/* Ritmo. One token set, two themes. Finish bar: margin analytics, Apple Fitness rings, Linear precision. */

:root {
  color-scheme: light;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --desk: #e1e2e7;
  --bg: #f1f1f3;
  --panel: #f8f8f9;
  --raised: #ffffff;
  --sunken: #e8e8eb;
  --hover: rgba(17, 18, 22, .05);
  --select: rgba(42, 85, 229, .1);

  --ink: #111216;
  --ink-2: #4b4e57;
  --ink-3: #676a73;
  --ink-4: #a3a5ac;
  --line: rgba(17, 18, 22, .075);
  --line-2: rgba(17, 18, 22, .13);
  --hatch: rgba(17, 18, 22, .15);

  --pill: #222327;
  --pill-ink: #ffffff;
  --primary: #111216;
  --primary-ink: #ffffff;
  --primary-hover: #2c2d33;

  --blue: #2a55e5;
  --magenta: #c81d63;
  --green: #16834a;
  --badge: #c24e08;

  --health: #e2456e;
  --career: #2a55e5;
  --growth: #1f9d59;
  --relationships: #ee8a1d;
  --health-deep: #c22a55;
  --career-deep: #2148cc;
  --growth-deep: #13804a;
  --relationships-deep: #b45e05;
  --focus: #6150d9;
  --journal: #1290b2;

  --ctl-shadow: 0 0 0 1px rgba(17, 18, 22, .06), 0 1px 2px rgba(17, 18, 22, .06);
  --pop-shadow: 0 0 0 1px rgba(17, 18, 22, .06), 0 20px 44px -18px rgba(17, 18, 22, .3), 0 4px 10px -4px rgba(17, 18, 22, .08);
  --panel-edge: inset 0 1px 0 rgba(255, 255, 255, .9);

  --r-panel: 20px;
  --r-ctl: 10px;
  --pad: 22px;
  --gap: 16px;
  --row: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --desk: #000000;
  --bg: #0b0b0d;
  --panel: #131316;
  --raised: #1d1d21;
  --sunken: #1d1d22;
  --hover: rgba(255, 255, 255, .055);
  --select: rgba(102, 136, 255, .16);

  --ink: #f3f3f5;
  --ink-2: #b4b6bd;
  --ink-3: #91949c;
  --ink-4: #5b5e66;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --hatch: rgba(255, 255, 255, .17);

  --pill: #f3f3f5;
  --pill-ink: #111216;
  --primary: #f3f3f5;
  --primary-ink: #111216;
  --primary-hover: #ffffff;

  --blue: #6688ff;
  --magenta: #ff5596;
  --green: #45d18a;
  --badge: #c24e08;

  --health: #ff5d86;
  --career: #6688ff;
  --growth: #45d18a;
  --relationships: #ffa53d;
  --health-deep: #c22a55;
  --career-deep: #2f57d9;
  --growth-deep: #13804a;
  --relationships-deep: #b45e05;
  --focus: #8c7eff;
  --journal: #3fc2e2;

  --ctl-shadow: 0 0 0 1px rgba(255, 255, 255, .075);
  --pop-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 28px 56px -18px rgba(0, 0, 0, .75);
  --panel-edge: inset 0 1px 0 rgba(255, 255, 255, .035);
}

:root[data-density="compact"] { --pad: 16px; --gap: 12px; --row: 8px; }

.p-health { --c: var(--health); --cd: var(--health-deep); }
.p-career { --c: var(--career); --cd: var(--career-deep); }
.p-growth { --c: var(--growth); --cd: var(--growth-deep); }
.p-relationships { --c: var(--relationships); --cd: var(--relationships-deep); }
.p-focus { --c: var(--focus); --cd: var(--focus); }
.p-journal { --c: var(--journal); --cd: var(--journal); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--desk); -webkit-text-size-adjust: 100%; scrollbar-color: var(--ink-4) transparent; }
body {
  margin: 0;
  font-family: var(--font);
  font-optical-sizing: auto;
  font-feature-settings: "cv05", "cv08";
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--desk);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--blue);
  accent-color: var(--blue);
}
::selection { background: color-mix(in srgb, var(--blue) 24%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 16%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }
[hidden] { display: none !important; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.skip { position: absolute; left: -9999px; top: 12px; z-index: 100; padding: 8px 12px; border-radius: 10px; background: var(--raised); box-shadow: var(--pop-shadow); }
.skip:focus { left: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-3)); flex: none; display: inline-block; }
kbd { font: 500 11.5px/1 var(--font); padding: 4px 6px; border-radius: 6px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }

.hatch, .gbar, .cap-bar, .fbar.past i, .ev.next, .sto-bar {
  --hc: var(--hatch);
  background-image: repeating-linear-gradient(-45deg, var(--hc) 0 1.4px, transparent 1.4px 6px);
}

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.is-rail .app { grid-template-columns: 76px minmax(0, 1fr); }
@media (min-width: 1360px) {
  body { padding: 14px; }
  .app { min-height: calc(100vh - 28px); border-radius: 28px; box-shadow: 0 0 0 1px var(--line), 0 40px 80px -48px rgba(17, 18, 22, .4); }
  .side { top: 14px !important; height: calc(100vh - 28px) !important; }
}

.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 14px 14px;
  overflow-y: auto; scrollbar-width: none;
}
.side::-webkit-scrollbar { display: none; }
.brand-row { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 4px 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 18px; font-weight: 500; letter-spacing: -0.02em; border-radius: 10px; }
.mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(165deg, #ff9b45 0%, #ef6612 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(200, 80, 10, .35); flex: none; }
.mark .i { width: 21px; height: 21px; stroke-width: 2.9; }
.search-btn {
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 6px 0 12px;
  border: 0; border-radius: 12px; background: var(--raised); box-shadow: var(--ctl-shadow);
  color: var(--ink-3); cursor: pointer; text-align: left; font-size: 14px;
}
.search-btn span { flex: 1; }
.search-btn:hover { color: var(--ink-2); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav-btn {
  position: relative;
  display: flex; align-items: center; gap: 11px; width: 100%; height: 36px; padding: 0 10px;
  border: 0; border-radius: 10px; background: none; cursor: pointer;
  color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 450; text-align: left; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav a:hover, .nav-btn:hover { background: var(--hover); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--pill); color: var(--pill-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 16px -10px rgba(0, 0, 0, .55); }
.nav a .dot { margin: 0 5px; }
.nav .count { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nav a[aria-current="page"] .count { color: inherit; opacity: .7; }
.nav-group { margin: 14px 10px 4px; font-size: 12.5px; color: var(--ink-3); }
.nav-pillars { display: flex; flex-direction: column; gap: 2px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.badge { margin-left: auto; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--badge); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.me:hover { background: var(--hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13.5px; color: #fff; background: linear-gradient(160deg, #3d5bd9, #1d2e7a); flex: none; }
.me-text { display: grid; line-height: 1.25; min-width: 0; }
.me-text b { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: var(--ink-3); font-size: 12.5px; }
.focus-pill {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 0; border-radius: 12px; cursor: pointer;
  background: color-mix(in srgb, var(--focus) 12%, var(--raised)); color: var(--ink); box-shadow: var(--ctl-shadow); font-size: 13.5px; font-weight: 500;
}
.focus-pill .i { color: var(--focus); width: 16px; height: 16px; }
.focus-pill b { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; }
.rail-btn .i { width: 17px; height: 17px; }

/* rail */
@media (min-width: 761px) {
  .is-rail .side { padding-inline: 14px; align-items: center; }
  .is-rail .brand-row { flex-direction: column; gap: 10px; padding: 2px 0 4px; }
  .is-rail .brand-name, .is-rail .nav span, .is-rail .nav-group, .is-rail .search-btn span, .is-rail .search-btn kbd,
  .is-rail .me-text, .is-rail .nav .count, .is-rail .focus-pill span { display: none; }
  .is-rail .nav-group { display: block; height: 1px; margin: 10px 8px; background: var(--line); font-size: 0; }
  .is-rail .nav a, .is-rail .nav-btn { width: 44px; justify-content: center; padding: 0; }
  .is-rail .nav a .dot { margin: 0; }
  .is-rail .search-btn { width: 44px; justify-content: center; padding: 0; }
  .is-rail .badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; font-size: 11.5px; padding: 0 4px; }
  .is-rail .focus-pill { width: 44px; justify-content: center; padding: 0; }
  .is-rail .focus-pill b { margin: 0; font-size: 0; }
  .is-rail .me { padding: 6px; }
  .is-rail .rail-btn { transform: scaleX(-1); }
}

.main { min-width: 0; display: flex; flex-direction: column; grid-column: 2; grid-row: 1; }
.topbar { display: none; }
.view { width: 100%; max-width: 1760px; margin: 0 auto; padding: 26px 32px 56px; container: view / inline-size; outline: none; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin: 2px 0 22px; }
.page-head h1 { margin: 0; font-size: 36px; line-height: 1.08; font-weight: 420; letter-spacing: -0.032em; }
.page-sub { margin: 7px 0 0; color: var(--ink-3); font-size: 14px; }
.page-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- grid + panels ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: stretch; }
.s-12 { grid-column: span 12; } .s-8 { grid-column: span 8; } .s-7 { grid-column: span 7; } .s-6 { grid-column: span 6; }
.s-5 { grid-column: span 5; } .s-4 { grid-column: span 4; } .s-3 { grid-column: span 3; }
@container view (max-width: 1020px) {
  .s-8, .s-7, .s-6, .s-5, .s-4 { grid-column: span 12; }
  .s-3 { grid-column: span 6; }
}
.stack { display: grid; gap: var(--gap); align-content: start; }

.panel { position: relative; min-width: 0; padding: var(--pad); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--panel-edge); }
.panel.flush { padding: 0; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 16.5px; line-height: 1.3; font-weight: 500; letter-spacing: -0.012em; }
.panel-head p { margin: 3px 0 0; color: var(--ink-3); font-size: 13.5px; }
.panel-head .tools { display: flex; align-items: center; gap: 6px; flex: none; }
.link-btn { display: inline-flex; align-items: center; gap: 3px; padding: 5px 6px 5px 9px; border: 0; border-radius: 10px; background: none; color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.link-btn .i { width: 15px; height: 15px; color: var(--ink-3); }
.link-btn:hover { background: var(--hover); }
.sub-h { margin: 22px 0 10px; font-size: 14px; font-weight: 500; }
.empty { display: grid; justify-items: center; gap: 10px; padding: 36px 16px; text-align: center; color: var(--ink-3); font-size: 14px; }
.empty b { color: var(--ink); font-weight: 500; font-size: 15px; }
.empty p { margin: 0; max-width: 40ch; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-ctl);
  background: var(--raised); color: var(--ink); box-shadow: var(--ctl-shadow);
  font-size: 13.5px; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .12s, opacity .15s;
}
.btn .i { width: 16px; height: 16px; }
.btn:hover { background: color-mix(in srgb, var(--raised) 93%, var(--ink)); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 16px -10px rgba(0, 0, 0, .55); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.danger { color: var(--magenta); }
.btn.danger-fill { background: var(--magenta); color: #fff; box-shadow: none; }
.btn.danger-fill:hover { background: color-mix(in srgb, var(--magenta) 88%, #000); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13.5px; border-radius: 10px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: default; transform: none; }
.icon-btn {
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none; cursor: pointer;
  background: var(--raised); color: var(--ink-2); box-shadow: var(--ctl-shadow);
  transition: background .15s, color .15s;
}
.icon-btn .i { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--raised) 93%, var(--ink)); }
.icon-btn.ghost { background: transparent; box-shadow: none; border-radius: 10px; }
.icon-btn.ghost:hover { background: var(--hover); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm .i { width: 15px; height: 15px; }
.icon-btn[disabled] { opacity: .35; cursor: default; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--sunken); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button, .seg label span {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg button .i { width: 15px; height: 15px; }
.seg button:hover, .seg label:hover span { color: var(--ink); }
.seg button[aria-pressed="true"], .seg input:checked + span { background: var(--raised); color: var(--ink); box-shadow: var(--ctl-shadow); }
.seg label { display: contents; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }
.seg-wide { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.seg-wide label span { justify-content: center; padding: 0 6px; }

.input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--raised); color: var(--ink); font-size: 14px; line-height: 1.4;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
.input:hover { border-color: color-mix(in srgb, var(--ink) 22%, transparent); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
textarea.input { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23838690' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 15px;
}
.select.compact { width: auto; height: 34px; font-size: 13.5px; border-radius: 10px; box-shadow: var(--ctl-shadow); border-color: transparent; }
.range { width: 100%; height: 22px; cursor: pointer; }
.search { position: relative; display: flex; align-items: center; }
.search .i { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 34px; }
.switch {
  position: relative; width: 38px; height: 22px; padding: 0; border: 0; border-radius: 12px; flex: none; cursor: pointer;
  background: color-mix(in srgb, var(--ink) 22%, transparent); transition: background .2s;
}
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .22s var(--ease); }
.switch[aria-checked="true"] { background: var(--blue); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.switch-row { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }

.fl { display: grid; gap: 6px; min-width: 0; border: 0; margin: 0; padding: 0; }
.fl > span, .fl > legend { font-size: 13.5px; font-weight: 500; color: var(--ink-2); padding: 0; margin-bottom: 6px; display: flex; justify-content: space-between; }
.fl > span { margin-bottom: 0; }
.fl output { color: var(--ink); font-variant-numeric: tabular-nums; }
.fl-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.fl-error { margin: -6px 0 0; font-size: 13.5px; color: var(--magenta); }
.check-row { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check-row input { width: 17px; height: 17px; margin: 0; }

.delta { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 8px; border-radius: 999px; background: var(--raised); box-shadow: var(--ctl-shadow); font-size: 12.5px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta svg { width: 8px; height: 8px; fill: currentColor; }
.delta.up svg { color: var(--green); }
.delta.down svg { color: var(--magenta); transform: rotate(180deg); }
.delta + .muted { font-size: 13.5px; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--raised); box-shadow: var(--ctl-shadow); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.status.behind::before { background: var(--magenta); }
.status.ahead::before { background: var(--blue); }
.status.done::before { background: var(--ink-3); }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag .dot { width: 7px; height: 7px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--raised); box-shadow: var(--ctl-shadow); color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--pill); color: var(--pill-ink); box-shadow: none; }

/* ---------- Today: week rings ---------- */
.week-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; align-items: center; }
.rings { display: block; width: 220px; height: 220px; }
.rings .ring { transition: opacity .2s; }
.rings[data-focus] .ring { opacity: .18; }
.rings[data-focus] .ring.on { opacity: 1; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.legend a { display: block; padding: 10px 12px; border-radius: 16px; text-decoration: none; color: inherit; transition: background .15s; }
.legend a:hover, .legend a:focus-visible { background: var(--hover); }
.lg-name { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.lg-val { margin-top: 8px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-3); }
.lg-val b { font-size: 32px; line-height: 1; font-weight: 400; letter-spacing: -0.035em; color: var(--c); font-variant-numeric: tabular-nums; }
.lg-val b small { font-size: 18px; color: var(--ink-4); letter-spacing: -0.02em; }
.week-note { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.week-note .i { width: 16px; height: 16px; color: var(--magenta); }
.week-note.good .i { color: var(--green); }

/* ---------- Today: insight ---------- */
.insight { display: flex; flex-direction: column; overflow: hidden; isolation: isolate; color: #fff; border: 0; background: #12204b; box-shadow: none; min-height: 100%; }
.insight::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(75% 62% at 102% 104%, rgba(255, 166, 112, .95) 0%, rgba(255, 166, 112, 0) 72%),
    radial-gradient(58% 52% at 64% 96%, rgba(250, 226, 186, .9) 0%, rgba(250, 226, 186, 0) 72%),
    radial-gradient(70% 66% at 14% 84%, rgba(92, 136, 222, .85) 0%, rgba(92, 136, 222, 0) 72%),
    linear-gradient(166deg, #0b1534 0%, #16295f 36%, #3a5eab 70%, #c79f86 100%);
}
.ins-art { position: absolute; right: -70px; bottom: -70px; width: 280px; height: 280px; z-index: -1; pointer-events: none; }
.ins-art circle { fill: none; stroke: rgba(255, 255, 255, .28); stroke-width: 1.2; }
.ins-art .fill { fill: rgba(255, 255, 255, .1); stroke: rgba(255, 255, 255, .4); }
.ins-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ins-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px 0 9px; border-radius: 999px; background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); font-size: 12.5px; font-weight: 500; }
.ins-chip .i { width: 15px; height: 15px; stroke-width: 2.6; }
.ins-nav { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: rgba(255, 255, 255, .85); font-variant-numeric: tabular-nums; }
.ins-nav button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ins-nav button:hover { background: rgba(255, 255, 255, .22); }
.ins-nav .i { width: 15px; height: 15px; }
.ins-num { display: flex; align-items: flex-end; gap: 12px; margin-top: 26px; }
.ins-num b { font-size: 60px; line-height: .92; font-weight: 400; letter-spacing: -0.045em; white-space: nowrap; }
.ins-num span { max-width: 15ch; padding-bottom: 4px; font-size: 13.5px; line-height: 1.3; color: rgba(255, 255, 255, .82); }
.insight h2 { margin: 18px 0 0; max-width: 24ch; font-size: 22px; line-height: 1.22; font-weight: 450; letter-spacing: -0.02em; }
.insight p { margin: 10px 0 0; max-width: 44ch; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, .86); }
.ins-foot { margin-top: auto; padding-top: 24px; display: flex; align-items: center; gap: 12px; }
.btn.on-dark { background: #fff; color: #111216; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5); }
.btn.on-dark:hover { background: #f1f1f3; }
.btn.on-dark[disabled] { opacity: .8; }
.ins-swap { animation: ins-in .45s var(--ease); }
@keyframes ins-in { from { opacity: .2; filter: blur(5px); transform: translateY(4px); } }

/* ---------- Today: timeline ---------- */
.tl-scroll { overflow-x: auto; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); scrollbar-width: thin; }
.tl { position: relative; min-width: 720px; display: grid; grid-template-columns: 76px minmax(0, 1fr); row-gap: 8px; }
.tl-name { align-self: center; font-size: 12.5px; color: var(--ink-3); }
.tl-track { position: relative; }
.tl-axis { height: 22px; }
.tl-axis span { position: absolute; top: 2px; transform: translateX(-50%); font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl-axis span:first-child { transform: none; }
.lane { height: 58px; border-radius: 12px; background-color: var(--sunken); background-image: linear-gradient(to right, var(--line-2) 1px, transparent 1px); background-size: calc(100% / 17) 100%; background-position: -1px 0; }
.lane.thin { height: 30px; }
.ev {
  position: absolute; top: 5px; bottom: 5px; min-width: 6px; padding: 0 9px; border: 0; border-radius: 10px;
  display: flex; flex-direction: column; justify-content: center; gap: 1px; overflow: hidden; text-align: left; cursor: pointer;
  font-size: 12.5px; font-weight: 500; line-height: 1.25; transition: filter .15s, transform .15s;
}
.ev span, .ev small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev small { font-weight: 400; font-variant-numeric: tabular-nums; opacity: .85; }
.ev.past, .ev.now { background: var(--cd); color: #fff; }
.ev.now { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent); }
.ev.next { --hc: color-mix(in srgb, var(--c) 32%, transparent); background-color: color-mix(in srgb, var(--c) 9%, var(--panel)); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 50%, transparent); }
.ev:hover { filter: brightness(1.06); transform: translateY(-1px); }
.sess { position: absolute; top: 6px; bottom: 6px; border-radius: 6px; background: var(--focus); }
.gap-label { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; pointer-events: none; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--blue); pointer-events: none; z-index: 2; border-radius: 2px; }
.tl-now b { position: absolute; top: -1px; left: 50%; transform: translateX(-50%); padding: 3px 7px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-legend { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--ink-3); }
.tl-legend i { display: inline-block; width: 18px; height: 10px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.tl-legend .k-done { background: var(--ink-2); }
.tl-legend .k-next { --hc: var(--hatch); background-color: var(--sunken); background-image: repeating-linear-gradient(-45deg, var(--hc) 0 1.4px, transparent 1.4px 5px); box-shadow: inset 0 0 0 1px var(--line-2); }
.tl-legend .k-focus { background: var(--focus); }

/* ---------- tasks ---------- */
.quick-add { display: flex; gap: 8px; margin-bottom: 6px; }
.quick-add .input { flex: 1; min-width: 0; }
.quick-add .select { width: auto; max-width: 42%; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: var(--row) 6px; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.check { width: 21px; height: 21px; padding: 0; border: 1.6px solid var(--ink-4); border-radius: 50%; background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.check:hover { border-color: var(--ink-2); }
.check:active { transform: scale(.9); }
.check .i { width: 12px; height: 12px; stroke-width: 3; }
.check[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.task-text { display: block; font-size: 14px; overflow-wrap: anywhere; }
.task.done .task-text { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.task-meta { display: flex; align-items: center; gap: 10px; margin-top: 3px; min-width: 0; }
.task-est { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.doing-chip { font-size: 12.5px; color: var(--focus); font-weight: 500; }
.row-act { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.task:hover .row-act, .task:focus-within .row-act, .mem:hover .row-act, .mem:focus-within .row-act,
.entry:hover .row-act, .entry:focus-within .row-act, tr:hover .row-act, tr:focus-within .row-act, .day-ev:hover .row-act, .day-ev:focus-within .row-act { opacity: 1; }
@media (hover: none) { .row-act { opacity: 1; } }

.capacity { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.cap-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-3); }
.cap-row b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.cap-bar { position: relative; height: 10px; margin-top: 9px; border-radius: 6px; background-color: var(--sunken); overflow: hidden; }
.cap-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--ink); transition: width .4s var(--ease); }
.cap-bar i.over { background: var(--magenta); border-radius: 0 6px 6px 0; }
.cap-bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--panel); }
.cap-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 0; font-size: 13.5px; color: var(--ink-2); }
.cap-note.warn > span { color: var(--magenta); }

/* ---------- focus ---------- */
.timer { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 2px 0 14px; }
.timer-num { font-size: 68px; line-height: .9; font-weight: 300; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.timer-state { font-size: 13.5px; color: var(--ink-3); padding-bottom: 6px; }
.timer-bar { height: 4px; border-radius: 2px; background: var(--sunken); overflow: hidden; }
.timer-bar i { display: block; height: 100%; width: 0; background: var(--focus); border-radius: 2px; transition: width .5s linear; }
.focus-controls { display: flex; gap: 8px; margin-top: 14px; }
.focus-controls .select { flex: 1; min-width: 0; }
.fweek { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; height: 132px; margin-top: 22px; padding-top: 18px; align-items: end; }
.fbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; height: 100%; }
.fbar i { position: relative; display: block; width: 100%; max-width: 30px; min-height: 3px; border-radius: 6px 6px 4px 4px; background-color: color-mix(in srgb, var(--focus) 16%, transparent); }
.fbar.past i { --hc: color-mix(in srgb, var(--focus) 55%, transparent); }
.fbar.today i { background: var(--focus); }
.fbar.future i { background: var(--sunken); }
.fbar span { font-size: 11.5px; line-height: 14px; color: var(--ink-3); }
.fbar.today span { color: var(--ink); font-weight: 600; }
.fbar em { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ftarget { position: absolute; left: 0; right: 0; border-top: 1.5px dashed color-mix(in srgb, var(--ink) 45%, transparent); pointer-events: none; }
.ftarget span { position: absolute; right: 0; bottom: 3px; font-size: 11.5px; color: var(--ink-2); background: var(--panel); padding-left: 6px; }

/* ---------- goals ---------- */
.glist { list-style: none; margin: 0; padding: 0; }
.grow-btn {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(110px, 1fr) 48px 112px; align-items: center; gap: 16px;
  width: 100%; padding: var(--row) 10px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: inherit; text-decoration: none; border-radius: 0;
  transition: background .12s;
}
.glist li:first-child .grow-btn { border-top: 0; }
.grow-btn:hover { background: var(--hover); }
.grow-btn[aria-current="true"] { background: var(--raised); box-shadow: var(--ctl-shadow); border-radius: 12px; border-top-color: transparent; }
.glist li:has(.grow-btn[aria-current="true"]) + li .grow-btn { border-top-color: transparent; }
.g-name { display: grid; gap: 3px; min-width: 0; }
.g-name b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-name small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.gbar { position: relative; height: 8px; border-radius: 4px; background-color: var(--sunken); }
.gbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--c); }
.gbar b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--ink); }
.gbar.lg { height: 12px; border-radius: 6px; }
.gbar.lg i { border-radius: 6px; }
.gbar.lg b { top: -6px; bottom: -6px; }
.g-pct { font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.g-status { justify-self: end; }
.glist-head { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(110px, 1fr) 48px 112px; gap: 16px; padding: 0 10px 10px; font-size: 12.5px; color: var(--ink-3); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.glist-head span:nth-child(3) { text-align: right; }
.glist-head span:nth-child(4) { text-align: right; }
@container view (max-width: 560px) {
  .grow-btn, .glist-head { grid-template-columns: minmax(0, 1fr) 56px; }
  .grow-btn .gbar, .grow-btn .g-status, .glist-head span:nth-child(2), .glist-head span:nth-child(4) { display: none; }
}

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 18px 22px 20px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat small { display: block; font-size: 13.5px; color: var(--ink-3); }
.stat b { display: block; margin-top: 8px; font-size: 32px; line-height: 1.05; font-weight: 400; letter-spacing: -0.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b.warn { color: var(--magenta); }
.stat span { display: block; margin-top: 6px; font-size: 13.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container view (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

.gd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gd-head h2 { margin: 8px 0 0; font-size: 22px; line-height: 1.2; font-weight: 450; letter-spacing: -0.02em; }
.gd-head p { margin: 5px 0 0; font-size: 13.5px; color: var(--ink-3); }
.big-num { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.big-num b { font-size: 60px; line-height: .95; font-weight: 400; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.gd-bar { margin-top: 20px; }
.gd-bar-legend { display: flex; justify-content: space-between; margin-top: 9px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart { position: relative; margin-top: 6px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-l { stroke: var(--line-2); stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font-size: 11.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .target-l { stroke: color-mix(in srgb, var(--ink) 55%, transparent); stroke-dasharray: 4 4; stroke-width: 1.2; }
.chart .target-t { fill: var(--ink); font-size: 12.5px; font-weight: 500; font-family: var(--font); }
.chart .plan { fill: none; stroke: color-mix(in srgb, var(--ink) 40%, transparent); stroke-width: 1.6; stroke-dasharray: 5 5; }
.chart .line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { stroke: var(--panel); stroke-width: 2.5; }
.chart .cursor { stroke: color-mix(in srgb, var(--ink) 30%, transparent); stroke-width: 1; }
.chart-tip { position: absolute; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: var(--raised); box-shadow: var(--pop-shadow); font-size: 12.5px; white-space: nowrap; pointer-events: none; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.chart-tip b { font-weight: 600; }
.chart-tip span { color: var(--ink-3); padding-left: 8px; border-left: 1px solid var(--line-2); }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.chart-legend i { display: inline-block; width: 16px; height: 0; margin-right: 6px; vertical-align: 3px; border-top: 2.4px solid var(--c); }
.chart-legend i.dash { border-top: 1.6px dashed color-mix(in srgb, var(--ink) 45%, transparent); }

.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; overflow-x: auto; padding-bottom: 2px; }
.heat i { width: 12px; height: 12px; border-radius: 4px; background: var(--sunken); }
.heat i[data-l="1"] { background: color-mix(in srgb, var(--c) 28%, var(--sunken)); }
.heat i[data-l="2"] { background: color-mix(in srgb, var(--c) 55%, var(--sunken)); }
.heat i[data-l="3"] { background: var(--c); }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.heat-legend i { width: 10px; height: 10px; border-radius: 2px; }
.heat-legend span:first-child { margin-right: 4px; }
.heat-legend span:last-child { margin-left: 4px; }
.prog-form { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.prog-form output { width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.linked { list-style: none; margin: 0; padding: 0; }
.linked li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.linked li:first-child { border-top: 0; }
.linked .check { width: 18px; height: 18px; }
.linked .check .i { width: 10px; height: 10px; }
.linked li.done span { color: var(--ink-3); text-decoration: line-through; }
.gd-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- close the day / journal ---------- */
.moods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 12px; background: var(--sunken); }
.moods button { display: grid; justify-items: center; gap: 5px; height: 54px; align-content: center; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.moods button i { width: 22px; height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--journal) var(--m), var(--sunken)); }
.moods button:hover { color: var(--ink); }
.moods button[aria-pressed="true"] { background: var(--raised); color: var(--ink); box-shadow: var(--ctl-shadow); }
.compose { display: grid; gap: 12px; }
.compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.compose-foot .select { width: auto; max-width: 100%; }
.prompt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--journal) 9%, var(--raised)); box-shadow: var(--ctl-shadow); font-size: 14px; }
.prompt q { quotes: '\201C' '\201D'; }
.saved { display: grid; gap: 10px; }
.saved blockquote { margin: 0; font-size: 15px; line-height: 1.55; }
.streak { font-size: 13.5px; color: var(--ink-3); }
.streak b { color: var(--ink); font-weight: 500; }

.entry { display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; gap: 16px; padding: 18px 4px; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; }
.entry time { font-size: 12.5px; color: var(--ink-3); line-height: 1.3; }
.entry time b { display: block; font-size: 22px; font-weight: 400; letter-spacing: -0.03em; color: var(--ink); }
.entry p { margin: 6px 0 0; font-size: 15px; line-height: 1.6; max-width: 64ch; }
.entry-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mood-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; }
.mood-tag i { width: 16px; height: 6px; border-radius: 4px; background: color-mix(in srgb, var(--journal) var(--m), var(--sunken)); }
.mood-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; border-top: 1px solid var(--line); }
.mood-stats div { padding: 14px 0 0; }
.mood-stats small { display: block; font-size: 12.5px; color: var(--ink-3); }
.mood-stats b { display: block; margin-top: 5px; font-size: 22px; font-weight: 400; letter-spacing: -0.02em; }
.goal-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.goal-bars li { display: grid; grid-template-columns: minmax(0, 1fr) 28px; gap: 6px 10px; align-items: center; font-size: 13.5px; }
.goal-bars li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-bars li b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.goal-bars li i { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--c); }

/* ---------- assistant ---------- */
.chat { display: grid; grid-template-columns: 236px minmax(0, 1fr) 272px; height: calc(100vh - 148px); min-height: 560px; padding: 0; overflow: hidden; }
@media (min-width: 1360px) { .chat { height: calc(100vh - 176px); } }
.threads { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; border-right: 1px solid var(--line); overflow-y: auto; }
.threads h2, .ctx h2 { margin: 4px 8px 10px; font-size: 13.5px; font-weight: 500; color: var(--ink-3); }
.thread { display: grid; gap: 2px; width: 100%; padding: 10px 10px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; color: var(--ink); }
.thread:hover { background: var(--hover); }
.thread[aria-current="true"] { background: var(--raised); box-shadow: var(--ctl-shadow); }
.thread b { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread small { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.log { flex: 1; overflow-y: auto; padding: 26px 30px 12px; display: flex; flex-direction: column; gap: 22px; scroll-behavior: smooth; }
.msg { max-width: 640px; }
.msg.user { align-self: flex-end; max-width: min(78%, 520px); padding: 10px 15px; border-radius: 20px 20px 6px 20px; background: var(--primary); color: var(--primary-ink); font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.ai { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; align-self: flex-start; width: 100%; }
.msg.ai .mark { width: 30px; height: 30px; border-radius: 10px; }
.msg.ai .mark .i { width: 19px; height: 19px; }
.bubble { padding-top: 4px; font-size: 15px; line-height: 1.6; }
.bubble p { margin: 0; }
.plan-list { list-style: none; margin: 12px 0 0; padding: 4px 0; border-radius: 16px; background: var(--raised); box-shadow: var(--ctl-shadow); }
.plan-list li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.plan-list li:first-child { border-top: 0; }
.plan-list time { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.msg-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.mem-used { margin-top: 10px; }
.mem-used summary { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 6px; margin-left: -6px; border-radius: 8px; font-size: 12.5px; color: var(--ink-3); cursor: pointer; list-style: none; }
.mem-used summary::-webkit-details-marker { display: none; }
.mem-used summary:hover { background: var(--hover); color: var(--ink-2); }
.mem-used summary .i { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.mem-used[open] summary .chev { transform: rotate(180deg); }
.mem-used ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.mem-used li { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; color: var(--ink-2); }
.mem-used li span { font-size: 12.5px; color: var(--ink-3); flex: none; width: 92px; }
.typing { display: inline-flex; gap: 4px; padding: 12px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: typing 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-2px); } }
.composer { padding: 10px 22px 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; padding: 2px; }
.compose-box { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 20px; background: var(--raised); box-shadow: var(--ctl-shadow); transition: box-shadow .15s; }
.compose-box:focus-within { box-shadow: 0 0 0 1px var(--blue), 0 0 0 4px color-mix(in srgb, var(--blue) 15%, transparent); }
.compose-box textarea { flex: 1; min-width: 0; max-height: 160px; padding: 7px 0; border: 0; outline: none; resize: none; background: transparent; font-size: 15px; line-height: 1.5; }
.send { width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); cursor: pointer; flex: none; transition: opacity .15s; }
.send .i { width: 17px; height: 17px; stroke-width: 2.2; }
.send[disabled] { opacity: .3; cursor: default; }
.compose-note { margin: 8px 4px 0; font-size: 12.5px; color: var(--ink-3); }
.ctx { padding: 14px 16px; border-left: 1px solid var(--line); overflow-y: auto; }
.ctx-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ctx-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 2px; }
.ctx-list li { padding: 9px 8px; border-radius: 10px; font-size: 13.5px; color: var(--ink-3); }
.ctx-list li.used { color: var(--ink); background: var(--raised); box-shadow: var(--ctl-shadow); }
.ctx-list li small { display: block; margin-bottom: 3px; font-size: 12.5px; color: var(--ink-3); }
.ctx-paused { margin: 12px 8px; font-size: 13.5px; color: var(--ink-3); }
.thread-select { display: none; padding: 12px 16px 0; }
@container view (max-width: 1080px) {
  .chat { grid-template-columns: 220px minmax(0, 1fr); }
  .ctx { display: none; }
}
@container view (max-width: 700px) {
  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 230px); min-height: 480px; }
  .threads { display: none; }
  .thread-select { display: block; }
  .log { padding: 18px 16px 8px; }
  .composer { padding: 8px 12px 14px; }
}

/* ---------- calendar ---------- */
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow span { padding: 0 10px 10px; font-size: 12.5px; color: var(--ink-3); }
.cal-day {
  min-height: 112px; display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 10px; min-width: 0;
  border: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: var(--ink);
  transition: background .12s;
}
.cal-day:nth-child(7n + 1) { border-left: 0; }
.cal-day:hover { background: var(--hover); }
.cal-day.out { color: var(--ink-4); }
.cal-n { display: grid; place-items: center; width: 27px; height: 27px; margin-bottom: 2px; border-radius: 50%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cal-day.today .cal-n { background: var(--blue); color: #fff; font-weight: 600; }
.cal-day[aria-pressed="true"] { background: var(--raised); box-shadow: inset 0 0 0 1.5px var(--ink); border-radius: 12px; border-color: transparent; }
.cal-day[aria-pressed="true"] + .cal-day { border-left-color: transparent; }
.cal-ev { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--ink-2); }
.cal-ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev .dot { width: 6px; height: 6px; }
.cal-more { font-size: 12.5px; color: var(--ink-3); padding-left: 12px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
@container view (max-width: 640px) {
  .cal-day { min-height: 64px; padding: 6px 4px; align-items: center; }
  .cal-ev, .cal-more { display: none; }
  .cal-dots { display: flex; justify-content: center; }
  .cal-dots .dot { width: 5px; height: 5px; }
  .cal-dow span { padding: 0 0 8px; text-align: center; }
}
.day-list { list-style: none; margin: 0; padding: 0; }
.day-ev { display: grid; grid-template-columns: 58px 8px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 2px; border-top: 1px solid var(--line); }
.day-ev:first-child { border-top: 0; }
.day-ev time { font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; line-height: 1.3; }
.day-ev b { display: block; font-weight: 500; font-size: 14px; }
.day-ev small { font-size: 12.5px; color: var(--ink-3); }
.day-ev .dot { align-self: center; }
.add-ev { display: grid; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.add-ev .fl-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- tasks board ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
@container view (max-width: 820px) { .board { grid-template-columns: minmax(0, 1fr); } }
.col { min-height: 260px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--panel-edge); transition: box-shadow .15s, background .15s; }
.col.drop { box-shadow: inset 0 0 0 2px var(--blue); background: color-mix(in srgb, var(--blue) 4%, var(--panel)); }
.col-head { display: flex; align-items: center; gap: 9px; padding: 2px 4px 12px; font-size: 14px; font-weight: 500; }
.col-head .n { color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.col-head svg { width: 16px; height: 16px; }
.kcard { position: relative; padding: 13px 14px 12px; margin-bottom: 8px; border-radius: 16px; background: var(--raised); box-shadow: var(--ctl-shadow); cursor: grab; transition: box-shadow .15s, transform .15s, opacity .15s; }
.kcard:hover { box-shadow: 0 0 0 1px var(--line-2), 0 6px 16px -10px rgba(0, 0, 0, .25); }
.kcard.dragging { opacity: .45; }
.kcard p { margin: 0 0 10px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.kcard.is-done p { color: var(--ink-3); text-decoration: line-through; }
.kfoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.kfoot .tag { flex: 1; min-width: 0; }
.kfoot .task-est { flex: none; }
.kmove { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--raised); box-shadow: var(--ctl-shadow); opacity: 0; transition: opacity .15s; }
.kcard:hover .kmove, .kcard:focus-within .kmove { opacity: 1; }
@media (hover: none) { .kmove { position: static; opacity: 1; box-shadow: none; padding: 0; margin-top: 8px; justify-content: flex-end; } }
.k-today { font-size: 12.5px; color: var(--blue); font-weight: 500; flex: none; }
.col-add { display: flex; gap: 6px; margin-bottom: 10px; }
.col-add .input { height: 36px; }
.col-empty { padding: 26px 10px; text-align: center; font-size: 13.5px; color: var(--ink-3); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); }
.tlist-group h3 { display: flex; align-items: center; gap: 9px; margin: 0; padding: 18px 6px 8px; font-size: 14px; font-weight: 500; border-bottom: 1px solid var(--line); }
.tlist-group:first-child h3 { padding-top: 0; }
.tlist-group h3 .n { color: var(--ink-3); font-weight: 400; }
.tlist-group h3 svg { width: 16px; height: 16px; }

/* ---------- memory ---------- */
.mem-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.mem-filters .search { flex: 1 1 240px; }
.mem { display: grid; grid-template-columns: 130px minmax(0, 1fr) 96px auto; gap: 16px; align-items: center; padding: 15px 10px; border-top: 1px solid var(--line); }
.mem:first-child { border-top: 0; }
.mem p { margin: 0; font-size: 15px; }
.mem small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink-3); }
.mem .uses { font-size: 12.5px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.mem .input { height: 34px; }
@container view (max-width: 640px) {
  .mem { grid-template-columns: minmax(0, 1fr) auto; }
  .mem .tag, .mem .uses { display: none; }
}
.banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: var(--gap); border-radius: 16px; background: color-mix(in srgb, var(--relationships) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--relationships) 30%, transparent); font-size: 14px; }
.banner .i { color: var(--relationships-deep); }
.banner > div { display: flex; align-items: center; gap: 10px; }

/* ---------- files ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { padding: 0 12px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 450; color: var(--ink-3); text-align: left; white-space: nowrap; }
.table th button { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px; margin: -3px -4px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; cursor: pointer; }
.table th button:hover { color: var(--ink); }
.table th button .i { width: 13px; height: 13px; opacity: .5; }
.table th[aria-sort] button { color: var(--ink); }
.table th[aria-sort] button .i { opacity: 1; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.fname { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.ficon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--raised)); }
.ficon .i { width: 17px; height: 17px; }
.storage { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: center; }
.storage b { font-size: 26px; font-weight: 400; letter-spacing: -0.03em; }
.storage b small { font-size: 14px; color: var(--ink-3); letter-spacing: 0; }
.sto-bar { grid-column: 1 / -1; position: relative; display: flex; height: 10px; border-radius: 6px; overflow: hidden; background-color: var(--sunken); }
.sto-bar i { height: 100%; background: var(--c); }
.sto-legend { grid-column: 1 / -1; display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }

/* ---------- settings / help ---------- */
.settings { display: grid; gap: var(--gap); max-width: 860px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); }
.panel-head + .set-row { border-top: 0; padding-top: 4px; }
.set-row > div:first-child { min-width: 0; }
.set-row b { display: block; font-size: 14px; font-weight: 500; }
.set-row small { display: block; margin-top: 2px; font-size: 13.5px; color: var(--ink-3); }
.set-row .input { width: 260px; max-width: 100%; }
@container view (max-width: 560px) {
  .set-row { flex-wrap: wrap; }
  .set-row .input { width: 100%; }
}
.faq details { border-top: 1px solid var(--line); }
.faq details:first-child { border-top: 0; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 4px; border-radius: 10px; font-size: 15px; font-weight: 500; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { width: 16px; height: 16px; color: var(--ink-3); transition: transform .2s var(--ease); }
.faq details[open] summary .i { transform: rotate(180deg); }
.faq details p { margin: -4px 4px 18px; max-width: 66ch; color: var(--ink-2); line-height: 1.6; }
.keys { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.keys td { padding: 11px 0; border-top: 1px solid var(--line); }
.keys tr:first-child td { border-top: 0; }
.keys td:last-child { text-align: right; }
.keys kbd + kbd { margin-left: 4px; }
.about { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.about p { margin: 0 0 10px; }

/* ---------- overlays ---------- */
.dlg, .palette { padding: 0; border: 0; color: var(--ink); background: var(--panel); box-shadow: var(--pop-shadow); }
.dlg { width: min(500px, calc(100vw - 32px)); border-radius: 20px; }
.dlg-sm { width: min(400px, calc(100vw - 32px)); }
.dlg::backdrop, .palette::backdrop { background: rgba(14, 15, 19, .32); }
:root[data-theme="dark"] .dlg::backdrop, :root[data-theme="dark"] .palette::backdrop { background: rgba(0, 0, 0, .6); }
.dlg[open], .palette[open] { animation: dlg-in .24s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.dlg-body { display: grid; gap: 16px; padding: 22px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: -2px; }
.dlg h2 { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.015em; }
.dlg p { margin: 0; color: var(--ink-2); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.palette { width: min(620px, calc(100vw - 24px)); margin-top: 12vh; border-radius: 20px; overflow: hidden; }
.pal-input { display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 16px 0 18px; border-bottom: 1px solid var(--line); }
.pal-input .i { color: var(--ink-3); }
.pal-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 16.5px; }
.pal-list { list-style: none; margin: 0; padding: 6px 8px 10px; max-height: min(420px, 60vh); overflow-y: auto; }
.pal-group { padding: 12px 10px 5px; font-size: 12.5px; color: var(--ink-3); }
.pal-item { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px; border-radius: 10px; font-size: 14px; cursor: pointer; }
.pal-item .i { width: 17px; height: 17px; color: var(--ink-3); }
.pal-item .dot { margin: 0 5px; }
.pal-item kbd { margin-left: auto; }
.pal-item[aria-selected="true"] { background: var(--hover); }
:root[data-theme="light"] .pal-item[aria-selected="true"] { background: #ebebee; }
.pal-empty { padding: 28px 12px; text-align: center; color: var(--ink-3); font-size: 14px; }

.notif-pop { position: fixed; z-index: 70; width: 360px; max-width: calc(100vw - 24px); padding: 8px; border-radius: 20px; background: var(--panel); box-shadow: var(--pop-shadow); animation: dlg-in .22s var(--ease); }
.notif-pop h2 { display: flex; justify-content: space-between; align-items: center; margin: 6px 8px 8px; font-size: 14px; font-weight: 500; }
.notif { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 12px; text-decoration: none; color: inherit; }
.notif:hover { background: var(--hover); }
.notif .ni { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--raised)); }
.notif .ni .i { width: 16px; height: 16px; }
.notif b { display: block; font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.notif small { font-size: 12.5px; color: var(--ink-3); }
.notif-empty { padding: 22px 12px 26px; text-align: center; font-size: 13.5px; color: var(--ink-3); }
.t-magenta { --c: var(--magenta); }

.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 90; display: grid; gap: 8px; justify-items: center; transform: translateX(-50%); pointer-events: none; width: max-content; max-width: calc(100vw - 24px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 14px; border-radius: 999px; background: #17181c; color: #fff; box-shadow: 0 16px 32px -14px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06); font-size: 13.5px; animation: toast-in .32s var(--ease); }
.toast.solo { padding-right: 16px; }
.toast .i { width: 16px; height: 16px; color: #7ee0a6; }
.toast button { height: 28px; padding: 0 12px; border: 0; border-radius: 999px; background: #fff; color: #111216; font-size: 13.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.toast button .i { color: #111216; width: 14px; height: 14px; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
:root[data-theme="dark"] .toast { background: #2a2b31; }

.scrim { position: fixed; inset: 0; z-index: 39; background: rgba(14, 15, 19, .32); }

/* ---------- responsive shell ---------- */
@media (max-width: 760px) {
  .app, .is-rail .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 40; width: 282px; height: 100%; background: var(--bg); transform: translateX(-104%); transition: transform .3s var(--ease); box-shadow: var(--pop-shadow); }
  .app.drawer .side { transform: none; }
  .rail-btn { display: none; }
  .topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 58px; padding: 0 12px; background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); border-bottom: 1px solid var(--line); }
  .topbar .brand { font-size: 18px; }
  .topbar .mark { width: 28px; height: 28px; }
  .view { padding: 20px 16px 110px; }
  .page-head { margin-bottom: 18px; }
  .page-head h1 { font-size: 32px; }
  .notif-pop { left: 12px !important; right: 12px; bottom: 90px !important; top: auto !important; width: auto; }
}
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: 64px; padding: 6px; border-radius: 20px; background: color-mix(in srgb, var(--panel) 90%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px); box-shadow: var(--pop-shadow); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 16px; background: none; color: var(--ink-3); text-decoration: none; font-size: 11.5px; font-weight: 500; cursor: pointer; }
  .tabbar a[aria-current="page"] { color: var(--ink); background: var(--hover); }
  .tabbar .i { width: 20px; height: 20px; }
  .toasts { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; }
  .page-tools { width: 100%; }
  .week-body { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 14px; }
  .legend { width: 100%; }
  .lg-val b { font-size: 26px; }
  .ins-num b { font-size: 48px; }
  .timer-num { font-size: 60px; }
  .fl-row, .add-ev .fl-row { grid-template-columns: minmax(0, 1fr); }
  .seg-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-add { flex-wrap: wrap; }
  .quick-add .select { max-width: none; flex: 1; }
  .entry { grid-template-columns: 52px minmax(0, 1fr); }
  .entry .row-act { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.reduce *, .reduce *::before, .reduce *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

/* ---------- additions ---------- */
.ev.bare { padding: 0; }
.upnext { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; font-size: 13.5px; }
.upnext .chip { height: 30px; cursor: pointer; }
.upnext .chip .tnum { color: var(--ink-3); }
.sess-list { list-style: none; margin: 18px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.sess-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.sess-list li span:first-child { color: var(--ink-3); }
.sess-list li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess-empty { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); }
.days { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.days-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 10px; }
.days-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; }
.days-row li { display: grid; justify-items: center; gap: 5px; }
.days-row i { width: 100%; max-width: 22px; aspect-ratio: 1; border-radius: 6px; background: var(--sunken); }
.days-row i.on { background: color-mix(in srgb, var(--journal) var(--m), var(--sunken)); }
.days-row span { font-size: 11.5px; color: var(--ink-3); }
.psum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.psum-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; text-decoration: none; color: inherit; min-width: 0; }
.psum-item:hover { background: var(--hover); }
.psum-item svg { width: 44px; height: 44px; flex: none; }
.psum-item b { display: block; font-size: 18px; font-weight: 400; letter-spacing: -0.02em; }
.psum-item small { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psum-item span { min-width: 0; }
@container view (max-width: 760px) { .psum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container view (max-width: 640px) {
  .tl-legend { display: none; }
}
@media (max-width: 640px) {
  .chat { height: calc(100dvh - 340px); min-height: 420px; }
}

/* =================================================================
   v3: wide, half screen, focus mode, pillars, review, week, people
   ================================================================= */
@media (max-width: 760px) { .main { grid-column: 1; } }

/* rail flyout for half-screen windows */
.rail-open .app { grid-template-columns: 76px minmax(0, 1fr); }
.rail-open .side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 46; width: 264px; height: 100vh; background: var(--bg); box-shadow: var(--pop-shadow); }
.rail-open .rail-btn { transform: none; }

/* Ask Ritmo panel */
.ask { position: fixed; top: 0; right: 0; bottom: 0; z-index: 48; width: min(440px, 100vw); display: flex; flex-direction: column; background: var(--panel); box-shadow: var(--pop-shadow); transform: translateX(104%); transition: transform .34s var(--ease); }
.ask.on { transform: none; }
.ask-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.ask-head .mark { width: 30px; height: 30px; }
.ask-title { flex: 1; min-width: 0; display: grid; }
.ask-title b { font-size: 15px; font-weight: 500; }
.ask-select { appearance: none; border: 0; padding: 0; background: transparent; color: var(--ink-3); font-size: 12.5px; cursor: pointer; max-width: 100%; text-overflow: ellipsis; }
.ask-select:hover { color: var(--ink); }
.ask .log { padding: 20px 18px 10px; gap: 18px; }
.ask .msg.user { max-width: 86%; }
.ask .plan-list li { grid-template-columns: 122px minmax(0, 1fr); }
.ask .plan-list time { white-space: nowrap; }
.ask .plan-list .tag { display: none; }
.ask .composer { padding: 10px 14px 16px; border-top: 1px solid var(--line); }
.scrim-ask { z-index: 47; }
@media (min-width: 1600px) {
  .ask-docked .app { grid-template-columns: 252px minmax(0, 1fr) 400px; }
  .ask-docked.is-rail .app { grid-template-columns: 76px minmax(0, 1fr) 400px; }
  .ask-docked .ask { position: sticky; top: 0; grid-column: 3; grid-row: 1; width: auto; height: 100vh; transform: none; box-shadow: none; border-left: 1px solid var(--line); }
}
@media (min-width: 1600px) and (min-width: 1360px) {
  .ask-docked .ask { top: 14px; height: calc(100vh - 28px); border-radius: 0 28px 28px 0; }
}

/* Today: one grid, three compositions */
.today-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); grid-template-areas: "week" "ins" "sched" "tasks" "focus" "habits" "close" "goals"; }
.a-week { grid-area: week; container: wk / inline-size; }
.a-ins { grid-area: ins; }
.a-sched { grid-area: sched; }
.a-tasks { grid-area: tasks; }
.a-focus { grid-area: focus; }
.a-habits { grid-area: habits; }
.a-close { grid-area: close; }
.a-goals { grid-area: goals; }
@container view (min-width: 700px) {
  .today-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "week ins" "sched sched" "tasks focus" "habits close" "goals goals"; }
}
@container view (min-width: 1320px) {
  .today-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "week week ins" "sched sched sched" "tasks habits focus" "goals goals close"; }
}
@container wk (max-width: 500px) { .week-body { grid-template-columns: minmax(0, 1fr); justify-items: center; } .legend { width: 100%; } }
@container wk (min-width: 760px) { .week-body .legend { grid-template-columns: repeat(4, minmax(0, 1fr)); } .week-body { grid-template-columns: 240px minmax(0, 1fr); } .rings { width: 240px; height: 240px; } }

/* habits */
.habits { list-style: none; margin: 0; padding: 0; }
.habit { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 40px; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); }
.habit:first-child { border-top: 0; }
.hcheck { width: 28px; height: 28px; padding: 0; border: 1.6px solid color-mix(in srgb, var(--c) 55%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--c) 8%, transparent); color: transparent; display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.hcheck .i { width: 15px; height: 15px; stroke-width: 2.8; }
.hcheck:hover { border-color: var(--c); }
.hcheck:active { transform: scale(.92); }
.hcheck[aria-pressed="true"] { background: var(--cd); border-color: var(--cd); color: #fff; }
.h-main { min-width: 0; }
.h-main b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-main small { font-size: 12.5px; color: var(--ink-3); }
.h-week { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.h-week li { display: grid; justify-items: center; gap: 3px; }
.h-week i { width: 16px; height: 16px; border-radius: 6px; background: var(--sunken); }
.h-week li.on i { background: var(--c); }
.h-week li.now i { box-shadow: 0 0 0 1.5px var(--panel), 0 0 0 3px var(--ink); }
.h-week li.fut i { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.h-week span { font-size: 11.5px; line-height: 12px; color: var(--ink-3); }
.h-streak { display: inline-flex; align-items: center; justify-content: flex-end; gap: 3px; font-size: 13.5px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.h-streak .i { width: 14px; height: 14px; }
.h-streak.hot { color: var(--ink); }
.h-streak.hot .i { color: #ec6a12; fill: color-mix(in srgb, #ec6a12 22%, transparent); }

/* focus mode */
.is-immersive body { padding: 0 !important; background: #05070b; }
.is-immersive .side, .is-immersive .topbar, .is-immersive .tabbar, .is-immersive .ariadne, .is-immersive .ask, .is-immersive .scrim { display: none !important; }
.is-immersive .app { display: block; min-height: 100vh; border-radius: 0; box-shadow: none; background: #05070b; }
.is-immersive .view { max-width: none; padding: 0; }
.is-immersive .toasts { bottom: 96px; }
.fm { position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; color: #fff; background: #0b0d12; }
.fm-bg { position: absolute; inset: 0; z-index: -2; }
.fm-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.05); transition: opacity 1.1s ease, transform 9s cubic-bezier(.16, 1, .3, 1); }
.fm-bg img.on { opacity: 1; transform: scale(1); }
.fm::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(52% 50% at 50% 50%, rgba(5, 8, 14, .4), rgba(5, 8, 14, .06) 72%), linear-gradient(180deg, rgba(5, 8, 14, .5) 0%, rgba(5, 8, 14, 0) 20%, rgba(5, 8, 14, 0) 72%, rgba(5, 8, 14, .62) 100%); }
.fm-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; }
.fm-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px; border: 0; border-radius: 999px; background: rgba(12, 14, 20, .44); color: #fff; text-decoration: none; font-size: 13.5px; font-weight: 500; cursor: pointer; -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); transition: background .15s; }
.fm-pill:hover { background: rgba(12, 14, 20, .62); }
.fm-pill .i { width: 16px; height: 16px; }
.fm-scenes { display: flex; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(12, 14, 20, .44); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.fm-scenes button { width: 44px; height: 30px; padding: 0; border: 0; border-radius: 999px; overflow: hidden; cursor: pointer; opacity: .62; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); transition: opacity .2s, box-shadow .2s, transform .2s; }
.fm-scenes button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fm-scenes button:hover { opacity: .9; }
.fm-scenes button[aria-checked="true"] { opacity: 1; box-shadow: 0 0 0 2px #fff; }
.fm-scenes button:focus-visible { outline-color: #fff; }
.fm-center { display: grid; justify-items: center; align-content: center; gap: 14px; padding: 8px 20px; text-align: center; }
.fm-dial { position: relative; width: min(340px, 70vw, 46vh); aspect-ratio: 1; }
.fm-dial svg { display: block; width: 100%; height: 100%; }
.fm-track { fill: rgba(8, 10, 16, .26); stroke: rgba(255, 255, 255, .2); stroke-width: 5; }
.fm-prog { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .5s linear; }
.fm-readout { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; }
.fm-time { font-size: clamp(60px, 9vw, 96px); font-weight: 250; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; text-shadow: 0 2px 30px rgba(0, 0, 0, .25); }
.fm-state { font-size: 14px; color: rgba(255, 255, 255, .82); }
.fm-task { appearance: none; -webkit-appearance: none; max-width: min(600px, 90vw); padding: 6px 34px 6px 16px; border: 0; border-radius: 12px; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; color: #fff; font: 500 22px/1.3 var(--font); letter-spacing: -0.012em; text-align: center; text-align-last: center; text-overflow: ellipsis; cursor: pointer; text-shadow: 0 1px 12px rgba(0, 0, 0, .3); }
.fm-task:hover { background-color: rgba(255, 255, 255, .1); }
.fm-task option { color: #111216; }
.fm-task:focus-visible { outline-color: #fff; }
.fm-goal { display: flex; align-items: center; gap: 8px; margin: -8px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, .84); }
.fm-controls { display: flex; align-items: center; gap: 18px; margin-top: 12px; }
.fm-round { width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(12, 14, 20, .44); color: #fff; cursor: pointer; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); transition: background .15s; }
.fm-round:hover { background: rgba(12, 14, 20, .62); }
.fm-round[disabled] { opacity: .35; cursor: default; }
.fm-round .i { width: 20px; height: 20px; }
.fm-play { width: 78px; height: 78px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #111216; cursor: pointer; box-shadow: 0 16px 34px -14px rgba(0, 0, 0, .7); transition: transform .15s; }
.fm-play:active { transform: scale(.95); }
.fm-play .i { width: 28px; height: 28px; fill: currentColor; stroke-width: 1; }
.fm-round:focus-visible, .fm-play:focus-visible, .fm-pill:focus-visible { outline-color: #fff; }
.fm-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; padding: 18px 24px 22px; font-size: 13.5px; color: rgba(255, 255, 255, .88); }
.fm-keys kbd { margin: 0 5px 0 12px; background: rgba(255, 255, 255, .16); color: #fff; }
.fm-keys kbd:first-child { margin-left: 0; }
@media (max-width: 640px) {
  .fm-top { padding: 14px; }
  .fm-pill span { display: none; }
  .fm-pill { width: 40px; padding: 0; justify-content: center; }
  .fm-keys { display: none; }
  .fm-foot { justify-content: center; text-align: center; }
  .fm-task { font-size: 18px; }
}

/* pillar hero */
.phero { position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: clamp(300px, 28vw, 440px); margin-bottom: var(--gap); overflow: hidden; border-radius: var(--r-panel); color: #fff; background: #1a1d24; }
.phero-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.phero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8, 10, 16, .64) 0%, rgba(8, 10, 16, .26) 46%, rgba(8, 10, 16, 0) 72%), linear-gradient(0deg, rgba(8, 10, 16, .5) 0%, rgba(8, 10, 16, 0) 56%); }
.phero-in { width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 32px; }
.phero h1 { margin: 0; font-size: clamp(48px, 5vw, 68px); line-height: 1; font-weight: 420; letter-spacing: -0.04em; }
.phero p { max-width: 46ch; margin: 12px 0 0; font-size: 16.5px; color: rgba(255, 255, 255, .9); }
.phero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.btn.glass { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn.glass:hover { background: rgba(255, 255, 255, .24); }
.phero-ring { position: relative; flex: none; width: 152px; height: 152px; }
.phero-ring svg { display: block; width: 100%; height: 100%; }
.hr-track { fill: rgba(8, 10, 16, .3); stroke: rgba(255, 255, 255, .22); stroke-width: 12; }
.hr-prog { fill: none; stroke: var(--c); stroke-width: 12; stroke-linecap: round; }
.phero-ring > div { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; }
.phero-ring b { font-size: 36px; line-height: 1; font-weight: 400; letter-spacing: -0.03em; }
.phero-ring b small { font-size: 18px; color: rgba(255, 255, 255, .6); }
.phero-ring span { margin-top: 5px; font-size: 12.5px; color: rgba(255, 255, 255, .84); }
@container view (max-width: 640px) {
  .phero { min-height: 400px; }
  .phero-in { flex-direction: column; align-items: flex-start; padding: 22px; }
  .phero-ring { order: -1; width: 112px; height: 112px; }
  .phero-ring b { font-size: 26px; }
  .phero::after { background: linear-gradient(0deg, rgba(8, 10, 16, .78) 0%, rgba(8, 10, 16, .12) 72%); }
}

/* bars (sleep, focus 14 days) */
.bars { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; height: 192px; padding-top: 22px; align-items: end; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar i { width: 100%; max-width: 28px; border-radius: 6px 6px 4px 4px; background: color-mix(in srgb, var(--c, var(--blue)) 72%, var(--panel)); }
.bar.low i { background: color-mix(in srgb, var(--c, var(--blue)) 30%, var(--sunken)); }
.bar.last i { background: var(--c, var(--blue)); }
.bar span { font-size: 11.5px; line-height: 14px; color: var(--ink-3); }

/* people */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.person { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 12px; border-radius: 16px; background: var(--raised); box-shadow: var(--ctl-shadow); }
.person > div { min-width: 0; }
.person b { display: block; font-size: 14px; font-weight: 500; }
.person small { display: block; font-size: 12.5px; color: var(--ink-3); }
.person-next { display: flex; align-items: flex-start; gap: 5px; margin-top: 6px; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.person-next .i { margin-top: 1px; }
.person-next .i { width: 13px; height: 13px; flex: none; }
.av { display: inline-block; flex: none; width: var(--s); height: var(--s); border-radius: 50%; object-fit: cover; vertical-align: middle; background: var(--sunken); box-shadow: 0 0 0 2px var(--panel); }
.av-i { display: inline-grid; place-items: center; font-size: calc(var(--s) * .42); font-weight: 600; color: #fff; background: linear-gradient(160deg, #e2456e, #a8264f); }
.av-stack { display: inline-flex; align-items: center; }
.av-stack .av + .av { margin-left: -7px; }
.who { display: inline-flex; align-items: center; gap: 8px; }
.day-ev > .av { margin-left: -2px; }

/* reading */
.books { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.books li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px 12px; }
.books b { display: block; font-size: 14px; font-weight: 500; }
.books small { font-size: 12.5px; color: var(--ink-3); }
.books span { font-size: 13.5px; color: var(--ink-2); }
.books .gbar { grid-column: 1 / -1; display: block; height: 6px; }
.books .gbar i { background: var(--c); }

/* moments */
.moments { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.moment { display: flex; flex-direction: column; margin: 0; overflow: hidden; border-radius: 16px; background: var(--raised); box-shadow: var(--ctl-shadow); }
.moment img, .moment-blank { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.moment-blank { background: color-mix(in srgb, var(--journal) var(--m), var(--sunken)); }
.moment figcaption { padding: 12px 14px 14px; }
.moment p { margin: 7px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* review */
.rhist { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.rhist-main { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: center; }
.rhist-main h2 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 450; letter-spacing: -0.022em; }
.rhist-main p { margin: 8px 0 14px; font-size: 15px; color: var(--ink-2); }
.rhist-main .legend { margin-left: -12px; }
.rhist-weeks .sub-h { margin-top: 0; }
.rhist-weeks ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.rhist-weeks li { display: grid; justify-items: center; gap: 7px; padding: 10px 2px 9px; border-radius: 16px; }
.rhist-weeks li.cur { background: var(--raised); box-shadow: var(--ctl-shadow); }
.rhist-weeks li svg { width: 100%; max-width: 58px; height: auto; }
.rhist-weeks span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.rhist-weeks li.cur span { color: var(--ink); font-weight: 500; }
@container view (max-width: 1240px) { .rhist { grid-template-columns: minmax(0, 1fr); } }
@container view (max-width: 640px) {
  .rhist-main { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .rhist-main .legend { margin: 0; text-align: left; }
  .rhist-weeks ol { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.nums { list-style: none; margin: 0; padding: 0; }
.nums li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); font-size: 14px; }
.nums li:first-child { border-top: 0; }
.nums li > span:first-child { color: var(--ink-2); }
.nums b { font-size: 22px; font-weight: 400; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; text-align: right; }
.nums .delta, .nums .muted { justify-self: end; }
.grow-btn.moved { grid-template-columns: minmax(0, 1.5fr) minmax(110px, 1fr) 96px; }
.carry { list-style: none; margin: 0 0 16px; padding: 0; }
.carry li { display: grid; gap: 4px; padding: 11px 0; border-top: 1px solid var(--line); }
.carry li:first-child { border-top: 0; }
.carry .tag { padding-left: 27px; }
.take { min-height: 0; }
.take h2 { max-width: 30ch; margin-top: 22px; font-size: clamp(22px, 2.4vw, 32px); }
.take p { max-width: 74ch; font-size: 15px; }
.take .ins-art { width: 360px; height: 360px; right: -90px; bottom: -120px; }
.ins-mem { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: rgba(255, 255, 255, .84); }
.ins-mem .i { width: 15px; height: 15px; }

/* calendar week */
.panel.wk { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.wk-head { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); gap: 4px; padding: 10px 10px 8px 0; border-bottom: 1px solid var(--line); }
.wk-day { display: grid; justify-items: center; gap: 3px; padding: 6px 0; border: 0; border-radius: 12px; background: none; color: var(--ink); cursor: pointer; transition: background .12s; }
.wk-day small { font-size: 12.5px; color: var(--ink-3); }
.wk-day b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 18px; font-weight: 400; font-variant-numeric: tabular-nums; }
.wk-day:hover { background: var(--hover); }
.wk-day[aria-pressed="true"] { background: var(--raised); box-shadow: var(--ctl-shadow); }
.wk-day.today b { background: var(--blue); color: #fff; font-weight: 500; }
.wk-scroll { max-height: min(640px, calc(100vh - 230px)); overflow-y: auto; }
.wk-body { position: relative; display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.wk-hours { position: relative; }
.wk-hours span { position: absolute; right: 10px; transform: translateY(-50%); font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wk-col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% 46px; cursor: cell; }
.wk-col.today { background-color: color-mix(in srgb, var(--blue) 4%, transparent); }
.wk-ev { position: absolute; left: 3px; right: 3px; display: flex; flex-direction: column; gap: 1px; padding: 5px 7px; overflow: hidden; border: 0; border-radius: 8px; text-align: left; font-size: 12.5px; line-height: 1.25; cursor: pointer; transition: filter .15s; }
.wk-ev b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-ev small { font-size: 11.5px; opacity: .85; font-variant-numeric: tabular-nums; }
.wk-ev.tight { justify-content: center; padding: 2px 7px; }
.wk-ev.past { background: var(--cd); color: #fff; }
.wk-ev.next { --hc: color-mix(in srgb, var(--c) 30%, transparent); background-color: color-mix(in srgb, var(--c) 10%, var(--panel)); background-image: repeating-linear-gradient(-45deg, var(--hc) 0 1.4px, transparent 1.4px 6px); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 50%, transparent); }
.wk-ev:hover { filter: brightness(1.05); }
.wk-ev .av-stack { margin-top: auto; }
.wk-ev .av { box-shadow: 0 0 0 1.5px var(--panel); }
.wk-now { position: absolute; left: -1px; right: 0; z-index: 2; height: 2px; background: var(--blue); pointer-events: none; }
.wk-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.wk-now b { display: none; }
@container view (max-width: 640px) {
  .wk-head, .wk-body { grid-template-columns: 38px repeat(7, minmax(0, 1fr)); }
  .wk-hours span { right: 6px; font-size: 11.5px; }
  .wk-ev { left: 1px; right: 1px; padding: 3px 4px; font-size: 11.5px; }
  .wk-ev small, .wk-ev .av-stack { display: none; }
  .wk-day b { width: 28px; height: 28px; font-size: 15px; }
}

/* journal photos */
.entry-photo { display: block; width: 100%; max-width: 440px; aspect-ratio: 4 / 3; margin-top: 12px; object-fit: cover; border-radius: 16px; }
.saved .entry-photo { max-width: none; aspect-ratio: 16 / 9; }
.photo-prev { position: relative; width: 168px; }
.photo-prev img { display: block; width: 168px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; }
.photo-prev .icon-btn { position: absolute; top: 6px; right: 6px; }
.row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* files */
.fthumb { width: 34px; height: 34px; flex: none; border-radius: 10px; object-fit: cover; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.fcard { position: relative; margin: 0; overflow: hidden; border-radius: 16px; background: var(--raised); box-shadow: var(--ctl-shadow); }
.fcard-prev { display: grid; place-items: center; aspect-ratio: 4 / 3; color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--sunken)); }
.fcard-prev img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fcard-prev .i { width: 40px; height: 40px; stroke-width: 1.4; }
.fcard figcaption { display: grid; gap: 2px; padding: 12px 14px 14px; }
.fcard b { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard small { font-size: 12.5px; color: var(--ink-3); }
.fcard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 12.5px; }
.fcard-del { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .15s; }
.fcard:hover .fcard-del, .fcard:focus-within .fcard-del { opacity: 1; }
@media (hover: none) { .fcard-del { opacity: 1; } }

.meta-sm { font-size: 12.5px; }

/* =================================================================
   v4: photography-led Today, cards, motion, focus sound and breath
   ================================================================= */
.today-grid { grid-template-areas: "hero" "pillars" "ins" "sched" "tasks" "focus" "habits" "close" "upcoming" "goals"; }
.a-hero { grid-area: hero; }
.a-pillars { grid-area: pillars; }
.a-upcoming { grid-area: upcoming; }
@container view (min-width: 700px) {
  .today-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "hero ins" "pillars pillars" "sched sched" "tasks focus" "habits close" "upcoming upcoming" "goals goals"; }
}
@container view (min-width: 1320px) {
  .today-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "hero hero ins" "pillars pillars pillars" "sched sched sched" "tasks habits focus" "upcoming upcoming upcoming" "goals goals close"; }
}

/* Today hero */
.thero { position: relative; isolation: isolate; container: hero / inline-size; display: flex; align-items: flex-end; min-height: 392px; overflow: hidden; border-radius: var(--r-panel); color: #fff; background: #1a1d24; }
.thero-media { position: absolute; inset: -70px 0; z-index: -2; will-change: transform; }
.thero-img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 66% 50%; }
.thero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8, 10, 16, .64) 0%, rgba(8, 10, 16, .3) 44%, rgba(8, 10, 16, 0) 72%), linear-gradient(0deg, rgba(8, 10, 16, .52) 0%, rgba(8, 10, 16, 0) 52%); }
.thero-in { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; width: 100%; padding: 30px 30px 28px; }
.thero h1 { max-width: 15ch; margin: 0; font-size: clamp(36px, 3.4vw, 48px); line-height: 1.04; font-weight: 420; letter-spacing: -0.035em; }
.thero-sub { max-width: 54ch; margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .9); }
.thero-sub [data-clock] { font-variant-numeric: tabular-nums; }
.thero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.thero-rings { display: grid; flex: none; justify-items: center; gap: 10px; color: #fff; text-align: center; text-decoration: none; border-radius: 20px; }
.thero-rings svg { width: 176px; height: 176px; filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .28)); transition: transform .5s var(--ease); }
.thero-rings:hover svg { transform: scale(1.04) rotate(-4deg); }
.thero-rings span { font-size: 13.5px; color: rgba(255, 255, 255, .88); }
.thero-rings b { font-weight: 600; color: #fff; }
.thero-rings:focus-visible { outline-color: #fff; }
@container hero (max-width: 620px) {
  .thero { min-height: 470px; }
  .thero-in { flex-direction: column; align-items: flex-start; padding: 22px; }
  .thero-rings { order: -1; justify-items: start; }
  .thero-rings svg { width: 118px; height: 118px; }
  .thero::after { background: linear-gradient(0deg, rgba(8, 10, 16, .8) 0%, rgba(8, 10, 16, .2) 62%, rgba(8, 10, 16, .1) 100%); }
}

/* pillar photo cards */
.pcards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.pcard { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; min-height: 214px; padding: 16px 18px 18px; overflow: hidden; border-radius: var(--r-panel); color: #fff; text-decoration: none; background: #1a1d24; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.pcard-media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.pcard-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.pcard::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 10, 16, .5) 0%, rgba(8, 10, 16, .06) 34%, rgba(8, 10, 16, .34) 54%, rgba(8, 10, 16, .86) 100%); }
.pcard-bot, .pcard-top b { text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }
.pcard:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -22px rgba(0, 0, 0, .55); }
.pcard:hover .pcard-media img { transform: scale(1.07); }
.pcard:focus-visible { outline-offset: 3px; }
.pcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pcard-top b { font-size: 16.5px; font-weight: 500; }
.pcard-top svg { width: 46px; height: 46px; }
.pcard-bot { display: grid; gap: 2px; }
.pcard-num { font-size: 36px; line-height: 1; font-weight: 400; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.pcard-num small { font-size: 18px; color: rgba(255, 255, 255, .62); }
.pcard-unit { font-size: 13.5px; color: rgba(255, 255, 255, .92); }
.pcard-note { margin-top: 6px; font-size: 12.5px; color: rgba(255, 255, 255, .78); }
@container view (max-width: 980px) { .pcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container view (max-width: 540px) {
  .pcards { display: flex; gap: 10px; margin: 0 -16px; padding: 0 16px 4px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .pcard { flex: 0 0 74%; min-height: 196px; scroll-snap-align: start; }
}

/* milestone cards */
.mcards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mcard, .gcard { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 0; border: 0; border-radius: 16px; background: var(--raised); box-shadow: var(--ctl-shadow); color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.mcard:hover, .gcard:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--line), 0 22px 38px -22px rgba(0, 0, 0, .4); }
.mcard-media, .gcard-media { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; background: var(--sunken); }
.mcard-media img, .gcard-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.mcard:hover .mcard-media img, .gcard:hover .gcard-media img { transform: scale(1.07); }
.mcard-when { position: absolute; top: 10px; left: 10px; padding: 5px 10px; border-radius: 999px; background: rgba(12, 14, 20, .52); color: #fff; font-size: 12.5px; font-weight: 500; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.mcard-body, .gcard-body { display: grid; gap: 4px; padding: 12px 14px 14px; }
.mcard-body b, .gcard-body b { font-size: 15px; font-weight: 500; }
.mcard-body small { font-size: 12.5px; color: var(--ink-3); }
.mcard-goal, .gcard-prog { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mcard-goal .gbar, .gcard-prog .gbar { flex: 1; }
.mcard-goal .gbar { height: 6px; }
.mcard .av-stack { margin-top: 8px; }
@container view (max-width: 980px) { .mcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container view (max-width: 540px) {
  .mcards { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .mcard { flex: 0 0 78%; scroll-snap-align: start; }
}

/* goal cards and cover */
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.gcard[aria-current="true"] { box-shadow: 0 0 0 2px var(--ink), 0 22px 38px -24px rgba(0, 0, 0, .45); }
.gcard-media .status { position: absolute; top: 10px; left: 10px; }
.gcard-body small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.gd-cover { position: relative; isolation: isolate; display: flex; align-items: flex-end; margin: calc(var(--pad) * -1) calc(var(--pad) * -1) 0; aspect-ratio: 2 / 1; overflow: hidden; border-radius: var(--r-panel) var(--r-panel) 0 0; color: #fff; }
.gd-cover img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.gd-cover::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(8, 10, 16, .8) 0%, rgba(8, 10, 16, .12) 66%); }
.gd-cover-in { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; width: 100%; padding: 18px 20px; }
.gd-cover h2 { margin: 8px 0 0; font-size: 22px; line-height: 1.2; font-weight: 450; letter-spacing: -0.02em; }
.gd-cover p { margin: 4px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, .86); }
.gd-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(12, 14, 20, .46); font-size: 12.5px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* motion helpers */
.bar i, .fbar i { transform-origin: 50% 100%; }
.gbar > i, .cap-bar i, .goal-bars i, .sto-bar i { transform-origin: 0 50%; }
.moment, .fcard, .person { transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.moment:hover, .fcard:hover, .person:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line), 0 20px 36px -22px rgba(0, 0, 0, .38); }
.moment img, .fcard-prev img { transition: transform 1.1s var(--ease); }
.moment:hover img, .fcard:hover .fcard-prev img { transform: scale(1.06); }
.phero-img { transition: transform 1.4s var(--ease); }
.pop { animation: pop .46s cubic-bezier(.22, 1, .36, 1); }
@keyframes pop { 0% { transform: scale(.8); } 55% { transform: scale(1.14); } 100% { transform: none; } }
.pop .i { stroke-dasharray: 28; animation: draw .42s ease-out .06s backwards; }
@keyframes draw { from { stroke-dashoffset: 28; } }
.h-streak.bump { animation: pop .5s cubic-bezier(.22, 1, .36, 1); }
.h-streak.bump .i { animation: flick .9s ease-in-out; }
@keyframes flick { 0%, 100% { transform: none; } 30% { transform: scale(1.3) rotate(-8deg); } 60% { transform: scale(.95) rotate(6deg); } }
.btn .i, .icon-btn .i { transition: transform .25s var(--ease); }
.link-btn:hover .i { transform: translateX(2px); transition: transform .25s var(--ease); }

/* focus: sound, breath */
.fm-right { display: flex; align-items: center; gap: 8px; }
.fm-sound { position: relative; }
.fm-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 5; min-width: 210px; padding: 6px; border-radius: 16px; background: rgba(12, 14, 20, .74); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 20px 40px -16px rgba(0, 0, 0, .6); animation: dlg-in .2s var(--ease); }
.fm-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: #fff; font-size: 13.5px; text-align: left; cursor: pointer; }
.fm-menu button .i { width: 15px; height: 15px; opacity: 0; }
.fm-menu button[aria-checked="true"] .i { opacity: 1; }
.fm-menu button:hover { background: rgba(255, 255, 255, .1); }
.fm-menu button:focus-visible { outline-color: #fff; }
.fm-vol { display: grid; gap: 6px; margin-top: 4px; padding: 10px 10px 6px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 12.5px; color: rgba(255, 255, 255, .76); }
.fm-vol input { width: 100%; accent-color: #fff; }
.fm-breath { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; background: rgba(5, 8, 14, .58); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transition: opacity .45s ease; }
.fm-breath.on { opacity: 1; }
.fm-breath-circle { width: min(300px, 60vw); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .36), rgba(255, 255, 255, .08) 72%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .36); transform: scale(.55); transition: transform 4s cubic-bezier(.45, 0, .55, 1); }
.fm-breath-circle.in { transform: scale(1); }
.fm-breath-label { margin: 10px 0 0; font-size: 26px; font-weight: 400; letter-spacing: -0.02em; }
.fm-breath-count { margin: 0 0 6px; font-size: 13.5px; color: rgba(255, 255, 255, .76); }

/* share card */
.dlg-share { width: min(480px, calc(100vw - 32px)); }
#share-canvas { display: block; width: 100%; height: auto; border-radius: 16px; background: #0b1534; }
.gd-cover .status, .gcard .status { color: var(--ink); }
.fm { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 640px) {
  .fm-top { flex-wrap: wrap; row-gap: 10px; }
  .fm-scenes { order: 3; margin: 0 auto; }
  .fm-scenes button { width: 36px; height: 26px; }
  .fm-foot { flex-direction: column; gap: 4px; }
}
@container view (max-width: 540px) {
  .task { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; }
  .task .row-act { grid-column: 3; grid-row: 1; }
  .task .task-est { display: none; }
  .task .row-act [data-action="later-task"], .task .row-act [data-action="delete-task"] { display: none; }
  .quick-add { flex-wrap: wrap; }
  .quick-add > .input:not(.select) { flex: 1 1 100%; }
}
