/* Socratis — one stylesheet. Tokens first, then layout, then components. */

:root {
  --bg: #F7F6F3; --surface: #FFFFFF; --sunken: #F2F0EB; --line: #E4E1DB; --line-soft: #EEECE7;
  --ink: #1C1B1A; --ink-2: #3B3936; --muted: #5E5B57; --faint: #6B6761; --field: #D4D0C8;
  --inv: #1C1B1A; --on-inv: #FFFFFF;
  --danger: #9B3A25; --danger-tint: #FBE7E0; --ok: #1B5A37; --ok-tint: #E0F1E7; --switch-on: #2E8B57;
  --focus: #2F6BCB;
  --shadow: 0 1px 2px rgba(28, 27, 26, .04), 0 8px 24px -16px rgba(28, 27, 26, .18);
  --pop: 0 12px 40px -8px rgba(28, 27, 26, .25);
  --r: 12px;
  color-scheme: light;
}
/* Pillars and tag colours share one palette. */
.p1, .c-clay   { --ac: #C2563A; --tint: #FBE7E0; --tx: #7A301B; }
.p2, .c-blue   { --ac: #2F6BCB; --tint: #E3EDFB; --tx: #1B4287; }
.p3, .c-green  { --ac: #2E8B57; --tint: #E0F1E7; --tx: #1B5A37; }
.hb, .c-amber  { --ac: #B7791F; --tint: #FBEFD2; --tx: #6B4510; }
.nt, .c-violet { --ac: #6B5FA8; --tint: #ECE9F6; --tx: #3F356F; }
.c-teal        { --ac: #1F8A8A; --tint: #DCF1F0; --tx: #135454; }
.c-rose        { --ac: #C2456E; --tint: #FBE4EC; --tx: #7D2343; }
.c-slate       { --ac: #6B6761; --tint: #EEECE7; --tx: #3B3936; }

/* Dark: chosen in Settings (data-theme="dark"), or "Match my device" when the device is dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413; --surface: #1D1C1B; --sunken: #282725; --line: #34322F; --line-soft: #2B2A28;
    --ink: #F2F0EB; --ink-2: #DAD6CF; --muted: #ADA9A1; --faint: #A39F97; --field: #4A4743;
    --inv: #F2F0EB; --on-inv: #141413;
    --danger: #F2A08A; --danger-tint: #3A221B; --ok: #9BD8B2; --ok-tint: #183225; --switch-on: #3F9E69;
    --focus: #8DB3F2;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --pop: 0 12px 40px -8px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .p1, :root:not([data-theme="light"]) .c-clay { --ac: #E07A5C; --tint: #3A221B; --tx: #F5B9A6; }
  :root:not([data-theme="light"]) .p2, :root:not([data-theme="light"]) .c-blue { --ac: #6A9BEA; --tint: #1B2A44; --tx: #B5CDF5; }
  :root:not([data-theme="light"]) .p3, :root:not([data-theme="light"]) .c-green { --ac: #5DBB86; --tint: #183225; --tx: #A9DFC0; }
  :root:not([data-theme="light"]) .hb, :root:not([data-theme="light"]) .c-amber { --ac: #D9A143; --tint: #3A2C12; --tx: #F0D29A; }
  :root:not([data-theme="light"]) .nt, :root:not([data-theme="light"]) .c-violet { --ac: #9D92D6; --tint: #2A2541; --tx: #CEC7F0; }
  :root:not([data-theme="light"]) .c-teal { --ac: #4FB8B6; --tint: #133332; --tx: #A3E0DE; }
  :root:not([data-theme="light"]) .c-rose { --ac: #E07A9C; --tint: #3A1C27; --tx: #F5B5CA; }
  :root:not([data-theme="light"]) .c-slate { --ac: #A39F97; --tint: #2B2A28; --tx: #DAD6CF; }
}
:root[data-theme="dark"] {
  --bg: #141413; --surface: #1D1C1B; --sunken: #282725; --line: #34322F; --line-soft: #2B2A28;
  --ink: #F2F0EB; --ink-2: #DAD6CF; --muted: #ADA9A1; --faint: #A39F97; --field: #4A4743;
  --inv: #F2F0EB; --on-inv: #141413;
  --danger: #F2A08A; --danger-tint: #3A221B; --ok: #9BD8B2; --ok-tint: #183225; --switch-on: #3F9E69;
  --focus: #8DB3F2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --pop: 0 12px 40px -8px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
:root[data-theme="dark"] .p1, :root[data-theme="dark"] .c-clay { --ac: #E07A5C; --tint: #3A221B; --tx: #F5B9A6; }
:root[data-theme="dark"] .p2, :root[data-theme="dark"] .c-blue { --ac: #6A9BEA; --tint: #1B2A44; --tx: #B5CDF5; }
:root[data-theme="dark"] .p3, :root[data-theme="dark"] .c-green { --ac: #5DBB86; --tint: #183225; --tx: #A9DFC0; }
:root[data-theme="dark"] .hb, :root[data-theme="dark"] .c-amber { --ac: #D9A143; --tint: #3A2C12; --tx: #F0D29A; }
:root[data-theme="dark"] .nt, :root[data-theme="dark"] .c-violet { --ac: #9D92D6; --tint: #2A2541; --tx: #CEC7F0; }
:root[data-theme="dark"] .c-teal { --ac: #4FB8B6; --tint: #133332; --tx: #A3E0DE; }
:root[data-theme="dark"] .c-rose { --ac: #E07A9C; --tint: #3A1C27; --tx: #F5B5CA; }
:root[data-theme="dark"] .c-slate { --ac: #A39F97; --tint: #2B2A28; --tx: #DAD6CF; }
:root[data-theme="light"] { color-scheme: light; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 14px/1.45 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--field); text-underline-offset: 3px; font-weight: 500; }
a:hover { text-decoration-color: currentColor; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.icon { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.m { color: var(--muted); font-size: 12px; }
.ht { font-size: 12px; font-weight: 500; color: var(--faint); white-space: nowrap; }
.ht[class*="c-"] { color: var(--tx); }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
code { font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex: none; position: sticky; top: 0; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 20px 12px; display: flex; flex-direction: column; gap: 4px;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 0 12px 20px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--inv); color: var(--on-inv); display: grid; place-items: center; font-size: 14px; }
.nav-list { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 20px 12px 6px; }
.nav {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 8px;
  color: var(--ink-2); font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .15s;
}
.nav:hover { background: var(--sunken); }
.nav.on { background: var(--inv); color: var(--on-inv); }
.dot { width: 10px; height: 10px; margin: 0 4px; border-radius: 50%; flex: none; background: var(--ac, var(--faint)); }
.nav.on .dot { box-shadow: 0 0 0 2px var(--on-inv); }

.main { flex: 1; min-width: 0; }
.top, .body { max-width: 1440px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 24px; flex-wrap: wrap; }
.title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.focus-now { min-height: 36px; padding: 0 14px; border-color: var(--field); border-radius: 999px; font-size: 13px; }
.focus-now .icon { width: 16px; height: 16px; }
.focus-now.is-live { border-color: transparent; background: var(--ok-tint); color: var(--ok); }
.top h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.sub { margin-top: 4px; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.body { padding-top: 24px; padding-bottom: 56px; }
.shared {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px 4px 8px; border-radius: 999px;
  background: var(--tint); color: var(--tx); font-size: 12px; font-weight: 600;
}
.shared .icon { width: 14px; height: 14px; }
.focus-top .shared { margin-top: 0; }

/* ---------- mode switches ---------- */
.modes { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.modes form { display: contents; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px 0 8px; border: 0; border-radius: 999px;
  background: none; color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.toggle:hover { background: var(--sunken); }
.sw { position: relative; width: 28px; height: 16px; border-radius: 999px; background: var(--field); flex: none; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.toggle[aria-checked="true"] .sw { background: var(--switch-on); }
.toggle[aria-checked="true"] .sw::after { transform: translateX(12px); }

/* ---------- account menu ---------- */
.menu { position: relative; }
.menu summary, details summary { list-style: none; }
.menu summary::-webkit-details-marker, details summary::-webkit-details-marker { display: none; }
.persona {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px 0 6px;
  border: 1px solid var(--field); border-radius: 999px; background: var(--surface); font-weight: 500; font-size: 13px; cursor: pointer;
}
.persona:hover { background: var(--sunken); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sunken); display: grid; place-items: center; font-weight: 600; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--pop); padding: 6px;
}
.menu-head { display: flex; flex-direction: column; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu-pop a, .menu-pop button {
  display: flex; width: 100%; min-height: 40px; align-items: center; gap: 10px; padding: 0 12px; border-radius: 8px;
  text-decoration: none; background: none; border: 0; cursor: pointer; font-weight: 500; text-align: left;
}
.menu-pop .icon { width: 16px; height: 16px; color: var(--faint); }
.menu-pop a:hover, .menu-pop button:hover { background: var(--sunken); }
.menu-note { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); }

/* ---------- flash & banner ---------- */
.flashes, .banner-wrap { max-width: 1440px; margin: 16px auto 0; padding: 0 32px; display: grid; gap: 8px; }
.flash {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; font-weight: 500; font-size: 13px;
  background: var(--ok-tint); color: var(--ok); transition: opacity .3s;
}
.flash.error { background: var(--danger-tint); color: var(--danger); }
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 10px; background: var(--tint); color: var(--tx); font-size: 13px; }
.banner span { flex: 1; }

/* ---------- layout ---------- */
.lay { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.lc { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.rail { position: sticky; top: 24px; }
.g { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.s6 { grid-column: span 6; } .s12 { grid-column: span 12; }
.pg { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; align-items: start; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; align-items: start; }
.col, .stack { display: flex; flex-direction: column; gap: 16px; }
.stack { gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-actions { margin-bottom: 20px; }
.push-down { margin-top: auto; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px;
  display: flex; flex-direction: column; box-shadow: var(--shadow); min-width: 0;
}
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-h h2, .card-title { font-size: 14px; font-weight: 600; }
.card-title { font-size: 16px; }
.card-h a, .link-btn { font-size: 12px; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 500; text-decoration: underline; text-decoration-color: var(--field); text-underline-offset: 3px; }
.link-btn:hover { text-decoration-color: currentColor; }
.card-sub { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.ph { display: flex; align-items: center; gap: 10px; background: var(--tint); color: var(--tx); border-radius: 10px; padding: 10px 14px; }
.ph h2 { font-size: 16px; font-weight: 600; }
.ph a { margin-left: auto; color: inherit; font-size: 12px; text-decoration-color: currentColor; }
.empty { color: var(--muted); font-size: 13px; padding: 12px 0; }
.empty-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 8px 0; color: var(--muted); }
.card.empty-cta { padding: 24px; margin-bottom: 24px; }
.count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--danger-tint); color: var(--danger); font-size: 12px; font-weight: 600; display: grid; place-items: center; }

.r { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.card-h + .r, .r:first-child { border-top: 0; }
.r-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.person-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.r-main > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.r-end { display: flex; align-items: center; gap: 8px; flex: none; }

.bl { padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.card-h + .bl, .bl:first-child { border-top: 0; }
.bl-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 7px; }
.bar { height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ac, var(--ink)); border-radius: 4px; transition: width .4s; }
.bar.over i { background: var(--danger); }

.tag { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; background: var(--tint); color: var(--tx); white-space: nowrap; }
.tag.alert { background: var(--danger-tint); color: var(--danger); }
.tag.done { background: var(--ok-tint); color: var(--ok); }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink);
  border-radius: 8px; font-weight: 500; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--sunken); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--inv); color: var(--on-inv); border-color: var(--inv); }
.btn.primary:hover { opacity: .88; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 12px; border-color: var(--field); }
.btn.small.primary { border-color: var(--inv); }
.btn.ghost { border-color: var(--field); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn[aria-pressed="true"] { background: var(--tint, var(--ok-tint)); color: var(--tx, var(--ok)); border-color: transparent; }
.btn .icon { width: 16px; height: 16px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: none;
  color: var(--faint); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.icon-btn .icon { width: 16px; height: 16px; }
.icon-btn.starred { color: #B7791F; }
.icon-btn.starred .icon { fill: currentColor; }

.input {
  width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px;
  background: var(--surface); font-size: 13px; min-width: 0;
}
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.input:disabled { background: var(--sunken); color: var(--muted); }
textarea.input { min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); min-width: 0; }
.field .m { font-weight: 400; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.inline { display: flex; gap: 8px; align-items: flex-end; }
.inline .input, .inline .field { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--inv); cursor: pointer; flex: none; margin: 0; }
details.add { border-top: 1px solid var(--line-soft); margin-top: 8px; padding-top: 12px; }
details.add summary { cursor: pointer; font-weight: 500; font-size: 13px; min-height: 36px; display: flex; align-items: center; gap: 6px; }
details.add summary .icon { width: 16px; height: 16px; }
details.add[open] summary { margin-bottom: 10px; }

/* ---------- chips & tags ---------- */
.fl { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip {
  font-size: 13px; font-weight: 500; min-height: 36px; padding: 0 10px; border: 0; border-radius: 999px; gap: 6px;
  background: none; color: var(--faint); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
}
.chip:hover { background: var(--sunken); color: var(--ink); }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--inv); color: var(--on-inv); }
.chip .icon { width: 14px; height: 14px; }
.chip-add { border: 1px dashed var(--field); color: var(--ink-2); }
.chip-soft { background: var(--tint); color: var(--tx); }
.chip-soft:hover { background: var(--tint); color: var(--tx); filter: brightness(.97); }
.chip-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ac); margin-right: 6px; vertical-align: 1px; }
.chip .chip-dot { margin-right: 0; }
.chip-row { margin: 14px 0 6px; }

.pop-add { position: relative; display: inline-block; }
.pop {
  position: absolute; z-index: 25; top: calc(100% + 6px); right: 0; width: 260px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--pop); padding: 14px;
}
.swatches { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.swatches legend { font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.swatch { position: relative; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.swatch span:first-of-type { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--ac); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.swatch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- tasks ---------- */
.task { display: flex; align-items: center; gap: 12px; min-height: 48px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.card-h + .task, .tasks > .task:first-child, .task:first-child { border-top: 0; }
.task form { display: contents; }
.task-text { flex: 1; min-width: 0; display: flex; flex-direction: column; row-gap: 2px; cursor: pointer; padding: 6px 0; }
.task.is-done .task-text > span:first-child { text-decoration: line-through; color: var(--faint); }
.t-meta { display: inline-flex; gap: 8px; align-items: baseline; }
.t-meta .ht + .due::before { content: "·"; margin-right: 8px; color: var(--faint); font-weight: 400; }
.due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.due.late { color: var(--danger); font-weight: 600; }
.task-acts { display: flex; opacity: 0; transition: opacity .15s; }
.task:hover .task-acts, .task:focus-within .task-acts { opacity: 1; }
.task-acts .starred { opacity: 1; }
@media (hover: none) { .task-acts { opacity: 1; } }
.todo-add { display: flex; flex-direction: column; gap: 8px; }
.todo-add .opts { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.todo-add.wide { display: grid; grid-template-columns: minmax(0, 1fr) 150px 160px auto; }
.group-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 2px; }
.group-h span { font-weight: 500; color: var(--faint); }
.group-h.late { color: var(--danger); }
.done-list summary { cursor: pointer; }

/* ---------- today's focus slots ---------- */
.slots { display: flex; flex-direction: column; }
.slot { display: flex; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.slot:first-child { border-top: 0; }
.slot form { display: contents; }
.slot-n {
  width: 24px; height: 24px; border-radius: 50%; background: var(--sunken); color: var(--muted); flex: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
}
.slot-n .icon { width: 13px; height: 13px; stroke-width: 2.6; }
.slot.is-done .slot-n { background: var(--ok-tint); color: var(--ok); }
.slot.is-done .task-text > span:first-child { text-decoration: line-through; color: var(--faint); }
.slot .task-text { flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.slot-x { opacity: 0; }
.slot:hover .slot-x, .slot:focus-within .slot-x { opacity: 1; }
@media (hover: none) { .slot-x { opacity: 1; } }
.slot-input {
  flex: 1; min-width: 0; min-height: 40px; padding: 0 2px; border: 0; border-bottom: 1px dashed var(--field);
  background: none; font-size: 13px;
}
.slot-input::placeholder { color: var(--faint); }
.slot-input:focus { outline: none; border-bottom: 1px solid var(--focus); }
.slot-empty .btn { opacity: 0; pointer-events: none; transition: opacity .15s; }
.slot-empty:focus-within .btn { opacity: 1; pointer-events: auto; }
@media (hover: none) { .slot-empty .btn { opacity: 1; pointer-events: auto; } }

/* ---------- habits ---------- */


/* today's chores and the tabbed chores card */
/* habits tile: one row per habit with its 4-week squares */
.habit-tile { margin-bottom: 24px; }
.habit-list { display: flex; flex-direction: column; }
.habit-line { display: grid; grid-template-columns: 44px minmax(140px, 1fr) var(--dots-w) 56px; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line-soft); --dots-w: calc(7 * 28px + 6 * 8px); }
.habit-line:first-child { border-top: 0; }
.habit-line form { display: contents; }
.habit-info { display: flex; flex-direction: column; min-width: 0; }
.habit-info strong { font-size: 14px; font-weight: 600; }
.rest-note { color: var(--faint); }
.tick {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); border: 2px solid var(--ac); color: var(--ac); transition: background .15s, transform .05s;
}
.tick:hover { background: var(--tint); }
.tick:active { transform: scale(.96); }
.tick .icon { width: 20px; height: 20px; stroke-width: 2.4; }
.habit-line.is-done .tick { background: var(--ac); color: #fff; }
.habit-line.is-done .tick:hover { opacity: .9; }
.habit-line.is-rest .tick { border: 2px dashed var(--field); color: var(--field); background: var(--sunken); }
.habit-line.is-rest .tick:hover { border-color: var(--ac); color: var(--ac); background: var(--tint); }
.habit-line.is-rest .habit-info strong { color: var(--ink-2); }
.heat-row { display: grid; grid-template-columns: repeat(28, 12px); gap: 3px; }
.heat-row i, .lg { display: block; width: 12px; height: 12px; border-radius: 3px; background: var(--line-soft); }
.heat-row i.on, .lg.on { background: var(--ac); }
.heat-row i.today, .lg.today { box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--ink-2); }
.seen-line { display: grid; grid-template-columns: minmax(140px, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.seen-line:first-child { border-top: 0; }
.heat-row.weeks { grid-template-columns: repeat(26, 11px); }
.heat-row.weeks i, .seen-tile .lg { width: 11px; height: 11px; }
.seen-line:hover .task-acts, .seen-line:focus-within .task-acts { opacity: 1; }

/* habits: four Monday-to-Sunday weeks as a grid */
.habit-line.grid-head { padding: 0 0 2px; border-top: 0; }

/* sections and goal cards */
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-h h2 { font-size: 16px; font-weight: 600; }
.term-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.term-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--tx); }
.term-col .goal { padding: 14px 0; }
.goal-desc { font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; }
.steps { margin-top: 10px; display: flex; flex-direction: column; }
.step { display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: 13px; }
.step form { display: contents; }
.step label { flex: 1; cursor: pointer; padding: 4px 0; }
.step.is-done label { text-decoration: line-through; color: var(--faint); }
.step-x { width: 28px; height: 28px; opacity: 0; }
.step:hover .step-x, .step:focus-within .step-x { opacity: 1; }
@media (hover: none) { .step-x { opacity: 1; } }
.step-add { display: flex; align-items: center; gap: 8px; padding-left: 28px; }
.step-add .slot-input { min-height: 34px; font-size: 13px; }
.step-add .btn { opacity: 0; pointer-events: none; }
.step-add:focus-within .btn { opacity: 1; pointer-events: auto; }
@media (hover: none) { .step-add .btn { opacity: 1; pointer-events: auto; } }
.updates { margin-top: 12px; padding: 10px 12px; background: var(--sunken); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; }
.update p { font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.older summary { cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted); }
.older[open] summary { margin-bottom: 8px; }
.older .update { padding-top: 8px; border-top: 1px solid var(--line); }
.update-add { display: flex; gap: 6px; }
.update-add .input { min-height: 36px; background: var(--surface); }
textarea.input.short { min-height: 64px; }
.note-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rail .event-fields { grid-template-columns: 1fr 1fr; }
.rail .event-fields .field:first-child { grid-column: 1 / -1; }
.heat-row i.many, .lg.many { background: var(--tx); }
/* the last 7 days as dots, with the day letters in line above */
.dots { display: grid; grid-template-columns: repeat(7, 28px); gap: 8px; }
.dot7 { width: 28px; height: 28px; border-radius: 50%; background: var(--line-soft); display: grid; place-items: center; color: #fff; }
.dot7.on { background: var(--ac); }
.dot7 .icon { width: 14px; height: 14px; stroke-width: 2.8; }
.dot7.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink-2); }
.dots-head span { display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.2; }
.dots-head small { font-size: 10px; font-weight: 500; color: var(--faint); }
.dots-head .is-today, .dots-head .is-today small { color: var(--ink); }
.grid-head .habit-count { font-size: 11px; font-weight: 600; color: var(--muted); }
.lg.dot { border-radius: 50%; }
.habit-count { font-size: 14px; font-weight: 600; min-width: 64px; text-align: right; }
.habit-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.habit-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-tick { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1.5px dashed var(--field); background: var(--sunken); }
.chore-split { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; margin-top: 6px; }
.chore-nav { display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line-soft); padding-right: 16px; }
.chore-nav button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 8px; background: none; font-weight: 500; text-align: left; cursor: pointer; color: var(--ink-2);
}
.chore-nav button:hover { background: var(--sunken); }
.chore-nav button[aria-selected="true"] { background: var(--tint); color: var(--tx); }
.chore-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chore-nav [aria-selected="true"] .chore-count { color: inherit; }
.chore-count.all { color: var(--ok); font-weight: 600; }
.chore-panel { min-width: 0; animation: rise .15s ease-out; }
.panel-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.panel-h h3 { font-size: 15px; font-weight: 600; }
.add-chore-inline { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); max-width: 420px; }
.add-chore-inline .input { min-height: 36px; }

/* goals */
.goal { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.card-h + .goal { border-top: 0; }
.goal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.goal-top strong { font-size: 14px; font-weight: 600; }
.goal-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.goal-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.goal-bar .bar { flex: 1; }
.goal-edit summary { cursor: pointer; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 8px; display: inline-flex; min-height: 28px; align-items: center; }
.goal-edit summary:hover { color: var(--ink); }
.goal-edit-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; margin-top: 6px; background: var(--sunken); border-radius: 10px; }
.late-text { color: var(--danger); font-weight: 600; }
.danger-text { color: var(--danger); }
.completed-goals > summary { cursor: pointer; margin-bottom: 0; }
.completed-goals[open] > summary { margin-bottom: 10px; }

/* ---------- people & alerts ---------- */
.notices { display: flex; flex-direction: column; }
.notice { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.notice:first-child { border-top: 0; }
.notice strong { font-weight: 600; }
.notice .r-main { flex: 1; }
.notice-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--tint); color: var(--tx); flex: none; }
.notice-ic .icon { width: 16px; height: 16px; }
.notice.urgent { background: var(--tint); color: var(--tx); border-radius: 10px; padding: 12px; margin-bottom: 4px; border: 0; }
.notice.urgent .notice-ic { background: var(--surface); }
.notice.urgent .m { color: inherit; }
.notice.urgent + .notice { border-top: 0; }

/* ---------- timers ---------- */
.timer-display { font-size: 32px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; min-width: 148px; }
.timer-btns { display: flex; gap: 8px; }

/* ---------- notes ---------- */
.composer { margin-bottom: 0; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.note { gap: 12px; }
.note p, .note-mini p { white-space: pre-wrap; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.note-quick { display: flex; flex-direction: column; gap: 10px; }
.note-quick textarea { min-height: 72px; }
.note-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.note-mini { background: var(--sunken); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.note-mini p { font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 16px; }
.search { position: relative; flex: 1; max-width: 360px; }
.search .icon { position: absolute; left: 12px; top: 13px; color: var(--faint); }
.search .input { padding-left: 38px; }

/* ---------- dialogs ---------- */
.dialog {
  width: min(480px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 16px; padding: 22px;
  background: var(--surface); color: var(--ink); box-shadow: var(--pop);
}
.dialog[open] { animation: rise .2s ease-out; }
.dialog::backdrop { background: rgba(20, 20, 19, .45); backdrop-filter: blur(2px); }
.dialog-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dialog-h h2 { font-size: 17px; font-weight: 600; }
.dialog-lead { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.status { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px; background: var(--sunken); font-size: 13px; margin-bottom: 16px; }
.status.ok { background: var(--ok-tint); color: var(--ok); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--sunken); border-radius: 10px; margin-bottom: 16px; }
.seg.two { grid-template-columns: repeat(2, 1fr); max-width: 240px; margin-bottom: 14px; }
.event-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.rail-stack { position: static; display: flex; flex-direction: column; gap: 24px; }
.seg button { min-height: 36px; border: 0; border-radius: 7px; background: none; font-weight: 500; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* set-up wizard */
.wizard { width: min(620px, calc(100vw - 32px)); padding: 0; }
.wizard > form { display: flex; flex-direction: column; max-height: min(760px, calc(100vh - 48px)); }
.wiz-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 0 24px; }
.wiz-dots { display: flex; gap: 4px; }
.wiz-dots i { width: 28px; height: 4px; border-radius: 2px; background: var(--line); transition: background .2s; }
.wiz-dots i.on { background: var(--inv); }
.wizard section { display: flex; flex-direction: column; gap: 14px; padding: 6px 24px 0; overflow-y: auto; flex: 1; animation: rise .2s ease-out; }
.wizard h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.habit-rows { display: flex; flex-direction: column; gap: 8px; }
.habit-rows:empty { display: none; }
.habit-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 170px auto; gap: 8px; align-items: center; animation: rise .15s ease-out; border-radius: 10px; }
.grip { cursor: grab; touch-action: none; width: 28px; }
.grip:active { cursor: grabbing; }
.habit-row.dragging { opacity: .85; background: var(--surface); box-shadow: var(--pop); position: relative; z-index: 1; animation: none; }
.habit-row.dragging .grip { cursor: grabbing; color: var(--ink); }
.add-own { align-self: flex-start; }
.chore-group { border: 0; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 10px; }
.chore-group legend { float: left; width: 100%; padding: 0; font-size: 13px; font-weight: 600; }
.chore-group legend + * { clear: both; }
.chip-check { position: relative; display: inline-flex; }
.chip-check input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip-check span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--field); font-size: 13px; font-weight: 500; color: var(--muted); transition: background .15s, color .15s;
}
.chip-check input:checked + span { background: var(--inv); border-color: var(--inv); color: var(--on-inv); }
.chip-check input:checked + span::before { content: ""; width: 10px; height: 6px; border: solid currentColor; border-width: 0 0 2px 2px; transform: translateY(-2px) rotate(-45deg); }
.chip-check input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.add-chore { display: flex; gap: 8px; max-width: 360px; }
.add-chore .input { min-height: 36px; }
.wiz-foot {
  position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 8px; margin-top: auto;
  padding: 16px 0 20px; background: var(--surface); border-top: 1px solid var(--line-soft);
}

/* welcome step */
.welcome { gap: 16px; }
.welcome-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--inv); color: var(--on-inv); display: grid; place-items: center; font-weight: 700; font-size: 20px; margin-top: 8px; }
.welcome h2 { font-size: 26px; }
.welcome-lead { font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 520px; }
.welcome-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.welcome-steps li { display: flex; align-items: center; gap: 12px; }
.welcome-n { width: 26px; height: 26px; border-radius: 50%; background: var(--sunken); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.welcome-n .icon { width: 14px; height: 14px; stroke-width: 2.4; }

/* light / dark picker */
.theme-pick { border: 0; margin: 0; padding: 0; }
.theme-pick legend { padding: 0; margin-bottom: 10px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.theme-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-opt { position: relative; }
.theme-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.theme-card { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 10px; border: 1px solid var(--field); border-radius: 12px; font-size: 13px; font-weight: 500; text-align: center; transition: border-color .15s, box-shadow .15s; }
.theme-opt input:checked + .theme-card { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.theme-opt input:focus-visible + .theme-card { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme-prev { display: flex; flex-direction: column; gap: 5px; height: 56px; padding: 10px; border-radius: 8px; border: 1px solid var(--line); }
.theme-prev i { display: block; height: 6px; border-radius: 3px; }
.theme-prev i:first-child { width: 45%; height: 8px; }
.theme-prev i:nth-child(2) { width: 80%; }
.theme-prev i:last-child { width: 60%; }
.tp-light { background: #F7F6F3; } .tp-light i { background: #1C1B1A; } .tp-light i + i { background: #D4D0C8; }
.tp-dark { background: #141413; } .tp-dark i { background: #F2F0EB; } .tp-dark i + i { background: #4A4743; }
.tp-system { background: linear-gradient(115deg, #F7F6F3 0 50%, #141413 50% 100%); } .tp-system i { background: #8A867F; }

/* ---------- calendar ---------- */
.cal-card { padding: 0; overflow: hidden; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h2 { font-size: 18px; font-weight: 600; margin-right: 10px; min-width: 150px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dow { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); }
.cd {
  min-height: 112px; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 3px; font-size: 12px; text-decoration: none; font-weight: 400; min-width: 0; transition: background .12s;
}
.cd:nth-child(7n) { border-right: 0; }
.cd:hover { background: var(--sunken); }
.cd b { font-weight: 500; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cd.o { background: color-mix(in srgb, var(--sunken) 45%, transparent); }
.cd.o b { color: var(--faint); }
.cd.t b { background: var(--inv); color: var(--on-inv); font-weight: 600; }
.cd.sel { box-shadow: inset 0 0 0 2px var(--focus); }
.ev { font-size: 11px; font-weight: 500; padding: 3px 6px; border-radius: 4px; background: var(--tint); color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more { font-size: 11px; color: var(--muted); padding-left: 6px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .m { display: block; margin-bottom: 6px; }
.stat strong { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat.warn strong { color: var(--danger); }

/* ---------- focus mode ---------- */
.focus-shell { min-height: 100vh; display: flex; flex-direction: column; }
.focus-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; }
.focus-top .logo { padding: 0; }
.focus-shell .flashes { max-width: 1040px; padding: 0 16px; }
.focus-main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 16px 72px; display: flex; flex-direction: column; gap: 56px; }
.focus-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.focus-main h1 { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 12px; }
.focus-main h2 { font-size: 16px; font-weight: 600; }
.focus-main .slot { min-height: 60px; font-size: 15px; }
.focus-main .slot-input { font-size: 15px; }
.timer-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); min-height: 340px; display: flex; }
.timer-card > * { width: 100%; }
.fs-timer { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; }
.fs-timer .timer-display { font-size: clamp(56px, 8vw, 84px); font-weight: 500; letter-spacing: -.04em; line-height: 1; min-width: 0; }
.focus-running .timer-card .timer-display { color: var(--switch-on); }
.focus-running .timer-card [data-status] { color: var(--switch-on); }
.btn.wide { min-width: 220px; min-height: 52px; font-size: 14px; }
.fs-intent { width: 100%; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.fs-working { font-size: 14px; font-weight: 500; color: var(--ink-2); max-width: 100%; overflow-wrap: anywhere; }
.fs-row { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.fs-row .toggle { border: 1px solid var(--line); }

/* full-screen focus view */
body.fs-locked { overflow: hidden; }
.fs-overlay {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: var(--bg); animation: fade .25s ease-out;
}
.fs-ov-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px; }
.fs-ov-top .logo { padding: 0; }
.fs-ov-top .toggle { border: 1px solid var(--line); background: var(--surface); }
.fs-ov-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 16px 64px; text-align: center; }
.fs-ov-label { font-size: 13px; color: var(--muted); margin-top: 8px; }
.fs-ov-main h1 { font-size: clamp(24px, 4vw, 40px); font-weight: 600; letter-spacing: -.02em; max-width: 900px; overflow-wrap: anywhere; line-height: 1.2; }
.fs-ov-task { font-size: 14px; color: var(--muted); }
.fs-ov-clock { font-size: clamp(72px, 16vw, 168px); font-weight: 500; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; margin: 24px 0 16px; }
.focus-running .fs-ov-clock, .focus-running [data-ov-status] { color: var(--switch-on); }
.fs-ov-main .btn { min-width: 160px; min-height: 52px; font-size: 14px; }
.fs-ov-hint { font-size: 12px; color: var(--faint); margin-top: 20px; }
@media (hover: none) { .fs-ov-hint { display: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.fs-details { display: flex; flex-direction: column; gap: 16px; animation: rise .2s ease-out; }
.fs-details h2 { font-size: 22px; letter-spacing: -.02em; }
.pick { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pick legend { padding: 0; margin-bottom: 8px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.fs-minutes { max-width: 140px; }
.fs-actions { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.fs-actions .btn.primary { margin-left: auto; }
.log-head { margin-bottom: 8px; }
.log-day { margin-top: 16px; }
.log-day h3 { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.log-day .r:first-of-type { border-top: 0; }
@media (max-width: 860px) {
  .focus-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* floating focus reminder */
.focus-pill {
  position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 2px;
  padding: 4px 4px 4px 6px; border-radius: 999px; background: var(--inv); color: var(--on-inv);
  box-shadow: var(--pop); max-width: min(420px, calc(100vw - 32px)); animation: rise .25s ease-out;
}
.pill-main { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 999px; color: inherit; text-decoration: none; min-width: 0; }
.pill-main:hover { background: color-mix(in srgb, var(--on-inv) 10%, transparent); }
.pill-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; }
.focus-pill.running .pill-dot { background: #3FBF7A; animation: pulse 2s ease-in-out infinite; }
.focus-pill.ended .pill-dot { background: #D9A143; }
.pill-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.pill-status { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.pill-what { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.pill-what:empty { display: none; }
.pill-clock { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill-btn { color: inherit; width: 40px; height: 40px; border-radius: 50%; }
.pill-btn:hover { background: color-mix(in srgb, var(--on-inv) 14%, transparent); color: inherit; }
.focus-pill .i-play, .focus-pill:not(.running) .i-pause { display: none; }
.focus-pill.running .i-pause { display: inline-flex; }
.focus-pill:not(.running) .i-play { display: inline-flex; }
.pill-btn span { display: inline-flex; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(63, 191, 122, .55); } 50% { box-shadow: 0 0 0 6px rgba(63, 191, 122, 0); } }
@media (max-width: 640px) { .focus-pill { right: 12px; left: 12px; bottom: 12px; max-width: none; } .pill-main { flex: 1; } .pill-clock { margin-left: auto; } }

/* ---------- login & sign up ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--inv); color: var(--on-inv); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side .logo-mark { background: var(--on-inv); color: var(--inv); }
.auth-side h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.02em; font-weight: 600; max-width: 420px; }
.pillars { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pillars span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--on-inv) 25%, transparent); }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.auth-switch { font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .lay { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
}
@media (max-width: 1000px) {
  .shell { flex-direction: column; }
  .side {
    position: sticky; top: 0; z-index: 20; width: auto; height: auto; flex-direction: row; align-items: center;
    padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; gap: 4px;
  }
  .logo { padding: 0 8px 0 0; }
  .logo-text { display: none; }
  .nav-list, .nav-group { flex-direction: row; flex: none; align-items: center; }
  .nav-label { padding: 0 6px 0 14px; margin-left: 6px; border-left: 1px solid var(--line); }
  .nav { min-height: 40px; }
  .top, .body, .flashes, .banner-wrap { padding-left: 16px; padding-right: 16px; }
  .s6, .s12 { grid-column: span 12; }
    .chore-split { grid-template-columns: 1fr; gap: 12px; }
  .event-fields { grid-template-columns: 1fr 1fr; }
  .event-fields .field:first-child { grid-column: 1 / -1; }
  .seen-line { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .seen-line .habit-count { display: none; }
  .seen-line .heat-row.weeks { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(13, 14px); }
  .seen-line .heat-row.weeks i { width: 14px; height: 14px; }
  .chore-nav { flex-direction: row; overflow-x: auto; border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line-soft); padding-bottom: 8px; }
  .chore-nav button { flex: none; }
  .todo-add.wide { grid-template-columns: 1fr 1fr; }
  .todo-add.wide .input:first-of-type { grid-column: 1 / -1; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 24px; gap: 24px; }
  .auth-side h2 { font-size: 24px; }
}
@media (max-width: 640px) {
  .top h1 { font-size: 22px; }
  .persona-name, .btn-label { display: none; }
  .toggle { padding: 0 10px 0 6px; font-size: 12px; }
  .cd { min-height: 64px; padding: 4px; }
  .cd b { width: 22px; height: 22px; font-size: 11px; }
  .ev { font-size: 0; height: 5px; padding: 0; border-radius: 3px; background: var(--ac); }
  .more { display: none; }
  .cols { grid-template-columns: 1fr; }
  .habit-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .habit-row .grip { grid-row: 1 / span 2; }
  .habit-row select { grid-column: 2; }
  .habit-row [data-remove-row] { grid-row: 1 / span 2; grid-column: 3; }
  .todo-add.wide { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* inside a page column, the column's gap does the spacing */
.lc > .page-actions, .lc > .habit-tile, .lc > .card.empty-cta, .lc > .stats { margin-bottom: 0; }
.grid-head + .habit-line { border-top: 0; }

/* dashboard: three habits side by side, chores in a full-width row underneath */


/* dashboard: this week at a glance */
.kpis { margin-bottom: 24px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpis .stat { display: flex; flex-direction: column; gap: 2px; }
.kpis .stat .m { margin-bottom: 4px; }
.kpi-of { font-size: 15px; font-weight: 500; color: var(--muted); }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi-sub .up { color: var(--ok); font-weight: 600; }
.kpi-sub .down { color: var(--danger); font-weight: 600; }
.stat.warn-soft { border-top: 3px solid #D9A143; }
.dash-chores { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.dash-chores h3 { font-size: 14px; font-weight: 600; }
.dash-chore-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 28px; margin-top: 4px; }
.dash-chore-list .task { border-top: 1px solid var(--line-soft); }

/* set-up: your closest people */
.person-rows { display: flex; flex-direction: column; gap: 8px; }
.person-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 130px 140px 36px; gap: 8px; align-items: center; animation: rise .15s ease-out; }
.person-head { font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: -2px; animation: none; }

/* sidebar: Try Couple Mode (Beta) */
.nav-couple { border: 0; background: none; width: 100%; cursor: pointer; font: inherit; text-align: left; }
.beta { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; background: var(--tint, #FBE4EC); color: var(--tx, #7D2343); }
.nav-couple { --tint: #FBE4EC; --tx: #7D2343; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav-couple { --tint: #3A1C27; --tx: #F5B5CA; } }
:root[data-theme="dark"] .nav-couple { --tint: #3A1C27; --tx: #F5B5CA; }

@media (max-width: 1000px) {
  .nav-couple { width: auto; }
  .nav-couple .beta { margin-left: 6px; }
}
@media (max-width: 640px) {
  .habit-line { grid-template-columns: 44px minmax(0, 1fr); --dots-w: auto; }
  .habit-line .dots { grid-column: 1 / -1; grid-template-columns: repeat(7, 1fr); justify-items: center; }
  .habit-line.grid-head { display: none; }
  .person-row { grid-template-columns: 1fr 1fr auto; }
  .person-head { display: none; }
  .person-row select, .person-row [type="date"] { grid-column: span 1; }
}

/* ---------- reading list ---------- */
.add-book { padding: 16px 20px; }
.book-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) auto auto; gap: 12px; align-items: end; }
.book-seg { display: flex; border: 1px solid var(--field); border-radius: 8px; padding: 3px; gap: 2px; height: 44px; }
.book-seg label { display: inline-flex; }
.book-seg input { position: absolute; opacity: 0; pointer-events: none; }
.book-seg span { display: inline-flex; align-items: center; padding: 0 12px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.book-seg label:hover span { color: var(--ink); background: var(--sunken); }
.book-seg input:checked + span { background: var(--tint); color: var(--tx); }
.book-seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.chip-n { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }

.book-group { margin-bottom: 28px; }
.book-group > .card-sub { display: flex; align-items: center; gap: 2px; margin-top: 0; }
.book-group > .card-sub .m { margin-left: 6px; font-weight: 500; letter-spacing: 0; }
.books { display: flex; flex-direction: column; gap: 10px; }

.book { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; transition: border-color .15s; }
.book:hover, .book[open] { border-color: var(--field); }
.book > summary { display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 0; cursor: pointer; list-style: none; }
.book > summary::-webkit-details-marker { display: none; }
.book > summary:focus-visible { outline-offset: -2px; border-radius: var(--r); }
.book-spine { align-self: stretch; width: 4px; margin: -14px 0; background: var(--ac); flex: none; }
.book-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.book-title { font-size: 15px; font-weight: 600; letter-spacing: -.005em; overflow-wrap: anywhere; }
.book-peek { margin-top: 6px; font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; border-left: 2px solid var(--tint); padding-left: 10px; }
.book[open] .book-peek { display: none; }
.book-end { display: flex; align-items: center; gap: 8px; flex: none; color: var(--faint); }
.book-end .icon { transition: transform .2s; }
.book[open] .book-end .icon { transform: rotate(180deg); }
.tag.empty-tag { background: var(--sunken); color: var(--faint); }

.book-body { display: flex; flex-direction: column; gap: 14px; padding: 2px 20px 18px 18px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.insight-form { display: flex; flex-direction: column; gap: 8px; }
.insight-form textarea { min-height: 64px; }
@media (hover: none) { .kbd-hint { visibility: hidden; } }
.insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.insights li { background: var(--sunken); border-radius: 10px; padding: 10px 6px 6px 14px; border-left: 3px solid var(--ac); }
.insights p { white-space: pre-wrap; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; padding-right: 8px; }
.insight-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.insight-meta .icon-btn { width: 32px; height: 32px; }
.book-acts { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.book-acts .fl { gap: 8px; }
.book-edit { position: relative; }
.book-edit > summary { list-style: none; }
.book-edit > summary::-webkit-details-marker { display: none; }
.book-edit[open] > summary { background: var(--sunken); }
.book-edit > form {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; width: min(320px, calc(100vw - 48px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--pop);
}

@media (max-width: 1180px) {
  .book-form { grid-template-columns: 1fr 1fr; }
  .bf-title { grid-column: 1 / -1; }
  .book-seg-field { justify-self: start; }
  .book-form .btn { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .book-form { grid-template-columns: 1fr; }
  .book-seg-field { justify-self: stretch; }
  .book-seg label { flex: 1; }
  .book-seg span { flex: 1; justify-content: center; }
  .book > summary { gap: 10px; padding-right: 12px; }
  .book-body { padding-left: 14px; padding-right: 14px; }
  .book-end .tag { display: none; }
}

/* ---------- reading focus ---------- */
.rf-form { gap: 14px; }
.rf-books { display: flex; flex-direction: column; gap: 6px; max-height: min(46vh, 380px); overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.rf-sub { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 2px; }
.rf-book { position: relative; display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; transition: border-color .15s, background .15s; }
.rf-book:hover { border-color: var(--field); }
.rf-book input { position: absolute; opacity: 0; pointer-events: none; }
.rf-spine { width: 4px; flex: none; background: var(--ac); }
.rf-text { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; min-width: 0; }
.rf-text strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.rf-book:has(input:checked) { border-color: var(--ac); background: var(--tint); }
.rf-book:has(input:checked) .rf-text .m { color: var(--tx); }
.rf-book:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.rf-error { color: var(--danger); }

.fs-overlay.with-notes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 460px); grid-template-rows: auto minmax(0, 1fr); }
.fs-overlay.with-notes .fs-ov-top { grid-column: 1 / -1; }
.fs-overlay.with-notes .fs-ov-clock { font-size: clamp(64px, 10vw, 136px); }
.fs-notes { display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow-y: auto; padding: 8px 24px 32px; border-left: 1px solid var(--line); }
.fs-note-form { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.fs-notes-h { font-size: 15px; font-weight: 600; }
.fs-note-form textarea { min-height: 120px; font-size: 14px; }
.fs-note-list li { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; }
.fs-note-list li.fresh { animation: rise .25s ease-out; }
.fs-note-empty { text-align: center; padding: 8px 12px; }

@media (max-width: 900px) {
  .fs-overlay.with-notes { display: flex; overflow-y: auto; }
  .fs-overlay.with-notes .fs-ov-main { flex: none; padding-bottom: 24px; }
  .fs-overlay.with-notes .fs-ov-clock { font-size: clamp(56px, 18vw, 96px); margin: 12px 0 8px; }
  .fs-notes { border-left: 0; border-top: 1px solid var(--line); overflow: visible; padding: 20px 16px 32px; }
}

/* ---------- heads up links ---------- */
.notice .r-main { gap: 2px; }
.notice-link { color: inherit; text-decoration: none; }
.notice-link:hover strong { text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 3px; }
.notice-more { padding-top: 10px; border-top: 1px solid var(--line-soft); }

/* ---------- editing a to-do in place ---------- */
.task { flex-wrap: wrap; }
.task.editing > .task-text, .task.editing > .task-acts { display: none; }
.task > form.task-edit { display: flex; flex: 1 1 0; min-width: 0; flex-direction: column; gap: 8px; padding: 8px 0 12px; }
.task > form.task-edit[hidden] { display: none; }
.task-edit-opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.task-edit-opts select.input, .task-edit-opts input[type="date"] { width: auto; flex: 1 1 120px; min-height: 36px; }
.task-edit-opts .btn { flex: none; }
.task-edit-opts .btn.primary { margin-left: auto; }
