/* The planner grid: shared by the sales-page demo and the members' app */
.week-grid {
  display: grid; grid-template-columns: repeat(7, minmax(134px, 1fr)); gap: 9px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px;
}
.day {
  scroll-snap-align: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  display: flex; flex-direction: column; min-height: 380px; overflow: hidden;
}
.day.is-today { border-color: var(--sage-2); box-shadow: 0 0 0 3px var(--sage-soft); }
.day-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 4px 6px; padding: 14px 12px 0; }
.day-name { font-family: var(--display); font-variation-settings: "wdth" 104; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.day-date { color: var(--muted); font-size: 0.85rem; }
.today-pill { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: var(--sage-soft); color: var(--sage-deep); padding: 4px 8px; border-radius: 999px; }
.day-ring { display: grid; place-items: center; padding: 14px 0 10px; }
.tasks-label { font-family: var(--display); font-variation-settings: "wdth" 78; font-weight: 700; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding: 8px 14px; border-top: 1px solid var(--line); background: var(--paper); }
.tasks { list-style: none; margin: 0; padding: 0; flex: 1; }
.task { display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px 7px 12px; border-bottom: 1px solid var(--paper-2); transition: background 0.25s; }
.task.done { background: var(--sage-mist); }
.task-text { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 0.93rem; line-height: 1.3; padding: 2px 0; color: var(--ink); resize: none; overflow: hidden; field-sizing: content; min-height: 0; display: block; }
.task .tick { margin-top: 0; }
.task-del { align-self: center; }
.task-text:focus { outline: none; box-shadow: 0 1.5px 0 var(--sage-2); }
.task.done .task-text { text-decoration: line-through; text-decoration-color: var(--sage-2); color: var(--muted); }
.task-del { border: 0; background: none; color: var(--line-2); font-size: 1.15rem; cursor: pointer; padding: 0 4px; opacity: 0; transition: opacity 0.2s; }
.task:hover .task-del, .task-del:focus { opacity: 1; }
.task-add { display: flex; border-top: 1px dashed var(--line); }
.task-new { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 14px; font: inherit; font-size: 0.92rem; }
.task-new:focus { outline: none; background: var(--sage-mist); }
.task-add button { border: 0; background: none; padding: 0 14px; font-size: 1.3rem; color: var(--sage-deep); cursor: pointer; }

/* This week summary */
.summary { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.summary-chart, .summary-ring { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.summary-title { margin-bottom: 12px; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; height: 150px; align-items: end; }
.bar-col { display: grid; grid-template-rows: 1fr auto; gap: 6px; height: 100%; text-align: center; font-size: 0.78rem; color: var(--muted); }
.bar-track { background: var(--paper); border-radius: 8px; position: relative; overflow: hidden; }
.bar-fill { position: absolute; inset: auto 0 0; background: var(--sage); border-radius: 8px 8px 0 0; transition: height 0.8s var(--ease); }
.bar-fill.full { background: var(--sage-2); }
.summary-ring { display: grid; justify-items: center; align-content: center; gap: 8px; text-align: center; }
.score { font-size: 0.98rem; color: var(--ink-2); }
.score b { font-size: 1.5rem; color: var(--ink); }
.small { font-size: 0.85rem; }

/* Habits */
.habits { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.habits th, .habits td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--paper-2); }
.habits thead th { font-family: var(--display); font-variation-settings: "wdth" 80; font-weight: 700; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); background: var(--paper); }
.habits thead th.is-today { color: var(--sage-deep); }
.habits tbody th { text-align: left; padding-left: 16px; min-width: 170px; }
.habits td .tick { margin: auto; }
.habit-name { border: 0; background: transparent; font: inherit; font-weight: 600; width: 100%; }
.habit-name:focus { outline: none; box-shadow: 0 1.5px 0 var(--sage-2); }
.habit-prog { min-width: 130px; display: flex; align-items: center; gap: 8px; }
.hbar { flex: 1; height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--sage-2); border-radius: 99px; transition: width 0.6s var(--ease); }
.habit-del { border: 0; background: none; color: var(--line-2); cursor: pointer; font-size: 1.1rem; }
.habit-del:hover { color: var(--clay); }
.habits .empty td { color: var(--muted); padding: 22px; }
.habit-add { display: flex; gap: 10px; margin-top: 12px; }
.habit-add .input { max-width: 340px; }

@media (max-width: 760px) {
  .week-grid { grid-template-columns: repeat(7, 82%); }
  .summary { grid-template-columns: 1fr; }
  .habits-wrap { overflow-x: auto; }
  .task-del { opacity: 1; }
}
