/* The portal's look, ArtusFlow's design system: a navy frame flush to the edge, a tinted top bar that is each page's head, premium panels with wash heads and glowing tiles, cards that lift, navy-head dialogs, wells inside cards, paired slate shadows. Every value comes from the tokens below; the token names are shared with aitree.css and installpage.css. Light only, system fonts only. Nothing here may widen the page past the screen. */
:root {
  color-scheme: light;
  --canvas: #f8fafc;
  --surface: #fff;
  --surface-2: #f1f5f9;
  --well: rgba(241, 245, 249, 0.75);
  --line: #e5e7eb;
  --line-strong: #cbd5e1;
  --line-soft: #eef0f6;
  --ring-soft: #e3e6f2;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --navy: #1e293b;
  --navy-2: #0f172a;
  --navy-ink: #cbd5e1;
  --navy-dim: #64748b;
  --navy-line: rgba(255, 255, 255, 0.08);
  --navy-hover: rgba(255, 255, 255, 0.04);
  --navy-active: rgba(99, 102, 241, 0.16);
  --accent-a: #818cf8;
  --accent-b: #4f46e5;
  --accent: #4f46e5;
  --accent-deep: #4338ca;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --grad: linear-gradient(145deg, var(--accent-a), var(--accent-b));
  --grad-pill: linear-gradient(135deg, #8b8ff9, #4f46e5 70%);
  --wash: linear-gradient(180deg, color-mix(in srgb, #818cf8 14%, #fff), #fff);
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --danger-deep: #b91c1c;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r-pill: 999px;
  --r-panel: 18px;
  --r-modal: 14px;
  --r-card: 12px;
  --r-row: 10px;
  --r-ctl: 8px;
  --r-item: 7px;
  --sh-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --sh: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
  --sh-panel: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 32px -14px rgba(15, 23, 42, 0.22);
  --sh-lifted: 0 30px 70px -14px rgba(15, 23, 42, 0.42), 0 0 0 1px rgba(15, 23, 42, 0.07);
  --glow-tile: 0 6px 14px -6px #4f46e5, inset 0 1px 0 rgba(255, 255, 255, 0.35);
  --glow-btn: 0 10px 22px -10px rgb(79 70 229 / 75%), inset 0 1px 0 rgb(255 255 255 / 35%);
  --glow-hover: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 34px -16px rgba(79, 70, 229, 0.35);
  --focus: 0 0 0 3px var(--accent-soft);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 280ms;
  --side-w: 202px;
  --side-w-collapsed: 54px;
  --bar-h: 48px;
  --pad: 1.75rem 2rem;
  --gap: 1rem;
  /* Beside the system: the text colour of each status, darker than its fill so it reads, and the soft white key the panels' actions use. */
  --ok-ink: #047857;
  --warn-ink: #b45309;
  --danger-ink: var(--danger-deep);
  --pad-x: 2rem;
  --white-key: 0 1px 2px rgba(15, 23, 42, 0.06), 0 3px 8px -4px rgba(15, 23, 42, 0.15);
  --scrim: color-mix(in srgb, var(--ink) 45%, transparent);
  /* Category marks for projects, shelves and people: dots, chips and tiles only */
  --shelf-0: #f97316;
  --shelf-1: #a855f7;
  --shelf-2: #6366f1;
  --shelf-3: #14b8a6;
  --shelf-4: #eab308;
  --shelf-5: #0ea5e9;
  --shelf-6: #64748b;
  --shelf-7: #ec4899;
  /* Work: ticket states and pipeline stages */
  --st-fog: #94a3b8;
  --st-ready: #6366f1;
  --st-doing: #8b5cf6;
  --st-blocked: #ef4444;
  --st-review: #f59e0b;
  --st-done: #10b981;
}
.shelf-c0 { --shelf: var(--shelf-0); }
.shelf-c1 { --shelf: var(--shelf-1); }
.shelf-c2 { --shelf: var(--shelf-2); }
.shelf-c3 { --shelf: var(--shelf-3); }
.shelf-c4 { --shelf: var(--shelf-4); }
.shelf-c5 { --shelf: var(--shelf-5); }
.shelf-c6 { --shelf: var(--shelf-6); }
.shelf-c7 { --shelf: var(--shelf-7); }

/* Base: body 14px at 500, the owner's floor */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font: 500 0.875rem/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; overflow-x: hidden; }
a { color: var(--accent); text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--focus); }
button { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; }
::selection { background: var(--accent-soft); }
kbd { flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ring-soft); color: var(--ink-2); font: 600 0.6875rem/1 var(--font); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-bold { stroke-width: 3.2; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes up-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes side-in { from { opacity: 0; transform: translateX(-4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; } }

/* The frame: the navy menu flush to the edge, full height and sticky, folding to its 54px rail; on a phone a drawer. */
.fr { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; transition: grid-template-columns var(--dur-slow) var(--ease); }
.fr.is-rail { grid-template-columns: var(--side-w-collapsed) minmax(0, 1fr); }
.fr-side { position: sticky; top: 0; z-index: 30; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; border-right: 1px solid var(--navy-line); background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: var(--navy-ink); }
.is-rail .fr-side { overflow: visible; }
.fr-brand { flex: none; display: flex; align-items: center; gap: 0.75rem; min-height: var(--bar-h); padding: 0.3125rem 0.8rem; border-bottom: 1px solid var(--navy-line); color: inherit; text-decoration: none; }
.fr-logo { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 9px; background: var(--grad); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 12px rgba(15, 23, 42, 0.4); }
.fr-logo .icon { width: 19px; height: 19px; stroke-width: 2; filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.18)); }
.fr-brand-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.fr-brand-name b { overflow: hidden; color: #fff; font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.005em; text-overflow: ellipsis; white-space: nowrap; }
.fr-brand-name small { overflow: hidden; color: var(--navy-dim); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.fr-side-body { flex: 1 1 auto; min-height: 0; padding: 0.5rem 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; animation: side-in var(--dur-slow) var(--ease-out); }
.fr-side-body::-webkit-scrollbar { width: 8px; }
.fr-side-body::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.14); background-clip: content-box; }
.fr-search { display: flex; align-items: center; gap: 0.6rem; width: calc(100% - 1rem); height: 34px; margin: 0.25rem 0.5rem 0.4rem; padding: 0 0.4rem 0 0.625rem; border: 1px solid var(--navy-line); border-radius: var(--r-ctl); background: rgba(255, 255, 255, 0.05); color: var(--navy-ink); font: 500 0.8125rem var(--font); cursor: pointer; transition: background var(--dur-fast) var(--ease); }
.fr-search:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.fr-search .icon { width: 16px; height: 16px; }
.fr-search span { flex: 1 1 auto; text-align: left; }
.fr-search kbd { background: rgba(255, 255, 255, 0.08); box-shadow: none; color: var(--navy-ink); }
.fr-section { display: flex; align-items: center; min-height: 28px; margin: 0; padding: 0.625rem 1.25rem 0.25rem; color: var(--navy-dim); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.fr-nav { display: flex; flex-direction: column; gap: 1px; }
.fr-nav .fr-item { width: calc(100% - 1rem); margin: 0 0.5rem; }
.fr-item { position: relative; display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.5rem 0.625rem; border: 0; border-radius: var(--r-item); background: none; color: var(--navy-ink); font: 500 0.875rem var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.fr-item:hover { background: var(--navy-hover); color: #fff; }
.fr-item[aria-current] { background: var(--navy-active); color: #fff; }
.fr-item[aria-current]::before { content: ""; position: absolute; top: 50%; left: -0.5rem; width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: var(--accent-a); transform: translateY(-50%); }
.fr-item .icon { width: 18px; height: 18px; }
.fr-item[aria-current] .icon { color: #c7d2fe; }
.fr-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; }
.fr-item small { display: inline-grid; place-items: center; min-width: 18px; height: 18px; flex: none; padding: 0 5px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 1; }
.fr-side-foot { flex: none; display: grid; gap: 2px; padding: 0.5rem; border-top: 1px solid var(--navy-line); background: var(--navy-2); }
.fr-me { display: flex; align-items: center; gap: 0.6rem; min-width: 0; padding: 0.375rem; border-radius: var(--r-item); }
.fr-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--grad); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06); }
.fr-avatar .icon { width: 16px; height: 16px; stroke-width: 2; }
.fr-me-text { display: grid; flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.fr-me-text b { overflow: hidden; color: #fff; font-size: 0.8125rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.fr-me-text small { color: var(--navy-dim); font-size: 0.6875rem; font-weight: 600; }
.fr-signout { color: var(--navy-ink); }
.fr-side .fr-ib:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
/* The rail: icons only, each name in a bubble on hover */
.is-rail .fr-brand-name, .is-rail .fr-side .fr-label, .is-rail .fr-search span, .is-rail .fr-search kbd, .is-rail .fr-me-text, .is-rail .fr-signout { display: none; }
.is-rail .fr-brand { justify-content: center; padding: 0.3125rem 0; }
.is-rail .fr-side .fr-item, .is-rail .fr-search { justify-content: center; padding: 0.5rem; }
.is-rail .fr-section { justify-content: center; min-height: 0; padding: 0.5rem 0.75rem; font-size: 0; }
.is-rail .fr-section::before { content: ""; width: 28px; height: 1px; background: var(--navy-line); }
.is-rail .fr-nav > .fr-section:first-child::before { display: none; }
.is-rail .fr-me { justify-content: center; }
.is-rail .fr-side .fr-item small { position: absolute; top: 4px; right: 4px; min-width: 14px; height: 14px; padding: 0 3px; font-size: 0.625rem; }
.is-rail .fr-side .fr-item:hover::after, .is-rail .fr-side .fr-item:focus-visible::after { content: attr(aria-label); position: absolute; top: 50%; left: calc(100% + 12px); z-index: 50; padding: 0.35rem 0.6rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font-size: 0.75rem; font-weight: 600; white-space: nowrap; box-shadow: var(--sh); transform: translateY(-50%); pointer-events: none; }
.fr-scrim { display: none; }

/* The top bar is the page head: the page's glowing tile and title, the "?" beside it, its tab tray, its white actions and one gradient pill. */
.fr-main { position: relative; display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.fr-top { position: relative; z-index: 25; flex: none; display: flex; align-items: center; gap: 0.75rem; min-height: var(--bar-h); padding: 3px var(--pad-x); border-bottom: 1px solid #e8eaf3; background: var(--wash); box-shadow: 0 10px 24px -22px rgba(15, 23, 42, 0.35); }
.fr-top .fr-menu { display: none; }
.fr-top-slot { flex: 1 1 auto; display: flex; min-width: 0; }
.fr-top .view-head { flex: 1 1 auto; display: flex; align-items: center; gap: 0.6rem; min-width: 0; margin: 0; }
.fr-head-tile { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 10px; background: var(--grad); color: #fff; box-shadow: var(--glow-tile); }
.fr-head-tile .icon { width: 16px; height: 16px; stroke-width: 2; filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.18)); }
.fr-title { margin: 0; overflow: hidden; color: var(--ink); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.015em; text-overflow: ellipsis; white-space: nowrap; }
.fr-title a { color: inherit; text-decoration: none; }
.fr-tabs { display: inline-flex; flex: none; align-items: center; gap: 0.15rem; height: 30px; margin-left: 1.4rem; padding: 0.2rem; border: 1px solid var(--ring-soft); border-radius: 14px; background: #f5f6fb; }
.fr-tab { display: inline-flex; align-items: center; gap: 0.4rem; height: 24px; padding: 0 0.7rem; border-radius: 10px; color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.fr-tab:hover { color: var(--ink); }
.fr-tab[aria-current] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 6px 14px -10px rgba(79, 70, 229, 0.6); }
.fr-tab small { color: var(--ink-3); font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fr-tab[aria-current] small { color: var(--accent-deep); }
.view-tools { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.top-pill { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.75rem 0.3rem 0.6rem; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px var(--ring-soft), 0 4px 10px -8px rgba(79, 70, 229, 0.5); color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.top-pill .icon { width: 14px; height: 14px; color: #6366f1; }
.fr-top .crumbs { flex: 0 1 auto; }
/* Something waiting, as a honey pill in the top bar */
.fr-wait { display: inline-flex; align-items: center; gap: 0.45rem; height: 30px; padding: 0 0.8rem; border: 0; border-radius: var(--r-pill); background: #fef3c7; box-shadow: inset 0 0 0 1px #fde68a; color: var(--warn-ink); font: 600 0.8125rem var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; }
.fr-wait i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }

/* The "?" beside a title or a label; its words in a bubble */
.tip { position: relative; display: inline-flex; flex: none; vertical-align: middle; }
.tip-mark { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; color: #6366f1; cursor: help; }
.tip-mark .icon { width: 15px; height: 15px; stroke-width: 1.8; }
.tip-mark:hover, .tip:focus-within .tip-mark { background: var(--accent-soft); }
.tip-text { position: absolute; top: calc(100% + 8px); left: -8px; z-index: 45; width: max-content; max-width: 18rem; padding: 0.5rem 0.625rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); box-shadow: var(--sh); color: var(--ink-2); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0; line-height: 1.45; text-align: left; text-transform: none; white-space: normal; pointer-events: none; }
/* Out of the layout until hover or focus, so a closed bubble never widens the page. */
.tip:not(:hover, :focus-within) .tip-text { display: none; }
.tip:is(:hover, :focus-within) .tip-text { animation: tip-in var(--dur-fast) var(--ease-out); }
@keyframes tip-in { from { opacity: 0; transform: translateY(-4px); } }

/* The page: one fluid grid with the same gutters on every screen, fading up as it comes */
.fr-body { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; padding: var(--pad); transition: opacity var(--dur) var(--dur-fast); }
.fr-body[aria-busy="true"] { opacity: 0.55; }
.view { display: grid; gap: var(--gap); min-width: 0; animation: up-in var(--dur-slow) var(--ease-out); }
.view > * { min-width: 0; margin: 0; }
.loading { display: flex; align-items: center; justify-content: center; gap: 0.75rem; min-height: 40vh; margin: 0; color: var(--ink-2); animation: fade-in 0.2s 0.2s both; }
.loading::before { content: ""; width: 18px; height: 18px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
/* The overview grid: a wide panel beside a column of panels, all of equal height */
.overview { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: stretch; gap: var(--gap); }
.overview-side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.overview-side > .card, .overview-side > .part-slot > .card { flex: 1 1 auto; }
/* A part that loads on its own takes no box of its own: its panel sits in the grid as if placed there. */
.part-slot { display: contents; }
.loading.is-part { min-height: 6rem; }
/* A side with one short panel keeps its own height instead of stretching to the list. */
.overview.is-top { align-items: start; }
.stack { display: grid; gap: var(--gap); }
.stack > .card { margin: 0; }

/* Signed out: one panel in the middle of the whole page, the title over it, the PIN pad in the look */
.is-out .fr { display: block; height: auto; }
.is-out .fr-main { height: auto; min-height: 100vh; background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, #818cf8 18%, transparent), transparent), var(--canvas); }
.is-out .fr-body { width: min(440px, 100%); margin: 0 auto; padding: 12vh 1.25rem 3rem; overflow: visible; }
.is-out .view-head { display: grid; justify-items: center; gap: 0.5rem; margin: 0 0 0.5rem; text-align: center; }
.out-logo { width: 52px; height: 52px; margin-bottom: 0.5rem; border-radius: 16px; box-shadow: var(--glow-tile), 0 18px 34px -16px rgba(79, 70, 229, 0.55); }
.out-logo .icon { width: 26px; height: 26px; }
.is-out .fr-title { font-size: 1.5rem; letter-spacing: -0.02em; white-space: normal; }
.is-out .view-head .tip { display: block; }
.is-out .view-head .tip-mark { display: none; }
.is-out .view-head .tip-text { position: static; display: block; width: auto; max-width: 34ch; padding: 0; text-align: center; border: 0; background: none; box-shadow: none; color: var(--ink-2); font-size: 0.9375rem; animation: none; }
.is-out .card { padding: 1.5rem; }
.is-out .actions .btn { flex: 1 1 100%; justify-content: center; height: 44px; font-size: 0.9375rem; }
.view-signin .pin { max-width: none; }
.join .fr-title { font-size: 1.75rem; }
.join input[type="password"] { height: 52px; font-size: 20px; letter-spacing: 0.5em; text-align: center; }

/* Buttons: a white control, the accent primary, the quiet fill for the second choice, solid danger; the page head's primary is the gradient pill */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; max-width: 100%; padding: 0.5rem 1rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font: 500 0.875rem/1.2 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn .icon { width: 15px; height: 15px; }
.btn-primary { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: var(--sh-sm); }
.btn-primary:hover:not(:disabled) { border-color: var(--accent-deep); background: var(--accent-deep); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25); }
.btn-quiet { border-color: transparent; background: var(--surface-2); color: var(--ink-2); }
.btn-quiet:hover:not(:disabled) { border-color: transparent; background: var(--line); color: var(--ink); }
.btn-danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { border-color: var(--danger-deep); background: var(--danger-deep); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn kbd { height: 18px; margin-left: 0.15rem; background: rgba(255, 255, 255, 0.18); box-shadow: none; color: inherit; }
.fr-top .btn { height: 30px; padding: 0 0.9rem; border-color: var(--line); border-radius: 9px; background: #fff; color: var(--ink); box-shadow: var(--white-key); }
.fr-top .btn:hover:not(:disabled) { background: #fff; border-color: var(--line-strong); }
.fr-top .btn-danger { color: var(--danger-ink); }
.fr-top .btn-primary { padding: 0 1.15rem 0 1rem; border: 0; border-radius: var(--r-pill); background: var(--grad-pill); color: #fff; box-shadow: var(--glow-btn); }
.fr-top .btn-primary:hover:not(:disabled) { background: var(--grad-pill); box-shadow: 0 12px 24px -10px rgb(79 70 229 / 85%), inset 0 1px 0 rgb(255 255 255 / 35%); }
.fr-ib { display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink-2); cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.fr-ib:hover:not(:disabled), .fr-ib[aria-expanded="true"], .fr-ib[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.fr-ib:disabled { opacity: 0.4; cursor: default; }
.fr-ib .icon { width: 17px; height: 17px; }
.fr-top .fr-ib { width: 30px; height: 30px; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 1px var(--line), var(--white-key); }

/* The glowing gradient tile: rows, panel heads, dialogs */
.fr-tile { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 10px; background: linear-gradient(145deg, var(--tone-a, var(--accent-a)), var(--tone-b, var(--accent-b))); color: #fff; box-shadow: 0 6px 14px -6px var(--tone-b, var(--accent-b)), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.fr-tile .icon { width: 16px; height: 16px; stroke-width: 2; filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.18)); }

/* The round arrow at the right of a row that opens something: a tint at rest, solid as the row lifts */
.go { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.go .icon { width: 14px; height: 14px; stroke-width: 2.2; }
:is(.ask-row, .lib-row, .wk-prow, .wk-lrow, .hit-link, .wk-trow2, .nav-row):hover .go { border-color: var(--accent); background: var(--accent); color: #fff; }
/* A row that opens something lifts as a whole */
:is(.ask-row, .lib-row, .wk-prow, .wk-lrow, .hit-link, .wk-trow2, .nav-row) { transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
:is(.ask-row, .lib-row, .wk-prow, .wk-lrow, .hit-link, .wk-trow2, .nav-row):hover { background: var(--surface); box-shadow: var(--glow-hover); transform: translateY(-1px); }
.nav-row { display: flex; align-items: center; gap: 0.75rem; min-width: 0; padding: 0.55rem 0.6rem 0.55rem 0.75rem; border-radius: var(--r-row); color: var(--ink); text-decoration: none; }
.nav-text { display: grid; flex: 1 1 auto; gap: 1px; min-width: 0; }
.nav-text b { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.nav-text small { overflow: hidden; color: var(--ink-2); font-size: 0.8125rem; text-overflow: ellipsis; white-space: nowrap; }

/* The three dots and every other short menu */
.fr-meta { margin: 0; color: var(--ink-2); font-size: 0.8125rem; }
.fr-anchor { position: relative; display: inline-flex; }
.fr-pop { position: absolute; top: calc(100% + 4px); right: 0; z-index: 40; width: 232px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--sh); animation: drop-in var(--dur-fast) var(--ease-out); }
.fr-pop-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 32px; padding: 0 0.625rem; border: 0; border-radius: 6px; background: none; color: var(--ink); font: 500 0.8125rem var(--font); text-align: left; cursor: pointer; transition: background var(--dur-fast) var(--ease); }
.fr-pop-item:hover:not(:disabled) { background: var(--surface-2); }
.fr-pop-item:disabled { opacity: 0.45; cursor: default; }
.fr-pop-item > .icon { width: 14px; height: 14px; color: var(--ink-3); }
.fr-pop-item span { flex: 1 1 auto; min-width: 0; }
.fr-pop-item[aria-pressed="true"] { font-weight: 600; }
.fr-pop-danger, .fr-pop-danger > .icon { color: var(--danger-ink); }
.fr-pop-note { margin: 0 0.625rem 0.4rem 2rem; color: var(--ink-2); font-size: 0.75rem; line-height: 1.45; }

/* Fields: the label at 600 in the label grey, its "?" beside it, the control under it */
form { margin: 0; }
.field { display: grid; align-content: start; gap: 0.4rem; max-width: 560px; margin: 0 0 1rem; }
.field-label { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="time"], select, textarea { display: block; width: 100%; max-width: 100%; padding: 0.625rem 0.75rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font: 500 0.9375rem/1.3 var(--font); transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { resize: vertical; line-height: 1.55; }
input[type="search"] { padding-left: 2.1rem; background: var(--surface) no-repeat 0.7rem 50% / 15px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M10.5 4a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13zM20 20l-4.6-4.6'/%3E%3C/svg%3E"); }
input[type="checkbox"], input[type="radio"] { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
progress { display: block; width: 100%; height: 6px; border: 0; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: var(--surface-2); }
progress::-webkit-progress-value { border-radius: var(--r-pill); background: var(--grad); }
progress::-moz-progress-bar { border-radius: var(--r-pill); background: var(--grad); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1rem 0 0; }
.more { margin-top: 0.75rem; }
.more summary { display: inline-flex; align-items: center; gap: 0.25rem; border-radius: var(--r-ctl); color: var(--accent); font-weight: 600; cursor: pointer; }
.more[open] summary { margin-bottom: 0.75rem; }

/* The PIN pad: the dots in a well, soft white keys that lift */
.pin { display: grid; gap: 0.6rem; max-width: 320px; }
.pin-field { position: relative; display: flex; justify-content: center; padding: 1rem 0.75rem; border-radius: var(--r-card); background: var(--well); box-shadow: inset 0 0 0 1px var(--line-soft); cursor: text; }
.pin-field:focus-within { box-shadow: inset 0 0 0 1px var(--accent), var(--focus); }
.pin-field input[type="password"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: text; }
.pin-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.pin-dots i { width: 13px; height: 13px; border: 2px solid var(--line-strong); border-radius: 50%; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.pin-dots i.is-on { border-color: transparent; background: var(--grad); transform: scale(1.08); box-shadow: 0 3px 8px -3px var(--accent-b); }
.pin-pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.pin-pad button { display: grid; place-items: center; height: 52px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); color: var(--ink); font: 600 1.25rem var(--font); cursor: pointer; box-shadow: var(--white-key); transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.pin-pad button:hover { border-color: #c7d2fe; box-shadow: var(--glow-hover); transform: translateY(-1px); }
.pin-pad button:active { transform: scale(0.97); }
.pin-pad .icon { width: 20px; height: 20px; color: var(--ink-2); }

/* Panels: radius 18, a crisp contact shadow and a soft long one; the head a tinted wash with its glowing tile; the gradient swaps by tone */
.card, .panel { --tone-a: var(--accent-a); --tone-b: var(--accent-b); position: relative; min-width: 0; padding: 1rem 1.125rem 1.125rem; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); box-shadow: var(--sh-panel); }
.pnl-honey { --tone-a: #fcd34d; --tone-b: #f59e0b; }
.pnl-green { --tone-a: #34d399; --tone-b: #059669; }
.card > .card-head:first-child, .card > h2:first-child { margin: -1rem -1.125rem 1rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.6rem; min-height: 54px; padding: 0.75rem 0.9rem 0.7rem; border-bottom: 1px solid var(--line-soft); border-radius: 17px 17px 0 0; background: linear-gradient(180deg, color-mix(in srgb, var(--tone-a) 16%, #fff), #fff); }
.card-head h2, .card > h2:first-child { display: flex; align-items: center; gap: 0.35rem; min-width: 0; margin: 0; font-size: 0.95rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.005em; }
.card > h2:first-child { min-height: 54px; padding: 0.75rem 1rem 0.7rem; border-bottom: 1px solid var(--line-soft); border-radius: 17px 17px 0 0; background: linear-gradient(180deg, color-mix(in srgb, var(--tone-a) 16%, #fff), #fff); }
.card-head > .fr-tile, .card-head .fr-tile { box-shadow: 0 6px 14px -6px var(--tone-b), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.card-tools { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.4rem; min-width: 0; }
.card-head .btn { padding: 0.3rem 0.65rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; box-shadow: var(--white-key); }
.card-head .btn:hover:not(:disabled) { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.card-head .btn-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.card-head .btn-primary:hover:not(:disabled) { background: var(--accent-deep); color: #fff; }
.card-head input[type="search"] { width: min(240px, 100%); padding-block: 0.4rem; font-size: 0.875rem; }
.card > h3 { margin: 1.1rem 0 0.4rem; color: var(--ink-2); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.count { display: inline-flex; align-items: center; height: 20px; padding: 0 0.5rem; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px #e6e9f2; color: var(--ink-2); font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.pnl { display: flex; flex-direction: column; padding: 0; }
.pnl > .card-head:first-child { margin: 0; }
.pnl-body { flex: 1 1 auto; min-width: 0; padding: 0.6rem 1rem 1rem; }
.pnl-foot { padding: 0.65rem 1rem; border-top: 1px solid var(--line-soft); border-radius: 0 0 17px 17px; background: linear-gradient(180deg, var(--canvas), #fff); }
.pnl-line { margin: 0.2rem 0 0.75rem; color: var(--ink-2); }
.well { padding: 0.6rem 0.75rem; border-radius: var(--r-card); background: var(--well); }
.empty { margin: 0; color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: 0.875rem; }
.error-text { color: var(--danger-ink); }
.path { margin: 2px 0 0; color: var(--ink-2); font: 500 0.75rem/1.5 var(--mono); font-variant-ligatures: none; }
.lead { margin: 1rem 0 1.25rem; color: var(--ink-2); font-size: 1.0625rem; line-height: 1.55; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem; min-width: 0; color: var(--ink-2); font-size: 0.9375rem; font-weight: 600; }
.crumbs a { padding: 0.15rem 0.35rem; border-radius: 6px; color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { background: var(--surface-2); color: var(--ink); }
.crumbs [aria-current] { overflow: hidden; padding: 0.15rem 0.35rem; color: var(--ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .icon { width: 13px; height: 13px; color: var(--line-strong); }
/* The empty state: a glowing circle with the picture, one line under it */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; min-height: 100%; padding: 2rem 1rem 2.25rem; color: var(--ink-2); text-align: center; }
.empty-art { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 0.6rem; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #fff, color-mix(in srgb, var(--tone-a, var(--accent-a)) 22%, #fff)); box-shadow: 0 0 0 8px color-mix(in srgb, var(--tone-a, var(--accent-a)) 9%, transparent), 0 10px 24px -12px var(--tone-b, var(--accent-b)); color: var(--tone-b, var(--accent-b)); }
.empty-art .icon { width: 26px; height: 26px; }
.empty-state b { color: var(--ink); font-size: 0.95rem; font-weight: 700; }
.empty-state p { max-width: 40ch; margin: 0; font-size: 0.875rem; }
.empty-state .actions { justify-content: center; margin-top: 0.75rem; }

/* Badges: status pills, a 12% fill with a 24% edge; the only coloured text */
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.4rem 0; }
.badge { --tint: var(--ink-3); --tint-ink: var(--ink-2); display: inline-flex; align-items: center; max-width: 100%; height: 22px; padding: 0 0.55rem; overflow: hidden; border: 1px solid color-mix(in srgb, var(--tint) 24%, transparent); border-radius: var(--r-pill); background: color-mix(in srgb, var(--tint) 12%, #fff); color: var(--tint-ink); font: 600 0.72rem/1 var(--font); text-overflow: ellipsis; white-space: nowrap; }
.badge-plain, .badge-wait, .badge-superseded, .badge-retired { --tint: #94a3b8; --tint-ink: var(--ink-2); }
.badge-ok, .badge-tier-open { --tint: var(--ok); --tint-ink: var(--ok-ink); }
.badge-warn, .badge-unverified { --tint: var(--warn); --tint-ink: var(--warn-ink); }
.badge-bad, .badge-untrusted { --tint: var(--danger); --tint-ink: var(--danger-ink); }
.badge-tier-private { --tint: #6366f1; --tint-ink: var(--accent-deep); }
.badge-tier-owner { --tint: #a855f7; --tint-ink: #7e22ce; }
.banner { display: flex; gap: 0.75rem; margin: 0.75rem 0; padding: 0.75rem 1rem; border: 1px solid; border-radius: var(--r-card); font-weight: 500; }
.banner-untrusted { border-color: color-mix(in srgb, var(--danger) 24%, transparent); background: color-mix(in srgb, var(--danger) 8%, #fff); color: var(--danger-ink); }
.banner-superseded { border-color: var(--line); background: var(--surface-2); color: var(--ink-2); }
.banner-unverified, .banner-warn { border-color: color-mix(in srgb, var(--warn) 30%, transparent); background: #fffbeb; color: var(--warn-ink); }

/* Lists */
.list, .hits, .steps, .links, .device-rows, .family-rows, .find-list, .rows, .ask-rows, .wk-trows2, .wk-checks, .birthdays, .gx-near, .wait-rows, .lib-rows { margin: 0; padding: 0; list-style: none; }
.list li, .step-row { padding: 0.75rem 0; border-top: 1px solid var(--line-soft); }
.list li:first-child, .step-row:first-child { border-top: 0; }
.step-row { display: grid; grid-template-columns: minmax(8em, 12em) 7em minmax(0, 1fr); align-items: center; gap: 0.25rem 0.75rem; }
.step-name { font-weight: 600; }
.step-error { grid-column: 1 / -1; display: grid; gap: 2px; margin: 0; }
.facts { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 0.5rem 1.25rem; margin: 0; padding: 0.75rem 0.9rem; border-radius: var(--r-card); background: var(--well); }
.facts dt { color: var(--ink-2); font-weight: 600; }
.facts dd { min-width: 0; margin: 0; }

/* One line of a long list (ui.js itemRow) */
.rows { display: grid; gap: 2px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; min-height: 50px; padding: 0.5rem 0.6rem; border-radius: var(--r-row); transition: background var(--dur-fast) var(--ease); }
.row:hover { background: var(--surface-2); }
.row-lead { display: grid; place-items: center; flex: none; }
.row-main { display: grid; flex: 1 1 0; gap: 1px; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; text-decoration: none; }
button.row-main, a.row-main { cursor: pointer; }
button.row-main:hover .row-title, a.row-main:hover .row-title { color: var(--accent-deep); }
.row-title { overflow: hidden; font-weight: 600; text-overflow: ellipsis; }
.row-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.75rem; min-width: 0; color: var(--ink-2); font-size: 0.8125rem; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.4rem; color: var(--ink-2); font-size: 0.8125rem; }
.row-tools { display: flex; flex: none; align-items: center; gap: 2px; }
.row-under .suggest { flex-basis: 100%; }
.row-under { display: flex; flex-wrap: wrap; flex-basis: 100%; align-items: center; justify-content: space-between; gap: 0.5rem 0.75rem; margin: 0.2rem 0 0.15rem; padding: 0.55rem 0.65rem; border-radius: var(--r-card); background: var(--well); }
.row:has(> .row-lead) > .row-under { margin-left: 42px; }
.row.is-done .row-title { color: var(--ink-3); font-weight: 500; text-decoration: line-through; text-decoration-color: var(--line-strong); }
.part-head { display: flex; align-items: center; gap: 0.5rem; margin: 0.9rem 0.6rem 0.3rem; color: var(--ink-2); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.part-head:first-child { margin-top: 0.4rem; }

/* A row that opens something: the whole row is the target */
.ask-rows { display: grid; gap: 4px; }
.ask-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 28px; align-items: center; gap: 0.75rem; width: 100%; min-height: 56px; padding: 0.55rem 0.6rem 0.55rem 0.75rem; border: 0; border-radius: var(--r-row); background: none; color: var(--ink); text-align: left; cursor: pointer; }
.ask-text { display: grid; gap: 1px; min-width: 0; }
.ask-title { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ask-text small { display: flex; align-items: center; gap: 0.5rem; min-width: 0; overflow: hidden; color: var(--ink-2); font-size: 0.8125rem; white-space: nowrap; }
.ask-row .badges { flex-wrap: nowrap; margin: 0; }
.hits { display: grid; gap: 4px; }
.hit-link { display: grid; grid-template-columns: 30px minmax(0, 1fr) 28px; align-items: center; gap: 0.75rem; padding: 0.7rem 0.6rem 0.7rem 0.75rem; border-radius: var(--r-row); color: var(--ink); text-decoration: none; }
.hit-body { display: grid; gap: 2px; min-width: 0; }
.hit-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; }
.hit-top .badges { margin: 0; }
.hit-title { color: var(--ink); font-size: 0.9375rem; font-weight: 700; }
.hit-desc { color: var(--ink); }
.snippet { color: var(--ink-2); font-size: 0.8125rem; }
.files-tile { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.files-tile .icon { width: 16px; height: 16px; }

/* Devices, family and keys: every row on one grid, so pills and times line up down the list */
.device-rows, .family-rows { display: grid; gap: 2px; }
.device-row, .family-row { display: grid; align-items: center; gap: 0.75rem; min-height: 58px; padding: 0.5rem 0.6rem; border-radius: var(--r-row); transition: background var(--dur-fast) var(--ease); }
.device-row:hover, .family-row:hover { background: var(--surface-2); }
.device-row { grid-template-columns: 30px minmax(0, 1fr) 220px 190px 112px 32px; }
.device-act { display: flex; justify-content: flex-end; }
.family-row { grid-template-columns: 30px minmax(0, 1fr) auto 32px; }
.device-name, .family-who { display: grid; gap: 1px; min-width: 0; }
.device-name b, .family-who b { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.device-name small, .family-who small { overflow: hidden; color: var(--ink-2); font-size: 0.8125rem; text-overflow: ellipsis; white-space: nowrap; }
.device-row .badges, .family-row .badges { flex-wrap: nowrap; margin: 0; overflow: hidden; }
.device-seen { color: var(--ink-2); font-size: 0.8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: grid; place-items: center; justify-self: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 0.8125rem; font-weight: 700;background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--shelf) 50%, #fff), var(--shelf)); box-shadow: 0 6px 14px -6px var(--shelf), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.connect { display: flex; align-items: stretch; gap: 0.5rem; }
.connect .connect-line { display: flex; flex: 1 1 auto; align-items: center; min-width: 0; margin: 0; }
.invite-message { padding: 0.75rem 1rem; border-radius: var(--r-card); background: var(--well); white-space: pre-wrap; }
.invite-codes { display: flex; flex-wrap: wrap; gap: 1rem; }
.invite-code { margin: 0; color: var(--ink-2); text-align: center; }
.reveal .qr, .step .qr, .invite-code .qr { display: block; width: 100%; max-width: 220px; height: auto; margin: 0.75rem 0; border-radius: var(--r-card); box-shadow: var(--sh); }
.secret { background: #fffbeb; color: var(--ink); }
/* Telegram's numbered steps */
.step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: -1rem -1.125rem 1rem; padding: 0.75rem 1rem 0.7rem; border-bottom: 1px solid var(--line-soft); border-radius: 17px 17px 0 0; background: var(--wash); }
.step-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 0.95rem; font-weight: 700; }
.step-n { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 10px; background: var(--grad); box-shadow: var(--glow-tile); color: #fff; font-size: 0.875rem; font-weight: 700; }
.step-n.is-done { background: linear-gradient(145deg, #34d399, #059669); box-shadow: 0 6px 14px -6px #059669, inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.step-body > :first-child { margin-top: 0; }
.step-body ol { display: grid; gap: 0.25rem; margin: 0 0 0.75rem; padding-left: 1.2em; }

/* Dialogs: borderless sheets lifted off a dimmed page, the head navy, the foot on the quiet fill */
.fr-overlay { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 1.5rem; background: var(--scrim); animation: fade-in var(--dur-fast) var(--ease); }
.fr-overlay-top { place-items: start center; padding-top: 12vh; }
.fr-modal { display: flex; flex-direction: column; width: min(30rem, 100%); max-height: min(90vh, 44rem); margin: 0; overflow: hidden; border-radius: var(--r-modal); background: var(--surface); box-shadow: var(--sh-lifted); animation: rise-in var(--dur) var(--ease-out); }
.fr-modal-sm { width: min(24rem, 100%); }
.fr-modal-lg { width: min(44rem, 100%); }
.fr-modal-find { width: min(40rem, 100%); }
.fr-modal-head { flex: none; display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.125rem; border-bottom: 2px solid var(--accent); background: var(--navy); color: var(--navy-ink); }
.fr-modal-head > div { flex: 1 1 auto; min-width: 0; }
.fr-modal-head h2 { margin: 0; color: #fff; font-size: 1rem; font-weight: 600; letter-spacing: -0.005em; }
.fr-modal-head .fr-meta { margin-top: 2px; color: var(--navy-ink); }
.fr-modal-orb { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: var(--r-item); background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
.fr-modal-orb .icon { width: 16px; height: 16px; }
.fr-modal-head .fr-ib { color: var(--navy-ink); }
.fr-modal-head .fr-ib:hover { background: var(--navy-hover); color: #fff; }
.fr-modal-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1rem; min-height: 0; padding: 1.125rem; overflow: auto; overscroll-behavior: contain; }
.fr-modal-body > * { flex: none; margin: 0; }
.fr-modal-body .field { max-width: none; margin: 0; }
.fr-modal-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; padding: 0.875rem 1.125rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.fr-modal-foot p { margin: 0 auto 0 0; color: var(--ink-2); font-size: 0.8125rem; }
.fr-modal .pin { max-width: none; }
/* A proposed change, line by line */
.fr-diff { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-card); }
.fr-diff-file { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font: 600 0.75rem var(--mono); }
.fr-diff-file .is-add { color: var(--ok-ink); }
.fr-diff-file .is-del { color: var(--danger-ink); }
.fr-diff table { width: 100%; table-layout: fixed; border-collapse: collapse; font: 0.75rem/1.6 var(--mono); }
.fr-diff-n { width: 36px; }
.fr-diff-s { width: 20px; }
.fr-diff td { padding: 2px 0.5rem; border: 0; overflow-wrap: anywhere; vertical-align: top; }
.fr-diff td:nth-child(-n+2) { color: var(--ink-3); text-align: right; }
.fr-diff tr.is-add { background: color-mix(in srgb, var(--ok) 10%, #fff); }
.fr-diff tr.is-add td:nth-child(n+3) { color: var(--ok-ink); }
.fr-diff tr.is-del { background: color-mix(in srgb, var(--danger) 8%, #fff); }
.fr-diff tr.is-del td:nth-child(n+3) { color: var(--danger-ink); }
.fr-diff tr.is-gap td { background: var(--surface-2); color: var(--ink-2); font-style: italic; }
.fr-diff-assets { display: grid; gap: 0.4rem; margin: 0; padding: 0.5rem 0.75rem; list-style: none; font: 0.75rem var(--mono); }
.fr-diff-assets li { display: flex; align-items: center; gap: 0.5rem; }
.own-words { padding: 0.75rem 1rem; border-radius: var(--r-card); background: var(--well); }
.own-words small { display: block; margin: 0 0 2px; color: var(--ink-2); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.own-words p { margin: 0; }
/* The search */
.find-field { display: flex; align-items: center; gap: 0.75rem; height: 58px; padding: 0 1rem; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.find-field .icon { width: 20px; height: 20px; }
.find-field input[type="search"] { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0; background: none; font-size: 1.0625rem; }
.find-field input[type="search"]:focus-visible { box-shadow: none; }
.find-field input[type="search"]::-webkit-search-cancel-button { display: none; }
.find-list { max-height: min(420px, 60vh); padding: 0.4rem; overflow: auto; }
.find-item { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.55rem 0.75rem; border-radius: var(--r-ctl); cursor: pointer; }
.find-item[aria-selected="true"] { background: var(--accent-soft); }
.find-item .icon { width: 17px; height: 17px; color: var(--ink-3); }
.find-item[aria-selected="true"] .icon { color: var(--accent); }
.find-item span { display: grid; min-width: 0; }
.find-item b { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.find-item small { overflow: hidden; color: var(--ink-2); font-size: 0.75rem; text-overflow: ellipsis; white-space: nowrap; }
.find-note { padding: 1rem 0.75rem; color: var(--ink-2); font-size: 0.875rem; }

/* The big popup a card, a page or a note opens in (ui.js bigPopup): the same sheet with a navy head, its body scrolling under it */
.wk-peek-layer { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 2rem 1.5rem; background: var(--scrim); animation: fade-in var(--dur-fast) var(--ease); }
.wk-peek { display: flex; flex-direction: column; width: min(58rem, 100%); min-width: 0; max-height: calc(100vh - 4rem); overflow: hidden; border-radius: var(--r-modal); background: var(--surface); box-shadow: var(--sh-lifted); animation: rise-in var(--dur) var(--ease-out); }
.wk-pop-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem 1rem 1.5rem; border-bottom: 2px solid var(--accent); background: var(--navy); color: var(--navy-ink); }
.wk-pop-title { display: grid; gap: 0.45rem; min-width: 0; }
.wk-pop-head h2 { margin: 0; color: #fff; font-size: 1.2rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; }
.wk-pop-head .badges { margin: 0; }
.wk-pop-head .badge, .wk-pop-head .wk-stage, .wk-pop-head .wk-st, .wk-pop-head .wk-proj, .wk-pop-head .wk-check-tag { border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.08); box-shadow: none; color: #e2e8f0; }
.wk-pop-head .fr-ib { color: var(--navy-ink); }
.wk-pop-head .fr-ib:hover { background: var(--navy-hover); color: #fff; }
.wk-peek-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1rem; min-height: 0; padding: 1.25rem 1.5rem; overflow-y: auto; overscroll-behavior: contain; }
.wk-peek-body > .path { margin: 0; }
.wk-peek-tools { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; padding: 0.875rem 1.5rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.wk-peek .fr-pop { right: auto; left: 0; }
.wk-back { display: inline-flex; align-self: start; align-items: center; gap: 0.35rem; max-width: 100%; padding: 0; border: 0; background: none; color: #a5b4fc; font: 600 0.8125rem var(--font); cursor: pointer; }
.wk-back:hover { color: #fff; }
.wk-back .icon { width: 14px; height: 14px; }

/* Notices: one at a time, top right, sliding down; Undo where a change can be put back */
.notice { position: fixed; top: 76px; right: 1.5rem; z-index: 80; width: min(380px, calc(100vw - 2rem)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 0.75rem; min-height: 50px; padding: 0.5rem 0.5rem 0.5rem 0.9rem; border: 1px solid var(--line); border-radius: var(--r-row); background: var(--surface); color: var(--ink); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12); pointer-events: auto; animation: toast-in var(--dur) var(--ease-out); }
.toast p { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0.25rem 0; }
.toast > .icon { color: var(--ok); }
.toast-bad { border-left: 3px solid var(--danger); }
.toast-bad > .icon { color: var(--danger); }
.toast-act { flex: none; height: 30px; padding: 0 0.8rem; border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent); border-radius: var(--r-ctl); background: color-mix(in srgb, var(--accent) 10%, #fff); color: var(--accent-deep); font-weight: 700; cursor: pointer; }
.toast-act:hover { border-color: var(--accent); background: var(--accent); color: #fff; }
.toast-x { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink-3); cursor: pointer; }
.toast-x:hover { background: var(--surface-2); color: var(--ink); }

/* Reading a page */
.read { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: var(--gap); }
.read-page { min-width: 0; padding: 2rem 2.5rem 2.5rem; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); box-shadow: var(--sh-panel); }
.page-head h1 { margin: 0 0 0.5rem; font-size: 1.75rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.connections { position: sticky; top: 0; max-height: calc(100vh - var(--bar-h) - 3.5rem); padding: 0 1rem 1rem; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); box-shadow: var(--sh-panel); scrollbar-width: none; }
.connections > h2 { margin: 0 -1rem 0.75rem; padding: 0.9rem 1rem 0.8rem; border-bottom: 1px solid var(--line-soft); border-radius: 17px 17px 0 0; background: var(--wash); font-size: 0.95rem; font-weight: 700; }
.connections h3 { display: flex; align-items: center; gap: 0.5rem; margin: 1rem 0 0.4rem; color: var(--ink-2); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.connections h2 + h3 { margin-top: 0.25rem; }
.links { display: grid; gap: 2px; }
.links a { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem; border-radius: var(--r-ctl); color: var(--ink); font-weight: 600; text-decoration: none; }
.links a:hover { background: var(--surface-2); color: var(--accent-deep); }
.links .icon { width: 15px; height: 15px; color: var(--accent); }
.links span { min-width: 0; }
.links small { display: block; color: var(--ink-2); font-size: 0.75rem; font-weight: 500; }
.links-none { margin: 0; color: var(--ink-2); }
.blocked-link { color: var(--ink-2); }
.prose { min-width: 0; max-width: 72ch; font-size: 0.9375rem; font-weight: 400; line-height: 1.7; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { margin: 1.7em 0 0.5em; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.prose h2 { font-size: 1.3rem; }
.prose h3 { font-size: 1.1rem; }
.prose h4, .prose h5, .prose h6 { font-size: 0.9375rem; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote, .prose .table-wrap { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.25em; }
.prose li::marker { color: var(--accent-a); }
.prose blockquote { padding: 0.25rem 1rem; border-left: 3px solid var(--accent-a); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; background: var(--well); color: var(--ink-2); }
.prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }
pre { max-width: 100%; padding: 0.75rem 1rem; border-radius: var(--r-card); background: var(--well); color: var(--ink); font-size: 0.8125rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; box-shadow: inset 0 0 0 1px var(--line-soft); }
code { font-family: var(--mono); font-size: 0.9em; font-variant-ligatures: none; }
:not(pre) > code { padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }
.table-wrap { max-width: 100%; margin: 0 0 0.75rem; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; line-height: 1.5; }
th, td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { background: var(--surface-2); color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }

/* Library: the shelves in a well at the side, the folder's rows beside them */
.lib { display: grid; padding: 0; overflow: hidden; }
.lib-split { grid-template-columns: 232px minmax(0, 1fr); }
.lib-tree { display: grid; align-content: start; gap: 2px; padding: 0.75rem 0.5rem; border-right: 1px solid var(--line-soft); background: var(--well); }
.lib-tree-label { margin: 0.4rem 0.6rem 0.3rem; color: var(--ink-2); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.lib-node { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; height: 34px; padding: 0 0.6rem; border-radius: var(--r-item); color: var(--ink-2); font-weight: 600; text-decoration: none; }
.lib-node span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-node small { color: var(--ink-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.lib-node .icon { width: 15px; height: 15px; color: var(--ink-3); }
.lib-node.d1 { padding-left: 1.6rem; }
.lib-node.d2 { padding-left: 2.5rem; }
.lib-node.d3 { padding-left: 3.4rem; }
.lib-node:hover { background: var(--surface); color: var(--ink); }
.lib-node[aria-current] { background: var(--surface); color: var(--accent-deep); box-shadow: var(--sh-sm), inset 0 0 0 1px var(--ring-soft); }
.lib-node[aria-current]::before { content: ""; position: absolute; top: 50%; left: -0.5rem; width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: var(--accent); transform: translateY(-50%); }
.lib-node-dot { width: 9px; height: 9px; margin-left: 3px; border-radius: 3px; background: var(--shelf); box-shadow: 0 2px 5px -1px var(--shelf); }
.lib-pane { display: flex; flex-direction: column; min-width: 0; }
.lib-shelves { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 0 0.75rem; }
.lib-pane > .lib-shelves { padding: 0.75rem 1rem; border-bottom: 1px solid var(--line-soft); }
.lib-split .lib-pane > .lib-shelves { display: none; }
.lib-shelf { display: inline-flex; flex: none; align-items: center; gap: 0.45rem; height: 30px; padding: 0 0.75rem; border: 0; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px #e6e9f2; color: var(--ink-2); font: 600 0.8125rem var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; transition: box-shadow var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.lib-shelf i { width: 8px; height: 8px; border-radius: 3px; background: var(--shelf); }
.lib-shelf small { color: var(--ink-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.lib-shelf:hover { box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink); }
.lib-shelf[aria-current] { background: color-mix(in srgb, var(--accent) 10%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent); color: var(--accent-deep); }
.lib-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; min-height: 54px; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line-soft); background: var(--wash); }
.lib-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; min-width: 0; font-size: 0.95rem; }
.lib-crumbs a { color: var(--ink-3); font-weight: 600; text-decoration: none; }
.lib-crumbs a:hover { color: var(--ink); }
.lib-crumbs a[aria-current] { color: var(--ink); font-weight: 700; }
.lib-crumbs .icon { width: 14px; height: 14px; color: var(--line-strong); }
input[type="search"].lib-filter { width: min(260px, 100%); padding-block: 0.45rem; font-size: 0.875rem; }
.lib-rows { display: grid; gap: 2px; padding: 0.5rem; }
.pnl-body > .lib-rows { padding: 0; }
.lib-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 28px; align-items: center; gap: 0.75rem; width: 100%; min-height: 50px; padding: 0.4rem 0.6rem 0.4rem 0.75rem; border: 0; border-radius: var(--r-row); background: none; color: var(--ink); font: 600 0.875rem var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.lib-tile { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(145deg, #fcd34d, #f59e0b); box-shadow: 0 6px 14px -6px #f59e0b, inset 0 1px 0 rgba(255, 255, 255, 0.35); color: #fff; }
.lib-tile.is-page { background: color-mix(in srgb, var(--accent) 12%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.lib-tile .icon { width: 16px; height: 16px; stroke-width: 1.9; }
.lib-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-meta { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--ink-2); font-size: 0.8125rem; font-weight: 500; white-space: nowrap; }
.lib-when { min-width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
.lib-when.is-old { color: var(--warn-ink); font-weight: 600; }
.lib-empty { padding: 1.5rem 1rem; }
.lib-lead { margin: 0; color: var(--ink); font-size: 0.9375rem; line-height: 1.55; }
.lib-link { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-width: 0; padding: 0.3rem 0.4rem; border: 0; border-radius: var(--r-ctl); background: none; color: var(--ink); font: 600 0.875rem var(--font); text-align: left; cursor: pointer; }
.lib-link:hover { background: var(--surface-2); color: var(--accent-deep); }
.gx-near { display: grid; gap: 2px; margin: 0.25rem 0 0; }

/* The library graph */
.gx { padding: 0; overflow: hidden; }
.gx-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; min-height: 54px; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line-soft); background: var(--wash); }
.gx-legend { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.gx-chip { display: inline-flex; align-items: center; gap: 0.45rem; height: 30px; padding: 0 0.75rem; border: 0; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px #e6e9f2; color: var(--ink); font: 600 0.8125rem var(--font); cursor: pointer; }
.gx-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--shelf); }
.gx-chip small { color: var(--ink-3); font-weight: 700; }
.gx-chip[aria-pressed="false"] { background: var(--surface-2); color: var(--ink-3); }
.gx-chip[aria-pressed="false"] i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.gx-count { color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }
.gx-stage { position: relative; height: calc(100vh - 210px); min-height: 420px; background-color: var(--canvas); background-image: radial-gradient(circle, var(--line) 1px, transparent 1.2px); background-size: 22px 22px; }
.gx-svg { display: block; width: 100%; height: 100%; cursor: grab; }
.gx-svg.is-drag { cursor: grabbing; }
.gx-links path { fill: none; opacity: 0.3; transition: opacity var(--dur-fast); }
.gx-n { stroke: var(--surface); cursor: pointer; transition: opacity var(--dur-fast); }
.gx-label { fill: var(--ink); font-family: var(--font); font-weight: 700; paint-order: stroke; stroke: rgba(255, 255, 255, 0.92); stroke-linejoin: round; pointer-events: none; }
.gx-label-project { fill: var(--ink-2); font-weight: 600; }
.gx-label-page { display: none; fill: var(--ink); font-weight: 600; }
.gx-svg.is-focus .gx-label-page.is-near { display: block; opacity: 1; }
.gx-svg.is-focus .gx-label.is-near { opacity: 1; }
.gx-svg.is-focus .gx-n:not(.is-near) { opacity: 0.16; }
.gx-svg.is-focus .gx-links path { opacity: 0.05; }
.gx-svg.is-focus .gx-links path.is-near { opacity: 0.85; }
.gx-svg.is-focus .gx-label:not(.is-near) { opacity: 0.25; }
.gx-tip { position: absolute; top: 0; left: 0; z-index: 2; display: grid; gap: 2px; max-width: 280px; padding: 0.5rem 0.65rem; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); box-shadow: var(--sh); color: var(--ink); font-size: 0.8125rem; opacity: 0; pointer-events: none; transition: opacity var(--dur-fast); }
.gx-tip.is-on { opacity: 1; }
.gx-tip small { color: var(--ink-2); }
.gx-tools { position: absolute; top: 0.75rem; right: 0.75rem; display: grid; gap: 0.4rem; }
.gx-tools .fr-ib { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--white-key); }
.gx-hint { position: absolute; bottom: 0.75rem; left: 1rem; margin: 0; color: var(--ink-2); font-size: 0.75rem; font-weight: 600; }

/* Work: ticket states, pipeline stages, a project as a coloured mark */
.st-fog { --st: var(--st-fog); --st-ink: var(--ink-2); }
.st-ready { --st: var(--st-ready); --st-ink: var(--accent-deep); }
.st-doing { --st: var(--st-doing); --st-ink: #6d28d9; }
.st-blocked { --st: var(--st-blocked); --st-ink: var(--danger-ink); }
.st-review { --st: var(--st-review); --st-ink: var(--warn-ink); }
.st-done { --st: var(--st-done); --st-ink: var(--ok-ink); }
.sg-idea { --st: var(--st-fog); }
.sg-spec { --st: var(--st-review); }
.sg-tickets { --st: var(--st-ready); }
.sg-building { --st: var(--st-doing); }
.sg-walk { --st: var(--st-done); }
.wk-dot { display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--st); }
.sg-idea .wk-dot, .wk-stage.sg-idea .wk-dot, .st-fog .wk-dot { background: transparent; box-shadow: inset 0 0 0 1.75px var(--st); }
.wk-st, .wk-st2, .wk-stage, .wk-check-tag { display: inline-flex; align-items: center; gap: 0.35rem; height: 22px; padding: 0 0.55rem; border: 1px solid color-mix(in srgb, var(--st, var(--ink-3)) 24%, transparent); border-radius: var(--r-pill); background: color-mix(in srgb, var(--st, var(--ink-3)) 12%, #fff); color: var(--st-ink, var(--ink-2)); font: 600 0.72rem/1 var(--font); white-space: nowrap; }
.wk-st .wk-dot, .wk-stage .wk-dot { width: 6px; height: 6px; }
.wk-st2 { justify-self: start; text-transform: capitalize; }
.wk-stage { --st-ink: var(--ink); }
.wk-check-tag { --st: var(--warn); --st-ink: var(--warn-ink); }
.wk-check-tag .icon { width: 13px; height: 13px; }
.wk-check-tag.is-icon { justify-content: center; width: 24px; padding: 0; }
.wk-proj { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; height: 22px; padding: 0 0.55rem 0 0.45rem; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px #e6e9f2; color: var(--ink-2); font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.wk-proj i { width: 8px; height: 8px; flex: none; border-radius: 3px; background: var(--shelf); }
.wk-proj span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wk-who { display: inline-flex; align-items: center; gap: 0.3rem; min-width: 0; color: var(--ink-2); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.wk-who .icon { width: 13px; height: 13px; color: var(--accent); }
.wk-none { margin: 0; color: var(--ink-2); }
.wk-label { margin: 0.25rem 0 -0.25rem; color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }

/* The board: five stage columns as wells; each column scrolls down on its own, never the page sideways */
.fr-body:has(> .view-flow) { display: flex; flex-direction: column; overflow: hidden; }
.view-flow { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.wk-cols { display: grid; align-items: start; gap: 0.85rem; }
.wk-flow { grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: hidden; }
.view-flow > .wk-flow { flex: 1 1 auto; align-items: stretch; min-height: 0; }
.wk-col { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; min-height: 120px; padding: 0 0.55rem 0.6rem; overflow-x: hidden; border-radius: 16px; background: var(--well); box-shadow: inset 0 0 0 1px var(--line-soft); }
.view-flow > .wk-flow > .wk-col { align-self: start; max-height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.wk-col::-webkit-scrollbar { display: none; }
.wk-col > header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 0.5rem; margin: 0 -0.55rem; padding: 0.8rem 0.85rem 0.5rem; border-radius: 16px 16px 0 0; background: linear-gradient(180deg, #f3f5f9 70%, rgba(243, 245, 249, 0)); font-size: 0.875rem; font-weight: 700; }
.wk-col-name { flex: 1 1 auto; }
.wk-col > header small { display: inline-flex; align-items: center; height: 20px; padding: 0 0.5rem; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px #e6e9f2; color: var(--ink-2); font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.wk-card { display: grid; gap: 0.5rem; padding: 0.8rem 0.85rem 0.75rem; border: 1px solid rgba(15, 23, 42, 0.07); border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--shelf, #eef2ff) 9%, #fff) 0%, #fff 55%); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 28px -18px rgba(15, 23, 42, 0.28); color: var(--ink); text-decoration: none; cursor: pointer; transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.wk-card:hover { border-color: #c7d2fe; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 18px 34px -16px rgba(79, 70, 229, 0.35); transform: translateY(-2px); }
.wk-card:active { transform: none; }
.wk-card > * { min-width: 0; }
.wk-card b { display: -webkit-box; overflow: hidden; font-size: 0.875rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.005em; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.wk-card .wk-proj { justify-self: start; max-width: 100%; }
.wk-card .wk-tsub { overflow: hidden; color: var(--ink-2); font-size: 0.8125rem; text-overflow: ellipsis; white-space: nowrap; }
.wk-card footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; margin-top: 0.15rem; padding: 0.45rem 0.55rem; border-radius: 10px; background: var(--well); }
.wk-segbar { display: flex; flex: 1 1 auto; gap: 2px; min-width: 0; height: 6px; overflow: hidden; border-radius: var(--r-pill); background: #e2e8f0; }
.wk-segbar i { background: var(--st); }
.wk-segbar i.is-left { background: transparent; }
/* A ticket being worked on is begun, not done: a soft stripe, so only done fills solid. */
.wk-segbar i.st-doing { background: color-mix(in srgb, var(--st) 35%, transparent); }
.wk-tchips { display: flex; align-items: center; gap: 0.4rem; }
.wk-tstuck { color: var(--danger-ink); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.wk-tcount { color: var(--ink-2); font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk-gempty { margin: 0; padding: 0.75rem 0.3rem; color: var(--ink-2); font-size: 0.8125rem; text-align: center; }
/* The stage chips a phone picks its one column with; hidden where every column fits */
.wk-stagepick { display: none; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.75rem; }
.wk-stagechip { display: inline-flex; align-items: center; gap: 0.45rem; height: 32px; padding: 0 0.75rem; border: 0; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px #e6e9f2; color: var(--ink); font: 600 0.8125rem var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wk-stagechip small { color: var(--ink-3); font-weight: 700; }
.wk-stagechip[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 10%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent); color: var(--accent-deep); }
/* The project filter in the top bar */
.wk-filterpop { width: 248px; }
.wk-filterpop .fr-pop-item { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 16px; align-items: center; gap: 0.5rem; }
.wk-filterpop .fr-pop-item .icon { color: var(--accent); }
.wk-pdot { width: 8px; height: 8px; border-radius: 3px; background: var(--shelf); }
.wk-pcount { color: var(--ink-3); font-weight: 700; font-variant-numeric: tabular-nums; }
/* A card's popup: the stage strip, the idea, the spec, the tickets and the chat line */
.wk-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.wk-stages li { display: grid; gap: 0.4rem; min-width: 0; color: var(--ink-3); font-size: 0.75rem; font-weight: 700; text-align: center; }
.wk-stages i { height: 5px; border-radius: var(--r-pill); background: var(--surface-2); }
.wk-stages li.is-past i { background: var(--st); }
.wk-stages li.is-here { color: var(--ink); }
.wk-pop-body { display: grid; gap: 1rem; }
.wk-pop-col { display: grid; align-content: start; gap: 1rem; min-width: 0; }
.wk-pop-sec { display: grid; gap: 0.75rem; padding: 0.9rem 1rem 1rem; border-radius: var(--r-card); background: var(--well); box-shadow: inset 0 0 0 1px var(--line-soft); }
.wk-pop-sec > header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.wk-pop-sec h3 { margin: 0; color: var(--ink-2); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.wk-pop-sec > header small { color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }
.wk-quote { margin: 0; padding: 0.15rem 0 0.15rem 0.85rem; border-left: 3px solid var(--accent-a); color: var(--ink); font-size: 0.9375rem; line-height: 1.55; }
.wk-goal { margin: 0; color: var(--ink); font-size: 0.9375rem; font-weight: 600; line-height: 1.5; }
.wk-checks { display: grid; gap: 0.45rem; }
.wk-checks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 0.5rem; }
.wk-checks li.is-done { color: var(--ink-2); }
.wk-box { display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--line-strong); border-radius: 5px; background: #fff; }
.is-done > .wk-box { border-color: var(--ok); background: var(--ok); color: #fff; }
.wk-box .icon { width: 12px; height: 12px; stroke-width: 2.6; }
.wk-specstate { display: flex; align-items: center; gap: 0.5rem; margin: 0.15rem 0 0; color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }
.wk-specstate .icon { width: 14px; height: 14px; color: var(--accent); }
.wk-more { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--accent); font-size: 0.8125rem; font-weight: 600; text-decoration: none; }
.wk-more .icon { width: 13px; height: 13px; }
.wk-trows2 { display: grid; gap: 0.4rem; }
.wk-trows2 li { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 0.5rem; }
.wk-trows2 li.is-check { grid-template-columns: minmax(0, 1fr) auto; }
.wk-trow2 { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto 28px; align-items: center; gap: 0.6rem; width: 100%; min-width: 0; min-height: 46px; padding: 0.4rem 0.5rem 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: var(--r-row); background: var(--surface); color: var(--ink); font: 600 0.875rem var(--font); text-align: left; cursor: pointer; }
.wk-trow2-title { min-width: 0; line-height: 1.3; }
.wk-trow2 .wk-who { max-width: 140px; overflow: hidden; }
.wk-trow2 > .go { grid-column: -2; }
.wk-pop-foot { position: sticky; bottom: -1.25rem; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 -1.5rem -1.25rem; padding: 0.9rem 1.5rem; border-top: 1px solid var(--line-soft); background: linear-gradient(180deg, var(--canvas), #fff); }
.wk-pop-foot-text { display: grid; gap: 2px; min-width: 0; }
.wk-pop-foot-text small { color: var(--ink-2); font-size: 0.75rem; font-weight: 600; }
.wk-pop-foot-text code { overflow: hidden; color: var(--ink); font-size: 0.875rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
/* A ticket's popup: the line to grab it in a well, then its sections read like fields */
.wk-peek-take { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.75rem 0.9rem; border-radius: var(--r-card); background: var(--well); box-shadow: inset 0 0 0 1px var(--line-soft); }
.wk-peek-take > span { display: grid; flex: 1 1 180px; gap: 2px; min-width: 0; }
.wk-peek-take small { color: var(--ink-2); font-size: 0.75rem; font-weight: 600; }
.wk-peek-take code { font-size: 0.875rem; font-weight: 600; overflow-wrap: anywhere; }
.wk-secs { display: grid; }
.wk-sec { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 1rem; padding: 0.9rem 0; border-top: 1px solid var(--line-soft); }
.wk-sec > h2 { display: flex; align-items: flex-start; gap: 0.5rem; margin: 2px 0 0; color: var(--ink-2); font-size: 0.875rem; font-weight: 600; line-height: 1.4; }
.wk-sec > h2 .icon { width: 16px; height: 16px; color: var(--accent); }
.wk-sec > div { min-width: 0; line-height: 1.6; }
.wk-sec p { margin: 0; }
.wk-sec p + p { margin-top: 0.4rem; }
.wk-sec.is-empty > div { color: var(--ink-3); }
.wk-sec.is-stands { margin: 0 0 0.25rem; padding: 0.85rem 1rem; border: 0; border-radius: var(--r-card); background: linear-gradient(135deg, color-mix(in srgb, #818cf8 14%, #fff), #fff 70%); box-shadow: inset 0 0 0 1px #c7d2fe; }
.wk-sec.is-stands + .wk-sec { border-top-color: transparent; }
.wk-sec.is-stands > h2, .wk-sec.is-stands > h2 .icon { color: var(--accent-deep); }
/* The inbox popup's File it row */
.in-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 0.75rem; }
.in-row label { display: grid; gap: 0.4rem; min-width: 0; }
.in-row label > span { color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }

/* Projects: one table in a panel; a project's specs and decisions a row a page */
.wk-table, .wk-list { padding: 0; overflow: hidden; }
.wk-list { padding: 0.5rem; }
.wk-thead, .wk-prow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px) 110px 28px; align-items: center; gap: 1rem; }
.wk-thead { min-height: 44px; padding: 0 1.25rem 0 1rem; border-bottom: 1px solid var(--line-soft); border-radius: 17px 17px 0 0; background: var(--wash); color: var(--ink-2); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.wk-prow { min-height: 64px; margin: 0.25rem 0.5rem; padding: 0.5rem 0.75rem 0.5rem 0.5rem; border-radius: var(--r-row); color: var(--ink); text-decoration: none; }
.wk-prow:last-child { margin-bottom: 0.5rem; }
.wk-prow.is-retired { color: var(--ink-2); }
.wk-prow.is-retired .wk-ptile { filter: grayscale(0.7); opacity: 0.6; }
.wk-pname { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.wk-pname > span { display: grid; gap: 1px; min-width: 0; }
.wk-pname b { font-weight: 700; }
.wk-pname small { overflow: hidden; color: var(--ink-2); font-size: 0.8125rem; text-overflow: ellipsis; white-space: nowrap; }
.wk-ptile { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 12px; background: linear-gradient(145deg, color-mix(in srgb, var(--shelf) 55%, #fff), var(--shelf)); box-shadow: 0 6px 14px -6px var(--shelf), inset 0 1px 0 rgba(255, 255, 255, 0.35); color: #fff; font: 700 0.9375rem var(--font); }
.wk-pdate { color: var(--ink-2); font-size: 0.8125rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.wk-counts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; min-width: 0; }
.wk-seg { display: inline-flex; flex: none; align-items: center; gap: 0.15rem; height: 30px; margin-left: 1.4rem; padding: 0.2rem; border: 1px solid var(--ring-soft); border-radius: 14px; background: #f5f6fb; }
.wk-seg a { display: inline-flex; align-items: center; gap: 0.4rem; height: 24px; padding: 0 0.7rem; border-radius: 10px; color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.wk-seg a:hover { color: var(--ink); }
.wk-seg a small { color: var(--ink-3); font-size: 0.72rem; font-weight: 700; }
.wk-seg a[aria-current] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 6px 14px -10px rgba(79, 70, 229, 0.6); }
.wk-lrow { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 90px 28px; align-items: center; gap: 0.75rem; min-height: 56px; padding: 0.45rem 0.6rem 0.45rem 0.75rem; border-radius: var(--r-row); color: var(--ink); text-decoration: none; }

/* Today and Notes: the list panel, the add line in its head, the tick, the side panels */
.add-row { display: flex; flex: 1 1 320px; align-items: center; gap: 0.4rem; min-width: 0; padding: 0.2rem 0.2rem 0.2rem 0.6rem; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--white-key); }
.add-row:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.add-row > .icon { width: 16px; height: 16px; color: var(--accent); }
.add-row input[type="text"].add-text { flex: 1 1 auto; min-width: 0; padding: 0.35rem 0.2rem; border: 0; background: none; font-size: 0.9375rem; }
.add-row input[type="time"].add-time { flex: none; width: 104px; padding: 0.3rem 0.45rem; border-color: var(--line); background: var(--surface-2); font-size: 0.8125rem; }
.add-row input:focus-visible { box-shadow: none; }
.card-head .add-row .btn { height: 30px; box-shadow: none; }
.card-head form { display: flex; flex: 1 1 320px; justify-content: flex-end; min-width: 0; }
.day-part.is-late .part-head { color: var(--danger-ink); }
.day-part.is-quiet .row { opacity: 0.72; }
.day-part > .empty { padding: 0.35rem 0.6rem 0.6rem; font-size: 0.875rem; }
.tick { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1.5px solid var(--line-strong); border-radius: 50%; background: #fff; color: transparent; cursor: pointer; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.tick .icon { width: 13px; height: 13px; stroke-width: 2.6; }
.tick:hover { border-color: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 16%, transparent); }
.tick.is-done { border-color: var(--ok); background: var(--ok); color: #fff; }
.when { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.when .icon { width: 13px; height: 13px; color: var(--ink-3); }
.when.is-late, .when.is-late .icon { color: var(--danger-ink); font-weight: 600; }
.page-chip { display: inline-flex; align-items: center; gap: 0.3rem; max-width: 100%; height: 22px; padding: 0 0.55rem; border-radius: var(--r-pill); background: color-mix(in srgb, var(--accent) 9%, #fff); color: var(--accent-deep); font-size: 0.75rem; font-weight: 600; text-decoration: none; }
.page-chip:hover { background: color-mix(in srgb, var(--accent) 16%, #fff); }
.page-chip .icon { width: 12px; height: 12px; }
.wait-rows { display: grid; gap: 0.4rem; }
.wait-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; }
.wait-row .btn { padding: 0.4rem 0.75rem; font-size: 0.8125rem; }
.birthdays { display: grid; gap: 0.4rem; }
.birthdays li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.55rem 0.7rem; border-radius: var(--r-row); background: var(--well); }
.bday-day { justify-self: start; display: inline-flex; align-items: center; height: 22px; padding: 0 0.55rem; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px #e6e9f2; color: var(--ok-ink); font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.birthdays b { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.birthdays small { color: var(--ink-2); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.drop textarea.drop-text { min-height: 92px; border-color: transparent; background: var(--well); box-shadow: inset 0 0 0 1px var(--line-soft); font-size: 0.9375rem; }
.drop textarea.drop-text:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.drop textarea.drop-text:focus-visible { border-color: var(--accent); background: #fff; box-shadow: var(--focus); }
.drop-foot { display: flex; justify-content: flex-end; padding-top: 0.6rem; }
.row.is-note { align-items: flex-start; padding: 0.7rem 0.6rem; }
.row.is-note + .row.is-note { border-top: 1px solid var(--line-soft); border-radius: 0; }
.row.is-note:hover { background: none; }
.row.is-note .row-line { display: -webkit-box; overflow: hidden; color: var(--ink-2); font-size: 0.875rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.suggest { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; color: var(--ink); font-size: 0.875rem; font-weight: 600; }
.suggest .icon { width: 16px; height: 16px; color: var(--accent); }
.suggest.is-none { color: var(--ink-2); font-weight: 500; }
.sorts { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sorts .btn { padding: 0.35rem 0.7rem; border-color: var(--line); background: #fff; color: var(--ink); font-size: 0.8125rem; font-weight: 600; box-shadow: var(--white-key); }
.sorts .btn:hover:not(:disabled) { background: #fff; border-color: var(--line-strong); }
.sorts .btn-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.sorts .btn-primary:hover:not(:disabled) { background: var(--accent-deep); }
.sorts .btn .icon { width: 14px; height: 14px; }
.sorts .sort-drop { color: var(--danger-ink); }
.walk { display: grid; gap: 0.85rem; }
.walk-top { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.75rem; color: var(--ink-2); font-size: 0.8125rem; font-weight: 700; }
.walk-title { margin: 0.4rem 0 0; font-size: 1.25rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; }
.walk-words { max-width: 72ch; margin: 0; padding: 0.75rem 0.9rem; border-radius: var(--r-card); background: var(--well); font-size: 0.9375rem; line-height: 1.6; white-space: pre-wrap; }
.walk-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; }
.walk-foot { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }

/* The AI setup editor: each item a panel of property rows and its text, its versions in a panel beside it */
.ai { align-content: start; }
.ai-ly { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: var(--gap); }
.ai-ly.is-single { grid-template-columns: minmax(0, 1fr); }
.ai-page { min-width: 0; padding: 0 1.5rem 1.5rem; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); box-shadow: var(--sh-panel); }
.ai-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; min-height: 54px; margin: 0 -1.5rem 1.25rem; padding: 0.6rem 1rem 0.6rem 1.25rem; border-bottom: 1px solid var(--line-soft); border-radius: 17px 17px 0 0; background: var(--wash); }
.ai-bar .btn { padding: 0.35rem 0.8rem; font-size: 0.8125rem; }
.ai-bar .btn-primary { border: 0; border-radius: var(--r-pill); background: var(--grad-pill); box-shadow: var(--glow-btn); }
.ai-gap { flex: 1 1 auto; }
.ai-pager { color: var(--ink-2); font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ai-sep { width: 1px; height: 20px; margin: 0 0.25rem; background: var(--line); }
.ai-edited { display: none; align-items: center; gap: 0.4rem; color: var(--warn-ink); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.ai-edited i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.is-edited .ai-edited { display: inline-flex; }
.ai-head { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1.1rem; }
.ai-head .fr-tile { width: 40px; height: 40px; border-radius: 12px; }
.ai-head .fr-tile .icon { width: 20px; height: 20px; }
.ai-name, .ai-page input.ai-name { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0.1rem 0.3rem; border: 1px solid transparent; border-radius: var(--r-ctl); background: none; color: var(--ink); font: 700 1.5rem/1.3 var(--font); letter-spacing: -0.02em; }
.ai-page input.ai-name:hover { border-color: var(--line); }
.ai-page input.ai-name:focus-visible { border-color: var(--accent); box-shadow: var(--focus); }
.ai-note { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0 0 1.1rem; padding: 0.7rem 0.9rem; border-radius: var(--r-card); background: #fffbeb; box-shadow: inset 0 0 0 1px #fde68a; color: var(--warn-ink); }
.ai-note > i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.ai-note > span { flex: 1 1 auto; }
.ai-props { display: grid; gap: 2px; margin: 0 0 1.25rem; padding: 0.4rem; border-radius: var(--r-card); background: var(--well); }
.ai-prop { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: center; gap: 0.75rem; min-height: 40px; padding: 0 0.5rem; border-radius: var(--r-ctl); }
.ai-prop:hover { background: #fff; }
.ai-prop > span { display: flex; align-items: center; gap: 0.5rem; color: var(--ink-2); font-weight: 600; }
.ai-prop > span .icon { width: 16px; height: 16px; color: var(--accent); }
.ai-val { min-width: 0; }
.ai-text { font-weight: 500; }
.ai-page input.ai-input { width: 100%; padding: 0.35rem 0.5rem; border: 1px solid transparent; background: none; font-size: 0.875rem; text-overflow: ellipsis; }
.ai-page input.ai-input:hover { border-color: var(--line-strong); background: #fff; }
.ai-page input.ai-input:focus-visible { border-color: var(--accent); background: #fff; }
.ai-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; min-width: 0; padding: 0.3rem 0; }
.ai-chip { position: relative; display: inline-flex; align-items: center; gap: 0.4rem; height: 26px; padding: 0 0.65rem; border: 0; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px #e6e9f2; color: var(--ink); font: 600 0.75rem var(--font); white-space: nowrap; }
.ai-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--shelf, var(--accent)); }
.ai-chip-add { color: var(--accent-deep); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent); cursor: pointer; }
.ai-chip-add:hover { background: color-mix(in srgb, var(--accent) 10%, #fff); }
.ai-chip-add .icon { width: 13px; height: 13px; }
.ai-x { display: none; place-items: center; width: 16px; height: 16px; margin-right: -4px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.ai-x .icon { width: 10px; height: 10px; stroke-width: 2.4; }
.ai-chip:hover .ai-x, .ai-chip:focus-within .ai-x, .ai-file:hover .ai-x, .ai-file:focus-within .ai-x { display: inline-grid; }
.ai-pick { width: 260px; max-height: 320px; overflow: auto; }
.ai-pick input[type="search"] { margin: 0 0 0.25rem; padding-block: 0.4rem; font-size: 0.875rem; }
.ai-pick .fr-pop-item .icon { visibility: hidden; color: var(--accent); }
.ai-pick .fr-pop-item[aria-pressed="true"] .icon { visibility: visible; }
.ai-file { display: inline-flex; align-items: center; gap: 0.25rem; }
.ai-file.is-new { color: var(--ok-ink); }
.ai-file-pick { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ai-status { display: inline-flex; align-items: center; gap: 0.4rem; margin-right: 0.75rem; font-weight: 500; }
.ai-status i { width: 7px; height: 7px; border-radius: 50%; }
.ai-status i.is-ok { background: var(--ok); }
.ai-status i.is-warn { background: var(--warn); }
.ai-blocks { margin: 0 -0.75rem; padding: 0.4rem 0.75rem; border-radius: var(--r-card); cursor: text; transition: background var(--dur-fast) var(--ease); }
.ai-blocks:hover { background: var(--well); }
.ai-page textarea.ai-editor { min-height: 280px; border-color: var(--line); background: #fff; font: 400 0.9375rem/1.7 var(--font); field-sizing: content; }
.ai-history { display: flex; flex-direction: column; min-width: 0; padding: 0 1rem 1rem; border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); box-shadow: var(--sh-panel); }
.ai-history-head { display: flex; align-items: center; justify-content: space-between; min-height: 54px; margin: 0 -1rem 0.6rem; padding: 0.6rem 0.75rem 0.6rem 1rem; border-bottom: 1px solid var(--line-soft); border-radius: 17px 17px 0 0; background: var(--wash); }
.ai-history-head h2 { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.95rem; font-weight: 700; }
.ai-versions { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.ai-version { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem; border-radius: var(--r-ctl); }
.ai-version:hover { background: var(--surface-2); }
.ai-version-text { display: grid; gap: 1px; min-width: 0; }
.ai-version-text b { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.ai-version-text small { color: var(--ink-2); font-size: 0.75rem; }
.ai-version .btn { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
.ai-latest { display: inline-flex; align-items: center; height: 20px; padding: 0 0.5rem; border: 1px solid color-mix(in srgb, var(--ok) 24%, transparent); border-radius: var(--r-pill); background: color-mix(in srgb, var(--ok) 12%, #fff); color: var(--ok-ink); font-size: 0.6875rem; font-weight: 700; }
.ai-history-note { margin-top: 1rem; }
.ai-table { margin: 0 0 0.75rem; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-card); }
.ai-empty { display: grid; place-items: center; }
.ai-options { display: grid; gap: 0.5rem; }
.ai-option { display: flex; align-items: center; gap: 0.75rem; min-height: 46px; padding: 0 1rem; border: 1px solid var(--line); border-radius: var(--r-row); cursor: pointer; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.ai-option:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 7%, #fff); }
.ai-held { margin: 0; color: var(--warn-ink); }
.ai-command { display: block; padding: 0.75rem 1rem; border-radius: var(--r-card); background: var(--well); box-shadow: inset 0 0 0 1px var(--line-soft); }

/* The plain page printPage prints: a recovery code or the paper codes, nothing else on paper */
.print-page { display: none; }
@media print {
  body > :not(.print-page) { display: none !important; }
  .print-page { display: block; background: #fff; color: #000; font: 14px var(--font); }
  .print-page pre { border: 0; background: none; box-shadow: none; font-size: 20px; letter-spacing: 0.08em; white-space: pre-wrap; }
}

/* A touch screen has no keys to hint at */
@media (hover: none), (max-width: 768px) {
  kbd { display: none; }
}

@media (min-width: 900px) {
  .wk-pop-body { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; }
}

@media (max-width: 1180px) {
  .device-row { grid-template-columns: 30px minmax(0, 1fr) 200px 112px 32px; }
  .device-seen { display: none; }
  .read { grid-template-columns: minmax(0, 1fr); }
  .connections { position: static; max-height: none; }
}
@media (max-width: 1100px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .overview-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .ai-ly { grid-template-columns: minmax(0, 1fr); }
  .wk-thead, .wk-prow { grid-template-columns: minmax(0, 1fr) minmax(0, 280px) 90px 28px; }
}
@media (max-width: 1100px) and (min-width: 769px) {
  .wk-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .view-flow > .wk-flow { grid-template-rows: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  /* A phone: the menu is a drawer, the top bar sticks and puts its tabs and actions on rows of their own, dialogs rise from the bottom, one column throughout. */
  :root { --pad: 1rem; --pad-x: 0.75rem; }
  body { font-size: 0.9375rem; }
  input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="time"], select, textarea { font-size: 16px; }
  .fr, .fr.is-rail { display: block; height: auto; }
  .fr-side { position: fixed; top: 0; bottom: 0; left: 0; width: 280px; height: 100%; visibility: hidden; transform: translateX(-100%); transition: transform var(--dur) var(--ease), visibility 0s var(--dur); }
  .is-rail .fr-brand-name, .is-rail .fr-side .fr-label, .is-rail .fr-search span, .is-rail .fr-me-text, .is-rail .fr-signout { display: revert; }
  .is-rail .fr-section { justify-content: flex-start; min-height: 28px; padding: 0.625rem 1.25rem 0.25rem; font-size: 0.6875rem; }
  .is-rail .fr-section::before { display: none; }
  .is-rail .fr-brand { justify-content: flex-start; padding: 0.3125rem 0.8rem; }
  .is-rail .fr-side .fr-item, .is-rail .fr-search { justify-content: flex-start; padding: 0.5rem 0.625rem; }
  .is-rail .fr-me { justify-content: flex-start; }
  .fr-side #rail { display: none; }
  .is-drawer .fr-side { z-index: 65; visibility: visible; transform: none; box-shadow: var(--sh-lifted); transition: transform var(--dur) var(--ease), visibility 0s; }
  .is-drawer .fr-scrim { position: fixed; inset: 0; z-index: 64; display: block; background: var(--scrim); }
  .fr-main { height: auto; min-height: 100vh; }
  .fr-top { position: sticky; top: 0; align-items: flex-start; gap: 0 0.5rem; padding: 0 0.75rem; }
  .fr-top .fr-menu { display: grid; margin-top: 8px; background: #fff; box-shadow: inset 0 0 0 1px var(--line), var(--white-key); }
  .fr-top .view-head { flex-wrap: wrap; align-items: center; gap: 0.5rem; min-height: var(--bar-h); }
  .fr-head-tile { width: 28px; height: 28px; }
  .fr-title { flex: 1 1 0; font-size: 1.05rem; }
  .fr-tabs, .wk-seg { order: 5; flex: 0 0 100%; justify-content: flex-start; height: auto; margin: 0 0 0.5rem; overflow-x: auto; scrollbar-width: none; }
  .fr-tab, .wk-seg a { height: 30px; }
  /* A phone shows the open bubble across the foot of the screen, wherever its mark sits. */
  .tip-text { position: fixed; top: auto; right: 0.75rem; bottom: 0.75rem; left: 0.75rem; z-index: 90; width: auto; max-width: none; padding: 0.75rem 0.875rem; font-size: 0.875rem; box-shadow: var(--sh-lifted); }
  .is-out .view-head .tip-text { position: static; padding: 0; box-shadow: none; }
  .fr-top .view-tools { order: 6; flex: 1 0 100%; flex-wrap: wrap; margin: 0 0 0.6rem; }
  .fr-top .view-tools:empty { display: none; }
  .top-pill { display: none; }
  .fr-body { overflow: visible; }
  .notice { top: auto; right: 0.75rem; bottom: 0.75rem; left: 0.75rem; width: auto; }
  .fr-overlay { place-items: end stretch; padding: 0; }
  .fr-overlay-top { padding-top: 0; }
  .fr-modal, .fr-modal-sm, .fr-modal-lg, .fr-modal-find { width: 100%; max-height: 92vh; border-radius: var(--r-modal) var(--r-modal) 0 0; }
  .wk-peek-layer { place-items: end stretch; padding: 0; }
  .wk-peek { width: 100%; max-height: 94vh; border-radius: var(--r-modal) var(--r-modal) 0 0; }
  .wk-pop-head { padding: 1rem; }
  .wk-peek-body { padding: 1rem; }
  .wk-peek-tools { padding: 0.75rem 1rem; }
  .wk-pop-foot { bottom: -1rem; margin: 0 -1rem -1rem; padding: 0.75rem 1rem; }
  .card, .panel { padding: 0.9rem 0.9rem 1rem; }
  .card > .card-head:first-child, .card > h2:first-child { margin: -0.9rem -0.9rem 0.9rem; }
  .step-head { margin: -0.9rem -0.9rem 0.9rem; }
  .pnl { padding: 0; }
  .pnl > .card-head:first-child { margin: 0; }
  .pnl-body { padding: 0.5rem 0.75rem 0.85rem; }
  .card-head form { flex-basis: 100%; }
  .add-row { flex-wrap: wrap; }
  .add-row input[type="text"].add-text { flex: 1 1 calc(100% - 30px); }
  .add-row input[type="time"].add-time { flex: 1 1 auto; }
  .overview-side { display: flex; }
  .ask-row { grid-template-columns: 30px minmax(0, 1fr) 28px; }
  .ask-row .badges { grid-row: 2; grid-column: 2; }
  .ask-row > .go { grid-row: 1 / 3; grid-column: 3; }
  .device-row { grid-template-columns: 30px minmax(0, 1fr) auto 32px; row-gap: 0.4rem; }
  .device-row .badges { grid-column: 2 / -1; grid-row: 2; flex-wrap: wrap; }
  .device-act { grid-row: 1; grid-column: 3; }
  .device-row > .fr-anchor, .device-row > span:last-child { grid-row: 1; grid-column: 4; }
  .family-row { grid-template-columns: 30px minmax(0, 1fr) 32px; }
  .family-row .badges { grid-column: 2; justify-content: flex-start; }
  .family-row > .fr-anchor { grid-row: 1; grid-column: 3; }
  .read-page { padding: 1.25rem 1rem; }
  .page-head h1 { font-size: 1.4rem; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 0.5rem; }
  .pin { max-width: none; }
  .step-row { grid-template-columns: minmax(0, 1fr) auto; }
  .step-row > .hint { grid-column: 1 / -1; }
  .in-row { grid-template-columns: minmax(0, 1fr); }
  .lib-split { grid-template-columns: minmax(0, 1fr); }
  .lib-tree { display: none; }
  .lib-split .lib-pane > .lib-shelves { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .lib-row { gap: 0.5rem; }
  .lib-when { display: none; }
  /* The board shows one column at a time, picked with the stage chips. */
  .wk-stagepick { display: flex; }
  .fr-body:has(> .view-flow) { overflow: visible; }
  .wk-flow { grid-template-columns: minmax(0, 1fr); }
  .wk-flow > .wk-col { display: none; }
  .wk-flow.show-idea > .sg-idea, .wk-flow.show-spec > .sg-spec, .wk-flow.show-tickets > .sg-tickets, .wk-flow.show-building > .sg-building, .wk-flow.show-walk > .sg-walk { display: flex; }
  .wk-sec { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; padding: 0.75rem 0; }
  .wk-trow2 { grid-template-columns: minmax(0, 1fr) 28px; row-gap: 0.3rem; }
  .wk-trow2 > .wk-st2 { grid-row: 2; grid-column: 1; }
  .wk-trow2-title { grid-row: 1; grid-column: 1; }
  .wk-trow2 > .wk-who { grid-row: 3; grid-column: 1; justify-self: start; }
  .wk-trow2 > .go { grid-row: 1 / span 3; grid-column: 2; }
  .wk-trows2 li.is-check { grid-template-columns: minmax(0, 1fr); }
  .wk-trows2 li.is-check > .btn { justify-self: end; }
  .wk-thead { display: none; }
  .wk-prow { grid-template-columns: minmax(0, 1fr) 28px; row-gap: 0.5rem; margin: 0.25rem; padding: 0.6rem; }
  .wk-prow > .wk-pname { grid-column: 1; }
  .wk-prow > .go { grid-row: 1; grid-column: 2; }
  .wk-prow > .wk-pdate { display: none; }
  .wk-prow > .wk-counts, .wk-prow > .wk-none { grid-column: 1 / -1; padding-left: 48px; }
  .wk-lrow { grid-template-columns: 30px minmax(0, 1fr) 28px; row-gap: 0.25rem; }
  .wk-lrow > .badge { grid-row: 2; grid-column: 2; justify-self: start; }
  .wk-lrow > .wk-pdate { display: none; }
  .wk-lrow > .go { grid-row: 1 / 3; grid-column: 3; }
  .row { padding: 0.5rem 0.3rem; }
  .row-meta { flex-basis: 100%; justify-content: flex-start; }
  .row:has(> .row-lead) > .row-meta { padding-left: 42px; }
  .row:has(> .row-lead) > .row-under { margin-left: 0; }
  .birthdays li { grid-template-columns: 78px minmax(0, 1fr) auto; gap: 0.5rem; }
  .ai-page { padding: 0 1rem 1rem; }
  .ai-bar { margin: 0 -1rem 1rem; padding: 0.6rem 0.75rem; }
  .ai-name, .ai-page input.ai-name { font-size: 1.25rem; }
  .ai-prop { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; padding: 0.5rem; }
  .fr-top .ai-top .view-tools { order: 1; flex: 0 1 auto; min-height: var(--bar-h); margin: 0 0 0 auto; }
}
