/* Shared design foundation first (docs/guides/ui-foundation.md §3): layer order, accessibility
   base (focus ring, reduced motion), then Livaday's tokens and the --ui-* theme. */
@import url('../lib/ui-foundation/layers.css');
@import url('../lib/ui-foundation/base.css');
@import url('../lib/ui-foundation/button.css');
@import url('../lib/ui-foundation/control.css');
@import url('../lib/ui-foundation/dialog.css');
@import url('../lib/ui-foundation/tabs.css');
@import url('../lib/ui-foundation/icon-button.css');
@import url('../lib/ui-foundation/segmented.css');
@import url('../lib/ui-foundation/chip.css');
@import url('./tokens.css');
@import url('./theme.css');
@import url('../lib/md-notes/md-notes.css');
@import url('./fonts.css');

/* The universal reset sits in @layer reset (guide docs/guides/ui-foundation.md §3): unlayered it
   would beat every shared or layered rule; inside the layer, all unlayered app CSS still wins as before. */
@layer reset {
  * { box-sizing: border-box; margin: 0; padding: 0; }
}
body { font-family: 'DM Sans', sans-serif; font-size: var(--fs-base); background: var(--cream); color: var(--ink); min-height: 100dvh; overflow-x: hidden; }
.app-body { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.app-body .stage { flex: 1; min-height: 0; }

/* Container-query opt-in: a component marked .cq adapts to its OWN width (not the viewport),
   so it looks right in any slot. Prefer @container over @media for relocatable pieces. */
.cq { container-type: inline-size; }

/* ── Form fields ──
   `.control` (normal) and `.control--sm` (dense cards) come from the shared
   lib/ui-foundation/control.css (guide §8.3); css/theme.css sets the --ui-control-* hooks. Feature
   classes on a field set layout only (width, flex, margin, resize, italic). Borderless in-card
   fields (quick add, steps, due date, resume note, group rename) and the round lobby search and
   offload capture bars are their own patterns, not `.control`. */
select.control {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 1.6rem;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right .55rem center;
}

/* ── File input (compact click + drop) ── */
.file-input {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 0.55rem;
  background: #fff;
  border: 1px solid var(--cream3);
  border-radius: 7px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.file-input:hover { border-color: var(--ink3); }
.file-input:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent);
}
.file-input__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.file-input__trigger {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.85rem;
  padding: 0.3rem 0.65rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink2);
  background: var(--cream);
  border: 1px solid var(--cream3);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.file-input__trigger:hover {
  border-color: var(--ink3);
  color: var(--ink);
}
.file-input__name {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink2);
}
.file-input__name--empty { color: var(--ink3); }
.file-input.is-dragover {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent);
}
.bg-section-file-input { margin-top: 0.45rem; }
#vision-overlay .file-input { margin-top: 6px; }
#vision-overlay .file-input__trigger {
  color: #fff;
  background: var(--area, var(--gold));
  border-color: transparent;
}
#vision-overlay .file-input__trigger:hover {
  filter: brightness(0.92);
  color: #fff;
}

/* Honour users who ask for less motion (accessibility default). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── HEADER ── */
.hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.5rem;
  padding-top: calc(.9rem + var(--safe-top));
  background: rgba(26,24,20,0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 200; gap: 1rem;
}
.hdr-brand { font-family: 'Fraunces', serif; font-size: var(--fs-lg); font-weight: 300; color: var(--cream); letter-spacing: -.01em; cursor: pointer; }

/* ── DATE STAMP ── */
#date-stamp { position: fixed; bottom: calc(2.1rem + var(--safe-bottom)); right: 1.2rem; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); opacity: .5; pointer-events: none; z-index: 100; font-family: 'DM Sans', sans-serif; text-shadow: 0 1px 2px rgba(0,0,0,.08); }
body.area-mode #date-stamp, body.has-lobby-bg #date-stamp { color: rgba(247,244,238,.72); text-shadow: 0 1px 5px rgba(0,0,0,.45); opacity: 1; }

/* ── VERSION TAG ── */
#version-tag { position: fixed; bottom: calc(.6rem + var(--safe-bottom)); left: .9rem; font-size: 10px; color: var(--ink3); opacity: .5; pointer-events: none; z-index: 100; font-family: 'DM Sans', sans-serif; text-shadow: 0 1px 2px rgba(0,0,0,.08); }
body.area-mode #version-tag, body.has-lobby-bg #version-tag { color: rgba(247,244,238,.65); text-shadow: 0 1px 4px rgba(0,0,0,.45); opacity: 1; }

/* ── ACCOUNT MENU ── */
.acct-menu-wrap { position: relative; }
.acct-btn { background: none; border: none; color: rgba(255,255,255,.6); cursor: pointer; padding: .3rem .35rem; border-radius: 7px; display: flex; align-items: center; transition: color .15s, background .15s; }
.acct-btn:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.1); }
.acct-dropdown { position: absolute; top: calc(100% + 6px); right: 0; background: white; border: 1px solid var(--cream3); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.14); min-width: 160px; overflow: hidden; z-index: 9000; }
.acct-dd-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: .65rem 1rem; font-size: 13px; font-family: inherit; color: var(--ink); cursor: pointer; transition: background .12s; text-decoration: none; box-sizing: border-box; }
.acct-dd-item:hover { background: var(--cream); }
.acct-dd-danger { color: #9b2020; }
.acct-dd-danger:hover { background: #fce8e8; }
.acct-dd-divider { height: 1px; background: var(--cream3); margin: 2px 0; }

/* ── ACCOUNT MODAL ── */
/* Account, Connect, Preferences and Add life area are shared dialogs (lib/ui-foundation/dialog.css); this is their panel. */
.acct-modal { border: 0; background: white; border-radius: 14px; padding: 1.75rem 1.75rem 1.5rem; width: min(360px, calc(100vw - 2rem)); box-shadow: 0 16px 48px rgba(0,0,0,.18); }
.acct-modal-title { font-family: 'Fraunces', serif; font-size: var(--fs-xl); font-weight: 300; margin-bottom: 1.25rem; color: var(--ink); }
.acct-field-label { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); margin-bottom: 6px; }
.acct-email-val { font-size: 14px; color: var(--ink); background: var(--cream); border: 1px solid var(--cream3); border-radius: 8px; padding: .55rem .85rem; word-break: break-all; }
.acct-auth-note { font-size: 12px; color: var(--ink3); margin-top: .85rem; line-height: 1.55; }
.acct-modal-footer { display: flex; justify-content: flex-end; margin-top: 1.5rem; }
.acct-modal-close { border-radius: 7px; padding: .45rem 1.1rem; font-size: 13px; }

/* ── ABOUT LIVADAY (programme_theory_about + mechanisms) ──
   Reference implementation for docs/architecture/frontend.md: design tokens + a container query.
   The modal is a named query container, so its contents adapt to the MODAL's width
   (roomier padding, two-column references when wide) rather than the viewport's. */
.about-modal { container: about / inline-size; background: var(--cream); border: 1px solid var(--border); border-radius: var(--r-lg); width: min(620px, calc(100vw - 2rem)); max-height: min(86dvh, 900px); padding: 0; flex-direction: column; overflow: hidden; box-shadow: 0 16px 48px rgba(0,0,0,.18); }
.about-hdr { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.about-title { font-family: 'Fraunces', serif; font-weight: 300; font-size: var(--fs-2xl); color: var(--ink); margin: 0; }
.about-close { background: none; border: none; color: var(--ink3); font-size: 18px; cursor: pointer; line-height: 1; padding: 4px; border-radius: var(--r-sm); transition: color .15s, background .15s; }
.about-close:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.about-body { padding: var(--sp-3) var(--sp-4) var(--sp-5); overflow-y: auto; }
.ab-lede { font-size: var(--fs-md); color: var(--ink); line-height: 1.55; margin: 0 0 var(--sp-2); }
.ab-lede em { font-style: italic; }
.ab-sec { margin-top: var(--sp-5); }
.ab-h { font-family: 'Fraunces', serif; font-weight: 400; font-size: var(--fs-xl); color: var(--ink); margin: 0 0 var(--sp-2); }
.ab-p { font-size: var(--fs-base); color: var(--ink2); line-height: 1.6; }
.ab-p a, .ab-reflist a { color: var(--gold); text-decoration: underline; }
.ab-root { font-size: var(--fs-base); color: var(--ink2); line-height: 1.5; padding: var(--sp-1) 0; }
.ab-root b { color: var(--ink); font-weight: 500; }
.ab-src { font-size: var(--fs-sm); color: var(--ink3); margin-top: 2px; }
.ab-principles { list-style: none; margin: var(--sp-1) 0 0; padding: 0; }
.ab-principles li { font-size: var(--fs-base); color: var(--ink2); line-height: 1.5; padding: 5px 0 5px 16px; position: relative; }
.ab-principles li::before { content: '·'; position: absolute; left: 4px; color: var(--gold); font-weight: 700; }
.ab-principles b { color: var(--ink); font-weight: 500; }
.ab-note { font-size: var(--fs-sm); color: var(--ink3); font-style: italic; margin-top: var(--sp-2); line-height: 1.5; }
.ab-refs { margin-top: var(--sp-1); }
.ab-refs summary { font-size: var(--fs-base); color: var(--ink2); cursor: pointer; padding: 4px 0; }
.ab-refs summary:hover { color: var(--ink); }
.ab-reflist { margin: var(--sp-2) 0 0; padding-left: 1.1rem; }
.ab-reflist li { font-size: var(--fs-sm); color: var(--ink3); line-height: 1.5; padding: 2px 0; }
.ab-foot { font-size: var(--fs-sm); color: var(--ink3); text-align: center; margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border); }

/* When the modal itself is wide (desktop), give it room and flow the long reference list
   into two columns. Driven by the container's width, not the screen's. */
@container about (min-width: 520px) {
  .about-hdr { padding: var(--sp-4) var(--sp-5); }
  .about-body { padding: var(--sp-4) var(--sp-5) var(--sp-6); }
  .ab-reflist { columns: 2; column-gap: var(--sp-5); }
  .ab-reflist li { break-inside: avoid; }
}

/* ── Stage title band (shared slot under .hdr) ──
   Area overlay + workspace (and future stage pages) use the same top clearance and gutters
   so the page title lands in one place. Area-only extras (emoji, values, Vision/Review,
   photo scrim) stay on #area-overlay. */
.stage-title-band {
  padding: var(--stage-title-top) var(--stage-gutter) 1.6rem;
}
.stage-page-title,
.workspace-title,
.ao-name {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0;
}
.workspace-title,
.stage-page-title:not(.ao-name) { color: var(--ink); }

/* ── Workspace layout (reusable stage shell) ──
   Fills the stage under the app header. First consumer: Programme theory map.
   Title band matches #area-overlay; .hdr is fixed cream while open (see rules after
   has-lobby-bg so they win specificity). */
.workspace-host {
  position: absolute; inset: 0; z-index: 6;
  display: none; flex-direction: column;
  background: var(--cream);
  padding: 0;
  overflow: hidden;
}
.workspace-host:not([hidden]) { display: flex; }
body.workspace-mode .lobby-utils { display: none; }
.workspace {
  container: workspace / inline-size;
  flex: 1; min-height: 0; min-width: 0;
  display: flex; flex-direction: column; gap: var(--sp-2);
  width: 100%; max-width: none; margin: 0;
}
.workspace-hdr.stage-title-band {
  flex: 0 0 auto;
  padding-bottom: var(--sp-2);
}
.workspace-body {
  flex: 1; min-height: 0; min-width: 0;
  display: flex; flex-direction: column;
  padding: 0 var(--stage-gutter) calc(1.5rem + 3.2rem);
}
.workspace-panes {
  flex: 1; min-height: 0; min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
  --workspace-list-w: 340px;
}
.workspace-list {
  flex: 0 0 var(--workspace-list-w);
  width: var(--workspace-list-w);
  max-width: min(62%, 36rem);
  min-width: 15rem;
}
.workspace-detail {
  flex: 1 1 0;
  min-width: 12rem;
  padding: var(--sp-3);
}
.workspace-list, .workspace-detail {
  min-height: 0; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: rgba(255,255,255,.45);
}
.workspace-split {
  flex: 0 0 9px;
  margin: 0 1px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  position: relative;
  touch-action: none;
  align-self: stretch;
}
.workspace-split::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 3px; right: 3px;
  border-radius: 2px;
  background: var(--border);
}
.workspace-split:hover::before,
.workspace-split:focus-visible::before,
.workspace-panes.is-resizing .workspace-split::before {
  background: var(--ink3);
}
.workspace-panes.is-resizing { cursor: col-resize; }
.workspace-back {
  display: none; align-items: center; gap: 4px;
  margin: 0 0 var(--sp-2); padding: 4px 0;
  border: 0; background: none; color: var(--gold); font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
@container workspace (max-width: 720px) {
  .workspace-panes { flex-direction: column; gap: 0; }
  .workspace-list {
    flex: 1 1 auto; width: auto; max-width: none; min-width: 0;
  }
  .workspace-split { display: none; }
  .workspace-panes:not(.is-detail) .workspace-detail { display: none; }
  .workspace-panes.is-detail .workspace-list { display: none; }
  .workspace-panes.is-detail .workspace-back { display: inline-flex; }
}
@media (max-width: 640px) {
  .stage-page-title, .workspace-title, .ao-name { font-size: 1.5rem; }
  .stage-title-band { padding: var(--stage-title-top-sm) var(--stage-gutter-sm) .5rem; }
  .workspace-hdr.stage-title-band { padding-bottom: var(--sp-2); }
  .workspace-body { padding-left: var(--stage-gutter-sm); padding-right: var(--stage-gutter-sm); }
}

/* ── Programme theory map (content inside workspace) ── */
.pt-map { display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; min-height: 0; }
.pt-posture-bar { flex: 0 0 auto; }
.pt-posture-bar[hidden] { display: none !important; }
.pt-layout {
  flex: 1; min-height: 0; min-width: 0;
  display: grid;
  grid-template-columns: minmax(11.5rem, 13.5rem) minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: stretch;
}
.pt-rail {
  min-width: 0; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-1) 0;
  border-right: 1px solid var(--border);
}
.pt-rail-group { display: flex; flex-direction: column; gap: 4px; }
.pt-rail-group-label {
  font-size: var(--fs-label); font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink3); margin: 0 0 2px; padding: 0 6px;
}
.pt-rail-item-wrap { display: flex; align-items: center; gap: 2px; min-width: 0; }
.pt-rail-item {
  flex: 1; min-width: 0;
  display: block; width: 100%; text-align: left;
  font-size: var(--fs-base); padding: 7px 8px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink2); cursor: pointer; font: inherit;
  line-height: 1.35;
}
.pt-rail-item:hover, .pt-rail-item.is-active {
  color: var(--ink); background: rgba(0,0,0,.04);
}
.pt-rail-item.is-active { font-weight: 500; }
.pt-main {
  min-width: 0; min-height: 0;
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.pt-mission-view, .pt-work-view, .pt-roles-view, .pt-fit-view {
  flex: 1; min-height: 0; min-width: 0;
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.pt-mission-view[hidden], .pt-work-view[hidden], .pt-roles-view[hidden], .pt-fit-view[hidden] { display: none !important; }
.pt-mission-panel {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: var(--sp-4) var(--sp-3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: rgba(0,0,0,.02);
  display: flex; flex-direction: column; gap: 0;
}
.pt-map-mission-h {
  font-family: 'Fraunces', serif; font-weight: 400; font-size: var(--fs-xl);
  color: var(--ink); margin: 0 0 var(--sp-2); line-height: 1.25;
}
.pt-map-mission {
  font-size: var(--fs-md); color: var(--ink); line-height: 1.55; margin: 0 0 var(--sp-3);
  max-width: 62ch;
}
.pt-map-role-title {
  font-size: var(--fs-base); color: var(--ink2); line-height: 1.4;
  margin: calc(-1 * var(--sp-2)) 0 var(--sp-3);
  max-width: 62ch;
}
.pt-fit .pt-map-role-title { margin-top: calc(-1 * var(--sp-1)); }
.pt-map-tagline {
  font-size: var(--fs-sm); color: var(--ink3); line-height: 1.5; margin: 0 0 var(--sp-5);
}
.pt-map-muted, .pt-posture, .pt-lens-gloss, .pt-map-foot { font-size: var(--fs-sm); color: var(--ink3); line-height: 1.5; margin: 0; }
.pt-posture { flex: 1; min-width: 12rem; }
.pt-fit { margin: var(--sp-2) 0 0; padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.pt-fit-h {
  font-family: 'Fraunces', serif; font-weight: 400; font-size: var(--fs-lg);
  margin: 0 0 var(--sp-2); color: var(--ink); line-height: 1.3;
}
.pt-fit-body { font-size: var(--fs-base); color: var(--ink2); line-height: 1.6; margin: 0; max-width: 62ch; }
/* Display titles stay inline (not flex): vertical-align:middle matches x-height mid
   of Fraunces. Flex align-items:center was lifting ⓘ above the letterforms. */
.stage-page-title .info-btn, .workspace-title .info-btn {
  font-size: 0.85rem; vertical-align: middle; margin-left: calc(6px + var(--info-pull));
  text-transform: none; letter-spacing: 0;
}
/* Panel title rows were already flex-centered — keep a fixed rem size only. */
.panel-hdr-title-row .info-btn, .det-hdr .info-btn {
  font-size: 0.85rem; text-transform: none; letter-spacing: 0;
}
/* Meta lines that stay inline in a tall line-box (lh 1.5): same flex pattern as
   list cols / rail — geometric center of the strut, not vertical-align on a <p>. */
.pt-posture,
.pt-map-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35em;
}
.pt-posture > .pt-info-text,
.pt-map-foot > .pt-info-text {
  flex: 1 1 12rem;
  min-width: 0;
}
.pt-map-mission-h,
.pt-fit-h,
.pt-gaps-h,
.pt-detail-h,
.pt-trace-h {
  display: flex;
  align-items: center;
  gap: 0.35em;
  flex-wrap: wrap;
}
.pt-trace-h .pt-info, .pt-detail-h .pt-info, .pt-fit-h .pt-info, .pt-gaps-h .pt-info, .pt-map-mission-h .pt-info {
  text-transform: none; letter-spacing: 0; font-weight: 400;
}
.pt-info { opacity: .55; }
.pt-info:hover, .pt-info:focus { opacity: 1; }
.pt-panes { margin-top: 0; flex: 1; min-height: 0; }
/* Narrow workspace: rail becomes a top strip (same IA) */
@container workspace (max-width: 720px) {
  .pt-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: var(--sp-2);
  }
  .pt-rail {
    flex-direction: row; flex-wrap: wrap; align-items: flex-start;
    gap: var(--sp-2) var(--sp-3);
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 0 var(--sp-2);
  }
  .pt-rail-group {
    flex: 1 1 auto;
    min-width: min(100%, 11rem);
  }
}
/* List: sticky column header + two-line rows (name primary, key secondary) */
.pt-list {
  display: flex; flex-direction: column;
  padding: 0; /* rows own horizontal pad; header aligns with them */
}
.pt-list-hdr {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px 6px;
  background: rgba(247,244,238,.96);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-label); font-weight: 500; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink3);
}
.pt-list-col { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.pt-list-col--end { flex: 0 0 auto; }
.pt-list-info { opacity: .55; text-transform: none; letter-spacing: 0; }
.pt-list-info:hover, .pt-list-info:focus { opacity: 1; }
.pt-list-rows { display: flex; flex-direction: column; min-height: 0; }
.pt-row {
  display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 10px;
  width: 100%; text-align: left; padding: 8px 10px; min-height: 2.75rem;
  border: 0; border-bottom: 1px solid var(--border); background: transparent;
  cursor: pointer; color: var(--ink2); font: inherit;
}
.pt-row:hover, .pt-row.is-selected { background: rgba(0,0,0,.04); color: var(--ink); }
.pt-row-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
}
.pt-row-name {
  font-size: var(--fs-base); color: var(--ink); font-weight: 500;
  line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.pt-row-key {
  font-size: var(--fs-sm); color: var(--ink3);
  font-family: ui-monospace, monospace; font-weight: 400;
  line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.pt-chip {
  flex: 0 0 auto; align-self: center;
  font-size: 11px; color: var(--ink3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 1px 6px; white-space: nowrap;
}
.pt-chip--soft { border-style: dashed; }
.pt-cite-kind {
  display: inline-block;
  font-size: var(--fs-label); font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink3); margin-right: 0.45em; vertical-align: 0.05em;
}
.pt-detail-h .pt-cite-kind { margin-right: 0.55em; }
.pt-gaps { border-top: 1px solid var(--border); margin-top: var(--sp-2); padding-top: var(--sp-2); }
.pt-gaps-h {
  font-size: var(--fs-sm); color: var(--ink3); margin: 0 0 var(--sp-1);
  padding: 0 10px; font-weight: 500;
}
.pt-detail-h { font-family: 'Fraunces', serif; font-weight: 400; font-size: var(--fs-xl); margin: 0 0 var(--sp-2); color: var(--ink); line-height: 1.3; }
.pt-trace-h { font-size: var(--fs-base); color: var(--ink); margin: var(--sp-3) 0 var(--sp-1); font-weight: 500; line-height: 1.35; }
.pt-trace-list { margin: 0; padding-left: 1.1rem; }
.pt-trace-list li { font-size: var(--fs-base); color: var(--ink2); line-height: 1.45; padding: 2px 0; }
.pt-build { margin-top: var(--sp-3); font-size: var(--fs-sm); color: var(--ink2); }
.pt-build summary {
  cursor: pointer; color: var(--ink3);
  display: inline-flex; align-items: center; gap: 0.35em;
}
.pt-inline { background: none; border: none; color: var(--gold); cursor: pointer; text-decoration: underline; padding: 0; font: inherit; }
.pt-about-body { font-size: var(--fs-base); color: var(--ink2); line-height: 1.55; }

/* How this map fits — hub + labeled SVG edges (low-ink) */
.pt-roles-diagram {
  margin: var(--sp-4) 0 var(--sp-2);
  max-width: 40rem;
}
.pt-roles-svg {
  display: block; width: 100%; height: auto;
  overflow: visible;
}
.pt-roles-marker { fill: var(--ink3); }
.pt-roles-edge {
  fill: none; stroke: var(--ink3); stroke-width: 1.25;
  stroke-linecap: round; stroke-linejoin: round;
}
.pt-roles-edge--claim { stroke: var(--gold); stroke-width: 1.5; }
.pt-roles-edge--evidence { stroke: var(--ink2); stroke-dasharray: 5 3.5; }
.pt-roles-edge--bound { stroke: var(--ink3); stroke-dasharray: 1.5 3.5; stroke-width: 1.15; }
.pt-roles-elabel {
  fill: var(--ink3);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: .02em;
}
.pt-roles-k {
  fill: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: var(--fs-base);
  font-weight: 500;
}
.pt-roles-k--hub {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: var(--fs-lg);
}
.pt-roles-v {
  fill: var(--ink3);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
}
.pt-roles-hub-bg {
  fill: rgba(255,255,255,.55);
  stroke: var(--gold);
  stroke-width: 1.25;
}
.pt-roles-legend {
  display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-4);
  margin: var(--sp-2) 0 0;
  padding: 0;
  font-size: var(--fs-sm); color: var(--ink3);
}
.pt-roles-leg {
  display: inline-flex; align-items: center; gap: 8px;
}
.pt-roles-leg-line {
  display: inline-block; width: 1.6rem; height: 0;
  border-top: 1.5px solid var(--ink3);
}
.pt-roles-leg-line--claim { border-top-color: var(--gold); border-top-width: 2px; }
.pt-roles-leg-line--evidence { border-top-style: dashed; border-top-color: var(--ink2); }
.pt-roles-leg-line--bound { border-top-style: dotted; border-top-width: 2px; }

/* Related-trace portal (in-detail cross-links) */
.pt-portal {
  position: absolute; inset: 0; z-index: 8;
  pointer-events: none;
}
.pt-portal:not([hidden]) { pointer-events: auto; }
.pt-portal[hidden] { display: none !important; }
.pt-portal-backdrop {
  position: absolute; inset: 0;
  background: rgba(26,24,20,.28);
}
.pt-portal-sheet {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(28rem, 92%);
  display: flex; flex-direction: column;
  background: var(--cream);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 28px rgba(0,0,0,.10);
  min-height: 0;
}
.pt-portal-hdr {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.pt-portal-title {
  flex: 1; min-width: 0;
  margin: 0;
  font-family: 'Fraunces', serif; font-weight: 400; font-size: var(--fs-lg);
  color: var(--ink); line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pt-portal-back, .pt-portal-close {
  flex: 0 0 auto;
  border: 0; background: none; color: var(--gold);
  font: inherit; font-size: var(--fs-sm); cursor: pointer;
  padding: 4px 6px; border-radius: var(--r-sm);
}
.pt-portal-close { color: var(--ink3); }
.pt-portal-back:hover, .pt-portal-close:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.pt-portal-back[hidden] { display: none !important; }
.pt-portal-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: var(--sp-3);
}
.pt-map { position: relative; }

/* Flex-column panels; as dialogs only while open (a closed dialog keeps display:none, dialog.css). */
.about-modal:not(dialog), .about-modal[open], .evoke-modal[open], .align-modal[open], .manage-modal[open],
.vision-modal[open], .prepare-modal[open], .review-modal[open], .offload-modal[open] { display: flex; }

/* ── Public pre-login About page (about.html). Reuses the .about-modal card + every .ab-*
   style so the markup is single-sourced with the in-app overlay. On a full page the card
   flows (no fixed-height inner scroll) and sits centred on the cream backdrop. ── */
.about-page { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: var(--sp-4); background: var(--cream); }
.about-page .about-modal { max-height: none; width: min(680px, calc(100vw - 2rem)); margin: var(--sp-4) 0; box-shadow: 0 16px 48px rgba(0,0,0,.10); }
.about-page .about-body { overflow-y: visible; }
.about-back { font-size: var(--fs-base); color: var(--ink3); text-decoration: none; padding: 4px 6px; border-radius: var(--r-sm); transition: color .15s, background .15s; white-space: nowrap; }
.about-back:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.about-cta { padding: var(--sp-3) var(--sp-4) var(--sp-4); border-top: 1px solid var(--border); flex: 0 0 auto; }
.about-cta-btn { display: block; text-align: center; font-size: var(--fs-base); font-weight: 500; padding: 12px 16px; border-radius: var(--r-sm); }

/* Crisis / not-a-substitute notice: a calm, easy-to-spot callout — compassion, never alarm
   (no red / escalation). Shared by the overlay and the public page (js/about-view.js). */
.ab-sec--safety { padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--r-lg); background: rgba(196,150,58,.06); }

/* ── Public landing (index.html). Calm + typographic; the hero, proof lines and safety
   note flow from programme_theory_about via js/landing-view.js (a third surface onto one source). ── */
.lp { min-height: 100dvh; background: var(--cream); padding: var(--sp-4); }
.lp-inner { max-width: 600px; margin: 0 auto; padding: clamp(2rem, 6vw, 4rem) 0; }
.lp-brand { font-family: 'Fraunces', serif; font-weight: 400; font-size: var(--fs-xl); color: var(--ink); margin-bottom: clamp(2rem, 7vw, 3.5rem); }
.lp-h1 { font-family: 'Fraunces', serif; font-weight: 300; font-size: var(--fs-2xl); line-height: 1.18; color: var(--ink); margin: 0 0 var(--sp-3); max-width: 24ch; }
.lp-sub { font-size: var(--fs-md); line-height: 1.6; color: var(--ink2); margin: 0 0 var(--sp-5); max-width: 52ch; }
.lp-sub em { font-style: italic; }
/* Hero row: headline/subline beside the archetypal Wheel; wheel drops below on narrow. */
.lp-hero-row { display: flex; gap: var(--sp-5); align-items: center; flex-wrap: wrap; }
.lp-hero-row #lp-hero { flex: 1 1 260px; }
.lp-wheel { flex: 0 0 auto; }
.lp-wheel svg { display: block; width: clamp(116px, 28vw, 152px); height: auto; }
.lp-cta { margin-bottom: clamp(2rem, 7vw, 3rem); }
.lp-field { display: flex; gap: 8px; max-width: 440px; }
.lp-input { flex: 1; min-height: 44px; }
.lp-btn { height: 44px; border-radius: var(--r-sm); padding: 0 18px; font-size: var(--fs-base); font-weight: 500; white-space: nowrap; }
.lp-note { font-size: var(--fs-sm); color: var(--ink3); margin: .6rem 0 0; line-height: 1.5; }
.lp-link { background: none; border: none; color: var(--gold-ink); font-family: inherit; font-size: var(--fs-sm); cursor: pointer; text-decoration: underline; padding: 0; }
.lp-link:hover { color: var(--ink); }
.lp-confirm { font-size: var(--fs-base); color: var(--ink2); }
.lp-proof { border-top: 1px solid var(--border); padding-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); max-width: 58ch; }
.lp-point { display: flex; gap: 11px; align-items: flex-start; font-size: var(--fs-base); line-height: 1.55; color: var(--ink2); }
.lp-point b { color: var(--ink); font-weight: 500; }
.lp-ring { flex: none; margin-top: 2px; }
.lp-ring circle { stroke: var(--gold); }
.lp-safety { font-size: var(--fs-sm); color: var(--ink3); line-height: 1.6; margin: var(--sp-4) 0 0; border-left: 3px solid var(--gold); padding-left: 14px; max-width: 54ch; }
.lp-safety a { color: var(--gold); text-decoration: underline; }
.lp-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: clamp(2rem, 7vw, 3rem); padding-top: var(--sp-4); border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--ink3); }
.lp-foot a { color: var(--gold); text-decoration: none; }
.lp-foot a:hover { text-decoration: underline; }

/* ── LOBBY START COLUMN + HERO (Option A: Offload above Prepare, left of Wheel) ── */
.lobby-center {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  padding-inline: 0.75rem;
}
.lobby-start {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  width: min(16.5rem, 30vw);
  flex: 0 0 auto;
  z-index: 5;
  order: 0;
}
body.area-mode .lobby-start,
body.workspace-mode .lobby-start { display: none; }
.lobby-start-prepare {
  align-self: flex-start;
  opacity: .55;
}
.lobby-start-prepare:hover { opacity: 1; }
.lobby-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
}

/* Lobby utils — under wheel in .lobby-hero (no longer absolute bottom of lobby-center) */
.lobby-utils {
  position: static; transform: none; bottom: auto; left: auto;
  z-index: 5; white-space: nowrap; display: flex; gap: 6px;
  margin-top: 2.75rem; justify-content: center; flex-wrap: wrap;
}
body.area-mode .lobby-utils { display: none; }
.lobby-util-btn { gap: 0; font-size: 11px; padding: .35rem .65rem; border-radius: 6px; opacity: .4; transition: opacity .15s, color .15s, background .15s; }
.lobby-util-btn:hover { opacity: 1; }
/* Prepare button badge */
.prepare-badge { display: inline-flex; align-items: center; justify-content: center; background: rgba(26,24,20,.15); color: inherit; border-radius: 8px; font-size: 10px; padding: 0 4px; min-width: 15px; height: 15px; margin-left: 4px; vertical-align: middle; line-height: 1; }
body.has-lobby-bg .prepare-badge { background: rgba(247,244,238,.22); }

/* On lobby background image — dark frosted pill (float-pill pattern) */
body.has-lobby-bg .lobby-utils { background: rgba(26,24,20,.58); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(247,244,238,.10); border-radius: 2rem; padding: .2rem .4rem; }
body.has-lobby-bg .lobby-util-btn { text-shadow: none; opacity: 1; }
body.has-lobby-bg .lobby-start-prepare { opacity: 1; }

/* Offload strip — in start column (not absolute under utils) */
.offload-strip {
  position: relative; bottom: auto; left: auto; transform: none;
  z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
  width: 100%;
}
body.area-mode .offload-strip,
body.workspace-mode .offload-strip { display: none; }
.offload-capture-form { flex: 1 1 100%; min-width: 0; margin: 0; }
.offload-entries { display: flex; flex-wrap: wrap; gap: .35rem; }
.offload-capture-input {
  width: 100%; box-sizing: border-box;
  background: rgba(26,24,20,.07); border: 1px solid var(--cream3);
  border-radius: 2rem; padding: .4rem 1rem; font-size: 13px;
  font-family: inherit; color: var(--ink); outline: none;
}
.offload-capture-input::placeholder { color: var(--ink3); opacity: .7; }
.offload-capture-input:focus {
  background: white; border-color: var(--ink3);
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
body.has-lobby-bg .offload-capture-input {
  background: rgba(247,244,238,.18); border-color: rgba(247,244,238,.50);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
}
body.has-lobby-bg .offload-capture-input:focus {
  background: rgba(247,244,238,.28); border-color: rgba(247,244,238,.70);
}
.offload-inbox-btn {
  flex-shrink: 0; font-size: 12px; padding: .35rem .55rem;
  border-radius: 6px; white-space: nowrap; opacity: .75;
}
.offload-inbox-btn:hover { opacity: 1; }
body.has-lobby-bg .offload-inbox-btn { opacity: 1; }
.offload-postsave {
  position: absolute; left: 0; right: 0; bottom: calc(100% + .35rem);
  display: flex; justify-content: center; gap: .5rem;
}
.offload-postsave[hidden] { display: none !important; }
.offload-postsave-btn {
  font-size: 12px; border-radius: 999px; padding: .3rem .85rem;
}

.offload-modal {
  width: min(28rem, 100%); max-height: min(80dvh, 36rem);
  padding: 0; border: 0;
  background: var(--cream, #f7f4ee); border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0,0,0,.22);
  flex-direction: column; overflow: hidden;
}
.offload-inbox-list {
  overflow: auto; padding: .5rem .75rem 1rem;
  display: flex; flex-direction: column; gap: .35rem;
}
.offload-inbox-row {
  text-align: left; width: 100%; cursor: pointer;
  border: 1px solid var(--cream3); background: rgba(255,255,255,.65);
  border-radius: 10px; padding: .7rem .85rem; font-family: inherit;
  color: var(--ink); font-size: var(--fs-base);
}
.offload-inbox-row:hover { background: white; }
.offload-inbox-row-text {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; white-space: pre-wrap;
}
.offload-inbox-empty { margin: 1rem .5rem; color: var(--ink3); font-size: var(--fs-sm); }
.offload-place-body { padding: 1rem 1.25rem 1.25rem; }
.offload-place-text {
  margin: 0 0 .75rem; white-space: pre-wrap; font-size: var(--fs-md); color: var(--ink);
}
.offload-place-hint { margin: 0 0 1rem; font-size: var(--fs-hint); color: var(--ink3); }
.offload-place-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.offload-primary-btn, .offload-secondary-btn {
  font-size: 13px; border-radius: 8px; padding: .45rem .9rem;
}
.offload-review-nudge {
  margin: 0 0 .75rem; font-size: 13px; color: var(--ink3);
}

/* ── AREA EDIT STICKY HEADER ── */
/* Uses the shared .panel-hdr; this just gives it the card-coloured background
   so content scrolls cleanly beneath the sticky header inside the card. */
.area-settings-hdr { background: rgba(247,244,238,0.85); }

/* ── ALIGNMENT MODAL ── */
/* ── Shared panel / modal header ─────────────────────────────────────────── */
/* Use panelHeader() from js/ui.js to generate these. Spec:                    */
/*   .panel-hdr — outer row (flex, padding, border-bottom)                    */
/*   .panel-hdr-left — left column (title row + optional tabs)                */
/*   .panel-hdr-title-row — inline: title + optional ⓘ                       */
/*   .panel-hdr-title — Fraunces --fs-xl / 300 (shared panel/modal title role) */
/*   .panel-close — ✕ button: a shared .icon-btn (look in theme.css)          */
.panel-hdr { display: flex; align-items: flex-start; justify-content: space-between; padding: 1.1rem 1.5rem .9rem; border-bottom: 1px solid var(--cream3); flex-shrink: 0; gap: 1rem; }
.panel-hdr-left { display: flex; flex-direction: column; gap: .45rem; flex: 1; min-width: 0; }
.panel-hdr-title-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.panel-hdr-title { font-family: 'Fraunces', serif; font-size: var(--fs-xl); font-weight: 300; color: var(--ink); }
.panel-hdr-sub { margin: .2rem 0 0; font-size: var(--fs-hint); color: var(--ink3); line-height: 1.4; max-width: 42rem; }
.panel-hdr-sub[hidden] { display: none; }
/* Tabs inside panel header: gap handles spacing, no extra margin needed */
.panel-hdr-left .prepare-tabs { margin-top: 0; }
/* Area and Home settings: a pill skin of the shared .tabs (hooks in css/theme.css), drawn on the
   same track as the segmented controls; equal tabs. */
.settings-tabs { background: var(--ui-seg-bg); border-radius: var(--ui-seg-radius); }
.settings-tabs .tabs__tab { flex: 1; justify-content: center; }
.settings-tabs .tabs__tab[aria-selected='true'] { box-shadow: var(--ui-seg-on-shadow); }
/* Review: cream bg acts as visual separator — no border-bottom needed */
.review-hdr { border-bottom: none; padding-bottom: .35rem; }

.align-modal { padding: 0; border: 0; background: white; border-radius: 14px; width: min(380px, calc(100vw - 2rem)); max-height: min(560px, calc(100dvh - 4rem)); flex-direction: column; box-shadow: 0 16px 48px rgba(0,0,0,.18); overflow: hidden; }
.align-balance-val { font-size: 11px; color: var(--ink3); letter-spacing: .03em; opacity: .7; margin-left: 2px; }
.align-body { padding: 1.1rem 1.5rem 1.25rem; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* ── MANAGE AREAS MODAL ── */
/* ── Moving toward (WB-9; table vision_items) ── */
.ao-actions { position: absolute; bottom: 0; right: 0; display: flex; align-items: center; gap: 4px; }
.vision-modal {
  padding: 0; border: 0;
  background: var(--cream); border-radius: var(--r-lg);
  width: min(var(--modal-content-max-w), calc(100vw - var(--modal-content-gutter)));
  max-height: min(94dvh, calc(100dvh - 1rem));
  flex-direction: column; box-shadow: 0 16px 48px rgba(0,0,0,.18); overflow: hidden;
}
.vision-modal .panel-hdr { padding: 1.15rem 1.5rem .85rem; border-bottom: 1px solid var(--cream3); }
.vision-body { padding: 1.15rem 1.5rem 1.75rem; overflow-y: auto; }
.vision-loading, .vision-empty-life { padding: 2rem 0; text-align: center; color: var(--ink3); font-size: var(--fs-sm); line-height: 1.6; }
.vision-lane { margin-bottom: 1.5rem; }
.vision-lane:last-child { margin-bottom: 0; }
.vision-lane-hdr { display: flex; align-items: center; gap: 8px; margin-bottom: .6rem; flex-wrap: wrap; }
.vision-lane-title { font-family: 'Fraunces', serif; font-size: var(--fs-lg); font-weight: 400; color: var(--ink); }
.vision-lane-hint { font-size: var(--fs-hint); color: var(--ink3); }
.vision-area-jump { background: none; border: none; font-family: 'Fraunces', serif; font-size: var(--fs-lg); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 0; }
.vision-area-jump:hover { color: var(--gold); }
.vision-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vision-card { position: relative; border-radius: 10px; overflow: hidden; background: var(--cream2); border: 1px solid var(--cream3); }
.vision-card-img { width: 100%; aspect-ratio: 4 / 3; background-size: cover; background-position: center; background-color: var(--cream2); }
.vision-card-meta { padding: 7px 9px 9px; }
.vision-card-cap { font-size: 12px; color: var(--ink); line-height: 1.35; }
.vision-card-val { font-size: 11px; color: var(--ink3); font-style: italic; margin-top: 3px; line-height: 1.4; }
.vision-card-actions { position: absolute; top: 5px; right: 5px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.vision-card:hover .vision-card-actions { opacity: 1; }
.vision-card-edit, .vision-card-del { width: 22px; height: 22px; border: none; border-radius: 5px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; cursor: pointer; line-height: 1; padding: 0; }
.vision-card-edit:hover, .vision-card-del:hover { background: rgba(0,0,0,.8); }
.vision-step { margin-top: 7px; background: none; border: 1px dashed var(--cream3); color: var(--ink3); font-family: inherit; font-size: 11px; padding: .25rem .55rem; border-radius: 6px; cursor: pointer; width: 100%; text-align: left; transition: border-color .12s, color .12s; }
.vision-step:hover { border-color: var(--ink3); color: var(--ink); }
.vision-step.has { border-style: solid; border-color: var(--gold); color: var(--ink2); }
.vision-add { border: 1px dashed var(--cream3); border-radius: 10px; background: none; color: var(--ink3); font-family: inherit; font-size: var(--fs-base); cursor: pointer; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; transition: border-color .12s, color .12s; }
.vision-add:hover { border-color: var(--gold); color: var(--ink); }
.vision-composer { max-width: min(36rem, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.vision-comp-hdr { font-family: 'Fraunces', serif; font-size: var(--fs-lg); font-weight: 400; color: var(--ink); }
.vision-comp-tabs { display: flex; gap: 6px; }
.vision-comp-tab { flex: 1; background: white; border: 1px solid var(--cream3); border-radius: 7px; padding: .4rem; font-family: inherit; font-size: var(--fs-sm); color: var(--ink3); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.vision-comp-tab.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.vision-comp-preview:not(:empty) { margin: 2px 0; }
.vision-comp-preview .vision-card-img { border-radius: 10px; aspect-ratio: 16 / 9; }
.vision-comp-status { padding: 1.5rem 0; text-align: center; color: var(--ink3); font-size: var(--fs-sm); }
.vision-comp-field { display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-md); font-weight: 500; color: var(--ink); }
.vision-comp-sub { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink3); opacity: .8; font-size: var(--fs-hint); }
.guide-suggest:not(:empty) { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--cream2); border-radius: 8px; padding: .5rem .65rem; margin: 2px 0; }
.guide-suggest-label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink3); }
.guide-suggest-text { font-size: 13px; font-style: italic; color: var(--ink); flex: 1; min-width: 0; }
.guide-suggest-use { background: none; border: 1px solid var(--cream3); border-radius: 6px; color: var(--ink2); font-family: inherit; font-size: 11px; padding: .22rem .55rem; cursor: pointer; white-space: nowrap; transition: border-color .12s, color .12s; }
.guide-suggest-use:hover { border-color: var(--ink3); color: var(--ink); }
.guide-suggest-ok { font-size: 12px; color: var(--ink3); font-style: italic; }
.guide-step-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.guide-step-row input[type="checkbox"] { flex-shrink: 0; margin-top: 0; }
.guide-step-text { flex: 1; min-width: 0; }
.vision-comp-input { font-weight: 400; }
.vision-gen-prompt { line-height: 1.5; }
/* .vision-gen-btn, .vision-comp-save and .vision-comp-cancel are shared .btn / .btn--secondary
   (lib/ui-foundation/button.css); the overlays' area fill is a --ui-btn-* hook in css/theme.css. */
.vision-gen-btn { margin-top: 6px; }
.vision-comp-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.vision-adv-note { font-size: var(--fs-hint); color: var(--ink3); opacity: .8; line-height: 1.4; margin-top: 2px; }
.vision-adv:not(:empty) { display: flex; flex-direction: column; gap: 8px; padding: 2px 0; }
.vision-adv-hdr { font-size: var(--fs-label); color: var(--ink2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vision-adv-hint { font-size: var(--fs-hint); color: var(--ink3); font-weight: 400; }
.vision-adv-steps { display: flex; flex-direction: column; gap: 4px; }
.vision-adv-step { display: flex; align-items: flex-start; gap: 7px; font-size: var(--fs-base); color: var(--ink); line-height: 1.4; cursor: pointer; padding: 2px 0; }
.vision-adv-step input { margin-top: 3px; flex-shrink: 0; }
.vision-adv-step.dupe { color: var(--ink3); }
.vision-adv-dupe { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink3); background: var(--cream2); border-radius: 4px; padding: 1px 6px; margin-left: auto; white-space: nowrap; align-self: center; }
.vision-adv-woop { border-top: 1px solid var(--cream3); padding-top: 8px; }
.vision-adv-woop > summary { font-size: var(--fs-hint); color: var(--ink3); cursor: pointer; user-select: none; }
.vision-adv-woop > summary:hover { color: var(--ink); }
.vision-adv-woop .vision-comp-input { margin-top: 6px; }
.vision-area-suggest:not(:empty) { font-size: var(--fs-hint); color: var(--ink3); line-height: 1.45; margin: -2px 0 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vision-area-suggest strong { color: var(--ink2); font-weight: 500; }
.vision-area-ok { opacity: .85; }
.vision-area-use { background: none; border: 1px solid var(--cream3); border-radius: 6px; color: var(--ink2); font-family: inherit; font-size: 11px; padding: .2rem .55rem; cursor: pointer; white-space: nowrap; transition: border-color .12s, color .12s; }
.vision-area-use:hover { border-color: var(--ink3); color: var(--ink); }

.manage-modal { padding: 0; border: 0; background: white; border-radius: 14px; width: min(440px, calc(100vw - 2rem)); max-height: min(560px, calc(100dvh - 4rem)); flex-direction: column; box-shadow: 0 16px 48px rgba(0,0,0,.18); overflow: hidden; }
.manage-list { flex: 1; overflow-y: auto; padding: .4rem 0; }
.manage-row { display: flex; align-items: center; gap: 10px; padding: .6rem 1.25rem; transition: background .12s; cursor: default; }
.manage-row:hover { background: var(--cream); }
.manage-drag { font-size: 14px; color: var(--ink3); opacity: .25; cursor: grab; flex-shrink: 0; padding: 0 2px; user-select: none; touch-action: none; transition: opacity .15s; }
.manage-drag:active { cursor: grabbing; }
.manage-row:hover .manage-drag { opacity: .45; }
.manage-drag:hover { opacity: .75 !important; }
.manage-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.manage-name { flex: 1; font-size: var(--fs-base); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-edit-btn { border-radius: 6px; font-size: 12px; padding: .25rem .7rem; white-space: nowrap; flex-shrink: 0; }
.manage-del-btn { background: none; border: none; font-size: 15px; color: var(--ink3); cursor: pointer; padding: 2px 4px; opacity: .25; transition: opacity .15s, color .15s; line-height: 1; flex-shrink: 0; }
.manage-del-btn:hover { opacity: 1 !important; color: #9b2020; }
.manage-row:hover .manage-del-btn { opacity: .4; }
.manage-footer { flex-shrink: 0; padding: .85rem 1.25rem; border-top: 1px solid var(--cream3); }
.manage-add-btn { width: 100%; background: none; border: 1px dashed rgba(0,0,0,.2); border-radius: 8px; padding: .6rem 1rem; font-size: 13px; font-family: inherit; color: var(--ink3); cursor: pointer; transition: border-color .15s, color .15s, background .15s; text-align: left; }
.manage-add-btn:hover { border-color: var(--ink); color: var(--ink); background: rgba(0,0,0,.02); }

/* Area view — fixed + transparent so stage fills full viewport behind it */
.hdr.area-mode { position: fixed; top: 0; left: 0; right: 0; background: linear-gradient(to bottom, rgba(0,0,0,.45) 0%, rgba(0,0,0,.12) 55%, transparent 100%); backdrop-filter: none; -webkit-backdrop-filter: none; }
.hdr.area-mode .hdr-brand { text-shadow: 0 1px 8px rgba(0,0,0,.55); }
.hdr.area-mode .acct-btn { color: rgba(255,255,255,.68); text-shadow: 0 1px 5px rgba(0,0,0,.5); }
.hdr.area-mode .acct-btn:hover { color: rgba(255,255,255,.95); background: rgba(255,255,255,.12); }

/* Lobby background image — header goes fixed + transparent, matching area-header treatment */
body.has-lobby-bg .hdr { position: fixed; top: 0; left: 0; right: 0; background: linear-gradient(to bottom, rgba(0,0,0,.45) 0%, rgba(0,0,0,.12) 55%, transparent 100%); backdrop-filter: none; -webkit-backdrop-filter: none; }
body.has-lobby-bg .hdr-brand { text-shadow: 0 1px 8px rgba(0,0,0,.55); }
body.has-lobby-bg .acct-btn { color: rgba(255,255,255,.68); text-shadow: 0 1px 5px rgba(0,0,0,.5); }
body.has-lobby-bg .acct-btn:hover { color: rgba(255,255,255,.95); background: rgba(255,255,255,.12); }

/* Fixed .hdr leaves document flow — the Home title band clears it with the shared title-band
   token (same contract as area/workspace). Photo still edge-to-edge via absolute #bg-prev. */
body.has-lobby-bg:not(.area-mode):not(.workspace-mode) .lobby-title-band {
  padding-top: var(--stage-title-top);
}
body.has-lobby-bg:not(.area-mode):not(.workspace-mode) .stage {
  scroll-padding-top: var(--stage-title-top);
}
@media (max-width: 899px) {
  body.has-lobby-bg:not(.area-mode):not(.workspace-mode) .lobby-title-band {
    padding-top: var(--stage-title-top-sm);
  }
  body.has-lobby-bg:not(.area-mode):not(.workspace-mode) .stage {
    scroll-padding-top: var(--stage-title-top-sm);
  }
}

/* Workspace mode: fixed cream .hdr (same slot as area). After has-lobby-bg / area-mode so these win. */
body.workspace-mode .hdr,
body.workspace-mode.has-lobby-bg .hdr,
body.workspace-mode .hdr.area-mode {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(247,244,238,.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
body.workspace-mode .hdr-brand,
body.workspace-mode.has-lobby-bg .hdr-brand {
  text-shadow: none; color: var(--ink);
}
body.workspace-mode .acct-btn,
body.workspace-mode.has-lobby-bg .acct-btn {
  color: var(--ink3); text-shadow: none;
}
body.workspace-mode .acct-btn:hover,
body.workspace-mode.has-lobby-bg .acct-btn:hover {
  color: var(--ink); background: rgba(0,0,0,.05);
}

/* ── FLOATING SPATIAL NAV ── */
#float-nav-group { position: absolute; bottom: calc(1.5rem + var(--safe-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 150; }
#float-nav-group.visible { opacity: 1; pointer-events: all; }
@media (pointer: coarse) { #float-nav-group.visible { opacity: 0.95; } }
.float-pill { background: rgba(26,24,20,0.60); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(247,244,238,0.14); border-radius: 2rem; color: rgba(247,244,238,0.82); font-family: inherit; font-size: 12px; padding: .42rem .95rem; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.float-pill:hover { background: rgba(26,24,20,0.84); color: rgba(247,244,238,1); }

/* ── AREA IDENTITY OVERLAY ── */
#area-overlay {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  /* Same band as .stage-title-band / workspace-hdr */
  padding: var(--stage-title-top) var(--stage-gutter) 1.6rem;
  opacity: 0; pointer-events: none; transition: opacity .35s .05s;
}
#area-overlay.visible { opacity: 1; pointer-events: all; }
.ao-title-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.ao-emoji { font-size: 2rem; line-height: 1; flex-shrink: 0; }
/* .ao-name typography: shared with .stage-page-title above */
.ao-vs { font-size: 13px; line-height: 1.55; font-style: italic; margin-top: .5rem; opacity: .85; }
.ao-vs.ao-vs-open { cursor: pointer; }
.ao-vs.ao-vs-open:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.ao-values-entry {
  display: inline-block; margin-top: .35rem; padding: 0;
  border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 500;
  letter-spacing: .02em; opacity: .72; text-decoration: underline;
  text-underline-offset: 2px; color: inherit;
}
.ao-values-entry[hidden] { display: none !important; }
.ao-values-entry:hover { opacity: 1; }
.ao-values-entry:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
/* Light text + gradient scrim when background image is active */
#area-overlay.on-image {
  background:
    linear-gradient(to bottom, rgba(0,0,0,.42) 0%, rgba(0,0,0,.06) 55%, transparent 78%),
    linear-gradient(to right,  rgba(0,0,0,.20) 0%, transparent 52%);
}
#area-overlay.on-image .ao-name  { color: rgba(247,244,238,.97) !important; text-shadow: 0 1px 8px rgba(0,0,0,.55); }
#area-overlay.on-image .ao-emoji { color: rgba(247,244,238,.97) !important; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
#area-overlay.on-image .ao-vs    { color: rgba(247,244,238,.88) !important; text-shadow: 0 1px 5px rgba(0,0,0,.45); }
#area-overlay.on-image .ao-values-entry { color: rgba(247,244,238,.82) !important; text-shadow: 0 1px 5px rgba(0,0,0,.45); }
#area-overlay.on-image .ao-review-btn { color: rgba(247,244,238,.85) !important; text-shadow: 0 1px 5px rgba(0,0,0,.5); }
#area-overlay.on-image .ao-review-btn:hover { background: rgba(247,244,238,.12); color: rgba(247,244,238,1) !important; }

/* Area values place sheet (P4-1 + P4-7 two-col) */
.avp-modal { width: min(52rem, 100%); max-height: min(90dvh, 46rem); }
.avp-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  container: avp-body / inline-size;
  overflow: hidden;
}
.avp-col {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.avp-col-collect { border-right: 1px solid var(--cream3); }
.avp-col-summary { padding-bottom: .35rem; }
@container avp-body (max-width: 36rem) {
  .avp-body { grid-template-columns: 1fr; }
  .avp-col-collect {
    border-right: 0;
    border-bottom: 1px solid var(--cream3);
    max-height: min(42dvh, 22rem);
  }
}
.avp-sentence {
  padding: .75rem .85rem 0; display: flex; flex-direction: column; gap: .45rem;
}
.avp-field-label { font-size: 12px; color: var(--ink3); }
.avp-textarea { line-height: 1.45; }
.avp-lists { overflow: visible; padding: .75rem .85rem 1.1rem; display: flex; flex-direction: column; gap: 1rem; }
.avp-add {
  display: flex; gap: .5rem; align-items: stretch; margin: 0 0 .65rem;
}
.avp-add .offload-input { flex: 1; min-width: 0; }
.avp-add .offload-primary-btn { flex-shrink: 0; white-space: nowrap; }
.avp-section-title {
  margin: 0 0 .45rem; font-size: 12px; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; color: var(--ink3);
}
.avp-row {
  border: 1px solid var(--cream3); border-radius: 10px; background: rgba(255,255,255,.65);
  padding: .65rem .8rem; margin: 0 0 .35rem;
}
.avp-row-text { font-size: 14px; color: var(--ink); white-space: pre-wrap; }
.avp-row-meta { font-size: 11px; color: var(--ink3); margin-top: .3rem; }
.avp-row-actions { margin-top: .45rem; }
.avp-row-btn {
  border: 0; background: transparent; font-family: inherit;
  font-size: 12px; color: var(--ink2); cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 2px;
}
.avp-row-btn:hover { color: var(--ink); }
.avp-row-pick {
  display: flex; align-items: flex-start; gap: .5rem; cursor: pointer;
}
.avp-row-pick input { margin-top: .2rem; flex-shrink: 0; }
.avp-propose-bar {
  display: flex; flex-wrap: wrap; gap: .45rem;
  padding: .55rem .85rem 0;
}
.avp-propose-box {
  padding: .55rem .85rem 0; display: flex; flex-direction: column; gap: .45rem;
}
.avp-history-wrap { padding: .75rem .85rem 1.1rem; }
.avp-hist-row {
  border: 1px solid var(--cream3); border-radius: 10px; background: rgba(255,255,255,.55);
  padding: .55rem .75rem; margin: 0 0 .35rem;
}
.avp-hist-text { font-size: 13px; color: var(--ink2); white-space: pre-wrap; font-style: italic; }
/* Was missing: without this, avp-empty inherited body --fs-base (~16–17px),
   larger than Value row text (14px) and Offload empty (--fs-sm). */
.avp-empty { margin: 0; font-size: var(--fs-sm); color: var(--ink3); line-height: 1.45; }

/* Why tray (P4-4) — read-only values beside Why fields */
.why-tray-host { margin: .35rem 0 .55rem; }
.why-tray {
  border: 1px solid var(--cream3); border-radius: 10px;
  background: rgba(255,255,255,.55); padding: .55rem .7rem;
}
.why-tray-label {
  font-size: 11px; font-weight: 600; letter-spacing: .03em;
  text-transform: uppercase; color: var(--ink3); margin-bottom: .25rem;
}
.why-tray-sentence {
  margin: 0 0 .55rem; font-size: 13px; font-style: italic;
  color: var(--ink2); line-height: 1.45;
}
.why-tray-block { margin-top: .45rem; }
.why-tray-list {
  margin: 0; padding-left: 1.1rem; font-size: 13px; color: var(--ink);
  line-height: 1.4;
}
.why-tray-list li { margin: .15rem 0; }
.why-tray-empty, .why-tray-loading {
  margin: 0; font-size: 12px; color: var(--ink3);
}
.why-tray-hint { margin: .45rem 0 0; font-size: 11px; color: var(--ink3); }
.why-tray-use {
  border: 0; background: transparent; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.why-tray-use:hover { color: var(--ink); }
#tp-vl-to-compass, #mt-vl-to-compass { margin: .35rem 0 .15rem; display: inline-block; }

/* ── INFO BUTTON ── */
/* ⓘ next to labels: a shared .icon-btn.icon-btn--sm (24px target, look in theme.css). The glyph
   scales with the surrounding text (1em); a negative margin pulls the 24px box back to a 1em box
   in the line so the ⓘ sits where it always did (guide §8.7: keep the target, do not shrink it).
   vertical-align: middle centres it on the parent x-height; it rests at half strength. */
.info-btn {
  --info-pull: calc((1em - var(--ui-icon-btn-size-sm)) / 2);
  vertical-align: middle;
  margin: var(--info-pull);
  opacity: .5;
  transition: opacity .15s;
}
.info-btn:hover, .info-btn:focus-visible { opacity: 1; }

/* ── TOOLTIP LAYER (fixed, never clipped) — content comes from the registry (data-tip) ── */
/* A manual popover (top layer, above an open modal dialog); inset/margin/border/overflow undo the popover defaults. */
#tooltip-layer {
  position: fixed;
  inset: auto;
  margin: 0;
  border: 0;
  overflow: visible;
  width: 300px;
  max-width: calc(100vw - 12px);
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--r-sm);
  padding: 0.85rem 1rem;
  z-index: 10050;
  box-shadow: 0 8px 32px rgba(0,0,0,.28);
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
}
#tooltip-layer.visible { opacity: 1; pointer-events: auto; }
#tooltip-layer.tt-wide { width: 360px; max-width: calc(100vw - 12px); }
.tt-eyebrow {
  font-size: 11px;
  font-weight: 500;
  color: var(--gold2);
  margin-bottom: .35rem;
  line-height: 1.35;
}
.tt-title {
  font-size: var(--fs-base);
  font-weight: 500;
  margin-bottom: var(--sp-1);
  color: var(--gold2);
  line-height: 1.35;
}
.tt-body {
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: rgba(255,255,255,.85);
  margin-bottom: var(--sp-1);
}
.tt-body--beats {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.tt-beat {
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: rgba(255,255,255,.85);
}
.tt-beat-k {
  display: inline;
  font-weight: 600;
  color: var(--gold2);
  margin-right: 4px;
}
/* Glossary beats: term/definition stack under What (etc.); mono for SoT identifiers */
.tt-beat--gloss { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.tt-beat-head { line-height: 1.45; }
.tt-dl { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.tt-dl-row { margin: 0; }
.tt-dt { display: inline; font-weight: 600; color: rgba(255,255,255,.95); margin: 0; }
.tt-dt::after { content: ' — '; font-weight: 400; color: rgba(255,255,255,.5); }
.tt-dd { display: inline; margin: 0; color: rgba(255,255,255,.85); }
.tt-code {
  font-family: ui-monospace, 'DM Mono', Menlo, Consolas, monospace;
  font-size: .92em;
  font-weight: 400;
  color: rgba(255,255,255,.68);
  word-break: break-word;
}
.tt-src {
  font-size: var(--fs-hint);
  color: rgba(255,255,255,.45);
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: var(--sp-1);
  margin-top: var(--sp-1);
  line-height: 1.4;
}

/* ── STAGE ── */
.stage { position: relative; overflow: hidden; display: flex; flex-direction: column; }
/* Lobby scrollport: document is locked (.app-body); stage scrolls lobby content when it
   stacks taller than the viewport. Area/workspace keep stage clipped (their own panes scroll). */
body:not(.area-mode):not(.workspace-mode) .stage {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#bg-prev { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; pointer-events: none; opacity: 0; transition: opacity .5s ease; }
.bg-tint { position: absolute; inset: 0; opacity: 0; transition: background .4s, opacity .4s; pointer-events: none; z-index: 0; }

/* ── LOBBY CENTER ── */
.lobby-center { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; }
.lobby-center.lobby-hidden { display: none; }
/* ≤899: sidebar stacks under centre — size to content so .stage can scroll the column.
   Start column stacks above hero (begin → choose). justify-content:center would clip. */
@media (max-width: 899px) {
  body:not(.area-mode):not(.workspace-mode) .lobby-center {
    flex: 0 0 auto;
    min-height: auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 1rem;
    gap: 0.85rem;
  }
  body:not(.area-mode):not(.workspace-mode) .lobby-start {
    width: min(28rem, calc(100% - 1.5rem));
    order: -1;
  }
  body:not(.area-mode):not(.workspace-mode) .lobby-sidebar {
    flex-shrink: 0;
  }
}

/* ── WHEEL ── */
.wheel-wrap { position: relative; width: 340px; height: 340px; z-index: 10; }
.wheel-info-btn { position: absolute; top: 8px; right: 8px; z-index: 2; font-size: 0.85rem; opacity: .45; transition: opacity .15s; }
.wheel-info-btn:hover, .wheel-info-btn:focus { opacity: 1; }
.wheel-hint { position: absolute; bottom: -2rem; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--ink3); white-space: nowrap; }

/* ── LOBBY SEARCH ── */
#lobby-search { position: relative; width: 260px; margin-bottom: .9rem; z-index: 20; }
.lobby-search-input { width: 100%; background: rgba(26,24,20,.07); border: 1px solid var(--cream3); border-radius: 2rem; padding: .45rem 1.1rem; font-size: 13px; font-family: inherit; color: var(--ink); outline: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.lobby-search-input::placeholder { color: var(--ink3); opacity: .7; }
.lobby-search-input:focus { background: white; border-color: var(--ink3); box-shadow: 0 2px 12px rgba(0,0,0,.07); }
body.has-lobby-bg .lobby-search-input { background: rgba(247,244,238,.18); border-color: rgba(247,244,238,.50); color: var(--ink); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 0 0 1px rgba(26,24,20,.10); }
body.has-lobby-bg .lobby-search-input::placeholder { color: var(--ink3); opacity: .85; }
body.has-lobby-bg .lobby-search-input:focus { background: rgba(247,244,238,.28); border-color: rgba(247,244,238,.70); box-shadow: 0 0 0 1px rgba(26,24,20,.12); }
.lobby-search-results { display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: white; border: 1px solid var(--cream3); border-radius: 12px; overflow-x: hidden; overflow-y: auto; max-height: min(50dvh, 320px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; box-shadow: 0 8px 28px rgba(0,0,0,.12); z-index: 100; }
body.has-lobby-bg .lobby-search-results { background: rgba(26,24,20,.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-color: rgba(247,244,238,.12); box-shadow: 0 8px 32px rgba(0,0,0,.30); }
.sr-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--cream3); padding: .55rem .85rem; cursor: pointer; font-family: inherit; transition: background .1s; }
.sr-row:last-child { border-bottom: none; }
.sr-row:hover, .sr-row:focus { background: var(--cream); outline: none; }
body.has-lobby-bg .sr-row { border-bottom-color: rgba(247,244,238,.08); }
body.has-lobby-bg .sr-row:hover, body.has-lobby-bg .sr-row:focus { background: rgba(247,244,238,.1); }
.sr-area { font-size: 10px; font-weight: 500; letter-spacing: .04em; padding: 2px 7px; border-radius: 4px; white-space: nowrap; flex-shrink: 0; }
.sr-content { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
body.has-lobby-bg .sr-content { color: rgba(247,244,238,.9); }
.sr-empty { padding: .75rem 1rem; font-size: 12px; color: var(--ink3); text-align: center; }
body.has-lobby-bg .sr-empty { color: rgba(247,244,238,.5); }

/* ── LOADING ── */
.wheel-loading { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 340px; height: 340px; display: flex; align-items: center; justify-content: center; }
.wheel-loading::after { content: ''; width: 48px; height: 48px; border: 2px solid var(--cream3); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LOBBY SIDEBAR ── */
.lobby-sidebar { flex-shrink: 0; display: flex; flex-direction: column; }
.lobby-sidebar.lobby-hidden { display: none; }

/* ── TODAY ── Practices | Recommended tabs in one panel (one list at a time) */
.today-panel {
  align-self: center; width: 500px; margin: .5rem 0 1.5rem;
  display: flex; flex-direction: column; min-height: 0;
  background: rgba(255,255,255,.55); border: 1px solid var(--cream3); border-radius: 14px;
}
.today-panel.hidden { display: none; }
.today-tabs-row { display: flex; align-items: center; gap: var(--sp-1); padding: .55rem .6rem .1rem; }
.today-tabs { flex: 1; border-radius: 9px; background: rgba(26,24,20,.06); }
/* The Today row is a segmented skin of the shared .tabs (lib/ui-foundation/tabs.css; hooks in
   css/theme.css): equal halves whose label ends in an ellipsis when the row is narrow. */
.today-tabs .tabs__tab {
  display: block; flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.today-tabs .tabs__tab[aria-selected='true'] { box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.today-tab-n { font-variant-numeric: tabular-nums; opacity: .7; }
.today-tabs-info { flex-shrink: 0; }
.today-tabpanel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .35rem .85rem .6rem; }
.today-tabpanel[hidden] { display: none !important; }
.practices-today-list { display: flex; flex-direction: column; }

/* Practice row: ring (tap = +1) · title · area + dose · if–then cue */
.ptd { display: flex; align-items: flex-start; gap: 10px; padding: .5rem 0; }
.ptd + .ptd { border-top: 1px solid var(--cream3); }
.ptd-done { opacity: .78; }
.ptd.closing-fade { max-height: 120px; }
.ptd-circle {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  border: 1.5px solid var(--c, var(--ink));
  background: conic-gradient(var(--c, var(--ink)) var(--p, 0%), transparent 0);
  position: relative; cursor: pointer; padding: 0;
  display: grid; place-items: center; font-family: inherit;
}
.ptd-circle::after {
  content: ''; position: absolute; inset: 3.5px; border-radius: 50%;
  background: var(--cream, #f7f4ee);
}
.ptd-circle-n {
  position: relative; z-index: 1; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1;
}
.ptd-body { min-width: 0; flex: 1; cursor: pointer; }
.ptd-task, .ptd-meta, .ptd-cue { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptd-task { font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.ptd-meta { font-size: 11.5px; color: var(--ink3); margin-top: 1px; line-height: 1.35; }
.ptd-dose { font-variant-numeric: tabular-nums; }
.ptd-cue { font-size: 11.5px; color: var(--ink3); font-style: italic; line-height: 1.35; }

/* Recommended row (button): area dot · title · area + why + energy. First = strongest pick. */
.tdc {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  padding: .55rem 0; background: none; border: none; cursor: pointer; font-family: inherit;
}
.tdc + .tdc { border-top: 1px solid var(--cream3); }
.tdc:focus-visible { outline: 2px solid var(--ink3); outline-offset: 2px; border-radius: 4px; }
.tdc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink3)); flex-shrink: 0; margin-top: .4rem; }
.tdc-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.tdc-task, .tdc-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tdc-task { font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.tdc:hover .tdc-task { text-decoration: underline; text-underline-offset: 2px; }
.tdc-primary .tdc-task { font-weight: 600; }
.tdc-meta { font-size: 11.5px; color: var(--ink3); margin-top: 1px; line-height: 1.35; }
.tdc-why { color: var(--due-ink); }
.tdc-energy-deep { color: #7a3e00; }

/* On a lobby photo: one frosted panel, light text */
body.has-lobby-bg .today-panel {
  background: var(--glass-photo); border-color: rgba(255,255,255,.14);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
body.has-lobby-bg .today-tabs { background: rgba(0,0,0,.28); }
body.has-lobby-bg .today-tabs .tabs__tab[aria-selected='true'] { box-shadow: none; }
body.has-lobby-bg .ptd + .ptd,
body.has-lobby-bg .tdc + .tdc { border-top-color: rgba(255,255,255,.08); }
body.has-lobby-bg .ptd-circle::after { background: rgba(20,18,14,.85); }
body.has-lobby-bg .ptd-circle-n,
body.has-lobby-bg .ptd-task,
body.has-lobby-bg .tdc-task { color: var(--on-photo); }
body.has-lobby-bg .ptd-meta,
body.has-lobby-bg .ptd-cue,
body.has-lobby-bg .tdc-meta { color: var(--on-photo-muted); }
body.has-lobby-bg .tdc-why { color: var(--due-on-photo); }
body.has-lobby-bg .tdc-energy-deep { color: #ffb070; }

/* ── SLIDERS ── */
.sliders-panel { display: none; transition: opacity .25s; }
.sliders-panel.hidden { opacity: 0; pointer-events: none; }
.panel-label { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); margin-bottom: .65rem; display: flex; align-items: center; gap: 4px; }
#balance-badge { margin-left: auto; font-size: 10px; color: var(--ink3); letter-spacing: .04em; }
.sr { display: grid; grid-template-columns: 8px 78px 1fr 18px; align-items: center; gap: 6px; margin-bottom: 8px; }
.sd { width: 8px; height: 8px; border-radius: 50%; }
.sn { font-size: 11px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 3px; border-radius: 2px; outline: none; cursor: pointer; width: 100%; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: var(--ink); cursor: pointer; }
.sv { font-size: 11px; font-weight: 500; color: var(--ink); text-align: right; }
/* [WB-3] Alignment not yet rated: muted until the first honest reading */
.sr-hint { font-size: 11px; color: var(--ink3); margin-bottom: .55rem; }
.sr-unrated input[type=range] { opacity: .45; }
.sr-unrated .sv { color: var(--ink3); }
.today-grid { display: flex; flex-direction: column; }
.today-empty { font-size: 13px; color: var(--ink3); padding: .5rem 0; }
body.has-lobby-bg .today-empty { color: var(--on-photo-muted); }
body.has-lobby-bg .today-panel .info-btn { color: rgba(247,244,238,.85); opacity: .85; }

/* Values link on task card */
.tc-vl { font-size: 11px; color: var(--ink3); font-style: italic; padding-left: 21px; margin-top: 3px; opacity: .8; line-height: 1.4; }

/* "Now" pill on a task card — shown only for the current Now task */
.tc-now-badge { display: none; align-items: center; gap: 5px; font-size: 10px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; padding: 1px 8px; border-radius: 4px; background: var(--ink); color: var(--cream); white-space: nowrap; }
.tc-now-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--gold2); flex-shrink: 0; }
.task-card.is-now .tc-now-badge { display: inline-flex; }
.task-card.is-running .tc-now-badge::before { animation: tc-now-pulse 1.6s ease-in-out infinite; }
@keyframes tc-now-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.7); } }

/* ── AREA CARD (3D flip) ── */
.area-card { position: absolute; top: 3.5rem; bottom: calc(4rem + var(--safe-bottom)); left: 50%; transform: translateX(-50%); width: calc(100% - 2.5rem); max-width: 520px; z-index: 4; perspective: 1200px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 16px; opacity: 0; pointer-events: none; transition: opacity .35s ease; --area: var(--gold); --area-ink: var(--ink2); --area-soft: rgba(196,150,58,.08); --area-on: var(--ink); }
/* Area theming — accent-only, keyed off the per-area --area vars set in openDetail */
.area-card .form-guide { border-color: var(--area); color: var(--area-ink); }
.area-card .form-guide:hover { background: var(--area-soft); border-color: var(--area); color: var(--area-ink); }
.area-card .tp-content-ta:focus,
.area-card .tp-vl-input:focus,
.area-card .edit-input:focus,
.area-card .edit-textarea:focus { border-color: var(--area); }
.area-card .tp-sub-add-btn:hover,
.area-card .tp-snooze-open-btn:hover,
.area-card .tp-unsnooze-btn:hover,
.area-card .tp-area-btn:hover { border-color: var(--area); color: var(--area-ink); }
/* Option B — primary filled buttons take the area colour within an area context.
   (--area is set per-container: #area-card on open, the two modal overlays on open + picker change.)
   The ✨ on AI buttons is an emoji, so it keeps its warm gold sparkle automatically. */
.area-card.open { opacity: 1; pointer-events: all; }
.card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.area-card.flipped .card-inner { transform: rotateY(180deg); }
.card-front, .card-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: rgba(247,244,238,0.85); border-radius: 16px; }
/* Front: clips scrollbar to rounded corners via overflow:hidden; inner .cf-body scrolls */
.card-front { overflow: hidden; display: flex; flex-direction: column; }
.cf-body { flex: 1; min-height: 0; overflow-y: auto; padding: 1.5rem 1.75rem 2rem;
  scrollbar-width: thin; scrollbar-color: rgba(0,0,0,.12) transparent;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.cf-body::-webkit-scrollbar { width: 4px; }
.cf-body::-webkit-scrollbar-track { background: transparent; margin: 14px 0; }
.cf-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 2px; }
/* Back: sticky header + scrollable body */
.card-back { transform: rotateY(180deg); overflow: hidden; display: flex; flex-direction: column; }
.tp-sticky-hdr { flex-shrink: 0; padding: 1.25rem 1.75rem 1rem; background: rgba(247,244,238,0.85); border-bottom: 1px solid var(--cream3); }
.tp-sticky-hdr .tp-hdr { margin-bottom: 0; }
.tp-scroll-body { flex: 1; min-height: 0; overflow-y: auto; padding: 1.25rem 1.75rem 3rem;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* shell-narrow: iOS Safari often fails touch-scroll inside preserve-3d / backface faces.
   Keep .flipped as the JS API; swap faces in 2D so .cf-body / .tp-scroll-body own the gesture. */
@media (max-width: 640px) {
  .card-inner {
    transform-style: flat;
    transition: none;
  }
  .area-card.flipped .card-inner { transform: none; }
  .card-front, .card-back {
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
  }
  .card-back { transform: none; }
  .area-card:not(.flipped) .card-back {
    visibility: hidden;
    pointer-events: none;
  }
  .area-card.flipped .card-front {
    visibility: hidden;
    pointer-events: none;
  }
}
.dh { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .5rem; }
.dh-emoji { font-size: 2.4rem; line-height: 1; flex-shrink: 0; }
.dh-name { font-family: 'Fraunces', serif; font-size: 1.55rem; font-weight: 300; letter-spacing: -.02em; line-height: 1; }
.dh-meta { font-size: 12px; margin-top: 3px; opacity: .7; }

/* Values statement — read-only in detail, editable in area settings */
.vs-wrap { margin-bottom: 1rem; }
.vs-label { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .07em; opacity: .5; display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.vs-text { font-size: 13px; line-height: 1.5; font-style: italic; opacity: .8; padding: .4rem .5rem; }
.vs-text.empty { opacity: .35; font-style: normal; font-size: 12px; }

/* Alignment slider */
.align-row { display: flex; align-items: center; gap: 10px; max-width: 340px; margin-bottom: 1.25rem; }
.align-label { font-size: 11px; opacity: .6; display: flex; align-items: center; gap: 3px; width: 68px; flex-shrink: 0; }

/* Tasks */
.section-label { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .07em; opacity: .6; display: flex; align-items: center; gap: 4px; margin-bottom: .65rem; }
/* Detail panel header — injected as flex sibling before .cf-body so it spans full card width */
.det-hdr { flex-shrink: 0; display: flex; align-items: center; gap: .4rem; padding: 1.1rem 1.5rem .9rem; border-bottom: 1px solid var(--cream3); background: rgba(247,244,238,0.85); }
.task-card { border-radius: 10px; padding: .65rem .9rem; margin-bottom: 6px; background: rgba(255,255,255,.92); border-left: 3px solid; transition: box-shadow .15s, opacity .3s, max-height .35s ease, padding .35s ease, margin .35s ease; overflow: hidden; max-height: 300px; cursor: pointer; }
.task-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.tc-ghost { opacity: .3; background: var(--cream2) !important; box-shadow: none !important; }
.tc-top { display: flex; align-items: flex-start; gap: 8px; }
.drag-handle { font-size: 14px; color: var(--ink3); opacity: 0; cursor: grab; flex-shrink: 0; margin-top: 1px; padding: 0 2px; user-select: none; touch-action: none; transition: opacity .15s; }
.drag-handle:active { cursor: grabbing; }
.task-card:hover .drag-handle { opacity: .4; }
.drag-handle:hover { opacity: .75 !important; }
@media (pointer: coarse) { .drag-handle { opacity: .3; } }
.tc-circle { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid; flex-shrink: 0; margin-top: 2px; cursor: pointer; transition: background .15s; }
.tc-circle:hover { opacity: .7; }
.tc-circle--dose {
  width: 22px; height: 22px; margin-top: 0; position: relative;
  background:
    conic-gradient(var(--c, var(--ink)) var(--p, 0%), transparent 0);
  border-width: 1.5px;
  display: grid; place-items: center;
}
.tc-circle--dose::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--cream, #f7f4ee);
}
.tc-dose-n {
  position: relative; z-index: 1; font-size: 9px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1;
}
.tc-text { flex: 1; font-size: 13px; line-height: 1.4; color: var(--ink); }
.tc-badges { display: flex; gap: 3px; flex-shrink: 0; align-items: center; }
.badge { font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 500; white-space: nowrap; }
.bdue { background: #e3f0e3; color: #2d6a2d; }
.bpractice { background: #e8eef5; color: #3a5570; }
.benergy { background: #fef3e2; color: #7a3e00; }
.chev { font-size: 11px; color: var(--ink3); transition: transform .2s; display: inline-block; margin-left: 2px; cursor: pointer; }
.subtasks { display: none; margin-top: 7px; padding-left: 21px; }
.subtasks.open { display: block; }
.st { font-size: 12px; color: var(--ink3); display: flex; gap: 6px; padding: 3px 0; border-top: 1px solid rgba(0,0,0,.06); line-height: 1.4; }
.st:first-child { border-top: none; }
.st-dot { width: 4px; height: 4px; border-radius: 50%; background: #ccc; flex-shrink: 0; margin-top: 5px; }

/* ── TASK COMPLETION ANIMATION ── */
@keyframes strikethrough {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes slideOut {
  from { max-height: 600px; opacity: 1; padding-top: .65rem; padding-bottom: .65rem; margin-bottom: 6px; }
  to   { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; margin-bottom: 0; }
}
.task-card.completing .tc-text { position: relative; }
.task-card.completing .tc-text::after {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  height: 1.5px;
  background: var(--ink3);
  animation: strikethrough .3s ease forwards;
}
.task-card.sliding-out {
  animation: slideOut .35s ease forwards;
  pointer-events: none;
}

/* Closing acknowledgment — brief hold, then calm fade (not celebration). */
@keyframes closingHoldFade {
  0%, 40% { opacity: 1; transform: none; }
  100% { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: 0; overflow: hidden; }
}
.task-card.closing-fade,
.ptd.closing-fade {
  animation: closingHoldFade .75s ease forwards;
  pointer-events: none;
}

/* Shared closing-reflection modal (a shared dialog; the backdrop is the dim) */
/* Settle beat: dim only — keep the lobby circle visible filling to full. Opacity, not visibility:
   ::backdrop inherits visibility from its dialog, so hiding the panel that way drops the dim too. */
.closing-modal.closing-settling {
  opacity: 0;
  pointer-events: none;
}
.closing-modal {
  padding: 0; border: 0;
  background: var(--cream);
  border-radius: 14px;
  width: min(520px, calc(100vw - 2rem));
  max-height: min(86dvh, 720px);
  overflow: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
}
.closing-body { padding: 1.35rem 1.4rem 1.25rem; }
.closing-body .rf-task-name { font-size: var(--fs-md); -webkit-line-clamp: 3; margin-bottom: 0; }
.closing-body .rf-done-text { font-size: 12px; margin-bottom: .75rem; }

/* Practice day-close: carry the lobby dose circle into the modal header */
.closing-hdr {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: .85rem;
}
.closing-circle {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--c, var(--ink));
  background: conic-gradient(var(--c, var(--ink)) var(--p, 0%), transparent 0);
  position: relative;
  display: grid; place-items: center;
  transition: background .28s ease;
}
.closing-circle::after {
  content: ''; position: absolute; inset: 5px; border-radius: 50%;
  background: var(--cream, #f7f4ee);
}
.closing-circle-n {
  position: relative; z-index: 1;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--ink); line-height: 1;
}
.closing-hdr-text { min-width: 0; flex: 1; }
.closing-hdr-area {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink3); margin-bottom: 2px;
}
.closing-dose-meta {
  font-size: 12px; color: var(--ink3); margin-top: 3px; line-height: 1.35;
}
.closing-hdr + .rf-done-text { margin-top: -.35rem; }

/* Closing modal: three equal buttons on one row; hint wraps so widths match */
.closing-body .rf-emojis {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: stretch;
}
.closing-body .rf-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: .35rem .4rem;
  text-align: center;
  justify-content: flex-start;
}
.closing-body .rf-btn-hint {
  white-space: normal;
  text-wrap: balance;
  max-width: 100%;
}

/* Lobby settle: calm fill to 100% before the day-close modal opens */
.ptd-circle,
.tc-circle--dose {
  transition: background .28s ease;
}

/* Done today (area list) — same chrome family as snoozed/archived */
.done-today-toggle {
  font-size: 11px; color: var(--ink3); background: none; border: none; cursor: pointer;
  padding: .5rem 0; opacity: .6; transition: opacity .15s; font-family: inherit;
  display: flex; align-items: center; gap: 4px;
}
.done-today-toggle:hover { opacity: 1; }
.done-today-section { margin-top: 6px; }
.done-today-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .65rem; margin-bottom: 4px;
  border-radius: 8px; background: var(--cream2); opacity: .85;
  cursor: pointer;
}
.done-today-item:hover { opacity: 1; }
.done-today-item-text { font-size: 13px; color: var(--ink2); flex: 1; line-height: 1.35; }
.done-today-item-meta { font-size: 11px; color: var(--ink3); }

/* ── ARCHIVED TASKS ── */
.archive-toggle { font-size: 11px; color: var(--ink3); background: none; border: none; cursor: pointer; padding: .5rem 0; opacity: .6; transition: opacity .15s; font-family: inherit; display: flex; align-items: center; gap: 4px; }
.archive-toggle:hover { opacity: 1; }
.archived-section { margin-top: 8px; }
.task-card.archived { opacity: .45; }
.task-card.archived .tc-text { text-decoration: line-through; }

.tp-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.tp-crumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink3); flex-wrap: wrap; }
.tp-crumb-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.tp-archived-badge { font-size: 10px; color: var(--ink3); background: var(--cream2); border-radius: 4px; padding: 1px 6px; }
.tp-content-ta { min-height: 0; resize: none; overflow: hidden; line-height: 1.5; margin-bottom: .85rem; }

/* Action details in-page tabs (Act | Why | Prepare | Settings | Log) */
.tp-tabs-stack { margin: 0 0 .25rem; }
/* The shared .tabs underline (lib/ui-foundation/tabs.css; hooks in css/theme.css): the tabs share
   the width. No border (the bottom padding keeps its 2px), so the selected line spans the whole tab
   and covers the row's rule. */
.tp-tabs .tabs__tab {
  flex: 1 1 auto; min-width: 3.6rem; justify-content: center;
  border: 0; padding: .5rem .2rem calc(.45rem + 2px); margin-bottom: -1px;
}
.tp-tabpanel { padding-top: .75rem; }
.tp-tabpanel[hidden] { display: none !important; }

.tp-chrome {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: .35rem 0 .65rem;
}
.tp-chrome .tp-now-btn { margin-left: 0; padding: .3rem .65rem; font-size: 12px; }
.tp-chrome-icon {
  width: 2rem; height: 2rem; border-radius: 8px; border: 1px solid var(--cream3);
  background: white; cursor: pointer; font-size: 14px; line-height: 1;
  display: grid; place-items: center; padding: 0; font-family: inherit;
  transition: border-color .12s, background .12s;
}
.tp-chrome-icon:hover { border-color: var(--ink3); }
.tp-chrome-snoozed { background: var(--cream2); border-color: var(--ink3); }

.tp-dose {
  display: grid; grid-template-columns: auto auto auto; grid-template-rows: auto auto;
  justify-content: center; align-items: center; column-gap: 14px; row-gap: 8px;
  padding: .85rem 0 1rem; --c: var(--ink);
}
.tp-dose-btn {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1.5px solid var(--cream3);
  background: white; color: var(--ink); font-size: 1.35rem; line-height: 1;
  cursor: pointer; font-family: inherit; display: grid; place-items: center;
  transition: border-color .12s, opacity .12s;
}
.tp-dose-btn:hover:not(:disabled) { border-color: var(--ink3); }
.tp-dose-btn:disabled { opacity: .35; cursor: default; }
.tp-dose-circle {
  width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--c);
  background: conic-gradient(var(--c) var(--p, 0%), transparent 0);
  position: relative; display: grid; place-items: center;
}
.tp-dose-circle::after {
  content: ''; position: absolute; inset: 8px; border-radius: 50%;
  background: var(--cream, #f7f4ee);
}
.tp-dose-n {
  position: relative; z-index: 1; font-size: 1.35rem; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1;
}
.tp-dose-meta {
  grid-column: 1 / -1; text-align: center; font-size: 12.5px; color: var(--ink2);
}
.tp-act-showup { display: flex; justify-content: center; padding: .5rem 0 .85rem; }
.tp-act-showup-btn { margin: 0; min-width: 10rem; }

.tp-ease { display: flex; gap: 6px; flex-wrap: wrap; }
.tp-ease-btn {
  font-size: 12px; padding: .4rem .75rem; border-radius: 7px; border: 1px solid var(--cream3);
  background: white; color: var(--ink2); cursor: pointer; font-family: inherit;
  transition: border-color .12s, background .12s, color .12s;
}
.tp-ease-btn:hover { border-color: var(--ink3); color: var(--ink); }
.tp-ease-btn.is-on { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.tp-ease-hint { font-size: var(--fs-hint); color: var(--ink3); margin: 0; line-height: 1.4; }

.tp-field { display: flex; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid rgba(0,0,0,.04); }
.tp-field-col { flex-direction: column; align-items: flex-start; gap: .5rem; padding-top: .75rem; border-bottom: none; }
.tp-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); min-width: 58px; flex-shrink: 0; }
.tp-field-col .tp-label { min-width: 0; }
.tp-date { border: none; outline: none; font-size: 13px; font-family: inherit; color: var(--ink); background: transparent; cursor: pointer; }
.tp-energy { display: flex; gap: 6px; flex-wrap: wrap; }
.tp-ebtn { font-size: 11px; padding: 3px 10px; border-radius: 5px; border: 1px solid var(--cream3); background: white; cursor: pointer; font-family: inherit; transition: background .12s, color .12s, border-color .12s; }
.tp-ebtn:hover { border-color: var(--ink3); }
/* Notes (Markdown) — shared md-notes module; colours via --mdn-* in tokens.css */
.tp-notes-field { display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--ink); }
.tp-notes-view { padding: .1rem 0; }
.area-card .tp-notes-field { --mdn-focus: var(--area); }
.tp-notes-actions { display: flex; gap: var(--sp-3); }
.tp-notes-actions:not(:has(:not([hidden]))) { display: none; }
.tp-notes-link { background: none; border: 0; padding: 0; font: inherit; font-size: var(--fs-sm); color: var(--ink3); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.tp-notes-link:hover { color: var(--ink); }
.tp-notes-alert { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--mdn-error); border-radius: var(--r-sm); background: var(--notes-alert-bg); color: var(--ink); }
.tp-notes-alert[hidden] { display: none; }
.tp-notes-alert-text { flex: 1 1 14rem; }
.tp-notes-alert-btn { background: white; border: 1px solid var(--cream3); border-radius: var(--r-sm); padding: .25rem .6rem; font: inherit; font-size: var(--fs-sm); color: var(--ink); cursor: pointer; }
.tp-notes-alert-btn:hover { border-color: var(--ink3); }
/* Values link in task panel */
.tp-vl-hint { font-size: 11px; color: var(--ink3); font-style: italic; opacity: .7; margin-bottom: 6px; padding: .3rem .5rem .3rem .6rem; border-left: 2px solid var(--cream3); line-height: 1.5; }
.tp-vl-input { font-style: italic; }
/* Values link input in reflection card */
.rf-vl-input { font-style: italic; }
.tp-footer { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--cream3); }
.tp-footer .tp-saved-msg { margin-left: auto; }
.tp-footer .tp-done { margin-left: auto; }
.tp-footer .tp-done + .tp-saved-msg { margin-left: 0; }
.tp-del { background: none; border: 1px solid rgba(180,40,40,.2); color: #9b2020; border-radius: 7px; padding: .35rem .75rem; font-size: 12px; cursor: pointer; font-family: inherit; transition: background .15s; }
.tp-del:hover { background: #fce8e8; }
.tp-done { border-radius: 7px; padding: .4rem 1rem; font-size: 13px; }
.tp-unarchive { background: none; border: 1px solid var(--cream3); color: var(--ink3); border-radius: 7px; padding: .35rem .75rem; font-size: 12px; cursor: pointer; font-family: inherit; transition: background .15s, color .15s; }
.tp-unarchive:hover { background: var(--cream2); color: var(--ink); }
.tp-archive-practice-wrap {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cream3);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .4rem;
}
.tp-archive-practice {
  background: none;
  border: 1px solid rgba(180, 40, 40, .22);
  color: #9b2020;
  border-radius: 7px;
  padding: .4rem .85rem;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.tp-archive-practice:hover { background: #fce8e8; }
.tp-archive-practice-hint {
  margin: 0;
  font-size: var(--fs-hint);
  line-height: 1.45;
  color: var(--ink3);
  max-width: 28rem;
}
.tp-now-btn { margin-left: auto; background: none; border: 1px solid var(--cream3); border-radius: 7px; font-size: 12px; color: var(--ink3); cursor: pointer; font-family: inherit; padding: .35rem .75rem; transition: all .15s; white-space: nowrap; }
.tp-now-btn:hover { border-color: var(--ink3); color: var(--ink); }
.tp-now-btn.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.tp-now-field { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 2px; }
.tp-now-field .tp-now-btn { margin-left: 0; }
.tp-now-caption { flex-basis: 100%; font-size: var(--fs-hint); color: var(--ink3); opacity: .8; line-height: 1.4; }
/* Gentle revisit nudge — calm, never alarming */
.tp-waiting { position: relative; background: var(--cream2); border: 1px solid var(--cream3); border-radius: 10px; padding: .7rem .85rem; margin: 4px 0 6px; }
.tp-waiting-text { font-size: 12.5px; color: var(--ink2); line-height: 1.45; padding-right: 16px; }
.tp-waiting-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tp-waiting-dismiss { position: absolute; top: 5px; right: 6px; background: none; border: none; color: var(--ink3); font-size: 12px; cursor: pointer; opacity: .55; padding: 2px 4px; line-height: 1; transition: opacity .12s, color .12s; }
.tp-waiting-dismiss:hover { opacity: 1; color: var(--ink); }
.tp-saved-msg { font-size: 11px; color: var(--ink3); opacity: 0; transition: opacity .25s; }
/* Time in action (WB-8) */
.tp-time-wrap { display: flex; flex-direction: column; gap: 7px; }
.tp-timer { display: flex; align-items: center; gap: 8px; }
.tp-timer-btn { font-size: 12px; padding: .38rem .85rem; border-radius: 6px; }
.tp-timer-total { margin-left: auto; font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.tp-sessions { display: flex; flex-direction: column; }
.tp-session { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink2); padding: 3px 0; }
.tp-session-when { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-session-dur { margin-left: auto; color: var(--ink3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tp-session-dur em { font-style: normal; color: var(--gold); }
.tp-session-edit, .tp-session-del { background: none; border: none; color: var(--ink3); cursor: pointer; font-size: 12px; padding: 1px 4px; border-radius: 4px; opacity: .55; line-height: 1; transition: opacity .12s, color .12s, background .12s; }
.tp-session-edit:hover, .tp-session-del:hover { opacity: 1; color: var(--ink); background: rgba(0,0,0,.06); }
.tp-session-empty { font-size: 12px; color: var(--ink3); opacity: .7; }
.tp-time-add { align-self: flex-start; background: none; border: 1px dashed var(--cream3); color: var(--ink3); font-family: inherit; font-size: 12px; padding: .28rem .65rem; border-radius: 6px; cursor: pointer; transition: border-color .12s, color .12s; }
.tp-time-add:hover { border-color: var(--ink3); color: var(--ink); }
.tp-session-editor { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 9px; background: var(--cream2); border-radius: 8px; margin: 2px 0; }
.tp-session-fl { display: flex; flex-direction: column; gap: 3px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); }
.tp-session-editor input { font-family: inherit; font-size: 12px; padding: .3rem .4rem; border: 1px solid var(--cream3); border-radius: 5px; color: var(--ink); background: white; outline: none; }
.tp-session-editor-actions { display: flex; gap: 6px; margin-left: auto; }
.tp-session-editor-actions .btn { font-size: 12px; padding: .32rem .75rem; border-radius: 5px; }
.tp-saved-msg.show { opacity: 1; }
.tp-divider { height: 1px; background: var(--cream3); margin: 1.1rem 0 1.25rem; }

/* ── SUBTASKS IN TASK PANEL ── */
.tp-sub-list { width: 100%; display: flex; flex-direction: column; gap: 1px; margin-bottom: 6px; }
/* Negative margin extends hover highlight flush to the panel text edge */
.tp-sub-item { display: flex; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 6px; margin: 0 -4px; }
.tp-sub-item:hover { background: rgba(0,0,0,.04); }
/* Drag handle — only active items have it */
.tp-sub-drag { font-size: 12px; color: var(--ink3); opacity: 0; cursor: grab; flex-shrink: 0; padding: 0 1px; user-select: none; touch-action: none; transition: opacity .15s; }
.tp-sub-drag:active { cursor: grabbing; }
.tp-sub-item:hover .tp-sub-drag { opacity: .35; }
.tp-sub-drag:hover { opacity: .7 !important; }
@media (pointer: coarse) { .tp-sub-drag { opacity: .25; } }
/* Check circle */
.tp-sub-check { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--cream3); flex-shrink: 0; cursor: pointer; transition: background .15s, border-color .15s; }
.tp-sub-check:hover { border-color: var(--ink3); }
.tp-sub-check.done { background: var(--cream3); border-color: var(--cream3); }
/* Body wraps text + delete; delete is absolute so it stays inside the body width */
.tp-sub-body { flex: 1; position: relative; min-width: 0; }
.tp-sub-text-input { width: 100%; border: none; outline: none; font-size: 12.5px; font-family: inherit; color: var(--ink); background: transparent; padding: 0 18px 0 0; min-width: 0; }
.tp-sub-text-input::placeholder { color: var(--ink3); }
.tp-sub-done-text { display: block; font-size: 12.5px; color: var(--ink3); text-decoration: line-through; opacity: .5; padding-right: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Delete: absolute inside .tp-sub-body, hidden until row is hovered */
.tp-sub-del { position: absolute; right: 0; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 11px; color: var(--ink3); cursor: pointer; opacity: 0; padding: 1px 2px; transition: opacity .15s, color .15s; line-height: 1; }
.tp-sub-item:hover .tp-sub-del { opacity: .45; }
.tp-sub-del:hover { opacity: 1 !important; color: #9b2020; }
/* Completed steps toggle */
.tp-sub-done-toggle { background: none; border: none; font-size: 11px; color: var(--ink3); cursor: pointer; font-family: inherit; padding: .45rem 0 .1rem; opacity: .6; transition: opacity .15s; display: block; }
.tp-sub-done-toggle:hover { opacity: 1; }

/* Add-step row — bordered like Notes for consistency */
.tp-sub-add-row { display: flex; align-items: center; gap: 7px; border: 1px solid var(--cream3); border-radius: 8px; padding: .45rem .65rem; margin-top: 4px; transition: border-color .15s; background: white; }
.tp-sub-add-row:focus-within { border-color: var(--ink3); }
.tp-sub-add-input { flex: 1; border: none; outline: none; font-size: 12.5px; font-family: inherit; color: var(--ink); background: transparent; min-width: 0; }
.tp-sub-add-input::placeholder { color: var(--ink3); }
.tp-sub-add-btn { background: none; border: none; font-size: 16px; line-height: 1; color: var(--ink3); cursor: pointer; padding: 0 2px; transition: color .15s; flex-shrink: 0; }
.tp-sub-add-btn:hover { color: var(--ink); }

/* ── REFLECTION CARD ── */
/* List cards use max-height + overflow:hidden for collapse animation; reflection
   must grow fully so Skip / Save & done stay reachable (not clipped under next rows). */
.task-card.reflecting {
  max-height: none;
  overflow: visible;
  position: relative;
  z-index: 2;
  background: rgba(255,255,255,.97);
  box-shadow: 0 4px 18px rgba(0,0,0,.1);
  cursor: default;
}
.rf-task-name { font-size: var(--fs-base); font-weight: 500; color: var(--ink); line-height: 1.4; margin-bottom: .2rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rf-done-text { font-size: 11px; color: var(--ink3); margin-bottom: .85rem; opacity: .6; }
.rf-section { margin-bottom: 1rem; }
.rf-q { font-size: 12px; font-weight: 500; color: var(--ink2); margin-bottom: .5rem; }
.rf-emojis { display: flex; gap: 7px; margin-bottom: .45rem; flex-wrap: wrap; }
.rf-btn { background: none; border: 1px solid rgba(0,0,0,.12); border-radius: 7px; padding: .3rem .7rem; font-size: 12px; cursor: pointer; font-family: inherit; transition: background .15s, border-color .15s; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rf-btn:hover { background: rgba(0,0,0,.04); }
.rf-btn[aria-pressed='true'] { border-color: var(--ink); background: rgba(0,0,0,.06); font-weight: 500; }
.rf-btn-hint { font-size: var(--fs-hint); color: var(--ink3); font-weight: 400; line-height: 1.2; white-space: nowrap; }
.rf-vl-hint { font-size: var(--fs-hint); color: var(--ink3); margin-top: .35rem; line-height: 1.4; }
.rf-steps-list { margin: 0 0 .55rem; padding-left: 1.1rem; font-size: 12px; color: var(--ink2); line-height: 1.45; }
.rf-steps-more { list-style: none; margin-left: -1.1rem; color: var(--ink3); }
/* Reflection evoker (reflection-evoke) — asks, never answers */
.rf-evoke-row { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.rf-evoke-btn { border-radius: 7px; font-size: 12px; padding: .3rem .65rem; }
.rf-evoke:not(:empty) { margin-top: 8px; }
.rf-evoke-box { background: var(--cream2); border: 1px solid var(--cream3); border-radius: 10px; padding: .7rem .85rem; }
.rf-evoke-hdr { font-size: 11.5px; color: var(--ink3); margin-bottom: 6px; }
.rf-evoke-back { font-size: 13px; color: var(--ink2); font-style: italic; margin-bottom: 8px; line-height: 1.45; }
.rf-evoke-qs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rf-evoke-qs li { font-size: 13px; color: var(--ink); line-height: 1.4; padding-left: 14px; position: relative; }
.rf-evoke-qs li::before { content: '·'; position: absolute; left: 4px; color: var(--gold); font-weight: 700; }
.rf-evoke-close { margin-top: 8px; background: none; border: none; color: var(--ink3); font-family: inherit; font-size: 11.5px; cursor: pointer; padding: 0; text-decoration: underline; }
.rf-evoke-close:hover { color: var(--ink); }

/* ── Evoke companion window (reusable; see js/app.js _openEvoke) ── */
.evoke-trigger { background: none; border: 1px solid var(--cream3); border-radius: var(--r-sm); color: var(--ink3); font-family: inherit; font-size: 12px; padding: .3rem .65rem; cursor: pointer; margin-top: 6px; transition: border-color .12s, color .12s; }
.evoke-trigger:hover { border-color: var(--gold); color: var(--ink); }
.evoke-modal { background: var(--cream); border: 1px solid var(--border); border-radius: var(--r-lg); width: min(540px, calc(100vw - 2rem)); max-height: min(86dvh, 760px); padding: 0; flex-direction: column; overflow: hidden; box-shadow: 0 16px 48px rgba(0,0,0,.18); }
.evoke-hdr { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4) var(--sp-3); border-bottom: 1px solid var(--border); }
.evoke-title { font-family: 'Fraunces', serif; font-weight: 300; font-size: var(--fs-xl); color: var(--ink); margin: 0; line-height: 1.2; }
.evoke-close { background: none; border: none; color: var(--ink3); font-size: 18px; cursor: pointer; line-height: 1; padding: 4px; border-radius: var(--r-sm); flex-shrink: 0; }
.evoke-close:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.evoke-body { padding: var(--sp-4); overflow-y: auto; }
.evoke-loading { font-size: var(--fs-base); color: var(--ink3); font-style: italic; }
.evoke-how { font-size: var(--fs-sm); color: var(--ink3); line-height: 1.55; background: var(--cream2); border-radius: var(--r-sm); padding: var(--sp-3); margin-bottom: var(--sp-4); }
.evoke-see-btn { display: block; margin-top: var(--sp-2); background: none; border: none; color: var(--gold); font-family: inherit; font-size: var(--fs-sm); cursor: pointer; padding: 0; text-decoration: underline; }
.evoke-see { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--ink2); line-height: 1.55; border-left: 2px solid var(--cream3); padding-left: var(--sp-3); }
.evoke-sec { margin-bottom: var(--sp-4); }
.evoke-sec-label { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); margin-bottom: var(--sp-2); }
.evoke-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.evoke-list li { font-size: var(--fs-base); color: var(--ink); line-height: 1.5; padding-left: 16px; position: relative; }
.evoke-list li::before { content: '·'; position: absolute; left: 4px; color: var(--gold); font-weight: 700; }
.evoke-foot { font-size: var(--fs-sm); color: var(--ink3); font-style: italic; border-top: 1px solid var(--border); padding-top: var(--sp-3); margin-top: var(--sp-2); }
.evoke-retry { margin-left: 6px; background: none; border: none; color: var(--gold); text-decoration: underline; cursor: pointer; font-family: inherit; font-size: inherit; }
.rf-note { display: none; resize: none; }
.rf-note.show { display: block; }
.rf-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: .5rem; border-top: 1px solid rgba(0,0,0,.06); margin-top: .25rem; }
.rf-cancel-btn { font-size: 12px; padding: .35rem .6rem; margin-right: auto; }
.rf-skip-btn { font-size: 12px; padding: .35rem .6rem; }
.rf-save-btn { border-radius: 7px; padding: .35rem .85rem; font-size: 12px; }

/* Add task */
.add-task-btn { display: flex; align-items: center; gap: 6px; background: none; border: 1px dashed rgba(0,0,0,.18); border-radius: 8px; padding: .5rem .9rem; font-size: 13px; color: var(--ink3); cursor: pointer; font-family: inherit; width: 100%; margin-top: 8px; transition: border-color .15s, color .15s; }
.add-task-btn:hover { border-color: rgba(0,0,0,.35); color: var(--ink); }
.add-form { background: rgba(255,255,255,.95); border-radius: 10px; padding: .85rem 1rem; margin-top: 8px; border: 1px solid var(--cream3); box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.add-form input[type=text]:not(.control) { width: 100%; border: none; outline: none; font-size: 13px; font-family: inherit; color: var(--ink); background: transparent; margin-bottom: 8px; }
.add-form input[type=text]:not(.control)::placeholder { color: var(--ink3); }
.add-form .practice-cue-input { margin-bottom: 0; }
.add-practice-toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink2); margin: 2px 0 8px; cursor: pointer; user-select: none; }
.add-practice-toggle input { margin: 0; }
.add-practice-fields { display: flex; flex-direction: column; gap: 7px; margin: 0 0 10px; padding: .55rem .65rem; background: var(--cream2); border-radius: 8px; border: 1px solid var(--cream3); }
.add-practice-fields[hidden] { display: none !important; }

.practice-day-row { display: flex; flex-wrap: wrap; gap: 5px; }
.practice-day-row[hidden] { display: none !important; }
.practice-day {
  min-width: 2.15rem; height: 2rem; padding: 0 .35rem; border-radius: 7px; border: 1px solid var(--cream3);
  background: white; color: var(--ink2); font-family: inherit; font-size: 11px; font-weight: 600;
  letter-spacing: .02em; cursor: pointer; line-height: 1;
}
.practice-day.is-on { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.practice-day:focus-visible { outline: 2px solid var(--ink3); outline-offset: 1px; }
.practice-interval-row { display: flex; align-items: center; }
.practice-interval-row[hidden] { display: none !important; }
.practice-interval-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink2); }
.practice-interval-input { width: 3.25rem; padding-inline: .25rem; text-align: center; }
.practice-cue-block { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.practice-cue-hdr { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); }
.practice-cue-opt { font-weight: 500; text-transform: none; letter-spacing: 0; opacity: .85; }
.practice-cue-field { display: flex; flex-direction: column; gap: 3px; }
.practice-cue-label { font-size: 11.5px; color: var(--ink2); }
.practice-dose-block { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.practice-dose-row { display: grid; grid-template-columns: 5.5rem 1fr; gap: 8px; }
.practice-dose-n .practice-cue-input { text-align: center; }
.tp-showups { width: 100%; margin-top: 4px; }
.tp-showups[hidden] { display: none !important; }
.tp-showups-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); margin-bottom: 4px; }
.tp-showups-empty { font-size: 12px; color: var(--ink3); line-height: 1.4; opacity: .85; }
.tp-showups-list { display: flex; flex-direction: column; gap: 2px; }
.tp-showup-row { font-size: 12px; color: var(--ink2); line-height: 1.4; padding: 2px 0; }
.tp-showup-day { font-variant-numeric: tabular-nums; color: var(--ink3); }
.form-row { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.form-save { margin-left: auto; border-radius: 7px; padding: .35rem .85rem; font-size: 12px; }
.form-cancel { background: none; border: none; color: var(--ink3); font-size: 12px; cursor: pointer; font-family: inherit; padding: .35rem .5rem; }
.form-guide { background: none; border: 1px solid var(--cream3); border-radius: 7px; color: var(--ink3); font-size: 12px; cursor: pointer; font-family: inherit; padding: .32rem .6rem; transition: border-color .15s, color .15s; }
.form-guide:hover { border-color: var(--gold); color: var(--ink); }


/* ── AREA EDIT ── */
.area-edit-btn { background: none; border: none; font-size: 14px; color: var(--ink3); cursor: pointer; padding: 4px 6px; border-radius: 6px; transition: color .15s, background .15s; margin-left: 4px; flex-shrink: 0; }
.area-edit-btn:hover { color: var(--ink); background: rgba(0,0,0,.06); }
.edit-back-btn { background: none; border: none; font-size: 12px; color: var(--ink3); cursor: pointer; font-family: inherit; padding: .25rem 0; margin-bottom: 1.1rem; display: inline-block; transition: color .15s; }
.edit-back-btn:hover { color: var(--ink); }
/* Minimal area header — dot + emoji + name, no nested card */
.edit-preview { display: flex; align-items: center; gap: 9px; padding: .1rem 0 1.1rem; border-bottom: 1px solid var(--cream3); margin-bottom: 1.5rem; }
.ep-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; transition: background .2s; }
.ep-emoji { font-size: 1.25rem; line-height: 1; }
.ep-name { font-family: 'Fraunces', serif; font-size: var(--fs-xl); font-weight: 300; letter-spacing: -.01em; transition: color .2s; }
.edit-fields { display: flex; flex-direction: column; gap: 1.1rem; margin-bottom: 2rem; }
.edit-field { display: flex; flex-direction: column; gap: 5px; }
.edit-label { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); display: flex; align-items: center; gap: 6px; }
.edit-hint { text-transform: none; letter-spacing: 0; font-size: var(--fs-hint); color: var(--ink3); opacity: .8; line-height: 1.4; }
.edit-textarea { min-height: 76px; line-height: 1.5; font-style: italic; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.color-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid transparent; cursor: pointer; transition: transform .15s, border-color .15s; padding: 0; }
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: var(--ink); transform: scale(1.1); }
.edit-custom-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.edit-color-native { width: 28px; height: 28px; border: 1px solid var(--cream3); border-radius: 6px; cursor: pointer; padding: 0; background: none; }
.edit-color-hex { font-size: 11px; color: var(--ink3); font-family: monospace; }
.color-chip-preview { display: inline-block; margin-top: 10px; padding: .3rem .75rem; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.edit-derived-row { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.edit-derived-label { font-size: 11px; color: var(--ink3); width: 110px; flex-shrink: 0; }
.edit-derived-reset { background: none; border: none; color: var(--ink3); font-size: 13px; cursor: pointer; padding: 2px 4px; border-radius: 4px; line-height: 1; opacity: .6; transition: opacity .15s; }
.edit-derived-reset:hover { opacity: 1; }

/* Uniform colour rows (shared UI-colors section) */
.cs-chip-preview { margin-bottom: 12px; }
.cs-chip { display: inline-block; padding: .3rem .8rem; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.cs-rows { display: flex; flex-direction: column; gap: 11px; }
.cs-row { display: flex; align-items: center; gap: 10px; }
.cs-row-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cs-row-label { font-size: 12.5px; color: var(--ink2); }
.cs-row-hint { font-size: 11px; color: var(--ink3); }
.cs-hex, .cs-xhex { width: 66px; text-align: right; flex-shrink: 0; }
/* Extracted roles — editable, but not rendered by the app yet */
.cs-extra-hdr { margin-top: 16px; font-size: var(--fs-label); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); }
.cs-extra-sub { display: block; margin-top: 2px; font-size: 10.5px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink3); opacity: .85; }
.cs-extra-rows { margin-top: 9px; }
.cs-row-extra .cs-row-label { color: var(--ink3); }
.edit-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; border-top: 1px solid var(--cream3); }
.delete-area-btn { border-radius: 7px; padding: .4rem .9rem; font-size: 12px; }
.save-area-btn { border-radius: 7px; padding: .45rem 1.1rem; font-size: 13px; }

/* ── TOGGLE SWITCH ── */
.toggle-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track { width: 32px; height: 18px; background: var(--cream3); border-radius: 9px; flex-shrink: 0; position: relative; transition: background .2s; }
.toggle-thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: white; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.22); transition: transform .2s; }
.toggle-switch input:checked + .toggle-track { background: var(--ink2); }
.toggle-switch input:checked + .toggle-track .toggle-thumb { transform: translateX(14px); }
.toggle-label { font-size: 13px; color: var(--ink); }

/* ── AREA BACKGROUND IMAGE (settings UI) ── */
.bg-img-thumb { width: 100%; height: 160px; background-size: contain; background-repeat: no-repeat; background-position: center; background-color: var(--cream3); border-radius: 8px; border: 1px solid var(--cream3); transition: background-image .1s; }
.bg-img-actions { display: flex; gap: 7px; margin-top: 7px; }
.bg-img-upload-btn { width: 100%; text-align: left; background: white; border: 1px solid var(--cream3); border-radius: 7px; padding: .5rem .7rem; font-size: 13px; font-family: inherit; color: var(--ink3); cursor: pointer; transition: border-color .15s, color .15s; }
.bg-img-upload-btn:hover { border-color: var(--ink3); color: var(--ink); }
.bg-img-change-btn { font-size: 12px; background: none; border: 1px solid var(--cream3); border-radius: 6px; padding: .3rem .65rem; cursor: pointer; font-family: inherit; color: var(--ink3); transition: border-color .15s, color .15s; }
.bg-img-change-btn:hover { border-color: var(--ink3); color: var(--ink); }
.bg-img-download-btn { font-size: 12px; background: none; border: 1px solid var(--cream3); border-radius: 6px; padding: .3rem .65rem; cursor: pointer; font-family: inherit; color: var(--ink3); transition: border-color .15s, color .15s; }
.bg-img-download-btn:hover { border-color: var(--ink3); color: var(--ink); }
.bg-gen-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 7px; }
.bg-gen-settings { display: inline-flex; gap: 6px; }
.bg-history { margin-top: 10px; }
.bg-history-label { font-size: var(--fs-hint); color: var(--ink3); margin-bottom: 5px; }
.bg-history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px; }
.bg-history-item { position: relative; }
.bg-history-thumb { width: 100%; height: 46px; background-size: cover; background-position: center; border-radius: 6px; border: 1px solid var(--cream3); cursor: pointer; transition: border-color .15s; }
.bg-history-thumb:hover { border-color: var(--ink3); }
.bg-history-item.is-current .bg-history-thumb { border-color: var(--gold); cursor: default; }
.bg-history-badge { position: absolute; bottom: 3px; left: 3px; font-size: 9px; background: var(--gold); color: #fff; padding: 1px 4px; border-radius: 4px; }
.bg-history-del { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border: none; border-radius: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; line-height: 1; cursor: pointer; display: none; padding: 0; }
.bg-history-item:hover .bg-history-del { display: block; }
.bg-img-remove-btn { font-size: 12px; background: none; border: 1px solid rgba(180,40,40,.2); border-radius: 6px; padding: .3rem .65rem; cursor: pointer; font-family: inherit; color: #9b2020; transition: background .15s; }
.bg-img-remove-btn:hover { background: #fce8e8; }
.bg-prompt-copy-btn { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; background: none; border: 1px solid var(--cream3); border-radius: 6px; padding: .3rem .65rem; font-size: 12px; font-family: inherit; color: var(--ink3); cursor: pointer; transition: border-color .15s, color .15s; }
.bg-prompt-copy-btn:hover { border-color: var(--ink3); color: var(--ink); }
.bg-prompt-copy-btn.bg-prompt-copied { border-color: #2a7a4f; color: #2a7a4f; }

/* ── AI background generation ─────────────────────────────────────────────── */
.bg-ctrl-row { display: flex; gap: 7px; }
.bg-ctrl-row .bg-img-upload-btn { flex: 1; }
.bg-gen-btn { flex-shrink: 0; border-radius: 7px; padding: .5rem .85rem; font-size: 12.5px; font-weight: 500; letter-spacing: .01em; }
/* When generate button follows the actions row (has-image state) */
.bg-img-actions + .bg-gen-btn { display: block; width: 100%; margin-top: 7px; text-align: center; }
.bg-gen-panel { display: flex; flex-direction: column; gap: 8px; }
.bg-gen-extras { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.bg-scene { width: 100%; font-size: 11.5px; }
.bg-scene > summary { cursor: pointer; color: var(--ink2); font-size: 12.5px; font-weight: 500; margin-bottom: 6px; user-select: none; }
.bg-scene > summary:hover { color: var(--ink); }
.bg-scene .gen-hints-row { margin-top: 0; margin-bottom: 6px; }
.bg-scene-row3 { display: flex; gap: 6px; margin-bottom: 5px; }
.bg-scene-cap { font-size: var(--fs-hint); color: var(--ink3); opacity: .85; font-style: italic; line-height: 1.4; margin-bottom: 8px; }
.bg-scene-cap:empty { display: none; }
.bg-scene-sel { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-label); color: var(--ink2); }
.bg-scene-sel > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bg-scene-sel select { width: 100%; }
.bg-scene-field { display: block; margin-bottom: 7px; }
.bg-scene-flabel { display: block; font-size: var(--fs-label); color: var(--ink2); margin-bottom: 2px; }
.bg-scene-field .bg-scene-input { margin-bottom: 0; }
.bg-scene-input { margin-bottom: 5px; }
.bg-scene-toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink2); margin-top: 4px; cursor: pointer; }
.bg-scene-presets { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.bg-scene-presets .gen-hint-select { flex: 1; min-width: 0; }
.bg-scene-suggest-row { display: flex; align-items: center; gap: 4px; }
.bg-scene-suggest { margin-bottom: 8px; }
.bg-scene-suggest:disabled { opacity: .6; cursor: not-allowed; }
.bg-gen-template-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bg-gen-prefs-link { background: none; border: none; color: var(--ink3); font-size: 11px; cursor: pointer; text-decoration: underline; font-family: inherit; padding: 0; margin-left: auto; }
.bg-gen-prefs-link:hover { color: var(--ink); }
.prefs-section-title { font-family: 'Fraunces', serif; font-size: var(--fs-lg); font-weight: 400; color: var(--ink2); margin: .2rem 0 .6rem; }
.bg-gen-prompt { min-height: 120px; line-height: 1.5; }
.bg-gen-actions { display: flex; gap: 7px; }
.bg-gen-submit { flex: 1; border-radius: 7px; padding: .45rem .85rem; font-size: 13px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 6px; }
.bg-gen-cancel { background: none; border: 1px solid var(--cream3); border-radius: 7px; padding: .45rem .75rem; font-size: 13px; font-family: inherit; color: var(--ink3); cursor: pointer; transition: border-color .15s, color .15s; }
.bg-gen-cancel:hover:not(:disabled) { border-color: var(--ink3); color: var(--ink); }
.bg-gen-cancel:disabled { opacity: .4; cursor: not-allowed; }
.bg-gen-spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: bg-spin .7s linear infinite; flex-shrink: 0; }
@keyframes bg-spin { to { transform: rotate(360deg); } }
.bg-gen-preview { display: flex; flex-direction: column; gap: 8px; }
.bg-gen-thumb { width: 100%; height: 170px; background-size: contain; background-repeat: no-repeat; background-position: center; background-color: var(--cream3); border-radius: 8px; border: 1px solid var(--cream3); }
.bg-gen-preview-actions { display: flex; gap: 7px; }
.bg-gen-use { flex: 1; border-radius: 7px; padding: .45rem .85rem; font-size: 13px; font-weight: 500; }
.bg-gen-retry { background: none; border: 1px solid var(--cream3); border-radius: 7px; padding: .45rem .75rem; font-size: 13px; font-family: inherit; color: var(--ink3); cursor: pointer; transition: border-color .15s, color .15s; }
.bg-gen-retry:hover { border-color: var(--ink3); color: var(--ink); }
.bg-gen-discard { background: none; border: 1px solid var(--cream3); border-radius: 7px; padding: .45rem .75rem; font-size: 13px; font-family: inherit; color: var(--ink3); cursor: pointer; transition: border-color .15s, color .15s; }
.bg-gen-discard:hover { border-color: var(--ink3); color: var(--ink); }
.bg-prompt-hint { display: block; margin-top: 4px; }

/* ── MOVE-TO-AREA FIELD IN TASK PANEL ── */
.tp-area-btn { display: inline-flex; align-items: center; gap: 7px; background: none; border: 1px solid var(--cream3); border-radius: 6px; padding: .28rem .7rem; font-size: 13px; font-family: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s; }
.tp-area-btn:hover { border-color: var(--ink3); }
.tp-area-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── MOVE-TO-AREA POPOVER ── */
.move-popover { position: fixed; z-index: 9000; background: white; border: 1px solid var(--cream3); border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.14); min-width: 200px; max-width: 260px; overflow: hidden; }
.mp-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); padding: .65rem 1rem .45rem; }
.mp-row { display: flex; align-items: center; gap: 9px; padding: .52rem 1rem; font-size: 13px; color: var(--ink); cursor: pointer; background: none; border: none; width: 100%; text-align: left; font-family: inherit; transition: background .12s; }
.mp-row:hover { background: var(--cream); }
.mp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── SNOOZE BUTTON ON TASK CARD ── */
.tc-snooze { display: none; background: none; border: none; font-size: 12px; color: var(--ink3); cursor: pointer; padding: 1px 3px; line-height: 1; flex-shrink: 0; opacity: .55; transition: opacity .15s; }
.task-card:hover .tc-snooze { display: inline; }
.task-card.snoozed-card { opacity: .5; }
.task-card.snoozed-card .tc-text { font-style: italic; }
@media (pointer: coarse) { .tc-snooze { display: inline; } }

/* ── SNOOZE POPOVER ── */
/* A manual popover once shown (top layer above dialogs): undo the browser's popover centring. */
.snooze-popover { position: fixed; inset: auto; margin: 0; padding: 0; color: inherit; z-index: 10000; background: white; border: 1px solid var(--cream3); border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.14); min-width: 320px; max-width: min(360px, calc(100vw - 16px)); overflow: hidden; }
.sp-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); padding: .65rem 1rem .45rem; display: flex; align-items: center; gap: .35rem; }
.sp-section-label { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); padding: .45rem 1rem .15rem; font-weight: 500; }
.sp-row { display: flex; align-items: center; justify-content: space-between; padding: .52rem 1rem; font-size: 13px; color: var(--ink); cursor: pointer; background: none; border: none; width: 100%; text-align: left; font-family: inherit; transition: background .12s; }
.sp-row:hover { background: var(--cream); }
.sp-time { font-size: 12px; color: var(--ink3); margin-left: 1.5rem; white-space: nowrap; }
.sp-divider { height: 1px; background: var(--cream3); margin: .3rem 0; }
.sp-custom { gap: 7px; justify-content: flex-start; color: var(--ink2); }
.sp-custom-icon { font-size: 14px; }
.sp-chips-block { padding: .35rem 0.75rem 0.55rem; }
.sp-chips-hdr { display: flex; align-items: baseline; justify-content: space-between; padding: 0 .25rem .35rem; }
.sp-chips-label { font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); font-weight: 500; }
.sp-chips-time { font-size: 12px; color: var(--ink3); }
.sp-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sp-chip { flex: 1 1 0; min-width: 2.1rem; padding: .4rem .15rem; font-size: 12px; font-family: inherit; color: var(--ink); background: var(--cream); border: 1px solid var(--cream3); border-radius: 6px; cursor: pointer; transition: background .12s, border-color .12s; }
.sp-chip:hover { background: var(--cream2, #ebe6dc); border-color: var(--ink3); }

/* ── SNOOZE CUSTOM DATETIME OVERLAY ── */
.snooze-dt-modal { border: 0; background: white; border-radius: 14px; padding: 1.75rem 1.75rem 1.5rem; width: min(360px, calc(100vw - 2rem)); box-shadow: 0 16px 48px rgba(0,0,0,.18); }
.snooze-dt-title { font-family: 'Fraunces', serif; font-size: var(--fs-xl); font-weight: 300; margin-bottom: 1.1rem; color: var(--ink); }
.snooze-dt-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 1.1rem; }
.snooze-dt-cancel { background: none; border: none; font-size: 13px; color: var(--ink3); cursor: pointer; font-family: inherit; padding: .4rem .65rem; border-radius: 7px; transition: color .15s; }
.snooze-dt-cancel:hover { color: var(--ink); }
.snooze-dt-save { border-radius: 7px; padding: .4rem 1rem; font-size: 13px; }

/* ── NOW HANDOFF (two-step leave wizard) ── */
.now-handoff-modal { border: 0; background: white; border-radius: 14px; padding: 1.5rem 1.5rem 1.25rem; width: min(420px, calc(100vw - 2rem)); max-height: min(90dvh, 640px); overflow: auto; box-shadow: 0 16px 48px rgba(0,0,0,.18); }
.now-handoff-title { font-family: 'Fraunces', serif; font-size: var(--fs-xl); font-weight: 300; margin: 0 0 .35rem; color: var(--ink); }
.now-handoff-leaving { font-size: 13px; color: var(--ink2); margin: 0 0 .85rem; line-height: 1.45; }
.now-handoff-leaving strong { font-weight: 600; color: var(--ink3); font-style: normal; }
.now-handoff-hint { font-size: var(--fs-hint); color: var(--ink3); margin: 0 0 .85rem; line-height: 1.45; }
.now-handoff-hint em { font-style: italic; color: var(--ink2); }
.now-handoff-hint strong { font-weight: 600; color: var(--ink2); }
.now-handoff-step[hidden] { display: none !important; }
.now-handoff-choice-stack { display: flex; flex-direction: column; gap: 8px; }
.now-handoff-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left;
  background: var(--cream); border: 1px solid var(--cream3); border-radius: 10px; padding: .75rem .9rem;
  cursor: pointer; font-family: inherit; transition: border-color .12s, background .12s;
}
.now-handoff-choice:hover { border-color: var(--ink3); background: var(--cream2, #ebe6dc); }
.now-handoff-choice-title { font-size: var(--fs-md); color: var(--ink); font-weight: 500; }
.now-handoff-label-row { display: flex; align-items: center; gap: 6px; margin-bottom: .35rem; }
.now-handoff-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); margin: 0; }
.now-handoff-note { min-height: 2.8rem; }
.now-handoff-presets { border: 1px solid var(--cream3); border-radius: 10px; overflow: hidden; background: var(--cream); max-height: 320px; overflow-y: auto; }
.now-handoff-presets .sp-section-label { padding: .45rem .85rem .15rem; }
.now-handoff-presets .sp-row { padding: .48rem .85rem; background: transparent; }
.now-handoff-presets .sp-chips-block { padding: .35rem .65rem .55rem; }
.now-handoff-presets .sp-divider { margin: .2rem 0; }
.now-handoff-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem; justify-content: flex-end; align-items: center; }
.now-handoff-back { background: none; border: none; font-size: 12px; color: var(--ink3); cursor: pointer; font-family: inherit; padding: .4rem .65rem; margin-right: auto; }
.now-handoff-back:hover { color: var(--ink); }
.now-handoff-save { border-radius: 7px; padding: .4rem 1.1rem; font-size: 13px; }
.now-handoff-cancel { display: block; width: 100%; margin-top: .85rem; background: none; border: none; font-size: 12px; color: var(--ink3); cursor: pointer; font-family: inherit; padding: .35rem; text-align: center; }
.now-handoff-cancel:hover { color: var(--ink); }

.tp-resume-row { display: flex; align-items: flex-start; gap: 8px; padding: .55rem 0; border-bottom: 1px solid rgba(0,0,0,.04); }
.tp-resume-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); flex-shrink: 0; padding-top: .35rem; }
.tp-resume-input { flex: 1; border: none; border-bottom: 1px solid var(--cream3); background: transparent; font-family: inherit; font-size: 13px; color: var(--ink); padding: .25rem 0; outline: none; min-width: 0; }
.tp-resume-input:focus { border-bottom-color: var(--gold); }
.tp-resume-clear { background: none; border: none; color: var(--ink3); cursor: pointer; font-size: 12px; padding: .25rem 4px; flex-shrink: 0; opacity: .55; }
.tp-resume-clear:hover { opacity: 1; color: var(--ink); }

/* ── SNOOZED SECTION (in area task list) ── */
.snooze-toggle { font-size: 11px; color: var(--ink3); background: none; border: none; cursor: pointer; padding: .5rem 0; opacity: .6; transition: opacity .15s; font-family: inherit; display: flex; align-items: center; gap: 4px; }
.snooze-toggle:hover { opacity: 1; }
.snoozed-section { margin-top: 6px; }
.snoozed-item { display: flex; align-items: flex-start; gap: 9px; padding: .5rem .75rem; border-radius: 8px; background: rgba(255,255,255,.6); border-left: 3px solid var(--cream3); margin-bottom: 5px; opacity: .65; }
.snoozed-item-text { flex: 1; font-size: 13px; color: var(--ink); font-style: italic; line-height: 1.4; }
.snoozed-item-meta { font-size: 11px; color: var(--ink3); margin-top: 2px; }
.snoozed-item-unsnooze { background: none; border: 1px solid var(--cream3); border-radius: 5px; font-size: 11px; color: var(--ink3); cursor: pointer; font-family: inherit; padding: 2px 7px; white-space: nowrap; flex-shrink: 0; margin-top: 1px; transition: border-color .15s, color .15s; }
.snoozed-item-unsnooze:hover { border-color: var(--ink3); color: var(--ink); }

/* Task panel — snoozed indicator */
.tp-snooze-row { display: flex; align-items: center; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid rgba(0,0,0,.04); }
.tp-snooze-badge { font-size: 12px; color: var(--ink3); display: flex; align-items: center; gap: 5px; }
.tp-unsnooze-btn { background: none; border: 1px solid var(--cream3); border-radius: 5px; font-size: 11px; color: var(--ink3); cursor: pointer; font-family: inherit; padding: 2px 7px; transition: border-color .15s, color .15s; }
.tp-unsnooze-btn:hover { border-color: var(--ink3); color: var(--ink); }
.tp-snooze-open-btn { background: none; border: 1px solid var(--cream3); border-radius: 5px; font-size: 11px; color: var(--ink3); cursor: pointer; font-family: inherit; padding: 2px 7px; transition: border-color .15s, color .15s; }
.tp-snooze-open-btn:hover { border-color: var(--ink3); color: var(--ink); }

/* ── TOAST ── */
/* The toast is a manual popover (top layer) so it shows above an open modal dialog; these undo the popover defaults. */
.toast { position: fixed; inset: auto auto 2rem 50%; margin: 0; border: 0; overflow: visible; transform: translateX(-50%) translateY(8px); background: var(--ink); color: var(--cream); border-radius: 10px; padding: .65rem 1.2rem; font-size: 13px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 9999; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #9b2020; pointer-events: auto; display: flex; align-items: center; gap: .75rem; white-space: normal; max-width: min(360px, 90vw); }
.toast.toast-action { pointer-events: auto; display: flex; align-items: center; gap: .85rem; white-space: normal; max-width: min(420px, 92vw); }
.toast-action-btn { border-radius: 6px; font-size: 12px; padding: .25rem .65rem; flex-shrink: 0; }
.toast-msg { flex: 1; }
.toast-close { background: none; border: none; color: inherit; opacity: .7; cursor: pointer; font-size: 14px; padding: 0; line-height: 1; flex-shrink: 0; }
.toast-close:hover { opacity: 1; }

/* ── LOGIN PAGE ── */
.login-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-card { background: white; border-radius: 16px; padding: 2.5rem 2rem; max-width: 380px; width: 100%; box-shadow: 0 4px 32px rgba(0,0,0,.08); }
.login-brand { font-family: 'Fraunces', serif; font-size: 1.8rem; font-weight: 300; letter-spacing: -.03em; margin-bottom: .25rem; }
.login-tagline { font-size: 13px; color: var(--ink3); margin-bottom: 2rem; }
.login-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); margin-bottom: 6px; }
.login-input { width: 100%; border: 1px solid var(--cream3); border-radius: 8px; padding: .65rem .9rem; font-size: 14px; font-family: inherit; color: var(--ink); outline: none; transition: border-color .15s; background: var(--cream); }
.login-input:focus { border-color: var(--ink3); }
.login-btn { width: 100%; background: var(--ink); color: var(--cream); border: none; border-radius: 8px; padding: .75rem; font-size: 14px; font-family: inherit; cursor: pointer; margin-top: 1rem; transition: background .15s; }
.login-btn:hover { background: var(--ink2); }
.login-btn:disabled { opacity: .5; cursor: default; }
.login-confirm { text-align: center; font-size: 14px; line-height: 1.6; color: var(--ink2); }
.login-confirm strong { color: var(--ink); }
.login-note { font-size: 13px; color: var(--ink3); line-height: 1.6; margin-bottom: 1.2rem; }
.login-link { display: block; width: 100%; background: none; border: none; color: var(--ink3); font-size: 12px; font-family: inherit; cursor: pointer; margin-top: .9rem; padding: 4px; text-decoration: underline; }
.login-link:hover { color: var(--ink); }


/* ── LOBBY BACKGROUND — wheel surface ── */
/* Frosted disc sits behind the canvas via ::before — sized to segment area (inset: 20px)
   so labels at maxR+16 always fall outside the disc, floating against the image */
body.has-lobby-bg .wheel-wrap::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: rgba(247,244,238,.40);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  z-index: -1;
  pointer-events: none;
}
/* Hint floats below disc — light text + dark shadow for legibility against image */
body.has-lobby-bg .wheel-hint {
  color: rgba(247,244,238,.72);
  text-shadow: 0 1px 3px rgba(0,0,0,.55), 0 0 8px rgba(0,0,0,.30);
}

/* ── HEADER RIGHT GROUP ── */
.hdr-right { display: flex; align-items: center; gap: .35rem; }

/* Locale EN|NL: the shared .segmented (lib/ui-foundation/segmented.css); its look on the dark
   header lives in css/theme.css (.locale-switch hooks). */

/*
 * Already-here chrome → arrow (not hand), when primary click is a no-op.
 * Drive from ARIA — do not copy cursor:default onto each .is-active chip.
 * - segmented aria-pressed — EN|NL, a list mode or a period already selected
 * - notes editor mode aria-pressed — Markdown|Visual already selected
 * - role=tab aria-selected — action-detail tabs already selected
 * - listbox option aria-selected — forward-compat for pickers
 * Do NOT include [aria-current=page]: PT map rail re-tap clears detail (keep hand).
 * Do NOT use bare .active / .is-active / practice-day[aria-pressed] — working
 * selection and toggles keep the hand.
 */
.segmented__opt[aria-pressed='true'],
.mdn-mode[aria-pressed='true'],
[role='tab'][aria-selected='true'],
[role='listbox'] [role='option'][aria-selected='true'] {
  cursor: default;
}

/* ── TITLE EDIT BUTTON (✎ next to the Home / area page title) ──
   Edits the thing the title names; the app header (.hdr) stays app-wide. */
.title-edit-btn { background: none; border: none; font-size: 1rem; color: inherit; cursor: pointer; padding: .3rem .45rem; border-radius: 7px; opacity: .55; transition: opacity .15s, background .15s; line-height: 1; flex-shrink: 0; align-self: center; font-family: inherit; }
.title-edit-btn:hover { opacity: 1; background: rgba(0,0,0,.06); }
.title-edit-btn:focus-visible { opacity: 1; outline: 2px solid currentColor; outline-offset: 2px; }
#area-overlay.on-image .title-edit-btn { color: rgba(247,244,238,.97) !important; text-shadow: 0 1px 6px rgba(0,0,0,.45); }
#area-overlay.on-image .title-edit-btn:hover,
body.has-lobby-bg .lobby-title-band .title-edit-btn:hover { background: rgba(247,244,238,.12); }

/* Home title band — same title slot and gutters as #area-overlay; in flow so the lobby
   layout below it keeps working. Under the sticky .hdr it only needs a small gap; with a
   lobby photo the .hdr is fixed, so the has-lobby-bg rule adds the full title-band top. */
.lobby-title-band { position: relative; z-index: 3; flex-shrink: 0; padding: 1.1rem var(--stage-gutter) .25rem; color: var(--ink); }
.lobby-title-band .ao-title-row { margin-bottom: 0; }
body.area-mode .lobby-title-band,
body.workspace-mode .lobby-title-band { display: none; }
body.has-lobby-bg .lobby-title-band { color: rgba(247,244,238,.97); }
body.has-lobby-bg .lobby-title-band .stage-page-title { color: inherit; text-shadow: 0 1px 8px rgba(0,0,0,.55); }
body.has-lobby-bg .lobby-title-band .title-edit-btn { text-shadow: 0 1px 6px rgba(0,0,0,.45); }
@media (max-width: 899px) {
  .lobby-title-band { padding: .75rem var(--stage-gutter-sm) .5rem; }
}
@media (max-width: 640px) {
  .lobby-title-band .stage-page-title { font-size: 1.5rem; }
}

/* ── PREPARE MODAL ── */
.prepare-modal { padding: 0; border: 0; background: white; border-radius: 14px; width: min(480px, calc(100vw - 2rem)); max-height: min(600px, calc(100dvh - 4rem)); flex-direction: column; box-shadow: 0 16px 48px rgba(0,0,0,.18); overflow: hidden; }
.prepare-body { flex: 1; overflow-y: auto; padding: .5rem 0 1rem; }
.prepare-loading { padding: 1.5rem; font-size: 13px; color: var(--ink3); text-align: center; }
.prepare-empty { padding: 2rem 1.5rem; font-size: 13px; color: var(--ink3); text-align: center; line-height: 1.6; }
.prepare-group { padding: 0 1.5rem; margin-bottom: .5rem; }
.prepare-group-hdr { display: flex; align-items: center; gap: 6px; padding: .85rem 0 .4rem; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); border-top: 1px solid var(--cream3); }
.prepare-group:first-child .prepare-group-hdr { border-top: none; }
.prepare-group-name { font-weight: 500; }
.prepare-row { padding: .55rem 0; border-bottom: 1px solid rgba(0,0,0,.04); }
.prepare-row:last-child { border-bottom: none; }
.prepare-task-text { font-size: 13px; color: var(--ink); line-height: 1.4; margin-bottom: .45rem; }
.prepare-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.prepare-ebtn { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; padding: .4rem .9rem; border-radius: 6px; border: 1px solid var(--cream3); background: var(--cream); cursor: pointer; font-family: inherit; color: var(--ink2); transition: background .12s, border-color .12s, color .12s; white-space: nowrap; }
.prepare-ebtn:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.prepare-ebtn-hint { font-size: 10px; color: var(--ink3); font-weight: 400; line-height: 1.2; transition: color .12s; }
.prepare-ebtn:hover .prepare-ebtn-hint { color: rgba(247,244,238,.7); }
.prepare-task-top { display: flex; align-items: flex-start; gap: 6px; margin-bottom: .45rem; }
.prepare-task-top .prepare-task-text { margin-bottom: 0; flex: 1; }
.prepare-open-btn { white-space: nowrap; flex-shrink: 0; }
.prepare-chev { font-size: 11px; color: var(--ink3); cursor: pointer; user-select: none; flex-shrink: 0; padding-top: 2px; line-height: 1; transition: transform .15s; }
.prepare-subtasks { padding: .1rem 0 .35rem .5rem; }
.prepare-sub-item { display: flex; align-items: center; gap: 6px; padding: .18rem 0; font-size: 12px; color: var(--ink3); line-height: 1.4; }
.prepare-sub-dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .4; flex-shrink: 0; }
/* Prepare segmented control */
.prepare-tabs { margin-top: .55rem; }
.prepare-tab-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 10px; padding: 0 4px; min-width: 15px; height: 15px; margin-left: 4px; vertical-align: middle; line-height: 1; background: rgba(26,24,20,.12); }
.prepare-tab[aria-pressed='true'] .prepare-tab-badge { background: rgba(26,24,20,.08); }
.prepare-tab-desc { padding: .6rem 1.5rem .2rem; font-size: 12px; color: var(--ink3); line-height: 1.5; }
/* Ease tab */
.prepare-ease-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.prepare-first-step { display: none; margin-top: .5rem; align-items: center; gap: 6px; flex-wrap: wrap; }
.prepare-first-step.open { display: flex; }
.prepare-first-step-input { flex: 1; min-width: 140px; width: auto; }
.prepare-first-step-save { font-size: 11px; padding: 3px 10px; border-radius: 5px; white-space: nowrap; }
.prepare-first-step-skip { font-size: 11px; padding: 3px 10px; border-radius: 5px; border: 1px solid var(--cream3); background: none; color: var(--ink3); cursor: pointer; font-family: inherit; white-space: nowrap; }
.prepare-dwell-nudge { font-size: 11px; color: var(--ink3); opacity: 0; max-height: 0; overflow: hidden; transition: opacity .4s, max-height .4s; font-style: italic; line-height: 1.5; }
.prepare-dwell-nudge.show { opacity: 1; max-height: 3rem; margin-top: .3rem; }
.bhard { background: #faeeda; color: #633806; }
.tp-hard-hint { font-size: 11px; color: var(--gold); font-style: italic; margin-left: 4px; }
.tp-due-hint { font-size: 10px; text-transform: none; letter-spacing: 0; color: var(--ink3); font-weight: 400; margin-left: 6px; }
/* ── PREPARE NEXT TAB ── */
.pn-area-group { padding: 0 1.5rem; margin-bottom: .15rem; }
.pn-area-label { font-size: 11px; font-weight: 600; padding: .25rem .6rem; border-radius: 5px; display: inline-flex; align-items: center; gap: 4px; margin: .55rem 0 .25rem; letter-spacing: .01em; }
.pn-row { display: flex; align-items: center; gap: 8px; padding: .38rem 0; border-bottom: 1px solid rgba(0,0,0,.04); }
.pn-row:last-child { border-bottom: none; }
.pn-row-main { flex: 1; min-width: 0; }
.pn-task-text { font-size: 13px; color: var(--ink); line-height: 1.4; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.pn-badge { font-size: 10px; padding: 1px 7px; border-radius: 20px; background: var(--cream); border: none; color: var(--ink3); }
.pn-badge.pn-hard { background: #faeeda; color: #a85a10; }
.pn-row-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.pn-now-btn { background: none; border: 1px solid var(--cream3); border-radius: 6px; font-size: 11px; color: var(--ink3); cursor: pointer; font-family: inherit; padding: .22rem .6rem; transition: background .12s, color .12s, border-color .12s; white-space: nowrap; }
.pn-now-btn:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.pn-now-btn.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.pn-snooze-btn { background: none; border: 1px solid var(--cream3); border-radius: 6px; font-size: 13px; color: var(--ink3); cursor: pointer; font-family: inherit; padding: .15rem .42rem; transition: background .12s, color .12s, border-color .12s; line-height: 1; }
.pn-snooze-btn:hover { border-color: var(--ink3); color: var(--ink2); }

/* ── LOBBY SETTINGS MODAL ── */
.lobby-settings-modal { padding: 0; border: 0; background: white; border-radius: 14px; width: calc(100% - 2.5rem); max-width: 520px; box-shadow: 0 16px 48px rgba(0,0,0,.18); overflow: hidden; }
.lobby-settings-body { padding: 1.1rem 1.5rem 1.25rem; max-height: min(72dvh, 640px); overflow-y: auto; }

/* ── NOW STRIP ── */
.now-strip { position: fixed; bottom: 0; left: 0; right: 0; z-index: 600; display: flex; align-items: center; justify-content: center; background: rgba(26,24,20,.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid rgba(255,255,255,.08); padding-bottom: var(--safe-bottom); transform: translateY(100%); transition: transform .25s cubic-bezier(.4,0,.2,1); pointer-events: none; }
.now-strip.visible { transform: translateY(0); pointer-events: auto; }
.now-strip-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 0 2px 2px 0; }
.now-strip-body { flex: 0 1 auto; max-width: min(60ch, 68vw); display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem .6rem .9rem; cursor: pointer; min-width: 0; border-radius: 4px; margin: 3px 3px 3px 0; transition: background .12s; }
.now-strip-body:hover { background: rgba(255,255,255,.055); }
.now-strip-emoji { font-size: 15px; flex-shrink: 0; line-height: 1; }
.now-strip-task { font-size: 13.5px; color: rgba(247,244,238,.9); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-family: 'DM Sans', sans-serif; letter-spacing: -.01em; }
.now-strip-label { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: rgba(247,244,238,.28); white-space: nowrap; flex-shrink: 0; font-family: 'DM Sans', sans-serif; }
.now-strip-actions { display: flex; flex-shrink: 0; padding-right: .35rem; }
.now-release-btn { font-size: 13px; padding: .3rem .5rem; border-radius: 5px; line-height: 1; }
.now-strip-timer { display: flex; align-items: center; gap: 7px; flex-shrink: 0; padding: 0 .2rem 0 .35rem; }
.now-strip-time { font-size: 13px; color: rgba(247,244,238,.92); font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; letter-spacing: .01em; }
.now-timer-btn { font-size: 12px; width: 28px; height: 28px; padding: 0; border-radius: 50%; line-height: 1; }
/* Nudge fixed/absolute elements above the strip when visible */
/* Nudge fixed/absolute chrome above the Now strip (+ home indicator) when visible */
body.has-now #date-stamp { bottom: calc(2.1rem + var(--now-strip-h) + var(--safe-bottom)); }
body.has-now #version-tag { bottom: calc(.6rem + var(--now-strip-h) + var(--safe-bottom)); }
body.has-now #float-nav-group { bottom: calc(1.5rem + var(--now-strip-h) + var(--safe-bottom)); }
body.has-now .area-card { bottom: calc(4rem + var(--now-strip-h) + var(--safe-bottom)); }

/* ── ICON PICKER (Build 83) ──────────────────────────────────────────────── */
.icon-picker { display: flex; flex-direction: column; gap: .45rem; }
.icon-category { }
.icon-cat-label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); margin-bottom: .3rem; }
.icon-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.icon-pick { width: 34px; height: 34px; border: 1.5px solid var(--cream3); border-radius: 7px; background: white; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; transition: border-color .12s, background .12s, box-shadow .12s; }
.icon-pick:hover { border-color: currentColor; background: var(--cream); }
.icon-pick.selected { border-color: currentColor; background: var(--cream); box-shadow: 0 0 0 1.5px currentColor; }
.icon-pick svg { display: block; pointer-events: none; }
.symbol-selected-row { display: flex; align-items: center; gap: 7px; background: var(--cream); border: 1.5px solid var(--cream3); border-radius: 8px; padding: .4rem .6rem; margin-bottom: .5rem; }
.symbol-selected-icon { display: flex; align-items: center; flex-shrink: 0; }
.symbol-selected-name { font-size: 11px; color: var(--ink2); flex: 1; font-family: 'DM Mono', monospace, sans-serif; }
.symbol-clear-btn { font-size: 11px; color: var(--ink3); background: none; border: none; cursor: pointer; padding: .15rem .3rem; text-decoration: underline; white-space: nowrap; font-family: inherit; }
.symbol-clear-btn:hover { color: var(--ink); }

/* ── WIDE SCREENS — sidebar floats absolute so wheel centres in full stage ── */
@media (min-width: 900px) {
  .lobby-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    flex-direction: column;
    /* Top-anchored so the tab bar stays put when switching tabs; the panel's tab body
       scrolls when it is taller than the column, the column itself never does. */
    justify-content: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.5rem calc(3.75rem + var(--safe-bottom)) 0; /* clear #date-stamp */
    overflow: hidden;
    width: 310px;
    z-index: 2;
  }
  body.has-lobby-bg .lobby-sidebar { padding-top: var(--stage-title-top); }
  body.has-now .lobby-sidebar { padding-bottom: calc(3.75rem + var(--now-strip-h) + var(--safe-bottom)); }
  .today-panel { width: auto; margin: 0; align-self: stretch; flex-shrink: 1; }
}

/* ── Area list — mobile fallback for the Wheel of Life (shown <=640px; see docs/architecture/frontend.md).
   Same domain data as the wheel, but legible + tappable: length reads better than angle,
   rows are full-width tap targets, labels never clip, and it's accessible to screen readers. */
.area-list { display: none; flex-direction: column; gap: var(--sp-2); width: calc(100% - 2rem); max-width: 440px; margin: 0 auto; }
.al-row { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 52px; padding: var(--sp-2) var(--sp-3);
  background: rgba(255,255,255,.92); border: 1px solid var(--border); border-left: 3px solid var(--al, var(--gold));
  border-radius: var(--r-sm); cursor: pointer; font-family: inherit; text-align: left; transition: box-shadow .15s, transform .1s; }
.al-row:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.al-row:active { transform: scale(.99); }
.al-emoji { font-size: 1.25rem; line-height: 1; flex-shrink: 0; }
.al-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.al-name { font-size: var(--fs-base); color: var(--ink); font-weight: 500; }
.al-count { color: var(--ink3); font-weight: 400; }
.al-bar { height: 6px; border-radius: 3px; background: rgba(0,0,0,.07); overflow: hidden; }
.al-fill { display: block; height: 100%; border-radius: 3px; background: var(--al, var(--gold)); }
.al-unrated .al-fill { opacity: .3; }
.al-meta { border-left-color: var(--gold); opacity: .82; }
.al-meta .al-body { gap: 0; }
/* Keep it legible when a lobby background image is set */
body.has-lobby-bg .al-row { background: rgba(26,24,20,.55); border-color: rgba(247,244,238,.12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
body.has-lobby-bg .al-name { color: var(--cream); }
body.has-lobby-bg .al-count { color: rgba(247,244,238,.6); }
body.has-lobby-bg .al-bar { background: rgba(247,244,238,.18); }

@media (max-width: 640px) {
  .detail { padding: 1rem 1rem 2rem 1rem; }
  .today-panel { width: calc(100vw - 2rem); }
  .wheel-wrap { display: none; }   /* on phones the wheel is replaced by the area list */
  .area-list { display: flex; }
  /* Breath under sticky .hdr only — fixed .hdr uses --stage-title-top* (see has-lobby-bg rules). */
  body:not(.has-lobby-bg) .lobby-center { padding-top: .5rem; }
  /* Utils under area list; start column already stacked above hero at ≤899. */
  .lobby-utils {
    flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 1.5rem); margin-top: 1.5rem;
  }
  .lobby-start { width: min(28rem, calc(100vw - 1.5rem)); }
  .offload-strip { flex-wrap: wrap; }
  .offload-postsave { position: static; width: 100%; margin-top: .35rem; bottom: auto; }
  /* Area view: the header (title · values · Vision/Review) is designed to flank the card in
     the side margins, which vanish on phones — so stack it above the card instead. The values
     clamp keeps the header height bounded, so the card's top offset reliably clears it. */
  #area-overlay { padding: var(--stage-title-top-sm) var(--stage-gutter-sm) .5rem; }   /* top clears the fixed app header */
  .ao-emoji, .ao-name { font-size: 1.5rem; }
  .ao-vs { margin-top: .35rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ao-actions { position: static; margin-top: .55rem; justify-content: flex-start; gap: .25rem; }
  .area-card { top: var(--area-card-top-sm); }   /* below stacked #area-overlay; token = stage-title-top-sm + stack allowance */

  /* Phase C: while typing, keep emoji+name; hide values + Vision/Review; drop card top */
  body.kb-open #area-overlay { padding-bottom: .25rem; }
  body.kb-open #area-overlay .ao-vs,
  body.kb-open #area-overlay .ao-values-entry,
  body.kb-open #area-overlay .ao-actions { display: none; }
  body.kb-open #area-overlay .ao-title-row { margin-bottom: 0; }
  body.kb-open .area-card { top: var(--area-card-top-kb); }
}

/* Phase C keyboard chrome — JS sets body.kb-open only on coarse pointer or shell-narrow.
   Hide Now + float-nav (no visualViewport lift). Reclaim bottom space for the focused field. */
body.kb-open .now-strip {
  transform: translateY(100%) !important;
  pointer-events: none !important;
}
body.kb-open #float-nav-group {
  opacity: 0 !important;
  pointer-events: none !important;
}
body.kb-open .area-card,
body.kb-open.has-now .area-card {
  bottom: calc(1rem + var(--safe-bottom));
}
body.kb-open.has-now #date-stamp { bottom: calc(2.1rem + var(--safe-bottom)); }
body.kb-open.has-now #version-tag { bottom: calc(.6rem + var(--safe-bottom)); }

/* ── Review space ─────────────────────────────────────────────────────────── */
.review-modal { padding: 0; border: 0; background: var(--cream); border-radius: 14px; width: 100%; max-width: min(640px, calc(100% - 2rem)); max-height: min(90dvh, 900px); flex-direction: column; box-shadow: 0 8px 40px rgba(0,0,0,.18); overflow: hidden; }
.review-framing { font-size: 13px; color: var(--ink3); font-style: italic; padding: .6rem 1.5rem .9rem; flex-shrink: 0; border-bottom: 1px solid var(--border); }
.review-body { overflow-y: auto; padding: 1.25rem 1.5rem; flex: 1; display: flex; flex-direction: column; gap: 1rem; }
.review-loading { font-size: 13px; color: var(--ink3); padding: 1rem 0; }
.review-empty { font-size: 13px; color: var(--ink3); padding: 1rem 0; line-height: 1.6; }

.review-journey { display: flex; flex-direction: column; }
.review-card { display: flex; flex-direction: column; gap: 1rem; }
.review-card-inner { background: white; border-radius: 10px; padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .9rem; }
.review-card-hdr { display: flex; align-items: center; gap: .55rem; padding-left: .65rem; }
.review-card-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.review-card-name { font-weight: 600; font-size: var(--fs-md); flex: 1; }
.review-card-count { font-size: 12px; color: var(--ink3); }
.review-card-tasks { display: flex; flex-direction: column; gap: .6rem; }
.review-task-item { display: flex; align-items: flex-start; gap: .55rem; }
.review-task-check { font-size: 13px; font-weight: 600; flex-shrink: 0; margin-top: 1px; }
.review-task-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.review-task-text { font-size: 13.5px; color: var(--ink); line-height: 1.4; }
.review-task-values { font-size: 12px; color: var(--ink3); font-style: italic; line-height: 1.3; }
.review-pattern { background: var(--cream); border-radius: 8px; padding: .75rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.review-pattern-label { font-size: 11px; color: var(--ink3); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: .35rem; margin-bottom: .15rem; }
.review-pattern-line { font-size: 13px; color: var(--ink2); line-height: 1.45; }
.review-mt { background: var(--cream); border-radius: 8px; padding: .75rem 1rem; display: flex; flex-direction: column; gap: .6rem; }
.review-mt-item { display: flex; flex-direction: column; gap: .2rem; padding-top: .35rem; border-top: 1px solid rgba(0,0,0,.05); }
.review-mt-item:first-of-type { border-top: 0; padding-top: 0; }
.review-mt-title { font-family: 'Fraunces', serif; font-size: var(--fs-lg); color: var(--ink); line-height: 1.35; }
.review-mt-counts { font-size: 12px; color: var(--ink3); }
.review-mt-q { font-size: 12.5px; color: var(--ink2); margin-top: .15rem; }
.review-mt-item.is-kept .review-mt-q { color: var(--ink3); }
.review-mt-item.is-kept .review-mt-actions { display: none; }
.review-mt-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .2rem; }
.review-mt-btn { background: none; border: 1px solid var(--border); border-radius: 20px; padding: .22rem .7rem; font-size: 12px; cursor: pointer; font-family: inherit; color: var(--ink2); transition: background .15s, color .15s, border-color .15s; }
.review-mt-btn:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.review-mt-letgo { color: var(--ink3); }
.review-mt-quiet { font-size: 12.5px; color: var(--ink3); }
.review-nav { display: flex; align-items: center; justify-content: space-between; padding: .25rem 0; }
.review-nav-btn { background: none; border: 1px solid var(--border); border-radius: 20px; padding: .3rem .85rem; font-size: 12px; cursor: pointer; font-family: inherit; color: var(--ink2); transition: background .15s, color .15s, border-color .15s; white-space: nowrap; max-width: 42%; overflow: hidden; text-overflow: ellipsis; }
.review-nav-btn:hover:not(:disabled) { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.review-nav-btn:disabled { opacity: .3; cursor: default; }
.review-position { font-size: 12px; color: var(--ink3); flex-shrink: 0; }
.review-position-of { opacity: .65; }
.review-summary-card { background: white; border-radius: 10px; padding: 2.5rem 1.5rem; display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center; }
.review-summary-big { font-family: 'Fraunces', serif; font-size: 56px; font-weight: 700; color: var(--ink); line-height: 1; }
.review-summary-big-label { font-size: 16px; color: var(--ink2); }
.review-summary-sub { font-size: 12px; color: var(--ink3); margin-top: .15rem; }
.review-summary-insight { font-size: 13px; color: var(--ink2); margin-top: .75rem; padding: .6rem 1rem; background: var(--cream); border-radius: 8px; }
.review-nav-done { background: var(--ink) !important; color: var(--cream) !important; border-color: var(--ink) !important; }

/* ── Monday review prompt ─────────────────────────────────────────────────── */
.monday-prompt { display: flex; align-items: center; gap: .6rem; background: white; border: 1px solid var(--border); border-radius: 9px; padding: .6rem .85rem; margin-bottom: .75rem; flex-wrap: wrap; }
.monday-prompt-text { font-size: 13px; color: var(--ink2); flex: 1; min-width: 140px; }
.monday-review-btn { border-radius: 6px; padding: .3rem .75rem; font-size: 12px; white-space: nowrap; }
.monday-dismiss-btn { font-size: 13px; padding: .1rem .2rem; line-height: 1; }

/* ── Area overlay review button ───────────────────────────────────────────── */
.ao-review-btn { background: none; border: none; cursor: pointer; font-size: 11px; color: inherit; font-family: inherit; padding: .3rem .5rem; opacity: .7; transition: opacity .15s; letter-spacing: .02em; white-space: nowrap; }
.ao-review-btn:hover { opacity: 1; }

/* ── Values echo on completion card ──────────────────────────────────────── */
.rf-values-echo { font-size: 11px; color: var(--ink3); font-style: italic; margin-bottom: .65rem; line-height: 1.4; }

/* ── Area editor panels ───────────────────────────────────────────────────── */
.area-edit-panel { padding-top: .75rem; }

/* ── Edit section (grouped block within a panel) ──────────────────────────── */
.edit-section { border-top: 1px solid var(--border); margin-top: .5rem; padding-top: 1rem; }
.edit-section-header { margin-bottom: .75rem; }
.edit-section-title { display: block; font-size: 13px; font-weight: 500; color: var(--ink2); }
.edit-section-hint { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink3); line-height: 1.4; }

/* ── Danger zone (delete button row in Identity tab) ──────────────────────── */
.edit-danger-zone { border-top: 1px solid var(--border); margin-top: .5rem; padding-top: 1.25rem; }
.edit-danger-zone .delete-area-btn { font-size: 12.5px; }

/* ── Generation hints row (temperature · saturation · brightness) ─────────── */
.gen-hints-row { display: flex; align-items: center; gap: .5rem; margin-top: .45rem; flex-wrap: wrap; }

/* ── Palette section wrapper ──────────────────────────────────────────────── */
#palette-section { margin-top: .6rem; }

/* Extracting state */
.palette-extracting { display: flex; align-items: center; gap: .55rem; padding: .6rem .8rem; background: var(--cream); border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; color: var(--ink3); }
.palette-spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--ink3); border-radius: 50%; flex-shrink: 0; animation: palette-spin .7s linear infinite; }
@keyframes palette-spin { to { transform: rotate(360deg); } }

/* Error state */
.palette-error { padding: .55rem .8rem; background: #fff5f5; border: 1px solid #fcc; border-radius: 8px; font-size: 12px; color: #a04040; }

/* Palette section spacing — keep a gap above whatever the palette area renders
   (extracting / error / result) so it never sticks to the Generate button. */
.bg-section-palette:not(:empty) { margin-top: 10px; }

/* Result state */
.palette-result { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: white; }
.palette-swatches-row { display: flex; height: 38px; }
.palette-swatch-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 3px; position: relative; }
.palette-swatch { position: absolute; inset: 0; }
.palette-swatch-label { position: relative; font-size: 8.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; mix-blend-mode: multiply; opacity: .6; line-height: 1; }
.palette-descriptors { display: flex; gap: .35rem; padding: .5rem .75rem; align-items: center; flex-wrap: wrap; }
.palette-descriptor-pill { font-size: 11px; color: var(--ink3); background: var(--cream); border-radius: 20px; padding: .15rem .55rem; letter-spacing: .03em; }
.palette-result-note { font-size: 11px; color: var(--ink3); padding: .1rem .75rem .55rem; font-style: italic; line-height: 1.45; }
.palette-result-note b { font-weight: 600; font-style: normal; color: var(--ink2); }
.palette-result-hdr { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); padding: .55rem .75rem .35rem; }
.palette-apply-btn { display: flex; width: calc(100% - 1.5rem); margin: .15rem .75rem .7rem; padding: .5rem; border-radius: 7px; font-size: 12px; font-weight: 500; }

/* ── Task groups ──────────────────────────────────────────────────────────── */
.group-section { margin-bottom: 2px; }
.ungrouped-label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink3); opacity: .55; padding: .55rem 0 .25rem; }
.group-hdr { display: flex; align-items: center; gap: 6px; padding: .55rem 0 .35rem; margin-top: 6px; border-top: 1px solid rgba(0,0,0,.07); }
.group-drag-handle { font-size: 13px; color: var(--ink3); opacity: 0; cursor: grab; flex-shrink: 0; padding: 0 2px; user-select: none; touch-action: none; transition: opacity .15s; }
.group-drag-handle:active { cursor: grabbing; }
.group-section:hover .group-drag-handle { opacity: .35; }
.group-drag-handle:hover { opacity: .7 !important; }
@media (pointer: coarse) { .group-drag-handle { opacity: .25; } }
.group-name { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); flex: 1; cursor: pointer; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-name:hover { color: var(--ink); }
.group-name-input { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); font-family: inherit; border: none; border-bottom: 1.5px solid var(--gold); outline: none; background: transparent; flex: 1; min-width: 0; padding: 0; line-height: 1.3; }
.group-count { font-size: var(--fs-label); color: var(--ink3); background: rgba(26,24,20,.08); border-radius: 8px; padding: 2px 7px; min-width: 1.25rem; text-align: center; flex-shrink: 0; line-height: 1.2; }
.group-snooze-btn {
  background: none; border: none; font-size: 12px; color: var(--ink3); cursor: pointer;
  padding: 0; width: 1.75rem; height: 1.75rem; display: inline-flex; align-items: center; justify-content: center;
  opacity: .45; transition: opacity .15s, color .15s; line-height: 1; flex-shrink: 0;
}
.group-snooze-btn:hover { opacity: 1; color: var(--ink); }
.group-collapse-btn {
  background: none; border: none; font-size: var(--fs-base); color: var(--ink2); cursor: pointer;
  padding: 0; width: 1.75rem; height: 1.75rem; display: inline-flex; align-items: center; justify-content: center;
  transition: transform .2s, color .15s; line-height: 1; flex-shrink: 0;
}
.group-collapse-btn:hover { color: var(--ink); }
.group-del-btn {
  background: none; border: none; font-size: var(--fs-sm); color: var(--ink3); cursor: pointer;
  padding: 0; width: 1.75rem; height: 1.75rem; display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s, color .15s; flex-shrink: 0; line-height: 1;
}
.group-section:hover .group-del-btn { opacity: .4; }
.group-del-btn:hover { opacity: 1 !important; color: #9b2020; }
.group-task-list { display: flex; flex-direction: column; }
.group-task-list.collapsed { display: none; }
.group-new-btn { display: flex; align-items: center; gap: 6px; background: none; border: 1px dashed rgba(0,0,0,.12); border-radius: 8px; padding: .4rem .9rem; font-size: 12px; color: var(--ink3); cursor: pointer; font-family: inherit; width: 100%; margin-top: 10px; transition: border-color .15s, color .15s; }
.group-new-btn:hover { border-color: rgba(0,0,0,.25); color: var(--ink); }

/* Committed actions: Groups | Moving toward mode switch */
.ca-mode-tabs { margin: 0 0 .65rem; }
.ca-toward-hint { margin: .35rem 0 .55rem; }
.toward-name { cursor: pointer; }
.toward-name:hover { color: var(--ink2); }
.toward-bucket-label { flex: 1; margin: 0; padding: 0; text-transform: uppercase; letter-spacing: .07em; font-size: 10px; color: var(--ink3); opacity: .7; }
.toward-let-go .toward-bucket-label { opacity: .55; }
.toward-hdr { border-top-color: rgba(0,0,0,.05); }
.no-tasks-msg { font-size: 13px; opacity: .5; padding: .25rem 0; }

.connect-cursor-steps {
  margin: .75rem 0 0;
  padding-left: 1.25rem;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
}
.connect-cursor-steps li { margin: .4rem 0; }

/* Compact values inside Claude steps — label | value | Copy stay one row */
.connect-claude-inline {
  margin: .35rem 0 0;
  display: flex;
  flex-direction: column;
  gap: .28rem;
}
.connect-claude-inline-row {
  display: grid;
  grid-template-columns: 6.75rem minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: .45rem;
  min-width: 0;
}
.connect-claude-inline-label {
  font-size: 11px;
  color: var(--ink3);
}
.connect-claude-value {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .35rem;
}
.connect-claude-hint {
  font-size: 11px;
  color: var(--ink3);
  opacity: .85;
}
.connect-claude-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
  word-break: break-all;
  color: var(--ink2);
  background: transparent;
  padding: 0;
}
.connect-claude-copy {
  background: none;
  border: 1px solid var(--cream3);
  border-radius: 5px;
  padding: .12rem .4rem;
  font-size: 11px;
  font-family: inherit;
  color: var(--ink3);
  cursor: pointer;
  line-height: 1.3;
  justify-self: end;
  align-self: start;
}
.connect-claude-copy:hover { border-color: var(--ink3); color: var(--ink); }

/* ── Offload Phase 2 place + Compass ── */
.offload-modal-place { width: min(32rem, 100%); max-height: min(88dvh, 44rem); }
.offload-dest-list {
  display: flex; flex-direction: column; gap: .35rem; margin: .75rem 0;
  container: offload-place / inline-size;
}
.offload-enact-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
  align-items: stretch;
}
.offload-enact-pair .offload-dest-row { height: 100%; }
@container offload-place (max-width: 22rem) {
  .offload-enact-pair { grid-template-columns: 1fr; }
}
.offload-let-go-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  margin-top: .25rem;
}
.offload-let-go {
  border: 0;
  background: transparent;
  color: var(--ink3);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: .45rem .35rem;
}
.offload-let-go:hover { color: var(--ink); }
.offload-dest-row {
  display: flex; align-items: stretch; gap: .25rem;
  border: 1px solid var(--cream3); border-radius: 10px; background: rgba(255,255,255,.55);
}
.offload-dest-row.is-selected { border-color: var(--ink3); background: white; }
.offload-dest-pick {
  flex: 1; text-align: left; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; padding: .65rem .8rem; color: var(--ink);
}
.offload-dest-label { display: block; font-size: var(--fs-md); font-weight: 500; }
.offload-dest-guide { display: block; margin-top: .15rem; font-size: 12px; color: var(--ink3); }
.offload-dest-helper-btn {
  border: 0; background: transparent; cursor: pointer; padding: 0 .7rem;
  color: var(--ink3); font-size: 14px;
}
.offload-dest-helper-btn:hover { color: var(--ink); }
.offload-dest-tip {
  align-self: center;
  flex-shrink: 0;
  margin-right: .35rem;
}
.offload-place-helper {
  margin: .35rem 0 .75rem; padding: .7rem .85rem; border-radius: 8px;
  background: rgba(26,24,20,.04); font-size: 13px; color: var(--ink2);
}
.offload-place-helper p { margin: .35rem 0 0; }
.offload-field { display: flex; flex-direction: column; gap: .3rem; margin: .65rem 0; }
.offload-field-label { font-size: 12px; color: var(--ink3); }
.offload-compass-filters { gap: .3rem; padding: .55rem .75rem 0; }
.offload-compass-filters[hidden] { display: none; }
.offload-compass-row {
  border: 1px solid var(--cream3); border-radius: 10px; background: rgba(255,255,255,.65);
  padding: .7rem .85rem; margin: 0 0 .35rem;
}
.offload-compass-meta { font-size: 11px; color: var(--ink3); margin-bottom: .25rem; }
.offload-compass-text { font-size: 14px; color: var(--ink); white-space: pre-wrap; }
.offload-compass-toward { margin-top: .35rem; font-size: 13px; color: var(--ink2); }
.offload-compass-row-actions {
  display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; margin-top: .55rem;
}
.offload-compass-retire {
  border: 0; background: transparent; font-family: inherit;
  font-size: 12px; color: var(--ink3); cursor: pointer; padding: 0;
}
.offload-compass-retire:hover { color: var(--ink); }
.offload-choice-entry {
  border: 0; background: transparent; font-family: inherit;
  font-size: 12px; color: var(--ink2); cursor: pointer; padding: 0; text-decoration: underline;
  text-underline-offset: 2px;
}
.offload-choice-entry:hover { color: var(--ink); }
.offload-sheet-hint {
  margin: 0;
  padding: .55rem .85rem 0;
  font-size: 13px;
  color: var(--ink3);
  line-height: 1.4;
}
/* ── Moving toward cards (words first; picture optional) ── */
.mt-grid { grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: 12px; container: mt-grid / inline-size; }
.mt-card { display: flex; flex-direction: column; }
.mt-card .vision-card-meta { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; }
.mt-card.has-img .vision-card-img { aspect-ratio: 16 / 7; }
.mt-card .vision-card-actions { opacity: 1; }
.mt-card.is-fresh { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(196,150,58,.25); }
.mt-card-title { font-family: 'Fraunces', serif; font-size: var(--fs-lg); font-weight: 400; line-height: 1.3; color: var(--ink); padding-right: 3.2rem; }
.mt-card-title.is-unnamed { color: var(--ink3); font-style: italic; cursor: pointer; }
.mt-row { display: flex; flex-direction: column; gap: .2rem; }
.mt-row-label { font-size: var(--fs-md); font-weight: 500; color: var(--ink); letter-spacing: 0; text-transform: none; }
.mt-row-text { font-size: var(--fs-base); line-height: 1.45; color: var(--ink2); white-space: pre-wrap; }
.mt-adds { display: flex; flex-direction: column; align-items: stretch; gap: .1rem; }
.mt-add-row { display: flex; align-items: center; gap: .4rem; min-height: 2rem; }
.mt-add {
  border: 0; background: transparent; font-family: inherit; font-size: var(--fs-base); color: var(--ink3);
  cursor: pointer; padding: .4rem 0; text-align: left; line-height: 1.35; flex: 1; min-width: 0;
}
.mt-add:hover { color: var(--ink); }
.mt-more > summary, .mt-optional > summary, .mt-retired > summary {
  font-size: var(--fs-base); color: var(--ink3); cursor: pointer; user-select: none; list-style: none;
  padding: .35rem 0;
}
.mt-more > summary::-webkit-details-marker, .mt-optional > summary::-webkit-details-marker, .mt-retired > summary::-webkit-details-marker { display: none; }
.mt-more > summary::before, .mt-optional > summary::before, .mt-retired > summary::before { content: '▸ '; }
.mt-more[open] > summary::before, .mt-optional[open] > summary::before, .mt-retired[open] > summary::before { content: '▾ '; }
.mt-more > summary:hover, .mt-optional > summary:hover, .mt-retired > summary:hover { color: var(--ink); }
.mt-optional { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--cream3); padding-top: 10px; }
.mt-optional > summary { font-size: var(--fs-base); color: var(--ink2); }
.mt-field-help { font-size: var(--fs-hint); color: var(--ink3); line-height: 1.4; margin-top: -4px; }
.mt-advise-row { display: flex; align-items: center; gap: 6px; }
.mt-ask { display: flex; flex-direction: column; gap: 8px; padding: .85rem 1rem; border: 1px solid var(--cream3); border-radius: 10px; background: rgba(255,255,255,.55); }
.mt-ask-intro { font-size: var(--fs-base); color: var(--ink2); line-height: 1.45; }
.mt-ask-actions { display: flex; justify-content: flex-end; gap: 8px; }
.mt-ask-actions .vision-gen-btn { margin-top: 0; }
.practice-cue-picture { font-size: var(--fs-hint); color: var(--ink3); line-height: 1.4; margin-top: 4px; }
.mt-advise-btn { margin-top: 0; }
.mt-editor-actions { align-items: center; flex-wrap: wrap; }
.mt-editor-actions .mt-spacer { flex: 1; }
.mt-editor-leave {
  display: flex; flex-direction: column; gap: .55rem;
  border-top: 1px solid var(--cream3); padding-top: .85rem; margin-top: .25rem;
}
.mt-leave-heading { font-size: var(--fs-md); font-weight: 500; color: var(--ink); }
.mt-leave-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .65rem; }
.mt-letgo, .mt-delete {
  background: none; border: 0; color: var(--ink2); font-family: inherit;
  font-size: var(--fs-base); font-weight: 500; cursor: pointer; padding: .15rem 0;
  text-decoration: underline; text-underline-offset: 2px;
}
.mt-letgo:hover { color: var(--ink); }
.mt-delete:hover { color: #a33; }
.mt-leave-note { font-size: var(--fs-hint); color: var(--ink3); line-height: 1.4; flex: 1; min-width: 12rem; }
.mt-empty { margin: 0 0 .75rem; font-size: var(--fs-sm); color: var(--ink3); line-height: 1.5; }
.mt-retired { margin-top: .5rem; }
.mt-retired-list { display: flex; flex-direction: column; gap: .3rem; margin-top: .4rem; }
.mt-retired-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: var(--fs-sm); color: var(--ink3); }
.mt-bring-back { border: 0; background: none; font-family: inherit; font-size: var(--fs-sm); color: var(--ink2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.mt-bring-back:hover { color: var(--ink); }
.mt-add-item { aspect-ratio: auto; min-height: 3.5rem; }
.mt-steps:not(:empty) { display: flex; flex-direction: column; gap: .2rem; margin-top: .15rem; }
.mt-step {
  display: flex; align-items: baseline; gap: .45rem; width: 100%; text-align: left;
  border: 0; background: transparent; font-family: inherit; font-size: var(--fs-base); color: var(--ink2);
  padding: .25rem 0; cursor: pointer; line-height: 1.4;
}
.mt-step:hover .mt-step-text { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.mt-step.is-done .mt-step-text { color: var(--ink3); text-decoration: line-through; }
.mt-step.is-done:hover .mt-step-text { text-decoration: line-through underline; }
.mt-step-mark { flex-shrink: 0; width: 1em; color: var(--ink3); font-size: var(--fs-sm); }
.mt-step-kind { margin-left: auto; font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .05em; color: var(--ink3); flex-shrink: 0; }
.tp-part-of { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; min-width: 0; }
.tp-part-of-field { margin: .35rem 0 .55rem; }
.tp-part-of-select { max-width: 18rem; }
.tp-part-of-open { border: 0; background: none; font-family: inherit; font-size: var(--fs-sm); color: var(--ink2); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 0; }
.tp-part-of-open:hover { color: var(--ink); }
.tp-part-of-none, .tp-part-of-loading { font-size: var(--fs-sm); color: var(--ink3); }
.mt-card:not(.has-img) .vision-card-edit { background: var(--cream3); color: var(--ink2); }
.mt-card:not(.has-img) .vision-card-edit:hover { background: var(--ink3); color: #fff; }
@container mt-grid (max-width: 22rem) {
  .mt-grid { grid-template-columns: 1fr; }
}
.offload-choice-bar {
  display: flex; flex-direction: column; gap: .25rem;
  padding: .65rem .85rem 0; border-bottom: 1px solid var(--cream3);
}
.offload-choice-bar-row {
  display: flex; align-items: center; gap: .35rem;
}
.offload-choice-start {
  align-self: flex-start; border: 1px solid var(--cream3); background: rgba(255,255,255,.7);
  font-family: inherit; font-size: 13px; color: var(--ink); padding: .35rem .75rem;
  border-radius: 8px; cursor: pointer;
}
.offload-choice-start:hover { border-color: var(--ink3); background: white; }
.offload-choice-bar-hint { margin: 0; font-size: 12px; color: var(--ink3); }
.offload-choice-sessions { display: flex; flex-direction: column; gap: .35rem; margin-top: .65rem; }
.offload-choice-sessions-label { margin: 0; font-size: 11px; color: var(--ink3); }
.offload-choice-session {
  display: flex; align-items: center; gap: .35rem;
  border: 1px solid var(--cream3); border-radius: 10px; background: rgba(255,255,255,.55);
}
.offload-choice-session-open {
  flex: 1; text-align: left; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; padding: .5rem .7rem; color: var(--ink); min-width: 0;
}
.offload-choice-session-label { display: block; font-size: 13px; }
.offload-choice-session-meta { display: block; margin-top: .1rem; font-size: 11px; color: var(--ink3); }
.offload-choice-session-takeaway {
  display: block; margin-top: .25rem; font-size: 12px; color: var(--ink2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.offload-choice-takeaway { margin-top: 1rem; }
.offload-choice-takeaway-hint {
  display: block; margin-top: .25rem; font-size: 11px; color: var(--ink3);
}
.offload-choice-session-remove {
  border: 0; background: transparent; font-family: inherit;
  font-size: 12px; color: var(--ink3); cursor: pointer; padding: 0 .7rem;
}
.offload-choice-session-remove:hover { color: var(--ink); }
.offload-modal-choice { width: min(34rem, 100%); max-height: min(90dvh, 48rem); }
.offload-choice-body { padding: 1rem 1.25rem 1.25rem; overflow: auto; }
.offload-choice-add { display: flex; gap: .5rem; align-items: stretch; margin-bottom: .75rem; }
.offload-choice-add .offload-input { flex: 1; min-width: 0; }
.offload-choice-options-summary { gap: .35rem; margin-bottom: .85rem; }
.offload-choice-empty { margin: .5rem 0; font-size: 13px; color: var(--ink3); }
.offload-choice-focus { margin-top: .25rem; }
.offload-choice-nav {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .65rem;
}
.offload-choice-pos { font-size: 12px; color: var(--ink3); }
.offload-choice-option-label {
  margin: 0 0 .35rem; font-size: var(--fs-xl); font-weight: 500; color: var(--ink);
}
.offload-choice-focus-hint { margin: 0 0 .85rem; font-size: 12px; color: var(--ink3); }
.offload-choice-criteria { display: flex; flex-direction: column; gap: .55rem; }
.offload-choice-criterion {
  border: 1px solid var(--cream3); border-radius: 10px; background: rgba(255,255,255,.65);
  padding: .7rem .85rem;
}
.offload-choice-crit-meta { font-size: 11px; color: var(--ink3); margin-bottom: .2rem; }
.offload-choice-crit-main { font-size: 14px; color: var(--ink); white-space: pre-wrap; }
.offload-choice-not {
  margin-top: .4rem; font-size: 12px; color: var(--ink3); white-space: pre-wrap;
}
.offload-choice-reveal-not {
  margin-top: .4rem; border: 0; background: transparent; font-family: inherit;
  font-size: 12px; color: var(--ink3); cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 2px;
}
.offload-mark-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.offload-mark-btn {
  border: 1px solid var(--cream3); background: rgba(255,255,255,.55); font-family: inherit;
  font-size: 12px; color: var(--ink3); padding: .25rem .55rem; border-radius: 8px; cursor: pointer;
}
.offload-mark-btn.is-active { color: var(--ink); border-color: var(--ink3); background: white; }
.offload-mark-btn:hover { border-color: var(--ink3); }

/* Preferences → AI connection (MCP): one access level per object group (off / read / read and edit). */
.prefs-mcp-access { display: grid; gap: var(--sp-2); container-type: inline-size; }
.prefs-mcp-access-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--ink); }
.prefs-mcp-access-row select { flex: none; width: auto; max-width: 11rem; }
@container (max-width: 280px) {
  .prefs-mcp-access-row { flex-direction: column; align-items: stretch; gap: var(--sp-1); }
  .prefs-mcp-access-row select { max-width: none; }
}
#add-area-error:not([hidden]) { color: var(--ink); font-weight: 500; }
