/* Enjazy 2 — component library (one stylesheet). Generated by _tools/build-css.mjs from 03-components/css/*.css. */
/* ==========================================================================
   Enjazy 2 — component library · 01 base
   Consumes ONLY semantic/component tokens (02-tokens). No raw colours, no physical directions.
   Layout rule for theme identity: borders are drawn with inset box-shadows (never CSS border),
   so a theme's border width can never change a box; UI text uses the fixed UI face.
   ========================================================================== */

/* ---- component tokens (reference semantic tokens only) ---- */
/* Component tokens re-resolve on every [data-theme] subtree, so a preview of another theme (theme gallery, onboarding,
   brand tiles) shows that theme's components, not the root theme's. */
:root, [data-theme] {
  --button-primary-bg: var(--accent);
  --button-primary-bg-hover: var(--accent-hover);
  --button-primary-bg-pressed: var(--accent-pressed);
  --button-primary-fg: var(--on-accent);
  --button-secondary-bg: var(--surface-1);
  --button-secondary-border: var(--border-strong);
  --button-danger-bg: var(--danger-solid);
  --button-danger-fg: var(--on-danger);
  --control-bg: var(--surface-1);
  --control-border: var(--border-strong);
  --control-radius: var(--radius-control);
  --task-row-height: var(--size-row-task);
  --task-check-size: 20px;
  --nav-row-height: var(--size-row-nav);
  --panel-bg: var(--surface-1);
  --overlay-bg: var(--surface-overlay);
  --tooltip-bg: var(--text-primary);
  --tooltip-fg: var(--text-inverse);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background-color: var(--bg);
  background-image: var(--material-texture), var(--material-app-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; margin: 0; }
img, svg { display: block; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--text-link); text-underline-offset: 2px; }
[hidden] { display: none !important; }
::selection { background: var(--state-selected-bg); color: var(--text-primary); }

/* ---- focus: one ring, everywhere, every theme (≥3:1) ---- */
:focus { outline: none; }
:focus-visible { outline: var(--bw-focus) solid var(--focus-ring); outline-offset: 2px; }
.focus-inset:focus-visible { outline-offset: calc(var(--bw-focus) * -1 - 1px); }

/* ---- text roles: size & weight build hierarchy (never UPPERCASE; Arabic has no case) ---- */
.t-caption { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-caption); }
.t-label-sm { font-size: var(--fs-label-sm); line-height: var(--lh-label-sm); font-weight: var(--fw-label-sm); }
.t-label { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: var(--fw-label); }
.t-body-sm { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); font-weight: var(--fw-body-sm); }
.t-body { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-body); }
.t-body-lg { font-size: var(--fs-body-lg); line-height: var(--lh-body-lg); font-weight: var(--fw-body-lg); }
/* Display-face roles are always laid out as fill-width single lines so a theme's face can't move anything. */
.t-heading, .t-title, .t-title-lg, .t-display { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-title, .t-title-lg, .t-display { font-family: var(--font-display); letter-spacing: var(--tracking-display); }
/* Letter-spacing breaks the joins between Arabic letters: display tracking is 0 for Arabic text in every theme. */
:lang(ar) { --tracking-display: 0em; }
/* heading is a UI role: same face and weight in every theme, so headings may shrink-wrap safely */
.t-heading { font-family: var(--font-ui); font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: var(--fw-heading); letter-spacing: 0; }
.t-title { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-title); }
.t-title-lg { font-size: var(--fs-title-lg); line-height: var(--lh-title-lg); font-weight: var(--fw-title-lg); }
.t-display { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-display); }
.t-secondary { color: var(--text-secondary); }
.t-disabled { color: var(--text-disabled); }
.t-danger { color: var(--danger-fg); }
.t-success { color: var(--success-fg); }
.t-accent { color: var(--accent-text); }
.t-strong { font-weight: var(--fw-semibold); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.ltr { direction: ltr; unicode-bidi: isolate; }   /* Latin-only values: email, URL, codes, keys */
[dir="rtl"] .ltr:is(div, p, pre, code, output, dd) { text-align: end; } /* a block of Latin in Arabic UI still aligns to the reading start */

/* ---- bidi: every piece of user-entered text is isolated (MI-25) ---- */
.u { unicode-bidi: isolate; }
.trunc { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- icons (one family; theme varies stroke only) ---- */
.icon { width: var(--size-icon-md); height: var(--size-icon-md); flex: none; fill: none; stroke: currentColor;
  stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; }
.icon--xs { width: var(--size-icon-xs); height: var(--size-icon-xs); }
.icon--sm { width: var(--size-icon-sm); height: var(--size-icon-sm); }
.icon--lg { width: var(--size-icon-lg); height: var(--size-icon-lg); }
.icon--xl { width: 32px; height: 32px; }
[dir="rtl"] .icon[data-mirror] { transform: scaleX(-1); }
.icon--spin { animation: enj-spin 1s linear infinite; }
@keyframes enj-spin { to { transform: rotate(360deg); } }
[dir="rtl"] .icon--spin { animation-direction: normal; }

/* ---- surfaces & materials (theme style layer through tokens) ---- */
.surface-1, .surface-2, .surface-3, .surface-raised, .surface-overlay, .surface-sunken {
  background-image: var(--material-panel-texture);
}
.surface-1 { background-color: var(--surface-1); }
.surface-2 { background-color: var(--surface-2); }
.surface-3 { background-color: var(--surface-3); }
.surface-raised { background-color: var(--surface-raised); }
.surface-overlay { background-color: var(--surface-overlay); }
.surface-sunken { background-color: var(--surface-sunken); }
.material { -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop); }

/* The border/elevation composite used by every boxed component. */
.bx {
  --_bw: 0px; --_bc: transparent; --_elev: 0 0 0 0 transparent;
  box-shadow: inset 0 0 0 var(--_bw) var(--_bc), var(--material-edge), var(--_elev);
}

/* ---- motion helpers (one motion language; reduced-motion aware through tokens) ---- */
.fx { transition-property: background-color, color, box-shadow, opacity, transform;
  transition-duration: var(--dur-fast); transition-timing-function: var(--ease-standard); }
@keyframes enj-in { from { opacity: 0; transform: translateY(var(--motion-distance)); } to { opacity: 1; transform: none; } }
@keyframes enj-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes enj-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---- layout primitives ---- */
.row { display: flex; align-items: center; gap: var(--space-8); min-width: 0; }
.row--4 { gap: var(--space-4); } .row--12 { gap: var(--space-12); } .row--16 { gap: var(--space-16); }
.col { display: flex; flex-direction: column; min-width: 0; }
.col--4 { gap: var(--space-4); } .col--8 { gap: var(--space-8); } .col--12 { gap: var(--space-12); } .col--16 { gap: var(--space-16); } .col--24 { gap: var(--space-24); }
.grow { flex: 1 1 0; min-width: 0; }
.col > .btn--link, .col > .btn--sm:not(.btn--block) { align-self: flex-start; }
.none { flex: none; }
.spacer { flex: 1 1 auto; }
.divider { height: 1px; background: var(--border-subtle); flex: none; }
.divider-v { width: 1px; align-self: stretch; background: var(--border-subtle); flex: none; }
.stack { display: grid; }
.stack > * { grid-area: 1 / 1; }

/* ==========================================================================
   Enjazy 2 — component library · 02 actions, selection controls, inputs  (J-01 … J-25)
   ========================================================================== */

/* ---- J-01 Button ---------------------------------------------------------- */
.btn {
  --_bw: 0px; --_bc: transparent; --_elev: 0 0 0 0 transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-6);
  height: var(--size-control-md); padding-inline: var(--space-12); border-radius: var(--control-radius);
  font-size: var(--fs-label); line-height: var(--lh-label); font-weight: var(--fw-label); white-space: nowrap;
  color: var(--text-primary); background-color: transparent; position: relative; flex: none;
  box-shadow: inset 0 0 0 var(--_bw) var(--_bc), var(--_elev);
  transition: background-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.btn .icon { width: var(--size-icon-sm); height: var(--size-icon-sm); }
.btn--sm { height: var(--size-control-sm); padding-inline: var(--space-8); gap: var(--space-4); }
.btn--lg { height: var(--size-control-lg); padding-inline: var(--space-16); font-size: var(--fs-body); }
.btn--block { display: flex; width: 100%; }
.btn--primary { background-color: var(--button-primary-bg); color: var(--button-primary-fg); --_elev: var(--shadow-1); }
.btn--primary:hover { background-color: var(--button-primary-bg-hover); }
.btn--primary:active { background-color: var(--button-primary-bg-pressed); }
.btn--secondary { background-color: var(--button-secondary-bg); --_bw: var(--bw-default); --_bc: var(--button-secondary-border); --_elev: var(--shadow-1); }
.btn--secondary:hover { background-image: linear-gradient(var(--state-hover), var(--state-hover)); }
.btn--secondary:active { background-image: linear-gradient(var(--state-pressed), var(--state-pressed)); }
.btn--tertiary { color: var(--text-primary); }
.btn--tertiary:hover { background-color: var(--state-hover); }
.btn--tertiary:active { background-color: var(--state-pressed); }
.btn--danger { background-color: var(--button-danger-bg); color: var(--button-danger-fg); --_elev: var(--shadow-1); }
.btn--danger:hover { background-image: linear-gradient(var(--state-hover), var(--state-hover)); }
.btn--danger-subtle { color: var(--danger-fg); --_bw: var(--bw-default); --_bc: var(--danger-border); background-color: var(--surface-1); }
.btn--danger-subtle:hover { background-color: var(--danger-bg); }
.btn--link { height: auto; padding: 0; color: var(--text-link); text-decoration: underline; text-decoration-color: transparent; border-radius: 2px; }
.btn--link:hover { text-decoration-color: currentColor; }
.btn[disabled], .btn[aria-disabled="true"] { background-color: var(--state-disabled-bg); color: var(--state-disabled-fg); --_bc: transparent; --_elev: 0 0 0 0 transparent; background-image: none; cursor: not-allowed; }
.btn--tertiary[disabled], .btn--link[disabled] { background-color: transparent; }
.btn.is-loading { color: transparent; }
.btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--button-primary-fg); border-inline-end-color: transparent; animation: enj-spin .8s linear infinite; }
.btn--secondary.is-loading::after, .btn--tertiary.is-loading::after { border-color: var(--text-secondary); border-inline-end-color: transparent; }
.btn__count { font-variant-numeric: tabular-nums; opacity: .9; }
[data-theme="brutal"] .btn--primary:active, [data-theme="brutal"] .btn--secondary:active { transform: translate(2px, 2px); --_elev: 0 0 0 0 transparent; }

/* ---- J-02 Icon button ------------------------------------------------------ */
.icon-btn {
  --_bw: 0px; --_bc: transparent;
  display: inline-grid; place-items: center; flex: none; position: relative;
  width: var(--size-control-sm); height: var(--size-control-sm); border-radius: var(--control-radius);
  color: var(--text-secondary); box-shadow: inset 0 0 0 var(--_bw) var(--_bc);
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.icon-btn .icon { width: var(--size-icon-sm); height: var(--size-icon-sm); }
.icon-btn:hover { background-color: var(--state-hover); color: var(--text-primary); }
.icon-btn:active { background-color: var(--state-pressed); }
.icon-btn--xs { width: 20px; height: 20px; border-radius: 4px; }
.icon-btn--xs::before { content: ""; position: absolute; inset: -2px; }            /* 24px target */
.icon-btn--xs .icon { width: 14px; height: 14px; }
.icon-btn--md { width: var(--size-control-md); height: var(--size-control-md); }
.icon-btn--md .icon { width: var(--size-icon-md); height: var(--size-icon-md); }
.icon-btn--lg { width: var(--size-touch); height: var(--size-touch); }
.icon-btn--lg .icon { width: var(--size-icon-lg); height: var(--size-icon-lg); }
.icon-btn--outline { --_bw: var(--bw-default); --_bc: var(--border-strong); background-color: var(--surface-1); color: var(--text-primary); }
.icon-btn--solid { background-color: var(--accent); color: var(--on-accent); }
.icon-btn--solid:hover { background-color: var(--accent-hover); color: var(--on-accent); }
.icon-btn--danger { color: var(--danger-fg); }
.icon-btn--danger:hover { background-color: var(--danger-bg); color: var(--danger-fg); }
.icon-btn[aria-pressed="true"] { background-color: var(--accent-subtle-bg); color: var(--accent-subtle-fg); }
.icon-btn[disabled] { color: var(--text-disabled); background: none; cursor: not-allowed; }
@media (pointer: coarse) { .icon-btn::after { content: ""; position: absolute; inset: calc((var(--size-touch) - 100%) / -2); } }

/* ---- J-03 Toolbar & row actions ------------------------------------------- */
.toolbar { display: flex; align-items: center; gap: var(--space-4); min-width: 0; flex-wrap: nowrap; }
.toolbar__sep { width: 1px; height: 20px; background: var(--border-default); margin-inline: var(--space-4); flex: none; }
.toolbar .btn { height: var(--size-control-sm); padding-inline: var(--space-8); }
.toolbar .btn--tertiary { color: var(--text-secondary); }
.toolbar .btn--tertiary:hover, .toolbar .btn[aria-pressed="true"], .toolbar .btn[aria-expanded="true"] { color: var(--text-primary); }
.toolbar .btn[aria-pressed="true"] { background-color: var(--accent-subtle-bg); color: var(--accent-subtle-fg); }
.row-actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }

/* ---- J-04 FAB (phone) ------------------------------------------------------ */
.fab {
  --_elev: var(--shadow-3);
  position: absolute; inset-inline-end: var(--space-16); bottom: calc(var(--layout-phone-nav-h) + var(--space-16));
  height: 56px; min-width: 56px; padding-inline: var(--space-16); border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8);
  background: var(--accent); color: var(--on-accent); font-size: var(--fs-label); font-weight: var(--fw-label);
  box-shadow: var(--material-edge), var(--_elev); z-index: var(--z-sticky);
}
.fab .icon { width: 24px; height: 24px; }
.fab-spacer { height: 88px; flex: none; }    /* content always ends above the FAB (MOB-019) */

/* ---- J-06 Timer control ---------------------------------------------------- */
.timer-ctl { display: inline-flex; align-items: center; gap: var(--space-4); flex: none; font-variant-numeric: tabular-nums; }
.timer-ctl__time { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); min-width: 4.2ch; }
.timer-ctl.is-running .timer-ctl__time { color: var(--accent-text); font-weight: var(--fw-medium); }
.timer-ctl.is-running .icon-btn { color: var(--accent-text); }
.timer-ctl.is-over .timer-ctl__time { color: var(--warning-fg); }
.timer-ctl--default { gap: var(--space-8); }
.timer-ctl--hero { gap: var(--space-12); }
.timer-ctl--hero .timer-ctl__time { font-family: var(--font-ui); font-size: var(--fs-title-lg); line-height: var(--lh-title-lg); color: var(--text-primary); min-width: 6ch; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; animation: enj-pulse 1.6s var(--ease-standard) infinite; }
@keyframes enj-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---- J-07 Task completion check ------------------------------------------- */
.task-check {
  position: relative; flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  color: var(--on-task-done);
}
.task-check::before {
  content: ""; width: var(--task-check-size); height: var(--task-check-size); border-radius: 50%;
  box-shadow: inset 0 0 0 var(--bw-strong, 1.5px) var(--task-todo-border), inset 0 0 0 1.5px var(--task-todo-border);
  background: var(--surface-1); grid-area: 1/1; transition: background-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast);
}
.task-check .icon { grid-area: 1/1; width: 14px; height: 14px; stroke-width: 2.5; opacity: 0; transition: opacity var(--dur-fast); position: relative; z-index: 1; }
.task-check:hover::before { background: var(--task-done-bg); box-shadow: inset 0 0 0 2px var(--task-done-fg); }
.task-check:hover .icon { opacity: 1; color: var(--task-done-fg); }
.task-check[data-state="wip"]::before { background: conic-gradient(var(--task-inprogress-fg) 0 50%, var(--surface-1) 0) content-box; padding: 5px; box-shadow: inset 0 0 0 2px var(--task-inprogress-fg); }
.task-check[data-state="done"]::before { background: var(--task-done-solid); box-shadow: none; animation: enj-pop var(--dur-slow) var(--ease-emphasis); }
.task-check[data-state="done"] .icon { opacity: 1; color: var(--on-task-done); }
.task-check[data-state="auto"] { cursor: default; }
.task-check[data-state="auto"]::before { background: conic-gradient(var(--task-done-solid) 0 var(--p, 0%), var(--chart-track) 0); box-shadow: none; -webkit-mask: radial-gradient(circle, transparent 5px, #000 5.5px); mask: radial-gradient(circle, transparent 5px, #000 5.5px); }
.task-check[disabled] { cursor: not-allowed; }
.task-check[disabled]::before { box-shadow: inset 0 0 0 1.5px var(--text-disabled); background: var(--state-disabled-bg); }
.task-check--sm { width: 24px; height: 24px; --task-check-size: 16px; }
[data-platform="phone"] .task-check { width: 48px; height: 48px; --task-check-size: 24px; }

/* ---- J-08 Checkbox ---------------------------------------------------------- */
.checkbox { position: relative; flex: none; width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 4px;
  background: var(--surface-1); box-shadow: inset 0 0 0 1.5px var(--border-strong); color: var(--on-accent); }
.checkbox .icon { width: 13px; height: 13px; stroke-width: 3; opacity: 0; }
.checkbox[aria-checked="true"], .checkbox[aria-checked="mixed"] { background: var(--accent); box-shadow: none; }
.checkbox[aria-checked="true"] .icon { opacity: 1; }
.checkbox[aria-checked="mixed"]::after { content: ""; width: 9px; height: 2px; border-radius: 1px; background: var(--on-accent); grid-area: 1/1; }
.checkbox[aria-disabled="true"] { background: var(--state-disabled-bg); box-shadow: inset 0 0 0 1.5px var(--text-disabled); }
.checkbox.has-error { box-shadow: inset 0 0 0 2px var(--danger-border); }
.checkbox::before { content: ""; position: absolute; inset: -3px; }                   /* 24px target */
.check-field { display: flex; align-items: flex-start; gap: var(--space-8); min-height: var(--size-control-sm); padding-block: 5px; cursor: pointer; }
.check-field__text { display: flex; flex-direction: column; min-width: 0; }
.select-mark { width: 20px; height: 20px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--border-strong); display: grid; place-items: center; flex: none; color: var(--on-accent); background: var(--surface-1); }
.select-mark .icon { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.is-selected > .select-mark, .select-mark[aria-checked="true"] { background: var(--accent); box-shadow: none; }
.is-selected > .select-mark .icon, .select-mark[aria-checked="true"] .icon { opacity: 1; }
/* FIX-A11Y-DESIGN #11: a real 24×24 desktop click box around the unchanged 20 px drawing, absorbed by margins. */
[data-platform="desktop"] .select-mark { width: 24px; height: 24px; margin: -2px; position: relative; background: transparent; box-shadow: none; }
[data-platform="desktop"] .is-selected > .select-mark,
[data-platform="desktop"] .select-mark[aria-checked="true"],
[data-platform="desktop"] .select-mark[aria-checked="mixed"] { background: transparent; box-shadow: none; }
[data-platform="desktop"] .select-mark::before { content: ""; position: absolute; inset: 2px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--border-strong); background: var(--surface-1); }
[data-platform="desktop"] .select-mark .icon { position: relative; }
[data-platform="desktop"] .is-selected > .select-mark::before,
[data-platform="desktop"] .select-mark[aria-checked="true"]::before,
[data-platform="desktop"] .select-mark[aria-checked="mixed"]::before { background: var(--accent); box-shadow: none; }

/* ---- J-09 Switch ------------------------------------------------------------ */
.switch { position: relative; flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--surface-sunken);
  box-shadow: inset 0 0 0 1.5px var(--border-strong); transition: background-color var(--dur-fast) var(--ease-standard); }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-secondary); transition: inset-inline-start var(--dur-fast) var(--ease-standard), background-color var(--dur-fast); }
.switch[aria-checked="true"] { background: var(--accent); box-shadow: none; }
.switch[aria-checked="true"]::after { inset-inline-start: 19px; background: var(--on-accent); }
.switch[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.switch::before { content: ""; position: absolute; inset: -4px -2px; }
[data-platform="phone"] .switch { width: 44px; height: 24px; }
[data-platform="phone"] .switch::after { width: 18px; height: 18px; }
[data-platform="phone"] .switch[aria-checked="true"]::after { inset-inline-start: 23px; }

/* ---- J-10 Segmented control & radio group ---------------------------------- */
.segmented { display: inline-flex; flex: none; padding: 2px; gap: 2px; border-radius: calc(var(--control-radius) + 2px); background: var(--surface-sunken);
  box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); }
.segmented__opt { height: calc(var(--size-control-md) - 4px); padding-inline: var(--space-12); border-radius: var(--control-radius);
  display: inline-flex; align-items: center; gap: var(--space-6); font-size: var(--fs-label); font-weight: var(--fw-label); color: var(--text-secondary); white-space: nowrap; }
.segmented__opt .icon { width: 16px; height: 16px; }
.segmented__opt:hover { color: var(--text-primary); background: var(--state-hover); }
.segmented__opt[aria-checked="true"], .segmented__opt[aria-selected="true"] { background: var(--surface-1); color: var(--text-primary); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-strong), var(--shadow-1); }
.segmented--sm .segmented__opt { height: calc(var(--size-control-sm) - 4px); padding-inline: var(--space-8); }
.segmented--block { display: flex; width: 100%; }
.segmented--block .segmented__opt { flex: 1 1 0; justify-content: center; }
.radio-group { display: flex; flex-direction: column; gap: var(--space-4); }
.radio-opt { display: flex; align-items: flex-start; gap: var(--space-8); padding: var(--space-8); border-radius: var(--radius-control); cursor: pointer; text-align: start; }
.radio-opt:hover { background: var(--state-hover); }
.radio { width: 18px; height: 18px; border-radius: 50%; flex: none; margin-top: 1px; box-shadow: inset 0 0 0 1.5px var(--border-strong); background: var(--surface-1); display: grid; place-items: center; }
.radio-opt[aria-checked="true"] .radio { box-shadow: inset 0 0 0 5px var(--accent); }
.radio-opt[aria-checked="true"] { background: var(--state-selected-bg); }
.radio-card { --_bw: var(--bw-default); --_bc: var(--border-default); box-shadow: inset 0 0 0 var(--_bw) var(--_bc); border-radius: var(--radius-card); padding: var(--space-12); }
.radio-card[aria-checked="true"] { --_bw: 2px; --_bc: var(--accent-border); background: var(--state-selected-bg); }

/* ---- J-11 Filter / choice chips ------------------------------------------- */
.chip-group { display: flex; flex-wrap: wrap; gap: var(--space-6); }
.filter-chip { height: var(--size-control-sm); padding-inline: var(--space-12); border-radius: var(--radius-chip); display: inline-flex; align-items: center; gap: var(--space-6);
  font-size: var(--fs-label); font-weight: var(--fw-label); color: var(--text-primary); background: var(--surface-1); box-shadow: inset 0 0 0 var(--bw-default) var(--border-default); white-space: nowrap; flex: none; }
.filter-chip:hover { background-image: linear-gradient(var(--state-hover), var(--state-hover)); }
.filter-chip .icon { width: 14px; height: 14px; }
.filter-chip[aria-pressed="true"], .filter-chip[aria-checked="true"] { background: var(--state-selected-bg); color: var(--state-selected-fg); box-shadow: inset 0 0 0 var(--bw-default) var(--accent-border); }
.filter-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* ---- J-12 Tabs ---------------------------------------------------------------- */
.tabs { display: flex; gap: var(--space-4); box-shadow: inset 0 -1px 0 var(--border-subtle); min-width: 0; }
.tab { height: 36px; padding-inline: var(--space-12); display: inline-flex; align-items: center; gap: var(--space-6); flex: none;
  font-size: var(--fs-label); font-weight: var(--fw-label); color: var(--text-secondary); position: relative; border-radius: var(--control-radius) var(--control-radius) 0 0; }
.tab:hover { color: var(--text-primary); background: var(--state-hover); }
.tab[aria-selected="true"] { color: var(--accent-text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; inset-inline: var(--space-8); bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); }
.tab .count { margin-inline-start: 2px; }

/* ---- J-13 Colour swatch picker (user colour slots) ------------------------- */
.swatches { display: grid; grid-template-columns: repeat(7, 28px); gap: var(--space-8); }
.swatch { width: 28px; height: 28px; border-radius: 50%; position: relative; display: grid; place-items: center; background: var(--_c); color: var(--_on); }
.swatch .icon { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface-overlay), 0 0 0 4px var(--_c); }
.swatch[aria-checked="true"] .icon { opacity: 1; }
.swatch--none { background: var(--surface-1); box-shadow: inset 0 0 0 1.5px var(--border-strong); color: var(--text-secondary); }
.swatch--none::after { content: ""; position: absolute; width: 1.5px; height: 22px; background: var(--text-secondary); transform: rotate(45deg); }
.swatches--sm { grid-template-columns: repeat(12, 20px); gap: 6px; }
.swatches--sm .swatch { width: 20px; height: 20px; }
.swatches--sm .swatch::before { content: ""; position: absolute; inset: -2px; }

/* ---- J-14 Level picker (importance / urgency) ------------------------------ */
.level-picker { display: inline-grid; grid-template-columns: repeat(4, auto); padding: 2px; gap: 2px; border-radius: calc(var(--control-radius) + 2px); background: var(--surface-sunken); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); }
.level-picker__opt { height: calc(var(--size-control-md) - 4px); padding-inline: var(--space-12); border-radius: var(--control-radius); display: inline-flex; align-items: center; gap: var(--space-6);
  font-size: var(--fs-label); font-weight: var(--fw-label); color: var(--text-secondary); white-space: nowrap; }
.level-picker__opt:hover { background: var(--state-hover); color: var(--text-primary); }
.level-picker__opt[aria-checked="true"] { background: var(--surface-1); color: var(--text-primary); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-strong), var(--shadow-1); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; flex: none; }
.bars i { width: 3px; border-radius: 1px; background: var(--border-strong); }
.bars i:nth-child(1) { height: 5px; } .bars i:nth-child(2) { height: 8px; } .bars i:nth-child(3) { height: 12px; }
.bars[data-level="1"] i:nth-child(-n+1), .bars[data-level="2"] i:nth-child(-n+2), .bars[data-level="3"] i:nth-child(-n+3) { background: var(--text-primary); }

/* ---- J-15/16 Text field + field wrapper ------------------------------------- */
.input {
  --_bw: var(--bw-default); --_bc: var(--control-border);
  display: flex; align-items: center; gap: var(--space-6); height: var(--size-control-md); padding-inline: var(--space-8);
  border-radius: var(--control-radius); background: var(--control-bg); box-shadow: inset 0 0 0 var(--_bw) var(--_bc); min-width: 0; color: var(--text-primary);
  transition: box-shadow var(--dur-fast) var(--ease-standard);
}
.input > input, .input > textarea { flex: 1 1 0; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; padding: 0; font-size: var(--fs-body); line-height: var(--lh-body); }
.input > input::placeholder, .input > textarea::placeholder { color: var(--text-secondary); opacity: 1; }
.input > .icon { width: 16px; height: 16px; color: var(--text-secondary); }
.input:hover { --_bc: var(--text-secondary); }
.input:focus-within { --_bw: 2px; --_bc: var(--focus-ring); }
.input.has-error { --_bw: 2px; --_bc: var(--danger-border); }
.input.is-disabled { background: var(--state-disabled-bg); --_bc: var(--border-default); color: var(--state-disabled-fg); }
.input.is-readonly { background: var(--surface-sunken); --_bc: var(--border-default); }
.input--sm { height: var(--size-control-sm); }
.input--lg { height: var(--size-control-lg); padding-inline: var(--space-12); }
.input--subtle { background: var(--surface-sunken); --_bc: transparent; }
.input--subtle:hover { --_bc: var(--border-strong); }
.input--code > input { font-family: var(--font-mono); font-size: var(--fs-body-sm); direction: ltr; text-align: start; }
.input__affix { color: var(--text-secondary); font-size: var(--fs-body-sm); white-space: nowrap; flex: none; }
.field { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.field__label { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: var(--fw-label); color: var(--text-primary); display: flex; gap: var(--space-4); align-items: baseline; }
.field__opt { font-weight: var(--fw-regular); color: var(--text-secondary); }
.field__hint { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.field__count { margin-inline-start: auto; font-size: var(--fs-caption); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-16); padding-block: var(--space-12); min-height: 56px; }
.form-row + .form-row { box-shadow: inset 0 1px 0 var(--border-subtle); }
.form-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.form-row__label { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-medium); }
.form-row__desc { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); }
.form-row--stack { grid-template-columns: minmax(0, 1fr); align-items: start; gap: var(--space-8); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-8); }
.form-actions__start { margin-inline-end: auto; display: flex; gap: var(--space-8); }
[data-platform="phone"] .form-actions { flex-direction: column-reverse; align-items: stretch; }
[data-platform="phone"] .form-actions .btn { width: 100%; height: 48px; }
[data-platform="phone"] .form-actions__start { margin: 0; flex-direction: column; }

/* ---- J-17 Search field ---------------------------------------------------- */
.search-field .kbd { flex: none; }
.search-trigger {
  display: flex; align-items: center; gap: var(--space-8); height: 32px; padding-inline: var(--space-8) var(--space-6); border-radius: var(--control-radius);
  background: var(--surface-sunken); color: var(--text-secondary); font-size: var(--fs-body-sm); min-width: 0; width: 100%;
  box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default);
}
.search-trigger:hover { box-shadow: inset 0 0 0 var(--bw-default) var(--border-strong); color: var(--text-primary); }
.search-trigger .icon { width: 16px; height: 16px; }
.search-trigger__text { flex: 1 1 0; min-width: 0; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- J-18 Textarea ---------------------------------------------------------- */
.textarea { height: auto; align-items: stretch; padding: var(--space-8); }
.textarea > textarea { resize: none; min-height: 72px; }

/* ---- J-19 Number field ---------------------------------------------------- */
.number-field { padding-inline: 0; overflow: hidden; }
.number-field > input { text-align: center; font-variant-numeric: tabular-nums; width: 4ch; flex: 1 1 0; }
.number-field__step { width: 28px; height: 100%; display: grid; place-items: center; color: var(--text-secondary); flex: none; }
.number-field__step:hover { background: var(--state-hover); color: var(--text-primary); }
.number-field__step .icon { width: 14px; height: 14px; }

/* ---- J-20 Date & time picker ------------------------------------------------ */
.date-field { cursor: pointer; }
.date-field__value { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: start; }
.date-field__value.is-empty { color: var(--text-secondary); }
.cal-pop { width: 300px; padding: var(--space-12); display: flex; flex-direction: column; gap: var(--space-12); }
.cal-pop__quick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
.cal-pop__head { display: flex; align-items: center; gap: var(--space-4); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-grid__dow { font-size: var(--fs-caption); line-height: 24px; color: var(--text-secondary); }
.cal-grid__day { height: 36px; border-radius: var(--control-radius); font-size: var(--fs-body-sm); font-variant-numeric: tabular-nums; display: grid; place-items: center; color: var(--text-primary); }
.cal-grid__day:hover { background: var(--state-hover); }
.cal-grid__day.is-out { color: var(--text-secondary); }
.cal-grid__day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent-border); font-weight: var(--fw-semibold); }
.cal-grid__day[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }

/* ---- J-21 Select + listbox ------------------------------------------------- */
.select { cursor: pointer; justify-content: space-between; }
.select[disabled], .select[aria-disabled="true"] { background: var(--state-disabled-bg); color: var(--state-disabled-fg); --_bc: var(--border-default); cursor: not-allowed; }
.select__value { flex: 1 1 0; min-width: 0; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select > .icon:last-child { color: var(--text-secondary); }
.listbox { padding: var(--space-4); display: flex; flex-direction: column; gap: 1px; }
.option { min-height: var(--size-row-menu); padding-inline: var(--space-8); border-radius: calc(var(--control-radius) - 2px); display: flex; align-items: center; gap: var(--space-8); font-size: var(--fs-body); cursor: pointer; }
.option:hover, .option.is-active { background: var(--state-hover); }
.option[aria-selected="true"] { color: var(--accent-text); font-weight: var(--fw-medium); }
.option__check { width: 16px; height: 16px; margin-inline-start: auto; color: var(--accent-text); }
.option__meta { margin-inline-start: auto; color: var(--text-secondary); font-size: var(--fs-caption); }

/* ---- J-22 Combobox (tags, lists, people) ---------------------------------- */
.combobox { height: auto; min-height: var(--size-control-md); flex-wrap: wrap; padding-block: 3px; gap: var(--space-4); }
.combobox > input { min-width: 80px; height: 24px; }
.option--create { color: var(--accent-text); }

/* ---- J-23 Quick add ------------------------------------------------------------ */
.quick-add { --_bw: var(--bw-default); --_bc: var(--border-default);
  display: flex; flex-direction: column; border-radius: var(--radius-card); background: var(--surface-1); box-shadow: inset 0 0 0 var(--_bw) var(--_bc), var(--material-edge); }
.quick-add:focus-within { --_bw: 2px; --_bc: var(--focus-ring); }
.quick-add__row { display: flex; align-items: center; gap: var(--space-8); height: 44px; padding-inline: var(--space-8) var(--space-6); }
.quick-add__row > .icon { color: var(--accent-text); }
.quick-add__input { flex: 1 1 0; min-width: 0; border: 0; outline: 0; background: transparent; font-size: var(--fs-body); height: 100%; }
.quick-add__input::placeholder { color: var(--text-secondary); opacity: 1; }
.qa-preview { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-6); padding: var(--space-8) var(--space-12) var(--space-8); box-shadow: inset 0 1px 0 var(--border-subtle); min-height: 40px; }
.qa-preview__label { font-size: var(--fs-caption); color: var(--text-secondary); }
.qa-preview__title { font-size: var(--fs-body-sm); font-weight: var(--fw-medium); }
.qa-token { background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); border-radius: 3px; padding-inline: 1px; }
.quick-add--compact .quick-add__row { height: 36px; }
.quick-add--collapsed { background: transparent; --_bc: transparent; }
.quick-add--collapsed .quick-add__row { color: var(--text-secondary); }
.quick-add--collapsed:hover { background: var(--state-hover); }

/* ---- J-24 Inline edit ------------------------------------------------------ */
.inline-edit { display: inline-flex; align-items: center; gap: var(--space-4); min-width: 0; border-radius: 4px; padding-inline: 4px; margin-inline: -4px; }
.inline-edit:hover { background: var(--state-hover); }
.inline-edit__icon { opacity: 0; color: var(--text-secondary); }
.inline-edit:hover .inline-edit__icon, .inline-edit:focus-visible .inline-edit__icon { opacity: 1; }
.inline-edit-field { height: 28px; margin-inline: -4px; padding-inline: 4px; border-radius: 4px; background: var(--surface-1); box-shadow: inset 0 0 0 2px var(--focus-ring); }

/* ---- J-25 Password & code fields ------------------------------------------ */
.code-field { display: flex; gap: var(--space-8); direction: ltr; justify-content: center; }
.code-field__cell { width: 44px; height: 52px; border-radius: var(--control-radius); background: var(--control-bg); box-shadow: inset 0 0 0 var(--bw-default) var(--control-border);
  display: grid; place-items: center; font-size: var(--fs-title); font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); }
.code-field__cell.is-active { box-shadow: inset 0 0 0 2px var(--focus-ring); }
.code-field__cell.has-error { box-shadow: inset 0 0 0 2px var(--danger-border); }
.code-field__sep { align-self: center; width: 8px; height: 2px; background: var(--border-strong); }

/* ==========================================================================
   Enjazy 2 — component library · 03 overlays (J-26 … J-35) and display (J-36 … J-45)
   ========================================================================== */

/* ---- Scrim (a real token — MI-01) ------------------------------------------ */
.scrim { position: absolute; inset: 0; background: var(--scrim); z-index: var(--z-dialog); animation: enj-fade var(--dur-base) var(--ease-standard); }
.layer { position: absolute; inset: 0; z-index: var(--z-dialog); display: grid; place-items: center; padding: var(--space-24); pointer-events: none; }
.layer > * { pointer-events: auto; }
.layer--top { place-items: start center; padding-top: 12vh; }

/* ---- One overlay surface recipe ------------------------------------------ */
.overlay {
  --_bw: var(--bw-hairline); --_bc: var(--border-default); --_elev: var(--shadow-2);
  background-color: var(--overlay-bg); background-image: var(--material-panel-texture);
  -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop);
  box-shadow: inset 0 0 0 var(--_bw) var(--_bc), var(--material-edge), var(--_elev);
  border-radius: var(--radius-card); color: var(--text-primary);
}

/* ---- J-26 Dialog ------------------------------------------------------------ */
.dialog { --_elev: var(--shadow-3); width: min(var(--layout-dialog-md), 100%); max-height: min(720px, 100% - 48px); display: flex; flex-direction: column;
  border-radius: var(--radius-dialog); animation: enj-in var(--dur-base) var(--ease-enter); overflow: hidden; }
.dialog--sm { width: min(var(--layout-dialog-sm), 100%); }
.dialog--lg { width: min(var(--layout-dialog-lg), 100%); }
.dialog__header { display: flex; align-items: flex-start; gap: var(--space-12); padding: var(--space-20) var(--space-20) var(--space-12); }
.dialog__titles { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.dialog__title { font-family: var(--font-display); font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-title); letter-spacing: var(--tracking-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog__desc { color: var(--text-secondary); font-size: var(--fs-body); line-height: var(--lh-body); }
.dialog__body { padding: var(--space-4) var(--space-20) var(--space-20); overflow: auto; display: flex; flex-direction: column; gap: var(--space-16); min-height: 0; }
.dialog__footer { padding: var(--space-12) var(--space-20) var(--space-20); }
.dialog__footer--bar { box-shadow: inset 0 1px 0 var(--border-subtle); padding-top: var(--space-16); }
.dialog__icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.dialog__icon--danger { background: var(--danger-bg); color: var(--danger-fg); }
.dialog__icon--info { background: var(--info-bg); color: var(--info-fg); }
.consequences { display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-12); border-radius: var(--radius-control); background: var(--surface-sunken); }
.consequences li { display: flex; gap: var(--space-8); align-items: flex-start; font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.consequences li .icon { width: 16px; height: 16px; margin-top: 1px; flex: none; }
.consequences .is-kept .icon { color: var(--success-fg); }
.consequences .is-lost .icon { color: var(--danger-fg); }
[data-platform="phone"] .dialog { width: 100%; }

/* ---- J-28 Full-screen gate ------------------------------------------------- */
.gate { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--space-24); }
.gate__card { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: var(--space-16); text-align: center; padding: var(--space-32); border-radius: var(--radius-dialog); }
.gate__title { font-family: var(--font-display); font-size: var(--fs-title-lg); line-height: var(--lh-title-lg); font-weight: var(--fw-title); width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- J-30 Bottom sheet & action sheet ------------------------------------- */
.sheet { --_elev: var(--shadow-4); position: absolute; inset-inline: 0; bottom: 0; z-index: var(--z-dialog); max-height: calc(100% - 48px);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; display: flex; flex-direction: column; animation: enj-in var(--dur-slow) var(--ease-enter); padding-bottom: env(safe-area-inset-bottom); }
.sheet__handle { width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 8px auto 4px; flex: none; }
.sheet__header { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-4) var(--space-8) var(--space-8) var(--space-16); min-height: 52px; }
.sheet__title { flex: 1 1 0; min-width: 0; font-family: var(--font-display); font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet__body { padding: 0 var(--space-16) var(--space-16); overflow: auto; display: flex; flex-direction: column; gap: var(--space-12); }
.action-list { display: flex; flex-direction: column; }
.action-list__item { min-height: 56px; display: flex; align-items: center; gap: var(--space-16); padding-inline: var(--space-16); font-size: var(--fs-body); text-align: start; width: 100%; border-radius: var(--radius-control); }
.action-list__item:hover { background: var(--state-hover); }
.action-list__item .icon { width: 24px; height: 24px; color: var(--text-secondary); }
.action-list__item--danger, .action-list__item--danger .icon { color: var(--danger-fg); }
.action-list__sep { height: 1px; background: var(--border-subtle); margin: var(--space-4) var(--space-16); }

/* ---- J-31 Side panel ------------------------------------------------------- */
.side-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%;
  background-color: var(--panel-bg); background-image: var(--material-panel-texture); -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop);
  box-shadow: inset 1px 0 0 var(--border-subtle), var(--material-edge); }
[dir="rtl"] .side-panel { box-shadow: inset -1px 0 0 var(--border-subtle), var(--material-edge); }
.panel-header { display: flex; align-items: center; gap: var(--space-4); height: 48px; padding-inline: var(--space-12) var(--space-8); flex: none; box-shadow: inset 0 -1px 0 var(--border-subtle); }
.panel-header__title { flex: 1 1 0; min-width: 0; font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-body { flex: 1 1 0; min-height: 0; overflow: auto; }

/* ---- J-32 Popover ----------------------------------------------------------- */
.popover { position: absolute; z-index: var(--z-popover); animation: enj-in var(--dur-fast) var(--ease-enter); }
.popover__header { padding: var(--space-12) var(--space-12) 0; font-weight: var(--fw-semibold); }

/* ---- J-33 Menu & context menu -------------------------------------------- */
.menu { min-width: 220px; max-width: 320px; padding: var(--space-4); display: flex; flex-direction: column; border-radius: var(--radius-card); }
.menu-item { min-height: var(--size-row-menu); padding-inline: var(--space-8); display: flex; align-items: center; gap: var(--space-8); border-radius: calc(var(--radius-control) - 1px);
  font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-primary); text-align: start; width: 100%; white-space: nowrap; }
.menu-item > .icon { width: 16px; height: 16px; color: var(--text-secondary); }
.menu-item:hover, .menu-item.is-active { background: var(--state-hover); }
.menu-item__label { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.menu-item__hint { color: var(--text-secondary); font-size: var(--fs-caption); display: inline-flex; gap: 2px; flex: none; }
.menu-item--danger, .menu-item--danger > .icon { color: var(--danger-fg); }
.menu-item--danger:hover { background: var(--danger-bg); }
.menu-item[aria-disabled="true"] { color: var(--text-disabled); cursor: not-allowed; }
.menu-item[aria-disabled="true"] > .icon { color: var(--text-disabled); }
.menu-item[aria-disabled="true"]:hover { background: none; }
.menu-item__check { width: 16px; height: 16px; flex: none; color: var(--accent-text); }
.menu-item[aria-checked="false"] .menu-item__check { visibility: hidden; }
.menu-label { padding: var(--space-8) var(--space-8) var(--space-4); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); font-weight: var(--fw-medium); }
.menu-sep { height: 1px; margin: var(--space-4) var(--space-4); background: var(--border-subtle); flex: none; }
.menu-item__sub { width: 16px; height: 16px; color: var(--text-secondary); }
[data-platform="phone"] .menu-item { min-height: 48px; }

/* ---- J-34 Command palette / global search -------------------------------- */
.palette { --_elev: var(--shadow-4); width: min(640px, 100%); max-height: min(560px, 76vh); display: flex; flex-direction: column; border-radius: var(--radius-dialog); overflow: hidden; }
.palette__input { display: flex; align-items: center; gap: var(--space-12); height: 56px; padding-inline: var(--space-16); box-shadow: inset 0 -1px 0 var(--border-subtle); flex: none; }
.palette__input input { flex: 1 1 0; min-width: 0; border: 0; outline: 0; background: none; font-size: var(--fs-body-lg); }
.palette__input input::placeholder { color: var(--text-secondary); opacity: 1; }
.palette__scopes { display: flex; gap: var(--space-6); padding: var(--space-8) var(--space-12); box-shadow: inset 0 -1px 0 var(--border-subtle); flex: none; }
.palette__results { overflow: auto; padding: var(--space-4) var(--space-8) var(--space-8); }
.palette__group { padding: var(--space-8) var(--space-8) var(--space-4); font-size: var(--fs-caption); color: var(--text-secondary); font-weight: var(--fw-medium); display: flex; gap: var(--space-8); }
.palette__footer { display: flex; align-items: center; gap: var(--space-16); height: 36px; padding-inline: var(--space-16); box-shadow: inset 0 1px 0 var(--border-subtle); color: var(--text-secondary); font-size: var(--fs-caption); flex: none; }
.palette__footer span { display: inline-flex; align-items: center; gap: var(--space-4); }

/* ---- J-53 List item / result row ------------------------------------------ */
.list-item { min-height: var(--size-row-list); padding-inline: var(--space-8); display: flex; align-items: center; gap: var(--space-12); border-radius: var(--radius-control); width: 100%; text-align: start; }
.list-item:hover, .list-item.is-active { background: var(--state-hover); }
.list-item.is-active { box-shadow: inset 0 0 0 1px var(--border-default); }
.list-item__icon { width: 28px; height: 28px; border-radius: var(--radius-control); display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-secondary); flex: none; }
.list-item__icon .icon { width: 16px; height: 16px; }
.list-item__text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.list-item__primary { font-size: var(--fs-body); line-height: var(--lh-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item__secondary { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item__trail { display: flex; align-items: center; gap: var(--space-6); color: var(--text-secondary); font-size: var(--fs-caption); flex: none; }
.list-item mark { background: none; color: var(--accent-text); font-weight: var(--fw-semibold); }

/* ---- J-35 Tooltip ------------------------------------------------------------ */
.tooltip { position: absolute; z-index: var(--z-tooltip); display: inline-flex; align-items: center; gap: var(--space-8); max-width: 280px; padding: 6px var(--space-8);
  border-radius: 6px; background: var(--tooltip-bg); color: var(--tooltip-fg); font-size: var(--fs-caption); line-height: var(--lh-caption); box-shadow: var(--shadow-2); white-space: nowrap; }
.tooltip .kbd { background: transparent; color: var(--tooltip-fg); box-shadow: inset 0 0 0 1px currentColor; opacity: .85; }
.info-tip { width: 20px; height: 20px; display: inline-grid; place-items: center; color: var(--text-secondary); border-radius: 50%; }
.info-tip .icon { width: 14px; height: 14px; }

/* ---- J-36 Priority indicator ------------------------------------------------ */
.prio { display: inline-flex; align-items: center; gap: var(--space-4); flex: none; color: var(--prio-none); }
.prio .icon { width: 16px; height: 16px; }
.prio[data-q="do"] { color: var(--prio-do); }
.prio[data-q="schedule"] { color: var(--prio-schedule); }
.prio[data-q="delegate"] { color: var(--prio-delegate); }
.prio[data-q="drop"] { color: var(--prio-drop); }
.prio[data-q="none"] .icon { opacity: .9; }
.prio__label { font-size: var(--fs-label); font-weight: var(--fw-label); }
.prio[data-q="do"] .prio__label { color: var(--prio-do-fg); }
.prio[data-q="schedule"] .prio__label { color: var(--prio-schedule-fg); }
.prio[data-q="delegate"] .prio__label { color: var(--prio-delegate-fg); }
.prio[data-q="drop"] .prio__label, .prio[data-q="none"] .prio__label { color: var(--text-secondary); }
.prio--pill { height: 24px; padding-inline: var(--space-6) var(--space-8); border-radius: var(--radius-chip); }
.prio--pill[data-q="do"] { background: var(--prio-do-bg); }
.prio--pill[data-q="schedule"] { background: var(--prio-schedule-bg); }
.prio--pill[data-q="delegate"] { background: var(--prio-delegate-bg); }
.prio--pill[data-q="drop"] { background: var(--prio-drop-bg); }
.prio--pill[data-q="none"] { box-shadow: inset 0 0 0 1px var(--border-default); }
.prio-slot { width: 16px; height: 16px; flex: none; }

/* ---- J-37 Badge & metadata chips ------------------------------------------ */
.badge { height: 20px; padding-inline: var(--space-6); border-radius: var(--radius-chip); display: inline-flex; align-items: center; gap: 4px; flex: none; max-width: 100%;
  font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: var(--fw-medium); white-space: nowrap; color: var(--text-secondary); background: var(--surface-sunken); }
.badge .icon { width: 12px; height: 12px; stroke-width: calc(var(--icon-stroke) + .25); }
.badge--md { height: 24px; padding-inline: var(--space-8); font-size: var(--fs-label-sm); }
.badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border-default); }
.badge--accent { background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); }
.badge--success { background: var(--success-bg); color: var(--success-fg); }
.badge--warning { background: var(--warning-bg); color: var(--warning-fg); }
.badge--danger { background: var(--danger-bg); color: var(--danger-fg); }
.badge--info { background: var(--info-bg); color: var(--info-fg); }
.badge--solid-accent { background: var(--accent); color: var(--on-accent); }
.badge__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.badge__x { width: 16px; height: 16px; margin-inline-end: -4px; display: grid; place-items: center; border-radius: 3px; position: relative; }
.badge__x::before { content: ""; position: absolute; inset: -4px; }
/* FIX-A11Y-DESIGN #3: parsed-token keep-text controls only; unrelated tag removers retain their design. */
.qa-preview .badge__x { width: 24px; height: 24px; flex: none; margin-inline: -4px -8px; }
.qa-preview .badge__x::before { inset: 0; }
.badge__x:hover { background: var(--state-hover); }
.badge__x .icon { width: 12px; height: 12px; }
/* facts that don't fit wrap onto a hidden second line: whole facts drop, never half a fact */
.meta { display: flex; align-items: center; flex-wrap: wrap; column-gap: var(--space-8); row-gap: 8px; min-width: 0; height: var(--lh-caption); overflow: hidden; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); white-space: nowrap; }
.meta__item { display: inline-flex; align-items: center; gap: 4px; flex: none; min-width: 0; }
.meta__item .icon { width: 12px; height: 12px; stroke-width: calc(var(--icon-stroke) + .25); }
.meta__item--shrink { flex: 0 1 auto; overflow: hidden; max-width: 160px; }
.meta__item--shrink > span { overflow: hidden; text-overflow: ellipsis; }
.meta__item.is-overdue { color: var(--task-overdue-fg); font-weight: var(--fw-medium); }
.meta__item.is-today { color: var(--accent-text); font-weight: var(--fw-medium); }
.meta__item.is-done { color: var(--task-done-fg); }
.meta__item.is-recurring { color: var(--task-recurring-fg); }
.meta__sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--_c, var(--border-strong)); }
.dot--sm { width: 6px; height: 6px; }
.dot--lg { width: 10px; height: 10px; }
.chip-list { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.tag-chip { color: var(--text-secondary); }
.tag-chip::before { content: "#"; opacity: .8; }

/* ---- J-38 Count badge ------------------------------------------------------ */
.count { min-width: 20px; height: 18px; padding-inline: 5px; border-radius: 9px; display: inline-grid; place-items: center; flex: none;
  font-size: var(--fs-caption); line-height: 1; font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; color: var(--text-secondary); background: var(--surface-sunken); }
.count--accent { background: var(--accent); color: var(--on-accent); }
.count--danger { background: var(--danger-bg); color: var(--danger-fg); }

/* ---- J-40 Keycap ------------------------------------------------------------ */
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding-inline: 5px; border-radius: 4px; direction: ltr; unicode-bidi: isolate;
  font-family: var(--font-ui); font-size: var(--fs-caption); line-height: 1; font-weight: var(--fw-medium); color: var(--text-secondary);
  background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--border-default), inset 0 -1px 0 var(--border-default); flex: none; }
.kbd-combo { display: inline-flex; gap: 3px; direction: ltr; unicode-bidi: isolate; flex: none; }

/* ---- J-41 Avatar ---------------------------------------------------------------- */
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  font-size: var(--fs-caption); font-weight: var(--fw-semibold); background: var(--_c, var(--slot-indigo)); color: var(--_on, var(--slot-indigo-on)); }
.avatar--sm { width: 22px; height: 22px; font-size: 10px; }
.avatar--lg { width: 40px; height: 40px; font-size: var(--fs-label); }
.avatar-group { display: inline-flex; }
.avatar-group .avatar { box-shadow: 0 0 0 2px var(--surface-1); }
.avatar-group .avatar + .avatar { margin-inline-start: -6px; }

/* ---- J-43 Linear progress ---------------------------------------------------- */
.progress { height: 6px; border-radius: 3px; background: var(--chart-track); overflow: hidden; display: flex; flex: 1 1 auto; min-width: 24px; }
.progress__fill { height: 100%; width: var(--v, 0%); background: var(--accent); border-radius: inherit; }
.progress--sm { height: 4px; }
.progress--success .progress__fill { background: var(--task-done-solid); }
.progress--over .progress__fill { background: var(--warning-fg); }
.progress--stack .progress__fill { border-radius: 0; }

/* ---- J-44 Progress ring (distinct from the spinner: has a track, a value, no motion) ---- */
.ring { --size: 16px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(var(--_rc, var(--task-done-solid)) 0 var(--v, 0%), var(--chart-track) 0);
  -webkit-mask: radial-gradient(circle, transparent calc(var(--size) / 2 - 3px), #000 calc(var(--size) / 2 - 2.5px)); mask: radial-gradient(circle, transparent calc(var(--size) / 2 - 3px), #000 calc(var(--size) / 2 - 2.5px)); }
.ring--lg { --size: 44px; -webkit-mask: radial-gradient(circle, transparent 17px, #000 17.5px); mask: radial-gradient(circle, transparent 17px, #000 17.5px); }
.ring-wrap { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring-wrap__label { position: absolute; font-size: var(--fs-caption); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }

/* ---- J-45 Stat tile & charts ------------------------------------------------- */
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat__label { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat__value { font-family: var(--font-display); font-size: var(--fs-title-lg); line-height: var(--lh-title-lg); font-weight: var(--fw-title); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat__delta { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); display: inline-flex; gap: 4px; align-items: center; }
.stat__delta.is-good { color: var(--success-fg); }
.stat__delta.is-bad { color: var(--danger-fg); }
.chart { display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
.chart svg { overflow: visible; }
.chart__grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart__axis { fill: var(--chart-axis); font-size: 11px; font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.chart__legend { display: flex; flex-wrap: wrap; gap: var(--space-12); font-size: var(--fs-caption); color: var(--text-secondary); }
.chart__legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart__legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--_c); }
.bar { fill: var(--chart-1); }
.bar.is-today { fill: var(--accent); }
.bar--track { fill: var(--chart-track); }

/* ==========================================================================
   Enjazy 2 — component library · 04 task item (J-46 … J-51), structure (J-52 … J-61),
   feedback (J-62 … J-66)
   ONE task item: same facts, same order, density rules decide what shows (04-patterns/task-item.md).
   ========================================================================== */

/* ---- J-46 Task row ---------------------------------------------------------- */
.task-row {
  --depth: 0;
  position: relative; display: grid; align-items: center; column-gap: var(--space-4);
  grid-template-columns: 16px 20px 32px 16px minmax(0, 1fr) auto;
  grid-template-areas: "handle toggle check prio main trail";
  height: var(--task-row-height); padding-inline: var(--space-4) var(--space-8);
  padding-inline-start: calc(var(--space-4) + var(--depth) * 24px);
  border-radius: var(--radius-control); color: var(--text-primary); cursor: default;
  transition: background-color var(--dur-fast) var(--ease-standard);
}
.task-row:hover { background: var(--state-hover); }
.task-row:focus-visible { outline-offset: -2px; }
.task-row__handle { grid-area: handle; width: 16px; height: 24px; display: grid; place-items: center; color: var(--text-secondary); opacity: 0; cursor: grab; }
.task-row__handle .icon { width: 14px; height: 14px; }
.task-row:hover .task-row__handle, .task-row:focus-within .task-row__handle { opacity: 1; }
.task-row__toggle { grid-area: toggle; }
.task-row .task-check { grid-area: check; }
.task-row .prio { grid-area: prio; }
.task-row__main { grid-area: main; display: flex; flex-direction: column; justify-content: center; min-width: 0; gap: 1px; cursor: pointer; }
.task-row__title { font-size: var(--fs-body); line-height: var(--lh-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-row__trail { grid-area: trail; display: flex; align-items: center; gap: var(--space-4); }
.task-row.is-selected { background: var(--state-selected-bg); }
.task-row.is-selected::before { content: ""; position: absolute; inset-block: 8px; inset-inline-start: 0; width: 3px; border-radius: 2px; background: var(--state-selected-border); }
.task-row.is-done .task-row__title { color: var(--text-secondary); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.task-row.is-dragging { background: var(--surface-overlay); box-shadow: var(--shadow-3), inset 0 0 0 1px var(--border-default); opacity: .96; z-index: 2; }
.task-row.is-drop-into { box-shadow: inset 0 0 0 2px var(--accent-border); background: var(--accent-subtle-bg); }
.task-row.is-bulk { grid-template-columns: 16px 20px 32px 16px minmax(0, 1fr) auto; }
.task-row.is-bulk .task-row__handle { opacity: 1; cursor: default; }
.task-row.is-locked .task-row__title { color: var(--text-secondary); }
.drop-line { position: absolute; inset-inline: var(--space-8) 0; height: 2px; border-radius: 1px; background: var(--accent); z-index: 3; pointer-events: none; }
.drop-line::before { content: ""; position: absolute; inset-inline-start: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface-1); }
.drop-line--before { top: -1px; } .drop-line--after { bottom: -1px; }
.drop-zone { height: 36px; margin: var(--space-4) var(--space-8); border-radius: var(--radius-control); display: grid; place-items: center; font-size: var(--fs-caption); color: var(--accent-text);
  box-shadow: inset 0 0 0 1.5px var(--accent-border); background: var(--accent-subtle-bg); }
.drop-zone.is-invalid { color: var(--danger-fg); box-shadow: inset 0 0 0 1.5px var(--danger-border); background: var(--danger-bg); }
.task-row--compact { --task-row-height: var(--size-row-task-compact); grid-template-columns: 0 16px 24px 16px minmax(0, 1fr) auto; column-gap: var(--space-2); }
.task-row--compact .task-row__main { flex-direction: row; align-items: center; gap: var(--space-8); }
.task-row--compact .task-row__title { flex: 1 1 auto; font-size: var(--fs-body-sm); }
.task-row--compact .meta { flex: 0 0 auto; }
.task-row--compact .task-check { width: 24px; height: 24px; --task-check-size: 16px; }
[data-platform="phone"] .task-row { grid-template-columns: 0 20px 48px 16px minmax(0, 1fr) auto; column-gap: var(--space-4); padding-inline-end: var(--space-4); }
[data-platform="phone"] .task-row__handle { display: none; }
[data-platform="phone"] .task-row__title { font-size: var(--fs-body); }
[data-platform="phone"] .task-row__trail .icon-btn { width: 40px; height: 40px; }
.tree-toggle { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 4px; color: var(--text-secondary); position: relative; }
.tree-toggle::before { content: ""; position: absolute; inset: -2px; }
.tree-toggle:hover { background: var(--state-hover); color: var(--text-primary); }
.tree-toggle .icon { width: 14px; height: 14px; }
.subtask-progress { display: inline-flex; align-items: center; gap: 4px; }

/* ---- J-47 Task card (board, matrix) ---------------------------------------- */
.task-card {
  --_bw: var(--bw-hairline); --_bc: var(--border-default); --_elev: var(--shadow-1);
  display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-8) var(--space-8) var(--space-8) var(--space-4);
  border-radius: var(--radius-card); background-color: var(--surface-raised); background-image: var(--material-panel-texture);
  box-shadow: inset 0 0 0 var(--_bw) var(--_bc), var(--material-edge), var(--_elev); min-width: 0; position: relative; cursor: pointer;
}
.task-card:hover { --_bc: var(--border-strong); }
.task-card__top { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: start; column-gap: var(--space-2); }
.task-card__top .task-check { margin-top: -4px; }
.task-card__title { font-size: var(--fs-body); line-height: var(--lh-body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: calc(var(--lh-body) * 2); padding-top: 2px; }
.task-card__meta { display: flex; align-items: center; gap: var(--space-8); padding-inline-start: 34px; min-width: 0; height: 20px; }
.task-card.is-selected { --_bw: 2px; --_bc: var(--state-selected-border); background-color: var(--state-selected-bg); }
.task-card.is-done .task-card__title { color: var(--text-secondary); text-decoration: line-through; }
.task-card.is-dragging { --_elev: var(--shadow-4); transform: rotate(1.5deg); }
[dir="rtl"] .task-card.is-dragging { transform: rotate(-1.5deg); }

/* ---- J-48 Task chip (calendar) ------------------------------------------- */
.task-chip { text-align: start; height: 24px; display: flex; align-items: center; gap: 4px; padding-inline: 4px 6px; border-radius: 5px; min-width: 0; width: 100%;
  font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-primary); background: var(--surface-sunken); position: relative; overflow: hidden; cursor: pointer; }
.task-chip:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.task-chip__edge { width: 3px; align-self: stretch; margin-block: 4px; border-radius: 2px; background: var(--_c, var(--border-strong)); flex: none; }
.task-chip__time { color: var(--text-secondary); font-variant-numeric: tabular-nums; flex: none; }
.task-chip__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 0; }
.task-chip .icon { width: 12px; height: 12px; flex: none; }
.task-chip.is-done { color: var(--text-secondary); }
.task-chip.is-done .task-chip__title { text-decoration: line-through; }
.task-chip.is-overdue { background: var(--task-overdue-bg); color: var(--task-overdue-fg); }
.task-chip.is-selected { box-shadow: inset 0 0 0 2px var(--state-selected-border); }
.task-chip--span { border-radius: 0; }
.task-chip--span.is-start { border-start-start-radius: 5px; border-end-start-radius: 5px; }
.task-chip--span.is-end { border-start-end-radius: 5px; border-end-end-radius: 5px; }
.more-link { height: 24px; flex-shrink: 0; font-size: var(--fs-caption); color: var(--text-link); padding-inline: 6px; border-radius: 4px; text-align: start; }
.more-link:hover { background: var(--state-hover); }

/* ---- J-49 Task bar (timeline / Gantt) ------------------------------------- */
.task-bar { position: absolute; height: 24px; border-radius: 6px; display: flex; align-items: center; gap: 6px; padding-inline: 8px; min-width: 24px;
  background: var(--_t, var(--surface-sunken)); color: var(--_tf, var(--text-primary)); box-shadow: inset 0 0 0 1.5px var(--_c, var(--border-strong)); font-size: var(--fs-caption); white-space: nowrap; overflow: hidden; cursor: pointer; }
.task-bar__label { overflow: hidden; text-overflow: ellipsis; }
.task-bar.is-done { opacity: 1; background: var(--surface-1); color: var(--text-secondary); box-shadow: inset 0 0 0 1.5px var(--border-default); }
.task-bar.is-done .task-bar__label { text-decoration: line-through; }
.task-bar.is-overdue { box-shadow: inset 0 0 0 2px var(--danger-border); }
.task-bar.is-selected { box-shadow: inset 0 0 0 2px var(--state-selected-border), var(--shadow-2); }
.task-bar__progress { position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--v, 0%); background: var(--_c); opacity: .25; pointer-events: none; }
.task-bar__outside { position: absolute; font-size: var(--fs-caption); color: var(--text-secondary); white-space: nowrap; }
.milestone { position: absolute; width: 14px; height: 14px; transform: rotate(45deg); border-radius: 3px; background: var(--_c, var(--accent)); }

/* ---- J-50 Activity item ---------------------------------------------------- */
.activity-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; column-gap: var(--space-12); align-items: start; padding: var(--space-8) var(--space-8); border-radius: var(--radius-control); }
.activity-item:hover { background: var(--state-hover); }
.activity-item__icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-secondary); }
.activity-item__icon .icon { width: 16px; height: 16px; }
.activity-item__text { font-size: var(--fs-body); line-height: var(--lh-body); min-width: 0; }
.activity-item__task { color: var(--text-link); font-weight: var(--fw-medium); }
.activity-item__sub { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); margin-top: 2px; }
.activity-item__time { font-size: var(--fs-caption); color: var(--text-secondary); white-space: nowrap; padding-top: 3px; font-variant-numeric: tabular-nums; }
.change { display: inline-flex; gap: 6px; align-items: center; }
.change del { color: var(--text-secondary); }
.change ins { text-decoration: none; font-weight: var(--fw-medium); }

/* ---- J-51 Timer bar (phone, docked) & timer widget (window) -------------- */
.timer-bar { display: flex; align-items: center; gap: var(--space-12); height: 56px; padding-inline: var(--space-16) var(--space-8); background: var(--accent-subtle-bg); color: var(--accent-subtle-fg);
  box-shadow: inset 0 1px 0 var(--accent-border); flex: none; }
.timer-bar__text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.timer-bar__task { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-bar__time { font-size: var(--fs-label); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }

/* ---- J-52 Navigation row (projects, lists, smart lists) ------------------ */
.nav-row {
  position: relative; display: flex; align-items: center; gap: var(--space-8); height: var(--nav-row-height); padding-inline: var(--space-8) var(--space-4);
  border-radius: var(--radius-control); color: var(--text-primary); font-size: var(--fs-body); line-height: var(--lh-body); cursor: pointer; min-width: 0;
}
.nav-row:hover { background: var(--state-hover); }
.nav-row:focus-visible { outline-offset: -2px; }
.nav-row__lead { width: 20px; height: 20px; display: grid; place-items: center; flex: none; color: var(--text-secondary); }
.nav-row__lead .icon { width: 16px; height: 16px; }
.nav-row__name { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-row__meta { display: flex; align-items: center; gap: var(--space-4); flex: none; color: var(--text-secondary); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.nav-row__meta .icon { width: 14px; height: 14px; }
.nav-row__meta .is-overdue { color: var(--task-overdue-fg); font-weight: var(--fw-medium); }
.nav-row .icon-btn { width: 24px; height: 24px; }
.nav-row .icon-btn .icon { width: 16px; height: 16px; }
.nav-row[aria-current="true"], .nav-row.is-selected { background: var(--state-selected-bg); color: var(--state-selected-fg); font-weight: var(--fw-medium); }
.nav-row[aria-current="true"]::before, .nav-row.is-selected::before { content: ""; position: absolute; inset-block: 6px; inset-inline-start: 0; width: 3px; border-radius: 2px; background: var(--state-selected-border); }
.nav-row[aria-current="true"] .nav-row__lead { color: var(--state-selected-fg); }
.nav-row.is-locked .nav-row__name { color: var(--text-secondary); }
.nav-row--sub { padding-inline-start: 32px; }

/* ---- J-54 Breadcrumb & app bar ------------------------------------------ */
.breadcrumb { display: flex; align-items: center; gap: 2px; min-width: 0; font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); }
.breadcrumb a, .breadcrumb button { color: var(--text-secondary); text-decoration: none; border-radius: 4px; padding-inline: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.breadcrumb a:hover, .breadcrumb button:hover { color: var(--text-primary); background: var(--state-hover); }
.breadcrumb .icon { width: 14px; height: 14px; flex: none; }
.breadcrumb [aria-current="page"] { color: var(--text-primary); font-weight: var(--fw-medium); padding-inline: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar { display: flex; align-items: center; gap: var(--space-4); height: var(--layout-phone-appbar-h); padding-inline: var(--space-4) var(--space-8); flex: none;
  background-color: var(--surface-2); background-image: var(--material-panel-texture); -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop); box-shadow: inset 0 -1px 0 var(--border-subtle); }
.app-bar__titles { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; padding-inline: var(--space-8); }
.app-bar__title { font-family: var(--font-display); font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-title); letter-spacing: var(--tracking-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar__sub { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- J-55 Page header (view template) ----------------------------------- */
.page-header { display: flex; flex-direction: column; gap: var(--space-12); padding: var(--space-16) var(--space-24) var(--space-12); flex: none; }
.page-header__row { display: flex; align-items: center; gap: var(--space-8); min-width: 0; min-height: 32px; }
.page-header__title { flex: 1 1 0; min-width: 0; }
.page-header__sub { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); white-space: nowrap; }
.scope-chip { height: 28px; display: inline-flex; align-items: center; gap: var(--space-6); padding-inline: var(--space-8) var(--space-6); border-radius: var(--radius-chip); flex: none;
  font-size: var(--fs-label); font-weight: var(--fw-label); background: var(--surface-1); box-shadow: inset 0 0 0 var(--bw-default) var(--border-default); color: var(--text-primary); max-width: 280px; }
.scope-chip:hover { box-shadow: inset 0 0 0 var(--bw-default) var(--border-strong); }
.scope-chip .icon { width: 16px; height: 16px; color: var(--text-secondary); }
.scope-chip__label { color: var(--text-secondary); font-weight: var(--fw-regular); }
.scope-chip__value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-chip.is-scoped { background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); box-shadow: inset 0 0 0 var(--bw-default) var(--accent-border); }
.scope-chip.is-scoped .icon, .scope-chip.is-scoped .scope-chip__label { color: var(--accent-subtle-fg); }

/* ---- J-56 Section header ----------------------------------------------- */
.section-header { display: flex; align-items: center; gap: var(--space-8); min-height: 32px; min-width: 0; }
.section-header__title { flex: 0 1 auto; }
.section-header--overline { min-height: 28px; }
.section-header--overline .section-header__title { font-family: var(--font-ui); font-size: var(--fs-label); line-height: var(--lh-label); font-weight: var(--fw-semibold); color: var(--text-secondary); letter-spacing: 0; }
.section-header__action { margin-inline-start: auto; }

/* ---- J-57 Card ------------------------------------------------------------ */
.card { --_bw: var(--bw-hairline); --_bc: var(--border-default); --_elev: 0 0 0 0 transparent;
  border-radius: var(--radius-card); background-color: var(--surface-raised); background-image: var(--material-panel-texture);
  -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop);
  box-shadow: inset 0 0 0 var(--_bw) var(--_bc), var(--material-edge), var(--_elev); min-width: 0; }
.card--elevated { --_elev: var(--shadow-1); }
.card--subtle { background-color: var(--surface-2); --_bc: transparent; }
.card--pad-sm { padding: var(--space-12); } .card--pad { padding: var(--space-16); } .card--pad-lg { padding: var(--space-24); }
.card__header { display: flex; align-items: center; gap: var(--space-8); min-height: 28px; margin-bottom: var(--space-12); }
.card__header .t-heading { flex: 1 1 0; }
.card--interactive { cursor: pointer; }
.card--interactive:hover { --_bc: var(--border-strong); }
.card--selected { --_bw: 2px; --_bc: var(--accent-border); }

/* ---- J-58 Disclosure ------------------------------------------------------ */
.disclosure__trigger { display: flex; align-items: center; gap: var(--space-8); width: 100%; min-height: 36px; padding-inline: var(--space-4); border-radius: var(--radius-control); text-align: start; }
.disclosure__trigger:hover { background: var(--state-hover); }
.disclosure__trigger .icon { width: 16px; height: 16px; color: var(--text-secondary); }

/* ---- J-59 Drag handle (grip-only drag, WS-047) --------------------------- */
.drag-handle { width: 16px; height: 24px; display: grid; place-items: center; color: var(--text-secondary); cursor: grab; flex: none; border-radius: 3px; }
.drag-handle .icon { width: 14px; height: 14px; }
.drag-handle:hover { background: var(--state-hover); color: var(--text-primary); }

/* ---- J-60 Selection bar ---------------------------------------------------- */
.selection-bar { --_elev: var(--shadow-3); display: flex; align-items: center; gap: var(--space-8); height: 52px; padding-inline: var(--space-8) var(--space-12);
  border-radius: var(--radius-card); background-color: var(--surface-overlay); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default), var(--material-edge), var(--_elev); }
.selection-bar__count { font-weight: var(--fw-semibold); font-size: var(--fs-label); white-space: nowrap; }

/* ---- J-61 Title bar & secondary-window chrome ---------------------------- */
.titlebar { display: flex; align-items: center; gap: var(--space-8); height: var(--layout-titlebar-h); padding-inline-start: var(--space-12); flex: none; position: relative; z-index: var(--z-nav);
  background-color: var(--surface-2); background-image: var(--material-panel-texture); -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop);
  box-shadow: inset 0 -1px 0 var(--border-subtle), var(--material-edge); -webkit-app-region: drag; }
.titlebar button, .titlebar input, .titlebar [role="button"] { -webkit-app-region: no-drag; }
.titlebar--web { padding-inline-end: var(--space-12); }
.brand { display: inline-flex; align-items: center; gap: var(--space-8); flex: none; font-weight: var(--fw-semibold); font-size: var(--fs-body); color: var(--text-primary); text-decoration: none; }
.brand__mark { width: 24px; height: 24px; flex: none; }
.win-controls { display: flex; align-self: stretch; flex: none; direction: ltr; }       /* caption buttons follow the OS, not the UI language (NAV-032) */
.win-btn { width: 46px; display: grid; place-items: center; color: var(--text-primary); }
.win-btn .icon { width: 14px; height: 14px; stroke-width: 1.25; }
.win-btn:hover { background: var(--state-hover); }
.win-btn--close:hover { background: var(--danger-solid); color: var(--on-danger); }
.win-chrome { display: flex; align-items: center; gap: var(--space-4); height: 36px; padding-inline: var(--space-8) 0; flex: none;
  background-color: var(--surface-2); box-shadow: inset 0 -1px 0 var(--border-subtle); -webkit-app-region: drag; }
.win-chrome button { -webkit-app-region: no-drag; }
.win-chrome__title { flex: 1 1 0; min-width: 0; font-size: var(--fs-label); font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: var(--space-6); }
.win-chrome .icon-btn { width: 32px; height: 32px; border-radius: 0; }
.win-chrome .icon-btn--close:hover { background: var(--danger-solid); color: var(--on-danger); }
.win-chrome.is-unfocused { background-color: var(--surface-1); }
.win-chrome.is-unfocused .win-chrome__title { color: var(--text-secondary); }

/* ---- J-62 Empty state ------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-8); padding: var(--space-32) var(--space-24); margin-inline: auto; width: min(420px, 100%); }
.empty__art { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); margin-bottom: var(--space-8); }
.empty__art .icon { width: 26px; height: 26px; }
.empty__title { font-family: var(--font-ui); font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: var(--fw-heading); width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty__body { color: var(--text-secondary); font-size: var(--fs-body); line-height: var(--lh-body); }
.empty__actions { display: flex; gap: var(--space-8); margin-top: var(--space-8); flex-wrap: wrap; justify-content: center; }
.empty--inline { flex-direction: row; text-align: start; padding: var(--space-12); gap: var(--space-12); width: 100%; }
.empty--inline .empty__art { width: 36px; height: 36px; margin: 0; }
.empty--inline .empty__art .icon { width: 18px; height: 18px; }
.empty--inline .empty__title { font-size: var(--fs-body); }
.empty--filtered .empty__art { background: var(--surface-sunken); color: var(--text-secondary); }
.empty--error .empty__art { background: var(--danger-bg); color: var(--danger-fg); }
.empty--offline .empty__art { background: var(--warning-bg); color: var(--warning-fg); }
.empty--locked .empty__art { background: var(--surface-sunken); color: var(--text-primary); }

/* ---- J-63 Banner & callout ------------------------------------------------ */
.banner { display: flex; align-items: center; gap: var(--space-12); min-height: 44px; padding: var(--space-8) var(--space-8) var(--space-8) var(--space-16); flex: none;
  font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); background: var(--info-bg); color: var(--text-primary); box-shadow: inset 0 -1px 0 var(--info-border); }
.banner > .icon { color: var(--info-fg); width: 18px; height: 18px; }
.banner__text { flex: 1 1 0; min-width: 0; }
.banner--warning { background: var(--warning-bg); box-shadow: inset 0 -1px 0 var(--warning-border); } .banner--warning > .icon { color: var(--warning-fg); }
.banner--danger { background: var(--danger-bg); box-shadow: inset 0 -1px 0 var(--danger-border); } .banner--danger > .icon { color: var(--danger-fg); }
.banner--success { background: var(--success-bg); box-shadow: inset 0 -1px 0 var(--success-border); } .banner--success > .icon { color: var(--success-fg); }
.callout { display: flex; gap: var(--space-12); padding: var(--space-12); border-radius: var(--radius-control); background: var(--info-bg); box-shadow: inset 0 0 0 1px var(--info-border); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.callout > .icon { color: var(--info-fg); width: 18px; height: 18px; margin-top: 1px; }
.callout__title { font-weight: var(--fw-semibold); font-size: var(--fs-body-sm); }
.callout--warning { background: var(--warning-bg); box-shadow: inset 0 0 0 1px var(--warning-border); } .callout--warning > .icon { color: var(--warning-fg); }
.callout--danger { background: var(--danger-bg); box-shadow: inset 0 0 0 1px var(--danger-border); } .callout--danger > .icon { color: var(--danger-fg); }
.callout--success { background: var(--success-bg); box-shadow: inset 0 0 0 1px var(--success-border); } .callout--success > .icon { color: var(--success-fg); }
.callout--neutral { background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--border-default); } .callout--neutral > .icon { color: var(--text-secondary); }
.callout--plan { background: var(--accent-subtle-bg); box-shadow: inset 0 0 0 1px var(--accent-border); } .callout--plan > .icon { color: var(--accent-subtle-fg); }

/* ---- J-64 Inline message -------------------------------------------------- */
.inline-msg { display: flex; align-items: flex-start; gap: var(--space-6); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.inline-msg .icon { width: 14px; height: 14px; margin-top: 1px; flex: none; }
.inline-msg--error { color: var(--danger-fg); } .inline-msg--success { color: var(--success-fg); } .inline-msg--info { color: var(--info-fg); } .inline-msg--warning { color: var(--warning-fg); }

/* ---- J-65 Toast (with Undo) ---------------------------------------------- */
.toast-region { position: absolute; inset-inline: 0; bottom: var(--space-24); z-index: var(--z-toast); display: flex; flex-direction: column; align-items: center; gap: var(--space-8); pointer-events: none; padding-inline: var(--space-16); }
[data-platform="phone"] .toast-region { bottom: calc(var(--layout-phone-nav-h) + 88px); }
.toast { --_elev: var(--shadow-3); pointer-events: auto; display: flex; align-items: center; gap: var(--space-12); min-height: 48px; width: min(480px, 100%); padding: var(--space-6) var(--space-6) var(--space-6) var(--space-16);
  border-radius: var(--radius-card); background-color: var(--surface-overlay); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default), var(--material-edge), var(--_elev);
  -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop); animation: enj-in var(--dur-base) var(--ease-enter); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.toast > .icon { width: 18px; height: 18px; }
.toast__text { flex: 1 1 0; min-width: 0; }
.toast--success > .icon { color: var(--success-fg); } .toast--error > .icon { color: var(--danger-fg); } .toast--info > .icon { color: var(--info-fg); } .toast--warning > .icon { color: var(--warning-fg); }
.toast--error { box-shadow: inset 0 0 0 1px var(--danger-border), var(--_elev); }
.toast .btn { height: 32px; }
.toast__timer { position: absolute; inset-inline: 12px; bottom: 3px; height: 2px; border-radius: 1px; background: var(--chart-track); overflow: hidden; }
.toast__timer::after { content: ""; display: block; height: 100%; width: 60%; background: var(--text-secondary); }
.toast { position: relative; }

/* ---- J-66 Spinner, skeleton, loader, sync status ------------------------- */
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--chart-track); border-top-color: var(--accent); animation: enj-spin .8s linear infinite; flex: none; }
.spinner--lg { width: 32px; height: 32px; border-width: 3px; }
.skeleton { background: linear-gradient(90deg, var(--surface-sunken) 0%, var(--surface-3) 50%, var(--surface-sunken) 100%); background-size: 200% 100%; animation: enj-shimmer 1.4s ease-in-out infinite; border-radius: 4px; }
@keyframes enj-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
[data-reduce-motion="reduce"] .skeleton { animation: none; }
.skeleton-row { display: grid; grid-template-columns: 20px 18px minmax(0, 1fr) 60px; align-items: center; gap: var(--space-12); height: var(--task-row-height); padding-inline: var(--space-24) var(--space-12); }
.skeleton-row .sk-check { width: 18px; height: 18px; border-radius: 50%; }
.skeleton-row .sk-line { height: 10px; }
.sync-status { display: inline-flex; align-items: center; gap: var(--space-6); height: 28px; padding-inline: var(--space-8); border-radius: var(--radius-chip); font-size: var(--fs-label); font-weight: var(--fw-label); color: var(--text-secondary); flex: none; white-space: nowrap; }
.sync-status:hover { background: var(--state-hover); color: var(--text-primary); }
.sync-status .icon { width: 16px; height: 16px; }
.sync-status[data-state="synced"] .icon { color: var(--success-fg); }
.sync-status[data-state="syncing"] .icon { color: var(--accent-text); animation: enj-spin 1.2s linear infinite; }
.sync-status[data-state="pending"] .icon { color: var(--warning-fg); }
.sync-status[data-state="offline"] { color: var(--text-primary); background: var(--warning-bg); }
.sync-status[data-state="offline"] .icon { color: var(--warning-fg); }
.sync-status[data-state="error"] { color: var(--danger-fg); background: var(--danger-bg); }
.sync-status[data-state="local"] .icon { color: var(--text-secondary); }
.app-loader { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); background-image: var(--material-texture), var(--material-app-bg); }
.app-loader__inner { display: flex; flex-direction: column; align-items: center; gap: var(--space-16); width: 280px; }
.app-loader__mark { width: 72px; height: 72px; }

/* ==========================================================================
   Enjazy 2 — layouts · app shell (D-001), navigation (D-002), view template (D-050),
   workspace (D-020), phone shell (D-070), secondary windows (D-080). Structure only.
   ========================================================================== */

.app { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; isolation: isolate;
  background-color: var(--bg); background-image: var(--material-texture), var(--material-app-bg); }
.app-main { flex: 1 1 0; min-height: 0; display: flex; }
.app-content { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.app-panel { width: var(--layout-panel-w); flex: none; min-height: 0; position: relative; z-index: var(--z-panel); }
.app-panel--wide { width: var(--layout-panel-w-wide); }

/* ---- title bar content ---- */
.titlebar__brand { width: calc(var(--layout-nav-w) - var(--space-12)); display: flex; align-items: center; gap: var(--space-4); flex: none; }
.app.is-rail .titlebar__brand { width: calc(var(--layout-nav-w-rail) + 8px); }
.titlebar__history { display: flex; gap: 2px; flex: none; }
.titlebar__search { flex: 1 1 0; display: flex; justify-content: center; min-width: 0; }
.titlebar__search .search-trigger { max-width: 520px; }
.titlebar__tools { display: flex; align-items: center; gap: var(--space-4); flex: none; }
.acct-btn { display: inline-flex; align-items: center; gap: var(--space-6); height: 32px; padding-inline: 2px var(--space-6); border-radius: 999px; flex: none; }
.acct-btn:hover { background: var(--state-hover); }
.acct-btn .icon { width: 14px; height: 14px; color: var(--text-secondary); }
.source-btn { display: inline-flex; align-items: center; gap: var(--space-6); height: 28px; padding-inline: var(--space-8); border-radius: var(--radius-chip); flex: none; font-size: var(--fs-label); color: var(--text-secondary); white-space: nowrap; }
.source-btn:hover { background: var(--state-hover); color: var(--text-primary); }
.source-btn .icon { width: 16px; height: 16px; }

/* ---- D-002 labelled primary navigation (never icon-only) ---- */
.sidenav { width: var(--layout-nav-w); flex: none; display: flex; flex-direction: column; min-height: 0; padding: var(--space-8);
  background-color: var(--surface-2); background-image: var(--material-panel-texture); -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop);
  box-shadow: inset -1px 0 0 var(--border-subtle); position: relative; z-index: var(--z-nav); }
[dir="rtl"] .sidenav { box-shadow: inset 1px 0 0 var(--border-subtle); }
.sidenav__scroll { flex: 1 1 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--space-16); }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group__label { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); font-weight: var(--fw-medium); padding: var(--space-4) var(--space-8) var(--space-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item { position: relative; display: flex; align-items: center; gap: var(--space-12); height: 36px; padding-inline: var(--space-8); border-radius: var(--radius-control);
  color: var(--text-primary); font-size: var(--fs-body); line-height: var(--lh-body); width: 100%; text-align: start; }
.nav-item > .icon { width: 20px; height: 20px; color: var(--text-secondary); }
.nav-item:hover { background: var(--state-hover); }
.nav-item[aria-current="page"] { background: var(--state-selected-bg); color: var(--state-selected-fg); font-weight: var(--fw-medium); }
.nav-item[aria-current="page"] > .icon { color: var(--state-selected-fg); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; inset-block: 8px; inset-inline-start: 0; width: 3px; border-radius: 2px; background: var(--state-selected-border); }
.nav-item__label { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item__end { display: flex; align-items: center; gap: var(--space-4); flex: none; }
.nav-item__end .icon { width: 14px; height: 14px; color: var(--text-secondary); }
.nav-item.is-gated .nav-item__label { color: var(--text-secondary); }
.sidenav__foot { display: flex; flex-direction: column; gap: 1px; padding-top: var(--space-8); box-shadow: inset 0 1px 0 var(--border-subtle); }
/* Collapsed rail keeps labels (small, under the icon) — icon-only navigation is not allowed. */
.app.is-rail .sidenav { width: var(--layout-nav-w-rail); padding-inline: var(--space-4); }
.app.is-rail .nav-group__label { visibility: hidden; height: 4px; padding: 0; }
.app.is-rail .nav-item { flex-direction: column; height: auto; min-height: 52px; gap: 2px; justify-content: center; padding-inline: 2px; padding-block: 6px; }
/* Arabic rail names («مساحة العمل», «لوحة المعلومات») may wrap to two 12 px lines rather than being abbreviated (CR-22). */
.app.is-rail .nav-item__label { flex: none; width: 100%; text-align: center; font-size: var(--fs-caption); line-height: var(--lh-caption); white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.app.is-rail .nav-item__end { position: absolute; top: 4px; inset-inline-end: 6px; }
.app.is-rail .nav-item__end .kbd, .app.is-rail .nav-item__end .icon { display: none; }

/* ---- D-050 view template ---- */
.view { flex: 1 1 0; min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.view-body { flex: 1 1 0; min-height: 0; overflow: auto; position: relative; }
.view-body--pad { padding: 0 var(--space-24) var(--space-24); }
.view-toolbar { display: flex; align-items: center; gap: var(--space-8); min-width: 0; min-height: 32px; }
.date-nav { display: flex; align-items: center; gap: var(--space-4); flex: none; }
.date-nav__label { font-weight: var(--fw-semibold); font-size: var(--fs-body); white-space: nowrap; min-width: 0; padding-inline: var(--space-8); }

/* ---- D-020 workspace ---- */
.ws { flex: 1 1 0; min-height: 0; display: flex; }
.ws-nav { width: var(--layout-lists-w); flex: none; display: flex; flex-direction: column; min-height: 0;
  background-color: var(--surface-2); background-image: var(--material-panel-texture); -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop);
  box-shadow: inset -1px 0 0 var(--border-subtle); }
[dir="rtl"] .ws-nav { box-shadow: inset 1px 0 0 var(--border-subtle); }
.ws-nav__head { display: flex; align-items: center; gap: var(--space-4); height: 48px; padding-inline: var(--space-12) var(--space-8); flex: none; }
.ws-nav__scroll { flex: 1 1 0; min-height: 0; overflow: auto; padding: 0 var(--space-8) var(--space-12); display: flex; flex-direction: column; gap: var(--space-12); }
.ws-section { display: flex; flex-direction: column; gap: 1px; }
.ws-section__head { display: flex; align-items: center; gap: var(--space-4); height: 32px; padding-inline: var(--space-4) 0; }
.ws-section__head .t-label { color: var(--text-secondary); font-weight: var(--fw-semibold); flex: 1 1 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-list { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column;
  background-color: var(--surface-1); background-image: var(--material-panel-texture); -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop); }
.ws-list__head { padding: var(--space-16) var(--space-24) var(--space-8); display: flex; flex-direction: column; gap: var(--space-8); flex: none; }
.ws-list__qa { padding: 0 var(--space-24) var(--space-8); flex: none; }
.ws-list__body { flex: 1 1 0; min-height: 0; overflow: auto; padding: 0 var(--space-16) var(--space-24); position: relative; }
.ws-list__foot { padding: 0 var(--space-16) var(--space-16); flex: none; }
.group-head { display: flex; align-items: center; gap: var(--space-8); height: 36px; padding-inline: var(--space-8); position: sticky; top: 0; z-index: 1;
  background-color: var(--surface-1); font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text-secondary); }
.group-head .count { margin-inline-start: 2px; }
.group-head .t-heading { color: var(--text-primary); }

/* ---- settings layout ---- */
.settings { flex: 1 1 0; min-height: 0; display: flex; }
.settings-nav { width: 248px; flex: none; padding: var(--space-16) var(--space-8); overflow: auto; display: flex; flex-direction: column; gap: var(--space-12);
  background-color: var(--surface-2); box-shadow: inset -1px 0 0 var(--border-subtle); }
[dir="rtl"] .settings-nav { box-shadow: inset 1px 0 0 var(--border-subtle); }
.settings-body { flex: 1 1 0; min-width: 0; overflow: auto; background-color: var(--surface-1); background-image: var(--material-panel-texture); }
.settings-page { max-width: 760px; padding: var(--space-24) var(--space-32) var(--space-48); display: flex; flex-direction: column; gap: var(--space-24); }
.settings-section { display: flex; flex-direction: column; gap: var(--space-4); }
.settings-group { --_bw: var(--bw-hairline); --_bc: var(--border-default); border-radius: var(--radius-card); padding-inline: var(--space-16); background: var(--surface-raised); box-shadow: inset 0 0 0 var(--_bw) var(--_bc), var(--material-edge); }

/* ---- phone shell (D-070) ---- */
.phone { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; isolation: isolate;
  background-color: var(--bg); background-image: var(--material-texture), var(--material-app-bg); }
.os-status { height: 24px; flex: none; display: flex; align-items: center; justify-content: space-between; padding-inline: 16px; font-size: 12px; font-weight: 500; color: var(--text-primary); direction: ltr; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.os-status__icons { display: flex; gap: 6px; align-items: center; }
.os-status__icons i { display: block; width: 14px; height: 9px; border-radius: 2px; background: currentColor; opacity: .85; }
.os-gesture { height: 20px; flex: none; display: grid; place-items: center; background: var(--surface-2); }
.os-gesture::after { content: ""; width: 108px; height: 4px; border-radius: 2px; background: var(--text-primary); opacity: .7; }
.phone-body { flex: 1 1 0; min-height: 0; overflow: auto; position: relative; background-color: var(--surface-1); background-image: var(--material-panel-texture); }
.phone-body--pad { padding: var(--space-8) var(--space-16) var(--space-16); }
.bottom-nav { height: var(--layout-phone-nav-h); flex: none; display: grid; grid-template-columns: repeat(5, 1fr); padding-inline: var(--space-4);
  background-color: var(--surface-2); background-image: var(--material-panel-texture); -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop); box-shadow: inset 0 1px 0 var(--border-subtle); }
.bottom-nav__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.bottom-nav__pill { width: 56px; height: 30px; border-radius: 15px; display: grid; place-items: center; }
.bottom-nav__pill .icon { width: 22px; height: 22px; }
.bottom-nav__label { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-inline: 2px; }
.bottom-nav__item[aria-current="page"] { color: var(--text-primary); font-weight: var(--fw-semibold); }
.bottom-nav__item[aria-current="page"] .bottom-nav__pill { background: var(--state-selected-bg); color: var(--state-selected-fg); }
.phone .toast-region { bottom: calc(var(--layout-phone-nav-h) + 20px + 76px); }
.phone .scrim, .phone .sheet { position: absolute; }
.phone-section { display: flex; flex-direction: column; gap: 2px; }
.phone-section__head { display: flex; align-items: center; gap: var(--space-8); min-height: 40px; padding-inline: var(--space-4); }
.phone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.tile-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-8); height: 88px; border-radius: var(--radius-card); background: var(--surface-raised);
  box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default), var(--material-edge); font-size: var(--fs-label); padding: var(--space-8); text-align: center; }
.tile-btn .icon { width: 24px; height: 24px; color: var(--accent-text); }

/* ---- secondary windows (D-080…D-083) ---- */
.win { position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; isolation: isolate;
  background-color: var(--surface-1); background-image: var(--material-panel-texture); border-radius: var(--radius-window);
  box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default), var(--shadow-3); }
.win-body { flex: 1 1 0; min-height: 0; overflow: auto; position: relative; }
.sticky { background-color: var(--_tint); color: var(--_tintfg); }
.sticky .win-chrome { background-color: transparent; box-shadow: inset 0 -1px 0 var(--_tintb); }
.sticky .win-chrome__title, .sticky .win-chrome .icon-btn { color: var(--_tintfg); }
.sticky .task-row { color: var(--_tintfg); }
.sticky .task-row:hover { background: var(--state-hover); }
.sticky .meta { color: var(--_tintfg); opacity: 1; }
.sticky .quick-add { background: var(--surface-1); }
.desktop-canvas { position: relative; height: 100%; overflow: hidden; background: linear-gradient(135deg, #2b3a55 0%, #3d5a73 45%, #6b7f8e 100%); }
[data-mode="light"] .desktop-canvas { background: linear-gradient(135deg, #9fb3c8 0%, #c9d6df 50%, #e4e9ed 100%); }
.os-taskbar { position: absolute; inset-inline: 0; bottom: 0; height: 40px; background: rgba(20, 24, 32, .82); display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-inline: 12px; direction: ltr; color: #fff; font-size: 12px; }

/* ---- web-only helpers ---- */
.page-center { min-height: 100%; display: grid; place-items: center; padding: var(--space-24); }
.content-max { max-width: var(--layout-content-max); width: 100%; margin-inline: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-16); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-16); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-16); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-body-sm); }
.table th { text-align: start; font-weight: var(--fw-semibold); color: var(--text-secondary); font-size: var(--fs-label); height: 36px; padding-inline: var(--space-12); box-shadow: inset 0 -1px 0 var(--border-default); white-space: nowrap; }
.table td { height: 44px; padding-inline: var(--space-12); box-shadow: inset 0 -1px 0 var(--border-subtle); }
.table tr:hover td { background: var(--state-hover); }

/* ---- skip link: first focusable element, visible on focus ---- */
.skip-link { position: absolute; inset-inline-start: 12px; top: -48px; z-index: var(--z-tooltip); padding: 8px 12px; border-radius: var(--radius-control);
  background: var(--surface-overlay); color: var(--text-link); font-weight: var(--fw-semibold); box-shadow: var(--shadow-3), inset 0 0 0 2px var(--focus-ring); text-decoration: underline; }
.skip-link:focus, .skip-link.is-visible { top: 8px; }
.app.is-rail .titlebar__brand .brand { display: none; }
/* ---- print layout (dashboard) ---- */
.print-page { background: #fff; color: #111; padding: 48px; min-height: 100%; }

/* side panel resize handle (360–640px, remembered; arrow keys resize by 16px) */
.app-panel__resize { position: absolute; inset-block: 0; inset-inline-start: -3px; width: 6px; cursor: col-resize; z-index: 2; }
.app-panel__resize:hover, .app-panel__resize:focus-visible { background: var(--accent); opacity: 1; }
.app-panel__resize:focus-visible { outline: none; }

/* ==========================================================================
   Enjazy 2 — composed patterns · task editor (D-041…D-049), Upcoming buckets, views helpers
   ========================================================================== */

/* ---- task editor ---- */
.editor__body { padding: var(--space-12) var(--space-16) var(--space-24); display: flex; flex-direction: column; gap: var(--space-12); scroll-padding-top: 48px; }
.editor__body > *, .panel-body > *, .ws-nav__scroll > *, .sidenav__scroll > *, .sheet__body > *, .dialog__body > * { flex-shrink: 0; }
.editor-title { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.editor-title .task-check { margin-top: 2px; }
.editor-title__input { width: 100%; border: 0; resize: none; background: transparent; outline: none; padding: 4px 6px; margin-inline-start: -6px; border-radius: var(--radius-control);
  font-family: var(--font-display); font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-title); letter-spacing: var(--tracking-display); height: calc(var(--lh-title) * 2 + 8px); overflow: hidden; }
.editor-title__input:hover { background: var(--state-hover); }
.editor-title__input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0; background: var(--surface-1); }
.jump-bar { position: sticky; top: calc(var(--space-12) * -1); z-index: 2; display: flex; gap: var(--space-4); padding: var(--space-6) 0; margin-inline: calc(var(--space-16) * -1); padding-inline: var(--space-16);
  background: var(--panel-bg); box-shadow: inset 0 -1px 0 var(--border-subtle); overflow-x: auto; margin-inline-start: calc(var(--space-16) * -1 + 1px); }
.jump-bar__link { height: 28px; padding-inline: var(--space-8); border-radius: var(--radius-chip); display: inline-flex; align-items: center; font-size: var(--fs-label); color: var(--text-secondary); text-decoration: none; white-space: nowrap; flex: none; }
.jump-bar__link:hover { background: var(--state-hover); color: var(--text-primary); }
.jump-bar__link.is-current { background: var(--state-selected-bg); color: var(--state-selected-fg); font-weight: var(--fw-medium); }
.editor-card { --_bw: var(--bw-hairline); --_bc: var(--border-default); display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-12); border-radius: var(--radius-card);
  background-color: var(--surface-raised); box-shadow: inset 0 0 0 var(--_bw) var(--_bc), var(--material-edge); scroll-margin-top: 48px; }
.prop { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; column-gap: var(--space-8); min-height: 36px; }
.prop--top { align-items: start; }
.prop--top .prop__label { padding-top: 6px; }
.prop__label { display: flex; align-items: center; gap: var(--space-6); color: var(--text-secondary); font-size: var(--fs-label); line-height: var(--lh-label); min-width: 0; }
.prop__label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop__value { min-width: 0; display: flex; align-items: center; gap: var(--space-6); }
.prop__value > .input, .prop__value > .select, .prop__value > .date-field { width: 100%; height: var(--size-control-sm); }
.prop__value .segmented__opt, .prop__value .level-picker__opt { padding-inline: var(--space-8); }
.prop--block { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-8); }
.prop--block .prop__label { padding-top: 6px; }
.prio-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: var(--space-8); }
.prio-row .level-picker { justify-self: start; }
.prio-row .level-picker__opt { height: 26px; padding-inline: 8px; font-size: var(--fs-caption); gap: 4px; }
.mini-matrix { display: grid; grid-template-columns: auto 1fr 1fr; grid-template-rows: auto 1fr 1fr; gap: 2px; margin-top: 2px; font-size: var(--fs-caption); }
.mini-matrix__axis { color: var(--text-secondary); font-size: 11px; line-height: 14px; }
.mini-matrix__axis--x { grid-column: 2; grid-row: 1; }
.mini-matrix__axis--x2 { grid-column: 3; grid-row: 1; }
.mini-matrix__axis--y { grid-column: 1; grid-row: 2; align-self: center; padding-inline-end: 6px; }
.mini-matrix__axis--y2 { grid-column: 1; grid-row: 3; align-self: center; padding-inline-end: 6px; }
.mini-matrix__cell { display: flex; align-items: center; gap: 6px; height: 28px; padding-inline: 6px; border-radius: 4px; background: var(--surface-sunken); color: var(--text-secondary); white-space: nowrap; overflow: hidden; }
.mini-matrix__cell[data-q="do"] { grid-column: 2; grid-row: 2; } .mini-matrix__cell[data-q="schedule"] { grid-column: 3; grid-row: 2; }
.mini-matrix__cell[data-q="delegate"] { grid-column: 2; grid-row: 3; } .mini-matrix__cell[data-q="drop"] { grid-column: 3; grid-row: 3; }
.mini-matrix__cell.is-on { background: var(--state-selected-bg); color: var(--text-primary); font-weight: var(--fw-medium); box-shadow: inset 0 0 0 1.5px var(--state-selected-border); }
.mini-matrix .prio .icon { width: 14px; height: 14px; }
.save-status { display: inline-flex; align-items: center; gap: var(--space-4); font-size: var(--fs-caption); color: var(--text-secondary); white-space: nowrap; flex: none; padding-inline: 4px; }
.save-status .icon { color: var(--success-fg); }
.save-status.is-error { color: var(--danger-fg); }
.save-status.is-error .icon { color: var(--danger-fg); }
.save-status .spinner { width: 12px; height: 12px; border-width: 2px; }
.comment { display: flex; flex-direction: column; gap: 4px; }
.change-line { display: flex; align-items: center; gap: var(--space-6); color: var(--text-secondary); }
.change-line .t-caption:first-of-type { color: var(--text-primary); flex: 1 1 auto; min-width: 0; }
.comment-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-8); align-items: end; }
.comment-composer .textarea > textarea { min-height: 24px; }
.file-row { display: flex; align-items: center; gap: var(--space-8); padding: 6px var(--space-4); border-radius: var(--radius-control); color: var(--text-secondary); }
.file-row:hover { background: var(--state-hover); }
.file-row .t-body-sm { color: var(--text-primary); }
.ai-suggest { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-8); border-radius: var(--radius-control); background: var(--accent-subtle-bg); }
.editor-actions { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-8) var(--space-12); box-shadow: inset 0 1px 0 var(--border-subtle); background: var(--surface-2); flex: none; }

/* ---- Upcoming buckets (D-055) ---- */
.bucket { display: flex; flex-direction: column; }
.bucket__head { display: flex; align-items: center; gap: var(--space-8); height: 40px; padding-inline: var(--space-8); width: 100%; text-align: start; border-radius: var(--radius-control); position: sticky; top: 0; z-index: 1; background: var(--surface-1); }
.bucket__head:hover { background-image: linear-gradient(var(--state-hover), var(--state-hover)); }
.bucket__head .t-heading { flex: 0 1 auto; }
.bucket__head .icon { color: var(--text-secondary); width: 16px; height: 16px; }
.bucket--overdue .bucket__head .t-heading { color: var(--danger-fg); }

/* ---- view surfaces ---- */
.view-surface { background-color: var(--surface-1); background-image: var(--material-panel-texture); -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr); gap: var(--space-12); height: 100%; padding: 0 var(--space-24) var(--space-24); overflow-x: auto; }
.board-col { display: flex; flex-direction: column; min-height: 0; border-radius: var(--radius-card); background: var(--surface-2); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-subtle); }
.board-col__head { display: flex; align-items: center; gap: var(--space-8); height: 44px; padding-inline: var(--space-12) var(--space-8); flex: none; }
.board-col__head .t-heading { flex: 0 1 auto; }
.board-col__body { flex: 1 1 0; min-height: 0; overflow: auto; padding: 0 var(--space-8) var(--space-8); display: flex; flex-direction: column; gap: var(--space-8); }
.board-col.is-drop { box-shadow: inset 0 0 0 2px var(--accent-border); background: var(--accent-subtle-bg); }
.cal { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); box-shadow: inset 0 -1px 0 var(--border-default); }
.cal-head__day { height: 32px; display: flex; align-items: center; padding-inline: var(--space-8); font-size: var(--fs-label); color: var(--text-secondary); font-weight: var(--fw-medium); }
.cal-month { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
.cal-cell { position: relative; min-width: 0; padding: 4px; display: flex; flex-direction: column; gap: 2px; box-shadow: inset -1px -1px 0 var(--border-subtle); overflow: hidden; }
[dir="rtl"] .cal-cell { box-shadow: inset 1px -1px 0 var(--border-subtle); }
.cal-cell.is-out { background: var(--surface-2); }
.cal-cell.is-out .cal-cell__num { color: var(--text-secondary); }
.cal-cell__top { display: flex; align-items: center; justify-content: space-between; height: 24px; }
.cal-cell__num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-label); font-variant-numeric: tabular-nums; }
.cal-cell.is-today .cal-cell__num { background: var(--accent); color: var(--on-accent); font-weight: var(--fw-semibold); }
.cal-cell__add { opacity: 0; }
.cal-cell:hover .cal-cell__add, .cal-cell:focus-within .cal-cell__add { opacity: 1; }
.cal-cell.is-weekend { background: var(--surface-2); }
.cal-cell > .task-chip, .cal-cell > .cal-drop { flex-shrink: 0; min-height: 24px; }
.gantt { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: 100%; min-height: 0; }
.gantt__labels { box-shadow: inset -1px 0 0 var(--border-default); overflow: hidden; }
[dir="rtl"] .gantt__labels { box-shadow: inset 1px 0 0 var(--border-default); }
.gantt__scale { height: 48px; display: flex; flex-direction: column; box-shadow: inset 0 -1px 0 var(--border-default); }
.gantt__row { height: 40px; display: flex; align-items: center; gap: var(--space-8); padding-inline: var(--space-12); box-shadow: inset 0 -1px 0 var(--border-subtle); font-size: var(--fs-body-sm); min-width: 0; }
.gantt__group { height: 36px; display: flex; align-items: center; gap: var(--space-8); padding-inline: var(--space-12); font-weight: var(--fw-semibold); font-size: var(--fs-label); background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--border-subtle); }
.gantt__canvas { position: relative; overflow: hidden; }
.gantt__today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 2; }
.gantt__today::before { content: attr(data-label); position: absolute; top: 2px; inset-inline-start: 4px; font-size: 11px; color: var(--accent-text); font-weight: 600; white-space: nowrap; }
.gantt__canvas .task-bar__outside { z-index: 3; }
.matrix { display: grid; grid-template-columns: 92px 1fr 1fr; grid-template-rows: 32px 1fr 1fr; gap: var(--space-12); height: 100%; min-height: 0; padding: 0 var(--space-24) var(--space-24); }
.matrix__axis { display: flex; align-items: center; justify-content: center; font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text-secondary); gap: 6px; }
.matrix__axis--y { justify-content: flex-end; text-align: end; padding-inline-end: 4px; white-space: normal; line-height: 18px; }
.quad { display: flex; flex-direction: column; min-height: 0; border-radius: var(--radius-card); background: var(--surface-1); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default), var(--material-edge); overflow: hidden; }
.quad__head { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-12) var(--space-12) var(--space-8); flex: none; }
.quad__head .t-heading { flex: 0 1 auto; }
.quad__hint { font-size: var(--fs-caption); color: var(--text-secondary); padding: 0 var(--space-12) var(--space-8); }
.quad__body { flex: 1 1 0; overflow: auto; padding: 0 var(--space-8) var(--space-8); display: flex; flex-direction: column; gap: 2px; }
.quad[data-q="do"] { box-shadow: inset 0 3px 0 var(--prio-do), inset 0 0 0 var(--bw-hairline) var(--border-default); }
.quad[data-q="schedule"] { box-shadow: inset 0 3px 0 var(--prio-schedule), inset 0 0 0 var(--bw-hairline) var(--border-default); }
.quad[data-q="delegate"] { box-shadow: inset 0 3px 0 var(--prio-delegate), inset 0 0 0 var(--bw-hairline) var(--border-default); }
.quad[data-q="drop"] { box-shadow: inset 0 3px 0 var(--prio-drop), inset 0 0 0 var(--bw-hairline) var(--border-default); }
.tray { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-8) var(--space-12); border-radius: var(--radius-card); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-subtle); margin: 0 var(--space-24) var(--space-12); }
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-16); padding: 0 var(--space-24) var(--space-32); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.verdict { display: flex; align-items: center; gap: var(--space-8); }
.feed { max-width: 880px; padding: 0 var(--space-24) var(--space-32); display: flex; flex-direction: column; gap: var(--space-4); }
.feed__day { position: sticky; top: 0; z-index: 1; background: var(--surface-1); padding: var(--space-12) var(--space-8) var(--space-4); font-size: var(--fs-label); font-weight: var(--fw-semibold); color: var(--text-secondary); }

/* ---- calendar week (D-053) ---- */
.wk { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.wk-row { display: grid; grid-template-columns: 64px repeat(7, minmax(0, 1fr)); }
.wk-row--head { box-shadow: inset 0 -1px 0 var(--border-default); }
.wk-row--allday { box-shadow: inset 0 -1px 0 var(--border-default); min-height: 40px; }
.wk-head { display: flex; flex-direction: column; align-items: center; padding: 6px 0; gap: 2px; }
.wk-head__num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.wk-head.is-today .wk-head__num { background: var(--accent); color: var(--on-accent); }
.wk-allday { padding: 4px 3px; display: flex; flex-direction: column; gap: 2px; box-shadow: inset -1px 0 0 var(--border-subtle); min-width: 0; }
[dir="rtl"] .wk-allday { box-shadow: inset 1px 0 0 var(--border-subtle); }
.wk-gutter { display: flex; flex-direction: column; align-items: flex-end; padding-inline-end: 8px; justify-content: center; }
.wk-scroll { flex: 1 1 0; min-height: 0; overflow: auto; }
.wk-hour { height: 44px; display: flex; align-items: flex-start; transform: translateY(-7px); }
.wk-col { position: relative; box-shadow: inset -1px 0 0 var(--border-subtle); min-width: 0; }
[dir="rtl"] .wk-col { box-shadow: inset 1px 0 0 var(--border-subtle); }
.wk-col.is-today { background: var(--accent-subtle-bg); }
.wk-slot { height: 44px; box-shadow: inset 0 -1px 0 var(--border-subtle); }
.wk-event { position: absolute; inset-inline: 3px; }
.wk-event .task-chip { height: 100%; align-items: flex-start; padding-top: 4px; }
.wk-now { position: absolute; inset-inline: 0; height: 2px; background: var(--danger-solid); }
.wk-now::before { content: ""; position: absolute; inset-inline-start: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger-solid); }

/* ---- timeline (D-054) ---- */
.gantt__scale { position: relative; }
.gantt__month { position: absolute; top: 4px; padding-inline: 6px; font-size: var(--fs-label); font-weight: var(--fw-semibold); white-space: nowrap; }
.gantt__day { position: absolute; bottom: 4px; text-align: center; font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.gantt__day.is-today { color: var(--accent-text); font-weight: var(--fw-semibold); }
.gantt__band { height: 40px; box-shadow: inset 0 -1px 0 var(--border-subtle); }
.gantt__band--group { height: 36px; background: var(--surface-2); }
.gantt__weekend { position: absolute; top: 0; bottom: 0; background: var(--surface-2); opacity: .7; }
.gantt__deps { position: absolute; inset-block-start: 0; inset-inline-start: 0; pointer-events: none; fill: none; stroke: var(--text-secondary); stroke-width: 1.5; overflow: visible; }
[dir="rtl"] .gantt__deps { transform: scaleX(-1); }
.gantt__deps .gantt__dep--conflict { stroke: var(--danger-fg); stroke-dasharray: 4 3; } /* successor starts before its predecessor ends (VW-005) */
.gantt__deps .gantt__arrowhead.gantt__dep--conflict { stroke-dasharray: none; }
.gantt__arrowhead { stroke-linejoin: round; }
.gantt__row .prio-slot, .gantt__row .prio { flex: none; }

/* ---- demonstration & drag states for rows (render sheets) ---- */
.task-row.is-hover { background: var(--state-hover); }
.task-row.is-hover .task-row__handle { opacity: 1; }
.task-row.is-focus { outline: var(--bw-focus) solid var(--focus-ring); outline-offset: -2px; }
.nav-row.is-dragging { background: var(--surface-overlay); box-shadow: var(--shadow-3), inset 0 0 0 1px var(--border-default); }
.nav-row.is-drop-before::after { content: ""; position: absolute; inset-inline: 8px 0; top: -1px; height: 2px; border-radius: 1px; background: var(--accent); }

.gantt__summary { position: absolute; height: 8px; border-radius: var(--radius-pill); background: var(--_c); }
.gantt__summary::before, .gantt__summary::after { content: ""; position: absolute; top: 0; width: 3px; height: 14px; background: var(--_c); border-radius: 1px; }
.gantt__summary::before { inset-inline-start: 0; } .gantt__summary::after { inset-inline-end: 0; }
.prio-mix { display: flex; gap: 4px; height: 56px; }
.prio-mix__seg { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding-inline: 8px; min-width: 0; border-radius: var(--radius-control); overflow: hidden; white-space: nowrap; }
.prio-mix__seg[data-q="do"] { background: var(--prio-do-bg); } .prio-mix__seg[data-q="schedule"] { background: var(--prio-schedule-bg); }
.prio-mix__seg[data-q="delegate"] { background: var(--prio-delegate-bg); } .prio-mix__seg[data-q="drop"] { background: var(--prio-drop-bg); }
.prio-mix__seg[data-q="none"] { box-shadow: inset 0 0 0 1px var(--border-default); }

/* ==========================================================================
   Enjazy 2 — layouts · Settings shell (D-060), Appearance gallery (D-061), preferences (D-062),
   data sources (D-063), backup (D-064), sign-in component (D-065), account (D-066), security (D-067),
   sharing (D-068), plans (D-069), About (D-014). Structure only: every colour, radius, border width
   and shadow is a token; borders are inset box-shadows; directions are logical.
   ========================================================================== */

/* ---- D-060 settings shell ---- */
.settings-nav > * { flex: none; }
.set-nav__head { display: flex; align-items: center; gap: var(--space-4); min-height: var(--size-control-md); padding-inline: var(--space-8) 0; }
.set-nav__head .t-title { flex: 1 1 0; }
.set-nav__search { padding-inline: var(--space-4); }
.set-nav__search .input { height: var(--size-control-sm); }
.set-nav__search .input > input { font-size: var(--fs-body-sm); }
.set-nav__foot { margin-top: auto; padding-top: var(--space-8); box-shadow: inset 0 1px 0 var(--border-subtle); display: flex; flex-direction: column; gap: 1px; }
.settings-nav .nav-item.is-unavailable .nav-item__label, .settings-nav .nav-item.is-dim .nav-item__label { color: var(--text-secondary); }
.settings-nav .nav-item.is-dim > .icon { color: var(--text-disabled); }
.settings-nav .nav-group__label { cursor: default; }
.settings-page--wide { max-width: 1000px; }
.set-head { display: flex; flex-direction: column; gap: var(--space-4); }
.set-head__row { display: flex; align-items: center; gap: var(--space-12); min-height: var(--size-control-md); min-width: 0; }
.set-head__title { flex: 1 1 0; }
.set-head__desc { color: var(--text-secondary); font-size: var(--fs-body); line-height: var(--lh-body); max-width: 680px; }
.set-back { margin-inline-start: calc(var(--space-8) * -1); margin-bottom: var(--space-4); }
.settings-section > .section-header { padding-inline: var(--space-4); }
.settings-section > .callout, .settings-page > .callout { flex: none; }
.set-intro { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); padding-inline: var(--space-4); margin-bottom: var(--space-4); max-width: 680px; }
.set-pad { padding-block: var(--space-12); }
.set-foot-note { display: flex; align-items: flex-start; gap: var(--space-6); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); padding-inline: var(--space-4); }
.set-foot-note .icon { margin-top: 1px; flex: none; }
.set-group-foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-12); padding-block: var(--space-12); box-shadow: inset 0 1px 0 var(--border-subtle); }
.set-group-foot .btn--link { margin-inline-start: 0; }
.settings-group > .set-result { padding: 0 0 var(--space-12); display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-6); }
.set-result .progress { width: 100%; flex: none; }

/* setting rows: one row = label + description at the start, control at the end */
.settings-group .form-row__label .row { flex-wrap: wrap; row-gap: var(--space-4); }
.settings-group .form-row__label .icon { color: var(--text-secondary); }
.settings-group .form-row > .row { justify-content: flex-end; flex-wrap: wrap; }
.settings-group .form-row--stack > .row { justify-content: flex-start; }
.form-row.is-target { position: relative; z-index: 0; }
.form-row.is-target::before { content: ""; position: absolute; z-index: -1; inset-block: 2px; inset-inline: calc(var(--space-8) * -1); border-radius: var(--radius-control);
  background: var(--accent-subtle-bg); box-shadow: inset 0 0 0 2px var(--accent-border); }
.form-row.is-unavailable .form-row__label { color: var(--text-secondary); }
.form-row.set-sub { padding-inline-start: var(--space-24); min-height: 48px; }
.form-row.set-sub .form-row__label { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.form-row .form-row__desc .kbd { vertical-align: middle; }
.set-ctl { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-4); max-width: 360px; }
.set-ctl .inline-msg { text-align: end; }
.set-select { display: inline-flex; width: 240px; }
.set-select > .select { width: 100%; }
.set-select > .select[disabled] { background: var(--state-disabled-bg); color: var(--state-disabled-fg); --_bc: var(--border-default); cursor: not-allowed; }
.set-select--sm { width: 128px; }
.set-select--sm > .select { height: var(--size-control-sm); }
.set-select--role { width: 128px; }
.settings .segmented__opt[aria-disabled="true"] { color: var(--text-disabled); cursor: not-allowed; }
.settings .segmented__opt[aria-disabled="true"]:hover { background: none; }
.settings .segmented__opt[aria-disabled="true"][aria-checked="true"] { color: var(--text-secondary); }
.radio-opt[aria-disabled="true"] { cursor: not-allowed; }
.radio-opt[aria-disabled="true"] .t-label { color: var(--text-secondary); }
.radio-opt[aria-disabled="true"] .radio { background: var(--state-disabled-bg); box-shadow: inset 0 0 0 1.5px var(--text-disabled); }
.radio-opt[aria-disabled="true"]:hover { background: none; }
.set-radio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); width: 100%; }
.set-radio-grid .radio-opt, .set-radios .radio-opt { align-items: flex-start; text-align: start; }
.set-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6) var(--space-16); }
.set-checks--one { grid-template-columns: minmax(0, 1fr); }
.set-checks li { display: flex; gap: var(--space-8); align-items: flex-start; font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); min-width: 0; }
.set-checks .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--success-fg); }
.set-results { padding: var(--space-4); }
.set-results .list-item { min-height: 48px; }
.set-kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--space-12); align-items: baseline; min-height: 32px; padding-block: var(--space-6); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.set-kv + .set-kv { box-shadow: inset 0 1px 0 var(--border-subtle); }
.set-kv__k { color: var(--text-secondary); }
.set-kv__v { min-width: 0; overflow-wrap: anywhere; }
.set-kvs { display: flex; flex-direction: column; padding-inline: var(--space-12); border-radius: var(--radius-control); background: var(--surface-sunken); }
.set-preview { padding-block: var(--space-8); }
.set-preview__note { display: flex; align-items: flex-start; gap: var(--space-6); padding-block: var(--space-8) var(--space-4); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); box-shadow: inset 0 1px 0 var(--border-subtle); }
.set-preview__note .icon { margin-top: 1px; flex: none; }
.set-record { display: inline-flex; align-items: center; gap: var(--space-8); height: var(--size-control-md); padding-inline: var(--space-12); border-radius: var(--control-radius);
  background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); box-shadow: inset 0 0 0 2px var(--focus-ring); font-size: var(--fs-body-sm); }
.set-detail__hint { display: flex; align-items: center; gap: var(--space-6); margin-top: var(--space-6); color: var(--text-primary); }
.set-detail__meta { display: inline; color: var(--text-secondary); font-size: var(--fs-caption); line-height: var(--lh-caption); }

/* ---- D-061 theme gallery: live preview cards ---- */
.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-12); margin-bottom: var(--space-12); }
.theme-card { --_bw: var(--bw-hairline); --_bc: var(--border-default); --_r: max(0px, calc(var(--radius-card) - 4px));
  display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); min-width: 0; border-radius: var(--radius-card); text-align: start;
  background-color: var(--surface-raised); box-shadow: inset 0 0 0 var(--_bw) var(--_bc), var(--material-edge); transition: box-shadow var(--dur-fast) var(--ease-standard); }
.theme-card:hover { --_bc: var(--border-strong); }
.theme-card[aria-checked="true"] { --_bw: 2px; --_bc: var(--accent-border); background-color: var(--state-selected-bg); }
.theme-card.is-focus { outline: var(--bw-focus) solid var(--focus-ring); outline-offset: 2px; }
.theme-card__foot { display: flex; align-items: center; gap: var(--space-6); min-height: var(--size-control-sm); padding-inline: var(--space-4) var(--space-2); }
.theme-card__name { flex: 1 1 0; min-width: 0; font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-card__check { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--on-accent); }
.theme-card__check .icon { width: 12px; height: 12px; stroke-width: 3; }
/* The stage carries data-theme / data-mode, so everything inside it paints with the PREVIEWED theme's tokens. */
.theme-card__stage { position: relative; display: block; height: 84px; border-radius: var(--_r); overflow: hidden; isolation: isolate; color-scheme: normal; }
.tp { position: absolute; inset: 0; background-color: var(--bg); background-image: var(--material-texture), var(--material-app-bg); color: var(--text-primary); font-family: var(--font-ui); }
.tp__win { position: absolute; inset-block: 9px -12px; inset-inline: 10px -10px; display: grid; grid-template-columns: 30% minmax(0, 1fr); border-radius: var(--radius-window); overflow: hidden;
  background-color: var(--surface-1); background-image: var(--material-panel-texture); -webkit-backdrop-filter: var(--material-backdrop); backdrop-filter: var(--material-backdrop); box-shadow: var(--shadow-2); }
.tp__win::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 var(--bw-default) var(--border-default), var(--material-edge); }
.tp__side { display: flex; flex-direction: column; gap: 4px; padding: 7px 5px; background-color: var(--surface-2); box-shadow: inset -1px 0 0 var(--border-subtle); }
[dir="rtl"] .tp__side { box-shadow: inset 1px 0 0 var(--border-subtle); }
.tp__nav { display: flex; align-items: center; gap: 3px; height: 10px; padding-inline: 3px; border-radius: 3px; }
.tp__nav::before { content: ""; width: 5px; height: 5px; border-radius: 1.5px; flex: none; background: var(--text-secondary); }
.tp__nav::after { content: ""; height: 3px; flex: 1 1 auto; border-radius: 2px; background: var(--text-secondary); opacity: .55; }
.tp__nav.is-on { background: var(--state-selected-bg); }
.tp__nav.is-on::before, .tp__nav.is-on::after { background: var(--state-selected-fg); opacity: 1; }
.tp__main { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; min-width: 0; }
.tp__head { display: flex; align-items: center; gap: 4px; height: 16px; margin-bottom: 1px; }
.tp__title { flex: 1 1 0; min-width: 0; font-family: var(--font-display); font-size: 12px; line-height: 16px; font-weight: var(--fw-title); letter-spacing: var(--tracking-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp__btn { width: 16px; height: 16px; flex: none; display: grid; place-items: center; border-radius: min(var(--radius-control), 5px); background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-1); }
.tp__btn .icon { width: 10px; height: 10px; stroke-width: 2.5; }
.tp__row { display: flex; align-items: center; gap: 5px; height: 14px; padding-inline: 3px; border-radius: 4px; }
.tp__row.is-sel { background: var(--state-selected-bg); }
.tp__check { width: 9px; height: 9px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--task-todo-border); }
.tp__row.is-done .tp__check { background: var(--task-done-solid); box-shadow: none; }
.tp__prio { display: grid; place-items: center; flex: none; color: var(--prio-none); }
.tp__prio[data-q="do"] { color: var(--prio-do); }
.tp__prio[data-q="schedule"] { color: var(--prio-schedule); }
.tp__prio .icon { width: 10px; height: 10px; }
.tp__text { height: 4px; width: var(--w, 60%); border-radius: 2px; background: var(--text-primary); opacity: .72; }
.tp__row.is-done .tp__text { background: var(--text-secondary); opacity: .55; }
.swatches.set-accents { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 28px; }
.set-accent-fixed { cursor: default; box-shadow: 0 0 0 2px var(--surface-raised), 0 0 0 3px var(--border-default); }

/* ---- D-063 data sources ---- */
.set-src__status { display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-6); }
.set-src__status .badge .spinner { width: 10px; height: 10px; border-width: 1.5px; }
.set-resolved { display: flex; align-items: center; gap: var(--space-6); }

/* ---- D-064 / D-066 / D-069 cards ---- */
.set-profile { display: flex; align-items: center; gap: var(--space-12); flex-wrap: wrap; }
.set-profile > .col { min-width: 180px; }
.set-plan { display: flex; flex-direction: column; gap: var(--space-12); }
.set-plan__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); }
.set-keyform { display: flex; align-items: flex-end; gap: var(--space-8); width: 100%; max-width: 560px; }
.set-keyform > .field { flex: 1 1 auto; }
.set-keyform > .btn { margin-bottom: 20px; }
.set-table { padding: 0; overflow: hidden; }
.set-table .table th, .set-table .table td { padding-inline: var(--space-16); }
.set-compare th:not(:first-child), .set-compare td { text-align: center; }
.set-compare td .icon { margin-inline: auto; color: var(--success-fg); }
.set-compare thead th { height: auto; padding-block: var(--space-12); vertical-align: bottom; white-space: normal; }
.set-compare tbody th { font-weight: var(--fw-regular); color: var(--text-primary); font-size: var(--fs-body-sm); text-align: start; height: 40px; padding-inline: var(--space-16); box-shadow: inset 0 -1px 0 var(--border-subtle); white-space: normal; }
.set-compare td { height: 40px; }
.set-compare__name { display: flex; align-items: center; justify-content: center; gap: var(--space-6); color: var(--text-primary); font-size: var(--fs-body); }
.set-compare__price { display: block; margin-top: 2px; font-weight: var(--fw-regular); font-size: var(--fs-caption); color: var(--text-secondary); }
.set-compare .is-cur { background: var(--accent-subtle-bg); }
.set-compare tr.set-compare__group th { background: var(--surface-2); color: var(--text-secondary); font-weight: var(--fw-semibold); font-size: var(--fs-label); height: 32px; }
.set-compare tr:hover td { background: transparent; }
.set-compare tr:hover td.is-cur { background: var(--accent-subtle-bg); }
.set-about { display: flex; align-items: center; gap: var(--space-16); flex-wrap: wrap; }
.set-about__mark { width: 64px; height: 64px; flex: none; }
.set-gate-art { height: 96px; border-radius: var(--radius-card); display: grid; place-items: center; background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); }
.set-gate-art .icon { width: 40px; height: 40px; }

/* ---- D-066 two-step setup ---- */
.set-qrwrap { display: flex; gap: var(--space-20); align-items: flex-start; }
.set-qr { width: 176px; height: 176px; flex: none; padding: var(--space-8); border-radius: var(--radius-control); background: var(--surface-overlay); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); }
.set-qr svg { width: 100%; height: 100%; fill: var(--text-primary); }
.set-key { font-family: var(--font-mono); font-size: var(--fs-body); line-height: var(--lh-body); padding: var(--space-8) var(--space-12); border-radius: var(--radius-control); background: var(--surface-sunken); overflow-wrap: anywhere; }
.set-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8) var(--space-24); padding: var(--space-12) var(--space-16); border-radius: var(--radius-control);
  background: var(--surface-sunken); font-family: var(--font-mono); font-size: var(--fs-body); line-height: var(--lh-body); font-variant-numeric: tabular-nums; }

/* ---- D-065 sign-in component (dialog body and web page) ---- */
.auth-body, .auth-form { display: flex; flex-direction: column; gap: var(--space-12); }
.auth-form .btn--block { margin-top: var(--space-4); }
.auth-or { display: flex; align-items: center; gap: var(--space-12); color: var(--text-secondary); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.auth-or::before, .auth-or::after { content: ""; flex: 1 1 0; height: 1px; background: var(--border-subtle); }
.auth-foot { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); text-align: center; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: var(--space-8); }
.auth-back { display: flex; }
.auth-wait { display: flex; flex-direction: column; align-items: center; gap: var(--space-12); text-align: center; padding-block: var(--space-16); }
.auth-steps { display: flex; flex-direction: column; gap: var(--space-12); counter-reset: none; }
.auth-steps li { display: flex; gap: var(--space-12); align-items: flex-start; padding: var(--space-12); border-radius: var(--radius-control); background: var(--surface-sunken); }
.auth-page { position: relative; display: flex; flex-direction: column; height: 100%; overflow: auto; background-color: var(--bg); background-image: var(--material-texture), var(--material-app-bg); }
.auth-page__bar { display: flex; align-items: center; gap: var(--space-8); height: 56px; padding-inline: var(--space-24); flex: none; }
.auth-page__bar .brand__mark { width: 28px; height: 28px; }
.auth-page__main { flex: 1 0 auto; display: grid; place-items: center; padding: var(--space-24); }
.auth-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-32); border-radius: var(--radius-dialog); --_elev: var(--shadow-3); }
.auth-card__head { display: flex; flex-direction: column; gap: var(--space-4); }
.auth-page__foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-12); padding: var(--space-16) var(--space-24); flex: none; font-size: var(--fs-caption); color: var(--text-secondary); }

/* ---- D-068 sharing ---- */
.share-page { max-width: 880px; display: flex; flex-direction: column; gap: var(--space-24); }
.set-join { display: flex; align-items: flex-start; gap: var(--space-8); max-width: 560px; }
.set-join > .field { flex: 1 1 auto; }
.set-join > .btn { margin-top: 22px; }
/* an empty code field shows its placeholder in the UI face and direction; the typed code is mono and LTR */
.set-join .input--code input:placeholder-shown, .set-keyform .input--code input:placeholder-shown { font-family: var(--font-ui); letter-spacing: normal; }
.set-invite { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-8); align-items: center; }
.set-people { display: flex; flex-direction: column; }
.set-person, .set-code { display: flex; align-items: center; gap: var(--space-12); min-height: 52px; padding-block: var(--space-6); }
.set-person + .set-person, .set-code + .set-code { box-shadow: inset 0 1px 0 var(--border-subtle); }
.set-person > .col, .set-code > .col { min-width: 0; }
.set-person__pending { background: var(--surface-sunken); color: var(--text-secondary); }
.set-person__pending .icon { width: 12px; height: 12px; }
.set-code__value { font-family: var(--font-mono); font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-medium); }
.set-codeform { display: flex; flex-direction: column; gap: var(--space-12); padding: var(--space-12); border-radius: var(--radius-card); background: var(--surface-sunken); }

/* ==========================================================================
   Enjazy 2 — layouts · standalone & external surfaces
   D-010 boot/loaders · D-011 onboarding · D-012 error screen · D-090 brand kit · D-091 sign-in pages
   D-092 admin console · D-093 email client frame · D-094 API docs + family error template.
   Same rules as the rest of the library: tokens only (the email HTML itself carries inline hex — clients need
   it — and is generated in app/external.js from the Simple tokens); logical properties only; borders are inset
   box-shadows; display-face text sits in fill-width single-line boxes.
   ========================================================================== */

/* ---- nested theme scopes (live previews, splash/theme boards, dark-client email frame) ----------
   Component tokens re-resolve on every [data-theme] subtree through `:root, [data-theme]` in 01-base.css (DEC-X21), so
   no scoped copy is needed here. Only the UA color scheme (scrollbars, native controls) is set per preview. */
.brand-tile[data-theme], .theme-prev[data-theme], .mail[data-theme] { color-scheme: var(--color-scheme); }

/* Alerts limited to the art, title and message of a panel (boot failures, crash panel) without changing its layout. */
.boot-alert, .crash-alert { display: contents; }

/* ---- page frame shared by every standalone page ------------------------------------------------ */
.ext-page { position: relative; height: 100%; overflow: auto; isolation: isolate; color: var(--text-primary);
  background-color: var(--bg); background-image: var(--material-texture), var(--material-app-bg); }
.ext-page a:not(.btn):not(.nav-item):not(.docs-nav__item) { color: var(--text-link); }
/* A Latin-only value that becomes a block (a flex/grid item) keeps LTR text but aligns with the RTL flow. */
[dir="rtl"] :is(.ext-page, .ext-phone, .onb, .crash, .boot) :is(.col, .adm-dl dd, .mail__from .col) > .ltr { text-align: end; }
.ext-page .ext-foot a { text-decoration: none; }
.ext-page .ext-foot a:hover { text-decoration: underline; }

/* ---- lockup: canonical mark + name in the UI face (mark never mirrors; order follows reading) ---- */
.ext-lockup { display: inline-flex; align-items: center; gap: var(--space-8); flex: none; min-width: 0; color: var(--text-primary); text-decoration: none; }
.ext-lockup__mark { width: 32px; height: 32px; flex: none; }
.ext-lockup__name { font-family: var(--font-ui); font-weight: var(--fw-semibold); font-size: 20px; line-height: 28px; white-space: nowrap; }
.ext-lockup__tag { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: var(--fw-medium); color: var(--text-secondary); padding-inline-start: var(--space-8);
  box-shadow: inset 1px 0 0 var(--border-default); white-space: nowrap; }
[dir="rtl"] .ext-lockup__tag { box-shadow: inset -1px 0 0 var(--border-default); }
.ext-lockup--sm { gap: var(--space-6); }
.ext-lockup--sm .ext-lockup__mark { width: 24px; height: 24px; }
.ext-lockup--sm .ext-lockup__name { font-size: 16px; line-height: 24px; }
.ext-lockup--lg { gap: var(--space-12); }
.ext-lockup--lg .ext-lockup__mark { width: 40px; height: 40px; }
.ext-lockup--lg .ext-lockup__name { font-size: 26px; line-height: 34px; }
.ext-lockup--lg .ext-lockup__tag { font-size: var(--fs-body); padding-inline-start: var(--space-12); }

/* ---- family page template: sign-in, landing and error pages ------------------------------------ */
.ext-auth { display: flex; flex-direction: column; }
.ext-auth__top { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-16) var(--space-24) 0; flex: none; }
.ext-auth__main { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-24); padding: var(--space-8) var(--space-16) var(--space-24); }
.ext-auth__brand { display: flex; justify-content: center; }
.ext-auth__after { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: var(--space-4); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); text-align: center; max-width: 400px; }
.ext-card { width: min(400px, 100%); padding: var(--space-32); display: flex; flex-direction: column; gap: var(--space-20); }
.ext-card--wide { width: min(460px, 100%); }
.ext-card--center { align-items: stretch; text-align: center; }
.ext-card--center .ext-card__head { align-items: center; }
.ext-card--center .ext-details { text-align: start; }
.ext-card__head { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.ext-card__head > .ext-art { margin-block-end: var(--space-8); }
.ext-card__head > .ext-art:not(.ext-art--lg) { width: 44px; height: 44px; }
.ext-card__head > .ext-art:not(.ext-art--lg) .icon { width: 22px; height: 22px; }
.ext-card__title { width: 100%; }
.ext-card__title--wrap { font-family: var(--font-ui); font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.ext-card__sub { color: var(--text-secondary); font-size: var(--fs-body); line-height: var(--lh-body); overflow-wrap: anywhere; }
.ext-card__sub strong { color: var(--text-primary); font-weight: var(--fw-semibold); }
.ext-form { display: flex; flex-direction: column; gap: var(--space-16); }
.ext-form > .btn--block { margin-block-start: var(--space-4); }
.ext-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-8); }
.ext-or { display: flex; align-items: center; gap: var(--space-12); color: var(--text-secondary); font-size: var(--fs-caption); line-height: var(--lh-caption); }
:lang(ar) .ext-or { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }   /* Arabic micro-text ≥ 13 px (CNT-010) */
.ext-or::before, .ext-or::after { content: ""; flex: 1 1 0; height: 1px; background: var(--border-subtle); }
.ext-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-4); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); }
.ext-links a { display: inline-flex; align-items: center; gap: var(--space-4); }
.ext-actions { display: flex; flex-direction: column; gap: var(--space-8); }
.ext-actions--split { flex-direction: row; }
.ext-actions--split > .btn { flex: 1 1 0; }
.ext-foot { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--space-8) var(--space-16); padding: var(--space-8) var(--space-24) var(--space-24); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); flex: none; }
.ext-foot__links { display: flex; gap: var(--space-16); }
.ext-page .ext-foot a { color: var(--text-secondary); }
.ext-art { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); }
.ext-art .icon { width: 26px; height: 26px; }
.ext-art--lg { width: 64px; height: 64px; }
.ext-art--lg .icon { width: 30px; height: 30px; }
.ext-art--danger { background: var(--danger-bg); color: var(--danger-fg); }
.ext-art--warning { background: var(--warning-bg); color: var(--warning-fg); }
.ext-art--success { background: var(--success-bg); color: var(--success-fg); }
.ext-art--neutral { background: var(--surface-sunken); color: var(--text-secondary); }
.ext-acct { display: flex; align-items: center; gap: var(--space-12); padding: var(--space-8) var(--space-12); border-radius: var(--radius-control); background: var(--surface-sunken); min-width: 0; text-align: start; }
.ext-acct__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 0; }
.ext-acct__name { font-weight: var(--fw-medium); font-size: var(--fs-body); line-height: var(--lh-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-acct__email { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-code { justify-content: space-between; gap: var(--space-6); }
.ext-code .code-field__cell { width: 48px; }
.ext-waiting { display: flex; align-items: center; justify-content: center; gap: var(--space-8); color: var(--text-secondary); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.ext-waiting--start { justify-content: flex-start; }
.ext-scopes { display: flex; flex-direction: column; gap: var(--space-12); }
.ext-scopes li { display: flex; gap: var(--space-12); align-items: flex-start; }
.ext-scopes .icon { color: var(--text-secondary); margin-block-start: 2px; }
.ext-link-vis { display: flex; align-items: center; justify-content: center; gap: var(--space-8); }
.ext-link-vis__dots { width: 40px; height: 2px; background-image: radial-gradient(circle, var(--border-strong) 1px, transparent 1.5px); background-size: 8px 2px; }
.ext-app-tile { width: 48px; height: 48px; border-radius: var(--radius-card); display: grid; place-items: center; flex: none; font-weight: var(--fw-semibold); font-size: var(--fs-body); background: var(--slot-teal); color: var(--slot-teal-on); }
.ext-app-tile--enjazy { background: var(--surface-1); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); }
.ext-app-tile--enjazy svg { width: 30px; height: 30px; }
.ext-app-tile--project { width: 56px; height: 56px; background: var(--slot-purple-tint); color: var(--slot-purple-tint-fg); margin: 0 auto var(--space-8); }
.ext-app-tile--project .icon { width: 26px; height: 26px; }
.ext-details { display: flex; flex-direction: column; gap: var(--space-8); }
.ext-details .disclosure__trigger { color: var(--text-secondary); }
.ext-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-4) var(--space-16); padding: var(--space-12); border-radius: var(--radius-control); background: var(--surface-sunken); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.ext-dl dt { color: var(--text-secondary); }
.ext-dl dd { margin: 0; font-family: var(--font-mono); overflow-wrap: anywhere; }
.ext-lang { flex: none; }
.ext-bar { padding-inline-end: 0; }
.ext-bar--bare { background-color: transparent; background-image: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.ext-bar__brand .brand__mark, .ext-bar__brand svg { width: 20px; height: 20px; }
.ext-phone .os-status-pad { display: none; }
.ext-win { height: 100%; border-radius: 0; }
@media (max-width: 600px) {
  .ext-auth__top { padding: var(--space-8) var(--space-12) 0; }
  .ext-auth__main { justify-content: flex-start; padding: var(--space-8) 0 var(--space-16); gap: var(--space-8); }
  .ext-lockup--lg .ext-lockup__mark { width: 32px; height: 32px; }
  .ext-lockup--lg .ext-lockup__name { font-size: 22px; line-height: 30px; }
  .ext-card, .ext-card--wide { width: 100%; padding: var(--space-16); background-color: transparent; background-image: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; }
  .ext-code .code-field__cell { width: 44px; }
}

/* ---- D-010 boot splash & loaders ---------------------------------------------------------------- */
.boot { background-color: var(--bg); }
.boot__main { flex: 1 1 0; min-height: 0; display: grid; place-items: center; padding: var(--space-24); position: relative; }
.boot--splash .boot__main { margin-block-start: calc(var(--layout-titlebar-h) * -1); }
.boot-splash { display: flex; flex-direction: column; align-items: center; gap: var(--space-24); }
.boot-splash__mark { width: 88px; height: 88px; }
.boot-splash--sm { gap: var(--space-16); }
.boot-splash--sm .boot-splash__mark { width: 48px; height: 48px; }
.boot-splash__label { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); }
.boot-mark__frame { stroke: var(--text-primary); stroke-dasharray: 100; stroke-dashoffset: 0; animation: boot-frame 2.6s var(--ease-standard) infinite; }
.boot-mark__check { stroke: var(--accent); stroke-dasharray: 100; stroke-dashoffset: 0; animation: boot-check 2.6s var(--ease-standard) infinite; }
.boot-mark__dot { fill: var(--accent); transform-box: view-box; transform-origin: 83.5px 16.5px; animation: boot-dot 2.6s var(--ease-emphasis) infinite; }
@keyframes boot-frame { 0% { stroke-dashoffset: 100; } 18% { stroke-dashoffset: 0; } 78% { stroke-dashoffset: 0; } 95%, 100% { stroke-dashoffset: -100; } }
@keyframes boot-check { 0%, 18% { stroke-dashoffset: 100; } 34% { stroke-dashoffset: 0; } 62% { stroke-dashoffset: 0; } 78%, 100% { stroke-dashoffset: -100; } }
@keyframes boot-dot { 0%, 30% { opacity: 0; transform: scale(0) rotate(0deg); } 40% { opacity: 1; transform: scale(1.25) rotate(135deg); } 50% { transform: scale(1) rotate(360deg); } 62% { opacity: 1; transform: scale(1) rotate(360deg); } 78%, 100% { opacity: 0; transform: scale(.4) rotate(360deg); } }
.boot-track { position: relative; display: block; width: 160px; height: 4px; border-radius: 2px; overflow: hidden; background: var(--chart-track); }
.boot-track--full { width: 100%; height: 6px; border-radius: 3px; }
.boot-track__bar { position: absolute; inset-block: 0; inset-inline-start: -35%; width: 35%; border-radius: inherit; background: var(--accent); animation: boot-sweep 1.3s var(--ease-standard) infinite; }
@keyframes boot-sweep { from { inset-inline-start: -35%; } to { inset-inline-start: 100%; } }
/* Reduced motion: a still mark (the diamond keeps its 45° turn — it lives on the <rect>, the wrapper is what moves)
   and a still label instead of the sweep. */
[data-reduce-motion="reduce"] .boot-mark *, [data-reduce-motion="reduce"] .boot-track__bar { animation: none !important; }
[data-reduce-motion="reduce"] .boot-track__bar { inset-inline-start: 0; width: 100%; opacity: .35; }
@media (prefers-reduced-motion: reduce) { .boot-mark *, .boot-track__bar { animation: none !important; } }
/* Render harness: freeze on the "hold" pose so screenshots are deterministic. */
.boot-mark--still * { animation: none !important; }
.boot-mark--fade { opacity: .3; }
.boot-panel { width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-12); }
.boot-panel--center { align-items: center; text-align: center; gap: var(--space-16); }
.boot-panel__mark { width: 48px; height: 48px; margin-block-end: var(--space-8); }
.boot-panel > .ext-art { margin-block-end: var(--space-4); }
.boot-panel > .t-title { white-space: nowrap; }
.boot-progress { display: flex; flex-direction: column; gap: var(--space-8); margin-block-start: var(--space-8); }
.boot-progress .progress { height: 6px; }
.boot-progress__row { display: flex; align-items: baseline; gap: var(--space-8); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.boot-panel__cta { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-6); margin-block-start: var(--space-8); }
.boot-panel__cta--row { flex-direction: row; gap: var(--space-8); }
.boot-panel__foot { margin-block-start: var(--space-8); padding-block-start: var(--space-12); box-shadow: inset 0 1px 0 var(--border-subtle); }
.boot-banner-progress { width: 160px; flex: none; display: flex; margin-inline-end: var(--space-8); }
.boot-sknav { display: flex; align-items: center; gap: var(--space-8); height: var(--size-row-nav); padding-inline: var(--space-8); }
.boot-win { display: grid; place-items: center; background-color: var(--bg); }
.boot-phone { display: grid; place-items: center; background-color: var(--bg); background-image: none; }
.boot-phone--panel { place-items: start center; padding: var(--space-48) var(--space-20) var(--space-24); }
.boot-phone--panel .boot-panel > .t-title { white-space: normal; font-family: var(--font-ui); }
.boot-phone-frame .os-status, .boot-phone-frame .os-gesture { background: var(--bg); }
.boot-strip { display: flex; gap: var(--space-16); align-items: stretch; }
.boot-frame { flex: 1 1 0; display: flex; flex-direction: column; gap: var(--space-12); min-width: 0; }
.boot-frame__stage { height: 200px; border-radius: var(--radius-card); background: var(--bg); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-subtle); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-16); }
.boot-frame__stage .boot-mark { width: 88px; height: 88px; }
.boot-frame figcaption { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.boot-strip--rm { max-width: 420px; }
.boot-mini { display: flex; flex-direction: column; align-items: center; gap: var(--space-12); width: 100%; }
.boot-mini__mark { width: 40px; height: 40px; }
.boot-mini .progress { width: 100%; }
.boot-mini__txt { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-primary); text-align: center; }

/* ---- D-011 onboarding --------------------------------------------------------------------------- */
.onb { background-color: var(--bg); }
.onb__main { flex: 1 1 0; min-height: 0; overflow: auto; display: grid; place-items: center; padding: var(--space-24); }
.onb--web .onb__main { position: relative; padding-block-start: var(--space-48); }
.onb__webtop { position: absolute; inset-block-start: var(--space-16); inset-inline: var(--space-24); display: flex; }
.onb-card { width: min(1000px, 100%); display: grid; grid-template-columns: 300px minmax(0, 1fr); overflow: hidden; }
.onb-side { display: flex; flex-direction: column; gap: var(--space-24); padding: var(--space-32) var(--space-24); background-color: var(--surface-2); box-shadow: inset -1px 0 0 var(--border-subtle); }
[dir="rtl"] .onb-side { box-shadow: inset 1px 0 0 var(--border-subtle); }
.onb-side__note { display: flex; align-items: center; gap: var(--space-6); margin-block-start: auto; }
.onb-steps { display: flex; flex-direction: column; gap: var(--space-4); }
.onb-step { display: flex; align-items: center; gap: var(--space-12); height: 40px; padding-inline: var(--space-8); border-radius: var(--radius-control); color: var(--text-secondary); font-size: var(--fs-body); }
.onb-step__dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: var(--fs-caption); font-weight: var(--fw-semibold); box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.onb-step.is-current { background: var(--state-selected-bg); color: var(--state-selected-fg); font-weight: var(--fw-medium); }
.onb-step.is-current .onb-step__dot { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.onb-step.is-done { color: var(--text-primary); }
.onb-step.is-done .onb-step__dot { background: var(--success-bg); color: var(--success-fg); box-shadow: none; }
.onb-body { display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-32) var(--space-32) var(--space-24); min-width: 0; min-height: 680px; }
.onb-count { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: var(--fw-medium); color: var(--accent-text); }
.onb-content { display: flex; flex-direction: column; gap: var(--space-16); margin-block-start: var(--space-16); flex: 1 1 auto; }
.onb-foot { display: flex; align-items: center; gap: var(--space-8); padding-block-start: var(--space-16); box-shadow: inset 0 1px 0 var(--border-subtle); margin-block-start: var(--space-16); }
/* choice cards (one radio pattern for language, data location and start) */
.ext-choice { --_bw: var(--bw-default); --_bc: var(--border-default); display: flex; align-items: center; gap: var(--space-16); width: 100%; padding: var(--space-16); border-radius: var(--radius-card); text-align: start;
  background-color: var(--surface-raised); box-shadow: inset 0 0 0 var(--_bw) var(--_bc), var(--material-edge); }
.ext-choice:hover { --_bc: var(--border-strong); }
.ext-choice[aria-checked="true"] { --_bw: 2px; --_bc: var(--accent-border); background-color: var(--state-selected-bg); }
.ext-choice > .radio { margin-block-start: 0; }
.ext-choice[aria-checked="true"] > .radio { box-shadow: inset 0 0 0 5px var(--accent); }
.ext-choice__text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ext-choice__desc { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); }
.ext-choice__icon { width: 40px; height: 40px; border-radius: var(--radius-control); display: grid; place-items: center; flex: none; background: var(--surface-sunken); color: var(--text-secondary); }
.ext-choice[aria-checked="true"] .ext-choice__icon { background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); }
.onb-lang { gap: var(--space-12); }
.ext-choice--lang { padding-block: var(--space-20); }
.onb-lang__name { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-semibold); }
.onb-lang__lines { width: 44px; height: 40px; flex: none; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 6px 8px; border-radius: var(--radius-control); background: var(--surface-sunken); }
.onb-lang__lines i { display: block; height: 3px; border-radius: 2px; background: var(--text-secondary); width: 100%; }
.onb-lang__lines i:nth-child(2) { width: 70%; } .onb-lang__lines i:nth-child(3) { width: 45%; }
.onb-lang__lines--ltr { align-items: flex-start; direction: ltr; }
.onb-lang__lines--rtl { align-items: flex-start; direction: rtl; }
.onb-themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-12); }
.onb-theme { --_bw: var(--bw-hairline); --_bc: var(--border-default); display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-6); border-radius: calc(var(--radius-card) + 4px); text-align: start; box-shadow: inset 0 0 0 var(--_bw) var(--_bc); }
.onb-theme:hover { --_bc: var(--border-strong); }
.onb-theme[aria-checked="true"] { --_bw: 2px; --_bc: var(--accent-border); background: var(--state-selected-bg); }
.onb-theme__name { display: flex; align-items: center; gap: var(--space-6); padding-inline: var(--space-4); font-size: var(--fs-label); line-height: var(--lh-label); font-weight: var(--fw-medium); min-height: 18px; }
.onb-theme__name .trunc { flex: 0 1 auto; }
.onb-theme__check { margin-inline-start: auto; color: var(--accent-text); }
.onb-loc { gap: var(--space-12); }
.onb-server { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-16); border-radius: var(--radius-card); background: var(--surface-sunken); }
.onb-start { gap: var(--space-12); }
.onb-import { display: flex; align-items: center; gap: var(--space-8); color: var(--text-secondary); }
/* live theme preview (a real subtree with data-theme / data-mode, so every theme paints itself) */
.theme-prev { display: flex; flex-direction: column; height: 84px; border-radius: var(--radius-card); overflow: hidden; color: var(--text-primary);
  background-color: var(--bg); background-image: var(--material-texture), var(--material-app-bg); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); }
.theme-prev__bar { height: 12px; flex: none; background-color: var(--surface-2); box-shadow: inset 0 -1px 0 var(--border-subtle); display: flex; align-items: center; padding-inline: 6px; }
.theme-prev__bar i { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.theme-prev__body { flex: 1 1 0; display: flex; min-height: 0; }
.theme-prev__nav { width: 30%; display: flex; flex-direction: column; gap: 4px; padding: 6px 5px; background-color: var(--surface-2); box-shadow: inset -1px 0 0 var(--border-subtle); }
[dir="rtl"] .theme-prev__nav { box-shadow: inset 1px 0 0 var(--border-subtle); }
.theme-prev__nav i { height: 5px; border-radius: 2px; background: var(--text-secondary); opacity: .45; }
.theme-prev__nav i.is-on { background: var(--state-selected-border); opacity: 1; }
.theme-prev__main { flex: 1 1 0; display: flex; flex-direction: column; gap: 5px; padding: 7px 6px; background-color: var(--surface-1); position: relative; }
.theme-prev__row { display: flex; align-items: center; gap: 4px; }
.theme-prev__row b { width: 7px; height: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1.25px var(--task-todo-border); flex: none; }
.theme-prev__row i { height: 4px; width: 68%; border-radius: 2px; background: var(--text-primary); opacity: .8; }
.theme-prev__row em { width: 6px; height: 6px; border-radius: 1px; background: var(--prio-do); margin-inline-start: auto; }
.theme-prev__row.is-done b { background: var(--task-done-solid); box-shadow: none; }
.theme-prev__row.is-done i { background: var(--text-secondary); opacity: .6; }
.theme-prev__btn { position: absolute; inset-block-end: 6px; inset-inline-end: 6px; width: 26px; height: 9px; border-radius: var(--radius-control); background: var(--accent); }
/* first workspace, next steps, coach marks */
.onb-first { display: flex; flex-direction: column; gap: var(--space-16); padding-block-start: var(--space-8); padding-inline: var(--space-24); }
.onb-first__hello { display: flex; align-items: center; gap: var(--space-16); padding: var(--space-8) 0; max-width: 720px; }
.onb-next { max-width: 720px; padding: var(--space-8) var(--space-8) var(--space-8); }
.onb-next__head { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-8) var(--space-8) var(--space-12); }
.onb-next__list { display: flex; flex-direction: column; gap: 2px; }
.onb-next__item { min-height: 56px; padding-block: var(--space-6); }
.onb-next__item .list-item__icon { width: 36px; height: 36px; background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); }
.onb-next__item .list-item__icon .icon { width: 18px; height: 18px; }
.onb-next__item .list-item__secondary { white-space: normal; font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.coach { position: absolute; z-index: var(--z-popover); width: 300px; padding: var(--space-16); display: flex; flex-direction: column; gap: var(--space-6); --_elev: var(--shadow-3); }
.coach--nav { inset-block-start: calc(var(--layout-titlebar-h) + 8px); inset-inline-start: calc(var(--layout-nav-w) + 14px); }
.coach__arrow { position: absolute; width: 12px; height: 12px; background: var(--overlay-bg); transform: rotate(45deg); }
.coach--nav .coach__arrow { inset-block-start: 58px; inset-inline-start: -6px; box-shadow: inset 1px -1px 0 var(--border-default); }
[dir="rtl"] .coach--nav .coach__arrow { box-shadow: inset -1px 1px 0 var(--border-default); }
.coach--below .coach__arrow { inset-block-start: -6px; inset-inline-start: 28px; box-shadow: inset 1px 1px 0 var(--border-default); }
.coach--end .coach__arrow { inset-inline-start: auto; inset-inline-end: 40px; }
.coach__count { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--accent-text); font-weight: var(--fw-semibold); }
.coach__title { font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: var(--fw-semibold); }
.coach__body { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); }
.coach__foot { display: flex; align-items: center; gap: var(--space-8); margin-block-start: var(--space-8); }
.onb-tour--capture #onb-anchor-capture, .onb-tour--search #onb-anchor-search {
  outline: 2px solid var(--focus-ring); outline-offset: 3px; border-radius: var(--radius-control); position: relative; z-index: 1; }
.onb-tour--nav .sidenav .nav-group:first-child { outline: 2px solid var(--focus-ring); outline-offset: -2px; border-radius: var(--radius-control); }
/* phone onboarding */
.onb-pbar { justify-content: space-between; }
.onb-pprog { padding: 0 var(--space-16) var(--space-8); background: var(--surface-2); }
.onb-pbody { display: flex; flex-direction: column; gap: var(--space-12); padding: var(--space-16); }
.onb-pbody > .t-title { white-space: normal; font-family: var(--font-ui); }
.onb-pwelcome { display: flex; align-items: center; gap: var(--space-12); margin-block-end: var(--space-8); }
.onb-pwelcome__mark { width: 40px; height: 40px; }
.onb-pfoot { display: flex; gap: var(--space-8); padding: var(--space-12) var(--space-16); background: var(--surface-2); box-shadow: inset 0 1px 0 var(--border-subtle); flex: none; }
.onb-pfoot .btn { flex: 1 1 0; }

/* ---- D-012 app error screen --------------------------------------------------------------------- */
.crash { background-color: var(--bg); }
.crash__main { flex: 1 1 0; min-height: 0; overflow: auto; display: grid; place-items: center; padding: var(--space-24); }
.crash-panel { width: min(560px, 100%); padding: var(--space-32); display: flex; flex-direction: column; gap: var(--space-12); }
.crash-panel > .ext-art { margin-block-end: var(--space-4); }
.crash-actions { display: flex; gap: var(--space-8); margin-block-start: var(--space-8); }
.crash-panel > .divider { margin-block: var(--space-12); }
.crash-report { display: flex; flex-direction: column; gap: var(--space-8); }
.crash-section { display: grid; place-items: center; }
.crash-small { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-12); padding: var(--space-32) var(--space-24); }
.crash-small .col { width: 100%; }
.crash-phone { padding: var(--space-24) var(--space-16); background-color: var(--bg); background-image: none; }
.crash-phone .crash-panel { width: 100%; padding: var(--space-20); }
.crash-phone .crash-actions { flex-direction: column; }
.crash-phone .crash-panel > .t-title-lg { white-space: normal; font-family: var(--font-ui); }

/* ---- D-090 brand kit boards --------------------------------------------------------------------- */
.brand-page { background-color: var(--bg); }
.brand-wrap { max-width: 1376px; margin-inline: auto; padding: var(--space-32) var(--space-32) var(--space-48); display: flex; flex-direction: column; gap: var(--space-20); }
.brand-head { display: flex; align-items: center; gap: var(--space-24); }
.brand-head .col { min-width: 0; }
.brand-head__intro { max-width: 460px; }
.brand-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--space-16); align-items: start; }
.brand-sec { display: flex; flex-direction: column; gap: var(--space-12); grid-column: span 6; min-width: 0; }
.brand-sec--mark { grid-column: span 4; }
.brand-sec--var { grid-column: span 5; }
.brand-sec--size { grid-column: span 3; }
.brand-sec--lock { grid-column: span 8; }
.brand-sec--pal { grid-column: span 4; }
.brand-sec--icons { grid-column: span 7; }
.brand-sec--dont { grid-column: span 5; }
.brand-sec--full { grid-column: 1 / -1; }
.brand-grid--icons .brand-sec { grid-column: span 6; }
.brand-tile { display: grid; place-items: center; border-radius: var(--radius-card); padding: var(--space-16); min-height: 112px; color: var(--text-primary);
  background-color: var(--bg); background-image: var(--material-texture), var(--material-app-bg); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); }
.brand-tile--live { background-color: var(--surface-sunken); background-image: none; }
.brand-tile--accent { background: var(--accent); }
.brand-tile--wide { min-height: 96px; }
.brand-tile--geo { padding: var(--space-8); }
.brand-mark { width: 56px; height: 56px; display: block; }
.brand-mark--fill { width: 100%; height: 100%; }
.brand-mark--mirror { transform: scaleX(-1); }
.brand-mark--stretch { transform: scaleX(1.45); }
.brand-mark--fx { filter: drop-shadow(3px 5px 0 var(--accent)) blur(.4px); }
.brand-geo { display: flex; flex-direction: column; gap: var(--space-12); }
.brand-geo__grid { width: 220px; height: 220px; }
.brand-parts { display: flex; flex-direction: column; gap: var(--space-6); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.brand-parts li { display: flex; align-items: center; gap: var(--space-8); }
.brand-parts b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: var(--fs-caption); background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); }
.brand-variants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-12); }
.brand-fig { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; align-items: stretch; }
.brand-cap { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.brand-cap b { color: var(--text-primary); font-weight: var(--fw-semibold); }
.brand-sizes { display: flex; flex-direction: column; gap: var(--space-12); }
.brand-size { display: flex; align-items: center; gap: var(--space-12); }
.brand-size__box { width: 72px; height: 72px; display: grid; place-items: center; flex: none; border-radius: var(--radius-control); background: var(--surface-sunken); }
.brand-size__mark { display: block; }
.brand-lockups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-12); }
.brand-lockups > .brand-fig:nth-child(3), .brand-lockups > .brand-fig:nth-child(6) { grid-column: span 1; }
.brand-lock { display: inline-flex; align-items: center; gap: 12px; }
.brand-lock__mark { width: 40px; height: 40px; flex: none; }
.brand-lock__words { display: flex; flex-direction: column; gap: 2px; }
.brand-lock[lang="ar"] .brand-lock__name { line-height: 42px; }
.brand-lock__name { font-family: var(--font-ui); font-size: 28px; line-height: 34px; font-weight: var(--fw-semibold); white-space: nowrap; }
.brand-lock__sub { font-size: 15px; line-height: 18px; font-weight: var(--fw-medium); color: var(--text-secondary); }
.brand-lock--v { flex-direction: column; gap: 8px; }
.brand-lock--v .brand-lock__mark { width: 44px; height: 44px; }
.brand-lock--v .brand-lock__name { font-size: 22px; line-height: 28px; }
.brand-iconrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-16); }
.brand-iconrow .brand-fig { align-items: center; text-align: center; }
.brand-img { display: block; flex: none; }
.brand-tray { display: flex; gap: var(--space-8); }
.brand-tile--tray { min-height: 0; padding: var(--space-12); display: flex; gap: var(--space-12); align-items: center; border-radius: var(--radius-control); }
.brand-fav { display: flex; align-items: center; justify-content: center; gap: var(--space-16); height: 96px; }
.brand-fav--zoom { height: auto; }
.brand-pixel { image-rendering: pixelated; box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-subtle); }
.brand-palette { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); }
.brand-swatch { display: flex; align-items: center; gap: var(--space-12); }
.brand-swatch svg { width: 40px; height: 40px; flex: none; border-radius: 8px; box-shadow: 0 0 0 var(--bw-hairline) var(--border-default); }
.brand-donts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-12); }
.brand-dont { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.brand-dont .brand-tile { min-height: 92px; box-shadow: inset 0 0 0 1.5px var(--danger-border); }
.brand-dont figcaption { display: flex; gap: var(--space-4); align-items: flex-start; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.brand-dont figcaption .icon { color: var(--danger-fg); flex: none; }
.brand-dont figcaption b { color: var(--danger-fg); }
.brand-crowd { display: inline-flex; align-items: center; gap: 1px; }
.brand-crowd .brand-mark { width: 44px; height: 44px; }
.brand-crowd__txt { font-weight: var(--fw-semibold); font-size: 18px; }
.brand-pxrow { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-20); }
.brand-fig--px { align-items: center; }
.brand-layers { position: relative; display: inline-grid; }
.brand-layers > * { grid-area: 1 / 1; }
.brand-tile--themed { min-height: 0; padding: var(--space-16); border-radius: 50%; width: 108px; height: 108px; background: var(--accent-subtle-bg); background-image: none; box-shadow: none; }
.brand-themed { display: flex; flex-direction: column; align-items: center; gap: var(--space-16); }
.brand-themed .icon { filter: none; }
img.brand-themed { opacity: .9; }
.brand-tile--bar { min-height: 0; padding: 0; width: 220px; }
.brand-taskbar { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-12); width: 100%; height: 40px; padding-inline: var(--space-12); direction: ltr; border-radius: var(--radius-card); background-color: var(--surface-2); font-size: var(--fs-caption); }
.brand-tile--splash { width: 200px; height: 260px; }
.brand-splash { display: flex; flex-direction: column; align-items: center; gap: var(--space-20); }
.brand-splash__mark { width: 64px; height: 64px; }
.brand-splash .boot-track { width: 96px; }
.brand-themes { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-12); }
.brand-tile--theme { min-height: 150px; padding: var(--space-12); }
.brand-tile--theme .ext-lockup__name { font-size: 18px; }
.brand-tile--email { min-height: 0; padding: var(--space-16) var(--space-20); place-items: start; }
.brand-emailhead { display: flex; align-items: center; gap: var(--space-12); font-weight: var(--fw-semibold); font-size: 20px; line-height: 28px; }
.brand-emailhead img { border-radius: 10px; }
.brand-themes--boot { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.brand-tile--boot { min-height: 160px; padding: var(--space-16); }

/* ---- D-091 phone + zoom are handled by the family media query above ------------------------------ */

/* ---- D-092 admin console ------------------------------------------------------------------------ */
.adm { display: flex; overflow: hidden; }
.adm-nav { height: 100%; }
.adm-nav .nav-item { text-decoration: none; }
.adm-nav__head { display: flex; flex-direction: column; gap: 2px; padding: var(--space-8) var(--space-8) var(--space-16); }
.adm-nav__host { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); padding-inline-start: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-who { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-8); min-width: 0; }
.adm-foot-tools { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-8); }
.adm-main { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; overflow: hidden; background-color: var(--surface-1); background-image: var(--material-panel-texture); }
.adm-head { padding: var(--space-24) var(--space-32) var(--space-16); gap: var(--space-4); }
.adm-head .breadcrumb { margin-block-end: var(--space-4); }
.adm-scroll { flex: 1 1 0; min-height: 0; overflow: auto; padding: 0 var(--space-32) var(--space-32); position: relative; }
.adm-toolbar { display: flex; align-items: center; gap: var(--space-8); padding: 0 var(--space-32) var(--space-12); flex: none; }
.adm-tabs { padding: 0 var(--space-32) var(--space-12); flex: none; }
.adm-pad { padding: 0 var(--space-32) var(--space-12); }
.adm-table-wrap { flex: 1 1 0; min-height: 0; overflow: auto; margin-inline: var(--space-32); border-radius: var(--radius-card); background-color: var(--surface-raised); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); }
.adm-table-wrap--plain { display: grid; place-items: center; background-color: transparent; box-shadow: none; margin-block-end: var(--space-32); }
.adm-table th { background-color: var(--surface-2); position: sticky; inset-block-start: 0; z-index: 1; }
.adm-table th:first-child { border-start-start-radius: var(--radius-card); }
.adm-table th:last-child { border-start-end-radius: var(--radius-card); }
.adm-table td { white-space: nowrap; height: 52px; }
.adm-table tr.adm-row { cursor: pointer; }
.adm-table tr.adm-row:focus-visible { outline: var(--bw-focus) solid var(--focus-ring); outline-offset: -2px; }
.adm-table tr.is-new td { background-color: var(--accent-subtle-bg); }
.adm-table--inner { font-size: var(--fs-body-sm); }
.adm-table--inner th { background-color: transparent; position: static; }
.adm-table--inner td { height: 40px; }
.adm-sort { display: inline-flex; align-items: center; gap: var(--space-4); height: 28px; padding-inline: var(--space-4); margin-inline: calc(var(--space-4) * -1); border-radius: var(--radius-control); color: inherit; font: inherit; }
.adm-sort:hover { background: var(--state-hover); color: var(--text-primary); }
.adm-sort .icon { opacity: .55; }
.adm-sort.is-sorted { color: var(--text-primary); }
.adm-sort.is-sorted .icon { opacity: 1; color: var(--accent-text); }
.adm-actions { text-align: end; width: 56px; }
.adm-cell-person { display: flex; align-items: center; gap: var(--space-12); min-width: 0; }
.adm-cell-person .col { min-width: 0; }
.adm-mono { font-family: var(--font-mono); font-size: var(--fs-body-sm); }
.adm-uri { display: inline-block; max-width: 250px; vertical-align: middle; }
.adm-uri-full { overflow-wrap: anywhere; }
.adm-sk { display: block; height: 10px; }
.adm-foot { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-8) var(--space-32) var(--space-16); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); flex: none; }
.adm-app-tile { width: 32px; height: 32px; border-radius: var(--radius-control); display: grid; place-items: center; flex: none; font-size: var(--fs-caption); font-weight: var(--fw-semibold); background: var(--_c, var(--surface-sunken)); color: var(--_on, var(--text-primary)); }
.adm-app-tile--enjazy { background: var(--surface-1); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); }
.adm-app-tile--enjazy svg { width: 20px; height: 20px; }
.adm-app-tile--lg { width: 48px; height: 48px; font-size: var(--fs-body); }
.adm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-16); }
.adm-stat { min-height: 96px; }
.adm-health { display: flex; flex-direction: column; gap: var(--space-12); max-width: 880px; }
.adm-health__row { display: flex; align-items: center; gap: var(--space-12); }
.adm-dl { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: var(--space-12) var(--space-16); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); align-items: center; }
.adm-dl dt { color: var(--text-secondary); }
.adm-dl dd { margin: 0; min-width: 0; }
.adm-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-16); align-items: start; }
.adm-digest { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-12) var(--space-16); }
.adm-digest__v { font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: var(--fw-semibold); }
.adm-drawer { position: absolute; inset-block: 0; inset-inline-end: 0; width: min(460px, 100%); z-index: var(--z-dialog); animation: enj-in var(--dur-base) var(--ease-enter);
  box-shadow: inset 1px 0 0 var(--border-default), var(--shadow-4); }
[dir="rtl"] .adm-drawer { box-shadow: inset -1px 0 0 var(--border-default), var(--shadow-4); }
.adm-drawer__body { display: flex; flex-direction: column; gap: var(--space-16); padding: var(--space-16) var(--space-20) var(--space-24); }
.adm-drawer__id { display: flex; align-items: center; gap: var(--space-12); }
.adm-drawer__foot { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-12) var(--space-20); box-shadow: inset 0 1px 0 var(--border-subtle); background-color: var(--surface-2); flex: none; }
.adm-drawer .adm-dl { grid-template-columns: 150px minmax(0, 1fr); }
.ext-page .radio-opt, .adm .radio-opt { text-align: start; }
.adm-fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.adm-textarea { height: auto; padding-block: var(--space-6); align-items: stretch; }
.adm-textarea textarea { width: 100%; border: 0; background: transparent; resize: vertical; outline: none; font-family: var(--font-mono); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: inherit; }
.adm-textarea textarea[dir="auto"] { font-family: var(--font-ui); }
.adm-secret { font-family: var(--font-mono); font-size: 15px; line-height: 22px; padding: var(--space-12); border-radius: var(--radius-control); background: var(--surface-sunken); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); overflow-wrap: anywhere; text-align: start; user-select: all; }
.adm-settings { max-width: 760px; }
.adm-phone .phone-body { background-color: var(--surface-1); }
.adm-pbar .app-bar__titles { min-width: 0; }
.adm-pbody { display: flex; flex-direction: column; gap: var(--space-12); padding: var(--space-12) var(--space-16) var(--space-24); }
.adm-pchips { display: flex; gap: var(--space-8); overflow-x: auto; }
.adm-pcard { display: flex; align-items: center; gap: var(--space-12); min-height: 72px; padding: var(--space-8) var(--space-4); text-align: start; width: 100%; box-shadow: inset 0 -1px 0 var(--border-subtle); }
.adm-pcard .col { gap: var(--space-4); }
.adm-pcard > .icon { color: var(--text-secondary); }
.adm-pcount { text-align: center; }
.adm-psheet-foot { display: flex; align-items: center; gap: var(--space-8); padding-inline: var(--space-8); }
.adm-psheet-who { padding-inline: var(--space-8); }
.adm-pstats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
.adm-pstat { padding: var(--space-12); border-radius: var(--radius-card); background-color: var(--surface-raised); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); }
.adm-phone .adm-pbody .adm-dl { margin: 0; }
[dir="rtl"] .adm-secret { text-align: end; }   /* LTR value, aligned with the RTL flow (DEC-X23) */

/* ---- D-093 email: neutral mail-client frame (the email inside is inline-styled HTML) -------------- */
.mail-stage { background-color: var(--surface-2); background-image: none; }
.mail { min-height: 100%; display: flex; flex-direction: column; background-color: var(--surface-1); color: var(--text-primary); }
.mail__bar { display: flex; align-items: center; gap: var(--space-4); height: 48px; padding-inline: var(--space-8) var(--space-12); flex: none; box-shadow: inset 0 -1px 0 var(--border-subtle); }
.mail__head { display: flex; flex-direction: column; gap: var(--space-12); padding: var(--space-16) var(--space-20) var(--space-12); flex: none; }
.mail__subject { font-family: var(--font-ui); font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--fw-semibold); }
.mail__from { display: flex; align-items: center; gap: var(--space-12); min-width: 0; }
.mail__from .col { min-width: 0; }
.mail__sender { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail__avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.mail__avatar--empty { display: grid; place-items: center; background: var(--surface-sunken); color: var(--text-secondary); }
.mail__notice { display: flex; align-items: center; gap: var(--space-8); margin: 0 var(--space-20) var(--space-8); padding: var(--space-8) var(--space-12); border-radius: var(--radius-control); background: var(--surface-sunken); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); }
.mail__body { flex: 1 0 auto; }
.mail__plain-label { padding: var(--space-8) var(--space-20) 0; }
.mail__plain { margin: 0; padding: var(--space-12) var(--space-20) var(--space-32); font-family: var(--font-ui); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-primary); }
.mail-stage--phone .mail__head { padding-inline: var(--space-16); }
.mail-stage--phone .mail__subject { font-size: var(--fs-heading); line-height: var(--lh-heading); }

/* ---- D-094 API docs (Swagger UI skinned with the family tokens) ---------------------------------- */
.docs { display: flex; flex-direction: column; overflow: hidden; background-color: var(--surface-1); background-image: var(--material-panel-texture); }
.docs-top { display: flex; align-items: center; gap: var(--space-12); height: 56px; padding-inline: var(--space-24); flex: none; background-color: var(--surface-2); box-shadow: inset 0 -1px 0 var(--border-subtle); }
.docs-main { flex: 1 1 0; min-height: 0; display: flex; }
.docs-nav { width: 240px; flex: none; overflow: auto; display: flex; flex-direction: column; gap: 2px; padding: var(--space-16) var(--space-12); background-color: var(--surface-2); box-shadow: inset -1px 0 0 var(--border-subtle); }
[dir="rtl"] .docs-nav { box-shadow: inset 1px 0 0 var(--border-subtle); }
.docs-nav__label { padding: var(--space-16) var(--space-8) var(--space-4); }
.docs-nav__item { display: flex; align-items: center; justify-content: space-between; height: 32px; padding-inline: var(--space-8); border-radius: var(--radius-control); color: var(--text-primary); text-decoration: none; font-size: var(--fs-body-sm); }
.docs-nav__item:hover { background: var(--state-hover); }
.docs-nav__item.is-current { background: var(--state-selected-bg); color: var(--state-selected-fg); font-weight: var(--fw-medium); }
.docs-body { flex: 1 1 0; min-width: 0; overflow: auto; padding: var(--space-24) var(--space-32) var(--space-48); display: flex; flex-direction: column; gap: var(--space-12); position: relative; }
.docs-intro { display: flex; flex-direction: column; gap: var(--space-12); max-width: 920px; margin-block-end: var(--space-12); }
.docs-base { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-8) var(--space-12); border-radius: var(--radius-control); background: var(--surface-sunken); }
.docs-base code { font-family: var(--font-mono); font-size: var(--fs-body-sm); }
.docs-group { max-width: 920px; border-radius: var(--radius-card); background-color: var(--surface-raised); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); }
.docs-group__head { display: flex; align-items: center; gap: var(--space-12); width: 100%; height: 48px; padding-inline: var(--space-16); text-align: start; border-radius: var(--radius-card); }
.docs-group__head:hover { background: var(--state-hover); }
.docs-group__head .t-heading { flex: 0 1 auto; }
.docs-group__ops { display: flex; flex-direction: column; padding: 0 var(--space-8) var(--space-8); }
.docs-op { border-radius: var(--radius-control); }
.docs-op + .docs-op { box-shadow: inset 0 1px 0 var(--border-subtle); }
.docs-op.is-open { background: var(--surface-sunken); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); }
.docs-op__row { display: flex; align-items: center; gap: var(--space-12); width: 100%; min-height: 44px; padding-inline: var(--space-8); text-align: start; color: var(--text-primary); }
.docs-op__row:hover { background: var(--state-hover); }
.docs-op__row > .icon, .docs-op__row [role="img"] { color: var(--text-secondary); }
.docs-method { width: 64px; justify-content: center; font-family: var(--font-mono); font-weight: var(--fw-semibold); letter-spacing: .02em; }
.docs-op__path { font-family: var(--font-mono); font-size: var(--fs-body-sm); font-weight: var(--fw-medium); white-space: nowrap; }
.docs-op__sum { font-size: var(--fs-body-sm); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.docs-op__body { display: flex; flex-direction: column; gap: var(--space-12); padding: var(--space-8) var(--space-16) var(--space-16); }
.docs-code { margin: 0; padding: var(--space-12) var(--space-16); border-radius: var(--radius-control); background: var(--surface-1); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-default); font-family: var(--font-mono); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); white-space: pre; overflow: auto; text-align: start; }
.docs-resp { display: flex; align-items: center; gap: var(--space-12); font-size: var(--fs-body-sm); }
.docs-group__h { margin: 0; font: inherit; }
/* Narrow layout by width (a narrow desktop window or 200 % zoom gets it too), plus the phone class for the prototype
   frame. The lockup's "API docs" tag, the version badge and the spec download give way; Authorize and the language
   switch always stay. */
@media (max-width: 720px) {
  .docs .docs-nav { display: none; }
  .docs .docs-top { padding-inline: var(--space-12); gap: var(--space-8); }
  .docs .docs-top .ext-lockup__tag, .docs .docs-top > .badge:not(.badge--success), .docs .docs-top > .btn--tertiary:not(.ext-lang):not([data-act="docsAuth"]) { display: none; }
  .docs .docs-body { padding: var(--space-16) var(--space-12) var(--space-32); }
  .docs .docs-op__sum { display: none; }
  .docs .docs-base { flex-wrap: wrap; }
}
.docs--phone .docs-nav { display: none; }
.docs--phone .docs-top { padding-inline: var(--space-12); gap: var(--space-8); }
.docs--phone .docs-top .ext-lockup__tag, .docs--phone .docs-top > .badge:not(.badge--success), .docs--phone .docs-top > .btn--tertiary:not(.ext-lang):not([data-act="docsAuth"]) { display: none; }
.docs--phone .docs-body { padding: var(--space-16) var(--space-12) var(--space-32); }
.docs--phone .docs-op__sum { display: none; }
.docs--phone .docs-base { flex-wrap: wrap; }

/* ==========================================================================
   Enjazy 2 — platform layouts: phone (D-070…D-076), tablet, secondary windows (D-080…D-084)
   ========================================================================== */
.phone .fab { bottom: calc(var(--layout-phone-nav-h) + 20px + var(--space-16)); }
.phone .timer-bar + .fab, .phone .timer-bar ~ .fab { bottom: calc(var(--layout-phone-nav-h) + 20px + 56px + var(--space-16)); }
.phone .sheet { bottom: 0; }
.phone .scrim { z-index: var(--z-dialog); }
.phone .editor__body { padding: var(--space-12) var(--space-16) var(--space-24); }
.phone .editor-actions { padding: var(--space-8) var(--space-16); }
.phone .editor-actions .btn--lg { height: 48px; }
.phone .prop { grid-template-columns: 96px minmax(0, 1fr); min-height: 48px; }
.phone .prop__value > .input, .phone .prop__value > .select, .phone .prop__value > .date-field { height: 44px; }
.phone .level-picker__opt { height: 36px; padding-inline: 8px; }
.phone .prio-row { grid-template-columns: 1fr; gap: 4px; }
.phone .quad__body .task-row { --task-row-height: 48px; }
.phone .toast { width: 100%; }
.scope-row { display: flex; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: var(--space-8) var(--space-8); background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--border-subtle); }
.week-strip__day { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding-block: 6px; border-radius: var(--radius-control); color: var(--text-secondary); }
.week-strip__day.is-selected { background: var(--state-selected-bg); color: var(--state-selected-fg); }
.week-strip__num { font-size: var(--fs-body-lg); font-weight: var(--fw-semibold); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.week-strip__day.is-selected .week-strip__num { color: var(--state-selected-fg); }
.week-strip__dots { display: flex; gap: 2px; height: 6px; }
.week-strip__dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.phone-bulk { display: grid; grid-template-columns: repeat(4, 1fr); height: 64px; flex: none; background: var(--surface-overlay); box-shadow: inset 0 1px 0 var(--border-default), var(--shadow-3); }
.phone-bulk__btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: var(--fs-caption); color: var(--text-primary); }
.phone-bulk__btn .icon { width: 22px; height: 22px; }
.phone-bulk__btn.is-danger { color: var(--danger-fg); }
.os-keyboard { height: 300px; flex: none; background: var(--surface-3); display: flex; flex-direction: column; }
.os-keyboard::after { content: ""; flex: 1; margin: 8px; border-radius: 8px; background: repeating-linear-gradient(90deg, var(--surface-1) 0 30px, transparent 30px 36px), var(--surface-3); opacity: .7; }
.os-keyboard__bar { height: 44px; display: flex; align-items: center; justify-content: space-around; background: var(--surface-2); box-shadow: inset 0 -1px 0 var(--border-subtle); font-size: var(--fs-label); color: var(--text-primary); }

/* ---- tablet / narrow web (768–1279): rail + overlay editor (D-076) ---- */
.app.is-narrow .app-panel { position: absolute; inset-block: var(--layout-titlebar-h) 0; inset-inline-end: 0; width: min(440px, 100%); box-shadow: var(--shadow-4); }
.app.is-narrow .ws-nav { width: 240px; }
.app-panel-scrim { position: absolute; inset: var(--layout-titlebar-h) 0 0 0; background: var(--scrim); z-index: calc(var(--z-panel) - 1); }

/* ---- secondary windows ---- */
.win-stage { position: relative; height: 100%; padding: 24px; display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; overflow: auto; }
.win-frame { position: relative; flex: none; display: flex; flex-direction: column; }
.win-frame__label { font: 500 12px/16px var(--font-ui); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); margin-bottom: 6px; }
[data-mode="light"] .win-frame__label { color: #0b1220; text-shadow: none; }
.win-chrome__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--_c); flex: none; }
.win-chrome .icon-btn[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-subtle-bg); }
.sticky .quick-add { margin: 8px; }
.sticky .task-row { --task-row-height: 32px; }
.sticky-foot { display: flex; align-items: center; gap: 8px; height: 32px; padding-inline: 12px; font-size: var(--fs-caption); color: var(--_tintfg); box-shadow: inset 0 1px 0 var(--_tintb); flex: none; }
.timer-widget { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; }
.timer-widget__time { font-family: var(--font-ui); font-size: 28px; line-height: 34px; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.mini-drill .nav-row { height: 36px; }
.os-menu { width: 240px; padding: 4px; border-radius: 8px; background: #2b2b2b; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.4); font: 12px/1.3 "Segoe UI", var(--font-ui); }
[data-mode="light"] .os-menu { background: #f9f9f9; color: #1a1a1a; box-shadow: 0 8px 24px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.08); }
.os-menu__item { display: flex; align-items: center; gap: 10px; height: 30px; padding-inline: 10px; border-radius: 4px; }
.os-menu__item:hover { background: rgba(127,127,127,.18); }
.os-menu__item .kbd-hint { margin-inline-start: auto; opacity: .7; }
.os-menu__sep { height: 1px; margin: 4px 6px; background: rgba(127,127,127,.3); }
.os-toast { width: 364px; border-radius: 8px; padding: 12px 14px; background: #2b2b2b; color: #fff; box-shadow: 0 12px 32px rgba(0,0,0,.45); font: 13px/1.35 "Segoe UI", var(--font-ui); display: flex; flex-direction: column; gap: 8px; }
[data-mode="light"] .os-toast { background: #f3f3f3; color: #1a1a1a; box-shadow: 0 12px 32px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.08); }
.os-toast__app { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: .85; }
.os-toast__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.os-toast__actions span { display: grid; place-items: center; height: 32px; border-radius: 4px; background: rgba(127,127,127,.22); }

.task-row.is-flat { grid-template-columns: 16px 0 32px 16px minmax(0, 1fr) auto; }
.task-row--compact.is-flat { grid-template-columns: 0 0 24px 16px minmax(0, 1fr) auto; }
[data-platform="phone"] .task-row.is-flat { grid-template-columns: 0 0 48px 16px minmax(0, 1fr) auto; padding-inline-start: 0; }
.phone .prop--block { grid-template-columns: minmax(0, 1fr); }
.phone .prop--block .level-picker { width: 100%; grid-template-columns: repeat(4, 1fr); }
.phone .prop--block .level-picker__opt { justify-content: center; }
.os-status__icons i { width: 12px; height: 8px; opacity: .6; border-radius: 1px; }
.os-status__icons i:last-child { width: 20px; opacity: .8; }
[data-platform="phone"] .task-row.is-bulk { grid-template-columns: 40px 0 48px 16px minmax(0, 1fr) auto; }
[data-platform="phone"] .task-row.is-bulk .task-row__handle { display: grid; width: 40px; height: 48px; }
[data-platform="phone"] .task-row.is-bulk .select-mark { width: 24px; height: 24px; }

/* ==========================================================================
   Enjazy 2 — component library · 10 completed states, touch targets and fixes found in spec review
   (J-01…J-44 reviews). Loaded last so it can refine earlier parts.
   ========================================================================== */

/* ---- layering: a popover opened inside a dialog or sheet must sit above its scrim ---- */
.popover { z-index: calc(var(--z-dialog) + 5); }

/* ---- pressed / hover / disabled states that were missing ---- */
.btn--danger:active { background-image: linear-gradient(var(--state-pressed), var(--state-pressed)); }
.btn--link:focus-visible { text-decoration-color: currentColor; }
.icon-btn--solid:active { background-color: var(--accent-pressed); color: var(--on-accent); }
.icon-btn--outline:active { background-color: var(--surface-1); background-image: linear-gradient(var(--state-pressed), var(--state-pressed)); }
.filter-chip:active { background-image: linear-gradient(var(--state-pressed), var(--state-pressed)); }
.filter-chip[disabled], .filter-chip[aria-disabled="true"] { color: var(--text-disabled); background: var(--state-disabled-bg); box-shadow: none; cursor: not-allowed; }
.segmented__opt:active, .level-picker__opt:active { background: var(--state-pressed); }
.segmented__opt[disabled], .segmented__opt[aria-disabled="true"], .level-picker__opt[disabled] { color: var(--text-disabled); background: none; cursor: not-allowed; }
.option[aria-disabled="true"] { color: var(--text-disabled); cursor: not-allowed; }
.option[aria-disabled="true"]:hover { background: none; }
.checkbox:hover:not([aria-disabled="true"]) { box-shadow: inset 0 0 0 1.5px var(--text-primary); }
.checkbox[aria-checked="true"]:hover, .checkbox[aria-checked="mixed"]:hover { background: var(--accent-hover); box-shadow: none; }
.checkbox:active:not([aria-disabled="true"]) { background-image: linear-gradient(var(--state-pressed), var(--state-pressed)); }
.checkbox[aria-disabled="true"][aria-checked="true"] { background: var(--state-disabled-fg); }
.checkbox[aria-disabled="true"][aria-checked="true"] .icon { opacity: 1; color: var(--surface-1); }
.switch:hover:not([aria-disabled="true"]) { box-shadow: inset 0 0 0 1.5px var(--text-primary); }
.switch[aria-checked="true"]:hover { background: var(--accent-hover); box-shadow: none; }
.switch:active:not([aria-disabled="true"])::after { transform: scale(.9); }
.switch[aria-disabled="true"] { opacity: 1; background: var(--state-disabled-bg); box-shadow: inset 0 0 0 1.5px var(--state-disabled-fg); }
.switch[aria-disabled="true"]::after { background: var(--state-disabled-fg); }
.switch[aria-disabled="true"][aria-checked="true"] { background: var(--state-disabled-fg); }
.switch[aria-disabled="true"][aria-checked="true"]::after { background: var(--surface-1); }
.swatch:hover { box-shadow: 0 0 0 2px var(--surface-overlay), 0 0 0 3px var(--border-strong); }
.swatch--none { --_c: var(--border-strong); }
.swatches--sm { grid-template-columns: repeat(auto-fill, 20px); }
.fab:hover { background: var(--accent-hover); }
.fab:active { background: var(--accent-pressed); }
.input.has-error:focus-within { --_bw: 2px; --_bc: var(--focus-ring); }
.input.has-error:focus-within + .inline-msg, .field .input.has-error:focus-within ~ .inline-msg { color: var(--danger-fg); }
.task-row.is-bulk .task-check { pointer-events: none; }
.task-row.is-bulk .task-check::before { background: var(--state-disabled-bg); box-shadow: inset 0 0 0 1.5px var(--text-disabled); }
@media (prefers-reduced-motion: reduce) { .pulse-dot, .spinner, .icon--spin, .sync-status[data-state="syncing"] .icon, .skeleton { animation: none !important; } }
[data-reduce-motion="reduce"] .pulse-dot, [data-reduce-motion="reduce"] .spinner, [data-reduce-motion="reduce"] .icon--spin, [data-reduce-motion="reduce"] .sync-status[data-state="syncing"] .icon { animation: none !important; }

/* ---- radii from tokens, not raw values ---- */
.kbd, .inline-edit, .inline-edit-field, .badge__x { border-radius: var(--radius-chip); }
.tooltip { border-radius: var(--radius-control); }
.count, .progress, .dot, .pulse-dot { border-radius: var(--radius-pill); }
.checkbox, .select-mark { border-radius: min(var(--radius-control), 6px); }
.fab { border-radius: var(--radius-card); }
.task-check::before { box-shadow: inset 0 0 0 max(1.5px, var(--bw-strong)) var(--task-todo-border); }
.nav-item { height: calc(var(--size-row-nav) + 4px); }

/* ---- priority glyph sizes honour the size option ---- */
.prio .icon--xs { width: 14px; height: 14px; }
.prio .icon--md { width: 20px; height: 20px; }

/* ---- avatar text never below the 12px minimum ---- */
.avatar--sm { width: 24px; height: 24px; font-size: var(--fs-caption); }

/* ---- touch: every target ≥ 48dp on the phone (visual size may be smaller; the hit area grows) ---- */
[data-platform="phone"] .icon-btn::after,
[data-platform="phone"] .checkbox::after,
[data-platform="phone"] .filter-chip::after,
[data-platform="phone"] .btn--sm::after,
[data-platform="phone"] .badge__x::after { content: none; }
[data-platform="phone"] .icon-btn, [data-platform="phone"] .filter-chip, [data-platform="phone"] .btn--sm, [data-platform="phone"] .tab, [data-platform="phone"] .segmented__opt, [data-platform="phone"] .level-picker__opt { position: relative; }
[data-platform="phone"] .icon-btn::before, [data-platform="phone"] .filter-chip::before, [data-platform="phone"] .btn--sm::before, [data-platform="phone"] .tab::before, [data-platform="phone"] .segmented__opt::before, [data-platform="phone"] .level-picker__opt::before { content: ""; position: absolute; inset: min(0px, calc((100% - 48px) / 2)); }
[data-platform="phone"] .filter-chip { height: 36px; }
[data-platform="phone"] .tab { height: 48px; }
[data-platform="phone"] .nav-item { height: 48px; }
[data-platform="phone"] .segmented__opt { height: 40px; }
[data-platform="phone"] .number-field__step { width: 44px; }
[data-platform="phone"] .input, [data-platform="phone"] .select, [data-platform="phone"] .date-field { height: 48px; }
[data-platform="phone"] .input--sm { height: 44px; }
[data-platform="phone"] .checkbox { width: 22px; height: 22px; }
[data-platform="phone"] .check-field { min-height: 48px; align-items: center; }
[data-platform="phone"] .switch::before { inset: -12px -6px; }
[data-platform="phone"] .swatch { width: 40px; height: 40px; }
[data-platform="phone"] .swatch::before { content: ""; position: absolute; inset: -4px; }

/* ---- touch: coarse pointer on desktop/web (REQ-A-016, owner NO-005) — the shell controls the J-02 `.icon-btn::after` rule does not cover
   grow their hit area to --size-touch; the drawn size never changes. min(0px, …) grows a short or narrow side and leaves a long side alone
   (a full-width nav row or the search trigger is never shrunk). .btn--sm uses ::before because ::after is its loading spinner; on the phone
   the same ::before rule above already applies, and the phone sync chip is an .icon-btn whose ::after is switched off there. ---- */
@media (pointer: coarse) {
  .search-trigger, .acct-btn, .sync-status { position: relative; }
  .nav-item::after, .search-trigger::after, .acct-btn::after, .sync-status::after, .btn--sm::before { content: ""; position: absolute; inset: min(0px, calc((100% - var(--size-touch)) / 2)); }
}

/* ---- small fixes ---- */
.sheet__header { padding-block: var(--space-4) var(--space-8); padding-inline: var(--space-16) var(--space-8); }
.date-field-wrap { position: relative; display: flex; }
.date-field-wrap > .date-field { flex: 1 1 0; padding-inline-end: 32px; }
.date-field-wrap > .icon-btn { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); }
.kbd-then { font-size: var(--fs-caption); color: var(--text-secondary); padding-inline: 2px; align-self: center; }
/* on the inverse J-35 bubble the joiner takes the tooltip legend colour (owner NO-006): --text-secondary fails contrast on --tooltip-bg */
.tooltip .kbd-then { color: var(--tooltip-fg); }

/* ---- review fixes (J-45…J-66) ---- */
/* caption buttons follow the OS layout (DEC-017): on an LTR Windows desktop they stay at the physical right */
[dir="rtl"]:not([data-os-dir="rtl"]) .titlebar .win-controls { order: -1; }
.banner { padding-block: var(--space-8); padding-inline: var(--space-16) var(--space-8); }
.toast { padding-block: var(--space-6); padding-inline: var(--space-16) var(--space-6); }
.task-card { padding-block: var(--space-8); padding-inline: var(--space-4) var(--space-8); }
[data-platform="phone"] .toast-region, .phone .toast-region { bottom: calc(var(--layout-phone-nav-h) + 20px + 80px); }
.chart__axis { font-size: var(--fs-caption); }
.gantt__day { font-size: var(--fs-caption); }
.gantt__today::before { font-size: var(--fs-caption); }
.mini-matrix__axis { font-size: var(--fs-caption); line-height: var(--lh-caption); }
.task-chip, .more-link, .breadcrumb a, .breadcrumb button, .mini-matrix__cell { border-radius: var(--radius-chip); }
.task-bar { border-radius: var(--radius-control); }
.task-bar__progress { opacity: 1; background: var(--state-pressed); }
.skeleton-row { grid-template-columns: 16px 20px 32px 16px minmax(0, 1fr) 60px; padding-inline: var(--space-4) var(--space-8); gap: var(--space-4); }
.skeleton-row .sk-check { grid-column: 3; justify-self: center; }
.task-row--compact { grid-template-columns: 12px 16px 24px 16px minmax(0, 1fr) auto; }
.task-row--compact .task-row__handle { width: 12px; }
[data-platform="phone"] .tree-toggle::before { inset: -12px; }
.task-card__grip { position: absolute; inset-inline-start: 2px; top: 10px; width: 14px; height: 20px; display: grid; place-items: center; color: var(--text-secondary); opacity: 0; cursor: grab; }
.task-card__grip .icon { width: 12px; height: 12px; }
.task-card:hover .task-card__grip, .task-card:focus-within .task-card__grip { opacity: 1; }
.task-chip.is-overdue .icon { color: var(--task-overdue-fg); }

/* ---- bidi truncation: the clipping element takes the text's own direction (so an English title in the Arabic UI
   keeps its beginning) while alignment still follows the surrounding language ---- */
.task-row__title, .task-chip__title, .task-card__title, .nav-row__name, .list-item__primary, .win-chrome__title .trunc, .gantt__row .trunc { text-align: match-parent; }

/* ==========================================================================
   Enjazy 2 — component library · 11 spec closure
   CSS-only items the component specs (J-01 … J-66) still marked "to add". Loaded last.
   Tokens only, logical properties only, no theme-specific rules; paint may differ by theme, sizes never do.
   ========================================================================== */

/* ---- J-01 Button ---- */
.btn--danger-subtle:active { background-image: linear-gradient(var(--state-pressed), var(--state-pressed)); }
.btn[aria-pressed="true"] { background-color: var(--accent-subtle-bg); color: var(--accent-subtle-fg); }
.btn--danger.is-loading::after { border-color: var(--button-danger-fg); border-inline-end-color: transparent; }
.btn.is-loading { pointer-events: none; }
a.btn:not(.btn--link) { text-decoration: none; }

/* ---- J-04 FAB ---- */
.fab:active { --_elev: var(--shadow-2); }

/* ---- J-05 Link ---- */
:lang(ar) a, :lang(ar) .btn--link { text-underline-offset: 3px; }
.btn--link:active { text-decoration-color: currentColor; background-color: var(--state-pressed); }
.btn--link.is-inline { text-decoration-color: currentColor; }
.btn--link::before { content: ""; position: absolute; inset-block: -3px; inset-inline: calc(var(--space-4) * -1); }
[data-platform="phone"] .btn--link::before { inset-block: calc((var(--size-touch) - 100%) / -2); inset-inline: calc(var(--space-4) * -1); }

/* ---- J-06 Timer control: clock values keep h:mm:ss order in both directions ---- */
.timer-ctl--hero .timer-ctl__time, .timer-bar__time { direction: ltr; unicode-bidi: isolate; text-align: match-parent; }

/* ---- J-07 Task check ---- */
.task-check::before { transition: background-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast), transform var(--dur-fast) var(--ease-standard); }
.task-check:active:not([disabled]):not([data-state="auto"])::before { transform: scale(.92); }
[dir="rtl"] .task-check[data-state="wip"]::before, [dir="rtl"] .task-check[data-state="auto"]::before { transform: scaleX(-1); }
[dir="rtl"] .task-check[data-state="wip"]:active:not([disabled])::before { transform: scale(-.92, .92); }

/* ---- J-08 Checkbox ---- */
.checkbox { box-shadow: inset 0 0 0 max(1.5px, var(--bw-strong)) var(--border-strong); }
.checkbox[aria-checked="true"]:active:not([aria-disabled="true"]), .checkbox[aria-checked="mixed"]:active:not([aria-disabled="true"]) { background: var(--accent-pressed); }
[data-platform="phone"] .checkbox::before { inset: min(0px, calc((100% - var(--size-touch)) / 2)); }
.check-group { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.check-group > legend { padding: 0; margin-block-end: var(--space-4); }

/* ---- J-09 Switch ---- */
.switch { box-shadow: inset 0 0 0 max(1.5px, var(--bw-strong)) var(--border-strong); }
.switch:active:not([aria-disabled="true"]) { background-image: linear-gradient(var(--state-pressed), var(--state-pressed)); }
.switch[aria-checked="true"]:active:not([aria-disabled="true"]) { background: var(--accent-pressed); }

/* ---- J-10 Segmented control & radio group ---- */
.radio-opt:active { background: var(--state-pressed); }
.segmented__opt[aria-checked="true"][disabled], .segmented__opt[aria-checked="true"][aria-disabled="true"],
.level-picker__opt[aria-checked="true"][disabled] { background: var(--surface-1); }
[data-platform="phone"] .radio-opt { min-height: var(--size-touch); }

/* ---- J-12 Tabs & navigation items ---- */
.tab:active, .nav-item:active:not([aria-current="page"]) { background-color: var(--state-pressed); }
.nav-item[aria-current="page"]:active, .bottom-nav__item:active .bottom-nav__pill { background-image: linear-gradient(var(--state-pressed), var(--state-pressed)); }

/* ---- J-13 Colour swatch picker (--_gap: the ring gap takes the picker's surface; default --surface-overlay) ---- */
.swatch { transition: transform var(--dur-fast) var(--ease-standard); }
.swatch:active { transform: scale(.92); }
.swatch:hover { box-shadow: 0 0 0 2px var(--_gap, var(--surface-overlay)), 0 0 0 3px var(--border-strong); }
.swatch[aria-checked="true"], .swatch[aria-checked="true"]:hover { box-shadow: 0 0 0 2px var(--_gap, var(--surface-overlay)), 0 0 0 4px var(--_c); }
[data-platform="phone"] .swatches:not(.set-accents) { grid-template-columns: repeat(6, 40px); gap: var(--space-12); }

/* ---- J-14 Level picker ---- */
.level-picker__opt[aria-pressed="true"] { background: var(--surface-1); color: var(--text-primary); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-strong), var(--shadow-1); }
.level-picker__opt[disabled] .bars i { background: var(--state-disabled-fg); }

/* ---- J-16 Field wrapper ---- */
.field__count.is-over { color: var(--danger-fg); }

/* ---- J-66 Spinner size used in fields, listboxes and the save status ---- */
.spinner--sm { width: 12px; height: 12px; }

/* ---- J-18 Textarea: grows with its content from 72 px to 320 px, then scrolls ---- */
.textarea > textarea { field-sizing: content; max-height: 320px; overflow-y: auto; }

/* ---- J-19 Number field ---- */
.number-field__step:active { background: var(--state-pressed); }
.number-field__step[aria-disabled="true"], .number-field__step[disabled] { color: var(--text-disabled); background: none; cursor: not-allowed; }

/* ---- J-20 Date picker ---- */
[data-platform="phone"] .cal-grid__day { height: var(--size-touch); }

/* ---- J-22 / J-23 / J-37 chip remove: 48 px target on touch ---- */
@media (pointer: coarse) {
  .badge__x::before { inset: calc((var(--size-touch) - 16px) / -2); }
  .qa-preview .badge__x::before { inset: calc((var(--size-touch) - 24px) / -2); }
}
[data-platform="phone"] .badge__x::before { inset: calc((var(--size-touch) - 16px) / -2); }
[data-platform="phone"] .qa-preview .badge__x::before { inset: calc((var(--size-touch) - 24px) / -2); }

/* ---- J-23 Quick add ---- */
[data-platform="phone"] .quick-add__row { height: var(--size-touch); }

/* ---- J-24 Inline edit ---- */
.inline-edit-field.has-error { box-shadow: inset 0 0 0 2px var(--danger-border); }
[data-platform="phone"] .inline-edit-field { height: var(--size-control-md); }

/* ---- J-25 Code field ---- */
.code-field.is-disabled .code-field__cell { background: var(--state-disabled-bg); color: var(--state-disabled-fg); box-shadow: inset 0 0 0 var(--bw-default) var(--border-default); }

/* ---- J-26 / J-30 / J-32 / J-34 leaving: the runtime adds .is-leaving and removes the node on animationend ---- */
.dialog.is-leaving, .palette.is-leaving { animation: enj-in var(--dur-fast) var(--ease-exit) reverse both; }
.sheet.is-leaving { animation: enj-in var(--dur-base) var(--ease-exit) reverse both; }
.popover.is-leaving, .scrim.is-leaving { animation: enj-fade var(--dur-fast) var(--ease-exit) reverse both; }

/* ---- J-26 Dialog: full-screen form on phone ---- */
.dialog--full { position: absolute; inset: 0; width: auto; max-height: none; border-radius: 0; }

/* ---- J-30 Bottom sheet ---- */
.sheet--expanded { height: calc(100% - var(--space-48)); }
.action-list__item:active { background: var(--state-pressed); }
.action-list__item[aria-disabled="true"], .action-list__item[aria-disabled="true"] .icon { color: var(--text-disabled); cursor: not-allowed; }
.action-list__item[aria-disabled="true"]:hover, .action-list__item[aria-disabled="true"]:active { background: none; }

/* ---- J-31 Side panel: overlay variant (web 768–1279) ---- */
.app-panel--overlay { position: absolute; inset-block: 0; inset-inline-end: 0; box-shadow: var(--shadow-3); }
.scrim--panel { z-index: var(--z-panel); }

/* ---- J-32 Popover ---- */
@keyframes enj-drop { from { opacity: 0; transform: translateY(calc(var(--motion-distance) * -1)); } to { opacity: 1; transform: none; } }
.popover[data-side="top"] { animation-name: enj-drop; }
.icon-btn[aria-expanded="true"]:not([aria-pressed="true"]):not(.icon-btn--solid) { background-color: var(--state-hover); color: var(--text-primary); }

/* ---- J-33 Menu ---- */
.menu-item:active:not([aria-disabled="true"]) { background: var(--state-pressed); }
.menu-item:focus-visible { background: var(--state-hover); outline-offset: calc(var(--bw-focus) * -1 - 1px); }

/* ---- J-34 Command palette: full screen on phone ---- */
[data-platform="phone"] .palette { position: absolute; inset: 0; width: auto; max-height: none; border-radius: 0; }
[data-platform="phone"] .palette__footer { display: none; }

/* ---- J-35 Tooltip & InfoTip ---- */
.tooltip--wrap { white-space: normal; }
.info-tip { position: relative; }
.info-tip::before { content: ""; position: absolute; inset: -2px; }
@media (pointer: coarse) { .info-tip::before { inset: calc((var(--size-touch) - 20px) / -2); } }
[data-platform="phone"] .info-tip::before { inset: calc((var(--size-touch) - 20px) / -2); }

/* ---- J-38 Count badge: "99+" keeps the plus after the number in RTL ---- */
.count { direction: ltr; unicode-bidi: isolate; }

/* ---- J-39 Status pill: task states read the task tokens, not the generic tones ---- */
.badge[data-status="todo"] { background: var(--surface-sunken); color: var(--task-todo-fg); }
.badge[data-status="wip"] { background: var(--task-inprogress-bg); color: var(--task-inprogress-fg); }
.badge[data-status="done"] { background: var(--task-done-bg); color: var(--task-done-fg); }
.badge[data-status="overdue"] { background: var(--task-overdue-bg); color: var(--task-overdue-fg); }

/* ---- J-40 Keycap: not shown on a touch-only phone (a hardware keyboard sets data-keyboard="hardware") ---- */
[data-platform="phone"]:not([data-keyboard="hardware"]) .kbd-combo { display: none; }

/* ---- J-41 Avatar ---- */
.avatar:has(> img) { position: relative; }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar--more, .avatar--unknown { background: var(--surface-sunken); color: var(--text-secondary); }
.avatar--unknown .icon { width: 60%; height: 60%; }
.avatar-group .avatar { box-shadow: 0 0 0 2px var(--_ring, var(--surface-1)); }

/* ---- J-43 Progress bar ---- */
.progress__fill { transition: width var(--dur-base) var(--ease-standard); }
.progress--stack .progress__fill { background: var(--_c, var(--accent)); }
.progress-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; row-gap: var(--space-4); column-gap: var(--space-8); min-width: 0; }
.progress-field > .progress { grid-column: 1 / -1; }
.progress-field__label { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-field__value { font-size: var(--fs-caption); line-height: var(--lh-caption); font-variant-numeric: tabular-nums; }
@keyframes enj-indeterminate { from { margin-inline-start: -30%; } to { margin-inline-start: 100%; } }
.progress--indeterminate .progress__fill { width: 30%; flex: none; animation: enj-indeterminate calc(var(--dur-slow) * 6) var(--ease-standard) infinite; }
@media (prefers-reduced-motion: reduce) { .progress--indeterminate .progress__fill { animation: none; } }
[data-reduce-motion="reduce"] .progress--indeterminate .progress__fill { animation: none; }

/* ---- J-44 Progress ring ---- */
@property --_rv { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
.ring { --_rv: var(--v, 0%); background: conic-gradient(var(--_rc, var(--task-done-solid)) 0 var(--_rv), var(--chart-track) 0); transition: --_rv var(--dur-base) var(--ease-standard); }
.ring--sm { --size: 24px; }
.ring-wrap__check { position: absolute; width: 20px; height: 20px; color: var(--task-done-fg); }

/* ---- J-45 Stat tile as a description list ---- */
dl.stat, .stat dd { margin: 0; }

/* ---- J-46 Task row ---- */
.task-row:has(> .task-row__main:active) { background: var(--state-pressed); }
.task-row--compact .meta { max-width: 50%; }

/* ---- J-47 Task card: pressed (not while an inner control is pressed) ---- */
.task-card:active:not(:has(button:active)) { background-image: linear-gradient(var(--state-pressed), var(--state-pressed)), var(--material-panel-texture); }

/* ---- J-48 Task chip ---- */
.task-chip:active { background-image: linear-gradient(var(--state-pressed), var(--state-pressed)); }
.task-chip--span.is-start { border-start-start-radius: var(--radius-chip); border-end-start-radius: var(--radius-chip); }
.task-chip--span.is-end { border-start-end-radius: var(--radius-chip); border-end-end-radius: var(--radius-chip); }
.wk-event .task-chip { min-height: 24px; }
.task-chip.is-dragging { box-shadow: var(--shadow-2); }
.cal-cell.is-drop { box-shadow: inset 0 0 0 2px var(--accent-border); background: var(--accent-subtle-bg); }

/* ---- J-49 Task bar ---- */
.task-bar:hover:not(.is-overdue):not(.is-selected):not(.is-done) { box-shadow: inset 0 0 0 1.5px var(--_c, var(--border-strong)), var(--shadow-1); }
.task-bar::before, .task-bar::after { content: ""; position: absolute; inset-block: 0; width: var(--space-6); cursor: ew-resize; }
.task-bar::before { inset-inline-start: 0; }
.task-bar::after { inset-inline-end: 0; }
.task-bar.is-dragging { box-shadow: inset 0 0 0 1.5px var(--_c, var(--border-strong)), var(--shadow-3); }

/* ---- J-50 Activity item ---- */
.activity-item.is-unread .activity-item__time::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-start: var(--space-6); border-radius: var(--radius-pill); background: var(--accent); vertical-align: middle; }
.activity-item__task { padding-block: 2px; }

/* ---- J-52 Navigation row ---- */
.nav-row:active:not(:has(button:active)) { background: var(--state-pressed); }
.nav-row.is-drop-after::after { content: ""; position: absolute; inset-inline: var(--space-8) 0; inset-block-end: -1px; height: 2px; border-radius: 1px; background: var(--accent); }

/* ---- J-53 List item: picked option in a picker ---- */
.list-item[aria-selected="true"]:not(.is-active) { background: var(--state-selected-bg); }
.list-item__check { width: 16px; height: 16px; color: var(--accent-text); flex: none; }

/* ---- J-54 Breadcrumb: 24 px targets ---- */
.breadcrumb a, .breadcrumb button { min-height: 24px; padding-block: 3px; }
.breadcrumb a:active, .breadcrumb button:active { background: var(--state-pressed); }

/* ---- J-56 Section header ---- */
.section-header--divider { box-shadow: inset 0 -1px 0 var(--border-subtle); padding-block-end: var(--space-4); }

/* ---- J-57 Card ---- */
.card__footer { display: flex; align-items: center; gap: var(--space-8); margin-block-start: var(--space-12); padding-block-start: var(--space-12); box-shadow: inset 0 1px 0 var(--border-subtle); }
.card--interactive:active:not(:has(button:active)) { background-image: linear-gradient(var(--state-pressed), var(--state-pressed)), var(--material-panel-texture); }
.card:has(.card__link) { position: relative; }
.card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card:has(.card__link) :is(a, button):not(.card__link) { position: relative; z-index: 1; }

/* ---- J-58 Disclosure ---- */
.disclosure__trigger:active, .tree-toggle:active { background-color: var(--state-pressed); }
button.group-head:active, .bucket__head:active { background-image: linear-gradient(var(--state-pressed), var(--state-pressed)); }
[data-platform="phone"] .tree-toggle::before { inset: calc((var(--size-touch) - 20px) / -2); }

/* ---- J-59 Drop indicator: the line starts at the target depth ---- */
.task-row > .drop-line { inset-inline-start: calc(var(--space-8) + var(--drop-depth, var(--depth, 0)) * 24px); }

/* ---- J-63 Compact callout ---- */
.callout--compact { padding-block: var(--space-6); padding-inline: var(--space-12) var(--space-8); align-items: center; }

/* ---- J-65 Toast countdown (pauses while the pointer or focus is inside) ---- */
@keyframes enj-countdown { from { width: 100%; } to { width: 0%; } }
.toast__timer::after { width: 100%; animation: enj-countdown var(--toast-duration, 5s) linear forwards; }
.toast:hover .toast__timer::after, .toast:focus-within .toast__timer::after { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .toast__timer::after { animation: none; } }
[data-reduce-motion="reduce"] .toast__timer::after { animation: none; }

/* Enjazy 2 — component library · states added for area c after the spec review. Tokens only, logical properties only. */

/* ---- D-041 editor header: offline save status, collapsed breadcrumb, live resize ---- */
.save-status.is-offline .icon { color: var(--warning-fg); }
.breadcrumb .breadcrumb__more { flex: none; min-inline-size: 24px; text-align: center; letter-spacing: 1px; }
.app-panel__resize.is-dragging { background: var(--focus-ring); opacity: 1; }

/* title grows with its text, 1–3 lines (no reserved empty band under one-line titles, D-041 open point 5) */
.editor-title__input { field-sizing: content; block-size: auto; min-block-size: calc(var(--lh-title) + 8px); max-block-size: calc(var(--lh-title) * 3 + 8px); }
/* date fields in the Details card span the value column (Start matched Due only by accident of its wrapper) */
#sec-details .prop__value > .date-field-wrap { flex: 1 1 auto; inline-size: 100%; }

/* view only: a done task keeps its filled check while inert (the disabled ring would read as "not done") */
.task-row:not(.is-bulk) .task-check[disabled][data-state="done"]::before, .editor-title .task-check[disabled][data-state="done"]::before { background: var(--task-done-solid); box-shadow: none; }

/* title required (J-16 error on the title field) */
.editor-title__input.has-error { box-shadow: inset 0 0 0 1.5px var(--danger-fg); background: var(--surface-1); }

/* ---- D-044 field controls: unset priority (DEC-007), repeat without due ---- */
.mini-matrix.is-none { outline: 1px dashed var(--border-strong); outline-offset: 3px; border-radius: var(--radius-control); }
.mini-matrix.is-none .mini-matrix__cell { color: var(--text-secondary); }
.prio-prompt { margin-block-start: var(--space-4); }
.prio-prompt .t-label { color: var(--text-primary); }
.repeat-needs-due { flex-wrap: wrap; row-gap: 0; }
.status-pill { align-self: flex-start; }

/* ---- D-045 time: paused control, near / over read-outs, focus panel ---- */
.timer-ctl.is-paused .timer-ctl__time { color: var(--text-secondary); }
.timer-ctl--default { flex-wrap: wrap; row-gap: var(--space-4); }
.time-over { color: var(--warning-fg); }
.stat > .btn--link { align-self: flex-start; }
.time-flag { display: inline-flex; align-items: center; gap: var(--space-4); color: var(--text-secondary); }
.time-flag.is-over { color: var(--warning-fg); font-weight: var(--fw-medium); }
.focus-panel { inline-size: min(340px, 100%); border-radius: var(--radius-dialog); --_elev: var(--shadow-3); }
.focus-panel.is-ended { box-shadow: inset 0 0 0 1px var(--success-border), var(--_elev); }
.focus-clock { font-size: var(--fs-display); line-height: var(--lh-display); }

/* ---- D-046 sub-tasks: tree, grip in the compact rows, drag, notices ---- */
.sub-tree { position: relative; }
.sub-tree .task-row.is-dragging .task-row__handle, .sub-tree .task-row.is-focus .task-row__handle { opacity: 1; }
.sub-tree.is-loading .skeleton-row { block-size: var(--size-row-task-compact); }
.editor-card .callout .row { flex-wrap: wrap; }

/* ---- D-047 activity and attachments ---- */
.comment__body, .comment__edit { padding-inline-start: calc(24px + var(--space-8)); }
.comment.is-sending .comment__body { color: var(--text-secondary); }
.comment-error { flex-wrap: wrap; align-items: flex-start; }
.comment-error .inline-msg { flex: 1 1 200px; }
.act-skel { display: flex; flex-direction: column; gap: var(--space-8); padding-block: var(--space-4); }
.act-skel .sk-line { inline-size: var(--w); block-size: 12px; border-radius: var(--radius-control); }
.file-row.is-missing > .icon { color: var(--text-disabled); }
.file-row__missing { display: inline-flex; align-items: center; gap: var(--space-4); color: var(--text-secondary); }
.file-row__missing .icon { color: var(--warning-fg); }
.editor-card.is-drop-target { position: relative; box-shadow: inset 0 0 0 1.5px var(--accent-border); background: var(--accent-subtle-bg); outline: 1.5px dashed var(--accent-border); outline-offset: -1.5px; }
.file-drop { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: var(--space-4); border-radius: inherit; background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); font-weight: var(--fw-medium); font-size: var(--fs-body-sm); }
.file-drop .icon { inline-size: 24px; block-size: 24px; }

/* ---- D-048 AI: icon and title on one line; suggestion rows ---- */
.ai-title { display: inline-flex; align-items: center; gap: var(--space-6); }
.ai-title .icon { color: var(--accent-text); flex: none; }
.ai-suggest__head { display: flex; align-items: center; gap: var(--space-6); color: var(--accent-subtle-fg); }
.ai-suggest__head .t-label { color: var(--text-primary); }
.ai-suggest__row { display: flex; align-items: flex-start; gap: var(--space-8); }
.ai-suggest__row .check-field { flex: 1 1 auto; min-inline-size: 0; }
.ai-suggest__row .badge { margin-block-start: 5px; }
.ai-thinking { min-block-size: var(--size-control-sm); }

/* ---- D-049 task not available, in every host ---- */
.task-gone { display: flex; flex-direction: column; align-items: center; }
.task-gone-host { display: grid; align-content: center; min-block-size: 100%; }
.task-gone-host--compact { align-content: start; padding: var(--space-8); }
.task-gone--compact { align-items: stretch; }
.task-gone--compact .empty { border-radius: var(--radius-card); background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--border-subtle); }
.task-gone--compact .empty__actions { justify-content: flex-start; }
.task-gone--phone { padding-block-start: var(--space-24); }
.task-gone--phone .empty__actions { flex-direction: column; align-self: stretch; inline-size: 100%; }
.task-gone--phone .empty__actions .btn { inline-size: 100%; justify-content: center; }
/* loading: the editor's skeleton (title line, section bar, six field rows) — never the empty copy */
.editor-skel { display: flex; flex-direction: column; gap: var(--space-12); }
.editor-skel__title { display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: var(--space-8); min-block-size: 64px; }
.editor-skel__title .sk-check { inline-size: 20px; block-size: 20px; border-radius: 50%; justify-self: center; }
.editor-skel__line { inline-size: var(--w, 60%); block-size: 12px; border-radius: var(--radius-control); }
.editor-skel__title .editor-skel__line { block-size: 20px; }
.editor-skel__jump { display: flex; gap: var(--space-8); }
.editor-skel__jump .skeleton { inline-size: var(--w); block-size: 20px; border-radius: var(--radius-chip); }
.editor-skel__card { gap: var(--space-16); }
.editor-skel__row { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: var(--space-8); min-block-size: 28px; }
.editor-skel__label { inline-size: 64px; block-size: 10px; border-radius: var(--radius-control); }

/* ---- D-040 compact row (J-46 gap rule): the title keeps at least half the row; meta gives way first ---- */
.task-row--compact .meta { flex: 0 1 auto; max-inline-size: 50%; min-inline-size: 0; overflow: hidden; }
.task-row--compact .task-row__title { min-inline-size: 50%; }

/* ---- D-040 task item: pressed, no-drop, static toast and touch specimen on the sheet ---- */
.task-row.is-pressed { background: var(--state-pressed); }
.task-row.is-pressed .task-check { transform: scale(.92); }
.drop-zone__msg { display: inline-flex; align-items: center; gap: var(--space-4); }
.task-row.is-no-drop { cursor: no-drop; box-shadow: inset 0 0 0 1.5px var(--danger-border); }
.activity-item__task.is-gone { color: var(--text-secondary); font-weight: var(--fw-regular); }
.ti-toast { display: flex; }
/* specimen wrappers re-derive the row height from their own density / platform tokens */
.ti-density, .ti-touch { --task-row-height: var(--size-row-task); }
.ti-toast .toast { inline-size: min(480px, 100%); }

/* Enjazy 2 — component library · states added for area d after the spec review. Tokens only, logical properties only. */

/* ---- D-050 view template: state bodies, gate, locked scope, summary skeleton ---- */
.vs-rows { padding-inline: var(--space-24); }
.vs-center { padding-block-start: var(--space-24); }
.vs-note { display: block; margin-block-start: var(--space-8); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.empty--gate { width: min(480px, 100%); }
.empty--gate .empty__title, .empty--locked .empty__title { white-space: normal; }
.empty--success .empty__art { background: var(--success-bg); color: var(--success-fg); }
.vs-msg { padding: 0 var(--space-24) var(--space-12); }
.vs-msg > .empty, .vs-cal--msg > .empty { width: 100%; max-inline-size: 720px; margin-inline: 0; }
.vs-notice { padding: 0 var(--space-24) var(--space-8); }
.vs-read { max-inline-size: 880px; padding: 0 var(--space-24) var(--space-24); }
.vs-read > .empty--inline { margin-block: var(--space-4) var(--space-8); }

/* skeleton shapes per view (J-66): same shimmer, the view's own geometry */
.sk-sub { display: inline-block; inline-size: 60px; block-size: 10px; border-radius: var(--radius-pill); vertical-align: middle; }
.sk-line { display: block; block-size: 10px; inline-size: var(--w, 100%); border-radius: var(--radius-pill); flex: none; }
.sk-line--sm { block-size: 8px; }
.sk-val { display: block; inline-size: 64px; block-size: 24px; border-radius: var(--radius-control); }
.sk-chip { display: block; block-size: 18px; inline-size: var(--w, 70%); border-radius: var(--radius-chip); flex: none; }
.sk-dot { display: block; inline-size: 14px; block-size: 14px; border-radius: 4px; flex: none; }
.sk-avatar { display: block; inline-size: 32px; block-size: 32px; border-radius: 50%; }
.sk-card { display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-12); border-radius: var(--radius-card); background: var(--surface-1); box-shadow: inset 0 0 0 var(--bw-hairline) var(--border-subtle); }
.sk-qrow { display: flex; align-items: center; gap: var(--space-8); block-size: 32px; padding-inline: var(--space-8); }
.sk-bars { display: flex; align-items: flex-end; gap: var(--space-8); block-size: 120px; }
.sk-bars .skeleton { flex: 1 1 0; block-size: var(--h); border-radius: 3px 3px 0 0; }
.gantt__band { position: relative; }
.sk-bar { position: absolute; inset-block-start: 10px; inset-inline-start: var(--x); inline-size: var(--w); block-size: 20px; border-radius: var(--radius-control); }

/* view options: per-view popover (role dialog) */
.vs-options { inline-size: 300px; }
.vs-opt { justify-content: space-between; }
.vs-opt--stack { display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-8); }

/* J-33 cascade: the row menu with the view's move submenu open beside it (the drag alternative) */
.menu-cascade { display: flex; align-items: flex-start; gap: var(--space-4); }
.menu-cascade > .menu + .menu { margin-block-start: calc(var(--_rows, 0) * var(--size-row-menu) + var(--_seps, 0) * 9px); min-inline-size: 200px; }

/* drag feedback shared by the views: date/level tip, ghost at the origin */
.drag-tip { position: absolute; z-index: 3; pointer-events: none; }
.drag-tip .tooltip { position: static; }

/* ---- D-055 Upcoming ---- (reading width and gutters come from .vs-read) */

/* ---- D-053 Calendar: week rows, weekend vs out-of-month, drop target ---- */
.vs-cal { padding: 0 var(--space-24) var(--space-16); overflow: hidden; display: flex; flex-direction: column; gap: var(--space-8); }
.vs-cal > .cal { flex: 1 1 0; min-block-size: 0; }
.cal-week { display: contents; }
.cal-cell.is-out { background: none; }
.cal-cell.is-out .cal-cell__num { color: var(--text-secondary); }
.cal-cell.is-weekend, .cal-head__day.is-weekend { background: var(--surface-2); }
.wk-col.is-weekend:not(.is-today), .wk-allday.is-weekend { background: var(--surface-2); }
.cal-cell.is-drop { background: var(--accent-subtle-bg); box-shadow: inset 0 0 0 2px var(--accent-border); overflow: visible; z-index: 2; }
.cal-drop { position: relative; }
.cal-drop .drag-tip { inset-block-start: calc(100% + 4px); inset-inline-start: 0; }
.task-chip.is-dragging { background: var(--surface-raised); box-shadow: var(--shadow-2), inset 0 0 0 2px var(--state-selected-border); cursor: grabbing; }
.task-chip.is-ghost { background: none; color: var(--text-secondary); outline: var(--bw-hairline) dashed var(--border-strong); outline-offset: -1px; }
.task-chip.is-ghost .task-chip__edge { background: var(--border-default); }

/* ---- D-052 Board: kept columns, empty column as a drop zone ---- */
.vs-board { overflow: hidden; }
.vs-board--msg { display: flex; flex-direction: column; }
.vs-board--msg > .board { flex: 1 1 0; block-size: auto; min-block-size: 0; }
.empty--column { flex-direction: column; text-align: center; gap: var(--space-4); padding: var(--space-16) var(--space-12); border: var(--bw-hairline) dashed var(--border-strong); border-radius: var(--radius-card); }
.empty--column .empty__art { margin: 0; }
.empty--column .empty__title { white-space: normal; }
.empty--column .empty__body { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); }
.board-col.is-drop .empty--column { border-color: var(--accent-border); }

/* ---- D-054 Timeline: groups, locked row, marker states, ghost + lifted bar, scale ticks ---- */
/* the gantt grows with its rows so the view body scrolls (it was clipped at the viewport, rows below the fold unreachable) */
.view-body > .gantt { block-size: auto; min-block-size: 100%; }
.gantt__row--list { font-weight: var(--fw-semibold); }
.gantt__row.is-done .trunc { color: var(--text-secondary); text-decoration: line-through; }
.gantt__group .tree-toggle, .gantt__row .tree-toggle { flex: none; }
.gantt__tick { text-align: start; padding-inline-start: var(--space-6); white-space: nowrap; overflow: hidden; }
.vs-locked-row { color: var(--text-secondary); }
.vs-locked-row .icon { color: var(--text-secondary); flex: none; }
.vs-locked-band { display: flex; align-items: center; padding-inline: var(--space-12); }
.milestone { border: 0; padding: 0; cursor: pointer; }
.milestone:focus-visible, .task-bar:focus-visible { outline: var(--bw-focus) solid var(--focus-ring); outline-offset: 2px; }
.milestone.is-overdue { background: var(--danger-fg); }
.milestone.is-done { background: none; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.task-bar__outside.is-overdue { color: var(--task-overdue-fg); }
.task-bar__outside.is-done bdi { text-decoration: line-through; }
.vs-tag::before { content: " · "; }
.task-bar > .icon { inline-size: 12px; block-size: 12px; flex: none; color: var(--danger-fg); }
.task-bar.is-dragging { z-index: 3; box-shadow: inset 0 0 0 2px var(--accent-border), var(--shadow-3); cursor: grabbing; }
.task-bar--ghost { background: none; box-shadow: none; outline: 1.5px dashed var(--border-strong); outline-offset: -1.5px; cursor: default; }
.chart__legend i.vs-legend-diamond { --_c: var(--accent); transform: rotate(45deg) scale(.85); }
.chart__legend i.vs-legend-line { --_c: var(--warning-fg); block-size: 2px; }

/* ---- D-056 Priority matrix: tray rows with the mini 2×2 picker, drop preview ---- */
.tray { flex-direction: column; align-items: stretch; }
.tray__bar { display: flex; align-items: center; gap: var(--space-8); }
.tray__rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-16); max-block-size: 200px; overflow: auto; padding-block-start: var(--space-4); box-shadow: inset 0 1px 0 var(--border-subtle); }
.tray__row { display: flex; align-items: center; gap: var(--space-8); min-inline-size: 0; }
.tray__row > .task-row { flex: 1 1 0; min-inline-size: 0; }
.mx-picker { display: grid; grid-template-columns: repeat(2, 20px); gap: 2px; flex: none; }
.mx-picker .icon-btn[data-q="do"] { color: var(--prio-do-fg); }
.mx-picker .icon-btn[data-q="schedule"] { color: var(--prio-schedule-fg); }
.mx-picker .icon-btn[data-q="delegate"] { color: var(--prio-delegate-fg); }
.mx-picker .icon-btn[data-q="drop"] { color: var(--prio-drop-fg); }
.vs-quad-empty { padding: var(--space-8); }
.quad.is-drop { background: var(--accent-subtle-bg); box-shadow: inset 0 0 0 2px var(--accent-border); }
.vs-lifted { position: relative; border-radius: var(--radius-control); background: var(--surface-raised); box-shadow: var(--shadow-3); margin-block-end: var(--space-4); }
.vs-preview { display: inline-block; margin: 0 var(--space-8) var(--space-6); padding: 2px var(--space-8); border-radius: var(--radius-pill); background: var(--accent-subtle-bg); color: var(--accent-subtle-fg); font-size: var(--fs-caption); line-height: var(--lh-caption); }
.vs-preview b { font-weight: var(--fw-semibold); }
.quad__body .is-ghost .task-row { background: var(--surface-sunken); outline: var(--bw-hairline) dashed var(--border-strong); outline-offset: -1px; }
.quad__body .is-ghost .task-row__title { color: var(--text-secondary); }

/* ---- D-051 Dashboard: charts with HTML labels at the type scale, verdict rows ---- */
.chart-box { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-8); margin: 0; }
.chart-box__y { position: relative; block-size: calc(var(--_h) - 24px); min-inline-size: 16px; }
.chart-box__yt { position: absolute; inset-inline-end: 0; inset-block-end: var(--y); transform: translateY(50%); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--chart-axis); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-box__plot { position: relative; min-inline-size: 0; }
.chart-box__plot svg { display: block; inline-size: 100%; block-size: calc(var(--_h) - 24px); overflow: visible; }
[dir="rtl"] .chart-box__plot svg { transform: scaleX(-1); }
.chart-box__x { position: relative; block-size: 24px; }
.chart-box__xt { position: absolute; inset-block-start: 6px; inset-inline-start: var(--x); transform: translateX(-50%); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--chart-axis); white-space: nowrap; font-variant-numeric: tabular-nums; }
[dir="rtl"] .chart-box__xt { transform: translateX(50%); }
.chart-box__xt.is-end { inset-inline-start: auto; inset-inline-end: 0; transform: none; }
.chart__cap { stroke: var(--warning-fg); stroke-width: 1.5; stroke-dasharray: 4 3; }
.bar.is-over { fill: var(--warning-solid); }
.vs-bar-row { min-block-size: 36px; }
.vs-bar-row__name { flex: 0 0 140px; }
.vs-bar-row__val { flex: 0 0 88px; text-align: end; }
.vs-pop { inline-size: 340px; padding: var(--space-16); }
/* narrow cards (editor open): titles take a second line instead of an ellipsis; the legend moves under them */
.dash .card__header { flex-wrap: wrap; row-gap: var(--space-4); }
.dash .card__header .t-heading { flex: 1 0 auto; max-inline-size: 100%; white-space: normal; overflow: visible; }

/* ---- D-057 Activity: locked and deleted items, end of feed ---- */
.activity-item__task.is-locked { color: var(--text-secondary); text-decoration: underline dotted; text-underline-offset: 3px; }
.activity-item__task.is-deleted { color: var(--text-secondary); font-weight: var(--fw-medium); }
.activity-item.is-locked .activity-item__sub { display: flex; align-items: center; gap: var(--space-4); }
.activity-item__sub .icon { inline-size: 12px; block-size: 12px; flex: none; }
.vs-end { padding: var(--space-16) var(--space-8) 0; text-align: center; }
.vs-subbar { display: flex; align-items: center; gap: var(--space-12); flex-wrap: wrap; min-block-size: 32px; padding: 0 var(--space-24) var(--space-8); }
/* D-050 OP-11: with the editor open, the view toolbar wraps to a second row instead of clipping its controls */
.view .view-toolbar { flex-wrap: wrap; row-gap: var(--space-8); }

/* ---- D-051 parity content: Now second row (Completion · Due today · Points done), Tasks · Points trend, on-time bars,
   breakdown rows with due span, badges, points and the period's figures ---- */
.dash-tile__row { align-items: center; }
.dash-tile__bar { display: flex; align-items: center; gap: var(--space-8); inline-size: 100%; font-variant-numeric: tabular-nums; }
.dash-tile__bar .progress { flex: 1 1 auto; }
.stat__delta > .icon { inline-size: 14px; block-size: 14px; flex: none; }
.bar.bar--ontime { fill: var(--task-done-solid); }
.bar.bar--late { fill: var(--warning-solid); }
/* the daily on-time / late bars need room: under a 280 px card body only the ring and the counts stay (tables stay for AT) */
.dash-ontime { container-type: inline-size; }
.dash-ontime__bars { margin-block-start: var(--space-12); }
@container (max-width: 279px) { .dash-ontime__bars, .dash-ontime__legend { display: none; } }
.dash-rows { gap: var(--space-8); }
.dash-row { display: flex; flex-direction: column; gap: var(--space-2); min-inline-size: 0; }
.dash-row + .dash-row { padding-block-start: var(--space-8); box-shadow: inset 0 1px 0 var(--border-subtle); }
.dash-row .vs-bar-row { min-block-size: 32px; }
.dash-row .vs-bar-row__val { flex: 0 0 auto; min-inline-size: 88px; }
.dash-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-12); padding-inline-start: calc(10px + var(--space-12)); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.dash-row--tag .dash-row__meta { padding-inline-start: 0; }
.dash-row__t { font-variant-numeric: tabular-nums; }
.dash-row__none { --_c: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.dash-note { display: flex; align-items: center; gap: var(--space-6); margin: var(--space-12) 0 0; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.dash-note .icon { flex: none; }

/* Enjazy 2 — component library · states added for area fg after the spec review. Tokens only, logical properties only. */

/* ==========================================================================
   Compact rows (sticky note, compact window, sub-tasks, phone quadrants) — the title keeps priority:
   it keeps its own width up to 70 % of the row; the metadata gets what is left and shows each fact whole
   or not at all (a zero-width first item lets even the first fact wrap onto the hidden second line);
   in a very narrow row the metadata is hidden.
   ========================================================================== */
.task-row--compact .task-row__main { container-type: inline-size; justify-content: flex-start; }
.task-row--compact .task-row__title { flex: 0 1 auto; min-width: 0; max-width: 70%; }
.task-row--compact .task-row__title:only-child { max-width: none; }
.task-row--compact .meta { flex: 1 1 0; min-width: 0; justify-content: flex-end; }
.task-row--compact .meta::before { content: ""; width: 0; height: var(--lh-caption); margin-inline-end: calc(var(--space-8) * -1); }
@container (max-width: 160px) {
  .task-row--compact .meta { display: none; }
  .task-row--compact .task-row__title { max-width: none; }
}
.task-row.is-new { background: var(--accent-subtle-bg); }
.sticky .task-row.is-hover { background: var(--state-hover); }

/* ---- text never under 12 px: the priority legend's axis labels ---- */
.mini-matrix__axis { font-size: var(--fs-caption); line-height: var(--lh-caption); }

/* ==========================================================================
   Read-only editor (viewer, D-043 / D-042): values read as text, no edit affordances
   ========================================================================== */
.editor__body.is-readonly .segmented__opt[aria-checked="false"],
.editor__body.is-readonly .level-picker__opt[aria-checked="false"] { display: none; }
.editor__body.is-readonly .segmented,
.editor__body.is-readonly .level-picker { display: inline-flex; width: auto; background: none; box-shadow: none; padding: 0; }
.editor__body.is-readonly .segmented__opt[aria-checked="true"],
.editor__body.is-readonly .level-picker__opt[aria-checked="true"] { color: var(--text-primary); background: var(--surface-sunken); box-shadow: none; cursor: default; }
.editor__body.is-readonly .input,
.editor__body.is-readonly .date-field,
.editor__body.is-readonly .select { --_bw: 0px; background: none; padding-inline: 0; cursor: default; }
.editor__body.is-readonly .select > .icon:last-child,
.editor__body.is-readonly .date-field > .icon,
.editor__body.is-readonly .number-field__step,
.editor__body.is-readonly .timer-ctl { display: none; }
.editor__body.is-readonly .number-field > input { flex: none; width: 3ch; text-align: start; }
.editor__body.is-readonly .combobox:empty::after { content: "—"; color: var(--text-secondary); }
.editor__body.is-readonly .editor-card:has(> .textarea textarea:placeholder-shown),
.editor__body.is-readonly .prio-prompt { display: none; }

/* ==========================================================================
   Phone shell (D-070 … D-074)
   ========================================================================== */
.app-bar .sync-status.icon-btn { padding: 0; justify-content: center; }
.app-bar > .badge, .app-bar > .save-status { flex: none; }
.app-bar__crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.app-bar__crumbs .icon { flex: none; width: 12px; height: 12px; }
.app-bar__crumb { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar__crumb:not(:last-child) { flex-shrink: 8; min-width: 3ch; }
.bottom-nav__pill { position: relative; }
.bottom-nav__gem { position: absolute; inset-block-start: -2px; inset-inline-end: 6px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--accent-text); }
.bottom-nav__gem .icon { width: 12px; height: 12px; }
.bottom-nav__item.is-gated .bottom-nav__label { color: var(--text-secondary); }
.tile-btn { position: relative; }
.tile-btn__gem { position: absolute; inset-block-start: var(--space-6); inset-inline-end: var(--space-6); display: grid; place-items: center; color: var(--accent-text); }
.tile-btn__gem .icon { width: 14px; height: 14px; }
.tile-btn.is-gated > span:not(.tile-btn__gem) { color: var(--text-secondary); }
/* FAB hides on scroll down (DEC-029) and comes back on focus */
.phone .fab { transition: transform var(--dur-base) var(--ease-standard), opacity var(--dur-base) var(--ease-standard); }
.phone .fab.is-hidden { transform: translateY(calc(100% + var(--space-24))); opacity: 0; }
.phone .fab.is-hidden:focus-visible { transform: none; opacity: 1; }
[data-reduce-motion="reduce"] .phone .fab { transition: none; }
@media (prefers-reduced-motion: reduce) { .phone .fab { transition: none; } }
/* J-51 timer strip: the text column is a button (opens the task) */
.timer-bar__text { flex: 1 1 0; min-width: 0; min-height: 48px; display: flex; flex-direction: column; justify-content: center; align-items: stretch; text-align: start; padding-inline: var(--space-4); margin-inline: calc(var(--space-4) * -1) 0; border-radius: var(--radius-control); color: inherit; }
.timer-bar__text:hover { background: var(--state-hover); }
.timer-bar__line { display: flex; align-items: center; gap: var(--space-8); min-width: 0; }
.timer-bar__mode { display: inline-flex; align-items: center; gap: var(--space-4); font-size: var(--fs-caption); line-height: var(--lh-caption); white-space: nowrap; }
/* toasts never sit under the raised FAB, the action bar or an open sheet */
.phone .timer-bar ~ .toast-region { bottom: calc(var(--layout-phone-nav-h) + 20px + 56px + 76px); }
.phone .editor-actions ~ .toast-region { bottom: calc(64px + 20px + var(--space-8)); }
.phone.has-sheet .toast-region { bottom: auto; inset-block-start: calc(24px + var(--layout-phone-appbar-h) + var(--space-8)); }
/* narrow toast on the phone (owner Q1, PD-2973): a toast with action buttons keeps its text on the first line at full width and puts the actions under it, at the end */
[data-platform="phone"] .toast:has(> .btn), .phone .toast:has(> .btn) { flex-wrap: wrap; row-gap: var(--space-4); }
[data-platform="phone"] .toast:has(> .btn) > .toast__text, .phone .toast:has(> .btn) > .toast__text { flex: 1 1 calc(100% - 18px - var(--space-12)); }
[data-platform="phone"] .toast:has(> .btn) > .toast__text + .btn, .phone .toast:has(> .btn) > .toast__text + .btn { margin-inline-start: auto; }
/* pull to refresh */
.pull-refresh { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); padding-block: var(--space-12) var(--space-4); color: var(--text-secondary); }
.pull-refresh__disc { width: 40px; height: 40px; border-radius: var(--radius-pill); display: grid; place-items: center; background: var(--surface-raised); box-shadow: var(--shadow-2); color: var(--accent-text); }
.pull-refresh.is-armed .pull-refresh__disc { background: var(--accent); color: var(--on-accent); }
.phone-note { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-6); margin: 0; padding: var(--space-12) var(--space-4); font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.phone-note .icon { flex: none; }
/* rows and lists */
.phone .nav-row { height: 56px; }
.nav-row__text { display: flex; flex-direction: column; min-width: 0; }
.nav-row__sub { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone-crumbs { padding-block: var(--space-4) var(--space-8); }
.chip-group--scroll { flex-wrap: nowrap; overflow: auto; padding-block-end: var(--space-8); scrollbar-width: none; }
.phone-bulk__btn[aria-disabled="true"] { color: var(--text-disabled); cursor: not-allowed; }
[data-platform="phone"] .task-row.is-bulk .select-mark { position: relative; }
[data-platform="phone"] .task-row.is-bulk .select-mark::before { content: ""; position: absolute; inset: -12px; }
.phone .task-card__top { grid-template-columns: 48px minmax(0, 1fr) auto; }
.phone .task-card__top .task-check { margin-block-start: -12px; margin-inline-start: -12px; }
/* touch: 48 px hit areas for the small controls the phone pages use (visual size unchanged) */
[data-platform="phone"] .jump-bar__link, [data-platform="phone"] .scope-chip, [data-platform="phone"] .breadcrumb > button, [data-platform="phone"] .more-link { position: relative; }
[data-platform="phone"] .jump-bar__link::before, [data-platform="phone"] .scope-chip::before, [data-platform="phone"] .breadcrumb > button::before, [data-platform="phone"] .more-link::before { content: ""; position: absolute; inset-block: min(0px, calc((100% - 48px) / 2)); inset-inline: 0; }
[data-platform="phone"] .breadcrumb > button::before { inset-inline: min(0px, calc((100% - 48px) / 2)); }
[data-platform="phone"] .task-row--compact .task-check { width: 48px; height: 48px; --task-check-size: 24px; }
[data-platform="phone"] .number-field > input { min-width: 48px; }
[data-platform="phone"] .combobox > input { align-self: stretch; min-height: 44px; }
[data-platform="phone"] .task-card__grip { display: none; }   /* no drag on the phone board: Move to… (DEC-038) */
/* priority matrix: stacked sections keep their rows (the desktop quadrant fills a grid cell; the phone stacks) */
.phone .quad { flex: none; }
.phone .quad__body { flex: none; overflow: visible; }
.quad[data-q="none"] { box-shadow: inset 0 3px 0 var(--prio-none), inset 0 0 0 var(--bw-hairline) var(--border-default); }
.quad__empty { padding: var(--space-4) var(--space-8) var(--space-8); }
.phone .quad__head .icon-btn { margin-block: calc(var(--space-12) * -1) calc(var(--space-8) * -1); margin-inline-end: calc(var(--space-8) * -1); }
/* calendar month grid (≥ 48 px day cells) */
.month-grid { display: flex; flex-direction: column; gap: 2px; padding-block: var(--space-8); }
.month-grid__row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.month-grid__dow { text-align: center; font-size: var(--fs-caption); line-height: 24px; color: var(--text-secondary); }
.month-grid__day { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: var(--radius-control); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.month-grid__day:hover { background: var(--state-hover); }
.month-grid__day.is-out { color: var(--text-secondary); }
.month-grid__num { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-pill); font-size: var(--fs-body-sm); }
.month-grid__day.is-today .month-grid__num { box-shadow: inset 0 0 0 1.5px var(--accent-border); font-weight: var(--fw-semibold); }
.month-grid__day[aria-selected="true"] { background: var(--state-selected-bg); color: var(--state-selected-fg); font-weight: var(--fw-semibold); }
.week-strip__day.is-today:not(.is-selected) .week-strip__num { color: var(--accent-text); }
/* keyboard: accessory toolbar buttons, IME under an open sheet */
.os-keyboard__bar > button { display: inline-flex; align-items: center; gap: var(--space-4); min-height: 44px; padding-inline: var(--space-12); border-radius: var(--radius-control); color: var(--text-primary); }
.phone.has-ime .sheet { inset-block-end: 300px; max-height: calc(100% - 300px - 24px); }
.os-keyboard--ime { position: absolute; inset-inline: 0; inset-block-end: 0; z-index: calc(var(--z-dialog) + 1); }

/* ==========================================================================
   Sheets (J-30): description, sticky footer, full height, stacked, alert
   ========================================================================== */
/* titles carry user text: up to two lines, then an ellipsis */
.sheet__title { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.sheet__desc { margin: 0; font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); }
.sheet__footer { flex: none; padding: var(--space-8) var(--space-16) var(--space-16); box-shadow: inset 0 1px 0 var(--border-subtle); }
.sheet__footer .form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); margin: 0; padding: 0; box-shadow: none; }
.sheet--full { height: calc(100% - 48px); }
.sheet--full .sheet__body { flex: 1 1 0; }
.sheet--stacked { z-index: calc(var(--z-dialog) + 2); }
.scrim:has(+ .sheet--stacked) { z-index: calc(var(--z-dialog) + 1); }
.sheet--qa .quick-add__row > .btn[data-act="qaSubmit"] { display: none; }
.sheet .radio-opt { min-height: 56px; align-items: center; }
.sheet .radio-opt .badge { flex: none; }
.action-list__text { display: flex; flex-direction: column; min-width: 0; }
.action-list__sub { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.action-list__item[aria-disabled="true"], .action-list__item[aria-disabled="true"] .icon { color: var(--text-disabled); cursor: not-allowed; }
.phone-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.phone-checklist li { display: flex; align-items: center; gap: var(--space-8); min-height: 32px; font-size: var(--fs-body-sm); }
.phone-checklist .icon { flex: none; color: var(--success-fg); }
.phone-fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-6); }
.phone-quick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); }
.phone-pair { gap: var(--space-8); }
.input.is-focused { --_bw: 2px; --_bc: var(--focus-ring); }

/* ==========================================================================
   Tablet (D-076): the expanded navigation is a drawer over the content; the rail's slot stays
   ========================================================================== */
.app.is-nav-drawer .titlebar__brand { width: calc(var(--layout-nav-w-rail) + 8px); }
.app.is-nav-drawer .titlebar__brand .brand { display: none; }
.app.is-nav-drawer .app-main { position: relative; }
.app.is-nav-drawer .sidenav { position: absolute; inset-block: 0; inset-inline-start: 0; z-index: calc(var(--z-panel) + 2); box-shadow: var(--shadow-4); }
.sidenav-spacer { width: var(--layout-nav-w-rail); flex: none; background-color: var(--surface-2); box-shadow: inset -1px 0 0 var(--border-subtle); }
[dir="rtl"] .sidenav-spacer { box-shadow: inset 1px 0 0 var(--border-subtle); }
.nav-drawer-scrim { position: absolute; inset: 0; background: var(--scrim); z-index: calc(var(--z-panel) + 1); }

/* ==========================================================================
   Secondary windows (D-042, D-080 … D-083)
   ========================================================================== */
.mode-scope { height: 100%; }
.mode-scope[data-mode="dark"] { color-scheme: dark; }
.win-anchor { position: relative; height: 100%; }
.win-menu { position: absolute; inset-block-start: 36px; inset-inline-end: var(--space-4); z-index: var(--z-popover); }
.win-menu--editor { inset-block-start: calc(36px + 44px); inset-inline-end: var(--space-8); }
.popover-card { width: 244px; padding: var(--space-12); display: flex; flex-direction: column; gap: var(--space-8); }
.win-chrome__badge { display: inline-grid; place-items: center; flex: none; color: currentColor; }
.win-chrome__badge .icon { width: 14px; height: 14px; }
.win-chrome__mark { width: 16px; height: 16px; flex: none; }
/* forced interaction states for static boards (the live ones come from :hover / :active / :focus-visible) */
.win-chrome .icon-btn.is-hover { background-color: var(--state-hover); color: var(--text-primary); }
.win-chrome .icon-btn.is-active { background-color: var(--state-pressed); color: var(--text-primary); }
.win-chrome .icon-btn.is-focus { outline: var(--bw-focus) solid var(--focus-ring); outline-offset: calc(var(--bw-focus) * -1); }
/* FIX-A11Y-DESIGN #31: the live keyboard ring of title-bar / window-chrome buttons is drawn inside, like the forced example */
.win-chrome .icon-btn:focus-visible,
.win-btn:focus-visible,
.titlebar .icon-btn:focus-visible { outline-offset: calc(var(--bw-focus) * -1); }
.win-chrome .icon-btn--close.is-hover { background-color: var(--danger-solid); color: var(--on-danger); }
.win .toast-region { bottom: var(--space-8); padding-inline: var(--space-8); }
.sticky .toast-region { bottom: calc(32px + var(--space-8)); }
.win .toast { width: 100%; }
/* compact window */
.win-bar { display: flex; align-items: center; gap: var(--space-4); height: 40px; min-width: 0; padding-inline: var(--space-4) var(--space-8); box-shadow: inset 0 -1px 0 var(--border-subtle); flex: none; }
.win-bar__spacer { width: var(--space-8); flex: none; }
.win-bar .breadcrumb { min-width: 0; overflow: hidden; }
.mini-drill { padding: 6px; }
.win-qa { padding: var(--space-8); }
.win-qa.is-disabled .quick-add { background: var(--state-disabled-bg); color: var(--state-disabled-fg); }
.win-skeleton .skeleton-row { padding-inline: var(--space-16) var(--space-12); }
.win-note { display: flex; align-items: center; gap: var(--space-4); margin: 0; padding: var(--space-8) var(--space-12); }
.win-note-empty { padding: var(--space-8) var(--space-16); color: var(--_tintfg); }
.win-snap { min-height: 32px; padding-block: var(--space-4); }
.win-task { padding: var(--space-12); display: flex; flex-direction: column; gap: var(--space-12); }
.win-task__title { grid-template-columns: 32px minmax(0, 1fr); }
.win-task__title .t-heading { white-space: normal; }
.win-task__key { width: 80px; flex: none; }
/* timer window: row 1 task (a button that opens it) · row 2 clock + controls · row 3 status, so nothing clips at 260–300 px */
.timer-widget__task { display: inline-flex; align-items: center; gap: var(--space-4); max-width: 100%; min-width: 0; align-self: flex-start; color: var(--text-secondary); text-align: start; border-radius: var(--radius-chip); }
.timer-widget__task:hover { color: var(--text-primary); text-decoration: underline; }
.timer-widget__row { display: flex; align-items: center; gap: var(--space-8); min-width: 0; }
.timer-widget__status { display: flex; align-items: center; gap: var(--space-8); min-width: 0; }
.timer-widget__status .progress { flex: 1 1 0; }
.timer-widget__msg { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-4); margin: 0; }
.win-dock { position: absolute; inset-inline-end: var(--space-24); inset-block-end: calc(40px + var(--space-24)); width: 300px; height: 132px; }
/* task window: width rules (TSK-007) — stacked fields under 400 px, content capped at 600 px from 640 px */
.task-win .editor__body { container-type: inline-size; }
@container (max-width: 399px) {
  .task-win .prop { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-4); }
  .task-win .prio-row { grid-template-columns: minmax(0, 1fr); }
}
@container (min-width: 640px) {
  .task-win .editor__body > * { width: 100%; max-width: 600px; margin-inline: auto; }
}

/* ==========================================================================
   OS surfaces (D-084) — extra rows for the tray, app menu, taskbar menu and Android shade
   ========================================================================== */
.win-stage--split { justify-content: space-between; }
.os-menu--wide { width: 340px; }
.os-menu__key { width: 90px; flex: none; opacity: .7; }
.os-menu__head { padding: var(--space-8) 10px var(--space-4); font-weight: var(--fw-semibold); }
.os-menu__item > .icon, .os-menu__item > .brand__mark { width: 16px; height: 16px; flex: none; }
.os-toast__actions[data-n="1"] { grid-template-columns: 1fr; }
.os-toast__actions--text { display: flex; gap: var(--space-16); }
.os-toast__actions--text span { height: 32px; padding-inline: 0; background: none; font-weight: var(--fw-semibold); }
.android-shade, .android-channels { width: 380px; }
.os-status--shade { background: none; }

/* ---- D-073 phone Dashboard: the D-051 cards and numbers stacked full width; Now tiles two a row, Completion across ---- */
.dash-phone .dash-tiles { gap: var(--space-8); }
.dash-phone .dash-tile--wide { grid-column: 1 / -1; }
.dash-phone__band { padding-block-start: var(--space-8); }
.dash-phone .card__header { flex-wrap: wrap; row-gap: var(--space-4); }
.dash-phone .card__header .t-heading { flex: 1 0 auto; max-inline-size: 100%; white-space: normal; overflow: visible; }
.dash-phone .vs-bar-row__name { flex-basis: 104px; }
.dash-phone .dash-row .vs-bar-row__val { min-inline-size: 0; }
.dash-phone .prio-mix__seg { padding-inline: var(--space-6); }

/* ---- D-073 phone Board: Group by picker row; with Priority the chosen column is named under the switcher ---- */
.board-group { display: flex; align-items: center; gap: var(--space-12); }
.board-group > .select { flex: 1 1 auto; min-inline-size: 0; }
.board-col-note { align-items: flex-start; padding-block: var(--space-4); }
.board-col-note > .col { gap: 2px; }
.board-col-note strong { color: var(--text-primary); }
.phone .segmented__opt .prio { display: inline-flex; }
.phone .segmented__opt .num { font-variant-numeric: tabular-nums; }

/* ---- D-073 phone Calendar: View options is marked while a non-default option is on ---- */
.phone .icon-btn.is-set { color: var(--accent-text); }

/* ---- D-072 bulk bar: four or five equal columns (Reopen joins when done tasks are picked) ---- */
.phone-bulk { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
/* ---- D-072 smart-list editor: the live count sits in the footer, above Create ---- */
.smart-foot > p { margin: 0; }

/* ---- D-070 More: the profile card is a button to Settings › Account ---- */
.phone-profile { inline-size: 100%; text-align: start; color: inherit; font: inherit; cursor: pointer; }
.phone-profile > .icon { flex: none; color: var(--text-secondary); }
.phone-profile:active { background-image: linear-gradient(var(--state-pressed), var(--state-pressed)); }
.phone .segmented__opt .prio + .num { margin-inline-start: var(--space-4); }

/* Enjazy 2 — component library · states added for areas A (shell) and B (workspace) after the spec review. Tokens only, logical properties only. */

/* ---- shell (D-002): simulated hover and keyboard focus for the state renders; same tokens as :hover / :focus-visible ---- */
.nav-item.is-hover { background: var(--state-hover); }
.nav-item.is-focus { outline: var(--bw-focus) solid var(--focus-ring); outline-offset: -2px; }
.nav-item.is-gated > .icon { color: var(--text-secondary); }
/* the parked skip link casts no shadow into the title bar (the stray shadow at the window's inline-start corner) */
.skip-link:not(:focus):not(.is-visible) { box-shadow: none; }
/* quick-add help: examples in the UI face (WS-035: no monospace for Arabic), keycap-like chips */
[aria-labelledby="qah"] code { font-family: var(--font-ui); font-size: var(--fs-body-sm); padding-inline: var(--space-4); border-radius: var(--radius-chip); background: var(--surface-sunken); }

/* ---- menus and popover triggers: the trigger shows its open state; a disabled item dims its keycaps too ---- */
.toolbar .btn[aria-expanded="true"]:not([aria-pressed="true"]), .btn--tertiary[aria-expanded="true"]:not([aria-pressed="true"]) { background-color: var(--state-hover); color: var(--text-primary); }
.menu-item[aria-disabled="true"] .menu-item__hint, .menu-item[aria-disabled="true"] > .icon { opacity: .55; }
.menu-item__upgrade { color: var(--accent-text); font-weight: var(--fw-medium); }
/* a radio item with its own colour dot / icon and a trailing lock, on one line (scope menu, quick-add list picker) */
.menu-item__row { display: inline-flex; align-items: center; gap: var(--space-8); min-width: 0; max-width: 100%; }
.menu-item__row > .icon, .menu-item__row > .dot { flex: none; }
.menu-item__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item__lock { display: inline-flex; flex: none; color: var(--text-secondary); }
.menu-item__gem { display: inline-flex; color: var(--text-secondary); }

/* ---- navigator (D-021 … D-023) ---- */
.nav-row__grip { position: absolute; inset-inline-start: -2px; inset-block: 0; width: 12px; display: grid; place-items: center; color: var(--text-secondary); opacity: 0; cursor: grab; }
.nav-row__grip .icon { width: 12px; height: 12px; }
.nav-row:hover .nav-row__grip, .nav-row:focus-within .nav-row__grip, .nav-row.is-hover .nav-row__grip, .nav-row.is-focus .nav-row__grip, .nav-row.is-dragging .nav-row__grip { opacity: 1; }
.nav-row.is-hover { background: var(--state-hover); }
.nav-row.is-focus { outline: var(--bw-focus) solid var(--focus-ring); outline-offset: -2px; }
.nav-row.is-drop-target { background: var(--accent-subtle-bg); box-shadow: inset 0 0 0 2px var(--accent-border); }
.nav-row.is-editing { cursor: default; padding-inline-end: var(--space-8); }
.nav-row.is-editing:hover { background: none; }
/* the scope row is a filter, the open list is the page: the scope keeps its bar and colour without the fill */
.nav-row--scope[aria-current="true"] { background: none; }
.nav-skel { display: flex; align-items: center; gap: var(--space-8); height: var(--nav-row-height); padding-inline: var(--space-8); }
.nav-skel__dot { width: 12px; height: 12px; border-radius: var(--radius-pill); flex: none; }
.nav-skel .sk-line { height: 10px; }
.nav-row__unlocked { display: inline-flex; color: var(--text-secondary); }
.assign-scroll { max-height: 280px; overflow: auto; }
.tpl-device { display: flex; align-items: center; gap: var(--space-4); margin-block-end: var(--space-12); }
.sum-skel__ring { width: 64px; height: 64px; border-radius: var(--radius-pill); flex: none; }
.sum-skel__value { display: block; width: 40%; height: 24px; margin-block-start: var(--space-8); }
/* wide windows: the list page stops at the content width; the rest is background (D-020) */
.ws-list { max-width: calc(var(--layout-content-max) + var(--space-48)); }
.ws-nav__note { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-8); }
.ws-nav__note .icon { flex: none; }
.gem-tag { display: inline-grid; place-items: center; width: 24px; height: 24px; color: var(--text-secondary); }
/* inline name field (J-24): 28 px, 2 px focus ring, 4 px padding, no native border */
input.inline-edit-field { flex: 1 1 0; min-width: 0; width: 100%; border: 0; outline: 0; font: inherit; color: inherit; padding-inline: var(--space-4); margin-inline: 0; }
input.inline-edit-field::placeholder { color: var(--text-secondary); opacity: 1; }
/* narrow navigator: the inline empty state stacks (art, text, action) instead of squeezing the words (D-032) */
.ws-nav .empty--inline { flex-direction: column; align-items: flex-start; }
.ws-nav .empty--inline .empty__actions { justify-content: flex-start; }

/* ---- list page (D-024, D-027) ---- */
.ws-filter-note { padding-block: var(--space-6); padding-inline: var(--space-12) var(--space-8); align-items: center; }
.ws-counts { flex-wrap: wrap; row-gap: var(--space-2); }
.ws-locked-line { display: inline-flex; align-items: center; gap: var(--space-4); }
.ws-locked-line .btn { height: auto; padding-inline: var(--space-2); }
.ws-done-hidden { display: flex; align-items: center; gap: var(--space-6); padding: var(--space-8) var(--space-8) 0; }
.empty__hint { display: block; margin-block-start: var(--space-6); font-size: var(--fs-caption); line-height: var(--lh-caption); }
/* quick add: an add error keeps the text and says so under the field (D-024, D-003a) */
.quick-add.is-focused { --_bw: 2px; --_bc: var(--focus-ring); }
.quick-add.has-error, .quick-add.has-error:focus-within { --_bw: 2px; --_bc: var(--danger-border); }
.quick-add__error { display: flex; align-items: center; gap: var(--space-8); padding: var(--space-6) var(--space-12) var(--space-8); box-shadow: inset 0 1px 0 var(--border-subtle); }
.quick-add__error .inline-msg { flex: 1 1 0; }

/* ---- rows (D-025) ---- */
/* the automatic check is a control: pointer, and the tick shows on hover or focus */
.task-check[data-state="auto"] { cursor: pointer; }
.task-check[data-state="auto"]:hover .icon, .task-check[data-state="auto"]:focus-visible .icon { opacity: 1; color: var(--task-done-fg); }
/* a manual parent with every sub-task done: an emphasised ring that invites the tick */
.task-check[data-state="ready"]::before { background: var(--task-done-bg); box-shadow: inset 0 0 0 2px var(--task-done-fg); }
.task-check[data-state="ready"] .icon { opacity: .6; color: var(--task-done-fg); }
.task-row.is-just-added { background: var(--accent-subtle-bg); box-shadow: inset 0 0 0 1px var(--accent-border); }
.task-row.is-drop-invalid { background: var(--danger-bg); box-shadow: inset 0 0 0 2px var(--danger-border); cursor: no-drop; }
.task-row.is-no-drag .task-row__handle { cursor: default; }
.drop-label { display: inline-flex; align-items: center; gap: var(--space-4); padding-inline: var(--space-8); height: 24px; border-radius: var(--radius-chip); font-size: var(--fs-caption); line-height: var(--lh-caption); white-space: nowrap; color: var(--accent-subtle-fg); background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--accent-border); }
.drop-label--invalid { color: var(--danger-fg); box-shadow: inset 0 0 0 1px var(--danger-border); }
.nav-row .drop-label { height: 22px; padding-inline: var(--space-6); }

/* ---- bulk selection (D-026): the mark has its own column beside the tree toggle; mixed shows a dash ---- */
.task-row.is-bulk { grid-template-columns: 24px 20px 32px 16px minmax(0, 1fr) auto; }
.select-mark[aria-checked="mixed"] { background: var(--accent); box-shadow: none; }
.select-mark[aria-checked="mixed"] .icon { opacity: 1; }
.selection-bar__hint { white-space: nowrap; }

/* ---- Summary (D-029) ---- */
.sum-scope, .sum-locked { display: flex; align-items: center; gap: var(--space-4); margin-block: calc(var(--space-8) * -1) 0; }
.sum-locked { margin-block: 0; }
.sum-locked .info-tip { margin-inline-start: auto; }
.sum-due .task-row { padding-inline: 0; }

/* ---- dialogs and palette ---- */
/* DEC-X22 applied to dialogs: a title that carries a name (user text, isolated) wraps to a second line in the UI face,
   so no name is cut off and every theme keeps the same boxes */
.dialog__title:has(bdi) { white-space: normal; overflow-wrap: anywhere; font-family: var(--font-ui); letter-spacing: normal; }
.btn--busy { gap: var(--space-8); }
.btn--busy .spinner { width: 14px; height: 14px; }
.dialog__error { margin-block-end: var(--space-4); }
.tpl-save-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-8); font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); }
.tpl-save-list li { display: flex; align-items: flex-start; gap: var(--space-8); }
.tpl-save-list li .icon { flex: none; margin-block-start: 2px; }
.assign-lock { display: inline-flex; vertical-align: middle; color: var(--text-secondary); }
/* a colour dot inside running text (check-field labels) is an inline box, or it has no size */
.check-field__text .dot { display: inline-block; vertical-align: middle; margin-inline-end: var(--space-4); }
/* palette footer: hints keep their words together; the source note gives way (ellipsis) */
.palette__footer > span { white-space: nowrap; }
.palette__footer > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.list-item[aria-disabled="true"] { cursor: default; }
.list-item[aria-disabled="true"] .list-item__primary, .list-item[aria-disabled="true"] .list-item__icon { color: var(--text-secondary); }
/* shortcuts reference (D-006): a filter above, a focusable scroll region with a shadow at the cut edge */
.keys-search { max-width: 320px; }
.keys-scroll { max-height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: var(--space-16); padding-block-end: var(--space-4);
  background: linear-gradient(var(--surface-overlay) 30%, transparent) top / 100% 16px no-repeat local, linear-gradient(transparent, var(--surface-overlay) 70%) bottom / 100% 16px no-repeat local,
    linear-gradient(var(--border-default), transparent) top / 100% 6px no-repeat scroll, linear-gradient(transparent, var(--border-default)) bottom / 100% 6px no-repeat scroll; }
.keys-scroll:focus-visible { outline-offset: 2px; }

/* ---- quick capture in the background (D-003a): the same body in an always-on-top window over another app ---- */
.capture-stage { position: relative; height: 100%; display: grid; place-items: start center; padding-block-start: 16vh; }
.capture-stage .win { width: min(600px, calc(100% - var(--space-48))); height: auto; border-radius: var(--radius-window); }
.capture-stage .win-body { flex: none; overflow: visible; padding: var(--space-16); display: flex; flex-direction: column; gap: var(--space-12); }

/* locked second tab (owner Q2, PD-2973): its inert top bar reads as unavailable */
.titlebar[inert] { opacity: .55; }

/* Enjazy 2 — component library · phone settings, account and sharing (D-075) and phone Templates. Tokens only, logical properties only.
   The section content is the desktop content (07-settings.css); this file only re-lays it out for a 390 dp column:
   full-width rows, 48 dp targets, controls under their label when they need the width, pickers as bottom sheets. */

/* ---- page scaffold ---- */
.set-phone { display: flex; flex-direction: column; gap: var(--space-16); }
.set-phone > * { flex: none; }
.set-phone > .set-head__desc { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); padding-inline: var(--space-4); }
.set-phone .settings-section { gap: var(--space-6); }
.set-phone .settings-section > .section-header { min-height: 32px; }
.set-phone .share-page { gap: var(--space-16); }
.pset-end { height: var(--space-24); }
.pset-count { padding-inline: var(--space-4); }

/* ---- index: search, account card, grouped navigation rows ---- */
.pset-search .input { width: 100%; }
.pset-group { display: flex; flex-direction: column; gap: var(--space-6); }
.pset-group__head { display: flex; flex-direction: column; gap: 2px; padding-inline: var(--space-4); }
.pset-group__head .t-label { color: var(--text-primary); }
.pset-group__hint { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.pset-list { padding: 0; margin: 0; list-style: none; overflow: hidden; }
.pset-list > li + li { box-shadow: inset 0 1px 0 var(--border-subtle); }
.pset-row { display: grid; grid-template-columns: var(--size-icon-lg) minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-16); width: 100%;
  min-height: var(--size-row-list); padding: var(--space-8) var(--space-12) var(--space-8) var(--space-16); text-align: start; color: var(--text-primary); }
.pset-row--noicon { grid-template-columns: minmax(0, 1fr) auto; }
.pset-row:hover { background: var(--state-hover); }
.pset-row:active { background: var(--state-pressed); }
.pset-row:focus-visible { outline-offset: -2px; }
.pset-row__icon { display: grid; place-items: center; color: var(--text-secondary); }
.pset-row__icon .icon { width: var(--size-icon-lg); height: var(--size-icon-lg); }
.pset-row__text { display: flex; flex-direction: column; min-width: 0; }
.pset-row__label { font-size: var(--fs-body); line-height: var(--lh-body); }
.pset-row__sub { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pset-row__trail { display: flex; align-items: center; gap: var(--space-4); color: var(--text-secondary); }
.pset-row.is-unavailable .pset-row__label, .pset-row.is-unavailable .pset-row__icon { color: var(--text-secondary); }
.pset-row mark { background: none; color: var(--accent-text); font-weight: var(--fw-semibold); }
.pset-account { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-12); width: 100%; padding: var(--space-16); text-align: start; color: var(--text-primary); }
.pset-account:hover { --_bc: var(--border-strong); }
.pset-account > .icon { color: var(--text-secondary); }
.pset-account .col { min-width: 0; }
.pset-account__status { display: flex; align-items: center; gap: var(--space-4); margin-top: 2px; font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-secondary); }
.pset-account__status .icon { flex: none; }
.pset-account--out { display: flex; flex-direction: column; align-items: stretch; }
.pset-account__icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-sunken); color: var(--text-secondary); }
.pset-account__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
.pset-account__actions .btn { height: var(--size-control-md); }

/* ---- section pages: the desktop rows in one column ---- */
.set-phone .settings-group { padding-inline: var(--space-16); }
.set-phone .form-row { min-height: var(--size-row-list); column-gap: var(--space-12); }
/* a control that needs the width sits under its label; switches, status badges and a lone tertiary link stay at the end */
.set-phone .settings-group .form-row:has(> .row :is(.segmented, .set-select, .btn:not(.btn--tertiary), .number-field, .set-keyform, .set-ctl, .swatches, .kbd-combo, .radio-group, .avatar-group)) {
  grid-template-columns: minmax(0, 1fr); row-gap: var(--space-8); align-items: start; }
.set-phone .settings-group .form-row > .row { justify-content: flex-end; }
.set-phone .settings-group .form-row:has(> .row :is(.segmented, .set-select, .btn:not(.btn--tertiary), .number-field, .set-keyform, .set-ctl, .swatches, .kbd-combo, .radio-group, .avatar-group)) > .row { justify-content: flex-start; }
.set-phone .form-row .btn--sm, .set-phone .set-group-foot .btn--sm, .set-phone .callout .btn--sm, .set-phone .empty .btn { height: var(--size-control-md); padding-inline: var(--space-12); }
.set-phone .form-row .segmented { display: flex; width: 100%; }
.set-phone .form-row .segmented__opt { flex: 1 1 0; justify-content: center; padding-inline: var(--space-8); }
.set-phone .set-select, .set-phone .set-select--sm { width: 100%; }
.set-phone .set-ctl { align-items: flex-start; max-width: none; }
.set-phone .set-ctl .inline-msg { text-align: start; }
.set-phone .set-radio-grid, .set-phone .set-checks { grid-template-columns: minmax(0, 1fr); }
.set-phone .set-kv { grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); }
.set-phone .set-keyform, .set-phone .set-join { flex-direction: column; align-items: stretch; max-width: none; }
.set-phone .set-keyform > .btn, .set-phone .set-join > .btn { margin: 0; height: var(--size-control-md); }
.set-phone .set-group-foot { flex-direction: column; align-items: flex-start; gap: var(--space-8); }
.set-phone .form-row.set-sub { padding-inline-start: var(--space-16); }
.set-phone .set-profile { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.set-phone .set-profile > .col { min-width: 0; }
.set-phone .set-profile > .row, .set-phone .set-profile > .btn { grid-column: 1 / -1; justify-self: start; }
.set-phone .set-profile > .btn { height: var(--size-control-md); }
.set-phone .set-plan .row.row--8 { flex-wrap: wrap; }
.set-phone .set-about { align-items: flex-start; }
.set-phone .set-table .table th, .set-phone .set-table .table td { padding-inline: var(--space-8); }
.set-phone .set-compare thead th { padding-block: var(--space-8); }
.set-phone .set-compare__name { flex-direction: column; gap: 2px; font-size: var(--fs-body-sm); }
.set-phone .set-compare__price { font-size: var(--fs-caption); line-height: var(--lh-caption); }
.set-phone .set-compare tbody th { font-size: var(--fs-caption); line-height: var(--lh-caption); padding-block: var(--space-6); height: auto; }
.set-phone .set-compare td { height: auto; padding-block: var(--space-6); font-size: var(--fs-caption); }
.set-phone .share-page .form-row .avatar-group { display: none; } /* member count is in the description; room for Manage */

/* ---- Appearance: the current theme as one live preview; the gallery is a sheet ---- */
.pset-theme-now { --_r: max(0px, calc(var(--radius-card) - 4px)); display: flex; flex-direction: column; gap: var(--space-12); padding: var(--space-8) var(--space-8) var(--space-12); }
.pset-theme-now .theme-card__stage { height: 132px; }
.pset-theme-now__row { display: flex; align-items: center; gap: var(--space-12); padding-inline: var(--space-8) var(--space-4); }
.pset-theme-now__row .col { min-width: 0; }
.pset-theme-now__row .btn { height: var(--size-control-md); flex: none; }
.pset-themes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); margin: 0; }
.pset-themes .theme-card__stage { height: 96px; }

/* ---- bottom sheets: pickers, menus and the shared components in a sheet shell ---- */
.pset-sheet .sheet__title { white-space: normal; }
.pset-pick { display: flex; flex-direction: column; margin-inline: calc(var(--space-8) * -1); }
.pset-pick__opt { display: flex; align-items: center; gap: var(--space-12); min-height: var(--size-row-list); padding-inline: var(--space-16); width: 100%; border-radius: var(--radius-control);
  text-align: start; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-primary); }
.pset-pick__opt:hover { background: var(--state-hover); }
.pset-pick__opt[aria-checked="true"] { background: var(--state-selected-bg); color: var(--state-selected-fg); font-weight: var(--fw-medium); }
.pset-pick__opt .icon { width: var(--size-icon-md); height: var(--size-icon-md); flex: none; }
.pset-dot { width: var(--size-icon-lg); height: var(--size-icon-lg); display: grid; place-items: center; flex: none; }
.phone .set-qrwrap { flex-direction: column; align-items: center; gap: var(--space-12); }
.phone .set-qrwrap > .col { width: 100%; }
.phone .set-invite { grid-template-columns: minmax(0, 1fr) auto; }
.phone .set-invite > .input { grid-column: 1 / -1; }
.phone .set-invite .set-select--role { width: auto; min-width: 136px; }
.phone .set-code { flex-wrap: wrap; row-gap: var(--space-8); }
.phone .set-code > .col { flex: 1 1 calc(100% - 48px); }
.phone .set-code > .btn { height: var(--size-control-md); }
.phone .set-code > .btn:first-of-type { margin-inline-start: 40px; }
.phone .set-codeform .grid-2 { grid-template-columns: minmax(0, 1fr); }
.phone .set-person { min-height: var(--size-row-list); }
/* dialogs over these pages: icon and close on the first line, the title and description get the full width */
.phone:has(.set-phone) .dialog__title { white-space: normal; }
.phone:has(.set-phone) .dialog__header:has(> .dialog__icon) { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--space-12); }
.phone:has(.set-phone) .dialog__header > .dialog__icon { grid-row: 1; grid-column: 1; }
.phone:has(.set-phone) .dialog__header > .dialog__titles { grid-row: 2; grid-column: 1 / -1; }
.phone:has(.set-phone) .dialog__header > .icon-btn { grid-row: 1; grid-column: 2; }

/* ---- Templates (D-028 parity): one card per template ---- */
.pset-tpl { display: flex; flex-direction: column; gap: var(--space-12); }
.pset-tpl .col { min-width: 0; }
.pset-tpl .btn--block { height: var(--size-control-md); }

/* ---- repairs scoped to these screens (owner of 10/11 notified): the phone switch keeps its thumb, and the
   Keyboard page shows its keycaps (the page is about a physical keyboard) ---- */
/* (the switch thumb is restored globally in 10-states-touch.css) */
.phone .set-phone .kbd-combo { display: inline-flex; }
