/* next.i.cl.tc — the shell's styles, ported from sandbox /9/ (test.i.cl.tc/9/assets/app.css; spec §3, §4, §12).
   Class names stay /9/'s, so its suites and later ports read the same. Visual base: the Astra studies (/5/–/7/). */

:root {
  --ink: #1c2635;
  --ink-2: #364253;
  --muted: #5b687a;
  --faint: #f2f4f7;
  --surface: #fff;
  --ground: #f6f7f9;
  --line: #e1e6ec;
  --line-strong: #c2cbd7;
  --positive: oklch(50% 0.11 156);
  --warning: oklch(52% 0.12 66);
  --danger: oklch(51% 0.17 27);
  --radius: 8px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --rail: 72px;
  --panel: 244px;
  --top: 64px;
  --crumbs: 52px;
  --font: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;   /* D5: the system stack until a production face is chosen */
  --shadow-pop: 0 1px 2px rgb(20 30 48 / .06), 0 12px 32px rgb(20 30 48 / .14);
  --shadow-sheet: 0 0 0 1px rgb(20 30 48 / .06), 0 24px 64px rgb(20 30 48 / .2);
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--line-strong) transparent;
}

/* Room colour system: every room carries the same six roles in its own hue (spec §3). Anything that belongs
   to another room (a flyout, a "Back to …", a search result) sets data-room locally and takes that room's. */
[data-room='home']    { --room: oklch(30% 0.03 258); --room-ink: oklch(27% 0.03 258); --room-muted: oklch(47% 0.025 258); --room-wash: oklch(97.6% 0.004 258); --room-soft: oklch(94.2% 0.008 258); --room-line: oklch(89% 0.012 258); }
[data-room='sell']    { --room: oklch(49% 0.17 266); --room-ink: oklch(40% 0.15 266); --room-muted: oklch(49% 0.05 266); --room-wash: oklch(97.4% 0.013 266); --room-soft: oklch(94% 0.03 266); --room-line: oklch(88.5% 0.045 266); }
[data-room='make']    { --room: oklch(48% 0.16 350); --room-ink: oklch(40% 0.14 350); --room-muted: oklch(49% 0.05 350); --room-wash: oklch(97.4% 0.011 350); --room-soft: oklch(94% 0.027 350); --room-line: oklch(88.5% 0.04 350); }
[data-room='ship']    { --room: oklch(49% 0.1 222); --room-ink: oklch(40% 0.085 222); --room-muted: oklch(48% 0.04 222); --room-wash: oklch(97.4% 0.012 222); --room-soft: oklch(94% 0.026 222); --room-line: oklch(88.5% 0.038 222); }
[data-room='money']   { --room: oklch(47% 0.105 158); --room-ink: oklch(39% 0.09 158); --room-muted: oklch(47% 0.04 158); --room-wash: oklch(97.4% 0.013 158); --room-soft: oklch(94% 0.028 158); --room-line: oklch(88.5% 0.04 158); }
[data-room='catalog'] { --room: oklch(48% 0.06 62); --room-ink: oklch(39% 0.05 62); --room-muted: oklch(49% 0.03 62); --room-wash: oklch(97.4% 0.008 62); --room-soft: oklch(94% 0.018 62); --room-line: oklch(88.5% 0.026 62); }
[data-room='company'] { --room: oklch(45% 0.045 252); --room-ink: oklch(37% 0.04 252); --room-muted: oklch(48% 0.025 252); --room-wash: oklch(97.4% 0.006 252); --room-soft: oklch(94% 0.014 252); --room-line: oklch(88.5% 0.02 252); }

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--crumbs) + 16px); }
body { margin: 0; min-height: 100vh; background: var(--ground); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
svg.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
::selection { background: var(--room-soft); color: var(--room-ink); }
input { caret-color: var(--room); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--room); outline-offset: 2px; border-radius: 6px; }
kbd { white-space: nowrap; font: 500 11px/1 var(--font); color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 3px 5px; background: var(--surface); }

/* ---------- frame grid: A (rooms rail beside the room's menu) or C (rooms on top), a personal setting ---------- */
.app { display: grid; min-height: 100vh; }
body[data-frame='a'] .app { grid-template-columns: calc(var(--rail) + var(--panel)) minmax(0, 1fr); transition: grid-template-columns .28s var(--ease); }
body[data-frame='a'].menu-hidden .app { grid-template-columns: var(--rail) minmax(0, 1fr); }
body[data-frame='c'] .app { grid-template-columns: var(--panel) minmax(0, 1fr); grid-template-rows: var(--top) minmax(0, 1fr); transition: grid-template-columns .28s var(--ease); }
body[data-frame='c'].menu-hidden .app { grid-template-columns: 0 minmax(0, 1fr); }
body[data-frame='c'].menu-hidden .sidebar { border-right: 0; }

.topbar { display: none; }
body[data-frame='c'] .topbar { display: flex; grid-column: 1 / -1; grid-row: 1; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
body[data-frame='a'] .main { grid-column: 2; }
body[data-frame='c'] .main { grid-column: 2; grid-row: 2; min-height: calc(100vh - var(--top)); }

/* ---------- sidebar ---------- */
.sidebar { position: sticky; top: 0; height: 100vh; align-self: start; display: grid; grid-template-rows: 60px minmax(0, 1fr) 54px; background: var(--surface); border-right: 1px solid var(--line); overflow: hidden; z-index: 20; }
body[data-frame='c'] .sidebar { top: var(--top); height: calc(100vh - var(--top)); grid-row: 2; grid-template-rows: 0 minmax(0, 1fr) 54px; }
.sb-head { grid-row: 1; } .sb-body { grid-row: 2; } .sb-foot { grid-row: 3; }
body[data-frame='c'] .sb-head, body[data-frame='c'] .sb-foot .me { display: none; }
.sb-head, .sb-foot { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); align-items: stretch; }
body[data-frame='c'] .sb-foot { grid-template-columns: minmax(0, 1fr); }
body[data-frame='c'] .sb-foot .sb-slot { border-left: 0; }
.sb-head > *, .sb-foot > * { min-width: 0; }
.sb-slot { display: flex; align-items: center; padding: 0 12px; background: var(--room-wash); border-left: 1px solid var(--room-line); transition: background-color .25s; }
body.at-home[data-frame='a'] .sb-slot { background: var(--surface); border-left-color: transparent; }
.sb-foot { border-top: 1px solid var(--line); }
.mark { display: grid; place-items: center; }
.mark svg { width: 30px; height: 30px; transition: transform .4s var(--ease); }
.mark:hover svg { transform: rotate(-12deg); }

.search-btn { flex: 1; display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 8px 0 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--room-line); color: var(--muted); font-size: 13.5px; transition: border-color .15s, box-shadow .15s; }
.search-btn:hover { border-color: var(--line-strong); box-shadow: 0 1px 2px rgb(20 30 48 / .06); }
.search-btn .ic { width: 16px; height: 16px; }
.search-btn kbd { margin-left: auto; }
.search-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* At Home in A the rail widens into the lobby; choosing a room folds it back (~300 ms), the one authored motion (spec §4). */
.sb-body { position: relative; min-height: 0; }
.rooms { position: absolute; top: 0; bottom: 0; left: 0; width: var(--rail); background: var(--surface); z-index: 3; padding: 6px 0; overflow: hidden; transition: width .3s var(--ease); }
body[data-frame='c'] .rooms { display: none; }
body.at-home[data-frame='a'] .rooms { width: 100%; }
.panel { position: absolute; top: 0; bottom: 0; left: var(--rail); right: 0; display: flex; flex-direction: column; background: var(--room-wash); border-left: 1px solid var(--room-line); transition: background-color .25s; }
body[data-frame='c'] .panel { left: 0; border-left: 0; }
body.at-home[data-frame='a'] .panel { visibility: hidden; }
.panel-in { animation: panelIn .32s var(--ease) both; }
@keyframes panelIn { from { opacity: .35; transform: translateX(-10px); } }

/* room tiles: compressed in a room, expanded at Home */
.tile { position: relative; display: block; width: 100%; height: 60px; color: var(--muted); }
.tile .sq { position: absolute; left: 18px; top: 6px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; transition: background-color .2s, color .2s, top .3s var(--ease); }
.tile .sq .ic { width: 19px; height: 19px; }
.tile .lbl { position: absolute; left: 0; width: var(--rail); top: 44px; padding: 0 2px; text-align: center; font-size: 10.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .18s .1s; }
.tile .nm { position: absolute; left: 68px; top: 20px; opacity: 0; pointer-events: none; white-space: nowrap; font-size: 14.5px; font-weight: 600; color: var(--ink); transition: opacity .12s; }
.tile:hover .sq { background: var(--room-soft); color: var(--room); }
.tile:hover .lbl { color: var(--room-ink); }
.tile[aria-current='page'] .sq { background: var(--room); color: #fff; box-shadow: 0 1px 2px rgb(20 30 48 / .12); }
.tile[aria-current='page'] .lbl { color: var(--room-ink); }
.rooms .sep { height: 1px; background: var(--line); margin: 6px 22px; transition: margin .3s var(--ease); }
body.at-home[data-frame='a'] .tile .sq { top: 12px; background: var(--room); color: #fff; }
body.at-home[data-frame='a'] .tile .lbl { opacity: 0; transition-delay: 0s; }
body.at-home[data-frame='a'] .tile .nm { opacity: 1; transition: opacity .2s .12s; }
body.at-home[data-frame='a'] .tile:hover, body.at-home[data-frame='a'] .tile[aria-current='page'] { background: var(--faint); }
body.at-home[data-frame='a'] .rooms .sep { margin: 6px 18px; }

/* the room's menu */
.room-head { display: flex; align-items: center; gap: 11px; padding: 16px 16px 10px; }
.room-head .chip { width: 34px; height: 34px; border-radius: 9px; background: var(--room); color: #fff; display: grid; place-items: center; flex: none; transition: background-color .25s; }
.room-head h2 { font-size: 17px; font-weight: 650; letter-spacing: -.015em; line-height: 1.2; }
.menu { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 8px 10px; scrollbar-width: thin; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background-color .12s; }
.mi .ic { width: 17px; height: 17px; color: var(--room-muted); }
.mi > span { overflow: hidden; text-overflow: ellipsis; }
.mi:hover { background: var(--room-soft); }
.mi[aria-current='page'] { background: var(--surface); color: var(--room-ink); font-weight: 600; box-shadow: 0 0 0 1px var(--room-line), 0 1px 2px rgb(20 30 48 / .06); }
.mi[aria-current='page'] .ic { color: var(--room); }
.mi-group { font-size: 11.5px; font-weight: 600; color: var(--room-muted); padding: 12px 10px 4px; letter-spacing: .01em; }
.panel-settings { padding: 6px 8px; border-top: 1px solid var(--room-line); flex: none; }

.sb-foot .me { display: grid; place-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: oklch(93% 0.02 258); color: var(--ink-2); font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
button.avatar { cursor: pointer; transition: box-shadow .12s; }
button.avatar:hover, button.avatar[aria-expanded='true'] { box-shadow: 0 0 0 3px var(--room-soft); }
.hide-btn { display: flex; align-items: center; gap: 9px; width: 100%; height: 36px; padding: 0 10px; border-radius: 8px; color: var(--room-muted); font-size: 13px; font-weight: 500; }
.hide-btn:hover { background: var(--room-soft); color: var(--room-ink); }
.hide-btn kbd { margin-left: auto; }
.hide-btn .ic { width: 16px; height: 16px; }
.hide-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.at-home[data-frame='a'] .hide-btn { visibility: hidden; }
.rail-extra { display: none; }
body[data-frame='a'].menu-hidden .rail-extra { display: grid; }
body[data-frame='a'].menu-hidden .sb-slot, body[data-frame='a'].menu-hidden .panel { visibility: hidden; }
.rail-btn { width: 40px; height: 40px; margin: 0 auto; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.rail-btn:hover { background: var(--faint); color: var(--ink); }
.rail-tools { position: absolute; left: 0; bottom: 8px; width: var(--rail); gap: 6px; z-index: 4; }
body.at-home[data-frame='a'] .rail-tools { display: none; }

/* ---------- top bar (C) ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); align-items: center; gap: 18px; padding: 0 18px 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16.5px; font-weight: 650; letter-spacing: -.02em; flex: none; }
.brand svg { width: 28px; height: 28px; }
.rooms-top { display: flex; align-items: center; gap: 4px; min-width: 0; }
.rt { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 13px 0 11px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 550; white-space: nowrap; transition: background-color .15s, color .15s; }
.rt .ic { width: 18px; height: 18px; color: var(--room-muted); transition: color .15s; }
.rt .chev { width: 14px; height: 14px; margin-left: -3px; color: var(--room-muted); }
.rt:hover { background: var(--room-wash); color: var(--room-ink); }
.rt:hover .ic { color: var(--room); }
.rt[aria-current='page'] { background: var(--room); color: #fff; box-shadow: 0 1px 2px rgb(20 30 48 / .14); }
.rt[aria-current='page'] .ic, .rt[aria-current='page'] .chev { color: #fff; }
.rt[aria-expanded='true']:not([aria-current='page']) { background: var(--room-wash); color: var(--room-ink); }
.rt.quiet { font-size: 13.5px; }
.rooms-top .sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; flex: none; }
.top-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.topbar .search-btn { width: 260px; flex: none; border-color: var(--line); background: var(--ground); }

/* ---------- breadcrumbs: Room › Page ▾, "Back to …", the room's settings ---------- */
.crumbs { position: sticky; top: 0; z-index: 15; height: var(--crumbs); display: flex; align-items: center; gap: 12px; padding: 0 20px 0 22px; background: rgb(255 255 255 / .9); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
body[data-frame='c'] .crumbs { top: var(--top); }
.trail { display: flex; align-items: center; gap: 1px; min-width: 0; font-size: 13.5px; }
.cr { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border-radius: 7px; color: var(--muted); font-weight: 500; white-space: nowrap; min-width: 0; }
.cr > span { overflow: hidden; text-overflow: ellipsis; }
.cr .ic { width: 16px; height: 16px; }
.cr:hover { background: var(--faint); color: var(--ink); }
.cr.room { color: var(--room-ink); font-weight: 600; }
.cr.room .ic { color: var(--room); }
.cr.cur, .cr.cur:hover { color: var(--ink); font-weight: 600; background: none; }
.trail > .ic { width: 14px; height: 14px; color: var(--line-strong); flex: none; }
.crg { display: inline-flex; align-items: center; min-width: 0; }
.cr-dd { width: 22px; height: 30px; margin-left: -6px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); flex: none; }
.cr-dd .ic { width: 14px; height: 14px; }
.cr-dd:hover, .cr-dd[aria-expanded='true'] { background: var(--faint); color: var(--ink); }
.crumb-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.return { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px 0 8px; border-radius: 7px; font-size: 13px; font-weight: 550; color: var(--room-ink); background: var(--room-wash); box-shadow: inset 0 0 0 1px var(--room-line); margin-right: 6px; max-width: 280px; }
.return span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.return .ic { width: 15px; height: 15px; }
.return:hover { background: var(--room-soft); }
.tool { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); flex: none; }
.tool .ic { width: 17px; height: 17px; }
.tool:hover { background: var(--faint); color: var(--ink); }

/* ---------- pages ---------- */
.page { width: 100%; max-width: 1480px; padding: 26px 30px 72px; }
.page.enter { animation: pageIn .2s var(--ease) both; }
@keyframes pageIn { from { opacity: .55; transform: translateY(3px); } }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 27px; font-weight: 650; letter-spacing: -.022em; line-height: 1.18; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.stub { display: grid; justify-items: start; gap: 10px; padding: 28px 28px 30px; max-width: 760px; }
.stub .chip { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--room-soft); color: var(--room); }
.stub p { color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 62ch; margin-top: 4px; text-wrap: balance; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 550; white-space: nowrap; transition: background-color .12s, border-color .12s, box-shadow .12s, transform .08s; }
.btn .ic { width: 16px; height: 16px; }
.btn:hover { border-color: var(--line-strong); background: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--room); border-color: var(--room); color: #fff; box-shadow: 0 1px 2px rgb(20 30 48 / .14); }
.btn.primary:hover { background: var(--room-ink); border-color: var(--room-ink); }
.stub .btn { margin-top: 6px; }

/* ---------- popovers: room flyouts (A), pull-downs (C), breadcrumb menus, your menu ---------- */
.pop { position: fixed; z-index: 60; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-pop), 0 0 0 1px rgb(20 30 48 / .07); padding: 6px; min-width: 220px; max-height: calc(100vh - 24px); overflow-y: auto; animation: popIn .14s var(--ease) both; scrollbar-width: thin; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
.pop.instant { animation: none; }
.pop .cap { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.pop .cap .sq { width: 30px; height: 30px; border-radius: 8px; background: var(--room); color: #fff; display: grid; place-items: center; flex: none; }
.pop .cap .sq .ic { width: 16px; height: 16px; }
.pop .cap b { display: block; font-size: 14px; font-weight: 650; }
.pop .cap .avatar { width: 28px; height: 28px; font-size: 10.5px; }
.pop .grp { font-size: 11.5px; font-weight: 600; color: var(--room-muted); padding: 10px 10px 4px; }
.pop .sepl { height: 1px; background: var(--line); margin: 6px 4px; }
.pop .mi { height: 32px; font-size: 13.5px; }
.pop .mi:hover, .pop .mi:focus-visible { background: var(--room-wash); }
.pop .mi kbd { margin-left: auto; }
.pop .mi.opt .ic { color: var(--room); }
.pop .mi.opt .sp { width: 17px; flex: none; }
.pop .mi.opt[aria-checked='true'] { color: var(--ink); font-weight: 600; }
.pop.mega { padding: 0; overflow: hidden; }
.pop.mega .mega-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: var(--room-wash); border-bottom: 1px solid var(--room-line); }
.pop.mega .mega-head .sq { width: 28px; height: 28px; border-radius: 8px; background: var(--room); color: #fff; display: grid; place-items: center; flex: none; }
.pop.mega .mega-head .sq .ic { width: 15px; height: 15px; }
.pop.mega .mega-head b { font-size: 14px; font-weight: 650; }
.pop.mega .mega-head .mi { width: auto; height: 30px; margin-left: auto; font-size: 13px; color: var(--room-ink); }
.pop.mega .mega-head .mi:hover { background: var(--room-soft); }
.pop.mega .mega-body { padding: 6px 8px 8px; }
.pop.mega .cols2 { columns: 2; column-gap: 10px; }
.pop.mega .blk { break-inside: avoid; padding-bottom: 4px; }

/* ---------- search: one index (spec §8) ---------- */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgb(18 26 40 / .22); animation: fade .15s ease both; }
@keyframes fade { from { opacity: 0; } }
.palette { position: fixed; z-index: 90; left: 50%; top: 11vh; width: min(700px, calc(100vw - 32px)); transform: translateX(-50%); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-sheet); overflow: hidden; animation: palIn .16s var(--ease) both; }
@keyframes palIn { from { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(.985); } }
.pal-in { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.pal-in .ic { width: 19px; height: 19px; color: var(--muted); }
.pal-in input { flex: 1; border: 0; outline: 0; font-size: 16px; height: 100%; background: transparent; color: var(--ink); min-width: 0; }
.pal-in input::placeholder { color: var(--muted); }
.pal-res { max-height: min(62vh, 560px); overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.pal-grp { font-size: 11.5px; font-weight: 650; color: var(--muted); padding: 10px 10px 5px; letter-spacing: .01em; }
.pal-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 6px 10px; border-radius: 9px; text-align: left; }
.pal-item .sq { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--room-soft); color: var(--room); }
.pal-item .sq .ic { width: 14px; height: 14px; }
.pal-item .t { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item .t mark { background: none; color: var(--room-ink); font-weight: 650; }
.pal-item .where { font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.pal-item .where .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--room); }
.pal-item[aria-selected='true'] { background: var(--room-wash); box-shadow: inset 0 0 0 1px var(--room-line); }
.pal-item[aria-selected='true'] .t { color: var(--room-ink); }
.pal-foot { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--ground); }
.pal-foot span { display: inline-flex; align-items: center; gap: 6px; }
.pal-empty { padding: 26px 18px 30px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.pal-empty b { color: var(--ink); }

/* ---------- settings drawer: each room's own, opened in place (spec §9) ---------- */
.drawer { position: fixed; z-index: 85; top: 0; right: 0; bottom: 0; width: min(440px, calc(100vw - 40px)); background: var(--surface); box-shadow: var(--shadow-sheet); display: grid; grid-template-rows: auto minmax(0, 1fr); animation: drIn .26s var(--ease) both; }
.drawer.out { animation: drOut .2s ease-in both; }
@keyframes drIn { from { transform: translateX(40px); opacity: 0; } }
@keyframes drOut { to { transform: translateX(40px); opacity: 0; } }
.dr-head { display: flex; align-items: center; gap: 14px; padding: 18px 16px 16px 22px; background: var(--room-wash); border-bottom: 1px solid var(--room-line); }
.dr-head .chip { width: 40px; height: 40px; border-radius: 11px; background: var(--room); color: #fff; display: grid; place-items: center; flex: none; }
.dr-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -.015em; }
.dr-head p { font-size: 13px; color: var(--room-muted); margin-top: 2px; line-height: 1.45; }
.dr-head .tool { margin-left: auto; align-self: flex-start; }
.dr-list { overflow-y: auto; padding: 10px 12px 24px; scrollbar-width: thin; }
.dr-list .mi { height: 40px; }
.dr-list .mi .ic { margin-left: auto; width: 15px; height: 15px; }
.dr-list .mi:hover { background: var(--room-wash); }
.dr-list .mi.flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0%, 35% { background: var(--room-soft); } 100% { background: transparent; } }

/* ---------- the one message line (errors from the API; Undo messages later) ---------- */
.toast { position: fixed; z-index: 95; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100vw - 32px)); padding: 11px 18px 11px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13.5px; line-height: 1.45; box-shadow: var(--shadow-sheet); animation: toastIn .22s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: oklch(70% 0.17 27); flex: none; }   /* a state is a dot plus words */

@media (max-width: 1360px) {   /* C's top bar stays on one line on laptops */
  .rt { padding: 0 9px; gap: 6px; }
  .rt.quiet span { display: none; }
  .topbar .search-btn span { display: none; }
  .topbar .search-btn { width: auto; }
}

.preload *, .preload *::before, .preload *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- sign-in (login.html): one card on the ground, Home's graphite ---------- */
body.signin { display: grid; place-items: center; padding: 24px 16px; }
.si { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.si-card { display: grid; gap: 6px; padding: 30px 32px 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgb(20 30 48 / .04), 0 16px 40px rgb(20 30 48 / .07); }
.si-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); margin-bottom: 20px; }
.si-brand svg { width: 28px; height: 28px; }
.si-card h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin-bottom: 12px; }
.si-card label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 8px; }
.si-card input:not([type='hidden']) { height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font: 400 14.5px/1 var(--font); color: var(--ink); caret-color: var(--room); transition: border-color .15s, box-shadow .15s; }
.si-card input:not([type='hidden']):hover { border-color: oklch(70% 0.02 258); }
.si-card input:focus-visible { outline: none; border-color: var(--room); box-shadow: 0 0 0 3px var(--room-soft); border-radius: var(--radius); }
.si-card .btn.primary { justify-content: center; height: 40px; margin-top: 20px; font: 600 14.5px/1 var(--font); cursor: pointer; }
.si-error { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--danger); font-size: 13.5px; font-weight: 550; }
.si-error::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }   /* a state is a dot plus words */
.si-old { text-align: center; font-size: 13px; color: var(--muted); }
.si-old a { color: var(--ink-2); font-weight: 600; }
.si-old a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
