/* Ari 0.8.0 — "The Living Constellation" (ADR 026). Tokens first; components use tokens only.
   Dark is the default; light is chosen in Home & care or follows the device. */
:root,:root[data-theme=dark]{
  color-scheme:dark;
  --bg:#070B16;--habitat:#0B1224;--surface:#121B31;--surface-2:#16213b;
  --glass:rgba(25,37,66,.82);--glass-raised:rgba(36,50,83,.72);--glass-soft:rgba(20,30,54,.62);--glass-strong:rgba(24,35,62,.94);--shadow-pill:0 4px 16px rgba(0,0,0,.34);
  --stroke:rgba(158,183,255,.30);--stroke-soft:rgba(158,183,255,.16);
  --text:#F6F3EA;--text-2:#B4C0DD;--text-3:#8D9ABB;
  --violet:#8B7CFF;--cyan:#66E2F0;--amber:#FFC66D;--mint:#8DE3C1;--rose:#FF7892;--warning:#F6AE5E;
  --on-accent:#0B0F1E;--field:rgba(9,14,28,.72);--code:#0A1022;--scrim:rgba(3,6,14,.72);--edge-shadow:rgba(0,0,0,.45);--on-scene:#F6F3EA;--on-scene-2:#D5DCF0;--scene-chip:rgba(10,18,40,.55);--scene-shadow:0 2px 24px rgba(3,6,20,.55);
  --habitat-opacity:.34;--habitat-veil:linear-gradient(180deg,rgba(7,11,22,.10) 0%,rgba(7,11,22,.0) 38%,rgba(7,11,22,.55) 70%,rgba(7,11,22,.86) 100%);
  --shadow-card:0 16px 44px rgba(0,0,0,.28),inset 0 1px rgba(255,255,255,.10);
  --shadow-float:0 28px 90px rgba(1,5,18,.46),0 0 0 1px rgba(158,183,255,.18);
  --glow-active:0 0 24px rgba(102,226,240,.24);--glow-reward:0 0 30px rgba(255,198,109,.25);--glow-violet:0 0 26px rgba(139,124,255,.30);
}
:root{
  --font:"Geist","Geist Variable",Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --mono:"Geist Mono",ui-monospace,SFMono-Regular,Consolas,monospace;
  --s1:4px;--s2:8px;--s3:12px;--s4:16px;--s5:20px;--s6:24px;--s7:32px;--s8:40px;--s9:56px;--s10:72px;
  --r-compact:12px;--r-control:18px;--r-card:24px;--r-hero:32px;--r-chip:999px;
  --gutter:20px;--touch:48px;--primary-control:56px;
  /* #178: a tap area is not a visual size. Controls are tapped on --hit and drawn at --control (the
     transparent ring between them is --hit-ring); text and the Talk composer read the same scale.
     These are the laptop's values; compact.css sets the phone's. */
  --hit:44px;--control:36px;--hit-ring:calc((var(--hit) - var(--control)) / 2);--composer-control:36px;
  --control-sm:28px;--hit-ring-sm:calc((var(--hit) - var(--control-sm)) / 2);
  --text-body:15px;--leading-body:22px;
  /* #215: Ari's replies are prose without a bubble: reading lines, and the air between two replies. */
  --leading-reading:24px;--gap-reply:28px;
  /* #182: the whole compact scale (ADR 067; the ui-ux-designer skill's compact-density table). Text
     roles: display (the greeting), headline (the one thing a card is about), title (screens, sheets,
     dialogs, days), heading (a card or row title), body, secondary, caption, micro (tab labels, time
     dividers), control and small control text, input text (16 px: iOS zooms a smaller field).
     Controls drawn inside the --hit ring: --control-lg a filled button, --control a pill or disc,
     --control-chip a chip, --control-sm a small action. Fields and rows, then spacing. The text and
     spacing values here are the laptop's own; compact.css sets the phone's. */
  --text-display:44px;--leading-display:48px;--text-headline:24px;--leading-headline:30px;
  --text-title:22px;--leading-title:28px;--text-heading:16px;--leading-heading:22px;
  --text-secondary:14px;--leading-secondary:20px;--text-caption:13px;--leading-caption:18px;--text-micro:12px;--leading-micro:16px;
  --text-control:15px;--text-control-sm:14px;--leading-control:20px;--text-input:16px;
  --control-lg:40px;--hit-ring-lg:calc((var(--hit) - var(--control-lg)) / 2);
  --control-chip:32px;--hit-ring-chip:calc((var(--hit) - var(--control-chip)) / 2);
  --field-height:48px;--row-2:60px;
  --pad-card:16px;--pad-sheet:18px;--gap-list:12px;--gap-stack:12px;--gap-section:24px;
  --blur:24px;--blur-compact:12px;
  --instant:80ms;--fast:160ms;--base:240ms;--scene:420ms;--celebrate:680ms;--ambient-breath:4200ms;--dream-breath:7000ms;
  --ease:cubic-bezier(.2,.8,.2,1);--ease-settle:cubic-bezier(.16,1,.3,1);
  font-family:var(--font);font-size:16px;line-height:1.45;color:var(--text);background:var(--bg);font-synthesis:none;
  -webkit-text-size-adjust:100%;text-size-adjust:100%;
  /* Kept for older rules and scripts that still read them. */
  --line:var(--stroke-soft);--muted:var(--text-2);--accent:var(--violet);
}
:root[data-theme=light]{
  color-scheme:light;
  --bg:#F5F4F0;--habitat:#E9EEF9;--surface:#FFFFFF;--surface-2:#F0F2F8;
  --glass:rgba(255,255,255,.80);--glass-raised:rgba(255,255,255,.92);--glass-soft:rgba(255,255,255,.66);--glass-strong:rgba(255,255,255,.94);--shadow-pill:0 4px 14px rgba(37,54,88,.14);
  --stroke:rgba(37,54,88,.16);--stroke-soft:rgba(37,54,88,.12);
  --text:#101628;--text-2:#4D5872;--text-3:#5F6982;
  --violet:#6555DE;--cyan:#087F91;--amber:#9B6100;--mint:#08765A;--rose:#B51F45;--warning:#945000;
  --on-accent:#FFFFFF;--field:#FFFFFF;--code:#F1F3F9;--scrim:rgba(16,22,40,.40);--edge-shadow:rgba(16,22,40,.14);--on-scene:#101628;--on-scene-2:#4D5872;--scene-chip:rgba(255,255,255,.78);--scene-shadow:none;
  --habitat-opacity:0;--habitat-veil:linear-gradient(180deg,rgba(245,244,240,0) 0%,rgba(245,244,240,0) 40%,rgba(245,244,240,.88) 64%,#F5F4F0 78%);
  --shadow-card:0 12px 32px rgba(37,54,88,.10),inset 0 1px rgba(255,255,255,.9);
  --shadow-float:0 24px 70px rgba(37,54,88,.18),0 0 0 1px rgba(37,54,88,.10);
  --glow-active:0 0 18px rgba(8,127,145,.16);--glow-reward:0 0 20px rgba(155,97,0,.14);--glow-violet:0 0 18px rgba(101,85,222,.16);
}
@media (prefers-color-scheme:light){
  :root:not([data-theme]){
    color-scheme:light;
    --bg:#F5F4F0;--habitat:#E9EEF9;--surface:#FFFFFF;--surface-2:#F0F2F8;
    --glass:rgba(255,255,255,.80);--glass-raised:rgba(255,255,255,.92);--glass-soft:rgba(255,255,255,.66);--glass-strong:rgba(255,255,255,.94);--shadow-pill:0 4px 14px rgba(37,54,88,.14);
    --stroke:rgba(37,54,88,.16);--stroke-soft:rgba(37,54,88,.12);
    --text:#101628;--text-2:#4D5872;--text-3:#5F6982;
    --violet:#6555DE;--cyan:#087F91;--amber:#9B6100;--mint:#08765A;--rose:#B51F45;--warning:#945000;
    --on-accent:#FFFFFF;--field:#FFFFFF;--code:#F1F3F9;--scrim:rgba(16,22,40,.40);--edge-shadow:rgba(16,22,40,.14);--on-scene:#101628;--on-scene-2:#4D5872;--scene-chip:rgba(255,255,255,.78);--scene-shadow:none;
    --habitat-opacity:0;--habitat-veil:linear-gradient(180deg,rgba(245,244,240,0) 0%,rgba(245,244,240,0) 40%,rgba(245,244,240,.88) 64%,#F5F4F0 78%);
    --shadow-card:0 12px 32px rgba(37,54,88,.10),inset 0 1px rgba(255,255,255,.9);
    --shadow-float:0 24px 70px rgba(37,54,88,.18),0 0 0 1px rgba(37,54,88,.10);
    --glow-active:0 0 18px rgba(8,127,145,.16);--glow-reward:0 0 20px rgba(155,97,0,.14);--glow-violet:0 0 18px rgba(101,85,222,.16);
  }
}

/* Base */
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--text)}
/* The page itself never scrolls or bounces (#108): only a screen's own area does, so dragging the
   header or the tab bar in the Home Screen app leaves the whole app still. */
html,body{overscroll-behavior:none}
body{min-height:100dvh;overflow:hidden}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer;background:var(--violet);color:var(--on-accent);border:1px solid transparent;border-radius:var(--r-control);padding:12px 18px;font-weight:600;min-height:44px;letter-spacing:.01em;transition:transform var(--instant) var(--ease),filter var(--fast) var(--ease),background var(--fast) var(--ease),box-shadow var(--fast) var(--ease)}
button:hover{filter:brightness(1.08)}
button:active{transform:translateY(1px)}
button:disabled{opacity:.5;cursor:wait}
input,textarea,select{background:var(--field);border:1px solid var(--stroke);border-radius:var(--r-compact);padding:12px 14px;min-height:44px;font-size:16px}
input::placeholder,textarea::placeholder{color:var(--text-3)}
:focus-visible{outline:2px solid var(--cyan);outline-offset:3px}
/* Focus a redraw moved while the owner used touch or a mouse (#194): no frame. Keys still see it. */
.focus-quiet:focus-visible{outline:none}
[hidden]{display:none!important}
a{color:var(--cyan)}
h1,h2,h3,h4{font-weight:580;letter-spacing:-.01em}
.eyebrow{font-size:12px;color:var(--text-2);font-weight:560}
.fine{font-size:13px;line-height:1.55;color:var(--text-2)}
.quiet{background:transparent;border:1px solid var(--stroke);color:var(--text);padding:9px 14px;font-size:14px;font-weight:560}
.quiet:hover{background:var(--glass-soft);filter:none}
.danger{color:var(--rose)}
.failure{color:var(--rose)}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.icon-defs{position:absolute;width:0;height:0;overflow:hidden}
.icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.icon-button{width:44px;height:44px;min-width:44px;padding:11px;display:inline-grid;place-items:center;border-color:transparent;border-radius:14px}
.glass{background:var(--glass);border:1px solid var(--stroke);box-shadow:var(--shadow-card);-webkit-backdrop-filter:blur(var(--blur)) saturate(1.15);backdrop-filter:blur(var(--blur)) saturate(1.15)}
.wordmark{display:inline-flex;align-items:flex-start;font-size:30px;line-height:1;font-weight:620;letter-spacing:-.04em;color:var(--text)}
.wordmark-star{width:12px;height:12px;margin:-4px 0 0 1px;fill:var(--amber);stroke:none}
.avatar{height:56px;width:56px;border-radius:18px;display:grid;place-items:center;color:var(--text);border:1px solid var(--stroke);background:var(--glass-raised);font-size:22px;font-weight:600}
.avatar.small{width:32px;height:32px;border-radius:999px;font-size:14px}

/* Habitat: Ari's night garden sits behind every screen, brightest on Home. */
.habitat{position:fixed;inset:0;z-index:0;pointer-events:none;background:var(--habitat);opacity:1;--scene:url("assets/scenes/home-portrait.webp")}
.shell[data-screen=jobs] .habitat{--scene:url("assets/scenes/quests-portrait.webp")}
.shell[data-screen=memory] .habitat{--scene:url("assets/scenes/world-portrait.webp")}
.shell[data-screen=system] .habitat{--scene:url("assets/scenes/care-portrait.webp")}
@media (min-width:761px){
  .habitat{--scene:url("assets/scenes/home-landscape.webp")}
  .shell[data-screen=jobs] .habitat{--scene:url("assets/scenes/quests-landscape.webp")}
  .shell[data-screen=memory] .habitat{--scene:url("assets/scenes/world-landscape.webp")}
  .shell[data-screen=system] .habitat{--scene:url("assets/scenes/care-landscape.webp")}
}
.habitat::before,.habitat::after{content:"";position:absolute;inset:0}
.habitat::before{
  background:var(--scene) center 30%/cover no-repeat,
    radial-gradient(60% 40% at 70% 8%,rgba(122,98,255,.45),transparent 70%),
    radial-gradient(50% 35% at 18% 30%,rgba(76,196,230,.22),transparent 70%),
    radial-gradient(80% 50% at 50% 100%,rgba(62,40,140,.45),transparent 70%),
    linear-gradient(180deg,#0B1433 0%,#0A1026 55%,#070B16 100%);
  opacity:var(--habitat-opacity);transition:opacity var(--scene) var(--ease)}
.habitat::after{background:var(--habitat-veil);opacity:.0;transition:opacity var(--scene) var(--ease)}
.shell[data-screen=home] .habitat::before{opacity:1}
.shell[data-screen=home] .habitat::after{opacity:1}
:root[data-theme=light] .habitat{background:radial-gradient(55% 40% at 50% 28%,rgba(139,124,255,.20),transparent 70%),radial-gradient(40% 30% at 18% 16%,rgba(102,226,240,.16),transparent 70%),linear-gradient(180deg,var(--habitat) 0%,#EEF1F8 55%,var(--bg) 100%)}
:root[data-theme=light] .habitat::before,:root[data-theme=light] .habitat::after{opacity:0!important}
@media (prefers-color-scheme:light){:root:not([data-theme]) .habitat{background:radial-gradient(55% 40% at 50% 28%,rgba(139,124,255,.20),transparent 70%),radial-gradient(40% 30% at 18% 16%,rgba(102,226,240,.16),transparent 70%),linear-gradient(180deg,var(--habitat) 0%,#EEF1F8 55%,var(--bg) 100%)}:root:not([data-theme]) .habitat::before,:root:not([data-theme]) .habitat::after{opacity:0!important}}

/* Shell: left rail on a laptop, bottom tab bar on a phone. */
.shell{position:relative;display:grid;grid-template-columns:220px minmax(0,1fr);grid-template-rows:minmax(0,1fr);height:100dvh;min-height:480px;isolation:isolate}
.shell>*:not(.habitat){position:relative;z-index:1}
.shell.nav-collapsed{grid-template-columns:84px minmax(0,1fr)}
.sidebar{display:flex;flex-direction:column;gap:var(--s2);padding:28px 16px 20px;height:100dvh;background:var(--glass-soft);border-right:1px solid var(--stroke-soft);-webkit-backdrop-filter:blur(var(--blur));backdrop-filter:blur(var(--blur))}
.brand{display:flex;align-items:center;gap:12px;margin:0 10px 18px}
.brand .wordmark{font-size:34px}
.rail-owner{display:flex;align-items:center;gap:12px;margin:0 10px 18px;font-size:15px;color:var(--text-2)}
.sidebar nav{display:flex;flex-direction:column;gap:6px;flex:1}
.nav{position:relative;width:100%;display:flex;align-items:center;gap:14px;background:transparent;color:var(--text-2);font-size:15px;font-weight:500;text-align:left;margin:0;padding:12px 14px;min-height:52px;border-radius:var(--r-control);border:1px solid transparent}
.nav:hover{background:var(--glass-soft);color:var(--text);filter:none}
.nav.active{background:var(--glass-raised);color:var(--text);border-color:var(--stroke);box-shadow:var(--glow-violet)}
.nav.active .icon{color:var(--violet)}
.nav .icon{width:22px;height:22px}
.nav span.nav-label{font-size:15px;white-space:nowrap}
.nav-count{margin-left:auto;min-width:22px;height:22px;border-radius:999px;padding:0 7px;display:inline-grid;place-items:center;background:var(--violet);color:var(--on-accent);font-size:12px;font-weight:650}
.nav-count:is(:empty){display:none}
.settings-nav{margin-top:auto}
.sidebar-bottom{margin-top:0}
.logout-button{display:flex;gap:14px;align-items:center;width:100%;border-color:transparent;min-height:48px;color:var(--text-2);justify-content:flex-start;padding:12px 14px}
.nav-collapsed .brand{margin:0 auto 18px}
.nav-collapsed .brand .wordmark{font-size:26px}
.nav-collapsed .nav-label,.nav-collapsed .nav-count{display:none}
.nav-collapsed .nav,.nav-collapsed .logout-button{justify-content:center;padding:12px}
main{--main-pad:32px;display:flex;flex-direction:column;min-width:0;min-height:0;height:100dvh;padding:16px var(--main-pad) 0}
header{display:flex;justify-content:space-between;gap:12px;align-items:center;min-height:64px;padding:0 0 8px;flex-shrink:0}
.header-title{display:flex;gap:12px;align-items:center;min-width:0}
.header-title h2{font-size:22px;line-height:28px;margin:0;font-weight:580;letter-spacing:-.02em;white-space:nowrap}
.header-actions{display:flex;gap:8px;align-items:center}
.header-actions .quiet{font-size:14px}
.back-button,.header-wordmark,.care-button{display:none}
.back-button{gap:6px;align-items:center;border-color:transparent;padding:8px 10px 8px 4px;font-size:16px}
.shell[data-screen=home] .header-wordmark,.shell[data-screen=home] .care-button{color:var(--on-scene)}
.shell[data-screen=home] #heading{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
/* Scrolling (#108): one scroll area per screen. A tab is the whole area between the header and the
   tab bar, edge to edge, so a swipe or a wheel anywhere in it scrolls, gutters included; padding keeps
   its content at the reading width (--tab-width) and ends it clear of the tab bar. */
.tab{--tab-width:9999px;position:relative;flex:1;min-height:0;overflow:auto;scrollbar-gutter:stable;overscroll-behavior:contain;
  margin-inline:calc(-1 * var(--main-pad));padding:0 max(var(--main-pad),calc((100% + 2 * var(--main-pad) - var(--tab-width)) / 2)) var(--tab-end,20px);scroll-padding-block:16px}
/* Scrollbars (#108): none on a touch screen. With a mouse or trackpad, a thin thumb that stays
   invisible until its area is hovered or scrolling (app.js marks .is-scrolling), then fades again.
   Wheel, trackpad and arrow keys scroll exactly as before; a focused area keeps its ring inside. */
:root,:root[data-theme=dark]{--thumb:rgba(158,183,255,.46);--thumb-soft:rgba(158,183,255,.22)}
:root[data-theme=light]{--thumb:rgba(37,54,88,.40);--thumb-soft:rgba(37,54,88,.18)}
@media (prefers-color-scheme:light){:root:not([data-theme]){--thumb:rgba(37,54,88,.40);--thumb-soft:rgba(37,54,88,.18)}}
*{scrollbar-width:thin;scrollbar-color:transparent transparent}
*:hover{scrollbar-color:var(--thumb-soft) transparent}
.is-scrolling{scrollbar-color:var(--thumb) transparent}
@media (hover:none){
  *{scrollbar-width:none}
  *::-webkit-scrollbar{display:none}
}
:is(.tab,.conversation,.talk-rail,dialog,.world-entity,.markdown-code,.markdown-table):focus-visible{outline-offset:-2px}
/* While a sheet or dialog is open, the screen behind it holds still (#108). */
body:has(dialog[open]) :is(.tab,.conversation,.talk-rail,.world-entity){overflow:hidden}
.shell[data-screen=home] #notice.echoed{display:none}
#notice{margin:0 0 12px;padding:12px 16px;background:var(--glass-raised);border:1px solid rgba(246,174,94,.45);color:var(--text);font-size:14px;border-radius:var(--r-control);line-height:1.5;flex-shrink:0;-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}

/* State chip: coloured light + words; colour is never the only signal. */
.state-chip{display:inline-flex;align-items:center;gap:10px;margin:0;padding:8px 16px;min-height:40px;border-radius:var(--r-chip);border:1px solid var(--stroke);background:var(--glass-soft);color:var(--text);font-size:15px;font-weight:500;-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}
.state-light{width:10px;height:10px;border-radius:50%;background:var(--mint);box-shadow:0 0 12px currentColor;color:var(--mint);flex-shrink:0}
.state-chip[data-state=thinking] .state-light{background:var(--violet);color:var(--violet)}
.state-chip[data-state=working] .state-light{background:var(--cyan);color:var(--cyan)}
.state-chip[data-state=needs] .state-light,.state-chip[data-state=happy] .state-light{background:var(--amber);color:var(--amber)}
.state-chip[data-state=resting] .state-light,.state-chip[data-state=sleeping] .state-light{background:var(--violet);color:var(--violet)}
.state-chip[data-state=away] .state-light{background:var(--text-3);color:var(--text-3)}
.state-chip[data-state=thoughtful] .state-light{background:var(--cyan);color:var(--cyan)}
.state-detail{margin:0;max-width:520px;text-align:center;font-size:14px;line-height:1.5;color:var(--on-scene-2)}

/* The creature: one production pose per state (static WebP), CSS adds breath and one-shot moments. */
.creature{position:relative;margin:0;display:block}
.creature::before{content:"";position:absolute;left:18%;right:18%;bottom:2%;height:9%;border-radius:50%;background:radial-gradient(closest-side,rgba(139,124,255,.45),transparent);filter:blur(6px);transition:background var(--base) var(--ease)}
.creature-img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;object-position:50% 100%;transform-origin:50% 96%;user-select:none;-webkit-user-drag:none}
.creature[data-state=idle] .creature-img{animation:ari-breath var(--ambient-breath) ease-in-out infinite}
.creature[data-state=thinking] .creature-img{animation:ari-breath 3200ms ease-in-out infinite}
.creature[data-state=thinking]::after{content:"";position:absolute;top:10%;left:50%;width:10px;height:10px;margin-left:-5px;border-radius:50%;background:#EDE8FF;box-shadow:0 0 14px 4px rgba(139,124,255,.75);animation:ari-orbit 1600ms linear infinite}
.creature[data-state=working]::before{background:radial-gradient(closest-side,rgba(102,226,240,.55),transparent);animation:ari-route 2400ms ease-in-out infinite}
.creature[data-state=working] .creature-img{animation:ari-focus 2400ms ease-in-out infinite}
.creature[data-state=needs]::before,.creature[data-state=happy]::before{background:radial-gradient(closest-side,rgba(255,198,109,.45),transparent)}
.creature[data-state=sleeping] .creature-img{animation:ari-breath var(--dream-breath) ease-in-out infinite;opacity:.94}
/* #82: rest is a calm pose, never a faded or sick one; can't-reach-home dims the ready pose under a cloud. */
.creature[data-state=resting] .creature-img{animation:ari-breath var(--dream-breath) ease-in-out infinite}
.creature[data-state=resting]::before{background:radial-gradient(closest-side,rgba(139,124,255,.38),transparent)}
.creature[data-state=away] .creature-img{opacity:.62}
.creature[data-state=away]::before{background:radial-gradient(closest-side,rgba(150,160,190,.30),transparent)}
.creature[data-state=thoughtful]::before{background:radial-gradient(closest-side,rgba(102,226,240,.35),transparent)}
.creature[data-state=happy] .creature-img{animation:ari-proud var(--celebrate) var(--ease-settle) 1 both}
@keyframes ari-breath{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-3px) scale(1.012)}}
@keyframes ari-focus{0%,100%{transform:translateX(0)}50%{transform:translateX(4px)}}
@keyframes ari-route{0%,100%{opacity:.65}50%{opacity:1}}
@keyframes ari-orbit{from{transform:rotate(0) translateX(26px) rotate(0)}to{transform:rotate(1turn) translateX(26px) rotate(-1turn)}}
@keyframes ari-proud{0%{transform:translateY(0)}45%{transform:translateY(-14px) scale(1.02)}100%{transform:translateY(0) scale(1)}}

/* Home */
#tab-home{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:28px;overflow:hidden}
.home-main{display:grid;grid-template-rows:minmax(0,1fr) auto auto;gap:16px;min-width:0;min-height:0;justify-items:center}
.home-stage{position:relative;width:100%;min-height:0;display:flex;flex-direction:column;align-items:flex-start;gap:14px;padding:4px 8px 0}
.home-stage>:not(.creature){position:relative;z-index:2}
.home-greeting{margin:0;font-size:44px;line-height:48px;font-weight:590;letter-spacing:-.035em;color:var(--on-scene);text-shadow:var(--scene-shadow)}
.home-stage .state-chip{color:var(--on-scene);background:var(--scene-chip);border-color:var(--stroke)}
.home-stage .state-detail{text-align:left}
/* #280: the hero is scenery. It fills its own stage and never reaches the cards below it, takes no
   taps (nothing on it is a control), and the cards stack above it whatever the width. */
.creature-hero{position:absolute;left:0;right:0;top:36px;bottom:0;width:100%;height:auto;z-index:1;pointer-events:none}
.home-actions{position:relative;z-index:2;width:100%;max-width:1060px;display:flex;flex-direction:column;gap:var(--s4)}
@media (min-width:1181px){.home-actions>.quest-card,.home-actions>.quest-empty{display:none}}
.quest-card{display:flex;align-items:center;gap:18px;width:100%;padding:16px 18px;border-radius:var(--r-card);color:var(--text);text-align:left;font-weight:400}
.quest-card:hover{filter:none;border-color:var(--cyan)}
.quest-thumb{width:72px;height:72px;border-radius:18px;display:grid;place-items:center;flex-shrink:0;color:var(--cyan);background:radial-gradient(circle at 35% 30%,rgba(102,226,240,.30),rgba(139,124,255,.20) 60%,rgba(11,18,36,.8));border:1px solid var(--stroke)}
.quest-thumb .icon{width:30px;height:30px}
.quest-body{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}
.quest-title{font-size:20px;line-height:26px;font-weight:580;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quest-meta{font-size:15px;color:var(--text-2)}
.quest-stones{display:flex;gap:6px;margin-top:4px}
.stone{height:6px;flex:1;max-width:72px;border-radius:999px;background:var(--stroke)}
.stone.done{background:var(--cyan)}
.stone.current{background:var(--cyan);box-shadow:var(--glow-active)}
.chevron{color:var(--text-2)}
.quest-empty{margin:0;padding:18px 20px;border-radius:var(--r-card);color:var(--text-2);font-size:15px}
.home-ask{display:flex;align-items:center;gap:12px;padding:12px 12px 12px 22px;border-radius:var(--r-card);background:var(--glass);border:1px solid var(--stroke);box-shadow:var(--shadow-card);-webkit-backdrop-filter:blur(var(--blur)) saturate(1.15);backdrop-filter:blur(var(--blur)) saturate(1.15)}
.ask-spark{width:24px;height:24px;color:var(--text);fill:currentColor;stroke:none;opacity:.9}
.home-ask input{flex:1;min-width:0;border:0;background:transparent;font-size:19px;padding:10px 6px}
.home-ask input:focus-visible{outline:none}
.home-ask:focus-within{border-color:var(--violet)}
.talk-button,.quest-button{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:var(--primary-control);padding:0 28px;border-radius:var(--r-chip);font-size:18px;font-weight:560;white-space:nowrap}
.talk-button{background:var(--glass-raised);color:var(--text);border:1.5px solid rgba(102,160,255,.55);box-shadow:0 0 22px rgba(102,160,255,.18)}
.quest-button{background:rgba(255,198,109,.10);color:var(--amber);border:1.5px solid var(--amber);box-shadow:var(--glow-reward)}
.talk-button .icon,.quest-button .icon{width:22px;height:22px}
.home-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:var(--s4)}
.info-card{display:flex;align-items:center;gap:14px;padding:16px;border-radius:var(--r-card);color:var(--text);text-align:left;font-weight:400;min-height:96px}
.info-card:hover{filter:none;border-color:var(--violet)}
.info-icon{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;flex-shrink:0;background:var(--glass-raised);border:1px solid var(--stroke);color:var(--text)}
.info-body{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
.info-label{font-size:13px;font-weight:560;color:var(--text-2);letter-spacing:.01em}
.info-text{font-size:15px;line-height:21px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}
.home-footer{margin:4px 0 0;font-size:13px;color:var(--text-2);text-align:center}
.home-trail{display:flex;flex-direction:column;gap:12px;min-width:0}
.home-trail h2{color:var(--on-scene);text-shadow:var(--scene-shadow);margin:4px 0 8px;font-size:26px;line-height:32px;font-weight:580;letter-spacing:-.02em}
.trail-list{display:flex;flex-direction:column;gap:12px}
.trail-row{display:flex;align-items:center;gap:14px;width:100%;padding:16px;border-radius:var(--r-card);color:var(--text);text-align:left;font-weight:400;min-height:88px}
.trail-row:hover{filter:none;border-color:var(--cyan)}
.trail-body{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
.trail-title{font-size:16px;font-weight:560;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.trail-state{font-size:14px}
.trail-light{width:10px;height:10px;border-radius:50%;flex-shrink:0;background:currentColor}
.tone-working{color:var(--cyan)}.tone-attention{color:var(--amber)}.tone-done{color:var(--mint)}.tone-failed{color:var(--rose)}.tone-planned{color:var(--text-2)}
.trail-empty{margin:0;padding:16px;border:1px dashed var(--stroke);border-radius:var(--r-card);color:var(--text-2);font-size:14px}
.trail-all{align-self:flex-start;background:var(--glass-soft);border-radius:var(--r-chip);-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}

/* Talk (0.8.4, ADR 027): message-first. A slim header with a small live Ari, the transcript takes
   most of the height, a compact composer; on a laptop a narrow rail holds Ari and the trail. */
:root,:root[data-theme=dark]{--bubble-ari:rgba(21,31,56,.86);--bubble-user:rgba(44,56,96,.86);--bubble-stroke:rgba(158,183,255,.24);--talk-bar:rgba(9,14,28,.78)}
:root[data-theme=light]{--bubble-ari:#FFFFFF;--bubble-user:#E6EBF8;--bubble-stroke:rgba(37,54,88,.14);--talk-bar:rgba(255,255,255,.86)}
@media (prefers-color-scheme:light){:root:not([data-theme]){--bubble-ari:#FFFFFF;--bubble-user:#E6EBF8;--bubble-stroke:rgba(37,54,88,.14);--talk-bar:rgba(255,255,255,.86)}}
/* The habitat recedes to a glow at the top while talking. */
.shell[data-screen=chat] .habitat::before{opacity:.5}
.shell[data-screen=chat] .habitat::after{opacity:1;background:linear-gradient(180deg,rgba(7,11,22,.30) 0%,rgba(7,11,22,.86) 14%,var(--bg) 26%)}
.shell[data-screen=chat]>main>header{display:none}
.shell[data-screen=chat]>main{--main-pad:0px;padding:0}
.shell[data-screen=chat] #notice{margin:12px 20px 0}
/* Out of reach, Talk's header says it in the same words (#507): one status, not a second line above it. The
   banner stays for a screen reader (it is the live status; Talk's header line is not), drawn nowhere, as .sr-only. */
.shell[data-screen=chat] #notice[data-banner=connection]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.talk-with{display:none}
@media (min-width:761px){.talk-with{display:inline}}
#tab-chat{display:grid;grid-template-columns:minmax(0,1fr);overflow:hidden;min-height:0;scrollbar-gutter:auto;margin:0;padding:0}
.talk-main{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;height:100%}
.talk-header{position:relative;z-index:3;display:flex;align-items:center;gap:8px;min-height:64px;padding:8px 20px;flex-shrink:0;border-bottom:1px solid var(--stroke-soft);background:var(--talk-bar);-webkit-backdrop-filter:blur(var(--blur)) saturate(1.15);backdrop-filter:blur(var(--blur)) saturate(1.15)}
.talk-back{display:none;min-height:48px;min-width:48px;margin-left:-10px;gap:4px;padding:8px 8px 8px 4px;font-size:17px;font-weight:500}
.creature-mini{width:44px;height:44px;flex-shrink:0;border-radius:50%;overflow:hidden;border:1px solid var(--stroke);background:radial-gradient(circle at 50% 35%,rgba(139,124,255,.35),rgba(11,18,36,.9))}
.creature-mini::before,.creature-mini::after{display:none}
.creature-mini .creature-img{object-fit:cover;object-position:50% 16%;transform:scale(1.5);transform-origin:50% 20%;animation:none!important}
.talk-heading{display:flex;flex-direction:column;min-width:0;flex:1}
/* Keep screen on in Talk (#708): his choice, this device only; pressed while it holds the screen on. */
.talk-screen{flex-shrink:0}
.talk-screen[aria-pressed=true]{color:var(--violet);filter:drop-shadow(0 0 6px rgba(139,124,255,.6))}
.talk-title{margin:0;font-size:18px;line-height:22px;font-weight:580;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.talk-status{display:flex;align-items:center;gap:6px;margin:2px 0 0;font-size:13px;line-height:17px;font-weight:500;color:var(--text-2);min-width:0}
.talk-status span:last-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.talk-status .state-light{width:8px;height:8px;box-shadow:0 0 8px currentColor}
.talk-status[data-state=thinking] .state-light{background:var(--violet);color:var(--violet);animation:ari-pulse 1.4s ease-in-out infinite}
.talk-status[data-state=working] .state-light{background:var(--cyan);color:var(--cyan)}
.talk-status[data-state=needs] .state-light,.talk-status[data-state=happy] .state-light{background:var(--amber);color:var(--amber)}
.talk-status[data-state=resting] .state-light,.talk-status[data-state=sleeping] .state-light{background:var(--violet);color:var(--violet)}
.talk-status[data-state=away] .state-light{background:var(--text-3);color:var(--text-3)}
.talk-status[data-state=thoughtful] .state-light{background:var(--cyan);color:var(--cyan)}
@keyframes ari-pulse{0%,100%{opacity:1}50%{opacity:.35}}
/* The transcript */
.conversation{flex:1;min-height:0;overflow:auto;overflow-anchor:none;overscroll-behavior:contain;padding:16px 20px 12px;scrollbar-gutter:stable;scroll-padding-bottom:12px}
.empty{max-width:480px;margin:10vh auto;text-align:center;color:var(--text-2);line-height:1.6}
.empty h3{color:var(--text);font-size:30px;line-height:34px;letter-spacing:-.03em;margin:0 0 8px}
.message{position:relative;display:flex;flex-direction:column;align-items:flex-start;width:100%;margin:0 0 16px;font-size:var(--text-body);line-height:var(--leading-body);overflow-wrap:anywhere}
.message>*{max-width:min(540px,100%)}
.message-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.message>.markdown{padding:10px 16px;border-radius:18px;border:1px solid var(--bubble-stroke);background:var(--bubble-ari);line-height:inherit}
.message.user{align-items:flex-end}
.message.user>*{max-width:min(540px,82%)}
.message.user>.markdown{background:var(--bubble-user);border-radius:18px 18px 6px 18px}
/* Ari's replies read as plain text across the chat column, like the Claude app (#215): no bubble, no
   face beside it, the composer's gutters, reading lines. The owner's words stay bubbles on the right.
   Air, not a box, sets replies apart: --gap-reply above and below each one is about twice a
   paragraph's, so two replies never read as one, and a reply's start is plain after his bubble.
   A reply that is still being written looks the same, with the writing dots under it. */
.message.assistant{margin-top:var(--gap-reply);margin-bottom:var(--gap-reply);line-height:var(--leading-reading)}
.conversation>.message.assistant:first-child{margin-top:0}
.message.assistant>*{max-width:100%}
.message.assistant>.markdown{align-self:stretch;padding:0;border:0;border-radius:0;background:none}
/* Prose keeps a reading measure on a wide column; tables, code and pictures keep the column. */
.message.assistant .markdown>:is(p,ul,ol,blockquote,h1,h2,h3,h4){max-width:70ch}
.message.system{color:var(--text-2);font-size:14px}
.message.system>.markdown{background:transparent;border:0;border-left:2px solid var(--stroke);border-radius:0;padding:2px 0 2px 12px}
.message.note>.markdown{display:flex;gap:10px;align-items:flex-start;background:var(--bubble-ari);border:1px solid var(--stroke);border-radius:14px;padding:10px 14px;color:var(--text)}
.message.note>.markdown::before{content:"";flex-shrink:0;width:18px;height:18px;margin-top:2px;border-radius:50%;border:2px solid var(--text-2)}
.message.note-failed>.markdown{border-color:rgba(255,120,146,.55)}
.message.note-failed>.markdown::before{border-color:var(--rose);background:radial-gradient(circle,var(--rose) 0 2px,transparent 2.5px)}
.message-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.message-actions button{min-height:40px;padding:8px 16px;font-size:14px}
.message.assistant>.why{margin-top:2px;max-width:min(640px,100%)}
.message.assistant>.why>summary{min-height:44px;display:flex;align-items:center;gap:8px;padding:8px 4px;font-size:13px;color:var(--text-2);list-style:none}
.message.assistant>.why>summary::-webkit-details-marker{display:none}
.message.assistant>.why>summary::after{content:"";width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:translateY(-2px) rotate(45deg);transition:transform var(--fast) var(--ease)}
.message.assistant>.why[open]>summary::after{transform:translateY(1px) rotate(-135deg)}
.why-list{list-style:none;margin:2px 0 8px;padding:0;display:grid;gap:8px}
.why-item{padding:10px 12px;border:1px solid var(--stroke-soft);border-radius:12px;background:var(--glass-soft)}
.why-title{margin:0;font-size:14px;line-height:1.45;color:var(--text);overflow-wrap:anywhere}
.why-reason{margin:2px 0 0;font-size:13px;line-height:1.45;color:var(--text-2)}
.why-empty{margin:4px 4px 8px}
.message.assistant>.sources{width:100%}
.sources>summary .icon{width:16px;height:16px}
.sources-set{display:grid;gap:4px}
.sources-body>p,.sources .why-failed>p{margin:8px 4px 0}
.sources .why-failed{display:grid;justify-items:start;gap:6px}
.sources-group{margin:8px 4px 0;font-size:13px;line-height:1.4;color:var(--text-2)}
.sources .why-list{margin:0 0 4px}
.sources-list{gap:6px}
.sources-item{padding:0}
.sources .diagnostics{margin:6px 0 0}
.sources .diagnostics[open]{padding-left:10px;border-left:2px solid var(--stroke-soft)}
.sources .diagnostics>summary{min-height:44px;display:flex;align-items:center;gap:8px;padding:8px 4px;font-size:13px;color:var(--text-2);list-style:none}
.sources .diagnostics>summary::-webkit-details-marker{display:none}
.sources .diagnostics>summary::after{content:"";width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:translateY(-2px) rotate(45deg);transition:transform var(--fast) var(--ease)}
.sources .diagnostics[open]>summary::after{transform:translateY(1px) rotate(-135deg)}
.source-link{display:flex;align-items:center;gap:10px;min-height:44px;padding:10px 12px;color:var(--text);text-decoration:none;border-radius:12px;overflow-wrap:break-word}
.source-link:hover{background:var(--glass-raised)}
.source-link:focus-visible{background:var(--glass-raised);outline:2px solid var(--cyan);outline-offset:-2px}
.source-mark{flex:none;font-size:13px}
.source-words{display:grid;gap:2px;flex:1;min-width:0}
.source-link>.icon{width:16px;height:16px;color:var(--text-2)}
.source-title{font-size:14px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.source-host{font-size:12px;line-height:1.4;color:var(--text-2)}
/* Text at 200% on a phone leaves a column this narrow: the chip steps aside and a title may take more lines. */
@media (max-width:260px){.source-mark{display:none}.source-title{-webkit-line-clamp:4}}
.message.note>.diagnostics{margin-top:4px}
.message.note>.diagnostics>summary{min-height:32px;padding:6px 0;font-size:13px}
.retry-button{border-radius:var(--r-chip)}
.message-time{display:block;margin-top:4px;font-size:12px;line-height:16px;color:var(--text-3);font-variant-numeric:tabular-nums;padding:0 4px}
/* Dates and times as chat apps show them (#181, talktime.js, ADR 066): a day pill heads each day (and the
   day being read stays pinned at the top), a message's time is small, only on the last message of a
   group: in the corner of the owner's bubble, under Ari's reply (#215). One visible form: the exact
   time is its title and accessible name, never a second state on screen. Phone and laptop alike. */
.has-day{position:relative;padding-top:40px}
.day-sep{position:absolute;top:4px;left:0;right:0;margin:0;display:flex;justify-content:center;max-width:none!important;pointer-events:none}
.day-pill{padding:3px 12px;border-radius:var(--r-chip);border:1px solid var(--stroke-soft);background:var(--glass-raised);box-shadow:var(--shadow-card);font-size:12px;line-height:16px;font-weight:600;color:var(--text-2);white-space:nowrap}
.day-float{position:absolute;left:0;right:0;z-index:3;margin:0;display:flex;justify-content:center;pointer-events:none}
.day-float[hidden]{display:none}
/* The pinned day stands in a band the words fade out of (#571): it never covers a message's text. */
.conversation.day-pinned{-webkit-mask-image:linear-gradient(to bottom,transparent 30px,#000 38px);mask-image:linear-gradient(to bottom,transparent 30px,#000 38px)}
/* The pinned day is a solid pill with a blur and a soft shadow, in both themes. */
.day-float .day-pill{background:var(--glass-strong);-webkit-backdrop-filter:blur(12px) saturate(1.2);backdrop-filter:blur(12px) saturate(1.2);box-shadow:var(--shadow-pill)}
.message-time.in-bubble{float:right;display:inline-flex;align-items:center;margin:6px -6px -5px 12px;padding:0;font-size:11px;line-height:14px;color:var(--text-2)}
.message-time.time-grouped,.inline-row .message-time{display:none}
/* A message that ends with a picture: its time sits on the picture, white on a small dark backing
   (5.4:1 even over a white picture, measured in #218). */
.picture-frame{position:relative;display:block;width:fit-content;max-width:100%;line-height:0}
.message-time.on-picture{position:absolute;right:6px;bottom:6px;display:inline-flex;align-items:center;margin:0;padding:2px 7px;border-radius:var(--r-chip);background:rgba(8,12,24,.6);color:#fff;font-size:11px;line-height:14px}
/* One row under Ari's reply (#215): the speaker and the time, like the Claude app's action row. The
   speaker keeps its 44 px tap box but pulls in, so its 16 px icon lines up with the words' left edge,
   the time follows 8 px after it and the row is 20 px tall; .message-time's size on the laptop, the
   phone's micro text in compact.css. The whole 44 px ring stays the speaker's (#218): it lies over the
   reply's last line and its time, and whatever is shown after the row (link cards, sources, What I did,
   What I recalled) starts below the ring's 12 px under the row, so two tap boxes never share a point.
   "What I did" draws its 44 px box 8 px above its line (live.css), so first under the row it starts 8 px
   lower; a link's card that is not there (hidden) adds no air. */
.reply-meta{display:flex;align-items:center;align-self:flex-start;margin-top:6px}
.reply-meta:has(~ :not([hidden])){margin-bottom:12px}
.message.assistant>.reply-meta+.live-done,.message.assistant>.reply-meta+.link-cards[hidden]+.live-done{margin-top:8px}
.reply-meta>.speak-button{position:relative;z-index:1;margin:-12px -6px -12px -14px}
.reply-meta>.message-time{margin:0;padding:0;color:var(--text-2)}
.message.note>.message-time{display:none}
.sent-mark{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
/* Phone-only pieces (#178): shown by compact.css. */
.filter-icon,.retry-button .icon,.report-button .icon{display:none}
.message.user .message-time::after{content:"";display:inline-block;width:10px;height:5px;margin-left:4px;border:solid currentColor;border-width:0 0 1.5px 1.5px;transform:translateY(-2px) rotate(-45deg)}
.writing{display:flex;align-items:center;gap:8px;margin:6px 0 0;font-size:12px;color:var(--text-3)}
.writing-dots{width:28px;height:8px;background:radial-gradient(circle at 4px 4px,var(--violet) 3px,transparent 3.5px) 0 0/10px 8px repeat-x;animation:ari-pulse 1.2s ease-in-out infinite}
.writing-text{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
/* Code: its own scroll, a header with the language and Copy, bounded height until Show all. */
.code-block{margin:12px 0;border:1px solid var(--stroke-soft);border-radius:14px;background:var(--code);overflow:hidden;max-width:100%}
.code-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 6px 4px 14px;border-bottom:1px solid var(--stroke-soft);font-size:12px;color:var(--text-2)}
.code-lang{font-family:var(--mono);text-transform:lowercase}
.code-copy,.code-more{min-height:32px;padding:4px 12px;font-size:13px;border-color:transparent}
/* Code never becomes a second vertical scroll inside the transcript (#108): it scrolls sideways only,
   a folded block is cut off with a fade, and Show all shows every line. */
.code-block .markdown-code{margin:0;border:0;border-radius:0;max-height:none;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;padding:12px 14px;font-size:13px;line-height:19px}
.code-block.folded .markdown-code{max-height:320px;-webkit-mask-image:linear-gradient(180deg,#000 calc(100% - 56px),transparent);mask-image:linear-gradient(180deg,#000 calc(100% - 56px),transparent)}
.code-more{display:block;width:100%;border-top:1px solid var(--stroke-soft);border-radius:0}
/* Images: a bounded thumbnail that opens the viewer. */
.attachments{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.attachment{overflow:hidden;border:1px solid var(--bubble-stroke);border-radius:14px;background:var(--bubble-ari);max-width:360px}
.attachment img{display:block;width:auto;max-width:100%;height:auto;max-height:240px;object-fit:contain;background:var(--code);cursor:zoom-in}
/* A video (#757): its first frame with ▶ Play over it, then the clip itself in the same place. */
.attachment-video{position:relative}
.attachment-video img{cursor:pointer}
.attachment video{display:block;width:100%;max-height:360px;background:#000}
.attachment-play{position:absolute;left:8px;top:8px;min-height:36px;padding:0 12px;border-radius:18px;background:rgba(0,0,0,.66);color:#fff;border:0;font-weight:600}
.attachment-detail{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 12px;align-items:center;padding:8px 8px 8px 12px}
.attachment-detail strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.attachment-detail .fine{grid-column:1;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attachment-actions{grid-column:2;grid-row:1/3}
.attachment-actions button{min-height:44px;padding:6px 12px;font-size:13px}
.attachment-error{margin:0;padding:0 12px 10px;font-size:13px}
/* Icon-first file cards (#139, ADR 059): a type badge leads a card that is not a picture. */
.attachment-file{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;width:100%;max-width:min(100%,520px)}
.attachment-file .attachment-detail{padding-left:0}
.attachment-file .attachment-error{grid-column:1/-1}
.file-badge{display:grid;place-items:center;width:44px;height:52px;margin:8px 12px;border-radius:10px 16px 10px 10px;background:linear-gradient(160deg,var(--glass-raised),var(--glass-soft));border:1px solid var(--stroke);color:var(--cyan);font:600 12px/1 var(--mono);letter-spacing:.04em;position:relative}
/* The kind of file in the badge's colour (#113): a spreadsheet, slides, an archive; a document and a PDF keep the default (rose means danger here). */
.file-badge[data-family=spreadsheet]{color:var(--mint)}
.file-badge[data-family=slides]{color:var(--amber)}
.file-badge[data-family=archive]{color:var(--violet)}
.file-badge::after{content:"";position:absolute;top:-1px;right:-1px;width:14px;height:14px;border-radius:0 16px 0 6px;background:var(--stroke-soft)}
.download-action::before{content:"";display:inline-block;width:14px;height:14px;margin-right:6px;vertical-align:-2px;background:currentColor;-webkit-mask:url("assets/icon/download.svg") center/contain no-repeat;mask:url("assets/icon/download.svg") center/contain no-repeat}
.read-action::before{content:"";display:inline-block;width:14px;height:14px;margin-right:6px;vertical-align:-2px;background:currentColor;-webkit-mask:url("assets/icon/read.svg") center/contain no-repeat;mask:url("assets/icon/read.svg") center/contain no-repeat}
.read-action[data-kind=page]::before{content:"";display:inline-block;width:14px;height:14px;margin-right:6px;vertical-align:-2px;background:currentColor;-webkit-mask:url("assets/icon/window.svg") center/contain no-repeat;mask:url("assets/icon/window.svg") center/contain no-repeat}
/* Read in Talk (#113, ADR 099): the reader sheet for words and PDFs. */
.reader{--sheet-pad:24px;max-width:min(96vw,900px)}
/* The header stays; the body scrolls (a long PDF on a phone must never lose its way out). */
dialog.reader.quest-sheet{padding:0;overflow:hidden;overflow:clip}
dialog.reader[open]{display:flex;flex-direction:column}
/* A PDF keeps one height in both views, so the sheet does not jump when Text and Pages are switched. */
dialog.reader:is(.is-pdf,.is-page,.is-table)[open]{height:min(92dvh,900px)}
dialog.reader .dialog-header{flex:none;align-items:center;gap:8px;margin:0;min-height:0;padding:var(--sheet-pad) var(--sheet-pad) 10px;border-bottom:1px solid var(--stroke-soft)}
.reader.is-page .reader-body{padding:0 8px 8px;overflow:hidden}
.reader.is-page #reader-content,.reader-pagebox{height:100%}
.reader-pagebox{position:relative;border-radius:14px;overflow:hidden;background:var(--glass-soft)}
.reader-pagestatus{position:absolute;inset:0;padding:16px;pointer-events:none}
.reader-pagestatus .why-failed{pointer-events:auto}
.reader-frame{display:block;width:100%;height:100%;border:0;background:#fff;border-radius:14px}
dialog.reader.is-page.full[open]{height:100dvh;max-height:100dvh;width:100vw;max-width:100vw;margin:0;border-radius:0}
.reader.is-page::after{display:none}
.reader-body{flex:1 1 auto;min-height:0;margin:0;padding:16px var(--sheet-pad) var(--sheet-pad);overflow:auto;overscroll-behavior:contain}
.reader-head{min-width:0;flex:1 1 auto}
dialog.reader .reader-head h3{margin:0;padding:0;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}
.reader-head p{margin:2px 0 0}
.reader-head p:empty{display:none}
.reader-actions{display:flex;flex:none;align-items:center;gap:8px;grid-column:auto;grid-row:auto}
.reader-mode .icon{width:16px;height:16px}
.reader-text{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.6 var(--mono);color:var(--text)}
.reader-csv{white-space:pre;overflow-x:auto}
.reader-markdown{max-width:none}
.reader-large{display:grid;gap:12px}
.reader-pdf{display:grid;gap:12px;justify-items:center}
.reader-page{width:100%;max-width:820px;background:var(--glass-soft);border-radius:8px;overflow:hidden}
.reader-page[data-state=drawn]{background:none;overflow:visible}
.reader-page canvas{display:block;width:100%;height:auto;border-radius:6px;background:#fff;box-shadow:0 0 0 1px var(--stroke-soft)}

/* Office previews in the reader (#113 phase 4, ADR 100): sheets, a document, slides, a list of files. */
.office-tabs{display:flex;gap:8px;overflow-x:auto;padding-bottom:10px;margin-bottom:10px;border-bottom:1px solid var(--stroke-soft);scrollbar-width:none;}
.office-tabs.more{-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 28px),transparent)}
.office-tabs.more>:last-child{margin-right:28px}
.office-tab{flex:none;min-height:44px;padding:6px 14px;border-radius:999px;white-space:nowrap;font-size:14px;color:var(--text-2);border:1px solid var(--stroke-soft)}
.office-tab.current{color:var(--text);background:var(--glass-raised);border-color:var(--violet)}
.office-panels:focus-visible{outline:2px solid var(--violet);outline-offset:4px;border-radius:12px}
.office-grid{overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;border:1px solid var(--stroke-soft);border-radius:12px}
.office-table{border-collapse:collapse;font-size:13px;line-height:1.4;min-width:100%}
.office-table th,.office-table td{border:1px solid var(--stroke-soft);padding:6px 10px;text-align:left;vertical-align:top;white-space:pre-wrap;min-width:6.5em;max-width:320px;overflow-wrap:break-word}
.office-letters th,.office-row,.office-corner{background:var(--glass-soft);color:var(--text-2);font-weight:500;text-align:center;font-size:12px}
.office-table .office-row,.office-table .office-corner{min-width:0;width:1%;padding:6px 8px}
.office-table .office-row{position:sticky;left:0;background:var(--glass-strong)}
@media(max-width:600px){.office-letters{display:none}.office-table{font-size:12.5px}.office-table th,.office-table td{padding:5px 8px;min-width:4.5em}.office-slide{padding:12px}.office-panels{min-height:38dvh}}
.office-table td.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.office-table td.tight{white-space:nowrap}
.office-table td.formula{font-style:italic}
.office-table td.bad{color:var(--rose)}
.office-grid.scrolls{background:linear-gradient(to right,var(--glass-strong) 30%,transparent) left/28px 100% no-repeat local,linear-gradient(to left,var(--glass-strong) 30%,transparent) right/28px 100% no-repeat local,linear-gradient(to right,rgba(0,0,0,.55),transparent) left/16px 100% no-repeat scroll,linear-gradient(to left,rgba(0,0,0,.55),transparent) right/16px 100% no-repeat scroll}
.office-swipe{margin:0 4px 6px;text-align:right}
.office-swipe[hidden]{display:none}
.office-more{margin:8px 4px}
.office-chart{margin:16px 0;padding:12px 14px;border:1px solid var(--stroke-soft);border-radius:12px;background:var(--glass-soft)}
.office-chart-title{margin-bottom:8px;font-weight:600}
.office-bars{list-style:none;margin:0 0 8px;padding:0;display:grid;gap:6px}
.office-series{font-size:13px;color:var(--text-2)}
.office-bar-row{display:grid;grid-template-columns:minmax(70px,32%) 1fr auto;gap:8px;align-items:center;font-size:13px}
.office-bar-label{overflow-wrap:anywhere}
.office-bar-track{height:12px;border-radius:6px;background:rgba(158,183,255,.24);overflow:hidden}
.office-bar-fill{display:block;height:100%;border-radius:6px;background:var(--violet)}
.office-bar-fill[data-series="1"]{background:var(--cyan)}
.office-bar-fill[data-series="2"]{background:var(--mint)}
.office-bar-fill[data-series="3"]{background:var(--amber)}
.office-bar-value{min-width:3ch;text-align:right;font-variant-numeric:tabular-nums;color:var(--text-2)}
.office-doc{max-width:70ch}
.office-doc p{margin:0 0 12px}
.office-title{margin:0 0 14px;font-size:24px;line-height:30px}
.office-list{margin:0 0 12px;padding-left:22px}
.office-list li{margin:2px 0}
.office-list .office-list{margin:2px 0 2px}
.office-doc-table table{border-collapse:collapse;min-width:100%}
.office-doc-table td,.office-doc-table th{border:1px solid var(--stroke-soft);padding:8px 12px;text-align:left;vertical-align:top;overflow-wrap:anywhere}
.office-doc-table th{background:var(--glass-raised);font-weight:600}
.office-picture{margin:12px 0;padding:14px;border:1px dashed var(--stroke);border-radius:10px;color:var(--text-2);text-align:center;font-size:13px}
.office-deck{display:grid;gap:14px}
.office-slide{padding:16px;border:1px solid var(--stroke);border-radius:16px;background:var(--glass-soft)}
.office-slide>*:last-child{margin-bottom:0}
.office-slide-no{margin:0 0 4px}
.office-slide-title{margin:0 0 10px}
.office-notes{margin-top:10px}
.office-files{list-style:none;margin:0;padding:0}
.office-file{display:flex;justify-content:space-between;gap:12px;padding:8px 4px;border-bottom:1px solid var(--stroke-soft);font-size:14px}
.office-file-name{overflow-wrap:anywhere;font:13px/1.5 var(--mono)}
.office-file.dir .office-file-name{color:var(--text-2)}
.attachment-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.attachment-file .attachment-detail strong{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.quest-files{padding:16px 18px;border-radius:var(--r-card);min-width:0}
/* ⓘ sits right under the status it explains (#139, #145). */
/* Follow up and Add a thought (#121, ADR 060): icon-first buttons and one box for both. */
.follow-action::before{content:"";display:inline-block;width:16px;height:16px;margin-right:6px;vertical-align:-3px;background:currentColor;-webkit-mask:url("assets/icon/follow.svg") center/contain no-repeat;mask:url("assets/icon/follow.svg") center/contain no-repeat}
/* Follow up's optional file (owner, 3 Oct 2026): the clip beside Send, the chosen file's name with × above. */
.follow-file{display:flex;align-items:center;gap:6px;margin:0;min-width:0;overflow-wrap:anywhere}
.follow-file .icon-button{flex-shrink:0}
.follow-form{display:flex;flex-direction:column;gap:10px;margin-top:10px;padding:14px;border-radius:var(--r-control);border:1px solid var(--violet);background:rgba(139,124,255,.08);box-shadow:var(--glow-violet)}
.follow-form label{display:grid;gap:8px}
.follow-form textarea{width:100%;min-height:88px;resize:none;font-size:16px}
/* In Talk the box takes the message column, not the width of its buttons. */
.message>.follow-form{align-self:stretch;width:min(540px,100%);box-sizing:border-box}
.follow-sent{display:flex;align-items:center;gap:6px;margin:-6px 0 0;color:var(--text-2)}
.follow-sent::before{content:"";flex-shrink:0;width:14px;height:14px;background:currentColor;-webkit-mask:url("assets/icon/follow.svg") center/contain no-repeat;mask:url("assets/icon/follow.svg") center/contain no-repeat}
.follow-form .actions{margin:0}
.follow-send::before{content:"";display:inline-block;width:16px;height:16px;margin-right:6px;vertical-align:-3px;background:currentColor;-webkit-mask:url("assets/icon/send.svg") center/contain no-repeat;mask:url("assets/icon/send.svg") center/contain no-repeat}
.follow-error{margin:0;font-size:14px}
.follow-history{margin:10px 0 0;padding-left:20px;display:grid;gap:8px}
.follow-item p{margin:0}.follow-item .fine{font-size:12px}
.quest-files h4{margin:0 0 4px;font-size:15px;font-weight:560;color:var(--cyan);letter-spacing:.01em}
.attachment-error button{min-height:36px;padding:4px 12px;margin-left:4px}
.image-viewer{max-width:min(96vw,1200px);padding:16px}
.image-viewer img{display:block;max-width:100%;max-height:78dvh;margin:16px auto 0;object-fit:contain}
/* Quests in the conversation: one compact row, the details a tap away. */
.inline-row{display:flex;flex-direction:column;align-items:flex-start;margin:0 0 16px}
.inline-card{width:min(420px,100%);border:1px solid var(--bubble-stroke);border-radius:12px;background:var(--bubble-ari);-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}
.inline-card.needs-you{border-color:rgba(255,198,109,.55);background:linear-gradient(90deg,rgba(255,198,109,.10),transparent 60%),var(--bubble-ari)}
.inline-summary{display:flex;align-items:center;gap:12px;min-height:52px;padding:8px 12px;cursor:pointer;list-style:none;border-radius:12px}
.inline-summary::-webkit-details-marker{display:none}
.inline-icon{width:32px;height:32px;flex-shrink:0;border-radius:10px;border:1.5px solid currentColor;display:grid;place-items:center;font-weight:700;font-size:15px}
.inline-icon.tone-attention::before{content:"!"}
.inline-icon:not(.tone-attention){border-radius:50%}
.inline-icon:not(.tone-attention)::before{content:"";width:10px;height:10px;border-radius:50%;background:currentColor;box-shadow:var(--glow-active)}
.inline-title{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1;font-size:14px;line-height:19px}
.inline-line{display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.inline-line strong{font-weight:600}
.inline-text{color:var(--text-2)}
.inline-stones{width:min(180px,100%);margin:0}
.inline-stones .stone{height:5px}
.inline-summary>.icon{width:18px;height:18px;color:var(--text-2);transition:transform var(--fast) var(--ease)}
.inline-card[open]>.inline-summary>.icon{transform:rotate(90deg)}
.inline-body{padding:0 12px 12px 56px}
.inline-body p{margin:0 0 8px}
.inline-body button{min-height:40px;padding:6px 14px;font-size:14px}
/* A quest's question (0.9.0, ADR 037): one card in Talk, on Home and in the quest sheet. A tap on
   a choice answers; the answered card is one line. Targets are 44 px; the colours are tokens. */
.question-card{width:min(480px,100%);display:flex;flex-direction:column;gap:10px;padding:14px 16px;border:1px solid rgba(255,198,109,.55);border-radius:16px;background:linear-gradient(90deg,rgba(255,198,109,.10),transparent 60%),var(--bubble-ari);color:var(--text);-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}
.question-card p{margin:0}
.question-head{font-size:13px;line-height:18px;color:var(--amber);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.question-head strong{font-weight:650}
.question-quest{color:var(--text-2)}
.question-text{font-size:16px;line-height:23px;font-weight:560;overflow-wrap:anywhere;white-space:pre-line}
.question-choices{display:flex;flex-wrap:wrap;gap:8px}
.question-card button{min-height:44px;padding:8px 16px;border-radius:var(--r-chip);font-size:15px;line-height:20px;white-space:normal;text-align:left}
.question-choice{background:rgba(139,124,255,.14);color:var(--text);border:1.5px solid var(--violet)}
.question-choice:hover{filter:none;background:rgba(139,124,255,.26)}
/* The asker's suggestion (#772): a filled button with a small word under its own, his tap still decides. */
.question-choice.recommended{background:var(--violet);color:var(--on-accent);display:inline-flex;flex-direction:column;align-items:flex-start;gap:0}
.question-choice.recommended:hover{background:var(--violet);filter:brightness(1.08)}
.question-advice{font-size:12px;line-height:15px;font-weight:600;opacity:.88}
.question-write[aria-expanded=true]{border-color:var(--violet);color:var(--violet)}
.question-card button:disabled{opacity:.62;cursor:default;transform:none}
.question-form{display:flex;flex-direction:column;gap:8px}
.question-form textarea{display:block;width:100%;min-height:88px;resize:vertical;font:inherit;font-size:16px;line-height:22px;color:var(--text)}
.question-form textarea:focus-visible{outline:none;border-color:var(--violet)}
.question-secret{font-size:13px;line-height:18px}
.question-send{align-self:flex-start;padding:8px 22px}
.question-error{font-size:14px;line-height:20px}
/* Question kinds (0.9.2, B34): what a permission is for, the site a step opens, and the quiet note. */
.question-detail{font-size:14px;line-height:20px;color:var(--text-2);overflow-wrap:anywhere}
.question-extra{white-space:pre-line}  /* a long text keeps its paragraphs on the card he approves (#685) */
/* A Threads card's photos and videos, in the order they go out (#758): a row he can swipe, each numbered. */
.question-media{display:flex;gap:6px;margin:6px 0;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;max-width:100%}
.question-media-item{position:relative;flex:0 0 auto;margin:0;width:88px;height:88px;border-radius:8px;overflow:hidden;background:var(--stroke-soft);scroll-snap-align:start}
.question-media-item img{display:block;width:100%;height:100%;object-fit:cover}
.question-media-number,.question-media-length{position:absolute;padding:0 5px;border-radius:6px;background:rgba(0,0,0,.62);color:#fff;font-size:12px;line-height:18px}
.question-media-number{top:4px;left:4px}
.question-media-length{bottom:4px;right:4px}
.question-note{font-size:13px;line-height:18px}
.question-address{font-size:13px;line-height:18px;color:var(--text-2);overflow-wrap:anywhere}
.question-link{align-self:flex-start;display:inline-flex;align-items:center;min-height:44px;padding:8px 16px;border:1.5px solid var(--bubble-stroke);border-radius:var(--r-chip);color:var(--text);font-size:15px;line-height:20px;text-decoration:none;overflow-wrap:anywhere}
.question-link::after{content:"\2197";margin-left:6px;color:var(--text-2)}
.question-link:hover{border-color:var(--violet)}
.question-link:focus-visible{outline:2px solid var(--violet);outline-offset:2px}
/* Out on his profile (#759): the words, then the same button to the post; in Talk the "is ready" line carries them too. */
.question-out{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.message>.question-open,.message>.question-out{margin-top:8px}
.question-picker{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip-path:inset(50%);pointer-events:none}
.question-card.answered{padding:10px 14px;border-color:var(--bubble-stroke);background:var(--bubble-ari)}
.question-answered{display:flex;align-items:baseline;flex-wrap:wrap;gap:0 4px;font-size:14px;line-height:20px;color:var(--text-2)}
.question-answered::before{content:"";flex-shrink:0;align-self:center;width:12px;height:7px;margin-right:6px;border:solid var(--mint);border-width:0 0 2px 2px;transform:translateY(-2px) rotate(-45deg)}
.question-answered strong{flex-basis:100%;color:var(--text);font-weight:600;overflow-wrap:anywhere}
.question-answered-time{white-space:nowrap}
.question-asked{font-size:13px;line-height:18px;color:var(--text-2);overflow-wrap:anywhere}
.question-answered:focus{outline:none}
.question-answered:focus-visible{outline:2px solid var(--violet);outline-offset:3px;border-radius:6px}
.home-question{display:flex;flex-direction:column;gap:8px;width:100%}
.home-question[hidden]{display:none}
.home-question .question-card{width:100%;border-radius:var(--r-card);padding:16px 18px}
/* Home's waiting cards (#748): one strip, swiped sideways a card at a time (CSS scroll snap, no script moves it), the next card peeking
   in at the edge so a person sees there are more; the page's own vertical scroll still works from anywhere on it. */
.waiting{display:flex;flex-direction:column;gap:8px;width:100%;min-width:0}
.waiting-track{display:flex;align-items:flex-start;gap:8px;width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y;scrollbar-width:none;border-radius:var(--r-card)}
.waiting-track::-webkit-scrollbar{display:none}
.waiting-track:focus-visible{outline:2px solid var(--violet);outline-offset:2px}
.waiting-track::after{content:"";flex:0 0 12px}
.waiting-track.single::after{display:none}
.waiting-slide{flex:0 0 calc(100% - 20px);min-width:0;display:flex;scroll-snap-align:start;scroll-snap-stop:always}
.waiting-track.single .waiting-slide{flex-basis:100%}
.home-question .waiting-slide .question-card{flex:1 1 auto;min-width:0}
.waiting-pager{align-self:center;display:flex;align-items:center;gap:2px;padding:0 2px;border-radius:var(--r-chip);border:1px solid var(--stroke);background:var(--glass-soft);-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}
.waiting-pager[hidden]{display:none}
.waiting-where{display:flex;align-items:center;justify-content:center;min-width:72px;max-width:52vw;padding:6px 8px}
.waiting-count{font-size:15px;line-height:20px;font-weight:560;color:var(--text);font-variant-numeric:tabular-nums}
.waiting-dots{display:flex;flex-wrap:nowrap;align-items:center;overflow:hidden;justify-content:center;gap:6px}
.waiting-dots[hidden]{display:none}
.home-question .question-head{display:flex;align-items:baseline}
.home-question .question-head strong{flex:none}
.home-question .question-quest{flex:1 1 auto;min-width:0;margin-left:.3em;overflow:hidden;text-overflow:ellipsis}
.question-place{flex:none;margin-left:auto;padding-left:8px;font-weight:600;color:var(--text);font-variant-numeric:tabular-nums}
.waiting-dot{flex:none;width:6px;height:6px;border-radius:50%;background:var(--text-2);opacity:.55}
.waiting-dot.on{background:var(--amber);opacity:1;width:8px;height:8px}
.waiting-step:disabled{opacity:.35}
#report-content .question-card{width:100%}
/* Latest, the waiting line and the composer */
.jump-latest{position:absolute;right:20px;bottom:calc(var(--composer-space,96px));z-index:4;display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:6px 14px;border-radius:var(--r-chip);border:1px solid var(--stroke);background:var(--talk-bar);color:var(--text);font-size:14px;font-weight:560;box-shadow:var(--shadow-card);-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}
.jump-latest .icon{width:18px;height:18px}
/* Back to top (0.9.0, #65): round, 44 px, at the bottom right of a sheet or dialog that scrolls.
   Sticky at the end of the body, so it takes room there and never covers the last controls
   (Copy, Download, the quest's buttons). A sticky offset counts from inside the padding, and the
   phone sheet's padding already holds env(safe-area-inset-bottom): 12 px more keeps it above the
   safe area without counting the inset twice (measured in Chrome at 375 px). */
.back-to-top{display:none;position:sticky;bottom:12px;z-index:3;align-items:center;justify-content:center;width:44px;height:44px;min-height:44px;padding:0;margin:16px 0 0 auto;border-radius:50%;border:1px solid var(--stroke);background:var(--talk-bar);color:var(--text);box-shadow:var(--shadow-card);-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact));opacity:0;visibility:hidden;transition:opacity var(--fast) var(--ease),visibility var(--fast) var(--ease)}
.long>.back-to-top{display:flex}
.back-to-top.shown{opacity:1;visibility:visible}
.back-to-top:hover{filter:none;background:var(--talk-bar)}
.back-to-top .icon{width:20px;height:20px}
.dialog-header h3:focus{outline:none}
.jump-count:empty{display:none}
.jump-count{min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:var(--violet);color:var(--on-accent);font-size:12px;display:inline-grid;place-items:center}
.live{width:100%;max-width:800px;margin:0 auto;font-size:13px;color:var(--cyan);padding:4px 20px;max-height:80px;overflow:auto;white-space:pre-wrap;flex-shrink:0}
/* While Ari replies the header already says so; the line under the conversation stays for waits. */
.talk-main:has(.composer.replying) .live{display:none}
.composer{position:relative;z-index:3;flex-shrink:0;margin:0 16px 12px;padding:8px;border-radius:28px;background:var(--talk-bar);border:1px solid var(--stroke);box-shadow:var(--shadow-float);-webkit-backdrop-filter:blur(var(--blur)) saturate(1.15);backdrop-filter:blur(var(--blur)) saturate(1.15)}
.composer:focus-within{border-color:rgba(139,124,255,.7)}
.composer-row{display:flex;align-items:flex-end;gap:8px}
.composer textarea{flex:1;min-width:0;resize:none;min-height:48px;max-height:132px;padding:12px 16px;border-radius:24px;border:1px solid var(--stroke-soft);background:var(--field);font-size:16px;line-height:22px;field-sizing:content}
.composer textarea:focus-visible{outline:none;border-color:var(--violet)}
.attach-button{width:48px;height:48px;min-width:48px;border-radius:50%;border:1px solid var(--stroke)}
.attach-button .icon{width:22px;height:22px}
.composer button[type=submit]{position:relative;width:48px;height:48px;min-width:48px;padding:0;border-radius:50%;font-size:0;color:transparent;background:var(--violet);box-shadow:var(--glow-violet)}
.composer button[type=submit]::before{content:"";position:absolute;inset:0;margin:auto;width:22px;height:22px;background:var(--on-accent);-webkit-mask:url("assets/icon/send.svg") center/contain no-repeat;mask:url("assets/icon/send.svg") center/contain no-repeat}
.stop-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;min-width:80px;padding:0 16px;border-radius:var(--r-chip);border:1.5px solid var(--violet);background:transparent;color:var(--violet);font-size:15px;font-weight:600}
.stop-square{width:12px;height:12px;border-radius:3px;background:currentColor}
.composer-hint{margin:6px 0 0;text-align:center;font-size:12px;line-height:16px;color:var(--text-3)}
@media (pointer:coarse) and (not (any-pointer:fine)){.composer-hint{display:none}}
.quest-mode{display:flex;align-items:center;gap:8px;margin:0 0 8px;padding:4px 4px 4px 12px;border:1px solid rgba(255,198,109,.5);border-radius:var(--r-chip);color:var(--text);font-size:13px;background:rgba(255,198,109,.08)}
.quest-mode>.icon{width:18px;height:18px;color:var(--amber)}
.quest-mode>span{flex:1;min-width:0}
.quest-mode .icon-button{width:36px;height:36px;min-width:36px;padding:8px}
/* The question a quest asked, quoted above the composer while he answers it (#572). */
.reply-about{display:flex;align-items:flex-start;gap:8px;margin:0 0 8px;padding:8px 4px 8px 12px;border:1px solid var(--stroke);border-left:3px solid var(--violet);border-radius:var(--r-compact);color:var(--text);font-size:13px;line-height:18px;background:var(--glass-soft)}
.reply-about[hidden]{display:none}
.reply-about>.icon{width:18px;height:18px;margin-top:1px;color:var(--violet)}
.reply-about-text{flex:1;min-width:0;display:grid;gap:2px}
.reply-about-text>strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reply-about-text>span{color:var(--text-2);display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
/* His comment on a card (#709): the card quoted above his words, the same violet edge as while he writes it. */
.message-reply{display:grid;gap:2px;margin:0 0 6px;padding:6px 10px;border-left:3px solid var(--violet);border-radius:var(--r-compact);background:var(--glass-soft);font-size:13px;line-height:18px}
.message-reply-head{font-weight:600;color:var(--text)}
.message-reply-text{color:var(--text-2);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.question-replaces{color:var(--text-2)}
.reply-about .icon-button{width:36px;height:36px;min-width:36px;padding:8px;margin-top:-4px}
/* An action with its icon (#568): the icon, then one or two words on one line. */
.with-icon{display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
.with-icon>.icon{width:16px;height:16px}
.quest-request summary>.icon{width:16px;height:16px;margin-right:6px;vertical-align:-3px}
.pending-files{display:grid;gap:8px;margin:0 0 8px}
.pending-files:empty{display:none}
.pending-file{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:8px 10px;border:1px solid var(--stroke);border-radius:var(--r-compact);background:var(--glass-soft);min-width:0}
.pending-file>div{min-width:0;display:grid;gap:2px}.pending-file strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.pending-file button{min-height:40px}
/* The laptop rail: Ari and the trail. */
.talk-rail{display:none}
@media (min-width:1100px){
  #tab-chat{grid-template-columns:minmax(0,1fr) 300px}
  .talk-main{border-right:1px solid var(--stroke-soft)}
  .talk-rail{display:flex;flex-direction:column;gap:12px;min-height:0;overflow:auto;padding:20px 16px}
  .rail-ari{display:flex;align-items:center;gap:12px;padding:12px;border-radius:var(--r-card);min-height:150px}
  .creature-rail{width:104px;height:124px;flex-shrink:0}
  .creature-rail::before{left:12%;right:12%}
  .rail-ari-text{min-width:0;display:flex;flex-direction:column;gap:6px}
  .rail-name{font-size:22px;line-height:26px;font-weight:600}
  .rail-ari .talk-status{margin:0;font-size:14px}
  .rail-ari .talk-status span:last-child{white-space:normal}
  .rail-detail{margin:0;font-size:13px;line-height:18px;color:var(--text-2)}
  .rail-title{margin:12px 0 0;font-size:20px;line-height:26px;font-weight:580}
  .rail-trail .trail-row{min-height:72px;padding:12px 14px;border-radius:18px}
  .rail-trail .trail-title{font-size:15px}
  .rail-trail .trail-state{font-size:13px}
  .conversation{padding:16px 24px 12px}
  .conversation>*{max-width:760px;margin-left:auto;margin-right:auto}
  .composer{width:calc(100% - 48px);max-width:760px;margin:0 auto 10px}
}
.markdown{white-space:normal;line-height:1.6;overflow-wrap:anywhere;min-width:0}
.markdown>:first-child{margin-top:0}
.markdown>:last-child{margin-bottom:0}
.markdown p{margin:0 0 14px;white-space:pre-wrap}
.markdown h3,.markdown h4,.markdown h5,.markdown h6{font-size:17px;line-height:1.4;font-weight:600;margin:22px 0 10px}
.markdown h3{font-size:24px;letter-spacing:-.02em}
.markdown ul,.markdown ol{padding-left:26px;margin:12px 0 16px}
.markdown li{padding-left:4px;margin:6px 0}
.markdown li>ul,.markdown li>ol{margin:6px 0}
.markdown li>p{margin:6px 0}
.markdown blockquote{border-left:3px solid var(--violet);margin:16px 0;padding:4px 0 4px 16px;color:var(--text-2)}
.markdown a{color:var(--cyan);text-decoration:underline;text-underline-offset:3px}
.markdown code{font:14px/1.6 var(--mono);background:var(--code);padding:2px 5px;border-radius:6px;overflow-wrap:anywhere}
.markdown pre,.diagnostics pre{display:block;max-width:100%;min-width:0;margin:16px 0;padding:16px;background:var(--code);border:1px solid var(--stroke-soft);border-radius:var(--r-control);overflow:auto;font:14px/1.6 var(--mono);white-space:pre;overflow-wrap:normal;tab-size:4}
.markdown pre code{padding:0;border:0;background:none;font:inherit;white-space:inherit;overflow-wrap:normal}
.markdown .markdown-table{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;margin:16px 0;border:1px solid var(--stroke);border-radius:var(--r-control)}
.markdown table{border-collapse:collapse;min-width:100%;font-size:14px;line-height:1.5}
.markdown th,.markdown td{padding:12px 16px;border-bottom:1px solid var(--stroke-soft);border-right:1px solid var(--stroke-soft);text-align:left;min-width:128px;vertical-align:top}
.markdown th{background:var(--glass-raised);font-weight:600}
.markdown tr:last-child td{border-bottom:0}
.markdown th:last-child,.markdown td:last-child{border-right:0}
.markdown .align-center{text-align:center}
.markdown .align-right{text-align:right}

/* Quests (the work list) */
#tab-jobs,#tab-memory,#tab-grow{--tab-width:880px}
.work-search{display:flex;gap:8px;align-items:center;margin:0 0 8px;min-width:0}
.work-search input{min-width:0;flex:1;width:100%;border-radius:var(--r-chip);padding-left:18px;background:var(--glass)}
.work-search button{flex-shrink:0;border-radius:var(--r-chip)}
/* The quest sheet's wait line and Talk's paused line carry the control that ends the wait. */
.quest-now.with-action{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px}
.wait-action,.live-action{min-height:44px;padding:0 18px;border-radius:var(--r-chip)}
.live-action{align-self:center;flex-shrink:0;margin:0 auto 6px}
.talk-main:has(.composer.replying) .live-action{display:none}
.work-filters{border-bottom:1px solid var(--stroke-soft);padding-bottom:0}
.work-filters summary{min-height:44px;padding:12px 0;cursor:pointer;font-size:14px;color:var(--text-2)}
.work-filter-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:8px 0 16px}
.work-filter-grid label{display:grid;gap:8px;font-size:13px;color:var(--text-2);min-width:0}
.work-filter-grid input,.work-filter-grid select{width:100%;min-width:0;max-width:100%;box-sizing:border-box;font-size:15px;color:var(--text)}
/* #61: an iOS date field keeps its own intrinsic width and shows an empty box without this. */
.work-filter-grid input[type=date]{-webkit-appearance:none;appearance:none;display:block;min-height:48px;text-align:left}
.work-filter-grid input[type=date]::-webkit-date-and-time-value{text-align:left}
.work-dates{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.work-dates[hidden]{display:none}
#work-state:empty{display:none}
.work-list{margin:12px 0 0;min-width:0;display:grid;gap:10px}
/* A quest row is one button (0.8.12, ADR 036): it opens the quest sheet, where the controls live. */
.work-row{display:grid;grid-template-columns:minmax(0,1fr) 20px;gap:4px 12px;width:100%;padding:12px 14px 12px 18px;border:1px solid var(--stroke);border-radius:var(--r-control);background:var(--glass);color:var(--text);text-align:left;font-weight:400;letter-spacing:normal;min-width:0;align-items:center;min-height:76px;-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}
.work-row:hover{filter:none;border-color:var(--cyan)}
.work-row>.icon{color:var(--text-2)}
.work-row-main{min-width:0;display:flex;flex-direction:column}
.work-title{display:flex;align-items:center;gap:10px;font-size:16px;line-height:1.4;margin:0 0 4px;font-weight:560;min-width:0}
.work-title>span:last-child{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.work-title .trail-light{width:9px;height:9px}
.work-meta{display:flex;flex-wrap:wrap;gap:0 12px;font-size:13px;color:var(--text-2);line-height:1.5;margin:0;overflow-wrap:anywhere}
.work-meta time{white-space:nowrap;font-variant-numeric:tabular-nums}
.work-failure{display:block;font-size:13px;line-height:1.5;margin:4px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.work-pagination{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:20px 0 24px}
.work-pagination span{text-align:center;font-variant-numeric:tabular-nums}
.work-error{padding:12px;border:1px solid var(--rose);border-radius:var(--r-compact);margin:12px 0;color:var(--rose);font-size:14px;line-height:1.5}
.work-error p{margin:0 0 12px}
/* Quests (0.8.7, ADR 031): a board over the list, lifecycle stones on live rows, and one quest sheet. */
.quests-board{display:flex;flex-direction:column;gap:12px;margin:0 0 16px}
.quests-summary{margin:0;font-size:17px;line-height:24px;font-weight:560;color:var(--text);min-width:0;text-shadow:var(--scene-shadow)}
.quests-summary:empty{display:none}
.quests-energy{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:0;padding:10px 14px;border-radius:var(--r-control);border:1px solid var(--warning);color:var(--text);background:var(--glass);font-size:14px;line-height:20px;-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}
.quests-energy[hidden]{display:none}
.quests-energy .icon{width:18px;height:18px;flex-shrink:0;color:var(--warning)}
.quests-energy>span{flex:1 1 160px;min-width:0}
.quests-energy button{min-height:44px;border-radius:var(--r-chip)}
.quest-chips{display:flex;gap:8px;padding:2px 2px 6px;margin:0 -2px}
.quest-chip{flex-shrink:0;scroll-snap-align:start;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border-radius:var(--r-chip);border:1px solid var(--stroke);background:var(--glass-soft);color:var(--text-2);font-size:14px;font-weight:560;box-shadow:none}
.quest-chip:hover{filter:none;color:var(--text);border-color:var(--violet)}
.quest-chip[aria-pressed=true]{color:var(--text);border-color:var(--violet);background:rgba(139,124,255,.18);box-shadow:inset 0 0 0 1px var(--violet)}
.quest-chip .trail-light{width:8px;height:8px}
/* A count on its chip (#295), drawn like the rail's Quests count: never a sentence over the board. */
.chip-count{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;margin-right:-6px;border-radius:999px;background:var(--violet);color:var(--on-accent);font-size:12px;line-height:1;font-weight:650;font-variant-numeric:tabular-nums}
.chip-count[hidden]{display:none}
.work-row .quest-stones{max-width:220px;margin:8px 0 2px}
.work-row.tone-row-working{border-color:rgba(102,226,240,.38)}
.work-row.tone-row-attention{border-color:rgba(255,198,109,.30)}
.work-row.tone-row-failed{border-color:rgba(255,120,146,.30)}
.quest-sheet{max-width:640px}
.quest-sheet .dialog-header h3{font-size:22px;line-height:28px;min-width:0;overflow-wrap:anywhere}
.quest-sheet #report-content{display:flex;flex-direction:column;gap:16px;margin-top:16px}
.quest-state{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px}
.quest-state time{font-variant-numeric:tabular-nums}
.quest-sheet .quest-chip-state{min-height:36px;padding:6px 14px;font-size:14px;color:var(--text)}
.quest-chip-state .trail-light{width:9px;height:9px}
.quest-trail{display:flex;flex-direction:column;gap:6px}
.quest-trail .quest-stones{max-width:320px;margin:0}
.quest-trail p{margin:0}
.quest-now.failure{border-color:rgba(255,120,146,.40)}
.quest-now{margin:0;padding:14px 16px;border-radius:var(--r-control);background:var(--glass-raised);border:1px solid var(--stroke);font-size:16px;line-height:23px}
.quest-actions{margin:0}
.quest-actions button{min-height:48px;padding:0 20px;border-radius:var(--r-chip)}
/* #298: a control that takes no tap right now (its request is on its way, or it just took another's place). */
.quest-actions button.settling{opacity:.45;cursor:progress;transition:opacity .15s}
.quest-thought{display:flex;flex-direction:column;gap:10px;padding:14px;border-radius:var(--r-control);border:1px solid var(--amber);background:rgba(255,198,109,.06)}
.quest-thought label{display:grid;gap:8px}
.quest-thought textarea{width:100%;min-height:88px;resize:vertical;font-size:16px}
.quest-thought .actions{margin:0}
.quest-result{padding:18px 20px;border-radius:var(--r-card);border-color:rgba(255,198,109,.45);box-shadow:var(--shadow-card),var(--glow-reward);min-width:0;overflow-wrap:anywhere}
.quest-result h4{margin:0 0 8px;font-size:15px;font-weight:560;color:var(--amber);letter-spacing:.01em}
.quest-result .actions{margin-top:12px}
.quest-sheet .diagnostics{margin:0}

/* World (memory) and shared cards */
.memory-add{padding:4px 0 8px}
.memory-add>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;color:var(--violet);font-size:15px;font-weight:560}
.memory-form{display:grid;gap:8px;grid-template-columns:1fr 2fr auto;padding-top:8px}
.memory-form input{min-width:0}
.cards{display:grid;gap:12px;margin:16px 0;min-width:0}
#memories{grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr))}
#memories .card>p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.card{padding:16px 18px;background:var(--glass);border:1px solid var(--stroke);border-radius:var(--r-control);overflow-wrap:anywhere;min-width:0;box-shadow:var(--shadow-card);-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}
.card h4{margin:0 0 8px;font-size:16px;font-weight:580}
.card>.tag+h4{margin-top:8px}
.card p{color:var(--text-2);font-size:15px;line-height:1.55;white-space:pre-wrap;margin:8px 0}
.card p.failure{color:var(--rose)}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
.tag{color:var(--violet);font-size:14px}
.diagnostics{margin-top:12px;min-width:0}
.diagnostics summary{cursor:pointer;color:var(--text-2);font-size:14px;min-height:44px;padding:12px 0}
.diagnostics pre{max-height:360px;font-size:12px}
.summary-list{display:grid;grid-template-columns:minmax(96px,1fr) minmax(0,2fr);gap:12px 16px;margin:8px 0 16px;font-size:15px;line-height:1.5}
.summary-list dt{color:var(--text-2)}
.summary-list dd{margin:0;text-align:right;overflow-wrap:anywhere}
.settings-disclosure{margin:0;padding:0 18px;background:var(--glass);border:1px solid var(--stroke);border-radius:var(--r-control)}
.settings-disclosure>summary{color:var(--text);padding:16px 0}
.settings-disclosure .diagnostics{margin-top:8px}
.settings-disclosure p:empty{display:none}
.request-text,.memory-full{font-size:15px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}

/* Grow */

/* Home & care */
.preferences{margin:16px 0;border:1px solid var(--stroke);border-radius:var(--r-control);background:var(--glass);padding:0 18px;min-width:0;-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}
.preferences .fine{overflow-wrap:anywhere}
.preferences [role=status]:empty{display:none}
.preferences>details:last-child{margin-bottom:8px}
/* Who thinks (0.8.10): the Claude / Codex choice and one plain sentence under it. */
.engine-choice{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-top:16px}
.engine-choice-label{font-size:14px;font-weight:600}
#engine-switch-result,#engine-energy{margin:8px 0 0}
#engine-energy{padding-bottom:12px}
#engine-energy:empty{display:none}
/* Two or three choices in one row: Appearance and Who thinks. */
.segmented{display:inline-flex;border:1px solid var(--line);border-radius:12px;padding:3px;gap:3px;background:var(--field)}
/* One line per choice (#134): a label never wraps; the choices share the row equally on a phone. */
.segmented button{background:transparent;color:var(--text-2);border-radius:9px;min-height:44px;min-width:96px;padding:8px 16px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.segmented button[aria-pressed=true]{background:var(--violet);color:var(--on-accent);font-weight:600;box-shadow:var(--glow-violet)}
.segmented button:disabled{cursor:default}
.segmented button:disabled:not([aria-pressed=true]){opacity:.55}
@media(max-width:760px){
  .preferences{padding:0 12px}
  .segmented{width:100%}
  .segmented button{flex:1 1 0;min-width:0;padding:8px 10px}
}
.appearance{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 16px;padding:14px 18px;background:var(--glass);border:1px solid var(--stroke);border-radius:var(--r-control)}
.appearance h3{margin:0;font-size:15px;font-weight:600}
#system>button{justify-self:start}
/* Work rows in Home & care (0.8.12, ADR 036): Pause all work / Allow new work and Quests at once. */
.care-rows{padding:0 6px}
.care-row{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:60px;padding:10px 12px;margin:0;background:transparent;color:var(--text);border:0;border-radius:var(--r-compact);text-align:left;font-weight:500;letter-spacing:normal}
.care-row+.care-row{border-top:1px solid var(--stroke-soft);border-top-left-radius:0;border-top-right-radius:0}
.care-row:hover{filter:none;background:var(--glass-soft)}
.care-row:disabled{cursor:default}
.care-row-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.care-row-label{font-size:15px;font-weight:600}
.care-row .fine{overflow-wrap:anywhere}
.care-row .chevron{width:18px;height:18px}
/* Home & care › Always on (#119) */
.always-on-state,.always-on-item{display:inline-flex;align-items:center;gap:6px}
.always-on-state .glyph,.always-on-item .glyph{width:16px;height:16px;flex-shrink:0}
.always-on-ready .always-on-state{color:var(--text)}
.always-on-needs_you .always-on-state .glyph{color:var(--violet)}
.always-on-list{list-style:none;margin:0;padding:0 12px 6px;display:flex;flex-wrap:wrap;gap:6px 14px;font-size:14px}
.always-on .diagnostics{margin:0 12px 10px}
/* Notifications (0.9.3, ADR 040): one switch per intent; the row's own words say what is true now. */
.notify-row{cursor:pointer}
.notify-row .care-row-text{flex:1}
.switch{-webkit-appearance:none;appearance:none;position:relative;flex:none;width:51px;height:31px;min-height:0;margin:0;padding:0;border:0;border-radius:var(--r-chip);background:var(--text-3);cursor:pointer;transition:background var(--fast) var(--ease)}
.switch::before{content:"";position:absolute;top:2px;left:2px;width:27px;height:27px;border-radius:50%;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.28);transition:transform var(--fast) var(--ease)}
.switch:checked{background:var(--violet)}
.switch:checked::before{transform:translateX(20px)}
.switch:disabled{opacity:.45;cursor:default}
.notify-help{margin:0 12px 12px}
.notify-more{border-top:1px solid var(--stroke-soft)}
/* Quiet hours From/To (#134, #201): one row, each word beside its time, and the row wraps instead of
   pushing To past the card. A time is a --control pill on a --hit tap box (the transparent ring is the
   border, as on every other compact control), as wide as its text. iOS's own time-field look is off (its
   built-in size pushed To past the card, and it set the text high), so the field centres its own value. */
.notify-times{display:flex;flex-wrap:wrap;align-items:center;column-gap:16px;padding:0 12px 4px}
.notify-times label{display:flex;align-items:center;gap:8px;min-width:0;font-size:var(--text-secondary);color:var(--text-2)}
.notify-times input{-webkit-appearance:none;appearance:none;box-sizing:border-box;display:flex;align-items:center;justify-content:center;flex:none;width:auto;min-width:0;
  height:var(--hit);min-height:var(--hit);margin:0;padding:0 10px;border:var(--hit-ring) solid transparent;border-radius:calc(var(--r-compact) + var(--hit-ring));
  background-clip:padding-box;box-shadow:inset 0 0 0 1px var(--stroke);text-align:center;font-size:var(--text-input);line-height:var(--control);color:var(--text)}
.notify-times input::-webkit-date-and-time-value{min-height:1.2em;margin:0;text-align:center}
/* A finger taps the time itself to set it; the clock icon would only widen the field (a pointer keeps it). */
@media (pointer:coarse){.notify-times input::-webkit-calendar-picker-indicator{display:none}}
/* At 200 % zoom on a phone the card is too narrow for a word and its time side by side: the word goes above. */
@media (max-width:300px){.notify-times label{flex-direction:column;align-items:flex-start;gap:0}}
.notify-note{margin:0 12px 14px}
@media (prefers-reduced-motion:reduce){.switch,.switch::before{transition:none}}
/* Home's paused state carries its own Allow new work. */
.unpause-button{min-height:48px;padding:0 24px;border-radius:var(--r-chip);box-shadow:var(--glow-violet)}
.unsent-attachments{margin-top:14px;padding:12px 16px;border:1px solid var(--stroke);border-radius:var(--r-control);background:var(--glass)}
.unsent-attachments>summary{cursor:pointer;font-weight:600;min-height:44px;padding:11px 0;box-sizing:border-box}.unsent-attachments>button{margin-top:10px}
.unsent-attachments-list{display:grid;gap:8px;margin-top:10px}
.unsent-attachment{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:10px;border:1px solid var(--stroke);border-radius:var(--r-compact);background:var(--glass-soft);min-width:0}
.unsent-attachment>div:first-child{min-width:0;display:grid;gap:2px}.unsent-attachment strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.unsent-attachment .attachment-actions{display:flex;gap:6px}.unsent-attachment .attachment-actions button{min-height:40px}
.login-remember{display:flex;gap:8px;align-items:center;color:var(--text-2)}
.login-remember input{width:auto;min-height:0;margin:0}
.devices{margin-top:12px;padding:12px 16px;border:1px solid var(--stroke);border-radius:var(--r-control);background:var(--glass)}
.devices>summary{cursor:pointer;font-weight:600;min-height:44px;padding:11px 0;box-sizing:border-box}
.devices-list{display:grid;gap:8px;margin:12px 0}
.device-row{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:12px;border:1px solid var(--stroke);border-radius:var(--r-compact)}
.device-row strong{display:block;overflow-wrap:anywhere}
.device-row .fine{display:block}
.devices-actions{display:flex;gap:8px;flex-wrap:wrap}
.devices-code{margin:12px 0;padding:12px;border:1px dashed var(--stroke);border-radius:var(--r-compact);line-height:1.6}
.devices-code strong{font-size:20px;letter-spacing:2px;font-family:var(--mono);display:block}
.devices-audit-list{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:6px;font-size:14px;color:var(--text-2)}

/* Sign-in and dialogs */
.login{position:relative;min-height:100dvh;display:grid;place-items:center;padding:24px;background:
  linear-gradient(180deg,rgba(7,11,22,.15),rgba(7,11,22,.75)),url("assets/scenes/home-portrait.webp") center 25%/cover no-repeat,
  radial-gradient(60% 40% at 70% 8%,rgba(122,98,255,.45),transparent 70%),linear-gradient(180deg,#0B1433,#070B16)}
.login-card{width:100%;max-width:420px;padding:28px;background:var(--glass);border:1px solid var(--stroke);border-radius:var(--r-hero);box-shadow:var(--shadow-float);text-align:left;-webkit-backdrop-filter:blur(var(--blur));backdrop-filter:blur(var(--blur))}
.login-creature{display:block;width:150px;height:150px;object-fit:contain;margin:-96px auto 4px;filter:drop-shadow(0 12px 30px rgba(139,124,255,.35))}
.login-card .avatar{display:none}
.login-card h1{font-size:32px;line-height:36px;letter-spacing:-.035em;margin:8px 0 0;text-align:center}
.login-card>p{line-height:1.6;color:var(--text-2)}
.login-card form{display:grid;gap:12px;margin:24px 0}
.login-card label{font-size:14px}
.login-card button[type=submit]{min-height:var(--primary-control);border-radius:var(--r-chip);font-size:17px}
#login-error{color:var(--rose)}
#login-error:empty{display:none}
dialog{max-width:850px;width:92vw;max-height:85dvh;background:var(--surface);color:var(--text);border:1px solid var(--stroke);border-radius:var(--r-card);padding:24px;overflow:auto;overscroll-behavior:contain;box-shadow:var(--shadow-float)}
dialog::backdrop{background:var(--scrim);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.dialog-header{display:flex;align-items:center;justify-content:space-between;gap:16px}
.dialog-header h3{margin:0;font-size:22px}
#report-content{margin-top:24px;min-width:0}

/* Tablet: the rail folds to icons. */
@media (max-width:1180px) and (min-width:761px){
  #tab-home{grid-template-columns:minmax(0,1fr);overflow:auto}
  .home-main{min-height:100%}
  .home-stage{min-height:380px}
  .home-trail{display:none}
  main{--main-pad:24px}
}
@media (max-width:1100px) and (min-width:761px){
  .shell{grid-template-columns:84px minmax(0,1fr)}
  .shell .nav-label,.shell .nav-count{display:none}
  .shell .nav,.shell .logout-button{justify-content:center;padding:12px}
  .shell .brand{margin:0 auto 18px}.shell .brand .wordmark{font-size:26px}
  .home-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Phone: bottom tab bar with four places; Talk and Home & care open from Home. */
@media (max-width:760px){
  :root{--gutter:20px}
  .shell,.shell.nav-collapsed{display:flex;flex-direction:column;height:100dvh;min-height:420px}
  .sidebar,.nav-collapsed .sidebar{order:2;position:relative;height:auto;flex-shrink:0;margin:0 12px max(10px,env(safe-area-inset-bottom));padding:6px;border:1px solid var(--stroke);border-radius:28px;background:var(--glass);box-shadow:var(--shadow-float);flex-direction:row}
  .brand,.nav-collapsed .brand,.sidebar-bottom,.rail-owner{display:none}
  .sidebar nav{flex-direction:row;gap:2px}
  .nav,.nav-collapsed .nav{flex:1;flex-direction:column;gap:3px;padding:8px 2px 6px;min-width:0;min-height:60px;justify-content:center;align-items:center;font-size:13px;border-radius:22px;box-shadow:none}
  .nav.active,.nav.parent-active{background:transparent;border-color:transparent;color:var(--text);box-shadow:none}
  .nav.active .icon,.nav.parent-active .icon{color:var(--violet);filter:drop-shadow(0 0 8px rgba(139,124,255,.6))}
  .nav.active::after,.nav.parent-active::after{content:"";position:absolute;bottom:3px;left:50%;width:5px;height:5px;margin-left:-2.5px;border-radius:50%;background:var(--text)}
  .nav .icon{width:24px;height:24px}
  .nav span.nav-label,.nav-collapsed .nav-label{display:block;font-size:13px}
  .nav .nav-count,.nav-collapsed .nav-count{display:none}
  .nav-talk,.settings-nav{display:none}
  main{--main-pad:var(--gutter);flex:1;min-height:0;height:auto;padding:max(6px,env(safe-area-inset-top)) var(--main-pad) 0}
  .tab{--tab-end:16px}
  header{min-height:52px;padding:0 0 6px;position:relative}
  #sidebar-toggle{display:none}
  .header-title{gap:4px}
  .header-title h2{font-size:20px}
  .header-actions{gap:4px}
  .care-button{display:inline-grid}
  .shell[data-screen=home] header{justify-content:center}
  .shell[data-screen=home] .header-wordmark{display:inline-flex}
  .shell[data-screen=home] .header-title{flex:1;justify-content:center}
  .shell[data-screen=home] .header-actions{position:absolute;right:-8px;top:2px}
  .shell[data-screen=chat] .back-button,.shell[data-screen=system] .back-button{display:inline-flex}
  .shell[data-screen=chat] .care-button,.shell[data-screen=system] .care-button{display:none}
  .shell[data-screen=chat] .header-title h2,.shell[data-screen=system] .header-title h2{font-size:18px}
  #tab-home{display:block}
  .home-trail{display:none}
  .home-main{gap:14px;min-height:100%}
  .home-stage{align-items:center;text-align:center;gap:12px;padding:0}
  .home-stage .state-detail{text-align:center}
  .home-greeting{font-size:32px;line-height:36px}
  #tab-home{overflow:auto}
  .home-main{display:flex;flex-direction:column;align-items:stretch}
  .creature-hero{position:relative;left:auto;right:auto;top:auto;bottom:auto;width:100%;height:clamp(240px,44dvh,400px);margin-top:-6px}
  .home-actions{gap:12px}
  .quest-card{padding:14px;gap:14px}
  .quest-thumb{width:64px;height:64px}
  .quest-title{font-size:19px;line-height:24px}
  .home-ask{background:none;border:0;box-shadow:none;padding:0;-webkit-backdrop-filter:none;backdrop-filter:none;display:grid;grid-template-columns:1fr 1fr;gap:12px}
  .home-ask input,.ask-spark{display:none}
  .talk-button,.quest-button{width:100%;padding:0 12px;min-height:60px;font-size:18px}
  .home-cards{grid-template-columns:1fr}
  .laptop-card{display:none}
  .home-footer{display:none}
  .info-card{min-height:84px}
  /* Phone Talk: full screen with a Home back action; no tab bar, so messages get the height. */
  .shell[data-screen=chat] .sidebar{display:none}
  .shell[data-screen=chat]>main{padding:0}
  .talk-header{min-height:calc(72px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 16px 0 20px;gap:8px}
  .talk-back{display:inline-flex}
  .creature-mini{width:40px;height:40px}
  .talk-title{font-size:20px;line-height:24px}
  .conversation{padding:12px 20px 8px}
  .message{font-size:16px;line-height:23px}
  .message>*{max-width:min(330px,calc(100% - 8px))}
  .message.user>*{max-width:82%}
  .attachment{max-width:240px}
  .attachment img{max-height:180px}
  .composer{margin:0 12px max(12px,env(safe-area-inset-bottom));padding:8px;border-radius:30px}
  .jump-latest{right:14px}
  .attachment-detail{grid-template-columns:minmax(0,1fr)}
  .attachment-actions{grid-column:1;grid-row:auto}
  .unsent-attachment{align-items:flex-start;flex-direction:column}.unsent-attachment .attachment-actions{width:100%}
  .memory-form{grid-template-columns:1fr}
  .card{padding:16px}
  .work-filter-grid{grid-template-columns:minmax(0,1fr)}
  .work-dates{grid-template-columns:minmax(0,1fr)}
  .work-search{flex-wrap:wrap}
  .work-search #work-reset{margin-left:auto}
  .work-row{gap:4px 10px;padding-left:14px}
  .work-pagination{gap:8px}
  .grow-title{font-size:28px;line-height:32px}
  .device-row{flex-direction:column;align-items:flex-start}
  .login-card{padding:24px}
  .empty{margin:24px auto}
  dialog{width:calc(100vw - 24px);padding:16px}
  .quest-sheet{width:100vw;max-width:100vw;max-height:92dvh;margin:auto 0 0;border-radius:var(--r-hero,32px) var(--r-hero,32px) 0 0;padding:20px 20px calc(20px + env(safe-area-inset-bottom))}
  .quests-summary{font-size:16px}
  .markdown pre{padding:12px}
  .markdown th,.markdown td{padding:12px}
}
@media (max-width:380px){
  .home-greeting{font-size:28px;line-height:32px}
  .talk-button,.quest-button{font-size:16px;gap:6px}
  .conversation{padding-left:16px;padding-right:16px}
  .update-prompt{font-size:13px}
}

/* Home fixes (0.8.4): the detail line sits on its own glass, clear of the creature's wing; the trail
   links to paused quests; a missing pose becomes a soft silhouette, never a broken image. */
.home-stage .state-detail{padding:8px 14px;border-radius:14px;background:var(--scene-chip);border:1px solid var(--stroke-soft);max-width:440px;-webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}
.trail-links{display:flex;flex-wrap:wrap;gap:8px}
.trail-paused{color:var(--text-2)}
.quest-title{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.creature.art-missing .creature-img{visibility:hidden}
.creature.art-missing::after{content:"";position:absolute;left:50%;bottom:6%;width:min(46%,260px);aspect-ratio:1/1.05;transform:translateX(-50%);border-radius:48% 48% 44% 44%;background:radial-gradient(60% 55% at 50% 40%,rgba(139,124,255,.38),rgba(102,226,240,.12) 60%,transparent 72%);filter:blur(2px);animation:none}
.creature-mini.art-missing::after{display:block;width:70%;bottom:15%}
/* Ari was updated: one quiet line with Reload; nothing reloads by itself. */
.update-prompt{position:fixed;left:50%;top:max(12px,env(safe-area-inset-top));transform:translateX(-50%);z-index:20;display:flex;align-items:center;gap:10px;width:max-content;max-width:calc(100vw - 24px);padding:8px 8px 8px 14px;border-radius:var(--r-chip);border:1px solid rgba(139,124,255,.55);background:var(--surface);color:var(--text);font-size:14px;line-height:19px;box-shadow:var(--shadow-float)}
.update-prompt>.icon{width:16px;height:16px;fill:var(--amber);stroke:none}
.update-prompt button{min-height:40px;padding:6px 14px;border-radius:var(--r-chip);font-size:14px}
/* Reduced motion: still poses and quick crossfades only. Reduced transparency: opaque surfaces. */
@media (prefers-reduced-motion:reduce){
  *{scroll-behavior:auto!important}
  .creature-img,.creature::before,.creature::after{animation:none!important}
  .creature[data-state=thinking]::after{display:none}
  .talk-status .state-light,.writing-dots{animation:none!important}
  *,*::before,*::after{transition-duration:.1s!important}
}
@media (prefers-reduced-transparency:reduce){
  .glass,.home-ask,.composer,.talk-header,.jump-latest,.back-to-top,.inline-card,.question-card,.card,.work-row,.world-entity,.sidebar,.state-chip,#notice{background:var(--surface);-webkit-backdrop-filter:none;backdrop-filter:none}
}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .glass,.home-ask,.composer,.talk-header,.inline-card,.question-card,.card,.work-row,.world-entity{background:var(--surface)}
}

/* Large screens keep the same size of Ari as a cap, never as a fixed height that ran past the stage
   onto a sign-in card (#280: a height here overrode the stage's own bottom). */
@media (min-width:1600px){.creature-hero{max-height:clamp(240px,50dvh,560px)}}

select option{background:#191f28;color:#e8edf5}
/* Native select popups above (Quests filters, Home & care) stay opaque and legible.
   The Talk mode selector left in 0.8.4 (ADR 027). */
:root[data-theme=light] select option{background:#FFFFFF;color:#101628}
/* World as Ari's journal and Grow (0.9.7, #81, ADR 045), icon first: a picture, one line and a time per entry;
   words open in a sheet on tap. The laptop adds the card of the chosen person or place as a pane beside the
   journal. Grow puts the fox inside a ring of skill stars. */
:root,:root[data-theme=dark]{--date:#ADA6FF;--person-a:#EBA8FF;--person-a-bg:rgba(214,120,255,.20);--person-b:#9ED3FF;--person-b-bg:rgba(102,170,255,.18);
  --node-fg:#FFFFFF;--node-bg:radial-gradient(circle,rgba(139,124,255,.50),rgba(40,30,110,.45));--puzzle-stroke:rgba(255,198,109,.78)}
:root[data-theme=light]{--date:#5646CF;--person-a:#8E2DB5;--person-a-bg:rgba(142,45,181,.10);--person-b:#1F5FA8;--person-b-bg:rgba(31,95,168,.10);
  --node-fg:#5646CF;--node-bg:#FFFFFF;--puzzle-stroke:rgba(155,97,0,.55)}
@media (prefers-color-scheme:light){:root:not([data-theme]){--date:#5646CF;--person-a:#8E2DB5;--person-a-bg:rgba(142,45,181,.10);--person-b:#1F5FA8;--person-b-bg:rgba(31,95,168,.10);
  --node-fg:#5646CF;--node-bg:#FFFFFF;--puzzle-stroke:rgba(155,97,0,.55)}}
#tab-memory{--tab-width:760px}
.shell[data-screen=memory] #heading{display:inline-flex;align-items:center;gap:12px}
.shell[data-screen=memory] #heading::before{content:"";width:44px;height:44px;flex-shrink:0;border-radius:50%;border:1px solid var(--stroke);
  background:url("assets/creature/idle.webp") 50% 12%/160% auto no-repeat,radial-gradient(circle at 50% 35%,rgba(139,124,255,.35),rgba(11,18,36,.9))}
.world-switch{display:flex;gap:4px;margin:0 0 var(--s4);padding:4px;border:1px solid var(--stroke);border-radius:var(--r-chip);background:var(--glass-soft);
  -webkit-backdrop-filter:blur(var(--blur-compact));backdrop-filter:blur(var(--blur-compact))}
/* A segment is as wide as its own words (#204): it grows into spare room, and when the row is too narrow its words wrap instead of leaving the pill. */
.world-choice{flex:1 1 auto;min-width:min-content;min-height:44px;padding:0 10px;border-radius:var(--r-chip);border:1px solid transparent;background:transparent;
  color:var(--text-2);font-size:15px;font-weight:560;cursor:pointer}
.world-choice:hover{filter:none;color:var(--text)}
.world-choice[aria-pressed=true]{color:var(--text);border-color:var(--violet);box-shadow:var(--glow-violet);background:linear-gradient(180deg,rgba(139,124,255,.34),rgba(139,124,255,.14))}
.progress{height:6px;border-radius:999px;background:var(--glass-soft);border:1px solid var(--stroke-soft);overflow:hidden}
.progress-fill{display:block;height:100%;background:linear-gradient(90deg,var(--violet),var(--cyan))}
/* Shared pieces: a kind picture in a circle, and a time or count chip. */
.kind-icon{display:grid;place-items:center;flex-shrink:0;width:40px;height:40px;border-radius:50%;border:1px solid var(--stroke);background:var(--glass-soft);color:var(--text)}
.kind-icon .icon{width:20px;height:20px}
.kind-person{color:var(--person-a);border-color:var(--person-a);background:var(--person-a-bg)}
.kind-place,.kind-project{color:var(--date);border-color:rgba(139,124,255,.6);background:rgba(139,124,255,.12)}
.kind-moment .icon,.kind-note .icon{fill:none}
.time-chip{flex-shrink:0;display:inline-flex;align-items:center;min-height:26px;padding:0 10px;border-radius:var(--r-chip);border:1px solid var(--stroke-soft);
  background:var(--glass-soft);color:var(--text-2);font-size:13px;font-weight:560;white-space:nowrap}
/* People and places: a row that scrolls sideways. A person is a monogram, a place a pin, a project a flag. */
.people-row{display:flex;gap:10px;margin:0 -4px var(--s4);padding:2px 4px 4px}
/* Sideways rows (#108): People & places and the quest chips. No bar at all; the edge that still has
   more fades out, a swipe settles on a whole item, and every item is at least 44 px. On a phone the
   row runs to the screen edges, so the fades sit in the gutters and items line up with the page at rest. */
@property --fade-start{syntax:'<length>';inherits:false;initial-value:0px}
@property --fade-end{syntax:'<length>';inherits:false;initial-value:0px}
.people-row,.quest-chips{--fade-start:0px;--fade-end:0px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 var(--fade-start),#000 calc(100% - var(--fade-end)),transparent);
  mask-image:linear-gradient(90deg,transparent,#000 var(--fade-start),#000 calc(100% - var(--fade-end)),transparent)}
.people-row::-webkit-scrollbar,.quest-chips::-webkit-scrollbar{display:none}
@supports (animation-timeline:scroll()){
  .people-row,.quest-chips{animation:ari-row-edges linear both;animation-timeline:scroll(self inline)}
}
@keyframes ari-row-edges{0%{--fade-start:0px;--fade-end:32px}12%{--fade-start:32px}88%{--fade-end:32px}100%{--fade-start:32px;--fade-end:0px}}
/* A table wider than Ari's bubble scrolls sideways; the edge with more fades, as the rows above (#181 review). */
.markdown .markdown-table{--fade-start:0px;--fade-end:0px;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 var(--fade-start),#000 calc(100% - var(--fade-end)),transparent);
  mask-image:linear-gradient(90deg,transparent,#000 var(--fade-start),#000 calc(100% - var(--fade-end)),transparent)}
@supports (animation-timeline:scroll()){.markdown .markdown-table{animation:ari-row-edges linear both;animation-timeline:scroll(self inline)}}
@media (max-width:760px){
  .people-row,.quest-chips{margin-inline:calc(-1 * var(--main-pad));padding-inline:var(--main-pad);scroll-padding-inline:var(--main-pad)}
}
.person{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;gap:6px;width:62px;min-height:44px;padding:0;background:none;border:0;
  border-radius:var(--r-compact);color:var(--text);font-size:13px;font-weight:520;scroll-snap-align:start}
.person:hover{filter:none}
.person:hover .entity-badge{border-color:var(--violet)}
.person-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-2)}
.entity-badge{display:inline-grid;place-items:center;flex-shrink:0;width:56px;height:56px;border-radius:50%;border:1px solid var(--stroke);
  background:var(--glass);box-shadow:var(--shadow-card);font-size:21px;font-weight:640;color:var(--text);letter-spacing:-.02em}
.entity-badge .icon{width:22px;height:22px}
.badge-person{color:var(--person-a);background:var(--person-a-bg);border-color:var(--person-a)}
.person:nth-child(even) .badge-person,.entity-row:nth-child(even) .badge-person{color:var(--person-b);background:var(--person-b-bg);border-color:var(--person-b)}
.badge-more{font-size:16px;font-weight:600;color:var(--text-2)}
/* The "?" question: the one warm (amber) surface on the screen. A glyph, one line, the answer buttons. */
.puzzle-slot{margin:0 0 var(--s5)}
.puzzle-slot:empty{display:none}
.puzzle{display:grid;grid-template-columns:48px minmax(0,1fr);column-gap:14px;align-items:center;padding:16px;border-radius:var(--r-card);
  border:1.5px solid var(--puzzle-stroke);box-shadow:var(--glow-reward),var(--shadow-card)}
.puzzle-glyph{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;border:1.5px solid var(--puzzle-stroke);color:var(--amber);font-size:26px;font-weight:700;line-height:1}
.puzzle-line{margin:0;font-size:18px;line-height:24px;font-weight:560;min-width:0;overflow-wrap:anywhere}
/* A "same or not?" question (#761): both entries, whole names and one line each, a tap opens one; Ari's view under them. */
.puzzle-entries{grid-column:1 / -1;display:grid;gap:8px;margin-top:14px}
.puzzle-entry{display:flex;align-items:center;gap:12px;width:100%;min-height:60px;padding:10px 12px;text-align:left;border-radius:var(--r-control);
  border:1px solid var(--stroke);background:var(--glass-raised);color:var(--text);font:inherit;font-weight:400;box-shadow:none}
.puzzle-entry:hover{filter:none;border-color:var(--violet)}
.puzzle-entry-words{flex:1 1 auto;min-width:0;display:grid;gap:2px}
.puzzle-entry-name{font-size:16px;line-height:22px;font-weight:600;overflow-wrap:anywhere}
.puzzle-entry-about{font-size:14px;line-height:20px;color:var(--text-2);overflow-wrap:anywhere}
.puzzle-entry-open{display:grid;flex-shrink:0;color:var(--text-2)}
.puzzle-entry-open .icon{width:18px;height:18px}
.puzzle-view{grid-column:1 / -1;margin:12px 0 0;font-size:16px;line-height:22px;overflow-wrap:anywhere}
.fact-group .puzzle-view{margin-top:6px}
/* In the narrower card a word never runs past its button (#761 walk: «Different» was cut): the buttons wrap instead. */
.fact-group .puzzle-choices .choice{min-width:fit-content}
.puzzle-choices{grid-column:1 / -1;display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.choice{flex:1 1 0;min-width:0;min-height:48px;padding:10px 14px;border-radius:var(--r-chip);border:1px solid var(--stroke);background:var(--glass-raised);
  color:var(--text);font-size:16px;font-weight:560;line-height:1.3;box-shadow:inset 0 1px rgba(255,255,255,.06)}
.choice:hover{filter:none;border-color:var(--violet)}
.choice.choice-picked{background:var(--violet);color:var(--on-accent);border-color:transparent}
.puzzle-choices.stacked{flex-direction:column}
.puzzle-choices.stacked .choice{flex:none;width:100%;text-align:left;border-radius:var(--r-control);padding:12px 16px}
.puzzle-choices.stacked .choice-later{text-align:center;background:transparent;color:var(--text-2)}
.puzzle-done{grid-column:1 / -1;display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:12px}
.puzzle-done-text{margin:0;flex:1 1 120px;font-size:16px;font-weight:560}
.puzzle-done button,.small-action,.see-quests{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border-radius:var(--r-chip)}
/* The days: a short heading, then one-line entries. */
.moments{display:grid;gap:10px}
.moment-day{margin:var(--s4) 0 0;font-size:20px;line-height:26px;font-weight:640;letter-spacing:-.01em;color:var(--text);text-shadow:var(--scene-shadow)}
.moment-day:first-child{margin-top:0}
.moment-list,.entity-list{display:grid;gap:8px}
.moment{display:flex;align-items:center;gap:12px;width:100%;min-height:60px;padding:10px 12px;border-radius:var(--r-control);text-align:left;color:var(--text);font:inherit;cursor:pointer}
.moment:hover{filter:none;border-color:var(--violet)}
.moment-title{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px;font-weight:520}
.moment-important{display:inline-grid;color:var(--amber)}
.set-aside-chip{flex-shrink:0;font-size:12px;color:var(--text-3);font-style:italic}
.moment-important .icon{width:16px;height:16px;fill:currentColor;stroke:none}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.entity-chip{position:relative;display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 14px 0 6px;border-radius:var(--r-chip);border:1px solid var(--stroke);
  background:var(--glass-soft);color:var(--text);font-size:14px;font-weight:540;cursor:pointer}
.entity-chip::after{content:"";position:absolute;inset:-4px -2px}
.entity-chip:hover,.entity-chip:focus-visible{filter:none;border-color:var(--violet)}
.chip-icon{display:grid;place-items:center;width:26px;height:26px;border-radius:50%}
.chip-icon .icon{width:16px;height:16px}
.chip-person{color:var(--person-a);border-color:var(--person-a);background:var(--person-a-bg)}
.chip-project,.chip-place{border-color:rgba(139,124,255,.65);background:rgba(139,124,255,.14)}
/* Below the days: a small status line, and the backfill as one compact row. */
.world-status{display:block;margin:var(--s5) 0 0;text-align:center;color:var(--text-3);font-size:13px;text-shadow:var(--scene-shadow)}
.world-status:empty{display:none}
.world-backfill{margin:8px 0 0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;align-items:center;padding:12px 14px}
.world-backfill h4{margin:0;font-size:14px}
.world-backfill p{margin:0}
.world-backfill .progress{grid-column:1 / -1}
.world-backfill button{min-height:44px;border-radius:var(--r-chip)}
.world-loading,.world-empty{margin:0;padding:8px 2px}
/* People & places: one-line rows grouped by kind. */
.entity-group{margin:var(--s4) 0 8px;font-size:15px;font-weight:580;color:var(--text-2);text-shadow:var(--scene-shadow)}
.entity-row{display:flex;align-items:center;gap:12px;text-align:left;width:100%;min-height:60px;padding:8px 12px;cursor:pointer;color:var(--text);font:inherit}
.entity-row .entity-badge{width:40px;height:40px;font-size:16px;box-shadow:none}
.entity-row-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px;font-weight:580}
/* The card of one person or place: head, three panels (I know, I'm puzzled, It used to be), moments, Correct something. */
.world-entity{display:grid;gap:12px;align-content:start;padding:16px 18px 18px;border:1px solid var(--stroke);border-radius:var(--r-card);background:var(--glass);box-shadow:var(--shadow-card);min-width:0;-webkit-backdrop-filter:blur(var(--blur)) saturate(1.15);backdrop-filter:blur(var(--blur)) saturate(1.15)}
.world-entity>.fine,.entity-note{margin:0}
.entity-head{display:grid;grid-template-columns:auto auto minmax(0,1fr);align-items:center;gap:12px;min-width:0;margin-left:-6px}
.entity-head .entity-badge{width:60px;height:60px}
.entity-back{flex-shrink:0}
.entity-heading{display:grid;gap:6px;min-width:0}
.entity-title{margin:0;font-size:26px;line-height:32px;font-weight:640;letter-spacing:-.02em;min-width:0;overflow-wrap:anywhere}
.entity-title:focus{outline:none}
.entity-title:focus-visible{outline:2px solid var(--cyan);outline-offset:3px;border-radius:6px}
.entity-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px}
.entity-meta .fine{font-size:14px}
.entity-kind{display:inline-flex;align-items:center;min-height:26px;padding:0 12px;border-radius:var(--r-chip);border:1px solid rgba(139,124,255,.65);background:rgba(139,124,255,.14);color:var(--text);font-size:13px;font-weight:560;letter-spacing:.01em}
.fact-group{display:grid;grid-template-columns:44px minmax(0,1fr);gap:14px;padding:14px 16px;border:1px solid var(--stroke);border-radius:var(--r-control);background:var(--glass-raised)}
.fact-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;border:1px solid var(--stroke);color:var(--text)}
.fact-body{min-width:0}
.fact-body h4{margin:2px 0 6px;font-size:17px;line-height:24px;font-weight:620}
.fact-unsure{border:1.5px solid var(--puzzle-stroke);box-shadow:var(--glow-reward)}
.fact-unsure h4,.fact-unsure .fact-icon{color:var(--amber);border-color:var(--puzzle-stroke)}
.fact-group .memory-versions{padding-left:0;border-left:0;gap:8px}
.fact-group .puzzle-choices{margin-top:10px}
.fact-group .puzzle-done{margin-top:6px}
.fact-group .small-action{margin-top:8px}
.puzzle-ask{margin:0;font-size:16px}
.entity-moments-title{margin:6px 0 0;font-size:18px;font-weight:620}
.world-entity .moment{background:var(--glass-raised)}
.entity-actions{display:flex;gap:10px;flex-wrap:wrap;padding-top:14px;border-top:1px solid var(--stroke-soft)}
.entity-actions button{display:inline-flex;align-items:center;gap:10px;min-height:48px;padding:0 18px;border-radius:var(--r-control);font-size:15px}
.fact-source{margin:2px 0 0}
.fact-source>summary{display:inline-flex;align-items:center;gap:8px;min-height:44px;cursor:pointer;font-size:13px;color:var(--text-2);list-style:none}
.fact-source>summary::-webkit-details-marker{display:none}
.fact-source>summary::after{content:"";width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:translateY(-2px) rotate(45deg);transition:transform var(--fast) var(--ease)}
.fact-source[open]>summary::after{transform:translateY(1px) rotate(-135deg)}
.fact-source>p{margin:4px 0 0;font-size:14px;line-height:1.5}
/* The sheet a moment or a note opens in. */
.world-sheet{max-width:560px}
.sheet-content{display:grid;gap:16px;margin-top:14px}
.sheet-meta{display:flex;align-items:center;gap:10px}
.sheet-content .memory-full{margin:0}
.moment-source{margin:0}
details.moment-source>summary{display:inline-flex;align-items:center;gap:8px;min-height:44px;cursor:pointer;color:var(--text-2);font-size:14px;list-style:none}
details.moment-source>summary::-webkit-details-marker{display:none}
.moment-source .icon{width:18px;height:18px}
.moment-source .memory-quote{margin:2px 0 4px;font-size:15px;line-height:1.5}
.note-actions{display:flex;gap:8px;flex-wrap:wrap}
.note-actions button{display:inline-flex;align-items:center;gap:8px;min-height:44px;border-radius:var(--r-chip)}
.sheet-content .memory-history{margin-top:0}
.version-text{display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;width:100%;min-height:44px;padding:0;background:none;border:0;border-radius:0;text-align:left;color:var(--text-3);font-weight:400;cursor:pointer}
.version-text:hover{filter:none}
.version-text[aria-expanded=true]{display:block;-webkit-line-clamp:unset;line-clamp:none}
/* Notes: a picture, a title and two lines; everything else in the sheet. */
.notes{display:grid;gap:8px}
.note-card{display:flex;align-items:center;gap:12px;width:100%;min-height:60px;padding:12px;text-align:left;color:var(--text);font:inherit;cursor:pointer}
.note-card:hover{filter:none;border-color:var(--violet)}
.note-words{display:grid;gap:2px;flex:1 1 auto;min-width:0}
.note-title{font-size:16px;font-weight:600;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.note-preview{display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--text-2);font-size:14px;line-height:1.45;overflow-wrap:anywhere}
.note-chevron{display:grid;color:var(--text-3)}
/* Grow: "Ari is a Scout." and the fox in its ring of skills, an icon timeline, lessons as chips. */
.grow-hero{display:grid;gap:8px;justify-items:center;text-align:center;padding-top:4px}
.grow-intro{display:grid;gap:4px}
.grow-title{margin:0;font-size:30px;line-height:36px;font-weight:640;letter-spacing:-.03em}
.grow-offline{margin:4px 0 0}
.grow-ring{position:relative;width:min(100%,340px);aspect-ratio:1/1.04;--r:124px}
.grow-ring::before{content:"";position:absolute;left:50%;top:50%;width:calc(var(--r) * 2);height:calc(var(--r) * 2);transform:translate(-50%,-50%);border-radius:50%;border:1px dashed rgba(158,183,255,.30)}
.grow-ring .creature-grow{position:absolute;left:50%;top:50%;width:58%;height:60%;transform:translate(-50%,-50%)}
.ring-stars{position:absolute;inset:0}
.ring-star{position:absolute;left:50%;top:50%;z-index:1;display:flex;flex-direction:column;align-items:center;gap:3px;width:86px;min-height:44px;padding:0;background:none;border:0;
  color:var(--text);transform:translate(calc(-50% + cos(var(--a)) * var(--r)),calc(-22px + sin(var(--a)) * var(--r)))}
.ring-star:hover{filter:none}
.ring-star:active{transform:translate(calc(-50% + cos(var(--a)) * var(--r)),calc(-21px + sin(var(--a)) * var(--r)))}
.ring-star:nth-child(1){--a:-140deg}.ring-star:nth-child(2){--a:-40deg}.ring-star:nth-child(3){--a:0deg}
.ring-star:nth-child(4){--a:40deg}.ring-star:nth-child(5){--a:140deg}.ring-star:nth-child(6){--a:180deg}
.star-mark{display:grid;place-items:center;width:44px;height:44px;border-radius:50%;border:1.5px dashed var(--stroke);background:var(--glass-soft);color:var(--text-3)}
.star-mark .icon{width:20px;height:20px}
.ring-star.lit .star-mark,.skill-mark.lit{border:1.5px solid rgba(139,124,255,.9);background:var(--node-bg);color:var(--node-fg);box-shadow:0 0 22px rgba(139,124,255,.6)}
.ring-star.lit .icon,.skill-mark.lit .icon{fill:currentColor;stroke:none}
.ring-star[aria-pressed=true] .star-mark{box-shadow:0 0 0 3px var(--violet),0 0 22px rgba(139,124,255,.6)}
.star-label{max-width:86px;font-size:12.5px;line-height:15px;font-weight:560;color:var(--text-2);text-shadow:var(--scene-shadow)}
.ring-star.lit .star-label{color:var(--text)}
.grow-skill{display:flex;align-items:center;gap:14px;width:100%;max-width:560px;margin-top:4px;padding:12px 14px;border-radius:var(--r-card);text-align:left}
.skill-mark{display:grid;place-items:center;flex-shrink:0;width:44px;height:44px;border-radius:50%;border:1.5px dashed var(--stroke);color:var(--text-3)}
.skill-mark .icon{width:20px;height:20px}
.skill-words{flex:1 1 auto;min-width:0}
.grow-skill h4{margin:0;font-size:17px;font-weight:620}
.grow-skill p{margin:2px 0 0;font-size:14px}
.see-quests{white-space:nowrap;flex-shrink:0}
.see-quests .icon{width:18px;height:18px}
.grow-story{margin-top:var(--s6)}
.grow-story h3,.grow-lessons h3{margin:0 0 12px;font-size:22px;line-height:28px;font-weight:640;letter-spacing:-.02em}
.grow-path{list-style:none;margin:0;padding:0}
.path-item{position:relative;display:flex;align-items:center;gap:14px;min-height:44px;padding:0 0 16px}
.path-item::before{content:"";position:absolute;left:21px;top:44px;bottom:0;width:2px;background:rgba(139,124,255,.55)}
.path-item:last-child::before{display:none}
.path-next::before{background:none;border-left:2px dashed rgba(139,124,255,.5);width:0}
.path-node{display:grid;place-items:center;flex-shrink:0;width:44px;height:44px;border-radius:50%;border:1.5px solid rgba(139,124,255,.85);background:var(--node-bg);color:var(--node-fg);box-shadow:0 0 16px rgba(139,124,255,.40)}
.path-node .icon{width:20px;height:20px}
.path-next .path-node{border-style:dashed;background:transparent;box-shadow:none;color:var(--text-2)}
.path-title{flex:1 1 auto;min-width:0;font-size:16px;font-weight:580;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.path-next .path-title{color:var(--text)}
.path-note{padding:8px 0}
.path-note p{margin:0 0 8px}
.grow-card{padding:18px 20px;border-radius:var(--r-card);margin-top:16px}
.lesson-chips{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.lesson-chip{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 14px 0 6px;border-radius:var(--r-chip);border:1px solid var(--stroke);background:var(--glass-soft);font-size:15px}
.lesson-empty{border-style:dashed;color:var(--text-2)}
.lesson-mark{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;color:var(--mint)}
.lesson-mark .icon{width:18px;height:18px}
@media (min-width:761px){
  .grow-hero{grid-template-columns:380px minmax(0,1fr);column-gap:32px;align-items:center;justify-items:start;text-align:left}
  .grow-ring{grid-column:1;grid-row:1 / span 2;width:380px;--r:140px}
  .grow-intro,.grow-skill{grid-column:2}
  .grow-intro{align-self:end}
  .grow-skill{align-self:start}
  .grow-title{font-size:40px;line-height:46px}
}
@media (min-width:1100px){
  #tab-memory{--tab-width:1280px;display:grid;grid-template-columns:minmax(0,760px);justify-content:center;gap:24px;align-items:start}
  #tab-memory.entity-open{grid-template-columns:minmax(0,1fr) minmax(360px,440px)}
  /* The card is a pane beside the journal, never taller than the screen (#108): 100cqh is the height
     World shows, so the whole card is reachable and its end never hides below the window. */
  #tab-memory{container-type:size}
  #tab-memory .world-entity{position:sticky;top:0;max-height:100cqh;overflow:auto;overscroll-behavior:contain}
}
@media (max-width:760px){
  .shell[data-screen=memory] .header-title h2{font-size:26px}
  .world-choice{font-size:14px;padding:0 6px}
  .world-entity{padding:12px 14px 16px}
  .entity-head .entity-badge{width:52px;height:52px}
  .entity-title{font-size:22px;line-height:28px}
  .fact-group{grid-template-columns:36px minmax(0,1fr);gap:12px;padding:12px 14px}
  .fact-icon{width:36px;height:36px}
  .fact-icon .icon{width:18px;height:18px}
}
/* Memory history (ADR 028): the current value first, earlier ones muted, nothing struck out of existence. */
.memory-history:empty{display:none}
.memory-history{margin-top:12px}
.memory-history h5{margin:0 0 8px;font-size:14px;font-weight:580;color:var(--text-2)}
.memory-versions{list-style:none;margin:0;padding:0 0 0 12px;border-left:2px solid var(--stroke);display:grid;gap:12px}
.memory-version p{margin:0}
.memory-state{font-size:13px;font-weight:580;color:var(--text)}
.memory-was .memory-state,.memory-was .memory-full{color:var(--text-3)}
.memory-version .memory-full{font-size:15px;margin:2px 0}
.memory-version .memory-source{font-size:13px;color:var(--text-2)}
.memory-quote{color:var(--text-3)}

/* Keys & accounts (0.9.4, #63, ADR 041): a list of saved keys, never their values. */
.keys-head{cursor:default}
.keys-head:hover{background:transparent}
.keys-head .care-row-text{flex:1}
.keys-note,.keys-foot{margin:0 12px 12px}
.keys-retry{margin:0 12px 12px}
.keys-list{display:grid;gap:8px;padding:0 6px 12px}
.keys-list:empty{display:none}
.key-connection{width:100%;display:flex!important;justify-content:flex-start;gap:8px;background:transparent;color:var(--text);font-weight:500;text-align:left}
.key-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;align-items:center;padding:12px;border:1px solid var(--stroke);border-radius:var(--r-compact)}
.key-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.key-text strong{overflow-wrap:anywhere}
.key-locked{font-size:14px;line-height:1.45}
.key-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.key-confirm,.key-uses{grid-column:1/-1}
.key-confirm{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding-top:10px;border-top:1px solid var(--stroke-soft)}
.key-confirm p{flex-basis:100%;margin:0}
.key-delete{background:var(--rose);color:var(--on-accent)}
.key-uses summary{cursor:pointer;min-height:44px;padding:12px 0;box-sizing:border-box;font-size:14px;color:var(--text-2)}
.key-uses ul{list-style:none;margin:0;padding:0 0 4px;display:grid;gap:4px;font-size:14px;color:var(--text-2)}
#key-dialog{max-width:520px}
#key-form{display:grid;gap:14px}
#key-form .dialog-header{margin-bottom:0}
#key-intro{margin:0;line-height:1.5}
#key-form label{display:grid;gap:6px;font-size:14px}
#key-form input,#key-form select{width:100%;min-width:0}
.key-fields{display:grid;gap:14px}
#key-kind{display:flex;width:100%}
#key-kind button{flex:1;min-width:0}
#key-error{margin:0;font-size:14px;line-height:1.5}
.key-site-note{margin:-6px 0 0;line-height:1.45}
#key-site[readonly]{color:var(--text-2)}
.key-intl{display:grid;gap:8px;padding:12px;border:1px solid var(--rose);border-radius:var(--r-compact)}
.key-intl-text{margin:0;font-size:14px;line-height:1.45}
#key-form .key-intl-confirm{display:flex;align-items:center;gap:10px;min-height:44px;font-size:15px}
#key-form .key-intl-confirm input{width:22px;height:22px;min-height:0;flex:none}
#key-save{width:100%}
.question-key{color:var(--text-2)}
@media (max-width:480px){.key-row{grid-template-columns:1fr}.key-actions{justify-content:flex-start}}

/* Connections (#114, #146, ADR 049): GitHub's card in Home & care (icon first, a few words, ⓘ for more), and a tracker change on a permission card. */
.connections>.keys-head{min-height:52px;padding-bottom:2px}
.connection-row{display:flex;align-items:center;flex-wrap:wrap;gap:0 12px;margin:0 0 4px;padding:0 0 0 12px}
.connection-icon{flex:none;width:24px;height:24px}
.connection-icon.connection-mark{fill:currentColor;stroke:none}
.connection-name{flex:1 1 7.5rem;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px}
.connection-name strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.connection-state{display:inline-flex;align-items:center;gap:8px;white-space:nowrap;min-width:0;max-width:100%}
.connection-state .fine{min-width:0;overflow:hidden;text-overflow:ellipsis}
.connection-dot{flex:none;width:9px;height:9px;border-radius:50%;background:var(--text-3)}
.connection-dot.on{background:var(--mint);box-shadow:0 0 8px rgba(141,227,193,.55)}
.connection-dot.off{background:var(--warning)}
.connection-info{flex:none;background:transparent;color:var(--text-2)}
.connection-info[aria-expanded="true"]{color:var(--violet)}
.connection-actions{margin:0 12px 8px 48px;display:flex}
.connection-actions:not(:has(button:not([hidden]))){display:none}
.connection-detail{margin:0 12px 8px;padding:10px 12px;border:1px solid var(--stroke-soft);border-radius:var(--r-compact);display:grid;gap:8px}
.connection-detail p{margin:0}
.connection-form{margin:0 12px 12px;display:grid;gap:10px}
.connection-form input{width:100%}
/* One left edge for the card: the GitHub row, Board, Ask me first and Recent all start at 12px. */
.connection-more{margin:0 0 8px;display:grid;gap:0;min-width:0;overflow:hidden}
.connection-more>.care-row{min-height:52px;border-top:1px solid var(--stroke-soft);border-radius:0}
.connection-more>.connection-detail{margin:0 12px 8px}
.connection-board{cursor:pointer;font:inherit}
.connection-check{display:inline-flex;align-items:center;gap:6px;font-size:14px;color:var(--text-2);white-space:nowrap}
.connection-check .icon{width:20px;height:20px}
.connection-check.on{color:var(--mint)}
.connection-check.off{color:var(--warning)}
.connection-recent{display:grid;gap:4px;padding:8px 12px 0;border-top:1px solid var(--stroke-soft);min-width:0}
/* Recent and its See all view (All changes, #208) draw the same plain rows, never the filled button. */
.connection-recent ul,.connection-recent-all{list-style:none;margin:0;padding:0;display:grid;gap:2px;min-width:0}
:is(.connection-recent,.connection-recent-all) li{min-width:0}
:is(.connection-recent,.connection-recent-all) .connection-recent-row{display:flex;align-items:center;gap:10px;width:100%;min-width:0;min-height:44px;padding:0;border:0;border-radius:0;background:transparent;font-size:14px;font-weight:450;color:var(--text-2);text-align:left}
.connection-recent-row .connection-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.connection-recent-row .fine{flex:none;white-space:nowrap}
.connection-recent-row[aria-expanded="true"]{color:var(--text)}
:is(.connection-recent,.connection-recent-all) li.connection-failed :is(.connection-recent-row,.connection-op){color:var(--rose)}
:is(.connection-recent,.connection-recent-all) li>.connection-detail{margin:2px 0 8px}
:is(.connection-recent,.connection-recent-all) li>.connection-detail button{justify-self:start}
.connection-op{flex:none;width:18px;height:18px;color:var(--text-3)}
.question-quote{margin:4px 0;padding:8px 12px;border-left:3px solid var(--stroke-soft);white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:20px;color:var(--text);max-height:240px;overflow:auto}
.question-destructive{color:var(--rose)}
/* ⓘ (#145, the text budget): 1-2 words on screen; the explanation waits behind this 44 px button, in one sheet. */
.info-btn{display:inline-grid;place-items:center;flex:none;width:44px;height:44px;min-width:44px;min-height:44px;margin:-12px -8px -12px 0;padding:12px;background:transparent;border:0;border-radius:50%;color:var(--text-3);vertical-align:middle}
.info-btn:hover{background:var(--glass-soft);color:var(--text);filter:none}
.info-btn .icon{width:18px;height:18px}
.info-btn[hidden]{display:none}
.care-row-title{display:inline-flex;align-items:center;gap:2px;min-width:0}
.info-sheet{max-width:380px}
.info-sheet-text{margin:0;font-size:16px;line-height:1.5;color:var(--text)}
.login-foot{margin:10px 0 0;display:flex;justify-content:center}
.notify-main label{cursor:pointer}
.quest-now .info-btn,.question-note .info-btn,.signin-error .info-btn,.key-locked .info-btn,.world-status .info-btn{margin-top:-14px;margin-bottom:-14px}

/* Quests at once (#135, ADR 055; UI/UX review): title + ⓘ + how many work now; one compact cluster
   − [n] ten slots + on the second line at every phone width; one line of explanation under the row. */
.lanes-row{display:grid;grid-template-columns:auto 44px minmax(0,1fr);grid-template-areas:"title info status" "control control control" "text text text";align-items:center;column-gap:4px;row-gap:6px;min-height:0;padding-top:6px;padding-bottom:10px}
.lanes-title{grid-area:title}
.lanes-info-toggle{grid-area:info}
.lanes-status{grid-area:status;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px 8px;min-width:0;text-align:right}
.lanes-state{white-space:nowrap}
.lanes-badge{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:13px;line-height:18px;font-weight:600;white-space:nowrap}
.lanes-badge .icon{width:16px;height:16px}
.lanes-badge-wait{color:var(--warning);background:color-mix(in srgb,var(--warning) 12%,transparent);border:1px solid color-mix(in srgb,var(--warning) 45%,transparent)}
.lanes-badge-error{color:var(--rose);background:color-mix(in srgb,var(--rose) 12%,transparent);border:1px solid color-mix(in srgb,var(--rose) 45%,transparent)}
.lanes-control{grid-area:control;display:inline-flex;align-items:center;gap:4px;justify-self:start}
.lanes-icon-button{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center;border-radius:12px}
.lanes-info-toggle{border:0;background:transparent;color:var(--text-2)}
.lanes-info-toggle[aria-expanded=true]{color:var(--violet)}
.lanes-info-toggle,.lanes-info-toggle:focus-visible{outline-offset:-2px}
.lanes-limit{min-width:2ch;text-align:center;font-weight:700;font-size:18px;line-height:24px;color:var(--text);font-variant-numeric:tabular-nums;margin-right:4px}
/* The owner's speed limiters (limits.js): one width for "5" and "95%", so every − + lines up. */
.limit-row .limit-value{min-width:6ch}  /* "500 MB" (#390): every limit row keeps one − column */
.lanes-icons{display:inline-flex;gap:3px;align-items:center}
.lane-slot{width:14px;height:14px;flex:none;overflow:visible}
.lane-slot rect{stroke-width:1.5}
.lane-busy rect{fill:var(--violet);stroke:var(--violet)}
.lane-busy{filter:drop-shadow(0 0 3px color-mix(in srgb,var(--violet) 55%,transparent))}
.lane-free rect{fill:none;stroke:var(--text)}
.lane-off rect{fill:none;stroke:var(--text-2);stroke-dasharray:3 2.2}
.lanes-info{grid-area:text;margin:0}
@media (max-width:359px){.lanes-row{row-gap:8px}.lanes-icons{gap:1px}.lane-slot{width:10px;height:10px}}
@media (min-width:600px){
  .lanes-row{grid-template-columns:auto 44px minmax(0,1fr) auto;grid-template-areas:"title info status control" "text text text text"}
  .lanes-control{justify-self:end}
}
/* Work › Skill forge (#269): the Quests at once row's look; a switch on line 1, − pace + under it while on. */
.lanes-row.forge-row{grid-template-columns:auto 44px minmax(0,1fr) auto;grid-template-areas:"title info status switch" "control control control control" "text text text text"}
.forge-switch{grid-area:switch;justify-self:end}
.forge-row .lanes-title{white-space:nowrap}
.forge-every{min-width:56px;white-space:nowrap}
.forge-state{white-space:nowrap}
@media (min-width:600px){
  .lanes-row.forge-row{grid-template-columns:auto 44px minmax(0,1fr) auto auto;grid-template-areas:"title info status control switch" "text text text text text";column-gap:8px}
}
/* Ari's test copy (ADR 053): a small amber tag on every screen, never on the real Ari. */
html[data-role="dev"] body::after{content:"Test copy";position:fixed;top:0;left:50%;transform:translateX(-50%);z-index:10000;padding:2px 12px;border-radius:0 0 10px 10px;background:#f5b642;color:#1b1400;font:600 12px/1.7 system-ui,sans-serif;letter-spacing:.02em;pointer-events:none}
.engine-line-row{display:flex;align-items:center;margin:2px 0 0}
.engine-line-row .engine-line{margin:0}
@media (max-width:600px){.composer-hint{display:none}}
.device-row .fine{display:block}
.device-badge{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;font-size:12px;line-height:18px;font-weight:600;color:var(--mint);border:1px solid color-mix(in srgb,var(--mint) 45%,transparent);vertical-align:middle}
/* The computer is about to make Ari go quiet (#168): one line on Home's stage, above the greeting.
   What it means for Ari in bold, the cause beside it, the fix behind ⓘ, and ✕. Warm, never red:
   nothing is broken, Anton only needs to know. */
.awake-banner{display:flex;align-items:center;gap:10px;max-width:min(100%,520px);min-height:52px;padding:6px 6px 6px 14px;border-radius:var(--r-control);border-color:rgba(246,174,94,.55);color:var(--text)}
.awake-banner[hidden]{display:none}
.awake-mark{display:grid;place-items:center;flex-shrink:0;width:32px;height:32px;border-radius:50%;background:rgba(246,174,94,.16);color:var(--warning)}
.awake-mark .icon{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.awake-words{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:8px;row-gap:0;min-width:0;flex:1;font-size:15px;line-height:20px}
.awake-title{font-weight:600}
.awake-cause{color:var(--text-2)}
.awake-banner .info-btn{flex-shrink:0}
.awake-close{flex-shrink:0;width:44px;height:44px;min-height:44px;padding:0;border-radius:50%;display:grid;place-items:center}
.awake-close .icon{width:18px;height:18px}
/* The memory repair (#197): the same banner; calm green when repaired, four dots while it runs. */
.memory-banner[data-state=repaired]{border-color:color-mix(in srgb,var(--mint) 50%,transparent)}
.memory-banner[data-state=repaired] .awake-mark{background:color-mix(in srgb,var(--mint) 16%,transparent);color:var(--mint)}
.memory-steps{display:flex;gap:4px;flex-shrink:0}
.memory-steps i{width:6px;height:6px;border-radius:50%;background:var(--text-2);opacity:.35}
.memory-steps i.done{opacity:1;background:var(--warning)}

/* Code colour (#113 phase 6, ADR 102): highlight.js's classes, in Ari's own tokens (every colour is at least 4.5:1 on the code background in both themes: violet 5.8/4.8, mint 12.5/5.0, amber 12.2/4.6, rose 7.5/5.8, grey 10.4/6.4). */
.hljs-keyword,.hljs-built_in,.hljs-type,.hljs-literal,.hljs-selector-tag,.hljs-doctag,.hljs-name,.hljs-tag,.hljs-meta .hljs-keyword{color:var(--violet)}
.hljs-string,.hljs-regexp,.hljs-meta .hljs-string,.hljs-addition{color:var(--mint)}
.hljs-number,.hljs-symbol,.hljs-bullet,.hljs-link{color:var(--amber)}
.hljs-comment,.hljs-quote,.hljs-meta{color:var(--text-2)}
.hljs-comment,.hljs-quote{font-style:italic}
.hljs-title,.hljs-section{color:var(--text);font-weight:600}
.hljs-attr,.hljs-attribute,.hljs-selector-class,.hljs-selector-id,.hljs-deletion{color:var(--rose)}
.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}

/* Sortable tables (#113 phase 6): a header cell is a button that fills it (a 44 px target); the table's look does not change. */
th:has(>.sort-button){padding:0}
.sort-button{display:flex;align-items:center;justify-content:flex-start;gap:6px;width:100%;min-height:44px;margin:0;padding:8px 12px;border:0;border-radius:0;background:none;color:inherit;font:inherit;text-align:inherit;cursor:pointer}
.sort-button:hover{color:var(--text)}
.sort-button:focus-visible{outline:2px solid var(--violet);outline-offset:-3px}
.sort-mark{flex:none;min-width:1em;font-size:14px;line-height:1;color:var(--text-2)}
th[aria-sort=ascending],th[aria-sort=descending]{box-shadow:inset 0 -3px var(--violet)}
th[aria-sort=ascending] .sort-mark,th[aria-sort=descending] .sort-mark{color:var(--text)}
td.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
/* A CSV in the reader: the sheet does not scroll, the table does, so the header stays in view. */
.reader-table{display:flex;flex-direction:column;gap:4px;min-height:0;height:100%}
.reader-table>.fine{margin:0}
.reader.is-table .reader-body{overflow:hidden;display:flex;flex-direction:column}
.reader.is-table #reader-content{flex:1 1 auto;min-height:0}
.reader-grid{flex:1 1 auto;min-height:0;max-width:100%;overflow:auto;overscroll-behavior:contain;border:1px solid var(--stroke);border-radius:var(--r-control)}
.reader-grid.scrolls{background:linear-gradient(to right,var(--glass-strong) 30%,transparent) left/28px 100% no-repeat local,linear-gradient(to left,var(--glass-strong) 30%,transparent) right/28px 100% no-repeat local,linear-gradient(to right,var(--edge-shadow),transparent) left/12px 100% no-repeat scroll,linear-gradient(to left,var(--edge-shadow),transparent) right/12px 100% no-repeat scroll}
.reader-grid table{border-collapse:separate;border-spacing:0;min-width:100%;font-size:14px;line-height:1.4}
.reader-grid th,.reader-grid td{padding:8px 12px;border-bottom:1px solid var(--stroke-soft);text-align:left;vertical-align:top;white-space:pre-wrap;overflow-wrap:break-word;max-width:320px}
.reader-grid td:first-child{min-width:9ch}
.reader-grid th{position:sticky;top:0;z-index:1;background:var(--glass-strong);font-weight:600;white-space:nowrap;padding:0}
.reader-grid td.num{text-align:right;white-space:nowrap}
th.num-col .sort-button,th.align-right .sort-button{justify-content:flex-end}
th.align-center .sort-button{justify-content:center}
th.num-col{text-align:right}

/* A code line that is cut by the edge: the edge shows a shadow (the same cue as a table's), in the code's own background. */
.code-block .markdown-code{background:linear-gradient(to right,var(--code) 30%,transparent) left/24px 100% no-repeat local,linear-gradient(to left,var(--code) 30%,transparent) right/24px 100% no-repeat local,linear-gradient(to right,var(--edge-shadow),transparent) left/12px 100% no-repeat scroll,linear-gradient(to left,var(--edge-shadow),transparent) right/12px 100% no-repeat scroll;background-color:var(--code)}
/* The reader below the status bar and the Dynamic Island, above the home indicator (owner, 4 Oct 22:32: on an iPhone Home Screen app the Expand view put
   Close and Expand against the top edge). env() is 0 where there is no inset (a laptop, a browser tab), so nothing else moves. */
/* The sheet floats --sheet-gap above the bottom (care.css): what is left under the status bar is its room. */
dialog.reader{max-height:calc(100dvh - env(safe-area-inset-top,0px) - var(--sheet-gap,0px) - 8px)}
dialog.reader:is(.is-pdf,.is-page,.is-table)[open]{height:min(92dvh,900px,calc(100dvh - env(safe-area-inset-top,0px) - var(--sheet-gap,0px) - 8px))}
/* Any phone sheet (a report, a note, Care) also stays below the status bar. */
:is(.quest-sheet,.care-sheet){max-height:min(92dvh,calc(100dvh - env(safe-area-inset-top,0px) - var(--sheet-gap,0px) - 8px))}
dialog.reader.full[open]{height:100dvh;max-height:100dvh}
dialog.reader.full .dialog-header{padding-top:calc(var(--sheet-pad) + env(safe-area-inset-top,0px))}
.reader-body{padding-bottom:calc(var(--sheet-pad) + env(safe-area-inset-bottom,0px))}
.reader.is-page .reader-body{padding-bottom:calc(8px + env(safe-area-inset-bottom,0px))}

/* A sortable table wider than the screen: the first column (the row's name) stays, and the edge fade is narrow so no number is lost in it. */
@keyframes ari-row-edges-narrow{0%{--fade-start:0px;--fade-end:14px}12%{--fade-start:14px}88%{--fade-end:14px}100%{--fade-start:14px;--fade-end:0px}}
@supports (animation-timeline:scroll()){.markdown .markdown-table.sorts{animation-name:ari-row-edges-narrow}}
.sticky-first th:first-child,.sticky-first td:first-child{position:sticky;left:0;z-index:1;background:var(--surface);box-shadow:1px 0 0 var(--stroke-soft)}   /* opaque: nothing shows through it */
.sticky-first th:first-child{z-index:3;background:linear-gradient(var(--glass-raised),var(--glass-raised)),var(--surface)}

/* Link cards (#113 phase 7, ADR 103): under the words of a message, one for each link Ari could read. */
.message>.link-cards{display:grid;gap:8px;margin:10px 0 2px;max-width:560px}
.message>.link-cards[hidden]{display:none}
.link-card{display:flex;align-items:stretch;gap:12px;min-height:44px;padding:10px;border:1px solid var(--stroke);border-radius:14px;background:var(--glass-soft);color:var(--text);text-decoration:none;-webkit-tap-highlight-color:transparent}
.link-card{border-left:3px solid var(--violet)}   /* Ari's own accent: violet for a page, cyan for a video */
.link-card.is-video{border-left-color:var(--cyan)}
.link-card:hover{background:var(--glass-raised)}
.link-card:active{background:var(--glass);border-color:var(--violet)}
.link-card:focus-visible{outline:2px solid var(--cyan);outline-offset:-2px}
.link-card-thumb{position:relative;flex:none;display:block;width:88px;min-height:66px;border-radius:10px;overflow:hidden;background:var(--code)}
.link-card.is-video{flex-direction:column}
.link-card.is-video .link-card-thumb{width:100%;min-height:0;aspect-ratio:16/9}
.link-card-image{display:block;width:100%;height:100%;object-fit:cover}
.link-card-mark{flex:none;align-self:center}
.link-card.has-image .link-card-mark{display:none}
.link-cards.many .link-card.has-image:not(.is-video) .link-card-mark{display:grid}
.link-card-play{position:absolute;inset:0;display:grid;place-items:center;background:rgba(0,0,0,.28);color:#fff}
.link-card-play .icon{width:26px;height:26px;fill:currentColor;stroke:none}
.link-card-words{display:flex;flex-direction:column;justify-content:center;gap:2px;min-width:0}
.link-card-title,.link-card-description{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:break-word;word-break:normal}
.link-card-title{-webkit-line-clamp:2;line-clamp:2;font-weight:600;font-size:15px;line-height:20px}
.link-card-description{-webkit-line-clamp:2;line-clamp:2;color:var(--text-2);font-size:13px;line-height:18px}
.link-card-where{display:flex;align-items:center;gap:4px;color:var(--text-2);font-size:12px;line-height:16px}
.link-card-host{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.link-card-where .icon{flex:none;width:12px;height:12px}
/* Several links in one message: a page is a compact row (its picture is left out), a video keeps its thumbnail. */
.link-cards.many .link-card:not(.is-video) .link-card-thumb{display:none}
.link-cards.many .link-card:not(.is-video){min-height:52px;align-items:center}
@media (max-width:760px){.link-card-thumb{width:72px;min-height:60px}.link-card-description{-webkit-line-clamp:1;line-clamp:1}}

@media (max-width:760px){.link-card-thumb{width:72px;min-height:60px}.link-card.is-video .link-card-thumb{width:96px;min-height:54px}.link-card-description{-webkit-line-clamp:1;line-clamp:1}}

/* Map card (#113 phase 8, ADR 104): a ```map block in a reply or a report. */
.map-card{margin:12px 0;max-width:560px;border:1px solid var(--stroke-soft);border-radius:14px;overflow:hidden;background:var(--code)}
.map-stage{position:relative;height:240px;max-height:none;overflow:hidden;overscroll-behavior:contain;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:pan-y pinch-zoom;cursor:grab;background:#d6d3cb;outline-offset:-3px}
.map-stage.map-awake{touch-action:none;box-shadow:inset 0 0 0 2px #5a4bd1}
.map-stage:focus-visible{outline:3px solid #5a4bd1;box-shadow:inset 0 0 0 6px #fff}
.map-layer,.map-pins,.map-lines{position:absolute;inset:0}
.map-lines{width:100%;height:100%;pointer-events:none}
.map-pins{pointer-events:none}
.map-tile{position:absolute;width:256px;height:256px;max-width:none;user-select:none;-webkit-user-drag:none;opacity:0;transition:opacity .18s}
.map-tile.ready{opacity:1}
.map-layer{background:#d6d3cb}
:root[data-theme=dark] .map-layer{filter:brightness(.82) contrast(1.05)}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .map-layer{filter:brightness(.82) contrast(1.05)}}
.map-tile.missing{background:#d9d5ca}
.map-route{fill:none;stroke:#5a4bd1;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;opacity:.9}
.map-pin{position:absolute;width:0;height:0;color:#5a4bd1}
.map-pin>.icon{position:absolute;left:-14px;top:-30px;width:28px;height:28px;fill:currentColor;stroke:#fff;stroke-width:1.2;filter:drop-shadow(0 1px 2px rgba(0,0,0,.4))}
.map-pin.flip .map-pin-label{left:auto;right:12px}
.map-pin.under .map-pin-label{top:6px;left:-8px;right:auto}
.map-pin.flip.under .map-pin-label{left:auto;right:-8px}
.map-directions{display:grid;place-items:center;text-decoration:none}
.map-directions .icon{width:22px;height:22px;fill:#5a4bd1;stroke:none}
.map-hint{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);padding:4px 12px;border-radius:999px;background:rgba(16,22,40,.85);color:#fff;font-size:13px;line-height:20px;pointer-events:none}
.map-hint[hidden]{display:none}
.map-pin-label{position:absolute;left:12px;top:-26px;max-width:180px;padding:2px 8px;border-radius:8px;background:rgba(255,255,255,.92);color:#101628;font-size:12px;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:0 1px 3px rgba(0,0,0,.3)}
.map-controls{position:absolute;right:8px;top:8px;display:grid;gap:6px}
.map-zoom{width:44px;height:44px;padding:0;border-radius:12px;background:rgba(255,255,255,.94);color:#101628;font-size:22px;line-height:1;border:1px solid rgba(16,22,40,.25);box-shadow:0 1px 4px rgba(0,0,0,.25)}
.map-zoom:hover,.map-zoom:active{background:#fff;color:#101628;filter:none}
.map-zoom:disabled{opacity:.45}
.map-status{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;margin:0;padding:6px 12px}
.map-foot{display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:0 8px;padding:2px 4px}
.map-card .map-foot a{display:inline-flex;align-items:center;min-height:36px;padding:0 8px;color:var(--text-2);font-size:12px;line-height:16px;text-decoration:underline;text-underline-offset:2px}
