/* Tend · page composition: a fluid full-width frame, the Today hero, per-page grids, scrollbars and scale pickers.
   Loads after tend.css and platform.css so it can tune their defaults. The frame has no maximum width: the gutter
   grows gently with the viewport and every page distributes its content with auto-filling grids; only text-heavy
   surfaces (settings forms, the science page, the journal editor, onboarding) keep a reading width. */

/* ---------- scrollbars & native controls ---------- */
html { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 26%, transparent) transparent; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 26%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 24%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--ink) 40%, transparent); background-clip: padding-box; }
.scroll-x { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; scroll-snap-type: x proximity; }
.scroll-x::-webkit-scrollbar { display: none; }
.fade-x { mask-image: linear-gradient(90deg, transparent, #000 22px, #000 calc(100% - 22px), transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 22px, #000 calc(100% - 22px), transparent); }
input[type="date"], input[type="time"], input[type="number"], select, textarea { color-scheme: inherit; }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="time"]::-webkit-calendar-picker-indicator { opacity: .7; cursor: pointer; }
[data-mode="dark"] input[type="date"]::-webkit-calendar-picker-indicator, [data-mode="dark"] input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.85); }

/* ---------- the frame: full width, adaptive gutter ---------- */
.page { max-width: none; padding: 24px var(--gutter) 96px; }
.page.read { max-width: var(--maxw-read); margin: 0 auto; }
.topbar-in, .footer-in { max-width: none; }
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.page-intro .pi-l { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.page-intro .pi-t { font-weight: 800; font-size: 15px; }
.page-intro .pi-d { color: var(--ink-2); font-size: 14px; }
.lvl-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 700; box-shadow: var(--shadow); }
.lvl-chip:hover { text-decoration: none; border-color: var(--line-2); }
.lvl-chip b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-family: var(--serif); font-size: 15px; }
html[dir="rtl"] .lvl-chip { padding: 6px 6px 6px 12px; }
.banners { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 12px; margin-bottom: 18px; }
.banners:empty { display: none; }
.banners > .card { margin-bottom: 0 !important; }
.page-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.page-head h1 { font-size: clamp(28px, 1.6vw + 14px, 40px); }
.page-head .lede { max-width: 72ch; }
.grid > .card, .board > *, .today-grid > *, .ws > *, .garden-layout > *, .journal-layout > * { min-width: 0; }
.grid.auto-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.grid.auto-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.grid.auto-cards > .card, .grid.auto-wide > .card { height: 100%; }

@media (min-width: 1400px) {
  body { font-size: 16.5px; }
  html[lang="ar"] body { font-size: 17px; }
  .small { font-size: 13.5px; }
  .page-head .lede { font-size: 17px; }
  .card-pad { padding: 26px; }
  .grid { gap: 22px; }
  .board { grid-template-columns: minmax(0, 1fr) 420px; gap: 32px; }
  .hcard .hmeta, .trow .tm { font-size: 13.5px; }
  .kpi .kv { font-size: 38px; }
  .nav a { font-size: 15px; padding: 9px 14px; }
}
@media (min-width: 1800px) {
  .board { grid-template-columns: minmax(0, 1fr) 480px; gap: 36px; }
  .grid-3 { gap: 26px; }
}

/* ---------- Today: hero, strip, grid ---------- */
.today-hero { position: relative; display: grid; grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }
.today-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(900px 420px at 0% 0%, var(--accent-soft), transparent 62%); pointer-events: none; }
.th-copy { position: relative; padding: clamp(24px, 2.6vw, 44px); display: flex; flex-direction: column; gap: 18px; border-inline-end: 1px solid var(--line); }
.th-copy h1 { font-size: clamp(32px, 2.2vw + 12px, 56px); max-width: 14ch; }
.th-copy .lede { color: var(--ink-2); font-size: 16px; max-width: 42ch; margin: -6px 0 0; }
.th-progress { display: flex; align-items: center; gap: 18px; }
.th-counts .th-n { font-family: var(--serif); font-size: 38px; line-height: 1; } .th-counts .th-n span { color: var(--ink-3); font-size: 22px; }
.th-next { margin-top: 6px; color: var(--ink-2); }
.th-next b { color: var(--ink); }
.th-plan { padding: 14px 16px; border-radius: var(--r); background: color-mix(in srgb, var(--surface-2) 70%, transparent); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.th-plan .intention { font-size: 19px; }
.th-plan .next-task { display: flex; align-items: center; gap: 10px; }
.th-plan .next-task .tt { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-plan .pl { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
html[lang="ar"] .th-plan .pl { letter-spacing: 0; }
.th-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.th-main { position: relative; padding: clamp(18px, 2vw, 30px); min-width: 0; }
.hlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); gap: 8px 14px; align-items: start; }
.th-group { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; }
.th-group:not(:first-child) { margin-top: 14px; }
.th-group h2 { font-size: 17px; } .th-group .count { color: var(--ink-3); font-size: 13px; font-weight: 700; }
.hwrap { container-type: inline-size; min-width: 0; }
.th-main .hcard { box-shadow: none; padding: 14px 16px; border-radius: 16px; height: 100%; }
@container (max-width: 600px) {
  .hcard { grid-template-columns: auto minmax(0, 1fr); }
  .hcard .hactions { grid-column: 1 / -1; justify-content: flex-start; }
  .hcard .hactions .btn { flex: 1 1 auto; }
}
.th-main .plant h3 { font-size: 22px; margin-bottom: 4px; }
.th-main .plant p { color: var(--ink-2); max-width: 46ch; }
.th-main .plant .type-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.th-main .plant .type-card { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; padding: 14px 16px; }
.th-main .plant .type-card .ti { grid-row: 1 / 3; margin: 0; }
.th-main .plant .type-card b { margin: 0; }
.th-strip { grid-column: 1 / -1; display: flex; align-items: center; gap: 28px 36px; flex-wrap: wrap; padding: 14px clamp(20px, 2.2vw, 36px); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 55%, transparent); position: relative; }
.th-strip .st { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.th-strip .st .sv { font-family: var(--serif); font-size: 22px; color: var(--ink); line-height: 1; }
.th-strip .st .ic { color: var(--accent); }
.th-strip .st.week { margin-inline-start: auto; }
.th-strip .week-dots .dot { width: 14px; height: 14px; }
.dot.half { background: linear-gradient(90deg, var(--hc, var(--accent)) 50%, var(--surface-3) 50%); }
.th-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.th-eyebrow .ic { color: var(--accent); }
html[lang="ar"] .th-eyebrow { letter-spacing: 0; font-size: 12.5px; }
.th-copy h1 { font-size: clamp(34px, 2.3vw + 14px, 70px); line-height: 1.04; }
.th-meter { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.th-meter .mrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.th-meter .mn { font-family: var(--serif); font-size: 34px; line-height: 1; } .th-meter .mn span { color: var(--ink-3); font-size: 20px; }
.th-meter .bar { height: 8px; }
.th-start h2 { font-size: clamp(22px, .9vw + 14px, 32px); margin-top: 6px; }
.th-start .starter-grid { margin-top: 18px; }
.th-more { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.th-more h3 { font-size: 16px; }
.th-more .starter-grid { margin-top: 10px; }
@media (min-width: 1500px) { .today-hero { grid-template-columns: minmax(380px, 4fr) minmax(0, 8fr); } }

/* ---------- starters (habits, routines, goals) ---------- */
.starter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.starter .st-add { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.starter .st-add span { display: none; }
.starter-grid.compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 8px; }
.starter { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); cursor: pointer; text-align: start; color: inherit; transition: border-color var(--t), transform 160ms var(--ease), background var(--t); }
.starter:hover { border-color: color-mix(in srgb, var(--hc, var(--accent)) 50%, var(--line-2)); transform: translateY(-1px); }
.starter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.starter .st-name { font-weight: 800; font-size: 15px; line-height: 1.3; }
.starter .st-desc { font-size: 13px; color: var(--ink-2); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.starter .st-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--ink-3); margin-top: 7px; }
.starter .st-meta .chip { padding: 2px 8px; font-size: 11px; }
.starter .st-add { align-self: center; }
.starter .st-go { color: var(--ink-3); }
.starter.compact { padding: 10px 12px; gap: 10px; }
.starter.compact .st-meta { margin-top: 3px; }
.starter.compact .st-add span { display: none; }
.starter.compact .st-add { padding: 7px; }

/* ---------- Today board: full row, main column, side with masonry ---------- */
.tb { display: flex; flex-direction: column; gap: 22px; }
.tb-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
@media (min-width: 1000px) { .tb-cols { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } .tb-cols.single { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1500px) { .tb, .tb-cols { gap: 24px; } }
.tb-main, .tb-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.tb-main > *, .tb-side > *, .tb-full > * { margin: 0 !important; }
.tb-masonry { columns: 300px; column-gap: 22px; }
.tb-masonry > * { break-inside: avoid; margin: 0 0 22px !important; }
.tb-masonry > .card { display: block; }
.tb-masonry > :last-child { margin-bottom: 0 !important; }
.idea .idea-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.idea .idea-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); font-size: 24px; flex: none; }
.idea .idea-t { font-family: var(--serif); font-size: clamp(18px, .5vw + 14px, 23px); line-height: 1.25; }
.idea .idea-cite { font-size: 12px; color: var(--ink-3); margin-top: 4px; font-style: italic; }
.idea .idea-s { color: var(--ink-2); font-size: 14px; }

/* garden card: the tree beside its numbers */
.garden-wide { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); overflow: hidden; color: inherit; text-decoration: none !important; transition: border-color var(--t); }
.garden-wide:hover { border-color: var(--line-2); }
.garden-wide .gw-art svg { display: block; width: 100%; height: 100%; min-height: 240px; }
.garden-wide .gw-info { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; border-inline-start: 1px solid var(--line); }
.gw-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gw-legend div { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.gw-legend b { font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.1; }
.gw-legend span { font-size: 11.5px; color: var(--ink-3); font-weight: 700; }
@media (max-width: 640px) { .garden-wide { grid-template-columns: 1fr; } .garden-wide .gw-info { border-inline-start: 0; border-top: 1px solid var(--line); } }

/* the next seven days */
.agenda { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.ag-day { display: flex; flex-direction: column; gap: 8px; min-height: 196px; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--surface-2) 60%, transparent); border: 1px solid var(--line); min-width: 0; }
.ag-day.today { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: linear-gradient(180deg, var(--accent-soft), transparent 75%), var(--surface); }
.ag-h { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.ag-wd { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[lang="ar"] .ag-wd { letter-spacing: 0; font-size: 12.5px; }
.ag-day.weekend .ag-wd { color: var(--ink-3); }
.ag-dn { font-family: var(--serif); font-size: 26px; line-height: 1; }
.ag-day.today .ag-dn { color: var(--accent); }
.ag-habits { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-2); }
.ag-habits .ic { color: var(--good); flex: none; }
.ag-over { font-size: 12px; color: var(--bad); font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.ag-tasks { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.ag-task { display: flex; align-items: center; gap: 6px; text-align: start; font-size: 12.5px; padding: 5px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); width: 100%; min-width: 0; color: var(--ink); }
.ag-task:hover { border-color: var(--line-2); }
.ag-task i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: none; }
.ag-task.p4 i { background: var(--bad); } .ag-task.p3 i { background: var(--warn); } .ag-task.p2 i { background: var(--c-sky); }
.ag-task .tt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ag-task .tm { font-size: 11px; color: var(--ink-3); }
.ag-free { font-size: 12px; color: var(--ink-3); font-style: italic; }
.ag-more { font-size: 12px; }
.ag-foot { display: flex; align-items: center; justify-content: space-between; }
.ag-add { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-3); border: 1px dashed var(--line-2); }
.ag-add:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 1100px) {
  .agenda { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(160px, 1fr); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding-bottom: 2px; }
  .agenda::-webkit-scrollbar { display: none; }
  .ag-day { scroll-snap-align: start; min-height: 170px; }
}

/* habits page: list and library beside an overview */
.hp-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; align-items: start; }
@media (min-width: 1200px) { .hp-layout { grid-template-columns: minmax(0, 1fr) 360px; } .hp-side { position: sticky; top: 86px; } }
@media (min-width: 1700px) { .hp-layout { grid-template-columns: minmax(0, 1fr) 420px; gap: 32px; } }
.hp-main, .hp-side { min-width: 0; }
.hp-side { display: flex; flex-direction: column; gap: 18px; }
.lib-head h2 { font-size: clamp(22px, .8vw + 15px, 30px); margin: 4px 0 6px; }
.lib-head p { max-width: 70ch; }
.lib-group { margin-top: 22px; }
.lib-group h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 19px; }
.kind-ic { width: 36px; height: 36px; border-radius: 11px; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--tc) 16%, transparent); font-size: 18px; flex: none; }
.kind-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 0; align-items: start; }
.kind-row + .kind-row { border-top: 1px solid var(--line); }
.ov-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ov-stats div { padding: 12px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.ov-stats b { font-family: var(--serif); font-size: 26px; font-weight: 500; line-height: 1.1; }
.ov-stats span { font-size: 12px; color: var(--ink-3); font-weight: 700; }

/* goals: an intro beside ideas when nothing is set yet */
.goal-empty { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
@media (min-width: 1100px) { .goal-empty { grid-template-columns: minmax(320px, 1fr) minmax(0, 2fr); } }
.ge-intro .ei { font-size: 40px; margin-bottom: 6px; }
.ge-intro h2 { margin-bottom: 6px; }
.week-card .widget-head { flex-wrap: wrap; }
@media (max-width: 999px) {
  .today-hero { grid-template-columns: 1fr; }
  .th-copy { border-inline-end: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .th-copy { padding: 20px 18px 18px; gap: 14px; }
  .th-copy h1 { font-size: 30px; }
  .th-main { padding: 16px 14px; }
  .th-strip { gap: 14px 20px; padding: 12px 16px; }
  .th-strip .st.week { margin-inline-start: 0; width: 100%; }
  .page-intro { margin-bottom: 14px; }
  .tg-side { grid-template-columns: 1fr; }
}

/* ---------- scale pickers (mood, energy, rating) ---------- */
.mood-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; max-width: 420px; }
.mood-pick button { width: auto; height: 50px; padding: 0; border-radius: 12px; font-size: 24px; background: var(--surface-2); border: 2px solid transparent; display: grid; place-items: center; line-height: 1; transition: border-color 120ms, background 120ms, transform 120ms; min-width: 0; }
.mood-pick button:hover { transform: translateY(-1px); border-color: var(--line-2); }
.mood-pick button.on { border-color: var(--accent); background: var(--accent-soft); }
.mood-pick.energy button { grid-template-rows: auto auto; gap: 2px; font-size: 11px; font-weight: 800; color: var(--ink-3); }
.mood-pick.energy button .ic { color: var(--warn); opacity: calc(.3 + var(--lv, 1) * .14); }
.mood-pick.energy button.on { color: var(--ink); } .mood-pick.energy button.on .ic { opacity: 1; }
@media (max-width: 640px) { .mood-pick { max-width: none; } .mood-pick button { height: 46px; font-size: 22px; } }

/* ---------- strips without scrollbars ---------- */
.jstrip-wrap { position: relative; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; min-width: 0; max-width: 100%; }
.jstrip { flex: 1 1 0%; width: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 6px; margin: 0; scroll-behavior: smooth; }
.jstrip::-webkit-scrollbar { display: none; }
.jstrip-wrap .js-arrow { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; }
.jstrip-wrap .js-arrow:hover { color: var(--ink); border-color: var(--line-2); }
.jstrip button { scroll-snap-align: end; }
.ws-nav, .settings-nav, .seg { scrollbar-width: none; }
.ws-nav::-webkit-scrollbar, .settings-nav::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
.seg { max-width: 100%; overflow-x: auto; }
.seg button { white-space: nowrap; }
@media (max-width: 900px) { .ws-nav { mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-inline-end: 28px; } }
@media (max-width: 860px) { .settings-nav { mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-inline-end: 28px; } }
.heatmap, .kanban { scrollbar-width: thin; }
.heatmap { padding-bottom: 10px; }

/* ---------- tasks workspace: nav · list · context rail ---------- */
@media (min-width: 901px) { .ws { grid-template-columns: 250px minmax(0, 1fr); gap: 28px; } }
.ws-rail { display: none; }
@media (min-width: 1500px) {
  .ws { grid-template-columns: 270px minmax(0, 1fr) 360px; gap: 36px; }
  .ws-rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 86px; }
  .ws-nav .ws-tags { display: none; }
  .ws-nav a { font-size: 15px; padding: 9px 14px; }
}
@media (min-width: 1900px) { .ws { grid-template-columns: 290px minmax(0, 1fr) 420px; gap: 44px; } }
.ws-rail .rail-stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ws-rail .rail-stat b { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.ws-rail .rail-stat:first-of-type { border-top: 0; }
.ws-rail .tag.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- habits, goals, garden, journal, circle, habit detail ---------- */
.habit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 14px; align-items: stretch; }
.habit-grid .hcard { margin: 0 !important; height: 100%; }
.goal-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.goal-grid > .card { height: 100%; }
.garden-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; margin-bottom: 26px; }
@media (min-width: 1200px) { .garden-layout { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); } }
.garden-scene svg { max-height: 78vh; }
.garden-side { display: flex; flex-direction: column; gap: 18px; }
.journal-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
@media (min-width: 1000px) { .journal-layout { grid-template-columns: minmax(0, 1fr) 380px; } }
@media (min-width: 1500px) { .journal-layout { grid-template-columns: minmax(0, 1100px) minmax(380px, 1fr); gap: 36px; } }
.journal-layout .rail { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 999px) { .journal-layout .rail { position: static; } }
.stats-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 1400px) { .stats-kpis { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (max-width: 760px) { .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1700px) { .stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stats-4 { grid-template-columns: 1fr; } }
.cal-strip i { width: clamp(14px, 1vw, 20px); height: clamp(14px, 1vw, 20px); }
.ach-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.settings { max-width: none; }
.settings .section { max-width: 1120px; }
@media (min-width: 1500px) { .settings { grid-template-columns: 260px minmax(0, 1fr); gap: 44px; } }
.auth-story h1 { font-size: clamp(38px, 3vw + 14px, 76px); }
@media (min-width: 1500px) { .auth { grid-template-columns: 1.25fr minmax(520px, .75fr); } .auth-card { width: min(460px, 100%); } }
.onb-body { width: min(900px, 100%); }
.onb-body h1 { font-size: clamp(30px, 2.4vw + 12px, 48px); }
.opt-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.onb-nav .row { gap: 6px; }
.empty { padding: 32px 20px; }
.empty .ei { font-size: 40px; }
.card-title h3, .widget-head h3 { font-size: 18px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }

/* the hero shows six starters on wide screens, four elsewhere */
/* the starter library scrolls sideways (custom.css), so every starter stays reachable at every width */

/* ================= section fills (garden, goals, stats, circle, journal, progress, settings, science) ================= */

/* garden: the scene at its natural ratio, a tree summary and growth list beside it, unlock progress below */
.garden-scene svg { max-height: none; }
@media (min-width: 1200px) { .garden-layout { grid-template-columns: minmax(0, 1.6fr) minmax(340px, 1fr); } }
.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.lstep { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--ink-3); font-weight: 700; text-align: center; }
.lstep i { height: 6px; border-radius: 3px; background: var(--surface-3); }
.lstep.done i { background: color-mix(in srgb, var(--good) 60%, var(--surface-3)); }
.lstep.now i { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.lstep.now span { color: var(--ink); }
.gbar .bar { margin-top: 6px; }
.grow-list { display: flex; flex-direction: column; }
.grow-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.grow-row + .grow-row { border-top: 1px solid var(--line); }
.grow-row .gi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-size: 17px; flex: none; }
.grow-row .gv { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.unlock-next { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.next-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.next-item .ui, .unlock .ui { font-size: 24px; width: 32px; text-align: center; flex: none; }
.unlock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.unlock-grid .unlock { align-items: flex-start; height: 100%; }
.unlock .grow > span { display: block; }

/* goals */
.gp-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; align-items: start; }
@media (min-width: 1200px) { .gp-layout:not(.single) { grid-template-columns: minmax(0, 1fr) 380px; } .gp-side { position: sticky; top: 86px; } }
@media (min-width: 1700px) { .gp-layout:not(.single) { grid-template-columns: minmax(0, 1fr) 420px; gap: 32px; } }
.gp-layout.single .gp-side { display: none; }
.gp-main, .gp-side { min-width: 0; }
.gp-side { display: flex; flex-direction: column; gap: 18px; }
.goal-card { color: inherit; text-decoration: none !important; display: block; transition: border-color var(--t), transform 160ms var(--ease); }
.goal-card:hover { border-color: color-mix(in srgb, var(--hc) 45%, var(--line-2)); transform: translateY(-1px); }
.ms-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.ms-dots i { width: 22px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.ms-dots i.on { background: var(--hc, var(--accent)); }
.goal-empty { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
@media (min-width: 1100px) { .goal-empty { grid-template-columns: minmax(340px, 1fr) minmax(0, 1.6fr); } }
.ideas-rich { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.starter.goal.rich { align-items: flex-start; padding: 18px; }
.starter .st-target { font-size: 13px; color: var(--ink-2); margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.starter .st-ms { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: ms; display: flex; flex-direction: column; gap: 6px; }
.starter .st-ms li { counter-increment: ms; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.starter .st-ms li::before { content: counter(ms); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: color-mix(in srgb, var(--hc) 16%, transparent); color: var(--hc); flex: none; }
.ov-stats.ov-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* stats: a heatmap that scales with its card, with the year in numbers beside it */
.heat-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: center; }
@media (min-width: 1100px) { .heat-wrap { grid-template-columns: minmax(0, 1fr) 260px; } }
.heat-main { container-type: inline-size; min-width: 0; }
.heat-main .heatmap { --hm: clamp(10px, calc((100cqw - 160px) / 53), 24px); grid-template-rows: repeat(7, var(--hm)); grid-auto-columns: var(--hm); overflow-x: auto; }
.heat-main .heatmap i { width: var(--hm); height: var(--hm); border-radius: calc(var(--hm) / 4); }
.heat-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.heat-facts .eyebrow { grid-column: 1 / -1; }
.heat-facts > div:not(.eyebrow) { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.heat-facts b { font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.15; }
.heat-facts span { font-size: 11.5px; color: var(--ink-3); font-weight: 700; }

/* journal: the side column becomes a two-column grid when there is room */
.journal-layout .rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; align-content: start; }
.journal-layout .rail > .card { margin: 0; }
.prompt-chip { text-align: start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; font-size: 14px; color: var(--ink); line-height: 1.4; width: 100%; }
.prompt-chip:hover { border-color: var(--line-2); background: var(--surface-3); }
.recent-row { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: start; padding: 9px 0; color: inherit; }
.recent-row + .recent-row { border-top: 1px solid var(--line); }
.recent-row .rm { font-size: 20px; width: 26px; text-align: center; flex: none; }
.recent-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.recent-row .grow .small { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.recent-row:hover b { color: var(--accent); }

/* progress */
.prog-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 22px; align-items: stretch; }
.close-ach { display: flex; gap: 12px; align-items: flex-start; }
.close-ach .ai { font-size: 26px; width: 36px; text-align: center; flex: none; }
.ach-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.hist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); column-gap: 28px; }
.hist-grid .list-row + .list-row { border-top: 0; }
.hist-grid .list-row { border-bottom: 1px solid var(--line); }

/* settings: navigation, the form, and a summary of the current setup */
.settings-aside { display: none; }
@media (min-width: 1500px) {
  .settings { grid-template-columns: 250px minmax(0, 1fr) 360px; gap: 36px; }
  .settings-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 86px; }
  .settings .section { max-width: none; }
}
@media (min-width: 1900px) { .settings { grid-template-columns: 270px minmax(0, 1fr) 400px; gap: 44px; } }
.sum-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; }
.sum-row + .sum-row { border-top: 1px solid var(--line); }
.sum-me { background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); }

/* science: contents beside a grid of studies */
.sci-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; align-items: start; }
@media (min-width: 1100px) { .sci-layout { grid-template-columns: 300px minmax(0, 1fr); } .sci-toc { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow: auto; } }
.sci-toc { display: flex; flex-direction: column; gap: 2px; }
.sci-toc button { display: flex; gap: 10px; align-items: flex-start; text-align: start; padding: 7px 8px; border-radius: 9px; font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.sci-toc button:hover { background: var(--surface-2); color: var(--ink); }
.sci-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 18px; align-items: start; }
.sci-card .study { padding: 0; border: 0; scroll-margin-top: 90px; }
@media (max-width: 1099px) { .sci-toc { display: none; } }

.garden-left { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.garden-left .grow-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); column-gap: 22px; }
.garden-left .grow-row + .grow-row { border-top: 0; }
.garden-left .grow-row { border-bottom: 1px solid var(--line); }
.garden-side .unlock-next { grid-template-columns: 1fr; gap: 10px; }

/* headers never push the page wider than the screen: their controls shrink and wrap */
.page-head > *, .card-title > *, .widget-head > * { min-width: 0; max-width: 100%; }
.card-title, .widget-head { flex-wrap: wrap; }

/* goals: the next milestone on each card, and how progress builds as one wide row under both columns */
.goal-next { display: flex; align-items: center; gap: 6px; margin: 2px 0 8px; min-width: 0; }
.goal-next b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-next svg { color: var(--hc, var(--accent)); flex: none; }
.how-wide .how-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 4px 28px; }
.how-wide .kind-row + .kind-row { border-top: 0; }
@media (max-width: 760px) { .how-wide .kind-row + .kind-row { border-top: 1px solid var(--line); } }
/* stats: observations as a two-column list once there is room */
.obs-card .obs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 4px 32px; }
/* garden: the two collections stacked, column counts chosen so their rows come out full */
.garden-unlocks { display: grid; gap: 22px; }
@media (min-width: 900px) { .unlock-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .unlock-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* progress: the XP scoring table */
.xp-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.xp-rules > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.xp-rules b { color: var(--accent); font-weight: 700; white-space: nowrap; }
/* habit detail: the history grid fills its card, with a legend and a weekday breakdown; one card grid below */
.hd-cal .cal-strip { grid-template-columns: repeat(var(--wk, 12), minmax(0, 1fr)); grid-template-rows: repeat(7, auto); justify-items: center; }
.hd-cal .cal-strip i { width: 100%; height: auto; aspect-ratio: 1; max-width: 30px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--ink-3); }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -2px; background: var(--surface-3); }
.cal-legend i.on { background: var(--hc, var(--accent)); } .cal-legend i.off { background: var(--bad); opacity: .55; } .cal-legend i.rest { background: var(--warn); opacity: .55; } .cal-legend i.na { background: transparent; border: 1px dashed var(--line-2); }
.hd-cards { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: stretch; }
@media (min-width: 1100px) { .hd-cards > .span-2 { grid-column: span 2; } }
/* goals: remaining ideas share the full main-column width */
.gp-main .starter-grid.compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
/* four-up KPI tiles stay two-up on phones instead of a tall single column */
@media (max-width: 640px) { .grid.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- reminders, drafts and plans ---------- */
.notice.caution { align-items: center; border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.notice.caution .btn { flex: none; }
.notice.caution b { display: block; margin-bottom: 2px; }
.time-list { display: grid; gap: 10px; }
.tl-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; align-items: center; }
.tl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); font-size: 14px; }
.tl-chip .ic { color: var(--accent); }
.tl-chip button { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; }
.tl-chip button:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); }
.tl-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tl-add .input[type="time"] { width: auto; padding: 7px 10px; }
.tl-quick { border: 1px dashed var(--line-2); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.tl-quick:hover { border-color: var(--accent); color: var(--ink); }
.tl-quick.on { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.emoji-btn { width: 46px; height: 42px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 22px; cursor: pointer; }
.rem-sum { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); margin-top: 6px; }
.rem-row, .rem-idea { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.rem-row + .rem-row { margin-top: 8px; }
.rem-row.off { opacity: .55; }
.rem-emoji { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--surface-3); flex: none; }
.rem-acts { display: flex; align-items: center; gap: 4px; flex: none; }
.rem-acts [data-sw] { margin-inline-end: 6px; }
.rem-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.rem-idea { cursor: pointer; background: transparent; border-style: dashed; transition: border-color var(--t), background var(--t); }
.rem-idea:hover { border-color: var(--accent); background: var(--accent-soft); }
.hab-rem { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 16px; align-items: start; padding: 14px 0; }
.hab-rem + .hab-rem { border-top: 1px solid var(--line); }
.hr-who { display: flex; gap: 10px; align-items: center; }
@media (max-width: 640px) { .hab-rem { grid-template-columns: 1fr; gap: 10px; } .rem-row { flex-wrap: wrap; } .rem-acts { margin-inline-start: auto; } }
.rem-top { align-items: stretch; }
.rem-top > .section { height: 100%; margin: 0; }
.pause-state { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--good-soft); }
.pause-state.on { background: var(--warn-soft); }
.up-list { display: grid; gap: 2px; }
.up-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.up-row:last-child { border-bottom: 0; }
.up-row.paused { opacity: .5; }
.up-time { font-weight: 700; min-width: 54px; }
.up-day { min-width: 64px; }
.up-emoji { width: 22px; text-align: center; }
.up-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drafts { border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line-2)); border-radius: 18px; padding: 14px 16px; background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.drafts-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--ink); }
.drafts-list { display: grid; gap: 8px; }
.draft-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.dr-emoji { font-size: 22px; width: 36px; text-align: center; }
.modal-actions .draft-btn { margin-inline-end: auto; }
.plan-chips { flex-wrap: wrap; }
.plan-row.done .chip { flex: none; }
.plan-card .serif { line-height: 1.1; }
.toast-act { border: 0; background: color-mix(in srgb, var(--ink) 10%, transparent); color: inherit; font: inherit; font-size: 12.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; cursor: pointer; flex: none; }
.toast-act:hover { background: color-mix(in srgb, var(--ink) 18%, transparent); }
.notif .snz { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 10px; color: var(--ink-3); }
.notif .snz button { border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 1px 8px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.notif .snz button:hover { border-color: var(--accent); color: var(--ink); }
.th-strip .st-link { color: inherit; text-decoration: none; border-radius: 12px; transition: background var(--t); }
.th-strip .st-link:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }

/* ---------- the night sky ----------
   A lifted, warmer dark theme (deep dusk, not near-black), Lext-like depth from soft glows and lit card corners,
   and a moving star field on a canvas behind everything (public/js/sky.js). Tend's own colours throughout. */
:root {
  --star: 150, 112, 76; --star-warm: 200, 98, 60; --sparkle: 214, 128, 74;
  --glow-1: rgba(200, 98, 60, .075); --glow-2: rgba(90, 138, 101, .065); --glow-3: rgba(194, 146, 43, .05);
  --card-light: rgba(255, 255, 255, .55);
}
[data-mode="dark"] {
  --bg: #201b17; --surface: #2a241e; --surface-2: #332c25; --surface-3: #3d352d;
  --ink-2: #c2b8a9; --ink-3: #a99e90; /* ≥ 4.5:1 on every dark surface */
  --line: rgba(255, 238, 214, .085); --line-2: rgba(255, 238, 214, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 22px 48px -30px rgba(0, 0, 0, .65);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .32), 0 36px 80px -34px rgba(0, 0, 0, .75);
  --star: 255, 244, 228; --star-warm: 255, 200, 156; --sparkle: 255, 214, 168;
  --glow-1: rgba(227, 132, 92, .14); --glow-2: rgba(127, 181, 138, .085); --glow-3: rgba(224, 180, 87, .07);
  --card-light: rgba(255, 238, 214, .045);
}
[data-mode="dark"][data-accent="sage"] { --bg: #1b1f19; --surface: #242a22; --surface-2: #2c332a; --surface-3: #363e33; --glow-1: rgba(127, 181, 138, .13); --glow-2: rgba(227, 132, 92, .07); --sparkle: 210, 240, 205; }
[data-mode="dark"][data-accent="teal"] { --bg: #172022; --surface: #1f2a2c; --surface-2: #273436; --surface-3: #303e40; --glow-1: rgba(88, 179, 181, .13); --glow-2: rgba(224, 180, 87, .07); --sparkle: 200, 240, 238; }
[data-mode="dark"][data-accent="plum"] { --bg: #1e1923; --surface: #27212d; --surface-2: #302937; --surface-3: #3a3241; --glow-1: rgba(173, 140, 203, .14); --glow-2: rgba(224, 180, 87, .07); --sparkle: 228, 212, 250; }
[data-mode="dark"][data-accent="rose"] { --bg: #221a1d; --surface: #2c2226; --surface-2: #352a2f; --surface-3: #3f3338; --glow-1: rgba(226, 131, 160, .13); --glow-2: rgba(127, 181, 138, .07); --sparkle: 255, 214, 226; }
[data-mode="dark"][data-accent="honey"] { --bg: #201c15; --surface: #2a251c; --surface-2: #332d22; --surface-3: #3d362a; --glow-1: rgba(224, 180, 87, .14); --glow-2: rgba(88, 179, 181, .06); --sparkle: 255, 228, 170; }

body { background: radial-gradient(1200px 760px at 6% -12%, var(--glow-1), transparent 62%), radial-gradient(1000px 760px at 102% 108%, var(--glow-2), transparent 60%), radial-gradient(760px 520px at 94% -6%, var(--glow-3), transparent 60%), var(--bg); background-attachment: fixed; }
#sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
[data-sky="off"] #sky { display: none; }
#app { position: relative; z-index: 1; }
.topbar { background: color-mix(in srgb, var(--bg) 72%, transparent); }
.footer { background: transparent; }
/* cards catch a little light on their top corner, as in Lext; translucent enough that the sky reads through the gaps */
.card:not(.accent):not(.soft), .kpi:not(.accent), .hcard, .rem-row, .draft-row { background-image: radial-gradient(130% 90% at 0% 0%, var(--card-light), transparent 58%); }
[data-mode="dark"] .card, [data-mode="dark"] .kpi, [data-mode="dark"] .hcard { border-color: rgba(255, 238, 214, .07); box-shadow: inset 0 1px 0 rgba(255, 238, 214, .045), var(--shadow); }
[data-mode="dark"] .hero { background: radial-gradient(1200px 420px at 8% -20%, var(--accent-soft), transparent 60%), radial-gradient(800px 360px at 100% 120%, var(--glow-2), transparent 60%), var(--surface); }
.hd-left { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.hd-left > #growth { flex: 1 1 auto; }
.up-row .chip { white-space: nowrap; flex: none; font-size: 11px; }
.deliv .sum-row { padding: 7px 0; }
.deliv a { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; }
/* the settings tab row scrolls inside the screen on phones instead of widening the page */
@media (max-width: 860px) { .settings { grid-template-columns: minmax(0, 1fr); } .settings-nav { min-width: 0; max-width: 100%; } }
.up-list { grid-template-columns: minmax(0, 1fr); }
.up-row { min-width: 0; }
@media (max-width: 640px) { .up-day { min-width: 0; } .up-row { gap: 8px; } }
.switch-row > div:first-child { min-width: 0; flex: 1 1 auto; }
.switch-row .row { flex-wrap: wrap; }
@media (max-width: 640px) { .notice.caution { flex-wrap: wrap; } .notice.caution .grow { flex: 1 1 calc(100% - 30px); } .notice.caution .btn { margin-inline-start: 26px; } }
.up-title { display: flex; flex-direction: column; white-space: normal; }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-cond { font-size: 11.5px; color: var(--ink-3); }
#caution:not(:empty) { margin: 4px 0 18px; }

/* ---------- arranging Today (views/arrange.js) ---------- */
.modal.arrange-modal { width: min(1000px, 100%); }
.arrange { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 760px) { .arrange { grid-template-columns: minmax(0, 1fr); } }
.ar-map-wrap { position: sticky; top: 0; display: grid; gap: 10px; }
.ar-map-wrap p { margin: 0; }
.ar-maph { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ar-map { border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: var(--surface-2); display: grid; gap: 8px; }
.m-hero { height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--accent-soft), transparent 80%), var(--surface-3); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink-2); letter-spacing: .04em; }
.m-full, .m-main, .m-side { display: grid; gap: 6px; align-content: start; min-height: 32px; border: 1px dashed var(--line-2); border-radius: 10px; padding: 6px; }
.m-cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 8px; }
.m-slot { display: flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 11px; font-weight: 600; min-width: 0; white-space: nowrap; }
.m-slot span { overflow: hidden; text-overflow: ellipsis; }
.m-slot.hl { border-color: var(--accent); background: var(--accent-soft); }
.m-none { height: 18px; }
.ar-lists { display: grid; gap: 20px; min-width: 0; }
.ar-gh { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ar-list { display: grid; gap: 8px; }
.ar-tile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); position: relative; min-width: 0; }
.ar-handle { display: grid; place-items: center; width: 28px; height: 38px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-3); cursor: grab; touch-action: none; flex: none; }
.ar-handle:hover, .ar-handle:focus-visible { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.ar-handle.pinned { cursor: default; color: var(--accent); }
.ar-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; background: var(--surface-3); flex: none; }
.ar-txt { min-width: 0; flex: 1; display: grid; gap: 1px; }
.ar-txt .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-moves { display: flex; gap: 2px; flex: none; }
.ar-sw { flex: none; display: flex; }
.ar-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px; }
.ar-add { display: flex; align-items: center; gap: 10px; text-align: start; padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--line-2); background: transparent; color: var(--ink); font: inherit; cursor: pointer; min-width: 0; }
.ar-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.ar-add > .ic { margin-inline-start: auto; color: var(--accent); flex: none; }
.ar-empty { margin: 0; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.ic.flip-v { transform: rotate(180deg); }
@media (max-width: 640px) { .ar-txt .small { white-space: normal; } .ar-map-wrap { position: static; } .ar-tile { gap: 8px; padding: 8px 10px; } .ar-moves .icon-btn { width: 30px; height: 30px; } }

/* mid-width screens (a small laptop, a tablet held sideways): the top navigation keeps its icons and drops its labels */
@media (min-width: 761px) and (max-width: 1180px) { .nav a span { display: none; } .nav a { padding: 8px 10px; } .topbar-in { gap: 12px; } }

/* phones: standalone links and the small remove buttons are at least 24 px tall to tap (inline links in sentences are exempt) */
@media (max-width: 760px) {
  .subtle-link, .card-title > a, .widget-head > a, .card-title .btn-link, .page > .small > a, p.small > a:only-child, .btn-link.num, .lb-row .grow > a, .adm-arow .small a { display: inline-flex; align-items: center; min-height: 26px; }
  .tk-tag button { width: 24px; height: 24px; }
  a.small, .insight .why a, .insight .why button, .tk-why, .pod a, .card-title .small a { display: inline-flex; align-items: center; min-height: 26px; }
  .btn-link.num { min-width: 32px; justify-content: center; }
  .tk-check input { width: 20px; height: 20px; }
}
/* small phones: the top bar keeps every icon at full size by tightening the gaps instead of squeezing the buttons */
@media (max-width: 480px) { .topbar-in { gap: 6px; } .topbar .icon-btn, .topbar .avatar-btn, .topbar .brand { flex: none; } }
/* a one-line banner beside a taller card keeps its own height instead of stretching to match */
.banners > .banner { align-self: start; }
