/* The Hub's typefaces, served from the Hub itself (FND-1).
   Pages never fetch fonts from a third party, so they paint on a LAN with no internet route.
   Variable fonts: one file covers every weight. Files come from Fontsource (@fontsource-variable,
   v5.3.0) under the SIL Open Font License; licences sit beside the files (OFL-*.txt).
   unicode-range matches Google's latin / latin-ext / thai subsets, so the browser downloads a file
   only when a page uses one of its characters. Characters none of these fonts contain (℃, →, ✓)
   fall back to the next font in each stack (system-ui), exactly as they did with Google Fonts. */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("/static/fonts/dm-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("/static/fonts/dm-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: italic;
  font-display: swap;
  font-weight: 100 1000;
  src: url("/static/fonts/dm-sans-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/static/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/static/fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/static/fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url("/static/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Thai script for Practice Room's Thai decks (only the Thai block; Latin text in .thai elements
   falls through to the next font in the stack). */
@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/noto-sans-thai-thai-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
/* Hub stylesheet: one file, loaded by every page.
 *
 * Merged from eight files (style, ui-refresh, notes-knowledge, tag-chips, notes-flow,
 * unified-capture, project-home, resurfacing). Sections keep their original order, so the
 * cascade is unchanged; declarations that a later identical selector always overrode
 * have been removed. Put new rules in the section for their area rather than appending
 * overrides at the end — that pattern is how the collapsed-sidebar width bug happened.
 */

/* ======================================================================
   style
   ====================================================================== */
/* Hub productivity theme: restrained, high-contrast neutrals with a single muted indigo accent. */
:root {--caret:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23405979' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");color-scheme:light}
@media(prefers-color-scheme:dark) {
  :root {--shadow-sm:none;--caret:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23AFC6E1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");color-scheme:dark}
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {margin:0;color:var(--ink);font:15px/1.55 var(--body);-webkit-font-smoothing:antialiased}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible {border-radius:4px}
h1, h2, h3 {font-weight:650;margin:0;line-height:1.18}

h2 { font-size: 1.1rem; margin-bottom: .75rem; }
h3 {font-size:.9rem;color:var(--muted);margin:1.15rem 0 .45rem;letter-spacing:-.005em}
code { font-family: var(--mono); font-size: .88em; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { color: var(--muted); margin: .25rem 0; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* ----- shell ----- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.sidebar {position:sticky;top:0;height:100vh;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;scrollbar-width:thin}
.side-top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: 0 .1rem .8rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font: 650 1.3rem/1 var(--display); color: var(--ink); letter-spacing: -.03em; }
.brand:hover { text-decoration: none; }
.brand-mark {width:28px;height:28px;border-radius:9px;display:grid;place-items:center;flex-shrink:0}
.brand-mark svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.side-toggle { border: 0; background: transparent; color: var(--faint); border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; }
.side-toggle:hover { background: var(--sunk); color: var(--ink); }
.side-actions { display: flex; gap: .4rem; margin-bottom: .5rem; }
.side-actions .nav-search { flex: 1; margin: 0; }
.side-new { width: 38px; padding: 0; flex-shrink: 0; border-radius: 10px; }
.nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-heading { font-size: .72rem; font-weight: 600; color: var(--faint); padding: .85rem .65rem .25rem; letter-spacing: .01em; text-transform: none; }
.nav a, .nav-settings, .nav-projects-toggle {
  display: flex; align-items: center; gap: .65rem; padding: .36rem .6rem; border-radius: 9px;
  color: var(--muted); font-weight: 500; font-size: .9rem; position: relative; border: 1px solid transparent;
}
.nav a:hover, .nav-settings:hover, .nav-projects-toggle:hover { background: var(--sunk); color: var(--ink); text-decoration: none; }
.nav a.on, .nav-settings.on {font-weight:600;border-color:var(--line);box-shadow:var(--shadow-sm)}

.nav .badge { margin-left: auto; font-size: .72rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0 .45rem; line-height: 1.5; }
.nav-projects { display: flex; flex-direction: column; }
.nav-projects-row { display: flex; align-items: center; }
.nav-projects-row > a { flex: 1; }
.nav-caret { border: 0; background: transparent; color: var(--faint); width: 28px; height: 28px; border-radius: 7px; cursor: pointer; display: grid; place-items: center; }
.nav-caret:hover { background: var(--sunk); color: var(--ink); }
.nav-caret svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.nav-projects.open .nav-caret svg { transform: rotate(90deg); }
.nav-sub { display: none; flex-direction: column; margin: .1rem 0 .3rem 1.45rem; padding-left: .55rem; border-left: 1px solid var(--line); max-height: 260px; overflow: auto; }
.nav-projects.open .nav-sub { display: flex; }
.nav-sub a { padding: .3rem .5rem; font-size: .87rem; font-weight: 400; }
.nav-sub a .pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; }
.nav-sub a.on .pdot { background: var(--accent); }
.nav-foot {padding-top:.6rem;border-top:1px solid var(--line)}
.main {display:flex;flex-direction:column}
.main > * { min-width: 0; }
.main.wide { max-width: none; }

/* collapsed sidebar: an icon rail */
.side-collapsed { --side: 70px; }
.side-collapsed .sidebar { padding-inline: .6rem; align-items: center; }
.side-collapsed .brand-text, .side-collapsed .nav-heading, .side-collapsed .nav a span, .side-collapsed .nav-settings span,
.side-collapsed .nav-search span, .side-collapsed .nav-search kbd, .side-collapsed .nav-sub, .side-collapsed .nav-caret,
.side-collapsed .nav .badge, .side-collapsed .side-new { display: none !important; }
.side-collapsed .side-top { flex-direction: column; gap: .6rem; }
.side-collapsed .side-toggle svg { transform: rotate(180deg); }
.side-collapsed .nav a, .side-collapsed .nav-settings { justify-content: center; padding: .55rem; }
.side-collapsed .nav-search { justify-content: center; padding: .55rem; }
.side-collapsed .nav-group + .nav-group { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .5rem; }
.side-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }

/* mobile tab bar */
.tabbar { display: none; }
.drawer-backdrop { display: none; }

/* ----- building blocks ----- */
.page-head {display:flex;justify-content:space-between;gap:.75rem;flex-wrap:wrap}
.page-head p { margin: .25rem 0 0; color: var(--muted); max-width: 68ch; }
.crumb { font-size: .86rem; color: var(--muted); margin-bottom: .3rem; display: inline-block; }
.panel {border:1px solid var(--line);border-radius:var(--r-panel);padding:.95rem 1.05rem;box-shadow:var(--shadow);min-width:0}
.panel > h2:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.panel > h2 a { font: 500 .84rem var(--body); letter-spacing: 0; }
a.panel { color: var(--ink); display: block; transition: border-color .15s, transform .15s, box-shadow .15s; }
a.panel:hover { border-color: var(--line-strong); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow), 0 12px 28px -16px rgba(68,23,78,.28); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 1rem; align-items: start; }
.span-all { grid-column: 1 / -1; }
.row { display: flex; gap: .5rem; align-items: center; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.chip, .epic-chip, .status-pill, .level-tag, .repeat-tag, .idea-state {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; line-height: 1.5; padding: .1rem .55rem;
  border-radius: var(--r-chip); background: var(--chip-bg); color: var(--chip-ink); white-space: nowrap; font-weight: 600;
  border: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
a.chip:hover { color: var(--accent); text-decoration: none; background: var(--accent-soft); }

.chip.due { background: var(--focus-soft); color: var(--high); }
.chip.on, a.chip.on:hover { background: var(--accent); color: var(--accent-ink); }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.eyebrow { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: 0; text-transform: none; margin-bottom: .15rem; }
.count { font-variant-numeric: tabular-nums; }

/* ----- forms ----- */
.input {font:inherit;color:var(--ink);border:1px solid var(--line-strong);padding:.52rem .72rem;min-width:0;width:100%;transition:border-color .15s, box-shadow .15s}
.input::placeholder { color: var(--faint); }
select, select.input { appearance: none; -webkit-appearance: none; background: var(--surface) var(--caret) no-repeat right .6rem center / 15px;
  padding-right: 2rem; cursor: pointer; }
select.input { width: auto; max-width: 100%; }
select option { background: var(--surface); color: var(--ink); }
.input:hover { border-color: var(--faint); }
.input:focus {outline:none;border-color:var(--accent)}
.input.sm { padding: .28rem .55rem; font-size: .85rem; border-radius: 8px; }
select.input.sm { padding-right: 1.7rem; background-position: right .45rem center; background-size: 13px; }
textarea.input { resize: vertical; line-height: 1.6; }
label.field { display: flex; flex-direction: column; gap: .3rem; font-size: .84rem; color: var(--muted); font-weight: 500; }
label.check { display: flex; align-items: center; gap: .5rem; font-size: .92rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-card); padding: .6rem .8rem; display: flex; flex-direction: column; gap: .35rem; margin: 0; }
legend { font-size: .84rem; color: var(--muted); padding: 0 .3rem; }
.btn {display:inline-flex;align-items:center;justify-content:center;gap:.4rem;font:500 .92rem var(--body);cursor:pointer;padding:.5rem .95rem;border:1px solid var(--line-strong);background:var(--surface);color:var(--ink);white-space:nowrap;box-shadow:var(--shadow-sm)}
.btn:hover { border-color: var(--faint); text-decoration: none; }

.btn.sm { padding: .26rem .62rem; font-size: .82rem; border-radius: 8px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { background: var(--sunk); color: var(--ink); }
.btn.danger { color: var(--urgent); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn .icon { width: 16px; height: 16px; }
.inline-form { display: inline; margin: 0; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* ----- Today ----- */
.today-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 1.5rem; align-items: end; padding: .4rem 0 .2rem; }
.today-hero h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -.03em; margin-top: .2rem; }
.today-hero .today-subtitle { margin: .5rem 0 0; font-size: 1.02rem; max-width: 52ch; }
.today-hero .today-subtitle strong { color: var(--ink); }
/* the one loud thing: marigold is reserved for "now" */
.now {position:relative;overflow:hidden;border-radius:var(--r-panel);padding:1rem 1.1rem 1.05rem 1.35rem;border:1px solid var(--line);box-shadow:var(--shadow)}
.now::before {content:"";position:absolute;inset:0 auto 0 0;width:5px}
.now-label { display: block; font: 600 .9rem var(--display); margin-bottom: .55rem; }
.now .when { color: var(--muted); margin: 0 0 .25rem; }
.now-ask { display: flex; gap: .5rem; }
.answer {
  margin-top: .8rem; font: 500 1.02rem/1.5 var(--body);
  background: var(--focus-soft); border-radius: var(--r-card); padding: .85rem 1rem;
}
.answer .src { display: block; font: 400 .8rem var(--body); color: var(--muted); margin-top: .5rem; letter-spacing: 0; }

.vitals { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
.vital { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; border-radius: var(--r-card); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); transition: border-color .15s, transform .15s; }
.vital:hover { text-decoration: none; border-color: var(--line-strong); transform: translateY(-1px); }
.vital-icon {width:42px;height:42px;border-radius:12px;display:grid;place-items:center;flex-shrink:0}
.vital-icon .icon { width: 20px; height: 20px; }
.vital-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.vital-body strong { font: 650 1.25rem var(--display); letter-spacing: -.02em; }
.vital-body span { font-size: .82rem; color: var(--muted); }
.ring { --ring: var(--accent); width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--ring) calc(var(--p) * 1%), var(--sunk) 0); }
.ring > span { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font: 600 .66rem var(--body); color: var(--muted); font-variant-numeric: tabular-nums; }

.allday { margin-bottom: .7rem; }
.allday .chip { background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--ink); }
.dot {flex-shrink:0}
.ribbon { position: relative; padding-bottom: 1.4rem; }
.ribbon-track { position: relative; height: 54px; border-radius: 12px; background:
  repeating-linear-gradient(90deg, transparent 0 calc(100% / 15 - 1px), var(--line) calc(100% / 15 - 1px) calc(100% / 15)), var(--surface-2);
  border: 1px solid var(--line); overflow: hidden; }
.ribbon-gap { position: absolute; top: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; }
.ribbon-gap em { font: 500 .68rem var(--body); font-style: normal; color: var(--story); background: color-mix(in srgb, var(--story) 10%, var(--surface)); padding: 0 .4rem; border-radius: 99px; white-space: nowrap; }
.ribbon-block { position: absolute; top: 6px; bottom: 6px; border-radius: 8px; padding: 0 .45rem; display: flex; align-items: center; overflow: hidden;
  background: color-mix(in srgb, var(--c) 20%, var(--surface)); border-left: 3px solid var(--c); color: var(--ink); }
.ribbon-block b { font: 600 .74rem var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ribbon-block.past { opacity: .5; }
.ribbon-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--focus); border-radius: 2px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.ribbon-now::before { content: ""; position: absolute; top: -2px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--focus); }
.ribbon-hours { position: absolute; left: 0; right: 0; bottom: 0; height: 1.2rem; }
.ribbon-hours span { position: absolute; transform: translateX(-50%); font-size: .7rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.ribbon-hours span:first-child { transform: none; }
.ribbon-hours span:last-child { transform: translateX(-100%); }
.day-list { list-style: none; margin: .6rem 0 0; padding: 0; }
.day-list li { display: flex; align-items: center; gap: .65rem; padding: .45rem 0; border-top: 1px solid var(--line); font-size: .93rem; }
.day-list li:first-child { border-top: 0; }
.day-list li.past { color: var(--faint); }
.day-list .time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 6.4rem; }
.day-list small { color: var(--muted); }
.later { margin-top: .6rem; border-top: 1px solid var(--line); padding-top: .55rem; }
.later > summary { font-size: .88rem; color: var(--muted); font-weight: 500; }
.later > summary .count { color: var(--faint); }

.sprint-strip { display: flex; align-items: center; gap: 1rem; padding: .65rem .8rem; margin-bottom: .6rem; border-radius: var(--r-card);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.sprint-strip:hover { text-decoration: none; border-color: var(--line-strong); }
.sprint-strip small { display: block; color: var(--muted); font-size: .8rem; }
.sprint-strip .meter { width: 34%; min-width: 90px; }
.focus-cards { display: flex; flex-direction: column; }
.top3 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.top3 li { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: var(--r-card); background: var(--surface-2); border: 1px solid var(--line); }
.top3 .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 650 .85rem var(--display); flex-shrink: 0; }
.top3 li.done .grow { text-decoration: line-through; color: var(--muted); }
.top3 li.done .n { background: var(--ok); color: #fff; }
.focus-list li { padding: .25rem 0 .25rem 1rem; position: relative; }
.focus-list li::before { content: ""; position: absolute; left: 0; top: .78rem; width: 6px; height: 6px; border-radius: 50%; background: var(--focus); }
.keep-going { display: flex; flex-direction: column; gap: .5rem; }
.kg { display: flex; align-items: center; gap: .75rem; padding: .55rem .65rem; border-radius: var(--r-card); color: var(--ink); border: 1px solid var(--line); }
.kg:hover { text-decoration: none; background: var(--surface-2); }
.kg small { display: block; color: var(--muted); font-size: .8rem; }
.kg-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--sunk); color: var(--muted); flex-shrink: 0; }
@media (max-width: 860px) {
  .today-hero { grid-template-columns: 1fr; gap: 1rem; }
  .vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .vital { padding: .7rem; gap: .6rem; }
  .vital-icon, .ring { width: 36px; height: 36px; }
  .ring > span { width: 28px; height: 28px; font-size: .6rem; }
  .vital-body strong { font-size: 1.05rem; }
  .ribbon-block b { display: none; }
  .day-list .time { min-width: 5.6rem; font-size: .76rem; }
}

/* ----- lists ----- */
.row-link { display: flex; align-items: center; gap: .65rem; padding: .5rem .55rem; margin: 0 -.55rem; border-radius: 8px; color: var(--ink); }
.row-link:hover { background: var(--sunk); text-decoration: none; }
.row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { display: flex; gap: .45rem; align-items: center; flex-shrink: 0; color: var(--muted); font-size: .84rem; }
.type {
  font-size: .7rem; font-weight: 600; padding: .05rem .42rem; border-radius: 5px; color: #fff; flex-shrink: 0;
  text-transform: capitalize;
}
.t-epic { background: var(--epic); } .t-story { background: var(--story); } .t-bug { background: var(--bug); } .t-task { background: var(--task); }
.pri { font-size: .78rem; font-weight: 600; }
.p-high { color: var(--high); } .p-urgent { color: var(--urgent); }
.due { font-size: .82rem; color: var(--muted); }
.due.overdue { color: var(--urgent); font-weight: 600; }
.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.goal.maint .goal-title { color: var(--muted); }
.stats li { display: flex; justify-content: space-between; }
.meter { display: block; height: 8px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

/* ----- todos ----- */
.todos { list-style: none; padding: 0; margin: 0; }
.todo { display: flex; align-items: center; gap: .55rem; padding: .4rem 0; border-top: 1px solid var(--line); }
.todo:first-child { border-top: 0; }
.todo-title { flex: 1; min-width: 0; }
.todo.is-done .todo-title { color: var(--faint); text-decoration: line-through; }
.tick { position: relative; display: inline-flex; cursor: pointer; }
.tick input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tick span { width: 20px; height: 20px; border-radius: 6px; border: 1.8px solid var(--faint); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.pri-high .tick span { border-color: var(--high); } .pri-urgent .tick span { border-color: var(--urgent); }
.tick input:checked + span { background: var(--ok); border-color: var(--ok); }
.tick input:checked + span::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.tick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.todo-group h3 { display: flex; gap: .4rem; align-items: baseline; }
.todo-group h3 .count { color: var(--faint); font-weight: 400; }
.todo-group.overdue h3 { color: var(--urgent); }
.todo details { flex: 1; min-width: 0; }
.todo details[open] { padding-bottom: .4rem; }
.todo details summary { display: flex; align-items: center; gap: .7rem; }
.edit-box { margin-top: .6rem; display: flex; flex-direction: column; gap: .5rem; }
.quick-add { display: flex; gap: .5rem; flex-wrap: wrap; }
.quick-add .grow { min-width: 220px; }

/* ----- tabs ----- */
.tabs {border-bottom:1px solid var(--line)}
.tabs a { padding: .55rem .85rem; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }

/* ----- board ----- */
/* Scoped Kanban column editor: form-first for mobile, keyboard and no-JS use. */
.board-column-manager { margin: .8rem 0; }
.board-column-manager > summary { cursor: pointer; font-size: .93rem; min-height: 44px; display: flex; align-items: center; gap: .4rem; }
.board-column-manager > p { margin: .7rem 0; }
.board-column-manager-list { display: grid; gap: .35rem; margin: .75rem 0; }
.board-column-manager-row { display: flex; gap: .65rem; flex-wrap: wrap; align-items: end; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.board-column-title-form { flex: 1 1 235px; align-items: end; }
.board-column-title-form > .field { flex: 1; min-width: 150px; }
.board-column-manager-actions { align-items: center; }
.board-column-new { align-items: end; margin-top: 1rem; }
.board-column-new .field { flex: 1 1 170px; max-width: 420px; }
.board-col-heading { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; }
.board-col-heading > span { overflow-wrap: anywhere; }
.board-column-grip { min-width: 44px; min-height: 44px; flex: 0 0 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; cursor: grab; }
.board-column-grip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-column-key].board-column-dragging { opacity: .5; }
[data-column-key].board-column-drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
@media (max-width: 600px) { .board-column-manager-row { align-items: stretch; } .board-column-manager-actions { width: 100%; } }

.board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; max-width: 100%; }
.column { background: var(--sunk); border-radius: var(--r-panel); padding: .65rem; min-height: 260px; display: flex; flex-direction: column; flex: 0 0 clamp(220px, 22vw, 310px); min-width: 0; }
.column.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.column > h3 { margin: .1rem .25rem .65rem; color: var(--ink); display: flex; justify-content: space-between; font-weight: 600; }
.column > h3 .count { color: var(--faint); font-weight: 400; }
.dropzone { display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: .65rem .7rem; display: flex; flex-direction: column; gap: .35rem; cursor: grab; }
.kcard:hover { border-color: var(--faint); }
.kcard.dragging { opacity: .45; }
.kcard-title { color: var(--ink); font-weight: 500; line-height: 1.35; }
.kcard .meta { display: flex; flex-wrap: wrap; gap: .3rem .6rem; font-size: .78rem; color: var(--muted); }
.sprint-bar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.sprint-bar .goal { color: var(--muted); }
.progress { display: flex; align-items: center; gap: .55rem; font-size: .85rem; color: var(--muted); }
.progress .meter { width: 140px; }
.add-card { display: flex; gap: .5rem; flex-wrap: wrap; }
.add-card .grow { min-width: 220px; }

/* ----- backlog / planning ----- */
.plan-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .4rem; }
.plan-head h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.plan-row { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.plan-row a.title { flex: 1; min-width: 0; color: var(--ink); }
.status-pill.s-active { background: var(--focus-soft); color: var(--high); }
.status-pill.s-completed { background: var(--sunk); color: var(--faint); }

/* ----- notes ----- */
.notes-layout {display:grid;grid-template-columns:220px 1fr}
.facets { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; }
.facets h3 { margin: 0 0 .3rem; }
.facet-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1px; }
.facet-list a { display: flex; justify-content: space-between; gap: .5rem; padding: .28rem .5rem; border-radius: 6px; color: var(--ink); font-size: .9rem; }
.facet-list a:hover { background: var(--sunk); text-decoration: none; }
.facet-list a.on { background: var(--accent-soft); color: var(--accent); }
.facet-list .n { color: var(--faint); font-size: .8rem; }
.facet-list .depth-1 { padding-left: 1.3rem; } .facet-list .depth-2 { padding-left: 2.1rem; }
.note-filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.note-filters .grow { min-width: 200px; }
.note-list { display: flex; flex-direction: column; }
.note-row { display: block; padding: .8rem .2rem; border-top: 1px solid var(--line); color: var(--ink); }
.note-row:first-child { border-top: 0; }
.note-row:hover { text-decoration: none; background: linear-gradient(90deg, var(--sunk), transparent); }
.note-row .title { font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.note-row .title .icon { width: 14px; height: 14px; color: var(--high); }
.note-row .excerpt { color: var(--muted); font-size: .9rem; margin: .15rem 0 .35rem; overflow-wrap: anywhere; }
.note-row .meta { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--faint); }

.note-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.note-side { display: flex; flex-direction: column; gap: 1rem; }
.title-input { font: 650 1.7rem var(--display); letter-spacing: -.015em; border: 0; background: transparent; padding: .2rem 0; width: 100%; color: var(--ink); }
.title-input:focus { outline: none; box-shadow: none; }
.meta-fields { display: flex; gap: .6rem; flex-wrap: wrap; }
.meta-fields .field { min-width: 150px; }
.meta-fields .field.grow { flex: 1; }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.editor-pane { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); overflow: hidden; }
.editor-pane textarea { border: 0; border-radius: 0; min-height: 62vh; font: 400 .92rem/1.7 var(--mono); padding: 1rem 1.1rem; background: transparent; }
.editor-pane textarea:focus { box-shadow: none; }
.editor .preview { min-height: 62vh; }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: .4rem; border-bottom: 1px solid var(--line); background: var(--sunk); }
.md-toolbar button { font: 500 .82rem var(--body); color: var(--ink); background: transparent; border: 0; border-radius: 6px; padding: .3rem .5rem; cursor: pointer; min-width: 2rem; }
.md-toolbar button:hover { background: var(--surface); }
.md-toolbar .sep { width: 1px; background: var(--line); margin: .2rem .25rem; }
.md-toolbar.compact { border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-card) var(--r-card) 0 0; }
.md-toolbar.compact + textarea { border-top-left-radius: 0; border-top-right-radius: 0; display: block; }

.prose { line-height: 1.7; overflow-wrap: anywhere; max-width: 72ch; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3 { margin: 1.3em 0 .45em; color: var(--ink); }
.prose h1 { font-size: 1.5rem; } .prose h2 { font-size: 1.25rem; } .prose h3 { font-size: 1.07rem; font-weight: 650; }
.prose pre { background: var(--sunk); padding: .8rem 1rem; border-radius: var(--r-card); overflow-x: auto; }
.prose code { background: var(--sunk); padding: .1em .35em; border-radius: 4px; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { margin: 0; padding: .1rem 1rem; border-left: 3px solid var(--accent); color: var(--muted); }
.prose table { border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: .4rem .7rem; text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.prose ul.contains-task-list { list-style: none; padding-left: .2rem; }
.prose .task-list-item { display: flex; gap: .55rem; align-items: baseline; }
.prose .task-list-item-checkbox { accent-color: var(--ok); width: 16px; height: 16px; transform: translateY(2px); cursor: pointer; flex-shrink: 0; }
.prose .task-list-item:has(> input:checked) { color: var(--faint); text-decoration: line-through; }
.preview .task-list-item-checkbox { pointer-events: none; }

/* ----- ideas ----- */
.idea-grid {display:grid}
.idea {display:flex;flex-direction:column;gap:.55rem}
.idea.s-exploring { border-top: 3px solid var(--accent); }
.idea.s-parked { opacity: .78; }
.idea h2 { font-size: 1.05rem; margin: 0; }

.idea .excerpt { color: var(--muted); font-size: .9rem; margin: 0; overflow-wrap: anywhere; }
.idea footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ----- goals ----- */

/* ----- chat ----- */
.chat-log { display: flex; flex-direction: column; gap: .65rem; min-height: 45vh; }
.msg { max-width: min(85%, 640px); padding: .7rem .95rem; border-radius: 14px; line-height: 1.55; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-form { position: sticky; bottom: 1rem; display: flex; gap: .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: .5rem; }
.chat-form .input { border: 0; }
.chat-form .input:focus { box-shadow: none; }
.suggestions { display: flex; gap: .4rem; flex-wrap: wrap; }
.suggestions button { font: inherit; font-size: .85rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 99px; padding: .3rem .75rem; cursor: pointer; }
.suggestions button:hover { border-color: var(--accent); }

/* ----- settings ----- */
.setting-section { display: grid; grid-template-columns: 250px 1fr; gap: 1.5rem; padding: 1.5rem 0; border-top: 1px solid var(--line); }
.setting-section:first-of-type { border-top: 0; padding-top: .5rem; }
.setting-section > div:first-child p { color: var(--muted); font-size: .9rem; margin: .4rem 0 0; }
.cal-row {display:flex;gap:.7rem;border-top:1px solid var(--line)}
.cal-row:first-child { border-top: 0; }
.cal-swatch { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.cal-row .url { color: var(--faint); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.cal-row.off { opacity: .55; }
.test-result { font-size: .9rem; padding: .7rem .9rem; border-radius: var(--r-card); background: var(--sunk); }
.test-result.ok { background: var(--accent-soft); }
.test-result.bad { background: color-mix(in srgb, var(--urgent) 12%, var(--surface)); color: var(--urgent); }
.howto { border: 1px solid var(--line); border-radius: var(--r-card); padding: .7rem .9rem; background: var(--surface); }
.howto summary { font-weight: 600; }
.howto ol { margin: .6rem 0 .2rem; padding-left: 1.2rem; color: var(--muted); }
.howto ol li { margin: .2rem 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.2rem; margin: 0; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.ok-dot, .off-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; }
.ok-dot { background: var(--ok); } .off-dot { background: var(--faint); }

/* ----- hierarchy ----- */
.tree-row { display: flex; align-items: center; gap: .55rem; padding: .42rem 0; border-top: 1px solid var(--line); }
.tree-row a.title { flex: 1; min-width: 0; color: var(--ink); }
.tree-row.depth-1 { padding-left: 1.6rem; position: relative; }
.tree-row.depth-2 { padding-left: 3.2rem; position: relative; }
.tree-row.depth-1::before, .tree-row.depth-2::before { content: ""; position: absolute; top: 0; bottom: 50%; width: .7rem; border-left: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); border-bottom-left-radius: 5px; }
.tree-row.depth-1::before { left: .6rem; } .tree-row.depth-2::before { left: 2.2rem; }
.tree-row.is-done a.title { color: var(--faint); text-decoration: line-through; }
.status-pill.s-doing { background: var(--accent-soft); color: var(--accent); }
.status-pill.s-review { background: var(--focus-soft); color: var(--high); }
.status-pill.s-done { color: var(--ok); }
.epic-panel { border-left: 4px solid var(--epic); }

/* ----- reading ----- */
.faint { color: var(--faint); }
.shelf { padding: .3rem 1.2rem; }
.book-row { display: flex; align-items: center; gap: .9rem; padding: .7rem 0; border-top: 1px solid var(--line); }
.book-row:first-child { border-top: 0; }
.spine { width: 6px; align-self: stretch; border-radius: 3px; flex-shrink: 0; min-height: 2.4rem; }
.book-main { flex: 1; min-width: 0; }
.book-title { font: 600 1.02rem/1.3 var(--display); letter-spacing: -.01em; color: var(--ink); }
.book-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-top: .25rem; font-size: .86rem; color: var(--muted); }
.book-meta > a:not(.chip) { color: var(--muted); }
.book-meta > a:not(.chip):hover { color: var(--ink); }
.book-row.s-read .book-title, .book-row.s-dnf .book-title { color: var(--muted); }
.stars { color: var(--line); letter-spacing: .05em; }
.stars .on, .stars:not(:has(span)) { color: var(--focus); }
.stars.big { font-size: 1.5rem; margin: 0 0 .5rem; }
.star-input { border: 0; padding: 0; gap: .2rem; }
.star-input legend { padding: 0; margin-bottom: .2rem; }
.star-row { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: .1rem; }
.star-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-row label { font-size: 1.9rem; line-height: 1; color: var(--line); cursor: pointer; transition: color .1s; }
.star-row input:checked ~ label, .star-row label:hover, .star-row label:hover ~ label { color: var(--focus); }
.star-row input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.import-panel { border-left: 4px solid var(--accent); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-weight: 500; color: var(--muted); padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
.table td { padding: .5rem; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.setup-row { border-top: 1px solid var(--line); padding: .5rem 0; }
.setup-row:first-of-type { border-top: 0; }
.setup-row summary { display: flex; align-items: center; gap: .6rem; }
.setup-edit { margin-top: .5rem; padding-left: 1.4rem; }
.setup-row-flat { padding: .35rem 0; border-top: 1px solid var(--line); }
.setup-row-flat .chip { min-width: 8rem; justify-content: space-between; }
input.colour { width: 2.4rem; height: 2rem; padding: .1rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; }

/* ----- moving cards into epics ----- */
.tree-row .pick { margin: 0; accent-color: var(--accent); }
.tree-row .grip { color: var(--faint); cursor: grab; font-size: .9rem; user-select: none; }
.tree-row.dragging { opacity: .45; }
.drop-zone.drop-ok, .tree-row.drop-ok { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--accent-soft); }
.bulk-bar { position: sticky; bottom: 1rem; z-index: 30; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--ink); color: var(--bg); padding: .55rem .8rem; border-radius: var(--r-panel); box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.bulk-bar .input { background: var(--surface); color: var(--ink); }
.bulk-bar .btn.ghost { color: var(--bg); }

/* ----- habits ----- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .45rem; vertical-align: middle; }
.dot.big { width: 14px; height: 14px; margin-right: .6rem; vertical-align: .15em; }
.habit-board { padding: .8rem 1.2rem 1rem; }
.habit-head, .habit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(7.5rem, max-content); gap: 1rem; align-items: center; }
.habit-head { padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.habit-row { padding: .65rem 0; border-top: 1px solid var(--line); }
.habit-row:first-of-type { border-top: 0; }
.habit-row.dragging { opacity: .5; }
.habit-name a { font-weight: 600; color: var(--ink); }
.habit-meta { display: flex; flex-wrap: wrap; gap: .2rem .5rem; font-size: .82rem; color: var(--muted); margin-top: .1rem; }
.streak { color: var(--high); font-weight: 600; }
.cells { display: grid; grid-template-columns: repeat(7, 2rem); gap: .3rem; }
.dname { text-align: center; font-size: .75rem; color: var(--muted); line-height: 1.1; }
.dname small { display: block; color: var(--faint); }
.dname.today { color: var(--ink); font-weight: 600; }
.cell { width: 2rem; height: 2rem; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font: 600 .72rem var(--body); color: var(--muted); padding: 0; }
.cell:hover:not(:disabled) { border-color: var(--hc); }
.cell.s-done { background: var(--hc); border-color: var(--hc); color: #fff; }
.cell.s-partial { background: color-mix(in srgb, var(--hc) 30%, var(--surface)); border-color: var(--hc); color: var(--ink); }
.cell.s-skipped { background: repeating-linear-gradient(45deg, var(--sunk), var(--sunk) 3px, var(--surface) 3px, var(--surface) 6px); }
.cell.s-missed { border-color: color-mix(in srgb, var(--urgent) 45%, var(--line)); }
.cell.s-due { border-color: var(--hc); border-style: dashed; }
.cell.s-off { opacity: .35; }
.cell:disabled { cursor: default; }
.habit-today { display: flex; align-items: center; gap: .3rem; justify-content: flex-end; }
.habit-btn { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 2px solid var(--hc); background: var(--surface); cursor: pointer; display: inline-grid; place-items: center; padding: 0; color: var(--hc); flex-shrink: 0; transition: background .15s, transform .1s; }
.habit-btn:active { transform: scale(.94); }
.habit-btn svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: .25; }
.habit-btn.s-done { background: var(--hc); color: #fff; }
.habit-btn.s-done svg { opacity: 1; }
.habit-btn.s-skipped { border-style: dashed; opacity: .6; }
.habit-btn.count {font:600 .9rem var(--body);display:inline-flex;justify-content:center}

.habit-btn.count.s-done { color: #fff; }
.habit-btn.count.s-partial { background: color-mix(in srgb, var(--hc) 18%, var(--surface)); color: var(--ink); }
.habit-mini .habit-btn { width: 2.1rem; height: 2.1rem; }

.habit-mini li { gap: .7rem; }
.habit-mini a { color: var(--ink); }
.sched { gap: .45rem; }
.day-picks { display: flex; gap: .3rem; flex-wrap: wrap; padding-left: 1.6rem; }
.day-pick input { position: absolute; opacity: 0; }
.day-pick span { display: inline-block; padding: .25rem .55rem; border: 1px solid var(--line); border-radius: 6px; font-size: .82rem; cursor: pointer; }
.day-pick input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day-pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.mhead { text-align: center; font-size: .78rem; color: var(--muted); }
.mday { width: 100%; height: auto; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
.mday .dnum { font-size: .82rem; }
@media (max-width: 860px) {
  .habit-head { display: none; }
  .habit-row { grid-template-columns: minmax(0, 1fr) auto; }
  .habit-row .cells { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(7, 1fr); }
  .cell { width: 100%; }
}

/* ----- finance ----- */
.fin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat .label { font-size: .85rem; color: var(--muted); }
.stat strong { font: 650 1.6rem/1.15 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat strong small { font: 400 .85rem var(--body); color: var(--muted); margin-left: .15rem; }
.stat .sub { font-size: .8rem; color: var(--faint); }
.stat.neg strong { color: var(--urgent); }
.stat.pos strong { color: var(--ok); }
.fin-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: .35rem; height: 170px; align-items: end; }
.fin-col { display: flex; flex-direction: column; align-items: center; height: 100%; gap: .3rem; }
.fin-col .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.fin-col .bar { width: 42%; max-width: 14px; border-radius: 3px 3px 0 0; min-height: 0; }
.bar.out, .key.out { background: var(--urgent); }
.bar.in, .key.in { background: var(--ok); }
.mlabel { font-size: .7rem; color: var(--muted); }
.legend { display: flex; align-items: center; gap: .4rem; color: var(--muted); margin: .6rem 0 0; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: .5rem; }
.key:first-child { margin-left: 0; }
.fin-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.fin-form .grow { min-width: 180px; }
.amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; color: var(--ink); }
.amt.in { color: var(--ok); }
.sub-row { display: flex; align-items: center; gap: .5rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.sub-row:first-of-type { border-top: 0; }
.sub-row.ended { opacity: .55; }
.cat-row { display: grid; grid-template-columns: 7rem 1fr auto; gap: .7rem; align-items: center; padding: .3rem 0; font-size: .9rem; }

/* ----- autosave ----- */
.save-pill { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; background: var(--ink); color: var(--bg); font-size: .82rem; padding: .35rem .75rem; border-radius: 999px; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: none; }
.save-pill.show { opacity: .92; transform: none; }
.save-pill.error { background: var(--urgent); color: #fff; opacity: 1; }

/* ----- reveal-to-add ----- */
.add-toggle > summary { display: inline-flex; }
.add-toggle[open] > summary { margin-bottom: .75rem; }
.add-toggle > form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 1.1rem 1.2rem; }
.chip .n { opacity: .6; margin-left: .15rem; }

/* ----- inbox ----- */
.inbox-item { display: flex; align-items: center; gap: .5rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.inbox-item:first-child { border-top: 0; }
.inbox-item span { flex: 1; min-width: 0; }

/* ----- small screens ----- */
@media (max-width: 860px) {
  .shell, .side-collapsed { grid-template-columns: 1fr; --side: 270px; }
  .sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(84vw, 300px); height: 100dvh; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .drawer-open .sidebar { transform: none; }
  .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(27, 25, 49, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
  .side-toggle { display: none; }
  .side-collapsed .sidebar { align-items: stretch; padding-inline: .75rem; }
  .side-collapsed .brand-text, .side-collapsed .nav-heading, .side-collapsed .nav a span, .side-collapsed .nav-settings span,
  .side-collapsed .nav-search span, .side-collapsed .nav-caret, .side-collapsed .side-new { display: revert !important; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
    padding: .35rem max(.4rem, env(safe-area-inset-right)) calc(.35rem + env(safe-area-inset-bottom)) max(.4rem, env(safe-area-inset-left)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: .15rem; font: 500 .7rem var(--body); color: var(--muted); padding: .3rem 0; border: 0; background: none; border-radius: 10px; cursor: pointer; }
  .tabbar a.on { color: var(--accent); }
  .tabbar .icon { width: 21px; height: 21px; }
  .tabbar a:hover { text-decoration: none; }
  .main { padding: 1.25rem 1rem 6.5rem; }
  .grid-2, .notes-layout, .setting-section { grid-template-columns: 1fr; }
  .facets { position: static; flex-direction: row; flex-wrap: wrap; gap: .5rem 1.5rem; }
  .editor { grid-template-columns: 1fr; }
  .editor .preview { display: none; }
  .editor.show-preview .preview { display: block; min-height: 30vh; }
  .board { scroll-snap-type: x mandatory; }
  .board > .column { flex-basis: 82vw; }
  .column { scroll-snap-align: start; }
  .row-link { flex-wrap: wrap; row-gap: .15rem; }
  .row-link .row-title { white-space: normal; flex-basis: calc(100% - 4.5rem); }
  .row-link .row-meta { flex-basis: 100%; }
  .save-pill { bottom: calc(5rem + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Today, goals and unified agenda */
.today-subtitle { color:var(--muted); margin:.25rem 0 .9rem; }
.agenda-day {margin-bottom:.85rem;}
.agenda-day h2 {justify-content:space-between}
.agenda-list {list-style:none;margin:0;padding:0;}
.agenda-entry {display:grid;grid-template-columns:5rem 4px 1fr;gap:.8rem;align-items:start;padding:.7rem 0;border-top:1px solid var(--line);}
.agenda-entry:first-child {border-top:0;}
.agenda-time {font-size:.78rem;color:var(--muted);font-variant-numeric:tabular-nums;}
.agenda-bar {align-self:stretch;border-radius:10px;min-height:1.8rem;}
.agenda-entry-title {font-weight:600;overflow-wrap:anywhere;}
.agenda-entry-meta {display:block;font-size:.76rem;color:var(--muted);margin-top:.2rem;}
@media(max-width:700px) {.agenda-entry {grid-template-columns:4rem 3px 1fr;gap:.55rem;}}

/* Navigation sections and content studio */

.quick-capture-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:1rem}.quick-capture-backdrop{position:absolute;inset:0;background:rgba(27,25,49,.55)}.quick-capture-dialog{position:relative;z-index:1;width:min(560px,100%);max-height:90vh;overflow:auto;box-shadow:0 18px 65px #0003}.quick-capture-types{display:flex;gap:.35rem;flex-wrap:wrap;margin:.65rem 0 1rem}.quick-capture-dialog .field[hidden]{display:none!important}

.planning-suggestion{padding:.8rem 0;border-top:1px solid var(--line)}.planning-suggestion strong,.planning-suggestion .small{display:block}.planning-suggestion p{margin:.3rem 0}.fitness-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.8rem}.fitness-stats h2{font-size:1.55rem;margin:.25rem 0}.fitness-chart{height:190px;display:flex;align-items:flex-end;gap:3px;border-bottom:1px solid var(--line);padding-top:10px}.fitness-bar-item{height:100%;flex:1;display:flex;align-items:flex-end;min-width:2px}.fitness-bar{background:var(--accent);width:100%;border-radius:3px 3px 0 0;min-height:0}.fitness-table-wrap{max-height:360px;overflow:auto}.fitness-table-wrap table{width:100%;border-collapse:collapse}.fitness-table-wrap td,.fitness-table-wrap th{padding:.4rem;border-bottom:1px solid var(--line);text-align:left}

/* Smart planning and connector status pages */
.planning-card{display:flex;flex-direction:column;gap:.55rem}
.planning-card p{margin:.3rem 0}
.planning-card form,.automation-row form{margin:0}
.automation-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.7rem 0;border-bottom:1px solid var(--line)}
.automation-row:last-child{border-bottom:0}
.automation-row>div{min-width:0;overflow-wrap:anywhere}
.integration-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.7rem}
.integration-tile{padding:.85rem;border:1px solid var(--line);border-radius:10px;background:var(--surface-2)}
.integration-tile p{margin:.4rem 0}
.run-status{font-size:.75rem;border:1px solid var(--line);border-radius:7px;padding:.2rem .5rem;white-space:nowrap}
.run-success,.run-processed{color:var(--good)}.run-failed{color:var(--bad)}.run-skipped{color:var(--muted)}

/* Universal search and related records */
.nav-search{display:flex;align-items:center;gap:.6rem;width:100%;padding:.5rem .65rem;
  border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--faint);
  text-align:left;cursor:pointer;font:inherit;font-size:.9rem;box-shadow:var(--shadow-sm)}
.nav-search span{flex:1}
.nav-search kbd{font:500 .7rem var(--mono);color:var(--muted)}
.nav-search:hover{border-color:var(--accent)}
.global-search-modal{position:fixed;inset:0;z-index:1100;display:flex;justify-content:center;
  align-items:flex-start;padding:min(12vh,95px) 1rem 1rem}
.global-search-backdrop{position:absolute;inset:0;background:rgba(27,25,49,.55)}
.global-search-dialog{position:relative;z-index:1;width:min(100%,650px);max-height:80vh;
  overflow:auto;box-shadow:0 20px 85px rgba(0,0,0,.27);padding:1.2rem}
.global-search-dialog .row{gap:.5rem}
.global-search-dialog h2{margin:0}
.global-search-results{display:flex;flex-direction:column;gap:.2rem;max-height:48vh;overflow:auto;margin:.8rem 0}
.global-search-result{display:flex;flex-direction:column;gap:.1rem;padding:.65rem .75rem;
  border:1px solid transparent;border-radius:8px;color:var(--ink)}
.global-search-result.active,.global-search-result:hover{background:var(--accent-soft);
  border-color:var(--accent);text-decoration:none}
.global-search-result span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.universal-results{display:flex;flex-direction:column;gap:.2rem}
.universal-result{display:block;border-bottom:1px solid var(--line);padding:.8rem .5rem;color:var(--ink)}
.universal-result:hover{background:var(--sunk);text-decoration:none}
.universal-result p{margin:.4rem 0 0;color:var(--muted);font-size:.88rem;overflow-wrap:anywhere}
.related-panel{margin:1rem 0}
.related-panel h2{margin:0}
.related-preview-list{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.7rem}
.related-preview-list a{border:1px solid var(--line);border-radius:7px;padding:.3rem .55rem;
  color:var(--accent);background:var(--sunk)}
.related-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;
  border-bottom:1px solid var(--line);padding:.6rem 0}
.related-row>div{display:flex;flex-direction:column;min-width:0;overflow-wrap:anywhere}
.related-row:last-child{border-bottom:0}
.related-row form{margin:0}
.search-picker-results{border:1px solid var(--line);border-radius:8px;max-height:300px;
  overflow-y:auto;display:flex;flex-direction:column;gap:0}
.search-picker-results p{margin:.5rem}
.search-picker-choice{background:transparent;border:0;border-bottom:1px solid var(--line);
  color:var(--ink);display:flex;align-items:start;flex-direction:column;text-align:left;
  gap:.15rem;padding:.5rem .7rem;cursor:pointer;font:inherit;width:100%}
.search-picker-choice:hover,.search-picker-choice:focus-visible{background:var(--accent-soft)}
[id^="todo-"],[id^="goal-"],[id^="content-"]{scroll-margin-top:1rem}
@media(max-width:600px){
  .global-search-modal{padding:3rem .5rem .5rem}
  .global-search-dialog{max-height:85vh;padding:.8rem}
  .global-search-dialog .row{flex-wrap:wrap}
}
.tab-plus { width: 34px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.tab-plus .icon { width: 18px !important; height: 18px !important; }

/* ----- Goals ----- */
.goals-top { display: grid; grid-template-columns: 1.55fr 1fr; gap: 1rem; align-items: start; }
.week-goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.week-goal { display: flex; align-items: flex-start; gap: .85rem; padding: .85rem .9rem; border-radius: var(--r-card); background: var(--surface-2); border: 1px solid var(--line); }
.week-goal .wg-n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(140deg, var(--accent-2), var(--accent)); color: #fff; font: 650 1rem var(--display); }
.wg-title { font: 600 1.05rem/1.35 var(--display); letter-spacing: -.01em; display: block; padding-top: .3rem; }
.week-goal.done .wg-title { text-decoration: line-through; color: var(--muted); }
.week-goal.done .wg-n { background: var(--ok); }
.week-goal.extra .wg-n { background: var(--sunk); color: var(--muted); }
.week-goal.empty-slot { background: transparent; border-style: dashed; align-items: center; }
.week-goal.empty-slot .wg-n { background: var(--sunk); color: var(--faint); }
.week-goal.empty-slot .input { background: transparent; border-color: transparent; padding-left: .2rem; }
.week-goal.empty-slot .input:focus { background: var(--surface); border-color: var(--accent); }
.goal-meta { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; margin-top: .3rem; font-size: .8rem; color: var(--muted); }
.goal-meta .chip .icon { width: 12px; height: 12px; }
.serves { color: var(--accent); font-weight: 500; }
.goal-check { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; flex-shrink: 0; color: transparent; transition: background .15s, border-color .15s; }
.goal-check svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.goal-check:hover { border-color: var(--ok); color: var(--ok); }
.goal-check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.week-goal .goal-check { width: 30px; height: 30px; margin-top: .15rem; }
.today-goals { list-style: none; margin: 0; padding: 0; }
.today-goals li { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.today-goals li:first-child { border-top: 0; }
.today-goals li.done .grow { text-decoration: line-through; color: var(--muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .4rem 0 .75rem; }
.section-head h2 { margin: 0; }
.outcome-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.outcome { display: flex; flex-direction: column; gap: .55rem; border-top: 3px solid var(--epic); }
.outcome.monthly { border-top-color: var(--accent); }
.outcome-title { font: 650 1.15rem/1.3 var(--display); color: var(--ink); margin: 0; letter-spacing: -.015em; }
.level-pill {font-size:.74rem;padding:.1rem .55rem;border-radius:99px}
.level-quarterly {background:color-mix(in srgb, var(--epic) 13%, var(--surface))}

.goal-progress { display: flex; align-items: center; gap: .6rem; }
.goal-progress .meter { flex: 1; }
.goal-progress small { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.milestones { list-style: none; margin: .2rem 0 0; padding: 0; }
.milestones > li { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem 0; border-top: 1px solid var(--line); font-size: .93rem; }
.milestones > li.done > .grow > span:first-child, .milestones > li.done > .grow { color: var(--muted); }
.milestones > li .goal-check { width: 22px; height: 22px; border-radius: 7px; }
.sub-goals { list-style: none; margin: .3rem 0 0; padding: 0 0 0 .7rem; border-left: 2px solid var(--line); font-size: .86rem; color: var(--muted); }
.sub-goals li.done { text-decoration: line-through; }
.goal-edit { position: relative; }
.goal-edit > summary { list-style: none; }
.goal-edit[open] > summary { background: var(--sunk); color: var(--ink); }
.goal-edit-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(420px, 86vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: .9rem; box-shadow: var(--shadow-lg); }
.chip-check { display: inline-flex; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span {font-size:.8rem;border-radius:var(--r-chip)}

.maint-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.maint { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .3rem .3rem .75rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: .9rem; }
.maint small { color: var(--faint); }
.maint .goal-edit > summary { padding: .1rem .5rem; border-radius: 99px; }
.struck { text-decoration: line-through; color: var(--muted); }
.new-goal > summary { display: flex; align-items: center; gap: .5rem; }
.new-goal > summary::before { content: "+"; font: 600 1.2rem var(--display); color: var(--accent); width: 1.2rem; }
.new-goal[open] > summary::before { content: "–"; }
.empty-state { text-align: center; padding: 2rem 1rem; }
.empty-state p { color: var(--muted); margin: 0 0 .9rem; }
@media (max-width: 860px) { .goals-top { grid-template-columns: 1fr; } .outcome-grid { grid-template-columns: 1fr; } }

/* ----- Settings: calendars & mail ----- */
.cal-list { padding: .4rem 1rem; }
.cal-row { align-items: flex-start; padding: .8rem 0; }
.cal-swatch-pick { --c: var(--accent); position: relative; width: 30px; height: 30px; border-radius: 9px; background: var(--c); flex-shrink: 0; cursor: pointer; margin-top: .15rem; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.cal-swatch-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.cal-main { display: flex; flex-direction: column; gap: .35rem; }
.cal-name { font-weight: 600; border-color: transparent; background: transparent; padding-left: .3rem; }
.cal-name:hover { border-color: var(--line-strong); }
.cal-sub { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.swatches { display: inline-flex; gap: 4px; }
.swatch { width: 16px; height: 16px; border-radius: 5px; border: 0; padding: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.cal-status { font-size: .78rem; color: var(--faint); }
.cal-status.ok { color: var(--ok); }
.cal-status.bad { color: var(--bad); }
.cal-actions { flex-shrink: 0; }
.kind-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.kind-opt { cursor: pointer; }
.kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.kind-opt span { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border-radius: 99px; border: 1px solid var(--line-strong); font-size: .86rem; background: var(--surface); }
.kind-opt span i { width: 9px; height: 9px; border-radius: 50%; }
.kind-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.kind-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.colour-input { width: 3.4rem; height: 2.45rem; padding: .2rem; }
.mail-advanced > summary { color: var(--muted); }
@media (max-width: 860px) { .cal-row { flex-wrap: wrap; } .cal-actions { margin-left: auto; } }

/* ----- Calendar ----- */
.notice { border-radius: var(--r-card); padding: .7rem 1rem; border: 1px solid var(--line); background: var(--surface); }
.notice p { margin: 0; }
.notice.bad { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: color-mix(in srgb, var(--bad) 6%, var(--surface)); }
.cal-filters { display: flex; flex-wrap: wrap; gap: .45rem; }
.cal-filter { --c: var(--accent); display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem .35rem .6rem; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font: 500 .86rem var(--body); }
.cal-filter i { width: 12px; height: 12px; border-radius: 4px; border: 2px solid var(--c); }
.cal-filter small { color: var(--faint); font-size: .74rem; }
.cal-filter.on { color: var(--ink); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.cal-filter.on i { background: var(--c); }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.week-day { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .65rem .3rem; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow-sm); }
.week-day:hover { text-decoration: none; border-color: var(--line-strong); }
.week-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.wd-name { font-size: .74rem; color: var(--muted); }
.wd-num { font: 650 1.3rem var(--display); }
.week-day.today .wd-num { color: var(--accent); }
.wd-dots { display: flex; gap: 3px; height: 6px; }
.wd-dots i { width: 6px; height: 6px; border-radius: 50%; }
.wd-free { font-size: .7rem; color: var(--faint); white-space: nowrap; }
.agenda { display: flex; flex-direction: column; gap: .75rem; }
.agenda-day { margin: 0; scroll-margin-top: 1rem; }
.agenda-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: .35rem; }
.agenda-day-head h2 { margin: 0; }
.agenda-day-head h2 .muted { font: 400 .9rem var(--body); }
.free-pill { font-size: .78rem; color: var(--story); background: color-mix(in srgb, var(--story) 9%, var(--surface)); padding: .1rem .6rem; border-radius: 99px; }
.agenda-time small { display: block; color: var(--faint); }
.task-bar { background: repeating-linear-gradient(180deg, var(--muted) 0 4px, transparent 4px 7px) !important; }
.agenda-entry.filtered { display: none; }
@media (max-width: 860px) { .week-strip { grid-template-columns: repeat(7, 64px); overflow-x: auto; padding-bottom: .2rem; } .wd-free { display: none; } }

/* ----- Mail ----- */
.mail-bar { display: flex; flex-direction: column; gap: .6rem; }
.tabs { display: flex; gap: .25rem; overflow-x: auto; padding: .25rem; background: var(--sunk); border-radius: 12px; width: fit-content; max-width: 100%; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .8rem; border-radius: 9px; color: var(--muted); font-size: .88rem; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
.tab .count { font-size: .72rem; color: var(--accent); background: var(--accent-soft); padding: 0 .4rem; border-radius: 99px; }
.mail-list { display: flex; flex-direction: column; gap: .6rem; }
.mail-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: .85rem 1rem; box-shadow: var(--shadow-sm); position: relative; }
.mail-item.pri-high { border-left: 3px solid var(--urgent); }
.mail-item.is-unread .mail-from { font-weight: 650; }
.mail-item.st-done, .mail-item.st-todo { opacity: .75; }
.mail-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .86rem; }
.mail-from { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-when { color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mail-subject { font: 600 1rem/1.35 var(--body); color: var(--ink); margin: .25rem 0 0; letter-spacing: 0; }
.mail-summary { margin: .25rem 0 0; color: var(--muted); font-size: .92rem; }
.mail-foot { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: .65rem; }
.mail-todo, .mail-more { position: relative; }
.mail-todo > summary, .mail-more > summary { list-style: none; }
.mail-todo-form, .mail-more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(340px, 84vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: .75rem; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: .5rem; }
.mail-more-menu p { margin: 0; }
.mail-excerpt { margin-top: .5rem; }
.mail-excerpt > summary { color: var(--faint); }
.mail-excerpt p { white-space: pre-line; font-size: .88rem; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: .6rem .75rem; margin: .4rem 0 0; max-height: 18rem; overflow: auto; }
.mail-empty h2 { margin-bottom: .4rem; }
.mail-empty p { max-width: 52ch; margin: 0 auto 1rem; }
.shell { background: linear-gradient(90deg, var(--surface-2) var(--side), var(--line) var(--side), var(--line) calc(var(--side) + 1px), transparent calc(var(--side) + 1px)); }
.agenda-day h2 { display: flex; align-items: baseline; gap: .45rem; }
.panel > h2 .count { font: 500 .82rem var(--body); color: var(--muted); letter-spacing: 0; }
@media (max-width: 860px) { .shell { background: none; } }
.todo.rolled .todo-title { animation: rolled 1.2s ease; }
@keyframes rolled { 0% { color: var(--ok); } 100% { color: inherit; } }
.hub-entry .task-bar { background: repeating-linear-gradient(180deg, var(--c, var(--muted)) 0 4px, transparent 4px 7px) !important; }
.hub-entry .agenda-entry-title { color: var(--ink); }
.hub-entry.kind-sprint .agenda-entry-title { color: var(--accent); }
.deadline-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .7rem; }
.deadline-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; padding: .15rem .6rem; border-radius: var(--r-chip); border: 1px dashed var(--line-strong); color: var(--ink); background: var(--surface); }
.deadline-chip:hover { text-decoration: none; border-color: var(--accent); }
.deadline-chip b { font-weight: 600; color: var(--high); }
.feed-url { display: flex; gap: .4rem; }
.feed-url input { font-family: var(--mono); font-size: .8rem; }
.howto-inline > summary { color: var(--accent); font-weight: 500; }
.howto-inline ul { margin: .5rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .4rem; }

/* ----- Routines ----- */
.notion-banner { padding: .8rem 1.1rem; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); gap: .6rem; }
.routine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.routine-grid.compact { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.section-title { margin: .6rem 0 0; }
.routine-card { display: flex; flex-direction: column; gap: .7rem; }
.routine-card.is-now { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus), var(--shadow); }
.routine-head { display: flex; align-items: center; gap: .75rem; }
.routine-head h2 { margin: 0; }
.routine-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--sunk); display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0; }
.now-tag { font: 600 .7rem var(--body); background: var(--focus); color: #3d2a00; padding: .05rem .45rem; border-radius: 99px; vertical-align: middle; }
.routine-card.complete .ring { --ring: var(--ok); }
.routine-steps { list-style: none; margin: 0; padding: 0; }
.routine-step { display: flex; align-items: center; gap: .65rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.routine-step:first-child { border-top: 0; }
.routine-step small { display: block; color: var(--faint); font-size: .78rem; }
.routine-step.done .step-title { color: var(--faint); text-decoration: line-through; }
.step-time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.8rem; }
.step-min { font-size: .76rem; color: var(--faint); white-space: nowrap; }
.step-tick { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; flex-shrink: 0; }
.step-tick svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.step-tick:hover { border-color: var(--ok); color: var(--ok); }
.routine-step.done .step-tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.routine-foot { margin-top: -.2rem; }
.step-editor { list-style: none; margin: 0 0 .8rem; padding: 0; }
.step-editor > li { display: flex; align-items: center; gap: .4rem; padding: .35rem 0; border-top: 1px solid var(--line); }
.step-editor > li:first-child { border-top: 0; }
.step-form { display: flex; gap: .4rem; flex: 1; min-width: 0; align-items: center; }
.step-form input[type=time] { width: 7.2rem; }
.step-form .mins { width: 4.6rem; }
.step-form .note { width: 30%; }
.step-actions { display: flex; flex-shrink: 0; }
.routine-today { display: flex; flex-direction: column; gap: .5rem; }
.routine-mini { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: var(--r-card); border: 1px solid var(--line); color: var(--ink); }
.routine-mini:hover { text-decoration: none; background: var(--surface-2); }
.routine-mini.is-now { border-color: var(--focus); background: var(--focus-soft); }
.routine-mini small { display: block; color: var(--muted); font-size: .8rem; }
.routine-mini .ring { width: 34px; height: 34px; }
.routine-mini .ring > span { width: 26px; height: 26px; font-size: .58rem; }
@media (max-width: 860px) {
  .routine-grid, .routine-grid.compact { grid-template-columns: 1fr; }
  .step-form { flex-wrap: wrap; }
  .step-form .note { width: 100%; }
  .step-editor > li { align-items: flex-start; }
}
.todos-add > .grow { flex: 1 1 100%; } .todos-add .btn.primary { margin-left: auto; }

/* Inbox triage and weekly review */
.review-stats {margin:1rem 0}
.review-stat {font-size:1.8rem;font-weight:750;line-height:1.5}
.review-stat small {font-size:.8rem;font-weight:400}

/* Time Insights summary */

/* Time tracking workspace */

.time-head .page-head p { max-width: 60ch; }
.time-kpis {margin:1.25rem 0}
.time-kpi { display:flex; flex-direction:column; gap:.45rem; min-width:0; }
.time-kpi strong {font-size:clamp(1.3rem,2vw,2rem);line-height:1.2}

.time-main,.time-aside { display:grid; gap:1.1rem; min-width:0; }

.muted-meter span { opacity:.55; }

.time-device strong {font-size:1.35rem}

.time-footer { margin-top:1.1rem; }
@media(max-width:1050px) { .time-kpis {grid-template-columns:repeat(2,minmax(0,1fr));} .time-layout {grid-template-columns:minmax(0,1fr);} .time-aside {grid-template-columns:repeat(2,minmax(0,1fr));} }
@media(max-width:620px) { .time-kpis,.time-aside,.time-form-row {grid-template-columns:minmax(0,1fr);} .time-history-row {flex-wrap:wrap;} }

/* =====================================================================
   Shared page components (one source of truth; no per-page colour stripes)
   ===================================================================== */
body { background-attachment: fixed; }
h1 { letter-spacing: -.035em; }

.vital-icon { color: var(--palette-rose); background: var(--accent-soft); }

.meter > span, .sprint-strip .meter > span, .goal-progress .meter > span { background: linear-gradient(90deg, var(--palette-plum), var(--palette-rose)); }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--accent); }
table { border-collapse: collapse; }
table tbody tr:hover { background: var(--surface-2); }

/* Stat tiles: Today vitals, Time, Fitness, Weekly review all share one look */
.stat-tile, .time-kpi, .fitness-stats > .panel, .review-stats > .panel {
  display: flex; flex-direction: column; gap: .3rem; padding: .95rem 1.05rem; border-radius: var(--r-card);
}
.time-kpi > span:first-child, .fitness-stats > .panel > .small:first-child { color: var(--muted); font-size: .82rem; font-weight: 500; }
.time-kpi strong { font: 650 clamp(1.3rem, 2vw, 1.75rem)/1.15 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.review-stat { font: 650 1.7rem/1.2 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.review-stat small { font: 400 .8rem var(--body); color: var(--muted); }
.review-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.review-stats .panel h2 { margin: .3rem 0; font-variant-numeric: tabular-nums; }

/* In-page section links (Time, Goals, Settings) */
.time-section-nav, .goal-jump-nav, .section-nav { display: flex; gap: .4rem; flex-wrap: wrap; }
.time-section-nav a, .goal-jump-nav a, .section-nav a {
  font-size: .84rem; font-weight: 600; padding: .35rem .8rem; border-radius: 999px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
}
.time-section-nav a:hover, .goal-jump-nav a:hover, .section-nav a:hover { color: var(--accent); border-color: var(--line-strong); text-decoration: none; }

/* Selectable chips */
.chip-check span { font-weight: 600; padding: .3rem .75rem; min-height: 32px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); }
.chip-check:hover span { border-color: var(--accent); color: var(--accent); }

.chip-check input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.level-pill { font-weight: 700; }
.level-quarterly { background: color-mix(in srgb, var(--palette-plum) 12%, var(--surface)); color: var(--accent); }

.level-tag { text-transform: capitalize; font-size: .7rem; }
.repeat-tag { background: var(--accent-soft); color: var(--accent); }

/* Mail category chips */
.cat-action, .cat-reply { background: var(--accent-soft); color: var(--accent); }
.cat-calendar { background: color-mix(in srgb, var(--epic) 14%, var(--surface)); color: var(--epic); }
.cat-receipt { background: color-mix(in srgb, var(--ok) 13%, var(--surface)); color: var(--ok); }

/* Habit counters */
.habit-btn.count { min-width: 4.6rem; width: auto; min-height: 2.5rem; padding: .35rem .75rem; gap: .25rem; align-items: center; border-radius: 14px; font-variant-numeric: tabular-nums; }
.habit-btn.count .n { font-size: 1.05rem; font-weight: 800; line-height: 1; }
.habit-btn.count .of { font-size: .74rem; font-weight: 600; opacity: .85; white-space: nowrap; }
.habit-btn.count .habit-count-add { display:inline-grid;place-items:center;flex-shrink:0;min-width:1.2rem;height:1.2rem;margin-left:.15rem;border-radius:5px;background:var(--sunk);font-weight:750;font-size:.85rem;line-height:1;color:var(--ink); }
.habit-btn.count.s-done .habit-count-add { background:rgba(255,255,255,.2);color:inherit; }

.habit-mini .habit-btn.count { min-width: 4.4rem; height: 2.3rem; }
.habit-row:has(.habit-btn.count) .habit-today { min-width: 9.5rem; }
@media (max-width: 760px) { .habit-row:has(.habit-btn.count) .habit-today { min-width: 0; } }

/* Time Insights */
.time-head { align-items: flex-start; }
.time-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.time-layout { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(230px, .8fr); gap: 1.1rem; align-items: start; }
.time-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; align-items: start; min-width: 0; }
.time-main #work, .time-main #screen, .time-main #history, .time-main #projects { grid-column: 1 / -1; }
.time-aside { display: grid; gap: 1.1rem; min-width: 0; }
.time-section { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.time-section h2 { margin: 0; }
.time-section h3 { font-size: 1rem; margin: .5rem 0 0; }
.time-section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.time-section-head p { margin: .35rem 0 0; }
.time-form { display: grid; gap: 1rem; }
.time-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.time-form-row > .field { min-width: 0; }
.time-form .field { display: flex; flex-direction: column; gap: .35rem; }
.time-form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: .8rem; }
.time-project-row, .time-app-row { display: grid; gap: .45rem; }
.time-project-label { display: flex; justify-content: space-between; align-items: center; gap: .75rem; font-size: .92rem; }
.time-project-label strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.time-meter { height: 8px; border-radius: 100px; background: var(--sunk); overflow: hidden; }
.time-meter span { display: block; height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--palette-plum), var(--palette-rose)); }
.time-meter.muted-meter span { background: var(--palette-apricot); }
.time-device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .7rem; }
.time-device { display: grid; gap: .35rem; padding: .8rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface-2); }
.time-device strong { font: 650 1.3rem var(--display); font-variant-numeric: tabular-nums; }
.time-history { display: grid; }
.time-history-row { display: flex; gap: .75rem; justify-content: space-between; align-items: flex-start; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.time-history-row:last-child { border-bottom: 0; }
.time-history-row > div:first-child { min-width: 0; flex: 1; }
.time-history-row p { margin: .3rem 0 0; overflow-wrap: anywhere; }
.time-duration { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.time-entry-note { white-space: pre-wrap; }
@media (max-width: 1050px) { .time-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .time-layout { grid-template-columns: minmax(0, 1fr); } .time-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .time-main, .time-aside, .time-form-row { grid-template-columns: minmax(0, 1fr); } .time-history-row { flex-wrap: wrap; } }

/* Inbox triage */
.inbox-review-card { min-width: 0; }
.inbox-review-card textarea { min-height: 4rem; }
.inbox-original { margin: .2rem 0; padding: .8rem 1rem; border-left: 3px solid var(--accent); background: var(--sunk); border-radius: 0 var(--r-card) var(--r-card) 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 15rem; overflow: auto; }
.inbox-history-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); padding: .8rem 0; overflow-wrap: anywhere; }
.inbox-history-row:last-child { border-bottom: none; }
.inbox-history-row > div { min-width: 0; }

/* Ideas */
.ideas-capture {box-shadow:var(--shadow)}
.ideas-explore {display:grid}
.ideas-toolbar-title {display:flex;justify-content:space-between;gap:.6rem}
.ideas-toolbar-title h2 { margin: 0; }
.ideas-explore .note-filters { margin: 0; }
.idea-grid {grid-template-columns:repeat(auto-fill, minmax(min(100%, 290px), 1fr));align-items:stretch}
.idea-grid .idea { display: flex; flex-direction: column; gap: .55rem; border: 1px solid var(--line); border-radius: var(--r-panel); padding: 1.05rem 1.1rem; background: var(--surface); box-shadow: var(--shadow); min-width: 0; transition: border-color .15s, transform .15s; }
.idea-grid .idea:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.idea-grid .idea h2 { font-size: 1.05rem; margin: .1rem 0; }
.idea-grid .idea .excerpt { color: var(--muted); margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.idea-grid .idea footer { margin-top: auto; padding-top: .65rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.idea-card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.idea-state-draft, .idea-state-active, .idea-state-exploring { background: var(--focus-soft); color: var(--high); }
.idea-state-promoted, .idea-state-done { background: color-mix(in srgb, var(--ok) 13%, var(--surface)); color: var(--ok); }
.idea-state-parked, .idea-state-archived { background: var(--sunk); color: var(--muted); }
@media (max-width: 680px) { .ideas-toolbar-title { align-items: flex-start; } }

/* Content studio accounts */

/* Error page */
.error-panel { max-width: 560px; margin: 8vh auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 2rem 1.5rem; }
.error-panel h1 { font-size: 1.6rem; }
.error-panel .error-message { color: var(--muted); margin: 0 0 .6rem; max-width: 46ch; }
.error-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.error-icon .icon { width: 24px; height: 24px; }

/* Empty states inside boards and lists */
.column:not(:has(.kcard)) { min-height: 140px; }
.dropzone:empty::after { content: "Drop cards here"; display: grid; place-items: center; flex: 1; min-height: 70px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-card); color: var(--faint); font-size: .82rem; }
.dropzone:empty::after { content: "Drop cards here"; }
.empty-state .vital-icon { margin: 0 auto .7rem; }

@media (prefers-reduced-motion: reduce) { .panel, .btn, .chip, .nav a, .idea-grid .idea { transition: none; } }
@media (max-width: 600px) { .main .btn { white-space: normal; text-align: center; } }
.empty-cta { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border: 1.5px dashed var(--line-strong); border-radius: var(--r-card); color: var(--muted); font-weight: 500; }
.empty-cta:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.empty-cta .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--sunk); font: 650 .85rem var(--display); }

/* Projects overview */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.project-card { display: flex; flex-direction: column; gap: .85rem; }
.project-card.is-paused { opacity: .75; }
.project-card-head { display: flex; align-items: center; gap: .75rem; }
.project-card-head h2 { margin: 0; font-size: 1.1rem; }
.project-mono { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; font: 700 1.05rem var(--display);
  background: color-mix(in srgb, var(--tint) 14%, var(--surface)); color: color-mix(in srgb, var(--tint) 70%, var(--ink)); }
.project-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.project-stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: .45rem .6rem; min-width: 0; }
.project-stats dt { font-size: .72rem; color: var(--muted); }
.project-stats dd { margin: 0; font: 650 1rem var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-foot { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .6rem; }
.project-foot span { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.project-foot .icon { width: 14px; height: 14px; color: var(--faint); }

/* Fitness */
.connect-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.connect-card h2 { margin: 0 0 .2rem; }
.stat-num { font: 650 1.55rem/1.15 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-num small { font: 500 .8rem var(--body); color: var(--muted); margin-left: .15rem; letter-spacing: 0; }
.steps-chart { position: relative; }
.steps-chart .goal-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--palette-apricot); pointer-events: none; }

.fitness-bar-item.hit .fitness-bar { background: linear-gradient(180deg, var(--palette-rose), var(--palette-plum)); }
.fitness-bar-item.no-data { background: repeating-linear-gradient(0deg, transparent 0 6px, var(--sunk) 6px 8px); border-radius: 3px 3px 0 0; }
.chart-axis { display: flex; justify-content: space-between; font-size: .74rem; color: var(--faint); margin-top: .35rem; }
.settings-nav { position: sticky; top: 0; z-index: 5; padding: .6rem 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
.setting-section { scroll-margin-top: 3.5rem; }
.setting-section > div:first-child h2 { margin-bottom: .3rem; }
.ideas-capture .row { gap: .6rem; }
.capture-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--focus-soft); color: var(--high); flex-shrink: 0; }
.capture-more { margin: .55rem 0 0 2.85rem; }
.capture-more > summary { color: var(--accent); font-weight: 500; }
@media (max-width: 600px) { .capture-icon { display: none; } .capture-more { margin-left: 0; } }
@media (max-width: 860px) {
  .today-grid { display: flex; flex-direction: column; gap: 1rem; }
  .today-grid > .stack { display: contents; }
  .today-grid > .stack > section { order: var(--o, 9); }
}
@media (max-width: 860px) { .settings-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -1rem; padding-inline: 1rem; } .settings-nav a { flex-shrink: 0; } }

/* Calm, information-dense productivity surfaces */

.brand-mark {background:var(--accent);color:var(--accent-ink);box-shadow:none}
.panel,.vital,.idea-grid .idea {box-shadow:var(--shadow)}
.btn.primary {box-shadow:none}
.btn.primary:hover {filter:none}
.chip.on,.chip.active {background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.nav a.on,.nav-settings.on {background:var(--accent-soft);color:var(--ink);border:1px solid var(--line)}
.nav a.on .icon,.nav-settings.on .icon {color:var(--accent)}
.now {background:var(--surface);border-color:var(--line)}
.now::before {background:var(--accent)}
.vital,.hub-insight,.time-kpi,.week-panel,.outcome,.outcome.monthly,.idea-grid .idea,
.idea-grid .idea:nth-child(n),.time-main .time-section,.time-aside .panel:nth-child(n),
.fitness-stats>.panel:nth-child(n) {border-top:1px solid var(--line)}
.hub-insight::after {display:none}
.hub-insight .insight-link {color:var(--accent)}
.time-meter span,.goal-progress .meter>span,.meter>span,.sprint-strip .meter>span {background:var(--accent)}
.fitness-bar {background:var(--accent)}
.time-device,.time-device:nth-child(n) {background:var(--surface-2);border-color:var(--line)}
.idea-state,.idea-state-draft,.idea-state-active,.idea-state-promoted,.idea-state-done,
.idea-state-parked,.idea-state-archived {background:var(--accent-soft);color:var(--ink);border:1px solid var(--line)}
.week-goal .wg-n,.week-goal:nth-child(n) .wg-n {background:var(--sunk);color:var(--ink)}
.level-quarterly,.level-monthly {background:var(--accent-soft);color:var(--ink);border:1px solid var(--line)}
.ideas-capture {border-color:var(--line)}
.time-section-nav a,.goal-jump-nav a {background:var(--surface);border-color:var(--line-strong);color:var(--ink)}
.time-section-nav a:hover,.goal-jump-nav a:hover {background:var(--accent-soft);border-color:var(--accent)}
select,select.input {background-color:var(--surface);color:var(--ink);border-color:var(--line-strong);background-image:var(--caret)}
.chip,.tag,.tag-chip,.badge-tag,.filter-chip,.epic-chip,.status-pill,.level-tag,.repeat-tag,
.chip-check span {background:var(--chip-bg);color:var(--chip-ink);border-color:var(--line)}

.chip.cat {background:var(--accent-soft);color:var(--ink);border-color:var(--line)}
@media(prefers-color-scheme:dark){
 .nav a.on,.nav-settings.on {color:var(--ink)}
 select,select.input {background-color:var(--surface);color:var(--ink);border-color:var(--line-strong)}
 .chip,.tag,.tag-chip,.badge-tag,.filter-chip,.epic-chip,.status-pill,.level-tag,.repeat-tag,.chip-check span {background:var(--chip-bg);color:var(--chip-ink);border-color:var(--line)}
 .chip-check input:checked + span {background:var(--accent);color:var(--accent-ink)}
 .time-device:nth-child(n),.idea-grid .idea:nth-child(n) {background:var(--surface);border-color:var(--line)}
}

/* Purposeful colour: preserve the professional neutral base while differentiating data. */
:root {--data-healthy:#2C8466;--data-learning:#4B70AD;--data-distraction:#BA6B43;--data-creative:#8264A7;}
.chip:not(.on),.tag,.tag-chip,.badge-tag,.filter-chip {border:1px solid #CBD7E5;background:#ECF2FA;color:#345374;font-weight:650}
.chip.cat,.chip[class*="category"] {background:#E8F3EE;color:#27634E;border-color:#B9D9C9}
.chip.due,.chip[class*="priority"] {background:#FBF0E4;color:#87502B;border-color:#E8D0AE}
.epic-chip,.level-quarterly {background:#F0EBF8;color:#654D86;border-color:#DCCFEF}
.level-monthly {background:#E9F1FB;color:#365F91;border-color:#CBDCEF}
.level-weekly {background:#E6F4EF;color:#296F56;border-color:#C6E4D8}
.status-pill {background:#EDF2F7;color:#45576D;border-color:#CBD6E2}
.chip-check input:checked+span {background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.data-section-nav {display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;margin:.4rem 0 1rem}
.data-section-nav a {display:inline-flex;align-items:center;padding:.45rem .85rem;border:1px solid var(--line-strong);border-radius:8px;background:var(--surface);font-size:.85rem;font-weight:650;color:var(--ink)}
.data-section-nav a:hover {text-decoration:none;border-color:var(--accent);background:var(--accent-soft)}
.data-block {margin-bottom:1rem;scroll-margin-top:2rem}
.data-heading {display:flex;justify-content:space-between;align-items:end;flex-wrap:wrap;gap:.7rem;margin-bottom:1rem}
.data-heading h2 {font-size:1.2rem;margin:.25rem 0 0}
.data-heading .eyebrow {font-size:.72rem;letter-spacing:.08em;text-transform:uppercase}
.data-summary-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.85rem}
.data-summary {display:flex;flex-direction:column;gap:.45rem;min-width:0;border-left:4px solid var(--accent)}
.data-summary strong {font:700 clamp(1.4rem,2.5vw,2rem)/1.2 var(--display);font-variant-numeric:tabular-nums}
.data-summary.healthy {border-left-color:var(--data-healthy)}
.data-summary.learning {border-left-color:var(--data-learning)}
.data-summary.distraction {border-left-color:var(--data-distraction)}
.data-legend {display:flex;gap:1.1rem;flex-wrap:wrap;font-size:.8rem;color:var(--muted);font-weight:650}
.legend-dot {display:inline-block;width:9px;height:9px;margin-right:.4rem;border-radius:3px}
.legend-dot.healthy {background:var(--data-healthy)}
.legend-dot.distraction {background:var(--data-distraction)}
.wellbeing-goals {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.2rem;margin:.65rem 0}
.wellbeing-goals>div {display:grid;gap:.65rem}
.time-meter .meter-healthy {background:var(--data-healthy)}
.time-meter .meter-distraction {background:var(--data-distraction)}
.dual-chart {display:flex;align-items:stretch;gap:.4rem;min-height:185px;max-width:100%;overflow-x:auto;padding:1rem .15rem .2rem;border-bottom:1px solid var(--line)}
.dual-chart-day {display:flex;flex-direction:column;gap:.35rem;align-items:center;flex:1 0 30px;min-width:30px;max-width:85px}
.dual-chart-pair {height:150px;width:100%;display:flex;justify-content:center;align-items:end;gap:3px;border-bottom:1px solid var(--line)}
.dual-bar {width:40%;max-width:18px;min-height:0;border-radius:3px 3px 0 0}
.dual-bar.healthy {background:var(--data-healthy)}
.dual-bar.distraction {background:var(--data-distraction)}
.dual-chart-day small {font-size:.63rem;white-space:nowrap;color:var(--muted)}
.fitness-overview .panel:nth-child(4n/**/+1) {border-left:3px solid var(--data-learning)}
.fitness-overview .panel:nth-child(4n/**/+2) {border-left:3px solid var(--data-healthy)}
.fitness-overview .panel:nth-child(4n/**/+3) {border-left:3px solid var(--data-distraction)}
.fitness-overview .panel:nth-child(4n/**/+4) {border-left:3px solid var(--data-creative)}
.steps-chart .fitness-bar {background:#7399C6}
.steps-chart .fitness-bar-item.hit .fitness-bar {background:var(--data-healthy)}
.steps-chart .goal-line {border-color:var(--data-distraction)}
@media(max-width:700px){.data-summary-grid{grid-template-columns:1fr 1fr}.wellbeing-goals{grid-template-columns:1fr}.dual-chart-day{flex-basis:38px}}
@media(max-width:460px){.data-summary-grid{grid-template-columns:1fr}}
@media(prefers-color-scheme:dark){
 :root {--data-healthy:#78CEAD;--data-learning:#95B9E8;--data-distraction:#EDAF7F;--data-creative:#C4AAE7}
 .chip:not(.on),.tag,.tag-chip,.badge-tag,.filter-chip,.chip.cat,.chip.due,.epic-chip,.level-quarterly,.level-monthly,.level-weekly,.status-pill {background:var(--sunk);color:var(--ink);border-color:var(--line-strong)}
 .data-section-nav a{background:var(--surface);color:var(--ink)}
 .steps-chart .fitness-bar{background:#658AB8}
}

/* Automatically tracked Practice Room skill time */
.practice-time-report {border-left:3px solid var(--data-learning, #4B70AD)}
.practice-time-stats {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.7rem;margin:.5rem 0}
.practice-time-stats>div {display:grid;gap:.3rem;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r-card);padding:.85rem;min-width:0}
.practice-time-stats strong {font:700 clamp(1.2rem,2vw,1.7rem)/1.2 var(--display);font-variant-numeric:tabular-nums}
.practice-time-breakdown {display:grid;gap:.8rem;margin-top:.6rem}
.time-meter .practice-meter {background:var(--data-learning,#4B70AD)}
@media(max-width:560px){.practice-time-stats{grid-template-columns:1fr 1fr}}

/* Global accessibility: a keyboard shortcut past the persistent navigation. */
.skip-link {
  position:fixed; left:1rem; top:-8rem; z-index:10000;
  background:var(--accent); color:var(--accent-ink); padding:.55rem 1rem;
  border-radius:var(--r-card); box-shadow:var(--shadow-lg);
  font-weight:700;
}
.skip-link:focus,.skip-link:focus-visible {top:.65rem;color:var(--accent-ink)}
#main-content:focus {outline:none}
/* Personal wellbeing targets: editing should stay compact and readable. */
.target-editor {position:relative}
.target-editor>summary {cursor:pointer}
.target-editor-form {
  display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:end;
  gap:.75rem; padding:1rem; border:1px solid var(--line);
  border-radius:var(--r-panel); background:var(--surface-2); margin-top:.75rem;
}
.target-editor-form .btn {height:fit-content}
.time-meter .meter-learning {background:var(--data-learning,#4B70AD)}
#time-goals .wellbeing-goals {grid-template-columns:repeat(3,minmax(0,1fr));margin-top:1.2rem}
#time-goals .wellbeing-goals>div {min-width:0}
#time-goals .time-project-label {flex-wrap:wrap;gap:.3rem}
#time-goals .time-project-label span {font-variant-numeric:tabular-nums}
@media(max-width:900px){
  #time-goals .wellbeing-goals {grid-template-columns:repeat(2,minmax(0,1fr))}
  .target-editor-form {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:620px){
  #time-goals .wellbeing-goals,.target-editor-form {grid-template-columns:minmax(0,1fr)}
}

/* Connected-workflow refinements: calmer hierarchy with visible actions. */
.mail-open-link {display:inline-flex;align-items:center;gap:.35rem;white-space:nowrap;
  background:var(--accent-soft);border:1px solid var(--line-strong);
  color:var(--accent);font-weight:750}
.mail-open-link:hover {background:var(--accent);color:var(--accent-ink);text-decoration:none}
.hierarchy-link {color:var(--accent);font-size:.77rem;font-weight:600;text-decoration:none}
.hierarchy-link:hover {text-decoration:underline}
.meta .hierarchy-link {max-width:100%;overflow-wrap:anywhere}
.idea-group {margin:1.1rem 0 1.7rem}
.idea-group>.row {margin-bottom:.7rem;border-bottom:1px solid var(--line);padding-bottom:.45rem}
.idea-group>.row h2 {margin:0;font-size:1.05rem}
.ideas-group-filter {margin-bottom:.5rem}
.ideas-group-filter .field {display:flex;flex-direction:row;align-items:center;gap:.6rem;font-size:.82rem;font-weight:650}
.ideas-group-filter select {min-width:150px}
.hub-calendar-manage {margin-bottom:1rem}
.hub-calendar-manage h2 {margin:0 0 .3rem}
.hub-calendar-manage p {margin:.2rem 0}
.hub-event-list {display:grid;margin-top:.6rem}
.hub-event-row {display:flex;align-items:flex-start;justify-content:space-between;
  border-top:1px solid var(--line);padding:.75rem 0;gap:.9rem}
.hub-event-row>div {min-width:0;overflow-wrap:anywhere}
.hub-event-row .chip {font-size:.7rem}
.capture-reminder-field {display:grid;gap:.7rem;border-left:3px solid var(--accent);padding-left:.85rem}
.capture-reminder-field[hidden] {display:none}
.review-crosspage {margin:1rem 0}
.review-crosspage h2 {margin:0 0 .3rem}
.review-crosspage .review-stats {margin:1rem 0}
.review-source {display:flex;flex-direction:column;gap:.4rem;padding:.8rem;
  background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r-card);min-width:0}
.review-source strong {font:700 clamp(1.15rem,2vw,1.65rem)/1.2 var(--display);font-variant-numeric:tabular-nums}
.review-project-breakdown {display:grid;gap:.6rem}
@media(max-width:620px) {
  .mail-foot {flex-wrap:wrap;gap:.5rem}
  .mail-open-link {order:1}
  .hub-event-row {flex-wrap:wrap}
}

/* Ideas: one filterable dataset, two equally capable views */
.ideas-explore {gap:1rem}
.ideas-toolbar-title {align-items:center}
.ideas-toolbar-title p {margin:.2rem 0 0}
.ideas-view-switch {display:inline-flex;align-items:center;gap:.2rem;padding:.2rem;border-radius:9px}
.ideas-view-option {display:inline-flex;align-items:center;gap:.4rem;padding:.4rem .72rem;
  border:1px solid transparent;border-radius:7px;color:var(--muted);font-weight:700;
  font-size:.84rem;text-decoration:none}
.ideas-view-option:hover {color:var(--ink);background:var(--sunk);text-decoration:none}
.ideas-view-option.on {background:var(--surface);border-color:var(--line-strong);box-shadow:var(--shadow-sm)}
.ideas-view-option .icon {width:15px;height:15px}
.ideas-filter-form {display:grid;grid-template-columns:minmax(180px,2fr) repeat(4,minmax(115px,1fr));
  gap:.7rem;align-items:end}
.ideas-filter-form>.field {display:flex;flex-direction:column;gap:.3rem;min-width:0;
  font-size:.79rem;font-weight:650;color:var(--muted)}
.ideas-filter-form .input {min-width:0;width:100%;min-height:39px}
.ideas-filter-actions {display:flex;align-items:center;gap:.5rem;grid-column:1/-1}
.ideas-tag-filters {max-height:130px;overflow-y:auto;align-content:start}
.ideas-table-wrap {overflow-x:auto;padding:0}
.ideas-table {min-width:750px;width:100%;border-collapse:collapse}
.ideas-table th {text-align:left;white-space:nowrap;font-size:.74rem;color:var(--muted);
  letter-spacing:.03em;background:var(--surface-2)}
.ideas-table th,.ideas-table td {padding:.8rem .9rem;vertical-align:middle;border-bottom:1px solid var(--line)}
.ideas-table tr:last-child td {border-bottom:0}
.ideas-table td {font-size:.86rem}
.ideas-table-title {min-width:200px;max-width:370px;overflow-wrap:anywhere}
.ideas-table-title>a {font-weight:750}
.ideas-table-title p {margin:.2rem 0 0;line-height:1.45}
.ideas-table .chips {gap:.25rem;min-width:150px}
.ideas-table .chip {font-size:.72rem;line-height:1.3;padding:.18rem .45rem}
.ideas-table-date {white-space:nowrap;color:var(--muted);font-variant-numeric:tabular-nums}
.ideas-table .inline-form {min-width:125px}
.ideas-table .inline-form select {min-width:125px;width:100%}
.ideas-table tbody tr:hover {background:var(--surface-2)}
.duration-entry-field {border:0;padding:0;margin:0;min-width:0}
.duration-entry-field legend {padding:0;margin:0 0 .3rem;font-weight:650;font-size:.83rem}
.duration-entry-inputs {display:grid;grid-template-columns:1fr 1fr;gap:.55rem}
.duration-entry-inputs>.field {min-width:0}
.duration-entry-inputs input {width:100%}
.data-coverage {display:flex;align-items:center;gap:.5rem;margin:1rem 0;flex-wrap:wrap}
.data-coverage .chip {font-variant-numeric:tabular-nums}
.fitness-coverage-stats {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;margin:.6rem 0 1rem}
.fitness-coverage-stats>.panel {display:flex;flex-direction:column;gap:.35rem}
.fitness-coverage-stats strong {font:750 clamp(1.2rem,2vw,1.6rem)/1.2 var(--display);
  font-variant-numeric:tabular-nums}
.fitness-coverage-stats strong small {font-size:.7em;color:var(--muted);font-weight:500}
.fitness-coverage-stats p {margin:0}
@media(max-width:1100px) {
 .ideas-filter-form {grid-template-columns:repeat(3,minmax(0,1fr))}
 .ideas-filter-form .ideas-search {grid-column:span 2}
}
@media(max-width:650px) {
 .ideas-filter-form {grid-template-columns:repeat(2,minmax(0,1fr))}
 .ideas-filter-form .ideas-search {grid-column:1/-1}
 .ideas-toolbar-title {flex-wrap:wrap}
 .ideas-table {min-width:660px}
 .fitness-coverage-stats {grid-template-columns:1fr}
}
@media(max-width:420px) {
 .ideas-filter-form {grid-template-columns:1fr}
 .ideas-filter-form .ideas-search {grid-column:1}
}

/* Smart daily planner */
.planner-days { margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.planner-settings { margin-bottom: 1rem; }
.planner-settings summary { cursor: pointer; display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.planner-settings-form { padding-top: 1rem; display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; }
.planner-settings-form .field { min-width: 118px; flex: 1 1 125px; }
.planner-settings-form button { margin-bottom: .1rem; }
.planner-summary { display: flex; gap: 1rem; justify-content: space-between; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.planner-summary h2 { margin: .15rem 0 .35rem; }
.planner-summary p { max-width: 580px; margin: 0; }
.planner-metrics { display: flex; gap: 1rem; }
.planner-metrics span { display: flex; flex-direction: column; min-width: 82px; text-align: center; }
.planner-metrics strong { font-size: 1.55rem; }
.planner-metrics small { color: var(--muted); }
/* Adaptive planner: straightforward agenda, no ornamental effects. */
.adaptive-plan, .today-adaptive-plan { margin-block: 1rem; }
.adaptive-plan .eyebrow, .today-adaptive-plan .eyebrow { display: block; margin-bottom: .4rem; }
.adaptive-plan p, .today-adaptive-plan p { overflow-wrap: anywhere; }
.adaptive-proposals { margin: .9rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.adaptive-proposal { display: grid; grid-template-columns: minmax(75px,95px) minmax(180px,1fr) auto; gap: .85rem;
  align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.adaptive-proposal-time { display: flex; flex-direction: column; gap: .2rem; font-variant-numeric: tabular-nums; }
.adaptive-proposal-time strong { white-space: nowrap; font-size: .84rem; }
.adaptive-proposal-time small { font-size: .75rem; color: var(--muted); }
.adaptive-proposal-main { min-width: 0; }
.adaptive-proposal-main a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.adaptive-proposal-main p { margin: .2rem 0 0; line-height: 1.4; }
.adaptive-proposal-actions { gap: .4rem; align-items: center; }
.adaptive-proposal-actions form { margin: 0; }
.adaptive-proposal-actions :is(a,button) { min-height: 44px; white-space: nowrap; }
.adaptive-proposal :is(a,button,summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.adaptive-warnings { padding: .4rem .9rem; border-left: 3px solid var(--warn, #916518); background: var(--surface-2); }
.adaptive-warnings p { margin: .35rem 0; }
.adaptive-overload { padding: .65rem .9rem; border-left: 3px solid var(--warn, #916518); background: var(--surface-2); }
.adaptive-postponed { margin-top: 1rem; }
.adaptive-postponed summary { min-height: 44px; cursor: pointer; font-weight: 600; padding: .55rem 0; }
.adaptive-postponed li { border-bottom: 1px solid var(--border); gap: .6rem; padding: .4rem 0; }
.adaptive-postponed li button { min-height: 44px; }
.today-adaptive-plan h2 { margin: 0; }
.today-adaptive-plan > .row:first-child { margin-bottom: .7rem; }
.today-adaptive-plan .adaptive-today-list { margin: .8rem 0; }
@media (max-width: 780px) {
  .adaptive-proposal { grid-template-columns: minmax(74px,90px) minmax(0,1fr); align-items: start; }
  .adaptive-proposal-actions { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 480px) {
  .adaptive-proposal { gap: .5rem; grid-template-columns: 70px minmax(0,1fr); }
  .adaptive-proposal-actions { grid-column: 1/-1; }
  .adaptive-proposal-actions form { flex: 1; }
  .adaptive-proposal-actions button { width: 100%; }
}

.planner-windows { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
.planner-window-head, .planner-booking { display: flex; align-items: center; justify-content: space-between; gap: .9rem; flex-wrap: wrap; }
.planner-window-head { margin-bottom: .6rem; }
.planner-window-head h2 { margin: 0; font-size: 1.2rem; }
.planner-task { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .85rem 0; border-top: 1px solid var(--border); }
.planner-task-main { min-width: 0; flex: 1 1 250px; }
.planner-task-main p { margin: .3rem 0 0; }
.planner-task-title { gap: .5rem; }
.planner-book-form { flex-shrink: 0; }
.planner-booking { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.planner-booking:last-child { border-bottom: 0; }
.planner-booking p { margin: .3rem 0 0; }
@media (max-width: 640px) { .planner-task { align-items: stretch; flex-direction: column; } .planner-book-form button { width: 100%; } .planner-booking { align-items: flex-start; } }

/* Focus Mode: intentional, spacious reading with a no-distraction timer. */
.focus-page-head { align-items: flex-start; gap: 1rem; }
.focus-stage { text-align: center; max-width: 850px; margin: 1.5rem auto 1.25rem; padding: clamp(1.5rem, 5vw, 3.5rem); }
.focus-stage h2 { font-size: clamp(1.3rem, 3vw, 2.2rem); margin: .7rem 0; overflow-wrap: anywhere; }
.focus-state-chip { display: inline-flex; margin-bottom: .9rem; }
.focus-stopwatch { font-family: var(--mono), monospace; font-variant-numeric: tabular-nums; letter-spacing: -.06em; font-size: clamp(3.6rem, 10vw, 7.2rem); font-weight: 500; line-height: 1.2; margin: 1.5rem 0 .6rem; }
.focus-stage[data-state="paused"] .focus-stopwatch { opacity: .57; }
.focus-stage .focus-progress { margin: 1.5rem auto; max-width: 580px; text-align: left; }
.focus-progress .time-meter { margin-top: .5rem; }
.focus-controls { justify-content: center; gap: .7rem; margin: 2rem 0 1.1rem; }
.focus-controls .btn { min-width: 125px; }
.focus-associations { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.2rem; }
.focus-start { max-width: 850px; margin: 1.5rem auto; }
.focus-start .field { min-width: 0; }
.focus-review { max-width: 850px; margin: 1.4rem auto 3rem; }
.focus-metrics { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0 1.5rem; }
.focus-metrics > div { display: flex; flex-direction: column; gap: .3rem; flex: 1 1 175px; }
.focus-metrics strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.focus-review h3 { margin: 1.4rem 0 .6rem; }
.focus-inline-form { display: inline-flex; flex-shrink: 0; margin: .25rem 0; }
.kcard > .focus-inline-form { margin-top: .55rem; }
.todo > .focus-inline-form { margin-left: auto; }
.tree-row > .focus-inline-form { margin-left: .35rem; }
.focus-running-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.focus-running-banner p { margin: .3rem 0 0; }
@media (max-width: 640px) { .focus-controls form { flex: 1 1 40%; } .focus-controls button { width: 100%; } .todo > .focus-inline-form button { font-size: .75rem; } }

.focus-goal-form { display: flex; justify-content: center; align-items: end; flex-wrap: wrap; gap: .75rem; margin: 1.5rem auto .5rem; max-width: 460px; }
.focus-goal-form .field { flex: 1 1 190px; text-align: left; }
.focus-card-row { display: flex; align-items: center; gap: .5rem; }
.focus-card-row .row-link { flex: 1 1 0; min-width: 0; }

/* Unified My Work — queue, actionable rows, and compact responsive filters. */
.my-work-stats { display:grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap:.7rem; margin:1rem 0 1.1rem; }
.my-work-stats .panel { display:flex; flex-direction:column; gap:.35rem; padding:1rem; min-width:0; }
.my-work-stats strong { font-size:1.7rem; line-height:1.15; font-variant-numeric: tabular-nums; }
.my-work-scopes { display:flex; gap:.45rem; flex-wrap:wrap; margin:1rem 0; }
.my-work-live { display:flex; gap:1rem; align-items:center; justify-content:space-between; flex-wrap:wrap; margin:1rem 0; }
.my-work-live p { margin:.25rem 0 0; }
.my-work-filters { margin:1rem 0 1.3rem; }
.my-work-filter-form { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.85rem; align-items:end; }
.my-work-filter-form .field { min-width:0; }
.my-work-filter-form .input { width:100%; }
.my-work-filter-form .my-work-search { grid-column:span 2; }
.my-work-filter-actions { display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; }
.my-work-heading { margin:0 0 .75rem; gap:1rem; align-items:flex-start; }
.my-work-heading h2 { margin:0; }
.my-work-heading p { margin:.4rem 0; max-width:680px; }
.my-work-group-title { margin:1.5rem 0 .65rem; display:flex; align-items:center; gap:.5rem; }
.my-work-list { overflow:hidden; border:1px solid var(--border); border-radius:var(--radius,12px); background:var(--surface,var(--card)); }
.my-work-entry { min-width:0; padding:1rem 1.05rem; }
.my-work-list-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:1rem; border-bottom:1px solid var(--border); }
.my-work-list-row:last-child { border-bottom:0; }
.my-work-card-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.85rem; }
.my-work-card { display:flex; flex-direction:column; justify-content:space-between; gap:1rem; border:1px solid var(--border); border-radius:var(--radius,12px); background:var(--surface,var(--card)); }
.my-work-content { flex:1 1 260px; min-width:0; }
.my-work-labels { gap:.4rem; margin-bottom:.35rem; }
.my-work-title { display:inline-block; font-weight:650; font-size:1.05rem; line-height:1.45; color:inherit; overflow-wrap:anywhere; }
.my-work-title:hover { text-decoration:underline; }
.my-work-context { margin-top:.4rem; gap:.35rem .8rem; line-height:1.5; }
.my-work-context a { color:var(--text-muted,var(--muted)); text-decoration:underline; text-decoration-style:dotted; }
.my-work-overdue { color:var(--danger,#b44747); }
.my-work-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:.45rem; }
.my-work-actions form { margin:0; }
.my-work-move { display:flex; align-items:center; gap:.3rem; }
.my-work-move select { width:auto; min-width:110px; max-width:150px; }
.my-work-milestone { border-left:3px solid var(--story,#8065aa); }
.my-work-results { padding-bottom:1rem; }
@media(max-width:1000px) { .my-work-stats { grid-template-columns:repeat(3,minmax(0,1fr)); } .my-work-filter-form { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:700px) { .my-work-filter-form { grid-template-columns:repeat(2,minmax(0,1fr)); } .my-work-card-grid { grid-template-columns:1fr; } .my-work-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } .my-work-list-row { align-items:flex-start; } .my-work-actions { justify-content:flex-start; } }
@media(max-width:430px) { .my-work-filter-form { grid-template-columns:1fr; } .my-work-filter-form .my-work-search { grid-column:auto; } .my-work-stats strong { font-size:1.35rem; } .my-work-entry { padding:.9rem; } }

/* Event preparation packs: lightweight checklist, schedules and progress. */
.event-prep-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.85rem; margin-top:1rem; }
.event-prep-card { display:flex; flex-direction:column; gap:.55rem; min-width:0; border:1px solid var(--border); border-radius:12px; padding:1rem; color:inherit; }
.event-prep-card:hover { border-color:var(--accent, #688c78); background:var(--surface-secondary,transparent); }
.event-prep-card strong { font-size:1.12rem; overflow-wrap:anywhere; }
.event-prep-card .time-meter { margin-top:.15rem; }
.event-prep-warning { color:var(--danger,#b44747); font-size:.82rem; font-weight:650; }
.event-prep-option { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.8rem 0; border-bottom:1px solid var(--border); }
.event-prep-option:last-child { border-bottom:0; }
.event-prep-option p { margin:.25rem 0 0; }
.event-prep-create { max-width:700px; }
.event-prep-create form { max-width:572px; }
.event-prep-hero { margin:1rem 0; }
.event-prep-hero h2 { margin:.3rem 0 0; }
.event-prep-hero .time-meter { margin:1.1rem 0 .5rem; }
.event-prep-hero-actions { margin:1rem 0 0; }
.event-prep-checklist { margin:1rem 0; }
.event-prep-step-list { margin:1rem 0; }
.event-prep-step { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem; padding:.8rem 0; border-bottom:1px solid var(--border); }
.event-prep-step:last-child { border-bottom:0; }
.event-prep-check { flex:0 0 auto; }
.event-prep-check .btn { width:2.3rem; min-width:2.3rem; border-radius:100%; }
.event-prep-step.is-done .event-prep-step-content strong { text-decoration:line-through; opacity:.65; }
.event-prep-step-content { flex:1 1 190px; min-width:0; display:flex; flex-direction:column; gap:.25rem; }
.event-prep-step-content strong { overflow-wrap:anywhere; }
.event-prep-step-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.45rem; }
.event-prep-edit { position:relative; }
.event-prep-edit summary { list-style:none; cursor:pointer; }
.event-prep-edit[open] { flex:1 1 100%; }
.event-prep-edit-form { display:flex; align-items:end; flex-wrap:wrap; gap:.6rem; margin:.65rem 0; }
.event-prep-edit-form .field:first-child { flex:2 1 200px; }
.event-prep-edit-form .field:nth-child(2) { flex:1 1 120px; }
.event-prep-edit-form .input { width:100%; }
.event-prep-add { display:flex; align-items:end; flex-wrap:wrap; gap:.7rem; padding-top:1.2rem; }
.event-prep-add .field:first-child { flex:2 1 220px; }
.event-prep-add .field:nth-child(2) { flex:1 1 110px; }
.event-prep-add .input { width:100%; }
.event-prep-management { margin:1rem 0 2rem; }
.event-prep-management .panel { min-width:0; }
.event-prep-management .field { max-width:585px; }
.event-prep-management form + form { margin-top:1.1rem; }
@media (max-width:920px) { .event-prep-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) { .event-prep-grid { grid-template-columns:1fr; } .event-prep-option { flex-wrap:wrap; } .event-prep-step-actions { width:100%; padding-left:2.8rem; } }

/* Consolidated work/calendar sub-navigation. The sidebar now exposes each
   destination once; these local tabs keep formerly top-level tools discoverable. */
.hub-subnav {
  display: flex; flex-wrap: nowrap; align-items: center; gap: .3rem;
  overflow-x: auto; overscroll-behavior-x: contain;
  margin: .85rem 0 1.5rem; padding: .25rem 0 .7rem;
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}
.hub-subnav a {
  flex: 0 0 auto; padding: .55rem .8rem; border-radius: .55rem;
  color: var(--muted); text-decoration: none;
  font-size: .88rem; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .35rem;
}
.hub-subnav a:hover { background: var(--surface-secondary,rgba(128,128,128,.08)); color: var(--text); }
.hub-subnav a.current {
  background: var(--accent-soft,rgba(72,116,91,.12));
  color: var(--text); box-shadow: inset 0 -2px var(--accent,#407562);
}
.hub-subnav a .small { font-size: .73rem; font-weight: 500; }
.hub-subnav a:focus-visible { outline: 2px solid var(--accent,#407562); outline-offset: 2px; }
@media(max-width:600px) { .hub-subnav { margin:.65rem 0 1rem; } .hub-subnav a { padding:.55rem .65rem; } }

/* AI review: long model-provided arguments cannot overflow panels. */
.approval-arguments { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 18rem; overflow-y: auto; padding: 1rem; border-radius: .55rem; background: rgba(120,120,120,.08); font-size: .82rem; }

/* Settings: AI providers and MCP */
.ai-status { font-size: .9rem; }
.ai-provider { padding: 0; }
.ai-provider[open] { padding-bottom: 1.1rem; }
.ai-provider-head { display: flex; align-items: center; gap: .8rem; padding: .95rem 1.2rem; }
/* FND-4: Settings › Assistant › Which model answers */
.ai-pings { display: grid; gap: .3rem; font-size: .9rem; }
.ai-pings li { display: flex; align-items: center; gap: .45rem; }
.ai-route-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ai-route-table th, .ai-route-table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ai-route-table thead th { font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ai-route-table tbody th { font-weight: 600; }
.ai-provider-head small { display: block; color: var(--muted); font-size: .8rem; }
.ai-provider > form, .ai-provider > .ai-test-result { margin: 0 1.2rem; }
.ai-provider[open] > .ai-provider-head { border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.ai-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 .95rem var(--display); flex-shrink: 0; color: #fff; }
.ai-logo.ai-anthropic { background: #C66B4A; }
.ai-logo.ai-openai { background: #1F1A2E; }
.ai-logo.ai-ollama { background: var(--ok); }
.test-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.test-dot.ok { background: var(--ok); } .test-dot.bad { background: var(--bad); }
.key-source { margin: -.3rem 0 0; }
label.check.inline { display: inline-flex; margin-left: .4rem; font-size: .85rem; }
.ai-test-result { margin-top: .9rem; }
.test-steps { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.test-steps li { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: .6rem; align-items: baseline; padding: .45rem .7rem; border-radius: 9px; font-size: .86rem; background: var(--surface-2); border-left: 3px solid var(--line-strong); }
.test-steps li.ok { border-left-color: var(--ok); }
.test-steps li.warn { border-left-color: var(--palette-apricot); background: var(--focus-soft); }
.test-steps li.bad { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 7%, var(--surface)); }
.test-steps small { color: var(--faint); font-variant-numeric: tabular-nums; }
.bad-text { color: var(--bad); }
pre.cmd { position: relative; background: var(--sunk); border-radius: 10px; padding: .75rem 4.5rem .75rem .85rem; margin: .4rem 0 0; white-space: pre-wrap; word-break: break-all; font-size: .8rem; }
pre.cmd .copy-btn { position: absolute; top: .35rem; right: .35rem; }
.wrap-code { word-break: break-all; }
@media (max-width: 600px) { .test-steps li { grid-template-columns: 1fr; gap: .1rem; } }

/* Shared filter + sort toolbar: reusable across Ideas, Reading, and future lists. */
.filter-toolbar{display:flex;flex-wrap:wrap;gap:.7rem;align-items:end;min-width:0}
.filter-toolbar .field{min-width:145px}
.filter-toolbar .field input,.filter-toolbar .field select{max-width:100%}
.filter-toolbar .field:has(input[type="search"]){flex:2 1 220px}
.filter-toolbar .field:has(select){flex:1 1 145px}
.filter-toolbar .filter-actions{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
@media(max-width:600px){.filter-toolbar .field{flex:1 1 100%;min-width:0}}

/* Practice Room uses Hub's navigation, typography and page framing. */
.practice-hub-shell {padding-bottom:18px!important}
.practice-hub-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:14px;flex-wrap:wrap;margin-bottom:16px}
.practice-hub-heading h1{margin:3px 0 5px}
.practice-hub-heading p{margin:0}
.practice-hub-container {border:1px solid var(--line);border-radius:var(--r-panel);background:var(--surface);box-shadow:var(--shadow)}
.practice-hub-frame {display:block;border:0;width:100%;min-height:580px;background:var(--bg)}
.practice-hub-caption{margin:10px 0 0}
@media(max-width:760px){.practice-hub-shell{padding:18px 12px 80px!important}.practice-hub-frame{height:calc(100dvh - 235px);min-height:400px}.practice-hub-heading{align-items:center}.practice-hub-heading h1{font-size:1.5rem}}

/* Dynamic Practice embed: Hub owns scrolling, the child reports its actual height. */
.practice-hub-shell{width:100%;max-width:none!important;min-width:0}
.practice-hub-container{width:100%;min-width:0;overflow:hidden}
.practice-hub-frame{height:740px;max-width:100%;min-width:0;overflow:hidden}
/* PRA-9: the studio reads as part of the page (no box), under the Hub's own Practice tabs. */
.practice-hub-heading{margin-bottom:12px}
.practice-hub-container{border:0;border-radius:0;background:transparent;box-shadow:none}
.practice-hub-frame{background:transparent}
.practice-tabs{display:flex;align-items:center;gap:4px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;
  border-bottom:1px solid var(--line);margin:0 0 4px;padding:0 2px}
.practice-tabs::-webkit-scrollbar{display:none}
.practice-tab-langs{display:contents}
.practice-tabs a{display:inline-flex;align-items:center;gap:7px;flex:none;padding:10px 12px;margin-bottom:-1px;
  font:600 .9rem var(--body);color:var(--muted);text-decoration:none;border-bottom:2px solid transparent;white-space:nowrap}
.practice-tabs a:hover{color:var(--ink)}
.practice-tabs a[aria-current="page"]{color:var(--ink);border-bottom-color:var(--accent)}
.practice-tabs .practice-tab-add{color:var(--accent);margin-left:auto}
.practice-tab-dot{width:8px;height:8px;border-radius:50%;background:var(--dot,var(--muted));flex:none}
@media(max-width:760px){.practice-tabs .practice-tab-add{margin-left:0}}
.login-page{min-height:100dvh;display:grid;place-items:center;padding:24px}
.login-panel{width:min(100%,460px);padding:clamp(22px,4vw,36px);display:grid;gap:18px}
.login-panel h1{margin:0}
.login-panel p{margin:0}
.login-panel .stack{display:grid;gap:15px}
.login-panel .field{display:grid;gap:8px}
.login-panel button{width:100%}

/* Shared File Library — one asset can be related to several Hub records. */
.file-library-layout{align-items:start}
.file-drop{border:2px dashed var(--line, #b9b9b9);border-radius:12px;padding:1.7rem 1rem;min-height:160px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.5rem;text-align:center;cursor:pointer;background:var(--surface-2,var(--panel,#f7f7f7))}
.file-drop:hover,.file-drop.dragover{border-color:var(--accent,#567bc0);background:var(--panel,#fff)}
.file-drop-mark{font-size:2rem;line-height:1}
.file-drop input{max-width:100%;font-size:.85rem}
.file-error{color:var(--danger,#bd3636)!important}
.file-alert{border-color:var(--good,#66a36a);margin-bottom:1rem}
.file-project-list{display:flex;flex-wrap:wrap;gap:.45rem;max-height:280px;overflow:auto}
.file-folder{display:inline-block;padding:.4rem .7rem;border:1px solid var(--line,#ccc);border-radius:9px;color:inherit;text-decoration:none;font-size:.87rem}
.file-folder.on{font-weight:700;border-color:var(--accent,#567bc0)}
.file-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:1rem}
.file-card{border:1px solid var(--line,#ddd);border-radius:12px;overflow:hidden;min-width:0;background:var(--panel,#fff)}
.file-card-preview{height:125px;display:flex;align-items:center;justify-content:center;background:var(--surface-2,#f7f7f7);overflow:hidden;text-decoration:none}
.file-card-preview img{max-height:100%;width:100%;object-fit:contain}
.file-glyph{font-family:var(--mono,monospace);font-weight:700;font-size:1.5rem;opacity:.6}
.file-card-details{padding:.7rem;display:flex;flex-direction:column;gap:.25rem}
.file-card-name{font-weight:650;overflow-wrap:anywhere;line-height:1.3}
.file-card-details p{margin:0;overflow-wrap:anywhere}
.file-detail-layout{align-items:start}
.file-detail-image{max-width:100%;max-height:650px;object-fit:contain;border-radius:8px}
.file-pdf-preview{width:100%;min-height:560px;border:1px solid var(--line,#ddd);border-radius:8px}
.file-extracted{white-space:pre-wrap;overflow-wrap:anywhere;max-height:500px;overflow:auto;font:inherit;font-size:.87rem;line-height:1.6}
.file-link-row{border-bottom:1px solid var(--line,#ddd);padding:.45rem 0}
@media(max-width:680px){.file-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.file-pdf-preview{min-height:370px}.file-library-layout{display:block}.file-library-layout>.panel{margin-bottom:1rem}}


.settings-tool-links{display:flex;flex-wrap:wrap;gap:8px}
.settings-tool-links .btn{display:inline-flex;align-items:center;gap:6px}

/* Today grid: click an empty slot to add an event there. */
.tg-col:not(.is-past) { cursor: cell; }
.tg-add-hint { position: absolute; left: 4px; right: 4px; border: 1.5px dashed var(--accent, #245CC4); border-radius: 8px; color: var(--accent, #245CC4); font-size: .72rem; font-weight: 600; padding: 2px 6px; pointer-events: none; background: color-mix(in srgb, var(--accent, #245CC4) 6%, transparent); z-index: 1; }
.agenda-day-head .agenda-add { opacity: .65; }
.agenda-day-head .agenda-add:hover, .agenda-day-head .agenda-add:focus-visible { opacity: 1; }
/* FND-5: "Garmin · synced 06:10" under a page title; amber when stale or failed. */
.data-freshness { margin: .2rem 0 0; color: var(--muted); }
.data-freshness.stale { color: var(--guess-ink); }
/* ======================================================================
   ui-refresh
   ====================================================================== */
/* Hub UI refresh — original cool-spectrum workspace design.
   Shared tokens and layout overrides live separately from legacy feature CSS.
   Use semantic variables; do not give each page an unrelated colour scheme. */
:root {
  --bg:#F2F5F9; --bg-wash:none;
  --surface:#FFFFFF; --surface-2:#F8FAFD; --sunk:#EDF2F8;
  --ink:#15253D; --muted:#4F6178; --faint:#647890;
  --line:#DFE6EF; --line-strong:#B7C6D7;
  --accent:#245CC4; --accent-2:#174B9F; --accent-ink:#FFFFFF;
  --accent-soft:#E9F1FF; --accent-strong:#1A4794; --focus:#087E83; --focus-soft:#E6F6F5;
  --chip-bg:#EFF3F8; --chip-ink:#3C536F;
  --palette-ink:#15253D; --palette-violet:#245CC4; --palette-plum:#245CC4;
  --palette-rose:#5995D8; --palette-apricot:#08A1A4; --palette-blush:#DDEFFC;
  --epic:#5E60AD; --story:#087E83; --task:#376AAB; --bug:#BB4B65;
  --high:#9A5B14; --urgent:#B83D55; --ok:#067D75; --good:#067D75; --bad:#B83D55;
  --r-panel:15px; --r-card:11px; --r-chip:7px;
  --shadow-sm:0 1px 2px rgba(14,39,73,.04);
  --shadow:0 4px 24px -17px rgba(18,44,84,.24);
  --shadow-lg:0 24px 65px -20px rgba(9,31,61,.38);
  --display:"Manrope","Figtree",system-ui,sans-serif;
  --body:"DM Sans","Figtree",system-ui,-apple-system,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,monospace;
  --side:242px;
  --nav-bg:#14253E; --nav-surface:#1E3452; --nav-ink:#F4F8FD;
  --nav-muted:#B5C7DE; --nav-line:#314562;
}
/* The collapse class sits on <html> (same element as :root), so it must out-rank the width above. */
:root.side-collapsed {--side:70px}
@media (max-width:860px) {:root.side-collapsed {--side:270px}}
@media (prefers-color-scheme:dark) {
 :root {
  --bg:#0D1625; --bg-wash:none; --surface:#17263A; --surface-2:#1B2B41; --sunk:#23364F;
  --ink:#EDF4FF; --muted:#B7C7DC; --faint:#A0B4CB;
  --line:#31445E; --line-strong:#58708C;
  --accent:#8EB8FF; --accent-2:#C1D7FF; --accent-ink:#112039; --accent-soft:#243E60; --accent-strong:#C1D7FF;
  --focus:#75D9D1; --focus-soft:#1C3B43; --chip-bg:#293B54; --chip-ink:#E4ECFA;
  --epic:#AEA8FF; --story:#83DED4; --task:#A8C6FF; --bug:#F2A9B6;
  --high:#E2B875; --urgent:#FA9BAC; --ok:#75D9D1; --good:#75D9D1; --bad:#FA9BAC;
  --nav-bg:#091323; --nav-surface:#1B3050; --nav-ink:#F4F8FF;
  --nav-muted:#B7CAE3; --nav-line:#324564;
  --shadow:0 8px 28px -15px rgba(0,0,0,.32);
  --shadow-lg:0 25px 60px -20px rgba(0,0,0,.64);
 }
}
body {background:var(--bg);font-family:var(--body);letter-spacing:-.006em}
h1,h2,h3 {font-family:var(--display);letter-spacing:-.032em}
h1 {font-weight:750;font-size:clamp(1.9rem,2.6vw,2.6rem);line-height:1.13}
h2 {font-weight:750;letter-spacing:-.025em}
h3 {font-weight:700}
a {text-underline-offset:3px}
a:hover {color:var(--accent-2)}
:focus-visible {outline:3px solid var(--focus);outline-offset:3px}
::selection {background:color-mix(in srgb,var(--accent) 28%,transparent)}
/* Main workspace and persistent utilities */
.shell {align-items:stretch}
.sidebar {
  padding:1.1rem .75rem .9rem;background:var(--nav-bg);
  border-right:1px solid var(--nav-line);color:var(--nav-ink);
}
.sidebar .brand {color:var(--nav-ink);font-weight:800;letter-spacing:-.055em;font-size:1.35rem}
.sidebar .brand-mark {
 background:#E6F3FF;color:#154B8C;box-shadow:none;border-radius:9px;
}
.sidebar .side-toggle {color:var(--nav-muted)}
.sidebar .side-toggle:hover {background:var(--nav-surface);color:var(--nav-ink)}
.sidebar .nav-heading {
  color:var(--nav-muted);font-size:.68rem;font-weight:700;letter-spacing:.105em;
  text-transform:uppercase;padding-top:1rem;padding-bottom:.35rem;
}
.sidebar .nav a,.sidebar .nav-settings,.sidebar .nav-projects-toggle {
  color:var(--nav-muted);border:1px solid transparent;border-radius:9px;
  padding:.43rem .7rem;line-height:1.35;
}
.sidebar .nav a:hover,.sidebar .nav-settings:hover,.sidebar .nav-projects-toggle:hover {
  background:var(--nav-surface);color:var(--nav-ink);text-decoration:none;
}
.sidebar .nav a.on,.sidebar .nav-settings.on {
  background:var(--nav-surface);color:var(--nav-ink);
  border-color:#4C6A90;box-shadow:none;
}
.sidebar .nav a.on .icon,.sidebar .nav-settings.on .icon {color:#87CBF5}
.sidebar .nav .badge {background:#3268A0;color:#FFFFFF}
.sidebar .nav-projects .nav-sub {border-left-color:var(--nav-line)}
.sidebar .nav-projects .nav-caret,.sidebar .nav-projects .nav-caret svg {color:var(--nav-muted)}
.sidebar .nav-caret:hover {background:var(--nav-surface);color:var(--nav-ink)}
.sidebar .nav-foot {border-top-color:var(--nav-line)}
.sidebar .nav-search {
 background:var(--nav-surface);border:1px solid var(--nav-line);
 color:var(--nav-ink);box-shadow:none;
}
.sidebar .nav-search:hover {background:#2C486B;color:white}
.sidebar .nav-search kbd {color:var(--nav-muted);border-color:var(--nav-line)}
.sidebar .side-new {background:#E5F1FF;color:#164C99;border-color:transparent;box-shadow:none}
.sidebar .nav-logout .btn {color:var(--nav-muted)}
.main {
  width:100%;min-width:0;max-width:2000px;
  padding:0 clamp(1.1rem,3.1vw,3.1rem) 5.5rem;gap:1.35rem;
}
.workspace-toolbar {
  position:relative;display:flex;align-items:center;justify-content:space-between;
  gap:1rem;min-height:64px;padding:10px 0;border-bottom:1px solid var(--line);
  margin-bottom:.25rem;flex-wrap:wrap;
}
.workspace-location {display:flex;align-items:center;gap:.45rem;font-size:.79rem;letter-spacing:.01em;color:var(--muted)}
.workspace-location span:first-child {font-weight:750;color:var(--ink)}
.workspace-location strong {font-weight:750;color:var(--accent)}
.workspace-tools {display:flex;align-items:center;gap:.6rem}
.workspace-search {
 display:flex;align-items:center;gap:.65rem;min-width:225px;justify-content:flex-start;
 background:var(--surface);border:1px solid var(--line);border-radius:10px;
 color:var(--muted);font:500 .84rem var(--body);padding:.54rem .8rem;
 cursor:pointer;box-shadow:var(--shadow-sm);
}
.workspace-search:hover {border-color:var(--line-strong);color:var(--ink)}
.workspace-search kbd {margin-left:auto;color:var(--faint);font:500 .7rem var(--mono)}
.workspace-capture {display:flex;align-items:center;gap:.45rem;white-space:nowrap}
.workspace-capture .icon {width:16px;height:16px}
.panel,.ideas-explore,.ideas-capture,.note-list {border-color:var(--line);box-shadow:var(--shadow)}
.panel {background:var(--surface)}
.page-head {padding-top:.35rem;align-items:flex-end}
.page-head h1 {line-height:1.1}
.page-head p {line-height:1.55;margin-top:.45rem}
.btn {border-radius:9px;font-weight:700;transition:background .15s,border-color .15s,transform .15s}
.btn.primary {background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.btn.primary:hover {background:var(--accent-2);border-color:var(--accent-2);color:var(--accent-ink)}
.btn:active {transform:translateY(1px)}
.input {background:var(--surface);border-color:var(--line-strong);border-radius:9px}
.input:focus {box-shadow:0 0 0 3px var(--accent-soft)}
.chip,.status-pill,.level-tag,.idea-state {border-radius:7px;font-weight:650}
.chip {border:1px solid var(--line)}
.chip.on {background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.tabbar {border-top-color:var(--line)}
/* Today is a visible launchpad, not a wall of collapsed cards. */
.main:has(.today-command) {max-width:2070px}
.today-command {display:grid;gap:1.1rem}
.today-intro {display:flex;justify-content:space-between;align-items:flex-end;gap:1.2rem;flex-wrap:wrap;padding:8px 0 4px}
.today-intro .eyebrow {font:750 .72rem var(--mono);letter-spacing:.09em;text-transform:uppercase;color:var(--accent);margin:0 0 .55rem}
.today-intro h1 {font-size:clamp(2rem,3.1vw,2.85rem);line-height:1.12}
.today-intro p {margin:.48rem 0 0;color:var(--muted);max-width:65ch}
.today-intro .today-date {font:600 .82rem var(--mono);color:var(--muted);white-space:nowrap}
.today-pulse {display:grid;gap:.75rem}
.today-pulse a {
  display:grid;gap:.35rem;background:var(--surface);color:var(--ink);
  border:1px solid var(--line);border-radius:12px;
  padding:1.05rem 1.15rem;text-decoration:none;transition:border-color .15s,transform .15s,box-shadow .15s;
}
.today-pulse a:hover {text-decoration:none;transform:translateY(-2px);border-color:var(--accent);box-shadow:var(--shadow)}
.today-pulse .pulse-label {display:flex;justify-content:space-between;align-items:center;gap:.5rem;font-size:.76rem;font-weight:750;color:var(--muted)}
.today-pulse .pulse-label .icon {width:17px;height:17px;color:var(--accent)}
.today-pulse strong {font:800 clamp(1.4rem,2.5vw,2rem)/1.2 var(--display);letter-spacing:-.055em}
.today-pulse .pulse-note {font-size:.8rem;color:var(--muted)}
.today-pulse a[data-kind="practice"] .pulse-label .icon,.today-pulse a[data-kind="habits"] .pulse-label .icon {color:var(--focus)}
.today-jump {
 display:flex;align-items:center;gap:.35rem;flex-wrap:wrap;
 border-bottom:1px solid var(--line);padding:.15rem 0 .7rem;
}
.today-jump span {font:700 .73rem var(--mono);color:var(--faint);margin-right:.65rem}
.today-jump a {padding:.35rem .7rem;color:var(--muted);border-radius:8px;font-size:.84rem;font-weight:700}
.today-jump a:hover {background:var(--accent-soft);color:var(--accent);text-decoration:none}
.today-workspace-links {background:var(--surface);border:1px solid var(--line);border-radius:13px;padding:1.05rem 1.2rem}
.today-workspace-links .section-heading {display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:.75rem}
.today-workspace-links h2 {font-size:1rem;margin:0}
.today-workspace-links p {font-size:.78rem;color:var(--muted);margin:0}
.today-link-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.35rem .65rem}
.today-link-grid a {
 display:flex;gap:.55rem;align-items:center;min-width:0;padding:.65rem .7rem;
 border:1px solid transparent;border-radius:9px;background:var(--surface-2);color:var(--ink);
 font-weight:700;font-size:.83rem;text-decoration:none;
}
.today-link-grid a .icon {width:17px;height:17px;color:var(--accent)}
.today-link-grid a:hover {background:var(--accent-soft);border-color:var(--line);color:var(--accent)}
.today-link-grid .mini-count {margin-left:auto;color:var(--muted);font:.65rem var(--mono);white-space:nowrap}
.today-core-grid {display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);align-items:start;gap:1rem}
.today-core-grid > .panel {min-width:0;height:100%}
.today-core-grid .panel h2 {display:flex;justify-content:space-between;align-items:center;gap:.5rem;flex-wrap:wrap}
.today-core-grid .panel h2 a {font:650 .8rem var(--body)}
.today-command .now {border:1px solid var(--line);background:var(--surface);padding:1rem 1.15rem;border-radius:12px;box-shadow:var(--shadow)}
.today-command .now::before {background:var(--focus)}
.today-command .now-label {font-weight:800}
.today-command .today-grid {grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1rem}
.today-command .day-panel {min-width:0}
.today-command .vitals {margin:0}
.today-command .vital {background:var(--surface)}
.today-command .panel {scroll-margin-top:22px}
.today-command [id^="today-"] {scroll-margin-top:20px}
.today-command .today-grid .stack {gap:1rem}
.today-section-title {display:flex;align-items:center;justify-content:space-between;gap:.8rem;flex-wrap:wrap;margin:.4rem 0 -.3rem}
.today-section-title h2 {font-size:1.14rem;margin:0}
.today-section-title p {margin:0;color:var(--muted);font-size:.83rem}
/* Notes and Ideas keep their familiar compact, information-rich layout. */
.main:has(.ideas-head),.main:has(.notes-layout),.main:has(.note-head) {max-width:2080px}
.ideas-head {padding:0}
.ideas-capture {border-radius:12px;background:var(--surface);padding:1rem;border:1px solid var(--line)}
.ideas-explore {border-radius:13px}
.ideas-toolbar-title h2 {font-size:1.12rem}
.ideas-view-switch {background:var(--sunk);border:1px solid var(--line)}
.ideas-view-option.on {color:var(--accent)}
.idea-grid {gap:1rem}
.idea {background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-sm);padding:1rem}
.idea:hover {border-color:var(--line-strong);box-shadow:var(--shadow)}
.idea h2 {line-height:1.35}
.idea h2 a {color:var(--ink)}
.idea h2 a:hover {color:var(--accent)}
.idea .excerpt {line-height:1.55}
.idea-board {display:grid;grid-auto-flow:column;grid-auto-columns:minmax(238px,1fr);gap:.95rem;overflow-x:auto;padding:0 0 .8rem;scroll-snap-type:x proximity}
.idea-board-column {background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:.8rem;min-width:0;scroll-snap-align:start}
.idea-board-column .board-header {display:flex;gap:.5rem;justify-content:space-between;align-items:center;margin:0 0 .8rem;padding:.15rem .2rem .65rem;border-bottom:1px solid var(--line)}
.idea-board-column .board-header h2 {font-size:.82rem;margin:0;overflow-wrap:anywhere}
.idea-board-column .board-header .chip {font:.7rem var(--mono)}
.idea-board-column .idea {margin:0 0 .65rem;padding:.9rem}
.idea-board-column .idea h2 {font-size:.94rem}
.idea-board-column .idea footer {flex-wrap:wrap}
.idea-board-column .idea .excerpt {max-height:5.2em;overflow:hidden}
.notes-layout {gap:1.15rem;align-items:start}
.notes-layout .facets {background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:.9rem;position:sticky;top:14px}
.notes-layout .facets h3 {text-transform:uppercase;letter-spacing:.09em;font:.72rem var(--mono);color:var(--faint);margin:.95rem 0 .5rem}
.notes-layout .note-list {padding:0;overflow:hidden}
.note-list .note-row {padding:1rem 1.2rem;border-bottom:1px solid var(--line)}
.note-list .note-row:hover {background:var(--surface-2)}
.note-list .note-row .title {font-family:var(--display);font-size:.96rem;font-weight:750;color:var(--ink)}
.note-list .note-row .excerpt {font-size:.83rem;line-height:1.55}
.note-list .note-row .meta {font-size:.72rem;gap:.35rem;color:var(--muted)}
.note-head {padding-top:.3rem}
.note-head .crumb {font-weight:700}
.main:has(.note-head)>.grid-2 {grid-template-columns:minmax(0,1.65fr) minmax(265px,.75fr)}
.main:has(.note-head) .prose {font-size:.97rem;line-height:1.8;min-height:300px;padding:clamp(1.3rem,2.5vw,2.35rem)}
.main:has(.note-head) .note-side {min-width:0}
.main:has(.note-head) .note-side>.panel {margin-bottom:.85rem}
.idea-detail-layout {grid-template-columns:minmax(0,1.5fr) minmax(280px,.85fr)}
/* Shared data-heavy pages: more breathing room without hiding controls. */
.main .review-stats,.main .time-kpis,.main .fitness-stats {gap:.8rem}
.main .review-stats .panel,.main .time-kpi {box-shadow:var(--shadow-sm)}
.main .review-stat,.main .time-kpi strong {color:var(--ink)}
.main .tabs {gap:.2rem}
.main .tabs a.on,.main .tabs button.on {color:var(--accent)}
.main .section-nav,.main .goal-jump-nav,.main .time-section-nav {padding:.25rem 0}
.main .section-nav a,.main .goal-jump-nav a,.main .time-section-nav a {border-radius:9px}
.main .filter-toolbar {gap:.75rem}
.main .board,.main .agenda,.main .habit-board {min-width:0}
.main .agenda-day,.main .review-crosspage {box-shadow:var(--shadow-sm)}
.main .empty-state {padding:2rem;text-align:center}
.main table th {color:var(--muted)}
.main table tr:last-child td {border-bottom-color:transparent}
/* Small responsive grids: no global horizontal overflow. */
@media (max-width:1250px) {
  
  .today-link-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
  .main:has(.note-head)>.grid-2 {grid-template-columns:minmax(0,1.35fr) minmax(250px,.8fr)}
}
@media (max-width:1000px) {
  .today-core-grid {grid-template-columns:1fr}
  .today-command .today-grid {grid-template-columns:1fr}
  .today-intro {align-items:flex-start}
}
@media (max-width:860px) {
  .main {padding:0 1rem 6.5rem}
  .workspace-toolbar {min-height:55px;gap:.5rem}
  .workspace-search {min-width:0}
  .workspace-search span,.workspace-search kbd {display:none}
  .workspace-location {max-width:58%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .sidebar {box-shadow:var(--shadow-lg)}
  .side-collapsed .sidebar .nav a,.side-collapsed .sidebar .nav-heading {color:var(--nav-muted)}
  .main:has(.note-head)>.grid-2 {grid-template-columns:1fr}
  .notes-layout .facets {position:static}
  .tabbar {background:color-mix(in srgb,var(--surface) 96%,transparent)}
}
@media (max-width:600px) {
  .workspace-toolbar {padding:.48rem 0}
  .workspace-location {font-size:.7rem}
  .workspace-capture {padding:.45rem .6rem;font-size:.77rem}
  .today-pulse {gap:.55rem}
  .today-pulse a {padding:.75rem;min-height:100px}
  .today-pulse strong {font-size:1.5rem}
  .today-link-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem}
  .today-link-grid a {padding:.65rem .5rem;font-size:.75rem}
  .today-workspace-links {padding:.9rem}
  .today-core-grid>.panel {padding:1rem}
  .idea-board {grid-auto-columns:minmax(245px,84vw)}
  .today-command .today-jump {gap:.15rem}
  .today-command .today-jump a {padding:.3rem .45rem;font-size:.76rem}
  .main:has(.note-head) .prose {padding:1.2rem}
}
@media (prefers-reduced-motion:reduce) {
  .today-pulse a,.btn,.sidebar,.nav a {transition:none!important}
}

/* Contextual previews are optional: the full detail routes remain canonical. */
.notes-layout.notes-workspace {display:grid}

.notes-workspace .notes-preview {top:15px;display:flex;flex-direction:column}
.note-row-header {display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-width:0}
.note-row-header .title {min-width:0;overflow-wrap:anywhere}
.note-preview-trigger {font-size:.74rem;font-weight:750;white-space:nowrap;color:var(--accent)}
.notes-workspace .note-row.selected {background:var(--accent-soft);box-shadow:inset 3px 0 0 var(--accent)}
.notes-preview-head {display:flex;justify-content:space-between;align-items:flex-start;gap:.5rem}
.notes-preview .eyebrow {font-size:.69rem;text-transform:uppercase;letter-spacing:.07em}
.notes-preview h2 {margin:0;font-size:1.35rem;line-height:1.25;overflow-wrap:anywhere}
.notes-preview h2 a {color:var(--ink)}
.notes-preview-excerpt {margin:0;white-space:pre-line;overflow-wrap:anywhere;line-height:1.75;color:var(--muted);font-size:.88rem}
.notes-preview-meta {display:flex;flex-wrap:wrap;gap:.4rem}
.notes-preview-related {border-top:1px solid var(--line);padding-top:1rem;display:grid;gap:.55rem}
.notes-preview-related h3 {margin:0 0 .2rem;font-size:.83rem;color:var(--ink)}
.notes-preview-related a {display:flex;gap:.45rem;align-items:center;font-size:.84rem}
.notes-preview-related .icon {width:14px;height:14px}
.notes-preview-actions,.ideas-inspector-actions {margin-top:auto;display:grid;gap:.5rem}
.notes-preview-actions .btn,.ideas-inspector-actions .btn {justify-content:center}
.notes-preview-empty {display:grid;gap:.8rem;justify-items:start}
.notes-preview-empty > .icon {width:32px;height:32px;color:var(--accent)}
.ideas-board-layout {min-width:0}
.ideas-board-layout.has-inspector {display:grid;grid-template-columns:minmax(0,1fr) minmax(270px,315px);gap:1rem;align-items:start}
.ideas-inspector {position:sticky;top:15px;display:flex;flex-direction:column;gap:1rem;max-height:calc(100dvh - 32px);overflow:auto}
.ideas-inspector h2 {font-size:1.35rem;line-height:1.25;margin:0}
.ideas-inspector-copy {margin:0;font-size:.89rem;color:var(--muted);line-height:1.7;white-space:pre-line;overflow-wrap:anywhere}
.ideas-inspector-group {border-top:1px solid var(--line);padding-top:.9rem}
.ideas-inspector-group h3 {font:.7rem var(--mono);letter-spacing:.09em;text-transform:uppercase;margin:0 0 .55rem;color:var(--faint)}
.ideas-inspector-group p {font-size:.85rem;white-space:pre-line;line-height:1.6}
.ideas-inspector-group>a {display:flex;align-items:center;gap:.4rem;font-weight:700;font-size:.86rem}
.ideas-inspector-group .icon {width:15px;height:15px}
@media(max-width:1340px) {
  .notes-layout.notes-workspace {grid-template-columns:minmax(165px,205px) minmax(0,1fr)}
  .notes-workspace .notes-preview {grid-column:2;position:static;max-height:none}
}
@media(max-width:1100px) {
  .ideas-board-layout.has-inspector {grid-template-columns:1fr}
  .ideas-inspector {position:static;max-height:none}
}
@media(max-width:860px) {
  .notes-layout.notes-workspace {grid-template-columns:1fr}
  .notes-workspace .notes-preview {grid-column:auto;position:static;max-height:none}
  .notes-workspace .facets {position:static}
}

/* Ideas controls must wrap on phones; only the columns should scroll horizontally. */
.ideas-toolbar-title {min-width:0;flex-wrap:wrap;row-gap:.85rem}
.ideas-toolbar-title>div {min-width:0}
.ideas-view-switch {min-width:0;max-width:100%;flex-shrink:1;overflow-x:auto;scrollbar-width:thin}
.ideas-view-option {white-space:nowrap;flex-shrink:0}
.ideas-board-layout,.ideas-board-layout .idea-board,.ideas-explore,.ideas-head,.ideas-capture {min-width:0;max-width:100%}
@media(max-width:600px) {
  .ideas-explore {padding:.9rem}
  .ideas-capture .row {flex-wrap:wrap}
  .ideas-capture input[name="title"] {flex:1 1 100%;width:100%}
  .ideas-view-switch {width:100%;max-width:100%;justify-content:flex-start}
  .ideas-view-option {padding:.4rem .55rem;font-size:.78rem}
}

/* ---------- Today v2: pulse, needs-attention, two-column work area ---------- */
.today-pulse {grid-template-columns:repeat(5,minmax(0,1fr))}
.today-pulse strong small {font-size:.55em;color:var(--muted);letter-spacing:-.02em;margin-left:.1em}
.today-pulse a.is-warn {border-color:color-mix(in srgb,var(--bad) 45%,var(--line))}
.today-pulse a.is-warn .pulse-note {color:var(--bad);font-weight:700}
.today-pulse a[data-kind="goals"] .pulse-label .icon {color:var(--focus)}
.warn-text {color:var(--bad)}
.today-command .panel > h2 {display:flex;justify-content:space-between;align-items:center;gap:.5rem;flex-wrap:wrap}
.today-command .panel > h2 a {font:650 .8rem var(--body)}
.today-command .panel > h2 .count {margin-right:auto;margin-left:.4rem}
.today-attention {border-left:3px solid var(--focus)}
.attention-list {list-style:none;margin:.25rem 0 0;padding:0}
.attention-row {display:flex;align-items:center;gap:.75rem;padding:.6rem 0;border-top:1px solid var(--line)}
.attention-row:first-child {border-top:0}
.attention-row .grow {display:grid;gap:.1rem;min-width:0}
.attention-row .grow small {color:var(--muted);font-size:.8rem}
.attention-row form {margin:0}
.attention-kind {flex:0 0 6.5rem;font:700 .68rem var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.today-main {display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:1rem;align-items:start}
.today-main > .stack {min-width:0}
.today-main > .stack {gap:1rem}
/* Today lays itself out by its own width (sidebar open or not), not the window's. */
.today-command {container:today / inline-size}
.today-command .panel > h2 .icon {width:15px;height:15px;vertical-align:-2px;margin-right:.15rem}
.today-command .now-ask .input {min-width:0}
/* Row actions ("Focus") stay out of the way until you point at or move to the row. */
@media (hover:hover) {
  .today-command .todo > .focus-inline-form, .today-command .focus-card-row > .focus-inline-form {opacity:0;transition:opacity .12s}
  .today-command .todo:is(:hover, :focus-within) > .focus-inline-form,
  .today-command .focus-card-row:is(:hover, :focus-within) > .focus-inline-form {opacity:1}
}
/* Weekly goals: the number is the tick button */
.today-command .goal-tick {margin:0;display:contents}
.today-command .top3 button.n {border:0;cursor:pointer;padding:0}
.today-command .top3 button.n:hover {background:var(--accent);color:#fff}
.today-command .top3 li.done button.n:hover {background:var(--surface-2);color:var(--ok);outline:1px solid var(--ok)}
/* Inbox rows: the capture first, filing choices beside it (or below it when narrow) */
.today-command .inbox-item {flex-wrap:wrap;row-gap:.25rem}
.today-command .inbox-text {flex:1 1 14rem;min-width:0;color:var(--ink);overflow-wrap:anywhere}
.today-command .inbox-text:hover {color:var(--accent)}
.today-command .inbox-actions {display:flex;flex:0 0 auto;gap:.15rem;align-items:center;flex-wrap:nowrap;margin-left:auto}
.today-command .inbox-actions form {margin:0}
@container today (max-width:1100px) {
  .today-pulse {gap:.6rem}
  .today-pulse a {padding:.8rem .9rem}
  .today-pulse strong {font-size:1.55rem}
}
@container today (max-width:780px) {
  .today-main {grid-template-columns:1fr}
}
@container today (max-width:640px) {
  /* Phones: the five counts become one swipeable row instead of a screen of tiles. */
  .today-pulse {display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:.5rem;padding-bottom:.25rem;
    margin-inline:-1rem;padding-inline:1rem;scrollbar-width:none}
  .today-pulse::-webkit-scrollbar {display:none}
  .today-pulse a {flex:0 0 auto;min-width:7.6rem;min-height:0;scroll-snap-align:start;padding:.65rem .8rem;gap:.15rem}
  .today-pulse strong {font-size:1.35rem}
  .today-pulse .pulse-note {font-size:.74rem;white-space:nowrap}
  .attention-row {flex-wrap:wrap;gap:.35rem .75rem}
  .attention-kind {flex-basis:100%}
  .attention-row > .grow {flex:1 1 100%}
  .attention-row > .row {margin-left:0}
  .today-command .now-ask {flex-direction:column;align-items:stretch}
  /* To-dos: let titles use the full width; list, priority and date sit underneath. */
  .today-command .todo {flex-wrap:wrap;row-gap:.15rem}
  .today-command .todo .todo-title {flex:1 1 calc(100% - 3rem)}
  .today-command .todo .row-meta {flex-basis:100%;padding-left:2.1rem;justify-content:flex-start}
  .today-command .todo > .focus-inline-form {display:none}
  .today-command .focus-card-row > .focus-inline-form {display:none}
}

/* Today styles are owned exclusively by 95-today.css. */

/* To-dos: optional add-form fields tucked away; titles keep their width on phones. */
.todos-add-more{flex:1 1 100%}
.todos-add-more>summary{cursor:pointer;color:var(--accent);font-size:.88rem;font-weight:600;min-height:32px;display:inline-flex;align-items:center}
.todos-add-more[open]>summary{margin-bottom:.5rem}
@media(max-width:640px){
 .todo details summary{flex-wrap:wrap;row-gap:.25rem}
 .todo details summary .todo-title{flex:1 1 100%}
 .todo details summary .row-meta{flex:1 1 100%;justify-content:flex-start;flex-wrap:wrap}
}

/* Calendar: the agenda first; editing your own Hub events is one click away at the bottom. */
details.hub-calendar-manage{margin-top:1rem}
details.hub-calendar-manage>summary{cursor:pointer;display:flex;gap:.5rem;align-items:center;min-height:44px;list-style:none}
details.hub-calendar-manage>summary::-webkit-details-marker{display:none}
details.hub-calendar-manage[open]>summary{margin-bottom:.6rem}

/* Goals: one "Manage" menu per goal instead of three buttons fighting the title for space. */
.goal-manage{position:relative;flex:none}
.goal-manage>summary{list-style:none}
.goal-manage>summary::-webkit-details-marker{display:none}
.goal-manage[open]>summary{background:var(--sunk);color:var(--ink)}
.goal-manage-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:31;display:flex;flex-direction:column;align-items:stretch;gap:.2rem;min-width:11rem;padding:.35rem;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-card);box-shadow:var(--shadow-lg)}
.goal-manage-menu>.goal-edit>summary{display:flex;width:100%;justify-content:flex-start}
.goal-manage-menu .goal-edit-form{right:calc(100% + 6px);top:0}
@media(max-width:640px){.goal-manage-menu .goal-edit-form{position:static;width:auto;box-shadow:none;margin-top:.3rem}}

/* Screen-reader-only text (used for per-row labels that would otherwise repeat the title). */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* My Work: search first; filters folded unless one is in use; one blue button per screen, not per row. */
.my-work-filter-form{grid-template-columns:minmax(0,1fr) auto;align-items:end}
.my-work-filter-form .my-work-search{grid-column:1}
.my-work-more-filters{grid-column:1/-1;order:3}
.my-work-more-filters>summary{cursor:pointer;color:var(--accent);font-weight:600;font-size:.9rem;min-height:32px;display:inline-flex;gap:.4rem;align-items:center}
.my-work-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.85rem;margin-top:.6rem}
.my-work-filter-grid .input{width:100%}
.my-work-filter-actions{grid-column:2;grid-row:1}
.my-work-list .work-action-bar .btn.primary,.my-work-card-grid .work-action-bar .btn.primary{background:transparent;color:var(--accent);border:1px solid var(--line);box-shadow:none}
.my-work-list > :first-child .work-action-bar .btn.primary,.my-work-card-grid > :first-child .work-action-bar .btn.primary{background:var(--accent);color:#fff;border-color:var(--accent)}
@media(max-width:700px){.my-work-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:430px){.my-work-filter-form{grid-template-columns:1fr}.my-work-filter-actions{grid-column:1;grid-row:auto}.my-work-filter-grid{grid-template-columns:1fr}}

/* Notification centre: fast triage of source-backed notices. No card-level
   colour codes for ordinary metadata; only verified due reminders stand out. */
.notification-filter-bar{display:flex;align-items:center;flex-wrap:wrap;gap:7px;
  margin:3px 0 13px;padding-bottom:10px;border-bottom:1px solid var(--line)}
.notification-filter-bar>.btn{min-height:40px;font-size:.8rem}
.notification-filter-bar>[data-notification-visible-count]{margin-left:auto}
.notification-work-row{padding:12px 0;border-bottom:1px solid var(--line)}
.notification-work-row[hidden]{display:none!important}
.notification-due-label{font-size:.7rem;color:#8f2b21;background:#fbe9e6;
  border:1px solid #e9b7af;border-radius:4px;padding:2px 6px;font-weight:750}
.notification-action-label{font-size:.7rem;color:#255d74;background:#eaf3f8;
  border:1px solid #b8d4e1;border-radius:4px;padding:2px 6px;font-weight:700}
@media(max-width:550px){.notification-filter-bar>[data-notification-visible-count]{
  margin-left:0;flex-basis:100%}}
/* ======================================================================
   notes-knowledge
   ====================================================================== */
/* Notes + Knowledge Centre — a focused writing canvas.
   Loaded after the general Hub refresh, with no new colour palette. */
.note-workspace-title{display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:1rem;padding:.3rem 0}
.note-workspace-title .crumb{display:inline-flex;align-items:center;gap:.35rem;margin-bottom:.5rem;font-weight:700}
.note-workspace-title h1{margin:0}
.note-workspace-title p{margin:.45rem 0 0}
.note-writing-layout{display:grid;grid-template-columns:minmax(165px,205px) minmax(0,1fr) minmax(260px,306px);gap:1rem;align-items:start;min-width:0}
.note-writing-layout>*{min-width:0}
.note-workspace-nav{position:sticky;top:16px;padding:.95rem;max-height:calc(100dvh - 35px);overflow:auto}
.note-workspace-nav h2{font-size:.88rem;margin:0}
.note-workspace-new{display:flex;align-items:center;gap:.4rem;color:var(--accent);font-weight:750;font-size:.84rem;margin:.9rem 0;border:1px dashed var(--line-strong);border-radius:9px;padding:.6rem}
.note-workspace-new:hover{background:var(--accent-soft);text-decoration:none}
.note-workspace-note-list{display:grid;gap:.25rem}
.note-workspace-note-list>a{display:flex;flex-direction:column;gap:.25rem;padding:.65rem .6rem;border-radius:9px;color:var(--ink);text-decoration:none;overflow-wrap:anywhere}
.note-workspace-note-list>a strong{font-weight:700;font-size:.85rem;line-height:1.35}
.note-workspace-note-list>a small{font-size:.71rem;color:var(--muted);line-height:1.3}
.note-workspace-note-list>a:hover,.note-workspace-note-list>a.current{background:var(--accent-soft)}
.note-workspace-note-list>a.current{box-shadow:inset 3px 0 0 var(--accent)}
.note-composer {padding:clamp(1.1rem,2.6vw,2.6rem);display:flex;flex-direction:column;min-height:69vh;border-radius:13px}
.note-writing-top{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.6rem}
.note-writing-top .eyebrow{text-transform:uppercase;font:600 .72rem var(--mono);letter-spacing:.08em;color:var(--faint)}
.note-writing-name{display:block;max-width:100%;width:100%;font:800 clamp(1.5rem,2.5vw,2.2rem)/1.3 var(--display);letter-spacing:-.04em;background:transparent;color:var(--ink);border:0;border-radius:0;padding:.1rem 0 .35rem;border-bottom:1px solid transparent}
.note-writing-name::placeholder{color:var(--faint)}
.note-writing-name:focus{outline:none;border-bottom-color:var(--accent)}
.note-rich-shell{position:relative;min-width:0;border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow:visible}
.note-rich-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:.15rem;padding:.45rem .55rem;background:var(--surface-2);border-bottom:1px solid var(--line);border-radius:11px 11px 0 0}
.note-rich-toolbar button{font:750 .8rem var(--body);border:0;background:transparent;color:var(--muted);cursor:pointer;padding:.35rem .55rem;min-width:30px;min-height:31px;border-radius:7px;display:inline-grid;place-items:center}
.note-rich-toolbar button:hover{background:var(--sunk);color:var(--ink)}
.note-rich-toolbar button:focus-visible{outline:2px solid var(--accent)}
.note-rich-toolbar .icon{width:16px;height:16px}
.note-rich-toolbar .sep{width:1px;height:20px;background:var(--line-strong);margin:0 .25rem}
.note-rich-toolbar .note-source-switch{margin-left:auto;white-space:nowrap;font-size:.73rem;font-weight:700;min-width:auto;padding:.35rem .6rem;color:var(--accent)}
.note-rich-content{min-height:370px;max-width:none;padding:1.25rem clamp(.9rem,2.5vw,1.7rem);font:400 .98rem/1.8 var(--body);color:var(--ink);outline:none;overflow-wrap:anywhere;white-space:normal;cursor:text}
.note-rich-content:focus{box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--accent) 11%,transparent);border-radius:0 0 11px 11px}
.note-rich-content:empty:before{content:"Start writing…";color:var(--faint);pointer-events:none}
.note-rich-content h1,.note-rich-content h2,.note-rich-content h3{margin:1.15em 0 .6em;line-height:1.3}
.note-rich-content h1{font-size:1.65rem}.note-rich-content h2{font-size:1.3rem}.note-rich-content h3{font-size:1.13rem}
.note-rich-content p{margin:.45em 0 .9em}
.note-rich-content ul,.note-rich-content ol{padding-left:1.5rem}
.note-rich-content li{margin:.25em 0}
.note-rich-content blockquote{padding:.3rem 1rem;border-left:3px solid var(--focus);background:var(--surface-2);color:var(--muted)}
.note-rich-content a.wiki-link,.prose a.wiki-link{border-radius:5px;padding:.08em .3em;background:var(--accent-soft);color:var(--accent);font-weight:700;text-decoration:none;cursor:pointer}
.note-rich-content a.wiki-link:hover,.prose a.wiki-link:hover{text-decoration:underline}
.wiki-unresolved{background:var(--focus-soft);border-bottom:1px dashed var(--high);border-radius:3px;padding:0 .15em}
.note-rich-content .task-list-item-checkbox{margin-right:.4rem}
.note-source{display:block;border:0;border-radius:0 0 11px 11px;box-shadow:none!important;min-height:370px;resize:vertical;white-space:pre-wrap;tab-size:2;font:400 .87rem/1.7 var(--mono);padding:1.15rem}
.note-source:focus{box-shadow:none!important;outline:2px solid var(--accent);outline-offset:-2px}
.note-writing-help{margin:-.4rem 0 .15rem;line-height:1.55}
.note-writing-help code{background:var(--surface-2);border:1px solid var(--line);padding:.06rem .24rem;border-radius:4px}
.note-writing-properties{margin:0;border-top:1px solid var(--line);padding-top:1rem}
.note-writing-properties summary{cursor:pointer;font-size:.8rem;font-weight:700;color:var(--muted)}
.note-writing-properties .meta-fields{margin-top:1rem;display:flex;flex-wrap:wrap;gap:.8rem}
.note-writing-properties .field{min-width:135px;flex:1 1 160px}
.note-writing-actions {display:flex;align-items:center;justify-content:space-between;gap:.65rem;flex-wrap:wrap;padding-top:.75rem;border-top:1px solid var(--line)}
.note-delete{margin:0;align-self:end}
.note-wiki-suggestions{position:absolute;z-index:38;width:min(370px,calc(100% - 16px));max-height:280px;overflow:auto;background:var(--surface);border:1px solid var(--line-strong);border-radius:11px;padding:.35rem;box-shadow:var(--shadow-lg)}
.note-wiki-option{display:grid;gap:.13rem;width:100%;border:0;border-radius:8px;background:transparent;color:var(--ink);text-align:left;padding:.62rem .7rem;cursor:pointer;font:400 .83rem var(--body)}
.note-wiki-option strong{font-size:.85rem;font-weight:750;overflow-wrap:anywhere}
.note-wiki-option span{font-size:.71rem;color:var(--muted)}
.note-wiki-option:hover,.note-wiki-option.active{background:var(--accent-soft)}
.knowledge-side{position:sticky;top:16px;min-width:0;max-height:calc(100dvh - 32px);overflow:auto;scrollbar-width:thin}
.knowledge-connections{display:grid;gap:.85rem;padding:1.05rem}
.knowledge-side-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:.6rem}
.knowledge-side-heading h2{font-size:1.15rem;margin:.15rem 0 0}
.knowledge-connections>p{margin:0}
.knowledge-connection-group{border-top:1px solid var(--line);padding-top:.75rem}
.knowledge-connection-group h3,.knowledge-linking h3{display:flex;align-items:center;justify-content:space-between;margin:0 0 .65rem;font:700 .76rem var(--body);color:var(--ink)}
.knowledge-connection-group h3 .count{font:.7rem var(--mono);color:var(--muted)}
.knowledge-connection{display:flex;align-items:flex-start;gap:.45rem;padding:.55rem 0;border-bottom:1px solid var(--line);min-width:0}
.knowledge-connection:last-child{border-bottom:0}
.knowledge-connection-icon{display:grid;place-items:center;width:23px;height:23px;border-radius:7px;background:var(--accent-soft);color:var(--accent);flex:none}
.knowledge-connection-icon .icon{width:13px;height:13px}
.knowledge-connection-main{display:grid;gap:.15rem;flex:1;min-width:0;overflow-wrap:anywhere}
.knowledge-connection-main a{font-weight:750;font-size:.83rem;color:var(--ink)}
.knowledge-connection-main a:hover{color:var(--accent)}
.knowledge-connection-main small{font-size:.7rem;line-height:1.4;color:var(--muted)}
.knowledge-unlink{font-size:1.2rem;line-height:1;min-width:28px;padding:.1rem .2rem;color:var(--muted)}
.knowledge-none{margin:.25rem 0 .5rem}
.knowledge-linking{border-top:1px solid var(--line);padding-top:.8rem}
.knowledge-link-picker{gap:.6rem}
.knowledge-link-picker .field{font-size:.74rem;color:var(--muted);gap:.28rem}
.knowledge-link-picker .input{font-size:.85rem;width:100%}
.knowledge-link-picker .btn{width:100%;justify-content:center}
.knowledge-picker-results{max-height:240px;overflow:auto;padding:.3rem;border:1px solid var(--line);border-radius:9px;background:var(--surface)}
.knowledge-picker-option{width:100%;display:grid;gap:.2rem;padding:.55rem;text-align:left;border:0;border-radius:7px;background:transparent;font:400 .83rem var(--body);color:var(--ink);cursor:pointer}
.knowledge-picker-option strong{font-weight:750;overflow-wrap:anywhere}
.knowledge-picker-option span{color:var(--muted);font-size:.72rem}
.knowledge-picker-option:hover,.knowledge-picker-option.active{background:var(--accent-soft)}
.knowledge-side-footer{display:grid;gap:.4rem;border-top:1px solid var(--line);padding-top:.8rem}
.knowledge-side-footer a{font-size:.79rem;font-weight:700}
.note-reading-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(275px,.65fr);align-items:start;gap:1rem}
.note-reading-layout .note-side{gap:.85rem}
.note-reading-layout .prose{min-height:350px;padding:clamp(1.3rem,2.5vw,2.35rem);line-height:1.85}
.idea-knowledge-widget{margin:0 0 .8rem}
@media(max-width:1320px){
  .note-writing-layout{grid-template-columns:minmax(0,1fr) minmax(260px,305px)}
  .note-workspace-nav{grid-column:1/-1;max-height:none;position:static}
  .note-workspace-note-list{grid-auto-flow:column;grid-auto-columns:minmax(170px,200px);overflow:auto}
}
@media(max-width:950px){
  .note-writing-layout,.note-reading-layout{grid-template-columns:minmax(0,1fr)}
  .knowledge-side{position:static;max-height:none}
  .note-workspace-nav{grid-column:auto}
}
@media(max-width:640px){
  .note-workspace-title{align-items:flex-start}
  .note-writing-layout{gap:.8rem}
  .note-composer{padding:1rem;min-height:0}
  .note-rich-content{min-height:300px;padding:1rem}
  .note-writing-name{font-size:1.6rem}
  .note-rich-toolbar .note-source-switch{margin-left:0}
  .note-writing-actions .row{width:100%;justify-content:flex-end}
}
@media(prefers-reduced-motion:reduce){.note-wiki-option,.knowledge-picker-option{transition:none}}

/* The same stable-ID link picker is available in Ideas and Project descriptions. */
.wiki-textarea-suggest{position:absolute;z-index:38;top:calc(100% + 4px);left:0;max-width:min(390px,100%);width:100%;max-height:280px;overflow:auto;background:var(--surface);border:1px solid var(--line-strong);border-radius:10px;padding:.3rem;box-shadow:var(--shadow-lg)}
.wiki-textarea-option{display:grid;gap:.15rem;width:100%;text-align:left;background:transparent;color:var(--ink);font:400 .84rem var(--body);border:0;border-radius:7px;padding:.55rem .65rem;cursor:pointer}
.wiki-textarea-option strong{font-weight:750}
.wiki-textarea-option span{color:var(--muted);font-size:.72rem}
.wiki-textarea-option:hover,.wiki-textarea-option.active{background:var(--accent-soft)}


/* LIB-4: the Notes tree (LibNotes board) */
.nt { display: grid; gap: 2px; font-size: 14px; }
.nt-find { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); margin-bottom: 8px; }
.nt-find .icon { width: 15px; height: 15px; color: var(--muted); }
.nt-find input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); outline: none; }
.nt-find:focus-within { border-color: var(--accent); }
.nt-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.nt-h .btn { width: 26px; height: 26px; min-height: 26px; }
.nt-list { list-style: none; margin: 0; padding: 0; }
.nt-list li { display: flex; align-items: center; }
.nt-list a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px 8px 5px calc(8px + var(--depth, 0) * 16px); border-radius: 8px; color: var(--ink); text-decoration: none; }
.nt-list a:hover { background: var(--sunk); }
.nt-list a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-list .icon { width: 15px; height: 15px; flex-shrink: 0; color: var(--muted); }
.nt-list small { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.nt-note.current > a, .nt-list a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nt-in > a { font-size: 13px; padding-left: calc(28px + var(--depth, 0) * 16px); }
.nt-chev { width: 12px; font-size: 10px; color: var(--muted); flex-shrink: 0; }
.nt-name { flex: 1; }
.nt-count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }
.nt-more a { font-size: 13px; color: var(--muted); padding-left: calc(28px + var(--depth, 0) * 16px); }
.nt-unpin { display: inline; }
.nt-unpin .btn { width: 26px; height: 26px; min-height: 26px; opacity: 0; }
.nt-note:hover .nt-unpin .btn, .nt-unpin .btn:focus-visible { opacity: 1; }
.nt-foot { padding: 12px 8px 0; margin: 0; }
@media (hover: none) { .nt-unpin .btn { opacity: 1; } }
/* LIB-4 layout: tree · editor · connections from 1100 px; the tree stays a column down to 950 px. */
.note-writing-layout { grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) minmax(240px, 280px); }
.note-workspace-nav { padding: .8rem .6rem; }
@media (max-width: 1320px) {
  .note-writing-layout { grid-template-columns: minmax(210px, 240px) minmax(0, 1fr) minmax(240px, 270px); }
  .note-workspace-nav { grid-column: auto; max-height: calc(100dvh - 35px); position: sticky; }
}
@media (max-width: 1100px) {
  .note-writing-layout { grid-template-columns: minmax(200px, 230px) minmax(0, 1fr); }
  .note-writing-layout > :last-child:not(.note-composer) { grid-column: 1 / -1; }
}
@media (max-width: 950px) {
  .note-writing-layout { grid-template-columns: minmax(0, 1fr); }
  .note-workspace-nav { position: static; max-height: 300px; }
}

/* LIB-5/6: saved views row and the Pursue as… menu on Ideas */
.ideas-views { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; }
.ideas-view-chip { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px 0 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; }
.ideas-view-chip.on { border-color: var(--accent); background: var(--accent-soft); }
.ideas-view-chip a { color: var(--ink); text-decoration: none; }
.ideas-view-chip .btn { width: 24px; height: 24px; min-height: 24px; }
.ideas-view-save > summary { list-style: none; } .ideas-view-save > summary::-webkit-details-marker { display: none; }
.ideas-view-save[open] form { margin-top: 6px; gap: 6px; }
.pursue-menu { position: relative; display: inline-block; }
.pursue-menu > summary { list-style: none; } .pursue-menu > summary::-webkit-details-marker { display: none; }
.pursue-pop { position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); min-width: 230px; display: grid; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(21, 37, 61, .16); }
.pursue-pop form { display: contents; }
.pursue-pop button, .pursue-pop a { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 600 13px var(--body); text-decoration: none; cursor: pointer; }
.pursue-pop button:hover, .pursue-pop a:hover { background: var(--sunk); }
.idea-pursue .pursue-options { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.idea-pursue .pursue-more { display: grid; gap: 6px; padding: 4px 0 6px 24px; }
.idea-became { padding: 8px 10px; border-radius: 9px; background: var(--accent-soft); }
.from-idea { font-size: 13px; color: var(--muted); }
.from-idea a { font-weight: 600; }

/* LIB-10: note templates */
.note-templates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 4px; }
.note-templates .inline-form { display: inline; }
.note-templates .chip { cursor: pointer; }
.tpl-row { display: flex; align-items: center; gap: 8px; padding: 10px 6px; border-top: 1px solid var(--line); border-radius: 8px; }
.tpl-row:first-of-type { border-top: 0; }
.tpl-row.on { background: var(--accent-soft); }
.tpl-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tpl-main a { color: var(--ink); text-decoration: none; }
/* ======================================================================
   tag-chips
   ====================================================================== */
/* Shared coloured dropdowns and reusable label chips across Hub.
   Semantic colour tokens work on both light and dark surfaces. */
:root {
  --tone-slate-bg:#edf1f6;--tone-slate-fg:#4c5b70;--tone-slate-border:#cfd7e3;
  --tone-blue-bg:#e7f0ff;--tone-blue-fg:#1957ae;--tone-blue-border:#bcd2f7;
  --tone-teal-bg:#e3f4f2;--tone-teal-fg:#0b716c;--tone-teal-border:#a8d9d4;
  --tone-green-bg:#e7f5ec;--tone-green-fg:#256b45;--tone-green-border:#b5ddc5;
  --tone-amber-bg:#fff3d8;--tone-amber-fg:#875910;--tone-amber-border:#eed39b;
  --tone-rose-bg:#fce8ec;--tone-rose-fg:#a93d58;--tone-rose-border:#efb8c6;
  --tone-violet-bg:#f0ebff;--tone-violet-fg:#6145aa;--tone-violet-border:#cfc2f2;
  --tone-pink-bg:#fceaf4;--tone-pink-fg:#a43f79;--tone-pink-border:#edbad5;
}
@media (prefers-color-scheme:dark) {
  :root {
    --tone-slate-bg:#29374a;--tone-slate-fg:#d4e1f2;--tone-slate-border:#4d6077;
    --tone-blue-bg:#193657;--tone-blue-fg:#b6d4ff;--tone-blue-border:#396a9b;
    --tone-teal-bg:#173c3d;--tone-teal-fg:#9aede1;--tone-teal-border:#3d7973;
    --tone-green-bg:#1c4435;--tone-green-fg:#b0e9c4;--tone-green-border:#417c60;
    --tone-amber-bg:#503b20;--tone-amber-fg:#f3d18d;--tone-amber-border:#90713c;
    --tone-rose-bg:#512b3a;--tone-rose-fg:#ffbfd0;--tone-rose-border:#a3566a;
    --tone-violet-bg:#342b56;--tone-violet-fg:#d7c8ff;--tone-violet-border:#6b549f;
    --tone-pink-bg:#4c2941;--tone-pink-fg:#ffc4e3;--tone-pink-border:#985577;
  }
}
[data-tone="slate"]{--tone-bg:var(--tone-slate-bg);--tone-fg:var(--tone-slate-fg);--tone-border:var(--tone-slate-border)}
[data-tone="blue"]{--tone-bg:var(--tone-blue-bg);--tone-fg:var(--tone-blue-fg);--tone-border:var(--tone-blue-border)}
[data-tone="teal"]{--tone-bg:var(--tone-teal-bg);--tone-fg:var(--tone-teal-fg);--tone-border:var(--tone-teal-border)}
[data-tone="green"]{--tone-bg:var(--tone-green-bg);--tone-fg:var(--tone-green-fg);--tone-border:var(--tone-green-border)}
[data-tone="amber"]{--tone-bg:var(--tone-amber-bg);--tone-fg:var(--tone-amber-fg);--tone-border:var(--tone-amber-border)}
[data-tone="rose"]{--tone-bg:var(--tone-rose-bg);--tone-fg:var(--tone-rose-fg);--tone-border:var(--tone-rose-border)}
[data-tone="violet"]{--tone-bg:var(--tone-violet-bg);--tone-fg:var(--tone-violet-fg);--tone-border:var(--tone-violet-border)}
[data-tone="pink"]{--tone-bg:var(--tone-pink-bg);--tone-fg:var(--tone-pink-fg);--tone-border:var(--tone-pink-border)}
select.colour-chip-select,
select[data-chip-select]{
  width:auto;max-width:100%;appearance:none;-webkit-appearance:none;cursor:pointer;
  display:inline-block;min-height:32px;padding:.32rem 1.55rem .32rem .8rem;
  border-radius:999px;font:750 .78rem var(--body);letter-spacing:.005em;
  background-color:var(--tone-bg,var(--surface-2));
  color:var(--tone-fg,var(--ink));
  border:1px solid var(--tone-border,var(--line));
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='m1 1 4.5 4.5L10 1' stroke='%23677c94' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position:right .58rem center;background-repeat:no-repeat;
  box-shadow:none;transition:background-color .16s,border-color .16s;
}
select.colour-chip-select:hover{filter:brightness(.98);border-color:var(--tone-fg,var(--line-strong))}
select.colour-chip-select:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
select.colour-chip-select:disabled{opacity:.65;cursor:not-allowed}
select.colour-chip-select option{color:var(--ink);background:var(--surface);font-weight:600}
.chip[data-tag-name],.tag-selection-chip,.tag-colour-pill{
  background:var(--tone-bg,var(--chip-bg))!important;color:var(--tone-fg,var(--ink))!important;
  border:1px solid var(--tone-border,var(--line))!important;border-radius:999px!important;
  box-shadow:none;display:inline-flex;align-items:center;gap:.42rem;
  font:700 .74rem var(--body);line-height:1.25;padding:.26rem .62rem;
  text-decoration:none;max-width:100%;white-space:normal;overflow-wrap:anywhere;
}
a.chip[data-tag-name]:hover{filter:brightness(.96);text-decoration:none}
.tag-selection-chip .tag-remove{
  border:0;background:transparent;cursor:pointer;color:inherit;
  font-size:1.1rem;line-height:1;padding:0 .1rem;opacity:.78;
  border-radius:50%;display:inline-grid;place-items:center;min-width:16px;
}
.tag-selection-chip .tag-remove:hover{opacity:1}
input[data-tag-picker][hidden]{display:none!important}
.tag-picker{width:100%;min-width:0;position:relative;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface);padding:.45rem .55rem;display:grid;gap:.4rem}
.tag-picker:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.tag-picker-pills{display:flex;flex-wrap:wrap;gap:.35rem;min-width:0}
.tag-picker-input-row{display:flex;align-items:center;min-width:0}
.tag-picker-query{width:100%;max-width:100%;min-width:0;border:0;outline:none;background:transparent;color:var(--ink);padding:.25rem .3rem;font:500 .84rem var(--body);box-shadow:none!important}
.tag-picker-query::placeholder{color:var(--faint)}
.tag-picker-manage{font-size:.72rem;font-weight:700;color:var(--muted);justify-self:start;padding-left:.3rem}
.tag-picker-manage:hover{color:var(--accent)}
.tag-picker-error,.tag-picker-alert{color:var(--bad)}
.tag-picker-menu{position:absolute;z-index:45;left:0;right:0;top:calc(100% + 5px);max-height:245px;overflow:auto;border:1px solid var(--line-strong);border-radius:12px;background:var(--surface);box-shadow:var(--shadow-lg);padding:.4rem}
.tag-picker-menu[hidden],.tag-picker-pills[hidden]{display:none}
.tag-picker-option{display:flex;align-items:center;gap:.55rem;min-height:34px;width:100%;font:650 .82rem var(--body);border:0;border-radius:8px;background:transparent;color:var(--ink);text-align:left;cursor:pointer;padding:.45rem .5rem}
.tag-picker-option.active,.tag-picker-option:hover{background:var(--accent-soft);color:var(--accent)}
.tag-picker-option small{margin-left:auto;color:var(--muted);font-size:.68rem;font-weight:600}
.tag-colour-dot{width:11px;height:11px;border-radius:50%;flex:none;background:var(--tone-fg,var(--muted));box-shadow:0 0 0 3px var(--tone-bg,var(--sunk))}
.entity-tag-section{margin-top:.8rem;padding:1.15rem;display:grid;gap:.65rem}
.entity-tag-section h2{margin:0;font-size:1.02rem}
.entity-tag-section p{margin:0}
.tag-library-top{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:1.25rem;margin:.5rem 0 1rem}
.tag-library-top h1{margin:0}
.tag-library-top p{margin:.5rem 0 0;max-width:65ch}
.tag-library-layout{display:grid;grid-template-columns:minmax(250px,.75fr) minmax(0,1.5fr);gap:1rem;align-items:start}
.tag-library-create{padding:1.25rem;display:grid;gap:1rem}
.tag-library-create h2{font-size:1.05rem;margin:0}
.tag-library-create .field{min-width:0}
.tag-library-list{padding:0;overflow:hidden}
.tag-library-list-heading{padding:1.2rem 1.4rem .85rem;display:flex;align-items:center;justify-content:space-between;gap:.8rem;border-bottom:1px solid var(--line)}
.tag-library-list-heading h2{font-size:1.03rem;margin:0}
.tag-library-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(65px,.3fr) auto;gap:1rem;align-items:center;padding:.85rem 1.4rem;border-bottom:1px solid var(--line)}
.tag-library-row:last-child{border-bottom:0}
.tag-library-row .tag-colour-pill{justify-self:start}
.tag-library-row .tag-count{font:.75rem var(--mono);color:var(--muted);white-space:nowrap}
.tag-library-row select{min-width:100px}
.tag-library-help{padding:1rem 1.3rem;border:1px dashed var(--line-strong);border-radius:12px;color:var(--muted);font-size:.84rem;line-height:1.55}
.tag-library-preview{display:flex;flex-wrap:wrap;gap:.5rem;padding:.4rem 0}
@media(max-width:900px){.tag-library-layout{grid-template-columns:1fr}}
@media(max-width:580px){.tag-library-row{grid-template-columns:minmax(0,1fr) auto;gap:.5rem;padding:.8rem}.tag-library-row .tag-count{grid-row:2;grid-column:1}.tag-library-row select{grid-column:2;grid-row:1/3}.tag-picker-menu{max-height:220px}}
@media(prefers-reduced-motion:reduce){select.colour-chip-select{transition:none}}

/* Notes keep reusable labels visible instead of hiding them under metadata. */
.note-write-tags{display:grid;gap:.4rem;min-width:0}
.note-write-tags>.small{font-weight:750;color:var(--ink)}
.note-write-tags>.tag-picker{max-width:100%}

/* ======================================================================
   notes-flow
   ====================================================================== */
/* The Hub: lower-noise navigation and Notes workflow.
 * Keeps the current light/dark palette and existing links/route names.
 */

/* Sidebar: a small set of daily destinations, then compact disclosures (see app/navigation.py). */
.sidebar nav[aria-label="Main"] {gap:.32rem}
.sidebar nav[aria-label="Main"] .nav-primary {padding-bottom:.5rem;border-bottom:1px solid var(--nav-line);margin-bottom:.25rem}
.nav-cluster {display:block;min-width:0}
.nav-cluster-summary {
  display:flex;align-items:center;gap:.65rem;min-height:38px;padding:.47rem .7rem;
  border-radius:9px;cursor:pointer;list-style:none;
  color:var(--nav-muted);font-weight:750;font-size:.78rem;
  letter-spacing:.025em;
}
.nav-cluster-summary::-webkit-details-marker {display:none}
.nav-cluster-summary::marker {content:""}
.nav-cluster-summary:hover {background:var(--nav-surface);color:var(--nav-ink)}
.nav-cluster-summary:focus-visible {outline:2px solid #91c9ff;outline-offset:1px}
.nav-cluster-summary > .icon {width:16px;height:16px;color:inherit}
.nav-cluster-summary > span:not(.nav-cluster-chevron) {flex:1}
.nav-cluster-chevron {font:850 1rem var(--body);line-height:1;transform:rotate(0);transition:transform .16s}
.nav-cluster[open] .nav-cluster-chevron {transform:rotate(180deg)}
.nav-cluster:has(a.on) > .nav-cluster-summary {color:var(--nav-ink);background:color-mix(in srgb,var(--nav-surface) 72%,transparent)}
.nav-cluster-content {padding:.12rem 0 .35rem .7rem;margin-left:.5rem;border-left:1px solid var(--nav-line)}
.nav-cluster-content .nav-projects {min-width:0}
.nav-cluster-content .nav-sub {max-height:160px}
.nav-cluster-content a {font-size:.85rem!important;min-height:33px}
.nav-foot {margin-top:auto}
.side-collapsed .nav-cluster {width:100%}
.side-collapsed .nav-cluster-summary {justify-content:center;padding:.55rem .35rem}
.side-collapsed .nav-cluster-summary > span {display:none!important}
/* Icon rail: every destination stays reachable. Groups become thin dividers and their links
   show as icons (labels live in the title tooltip), whatever the group's open state. */
.side-collapsed .nav-cluster > .nav-cluster-summary {display:none}
.side-collapsed .nav-cluster > .nav-cluster-content {display:flex!important;flex-direction:column;
  padding:.35rem 0 0;margin:.35rem 0 0;border-left:0;border-top:1px solid var(--nav-line)}
.side-collapsed .nav-cluster-content .nav-projects-row {display:block}
.side-collapsed .nav-primary {align-items:stretch;width:100%}
.side-collapsed .sidebar nav[aria-label="Main"] {width:100%}
@media(max-width:860px){
  .nav-cluster-content {padding-left:.45rem;margin-left:.45rem}
  .side-collapsed .nav-cluster > .nav-cluster-summary {display:flex}
  .side-collapsed .nav-cluster > .nav-cluster-content {display:none!important;border-top:0;padding:.12rem 0 .35rem .45rem;margin-left:.45rem;border-left:1px solid var(--nav-line)}
  .side-collapsed .nav-cluster[open] > .nav-cluster-content {display:flex!important;flex-direction:column}
  .side-collapsed .nav-cluster-summary {justify-content:flex-start;padding:.47rem .7rem}
  .side-collapsed .nav-cluster-summary > span {display:inline!important}
  .side-collapsed .nav-primary {width:100%}
}

/* Note editor: metadata is editable while the content is still in view. */
.note-composer {gap:1.05rem}
.note-save-toolbar {
  position:sticky;top:0;z-index:12;
  padding:.6rem 0 .7rem;margin:-.5rem 0 0;
  border-bottom:1px solid var(--line);
  background:var(--surface);
}
.note-save-controls {display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
.note-save-controls .btn {min-height:34px}
.note-save-state {
  display:inline-flex;align-items:center;gap:.45rem;
  padding:.3rem .55rem;border:1px solid transparent;border-radius:999px;
  font:750 .75rem var(--body);white-space:normal;line-height:1.4;color:var(--muted);
}
.note-save-dot {width:8px;height:8px;border-radius:50%;background:var(--muted);flex:none}
.note-save-state[data-state="saved"] {color:var(--tone-green-fg);background:var(--tone-green-bg);border-color:var(--tone-green-border)}
.note-save-state[data-state="saved"] .note-save-dot {background:var(--tone-green-fg)}
.note-save-state[data-state="pending"] {color:var(--tone-amber-fg);background:var(--tone-amber-bg);border-color:var(--tone-amber-border)}
.note-save-state[data-state="pending"] .note-save-dot {background:var(--tone-amber-fg)}
.note-save-state[data-state="saving"] {color:var(--tone-blue-fg);background:var(--tone-blue-bg);border-color:var(--tone-blue-border)}
.note-save-state[data-state="saving"] .note-save-dot {background:var(--tone-blue-fg)}
.note-save-state[data-state="error"] {color:var(--tone-rose-fg);background:var(--tone-rose-bg);border-color:var(--tone-rose-border)}
.note-save-state[data-state="error"] .note-save-dot {background:var(--tone-rose-fg)}
.note-visible-properties {
  border:1px solid var(--line);border-radius:12px;background:var(--surface-2);
  padding:.85rem 1rem;display:grid;gap:.8rem;
}
.note-properties-heading {display:flex;gap:.6rem;align-items:baseline;justify-content:space-between;flex-wrap:wrap}
.note-properties-heading strong {font-size:.83rem;letter-spacing:.01em;color:var(--ink)}
.note-properties-heading .small {font-size:.72rem}
.note-properties-fields {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(220px,1.2fr);gap:.65rem}
.note-property {display:grid;gap:.33rem;min-width:0;align-content:start}
.note-property-label {display:flex;gap:.35rem;align-items:center;font:750 .76rem var(--body);color:var(--muted)}
.note-property-label .icon {width:14px;height:14px}
.note-property-control {display:flex;gap:.3rem;min-width:0;align-items:center}
.note-property-control .input {min-width:0;width:100%;font-size:.83rem;height:37px}
.note-property-control .btn {white-space:nowrap;flex:none}
.note-property-tags .tag-picker {padding:.32rem .46rem;min-height:37px;background:var(--surface)}
.note-property-tags .tag-picker-manage {display:none}
.note-tags-manage {font-size:.7rem;justify-self:start}
.note-folder-clear[hidden],.note-project-create[hidden] {display:none}
.note-project-create {
  grid-column:1/-1;display:grid;gap:.35rem;padding:.7rem;border:1px solid var(--line);
  border-radius:9px;background:var(--surface)
}
.note-project-create .row {flex-wrap:wrap;gap:.3rem}
.note-project-create .input {min-width:140px;flex:1}
.note-project-create .small {margin:0;overflow-wrap:anywhere}
.note-property-folder > .small {font-size:.7rem;line-height:1.45}
.note-editor-mode:empty {display:none}
.note-editor-mode {margin:0;line-height:1.45}
.note-writing-actions {margin-top:.15rem}
.note-writing-actions > .small {font-size:.75rem;line-height:1.5}
@media(max-width:1420px){
 .note-properties-fields {grid-template-columns:repeat(2,minmax(0,1fr))}
 .note-property-tags {grid-column:1/-1}
}
@media(max-width:640px){
 .note-save-toolbar {position:static;align-items:flex-start}
 .note-save-controls {width:100%;justify-content:space-between}
 .note-properties-fields {grid-template-columns:1fr}
 .note-property-tags {grid-column:auto}
 .note-visible-properties {padding:.7rem}
 .note-property-control .input {min-width:0}
}

/* Notes library: fewer columns, dense responsive cards, preview on request. */
.notes-layout.notes-workspace {
 grid-template-columns:minmax(185px,225px) minmax(0,1fr);gap:1.05rem;
 max-width:2080px;align-items:start;
}
.notes-workspace .facets {
 max-height:calc(100dvh - 35px);overflow:auto;scrollbar-width:thin;
 padding:.95rem;
}
.notes-workspace .notes-results {gap:.9rem;display:grid;min-width:0}
.notes-results-head {display:flex;align-items:center;justify-content:space-between;gap:.8rem;flex-wrap:wrap}
.notes-results-head h2 {font-size:1.05rem;margin:0}
.notes-results-head h2 .small {font:500 .73rem var(--body)}
.notes-results-head p {font-size:.76rem;margin:.28rem 0 0}
.notes-workspace .note-filters {display:flex;flex-wrap:wrap;gap:.55rem}
.notes-workspace .note-filters input[name="q"] {min-width:160px}
.notes-workspace .note-list.note-cards {
 display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr));
 gap:.8rem;background:transparent;border:0;box-shadow:none;border-radius:0;
 padding:0;overflow:visible;align-items:stretch;
}
.notes-workspace .note-list .note-row {
 display:flex;flex-direction:column;min-width:0;min-height:181px;padding:1.05rem;
 border:1px solid var(--line);border-radius:12px;background:var(--surface);
 box-shadow:var(--shadow-sm);transition:border-color .12s,box-shadow .12s;
}
.notes-workspace .note-list .note-row:hover {background:var(--surface);border-color:var(--line-strong);box-shadow:var(--shadow)}
.notes-workspace .note-list .note-row.selected {border-color:var(--accent);background:var(--accent-soft)}
.note-cards .note-row-header {align-items:flex-start}
.note-cards .note-row .title {font-size:1rem;line-height:1.4}
.note-cards .note-preview-trigger {font-size:.69rem;white-space:nowrap;border:1px solid var(--line);border-radius:6px;padding:.17rem .4rem}
.note-cards .note-row .excerpt {
 margin:.55rem 0 .75rem;font-size:.81rem;line-height:1.55;
 display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
}
.note-card-meta {display:flex;gap:.35rem;align-items:center;flex-wrap:wrap;font-size:.72rem;color:var(--muted);margin-top:auto}
.note-card-meta .chip {font-size:.68rem;max-width:100%;overflow-wrap:anywhere}
.note-card-date {display:inline-flex;gap:.28rem;align-items:center;font-size:.7rem;white-space:nowrap}
.note-card-date .icon {width:12px;height:12px}
.note-card-footer {display:flex;justify-content:space-between;gap:.5rem;margin-top:.8rem;padding-top:.65rem;border-top:1px solid var(--line)}
.note-card-footer a {font-weight:700;font-size:.73rem;color:var(--accent)}
.notes-workspace .notes-preview {
 position:static;max-height:none;min-width:0;overflow:visible;
 padding:1.1rem 1.25rem;border-color:var(--accent);gap:.7rem;
}
.notes-workspace .notes-preview h2 {font-size:1.2rem}
.notes-workspace .notes-preview-excerpt {max-height:180px;overflow:auto;font-size:.82rem}
.notes-workspace .notes-preview-actions {display:flex;flex-wrap:wrap;gap:.4rem}
.notes-workspace .notes-preview-actions .btn {flex:1}
.notes-workspace .notes-preview-related {padding-top:.7rem}
.notes-workspace .notes-empty {grid-column:1/-1;padding:1.1rem}
@media(max-width:1000px){
 .notes-layout.notes-workspace {grid-template-columns:minmax(150px,195px) minmax(0,1fr)}
}
@media(max-width:760px){
 .notes-layout.notes-workspace {grid-template-columns:minmax(0,1fr)}
 .notes-workspace .facets {max-height:none;overflow:visible;position:static}
 .notes-workspace .note-list.note-cards {grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr))}
}
@media(prefers-reduced-motion:reduce){.note-list .note-row,.nav-cluster-chevron{transition:none!important}}

/* ======================================================================
   unified-capture
   ====================================================================== */
/* Unified capture workspace: single intake, clear choice, explicit links. */
.capture-workspace{max-width:1620px;margin:0 auto;display:grid;gap:1.3rem;padding:.3rem 0 2rem}
.capture-hero{display:flex;justify-content:space-between;align-items:flex-end;gap:1rem;flex-wrap:wrap}
.capture-hero h1{margin:.1rem 0 .4rem;font-size:clamp(1.65rem,2.5vw,2.3rem);letter-spacing:-.04em}
.capture-hero p:not(.eyebrow){margin:0;color:var(--muted);font-size:.93rem;line-height:1.55;max-width:64ch}
.capture-hero .eyebrow{margin:0;text-transform:uppercase;font-size:.73rem;letter-spacing:.09em;color:var(--accent);font-weight:750}
.capture-composer{padding:clamp(1.2rem,3vw,2.4rem);display:grid;gap:1rem;border-radius:15px}
.capture-composer-top,.capture-composer-bottom{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.capture-composer-top strong{display:flex;align-items:center;gap:.5rem;font-size:.95rem}
.capture-input{width:100%;min-height:210px;line-height:1.75;font-size:1rem;padding:1rem 1.15rem;resize:vertical;background:var(--surface)}
.capture-composer-bottom .small{max-width:60ch;line-height:1.5;margin:0}
.capture-composer-bottom .small .icon{width:14px;height:14px;vertical-align:middle}
.capture-next-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.85rem}
.capture-next-steps>div{padding:1.1rem;border:1px solid var(--line);border-radius:12px;display:grid;gap:.4rem;align-content:start;background:var(--surface)}
.capture-next-steps span{display:inline-grid;place-items:center;background:var(--accent-soft);color:var(--accent);font:750 .79rem var(--mono);border-radius:8px;width:30px;height:30px}
.capture-next-steps strong{font-size:.85rem}
.capture-next-steps p{margin:0;color:var(--muted);font-size:.76rem;line-height:1.55}
.capture-review-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(270px,.74fr);gap:1.15rem;align-items:start}
.capture-review-layout>*{min-width:0}
.capture-review-main{display:grid;gap:1rem;min-width:0}
.capture-original{padding:1.1rem 1.25rem}
.capture-original h2,.capture-filing-form h2,.capture-relationships h2{font-size:1rem;margin:0}
.capture-original blockquote{margin:.7rem 0 0;padding:.8rem 1rem;background:var(--surface-2);border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:8px;color:var(--ink);white-space:pre-wrap;overflow-wrap:anywhere;max-height:190px;overflow:auto;line-height:1.6}
.capture-filing-form{padding:1.15rem 1.4rem;gap:1.1rem}
.capture-recommendation{display:flex;align-items:flex-start;gap:.65rem;background:var(--accent-soft);color:var(--ink);border-radius:10px;padding:.8rem .9rem}
.capture-recommendation .icon{flex:none;color:var(--accent);margin-top:.12rem}
.capture-recommendation p{font-size:.8rem;line-height:1.55;margin:0}
.capture-destination-field{display:grid;gap:.5rem}
.capture-destination-field>.field{font-size:.79rem;font-weight:700}
.capture-destination-choices{display:flex;gap:.48rem;flex-wrap:wrap}
.capture-destination-option{cursor:pointer}
.capture-destination-option input{position:absolute;opacity:0;pointer-events:none;width:1px;height:1px}
.capture-destination-option span{display:flex;align-items:center;gap:.38rem;min-height:37px;padding:.48rem .72rem;border:1px solid var(--line-strong);background:var(--surface);border-radius:9px;color:var(--muted);font-weight:750;font-size:.76rem}
.capture-destination-option .icon{width:15px;height:15px}
.capture-destination-option input:checked+span{background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}
.capture-destination-option input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}
.capture-destination-option:hover span{border-color:var(--accent)}
.capture-fields-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.9rem;align-items:start}
.capture-fields-grid .field{min-width:0;font-size:.8rem;font-weight:700;display:grid;gap:.3rem}
.capture-fields-grid .field .input{min-width:0;width:100%;font-size:.85rem}
.capture-fields-grid .field small{font-size:.71rem;font-weight:500;color:var(--muted)}
.capture-fields-grid .capture-field-wide{grid-column:1/-1}
.capture-fields-grid [data-show-for][hidden]{display:none!important}
.capture-fields-grid .tag-picker{font-weight:400}
.capture-confirm{border-top:1px solid var(--line);padding-top:1.05rem;display:grid;gap:.8rem}
.capture-confirm .small{line-height:1.5;margin:0}
.capture-confirm .row{gap:.5rem}
.capture-confirm button[disabled]{opacity:.55;cursor:not-allowed}
.capture-error{border:1px solid var(--tone-rose-border);background:var(--tone-rose-bg);color:var(--tone-rose-fg);border-radius:10px;padding:.8rem 1rem;font-size:.84rem}
.capture-relationships{display:grid;gap:.85rem;position:sticky;top:18px;max-height:calc(100dvh - 36px);overflow:auto}
.capture-relationships .panel{padding:1.15rem;gap:.8rem}
.capture-relationships p{margin:0;line-height:1.5}
.capture-related-results{display:grid;gap:.3rem;max-height:355px;overflow:auto}
.capture-related-choice{display:flex;align-items:flex-start;gap:.7rem;padding:.7rem .75rem;cursor:pointer;border:1px solid var(--line);border-radius:9px;min-width:0}
.capture-related-choice:has(input:checked){background:var(--accent-soft);border-color:var(--accent)}
.capture-related-choice input{margin-top:.2rem;accent-color:var(--accent);flex:none}
.capture-related-choice span{display:grid;gap:.16rem;min-width:0;overflow-wrap:anywhere}
.capture-related-choice strong{font-size:.8rem;line-height:1.35}
.capture-related-choice small{font-size:.71rem;color:var(--muted);line-height:1.45}
.capture-related-choice:hover{border-color:var(--accent)}
.capture-relationships .chips{display:flex;flex-wrap:wrap;gap:.4rem}
.inbox-review-card .inbox-process-link{align-self:flex-start}
@media(max-width:950px){.capture-review-layout{grid-template-columns:1fr}.capture-relationships{position:static;max-height:none}.capture-relationships .panel{padding:1rem}.capture-related-results{max-height:260px}}
@media(max-width:640px){.capture-next-steps{grid-template-columns:1fr}.capture-composer-bottom .btn{width:100%;justify-content:center}.capture-fields-grid{grid-template-columns:1fr}.capture-fields-grid .capture-field-wide{grid-column:auto}.capture-filing-form{padding:1rem}.capture-confirm .btn{width:100%}.capture-original{padding:1rem}}

.capture-unified-shortcut{display:flex;align-items:center;gap:.48rem;margin:.4rem 0 1rem;padding:.8rem .95rem;border:1px solid var(--accent);background:var(--accent-soft);color:var(--accent);border-radius:10px;font-size:.86rem;font-weight:800;text-decoration:none}
.capture-unified-shortcut:hover{filter:brightness(.97);text-decoration:none}
.capture-unified-shortcut .icon{width:17px;height:17px}

/* Smart capture: what the Hub understood, shown under the box as you type. */
.capture-understood{margin-top:.6rem;padding:.75rem 1rem;border:1px dashed var(--line);border-radius:12px;background:var(--surface)}
.capture-understood-text{margin:0;font-size:15px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
.capture-understood .hl-legend{margin:.35rem 0 0;font-size:13px}
/* ======================================================================
   project-home
   ====================================================================== */
/* Project Home: restrained, responsive command centre that reuses Hub tokens. */
.project-home{display:grid;gap:.75rem;max-width:2000px}
.project-home .panel{min-width:0}
.project-home-intro{display:flex;align-items:flex-start;justify-content:space-between;gap:1.2rem;padding:1.35rem 1.5rem}
.project-home-intro-copy{min-width:0;max-width:78ch;display:grid;gap:.72rem}
.project-home-intro-copy h2{font-size:1.25rem;letter-spacing:-.02em;margin:0}
.project-home-eyebrow{align-items:center;gap:.5rem}
.project-home-description{font-size:.9rem;line-height:1.6;max-height:230px;overflow:auto;overflow-wrap:anywhere}
.project-home-description :first-child{margin-top:0}
.project-home-description :last-child{margin-bottom:0}
.project-home-quicklinks{display:flex;flex-wrap:wrap;align-items:stretch;justify-content:flex-end;gap:.45rem;min-width:180px;max-width:295px}
.project-home-quicklinks .btn{flex:1 1 115px;display:flex;align-items:center;justify-content:center;gap:.35rem;white-space:nowrap}
.project-home-goals{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}
.project-home-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.75rem}
.project-home-metric{display:flex;flex-direction:column;gap:.42rem;padding:1rem 1.1rem!important;text-decoration:none;color:var(--ink);min-height:128px}
.project-home-metric:hover{border-color:var(--accent)}
.project-home-metric strong{font-size:clamp(1.5rem,2.5vw,2.05rem);line-height:1.18;letter-spacing:-.035em;font-weight:800}
.project-home-metric strong small{font-size:.6em;color:var(--muted);font-weight:600;letter-spacing:0}
.project-home-metric .meter{height:6px;margin:.15rem 0}
.project-home-attention strong{color:var(--tone-rose-fg,var(--danger))}
.project-home-columns{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(280px,.85fr);gap:.7rem;align-items:start}
.project-home-columns>.stack{min-width:0;gap:.7rem}
.project-home-section{padding:.9rem 1rem;display:grid;gap:.65rem;min-width:0}
.project-home-section .row h2{font-size:1.02rem;margin:0}
.project-home-section .row p{margin:.2rem 0 0;line-height:1.5}
.project-home-section h3{font-size:.9rem;margin:0}
.project-home-actions-list,.project-home-links{display:grid;gap:0}
.project-home-action{display:flex;align-items:center;justify-content:space-between;gap:.85rem;min-width:0;padding:.85rem .15rem;border-top:1px solid var(--line);text-decoration:none;color:var(--ink)}
.project-home-action:hover,.project-home-link:hover,.project-home-activity:hover,.project-home-idea:hover{background:var(--surface-2);border-radius:7px}
.project-home-action-main{display:grid;gap:.2rem;min-width:0;flex:1}
.project-home-action-main strong{font-size:.88rem;font-weight:750;overflow-wrap:anywhere}
.project-home-action-main .small{font-size:.73rem;overflow-wrap:anywhere}
.project-home-action-meta{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:.35rem;max-width:180px;text-align:right}
.project-home-action-meta .small{font-size:.73rem}
.project-home-overdue{color:var(--tone-rose-fg,var(--danger));font-weight:700}
.project-home-quickadd{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:.65rem}
.project-home-quickadd label{font-weight:700;white-space:nowrap}
.project-home-quickadd input{min-width:min(100%,210px);flex:1 1 180px}
.project-home-quickadd .btn{display:inline-flex;align-items:center;gap:.25rem;justify-content:center}
.project-home-subheading{display:flex;align-items:baseline;gap:.4rem;margin:.15rem 0 .1rem!important}
.project-home-subheading .small{font-size:.73rem;font-weight:400}
.project-home-link{display:flex;align-items:center;justify-content:space-between;gap:.8rem;border-top:1px solid var(--line);padding:.6rem .2rem;font-size:.82rem;min-width:0;color:var(--ink);text-decoration:none}
.project-home-link>span{min-width:0;overflow-wrap:anywhere}
.project-home-link .icon{width:14px;height:14px;vertical-align:middle;color:var(--accent)}
.project-home-link small{white-space:nowrap;font-size:.72rem}
.project-home-activity{display:grid;grid-template-columns:55px minmax(0,1fr) auto;align-items:center;gap:.65rem;padding:.65rem .25rem;border-top:1px solid var(--line);font-size:.8rem;color:var(--ink);text-decoration:none;min-width:0}
.project-home-activity-kind{font-size:.69rem;font-weight:700;color:var(--muted)}
.project-home-activity-title{min-width:0;overflow-wrap:anywhere}
.project-home-activity .small{font-size:.72rem;white-space:nowrap}
.project-home-secondary .panel{padding:1.05rem}
.project-home-secondary .meter{height:7px}
.project-home-secondary p{line-height:1.55;margin:0}
.project-home-date{display:flex;align-items:center;gap:.75rem;padding:.7rem 0;border-top:1px solid var(--line);color:var(--ink);font-size:.82rem;text-decoration:none;min-width:0}
.project-home-date-day{font-size:.77rem;white-space:nowrap;font-weight:750;color:var(--accent);min-width:53px}
.project-home-date>span:last-child{min-width:0;overflow-wrap:anywhere}
.project-home-date small{display:block;margin-top:.15rem;font-size:.7rem}
.project-home-time-number{font-size:1.7rem;font-weight:800;line-height:1.25;letter-spacing:-.035em}
.project-home-time-number small{font-size:.6em;font-weight:600;color:var(--muted)}
.project-home-idea{display:flex;align-items:center;justify-content:space-between;gap:.6rem;padding:.65rem 0;border-top:1px solid var(--line);color:var(--ink);text-decoration:none;min-width:0}
.project-home-idea strong{min-width:0;font-size:.82rem;overflow-wrap:anywhere}
.project-home-idea .chip{flex-shrink:0}
@media(max-width:1180px){.project-home-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.project-home-columns{grid-template-columns:minmax(0,1fr) minmax(230px,.7fr)}}
@media(max-width:800px){.project-home-columns{grid-template-columns:minmax(0,1fr)}.project-home-intro{flex-direction:column}.project-home-quicklinks{max-width:none;width:100%;justify-content:flex-start}.project-home-quicklinks .btn{flex:1 1 130px}}
@media(max-width:480px){.project-home-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem}.project-home-metric{padding:.85rem!important;min-height:125px}.project-home-metric strong{font-size:1.45rem}.project-home-metric .small{font-size:.7rem}.project-home-intro,.project-home-section{padding:.95rem}.project-home-action{align-items:flex-start;flex-direction:column;gap:.35rem}.project-home-action-meta{max-width:none;justify-content:flex-start}.project-home-activity{grid-template-columns:50px minmax(0,1fr)}.project-home-activity .small{grid-column:2;justify-self:start}.project-home-quickadd .btn{flex:1 1 100%}}


/* Projects simplification (Nov 2026) */
/* Inside a project, every card already belongs to it: don't repeat the project name. */
.project-page .work-item-context { display:none; }
.project-work-switch { display:flex; gap:.35rem; margin:0 0 .9rem; }
.project-home-epic { display:grid; grid-template-columns:minmax(0,1fr) 120px auto; gap:.4rem .8rem; align-items:center;
  padding:.55rem 0; border-top:1px solid var(--line); text-decoration:none; color:inherit; }
.project-home-epic:first-of-type { border-top:0; }
.project-home-epic:hover .project-home-epic-title { text-decoration:underline; }
.project-home-epic-title { font-weight:600; overflow-wrap:anywhere; }
.project-home-epic .meter { height:6px; }
@media (max-width:640px) { .project-home-epic { grid-template-columns:minmax(0,1fr) auto; }
  .project-home-epic .meter { grid-column:1 / -1; grid-row:2; } }
.project-notes-grid { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(0,1fr); gap:1rem; align-items:start; }
@media (max-width:900px) { .project-notes-grid { grid-template-columns:1fr; } }
.item-head-actions { margin:.5rem 0 1rem; align-items:center; gap:.5rem; }
.item-focus-line { margin-left:.25rem; }
.item-more-options { border-top:1px solid var(--line); padding-top:.6rem; }
.item-more-options > summary { cursor:pointer; color:var(--muted); }
.item-more-options[open] > summary { margin-bottom:.6rem; }
/* ======================================================================
   resurfacing
   ====================================================================== */
/* Quiet resurfacing cards; compact in Today and Weekly Review. */
.revisit-section{display:grid;gap:1rem;margin:1rem 0;min-width:0}
.revisit-section .row{gap:.6rem}
.revisit-section .row p{margin:.25rem 0 0}
.revisit-section h2{margin:0}
.revisit-list{display:grid;gap:.7rem;min-width:0}
.revisit-card{display:flex;gap:1rem;align-items:start;justify-content:space-between;border:1px solid var(--line);border-radius:11px;padding:.95rem 1rem;background:var(--surface);min-width:0}
.revisit-card-main{display:grid;gap:.4rem;min-width:0;flex:1}
.revisit-card-main h3{margin:0;font-size:.97rem;line-height:1.35;overflow-wrap:anywhere}
.revisit-card-main h3 a{color:var(--ink);text-decoration:none}
.revisit-card-main h3 a:hover{color:var(--accent);text-decoration:underline}
.revisit-card-main p{margin:0;line-height:1.55;overflow-wrap:anywhere}
.revisit-card-kicker,.revisit-related{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;min-width:0}
.revisit-related a{max-width:100%;white-space:normal;overflow-wrap:anywhere;text-decoration:none}
.revisit-card-actions{display:flex;gap:.35rem;flex-wrap:wrap;justify-content:flex-end;min-width:145px;max-width:270px}
.revisit-card-actions form{margin:0}
.revisit-card-actions .btn{white-space:nowrap;display:inline-flex;justify-content:center}
.revisit-empty{padding:.5rem .2rem;line-height:1.6}
.revisit-explainer{margin-top:1rem}
.revisit-explainer h2{margin:0}
.revisit-explainer p{line-height:1.6}
.revisit-preview{display:grid;gap:.75rem;margin:1rem 0}
.revisit-preview .revisit-card{padding:.8rem .95rem}
.revisit-preview .revisit-card-actions{min-width:0}
/* Stack actions under the text whenever the card itself is narrow (e.g. a Today column), not just on phones. */
.revisit-list{container-type:inline-size}
@container (max-width:680px){.revisit-card{flex-direction:column}.revisit-card-actions{max-width:none;width:100%;justify-content:flex-start}}
.today-secondary .revisit-preview{margin:0}
@media(max-width:650px){.revisit-card{flex-direction:column}.revisit-card-actions{max-width:none;width:100%;justify-content:flex-start}.revisit-card-actions .btn{white-space:normal}.revisit-card-actions form{flex:0 1 auto}}

/* Personal Analytics: readable cross-feature panels without decorative dashboards. */
.analytics-toolbar { margin: .65rem 0 1.25rem; align-items: flex-start; gap: 1rem; }
.analytics-toolbar > p { margin: .4rem 0; }
.analytics-customize { padding: .7rem 1rem; min-width: 14rem; }
.analytics-customize summary { cursor:pointer; font-weight:600; }
.analytics-customize fieldset { margin-top: .8rem; border: 0; padding: 0; }
.analytics-customize legend { font-weight:600; margin-bottom:.5rem; }
.analytics-customize .check { display:flex; align-items:center; gap:.6rem; margin:.45rem 0; min-height:2.75rem; }
.analytics-layout { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; align-items:start; }
.analytics-panel { min-width:0; padding:1.1rem; }
.analytics-panel h2 { margin:0 0 .35rem; }
.analytics-panel h3 { font-size:1rem; margin:1.3rem 0 .4rem; }
.analytics-panel .row { gap:.5rem; }
.analytics-panel .small { line-height:1.45; }
.analytics-panel .table { width:100%; }
.analytics-table-wrap { overflow-x:auto; }
.analytics-goal { padding:.8rem 0; border-bottom:1px solid var(--line,#d2d7dc); }
.analytics-goal:last-of-type { border-bottom:0; }
.analytics-goal .time-meter { margin:.55rem 0 .35rem; }
.analytics-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.7rem; margin:1rem 0; }
.analytics-metrics > div { min-width:0; }
.analytics-metrics .small { display:block; }
.analytics-metrics strong { display:block; margin-top:.3rem; font-size:1.25rem; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.analytics-source { padding:.7rem 0; border-bottom:1px solid var(--line,#d2d7dc); }
.analytics-source:last-of-type { border-bottom:0; }
.analytics-source .time-meter { margin:.55rem 0; }
.analytics-method { margin-top:1.1rem; }
.analytics-method summary { cursor:pointer; }
@media(max-width:900px){.analytics-layout { grid-template-columns:minmax(0,1fr); }}
@media(max-width:540px){.analytics-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }.analytics-panel { padding:.85rem; }}

/* Rotating routine plans: functional cards, responsive editor and history. */
.routine-cycle-overview { margin-block: 1rem; }
.routine-cycle-tile { display:block; text-decoration:none; color:inherit; min-width:0; }
.routine-cycle-tile:hover { border-color: var(--accent, #6b7a8b); }
.routine-cycle-tile p { margin:.4rem 0; }
.routine-cycle-list { padding:0; margin:.75rem 0 1rem; list-style:none; }
.routine-cycle-row { padding:.8rem 0; border-bottom:1px solid var(--line, #ddd); gap:.7rem; }
.routine-cycle-row:last-child { border-bottom:none; }
.routine-cycle-row .row { gap:.3rem; }
@media (max-width: 640px) {
  .routine-cycle-row > .row { width:100%; justify-content:flex-start; flex-wrap:wrap; }
  .routine-cycle-tile { width:100%; }
}

/* Project decision evidence — readable, comparable and responsive. */
.project-decision-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:.65rem; }
.project-decision-stats > div { display:flex; flex-direction:column; gap:.3rem; min-width:0; padding:.85rem; background:var(--sunk); border-radius:var(--r-card); }
.project-decision-stats strong { font-size:1.18rem; color:var(--ink); overflow-wrap:anywhere; }
.project-decision-overview p { max-width:80ch; }
.project-decision-tasks .table-wrap { max-width:100%; overflow-x:auto; }
.project-decision-tasks .table { min-width:660px; }
@media(max-width:650px) { .project-decision-stats {grid-template-columns:repeat(2,minmax(0,1fr));} .project-decision-stats > div {padding:.7rem;} .project-decision-stats strong {font-size:1rem;} }
@media(max-width:390px) { .project-decision-stats {grid-template-columns:minmax(0,1fr);} }

/* Keep portfolio comparison scrollable within the card instead of widening mobile pages. */
.project-portfolio { min-width:0; max-width:100%; }
.project-portfolio-scroll { display:block; min-width:0; max-width:100%; width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
.project-portfolio-scroll > .table { min-width:700px; }
.project-portfolio-scroll th,.project-portfolio-scroll td { overflow-wrap:anywhere; }

/* Note heading folds: controls remain visible, readable and keyboard operable. */
#note-body .note-fold-hidden, #note-rich .note-fold-hidden { display: none !important; }
#note-body :is(h1,h2,h3,h4,h5,h6), #note-rich :is(h1,h2,h3,h4,h5,h6) { position: relative; }
.note-fold-toggle { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 32px; margin: 0 6px 0 -6px; padding: 0; vertical-align: middle; border: 0; border-radius: 5px; background: transparent; color: inherit; font: inherit; font-size: 19px; line-height: 1; cursor: pointer; }
.note-fold-toggle:hover { background: rgba(127,127,127,.13); }
.note-fold-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (pointer:coarse) { .note-fold-toggle { min-width: 44px; min-height: 44px; } }

/* Embedded note media and code: clear boundaries, usable on narrow screens. */
#note-body .note-audio-embed { display:flex; flex-direction:column; gap:.5rem; margin:1rem 0; padding:1rem; border:1px solid var(--border, #bbc1c8); border-radius:8px; }
#note-body .note-audio-embed audio { width:100%; max-width:100%; }
#note-body img { max-width:100%; height:auto; border-radius:6px; }
#note-body .note-code-wrap { position:relative; margin:1rem 0; max-width:100%; min-width:0; }
#note-body .note-code-wrap pre { margin:0; padding-top:2.8rem; overflow-x:auto; tab-size:2; }
#note-body .note-code-copy { position:absolute; top:.4rem; right:.4rem; padding:.35rem .65rem; border:1px solid currentColor; border-radius:5px; background:var(--surface, #fff); color:var(--text, #222); font-size:.8rem; cursor:pointer; }
#note-body .note-code-copy:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
#note-media-status:not([hidden]) { margin:.5rem 0; }
.note-rich-toolbar [data-note-block] { white-space:nowrap; }

.note-linked-media { margin:.65rem 0; border:1px solid var(--border, #bbb); border-radius:7px; padding:.65rem .85rem; }
.note-linked-media summary { cursor:pointer; font-weight:600; }
.note-media-library { display:grid; gap:.4rem; }
.note-media-entry { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.5rem; padding:.4rem 0; border-top:1px solid var(--border, #ddd); }
.note-media-entry span { overflow-wrap:anywhere; min-width:0; }
/* Source-owned planning details — no separate dashboard. */
.planning-fields { border:1px solid var(--line); border-radius:var(--r-card); padding:.8rem; margin:.7rem 0; min-width:0; }
.planning-fields legend { font-weight:650; padding:0 .35rem; }
.planning-fields .row { align-items:end; }
.planning-fields .field { flex:1 1 140px; min-width:0; }
.planning-fields .field .input { max-width:100%; }
.planning-dependencies { display:block; }
.planning-dependencies summary { cursor:pointer; min-height:44px; display:flex; align-items:center; }
.planning-dependencies form select { min-width:160px; }
@media(max-width:640px) { .planning-fields { padding:.65rem; } .planning-fields .field { flex-basis:100%; } }

/* Projects 2026: restrained, accessible command-centre layout. */
.project-workspace-head { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:1rem 2rem; margin-bottom:.85rem; min-width:0; }
.project-workspace-heading { flex:1 1 360px; min-width:0; }
.project-workspace-heading .crumb { display:inline-flex; align-items:center; gap:.3rem; margin-bottom:.6rem; }
.project-workspace-titleline { display:flex; align-items:center; flex-wrap:wrap; gap:.6rem; }
.project-workspace-titleline h1 { margin:0; min-width:0; overflow-wrap:anywhere; }
.project-workspace-summary { margin:.55rem 0 .35rem; max-width:68ch; line-height:1.5; }
.project-workspace-facts { display:flex; gap:.4rem .9rem; flex-wrap:wrap; margin-top:.65rem; font-size:.82rem; color:var(--muted); }
.project-workspace-facts span+span::before { content:"·"; margin-right:.8rem; color:var(--muted); }
.project-workspace-actions { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; }
.project-workspace-actions .btn { white-space:nowrap; }
.project-workspace-more { position:relative; }
.project-workspace-more>summary { list-style:none; cursor:pointer; }
.project-workspace-more>summary::-webkit-details-marker { display:none; }
.project-workspace-more-items { position:absolute; z-index:10; top:calc(100% + .3rem); right:0; min-width:190px; display:grid; gap:.2rem; padding:.4rem; border:1px solid var(--line); border-radius:9px; background:var(--surface); box-shadow:0 8px 18px #0002; }
.project-workspace-more-items a { color:var(--ink); padding:.65rem .75rem; border-radius:6px; text-decoration:none; }
.project-workspace-more-items a:hover,.project-workspace-more-items a:focus-visible { background:var(--surface-2); text-decoration:underline; }
.project-workspace-tabs { display:flex; align-items:center; gap:.15rem; overflow-x:auto; overscroll-behavior-inline:contain; scrollbar-width:thin; border-bottom:1px solid var(--line); margin:0 0 .8rem; padding:0 .1rem; }
.project-workspace-tabs a { flex:0 0 auto; display:inline-flex; align-items:center; min-height:44px; padding:.55rem .85rem; text-decoration:none; border-bottom:3px solid transparent; color:var(--muted); font-weight:550; font-size:.9rem; white-space:nowrap; }
.project-workspace-tabs a:hover { color:var(--ink); background:var(--surface-2); }
.project-workspace-tabs a.on { color:var(--ink); border-bottom-color:var(--ink); font-weight:700; }
.project-workspace-tabs a:focus-visible { outline:2px solid var(--ink); outline-offset:-3px; }
.project-workspace-tags { margin-bottom:1rem; }
.project-workspace-tags [data-entity-tags] { min-height:0; }
.project-index-toolbar { display:flex; flex-wrap:wrap; gap:.6rem 1rem; align-items:center; justify-content:space-between; margin:0 0 1.1rem; }
.project-index-status { display:flex; flex-wrap:wrap; gap:.35rem; }
.project-index-filters { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; flex:1 1 320px; justify-content:flex-end; }
.project-index-filters #project-filter { flex:1 1 200px; max-width:320px; min-width:0; }
.project-index-filters #project-sort { width:auto; max-width:100%; }
.project-index-card .project-card-head h2 { margin:0; font-size:1.05rem; line-height:1.3; }
.project-index-next { margin:0; }
.project-index-overdue { color:var(--danger, #b42318); font-weight:600; }
.project-index-card { border:1px solid var(--line); min-width:0; }
.project-index-card[hidden] { display:none!important; }
.project-index-card .project-index-priority { display:block; font-size:.75rem; color:var(--muted); margin-top:.1rem; }
.project-index-description { font-size:.84rem; line-height:1.5; color:var(--muted); margin:0; overflow-wrap:anywhere; }
.project-index-empty { padding:1.5rem; }
.project-home-focus { border:1px solid var(--line); border-radius:11px; background:var(--surface); margin:1rem 0; padding:1.15rem; min-width:0; }
.project-home-focus-intro h2 { margin:.2rem 0; }
.project-home-focus-intro p { margin:.25rem 0 1rem; }
.project-home-focus-grid { display:grid; grid-template-columns:minmax(0,1.45fr) repeat(2,minmax(0,1fr)); gap:.75rem; }
.project-home-focus-grid>div { background:var(--surface-2); padding:1rem; border:1px solid var(--line); border-radius:8px; min-width:0; }
.project-home-focus-label { display:block; font-size:.78rem; color:var(--muted); margin-bottom:.55rem; }
.project-home-focus-primary .project-home-focus-action { display:block; font-size:1.05rem; font-weight:700; overflow-wrap:anywhere; }
.project-home-focus-grid strong { display:block; font-size:1rem; }
.project-home-focus-grid .small { margin:.4rem 0 .8rem; }
.project-home-focus-grid a:not(.btn) { text-underline-offset:2px; }
@media(max-width:920px) { .project-home-focus-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .project-home-focus-primary { grid-column:1/-1; } }
@media(max-width:610px) { .project-workspace-actions { width:100%; } .project-workspace-actions>a { flex:1 1 auto; text-align:center; } .project-workspace-more { margin-left:auto; } .project-index-metrics { gap:.4rem; } .project-index-metrics>div { padding:.6rem; } .project-index-metrics strong { font-size:1.2rem; } .project-index-metrics span { font-size:.72rem; } .project-home-focus-grid { grid-template-columns:minmax(0,1fr); } .project-home-focus-primary { grid-column:auto; } .project-home-focus { padding:.8rem; } .project-workspace-more-items { right:0; } }

/* Shared next-work recommendation: quiet, actionable and readable on phones. */
.today-next-work { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:1rem; margin:1rem 0; padding:1rem 1.2rem; border:1px solid var(--line); }
.today-next-work-main { min-width:0; flex:1 1 280px; }
.today-next-work-title { display:block; margin:.2rem 0 .4rem; font-weight:700; font-size:1.08rem; line-height:1.4; overflow-wrap:anywhere; }
.today-next-work-main .small { margin:.25rem 0; line-height:1.5; }
.today-next-work-actions { display:flex; gap:.5rem; flex-wrap:wrap; }
.today-next-work-actions .btn { min-height:40px; display:inline-flex; align-items:center; justify-content:center; }
@media(max-width:600px) { .today-next-work { padding:.85rem; } .today-next-work-actions { width:100%; } .today-next-work-actions .btn { flex:1 1 auto; min-height:44px; } }


/* Project page: five tabs, left-aligned. */
.project-workspace-tabs { justify-content:flex-start; flex-wrap:wrap; overflow:visible; margin:0 0 .9rem; }
.project-workspace-tabs a.on { border-bottom-color:var(--accent); }
@media (max-width:640px) { .project-workspace-tabs { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }
  .project-workspace-tabs a { padding:.55rem .6rem; } }
.project-workspace-tags { margin:0 0 .85rem; min-width:0; }

/* Overview: show actual work first, contextual information second. */
.project-home { gap:.85rem; max-width:2000px; }
.project-home-focus { margin:0; padding:1rem 1.2rem; }
.project-home-focus-intro { margin-bottom:.7rem; }
.project-home-focus-intro h2 { margin:.15rem 0 .15rem; font-size:1.15rem; }
.project-home-focus-intro p { margin:0; }
.project-home-focus-grid { grid-template-columns:minmax(0,1.5fr) repeat(2,minmax(0,.85fr)); gap:.6rem; }
.project-home-focus-grid > div { padding:.9rem 1rem; }
.project-home-focus-primary .project-home-focus-action { font-size:1.08rem; line-height:1.42; }
.project-home-focus-actions { margin-top:.6rem; }
.project-home-focus-empty { line-height:1.5; }
.project-home-focus-label { color:var(--ink); font-size:.75rem; font-weight:650; }
.project-home-metrics { gap:.65rem; }
.project-home-metric { min-height:105px; padding:.8rem 1rem!important; gap:.32rem; }
.project-home-metric strong { font-size:clamp(1.45rem,2.25vw,1.85rem); }
.project-home-columns { grid-template-columns:minmax(0,1.55fr) minmax(265px,.8fr); align-items:start; gap:.85rem; }
.project-home-columns > .stack { gap:.8rem; }
.project-home-primary, .project-home-secondary { min-width:0; }
.project-home-section { gap:.7rem; padding:1rem 1.15rem; }
.project-home-section .eyebrow { display:block; margin-bottom:.2rem; }
.project-home-section .row > div { min-width:0; }
.project-home-planning-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; align-items:start; }
.project-home-planning-grid > .panel { min-width:0; height:100%; }
.project-home-planning-grid .meter { margin:.25rem 0; height:7px; }
.project-home-planning-grid p { line-height:1.5; margin:.15rem 0; }
.project-home-secondary .project-home-intro { display:block; padding:1rem 1.15rem; min-width:0; }
.project-home-secondary .project-home-intro-copy { max-width:none; gap:.6rem; min-width:0; }
.project-home-secondary .project-home-intro-copy h2 { font-size:1.05rem; }
.project-home-secondary .project-home-description { font-size:.85rem; max-height:150px; overflow:auto; }
.project-home-secondary .project-home-quicklinks { min-width:0; max-width:none; width:100%; justify-content:flex-start; }
.project-home-secondary .project-home-quicklinks .btn { flex:1 1 110px; }
.project-home-quickadd { scroll-margin-top:1.5rem; }
.project-home-activity-disclosure { margin:0; padding:0; min-width:0; }
.project-home-activity-disclosure > summary {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap;
  gap:.45rem; min-height:48px; padding:.85rem 1.15rem; list-style:none;
  cursor:pointer; font-weight:700; color:var(--ink);
}
.project-home-activity-disclosure > summary::-webkit-details-marker { display:none; }
.project-home-activity-disclosure > summary:hover { background:var(--surface-2); }
.project-home-activity-disclosure > summary:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.project-home-activity-content { border-top:1px solid var(--line); padding:.65rem 1.15rem 1rem; }
.project-home-activity-content > p { margin:.1rem 0 .7rem; }
.project-home-action, .project-home-link, .project-home-date, .project-home-idea { min-height:44px; }
.project-home-focus a:focus-visible, .project-home a:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media(max-width:1160px) {
  .project-home-columns { grid-template-columns:minmax(0,1.3fr) minmax(245px,.85fr); }
  .project-home-planning-grid { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:860px) {
  .project-home-columns { grid-template-columns:minmax(0,1fr); }
  .project-home-planning-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .project-home-focus-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .project-home-focus-primary { grid-column:1 / -1; }
}
@media(max-width:640px) {
  .project-workspace-tabs-main { flex:1 1 100%; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0 .15rem; }
  .project-workspace-tabs-main > a { justify-content:center; padding:.55rem .35rem; font-size:.83rem; min-width:0; }
  .project-workspace-extra { min-width:0; flex:1 1 100%; }
  .project-workspace-extra > summary { justify-content:center; gap:.45rem; }
  .project-workspace-extra-menu { position:static; box-shadow:none; max-width:none; width:100%; border-radius:7px; margin:.3rem 0 .5rem; }
  .project-home-focus { padding:.85rem; }
  .project-home-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .project-home-planning-grid { grid-template-columns:minmax(0,1fr); }
  .project-home-focus-grid { grid-template-columns:minmax(0,1fr); }
  .project-home-focus-primary { grid-column:auto; }
  .project-home-focus-actions .btn { min-height:44px; }
  .project-home-activity-disclosure > summary { align-items:flex-start; flex-direction:column; }
}


/* Board controls are one compact workspace, not three disconnected toolbars. */
.project-board-workspace { display:grid; gap:.55rem; margin-bottom:.6rem; min-width:0; }
.project-board-heading { gap:.65rem; align-items:center; }
.project-board-heading h2 { font-size:1.1rem; margin:0 0 .2rem; }
.project-board-heading p { margin:0; line-height:1.45; }
.project-board-tools { display:grid; gap:.85rem; min-width:0; padding:1rem 1.1rem; }
.project-board-tools .sprint-bar { margin:0; gap:.7rem; align-items:center; }
.project-board-filters { display:flex; flex:1 1 380px; gap:.5rem; align-items:end; min-width:0; }
.project-board-filter { display:grid; gap:.3rem; flex:1 1 130px; min-width:0; font-size:.78rem; color:var(--ink); font-weight:650; }
.project-board-filter select { width:100%; min-width:0; max-width:100%; }
.project-board-tools #board-columns { margin:0; }
.project-board-add { border-top:1px solid var(--line); padding-top:.85rem; align-items:center; gap:.45rem; }
.project-board-add-label { font-weight:700; font-size:.83rem; flex:0 0 auto; }
.project-board-add input.grow { flex:2 1 220px; min-width:min(100%,180px); }
.project-board-add select { flex:0 1 auto; max-width:100%; }
.project-board-hint { margin:.5rem 0 .8rem; }
.project-board-tools .btn:focus-visible, .project-board-tools .input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media(max-width:720px) {
  .project-board-tools { padding:.8rem; }
  .project-board-filter { flex-basis:140px; }
  .project-board-add-label { flex-basis:100%; }
  .project-board-add input.grow { flex-basis:100%; }
  .project-board-add select { flex:1 1 120px; }
  .project-board-add .btn { min-height:44px; flex:1 1 100%; }
}



/* Project Work Explorer: compact, readable alternatives to the old fully expanded tree. */
.project-explorer { display:grid; gap:.9rem; min-width:0; width:100%; max-width:100%; overflow-x:clip; }
.project-explorer [hidden] { display:none!important; }
.project-explorer-header { display:flex; align-items:end; justify-content:space-between; gap:.75rem; flex-wrap:wrap; }
.project-explorer-header h2 { margin:.1rem 0 .2rem; font-size:1.25rem; }
.project-explorer-header p { margin:0; line-height:1.5; }
.explorer-modes { display:flex; flex-wrap:wrap; gap:.25rem; }
.explorer-modes .btn { min-height:44px; font-weight:650; }
.explorer-modes .btn[aria-pressed="true"] { background:var(--ink); border-color:var(--ink); color:var(--surface); }
.explorer-toolbar { display:grid; grid-template-columns:minmax(160px,2fr) repeat(3,minmax(115px,1fr)); gap:.65rem; padding:1rem; min-width:0; }
.explorer-toolbar .field { min-width:0; display:grid; gap:.25rem; margin:0; font-size:.8rem; font-weight:600; }
.explorer-toolbar .input { width:100%; min-width:0; }
.explorer-filter-actions { display:flex; flex-wrap:wrap; align-items:center; gap:.6rem; }
.explorer-filter-actions .btn { min-height:44px; }
.explorer-presets { display:flex; align-items:end; flex-wrap:wrap; gap:.65rem; padding:.75rem 1rem; }
.explorer-presets>.field { display:grid; gap:.3rem; min-width:150px; flex:1 1 175px; font-size:.8rem; font-weight:600; margin:0; }
.explorer-presets .input { width:100%; min-width:0; }
.explorer-presets-actions { display:flex; align-items:center; gap:.4rem; flex-wrap:wrap; }
.explorer-presets-actions .btn { min-height:44px; }
.explorer-presets [data-explorer-feedback] { width:100%; min-height:1rem; }
.explorer-presets [data-error="true"], .explorer-edit-message[data-error="true"] { color:var(--danger); font-weight:650; }
.explorer-tree-view { display:grid; gap:.65rem; min-width:0; }
.explorer-view-heading { margin:0; align-items:center; gap:.45rem; }
.explorer-view-heading h3 { margin:0; font-size:1.02rem; }
.explorer-view-heading .btn { min-height:44px; }
.explorer-epic, .explorer-unassigned { padding:.55rem .85rem; min-width:0; }
.explorer-unassigned h3 { font-size:.9rem; margin:.4rem .4rem .6rem; }
.explorer-node { min-width:0; }
.explorer-tree-row { display:flex; gap:.45rem; align-items:center; min-height:46px; padding:.35rem .1rem; position:relative; flex-wrap:wrap; }
.explorer-tree-row.depth-1, .explorer-tree-row.depth-2 { padding-left:.1rem; }
.explorer-tree-row.depth-1::before, .explorer-tree-row.depth-2::before { display:none; }
.explorer-tree-row .title { flex:1 1 170px; line-height:1.4; overflow-wrap:anywhere; text-underline-offset:2px; }
.explorer-tree-row .pick { flex:0 0 auto; min-height:17px; }
.explorer-tree-row .type { flex:0 0 auto; }
.explorer-toggle, .explorer-toggle-placeholder { flex:0 0 36px; min-width:36px; min-height:44px; display:inline-flex; justify-content:center; align-items:center; }
.explorer-toggle { border:0; border-radius:6px; background:transparent; color:var(--ink); cursor:pointer; font-size:1.2rem; }
.explorer-toggle:hover, .explorer-toggle:focus-visible { background:var(--surface-2); }
.explorer-toggle[aria-expanded="false"] span { transform:rotate(-90deg); }
.explorer-parent-link { overflow:hidden; text-overflow:ellipsis; max-width:170px; color:var(--muted); white-space:nowrap; }
.explorer-progress, .explorer-sprint { white-space:nowrap; }
.explorer-children { margin-left:1.05rem; padding-left:.65rem; border-left:1px solid var(--line); min-width:0; }
.explorer-add-child { margin:.15rem 0 .4rem 3.2rem; position:relative; width:fit-content; max-width:calc(100% - 3.2rem); }
.explorer-add-child > summary, .explorer-edit > summary { cursor:pointer; list-style:none; min-height:40px; display:inline-flex; align-items:center; justify-content:center; }
.explorer-add-child > summary::-webkit-details-marker, .explorer-edit > summary::-webkit-details-marker { display:none; }
.explorer-add-form { display:flex; gap:.5rem; flex-wrap:wrap; align-items:end; padding:.65rem; background:var(--surface-2); border:1px solid var(--line); border-radius:7px; max-width:min(540px,85vw); margin-top:.3rem; }
.explorer-add-form .field { flex:1 1 150px; display:grid; gap:.2rem; font-size:.78rem; min-width:0; }
.explorer-add-form .input { width:100%; }
.explorer-add-form .btn { min-height:44px; }
.explorer-edit { position:relative; flex:0 0 auto; }
.explorer-edit[open] { z-index:8; }
.explorer-edit-form { position:absolute; right:0; top:calc(100% + .2rem); z-index:12; width:min(390px,85vw); display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.65rem; max-height:70vh; overflow:auto; padding:1rem; background:var(--surface); border:1px solid var(--line); border-radius:9px; box-shadow:0 8px 20px #0003; }
.explorer-edit-form .field { display:grid; gap:.2rem; min-width:0; font-size:.77rem; font-weight:650; }
.explorer-edit-form .field:first-child, .explorer-edit-form .field:has([name="parent_id"]) { grid-column:1/-1; }
.explorer-edit-form .input { min-width:0; width:100%; }
.explorer-edit-actions { grid-column:1/-1; display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.explorer-edit-actions .btn { min-height:44px; }
.explorer-edit-actions [role="status"] { overflow-wrap:anywhere; }
.explorer-flat-view { min-width:0; max-width:100%; width:100%; overflow:hidden; }
.explorer-table-wrap { display:block; width:100%; min-width:0; max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
.explorer-table { min-width:690px; width:max(100%,690px); max-width:none; }
.explorer-table th { white-space:nowrap; }
.explorer-table th, .explorer-table td { padding:.65rem .65rem; vertical-align:middle; }
.explorer-table td:first-child { min-width:190px; overflow-wrap:anywhere; }
.explorer-table td:nth-child(2) { min-width:135px; overflow-wrap:anywhere; }
.explorer-table .type { margin-right:.25rem; }
.explorer-table tbody tr:hover { background:var(--surface-2); }
.explorer-table .explorer-edit-form { right:0; }
.explorer-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr)); gap:.7rem; }
.explorer-card { min-width:0; padding:1rem; display:flex; flex-direction:column; gap:.7rem; }
.explorer-card h3 { margin:0; font-size:1rem; overflow-wrap:anywhere; }
.explorer-card h3 a { color:var(--ink); text-decoration:none; }
.explorer-card h3 a:hover { text-decoration:underline; }
.explorer-card p { margin:0; }
.explorer-card .explorer-edit { align-self:flex-start; margin-top:auto; }
.explorer-card .explorer-edit-form { left:0; right:auto; }
.explorer-no-results { margin:0; padding:1rem; }
.explorer-new-epic { padding:1rem; }
.explorer-new-epic h3 { margin:0 0 .7rem; font-size:1rem; }
.explorer-new-epic form { align-items:end; }
.explorer-new-epic-title { flex:1 1 190px; min-width:0; display:grid; gap:.25rem; font-size:.8rem; font-weight:650; }
.explorer-new-epic-title .input { width:100%; }
.explorer-new-epic .btn { min-height:44px; }
.project-explorer :is(button,select,input,summary,a):focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media(max-width:1080px) {
  .explorer-toolbar { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .explorer-search { grid-column:1/-1; }
}
@media(max-width:640px) {
  .explorer-toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); padding:.75rem; }
  .explorer-search { grid-column:1/-1; }
  .project-explorer-header, .explorer-presets { align-items:stretch; }
  .explorer-modes { width:100%; }
  .explorer-modes .btn { flex:1; }
  .explorer-presets { padding:.75rem; }
  .explorer-presets>.field { flex-basis:100%; }
  .explorer-presets-actions { width:100%; }
  .explorer-presets-actions .btn { flex:1 1 auto; }
  .explorer-tree-row { gap:.3rem; }
  .explorer-tree-row .title { flex:1 1 150px; }
  .explorer-tree-row .explorer-parent-link, .explorer-tree-row .explorer-sprint { display:none; }
  .explorer-children { margin-left:.3rem; padding-left:.4rem; }
  .explorer-epic, .explorer-unassigned { padding:.35rem .4rem; }
  .explorer-add-child { margin-left:2rem; max-width:calc(100% - 2rem); }
  .explorer-edit-form { position:fixed; top:auto; left:.5rem; right:.5rem; bottom:calc(5.5rem + env(safe-area-inset-bottom)); width:auto; max-width:none; max-height:60vh; overflow-y:auto; box-shadow:0 0 0 1px var(--line),0 8px 20px #0003; }
  .explorer-card .explorer-edit-form { left:.5rem; right:.5rem; }
  .explorer-table .explorer-edit-form { right:.5rem; }
}

/* Unified daily workflow: consistent, accessible controls and task context. */
.work-action-bar { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.work-action-bar form { margin: 0; }
.work-action-bar .btn { min-height: 44px; }
.workflow-active-banner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .8rem 1rem; margin-bottom: 1rem; background: var(--surface, #fff); border: 1px solid var(--border, #c5cbd2); border-left: 4px solid var(--primary, #315d88); border-radius: .5rem; }
.workflow-active-banner[hidden] { display: none; }
.workflow-active-banner > div { display: grid; gap: .25rem; min-width: 0; }
.workflow-active-banner strong { overflow-wrap: anywhere; }
.workflow-context { display: flex; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; margin: .8rem 0; }
.workflow-selected .work-action-bar { margin: .8rem 0; }
.my-work-actions .work-action-bar { flex-wrap: wrap; }
.focus-finished .work-action-bar { margin: .75rem 0; }
@media (max-width: 640px) { .work-action-bar .btn { min-height: 44px; } }


/* Review & Insights: quiet reporting workspace, sharing the existing design tokens. */
.review-hub{display:grid;gap:1rem;max-width:1560px;margin:0 auto;min-width:0}
.review-hub-heading{display:flex;align-items:end;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin:0}
.review-hub-heading h1{margin:.15rem 0 .4rem}
.review-hub-heading p{max-width:72ch;margin:0}
.review-hub-tabs{display:flex;flex-wrap:wrap;gap:.25rem;border-bottom:1px solid var(--line)}
.review-hub-tabs>a{display:inline-flex;align-items:center;min-height:44px;padding:.65rem .9rem;
  border-bottom:3px solid transparent;text-decoration:none;color:var(--muted);font-weight:600}
.review-hub-tabs>a.on,.review-hub-tabs>a:hover{color:var(--ink);border-bottom-color:var(--accent)}
.review-hub-tabs>a:focus-visible,.review-hub :is(a,button,summary,input,select):focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.review-hub-panel{display:grid;gap:1rem}
.review-hub-panel h2{font-size:1.15rem;margin:0}
.review-hub-panel h3{font-size:1rem;margin:.15rem 0}
.review-hub-panel .row>div{min-width:0}
.review-hub-observation{padding:1rem 0;border-top:1px solid var(--line);display:grid;gap:.5rem}
.review-hub-observation:first-of-type{border-top:0}
.review-hub-observation p{margin:0;max-width:85ch;overflow-wrap:anywhere}
.review-hub-observation .btn{min-height:44px}
.review-hub-overview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem}
.review-hub-overview-grid>a{min-width:0;display:flex;flex-direction:column;gap:.4rem;text-decoration:none;min-height:110px}
.review-hub-overview-grid>a strong{font-size:1.05rem;color:var(--ink)}
.review-hub-overview-grid>a span{font-weight:600;color:var(--ink)}
.review-hub-overview-grid>a small{color:var(--muted)}
.review-hub-overview-grid>a:hover{border-color:var(--accent)}
.review-hub-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.7rem}
.review-hub-metrics>div{min-width:0;display:flex;flex-direction:column;gap:.5rem;padding:.8rem;border:1px solid var(--line);border-radius:var(--r-card)}
.review-hub-metrics>div span{font-size:.8rem;color:var(--muted)}
.review-hub-metrics>div strong{font-size:1.3rem;color:var(--ink);overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.review-hub-actions .btn{min-height:44px}
.review-hub-goal{padding:.8rem 0;border-bottom:1px solid var(--line);display:grid;gap:.45rem;min-width:0}
.review-hub-goal:last-of-type{border-bottom:0}
.review-hub-goal .meter{max-width:800px}
.review-hub-goal p{margin:0}
.review-hub-rows{display:grid;gap:.6rem}
.review-hub-rows>div{padding:.55rem 0;border-bottom:1px solid var(--line)}
.review-hub-source-details{padding:0;min-width:0}
.review-hub-source-details>summary{list-style:none;min-height:54px;padding:.9rem 1.1rem;
  cursor:pointer;display:flex;align-items:center;font-weight:700;color:var(--ink)}
.review-hub-source-details>summary::-webkit-details-marker{display:none}
.review-hub-source-details>summary:after{content:"+";margin-left:auto;font-size:1.25rem;color:var(--muted)}
.review-hub-source-details[open]>summary:after{content:"−"}
.review-hub-source-details[open]>summary{border-bottom:1px solid var(--line)}
.review-hub-source-details>p,.review-hub-source-details>h3,.review-hub-source-details>ul{margin:.85rem 1.1rem}
.review-hub-source-details>.table-wrap{max-width:calc(100% - 2.2rem);margin:0 1.1rem;overflow-x:auto}
.review-hub-source-details table{min-width:610px}
.review-hub-source-note{display:block;max-width:37ch;color:var(--muted);font-size:.8rem;line-height:1.45;margin-top:.25rem}
.review-hub-footer{border-top:1px solid var(--line);padding:.7rem .2rem 0}
.review-hub-footer p{margin:.3rem 0}
@media(max-width:700px){
  .review-hub-overview-grid{grid-template-columns:1fr}
  .review-hub-metrics{grid-template-columns:1fr}
  .review-hub-tabs{gap:0}
  .review-hub-tabs>a{flex:1 1 29%;justify-content:center;padding:.55rem .45rem}
}

/* Weekly capacity: shared Review & Insights design system, no separate CSS file. */
.review-capacity-warning{padding:.8rem 1rem;margin:0;border-left:3px solid var(--accent);
  color:var(--ink);background:var(--surface-2);line-height:1.5}
.review-hub-panel .notice{margin:0}
.review-hub-panel .review-hub-metrics small{font-size:.78rem;line-height:1.4}
.review-capacity-assumptions{border-top:1px solid var(--line);padding-top:.4rem}
.review-capacity-assumptions>summary{display:flex;align-items:center;min-height:44px;
  cursor:pointer;font-weight:600;color:var(--ink)}
.review-capacity-assumptions li{line-height:1.5;margin:.35rem 0}
.review-hub-tabs>a{white-space:nowrap}
@media(max-width:650px){.review-hub-tabs>a{flex:1 1 27%;font-size:.85rem}
  .review-hub-panel .table-wrap{overflow-x:auto;max-width:100%}}

/* Goal details: keep the next action and measured outcomes visible while
   secondary effort/forecast details are available on demand. */
.goal-execution-detail { margin-top:.6rem; }
.goal-execution-summary { display:flex;align-items:center;justify-content:space-between;gap:.75rem;cursor:pointer;font-weight:600;min-height:44px; }
.goal-execution-detail[open] > .goal-execution-summary { margin-bottom:.75rem; }
.goal-execution-summary .small { font-weight:400; }
.goal-execution-summary:focus-visible { outline:2px solid var(--accent);outline-offset:2px; }

/* =====================================================================
   Workspace consolidation · high-contrast, responsive, functional controls
   ===================================================================== */
.workspace-ask{display:inline-flex;align-items:center;gap:.35rem;white-space:nowrap}
.hub-subnav,.my-work-tabs{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;margin:0 0 .8rem}
.hub-subnav a{padding:.4rem .65rem;border-radius:6px;color:var(--ink);font-weight:600}
.hub-subnav a.current,.hub-subnav a[aria-current="page"]{background:var(--panel,#f2f4f8);outline:1px solid var(--line,#c2cad3)}
.my-work-table-wrap{overflow-x:auto;max-width:100%;border-radius:8px}
.my-work-table{width:100%;min-width:890px;font-size:.9rem}
.my-work-table th{white-space:nowrap;text-align:left}
.my-work-table td{vertical-align:top;padding:.65rem .55rem}
.my-work-table td.numeric{font-variant-numeric:tabular-nums;white-space:nowrap}
.my-work-table-title{min-width:195px}
.my-work-table-title a{font-weight:650}
.my-work-table-title small{display:block;max-width:310px;margin-top:.15rem}
.my-work-data-row:hover{background:var(--surface-hover,#f4f6fa)}
.my-work-category{font-size:.8rem;max-width:170px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:inline-block;vertical-align:middle}
.my-work-category-manager{margin:0 0 .8rem}
.my-work-category-manager form{margin:.65rem 0}
.my-work-stats{display:flex;gap:.6rem;flex-wrap:wrap}
.my-work-stats .panel{flex:1 1 140px;padding:.65rem .8rem}
.my-work-stats .panel strong{display:block;font-size:1.25rem;line-height:1.3}
.today-goal-priorities{margin-bottom:1rem}
.today-priority-three{list-style:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem;padding:0;margin:.7rem 0}
.today-priority-three li{display:flex;flex-direction:column;align-items:flex-start;gap:.3rem;min-height:76px;padding:.75rem;border:1px solid var(--line,#b8c1ce);border-radius:6px}
.today-priority-three li.done{opacity:.8}
.today-priority-number{font-size:.8rem;font-weight:700;color:var(--ink);min-width:1.5rem}
.today-daily-goal-editor{margin-top:.75rem}
.today-daily-goal-editor>.stack{padding:.75rem 0}
.hub-schedule-dialog{width:min(540px,calc(100vw - 2rem));max-height:calc(100dvh - 2rem);overflow:auto;border:1px solid #64748b;border-radius:10px;background:#fff;color:#172334;padding:1.2rem;box-shadow:0 16px 46px rgba(0,0,0,.2)}
.hub-schedule-dialog::backdrop{background:rgba(0,0,0,.55)}
.hub-schedule-dialog .field{min-width:0}
.hub-schedule-fields{display:grid;grid-template-columns:1fr 1fr;gap:.65rem}
.hub-schedule-suggestions,.hub-schedule-gaps{gap:.4rem}
.hub-schedule-suggestions .btn{min-height:40px}
.hub-schedule-dialog input[type="time"],.hub-schedule-dialog input[type="date"]{min-height:44px}
.planner-priority-actions{margin:.5rem 0 1rem}
.planner-availability-row{font-size:.86rem;color:var(--ink);padding:.35rem 0}
.planner-availability-number{font-size:1rem;margin:0}
.planner-day-comparison{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;margin:1rem 0}
.planner-day-comparison .panel{min-width:0}
.planner-day-comparison .panel h2{margin:0 0 .35rem}
.planner-comparison-list{display:flex;flex-direction:column;gap:.4rem;margin:.75rem 0 0;padding:0}
.planner-comparison-list li{display:flex;align-items:baseline;flex-wrap:wrap;gap:.35rem;border-top:1px solid var(--line,#e3e7ef);padding:.45rem 0}
.planner-comparison-list strong{font-variant-numeric:tabular-nums;min-width:90px}
.planner-settings-area{margin-top:1rem}
.project-home-relevant-knowledge{margin:.65rem 0}
.project-home-relevant-knowledge summary{min-height:44px}
.project-home-relevant-knowledge>.panel{margin:.7rem 0 0}
.project-board-tools{padding:.8rem}
.project-board-tools summary{margin:0}
.project-board-tools[open] summary{margin-bottom:.85rem}
.explorer-presets>summary,.explorer-new-epic>summary{min-height:40px}
.explorer-presets[open]>summary,.explorer-new-epic[open]>summary{margin-bottom:.75rem}
.review-summary,.weekly-review-steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;margin:.75rem 0}
.review-summary>.panel,.weekly-review-steps>.panel{min-width:0}
.review-summary-fact{display:flex;align-items:baseline;gap:.75rem;border-bottom:1px solid var(--line,#d5dce5);padding:.5rem 0}
.review-summary-fact strong{font-size:1.4rem;font-variant-numeric:tabular-nums}
.weekly-guided-review{display:flex;flex-direction:column;gap:.8rem}
.weekly-guided-review>section.panel{max-width:1040px}
.weekly-review-details,.review-evidence-details{margin:1rem 0}
.weekly-review-details[open]>summary,.review-evidence-details[open]>summary{margin-bottom:1rem}
.project-decisions-disclosure{margin:.8rem 0;padding:.75rem}
@media(max-width:860px){
  .my-work-table{min-width:840px}
  .planner-day-comparison{grid-template-columns:1fr}
  .review-summary,.weekly-review-steps{grid-template-columns:1fr}
}
@media(max-width:600px){
  .today-priority-three{grid-template-columns:1fr}
  .today-priority-three li{min-height:0}
  .hub-schedule-fields{grid-template-columns:1fr}
  .hub-schedule-dialog{padding:1rem}
  .workspace-ask span{display:none}
  .planner-comparison-list strong{min-width:70px}
}

/* Accessible icon-only toolbar and contextual recommendation menu. */
.workspace-tools { position:relative; display:flex; align-items:center; gap:.5rem; }
.workspace-tools .workspace-icon-button {
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto;
  width:44px; height:44px; min-width:44px; min-height:44px;
  padding:0; border:1px solid #cbd5e1; border-radius:9px;
  background:#fff; color:#172638; text-decoration:none; cursor:pointer;
}
.workspace-tools .workspace-icon-button svg { width:20px; height:20px; }
.workspace-tools .workspace-icon-button:hover, .workspace-tools .workspace-icon-button:focus-visible {
  background:#eaf0f6; border-color:#58718e;
}
.workspace-tools .workspace-icon-button:focus-visible { outline:3px solid #285c8a; outline-offset:2px; }
.workspace-tools .workspace-capture { background:#173b5a; border-color:#173b5a; color:#fff; }
.workspace-tools .workspace-capture:hover, .workspace-tools .workspace-capture:focus-visible { background:#254f73; color:#fff; }
.workspace-recommendation { position:relative; }
.workspace-recommendation > summary { list-style:none; }
.workspace-recommendation > summary::-webkit-details-marker { display:none; }
.workspace-recommendation[open] > summary { background:#eaf0f6; border-color:#58718e; }
.workspace-recommendation-panel {
  position:absolute; right:0; top:calc(100% + 10px); z-index:110;
  width:min(370px,calc(100vw - 28px)); padding:1rem; box-shadow:0 8px 24px #17263824;
}
.workspace-recommendation-panel .now-ask { display:grid; gap:.65rem; margin-top:.6rem; }
.workspace-recommendation-panel .now-ask > * { width:100%; }
.workspace-recommendation-panel .answer { margin-top:.75rem; overflow-wrap:anywhere; }
@media (max-width:650px) {
  .workspace-location { min-width:0; }
  .workspace-tools { gap:.25rem; }
  .workspace-tools .workspace-icon-button { width:44px; height:44px; }
  .workspace-recommendation-panel { right:-56px; }
}


/* ======================================================================
   My Work Phase 2: native controls, linked records and four clear tabs
   ====================================================================== */
.my-work-tabs {gap:.45rem;flex-wrap:wrap;margin:1rem 0 1.1rem}
.my-work-tabs a {display:inline-flex;align-items:center;min-height:44px;padding:.6rem .85rem}
.my-work-tab-verb {font-size:.82em;font-weight:500;color:var(--muted)}
.my-work-tabs a.current .my-work-tab-verb {color:inherit}
.workspace-selection-list {list-style:none;padding:0;margin:1rem 0;display:grid;gap:0}
.workspace-selection-row {
  display:grid;grid-template-columns:2rem minmax(0,1fr) auto;
  gap:.75rem;align-items:start;padding:.9rem 0;border-bottom:1px solid var(--line)
}
.workspace-selection-row:last-child {border-bottom:0}
.workspace-selection-index {display:grid;place-items:center;width:2rem;height:2rem;
  border-radius:6px;border:1px solid var(--line);font-variant-numeric:tabular-nums;font-weight:700}
.workspace-selection-main {min-width:0}
.workspace-selection-main>a,.workspace-selection-main>strong {font-weight:600}
.workspace-selection-main>.small,.workspace-selection-main>p {margin:.2rem 0}
.workspace-selection-actions {display:flex;gap:.25rem;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.workspace-selection-actions form,.workspace-selection-primary-actions form {margin:0}
.workspace-selection-actions .btn,.workspace-selection-primary-actions .btn,
.workspace-selection-add .btn,.workspace-quick-todo .btn,.my-work-attention .btn {
  min-height:44px;padding:.5rem .7rem
}
.workspace-selection-notes {margin:.45rem 0}
.workspace-selection-notes summary,.workspace-add-focus summary {min-height:44px;cursor:pointer}
.workspace-selection-notes form {margin-top:.5rem}
.workspace-selection-add {margin-top:1rem;border-top:1px solid var(--line);padding-top:.9rem}
.workspace-selection-add .input,.workspace-quick-todo .input {min-height:44px}
.workspace-quick-todo {align-items:end;margin-top:1rem}
.workspace-selection-complete {opacity:.77}
.workspace-selection-complete .workspace-selection-main>a {text-decoration:line-through;text-decoration-thickness:1px}
.workspace-selection-primary-actions {margin-top:.5rem}
.my-work-attention-groups {display:grid;gap:.65rem}
.my-work-attention-group {border:1px solid var(--line);border-radius:8px;padding:.2rem .8rem}
.my-work-attention-group summary {display:flex;align-items:center;justify-content:space-between;
  cursor:pointer;font-weight:650;min-height:44px}
.my-work-attention-group>.plain-list {margin:.5rem 0 0}
.my-work-attention-group li {border-top:1px solid var(--line);padding:.7rem 0}
.my-work-attention-group li small {display:block}
.my-work-attention-group>p {padding:.25rem .1rem .8rem}
.my-work-attention-entry>p {margin:.2rem 0 .5rem}
.my-work-reflect-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin-top:1rem}
.my-work-reflect-grid>.panel {min-width:0}
.my-work-reflect-stat {display:flex;align-items:center;gap:1rem;margin:.75rem 0}
.my-work-reflect-stat>strong {font-size:1.7rem;line-height:1.2;font-variant-numeric:tabular-nums}
.planner-week-day {display:grid;grid-template-columns:minmax(170px,1fr) 2fr;gap:1rem;
  padding:1rem 0;border-top:1px solid var(--line)}
.planner-week-day p {margin:.2rem 0}
@media(max-width:720px){
  .my-work-tabs {gap:.2rem}
  .my-work-tabs a {justify-content:center;text-align:center}
  .workspace-selection-row {grid-template-columns:2rem minmax(0,1fr);gap:.55rem}
  .workspace-selection-actions {grid-column:2;justify-content:flex-start}
  .my-work-reflect-grid {grid-template-columns:1fr}
  .planner-week-day {grid-template-columns:1fr;gap:.25rem}
}

.planner-activity-action{align-items:end;margin:.5rem 0;gap:.5rem}
.planner-activity-source{border-top:1px solid var(--line);padding:.85rem 0}
.planner-activity-source .small{margin:.35rem 0}
.planner-activity-source-controls{align-items:center;gap:.85rem}
.planner-activity-source-controls .check{display:inline-flex;align-items:center;min-height:44px;gap:.4rem;font-size:.85rem}
.planner-activity-source-controls input{min-width:20px;min-height:20px;accent-color:var(--accent)}
.planner-activity-source-controls .btn,.planner-activity-action .btn,.planner-activity-ledger-row .btn{min-height:44px}
.planner-activity-ledger-row{padding:.75rem 0;border-top:1px solid var(--line)}
.planner-activity-ledger-row form{align-items:center;min-height:44px}
@media(max-width:650px){.planner-activity-action .field{min-width:100%}.planner-activity-source-controls{gap:.4rem}}

/* Phase 6 Reflect: evidence-led weekly, estimation and activity comparisons. */
.reflect-scorecards,.reflect-estimate-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));gap:1rem;margin:1.1rem 0}
.reflect-scorecard,.reflect-estimate-fact{padding:.95rem 1rem;border:1px solid var(--line);background:var(--card,#fff);display:flex;flex-direction:column;gap:.35rem;min-width:0}
.reflect-scorecard>span,.reflect-estimate-fact>span{font-weight:600;line-height:1.4}
.reflect-scorecard>strong,.reflect-estimate-fact>strong{font-size:clamp(1.35rem,2.4vw,1.85rem);line-height:1.25;font-variant-numeric:tabular-nums;color:var(--text,#202b36)}
.reflect-scorecard small,.reflect-estimate-fact small{line-height:1.45;color:var(--muted)}
.reflect-evidence-note{margin:1rem 0;padding:.85rem 1rem;border-left:3px solid var(--border-strong,#526174);background:var(--surface,#f5f6f7);line-height:1.6}
.reflect-chart-legend{display:flex;gap:1.5rem;flex-wrap:wrap;margin:1rem 0;align-items:center}
.reflect-key{display:inline-flex;align-items:center;gap:.5rem;font-size:.9rem;font-weight:600}
.reflect-key::before{content:"";width:1.35rem;height:.65rem;display:inline-block;background:#364c67}
.reflect-key-actual::before{background:#28736c}
.reflect-bar-chart{display:grid;gap:1rem;margin:1.2rem 0 1.35rem}
.reflect-chart-row{display:grid;grid-template-columns:minmax(9rem,12rem) minmax(0,1fr) minmax(6.5rem,8rem);gap:1rem;align-items:center}
.reflect-chart-label{display:flex;flex-direction:column;gap:.2rem}
.reflect-chart-label span{font-size:.82rem;color:var(--muted)}
.reflect-chart-bar-group{display:grid;gap:.3rem;min-width:0}
.reflect-chart-track{width:100%;height:.8rem;background:#e5e9ee;overflow:hidden}
.reflect-chart-bar{display:block;height:100%;min-width:0}
.reflect-chart-planned{background:#364c67}
.reflect-chart-actual{background:#28736c}
.reflect-chart-values{display:grid;gap:.25rem;justify-items:end;line-height:1.1;font-variant-numeric:tabular-nums;font-size:.85rem}
.reflect-evidence-details{margin:1.2rem 0}
.reflect-evidence-details>summary{cursor:pointer;min-height:44px;padding:.7rem 0;font-weight:600}
.reflect-evidence-details>summary:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.reflect-observation{border-top:1px solid var(--line);display:flex;align-items:start;justify-content:space-between;gap:1rem;padding:1rem 0}
.reflect-observation h3{margin:0 0 .4rem;font-size:1rem}
.reflect-observation p{margin:.25rem 0}
.reflect-observation .btn{flex-shrink:0;min-height:44px}
.reflect-limitations{padding-left:1.35rem;display:grid;gap:.55rem}
@media(max-width:730px){
  .reflect-chart-row{grid-template-columns:minmax(0,1fr) auto;gap:.45rem}
  .reflect-chart-label{grid-column:1/-1}
  .reflect-chart-bar-group{grid-column:1}
  .reflect-chart-values{grid-column:2}
  .reflect-observation{flex-direction:column}
}

/* Phase 7B: original weekly intentions vs booked and observed evidence. */
.weekly-intention-week-picker{align-items:end;gap:.75rem;margin:1rem 0}
.weekly-intention-week-picker .field{min-width:12rem}
.weekly-intention-week-picker input{min-height:44px}
.weekly-intention-revision-summary{gap:.65rem;margin:.85rem 0}
.weekly-intention-revision-summary span{padding:.45rem .65rem;border:1px solid var(--line)}
.weekly-intention-priorities{padding-left:1.3rem;display:grid;gap:.5rem;margin:1rem 0 1.25rem}
.weekly-intention-outcomes{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr));gap:1rem;align-items:start;margin:1rem 0}
.weekly-intention-outcomes h4{margin:.2rem 0 .6rem}
.weekly-intention-outcomes li{margin:.35rem 0}
.weekly-intention-outcome-list{display:grid;gap:.45rem}
.weekly-intention-outcome-list li{line-height:1.5}
.weekly-intention-outcome-list li span{margin-left:.5rem}
.weekly-intention-comparison{min-width:42rem}
.weekly-intention-revision{border-top:1px solid var(--line);padding:.75rem 0}
.weekly-intention-revision>span{margin-left:.5rem}
.weekly-intention-empty{border-left:3px solid var(--line);background:var(--surface,#f6f7f8);padding:.85rem 1rem;line-height:1.5}
.weekly-intention-capture{border-top:1px solid var(--line);margin-top:1.25rem;padding-top:1rem}
.weekly-intention-capture>summary{cursor:pointer;min-height:44px;padding:.7rem 0;font-weight:700}
.weekly-intention-capture summary:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.weekly-intention-capture .field{display:flex;flex-direction:column;gap:.45rem}
.weekly-intention-allocations{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,11rem),1fr));gap:.9rem;margin:.65rem 0 1rem}
.weekly-intention-allocations input{min-height:44px}
.weekly-intention-checkboxes{display:grid;gap:.25rem;max-height:15rem;overflow-y:auto;padding:.35rem}
.weekly-intention-checkboxes label{display:flex;align-items:center;gap:.55rem;min-height:44px;padding:.4rem .3rem;cursor:pointer}
.weekly-intention-checkboxes input{width:19px;height:19px;flex:none;accent-color:var(--accent)}
.weekly-intention-capture #weekly-intention-status{align-self:center;line-height:1.5}
@media(max-width:650px){.weekly-intention-week-picker{align-items:stretch}.weekly-intention-week-picker .field{flex:1 1 100%}.weekly-intention-revision>span{display:block;margin-left:0}}
/* Review is outcome-first; keep independent evidence available on demand. */
.review-learning-graph{margin:1.25rem 0}
.review-graph-legend{display:flex;gap:1rem;flex-wrap:wrap;margin:.7rem 0}
.learning-legend{display:inline-flex;align-items:center;gap:.4rem}
.learning-legend::before{content:"";width:.75rem;height:.75rem;display:inline-block;background:#365b73}
.learning-legend.manual::before{background:#8f6f3c}
.learning-legend.target::before{height:0;border-top:2px dashed currentColor;background:transparent}
.review-learning-chart-scroll{overflow-x:auto;padding:.5rem 0 1rem;max-width:100%}
.review-learning-chart{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(84px,1fr);gap:.7rem;min-width:max-content}
.review-learning-bucket{display:flex;flex-direction:column;gap:.25rem;text-align:center;min-width:84px;max-width:130px}
.review-learning-bars{height:175px;display:flex;align-items:flex-end;justify-content:center;gap:5px;position:relative;border-bottom:1px solid currentColor;padding:0 .25rem}
.review-learning-practice,.review-learning-manual{display:block;width:25px;min-height:2px;background:#365b73;border-radius:3px 3px 0 0;position:relative;z-index:1}
.review-learning-manual{background:#8f6f3c}
.review-learning-target{position:absolute;left:0;right:0;border-top:2px dashed currentColor;z-index:2;pointer-events:none}
.review-learning-label{font-weight:650;font-size:.8rem}
.review-capacity-scenario{margin:1.3rem 0;padding:1rem;border:1px solid var(--line);border-radius:.45rem}
.review-capacity-scenario .field{display:flex;flex-direction:column;gap:.35rem}
.review-capacity-scenario-form input{width:8rem;min-height:44px}
.review-capacity-scenario .btn{min-height:44px}
.review-capacity-progress{width:100%;height:.7rem;background:#dde2e5;border-radius:3px;overflow:hidden;margin-top:1rem}
.review-capacity-progress span{display:block;height:100%;background:#365b73}
.my-work-weekly-decision{margin:1.15rem 0}
.my-work-weekly-decision h3{margin:0 0 .25rem}
.my-work-weekly-decision-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));gap:1rem;margin-top:1rem}
.my-work-weekly-decision-grid>div{border-top:1px solid var(--line);padding-top:.75rem;min-width:0}
.my-work-weekly-decision-grid p{margin:.45rem 0 0;white-space:pre-line}
.review-evidence-details>summary{cursor:pointer;min-height:44px;padding:.65rem 0}
@media(max-width:600px){.review-capacity-scenario-form{width:100%;align-items:end}.review-learning-bucket{min-width:76px}}
/* Yearly goals and optional, source-backed measurement at creation. */
.level-pill.level-yearly{border:1px solid #45677d;background:transparent;color:inherit}
.goal-creation-tracking{border-top:1px solid var(--line);padding:.65rem 0;margin:.5rem 0}
.goal-creation-tracking>summary{cursor:pointer;font-weight:700;min-height:44px;padding:.55rem 0}
.goal-creation-tracking-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));gap:.75rem;padding:.75rem 0}
.goal-creation-tracking-fields .field{display:flex;flex-direction:column;gap:.35rem}
.goal-creation-tracking-fields .input{min-height:44px;width:100%}
/* Calendar source and work-kind tags show provenance without taking focus. */
.cal-source-tag{display:inline-flex;align-items:center;gap:.35rem;border:1px solid var(--tag-colour, #56767c);color:inherit;background:transparent;white-space:nowrap;font-weight:600;font-size:.75rem;padding:.15rem .4rem;vertical-align:middle}
.planner-inbox-prompt h2{font-size:1.05rem;margin:0 0 .35rem}
.planner-inbox-prompt .btn{min-height:44px}

/* Accessible, source-specific insight charts; details retain original tables. */
.review-trend-graph{margin:1.25rem 0 1.7rem}
.review-trend-graph h3{margin:.5rem 0}
.review-habit-chart{display:grid;gap:.7rem;margin:1rem 0}
.review-habit-row{display:grid;grid-template-columns:minmax(100px,1fr) minmax(110px,3fr) 4.25rem minmax(110px,1.5fr);align-items:center;gap:.75rem}
.review-chart-label{font-size:.83rem;font-weight:650}
.review-chart-track{position:relative;display:block;width:100%;height:14px;border:1px solid #bec7ce;background:#e6eaed;border-radius:2px;overflow:hidden}
.review-chart-track>span,.review-chart-track>i{display:block;height:100%;min-width:0;max-width:100%;border-radius:1px}
.review-chart-habit-fill{background:#37675a}
.review-chart-plan-fill{background:#365b73}
.review-chart-observed-fill{background:#946b30}
.review-chart-value{font-weight:700;font-variant-numeric:tabular-nums}
.review-chart-detail{font-size:.76rem}
.review-chart-legend{display:flex;gap:1rem;flex-wrap:wrap;margin:.65rem 0 1rem}
.review-chart-key{display:inline-flex;align-items:center;gap:.35rem}
.review-chart-key::before{content:"";width:.85rem;height:.85rem;background:#365b73;display:block}
.review-chart-key.observed::before{background:#946b30}
.review-project-comparisons{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,21rem),1fr));gap:1rem}
.review-project-comparison{border-top:1px solid var(--line);padding:.65rem 0}
.review-project-comparison p{margin:.35rem 0}
.review-project-chart-line{display:grid;grid-template-columns:5.2rem minmax(90px,1fr) 5.6rem;gap:.6rem;align-items:center;margin:.55rem 0}
.review-project-chart-line .small:last-child{text-align:right}
.review-evidence-details>summary{min-height:44px;cursor:pointer;padding:.55rem 0}
@media(max-width:620px){.review-habit-row{grid-template-columns:6.5rem minmax(90px,1fr) 3.5rem;gap:.4rem}.review-habit-row .review-chart-detail{grid-column:2/4}.review-project-chart-line{grid-template-columns:5rem minmax(80px,1fr) 5rem}}
/* Weekly intention proposals stay opt-in and visible before committing. */
.weekly-intention-import{margin:.7rem 0 1rem;padding:.85rem}
.weekly-intention-import h3{margin:0 0 .4rem;font-size:1rem}
.weekly-intention-import .btn{min-height:44px}
.event-prep-edit [data-prep-date-preview] output,.event-prep-add output{display:block;font-weight:600;padding-top:.25rem}
.event-prep-checklist .event-prep-step-content .event-prep-warning{font-weight:700}
/* Review drill-down navigation and visible linked project identity. */
.review-drilldown-breadcrumb{display:flex;gap:.55rem;align-items:center;margin:.8rem 0 .3rem;font-size:.86rem}
.review-drilldown-heading{margin:.2rem 0 1rem}
.review-drilldown-heading h2{font-size:1.2rem;margin:0}
.review-next-action-preview{padding-top:.65rem;border-top:1px solid var(--line);margin-top:.75rem}
.review-next-action-preview>summary{cursor:pointer;font-weight:700;min-height:44px;padding:.65rem 0}
.review-next-action-preview ul{margin:.5rem 0 1rem;padding-left:1.35rem}
.review-next-action-preview li{padding:.3rem 0}
.review-next-action-preview li .muted{display:block}
.cal-project-tag{display:inline-flex;align-items:center;gap:.4rem;min-height:28px;padding:.15rem .5rem;border-left:4px solid var(--project-colour,#596b78);border-radius:3px;background:var(--surface,#f3f4f6);color:inherit;text-decoration:none;font-size:.79rem;font-weight:700}
.cal-project-tag:hover{text-decoration:underline}
.cal-personal-tag{border-left-color:#606c77}

/* Inbox (Inbox board): one at a time, a capture list beside a review pane. */
.ib { max-width: 1610px; margin: 0 auto; padding: 10px 0 40px; }
.ib-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.ib-title { margin: 0; font: 800 32px/1.1 var(--display); letter-spacing: -0.04em; }
.ib-sub { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.ib-tools { display: flex; align-items: center; gap: 6px; }
.seg-switch { display: inline-flex; gap: 2px; background: #E6ECF3; padding: 3px; border-radius: 10px; }
.seg-switch a { padding: 7px 14px; border-radius: 8px; font: 600 13px var(--body); color: var(--muted); text-decoration: none; }
.seg-switch a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(21, 37, 61, .08); }
.ib-panes { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.ib-list { flex: 1 1 380px; max-width: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; }
.ib-item { display: flex; gap: 12px; padding: 14px 16px; border-top: 1px solid #EDF1F6; color: var(--ink); text-decoration: none; }
.ib-item:first-child { border-top: 0; }
.ib-item:hover { background: #F7F9FC; color: var(--ink); }
.ib-item.on { background: #F2F7FF; box-shadow: inset 3px 0 0 var(--accent); }
.ib-item.on .ib-snip { font-weight: 600; }
.ib-item.on .ib-src { background: var(--accent-soft); color: var(--accent-strong); }
.ib-src { width: 32px; height: 32px; border-radius: 9px; background: #EDF2F8; color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.ib-src svg { width: 18px; height: 18px; }
.ib-item-body { min-width: 0; display: block; }
.ib-snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.ib-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.ib-meta .dot { width: 8px; height: 8px; border-radius: 50%; background: #647890; flex-shrink: 0; }
.ib-dot-todo, .ib-dot-item { background: var(--accent-strong) !important; }
.ib-dot-idea, .ib-dot-writing { background: #B7791F !important; }
.ib-dot-card { background: #1F7A3A !important; }
.ib-keys { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 12px 16px; border-top: 1px solid #EDF1F6; font-size: 12px; color: var(--muted); }
.ib kbd { font: 11px var(--body); border: 1px solid #D5DEE8; border-radius: 5px; padding: 1px 5px; background: var(--surface); color: var(--muted); }
.ib-review { flex: 999 1 560px; min-width: 0; padding: 20px 24px 0; border-radius: 16px; overflow: hidden; }
.ib-review-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.ib-review-top a { font-weight: 600; }
.ib-quote { margin: 12px 0 0; border-left: 3px solid #D5DEE8; background: none; border-radius: 0; padding: 6px 0 6px 14px; font-size: 17px; line-height: 1.6; max-height: 18rem; }
.ib-audio { width: 100%; margin-top: 10px; }
.ib-label { margin: 18px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ib-types { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.ib-type { position: relative; display: inline-flex; }
.ib-type input { position: absolute; opacity: 0; pointer-events: none; }
.ib-type span, a.ib-type { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border-radius: 10px; border: 1px solid #D5DEE8; background: var(--surface); color: #33465E; font: 600 14px var(--body); cursor: pointer; text-decoration: none; }
.ib-type input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.ib-type input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
a.ib-type { color: var(--muted); border-style: dashed; }
.ib-form { display: flex; flex-direction: column; gap: 12px; }
.ib-form .field > span { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ib-grid [hidden] { display: none; }
.ib-from { font-size: 11px; font-weight: 700; color: #7A4F00; background: #FFF0CC; border-radius: 5px; padding: 1px 6px; font-style: normal; }
.ib-why { margin: 0; font-size: 13px; color: var(--muted); }
.ib-several { margin: 18px 0 0; padding: 12px 14px; border: 1px solid var(--guess-line); background: var(--guess-bg); border-radius: 12px; color: var(--guess-ink); }
.ib-review .inbox-card { margin-top: 16px; border: 0; padding: 0; box-shadow: none; background: none; }
.ib-review .inbox-card > .row:last-child { display: none; }
.ib-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px -24px 0; padding: 16px 24px; background: #F7F9FC; border-top: 1px solid var(--line); }
.ib-foot form { margin: 0; }
.ib-foot .btn.icon { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 11px; border: 1px solid #CBD6E3; background: var(--surface); color: var(--muted); }
.ib-foot .ib-del { color: #B42318; border-color: #F5C2BC; }
.ib-next { font-size: 13px; color: var(--muted); margin-left: 6px; }
.ib-save { min-height: 44px; padding: 0 18px; border-radius: 11px; }
.ib-foot > .ib-save:not(.ib-more + .ib-save) { margin-left: auto; }
.ib-save kbd { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.ib-fold, .ib-history, .ib-empty { margin-top: 18px; }
.ib-fold > summary { cursor: pointer; }
.ib-quick { display: flex; gap: 8px; margin-top: 12px; }
.ib-quick .input { flex: 1; }
.ib-sub-fold { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.ib-sub-fold > summary { cursor: pointer; }
@media (max-width: 760px) {
  .ib-list { max-width: none; position: static; max-height: 40vh; }
  .ib-grid { grid-template-columns: 1fr 1fr; }
  .ib-review { padding: 16px 16px 0; }
  .ib-foot { margin: 18px -16px 0; padding: 14px 16px; }
}
html[data-theme="dark"] .ib-item.on { background: rgba(36, 92, 196, .16); }
html[data-theme="dark"] .ib-item:hover, html[data-theme="dark"] .ib-foot { background: rgba(255, 255, 255, .03); }
html[data-theme="dark"] .ib-src, html[data-theme="dark"] .seg-switch { background: rgba(255, 255, 255, .06); }
/* Smart capture: the words the Hub understood, coloured by what they became (PopCapture board). */
mark.hl { border-radius: 5px; padding: 1px 3px; color: inherit; background: none; }
.hl-type { background: #FFF6E0 !important; box-shadow: inset 0 -2px 0 #B7791F; }
.hl-proj { background: #E9F1FF !important; box-shadow: inset 0 -2px 0 #245CC4; }
.hl-due { background: #FFF1E2 !important; box-shadow: inset 0 -2px 0 #C2410C; }
.hl-est { background: #F0ECFF !important; box-shadow: inset 0 -2px 0 #6D4FC2; }
.hl-prio { background: #FEECEC !important; box-shadow: inset 0 -2px 0 #B42318; }
.hl-imp { background: #E7F5EC !important; box-shadow: inset 0 -2px 0 #1F7A3A; }
.hl-legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.ib-event-hint { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); font-size: 14px; }
.ib-event-hint svg { width: 18px; height: 18px; flex-shrink: 0; }
.ib-mins { display: flex; align-items: center; gap: 6px; }
.ib-mins .input { flex: 1; min-width: 0; }
.ib-mins > span { font-size: 13px; color: var(--muted); }
.ib-impact { border: 0; padding: 0; margin: 0; min-width: 0; }
.ib-impact legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0; margin-bottom: 5px; }
.ib-impact [role="radiogroup"] { display: flex; gap: 5px; }
.ib-impact label { position: relative; }
.ib-impact input { position: absolute; opacity: 0; }
.ib-impact span span, .ib-impact label > span { display: grid; place-items: center; width: 38px; height: 40px; border-radius: 9px; border: 1px solid #D5DEE8; background: var(--surface); font: 600 14px var(--body); color: #33465E; cursor: pointer; }
.ib-impact input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.ib-impact input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
html[data-theme="dark"] mark.hl { background: rgba(255, 255, 255, .08) !important; }
/* Plan it: a free slot inside your hours, before the deadline (PopCapture board). */
.ib-plan { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #F7F9FC; }
.ib-plan[hidden] { display: none; }
.ib-plan > svg { width: 20px; height: 20px; color: #B7791F; flex-shrink: 0; }
.ib-plan-text { flex: 1; display: grid; gap: 2px; font-size: 14px; }
.ib-plan-text span { font-size: 13px; color: var(--muted); }
.ib-plan[data-empty] > svg { color: var(--muted); }
.ib-plan[data-empty] strong { color: var(--muted); font-weight: 600; }
.ib-plan-tick { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.ib-plan-tick input { width: 18px; height: 18px; accent-color: var(--accent); }
html[data-theme="dark"] .ib-plan { background: rgba(255, 255, 255, .03); }

/* Inbox board: the review pane's type-specific pieces (fields follow the popup's types). */
.ib-form [hidden] { display: none !important; }
.ib-form > [data-ib-create] { display: flex; flex-direction: column; gap: 12px; }
.ib-form .ib-types { margin-bottom: 4px; }
.ib-span2 { grid-column: span 2; }
.ib-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ib-seg { display: inline-flex; gap: 2px; background: #EDF2F8; padding: 3px; border-radius: 10px; width: max-content; max-width: 100%; }
.ib-seg label { position: relative; }
.ib-seg input { position: absolute; opacity: 0; pointer-events: none; }
.ib-seg span { display: block; padding: 7px 14px; border-radius: 8px; font: 600 13px var(--body); color: #15253D; cursor: pointer; }
.ib-seg input:checked + span { background: var(--surface); box-shadow: 0 1px 2px rgba(21, 37, 61, .08); }
.ib-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ib-append { display: flex; flex-direction: column; gap: 8px; }
.ib-hint { margin: 0; font-size: 13px; color: var(--muted); }
.ib-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ib-preview-h { margin: 0; padding: 8px 14px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: #F7F9FC; border-bottom: 1px solid var(--line); }
.ib-preview-before { padding: 10px 14px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.ib-preview-before strong { display: block; color: var(--muted); font-weight: 600; }
.ib-preview-add { display: grid; gap: 4px; padding: 8px 14px 12px; background: #F2FBF4; border-top: 1px dashed #B9DEC4; }
.ib-preview-add > span { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #1F7A3A; }
.ib-preview-add .input { background: transparent; border-color: transparent; padding: 0; min-height: 0; font-size: 14px; line-height: 1.6; resize: vertical; }
.ib-preview-add .input:focus { border-color: #B9DEC4; background: var(--surface); padding: 4px 8px; }
.ib-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #F7F9FC; }
.ib-box-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.ib-box-head span { color: var(--muted); font-size: 13px; }
.ib-types-sm { margin: 8px 0 0 !important; }
.ib-types-sm .ib-type span { min-height: 32px; font-size: 13px; }
.ib-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ib-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.ib-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.ib-link > svg { color: var(--accent); }
.ib-link .ib-plan-text a { font-weight: 600; }
.ib-others { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #EDF1F6; }
.ib-others > span { font-size: 13px; color: var(--muted); margin-right: 2px; }
.ib-others .btn { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-act-form { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.ib-more { margin-left: auto; font-size: 13px; font-weight: 600; }
.ib-foot .ib-more + .ib-save { margin-left: 0; }
.ib-dot-bug, .ib-dot-story { background: var(--accent-strong) !important; }
.ib-dot-content { background: #B7791F !important; }
.ib-empty { text-align: center; padding: 26px; }
.ib-empty h2 { margin: 10px 0 4px; font: 700 18px var(--display); }
.ib-empty-tick { width: 48px; height: 48px; border-radius: 24px; background: #E6F4EA; color: #1F7A3A; display: inline-grid; place-items: center; }
.ib-empty-tick svg { width: 24px; height: 24px; }
html[data-theme="dark"] .ib-box, html[data-theme="dark"] .ib-preview-h { background: rgba(255, 255, 255, .03); }
html[data-theme="dark"] .ib-seg { background: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .ib-seg span { color: var(--ink); }
html[data-theme="dark"] .ib-preview-add { background: rgba(31, 122, 58, .12); }
@media (max-width: 720px) { .ib-span2 { grid-column: auto; } .ib-grid-2 { grid-template-columns: 1fr; } }

/* INB-8 / CAP-2: the Capture popup, matching the PopCapture board */
.quick-capture-dialog.qc { width: min(640px, 100%); padding: 18px 20px 16px; border-radius: 18px; background: var(--panel, #fff); }
.qc-smart { display: grid; gap: 12px; margin: 0; }
.qc-head { display: flex; align-items: center; justify-content: space-between; }
.qc-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.qc-box { position: relative; border: 1px solid var(--line, #DCE3EC); border-radius: 14px; background: var(--panel, #fff); }
.qc-box:focus-within { border-color: var(--accent, #245CC4); box-shadow: 0 0 0 3px rgba(36, 92, 196, .14); }
.qc-box textarea, .qc-mirror { font: inherit; font-size: 17px; line-height: 1.55; padding: 12px 14px; margin: 0; border: 0; width: 100%;
  min-height: 92px; white-space: pre-wrap; word-wrap: break-word; letter-spacing: normal; box-sizing: border-box; }
.qc-box textarea { position: relative; z-index: 1; background: transparent; resize: vertical; outline: none; color: inherit; caret-color: var(--ink, #1B1931); display: block; }
.qc-mirror { position: absolute; inset: 0; color: transparent; overflow: hidden; pointer-events: none; }
.qc-mirror mark.hl { color: transparent; padding: 0; border-radius: 4px; }
.qc-tools { display: flex; align-items: center; gap: 4px; }
.qc-legend { margin-left: auto; display: flex; gap: 6px; font-size: 11.5px; color: var(--muted, #5A6B80); flex-wrap: wrap; }
.qc-legend mark.hl { padding: 1px 6px; }
.qc-section { display: grid; gap: 12px; border-top: 1px solid var(--line, #E3E9F0); padding-top: 12px; }
.qc-section[hidden] { display: none; }
.qc-label { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #5A6B80); }
.qc-types { display: flex; flex-wrap: wrap; gap: 6px; }
.qc-type input { position: absolute; opacity: 0; pointer-events: none; }
.qc-type span { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line, #DCE3EC);
  font-size: 14px; font-weight: 600; cursor: pointer; background: var(--panel, #fff); transition: background .15s, color .15s, border-color .15s; }
.qc-type input:checked + span { background: var(--ink, #1B1931); border-color: var(--ink, #1B1931); color: #fff; }
.qc-type input:focus-visible + span { outline: 2px solid var(--accent, #245CC4); outline-offset: 2px; }
.qc-title .input { font-weight: 600; }
.qc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.qc-grid .field[hidden], .qc .ib-plan[hidden] { display: none !important; }
.qc-grid .field > span:first-child, .qc-impact legend { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.qc-impact { border: 0; padding: 0; margin: 0; min-width: 0; }
.qc-impact > span { display: flex; gap: 4px; margin-top: 4px; }
.qc-impact label input { position: absolute; opacity: 0; }
.qc-impact label span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line, #DCE3EC); font-weight: 700; cursor: pointer; }
.qc-impact label input:checked + span { background: var(--accent, #245CC4); border-color: var(--accent, #245CC4); color: #fff; }
.qc-plan { background: #FFF8EB; border-color: #F3D9A4; }
.qc-status { margin: 0; color: var(--muted, #5A6B80); min-height: 1em; }
.qc-status:empty { display: none; }
.qc-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qc-foot > span { flex: 1; min-width: 200px; }
.qc-foot kbd { font: inherit; font-size: 12px; opacity: .75; margin-left: 4px; }
html[data-theme="dark"] .qc-plan { background: rgba(183, 121, 31, .12); border-color: rgba(183, 121, 31, .35); }
@media (max-width: 560px) { .qc-grid { grid-template-columns: 1fr; } .quick-capture-dialog.qc { padding: 14px; } }
/* The popup's mic while recording (INB-20: dictation lives in the popup). */
.qc-mic.is-recording { background: #FDECEA; color: #B42318; box-shadow: inset 0 0 0 1.5px #B42318; }
@media (prefers-reduced-motion: no-preference) { .qc-mic.is-recording svg { animation: qc-pulse 1.2s ease-in-out infinite; } }
@keyframes qc-pulse { 50% { opacity: .45; } }

/* Today: one cohesive, accessible workspace.
   This is the sole source for Today-specific layout/visual treatments.
   It follows Hub's existing typography and theme variables. */
.today-home {
  --today-surface:var(--card,#ffffff);
  --today-soft:var(--sunk,#f5f7fa);
  --today-border:var(--line,#d8e0e8);
  --today-text:var(--ink,#192b3a);
  --today-muted:var(--muted,#546476);
  --today-action:var(--accent,#265e7d);
  --today-focus:var(--accent,#265e7d);
  --today-red:#ae2438;
  --today-amber:#965c10;
  --today-blue:#275d93;
  --today-teal:#226a66;
  max-width:2180px;
  width:100%;
  margin:0 auto;
  color:var(--today-text);
  display:grid;
  gap:10px;
  align-content:start;
}
.today-home *, .today-home *::before, .today-home *::after{box-sizing:border-box}
.today-home [hidden]{display:none!important}
.today-home .panel {
  background:var(--today-surface);
  border:1px solid var(--today-border);
  border-radius:12px;
  box-shadow:none;
  margin:0;
  min-width:0;
  padding:13px 15px;
}
.today-home .eyebrow {
  display:block;
  color:var(--today-muted);
  text-transform:uppercase;
  letter-spacing:.075em;
  font-size:.69rem;
  font-weight:750;
  line-height:1.5;
}
.today-home a {text-underline-offset:3px}
.today-home a:hover{text-decoration:underline}
.today-home button,.today-home input,.today-home select{font:inherit}
.today-home .btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.38rem;
  min-height:42px;
  padding:.48rem .78rem;
  border-radius:7px;
  font-size:.84rem;
  font-weight:650;
  line-height:1.2;
  text-decoration:none;
  white-space:nowrap;
  cursor:pointer;
  transition:background-color .12s ease,border-color .12s ease;
}
.today-home .btn.primary{background:var(--today-action);border-color:var(--today-action);color:#fff}
.today-home .btn.primary:hover{filter:brightness(.92);text-decoration:none}
.today-home .btn.ghost{border-color:transparent;background:transparent;color:var(--today-text)}
.today-home .btn.ghost:hover{background:var(--today-soft)}
.today-home .btn:focus-visible,.today-home a:focus-visible,
.today-home summary:focus-visible,.today-home button:focus-visible,
.today-home input:focus-visible,.today-home select:focus-visible {
  outline:3px solid var(--today-focus);
  outline-offset:2px;
}
.today-home input.input,.today-home select.input {
  min-height:44px;min-width:0;border-radius:7px;
  border-color:var(--today-border);background:var(--today-surface);color:var(--today-text);
}
.today-home .small,.today-home .muted{color:var(--today-muted)}
.today-home-heading {
  display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:8px 14px;
  margin:0;min-width:0;
}
.today-home-heading>div:first-child{min-width:0}
.today-home-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.today-home-header-actions>.btn{border:1px solid var(--today-border);background:var(--today-surface)}
.today-home-header-actions .today-home-preferences>summary{border:1px solid var(--today-border);background:var(--today-surface)}

.today-home-heading .eyebrow{font-size:.77rem;letter-spacing:.045em;text-transform:none}
.today-home-heading h1,.today-home-heading .today-workspace-title {
  font-size:clamp(1.8rem,2.7vw,2.3rem);font-weight:780;
  letter-spacing:-.045em;margin:.08rem 0 .18rem;line-height:1.15;color:var(--today-text);
}
.today-home-heading p.small{font-size:.93rem;margin:.1rem 0 0}
.today-home-preferences{position:relative;align-self:center;z-index:15}
.today-home-preferences>summary{list-style:none;cursor:pointer}
.today-home-preferences>summary::-webkit-details-marker{display:none}
.today-home-preferences[open]>.today-home-preference-form{
  position:absolute;right:0;top:calc(100% + 8px);z-index:25;
  width:min(330px,calc(100vw - 40px));
  display:grid;gap:10px;
  padding:16px;border:1px solid var(--today-border);
  border-radius:10px;background:var(--today-surface);
  box-shadow:0 12px 30px rgba(21,40,57,.14);
}
.today-home-preference-form label{font-weight:650;font-size:.85rem}

/* Daily Direction: one card, disclosure heading and compact segmented tabs. */
.today-home .today-decision-hub{padding:0;overflow:visible}
.today-decision-shell,.today-decision-content{min-width:0}
.today-decision-content{padding:0}
.today-decision-header{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;flex-wrap:wrap;
  padding:10px 15px;border-bottom:1px solid var(--today-border);
}
.today-decision-heading{margin:0;flex:1 1 240px;font-size:inherit;min-width:0}
.today-decision-heading-toggle {
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  text-align:left;width:100%;min-height:44px;
  padding:0;background:none;border:0;color:inherit;cursor:pointer;
}
.today-decision-heading-copy{display:grid;gap:3px}
.today-decision-heading-title{
  font-size:1.22rem;line-height:1.2;letter-spacing:-.022em;
  font-weight:760;color:var(--today-text);
}
.today-decision-chevron{width:21px;height:21px;flex:none;color:var(--today-muted);transition:transform .15s ease}
.today-decision-heading-toggle[aria-expanded="false"] .today-decision-chevron{transform:rotate(-90deg)}
.today-decision-collapsed-summary{font-size:.82rem;line-height:1.35;font-weight:550}
.today-decision-main[hidden],.today-decision-collapsed-summary[hidden]{display:none!important}
.today-decision-hub.is-collapsed .today-decision-header{border-bottom:0}
.today-decision-tabs{
  display:flex;gap:2px;align-items:stretch;
  padding:2px 15px 0;margin:0;border-bottom:1px solid var(--today-border);
  background:var(--today-surface);
}
.today-decision-tab{
  appearance:none;background:transparent;color:var(--today-muted);
  border:0;border-bottom:3px solid transparent;
  border-radius:6px 6px 0 0;
  display:flex;gap:9px;align-items:center;justify-content:center;
  cursor:pointer;font:inherit;font-size:.87rem;font-weight:675;
  min-height:44px;padding:6px 11px;white-space:nowrap;
}
.today-decision-tab:hover{background:var(--today-soft);color:var(--today-text)}
.today-decision-tab[aria-selected="true"]{
  color:var(--today-text);
  border-bottom-color:var(--today-focus);
  background:var(--today-soft);
}
.today-decision-tab .count {
  display:inline-grid;place-items:center;min-width:22px;
  padding:2px 6px;border-radius:5px;background:var(--today-soft);
  border:1px solid var(--today-border);font-size:.73rem;
  color:var(--today-muted);font-variant-numeric:tabular-nums;font-weight:750;
}
.today-decision-tab[aria-selected="true"] .count{background:var(--today-surface);color:var(--today-text)}
.today-tab-short{display:none}
.today-decision-panel{padding:10px 15px 12px;min-width:0}
.today-decision-panel[hidden]{display:none!important}
.today-decision-panel .today-panel-body{display:block;min-width:0}
.today-decision-panel .today-focus-heading{
  min-height:30px;margin:0 0 5px;gap:12px;font-size:.85rem
}
.today-decision-panel .today-focus-heading .small{color:var(--today-muted)}
.today-decision-panel .workspace-selection-list {
  display:grid;gap:0;list-style:none;margin:0;padding:0;
  border-top:1px solid var(--today-border);
}
.today-decision-panel .workspace-selection-row{
  display:grid;grid-template-columns:28px minmax(0,1fr) auto;
  align-items:start;gap:8px;min-width:0;
  padding:9px 0;border-bottom:1px solid var(--today-border);
  background:transparent;
}
.today-decision-panel .workspace-selection-index {
  display:grid;place-items:center;min-width:28px;height:28px;
  font-size:.79rem;font-weight:750;border:1px solid var(--today-border);
  border-radius:7px;background:var(--today-soft);color:var(--today-muted);
}
.today-decision-panel .workspace-selection-main{min-width:0}
.today-decision-panel .workspace-selection-main>a strong,
.today-decision-panel .workspace-selection-main>strong{
  color:var(--today-text);font-size:.96rem;font-weight:750;line-height:1.45;
}
.today-decision-panel .workspace-selection-complete .workspace-selection-main>a strong{
  text-decoration:line-through;text-decoration-color:var(--today-muted);
}
.today-decision-panel .workspace-selection-primary-actions {
  display:flex;align-items:center;flex-wrap:wrap;gap:5px;
  margin:7px 0 0;padding:0;
}
.today-decision-panel .workspace-selection-primary-actions form{margin:0}
.today-decision-panel .workspace-selection-primary-actions .btn,
.today-decision-panel .workspace-selection-primary-actions button{min-height:38px}
.today-row-more{position:relative;align-self:start;z-index:3}
.today-row-more>summary{
  display:inline-flex;align-items:center;justify-content:center;
  list-style:none;cursor:pointer;min-height:40px;
}
.today-row-more>summary::-webkit-details-marker{display:none}
.today-row-more[open]>.workspace-selection-actions{
  position:absolute;z-index:10;right:0;top:calc(100% + 5px);
  display:grid;gap:3px;min-width:170px;padding:7px;
  border:1px solid var(--today-border);border-radius:9px;
  background:var(--today-surface);box-shadow:0 10px 28px rgba(15,31,49,.18)
}
.today-row-more .workspace-selection-actions>form{margin:0}
.today-row-more .workspace-selection-actions .btn{
  width:100%;justify-content:flex-start;min-height:40px;text-align:left;
}
.today-decision-panel .workspace-selection-notes{margin:5px 0 0}
.today-decision-panel .workspace-selection-notes>summary{
  font-size:.81rem;color:var(--today-muted);cursor:pointer;min-height:32px
}
.today-decision-panel .workspace-add-focus,.today-decision-panel .today-compact-editor{
  display:inline-block;margin:12px 8px 4px 0;vertical-align:top;
}
.today-decision-panel .workspace-add-focus>summary,
.today-decision-panel .today-compact-editor>summary{
  display:inline-flex;align-items:center;cursor:pointer;min-height:42px;
  list-style:none;
}
.today-decision-panel .workspace-add-focus>summary::-webkit-details-marker,
.today-decision-panel .today-compact-editor>summary::-webkit-details-marker{display:none}
.today-decision-panel .workspace-add-focus[open],
.today-decision-panel .today-compact-editor[open]{display:block;margin:10px 0}
.today-decision-panel .workspace-selection-add,
.today-decision-panel .workspace-quick-todo{
  margin:10px 0 0;padding:14px;gap:12px;
  border:1px solid var(--today-border);background:var(--today-soft);
  border-radius:8px;
}
.today-decision-panel .workspace-selection-add .field{min-width:0}
.today-decision-panel .workspace-selection-add .input,
.today-decision-panel .workspace-quick-todo .input{width:100%;max-width:100%}
.today-decision-panel .today-recommended-focus{
  margin:10px -15px -12px;padding:10px 15px 11px;
  border-top:1px solid var(--today-border);background:var(--today-soft);
}
.today-recommended-focus h3{
  margin:0;color:var(--today-text);font-size:.94rem;font-weight:750;
}
.today-recommended-focus>.row{gap:12px;margin:0 0 8px}
.today-recommendations{list-style:none;margin:0;padding:0}
.today-recommendation{
  display:grid;grid-template-columns:minmax(0,1fr) auto;
  align-items:center;gap:14px;
  padding:7px 0;margin:0;border-top:1px solid var(--today-border);
}
.today-recommendation>div{min-width:0}
.today-recommendation a strong{color:var(--today-text);font-size:.89rem}
.today-recommendation p{margin:4px 0 0;line-height:1.35;font-size:.79rem}
.today-recommendation form{margin:0}
.today-recommendation .btn{min-height:38px}
.today-rec-more{margin:8px 0 0}
.today-rec-more>summary{cursor:pointer;list-style:none;min-height:40px}
.today-rec-more>summary::-webkit-details-marker{display:none}
.today-decision-panel .top3{margin:8px 0 0;list-style:none;padding:0}
.today-decision-panel .top3 li{
  display:flex;align-items:center;gap:11px;
  padding:12px 0;margin:0;min-height:52px;
  border-top:1px solid var(--today-border);
}
.today-decision-panel .top3 li .grow{min-width:0}
.today-decision-panel .top3 .n{
  display:grid;place-items:center;min-width:34px;min-height:34px;
  border:1px solid var(--today-border);border-radius:8px;
  background:var(--today-surface);color:var(--today-text);cursor:pointer;
}
.today-goal-detail{display:grid;gap:4px}
.today-goal-summary{margin:0 0 9px}

/* Source-backed metadata, quiet by default, strong only for urgent facts. */
.today-record-facts{display:flex;flex-wrap:wrap;align-items:center;gap:5px 7px;margin:6px 0 0;min-width:0}
.today-fact{
  display:inline-flex;align-items:center;max-width:100%;line-height:1.35;
  border:1px solid var(--today-border);border-radius:5px;
  padding:3px 7px;background:var(--today-soft);color:var(--today-muted);
  font-size:.73rem;font-weight:620;overflow-wrap:anywhere;
}
.today-fact-type{font-weight:750;color:var(--today-text)}
.today-fact-project{border-left:3px solid var(--today-focus);color:var(--today-text)}
.today-fact-overdue,.today-fact-urgent{
  color:var(--today-red);border-color:color-mix(in srgb,var(--today-red) 40%,var(--today-border));
  background:color-mix(in srgb,var(--today-red) 7%,var(--today-surface));font-weight:750;
}
.today-fact-due-today{
  color:var(--today-amber);border-color:color-mix(in srgb,var(--today-amber) 38%,var(--today-border));font-weight:750
}
.today-fact-scheduled,.today-fact-state{color:var(--today-text)}

/* Needs Attention — consistent heading, filters, grouped sections and aligned actions. */
.today-home .my-work-attention{padding:12px 15px}
.my-work-attention>.row:first-child{gap:12px;align-items:end}
.my-work-attention h2{font-size:1.2rem;font-weight:760;letter-spacing:-.025em;margin:2px 0 0;color:var(--today-text)}
.today-attention-tools{
  display:flex;gap:14px 22px;flex-wrap:wrap;align-items:end;
  padding:9px 0 8px;margin:0;border-bottom:1px solid var(--today-border)
}
.today-attention-search{display:grid;gap:6px;flex:1 1 220px;min-width:0;font-size:.78rem;font-weight:700;color:var(--today-muted)}
.today-attention-search .input{width:100%;max-width:none;min-height:44px}
.today-attention-filters{
  border:0;padding:0;margin:0;display:flex;align-items:center;gap:6px;flex-wrap:wrap;
}
.today-attention-filters legend{
  float:left;margin:0 5px 0 0;padding:10px 0;
  font-size:.78rem;font-weight:700;color:var(--today-muted);
}
.today-attention-filters .btn{
  min-height:40px;border-radius:7px;padding:7px 10px;
  font-size:.79rem;box-shadow:none;
}
.today-attention-filters .btn[aria-pressed="true"]{
  background:var(--today-text);color:var(--today-surface);
  border-color:var(--today-text);font-weight:750;
}
.today-filter-count{
  display:inline-grid;place-items:center;min-width:21px;
  background:color-mix(in srgb,var(--today-muted) 13%,transparent);
  color:inherit;border-radius:5px;padding:1px 4px;font-variant-numeric:tabular-nums;font-size:.73rem;
}
.today-attention-count{margin:9px 0 0;color:var(--today-muted);font-size:.79rem}
.today-attention-empty{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0;padding:12px 15px;border:1px dashed var(--today-border);border-radius:8px;background:var(--today-soft);color:var(--today-muted)}
.my-work-attention-groups{display:grid;gap:6px;margin:9px 0 0}
.my-work-attention-group[data-empty="true"]{display:none}
.my-work-attention-group{
  border:1px solid var(--today-border);border-left:4px solid var(--today-muted);
  border-radius:9px;min-width:0;background:var(--today-surface);
  padding:0;overflow:visible;
}
.my-work-attention-group>summary{
  list-style:none;display:flex;align-items:center;gap:10px;
  min-height:44px;padding:7px 11px;
  cursor:pointer;color:var(--today-text);
  font-size:.92rem;font-weight:730;
}
.my-work-attention-group>summary::-webkit-details-marker{display:none}
.my-work-attention-group>summary::after{
  content:"";width:16px;height:16px;margin-left:auto;flex:none;
  border:solid currentColor;border-width:0 2px 2px 0;
  transform:translateY(-3px) rotate(45deg) scale(.55);transition:transform .15s ease;
}
.my-work-attention-group[open]>summary::after{transform:translateY(2px) rotate(225deg) scale(.55)}
.today-group-heading{display:grid;gap:2px;min-width:0}
.today-group-heading strong{font-size:.93rem;font-weight:760;line-height:1.3}
.today-group-description{color:var(--today-muted);font-size:.75rem;font-weight:500;line-height:1.4}
.my-work-attention-group>summary .count{
  display:inline-grid;place-items:center;min-width:26px;height:25px;
  padding:0 7px;background:var(--today-soft);border:1px solid var(--today-border);
  border-radius:7px;color:var(--today-muted);font-size:.76rem;font-weight:750
}
.today-attention-deadlines{border-left-color:var(--today-red)}
.today-attention-prepare{border-left-color:var(--today-amber)}
.today-attention-plan{border-left-color:var(--today-blue)}
.today-attention-due-next{border-left-color:var(--today-teal)}
.today-attention-deadlines>summary strong{color:var(--today-red)}
.today-attention-prepare>summary strong{color:var(--today-amber)}
.today-attention-plan>summary strong{color:var(--today-blue)}
.today-attention-due-next>summary strong{color:var(--today-teal)}
.today-attention-cards{display:grid;gap:0;list-style:none;margin:0;padding:0 11px 2px}
.today-attention-card{
  display:grid;grid-template-columns:minmax(0,1fr) auto;
  align-items:center;gap:9px;padding:8px 0;margin:0;
  border-top:1px solid var(--today-border);min-width:0;
}
.today-attention-card.is-overdue{border-left:0;padding-left:0}
.today-attention-card-main{min-width:0;overflow-wrap:anywhere}
.today-attention-card-main>a strong{font-size:.9rem;font-weight:750;color:var(--today-text)}
.today-attention-card-main p.small{font-size:.79rem;line-height:1.45;margin:5px 0 0;max-width:75ch}
.today-attention-card-actions{
  display:flex;gap:6px;align-items:center;justify-content:flex-end;
  flex-wrap:nowrap;min-width:max-content;justify-self:end;
}
.today-attention-card-actions>form{margin:0}
.today-attention-more{position:relative;flex:none}
.today-attention-more>summary{
  list-style:none;cursor:pointer;display:inline-flex;align-items:center;
  min-height:40px;
}
.today-attention-more>summary::-webkit-details-marker{display:none}
.today-attention-more-menu{
  position:absolute;z-index:40;right:0;top:calc(100% + 6px);
  display:grid;gap:4px;min-width:165px;
  padding:7px;border:1px solid var(--today-border);border-radius:9px;
  background:var(--today-surface);box-shadow:0 11px 28px rgba(15,31,49,.16)
}
.today-attention-more-menu form{margin:0}
.today-attention-more-menu .btn{width:100%;justify-content:flex-start;min-height:40px}

.today-attention-card-actions .btn{min-height:40px;font-size:.79rem;padding:7px 11px}
.today-attention-card-actions .today-remind-trigger{border-color:var(--today-border);background:var(--today-surface)}
.today-attention-card[hidden],.today-attention-empty[hidden]{display:none!important}
.my-work-attention-group.is-filter-empty[open] .today-attention-cards{display:none}
.my-work-attention.is-filtering .my-work-attention-group.is-filter-empty>p{display:none}
.my-work-attention-group>p.small{padding:1px 14px 14px;margin:0}
.today-schedule-urgency,.today-schedule-error,.today-overdue-label,.today-priority-label{color:var(--today-red);font-weight:750}

/* Shared reminder dialog is modal and never competes with card actions. */
.today-home .today-attention-card-actions .today-remind-trigger{min-width:44px;width:44px;padding:0;border:1px solid var(--today-border);color:var(--today-muted)}
.today-home .today-row-more>summary.work-item-icon-button{min-width:44px;width:44px;min-height:44px;padding:0}
.today-home .today-reminder-dialog{
  width:min(430px,calc(100vw - 30px));max-height:calc(100vh - 35px);
  margin:auto;padding:22px;border:1px solid var(--today-border);
  border-radius:12px;background:var(--today-surface);color:var(--today-text);
  box-shadow:0 24px 60px rgba(9,25,41,.25);overflow-y:auto;
}
.today-reminder-dialog::backdrop{background:rgba(10,25,40,.52)}
.today-reminder-dialog .today-remind-form{position:static;display:grid;gap:13px;border:0;box-shadow:none;padding:0;background:transparent;width:auto;max-width:none}
.today-reminder-dialog h2{font-size:1.2rem;font-weight:750;margin:0}
.today-reminder-dialog .field{display:grid;gap:6px}
.today-reminder-dialog .input{width:100%;min-height:44px}
.today-reminder-dialog .today-remind-when[hidden]{display:none!important}

/* Same visual language for routine launchers; execution remains in Routines. */
.today-home .today-routine-panel{padding:12px 15px}
.today-routine-panel h2{font-size:1.18rem;margin:3px 0 0;font-weight:760;letter-spacing:-.025em;color:var(--today-text)}
.today-routine-panel>p.small{margin:5px 0 0}
.today-routine-list{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));
  gap:8px;margin:8px 0 0
}
.today-routine-card{
  display:flex;align-items:center;gap:9px;min-height:70px;min-width:0;
  padding:9px 11px;border:1px solid var(--today-border);
  background:var(--today-surface);border-radius:9px;
  color:var(--today-text);text-decoration:none;
}
.today-routine-card:hover,.today-routine-card:focus-visible{
  background:var(--today-soft);border-color:var(--today-focus);text-decoration:none
}
.today-routine-icon{
  display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;
  background:var(--today-soft);border-radius:9px;color:var(--today-text);font-size:1.18rem
}
.today-routine-copy{display:grid;gap:3px;min-width:0;flex:1}
.today-routine-copy strong{font-size:.88rem;font-weight:760;overflow-wrap:anywhere}
.today-routine-copy .small{font-size:.77rem;line-height:1.35;overflow-wrap:anywhere}
.today-routine-progress{
  border:1px solid var(--today-border);border-radius:6px;background:var(--today-soft);
  font-size:.74rem;font-weight:750;padding:4px 6px;white-space:nowrap;
}
.today-routine-action{white-space:nowrap;font-size:.78rem;font-weight:750;color:var(--today-action)}

/* Responsive: no floating controls, no horizontal work-table overflow. */
@media(min-width:1050px){
  #today-focus .workspace-selection-main{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 12px;align-items:center}
  #today-focus .workspace-selection-main>a,#today-focus .workspace-selection-main>strong,#today-focus .workspace-selection-main>.today-record-facts{grid-column:1}
  #today-focus .workspace-selection-main>.workspace-selection-primary-actions{grid-column:2;grid-row:1 / span 2;margin:0;justify-content:flex-end}
}
@media(max-width:740px){
  .today-home{gap:9px}
  .today-home .panel{padding:10px 12px}
  .today-home .today-decision-hub{padding:0}
  .today-decision-header{padding:9px 12px}
  .today-decision-tabs{padding:2px 12px 0}
  .today-decision-panel{padding:9px 12px 10px}
  .today-decision-panel .today-recommended-focus{margin:9px -12px -10px;padding:9px 12px}
  .today-home .my-work-attention,.today-home .today-routine-panel{padding:10px 12px}
  .today-attention-card{grid-template-columns:minmax(0,1fr);gap:8px}
  .today-attention-card-actions{justify-self:start;min-width:0;flex-wrap:wrap}
  .today-attention-tools{gap:10px}
  .today-attention-search{flex-basis:100%}
  .today-recommendation{grid-template-columns:minmax(0,1fr);gap:7px}
  .today-recommendation form{justify-self:start}
}
@media(max-width:520px){
  .today-home-heading{align-items:start}
  .today-home-heading h1{font-size:1.8rem}
  .today-home-preferences{align-self:start}
  .today-home-preferences[open]>.today-home-preference-form{left:auto;right:0}
  .today-decision-heading-title{font-size:1.09rem}
  .today-decision-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0}
  .today-decision-tab{min-width:0;white-space:normal;flex-wrap:wrap;gap:3px;padding:7px 3px;font-size:.79rem}
  .today-tab-label{display:none}
  .today-tab-short{display:inline}
  .today-decision-panel .workspace-selection-row{grid-template-columns:24px minmax(0,1fr) auto;gap:8px}
  .today-decision-panel .workspace-selection-index{width:24px;height:24px;min-width:24px}
  .today-attention-filters legend{width:100%;float:none;padding:0}
  .today-attention-filters{gap:5px}
  .today-attention-filters .btn{font-size:.75rem;padding:7px 8px}
  .today-routine-card{padding:11px}
  .today-routine-action{font-size:.73rem}
}
@media(prefers-color-scheme:dark){
  .today-home{
    --today-surface:var(--card,#1c2836);
    --today-soft:var(--sunk,#263548);
    --today-border:var(--line,#405265);
    --today-text:var(--ink,#edf4fa);
    --today-muted:var(--muted,#b8c7d7);
    --today-red:#ffb4bc;
    --today-amber:#ffd28e;
    --today-blue:#afd3ff;
    --today-teal:#a8e6d6;
    --today-action:#24589a;
  }
  .today-fact-overdue,.today-fact-urgent{background:#452c38}
  .today-attention-filters .btn[aria-pressed="true"]{background:#b6d3e5;color:#162739;border-color:#b6d3e5}
}

/* A wider Today workspace makes the decision surface useful on desktop
   without changing global layouts or creating horizontal page overflow. */
.main.today-shell{max-width:none;min-width:0;padding-inline:clamp(12px,2.1vw,32px)}
.today-home .today-intelligence{display:grid;gap:12px;padding:14px 16px}
.today-intelligence .today-brief-heading h2{margin:0}
.today-intelligence-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.today-intelligence-stat{display:grid;gap:2px;min-width:0;text-decoration:none!important;
  background:var(--today-soft);border:1px solid var(--today-border);border-radius:8px;padding:10px 12px}
.today-intelligence-stat:hover,.today-intelligence-stat:focus-visible{border-color:var(--today-action)}
.today-intelligence-stat strong{font-size:1.55rem;line-height:1.2;color:var(--today-text);font-variant-numeric:tabular-nums}
.today-intelligence-stat span{font-size:.77rem;font-weight:650;color:var(--today-muted);line-height:1.4}
.today-intelligence-signals{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,255px),1fr));gap:8px}
.today-intelligence-signal{display:grid;gap:4px;border-left:3px solid var(--today-blue);
  background:var(--today-soft);border-radius:5px;padding:9px 11px;color:var(--today-text);text-decoration:none!important}
.today-intelligence-signal:hover{text-decoration:underline!important}
.today-intelligence-signal-kind{font-size:.67rem;font-weight:780;text-transform:uppercase;letter-spacing:.02em;color:var(--today-blue)}
.today-intelligence-signal-kind.is-risk{color:var(--today-red)}
.today-intelligence-signal strong{font-size:.83rem;line-height:1.35}
.today-intelligence-signal .small{font-size:.73rem;line-height:1.35;color:var(--today-muted)}
.today-intelligence-projects>summary{display:flex;align-items:center;gap:9px;flex-wrap:wrap;
  min-height:44px;cursor:pointer;font-size:.83rem;color:var(--today-text);border-top:1px solid var(--today-border)}
.today-intelligence-projects>summary .small{font-weight:400;color:var(--today-muted);font-size:.73rem}
.today-intelligence-project-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,285px),1fr));gap:9px}
.today-intelligence-project{border:1px solid var(--today-border);border-radius:8px;padding:10px 12px;
  min-width:0;display:flex;flex-direction:column;gap:7px}
.today-intelligence-project .row{align-items:center;flex-wrap:wrap;gap:5px}
.today-intelligence-project-name{font-weight:740;font-size:.84rem;overflow-wrap:anywhere}
.today-intelligence-risk{font-size:.7rem;color:var(--today-red);font-weight:740}
.today-intelligence-project>p{margin:0;font-size:.72rem;line-height:1.35}
.today-intelligence-next{display:grid;gap:3px;padding:6px 7px;border-radius:5px;
  background:var(--today-soft);text-decoration:none!important}
.today-intelligence-next:hover{text-decoration:underline!important}
.today-intelligence-next strong{font-size:.79rem;line-height:1.35;overflow-wrap:anywhere}
.today-intelligence-next .small{font-size:.71rem;line-height:1.35;color:var(--today-muted)}
.today-intelligence-project-foot{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px;
  color:var(--today-muted);font-size:.7rem;line-height:1.3}
.today-intelligence-estimate{margin:0;padding:8px 0;border-top:1px solid var(--today-border);font-size:.75rem}
.today-intelligence-method>summary{font-size:.76rem;color:var(--today-blue);cursor:pointer;min-height:32px}
.today-intelligence-method p{max-width:90ch;margin:4px 0 7px;font-size:.75rem}
.today-now-fit-note{font-size:.73rem;color:var(--today-teal);font-weight:690;margin:4px 0}
@media(max-width:750px){
  .today-intelligence-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .today-home .today-intelligence{padding:11px 12px}
  .main.today-shell{padding-inline:12px}
}
@media(max-width:420px){
  .today-intelligence-stat strong{font-size:1.25rem}
  .today-intelligence-stat{padding:8px}
}

@media(prefers-reduced-motion:reduce){
  .today-home .btn,.today-decision-chevron,.my-work-attention-group>summary::after{transition:none}
}

/* Compact read-only Today action and schedule surfaces. Planner owns editing. */
.today-right-now,.today-day-schedule{margin:0;min-width:0}
.today-brief-heading{display:flex;align-items:center;justify-content:space-between;gap:9px;flex-wrap:wrap;margin-bottom:10px}
.today-brief-heading h2{font-size:1.08rem;letter-spacing:-.015em;margin:2px 0 0}
.today-brief-heading .eyebrow{font-size:.67rem}
.today-right-now-content{display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:0}
.today-right-now-copy{flex:1;min-width:0}
.today-now-context{font-size:.72rem;font-weight:680;color:var(--today-muted)}
.today-now-title{display:block;font-size:1rem;line-height:1.4;font-weight:740;color:var(--today-text);margin:2px 0 4px;overflow-wrap:anywhere}
.today-right-now-copy p{font-size:.77rem;margin:2px 0 0}
.today-right-now-actions{flex-shrink:0;display:flex;align-items:center}
.today-right-now-actions .work-item-primary-actions{margin:0}
.today-calendar-warning{color:var(--today-amber);font-weight:650;font-size:.74rem;margin:5px 0 8px}
.today-now-unverified{color:var(--today-muted)}
.today-habit-summary{display:inline-flex;align-items:center;min-height:44px;padding:5px 9px;border:1px solid var(--today-border);border-radius:6px;text-decoration:none;font-size:.75rem;font-weight:680;color:var(--today-text)}
.today-habit-summary:hover,.today-habit-summary:focus-visible{background:var(--today-soft)}
.today-schedule-list{list-style:none;margin:0;padding:0;display:grid;gap:0}
.today-schedule-event{display:grid;grid-template-columns:45px 3px minmax(0,1fr);align-items:center;gap:10px;padding:8px 0;border-top:1px solid var(--today-border);min-width:0}
.today-schedule-event:first-child{border-top:0}
.today-schedule-time{font-size:.76rem;color:var(--today-muted);font-variant-numeric:tabular-nums}
.today-schedule-event-colour{width:3px;height:30px;background:var(--today-event-colour,var(--today-focus));border-radius:2px}
.today-schedule-event-copy{display:grid;gap:2px;min-width:0}
.today-schedule-event-copy strong{font-size:.82rem;font-weight:660;overflow-wrap:anywhere}
.today-schedule-event-copy .small{font-size:.72rem}
.today-schedule-event.is-current .today-schedule-time{font-weight:800;color:var(--today-text)}
.today-schedule-all-day{display:flex;gap:5px;align-items:center;flex-wrap:wrap;background:var(--today-soft);padding:7px 9px;border-radius:6px;font-size:.73rem;margin:2px 0 8px}
.today-schedule-all-day>span:first-child{font-weight:750}
.today-schedule-more{display:inline-block;margin-top:6px}
.today-schedule-empty{margin:3px 0}
@media(max-width:640px){
 .today-right-now-content{align-items:flex-start;flex-direction:column;gap:10px}
 .today-schedule-event{grid-template-columns:43px 3px minmax(0,1fr);gap:8px}
}

/* Today polish: consistent, quiet surfaces and small source-linked task rows. */
.today-home .today-decision-tabs{gap:5px;background:var(--today-surface);
  padding:3px 15px 0}
.today-home .today-decision-tab{color:var(--today-muted);border-radius:7px 7px 0 0;
  font-size:.82rem}
.today-home .today-decision-tab[aria-selected="true"]{background:var(--today-surface);
  color:var(--today-text);border-bottom-color:var(--today-blue)}
.today-home .today-decision-tab[aria-selected="true"] .count{
  background:var(--today-soft);border-color:var(--today-border)}
.today-decision-panel .workspace-selection-list{border-top:0;gap:5px}
.today-decision-panel .workspace-selection-row{padding:9px 10px;
  background:var(--today-surface);border:1px solid var(--today-border);
  border-radius:8px;align-items:center}
.today-decision-panel .workspace-selection-index{background:var(--today-soft);
  border-color:var(--today-border);color:var(--today-text)}
.today-decision-panel .workspace-selection-main > .work-item-heading{
  display:flex;gap:4px 9px;align-items:center}
.today-decision-panel .workspace-selection-main > .work-item-facts{margin:5px 0 0}
#today-focus .workspace-selection-main{
  display:grid;grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:auto auto;gap:2px 12px;align-items:center}
#today-focus .workspace-selection-main > .work-item-heading{
  grid-column:1;grid-row:1}
#today-focus .workspace-selection-main > .work-item-facts{
  grid-column:1;grid-row:2}
#today-focus .workspace-selection-main > .work-item-primary-actions{
  grid-column:2;grid-row:1 / span 2;align-self:center;
  justify-content:flex-end;margin:0}
.today-decision-panel .workspace-selection-row .today-row-more{align-self:center}
.today-decision-panel .top3{display:grid;gap:6px}
.today-decision-panel .top3 li{border:1px solid var(--today-border);
  border-radius:8px;padding:9px 10px;background:var(--today-surface)}
.today-decision-panel .top3 .n{background:var(--today-soft)}
.today-decision-panel .top3 li.done{opacity:.86}
.today-decision-panel .today-recommended-focus{margin:14px 0 0;
  padding:0;border:0;background:transparent}
.today-recommendations{display:grid;gap:6px}
.today-recommendation{padding:9px 11px;margin:0;
  background:var(--today-surface);border:1px solid var(--today-border);
  border-radius:8px}
.today-recommendation>div{min-width:0}
.today-recommendation .work-item-facts{margin-top:5px}
.today-recommendation .btn{border-color:var(--today-border)}
.today-recommendation-reason{max-width:68ch}
.today-attention-tools{display:block;padding:8px 0 5px}
.today-attention-filters{display:flex;width:100%;flex-wrap:nowrap;gap:5px;
  align-items:center;overflow-x:auto;scrollbar-width:thin;padding:2px 0 5px}
.today-attention-filters .btn{flex:0 0 auto;border-radius:999px;
  min-height:40px;padding:6px 11px;font-size:.76rem;font-weight:650;
  border:1px solid var(--today-border);background:var(--today-surface)}
.today-attention-filters .btn[aria-pressed="true"]{background:var(--today-text);
  color:var(--today-surface);border-color:var(--today-text)}
.today-attention-filters .today-filter-count{min-width:18px;padding:0 3px;
  font-size:.68rem}
@media(max-width:700px){
  #today-focus .workspace-selection-main{grid-template-columns:minmax(0,1fr)}
  #today-focus .workspace-selection-main > .work-item-heading,
  #today-focus .workspace-selection-main > .work-item-facts,
  #today-focus .workspace-selection-main > .work-item-primary-actions{
    grid-column:1;grid-row:auto}
  #today-focus .workspace-selection-main > .work-item-primary-actions{
    justify-content:flex-start;margin-top:5px}
  .today-decision-panel .workspace-selection-row{grid-template-columns:24px minmax(0,1fr) auto}
  .today-recommendation{grid-template-columns:minmax(0,1fr)}
  .today-recommendation form{justify-self:start}
}
@media(prefers-color-scheme:dark){
  .today-home .today-attention-filters .btn[aria-pressed="true"]{
    background:#bfd5e9;color:#182b3a;border-color:#bfd5e9}
}

.today-home a.today-now-project-link{display:inline-block;color:var(--today-blue);
  font-weight:700;text-decoration:underline;text-decoration-thickness:1px;
  text-underline-offset:3px}
.today-home a.today-now-project-link:hover{color:var(--today-text)}

/* Attention is a horizontal set of decision columns on wide screens,
   rather than a single tall stack. The only booked items live in a
   separate collapsed pane, without inflating attention counts. */
/* Exactly one full-width column until a real five-column fit exists.
   Container width, not browser viewport, accounts for the sidebar. */
.today-home .my-work-attention{container-type:inline-size}
.today-home .today-attention-tools{display:flex;flex-wrap:nowrap;align-items:end;
  gap:8px;overflow-x:auto;scrollbar-width:thin;padding:8px 0 10px}
.today-home .today-attention-filters{width:auto;flex:none;overflow:visible;padding:0;
  white-space:nowrap}
.today-attention-control{display:grid;gap:3px;flex:0 0 auto;font-size:.72rem;
  font-weight:700;color:var(--today-muted)}
.today-attention-control .input{width:auto;max-width:185px;min-width:118px;
  height:40px;min-height:40px;padding:6px 9px;font-size:.77rem}
.today-home .today-attention-tools>[data-attention-reset]{flex:none;min-height:40px}
.today-home .my-work-attention-groups{display:grid;grid-template-columns:minmax(0,1fr);
  align-items:start;gap:10px}
@container (min-width: 1440px){
  .today-home .my-work-attention-groups{grid-template-columns:repeat(5,minmax(0,1fr))}
  .today-home .today-attention-already-planned{grid-column:auto}
  .today-home .today-attention-already-planned .today-attention-cards{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:700px){
  .today-home .today-attention-tools{flex-wrap:nowrap}
  .today-attention-control .input{min-width:115px}
}
.today-home .my-work-attention-group{min-width:0;margin:0;background:#fff}
.today-home .my-work-attention-group>summary{gap:7px;padding:10px}
.today-home .today-attention-cards{padding:0 10px 8px;display:grid;gap:4px}
.today-home .today-attention-card{grid-template-columns:minmax(0,1fr);
  align-items:start;gap:7px;padding:9px 0 8px;min-width:0}
.today-home .today-attention-card-actions{justify-self:start;min-width:0;
  justify-content:flex-start;flex-wrap:wrap;gap:4px}
.today-home .today-attention-card-actions .work-item-primary-actions{
  flex-wrap:wrap;gap:4px}
.today-home .today-attention-card-main .work-item-heading{
  display:flex;align-items:flex-start;gap:4px 7px}
.today-home .today-attention-already-planned{grid-column:1/-1;
  background:var(--today-surface);border-left-color:var(--today-teal)}
.today-home .today-attention-already-planned>summary strong{color:var(--today-teal)}
.today-home .today-attention-already-planned .today-attention-cards{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,265px),1fr));gap:0 14px}
.today-home .today-attention-booked{display:inline-block;margin:6px 0 0;
  font-size:.72rem;font-weight:730;color:var(--today-teal)}
@media(max-width:650px){
  .today-home .my-work-attention-groups{grid-template-columns:minmax(0,1fr)}
  .today-home .my-work-attention-group{background:var(--today-surface)}
}
@media(prefers-color-scheme:dark){
  .today-home .my-work-attention-group{background:var(--today-surface)}
}

/* Keep the five-column decision layout after later legacy spacing rules.
   Only the true content container width determines eligibility. */
@container (min-width:1440px){
  .today-home .my-work-attention-groups{grid-template-columns:repeat(5,minmax(0,1fr))}
  .today-home .today-attention-already-planned{grid-column:auto}
  .today-home .today-attention-already-planned .today-attention-cards{grid-template-columns:minmax(0,1fr)}
}


/* Today reference implementation, 2026-11-08.
   Scoped to Today only: global navigation and other Hub screens stay intact.
   The uploaded reference is intentionally compact, light, professional. */
.today-ref-home{
  --today-surface:#fff;--today-soft:#f5f7fa;--today-border:#dfe6ed;
  --today-text:#1c2936;--today-muted:#566575;--today-action:#2b608b;
  --today-focus:#2b608b;--today-red:#a52e42;--today-teal:#176a65;
  color:var(--today-text);width:100%;max-width:1625px;margin:0 auto;
  padding:4px clamp(14px,2vw,28px) 52px;font-size:12px;line-height:1.4;
}
.today-ref-home .panel{background:#fff;border:1px solid #dfe6ed;border-radius:9px;
  box-shadow:0 1px 3px rgba(27,45,64,.035);min-width:0}
.today-ref-home .btn{font-size:11px;min-height:32px;border-radius:6px;
  padding:6px 10px;font-weight:680;box-shadow:none}
.today-ref-home .btn.sm{font-size:10.5px;min-height:30px;padding:5px 9px}
.today-ref-home .btn.primary{background:#243f58;color:#fff;border-color:#243f58}
.today-ref-home .btn.primary:hover{background:#34546f}
.today-ref-home .eyebrow{font-size:10px;color:#68778a;letter-spacing:0;text-transform:none}
.today-ref-home .small{font-size:10.5px;line-height:1.45}
.today-ref-page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  margin:0 0 15px;padding:0}
.today-ref-page-head h1,.today-ref-page-head .today-workspace-title{font-size:25px;
  letter-spacing:-1px;line-height:1.15;font-weight:780;margin:3px 0 4px;color:#1c2936}
.today-ref-page-head .today-home-heading-copy>p:last-child{margin:0;font-size:11px}
.today-ref-page-head .today-home-header-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.today-ref-home .today-habit-summary{font-size:10px;color:#52716e;font-weight:740;
  text-decoration:none;background:transparent;padding:2px;border:0}
.today-ref-home .today-home-preferences>summary{list-style:none;min-height:34px}
.today-ref-home .today-home-preferences>summary::-webkit-details-marker{display:none}
.today-ref-layout{display:grid;grid-template-columns:minmax(0,1fr) 315px;
  gap:12px;align-items:start;min-width:0}
.today-ref-primary,.today-ref-side{display:grid;gap:12px;min-width:0;align-content:start}
.today-ref-home .today-ref-now{display:grid;grid-template-columns:3px minmax(0,1fr) auto;
  gap:13px;align-items:center;padding:14px 15px}
.today-ref-now-accent{align-self:stretch;background:#2b8078;border-radius:3px}
.today-ref-now-main{min-width:0}
.today-ref-now-brow{font-size:10px!important;font-weight:780!important;letter-spacing:.05em!important;
  color:#1f6d64!important;text-transform:uppercase;margin:0 0 5px!important}
.today-ref-now-title{display:block;font-size:15px;font-weight:760;letter-spacing:-.25px;
  color:#1c2936;line-height:1.35;overflow-wrap:anywhere;text-decoration:none}
.today-ref-now-detail{margin:4px 0 0;font-size:10.5px;color:#5b6b7c;line-height:1.4}
.today-ref-now-facts{display:flex;gap:5px 12px;flex-wrap:wrap;margin:6px 0 0;
  font-size:10px;color:#546879}
.today-ref-now-facts span{display:inline-flex;align-items:center;gap:4px}
.today-ref-unverified{color:#9b5228;font-weight:720}
.today-ref-now-actions{display:flex;align-items:center;gap:4px;flex-wrap:wrap;justify-content:flex-end}
.today-ref-home .today-ref-now-actions .work-item-primary-actions{display:flex;
  align-items:center;justify-content:flex-end;gap:4px;margin:0}
.today-ref-home .today-ref-now-actions .work-item-primary-actions form{margin:0}
.today-ref-home .today-ref-now-actions .work-item-icon-button{width:31px;min-width:31px;padding:0}
.today-ref-now-alternatives{border-color:transparent!important;font-size:18px!important;min-width:31px}
.today-ref-panel-inner{padding:14px 15px}
.today-ref-panel-head{display:flex;align-items:flex-start;justify-content:space-between;
  gap:10px;margin:0 0 10px}
.today-ref-panel-head h2{font-size:13px;line-height:1.35;font-weight:760;
  letter-spacing:-.2px;margin:0;color:#1c2936}
.today-ref-panel-head p{font-size:10px;line-height:1.4;color:#69798a;margin:3px 0 0}
.today-ref-panel-link{font-size:10.5px;font-weight:700;color:#2e638e;
  text-decoration:none;white-space:nowrap}
.today-ref-side-panel{padding:14px 15px}
.today-ref-side-panel>.today-ref-panel-head{margin-bottom:10px}
.today-ref-home .today-ref-schedule-list{display:grid;gap:0;margin:0;padding:0;list-style:none}
.today-ref-home .today-ref-schedule-row{display:grid;grid-template-columns:38px 3px minmax(0,1fr);
  align-items:center;gap:9px;padding:7px 0;border-bottom:1px solid #edf1f4}
.today-ref-home .today-ref-schedule-row:last-child{border-bottom:0}
.today-ref-home .today-schedule-time{font-size:10px;color:#607184;font-variant-numeric:tabular-nums}
.today-ref-home .today-schedule-event-colour{width:3px;height:28px;
  background:var(--today-event-colour,#6789ad);border-radius:2px}
.today-ref-home .today-schedule-event-copy{display:grid;gap:2px;min-width:0}
.today-ref-home .today-schedule-event-copy strong{font-size:10.5px;font-weight:710;color:#1c2936}
.today-ref-home .today-schedule-event-copy .small{font-size:9.5px;color:#738292}
.today-ref-soft-note,.today-ref-all-day{font-size:10px;color:#627387;border-radius:5px;
  background:#f3f6f9;margin:9px 0 0;padding:7px 8px}
.today-ref-all-day{display:flex;gap:5px;flex-wrap:wrap}
.today-ref-all-day strong{color:#304a61}
.today-ref-week-row{display:grid;gap:3px;padding:8px 0;border-top:1px solid #edf0f4;
  text-decoration:none;overflow-wrap:anywhere}
.today-ref-week-row:first-of-type{border-top:0}
.today-ref-week-row strong{font-size:10.5px;color:#1c2936;font-weight:710}
.today-ref-week-row>span{font-size:9.5px;color:#647486;line-height:1.45}
.today-ref-week-details{border-top:1px solid #edf0f4;padding-top:7px;margin-top:5px}
.today-ref-week-details summary{font-size:10px;color:#2e638e;cursor:pointer;min-height:26px}
.today-ref-week-details p{margin:4px 0;font-size:10px}
.today-ref-week-details a{font-size:10px;color:#2e638e}
.today-ref-routine-row{display:flex;align-items:center;justify-content:space-between;gap:9px;
  padding:9px 0;border-top:1px solid #edf0f4;text-decoration:none;color:#1c2936}
.today-ref-routine-row:first-of-type{border-top:0}
.today-ref-routine-row>span:first-child{display:grid;gap:3px;min-width:0}
.today-ref-routine-row strong{font-size:10.5px;font-weight:710}
.today-ref-routine-row small{font-size:9.5px;color:#657687}
.today-ref-routine-row>.btn{pointer-events:none;white-space:nowrap}
.today-ref-routine-progress{display:flex;gap:4px;align-items:center;margin:2px 0}
.today-ref-routine-progress i{display:block;height:4px;width:18px;border-radius:8px;background:#e2e8ef}
.today-ref-routine-progress i.is-done{background:#2d8a77}
.today-ref-habit-summary{display:block;border-top:1px solid #edf0f4;padding-top:9px;
  font-size:10px;color:#52716e;font-weight:660}
.today-ref-home .today-decision-hub{border:1px solid #dfe6ed;border-radius:9px;box-shadow:none}
.today-ref-home .today-decision-shell{display:block;padding:0}
.today-ref-home .today-decision-content{display:block;padding:0}
.today-ref-home .today-decision-header{padding:0;border:0;margin:0}
.today-ref-home .today-decision-heading{margin:0;font-size:13px;line-height:1.35}
.today-ref-home .today-decision-heading-toggle{display:flex;width:100%;min-height:48px;
  align-items:center;justify-content:space-between;padding:13px 15px;background:none;border:0;
  color:#1c2936;font-weight:760;text-align:left}
.today-ref-home .today-decision-heading-title{font-size:13px;line-height:1.35;
  font-weight:760;letter-spacing:-.2px;color:#1c2936}
.today-ref-home .today-decision-heading-copy{display:inline-flex;align-items:center;gap:9px}
.today-ref-home .today-decision-heading-toggle:hover{background:#fbfcfd}
.today-ref-home .today-decision-chevron{width:15px;height:15px;flex:none}
.today-ref-home .today-decision-main{padding:0 14px 13px}
.today-ref-home .today-decision-tabs{display:flex;gap:3px;align-items:center;
  border-bottom:1px solid #dfe6ed;background:none;padding:0;margin:0 0 9px}
.today-ref-home .today-decision-tab{min-height:37px;background:none;border:0;
  border-bottom:2px solid transparent;padding:7px 9px;border-radius:0;color:#607080;
  font-size:10.5px;font-weight:660;white-space:nowrap}
.today-ref-home .today-decision-tab[aria-selected="true"]{border-bottom:2px solid #2b608b;
  color:#245a84;background:transparent}
.today-ref-home .today-decision-tab .count{font-size:9px;background:#edf1f5;
  color:#536777;border:0;border-radius:8px;margin-left:4px;padding:1px 5px}
.today-ref-home .today-decision-panel{padding:0;border:0;background:transparent}
.today-ref-home .today-decision-panel[hidden],.today-ref-home .today-decision-main[hidden]{display:none!important}
.today-ref-home .workspace-selection-list{display:grid;gap:0;margin:0;list-style:none;padding:0}
.today-ref-home .workspace-selection-row{display:grid;grid-template-columns:21px minmax(0,1fr) auto;
  align-items:center;gap:8px;padding:9px 2px;border:0;
  border-bottom:1px solid #edf0f4;border-radius:0;background:transparent}
.today-ref-home .workspace-selection-row:last-child{border-bottom:0}
.today-ref-home .workspace-selection-index{display:grid;place-items:center;width:19px;height:19px;
  border-radius:5px;font-size:9px;font-weight:800;background:#edf2f7;color:#496079}
.today-ref-home .workspace-selection-main{display:grid;gap:3px;min-width:0}
.today-ref-home #today-focus .workspace-selection-main{display:grid;grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:auto auto;gap:3px 10px}
.today-ref-home #today-focus .workspace-selection-main>.work-item-heading{
  grid-column:1;grid-row:1}
.today-ref-home #today-focus .workspace-selection-main>.work-item-facts{
  grid-column:1;grid-row:2}
.today-ref-home #today-focus .workspace-selection-main>.work-item-primary-actions{
  grid-column:2;grid-row:1/span 2;margin:0;justify-self:end}
.today-ref-home .work-item-heading{display:flex;align-items:center;flex-wrap:wrap;gap:4px 7px;min-width:0}
.today-ref-home .work-item-title{font-size:11.5px;color:#22394c;font-weight:720}
.today-ref-home .work-item-origin{display:inline-flex;gap:5px;align-items:center;min-width:0}
.today-ref-home .work-item-type{border:0;border-radius:4px;padding:2px 5px;font-size:9px}
.today-ref-home .work-item-facts{display:flex;gap:5px 10px;flex-wrap:wrap;margin-top:2px}
.today-ref-home .work-item-fact{font-size:9.5px;color:#657587}
.today-ref-home .work-item-fact svg{width:12px;height:12px}
.today-ref-home .work-item-overdue{color:#a52e42;font-weight:760}
.today-ref-home .work-item-priority[data-priority="high"],
.today-ref-home .work-item-priority[data-priority="urgent"]{color:#946117}
.today-ref-home .work-item-primary-actions{display:flex;align-items:center;gap:3px}
.today-ref-home .work-item-primary-actions form{margin:0}
.today-ref-home .work-item-primary-actions .btn{min-height:29px}
.today-ref-home .work-item-primary-actions .work-item-icon-button{width:30px;min-width:30px;padding:0;
  background:transparent;border-color:transparent}
.today-ref-home .today-row-more{align-self:center}
.today-ref-home .today-row-more>summary{min-width:30px;min-height:30px;border-color:transparent;
  background:transparent}
.today-ref-home .today-row-more>.workspace-selection-actions{right:0;left:auto;z-index:8}
.today-ref-home .workspace-add-focus,.today-ref-home .today-compact-editor{border:0;margin-top:7px}
.today-ref-home .workspace-add-focus>summary,.today-ref-home .today-compact-editor>summary{
  font-size:10.5px;min-height:32px}
.today-ref-home .today-recommended-focus{border-top:1px solid #dfe6ed;
  margin:10px -14px -13px;padding:10px 14px 12px;background:#fbfcfe;
  border-radius:0 0 9px 9px}
.today-ref-home .today-recommended-focus h3{font-size:10.5px;font-weight:760;margin:0}
.today-ref-home .today-recommendations{display:grid;gap:0}
.today-ref-home .today-recommendation{display:flex;justify-content:space-between;gap:9px;
  background:transparent;border:0;border-top:1px solid #edf0f4;border-radius:0;
  padding:8px 0;margin:0}
.today-ref-home .today-recommendation .work-item-title{font-size:10.5px}
.today-ref-home .today-recommendation-reason{font-size:10px;line-height:1.4}
.today-ref-home .today-decision-panel>.today-panel-body{padding:0}
.today-ref-home .today-decision-panel .row h2{font-size:11px}
.today-ref-home .today-decision-panel .today-goal-summary{font-size:10px}
.today-ref-home .today-decision-panel .top3 li{padding:8px 2px;border:0;
  border-bottom:1px solid #edf0f4;border-radius:0}
.today-ref-home .today-decision-panel .top3 .n{width:21px;height:21px;font-size:10px}
.today-ref-home .today-decision-panel .top3 li:last-child{border-bottom:0}
.today-ref-home .today-decision-collapsed-summary{padding:0 15px 9px;font-size:10px}
.today-ref-home .today-ref-attention{padding:0}
.today-ref-home .today-ref-alerts{margin:0;padding:0;list-style:none;display:grid;gap:0}
.today-ref-alert-row{display:grid;grid-template-columns:minmax(0,1fr) auto;
  align-items:center;gap:8px;padding:9px 0;border-bottom:1px solid #edf0f4}
.today-ref-alert-row:last-child{border-bottom:0}
.today-ref-alert-row[hidden]{display:none!important}
.today-ref-alert-text{min-width:0;overflow-wrap:anywhere}
.today-ref-alert-title{color:#1c2936;font-size:10.5px;font-weight:740;line-height:1.35}
.today-ref-alert-text p{margin:3px 0 0;font-size:9.5px;color:#647486;line-height:1.4}
.today-ref-overdue{display:inline-block;background:#fff0f1;color:#a52e42;
  border-radius:4px;padding:2px 5px;font-size:9px;font-weight:800}
.today-ref-alert-actions .btn{min-height:30px;white-space:nowrap}
.today-ref-attention-filters{display:flex;gap:5px;flex-wrap:wrap;margin:2px 0 9px}
.today-ref-attention-filter{min-height:31px;border:1px solid #e5ebf0;border-radius:6px;
  padding:5px 8px;background:#f5f7f9;color:#5d6f80;font-size:10px;font-weight:660}
.today-ref-attention-filter:hover{background:#eaf1f7}
.today-ref-attention-filter.is-active{background:#e5eff8;color:#255b86;border-color:#b4cce0}
.today-ref-count{font-size:9px;font-weight:720;border-radius:8px;
  padding:2px 6px;background:#edf1f5;color:#536777;margin-left:4px}
.today-ref-alert-empty{padding:12px 0}
.today-ref-home a:focus-visible,.today-ref-home button:focus-visible,
.today-ref-home summary:focus-visible{outline:3px solid #8ab2df;outline-offset:2px}
@media(max-width:1090px){
  .today-ref-layout{grid-template-columns:minmax(0,1fr) 285px}
}
@media(max-width:820px){
  .today-ref-layout{grid-template-columns:minmax(0,1fr)}
  .today-ref-side{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
  .today-ref-home .today-ref-side>.today-ref-routines{grid-column:1/-1}
}
@media(max-width:560px){
  .today-ref-home{padding:15px 12px 35px}
  .today-ref-page-head{flex-direction:column}
  .today-ref-side{grid-template-columns:1fr}
  .today-ref-home .today-ref-side>.today-ref-routines{grid-column:auto}
  .today-ref-home .today-ref-now{grid-template-columns:3px minmax(0,1fr);gap:10px}
  .today-ref-now-actions{grid-column:2;justify-content:flex-start}
  .today-ref-home #today-focus .workspace-selection-main{grid-template-columns:minmax(0,1fr)}
  .today-ref-home #today-focus .workspace-selection-main>.work-item-heading,
  .today-ref-home #today-focus .workspace-selection-main>.work-item-facts,
  .today-ref-home #today-focus .workspace-selection-main>.work-item-primary-actions{
    grid-column:1;grid-row:auto;justify-self:start}
  .today-ref-home .workspace-selection-row{grid-template-columns:20px minmax(0,1fr);gap:7px}
  .today-ref-home .today-row-more{grid-column:2;justify-self:start}
  .today-ref-home .today-decision-tabs{overflow-x:auto;scrollbar-width:thin}
  .today-ref-home .today-decision-tab{padding:7px 6px}
}
@media(prefers-reduced-motion:reduce){.today-ref-home *{scroll-behavior:auto!important}}

/* The Recommended Focus strip lives below Daily Direction rather than
   inside its first tab; its content still comes from the existing ranking. */
.today-ref-home .today-ref-recommend-strip{margin:0;padding:10px 15px;
  border:0;border-top:1px solid #dfe6ed;background:#fbfcfe;
  border-radius:0 0 9px 9px}
.today-ref-home .today-ref-recommend-strip>.row{margin:0;gap:8px;align-items:center}
.today-ref-home .today-ref-recommend-strip>.row>a{margin-left:auto;font-size:10px}
.today-ref-home .today-ref-recommend-strip>.row>button{margin-left:5px}
.today-ref-home .today-ref-recommend-strip .today-recommendations[hidden],
.today-ref-home .today-ref-recommend-strip .today-rec-more[hidden],
.today-ref-home .today-ref-recommend-strip>p[hidden]{display:none!important}
.today-ref-home .today-ref-alert-actions{display:flex;align-items:center;gap:4px}
.today-ref-home .today-ref-alert-actions form{margin:0}
.today-ref-home .today-ref-alert-actions .today-remind-trigger{width:30px;min-width:30px;
  height:30px;min-height:30px;padding:0;border:1px solid transparent}
.today-ref-home .today-reminder-dialog{font-size:12px}

.today-ref-home .today-ref-alert-facts{margin-top:3px}
.today-ref-home .today-ref-alert-facts .work-item-facts{margin:2px 0 0;gap:3px 8px}
.today-ref-home .today-ref-alert-facts .work-item-fact{font-size:9.2px;color:#657587}
.today-ref-home .today-ref-alert-facts .work-item-overdue{color:#a52e42;font-weight:750}
.today-ref-home .today-ref-alert-facts .work-item-fact svg{width:11px;height:11px}
.today-ref-home .today-ref-attention .today-remind-trigger{min-height:30px}
.today-ref-home .today-ref-attention .today-remind-trigger:hover{background:#edf2f6}

/* Advanced controls retain the existing priority, effort and impact filtering
   without crowding the supplied reference's four quick-filter chips. */
.today-ref-home .today-ref-attention-filters{align-items:center}
.today-ref-home .today-ref-advanced-filters{position:relative;margin-left:auto;min-width:0}
.today-ref-home .today-ref-advanced-filters>summary{min-height:31px;list-style:none;
  display:flex;align-items:center;cursor:pointer;border:1px solid #e5ebf0}
.today-ref-home .today-ref-advanced-filters>summary::-webkit-details-marker{display:none}
.today-ref-home .today-ref-advanced-filters[open]{z-index:12}
.today-ref-home .today-ref-filter-options{position:absolute;right:0;top:calc(100% + 4px);
  width:min(360px,calc(100vw - 40px));background:#fff;border:1px solid #dfe6ed;
  border-radius:8px;box-shadow:0 6px 18px rgba(18,39,60,.14);
  padding:12px;display:grid;gap:10px}
.today-ref-home .today-ref-filter-options label{display:grid;gap:4px;
  font-size:10px;font-weight:700;color:#566575}
.today-ref-home .today-ref-filter-options .input{width:100%;min-height:38px;
  font-size:11px;border-radius:6px}
.today-ref-home .today-ref-attention-filter{flex:none}
@media(max-width:560px){
  .today-ref-home .today-ref-advanced-filters{margin-left:0}
  .today-ref-home .today-ref-filter-options{left:0;right:auto}
}

/* Do next: one clear instruction, two backups, everything else folded. */
.today-ref-home .today-do-now{grid-template-columns:3px minmax(0,1fr);padding:18px 20px}
.today-do-now .today-ref-now-brow{margin:0 0 2px}
.today-do-now .today-now-window{margin:0;font-size:12px;color:#5b6b7c}
.today-do-now .today-now-energy{margin:2px 0 0;font-size:12px;color:#2b8078;font-weight:650}
.today-do-now .today-ref-now-title{font-size:20px;line-height:1.3;margin:10px 0 2px}
.today-do-now .today-ref-now-detail{font-size:12.5px}
.today-do-now .today-ref-now-actions{justify-content:flex-start;margin-top:12px;gap:8px}
.today-now-skip{margin:0}
.today-now-backups{margin-top:16px;border-top:1px solid var(--line,#e3e8ee);padding-top:12px}
.today-now-backups h3{margin:0 0 6px;font-size:11px;font-weight:720;letter-spacing:.04em;
  text-transform:uppercase;color:#5b6b7c}
.today-now-alts{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.today-now-alts .today-now-pick a{display:flex;flex-direction:column;gap:1px;padding:7px 8px;
  margin:0 -8px;border-radius:8px;color:inherit;text-decoration:none}
.today-now-alts .today-now-pick a:hover{background:var(--hover,#f3f6f9)}
.today-now-alts strong{font-size:13.5px;font-weight:680}
.today-now-alts span{font-size:11.5px;color:#5b6b7c}
.today-fold{border:1px solid var(--line,#e3e8ee);border-radius:12px;background:var(--panel,#fff);
  margin-top:12px}
.today-fold>summary{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;cursor:pointer;
  padding:13px 16px;font-weight:700;font-size:14px;list-style:none}
.today-fold>summary::-webkit-details-marker{display:none}
.today-fold>summary::after{content:"▾";margin-left:auto;color:#5b6b7c;transition:transform .15s}
.today-fold[open]>summary::after{transform:rotate(180deg)}
.today-fold>summary small{font-weight:500;font-size:12px;color:#5b6b7c}
.today-fold[open]{padding-bottom:4px}
.today-fold>.panel{border:0;box-shadow:none;margin:0;background:transparent}
.today-fold>.today-ref-week{padding:0 16px 12px}
@media (prefers-color-scheme:dark){
  .today-do-now .today-now-window,.today-now-alts span,.today-fold>summary small,
  .today-now-backups h3{color:#9fb0c2}
  .today-do-now .today-now-energy{color:#6cc5bb}
}
/* Work item components — The Hub colour system v4.
 * One shared presentation for Today, Work Queue, Projects, To-dos and Planner.
 * Controls retain full touch targets; metadata is intentionally dense. */
:root {
  --hub-space-1:4px; --hub-space-2:8px; --hub-space-3:12px;
  --hub-space-4:16px; --hub-space-5:24px;
  --work-task-text:#1b5c8c; --work-task-bg:#eaf3fa; --work-task-line:#d1e4f2;
  --work-story-text:#69479a; --work-story-bg:#f2edfa; --work-story-line:#e2d7f1;
  --work-todo-text:#176b5a; --work-todo-bg:#e8f5ef; --work-todo-line:#cfe9dc;
  --work-urgent:#aa2c3d; --work-high:#9c551b; --work-green:#247452;
}
.work-item,.work-item-body,.work-item-heading{min-width:0}
.work-item{
  --work-border:var(--line,#e3e8ef);--work-muted:var(--muted,#5c6b7e);
  --work-surface:var(--card,#fff);--work-soft:var(--sunk,#f5f7fa);
  color:var(--ink,#1b293c);
}
.work-item-heading{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px}
.work-item-title{
  display:inline;min-width:0;font-size:.87rem;font-weight:720;line-height:1.35;
  letter-spacing:-.012em;color:var(--ink,#1b293c);text-decoration:none;overflow-wrap:anywhere;
}
a.work-item-title:hover{text-decoration:underline;text-underline-offset:3px}
.work-item-origin{display:inline-flex;align-items:center;gap:7px;flex-wrap:wrap;min-width:0}
.work-item-type{
  display:inline-flex;align-items:center;min-height:20px;padding:2px 7px;
  border:1px solid var(--work-task-line);border-radius:4px;
  background:var(--work-task-bg);color:var(--work-task-text);
  font-size:.67rem;font-weight:730;line-height:1.2;white-space:nowrap;
}
.work-item-type[data-work-type="story"],.work-item-type[data-work-type="epic"]{
  background:var(--work-story-bg);border-color:var(--work-story-line);color:var(--work-story-text);
}
.work-item-type[data-work-type="to-do"],.work-item-type[data-work-type="todo"]{
  background:var(--work-todo-bg);border-color:var(--work-todo-line);color:var(--work-todo-text);
}
.work-item-type[data-work-type="bug"]{
  background:#fcf1e8;border-color:#edd4be;color:#925121;
}
.work-item-context{
  display:inline-flex;align-items:center;gap:5px;
  font-size:.72rem;line-height:1.3;font-weight:550;color:var(--work-muted);
  overflow-wrap:anywhere;
}
.work-item-project-dot{display:inline-block;width:6px;height:6px;flex:0 0 6px;
  border-radius:50%;background:#42829a}
.work-item-context[data-context-tone="blue"] .work-item-project-dot{background:#42829a}
.work-item-context[data-context-tone="violet"] .work-item-project-dot{background:#8566ad}
.work-item-context[data-context-tone="teal"] .work-item-project-dot{background:#3d9b88}
.work-item-context[data-context-tone="ochre"] .work-item-project-dot{background:#b18b48}
.work-item-context[data-context-tone="slate"] .work-item-project-dot{background:#6a8297}
.work-item-context[data-context-tone="personal"] .work-item-project-dot{background:#a47a4f}
.work-item-facts{
  display:flex;flex-wrap:wrap;align-items:center;gap:5px 11px;
  margin-top:6px;min-width:0;
}
.work-item-fact{
  display:inline-flex;align-items:center;gap:5px;min-height:18px;
  color:var(--work-muted);font-size:.72rem;line-height:1.4;white-space:nowrap;font-weight:560;
}
.work-item-icon{display:inline-block;flex:none;width:13px;height:13px;color:currentColor;opacity:.83}
.work-item-priority[data-priority="high"]{color:var(--work-high);font-weight:700}
.work-item-priority[data-priority="urgent"]{color:var(--work-urgent);font-weight:720}
.work-item-priority[data-priority="medium"]{color:var(--work-muted);font-weight:630}
.work-item-overdue{color:var(--work-urgent)!important;font-weight:720}
.work-item-missing{display:inline-flex;align-items:center;color:var(--work-muted);font-size:.79rem;font-weight:670;line-height:1.4}
.workspace-selection-complete .work-item-missing{opacity:.8}
.work-item-remaining{color:var(--ink,#1b293c);font-weight:750;font-variant-numeric:tabular-nums}
.work-item-unknown{font-variant-numeric:tabular-nums}
.work-item-compact,.work-item-card{
  display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;
  min-width:0;background:var(--work-surface);
  border:1px solid var(--work-border);border-radius:9px;
  padding:10px 12px;
}
.work-item-card{grid-template-columns:minmax(0,1fr);gap:10px;padding:13px 14px 11px}
.work-item-card>.work-item-actions{padding-top:8px;border-top:1px solid var(--work-border)}
.work-item-actions{min-width:0}
.work-item-compact-list{display:grid;gap:5px}
.work-item-card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,310px),1fr));gap:9px}
.work-item-card-grid>.work-item{min-width:0}
.work-action-bar,.work-item-primary-actions{display:flex;gap:4px;align-items:center;flex-wrap:wrap;min-width:0}
.work-action-bar form,.work-item-primary-actions form{margin:0}
.work-action-bar .btn,.work-item-primary-actions .btn,.work-item-more>summary{
  display:inline-flex;align-items:center;justify-content:center;gap:5px;
  min-height:44px;height:44px;border-radius:6px;padding:0 10px;
  font-size:.75rem;font-weight:680;line-height:1;
  white-space:nowrap;cursor:pointer;text-decoration:none;
}
.work-item-primary-actions .work-item-start{padding:0 11px}
.work-item-icon-button,.work-action-bar .work-item-icon-button,
.work-item-primary-actions .work-item-icon-button,.work-item-more>summary{
  min-width:44px;width:44px;padding:0;flex:none;
}
.work-item-icon-button .work-item-icon{width:16px;height:16px}
.work-item-primary-actions button[title="Complete"]{color:var(--work-green);border-color:var(--work-border)}
.work-item-more{position:relative;z-index:4}
.work-item-more>summary{list-style:none}
.work-item-more>summary::-webkit-details-marker{display:none}
.work-item-more[open]>.work-item-more-menu{
  position:absolute;z-index:30;top:calc(100% + 5px);right:0;
  display:grid;gap:3px;min-width:170px;max-width:min(260px,90vw);
  border:1px solid var(--work-border);border-radius:8px;
  background:var(--work-surface);padding:6px;box-shadow:0 9px 24px rgba(18,35,56,.14);
}
.work-item-more-menu form{margin:0}
.work-item-more-menu .btn{width:100%;height:auto;min-height:44px;text-align:left;justify-content:flex-start;padding:9px}
.work-item-status-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px}
.work-item-status-form select{min-width:0;max-width:140px;min-height:44px}
.work-item .btn:focus-visible,.work-item-more>summary:focus-visible,
.work-item-primary-actions .btn:focus-visible,.work-action-bar .btn:focus-visible{
  outline:3px solid var(--accent,#23658e);outline-offset:2px;
}
.work-item-table{width:100%;border-collapse:collapse;table-layout:auto}
.work-item-table thead th{font-size:.71rem;letter-spacing:.01em;
  padding:9px 11px;background:var(--work-soft,#f6f8fa);
  color:var(--work-muted);font-weight:730}
.work-item-table td{font-size:.77rem;vertical-align:middle;padding:9px 11px;
  border-bottom:1px solid var(--work-border)}
.work-item-table .work-item-task-cell{min-width:190px}
.work-item-table .work-item-task-cell .work-item-heading{display:grid;gap:4px}
.work-item-table .work-item-task-cell .work-item-title{font-size:.83rem}
.work-item-table .work-item-numeric{font-variant-numeric:tabular-nums;white-space:nowrap}
.work-item-table .work-item-table-time{font-weight:750;color:var(--ink,#1b293c)}
.work-item-table-priority{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-size:.75rem}
.work-item-priority-dot{width:7px;height:7px;border-radius:50%;background:#9eacb8}
.work-item-table-priority[data-priority="high"]{color:var(--work-high);font-weight:710}
.work-item-table-priority[data-priority="high"] .work-item-priority-dot{background:#bc7b21}
.work-item-table-priority[data-priority="urgent"]{color:var(--work-urgent);font-weight:710}
.work-item-table-priority[data-priority="urgent"] .work-item-priority-dot{background:var(--work-urgent)}
.work-item-table-priority[data-priority="medium"] .work-item-priority-dot{background:#66839a}
.work-item-table .work-item-table-actions{min-width:230px}
.work-item-table .work-item-table-actions .work-action-bar{justify-content:flex-end}
/* Today and other embedded surfaces never add duplicate work-card framing. */
.today-home .workspace-selection-main .work-item-heading,.today-home .today-attention-card-main .work-item-heading,
.today-home .today-recommendation .work-item-heading{display:flex}
.today-home .workspace-selection-main .work-item-facts,
.today-home .today-attention-card-main .work-item-facts,.today-home .today-recommendation .work-item-facts{margin-top:5px}
.today-home .workspace-selection-main .work-item-origin{margin:0}
.today-home .today-attention-card-main .work-item-origin{margin:0}
.project-home-actions-list .work-item,.project-workspace-section .work-item,
.project-explorer .work-item{margin:0}
.todo .work-item-heading,.todo .work-item-facts{display:flex}
.todo .work-item-origin{margin:0}
@media(max-width:1000px){
  .work-item-compact{grid-template-columns:minmax(0,1fr);gap:7px}
  .work-item-compact>.work-item-actions{width:100%}
  .work-item-table-wrap{overflow:visible}
  .work-item-table,.work-item-table tbody{display:block;width:100%;min-width:0}
  .work-item-table thead{display:none}
  .work-item-table tr{
    display:flex;flex-wrap:wrap;gap:7px 12px;margin-bottom:8px;
    border:1px solid var(--work-border);border-radius:9px;
    background:var(--work-surface);padding:11px;
  }
  .work-item-table td{display:inline-flex;align-items:center;padding:0;
    border:0!important;font-size:.77rem;min-width:0}
  .work-item-table td:first-child{display:block;width:100%;flex-basis:100%;margin-bottom:2px}
  .work-item-table td:last-child{display:block;flex-basis:100%;margin-top:4px}
  .work-item-table td:not(:first-child):not(:last-child)::before{
    content:attr(data-label) " ";font-size:.7rem;color:var(--work-muted);margin-right:4px}
  .work-item-table .work-item-table-actions{min-width:0}
  .work-item-table .work-item-table-actions .work-action-bar{justify-content:flex-start}
}
@media(max-width:600px){
  .work-item-compact,.work-item-card{padding:10px 11px}
  .work-item-compact{grid-template-columns:minmax(0,1fr)}
  .work-item-facts{gap:5px 9px}
  .work-item-title{font-size:.86rem}
  .work-item-table tr{padding:10px}
}
/* Cross-feature layouts should arrange the shared component, not rebuild it. */
.project-home-actions-list,.project-workspace-next-list{gap:6px}
.project-home-featured-work{display:grid;gap:7px;min-width:0}
.project-home-featured-work .work-item-heading{margin:0}
.project-home-featured-work .work-action-bar{margin-top:2px}
.project-home-actions-list>.work-item{min-width:0}
.project-home-section .work-item-compact{padding:9px 10px}
.project-home-section .work-item-card{padding:11px}
.project-workspace-section .project-workspace-next-list{display:grid;gap:6px}
.kcard .work-item-heading{display:flex;gap:5px 8px}
.kcard .work-item-title{font-size:.85rem;font-weight:740}
.kcard .work-item-facts{margin:3px 0;gap:4px 9px}
.kcard .work-item-fact{font-size:.68rem}
.kcard .work-item-origin{gap:5px}
.kcard .work-action-bar{gap:3px}
.plan-row .plan-work-info{min-width:0;flex:1}
.plan-row .work-item-heading{display:flex;gap:5px 8px}
.plan-row .work-action-bar{flex:none}
.project-explorer .explorer-card .work-item-body{min-width:0}
.project-explorer .explorer-node .work-item-heading{gap:4px 8px}
.project-explorer .explorer-node .work-item-facts{margin:0}
.project-explorer .work-item-table .work-item-table-actions{min-width:250px}
.project-explorer [data-explorer-entry][hidden]{display:none!important}
.todo-group .todo{gap:8px}
.todo-group .todo details>summary{display:flex;flex-wrap:wrap;align-items:center;gap:3px 9px;min-height:40px}
.todo-group .todo-title{font-weight:720;font-size:.87rem;flex:1 1 160px}
.todo-group .todo-work-meta{display:grid;flex:1 1 100%;gap:3px;min-width:0}
.todo-group .todo-work-meta .work-item-facts{margin:0}
.todo-group .todo .work-action-bar{flex:none}
.todo-group .todo .work-item-primary-actions{gap:3px}
.item-detail-summary{display:flex;flex-wrap:wrap;align-items:center;gap:5px 12px;margin-top:4px}
.item-detail-summary .work-item-facts{margin:0}
.item-detail-summary .work-item-origin{margin:0}
@media(max-width:1000px){
  .project-explorer .explorer-table-wrap{overflow:visible}
}
@media(max-width:700px){
  .todo-group .todo{align-items:flex-start;flex-wrap:wrap}
  .todo-group .todo details{flex:1 1 calc(100% - 36px)}
  .todo-group .todo>.work-action-bar{margin-left:28px;flex-basis:calc(100% - 28px)}
  .plan-row{flex-wrap:wrap}
  .plan-row .plan-work-info{flex:1 1 100%}
}
@media(prefers-color-scheme:dark){
  :root{
    --work-task-text:#b7dafa;--work-task-bg:#203b50;--work-task-line:#496b82;
    --work-story-text:#d6c1ff;--work-story-bg:#37294a;--work-story-line:#65527a;
    --work-todo-text:#a8e8d1;--work-todo-bg:#203d38;--work-todo-line:#3f7064;
    --work-urgent:#ffb4be;--work-high:#f3cd88;--work-green:#a9e3c1;
  }
  .work-item-type[data-work-type="bug"]{background:#452f22;color:#ffd5b3;border-color:#805c47}
}

/* The context label becomes a link only when the source has a real project ID. */
a.work-item-project-link{color:var(--accent,#235e87);text-decoration:none;
  border-radius:4px;padding:2px 4px;margin:-2px -4px;cursor:pointer}
a.work-item-project-link:hover{background:var(--work-soft);text-decoration:underline;
  text-underline-offset:3px}
a.work-item-project-link:focus-visible{outline:3px solid var(--accent,#235e87);
  outline-offset:2px}

.work-item-postponed{color:#8b5a21;font-weight:700}
@media(prefers-color-scheme:dark){.work-item-postponed{color:#f4cf92}}

/* Work pages (Today · Planner · All work · To-dos · Reflect) share one compact tab bar. */
.main .my-work-tabs{margin:2px 0 14px;gap:2px;border-bottom:1px solid var(--line,#e3e8ee);padding-bottom:6px}
.main .my-work-tabs a{padding:.45rem .8rem;font-size:.92rem;font-weight:620;color:var(--muted,#5b6b7c);
  border-radius:7px;outline:0!important;background:transparent}
.main .my-work-tabs a.current,.main .my-work-tabs a[aria-current="page"]{color:var(--text,#1c2936);
  background:var(--surface-secondary,#eef2f6);font-weight:720}

/* In lists, Start is one of several actions: quiet until you reach for it. */
.my-work-table .work-item-start,.my-work-list .work-item-start,.todos-page .work-item-start{
  background:transparent!important;color:var(--accent,#245CC4)!important;
  border:1px solid var(--line,#d6dde5)!important}
.my-work-table tr:hover .work-item-start,.todos-page .todo:hover .work-item-start,
.my-work-table .work-item-start:focus-visible,.todos-page .work-item-start:focus-visible{
  background:var(--accent,#245CC4)!important;color:#fff!important;border-color:var(--accent,#245CC4)!important}

/* To-dos on their own: the list says what they are, so no "To-do" badge on every row. */
.todos-page .work-item-type{display:none}
.todos-page .todo-group{padding-top:12px;padding-bottom:6px}
.todos-page .todos>.todo{padding-top:7px;padding-bottom:7px}
.todos-lists-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0 12px}
.todos-lists-row>.chips{margin:0}
.todos-new-list>summary{list-style:none;cursor:pointer;border-style:dashed}
.todos-new-list>summary::-webkit-details-marker{display:none}
.todos-new-list[open]{flex-basis:100%}
.todos-new-list form{margin-top:8px}

/* All work: counts live on the scope chips. */
.my-work-scopes .chip .count{margin-left:4px;font-size:.72rem;font-weight:700;opacity:.75}
.my-work-results .my-work-heading{align-items:center;margin:4px 0 8px}
.my-work-results .my-work-heading h2{margin:0;font-size:1.05rem}
.wq-booking-chips{margin:0}
/* One column grid for every group table, so Due and Left line up down the page. */
.my-work-table{table-layout:fixed;width:100%}
.my-work-table th:nth-child(1){width:auto}
.my-work-table th:nth-child(2){width:110px}
.my-work-table th:nth-child(3){width:80px}
.my-work-table th:nth-child(4){width:130px}
.my-work-table th:nth-child(5){width:110px}
.my-work-table th:nth-child(6){width:230px}
.my-work-filters{padding:12px 14px!important;margin-bottom:10px!important}
.my-work-scopes{margin:0 0 6px!important}
.my-work-group-title{margin:16px 0 6px!important;font-size:.92rem}
.work-item-parent{display:block;font-size:.72rem;color:var(--muted,#5b6b7c);margin-top:1px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.main .my-work-tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
.main .my-work-tabs::-webkit-scrollbar{display:none}
.main .my-work-tabs a{flex:0 0 auto;white-space:nowrap}
@media(max-width:600px){.main .my-work-tabs a{padding:.45rem .6rem;font-size:.88rem}}

/* Calendar: what's on, and getting ready. */
.cal-ready{margin-bottom:14px}
.cal-ready h2{margin:0 0 2px;font-size:1.05rem}
.cal-ready-list{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:2px}
.cal-ready-main{display:grid;grid-template-columns:44px minmax(0,1fr) 90px;gap:12px;align-items:center;
  padding:8px;margin:0 -8px;border-radius:8px;color:inherit;text-decoration:none}
.cal-ready-main:hover{background:var(--surface-secondary,#f3f6f9)}
.cal-ready-date{display:flex;flex-direction:column;align-items:center;line-height:1.05;
  border:1px solid var(--line,#dfe6ed);border-radius:8px;padding:5px 0;background:var(--panel,#fff)}
.cal-ready-date strong{font-size:1.05rem}
.cal-ready-date small{font-size:.66rem;text-transform:uppercase;color:var(--muted,#5b6b7c);letter-spacing:.04em}
.cal-ready-copy{display:flex;flex-direction:column;gap:1px;min-width:0}
.cal-ready-copy>strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cal-ready-now{font-size:.8rem;font-weight:650;color:#9a4a12}
.cal-ready-done{color:#2b7a55;font-weight:650}
.cal-ready-main .time-meter{margin:0}
.cal-ready-more>summary{cursor:pointer;font-size:.82rem;color:var(--accent,#245CC4);margin-top:6px}
.cal-agenda-heading{font-size:1rem;margin:14px 0 8px}
.agenda-entry{align-items:center}
.agenda-entry-body{display:flex;flex-direction:column;min-width:0;flex:1}
.cal-prep-chip{margin-left:auto;font-size:.72rem;font-weight:700;padding:3px 8px;border-radius:999px;
  background:#fdf1e6;color:#8a4310;border:1px solid #f0cfae;text-decoration:none;white-space:nowrap}
.cal-prep-add{margin:0 0 0 auto}
.agenda-entry>.btn{margin-left:auto}
.crumb-back{margin:0 0 10px;font-size:.85rem}
.event-prep-dismissed{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
@media(max-width:600px){.cal-ready-main{grid-template-columns:40px minmax(0,1fr)}.cal-ready-main .time-meter{display:none}}
.agenda .agenda-entry{grid-template-columns:5rem 4px minmax(0,1fr) auto;align-items:center}
@media(max-width:700px){.agenda .agenda-entry{grid-template-columns:4rem 3px minmax(0,1fr) auto}}
.agenda-entry .cal-prep-add,.agenda-entry>a.btn{margin:0;opacity:0;transition:opacity .12s}
.agenda-entry:hover .cal-prep-add,.agenda-entry:hover>a.btn,
.agenda-entry:focus-within .cal-prep-add,.agenda-entry:focus-within>a.btn{opacity:1}
@media(hover:none){.agenda-entry .cal-prep-add,.agenda-entry>a.btn{opacity:.75}}
.agenda-entry .cal-prep-chip{margin:0}
.work-page-lead{margin:-6px 0 12px;font-size:.85rem;color:var(--muted,#5b6b7c)}
.todo-list-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--dot);margin-right:6px}
.todos-manage-lists>summary{list-style:none;cursor:pointer}
.todos-manage-lists>summary::-webkit-details-marker{display:none}
.todos-manage-lists[open]{flex-basis:100%}
.todos-list-admin{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:6px}
.todos-list-admin li{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.todos-list-admin input[type=color]{width:32px;height:30px;padding:0;border:1px solid var(--line,#d6dde5);border-radius:6px}
.todos-list-admin .input{max-width:220px}
.todos-list-admin form{margin:0}
/* Content Studio (0048): pipeline that follows production steps, calendar, ideas, piece page. */
.studio-head { align-items: flex-start; }
.studio-summary { margin: .25rem 0 0; color: var(--muted); }
.studio-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.studio-summary a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); }
.studio-risk-text { color: var(--bad); font-weight: 600; }

.studio-new { margin: 0 0 1rem; }
.studio-new:not([open]) { display: none; }
.studio-new-form { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; align-items: end; }
.studio-new-title { grid-column: 1 / -1; }
.studio-new-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.studio-new-actions .small { flex: 1 1 260px; }
@media (max-width: 900px) { .studio-new-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .studio-new-form { grid-template-columns: 1fr; } }

.studio-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin: 0 0 1rem; }
.studio-tabs { margin: 0; }
.studio-accounts { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.studio-accounts-manage { padding-inline: .5rem; }
.studio-accounts-manage .icon { width: 15px; height: 15px; }

/* Pipeline */
.studio-pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: .75rem;
  overflow-x: auto; padding-bottom: .5rem; align-items: start; scroll-snap-type: x proximity; }
.studio-column { background: var(--sunk); border-radius: var(--r-panel, 14px); padding: .7rem; min-height: 160px; scroll-snap-align: start; }
.studio-column > h2 { display: flex; justify-content: space-between; align-items: center; margin: .1rem .2rem .6rem;
  font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.studio-column-ready > h2, .studio-column-published > h2 { color: var(--good, var(--ok)); }
.studio-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card, 10px);
  padding: .75rem .8rem; margin: 0 0 .55rem; display: grid; gap: .35rem; box-shadow: var(--shadow-sm); }
.studio-card.is-at-risk { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); box-shadow: inset 3px 0 0 var(--bad); }
.studio-card-title { font-weight: 650; color: var(--ink); text-decoration: none; line-height: 1.3; overflow-wrap: anywhere; }
.studio-card-title:hover { text-decoration: underline; }
.studio-card-meta, .studio-card-when { margin: 0; font-size: .8rem; color: var(--muted); }
.studio-card-when { display: flex; align-items: center; gap: .3rem; }
.studio-card-when .icon { width: 13px; height: 13px; }
.studio-card-risk { margin: 0; font-size: .78rem; font-weight: 600; color: var(--bad); }
.studio-progress { display: flex; align-items: center; gap: 3px; }
.studio-progress > span { flex: 1 1 0; height: 5px; border-radius: 3px; background: var(--line); max-width: 40px; }
.studio-progress > span.done { background: var(--good, var(--ok)); }
.studio-progress > span.next { background: var(--accent); }
.studio-progress small { margin-left: .4rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.studio-next { display: flex; align-items: center; gap: .5rem; border-top: 1px dashed var(--line); padding-top: .45rem; font-size: .88rem; }
.studio-empty { color: var(--faint); font-size: .85rem; margin: .3rem .2rem; }

/* CON-7: pipeline to the ContentStudio board */
.studio-bar { border-bottom: 1px solid var(--line); }
.main .studio-tabs a.on { color: var(--ink); border-bottom-color: var(--tone-pink-fg); }
.studio-pipeline { grid-auto-columns: minmax(158px, 1fr); gap: .6rem; }
.studio-column > h2 { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); }
.studio-column > h2 .count { color: var(--muted); font-weight: 500; background: none; padding: 0; }
.studio-column-ready > h2, .studio-column-published > h2 { color: var(--ink); }
.studio-column, .studio-card { min-width: 0; }
.studio-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; min-width: 0; }
.studio-fmt { min-width: 0; }
.studio-card > .btn { justify-self: stretch; white-space: normal; }
.studio-fmt { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tone-pink-fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-card-top .studio-card-when { font-size: .78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.studio-next small { font-size: .78rem; }
.studio-column-upnext { border: 1px dashed var(--line-strong); }
.studio-upnext-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.studio-upnext-start { position: relative; }
.studio-upnext-start > summary { list-style: none; }
.studio-upnext-start > summary::-webkit-details-marker { display: none; }
.studio-upnext-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 250px; display: grid; gap: .5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .8rem; box-shadow: var(--shadow-lg, 0 10px 30px rgb(0 0 0 / .15)); }
.studio-upnext-pop p { margin: 0; }
.studio-upnext-more { display: block; margin: .2rem .25rem 0; }
.studio-risk-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 0 0 1rem; padding: .6rem .9rem;
  border: 1px solid var(--tone-amber-border); background: var(--tone-amber-bg); color: var(--tone-amber-fg); border-radius: 12px; font-size: .92rem; }
.studio-risk-banner > span { flex: 1 1 280px; }
.studio-pipeline-note { margin: .6rem .2rem 0; max-width: 70ch; }

/* Round tick used for steps */
.studio-tick { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong);
  background: var(--surface); cursor: pointer; padding: 0; position: relative; }
.studio-tick:hover, .studio-tick:focus-visible { border-color: var(--good, var(--ok)); }
.studio-tick:hover::after, .studio-tick.on::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid var(--good, var(--ok)); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.studio-tick.on { background: var(--good, var(--ok)); border-color: var(--good, var(--ok)); }
.studio-tick.on::after { border-color: #fff; }

/* Phase pills */
.studio-phase { display: inline-flex; align-items: center; border-radius: 999px; padding: .1rem .55rem; font-size: .75rem; font-weight: 650;
  background: var(--tone-slate-bg); color: var(--tone-slate-fg); border: 1px solid var(--tone-slate-border); white-space: nowrap; }
.studio-phase-write { background: var(--tone-violet-bg); color: var(--tone-violet-fg); border-color: var(--tone-violet-border); }
.studio-phase-make { background: var(--tone-amber-bg); color: var(--tone-amber-fg); border-color: var(--tone-amber-border); }
.studio-phase-edit { background: var(--tone-blue-bg); color: var(--tone-blue-fg); border-color: var(--tone-blue-border); }
.studio-phase-publish { background: var(--tone-pink-bg); color: var(--tone-pink-fg); border-color: var(--tone-pink-border); }
.studio-phase-ready, .studio-phase-published { background: var(--tone-green-bg); color: var(--tone-green-fg); border-color: var(--tone-green-border); }

/* Calendar */
.studio-calendar { display: grid; gap: .75rem; max-width: 1170px; }
.studio-week > h2 { display: flex; gap: .5rem; align-items: center; font-size: 1rem; margin: 0 0 .4rem; }
.studio-week.is-past { opacity: .7; }
.studio-week.is-current { border-color: var(--accent); }
.studio-cal-row { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto auto; gap: .4rem .8rem; align-items: center;
  padding: .55rem .2rem; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.studio-cal-row:first-of-type { border-top: 0; }
.studio-cal-row:hover .studio-cal-title { text-decoration: underline; }
.studio-cal-row.is-at-risk .studio-cal-day strong { color: var(--bad); }
.studio-cal-day { display: grid; text-align: center; font-size: .72rem; color: var(--muted); text-transform: uppercase; line-height: 1.1; }
.studio-cal-day strong { font-size: 1.15rem; color: var(--ink); }
.studio-cal-title { display: grid; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.studio-cal-title small { font-weight: 400; }
@media (max-width: 640px) { .studio-cal-row { grid-template-columns: 2.6rem minmax(0, 1fr) auto; }
  .studio-cal-row > :nth-child(4) { grid-column: 2 / -1; } }

/* Ideas */
.studio-ideas-capture { margin: 0 0 1rem; }
.studio-idea-form { display: flex; flex-wrap: wrap; gap: .5rem; }
.studio-idea-form .grow { flex: 1 1 260px; }
.studio-idea-tags { margin-top: .7rem; }
.studio-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.studio-idea { display: grid; gap: .4rem; align-content: start; }
.studio-idea p { margin: 0; }
.studio-idea-start { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; padding-top: .55rem; border-top: 1px solid var(--line); }
.studio-idea-start select { flex: 1 1 120px; min-width: 0; }
.studio-idea-start input { flex: 1 1 120px; min-width: 0; }
.studio-dropped { margin-top: 1rem; }
/* CON-4: Library ideas set for production, and the ones still only in Library */
.studio-flagged { margin: 0 0 1.25rem; }
.studio-flagged h2, .studio-subhead { font-size: 1rem; margin: 0 0 .6rem; }
.studio-idea-library { border-left: 3px solid var(--accent); }
.studio-from { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; color: var(--muted); }
.studio-from svg { width: 13px; height: 13px; }
.studio-library-ideas { margin-top: 1rem; }
.studio-library-ideas > summary { font-weight: 600; cursor: pointer; }
.studio-library-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .45rem 0; border-top: 1px solid var(--line); }
.idea-production { display: grid; gap: .45rem; padding: .6rem 0 .8rem; margin-bottom: .6rem; border-bottom: 1px solid var(--line); }
.idea-production p { margin: 0; }
.idea-production-badge { font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); text-decoration: none; }

/* Accounts */
.studio-account-settings { margin-top: 1.5rem; }
.studio-account-settings > summary { font-weight: 600; cursor: pointer; }
.studio-account-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--line); }
.studio-account-row .input { flex: 1 1 180px; width: auto; }

/* Piece page */
.studio-piece-head { margin: 0 0 1rem; }
.studio-piece-head h1 { margin: .35rem 0 .45rem; overflow-wrap: anywhere; }
.studio-piece-risk { margin: .7rem 0 0; padding: .55rem .8rem; border-radius: 10px; font-weight: 600;
  background: var(--tone-rose-bg); color: var(--tone-rose-fg); border: 1px solid var(--tone-rose-border); }
.studio-piece { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 960px) { .studio-piece { grid-template-columns: 1fr; } }
.studio-start-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.studio-start-steps { margin: .6rem 0 0; }
.studio-steps .meter { margin: .3rem 0 .5rem; }
.studio-step-list { list-style: none; margin: 0; padding: 0; }
.studio-step { display: flex; align-items: center; gap: .7rem; padding: .6rem .1rem; border-top: 1px solid var(--line); }
.studio-step:first-child { border-top: 0; }
.studio-step > form:first-child { display: flex; }
.studio-step-body { flex: 1 1 auto; display: grid; min-width: 0; }
.studio-step-title { font-weight: 600; }
.studio-step.is-done .studio-step-title { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.studio-step.is-next { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 8px; padding-inline: .5rem; }
.studio-step-remove .btn { opacity: .55; }
.studio-step-remove .btn:hover { opacity: 1; }
.studio-step-remove .icon { width: 15px; height: 15px; }
.studio-step-add { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.studio-step-add .grow { flex: 1 1 220px; }
.studio-script textarea { min-height: 18rem; font-family: var(--mono, ui-monospace, monospace); }
.studio-note-picks { max-height: 14rem; overflow: auto; margin-top: .5rem; }
.studio-piece-side h2 { margin-top: 0; }
.studio-published { margin-top: .75rem; }
.studio-published > summary { font-weight: 600; cursor: pointer; }
.studio-published[open] > summary { margin-bottom: .4rem; }
.studio-week.is-empty { padding-block: .55rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem 1rem; }
.studio-week.is-empty > h2 { margin: 0; font-size: .92rem; }
.studio-week.is-empty > h2 .count { display: none; }
.studio-week.is-empty .studio-empty { margin: 0; }

/* CON-3: posts per platform */
.studio-posts { display: grid; gap: 6px; }
.studio-post { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.studio-post > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; cursor: pointer; list-style: none; }
.studio-post > summary::-webkit-details-marker { display: none; }
.studio-post[open] > summary { margin-bottom: 8px; }
.studio-post-platform { font-weight: 700; flex: 1; }
.studio-post-status { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.studio-post-published .studio-post-status { background: color-mix(in srgb, #1F7A3A 12%, transparent); color: #1F7A3A; }
.studio-post-dropped { opacity: .65; }
.studio-post-dropped .studio-post-status { background: var(--sunk); color: var(--muted); }
.studio-post-acts { margin-top: 8px; gap: 6px; }
.studio-post-acts form { display: inline-flex; gap: 4px; }
.studio-post-add { gap: 6px; margin-top: 4px; }
.studio-cal-platform { display: inline-grid; place-items: center; min-width: 22px; height: 18px; margin-right: 6px; padding: 0 4px; border-radius: 5px; background: var(--sunk); font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--muted); vertical-align: 1px; }

/* CON-5: formats you own */
.studio-formats { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 1.1rem 1.2rem; }
.studio-formats::backdrop { background: rgb(0 0 0 / .35); }
.studio-formats-head { align-items: flex-start; margin-bottom: .6rem; }
.studio-formats-head h2 { margin: 0 0 .2rem; font-size: 1.1rem; }
.studio-formats-head p { margin: 0; }
.studio-format { border-top: 1px solid var(--line); padding: .55rem 0; }
.studio-format > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
.studio-format.is-archived > summary strong { color: var(--muted); }
.studio-format-form { margin-top: .6rem; }
.studio-format-steps { width: 100%; border-collapse: collapse; }
.studio-format-steps th { text-align: left; font-size: .72rem; font-weight: 600; color: var(--muted); padding: 0 .3rem .25rem; }
.studio-format-steps td { padding: .2rem .3rem; }
.studio-format-steps td:first-child { width: 46%; }
.studio-format-steps .input { width: 100%; }
.studio-format-steps tr.is-new .input { border-style: dashed; }
.studio-format-new { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .4rem; align-items: end; }
.studio-formats-open svg { width: 14px; height: 14px; }
@media (max-width: 640px) {
  .studio-format-steps thead { display: none; }
  .studio-format-steps tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .3rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
  .studio-format-steps td:first-child { grid-column: 1 / -1; width: auto; }
}

/* CON-7: piece header to the ContentPiece board */
.studio-piece-pills { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0 .2rem; }
.studio-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: .1rem .6rem; font-size: .75rem; font-weight: 600;
  background: var(--sunk); color: var(--muted); border: 1px solid var(--line); }
.studio-piece-facts { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 .2rem; }
.studio-fact { display: inline-flex; align-items: baseline; gap: .35rem; min-height: 34px; padding: .35rem .7rem; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); color: var(--muted); font-size: .82rem; text-decoration: none; }
.studio-fact b { color: var(--ink); font-weight: 600; }
a.studio-fact:hover { border-color: var(--line-strong); text-decoration: none; }
.studio-piece-part { margin: .3rem 0 0; }
/* Stage 4: Next card, Not now and Why this?, What now? popover, focus timer styles. */
.next-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 8px 0 0; padding: 0; }
.next-chips .pill { font-size: 12.5px; }
.next-meta { color: var(--muted); }
.next-notnow, .next-why { position: relative; display: inline-block; }
.next-notnow > summary, .next-why > summary { list-style: none; cursor: pointer; }
.next-notnow > summary::-webkit-details-marker, .next-why > summary::-webkit-details-marker { display: none; }
.next-notnow-menu, .next-why-panel { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(320px, 86vw); padding: 10px; box-shadow: var(--shadow-lg); }
.next-notnow-menu p { margin: 2px 6px 8px; }
.next-notnow-menu button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: 600 14.5px var(--body); text-align: left; cursor: pointer; }
.next-notnow-menu button span { font-weight: 400; font-size: 13px; color: var(--muted); }
.next-notnow-menu button:hover, .next-notnow-menu button:focus-visible { background: var(--surface-2); }
.next-notnow-menu .next-notnow-skip { justify-content: center; color: var(--accent); border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; margin-top: 4px; }
.next-why-panel ul { margin: 4px 0 8px; padding-left: 18px; }
.next-notnow-done { margin: 8px 0 0; }
.whatnow-pop { inline-size: min(460px, 92vw); padding: 16px 18px; }
.whatnow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.whatnow-head h2 { margin: 0; font: 800 18px var(--display); }
.whatnow-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.whatnow-pills > span { font-size: 13px; color: var(--muted); margin-right: 2px; }
.whatnow-pills .pill { cursor: pointer; border: 1px solid var(--line); background: var(--surface); min-height: 32px; padding: 0 12px; font-weight: 600; }
.whatnow-pills .pill[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.whatnow-results { margin-top: 12px; }
.whatnow-best { padding: 14px; border: 1px solid var(--accent-soft); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); border-radius: 14px; display: grid; gap: 6px; }
.whatnow-lab { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; color: var(--accent); }
.whatnow-title { font: 700 16px/1.3 var(--display); }
.whatnow-best .row, .whatnow-alt { display: flex; gap: 8px; align-items: center; }
.whatnow-best form, .whatnow-alt form { margin: 0; }
.whatnow-alt { justify-content: space-between; padding: 10px 2px; border-top: 1px solid var(--line); }
.whatnow-alt-text { display: grid; min-width: 0; }
.whatnow-more { display: inline-block; margin-top: 6px; }
.whatnow-ask { display: flex; align-items: center; gap: 8px; margin: 12px -18px -16px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-panel, 16px) var(--r-panel, 16px); }
.whatnow-ask .input { flex: 1; min-width: 0; }
.whatnow-pop #what-now-answer { margin-top: 18px; }
/* Focus timer picture: ring (fills as time is used) or wedge (shrinks as time runs out). */
.focus-visual { position: relative; width: 168px; height: 168px; margin: 8px auto 4px; display: grid; place-items: center; }
.focus-visual.sm { width: 112px; height: 112px; margin: 6px 0; }
.focus-visual-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.focus-visual-ring circle { fill: none; stroke-width: 9; }
.focus-visual-ring .track { stroke: var(--line); }
.focus-visual-ring .fill { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 0 327; transition: stroke-dasharray .9s linear; }
.focus-visual-wedge { position: absolute; inset: 6%; border-radius: 50%; display: none; background: conic-gradient(var(--accent) calc(var(--left, 1) * 1turn), var(--line) 0); }
.focus-visual-text { position: relative; display: grid; place-items: center; width: 74%; height: 74%; border-radius: 50%; background: var(--surface); text-align: center; align-content: center; }
.focus-visual-text strong { font: 800 26px var(--display); font-variant-numeric: tabular-nums; }
.focus-visual.sm .focus-visual-text strong { font-size: 19px; }
.focus-visual-text span { font-size: 12px; color: var(--muted); }
.focus-visual.over .fill { stroke: var(--guess-line); }
.focus-visual.paused { opacity: .7; }
:root[data-timer-style="wedge"] .focus-visual-ring { display: none; }
:root[data-timer-style="wedge"] .focus-visual-wedge { display: block; }
:root[data-timer-style="wedge"] .focus-visual-text { width: 56%; height: 56%; }
:root[data-timer-style="wedge"] .focus-visual.sm .focus-visual-text { width: 62%; height: 62%; box-shadow: 0 0 0 2px var(--surface); }
:root[data-timer-style="wedge"] .focus-visual.sm .focus-visual-text strong { font-size: 16px; }
:root[data-timer-style="wedge"] .focus-visual.sm .focus-visual-text span { display: none; }
.focus-style-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin: 4px 0 10px; }
.focus-style-form .btn.on { background: var(--accent-soft); color: var(--accent-2); }
.next-focus { float: right; margin-left: 12px; }
/* Top-bar chip in wedge style */
.focus-chip-wedge { display: none; inline-size: 18px; block-size: 18px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(#6EA0FF calc(var(--left, 1) * 1turn), rgba(255,255,255,.2) 0); }
:root[data-timer-style="wedge"] .focus-chip-ring { display: none; }
:root[data-timer-style="wedge"] .focus-chip-wedge { display: inline-block; }
/* Your hours */
.hours-scale, .hours-day { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; }
.hours-scale div { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.hours-day { height: 26px; }
.hours-day b { font-size: 13px; color: var(--muted); }
.hours-bar { position: relative; height: 18px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hours-seg { position: absolute; top: 0; bottom: 0; }
.hours-protected { background: #E0F2F5; } .hours-work { background: #C8D9F5; } .hours-personal { background: #E6F4EA; } .hours-off { background: #DCE2EA; }
.hours-key { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 0 54px; font-size: 13px; }
.hours-key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hours-list { list-style: none; margin: 8px 0; padding: 0; }
.hours-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hours-swatch { width: 14px; height: 14px; border-radius: 4px; }
.hours-what { flex: 1; min-width: 12rem; display: grid; }
.hours-kind { color: var(--muted); max-width: 18rem; text-align: right; }
.hours-row form { margin: 0; }
.hours-type-form { gap: 10px; align-items: center; flex: 1; flex-wrap: wrap; }
.hours-type-form input.input { max-width: 220px; } .hours-type-form select.input { max-width: none; width: auto; }
.hours-colour { width: 36px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.hours-edit, .hours-add { position: relative; }
.hours-edit > summary, .hours-add > summary { list-style: none; cursor: pointer; }
.hours-edit > summary::-webkit-details-marker, .hours-add > summary::-webkit-details-marker { display: none; }
.hours-edit[open] { flex-basis: 100%; order: 9; }
.hours-form { display: grid; gap: 10px; margin-top: 10px; max-width: 832px; }
.hours-days, .hours-projects { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.hours-days legend, .hours-projects legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.hours-daychip input { position: absolute; opacity: 0; }
.hours-daychip span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; }
.hours-daychip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hours-daychip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hours-empty { padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.next-hours { margin: 6px 0 0; }
.next-just-start { display: inline; margin: 0; }

/* Keep the top bar on one row while a focus session runs. */
@media (max-width: 1500px) {
  .focus-chip strong { max-inline-size: 7.5rem; }
  .topbar:has(.focus-chip:not([hidden])) .btn.whatnow span { display: none; }
}
@media (max-width: 1280px) { .focus-chip strong { display: none; } }
/* Inbox: append under a heading, complete, automation cards, batch size */
.inbox-append, .inbox-card { display: grid; gap: 8px; padding: 12px 14px; border-color: var(--accent-soft); }
.inbox-append p { margin: 0; }
.inbox-append-heading { display: inline-block; width: auto; min-height: 32px; margin-left: 4px; }
.inbox-append-preview { border-left: 3px solid var(--line); padding: 4px 10px; display: grid; gap: 2px; }
.inbox-append-context { white-space: pre-wrap; }
.inbox-append-new { white-space: pre-wrap; background: var(--accent-soft); border-radius: 6px; padding: 2px 6px; }
.inbox-card-items { width: 100%; border-collapse: collapse; }
.inbox-card-items th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.inbox-card-items td { padding: 3px 6px; }
.inbox-card-items .input { min-height: 34px; }
.input.guessed { background: var(--guess-bg); border-color: var(--guess-line); color: var(--guess-ink); }
.inbox-batch-size { align-items: center; gap: 8px; margin-top: 6px; }
.inbox-batch-size .input { width: auto; min-height: 32px; }
/* Ask: full page and side panel */
.ask-page { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.ask-sidebar { display: grid; gap: 10px; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: hidden auto; min-width: 0; }
.ask-sidebar > * { min-width: 0; }
.ask-threads { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ask-thread { display: flex; align-items: center; gap: 2px; border-radius: 9px; }
.ask-thread.on, .ask-thread:hover { background: var(--surface-2); }
.ask-thread-open { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 8px 10px; font: 500 14px var(--body); color: var(--ink); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-thread .btn.icon { opacity: 0; }
.ask-thread:hover .btn.icon, .ask-thread:focus-within .btn.icon, .ask-thread.on .btn.icon { opacity: 1; }
.ask-main { display: grid; grid-template-rows: auto 1fr auto auto auto; min-height: calc(100vh - 220px); gap: 10px; }
.ask-head { display: flex; align-items: baseline; gap: 10px; }
.ask-head h2 { margin: 0; }
.ask-log { overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; min-height: 200px; }
.ask-msg { display: grid; gap: 6px; max-width: 760px; }
.ask-user { align-self: flex-end; }
.ask-user .ask-bubble { background: var(--accent); color: var(--accent-ink); border-radius: 16px 16px 4px 16px; padding: 10px 14px; white-space: pre-wrap; }
.ask-assistant .ask-bubble { background: var(--surface-2); border-radius: 16px 16px 16px 4px; padding: 10px 14px; }
.ask-text p { margin: 0 0 6px; } .ask-text p:last-child { margin-bottom: 0; }
.ask-text ul, .ask-text ol { margin: 4px 0; padding-left: 20px; }
.ask-thinking .ask-bubble { color: var(--muted); }
.ask-model { margin-left: 4px; }
.ask-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px; background: var(--surface); }
.ask-pick { border-color: var(--accent-soft); }
.ask-pick form { margin: 0; }
.ask-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ask-changes li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.ask-status { margin-left: auto; text-transform: capitalize; }
.ask-undo { display: flex; align-items: center; gap: 8px; }
.ask-prompts { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-prompts .pill { border: 1px solid var(--line); background: var(--surface); cursor: pointer; min-height: 32px; padding: 0 12px; }
.ask-form { display: flex; gap: 8px; align-items: flex-end; }
.ask-form textarea { flex: 1; resize: vertical; min-height: 44px; }
/* ASK-7: highlights behind the Ask box (the Capture popup's mirror) and what was recognised. */
.ask-hl-box { position: relative; flex: 1; min-width: 0; display: flex; background: var(--surface); border-radius: 9px; }
.ask-hl-box textarea { position: relative; z-index: 1; width: 100%; background: transparent; }
.ask-hl-mirror { position: absolute; top: 0; left: 0; overflow: hidden; pointer-events: none; color: transparent;
  white-space: pre-wrap; overflow-wrap: break-word; border-style: solid; border-color: transparent; margin: 0; }
.ask-hl-mirror mark.hl { color: transparent; padding: 0; border-radius: 4px; }
.ask-understood { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 12px; }
.ask-understood[hidden] { display: none; }
.ask-understood-label { font-weight: 600; }
.ask-understood mark.hl { padding: 1px 6px; }
.ask-error { color: var(--bad, #B42318); }
.ask-empty { margin: auto 0; text-align: center; }
.ask-switches { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.ask-endpoint { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 10px; margin: 0 0 10px; }
.ask-endpoint legend { font-weight: 600; padding: 0 4px; }
.ask-endpoint .seg, .ask-endpoint p { grid-column: 1 / -1; }
/* Side panel (Ctrl J) */
.ask-panel { position: fixed; z-index: 55; top: 72px; right: 12px; bottom: 12px; width: min(420px, calc(100vw - 24px)); display: grid; grid-template-rows: auto 1fr auto; gap: 10px; box-shadow: var(--shadow-lg); padding: 14px; }
.ask-panel[hidden] { display: none; }
.ask-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ask-panel .ask-log { min-height: 0; }
.ask-panel .ask-msg { max-width: 100%; }
@media (max-width: 860px) { .ask-page { grid-template-columns: 1fr; } .ask-sidebar { position: static; max-height: none; } .ask-endpoint { grid-template-columns: 1fr; } }

/* Today: List, Day and Week */
.today-view-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-sunken, #E6ECF3); }
.today-view-switch a { padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: .85rem; color: var(--muted, #4F6178); text-decoration: none; }
.today-view-switch a:hover { color: var(--text, #15253D); }
.today-view-switch a[aria-current="page"] { background: var(--surface, #fff); color: var(--text, #15253D); box-shadow: 0 1px 2px rgb(21 37 61 / 10%); }
.today-home-header-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.next-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; padding: .7rem 1rem; border-color: #C9D8EE; margin-bottom: 1.2rem; }
.next-strip-label { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent, #245CC4); }
.next-strip-title { flex: 1 1 220px; font-weight: 700; color: var(--text, #15253D); text-decoration: none; min-width: 0; }
a.next-strip-title:hover { text-decoration: underline; }
.next-strip-meta { font-size: .85rem; color: var(--muted, #4F6178); }
.next-strip form { margin: 0; }
.next-strip .work-item-primary-actions { display: inline-flex; gap: .3rem; }
.today-calendar-key { margin: .8rem .2rem 0; }
.planner-cal-segment #today-view-list { text-decoration: none; }
/* Life › Routines & habits (Life board): flows, rotations, routines and habits on one page. */
.lf { max-width: 1350px; margin: 0 auto; padding: 10px 0 48px; display: grid; gap: 14px; }
.lf-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 6px; }
.lf-date { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.lf-title { margin: 4px 0 0; font: 800 32px/1.1 var(--display); letter-spacing: -0.04em; }
.lf h2 { margin: 0; font: 700 19px/1.2 var(--display); letter-spacing: -0.02em; }
.lf h3 { margin: 0; font: 700 18px/1.25 var(--display); }
.lf h3 a, .lf-row-title { color: var(--ink); text-decoration: none; }
.lf h3 a:hover, .lf-row-title:hover { color: var(--accent); }
.lf-sub { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.lf-sub svg { width: 13px; height: 13px; vertical-align: -2px; }
.lf-sec-head, .lf-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lf-sec-head { margin-top: 6px; }
.lf-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; min-width: 0; }
.lf-card-head { margin-bottom: 8px; }
.lf-icons { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.lf-inline { margin: 0; display: inline-flex; }
.lf .btn.icon { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 11px; display: inline-grid; place-items: center; }
.lf .btn.icon svg { width: 18px; height: 18px; }
.lf-ibtn { border: 1px solid #D5DEE8; background: var(--surface); color: var(--muted); }
.lf-ibtn.lf-go { background: var(--accent); border-color: var(--accent); color: #fff; }
.lf .btn.icon.danger { color: #B42318; }
/* add forms open as a panel under their + button */
.lf-add { position: relative; }
.lf-add > summary { list-style: none; cursor: pointer; }
.lf-add > summary::-webkit-details-marker { display: none; }
.lf-add[open] > summary { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); }
.lf-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(560px, calc(100vw - 32px)); max-height: 75vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg, 0 18px 50px rgba(21, 37, 61, .18)); padding: 16px; }
.lf-pop > form.panel { border: 0; padding: 0; box-shadow: none; background: none; }
.lf-pop h3 { margin-bottom: 8px; }
/* active sessions */
.lf-active { display: grid; gap: 6px; }
.lf-active-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-strong); text-decoration: none; }
.lf-active-row svg { width: 18px; height: 18px; }
.lf-active-row span:nth-child(2) { flex: 1; }
.lf-active-go { font-weight: 700; }
/* flows */
.lf-flow .lf-card-head { margin-bottom: 14px; }
.lf-stages { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; counter-reset: none; }
.lf-stage { flex: 1 1 0; min-width: 0; display: grid; gap: 4px; align-content: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #F7F9FC; position: relative; }
.lf-stage + .lf-stage::before { content: "→"; position: absolute; left: -10px; top: 50%; transform: translate(-50%, -50%); color: #9AAABD; font-size: 14px; }
.lf-kind { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.lf-stage-name { font: 700 16px/1.25 var(--display); color: var(--ink); text-decoration: none; }
.lf-stage-name:hover { color: var(--accent); }
.lf-dashed { width: 100%; min-height: 56px; border: 1.5px dashed #C5CEDA; border-radius: 16px; background: transparent; color: var(--muted);
  font: 600 14px var(--body); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.lf-dashed:hover { border-color: var(--accent); color: var(--accent-strong); }
.lf-dashed svg { width: 18px; height: 18px; }
/* rotations + routines */
.lf-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.lf-rot { padding: 12px 0; border-top: 1px solid #EDF1F6; }
.lf-rot:first-of-type { border-top: 0; }
.lf-row-head { display: flex; align-items: center; gap: 8px; }
.lf-row-head strong { flex: 1; font-size: 15px; }
.lf-row-head a { color: var(--ink); text-decoration: none; }
.lf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.lf-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid #D5DEE8; background: var(--surface); font-size: 13px; font-weight: 600; color: #33465E; }
.lf-chip.is-next { background: var(--accent); border-color: var(--accent); color: #fff; }
.lf-chip.is-done { background: #E6F4EA; border-color: #B9DEC4; color: #1F7A3A; }
.lf-sep { color: #9AAABD; }
.lf-ok { color: #1F7A3A; }
.lf-row, .lf-habit { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #EDF1F6; }
.lf-card-head + .lf-row, .lf-habit-head + .lf-habit { border-top: 0; }
.lf-row-icon { width: 32px; height: 32px; border-radius: 9px; background: #EDF2F8; display: grid; place-items: center; flex-shrink: 0; }
.lf-grow { flex: 1; min-width: 0; }
.lf-row-title { font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.lf-due { color: var(--accent-strong); }
.lf-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.lf-note strong { color: var(--ink); }
.lf-empty { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.lf-archived { margin-top: 10px; font-size: 13px; }
.lf-archived summary { cursor: pointer; color: var(--muted); }
.lf-archived a { display: block; padding: 4px 0; }
/* habits */
.lf-habit { display: grid; grid-template-columns: minmax(0, 1fr) auto 72px auto; column-gap: 18px; }
.lf-habit-head { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-bottom: 4px; }
.lf-right { text-align: right; }
.lf-prog { font-weight: 700; font-variant-numeric: tabular-nums; }
.lf-week { display: flex; gap: 4px; }
.lf-d { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: #EDF2F8; color: var(--muted); }
.lf-d.s-done { background: var(--hc, var(--accent)); color: #fff; }
.lf-d.s-partial { background: color-mix(in srgb, var(--hc, var(--accent)) 35%, #fff); color: var(--ink); }
.lf-d.s-skipped { background: #F2F4F7; color: #9AAABD; text-decoration: line-through; }
.lf-d.s-off { background: transparent; color: #C5CEDA; }
.lf-d.s-due, .lf-d.s-open { background: var(--surface); border: 1.5px dashed #C5CEDA; }
.lf-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.lf-fold summary { cursor: pointer; font-weight: 600; }
@media (max-width: 900px) {
  .lf-grid { grid-template-columns: 1fr; }
  .lf-stages { flex-direction: column; }
  .lf-stage + .lf-stage::before { content: "↓"; left: 50%; top: -10px; transform: translate(-50%, -50%); }
  .lf-habit { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .lf-habit-head { display: none; }
  .lf-week { grid-column: 1 / -1; order: 3; }
  .lf-prog { order: 2; }
}
html[data-theme="dark"] .lf-stage { background: rgba(255, 255, 255, .03); }
html[data-theme="dark"] .lf-row-icon, html[data-theme="dark"] .lf-d { background: rgba(255, 255, 255, .06); }

/* Nov 2026 rebuild, per the Life design: flow states, rotation week, quick add. */
.lf-done-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: #1F7A3A; margin-right: 6px; white-space: nowrap; }
.lf-done-pill svg, .lf-ok-line svg { width: 16px; height: 16px; }
.lf-ok-line { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 13px; font-weight: 600; color: #1F7A3A; }
.lf-stage { background: var(--surface); }
.lf-stage.is-rotation { border-color: #C5D7F5; background: #F7FAFF; }
.lf-stage.s-completed { border-color: #B9DEC4; }
.lf-stage.s-skipped { opacity: .65; }
.lf-sub strong { color: var(--ink); }
.lf-explain { margin: 12px 0 0; background: #F7F9FC; border-radius: 12px; padding: 11px 13px; font-size: 13.5px; line-height: 1.5; color: #33465E; }
.lf-explain strong { color: var(--ink); }
.lf-weekstrip { margin-top: 14px; }
.lf-weekstrip ol { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.lf-weekstrip li { text-align: center; min-width: 0; }
.lf-wbox { display: grid; place-items: center; height: 30px; border-radius: 7px; background: #EDF2F8; font-size: 12px; font-weight: 700; color: var(--muted); }
.lf-weekstrip .w-done .lf-wbox { background: #0E6E86; color: #fff; }
.lf-weekstrip .w-skipped .lf-wbox, .lf-weekstrip .w-rest .lf-wbox { background: #F2F4F7; color: #9AAABD; }
.lf-weekstrip .w-missed .lf-wbox { background: var(--surface); border: 1.5px dashed #C5CEDA; color: #9AAABD; }
.lf-weekstrip .w-next .lf-wbox { background: var(--surface); border: 1.5px solid var(--accent); color: var(--accent-strong); }
.lf-weekstrip .w-later .lf-wbox { background: transparent; border: 1px solid #EDF1F6; }
.lf-wday { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lf-weekstrip .is-today .lf-wday { color: var(--ink); font-weight: 700; }
.lf-pop-wide { width: min(620px, calc(100vw - 32px)); }
.lf-pop-sm { width: min(380px, calc(100vw - 32px)); }
.lf-pop-left { right: auto; left: 0; }
.lf-add-sm { display: inline-flex; }
.lf-kinds { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lf-kindopt { display: block; cursor: pointer; }
.lf-kindopt input { position: absolute; opacity: 0; pointer-events: none; }
.lf-kindopt > span { display: grid; gap: 3px; height: 100%; box-sizing: border-box; border: 1px solid #D5DEE8; border-radius: 12px; padding: 11px 13px; }
.lf-kindopt small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.lf-kindopt input:checked + span { border: 2px solid var(--accent); background: #F5F9FF; padding: 10px 12px; }
.lf-kindopt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.lf-daypick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lf-daypick legend { width: 100%; margin-bottom: 4px; }
.lf-daypick .lf-dc { cursor: pointer; display: inline-flex; width: auto; margin: 0; position: relative; }
.lf-dc input { position: absolute; opacity: 0; }
.lf-dc span:first-of-type { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid #D5DEE8; font-size: 12px; font-weight: 700; color: var(--muted); }
.lf-dc input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.lf-dc input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.lf-new textarea { font-family: inherit; }
html[data-theme="dark"] .lf-stage.is-rotation, html[data-theme="dark"] .lf-explain { background: rgba(255, 255, 255, .04); }
html[data-theme="dark"] .lf-wbox { background: rgba(255, 255, 255, .06); }
@media (max-width: 900px) { .lf-kinds { grid-template-columns: 1fr; } .lf-wday { font-size: 10.5px; } }
.lf .lf-new .lf-daypick { flex-direction: row; align-items: center; }
.lf .lf-new .lf-daypick .lf-dc { display: inline-flex; flex: 0 0 auto; }

/* Habits table (Life design): habit + source · Mon–Sun · progress · tick, skip, edit, delete.
   Shared by Life › Routines & habits and the Habits page. */
.ht { display: grid; }
.ht-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px auto; align-items: center; column-gap: 18px; padding: 12px 0; border-top: 1px solid #EDF1F6; }
.ht-head { border-top: 0; padding: 4px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ht-head + .ht-row { border-top: 0; }
.ht-weekh { min-width: calc(7 * 26px + 6 * 4px); }
.ht-right { text-align: right; }
.ht-name { min-width: 0; display: grid; gap: 3px; }
.ht-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); text-decoration: none; }
.ht-title:hover { color: var(--accent); }
.ht-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.ht-source { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.ht-source.is-auto { font-weight: 600; }
.ht-source svg { width: 14px; height: 14px; flex-shrink: 0; }
.ht-week { display: flex; gap: 4px; }
.ht-d { width: 26px; height: 26px; border-radius: 7px; border: 0; padding: 0; display: grid; place-items: center; font: 700 11px var(--body); background: #EDF2F8; color: var(--muted); }
button.ht-d { cursor: pointer; }
button.ht-d:hover { outline: 2px solid color-mix(in srgb, var(--hc, var(--accent)) 45%, transparent); }
button.ht-d:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ht-d.s-done { background: var(--hc, #0E6E86); color: #fff; }
.ht-d.s-partial { background: color-mix(in srgb, var(--hc, #0E6E86) 35%, #fff); color: var(--ink); }
.ht-d.s-skipped { background: #F2F4F7; color: #9AAABD; text-decoration: line-through; }
.ht-d.s-missed { background: var(--surface); border: 1.5px dashed #C5CEDA; color: #9AAABD; }
.ht-d.s-due, .ht-d.s-open { background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--hc, var(--accent)) 60%, #fff); color: var(--ink); }
.ht-d.s-off { background: transparent; color: #C5CEDA; }
.ht-d.s-later { background: transparent; border: 1px solid #EDF1F6; color: #9AAABD; }
.ht-prog { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ht-acts { display: inline-flex; align-items: center; gap: 2px; }
.ht-tick, .ht-tick-gap { width: 36px; height: 36px; margin-right: 4px; flex-shrink: 0; }
.ht-tick { display: grid; place-items: center; border-radius: 9px; border: 1px solid #D5DEE8; background: var(--surface); color: var(--muted); cursor: pointer; font: 700 13px var(--body); }
.ht-tick svg { width: 18px; height: 18px; }
.ht-tick:hover { border-color: var(--hc, var(--accent)); color: var(--ink); }
.ht-tick.s-done { background: var(--hc, #0E6E86); border-color: var(--hc, #0E6E86); color: #fff; }
.ht-tick.s-partial { border-color: var(--hc, #0E6E86); color: var(--ink); }
.ht-tick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ht .btn.icon { width: 36px; height: 36px; min-height: 36px; padding: 0; display: inline-grid; place-items: center; border-radius: 9px; }
.ht .btn.icon svg { width: 17px; height: 17px; }
.ht .btn.icon.danger { color: #B42318; }
.ht .habit-row.dragging { opacity: .5; }
.habit-board.lf-card { padding: 14px 20px; }
.habit-import { margin: -4px 0 6px; }
.habit-import summary { cursor: pointer; }
@media (max-width: 760px) {
  .ht-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .ht-head { display: none; }
  .ht-week { grid-column: 1 / -1; order: 3; }
  .ht-prog { order: 2; }
  .ht-acts { grid-column: 1 / -1; order: 4; justify-content: flex-end; }
}
html[data-theme="dark"] .ht-d { background: rgba(255, 255, 255, .06); }
.ht-d.s-open { background: var(--surface); border: 1px solid #E3E9F0; color: var(--muted); }
.ht-d.is-today { box-shadow: 0 0 0 2px color-mix(in srgb, var(--hc, var(--accent)) 30%, transparent); }
.habit-autotick { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.habit-autotick legend { font-weight: 700; margin-bottom: 4px; }
.habit-routine-credit { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: #F7F9FC; }
.habit-routine-credit h3 { margin: 0 0 4px; font-size: 15px; }
html[data-theme="dark"] .habit-routine-credit { background: rgba(255, 255, 255, .04); }

/* REV-5: year themes */
.goal-themes { display: grid; gap: 8px; margin: 0 0 12px; }
.gt-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.gt-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.gt-list { flex: 1; min-width: 0; }
.gt-theme { font-weight: 600; }
.gt-review { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.goal-theme-chip .icon { width: 13px; height: 13px; }
.yt-theme { display: grid; gap: 8px; }
.yt-head { display: flex; align-items: center; gap: 10px; }
.yt-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; flex-shrink: 0; }
.yt-title { font: 700 18px var(--display); }
.yt-serving { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.goal-measure-missing { color: #8A4A0C; font-weight: 600; }
.goal-other-sources > summary { cursor: pointer; margin-top: 6px; }

/* REV-7: Insights › Accuracy */
.ins-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ins-panel { display: grid; gap: 8px; align-content: start; }
.ins-panel h2 { margin: 0; }
.ins-table { font-size: 13px; }
.ins-source { margin: 4px 0 0; color: var(--muted); }
.ins-bars { display: flex; align-items: flex-end; gap: 3px; height: 80px; }
.ins-bar { flex: 1; min-height: 2px; height: var(--h); background: var(--accent); border-radius: 3px 3px 0 0; opacity: .85; }
.ins-axis { display: flex; justify-content: space-between; }
.ins-big { font: 800 30px var(--display); margin: 0; }
.ins-dims { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ins-dims li { display: flex; gap: 8px; align-items: baseline; }
.ins-dims span { flex: 1; }
@media (max-width: 860px) { .ins-grid { grid-template-columns: 1fr; } }

/* REV-8: Skips and slips */
.skips { display: grid; gap: 6px; }
.skips-h { margin: 10px 0 2px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.skips-list { list-style: none; margin: 0; padding: 0; }
.skips-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.skips-list li:first-child { border-top: 0; }
.skips-main { flex: 1 1 260px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.skips-main a { font-weight: 600; color: var(--ink); }
.skips-count { font-weight: 800; color: #8A4A0C; }
.skips-late { color: var(--bad); }
.skips-acts { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.skips-acts form { display: inline; }
.skips-resched { position: relative; }
.skips-resched > summary { list-style: none; } .skips-resched > summary::-webkit-details-marker { display: none; }
.skips-resched[open] form { position: absolute; z-index: 10; right: 0; top: calc(100% + 4px); padding: 8px; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(21,37,61,.14); }

/* REV-2: Clear the decks */
.cd-progress { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.cd-bar { flex: 1; max-width: 240px; height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.cd-bar span { display: block; height: 100%; background: var(--accent); }
.cd-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; background: var(--surface); }
.cd-card h3 { margin: 0; font-size: 18px; }
.cd-card h3 a { color: var(--ink); }
.cd-kind { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #8A4A0C; }
.cd-inbox .cd-kind { color: var(--accent); } .cd-project .cd-kind { color: var(--muted); }
.cd-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; margin-top: 4px; }
.cd-drop > summary { list-style: none; } .cd-drop > summary::-webkit-details-marker { display: none; }
.cd-drop[open] form { margin-top: 8px; min-width: 260px; }
.cd-done { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, #1F7A3A 10%, var(--surface)); }
.cd-done p { margin: 0; flex-basis: 100%; }

/* LIF-7: Fitness dashboard to the LifeFitness board */
.fit-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: .75rem; margin: 0 0 .75rem; }
.fit-vitals, .fit-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 0 0 .75rem; }
.fit-bottom { display: grid; grid-template-columns: 1.6fr 1fr; gap: .75rem; margin: 0 0 1.25rem; }
@media (max-width: 1000px) { .fit-top { grid-template-columns: 1fr 1fr; } .fit-top .fit-rotation { grid-column: 1 / -1; } }
@media (max-width: 760px) { .fit-vitals, .fit-charts, .fit-bottom { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .fit-top { grid-template-columns: 1fr; } }
.fit-tile { display: grid; gap: .35rem; align-content: start; min-width: 0; }
.fit-tile p { margin: 0; }
.fit-lab { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.fit-lab-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.fit-big { font-size: 1.7rem; font-weight: 800; line-height: 1.1; font-family: var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fit-big small { font-size: .9rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.fit-bar { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.fit-bar span { display: block; height: 100%; background: var(--good, var(--ok)); border-radius: 3px; }
.fit-seq { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: .3rem 0 0; padding: 0; }
.fit-seq li { display: grid; padding: .3rem .55rem; border-radius: 9px; border: 1px solid var(--line); font-size: .8rem; font-weight: 600; min-width: 5.5rem; }
.fit-seq li small { font-weight: 500; color: var(--muted); font-size: .72rem; }
.fit-seq li.is-done { background: var(--tone-green-bg); border-color: var(--tone-green-border); color: var(--tone-green-fg); }
.fit-seq li.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fit-week { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: .25rem 0 0; padding: 0; }
.fit-week li { text-align: center; font-size: .72rem; font-weight: 700; padding: .3rem 0; border-radius: 6px; background: var(--sunk); color: var(--muted); }
.fit-week li.is-done { background: var(--good, var(--ok)); color: #fff; }
.fit-week li.is-planned { background: var(--surface); border: 1px dashed var(--line-strong); }
.fit-week li.is-missed { background: var(--tone-amber-bg); color: var(--tone-amber-fg); }
.fit-week li.is-today { outline: 2px solid var(--accent); outline-offset: 1px; }
.fit-trend { font-size: 1rem; color: var(--muted); }
.fit-cols { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 3px; height: 72px; margin: .3rem 0; }
.fit-cols > span { height: 100%; display: flex; align-items: end; }
.fit-cols i { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--accent); }
.fit-cols > span.is-hit i { background: var(--good, var(--ok)); }
.fit-cols > span.is-none i { background: transparent; border-bottom: 2px dashed var(--line-strong); }
.fit-list { list-style: none; margin: 0; padding: 0; }
.fit-list li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.fit-list li:first-child { border-top: 0; }
/* Reading: add / edit a book (book_form.html) and the ownership pills on the shelf. */
.bf {display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:20px;align-items:start}
@media (max-width:980px) {.bf {grid-template-columns:1fr}}
.bf-form {display:flex;flex-direction:column;gap:22px;padding:22px 24px}
.bf-step {border:0;margin:0;padding:0;min-width:0;display:flex;flex-direction:column;gap:12px}
.bf-lab {display:flex;align-items:center;gap:8px;margin:0;padding:0;font:700 15px Manrope,var(--font,sans-serif);color:var(--ink)}
.bf-num {width:24px;height:24px;border-radius:7px;background:var(--accent-soft);color:var(--accent-strong);display:grid;place-items:center;font-size:12px}
.bf-sublab {display:block;font-size:12px;font-weight:700;letter-spacing:.04em;color:var(--muted);margin:0 0 8px}
.bf-row {display:flex;flex-wrap:wrap;gap:12px}
.bf-row > .field {min-width:180px}
.bf-search {position:relative;display:block}
.bf-search .icon {position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--faint);pointer-events:none}
.bf-search .input {padding-left:38px;width:100%}
.bf-error {margin:0;padding:10px 12px;border-radius:10px;background:var(--bad-soft);color:var(--bad-ink);font-weight:600}

.bf-dupes:empty {display:none}
.bf-dupes {display:flex;flex-direction:column;gap:8px}
.bf-dupe {display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--guess-line);border-radius:12px;background:var(--guess-bg);color:var(--guess-ink)}
.bf-dupe a:not(.btn) {color:inherit;font-weight:700}
.bf-dupes.nudge .bf-dupe {animation:bf-nudge .35s}
@keyframes bf-nudge {25% {transform:translateX(-4px)} 75% {transform:translateX(4px)}}
@media (prefers-reduced-motion:reduce) {.bf-dupes.nudge .bf-dupe {animation:none;outline:2px solid var(--guess-line)}}
.bf-anyway {margin:0;font-size:13px;color:var(--muted);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.bf-similar {display:flex;flex-direction:column;gap:2px}
.bf-sim {padding:6px 8px;border-radius:8px;text-decoration:none}
.bf-sim:hover {background:var(--sunk)}

.bf-own {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
@media (max-width:720px) {.bf-own {grid-template-columns:repeat(2,minmax(0,1fr))}}
.bf-opt {position:relative;display:flex;flex-direction:column;gap:5px;min-height:118px;padding:14px;border:1px solid var(--line-strong);border-radius:14px;background:var(--surface);cursor:pointer}
.bf-opt input {position:absolute;opacity:0;pointer-events:none}
.bf-opt strong {font-size:15px}
.bf-opt small {font-size:12.5px;line-height:1.35;color:var(--muted)}
.bf-ico {width:38px;height:38px;border-radius:10px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent)}
.bf-ico .icon {width:20px;height:20px}
.bf-tick {position:absolute;top:10px;right:10px;width:22px;height:22px;border-radius:50%;display:none;place-items:center;background:var(--accent);color:var(--accent-ink)}
.bf-tick .icon {width:13px;height:13px}
.bf-opt:has(input:checked) {border:2px solid var(--accent);padding:13px;background:var(--accent-soft)}
.bf-opt:has(input:checked) .bf-ico {background:var(--accent);color:var(--accent-ink)}
.bf-opt:has(input:checked) .bf-tick {display:grid}
.bf-opt.warn:has(input:checked) {border-color:var(--guess-line);background:var(--guess-bg)}
.bf-opt.warn:has(input:checked) .bf-ico, .bf-opt.warn .bf-tick {background:var(--guess-line);color:#fff}
.bf-opt:has(input:focus-visible) {outline:3px solid var(--focus);outline-offset:2px}

.bf-detail {padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2)}
.bf-detail.guess {border-color:var(--guess-line);background:var(--guess-bg)}
.bf-detail[hidden] {display:none}
.bf-chips {display:flex;flex-wrap:wrap;gap:8px}
.bf-chip {position:relative;display:inline-flex;align-items:center;min-height:36px;padding:0 14px;border-radius:var(--r-pill);border:1px solid var(--line-strong);background:var(--surface);font-weight:600;font-size:13.5px;cursor:pointer}
.bf-chip input {position:absolute;opacity:0;pointer-events:none}
.bf-chip:has(input:checked) {background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.bf-chip:has(input:focus-visible) {outline:3px solid var(--focus);outline-offset:2px}
.bf-note {margin:10px 0 0;font-size:13px;line-height:1.45;color:var(--muted)}
.bf-gotit {display:flex;align-items:center;gap:10px;flex-wrap:wrap}

.bf-seg {display:flex;flex-wrap:wrap;gap:2px;padding:3px;border-radius:11px;background:var(--sunk)}
.bf-seg label {position:relative;flex:1;min-width:96px;display:grid;place-items:center;min-height:40px;border-radius:9px;font-weight:600;font-size:14px;color:var(--muted);cursor:pointer}
.bf-seg input {position:absolute;opacity:0;pointer-events:none}
.bf-seg label:has(input:checked) {background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(21,37,61,.14)}
.bf-seg label:has(input:focus-visible) {outline:3px solid var(--focus)}
.bf-actions {display:flex;justify-content:flex-end;gap:10px;padding-top:6px;border-top:1px solid var(--line)}
.bf-actions .btn {min-height:44px}

.bf-aside {padding:18px 20px;position:sticky;top:16px}
.bf-aside h2 {margin:0 0 12px;font-size:16px}
.bf-prev {display:flex;gap:12px;align-items:center;padding:10px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.bf-cover {width:34px;height:50px;border-radius:6px;background:var(--accent-soft);flex-shrink:0}
.bf-pills, .book-pills {display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.bf-pill {display:inline-flex;align-items:center;min-height:24px;padding:0 8px;border-radius:7px;font-size:12px;font-weight:700;white-space:nowrap}
.bf-pill.has {background:var(--ok-soft);color:var(--ok-ink)}
.bf-pill.get {background:var(--guess-bg);color:var(--guess-ink);border:1px solid var(--guess-line)}
.bf-todo {display:flex;gap:10px;align-items:center;margin-top:12px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.bf-todo[hidden] {display:none}
.bf-box {width:20px;height:20px;border-radius:6px;border:1.5px solid var(--line-strong);flex-shrink:0}
.bf-rules {margin:14px 0 0;padding-left:18px;font-size:13px;line-height:1.5;color:var(--muted)}
.bf-rules li + li {margin-top:4px}
.icon.flip {transform:rotate(180deg)}

/* Shelf rows: what you have, and the Get-it to-do. */
.book-get {display:inline-flex;align-items:center;gap:6px;font-size:12.5px}
.shelf-add {display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:14px 0}
/* Stage 3: the shared editor (hub-editor.js) in full and compact modes, and the note conflict dialog. */
.hub-editor { position: relative; display: flex; flex-direction: column; gap: 6px; }
.he-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.he-toolbar button { min-width: 32px; height: 32px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: 600 13px/1 var(--body); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.he-toolbar button:hover { background: var(--surface-2); }
.he-toolbar button:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 1px; }
.he-toolbar button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.he-toolbar .sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.he-toolbar .he-source-toggle { margin-left: auto; font-family: var(--mono); font-weight: 500; color: var(--muted); }
.he-toolbar .icon { width: 16px; height: 16px; }
.he-body { position: relative; min-width: 0; }
.he-surface { min-height: 14rem; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); line-height: 1.6; overflow-wrap: anywhere; }
.he-surface:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-soft, rgba(36, 92, 196, .15)); }
.he-surface > :first-child { margin-top: 0; }
.he-surface > p:only-child:has(> br:only-child)::before { content: attr(data-placeholder); color: var(--faint, var(--muted)); pointer-events: none; float: left; height: 0; }
.he-surface .he-raw { display: none; }
.he-surface blockquote { margin: .6em 0; padding: .2em 0 .2em 14px; border-left: 3px solid var(--line-strong, var(--line)); color: var(--muted); }
.he-surface blockquote.he-callout, .md blockquote.he-callout { color: var(--ink); background: var(--accent-soft); border-left-color: var(--accent); border-radius: 0 10px 10px 0; padding: 8px 12px; }
.he-surface pre { padding: 10px 12px; border-radius: 10px; background: var(--sunk, var(--surface-2)); font: 13px/1.5 var(--mono); white-space: pre-wrap; }
.he-surface pre[data-lang]::before { content: attr(data-lang); display: block; font: 600 11px var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.he-surface table { border-collapse: collapse; margin: .6em 0; }
.he-surface th, .he-surface td { border: 1px solid var(--line); padding: 6px 10px; min-width: 4em; text-align: left; }
.he-surface th { background: var(--surface-2); }
.he-surface ul.contains-task-list, .md ul.contains-task-list { list-style: none; padding-left: 4px; }
.he-surface .task-list-item input { margin: 0 8px 0 0; width: 16px; height: 16px; vertical-align: -2px; accent-color: var(--accent); cursor: pointer; }
.he-surface details.md-toggle, .md details.md-toggle { margin: .6em 0; padding: 4px 0 4px 4px; }
.he-surface details.md-toggle > summary, .md details.md-toggle > summary { font-weight: 600; cursor: pointer; list-style: none; }
.he-surface details.md-toggle > summary::-webkit-details-marker, .md details.md-toggle > summary::-webkit-details-marker { display: none; }
.he-surface details.md-toggle > summary::before, .md details.md-toggle > summary::before { content: "▸"; display: inline-block; width: 1.1em; color: var(--muted); transition: transform .15s; }
.he-surface details.md-toggle[open] > summary::before, .md details.md-toggle[open] > summary::before { transform: rotate(90deg); }
.he-surface blockquote > p, .md blockquote.he-callout > p { margin: 0; }
.he-surface details.md-toggle > :not(summary) { margin-left: 18px; }
.he-surface a.wiki-link { background: var(--accent-soft); color: var(--accent); padding: 0 4px; border-radius: 5px; text-decoration: none; }
.he-surface img { max-width: 100%; border-radius: 10px; }
.he-source { width: 100%; min-height: 14rem; font: 13px/1.55 var(--mono); }
.he-menu { position: absolute; z-index: 40; width: 300px; max-height: 320px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.16)); }
.he-option { display: grid; grid-template-columns: 30px 1fr; align-items: center; column-gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: 14px var(--body); }
.he-option.active, .he-option:hover { background: var(--surface-2); }
.he-option-hint { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); grid-row: span 2; }
.he-option strong { font-weight: 500; }
.he-option-meta { grid-column: 2; font-size: 12px; color: var(--muted); }
.he-status { margin: 0; }
.he-contents { display: none; }

/* LIB-2: contents in two places. Top: a "Contents · N" bar that opens in place (any width).
   Side: docked beside the text on wide screens (narrower screens fall back to the bar). */
.he-contents-bar { display: none; }
.he-full .he-contents-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 8px 0 6px; font-size: 13px; }
.he-contents-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 3px 0; color: var(--muted); font: 600 13px var(--body); cursor: pointer; }
.he-contents-toggle::before { content: "▸"; font-size: 11px; transition: transform .15s; }
.he-contents-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.he-contents-bar.is-empty .he-contents-toggle { cursor: default; }
.he-contents-dock, .he-contents-undock { display: none; border: 0; background: none; padding: 3px 0; color: var(--accent); font: 600 12px var(--body); cursor: pointer; }
.he-contents-top-list { flex-basis: 100%; list-style: none; margin: 2px 0 4px; padding: 6px 0; border-left: 2px solid var(--line); }
.he-contents-top-list button, .he-full .he-contents button { display: block; width: 100%; padding: 3px 10px; border: 0; background: none; color: var(--muted); text-align: left; cursor: pointer; font: inherit; }
.he-contents-top-list button:hover, .he-full .he-contents button:hover { color: var(--ink); }
.he-contents-top-list .he-contents-h2 button, .he-full .he-contents .he-contents-h2 button { padding-left: 20px; }
.he-contents-top-list .he-contents-h3 button, .he-full .he-contents .he-contents-h3 button { padding-left: 30px; }
.he-surface .he-heading-flash { animation: he-flash 1.6s ease-out; border-radius: 6px; }
@keyframes he-flash { 0%, 30% { background: color-mix(in srgb, var(--accent) 16%, transparent); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .he-surface .he-heading-flash { animation: none; outline: 2px solid var(--accent); outline-offset: 2px; } }

@media (min-width: 1180px) {
  .he-full .he-contents-dock { display: inline; margin-left: auto; }
  .he-full.he-contents-side .he-contents-toggle, .he-full.he-contents-side .he-contents-top-list { display: none; }
  .he-full.he-contents-side .he-body { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 16px; align-items: start; }
  .he-full.he-contents-side .he-contents { display: block; position: sticky; top: 84px; font-size: 13px; }
  .he-full.he-contents-side .he-contents ol { list-style: none; margin: 6px 0 0; padding: 0; border-left: 1px solid var(--line); }
  .he-full.he-contents-side .he-contents-undock { display: block; margin: 2px 0 0; }
  .he-full.he-contents-side .he-contents-dock { display: none; }
  .he-full .he-source { grid-column: 1; }
}

/* Compact mode: same editing in a small box. */
.he-compact .he-toolbar { border: 0; padding: 0; background: none; }
.he-compact .he-toolbar button { height: 28px; min-width: 28px; }
.he-compact .he-surface { min-height: 6.5rem; padding: 10px 12px; font-size: 14px; }
.he-compact .he-source { min-height: 6.5rem; }

/* Conflict dialog: two versions side by side. */
.note-conflict { width: min(880px, 94vw); border: 1px solid var(--line); border-radius: var(--r-panel, 16px); padding: 20px 22px; }
.note-conflict::backdrop { background: rgba(15, 20, 30, .45); }
.note-conflict h2 { margin: 0 0 4px; }
.note-conflict-versions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.note-conflict-versions h3 { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.note-conflict-versions pre { margin: 0; max-height: 40vh; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font: 12.5px/1.5 var(--mono); white-space: pre-wrap; }
.note-conflict-actions { justify-content: flex-end; gap: 8px; }
@media (max-width: 700px) { .note-conflict-versions { grid-template-columns: 1fr; } }
.he-surface.prose { max-width: none; }

/* Table editing: a small toolbar above the table you're in. */
.he-surface table { display: block; max-width: 100%; overflow-x: auto; }
.he-surface td:focus-within, .he-surface th:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.he-surface table.he-table-active { margin-top: calc(var(--he-table-bar, 38px) + 10px); }
.he-table-bar { position: absolute; z-index: 35; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow, 0 4px 14px rgba(0,0,0,.1)); }
.he-table-bar[hidden] { display: none; }
.he-table-bar button { min-width: 30px; height: 28px; padding: 0 7px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: 600 12px var(--body); cursor: pointer; white-space: nowrap; }
.he-table-bar button:hover:not(:disabled) { background: var(--surface-2); }
.he-table-bar button:focus-visible { outline: 2px solid var(--focus, var(--accent)); }
.he-table-bar button:disabled { opacity: .35; cursor: default; }
.he-table-bar button.danger { color: var(--bad, #B42318); }
.he-table-bar .sep { width: 1px; height: 16px; margin: 0 3px; background: var(--line); }

/* LIB-13: nested lists. Numbered lists count 1. → a. → i. by level; a faint guide line marks
   each level. The Markdown stays plain numbers with two-space indents. */
.he-surface li > ul, .he-surface li > ol { margin: 2px 0 2px; padding-left: 1.4em; border-left: 1px solid var(--line); }
.he-surface ol ol { list-style-type: lower-alpha; }
.he-surface ol ol ol { list-style-type: lower-roman; }
.he-surface ul ul { list-style-type: circle; }
.he-surface ul ul ul { list-style-type: square; }
.he-surface li.task-list-item > ul, .he-surface ul.contains-task-list ul.contains-task-list { list-style: none; }
/* A checklist row is a flex row: its nested list wraps onto its own line below it. Ticking a parent
   never looks like it ticked the children: only items without children get the strike-through. */
.prose .task-list-item, .he-surface .task-list-item { flex-wrap: wrap; }
.prose .task-list-item > ul, .prose .task-list-item > ol,
.he-surface .task-list-item > ul, .he-surface .task-list-item > ol { flex-basis: 100%; }
.prose .task-list-item:has(> input:checked):has(> ul, > ol) { text-decoration: none; }
.prose .task-list-item:has(> input:checked) > ul, .prose .task-list-item:has(> input:checked) > ol { color: var(--ink); }
.prose li > ul, .prose li > ol { padding-left: 1.4em; border-left: 1px solid var(--line); margin: 2px 0; }
.prose ol ol { list-style-type: lower-alpha; } .prose ol ol ol { list-style-type: lower-roman; }
/* Stage 2: toasts, status banner, changes log, approval rules */
/* TOD-12: one pattern for banners, toasts and panel states (States board). */
.toasts { position: fixed; left: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: min(460px, calc(100vw - 32px)); }
.toast { display: inline-flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 12px; background: #15253D; color: #fff; box-shadow: 0 10px 24px rgba(21,37,61,.25); font-size: 14px; line-height: 1.4; }
.toast.is-error { background: #7A1A12; }
.toast span { flex: 1; }
.toast-action { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: #9FC0FF; text-decoration: none; cursor: pointer; white-space: nowrap; }
.toast-action:hover { color: #fff; text-decoration: underline; }
.toast-close { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: rgba(255,255,255,.7); cursor: pointer; }
.toast-close:hover { background: rgba(255,255,255,.12); color: #fff; }
.hub-i { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.status-banner { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; border: 1px solid #C9D9F7; background: #EEF4FF; color: #1A4794; font-size: 14px; }
.status-banner[hidden] { display: none; }
.status-banner .status-banner-text { flex: 1; min-width: 12ch; }
.status-banner .btn { min-height: 32px; }
.status-banner .btn.ghost { color: inherit; }
.status-banner.error { background: #FDECEA; border-color: #F5C2BC; color: #B42318; }
.status-banner.warning, .status-banner.offline { background: #FFF4E5; border-color: #F3D19C; color: #7A4F00; }
.panel-state { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line, #E3E9F0); background: var(--surface, #fff); }
.panel-state-head { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.panel-state.error .panel-state-head { color: #B42318; }
.panel-state.warning .panel-state-head { color: #7A4F00; }
.panel-state.info .panel-state-head { color: #1A4794; }
.panel-state p { margin: 0; font-size: 13px; color: var(--muted, #5A6B80); }
.panel-state-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.panel-state-actions .btn { min-height: 32px; }
.change-list { list-style: none; margin: 0; padding: 0; }
.change-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line, #E3E6EC); }
.change-row:last-child { border-bottom: 0; }
.change-row .change-summary { flex: 1; min-width: 0; }
.change-row.undone .change-summary { text-decoration: line-through; color: var(--muted, #6B7280); }
.change-row form { margin: 0; }
.rule-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line, #E3E6EC); }
.rule-row .rule-label { font-weight: 600; text-align: left; }
.approval-rules form > div:last-child { padding-top: 6px; }
.page-head > .seg { align-self: flex-end; display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2, #E9EDF3); }
.page-head > .seg a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: inherit; font-weight: 500; }
.page-head > .seg a.on { background: var(--surface, #fff); box-shadow: 0 1px 2px rgba(0,0,0,.12); font-weight: 600; }
.seg label { display: inline-flex; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label span { padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg label input:checked + span { background: var(--surface, #fff); box-shadow: 0 1px 2px rgba(0,0,0,.12); font-weight: 600; }
.seg label input:focus-visible + span { outline: 2px solid var(--accent, #245CC4); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: hub-toast-in .18s ease-out; } }
@keyframes hub-toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
/* ======================================================================
   components
   ====================================================================== */
/* Shared components from the redesign canvas ("The Hub — Recommended UI").
   Built on the tokens in 20-ui-refresh.css; add new tokens here only when a
   component needs one. Render these through the macros in _macros.html. */
:root {
  /* Amber marks values the Hub guessed and you should check. */
  --guess-bg:#FFFBF2; --guess-line:#D9A441; --guess-ink:#7A4F00;
  --ok-soft:#E7F5EC; --ok-ink:#1F7A3A;
  --bad-soft:#FDECEA; --bad-ink:#B42318;
  --info-soft:#EEF4FF; --info-ink:#1A4794;
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:24px;
  --r-pill:999px;
  --tap:40px;
}
@media (prefers-color-scheme:dark) {
 :root {
  --guess-bg:#3A2E14; --guess-line:#C9973A; --guess-ink:#F5D59A;
  --ok-soft:#173B2A; --ok-ink:#8FE0B0;
  --bad-soft:#4A1F1C; --bad-ink:#F5B1AA;
  --info-soft:#1E3352; --info-ink:#BBD3FF;
 }
}

/* Icon button: a square tap target holding one icon, always with a label. */
.btn.icon {
  inline-size:var(--tap); block-size:var(--tap); min-block-size:var(--tap);
  padding:0; display:inline-grid; place-items:center; flex-shrink:0;
  border-radius:var(--r-card);
}
.btn.icon.sm {inline-size:32px; block-size:32px; min-block-size:32px}
.btn.icon .icon {inline-size:18px; block-size:18px}
.btn.icon.danger {color:var(--bad-ink)}

/* Pill: a short status or label. Tones match meaning, not decoration. */
.pill {
  display:inline-flex; align-items:center; gap:var(--space-1);
  padding:2px 9px; border-radius:var(--r-pill); white-space:nowrap;
  font-size:.78rem; font-weight:700; line-height:1.5;
  background:var(--chip-bg); color:var(--chip-ink);
}
.pill.ok {background:var(--ok-soft); color:var(--ok-ink)}
.pill.bad {background:var(--bad-soft); color:var(--bad-ink)}
.pill.info {background:var(--info-soft); color:var(--info-ink)}
.pill.guess {background:var(--guess-bg); color:var(--guess-ink); box-shadow:inset 0 0 0 1px var(--guess-line)}

/* Switch: an on/off setting. Uses a real checkbox for keyboards and screen readers. */
.switch {display:inline-flex; align-items:center; gap:var(--space-2); cursor:pointer}
.switch input {
  appearance:none; -webkit-appearance:none; margin:0; flex-shrink:0;
  inline-size:38px; block-size:22px; border-radius:var(--r-pill);
  background:var(--line-strong); position:relative; cursor:pointer;
  transition:background .15s ease;
}
.switch input::after {
  content:""; position:absolute; inset-block-start:2px; inset-inline-start:2px;
  inline-size:18px; block-size:18px; border-radius:50%; background:#FFFFFF;
  box-shadow:0 1px 2px rgba(0,0,0,.25); transition:transform .15s ease;
}
.switch input:checked {background:var(--accent)}
.switch input:checked::after {transform:translateX(16px)}
.switch input:focus-visible {outline:2px solid var(--focus); outline-offset:2px}
@media (prefers-reduced-motion:reduce) {.switch input, .switch input::after {transition:none}}

/* Segmented control: one choice from a few, as radio buttons. */
.seg {display:inline-flex; padding:2px; gap:2px; border-radius:var(--r-card); background:var(--sunk)}
.seg label {position:relative}
.seg input {position:absolute; opacity:0; inset:0; margin:0; cursor:pointer}
.seg span {
  display:block; padding:6px 12px; border-radius:calc(var(--r-card) - 2px);
  font-size:.85rem; font-weight:700; color:var(--muted); white-space:nowrap;
}
.seg input:checked + span {background:var(--surface); color:var(--ink); box-shadow:var(--shadow-sm)}
.seg input:focus-visible + span {outline:2px solid var(--focus); outline-offset:1px}

/* Guessed value: a field or inline value the Hub filled in for you to check. */
.guessed, input.guessed, select.guessed, textarea.guessed {
  background:var(--guess-bg); border-color:var(--guess-line); color:var(--guess-ink);
}
mark.guessed {padding:0 3px; border-radius:4px; box-shadow:inset 0 0 0 1px var(--guess-line)}

/* Section label above a group: small caps, muted. */
.lab {font-size:.72rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--faint)}

/* A row of actions that sits at the end of a list row. */
.row-actions {display:inline-flex; gap:2px; margin-inline-start:auto}

/* LIF-6: an edit page opened as a popup over the page (hub-page-popup.js) */
.page-popup { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line);
  border-radius: 16px; background: var(--bg, var(--surface)); color: var(--ink); box-shadow: 0 24px 60px rgb(0 0 0 / .25); overflow: hidden; }
.page-popup[open] { display: flex; flex-direction: column; }
.page-popup::backdrop { background: rgb(10 20 35 / .4); }
.page-popup-head { display: flex; align-items: center; gap: .75rem; padding: .6rem .7rem .6rem 1.1rem; border-bottom: 1px solid var(--line);
  background: var(--surface); }
.page-popup-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-popup-body { overflow: auto; padding: 1rem 1.1rem 1.4rem; }
.page-popup-body .routine-detail-crumb { display: none; }
.page-popup-error { margin: 0 0 .6rem; padding: .5rem .7rem; border-radius: 9px; background: color-mix(in srgb, var(--bad) 10%, var(--surface));
  color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); font-weight: 600; font-size: .9rem; }
@media (max-width: 640px) { .page-popup { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; } }

/* ASK-1: actions in the Ctrl K palette */
.palette-group-label{font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);padding:.55rem .75rem .25rem}
.global-search-result.palette-action strong{font-weight:600}
.global-search-result.palette-action{cursor:pointer}
.palette-status{margin:0;min-height:1.2em;color:var(--muted)}
.palette-status:empty{display:none}

/* ASK-4: the one proposed-changes card (Ask, the Ask panel, the approvals page) */
.change-card{display:flex;flex-direction:column;align-items:stretch;gap:8px;text-align:left}
.change-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.change-row{border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:var(--surface);display:flex;flex-direction:column;align-items:stretch;gap:6px;text-align:left}
.change-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px}
.change-head .change-status{margin-left:auto}
.change-record{font-weight:600}
.change-fields{justify-content:start;display:grid;grid-template-columns:max-content minmax(0,1fr);gap:3px 12px;margin:0;font-size:13px}
.change-fields dt{color:var(--muted);font-weight:600}
.change-fields dd{margin:0;min-width:0;overflow-wrap:anywhere}
.change-fields del{color:var(--muted);text-decoration:line-through}
.change-fields ins{text-decoration:none;background:var(--accent-soft);border-radius:4px;padding:0 4px}
.change-warn{color:var(--muted)}
.change-error,.change-msg{color:var(--bad);margin:0}
.change-msg:empty{display:none}
.change-actions,.change-all{gap:6px;flex-wrap:wrap;justify-content:flex-start}
.change-edit{border-top:1px solid var(--line);padding-top:8px}
.change-undo{display:flex;align-items:center;gap:8px}
@media(max-width:600px){.change-fields{grid-template-columns:1fr}.change-fields dt{margin-top:4px}}

/* ASK-5: chats kept on the project */
.pj-chats{margin-bottom:14px;padding:12px 14px}
.pj-chats-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:6px}
.pj-chats-head h2{font-size:15px;margin:0}
.pj-chat-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.pj-chat-list li{display:flex;justify-content:space-between;gap:10px;padding:6px 0;border-top:1px solid var(--line)}
.pj-chat-list li:first-child{border-top:0}

/* SET-8: one Settings layout with a left rail */
.settings-shell{display:grid;grid-template-columns:220px minmax(0,1fr);gap:24px;align-items:start}
.settings-main{min-width:0}
.settings-rail{position:sticky;top:84px}
.settings-rail-title{font:800 26px/1.1 var(--display);letter-spacing:-.03em;margin:4px 0 12px}
.settings-rail ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.settings-rail a{display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:10px;text-decoration:none;font-weight:600;font-size:14px;color:var(--muted)}
.settings-rail a svg{width:17px;height:17px;flex:none}
.settings-rail a:hover{background:var(--sunk);color:var(--ink)}
.settings-rail a[aria-current="page"]{background:var(--accent-soft);color:var(--accent-strong)}
@media(max-width:860px){
  .settings-shell{grid-template-columns:minmax(0,1fr);gap:12px}
  .settings-rail{position:static}
  .settings-rail-title{display:none}
  .settings-rail ul{flex-direction:row;overflow-x:auto;scrollbar-width:none;gap:4px;padding-bottom:4px}
  .settings-rail ul::-webkit-scrollbar{display:none}
  .settings-rail a{white-space:nowrap;padding:7px 10px;font-size:13px}
}

/* SET-4: Settings › Scripts */
.script-list{list-style:none;margin:0;padding:0}
.script-list li{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 0;border-top:1px solid var(--line)}
.script-list li:first-child{border-top:0}
.script-list li .pill{margin-left:auto}
.script-detail{margin-bottom:16px;align-items:start}
.secret-row{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap}
.script-run summary{cursor:pointer;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.script-log{max-height:320px;overflow:auto;background:var(--sunk);border-radius:8px;padding:10px;font:12px/1.5 var(--mono);white-space:pre-wrap;overflow-wrap:anywhere}

/* SET-6: rename and merge on each tag row */
.tag-library-row{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem 1rem}
.tag-library-row .tag-count{min-width:80px}
.tag-rename,.tag-merge{display:flex;gap:6px;align-items:center}
.tag-rename .input{width:170px}
.tag-merge .input{width:160px}
.tag-row-msg{flex-basis:100%;margin:0;color:var(--muted)}
.tag-row-msg:empty{display:none}
/* Work section (Stage 5a): All work queue, projects. */
.wk { max-width: 1460px; margin: 0 auto; }
.wk-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.wk-head h1 { margin: 0; font: 800 32px/1.1 var(--display); letter-spacing: -0.04em; }
.wk-sub { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.wk-new { position: relative; }
.wk-new > summary { list-style: none; cursor: pointer; }
.wk-new > summary.icon { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; }
.wk-new > summary.icon.sm { width: 32px; height: 32px; }
.wk-new > summary::-webkit-details-marker { display: none; }
.wk-new-form { position: absolute; right: 0; top: 46px; z-index: 30; width: 300px; display: grid; gap: 10px; box-shadow: var(--shadow-lg); }
.wk-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.wk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wk-chip { min-height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; color: var(--ink); display: inline-flex; align-items: center; text-decoration: none; }
.wk-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.wk-divider { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.wk-sel { min-height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 0 8px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; background: var(--surface); }
.wk-sel select { border: 0; background: transparent; font: inherit; color: inherit; min-height: 32px; width: auto; min-width: 0; padding: 0 2px; box-shadow: none; appearance: auto; }
.wk-sort { margin-left: auto; }
.wk-search { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); }
.wk-search input { border: 0; outline: 0; width: 110px; min-width: 0; padding: 0; min-height: 30px; box-shadow: none; font: inherit; background: transparent; color: var(--ink); }
.wk-search .icon { width: 16px; height: 16px; }
.wk-cols { display: grid; grid-template-columns: 1fr 58px 62px 116px 152px; gap: 12px; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; margin: 16px 18px 0 18px; }
.wk-cols span:nth-child(2) { text-align: center; } .wk-cols span:nth-child(4) { text-align: right; }
.wk-gh { display: flex; justify-content: space-between; align-items: baseline; font: 700 15px var(--display); margin: 20px 4px 8px; }
.wk-gh span + span { font-weight: 500; color: var(--muted); font-family: var(--body); font-size: 14px; }
.wk-card { list-style: none; margin: 0; padding: 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.wk-row { display: grid; grid-template-columns: 1fr 58px 62px 116px 152px; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--line); }
.wk-row:first-child { border-top: 0; }
.wk-main { min-width: 0; }
.wk-title { font-weight: 600; color: var(--ink); text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-title:hover { color: var(--accent); }
.wk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: 13px; color: var(--muted); }
.wk-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.wk-type { font-weight: 600; }
.wk-t-task { color: #1A4794; } .wk-t-todo { color: #1F7A3A; } .wk-t-story { color: #553C8C; } .wk-t-bug { color: #B42318; } .wk-t-epic { color: #0E6E86; }
.wk-due { text-align: center; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 3px 0; }
.due-late { background: var(--bad-soft); color: var(--bad); }
.due-today { background: #FFF1E2; color: #8A4A0C; }
.due-week, .due-later { background: var(--surface-2); color: var(--ink); }
.due-none { color: var(--muted); font-weight: 500; }
.wk-impact { display: flex; gap: 3px; }
.wk-impact i { width: 9px; height: 9px; border-radius: 3px; background: var(--line); }
.wk-impact i.on { background: var(--ink); }
.wk-plan { display: flex; justify-content: flex-end; }
.wk-plan .btn { color: var(--accent); }
.wk-slot { font-size: 12px; font-weight: 600; color: var(--accent-strong); background: var(--accent-soft); border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.wk-acts { display: flex; justify-content: flex-end; }
.wk-row .inline-form { display: contents; }
.wk-foot { font-size: 13px; color: var(--muted); margin: 14px 4px 0; }
@media (max-width: 760px) {
  .wk-cols { display: none; }
  .wk-row { grid-template-columns: 1fr auto; }
  .wk-impact, .wk-plan { display: none; }
  .wk-acts { grid-column: 1 / -1; justify-content: flex-end; }
  .wk-sort { margin-left: 0; }
}

/* Projects list */
.wk-seg { display: inline-flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 9px; }
.wk-seg a { padding: 5px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.wk-seg a[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.pj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.pj-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--pj, var(--accent)); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.pj-card-top { display: flex; align-items: flex-start; gap: 8px; }
.pj-card-top > .wk-main, .pj-next > .wk-main { flex: 1; min-width: 0; }
.pj-card-title { font: 800 19px var(--display); color: var(--ink); text-decoration: none; }
.pj-card-title:hover { color: var(--accent); }
.pj-card-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.pj-acts { display: flex; margin: -4px -6px 0 0; }
.pj-acts .inline-form { display: contents; }
.pj-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.pj-bar { flex: 1; height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; display: block; min-width: 60px; }
.pj-bar > span { display: block; height: 100%; background: var(--pj, var(--accent)); }
.pj-next { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.pj-next .inline-form { display: contents; }
.pj-lab { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.pj-guess { margin: 0; padding: 9px 11px; border: 1px solid var(--guess-line); background: var(--guess-bg); border-radius: 10px; font-size: 13px; color: var(--guess-ink); }
.pj-guess a { color: inherit; font-weight: 600; }
.pj-card-foot { display: flex; gap: 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }
.pj-card-foot b { color: var(--ink); }
.pj-card-new { border: 1.5px dashed var(--line); border-top-width: 1.5px; background: transparent; min-height: 240px; justify-content: center; position: relative; }
.pj-card-new > summary { list-style: none; display: grid; justify-items: center; gap: 8px; text-align: center; cursor: pointer; }
.pj-card-new > summary::-webkit-details-marker { display: none; }
.pj-card-new .btn.icon { width: 48px; height: 48px; border-radius: 14px; }
.pj-card-new[open] .wk-new-form { position: static; width: auto; box-shadow: none; }
.pj-list-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-top: 1px solid var(--line); }
.pj-list-row:first-child { border-top: 0; }
.pj-list-row .wk-main { flex: 1; }
.pj-list-row .inline-form { display: contents; }
.pj-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.pj-progress-sm { width: 160px; }
.pj-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; border: 1.5px dashed var(--line); border-radius: 14px; list-style: none; grid-column: 1 / -1; }
.wk-card .pj-empty { border: 0; }

/* Project page */
.pj-head { margin-bottom: 4px; }
.pj-crumbs { font-size: 14px; color: var(--muted); }
.pj-crumbs a { font-weight: 600; }
.pj-titlerow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 14px; margin-top: 8px; }
.pj-titlerow h1 { margin: 0; font: 800 30px/1.15 var(--display); letter-spacing: -0.03em; }
.pj-sub { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.pj-head .pj-progress { margin-top: 10px; color: var(--muted); }
.pj-head .pj-bar { flex: none; width: 220px; }
.pj-actions { display: flex; gap: 4px; align-items: center; }
.pj-actions > details > summary { list-style: none; cursor: pointer; }
.pj-actions > details > summary::-webkit-details-marker { display: none; }
.pj-actions .btn.icon { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; }
.pj-snooze { position: relative; }
.pj-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 18px 0 14px; }
.pj-tabs a { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pj-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.pj-bar-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 14px; }
.pj-stage { margin-top: 18px; }
.pj-stage-h { font: 700 16px var(--display); margin: 0 4px 8px; display: flex; align-items: baseline; gap: 10px; }
.pj-stage-h span { font: 400 13px var(--body); color: var(--muted); }
.pj-epic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pj-epic { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--ep); border-radius: 14px; padding: 16px 18px; }
.pj-epic-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pj-epic-title { font: 700 17px var(--display); color: var(--ink); text-decoration: none; margin-right: 6px; }
.pj-epic-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pj-epic-acts { display: flex; }
.pj-epic-acts .inline-form { display: contents; }
.pj-epic-acts > details > summary { list-style: none; }
.pj-epic .pj-progress { margin-top: 14px; }
.pj-epic .pj-bar > span { background: var(--ep); }
.pj-epic-facts { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 10px; }
.pj-epic-time { font-size: 13px; color: var(--ink); font-weight: 600; margin-top: 6px; }
.pj-epic-open { display: inline-block; font-size: 14px; font-weight: 600; margin-top: 10px; }
.pj-stage-move { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.pj-release { margin-left: auto; }
.pj-release input { width: 140px; min-height: 30px; font-size: 13px; }
.pj-filter { margin: 0 0 12px; }
.pj-activity { padding: 4px 18px 8px; }
.pj-activity li { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); list-style: none; }
.pj-activity li:first-child { border-top: 0; }
.pj-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.pj-act-text { flex: 1; font-size: 14px; line-height: 1.5; }
.pj-act-when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.pj-ideas { padding: 0 12px; margin-top: 12px; }
.pj-idea { display: flex; align-items: center; gap: 8px; padding: 11px 0; border-top: 1px solid var(--line); list-style: none; }
.pj-idea:first-child { border-top: 0; }
.pj-idea .wk-main { flex: 1; }
.pj-idea .inline-form { display: contents; }
.pj-pursue { display: flex; gap: 6px; align-items: center; }
.pj-pursue select { min-height: 32px; width: auto; }
.pj-attempt-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.pj-attempt-add .grow { flex: 1; min-width: 220px; }
.pj-attempts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 16px; }
.pj-attempt { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pj-attempt img, .pj-attempt-noimg { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.pj-attempt figcaption { display: flex; align-items: flex-start; gap: 6px; padding: 8px; }
.pj-attempt-edit { flex: 1; display: grid; gap: 4px; }
.pj-attempt-edit .input { min-height: 30px; font-size: 13px; padding: 2px 8px; }
.pj-attempt figcaption .inline-form { display: contents; }
.pj-danger { border-color: var(--bad-soft); }
@media (max-width: 760px) {
  .pj-grid, .pj-epic-grid { grid-template-columns: 1fr; }
  .pj-progress-sm { display: none; }
}

/* Story and epic detail */
.it-roll { border-top: 4px solid var(--ep); margin: 0 0 14px; }
.it-roll .pj-bar { height: 8px; }
.it-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; }
.it-stats dt { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.it-stats dd { margin: 4px 0 0; font: 800 20px var(--display); }
.it-stats span { font-size: 12px; color: var(--muted); }
.it-nudge { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; }
.it-nudge span { flex: 1; }
.it-nudge .btn { background: var(--surface); border-color: var(--guess-line); color: var(--guess-ink); }
.it-group { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.it-children { list-style: none; margin: 0; padding: 0; }
.it-children li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.it-children li:first-child { border-top: 0; }
.it-children form { display: contents; }
.it-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; padding: 0; color: #fff; cursor: pointer; flex-shrink: 0; }
.it-tick .icon { width: 13px; height: 13px; }
.it-children li.is-done .it-tick { background: #1F7A3A; border-color: #1F7A3A; }
.it-title { flex: 1; font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; min-width: 0; }
.it-children li.is-done .it-title { text-decoration: line-through; color: var(--muted); }
/* Children of an opened epic/story (WRK-4): type, status and estimate on each row, add row below. */
.it-kids-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.it-kids-head h2 { margin: 0; }
.it-count { font: 400 13px var(--body); color: var(--muted); margin-left: 6px; }
.it-meta { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); }
.wk-type-chip { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 6px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, currentColor 10%, transparent); }
.it-meta .status-pill { min-height: 22px; font-size: 12px; }
.it-est, .it-sub { white-space: nowrap; }
.it-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-strong, var(--line)); }
.it-add-icon { display: grid; place-items: center; width: 22px; color: var(--muted); }
.it-add .input.grow { flex: 1; min-width: 12rem; }
.it-add-type { width: auto; }
.it-add-error { flex-basis: 100%; margin: 0 0 0 30px; font-size: 13px; color: var(--bad); }
.it-add .input[aria-invalid="true"] { border-color: var(--bad); }
@media (max-width: 760px) {
  .it-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .it-children li { flex-wrap: wrap; }
  .it-meta { flex-basis: 100%; padding-left: 32px; order: 5; }
}

/* Saved videos */
.sv-add { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; align-items: start; }
.sv-add > details > summary { cursor: pointer; }
.sv-list { padding: 0 14px; }
.sv-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); list-style: none; }
.sv-row:first-child { border-top: 0; }
.sv-row .wk-main { flex: 1; }
.sv-row .inline-form { display: contents; }
.sv-status { font-size: 13px; color: var(--muted); white-space: nowrap; }
.sv-error { color: var(--bad); }
.sv-queued, .sv-working { background: var(--accent); } .sv-carded { background: #B7791F; } .sv-done { background: #1F7A3A; }
.sv-failed { background: var(--bad); } .sv-dismissed { background: var(--line); }
@media (max-width: 760px) { .sv-add { grid-template-columns: 1fr; } }

/* Book highlights */
.bh { margin-top: 1rem; }
.bh-item { border-left: 4px solid var(--line); padding: 4px 0 4px 14px; }
.bh-yellow { border-left-color: #E5C04A; } .bh-blue { border-left-color: #5B8DEF; } .bh-pink { border-left-color: #E07AA6; }
.bh-orange { border-left-color: #E8955A; } .bh-green, .bh-purple { border-left-color: #7FB77E; }
.bh-item blockquote { margin: 0; font-size: 15px; line-height: 1.6; }
.bh-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.bh-note .input { min-height: 30px; font-size: 13px; margin-top: 4px; }

/* Archived project: say so, and offer Unarchive in one click. */
.pj-archived { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 12px 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.pj-archived .icon { width: 16px; height: 16px; vertical-align: -3px; color: var(--muted); }
.pj-archived form { margin: 0; }

/* Project board to the design: one filter row, a "+" per column, lean cards that open on click. */
.pj-board-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; font-size: 13px; }
.pj-board-bar .project-board-filters { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 1 auto; align-items: center; }
.pj-filter { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 4px 0 10px; border: 1px solid var(--line-strong, var(--line)); border-radius: 9px; background: var(--surface); font-weight: 600; color: var(--ink); }
.pj-filter span { color: var(--muted); font-weight: 600; }
.pj-filter select { field-sizing: content; width: auto; min-width: 0; min-height: 0; box-shadow: none; border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--ink); padding: 4px 2px; max-width: 12rem; cursor: pointer; }
.pj-filter:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.pj-board-sprint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pj-board-hint { margin-left: auto; color: var(--muted); }
.pj-board-cols { position: relative; }
.pj-board-cols > summary { list-style: none; }
.pj-board-cols > summary::-webkit-details-marker { display: none; }
.pj-board-cols[open] > .board-column-manager { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(560px, calc(100vw - 32px)); margin: 0; box-shadow: var(--shadow-pop, 0 12px 32px rgba(21, 37, 61, .16)); }
.pj-board .column > h3 { align-items: center; position: relative; }
.pj-board .board-col-heading { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.pj-board .board-col-heading .count { color: var(--muted); font-weight: 500; }
.pj-col-add > summary { list-style: none; }
.pj-col-add > summary::-webkit-details-marker { display: none; }
.pj-col-add[open] > .pj-col-add-form { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 15; display: grid; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop, 0 12px 32px rgba(21, 37, 61, .16)); font-weight: 400; }
.pj-col-add-form .row { gap: 6px; }
.pj-col-add-form select { flex: 1 1 6rem; min-width: 0; }
.pj-kc { gap: 6px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.pj-kc:active { cursor: grabbing; }
.kc-top { display: flex; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.kc-type { font-weight: 700; }
.kc-epic { margin-left: auto; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); background: var(--sunk); border-radius: 5px; padding: 1px 6px; text-decoration: none; }
.kc-epic:hover { color: var(--ink); }
.pj-kc .kcard-title { font-weight: 600; font-size: 14px; line-height: 1.35; color: var(--ink); text-decoration: none; }
.pj-kc .kcard-title:hover { text-decoration: underline; }
.pj-kc.is-done .kcard-title { color: var(--muted); }
.kc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; color: var(--muted); }
.kc-foot .icon { width: 13px; height: 13px; vertical-align: -2px; }
.kc-impact { display: inline-flex; gap: 2px; }
.kc-impact span { width: 8px; height: 8px; border-radius: 2px; background: var(--line); }
.kc-impact span.on { background: var(--ink); }
.kc-when { margin-left: auto; font-weight: 600; }
.kc-slot { color: var(--accent); }
.kc-due { color: #8A4A0C; }
.kc-overdue { color: var(--bad); }
.kc-done { color: #1F7A3A; }
@media (max-width: 760px) {
  .pj-board-hint { display: none; }
  .pj-filter select { max-width: 8rem; }
}
.pj-stages { margin: 12px 0 4px; } .pj-stages summary { cursor: pointer; } .pj-stages form { margin-top: 10px; align-items: flex-end; } .pj-stages .field.grow { flex: 1 1 18rem; }

/* WRK-7: the item edit side panel (item-panel.js + _item_panel.html). */
html.ip-open { overflow: hidden; }
.ip-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(21, 37, 61, .32); }
.ip-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 91; width: min(520px, 100vw); overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(21, 37, 61, .18); padding: 18px 22px 28px; outline: none; }
.ip-loading { margin: 40px 0; text-align: center; }
.ip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ip-crumbs { font-size: 13px; color: var(--muted); min-width: 0; }
.ip-crumbs a { font-weight: 600; }
.ip-icons { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.ip-icons form { display: contents; }
.ip-icons [aria-pressed="true"] { color: #1F7A3A; background: color-mix(in srgb, #1F7A3A 12%, transparent); }
.ip-pills { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.ip-type { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12px; font-weight: 700; background: color-mix(in srgb, currentColor 10%, transparent); }
.ip-status { display: inline-flex; align-items: center; min-height: 28px; padding: 0 4px 0 8px; border-radius: 7px; background: var(--sunk); font-size: 12px; font-weight: 700; }
.ip-status.s-doing { background: var(--accent-soft); color: var(--accent); } .ip-status.s-done { color: var(--ok, #1F7A3A); }
.ip-status select { border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; min-height: 0; padding: 2px; width: auto; box-shadow: none; }
.ip-title { display: block; width: 100%; margin: 10px 0 0; padding: 4px 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; font: 800 24px/1.2 var(--display); color: var(--ink); }
.ip-title:hover { border-color: var(--line); } .ip-title:focus { border-color: var(--accent); outline: none; }
.ip-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.ip-field { display: grid; gap: 3px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; min-width: 0; }
.ip-field > span { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ip-field select, .ip-field input { border: 0; background: transparent; font: 600 14px var(--body); color: var(--ink); padding: 0; min-height: 0; width: 100%; box-shadow: none; }
.ip-field:focus-within { border-color: var(--accent); }
.ip-read b { font-size: 14px; }
.ip-error { margin: 10px 0 0; color: var(--bad); font-size: 13px; }
.ip-saved { margin: 6px 0 0; min-height: 1em; }
.ip-sec { margin-top: 20px; }
.ip-sec h3 { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.ip-body { font-size: 14px; line-height: 1.5; white-space: pre-line; }
.ip-kids { list-style: none; margin: 0; padding: 0; }
.ip-kids li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ip-kids li:first-child { border-top: 0; }
.ip-kids a { font-weight: 600; color: var(--ink); }
.ip-kids li.is-done a { text-decoration: line-through; color: var(--muted); }
.ip-links { display: grid; gap: 6px; }
.ip-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.ip-link .icon { width: 15px; height: 15px; }
@media (max-width: 760px) {
  .ip-panel { width: 100vw; border-left: 0; padding: 14px 16px 24px; }
  .ip-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* WRK-9: Hand to Claude (PopForClaude) */
.ch { margin-top: 18px; border: 1px solid color-mix(in srgb, #B7791F 35%, var(--line)); background: color-mix(in srgb, #B7791F 5%, var(--surface)); border-radius: 12px; padding: 12px 14px; }
.panel > .ch { margin: 0; border: 0; padding: 0; background: transparent; }
.ch-top { display: flex; align-items: center; gap: 10px; }
.ch-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, #B7791F 15%, transparent); color: #8A5A0C; flex-shrink: 0; }
.ch-top-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.ch-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; cursor: pointer; }
.ch-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ch-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong, #C3CFDD); transition: background .15s; }
.ch-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.ch-switch input:checked + span { background: var(--accent); }
.ch-switch input:checked + span::after { transform: translateX(18px); }
.ch-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ch-needs { margin: 10px 0 0; padding: 8px 10px; border-radius: 9px; background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
.ch-body { margin-top: 12px; display: grid; gap: 10px; }
.ch-criteria { border: 0; margin: 0; padding: 0; }
.ch-criteria legend { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ch-criteria ol { margin: 0 0 6px; padding-left: 22px; display: grid; gap: 6px; }
.ch-criteria li { padding-left: 2px; }
.ch-criteria li > .input { width: calc(100% - 44px); display: inline-block; }
.ch-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ch-field { display: grid; gap: 3px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13px; min-width: 0; }
.ch-field > span { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ch-field select { border: 0; background: transparent; font: 600 14px var(--body); color: var(--ink); padding: 0; width: 100%; min-height: 0; box-shadow: none; }
.ch-read b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.ch-notes textarea { width: 100%; }
.ch-error { margin: 8px 0 0; color: var(--bad); font-size: 13px; }
.ch-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

/* WRK-10: the Claude tab (ProjClaude) */
.pj-tab-claude { display: inline-flex; align-items: center; gap: 6px; }
.pj-tab-claude .icon { width: 15px; height: 15px; }
.pj-tab-claude .pill { min-height: 20px; padding: 0 6px; font-size: 11px; }
.cl-strip { display: flex; align-items: center; gap: 14px; margin: 14px 0; position: relative; }
.cl-strip-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, #B7791F 14%, transparent); color: #8A5A0C; flex-shrink: 0; }
.cl-strip-text { display: grid; gap: 3px; flex: 1; min-width: 0; }
.cl-warn { color: #8A4A0C; }
.cl-repo > summary { list-style: none; } .cl-repo > summary::-webkit-details-marker { display: none; }
.cl-repo[open] > .cl-repo-form { position: absolute; right: 12px; top: calc(100% + 6px); z-index: 10; width: min(380px, calc(100vw - 32px)); display: grid; gap: 8px; box-shadow: 0 12px 32px rgba(21, 37, 61, .16); }
.cl-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
.cl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cl-head h2 { margin: 0; }
.cl-need { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.cl-need:first-of-type { border-top: 0; }
.cl-need-main { flex: 1 1 260px; min-width: 0; }
.cl-need-main p { margin: 4px 0 0; }
.cl-title { font-weight: 700; color: var(--ink); }
.cl-state { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--sunk); color: var(--muted); }
.cl-s-needs_you { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.cl-s-pr_open { background: color-mix(in srgb, #1F7A3A 12%, transparent); color: #1F7A3A; }
.cl-s-working { background: color-mix(in srgb, #B7791F 15%, transparent); color: #8A5A0C; }
.cl-s-queued { background: var(--accent-soft); color: var(--accent); }
.cl-queue { list-style: none; margin: 10px 0 0; padding: 0; }
.cl-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line); background: var(--surface); }
.cl-row:first-child { border-top: 0; }
.cl-row.dragging { opacity: .5; }
.cl-grip { cursor: grab; color: var(--muted); }
.cl-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sunk); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.cl-row-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.cl-move { display: inline-flex; }
.cl-done { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; padding: 8px 0; border-top: 1px solid var(--line); }
.cl-done:first-of-type { border-top: 0; }
.cl-rules { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
@media (max-width: 860px) {
  .cl-grid { grid-template-columns: 1fr; }
  .cl-strip { flex-wrap: wrap; }
  .ch-fields { grid-template-columns: 1fr; }
}

/* WRK-11: the project List view (ProjList board) */
.pl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; font-size: 13px; }
.pl-done { cursor: pointer; padding-right: 10px; }
.pl-done input { margin: 0 2px 0 0; }
.pl-done span { color: var(--ink) !important; }
.pl-advanced { margin-left: auto; }
.pl-card { padding: 0; overflow-x: auto; }
.pl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pl-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px; background: var(--sunk); border-bottom: 1px solid var(--line); white-space: nowrap; }
.pl-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pl-table tr.pl-group th { background: transparent; color: var(--ink); font: 700 13px var(--display); letter-spacing: 0; text-transform: none; padding-top: 14px; }
.pl-table tr.pl-group th span { color: var(--muted); font-weight: 500; margin-left: 4px; }
.pl-tick { width: 40px; }
.pl-tick form { display: inline; }
.pl-tick [aria-pressed="true"] { color: #1F7A3A; }
.pl-title a { font-weight: 600; color: var(--ink); text-decoration: none; }
.pl-title a:hover { text-decoration: underline; }
.pl-claude .icon { width: 13px; height: 13px; color: #8A5A0C; vertical-align: -2px; margin-left: 4px; }
.pl-child { background: color-mix(in srgb, var(--sunk) 45%, var(--surface)); font-size: 13px; }
.pl-child .pl-title { position: relative; padding-left: 32px; }
.pl-child .pl-title::before { content: "└"; position: absolute; left: 16px; color: var(--line-strong, #B8C4D2); }
.pl-child .pl-title a { font-weight: 500; }
.pl-row.is-done .pl-title a { text-decoration: line-through; color: var(--muted); }
.pl-type { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.pl-epic a { color: var(--ink); }
.pl-due, .pl-num, .pl-slot { white-space: nowrap; color: var(--ink); }
.pl-due.is-overdue { color: var(--bad); font-weight: 600; }
.pl-slot { color: var(--accent); font-weight: 600; }
.pl-acts { text-align: right; white-space: nowrap; }
.pl-acts .inline-form { display: inline; }
.pj-list-back { margin: 12px 0 0; }
@media (max-width: 860px) {
  .pl-table thead { display: none; }
  .pl-table, .pl-table tbody, .pl-table tr, .pl-table td { display: block; }
  .pl-table tr.pl-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 2px 8px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
  .pl-table td { border: 0; padding: 2px 0; }
  .pl-table td:nth-child(n+3):not(.pl-acts) { grid-column: 2; font-size: 12px; }
  .pl-table td:nth-child(n+3):not(.pl-acts):empty { display: none; }
  .pl-acts { grid-column: 3; grid-row: 1; }
  .pl-advanced { margin-left: 0; flex-basis: 100%; }
}
@media (min-width: 861px) { .pj-board > .column { flex: 1 1 0; min-width: 200px; } }
/* Today (Main board): header facts, the Next card, Your day as one list in time order. */
.td { max-width: 1150px; margin: 0 auto; padding: 10px 0 40px; }
.td-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 20px; }
.td-date { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.td-title { margin: 4px 0 0; font: 800 34px/1.1 var(--display); letter-spacing: -0.04em; }
.td-facts { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--muted); }
.td-facts a { color: inherit; text-decoration: none; }
.td-facts strong { color: var(--ink); }
.td-facts .td-fact-key { color: var(--accent-strong); }
.td-banner { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; color: var(--muted); }

/* Next */
.td-next { background: var(--surface); border: 1px solid #C9D8EE; border-radius: 18px; padding: 22px 24px 22px 28px; box-shadow: 0 6px 24px rgba(21, 37, 61, .05); }
.td-brow-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.td-brow { margin: 0; font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .07em; text-transform: uppercase; font-family: var(--body); }
.td-window { font-size: 13px; color: var(--muted); }
.td-next-title { display: block; margin: 6px 0 0; font: 800 28px/1.2 var(--display); letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
a.td-next-title:hover { color: var(--accent); }
.td-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.td-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.td-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.td-t-task, .td-t-item { color: #1A4794; } .td-t-story { color: #553C8C; } .td-t-bug { color: #B42318; } .td-t-todo { color: #1F7A3A; }
.td-t-routine { color: #9D3D6B; } .td-t-habit { color: #0E6E86; } .td-t-event { color: #647890; }
.td-why { margin: 12px 0 0; font-size: 16px; line-height: 1.6; color: var(--ink-2, #33465E); max-width: 640px; }
.td .next-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 10px 0 0; padding: 0; }
.td-note { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.td-flash { display: inline-flex; margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--accent-strong); background: var(--accent-soft); border-radius: 8px; padding: 5px 10px; }
.td-next-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; }
.td-next-actions > form { margin: 0; }
.td-next-actions .btn { min-height: 44px; padding: 0 18px; border-radius: 11px; font-size: 15px; }
.td-next-actions .btn.icon { min-height: 36px; width: 36px; padding: 0; }
.td-icons { display: flex; gap: 2px; margin-left: auto; }
.td-icons form { margin: 0; }
.td-ib-done:hover { background: #E4F4F0; color: #1C7A6C; }
.td-next details { position: relative; }
.td-next details > summary { list-style: none; }
.td-next details > summary::-webkit-details-marker { display: none; }
.td-next .next-notnow-menu, .td-next .next-why-panel { position: absolute; top: 50px; left: 0; z-index: 20; min-width: 280px; box-shadow: var(--shadow-lg); }
.td-next .next-why-panel ul { margin: 0 0 6px; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.td-next .next-why-panel strong { display: inline-block; min-width: 92px; }
.td-focus { display: flex; align-items: center; gap: 24px; }
.td-focus-copy { flex: 1; min-width: 0; }

/* Your day */
.td-day { margin-top: 30px; }
.td-day-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.td-day-nav, .td-day-tools { display: flex; align-items: center; gap: 6px; }
.td-day-nav h2 { margin: 0 10px 0 0; font: 700 19px var(--display); }
.td-day-tools form { margin: 0; }
.td-sug[aria-pressed="true"] { background: #FFF6E0; border-color: #D9A441; color: #7A4F00; }
.td-pop-wrap { position: relative; }
.td-pop-wrap > summary { list-style: none; cursor: pointer; }
.td-pop-wrap > summary::-webkit-details-marker { display: none; }
.td-pop { position: absolute; top: 42px; left: 0; z-index: 25; width: 300px; display: grid; gap: 10px; box-shadow: var(--shadow-lg); }
.td-pop-right .td-pop { left: auto; right: 0; }
.td-pop-h { margin: 0; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.td-cal { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; }
.td-cal span { width: 10px; height: 10px; border-radius: 3px; }
.td-stale { color: #B54708; margin: 0; }
.td-list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px 6px; }
.td-row { display: flex; gap: 14px; align-items: center; padding: 15px 8px; border-top: 1px solid var(--line); }
.td-list > .td-row:first-child, .td-list > details:first-child > summary { border-top: 0; }
.td-row form { margin: 0; }
.td-t { width: 52px; flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.td-grow { flex: 1; min-width: 0; }
.td-muted { color: var(--muted); font-size: 14px; }
.td-row-title { font-weight: 600; color: var(--ink); text-decoration: none; }
a.td-row-title:hover { color: var(--accent); }
.td-row .td-meta { margin-top: 4px; }
.td-row.is-now { background: var(--accent-soft); border-radius: 10px; }
.td-row.is-now .td-t { color: var(--accent); }
.td-row.is-done .td-row-title { text-decoration: line-through; color: var(--muted); }
.td-now { font-size: 12px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 6px; padding: 3px 8px; }
.td-gap { border: 1.5px dashed #D9A441; border-radius: 10px; padding: 9px 12px; background: #FFFBF2; }
.td-gap-label { font-size: 12px; font-weight: 700; color: #8A5A00; }
.td-gap .td-row-title { display: block; margin-top: 2px; }
.td-lock { display: inline-flex; color: #647890; }
.td-lock .icon { width: 16px; height: 16px; }
.td-open { font-size: 13px; font-weight: 600; white-space: nowrap; padding: 0 6px; }
.td-earlier > summary { list-style: none; cursor: pointer; }
.td-earlier > summary::-webkit-details-marker { display: none; }
.td-show { font-size: 13px; font-weight: 600; color: #1C7A6C; }
.td-earlier[open] .td-show { visibility: hidden; }
.td-section { padding-top: 12px; padding-bottom: 6px; }
.td-section .td-t { white-space: nowrap; width: auto; min-width: 52px; }
.td-allday .td-grow { font-size: 14px; color: var(--muted); }
.td-empty { margin: 0; padding: 20px 8px; color: var(--muted); text-align: center; }
.td-tomorrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; text-decoration: none; color: var(--ink); }
.td-peek { color: var(--accent); font-weight: 600; font-size: 14px; }
.td-foot { font-size: 13px; color: var(--muted); margin: 14px 4px 0; }
.td-prefs { display: inline; margin-left: 4px; }
.td-prefs > summary { display: inline; cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.td-prefs form { margin-top: 8px; align-items: center; }
.td-prefs select { width: auto; }
.td .habit-btn { width: 36px; height: 36px; }
@media (max-width: 760px) {
  .td-next { padding: 18px; }
  .td-next-title { font-size: 23px; }
  .td-icons { margin-left: 0; }
  .td-row { flex-wrap: wrap; gap: 8px 10px; }
  .td-row .td-grow { flex-basis: calc(100% - 70px); }
}

.td-fold { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.td-fold > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; list-style: none; }
.td-fold > summary::-webkit-details-marker { display: none; }
.td-fold[open] > summary .td-peek { visibility: hidden; }
.td-fold > :not(summary) { margin: 0 14px 14px; }
.td-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12px; font-weight: 700; margin-left: 4px; }
/* Habits fold: "Habits 2 of 4" in the header opens today's habits. */
.td-habits-toggle { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 6px; margin: -4px -6px; border-radius: 8px; font: inherit; color: inherit; cursor: pointer; }
.td-habits-toggle:hover { background: var(--accent-soft); }
.td-habits-toggle svg { width: 14px; height: 14px; transition: transform .15s; }
.td-habits-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.td-habits { margin: -8px 0 18px; padding: 4px 16px 10px; border-radius: 16px; }
.td-habits[hidden] { display: none; }
.td-habits-all { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; }
/* Calendars menu (Main board) */
.td-cals { width: 320px; }
.td-tog { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; cursor: pointer; }
.td-tog input { width: 18px; height: 18px; accent-color: var(--accent); }
.td-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.td-pop-note { margin: 4px 0 10px; font-size: 12px; color: var(--muted); }
.td-pop-sep { border-top: 1px solid var(--line); padding-top: 10px; }
.td-pop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; font-weight: 600; }
.td-row.filtered { display: none; }
.td-list.hide-done .td-row.is-done { display: none; }
.td-habits .td-t { display: none; }
.td-habits .td-row:first-child { border-top: 0; }
.td-habits-toggle svg { transform: rotate(-90deg); }
.td-habits-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.td-stale-tag { margin-left: auto; font-size: 12px; font-weight: 600; color: #B54708; }

/* TOD-10: quieter Next states and the shutdown page */
.td-next-options { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; max-width: 640px; }
.td-next-options li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.td-next-options li > a, .td-next-options .link-btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); text-decoration: none; }
.td-next-options li > a:hover, .td-next-options .link-btn:hover { color: var(--accent); }
.td-next-options li > span { font-size: 13px; color: var(--muted); }
.td-next-options form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.td-flash form.inline { display: inline; margin: 0 0 0 6px; }
.sd-steps { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; }
.sd-step { padding: 18px 22px; }
.sd-big { margin: 8px 0 0; font: 700 20px/1.3 var(--display); color: var(--ink); }
.sd-big strong { font-size: 28px; }
.sd-left { list-style: none; margin: 12px 0 0; padding: 0; }
.sd-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.sd-row:first-child { border-top: 0; }
.sd-title { flex: 1; font-weight: 600; color: var(--ink); text-decoration: none; }
.sd-row .td-icons { display: inline-flex; gap: 6px; align-items: center; }
.sd-row .td-icons form { margin: 0; }
.sd-overdue { color: var(--danger, #B42318); }
.icon.flip { transform: rotate(180deg); }
.td.sd { width: 100%; }
.td-day > .panel-state { margin: 0 0 10px; }
.main.today-shell > .status-banner { max-width: 1150px; margin-inline: auto; }

/* TOD-8 / TOD-9: Day and Week grids on the same 1,150 px column (Planner and WeekView boards) */
.td .next-strip { border-radius: 14px; margin-bottom: 0; }
.td-back-today { color: var(--accent); border-color: transparent; }
.tg-nums { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.tg-nums strong { color: var(--ink); }
.tg { background: var(--surface, #fff); border: 1px solid var(--line, #E3E9F0); border-radius: 16px; padding: 14px 14px 18px 0; }
.tg-allday { margin: 0 0 10px 64px; padding: 6px 10px; border-radius: 8px; background: #EEF1F5; font-size: 13px; color: #33465E; }
.tg-allday span { font-weight: 700; margin-right: 6px; }
.tg-body { display: flex; }
.tg-hours { position: relative; width: 60px; flex-shrink: 0; }
.tg-hours span { position: absolute; right: 12px; transform: translateY(-8px); font-size: 12px; color: #647890; }
.tg-col { position: relative; flex: 1; min-width: 0; border-left: 1px solid var(--line, #E3E9F0); }
.tg-line { position: absolute; left: 0; right: 0; height: 1px; background: #EEF2F7; }
.tg-band { position: absolute; left: 0; right: 0; background: #F5F8FE; border-left: 3px solid #B9CDEB; }
.tg-week .tg-band { border-left: 0; }
.tg-band span { position: absolute; right: 10px; top: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #4F6178; }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: #C2410C; z-index: 3; pointer-events: none; }
.tg-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #C2410C; }
.tg-blk { position: absolute; z-index: 2; box-sizing: border-box; }
.tg-blk > summary { list-style: none; height: 100%; box-sizing: border-box; border-radius: 8px; padding: 4px 10px; display: flex; gap: 10px; align-items: center; overflow: hidden; white-space: nowrap; cursor: pointer; font-size: 13px; background: #E9F1FF; border: 1px solid #C5D7F5; color: #1A4794; }
.tg-blk > summary::-webkit-details-marker { display: none; }
.tg-blk > summary strong { overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 4px; }
.tg-blk > summary span { font-size: 12px; opacity: .85; overflow: hidden; text-overflow: ellipsis; }
.tg-blk:not(.is-short) > summary { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0; white-space: normal; }
.tg-blk.tg-k-locked > summary, .tg-blk.tg-k-event > summary { background: #EEF1F5; border-color: #D3DBE5; color: #33465E; }
.tg-blk.tg-k-routine > summary { background: #FCEEF4; border-color: #F0C9DB; color: #852F59; }
.tg-blk.tg-k-gap > summary { background: #FFFBF2; border: 1.5px dashed #D9A441; color: #7A4F00; }
.tg-blk.td-t-todo.tg-k-work > summary { background: #E7F5EC; border-color: #B8E0C5; color: #1F6B3A; }
.tg-blk.td-t-story.tg-k-work > summary { background: #F0ECF8; border-color: #D5CBEC; color: #553C8C; }
.tg-blk.is-now.tg-k-work > summary { background: #245CC4; border-color: #245CC4; color: #fff; }
.tg-blk.is-done > summary { opacity: .55; }
.tg.hide-done .tg-blk.is-done { display: none; }
.tg-blk.filtered { display: none; }
.tg-blk[draggable="true"] > summary { cursor: grab; }
.tg-blk.is-dragging { opacity: .4; }
.tg-blk[open] { z-index: 20; }
.tg-lock { width: 12px; height: 12px; }
.tg-pop { position: absolute; top: calc(100% + 6px); left: 0; width: min(520px, 80vw); z-index: 30; padding: 6px 10px; border-radius: 14px; box-shadow: 0 12px 32px rgba(21,37,61,.18); background: #fff; }
.tg-week .tg-col:nth-last-child(-n+3) .tg-pop, .tg-day .tg-pop { left: auto; right: 0; }
.tg-pop .td-row { border: 0; }
.tg-pop-note { margin: 6px 4px 0; font-size: 12px; color: var(--muted); }
.tg-drop { position: absolute; left: 3px; right: 3px; z-index: 25; border: 2px dashed var(--accent, #245CC4); border-radius: 8px; background: rgba(36,92,196,.08); font-size: 12px; font-weight: 700; color: var(--accent, #245CC4); padding: 2px 8px; pointer-events: none; }
.tg-tray { margin-top: 14px; background: var(--surface, #fff); border: 1px solid var(--line, #E3E9F0); border-radius: 16px; padding: 12px 14px; }
.tg-tray h3 { margin: 0 0 6px; font: 700 15px var(--display); }
.tg-tray-row { display: flex; align-items: center; gap: 6px; border-top: 1px solid #EDF1F6; cursor: grab; }
.tg-tray-row:first-of-type { border-top: 0; }
.tg-tray-row .td-row { flex: 1; border: 0; }
.tg-tray-row .td-t { display: none; }
.tg-grip { color: #9AA8B8; font-size: 14px; letter-spacing: -2px; padding-left: 4px; }
.tg-tray-empty { margin: 4px 0; font-size: 14px; }
.tg-key { margin: 12px 4px 0; font-size: 13px; color: var(--muted); }
/* Week */
.tg-week { padding-top: 0; overflow: visible; }
.tg-heads { display: flex; border-bottom: 1px solid var(--line, #E3E9F0); }
.tg-rail-gap { width: 60px; flex-shrink: 0; }
.tg-dayhead { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-left: 1px solid var(--line, #E3E9F0); text-decoration: none; color: var(--ink); }
.tg-dayhead:hover { background: #F7F9FC; }
.tg-dayhead.is-past { opacity: .7; }
.tg-dayhead.is-today { background: #FAFCFF; }
.tg-dow { font-size: 12px; font-weight: 700; color: #5A6B80; }
.tg-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 15px; font: 800 15px var(--display); }
.tg-dayhead.is-today .tg-num { background: #245CC4; color: #fff; }
.tg-free { font-size: 11px; color: #5A6B80; min-height: 14px; }
.tg-due { max-width: 100%; box-sizing: border-box; font-size: 11px; font-weight: 700; color: #B42318; background: #FDECEA; border-radius: 5px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-allday-chip { max-width: 100%; box-sizing: border-box; font-size: 11px; color: #33465E; background: #EEF1F5; border-radius: 5px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-week .tg-col.is-today { background: #FAFCFF; }
.tg-week .tg-col.is-past .tg-blk > summary { opacity: .55; }
.tg-week .tg-blk > summary { padding: 2px 6px; font-size: 11px; font-weight: 600; border-radius: 6px; }
.tg-week .tg-blk > summary span { display: none; }
.tg-week .tg-hours span { font-size: 11px; right: 8px; }
.tg-week .tg-body { padding-top: 10px; }
@media (max-width: 760px) {
  .tg-week .tg-heads, .tg-week .tg-body { min-width: 720px; }
  .tg-week { overflow-x: auto; }
}
.today-home > .td { width: 100%; }

/* Shared free time strip (app.capacity) on the Planner and Plan next week */
.planner-page { max-width: 1150px; margin: 0 auto; width: 100%; }
.planner-head { margin-bottom: 12px; align-items: flex-end; }
.planner-head .td-note { max-width: 520px; text-align: right; }
.cap-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 0 0 16px; }
.cap-day { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line, #E3E9F0); background: var(--surface, #fff); text-decoration: none; color: var(--ink); }
.cap-day:hover { border-color: #B9CDEB; background: #F7FAFF; }
.cap-day.is-today { border-color: #245CC4; box-shadow: inset 0 0 0 1px #245CC4; }
.cap-day.is-low strong { color: #B54708; }
.cap-dow { font-size: 12px; font-weight: 700; color: var(--muted); }
.cap-day strong { font: 800 18px var(--display); }
.cap-sub { font-size: 11px; color: var(--muted); }
@media (max-width: 760px) { .cap-strip { grid-template-columns: repeat(4, 1fr); } .planner-head .td-note { text-align: left; } }

/* Plan next week (ReviewPlan board) */
.pw { max-width: 1150px; margin: 0 auto; width: 100%; }
.pw-weeknav { display: flex; gap: 4px; }
.pw-steps { list-style: none; display: flex; gap: 6px; margin: 4px 0 16px; padding: 0; }
.pw-steps li { flex: 1; display: flex; }
.pw-steps li > a, .pw-steps li { align-items: center; gap: 8px; }
.pw-steps li > a, .pw-steps li.is-on { flex: 1; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line, #E3E9F0); background: #fff; color: #5A6B80; font-weight: 700; font-size: 14px; text-decoration: none; }
.pw-steps li.is-done > a { background: #E9F1FF; color: #1A4794; }
.pw-steps li.is-on { background: #245CC4; color: #fff; border-color: #245CC4; }
.pw-steps span { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; background: #EDF2F8; color: #5A6B80; }
.pw-steps li.is-on span { background: #fff; color: #245CC4; }
.pw-steps .icon { width: 16px; height: 16px; }
.pw-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 14px; align-items: start; }
.pw-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; }
.pw-h h2 { margin: 0; font: 700 16px var(--display); }
.pw-top3 { padding: 0; overflow: hidden; }
.pw-row { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid #EDF1F6; }
.pw-row.is-on { background: #F2F7FF; }
.pw-row form { margin: 0; }
.pw-chk { width: 20px; height: 20px; border-radius: 5px; border: 1.8px solid #B8C4D2; background: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; color: #fff; }
.pw-chk.on { background: #245CC4; border-color: #245CC4; }
.pw-chk .icon { width: 12px; height: 12px; }
.pw-chk:disabled { opacity: .45; cursor: not-allowed; }
.pw-txt { flex: 1; display: grid; gap: 2px; font-size: 14px; }
.pw-txt > a, .pw-txt > strong { font-weight: 600; color: var(--ink); text-decoration: none; }
.pw-txt > span { font-size: 12px; color: #5A6B80; }
.pw-why { font-style: normal; color: #7A4F00; }
.pw-foot, .pw-empty { margin: 0; padding: 10px 14px; font-size: 12px; color: #5A6B80; border-top: 1px solid #EDF1F6; }
.pw-side { display: grid; gap: 14px; }
.pw-time { padding: 0 16px 14px; }
.pw-time .pw-h { padding: 14px 0 0; }
.pw-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; align-items: end; margin-top: 10px; }
.pw-bar { display: grid; justify-items: center; gap: 4px; }
.pw-dow { font-size: 12px; font-weight: 700; color: #5A6B80; }
.pw-stack { width: 30px; display: flex; flex-direction: column-reverse; border-radius: 6px; overflow: hidden; }
.pw-seg { display: block; min-height: 2px; }
.pw-free { font-size: 11px; color: #33465E; white-space: nowrap; }
.pw-job { background: #B8C4D2; } .pw-events { background: #647890; } .pw-routines { background: #0E6E86; }
.pw-projects { background: #553C8C; } .pw-todos { background: #1F7A3A; }
.pw-unplanned { background: #fff; border: 1.5px dashed #9DB6DB; box-sizing: border-box; }
.pw-legend { list-style: none; margin: 10px 0 0; padding: 0; }
.pw-legend li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid #EDF1F6; font-size: 13px; }
.pw-legend li span, .pw-legend li a { flex: 1; }
.pw-legend li.pw-sub { border-top: 0; padding: 3px 0 3px 18px; }
.pw-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pw-dot { width: 8px; height: 8px; border-radius: 50%; background: #553C8C; display: inline-block; }
.pw-free-total { padding: 14px 16px; display: grid; gap: 2px; }
.pw-free-total strong { font: 800 26px var(--display); }
.pw-amber { margin: 0; padding: 12px 14px; font-size: 13px; border: 1px solid #D9A441; background: #FFFBF2; color: #7A4F00; border-radius: 12px; }
.pw-nav { display: flex; justify-content: space-between; margin-top: 16px; }
@media (max-width: 900px) { .pw-grid { grid-template-columns: 1fr; } .pw-steps { flex-wrap: wrap; } }
.cap-sub.is-unverified { color: #B54708; }

/* ----- Today's habits popover (Today design) ----- */
:root { --hb: #1C7A6C; --hb-soft: #DDEFEA; --hb-border: #9FCFC4; --hb-wash: #F3FAF8; --hb-skip: #C9D3DE; }
@media (prefers-color-scheme: dark) {
  :root { --hb: #5FC7B5; --hb-soft: #1F3B3A; --hb-border: #3E8C80; --hb-wash: #18302E; --hb-skip: #4A5D74; }
}
.hb-anchor { position: relative; display: inline-flex; }
.hb-pop { position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; width: min(400px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-lg);
  overflow: hidden; color: var(--ink); text-align: left; font-size: 14px; }
.hb-pop[hidden] { display: none; }
.hb-head { display: flex; align-items: center; gap: 14px; padding: 18px 18px 14px; background: linear-gradient(var(--hb-wash), var(--surface)); }
.hb-ring { flex-shrink: 0; transform: rotate(-90deg); }
.hb-ring circle { fill: none; stroke-width: 6; }
.hb-ring-track { stroke: var(--hb-soft); }
.hb-ring-fill { stroke: var(--hb); stroke-linecap: round; transition: stroke-dasharray .25s; }
.hb-head-copy { flex: 1; min-width: 0; }
.hb-head-copy h2 { margin: 0; font: 800 18px var(--display, Manrope, sans-serif); letter-spacing: -.02em; }
.hb-head-copy p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.hb-ibtn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex-shrink: 0; }
.hb-ibtn:hover { background: var(--sunk); color: var(--ink); }
.hb-ibtn svg { width: 18px; height: 18px; }
.hb-list { list-style: none; margin: 0; padding: 4px 10px 6px; }
.hb-row { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-top: 1px solid var(--line); }
.hb-row:first-child { border-top: 0; }
.hb-row[data-state="skipped"] { opacity: .6; }
.hb-row[data-state="skipped"] .hb-name { text-decoration: line-through; }
.hb-tick { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; cursor: pointer;
  border: 2px solid var(--hb-border); background: var(--surface); color: var(--hb); padding: 0; }
.hb-tick svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.hb-tick:hover:not([disabled]) { background: var(--hb-soft); }
.hb-tick.s-done { background: var(--hb); border-color: var(--hb); color: var(--surface); }
.hb-tick.s-partial { border-color: var(--hb); }
.hb-tick[disabled] { cursor: default; }
.hb-body { flex: 1; min-width: 0; }
.hb-name-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hb-name { font-weight: 700; font-size: 15px; color: var(--ink); text-decoration: none; }
.hb-name:hover { text-decoration: underline; }
.hb-state { font-size: 12px; font-weight: 600; color: var(--muted); }
.hb-row[data-state="done"] .hb-state { color: var(--hb); }
.hb-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.hb-progress { height: 6px; border-radius: 3px; background: var(--hb-soft); margin-top: 7px; overflow: hidden; }
.hb-progress span { display: block; height: 6px; background: var(--hb); border-radius: 3px; }
.hb-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.hb-dots { display: flex; gap: 3px; }
.hb-d { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.hb-d.d-done { background: var(--hb); }
.hb-d.d-partial { background: var(--hb-border); }
.hb-d.d-skipped { background: var(--hb-skip); }
.hb-d.d-off, .hb-d.d-open { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.hb-d.is-today.d-due { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--hb-border); }
.hb-skip { border: 0; background: transparent; padding: 4px 6px; border-radius: 6px; font: 600 12px var(--body, inherit); color: var(--muted); cursor: pointer; }
.hb-skip:hover { background: var(--sunk); color: var(--ink); }
.hb-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--sunk); border-top: 1px solid var(--line); }
.hb-foot span { font-size: 12px; color: var(--muted); flex: 1; }
.hb-foot a:not(.btn) { font-size: 14px; font-weight: 600; }
.hb-foot .btn svg { width: 16px; height: 16px; }

/* ----- In focus on Today (Today design): a 132 px timer beside the task ----- */
.td-focus .next-focus { display: block; flex-shrink: 0; color: inherit; text-decoration: none; border-radius: 50%; }
.td-focus .focus-visual { width: 132px; height: 132px; margin: 0; }
.td-focus .td-next-title { font-size: 26px; }
@media (max-width: 560px) {
  .td-focus { flex-direction: column; align-items: flex-start; gap: 14px; }
  .td-focus .focus-visual { width: 112px; height: 112px; }
}

/* ----- The date button's month grid (Today design) ----- */
.td-cal-pop { width: 300px; padding: 14px; }
.td-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.td-cal-head strong { font: 800 15px var(--display, Manrope, sans-serif); }
.td-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.td-cal-dow { font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.td-cal-day { display: grid; place-items: center; height: 36px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; font-variant-numeric: tabular-nums; }
.td-cal-day:hover { background: var(--sunk); }
.td-cal-day.has-due { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 700; }
.td-cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.td-cal-day.is-selected { background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: none; }
.td-cal-quick { display: flex; gap: 6px; margin-top: 10px; }
.td-cal-quick .btn { flex: 1; }
.td-date-btn { font-variant-numeric: tabular-nums; }

/* Row actions (Today design): quiet icons; delete turns red only on hover. */
.td-list .btn.icon.danger, .td-next .btn.icon.danger { color: var(--muted); }
.td-list .btn.icon.danger:hover, .td-next .btn.icon.danger:hover,
.td-list .btn.icon.danger:focus-visible, .td-next .btn.icon.danger:focus-visible { color: var(--urgent, #B42318); background: color-mix(in srgb, var(--urgent, #B42318) 10%, transparent); }

/* ----- Plan one task (TOD-13: the old Planner's "selected work") ----- */
.td-plan { margin: 0 0 18px; border-color: var(--accent); }
.td-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.td-plan h2 { margin: 2px 0 0; font: 800 20px var(--display, Manrope, sans-serif); letter-spacing: -.02em; }
.td-plan-slots { list-style: none; margin: 12px 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.td-plan-slots .btn { font-variant-numeric: tabular-nums; }

/* ----- Today's agenda (/today/agenda): the old Calendar list, made printable ----- */
@media print {
  .topbar, .sidebar, .tabbar, .no-print, .agenda-add, .cal-prep-add, #hub-status-banner, #hub-toasts, .ask-panel { display: none !important; }
  .main { max-width: none; padding: 0; }
  .agenda-day { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; color: #000; }
}

/* ----- Week: review and book the week's suggestions at once (TOD-13, from the old Planner) ----- */
.tg-review { position: relative; margin: 0 0 10px; }
.tg-review > summary { list-style: none; cursor: pointer; display: inline-flex; }
.tg-review > summary::-webkit-details-marker { display: none; }
.tg-review-form { margin-top: 8px; max-width: 560px; }
.tg-review-form ul { margin: 8px 0 12px; display: flex; flex-direction: column; gap: 6px; }
/* ======================================================================
   topbar
   ====================================================================== */
/* Top navigation from the redesign: seven sections across the top, the
   current section's pages as tabs underneath, and What now?, Capture,
   Search, Ask and Settings on the right. On wide screens the old sidebar is
   hidden; on phones it stays as the "More" drawer behind the tab bar. */

.topbar {
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; gap:10px 18px; flex-wrap:wrap;
  padding:12px clamp(1rem,2.2vw,2rem);
  background:var(--surface); border-bottom:1px solid var(--line);
}
.topbar-brand {
  display:inline-flex; align-items:center; gap:9px; margin-right:10px;
  font:800 19px/1 var(--display); letter-spacing:-.03em; color:var(--ink); text-decoration:none;
}
.topbar-brand .brand-mark {
  inline-size:28px; block-size:28px; border-radius:8px; display:grid; place-items:center;
  background:var(--accent); color:var(--accent-ink);
}
.topbar-brand .brand-mark svg {inline-size:16px; block-size:16px; fill:none; stroke:currentColor; stroke-width:2.2}
.topbar-nav {display:flex; gap:2px; flex-wrap:wrap}
.topbar-nav a {
  display:inline-flex; align-items:center; gap:6px; min-block-size:var(--tap); padding:0 12px;
  border-radius:var(--r-card); font:600 15px var(--body); color:var(--muted); text-decoration:none;
}
.topbar-nav a:hover {background:var(--sunk); color:var(--ink)}
.topbar-nav a.on {background:var(--accent-soft); color:var(--accent-2)}
.topbar-nav .count {
  background:var(--accent); color:var(--accent-ink); border-radius:6px; padding:0 6px;
  font-size:12px; font-weight:700; line-height:1.5;
}
.topbar-tools {margin-left:auto; display:flex; align-items:center; gap:6px; flex-wrap:wrap}
.topbar-tools .btn {min-block-size:var(--tap)}
.topbar-tools .btn.on {background:var(--accent-soft); color:var(--accent-2)}

/* What now? */
.topbar-whatnow {position:relative}
.topbar-whatnow > summary {list-style:none; cursor:pointer}
.topbar-whatnow > summary::-webkit-details-marker {display:none}
.btn.whatnow {
  display:inline-flex; align-items:center; gap:7px; padding:0 14px; white-space:nowrap;
  background:var(--guess-bg); border:1px solid var(--guess-line); color:var(--guess-ink); font-weight:600;
}
.topbar-popover {
  position:absolute; top:calc(100% + 8px); right:0; z-index:45; inline-size:min(380px,90vw);
  padding:14px 16px; box-shadow:var(--shadow-lg);
}

/* Capture: a button that opens quick capture (C from anywhere). */
.topbar-capture {display:inline-flex; align-items:center; gap:6px; padding:0 14px; white-space:nowrap; font-weight:600}
.topbar-capture .icon {inline-size:16px; block-size:16px}
.topbar-ask {display:inline-flex; align-items:center; gap:6px; background:var(--accent-soft); color:var(--accent-2); font-weight:600}

/* Focus chip: shown while a focus session runs. */
.focus-chip {
  display:inline-flex; align-items:center; gap:8px; min-block-size:var(--tap); padding:0 12px 0 8px;
  border-radius:var(--r-pill); background:var(--ink); color:var(--surface);
  font:600 14px var(--body); text-decoration:none; white-space:nowrap; max-inline-size:280px;
}
.focus-chip[hidden] {display:none}
.focus-chip strong {overflow:hidden; text-overflow:ellipsis; font-weight:600}
.focus-chip-time {color:#9FC0FF; font-variant-numeric:tabular-nums}
.focus-chip-ring {inline-size:22px; block-size:22px; flex-shrink:0; transform:rotate(-90deg)}
.focus-chip-ring circle {fill:none; stroke-width:3; stroke:rgba(255,255,255,.2)}
.focus-chip-ring .focus-chip-progress {stroke:#6EA0FF; stroke-linecap:round; stroke-dasharray:0 50.3}
.focus-chip.paused .focus-chip-time {color:var(--guess-line)}

/* Section menus: each section's pages open from the bar (the "Top navbar with hover
   submenus" design). The section name stays a link; topnav.js opens and closes. */
.tn-item {position:relative; display:flex}
.topbar-nav .tn-link {gap:4px}
.tn-caret {inline-size:14px; block-size:14px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; opacity:.55; transition:transform .15s}
.tn-item.open .tn-caret {transform:rotate(180deg); opacity:.9}
.tn-item.open > .tn-link {background:var(--sunk); color:var(--ink)}
.tn-item.open > .tn-link.on {background:var(--accent-soft); color:var(--accent-2)}
.tn-menu {
  position:absolute; top:calc(100% + 8px); left:-6px; z-index:46; display:flex; gap:0;
  min-inline-size:300px; max-inline-size:calc(100vw - 32px); padding:8px;
  background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-lg);
}
.tn-menu[hidden] {display:none}
/* The gap between the bar and the menu counts as inside, so moving down never closes it. */
.tn-menu::before {content:""; position:absolute; inset:-10px 0 auto 0; block-size:10px}
.tn-pages {list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; min-inline-size:280px}
.topbar-nav .tn-page {
  display:flex; flex-direction:column; align-items:flex-start; gap:2px; padding:9px 12px; min-block-size:0;
  border-radius:10px; color:var(--ink); font:600 14px var(--body); text-decoration:none;
}
.topbar-nav .tn-page:hover, .topbar-nav .tn-page:focus-visible {background:var(--sunk)}
.topbar-nav .tn-page.here {background:var(--accent-soft)}
.tn-page-name {display:inline-flex; align-items:center; gap:7px}
.tn-page-desc {font-weight:400; font-size:13px; color:var(--muted); line-height:1.35; max-inline-size:250px}
.tn-aside {display:flex; flex-direction:column; gap:4px; min-inline-size:190px; margin-left:8px; padding:8px 8px 8px 16px; border-left:1px solid var(--line)}
.tn-aside-head {margin:2px 0 4px; font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--muted)}
.tn-aside ul {list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px}
.topbar-nav .tn-aside a {
  display:flex; align-items:center; gap:8px; min-block-size:32px; padding:4px 6px; border-radius:8px;
  font:500 14px var(--body); color:var(--ink);
}
.topbar-nav .tn-aside a:hover {background:var(--sunk)}
.tn-dot {inline-size:7px; block-size:7px; border-radius:50%; background:var(--accent); flex-shrink:0}
.tn-aside-empty {font-size:13px; color:var(--muted); padding:4px 6px}
.topbar-nav .tn-aside .tn-aside-all {margin-top:6px; color:var(--accent-2); font-weight:600}
@media (prefers-reduced-motion:reduce) {.tn-caret {transition:none}}

/* Wide screens: no sidebar, centred content. */
@media (min-width:861px) {
  .shell, :root.side-collapsed .shell {display:block; background:none}
  .sidebar, .drawer-backdrop {display:none}
  .main {margin-inline:auto; padding-top:.75rem}
}
/* Middle widths: What now? shortens to its icon so the bar stays on one row.
   Ask and Capture always keep their labels. */
@media (max-width:1180px) {
  .btn.whatnow span {display:none}
  .topbar-nav a {padding:0 9px}
}
/* Phones: the tab bar and "More" drawer take over section navigation. */
@media (max-width:860px) {
  .topbar {padding:10px 1rem; gap:8px}
  .topbar-nav, .topbar-whatnow {display:none}
  .topbar-tools {gap:4px}
}
/* Small phones: the tab bar's Add button does capture. */
@media (max-width:520px) {
  .topbar-capture {display:none}
}
@media (prefers-color-scheme:dark) {
  .focus-chip {background:var(--sunk); color:var(--ink)}
}

/* Projects from anywhere: the folder button (P) opens a filterable list. */
.topbar-projects > summary.btn.icon {display:inline-grid; place-items:center}
.projects-pop {inline-size:min(360px,92vw); display:grid; gap:10px}
.projects-pop-head {display:flex; align-items:baseline; justify-content:space-between}
.projects-pop-head h2 {margin:0; font-size:17px}
.projects-pop-list {list-style:none; margin:0; padding:0; max-block-size:min(52vh,420px); overflow:auto; display:grid; gap:2px}
.projects-pop-list > li {display:flex; align-items:center; gap:6px}
.projects-pop-row {flex:1; min-inline-size:0; display:grid; gap:1px; padding:8px 10px; border-radius:10px; color:inherit; text-decoration:none}
.projects-pop-row strong {font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.projects-pop-row:hover, .projects-pop-row.on {background:var(--accent-soft)}
.projects-pop-board {padding:6px 8px; border-radius:8px; color:var(--muted); text-decoration:none}
.projects-pop-board:hover {background:var(--accent-soft); color:var(--accent-2)}
.projects-pop-group {font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); padding:8px 10px 2px}
.projects-pop-foot {margin:0}
@media (max-width:860px) {
  .topbar-whatnow.topbar-projects {display:block}
  .projects-pop {position:fixed; inset-inline:12px; top:64px; inline-size:auto}
}

/* WRK-8: the page-aware "+ New" (top bar and phone tab bar). */
.new-menu { position: relative; }
.new-menu > summary { list-style: none; cursor: pointer; }
.new-menu > summary::-webkit-details-marker { display: none; }
.new-menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 230px; display: grid; gap: 2px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(21, 37, 61, .16); }
.new-menu-h { margin: 2px 8px 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.new-menu-pop > a, .new-menu-pop > button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: 600 14px var(--body); text-decoration: none; text-align: left; cursor: pointer; }
.new-menu-pop > a:hover, .new-menu-pop > button:hover, .new-menu-pop > a:focus-visible, .new-menu-pop > button:focus-visible { background: var(--sunk); outline: none; }
.new-menu-pop .icon { width: 16px; height: 16px; color: var(--accent); }
.new-menu-any { border-top: 1px solid var(--line) !important; border-radius: 0 0 9px 9px !important; margin-top: 4px; }
.new-menu-any kbd { margin-left: auto; font: 600 11px var(--body); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--muted); }
/* On the phone tab bar the menu opens upward, centred over Add. */
.new-menu-tab { display: flex; min-width: 0; }
.new-menu-tab > summary { flex: 1; }
.new-menu-tab > summary { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.new-menu-tab .new-menu-pop { position: fixed; left: 16px; right: 16px; top: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); min-width: 0; }
.tabbar .new-menu-tab > summary { font: 500 .7rem var(--body); color: var(--muted); padding: .3rem 0; border-radius: 10px; }
.tabbar .new-menu-pop > a, .tabbar .new-menu-pop > button { flex-direction: row; font: 600 15px var(--body); color: var(--ink); padding: 0 12px; min-height: 46px; }
/* One page width (Nov 2026).
   Every page's content sits in the same centred column, so moving between pages doesn't
   make the content jump from edge-to-edge to a narrow strip and back. Two sizes only:
   --page-max for ordinary pages (Today and Planner included); --page-wide for pages that lay
   things out side by side (a project board, the note editor, Content studio, Ask).
   Pages opt into the wide column with the existing `wide` class on <main>. */
:root{--page-max:1200px;--page-wide:1600px;--page-gutter:clamp(16px,2.6vw,40px)}
@media (min-width:861px){
  .main,
  .main.today-shell,
  .main:has(.today-command),
  .main:has(.ideas-head){
    max-width:calc(var(--page-max) + 2 * var(--page-gutter));
    margin-inline:auto;
    padding-inline:var(--page-gutter);
  }
  .main.wide:not(.today-shell):not(:has(.planner-page)):not(:has(.pw)),
  .main:has(.notes-layout),
  .main:has(.note-head){
    max-width:calc(var(--page-wide) + 2 * var(--page-gutter));
  }
  /* A page's own wrapper fills the column rather than shrinking to its content (a flex child
     with auto margins doesn't stretch), and no page caps itself narrower than the column. */
  .main > :where(div, section, article, header, form, nav, details){width:100%}
  .td, .planner-page, .pw, .main.today-shell > .status-banner, .lf{max-width:none}
}
