/* ==========================================================================
   Placeholder — layout + components.
   Depth model: layered translucent surfaces + a .5px hairline ring.
   No hard 1px borders anywhere in chrome. Glass only on floating chrome.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--border); }
/* #root must carry the height or .app's height:100% never resolves, the view
   stops being a scroll container, and content below the fold is unreachable. */
html, body, #root { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans); font-size: 14px; line-height: 1.4286;
  color: var(--foreground); background: var(--background);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; background: none; }
button { cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.icon { width: 16px; height: 16px; flex-shrink: 0; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-fg-3); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }

/* Ambient field: the landing screen only, and only inside the content column.
   Everything around the floating sidebar stays the plain white page. */
.main::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-slow) var(--ease-out);
  background:
    radial-gradient(680px 420px at 6% -6%, oklch(68.5% .169 237.323/.10), transparent 62%),
    radial-gradient(560px 380px at 92% 4%, oklch(60.6% .25 292.717/.07), transparent 60%),
    radial-gradient(720px 520px at 60% 108%, oklch(69.6% .17 162.48/.05), transparent 60%);
}
body.landing .main::before { opacity: 1; }
.dark body.landing .main::before { opacity: .5; }

/* ---------- app frame ---------- */
.app { position: relative; z-index: 1; display: flex; height: 100%; }

/* ---------- sidebar: floating rounded panel, inset on all four sides ---------- */
.rail {
  width: var(--rail-w); flex-shrink: 0; display: flex; flex-direction: column;
  margin: var(--rail-inset) 0 var(--rail-inset) var(--rail-inset);
  border-radius: var(--rail-radius);
  background: var(--sidebar-glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.35); backdrop-filter: blur(20px) saturate(1.35);
  box-shadow:
    0 0 0 .5px oklch(14.5% 0 0/.07),
    inset 0 1px 0 oklch(100% 0 0/.55),
    0 1px 2px oklch(14.5% 0 0/.04),
    0 14px 30px -14px oklch(14.5% 0 0/.18);
  transition: width var(--dur-slow) var(--ease-in-out);
  overflow: hidden;
}
.dark .rail {
  box-shadow:
    0 0 0 .5px oklch(98.5% 0 0/.08),
    inset 0 1px 0 oklch(100% 0 0/.06),
    0 16px 32px -14px oklch(0% 0 0/.55);
}
.rail.collapsed { width: var(--rail-w-collapsed); }
/* collapse fades and folds rather than popping */
/* Collapsing must take the labels OUT of layout. With opacity alone they keep
   their width, so centring the row centres [icon + invisible label] and shoves
   every icon left by a different amount depending on its label length. */
.rail .lbl, .rail .rail-foot-meta, .rail .wordmark {
  transition: opacity 150ms var(--ease-out), max-width var(--dur-slow) var(--ease-in-out);
  max-width: 200px; overflow: hidden; white-space: nowrap;
}
.rail .rail-group { max-height: 760px; opacity: 1; overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease-in-out), opacity 200ms var(--ease-out) 60ms, margin var(--dur-slow) var(--ease-in-out); }
.rail.collapsed .lbl, .rail.collapsed .rail-foot-meta, .rail.collapsed .wordmark { opacity: 0; max-width: 0; pointer-events: none; }
.rail.collapsed .rail-group { max-height: 0; opacity: 0; margin-top: 0; }
.rail.collapsed .rail-item { justify-content: center; padding: 0; gap: 0; }
.rail.collapsed .pfp-btn { justify-content: center; padding: 6px 0; gap: 0; }
.rail.collapsed .rail-head { padding: 0 8px; justify-content: center; }
.rail.collapsed .rail-sep { margin: 8px 6px; }

.rail-head { display: flex; align-items: center; gap: 8px; height: var(--header-h); padding: 0 10px 0 14px; flex-shrink: 0; }
/* .16em tracking suits a 5-letter wordmark; on a longer one it reads spaced out */
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; letter-spacing: -.005em; flex: 1; }
.wordmark b { font-weight: 700; }

.rail-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 8px 8px; }
.rail-item {
  position: relative;
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px;
  padding: 0 10px; border-radius: 10px; color: var(--surface-fg-1);
  font-size: 13.5px; font-weight: 450; text-align: left;
  transition: background var(--dur-fast) var(--ease-out);
}
.rail-item .icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--surface-fg-2); }
.rail-item:hover { background: var(--muted); }
/* selected destination: filled row, solid glyph, and a marker line at the left.
   Same treatment expanded and collapsed. */
.rail-item[aria-current="page"] { background: var(--nav-selected); color: var(--foreground); font-weight: 550; }
.rail-item[aria-current="page"] .icon { color: var(--nav-marker); }
.rail-item[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 2.5px; height: 24px; border-radius: 2px; background: var(--nav-marker);
}
.rail.collapsed .rail-item[aria-current="page"]::before { height: 22px; }
/* New chat is a navy pill in its default state, everywhere it appears — a real
   pill, fully rounded, not a rounded rectangle */
.rail-item[data-act="new-chat"] { background: var(--navy); color: var(--navy-fg); font-weight: 500; border-radius: 999px; }
.rail.collapsed .rail-item[data-act="new-chat"] { border-radius: 999px; }
.rail-item[data-act="new-chat"] .icon { color: var(--navy-fg); }
.rail-item[data-act="new-chat"]:hover { background: var(--navy-hover); }
.rail-item .cnt { margin-left: auto; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--surface-fg-3); }

.rail-sep { height: 1px; margin: 8px 10px; background: var(--border); opacity: .7; }
.rail-group { margin-top: 10px; }
/* Favorites / Projects / Chats are real headings: same ink as the rows they
   label, and bold. The date buckets underneath stay grey and light. */
.rail-group > h4 {
  margin: 0 0 5px; padding: 0 8px 0 10px; font-size: 12.5px; font-weight: 600;
  letter-spacing: 0; color: var(--surface-fg-1);
  display: flex; align-items: center; gap: 6px; min-height: 24px;
}
.rail-group > h4 .icon { width: 13px; height: 13px; }
.icon.gold { color: var(--gold); fill: currentColor; }
.icon.fill { fill: currentColor; }
.icon.solid { fill: currentColor; stroke: none; }

/* a chevron beside the group name collapses the group; expanded by default */
.grp-chev {
  width: 18px; height: 18px; margin-left: 2px; display: grid; place-items: center;
  border-radius: 6px; color: var(--surface-fg-2); flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.grp-chev:hover { background: var(--accent); color: var(--foreground); }
.rail-group > h4 .grp-chev .icon { width: 13px; height: 13px; }
.rail-group.collapsed .grp-chev { transform: rotate(-90deg); }
.rail-group.collapsed .grp-body { display: none; }
.rail-group.collapsed > h4 { margin-bottom: 0; }

/* group header actions: revealed on hover, like the row ⋯ */
.ghead-acts { margin-left: auto; display: flex; align-items: center; gap: 1px; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.rail-group:hover > h4 .ghead-acts, .rail-group > h4 .ghead-acts:focus-within { opacity: 1; }
.ghead-act { position: relative; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: var(--surface-fg-2); }
.ghead-act:hover { background: var(--accent); color: var(--foreground); }
.rail-group > h4 .ghead-act .icon { width: 14px; height: 14px; }

/* lightweight tooltip */
[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%;
  transform: translateX(-50%); padding: 5px 9px; border-radius: 8px;
  background: oklch(14.5% 0 0/.92); color: oklch(98.5% 0 0); font-size: 11.5px;
  font-weight: 450; line-height: 1; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); z-index: 60;
}
[data-tip]:hover::after { opacity: 1; }

/* chat status: blue = Workbench finished, hollow = seen, blinking = running */
.cdot { width: 15px; height: 15px; display: grid; place-items: center; flex-shrink: 0; }
.cdot::before { content: ""; display: block; width: 7px; height: 7px; border-radius: 50%; }
.cdot.done::before { background: var(--brand); }
.cdot.seen::before { box-shadow: inset 0 0 0 1.5px var(--surface-fg-3); }
.cdot.active::before { background: var(--surface-fg-2); animation: cdot-blink 1.25s var(--ease-in-out) infinite; }
@keyframes cdot-blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .18; transform: scale(.72); } }
@media (prefers-reduced-motion: reduce) { .cdot.active::before { animation: none; opacity: .55; } }

/* a selected project discloses its chats underneath */
.proj-kids { margin: 1px 0 7px; }
.chat-row.kid { padding-left: 26px; }
.showmore.kid { padding-left: 26px; }
.more.always { opacity: 1; }
.rail-subgroup { margin-top: 8px; }
.rail-subgroup:first-of-type { margin-top: 0; }
.rail-subgroup > h5 {
  margin: 0 0 3px; padding: 0 10px; font-size: 11.5px; font-weight: 500;
  letter-spacing: 0; color: var(--surface-fg-1);
}
.chat-row { display: flex; align-items: center; gap: 8px; width: 100%; height: 31px; padding: 0 8px 0 10px; border-radius: 9px; text-align: left; color: var(--surface-fg-1); font-size: 13px; }
.chat-row:hover { background: var(--muted); }
.chat-row[aria-current="page"] { background: var(--secondary); }
/* row lead icons read as content, not placeholder text */
.chat-row .icon.lead { width: 15px; height: 15px; color: var(--surface-fg-2); }
.chat-row[aria-current="page"] .icon.lead { color: var(--brand-content); }
/* favorite rows are text only: the group header already says they are favorites */
.chat-row.fav-row { padding-left: 10px; }
.chat-row .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .more { opacity: 0; width: 22px; height: 22px; display: grid; place-items: center; border-radius: var(--r-sm); flex-shrink: 0; color: var(--surface-fg-2); }
.chat-row:hover .more, .chat-row .more:focus-visible { opacity: 1; }
.chat-row .more:hover { background: var(--accent); }
/* project tag removed from sidebar chat rows — rule kept for reuse elsewhere */
.chat-row .proj { font-size: 10.5px; color: var(--surface-fg-3); flex-shrink: 0; }
.showmore { display: block; width: 100%; padding: 5px 10px; text-align: left; font-size: 12.5px; color: var(--surface-fg-2); border-radius: 9px; }
.showmore:hover { background: var(--muted); color: var(--foreground); }

.rail-foot { flex-shrink: 0; padding: 8px; }
.pfp-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border-radius: var(--r-lg); text-align: left; }
.pfp-btn:hover { background: var(--muted); }
.rail-foot-meta { min-width: 0; display: block; }
.rail-foot-meta .n { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot-meta .e { display: block; font-size: 11px; color: var(--surface-fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.av {
  width: 26px; height: 26px; border-radius: var(--r-full); flex-shrink: 0;
  display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff;
  background: linear-gradient(150deg, var(--sky-400), var(--violet-500));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px rgba(0,0,0,.18);
}
.av.lg { width: 34px; height: 34px; font-size: 13px; }

/* ---------- notifications: right-hand pane, slides in ---------- */
/* a tile that rides in from the right over the app, not a column that pushes it */
.npane {
  position: fixed; z-index: 55; top: var(--rail-inset); right: var(--rail-inset);
  bottom: var(--rail-inset); width: 352px; max-width: calc(100vw - 32px);
  border-radius: var(--rail-radius); overflow: hidden;
  background: var(--sidebar-glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.35); backdrop-filter: blur(20px) saturate(1.35);
  box-shadow:
    0 0 0 .5px oklch(14.5% 0 0/.07),
    inset 0 1px 0 oklch(100% 0 0/.55),
    0 24px 60px -24px oklch(14.5% 0 0/.35);
  transform: translateX(calc(100% + var(--rail-inset) + 12px));
  opacity: 0; pointer-events: none;
  transition: transform var(--dur-slow) var(--ease-in-out), opacity 180ms var(--ease-out);
}
.dark .npane {
  box-shadow:
    0 0 0 .5px oklch(98.5% 0 0/.08),
    inset 0 1px 0 oklch(100% 0 0/.06),
    0 24px 60px -24px oklch(0% 0 0/.6);
}
.npane.open { transform: none; opacity: 1; pointer-events: auto; }
.npane-inner { width: 100%; height: 100%; display: flex; flex-direction: column; }
/* click anywhere else to dismiss */
.npane-scrim { position: fixed; inset: 0; z-index: 54; }
@media (prefers-reduced-motion: reduce) { .npane { transition: opacity 120ms linear; } }
.npane-head { display: flex; align-items: center; gap: 6px; padding: 0 8px 0 16px; height: var(--header-h); flex-shrink: 0; box-shadow: inset 0 -1px 0 oklch(14.5% 0 0/.05); }
.dark .npane-head { box-shadow: inset 0 -1px 0 oklch(98.5% 0 0/.05); }
.npane-head h3 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; }
.npane-scroll { flex: 1; overflow-y: auto; padding: 8px; }
.notif {
  display: flex; gap: 10px; padding: 9px 10px; border-radius: var(--r-lg);
  text-align: left; width: 100%; align-items: flex-start;
}
.notif:hover { background: var(--muted); }
.notif .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--brand); margin-top: 6px; flex-shrink: 0; }
.notif .dot.read { background: var(--surface-fg-3); }
.notif .nb { min-width: 0; }
.notif .nt { font-size: 13px; font-weight: 500; }
.notif .nd { font-size: 12px; color: var(--surface-fg-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif .na { font-size: 11px; color: var(--surface-fg-3); margin-top: 2px; }

/* ---------- main column ---------- */
.main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }

.masthead {
  display: flex; align-items: center; gap: 10px; height: var(--header-h); padding: 0 12px 0 16px; flex-shrink: 0;
  background: var(--masthead-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  position: relative; z-index: 30;
}
/* a blurred tile that fades out, instead of a hard rule under the masthead */
.masthead::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 24px;
  pointer-events: none;
  -webkit-backdrop-filter: blur(11px) saturate(1.2); backdrop-filter: blur(11px) saturate(1.2);
  background: linear-gradient(to bottom, var(--masthead-glass), transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}

/* chat pages carry the chat title and its menu, not a breadcrumb */
.mast-title {
  display: inline-flex; align-items: center; gap: 5px; max-width: 460px;
  height: 30px; padding: 0 8px; border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 550; color: var(--foreground);
}
.mast-title .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mast-title .icon { width: 15px; height: 15px; color: var(--surface-fg-2); }
.mast-title:hover, .mast-title[aria-expanded="true"] { background: var(--muted); }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--surface-fg-2); min-width: 0; }
.crumb a:hover { color: var(--foreground); }
.crumb .sep { color: var(--surface-fg-3); }
.crumb .cur { color: var(--foreground); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mast-spacer { flex: 1; }
.mast-actions { display: flex; align-items: center; gap: 2px; }

.iconbtn {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-md);
  color: var(--surface-fg-2); position: relative; flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.iconbtn:hover { background: var(--muted); color: var(--foreground); }
.iconbtn[aria-expanded="true"] { background: var(--secondary); color: var(--foreground); }
.iconbtn .icon { width: 17px; height: 17px; }
.iconbtn .badge {
  position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 99px; background: var(--destructive); color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center;
  box-shadow: 0 0 0 2px var(--background);
}

.view { flex: 1; overflow-y: auto; position: relative; }
.pad { max-width: 1180px; margin: 0 auto; padding: 26px 28px 64px; }
.pad.narrow { max-width: 880px; }

/* ---------- typography ---------- */
h1.pt { margin: 0 0 3px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
p.psub { margin: 0 0 20px; font-size: 13.5px; color: var(--surface-fg-2); }
/* when the page title is dropped as a duplicate, the subtitle leads the page */
p.psub.lead { margin: 2px 0 20px; font-size: 14.5px; color: var(--surface-fg-1); }
p.psub b { font-weight: 550; color: var(--foreground); }
/* section headings are bigger everywhere, not just on the landing */
h2.sec { margin: 28px 0 12px; font-size: 16px; font-weight: 600; letter-spacing: -.005em; color: var(--blue-accent); }
.mono { font-family: var(--font-mono); font-size: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 13px; border-radius: var(--r-md); font-size: 13px; font-weight: 500;
  color: var(--surface-fg-1); background: var(--surface-primary);
  box-shadow: var(--ring-surface), var(--shadow-xs);
  transition: background var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.btn:hover { background: var(--muted); }
.btn:active { transform: translateY(.5px); }
.btn .icon { width: 15px; height: 15px; }
.btn.primary { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.btn.primary:hover { opacity: .9; background: var(--primary); }
.btn.primary[data-act="new-chat"] { background: var(--navy); color: var(--navy-fg); border-radius: 999px; }
.btn.primary[data-act="new-chat"]:hover { background: var(--navy-hover); opacity: 1; }
.btn.ghost { background: none; box-shadow: none; }
.btn.ghost:hover { background: var(--muted); }
.btn.danger { color: var(--destructive); }
.btn.sm { height: 27px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface-secondary); border-radius: var(--card-radius);
  box-shadow: var(--ring-surface), var(--shadow-sm); padding: 16px;
  transition: box-shadow var(--dur), transform var(--dur);
}
a.card:hover, button.card:hover { box-shadow: var(--ring-surface), var(--shadow-lg); transform: translateY(-1px); }
.card h3 { margin: 0 0 3px; font-size: 14px; font-weight: 600; }
.card p { margin: 0; font-size: 12.5px; color: var(--surface-fg-2); }
.grid { display: grid; gap: 12px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1040px) { .grid.c4 { grid-template-columns: repeat(2,minmax(0,1fr)); } .grid.c3 { grid-template-columns: repeat(2,minmax(0,1fr)); } }

.panel { background: var(--surface-secondary); border-radius: var(--r-lg); box-shadow: var(--ring-surface); overflow: hidden; }
.panel .prow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; box-shadow: inset 0 -1px 0 var(--border); }
.panel .prow:last-child { box-shadow: none; }
.panel .prow:hover { background: var(--muted); }
/* a leading row icon is metadata: it should never outweigh the row's title */
.panel .prow > .icon { color: var(--surface-fg-2); }
.panel .prow .rmeta { font-size: 12px; color: var(--surface-fg-2); white-space: nowrap; }
.panel a.prow { color: inherit; }
.panel a.prow .nm { font-weight: 500; }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-lg); background: var(--muted); margin-bottom: 18px; }
.tab { height: 28px; padding: 0 13px; border-radius: var(--r-md); font-size: 13px; font-weight: 500; color: var(--surface-fg-2); }
.tab:hover { color: var(--foreground); }
.tab[aria-selected="true"] { background: var(--surface-primary); color: var(--foreground); box-shadow: var(--ring-surface), var(--shadow-xs); }

/* ---------- table ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
/* the first row of any table is the header row, and it carries the blue */
table.tbl th {
  text-align: left; padding: 9px 12px; font-size: 11.5px; font-weight: 500;
  letter-spacing: 0; color: var(--blue-accent);
  box-shadow: inset 0 -1px 0 var(--border);
}
table.tbl td { padding: 11px 12px; box-shadow: inset 0 -1px 0 var(--border); vertical-align: middle; }
table.tbl tr:hover td { background: var(--muted); }
table.tbl td .nm { font-weight: 500; }

/* ---------- badges ---------- */
/* Neutral badges stay grey, so they stay light. Coloured badges keep their weight
   because the colour, not the weight, is what makes them read. */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px;
  border-radius: 99px; font-size: 11px; font-weight: 450; letter-spacing: 0;
  background: var(--secondary); color: var(--surface-fg-2);
}
.badge.brand, .badge.ok, .badge.warn, .badge.danger, .badge.violet { font-weight: 550; }
.badge.brand { background: oklch(68.5% .169 237.323/.14); color: var(--brand-content); }
.badge.ok { background: oklch(69.6% .17 162.48/.15); color: var(--success); }
.badge.warn { background: oklch(76.9% .188 70.08/.18); color: var(--warn); }
.badge.danger { background: oklch(57.7% .245 27.325/.12); color: var(--destructive); }
.badge.violet { background: oklch(60.6% .25 292.717/.13); color: var(--violet-500); }
.dark .badge.violet { color: var(--violet-400); }

/* ---------- the orb (the one neomorphic element) ---------- */
.orb { width: 76px; height: 76px; border-radius: 50%; position: relative; margin: 0 auto 20px; isolation: isolate; }
.orb::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, #fff 0%, rgba(255,255,255,.85) 9%, rgba(214,226,255,.75) 26%, rgba(150,170,240,.72) 52%, rgba(108,118,214,.8) 78%, rgba(76,80,170,.9) 100%);
  box-shadow:
    inset -6px -8px 18px rgba(56,58,130,.55),
    inset 5px 6px 14px rgba(255,255,255,.75),
    0 12px 26px -8px rgba(86,92,190,.5),
    0 2px 6px rgba(40,44,110,.18);
  animation: orbFloat 7s var(--ease-in-out) infinite;
}
.orb::after {
  content: ""; position: absolute; inset: -22%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(126,140,232,.28), transparent 62%);
  animation: orbPulse 7s var(--ease-in-out) infinite;
}
.orb.sm { width: 34px; height: 34px; margin: 0; }
@keyframes orbFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.02); } }
@keyframes orbPulse { 0%,100% { opacity: .65; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .orb::before, .orb::after { animation: none; } }

/* ---------- home ---------- */
.home-wrap { display: flex; flex-direction: column; min-height: 100%; }
.hero { padding: 52px 28px 0; max-width: 820px; margin: 0 auto; width: 100%; }
.hero h1 { margin: 0 0 26px; font-size: 27px; font-weight: 500; text-align: center; letter-spacing: -.015em; }
.hero h1 span { color: var(--brand-content); }

/* composer: controls flank the text inline on one line,
   and drop to their own row once the text wraps (.ed-wrap.multi). */
.composer-wrap { display: flex; flex-direction: column; }
.composer {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--composer-bg); border-radius: var(--composer-radius);
  /* no hairline ring: the composer floats on shadow alone */
  box-shadow: var(--composer-shadow), 0 18px 36px -22px rgba(0,0,0,.22);
  transition: box-shadow var(--dur);
}
.composer:focus-within { box-shadow: var(--composer-shadow), 0 22px 44px -22px rgba(0,0,0,.3); }
.ed-wrap { position: relative; padding: 6px 44px; transition: padding var(--dur-slow) var(--ease-in-out); }
.ed-wrap.multi { padding: 8px 8px 44px; }
.composer textarea {
  display: block; width: 100%; border: 0; outline: 0; resize: none; background: none;
  font-size: 14.5px; line-height: 1.5; min-height: 30px; max-height: 200px;
  overflow-y: auto; padding: 4px;
}
.composer textarea::placeholder { color: var(--surface-fg-3); }
/* the box shows focus, never the raw field inside it — no box within a box */
.composer textarea:focus-visible, .composer textarea:focus { box-shadow: none; outline: none; }
.ed-left { position: absolute; left: 6px; bottom: 6px; display: flex; align-items: center; gap: 4px; }
.ed-right { position: absolute; right: 6px; bottom: 6px; display: flex; align-items: center; gap: 4px; }
.round { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--dur-fast) var(--ease-out), opacity var(--dur-fast); }
.round .icon { width: 16px; height: 16px; }
.round.clip { background: var(--secondary); color: var(--blue-accent); }
.round.clip:hover { background: var(--accent); color: var(--blue-accent); }
/* send: bare black glyph at rest, a ringed circle once there is something to
   send, a red stop while a reply is streaming */
.round.send { background: none; color: var(--foreground); border-radius: 50%; }
.round.send:hover { background: var(--muted); }
.ed-wrap.has-text .round.send { box-shadow: var(--ring-surface); background: var(--secondary); }
.ed-wrap.has-text .round.send:hover { background: var(--accent); }
.ed-wrap.busy .round.send,
.ed-wrap.busy.has-text .round.send { background: var(--destructive); color: oklch(98.5% 0 0); box-shadow: none; }
/* Skills and the model picker live inside the composer box, not floating under it */
.composer-foot { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 10px 9px; }
.composer-foot .right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.composer-bar { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 10px;
  border-radius: 99px; font-size: 12.5px; color: var(--surface-fg-2);
  box-shadow: var(--ring-surface);
}
.chip:hover { background: var(--muted); color: var(--foreground); }
.chip .icon { width: 14px; height: 14px; }
.send { width: 30px; height: 30px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--primary); color: var(--primary-foreground); }
.send:hover { opacity: .9; }

/* three dismissible line items, not cards */
.starters { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; }
.starter-row { display: flex; align-items: center; gap: 2px; border-radius: var(--r-md); }
.starter-row:hover { background: var(--muted); }
.starter {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  text-align: left; padding: 9px 4px 9px 10px; border-radius: var(--r-md);
}
.starter .st { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.starter .icon { width: 15px; height: 15px; color: var(--surface-fg-3); }
.starter-x {
  width: 26px; height: 26px; margin-right: 4px; display: grid; place-items: center;
  border-radius: 8px; color: var(--surface-fg-3); opacity: .4;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.starter-row:hover .starter-x, .starter-x:focus-visible { opacity: 1; }
.starter-x:hover { background: var(--accent); color: var(--foreground); }
.starter-x .icon { width: 13px; height: 13px; }

.resume { max-width: 820px; margin: 40px auto 0; width: 100%; padding: 0 28px 60px; }
/* section headers carry the same blue as the table header rows */
.resume h2 { margin: 0 0 13px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--blue-accent); }
.resume h2.inbox-h { margin: 34px 0 13px; }
.panel .prow .exp { font-size: 12px; color: var(--warn); font-variant-numeric: tabular-nums; }
.resume-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
@media (max-width: 820px) { .resume-grid { grid-template-columns: 1fr; } }
.rcard { text-align: left; padding: 13px 14px; border-radius: var(--r-lg); background: var(--surface-secondary); box-shadow: var(--ring-surface), var(--shadow-xs); }
.rcard:hover { box-shadow: var(--ring-surface), var(--shadow-md); transform: translateY(-1px); }
.rcard .rk { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--surface-fg-2); }
.rcard .rk .cdot { width: 9px; height: 9px; margin-left: -1px; }
.rcard .rk .cdot::before { width: 6px; height: 6px; }
.rcard .rt { display: block; font-size: 13.5px; font-weight: 500; margin: 4px 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard .rm { display: block; font-size: 11.5px; color: var(--surface-fg-3); }

/* needs you */
.needsyou {
  max-width: 820px; margin: 18px auto 0; width: 100%;
  background: linear-gradient(180deg, oklch(76.9% .188 70.08/.10), oklch(76.9% .188 70.08/.04));
  border-radius: var(--r-lg); box-shadow: 0 0 0 .5px oklch(76.9% .188 70.08/.35); padding: 12px 14px;
}
.needsyou h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .01em; color: var(--warn); display: flex; align-items: center; gap: 6px; }
.needsyou h3 .icon { width: 14px; height: 14px; }
.ny-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.ny-row + .ny-row { box-shadow: inset 0 1px 0 oklch(76.9% .188 70.08/.2); }
.ny-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ny-row .exp { font-size: 11.5px; color: var(--warn); font-variant-numeric: tabular-nums; }

/* ---------- chat ---------- */
.chat-wrap { display: flex; flex-direction: column; height: 100%; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 22px 0 8px; }
/* use the room that is there: the thread spreads with the window instead of
   sitting in a 760px column with empty gutters either side */
.thread { width: 100%; max-width: 1020px; margin: 0 auto; padding: 0 40px; }
@media (max-width: 1180px) { .thread { max-width: 900px; padding: 0 32px; } }
.msg { margin-bottom: 22px; }
.msg.user .bubble {
  margin-left: auto; max-width: 78%; background: var(--secondary);
  padding: 10px 15px; border-radius: var(--r-lg); font-size: 14px;
}
.msg.ai .bubble { font-size: 14.5px; line-height: 1.6; }
.msg.ai .bubble p { margin: 0 0 10px; }
.msg.ai .bubble ul { margin: 0 0 10px; padding-left: 18px; }
.msg.ai .bubble li { margin-bottom: 4px; }
.worked { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--surface-fg-2); padding: 5px 10px; border-radius: 99px; box-shadow: var(--ring-surface); margin-bottom: 10px; }
.worked .icon { width: 13px; height: 13px; }
.msg-actions { display: flex; align-items: center; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity var(--dur); }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
.msg-actions .ts { font-size: 11px; color: var(--surface-fg-3); margin-left: auto; }
.chat-composer { padding: 0 40px 22px; max-width: 1020px; margin: 0 auto; width: 100%; }
@media (max-width: 1180px) { .chat-composer { max-width: 900px; padding: 0 32px 22px; } }

/* ---------- project detail w/ right pane ---------- */
.split { display: flex; height: 100%; min-height: 0; }
.split-main { flex: 1; min-width: 0; overflow-y: auto; }
.ppane {
  width: 320px; flex-shrink: 0; overflow-y: auto; padding: 18px 16px 40px;
  background: var(--surface-tertiary);
  box-shadow: inset 1px 0 0 var(--border);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.ppane.hidden { display: none; }
.ppane h4 { margin: 0 0 7px; font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--foreground); }
.ppane section { margin-bottom: 20px; }
.ppane .instr { font-size: 12.5px; line-height: 1.55; color: var(--surface-fg-1); background: var(--surface-secondary); border-radius: var(--r-md); padding: 10px 11px; box-shadow: var(--ring-surface); }
.ppane .fitem { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12.5px; }
.ppane .fitem .icon { width: 14px; height: 14px; color: var(--surface-fg-3); flex-shrink: 0; }
.ppane .empty { font-size: 12px; color: var(--surface-fg-3); padding: 6px 0; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.kv .k { font-size: 10.5px; letter-spacing: .01em; color: var(--surface-fg-3); }
.kv .v { font-size: 12.5px; font-family: var(--font-mono); }

/* ---------- designer ---------- */
.designer { display: flex; height: 100%; min-height: 0; }
.dz-palette { width: 190px; flex-shrink: 0; padding: 14px 12px; overflow-y: auto; box-shadow: inset -1px 0 0 var(--border); }
.dz-palette h5 { margin: 14px 0 5px; font-size: 11px; font-weight: 450; letter-spacing: 0; color: var(--surface-fg-3); }
.dz-palette h5:first-child { margin-top: 0; }
.dz-step { display: block; width: 100%; text-align: left; padding: 7px 10px; margin-bottom: 4px; border-radius: var(--r-md); font-size: 12.5px; background: var(--surface-secondary); box-shadow: var(--ring-surface); }
.dz-step:hover { background: var(--muted); }
.dz-canvas { flex: 1; min-width: 0; position: relative; overflow: auto; background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 18px 18px; }
.dz-node { position: absolute; width: 190px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--surface-primary); box-shadow: var(--ring-surface), var(--shadow-md); }
.dz-node.sel { box-shadow: 0 0 0 1.5px var(--brand), var(--shadow-lg); }
.dz-node .k { font-size: 10px; letter-spacing: .01em; color: var(--brand-content); font-weight: 600; }
.dz-node .n { font-size: 13px; font-weight: 500; margin-top: 2px; }
.dz-node .id { font-size: 11px; color: var(--surface-fg-3); font-family: var(--font-mono); }
.dz-cfg { width: 290px; flex-shrink: 0; padding: 14px; overflow-y: auto; box-shadow: inset 1px 0 0 var(--border); }
.dz-cfg .fld { margin-bottom: 12px; }

/* ---------- forms ---------- */
.fld label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; color: var(--surface-fg-1); }
.inp, select.inp, textarea.inp {
  width: 100%; height: 34px; padding: 0 11px; border-radius: var(--r-md);
  background: var(--surface-primary); box-shadow: var(--ring-surface);
  font-size: 13.5px; outline: none; transition: box-shadow var(--dur-fast);
}
textarea.inp { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
select.inp { appearance: none; background-image: none; cursor: pointer; }
.inp:focus { box-shadow: 0 0 0 1px var(--brand), 0 0 0 3.5px oklch(68.5% .169 237.323/.15); }
.inp::placeholder { color: var(--surface-fg-3); }
.selwrap { position: relative; }
.selwrap .icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--surface-fg-3); pointer-events: none; }
.switch { width: 36px; height: 20px; border-radius: 99px; background: var(--secondary); position: relative; flex-shrink: 0; transition: background var(--dur); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease-out); }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }

/* ---------- popovers / menus ---------- */
.pop {
  position: absolute; z-index: 60; min-width: 200px; padding: 5px;
  border-radius: var(--r-xl); background: var(--popover);
  /* no hairline ring on floating chrome: depth comes from the shadow */
  box-shadow: var(--shadow-xl), 0 22px 48px -20px oklch(14.5% 0 0/.28);
  -webkit-backdrop-filter: blur(var(--overlay-blur)) saturate(1.6); backdrop-filter: blur(var(--overlay-blur)) saturate(1.6);
  animation: popIn var(--dur) var(--ease-out);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }
.pop .mi { display: flex; align-items: center; gap: 9px; width: 100%; height: 31px; padding: 0 9px; border-radius: var(--r-md); font-size: 13px; text-align: left; color: var(--surface-fg-1); }
.pop .mi:hover { background: var(--muted); }
.pop .mi .icon { width: 15px; height: 15px; color: var(--surface-fg-2); }
.pop .mi .icon.gold { color: var(--gold); }
.pop .mi.danger { color: var(--destructive); } .pop .mi.danger .icon { color: var(--destructive); }
.pop .msep { height: 1px; margin: 4px 6px; background: var(--border); }
.pop .mhead { padding: 7px 9px 5px; font-size: 12px; font-weight: 450; letter-spacing: 0; color: var(--surface-fg-3); }
.seg { display: flex; gap: 2px; padding: 3px; margin: 2px 6px 4px; border-radius: var(--r-md); background: var(--muted); }
.seg button { flex: 1; height: 25px; border-radius: var(--r-sm); font-size: 12px; color: var(--surface-fg-2); }
.seg button[aria-pressed="true"] { background: var(--surface-primary); color: var(--foreground); box-shadow: var(--ring-surface); }

.scrim { position: fixed; inset: 0; z-index: 55; }

/* ---------- feedback popover ---------- */
.fb-pop { width: 430px; padding: 0; max-height: calc(100vh - 70px); display: flex; flex-direction: column; }
.fb-head { display: flex; align-items: center; gap: 8px; padding: 13px 15px 10px; }
.fb-head h3 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; }
.fb-head .icon { width: 16px; height: 16px; color: var(--brand-content); }
.fb-body { padding: 0 15px 4px; overflow-y: auto; }
.fb-body .fld { margin-bottom: 12px; }
.fb-row { display: grid; grid-template-columns: 1fr 160px; gap: 10px; }
.dropzone {
  border-radius: var(--r-lg); padding: 16px 12px; text-align: center; cursor: pointer;
  background: var(--surface-tertiary);
  box-shadow: 0 0 0 1.5px var(--border) inset;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 7px, oklch(14.5% 0 0/.02) 7px, oklch(14.5% 0 0/.02) 14px);
  transition: box-shadow var(--dur), background var(--dur);
}
.dropzone:hover { background: var(--muted); }
.dropzone.over { box-shadow: 0 0 0 1.5px var(--brand) inset; background: oklch(68.5% .169 237.323/.07); }
.dropzone .icon { width: 19px; height: 19px; margin: 0 auto 6px; color: var(--surface-fg-3); }
.dropzone .dz1 { font-size: 12.5px; font-weight: 500; }
.dropzone .dz2 { font-size: 11.5px; color: var(--surface-fg-3); margin-top: 2px; }
.fb-files { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.fb-file { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-md); background: var(--surface-secondary); box-shadow: var(--ring-surface); font-size: 12px; }
.fb-file img { width: 26px; height: 26px; object-fit: cover; border-radius: var(--r-sm); flex-shrink: 0; }
.fb-file .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-file .fs { color: var(--surface-fg-3); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.fb-file .x { width: 20px; height: 20px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--surface-fg-2); flex-shrink: 0; }
.fb-file .x:hover { background: var(--accent); }
.fb-foot { display: flex; align-items: center; gap: 8px; padding: 11px 15px 13px; box-shadow: inset 0 1px 0 var(--border); }
.fb-foot .sp { flex: 1; }
.fb-note { font-size: 11.5px; color: var(--surface-fg-3); }
.fb-msg { font-size: 12.5px; padding: 8px 11px; border-radius: var(--r-md); margin: 0 15px 10px; }
.fb-msg.ok { background: oklch(69.6% .17 162.48/.12); color: var(--success); }
.fb-msg.err { background: oklch(57.7% .245 27.325/.1); color: var(--destructive); }
.req { color: var(--destructive); }

/* ---------- coach marks / onboarding ---------- */
/* The scrim carries the dim AND the blur, and is clipped with an even-odd hole
   so the step's target stays completely sharp and un-dimmed. The hole is a real
   gap in the overlay, not a transparent element sitting on top of a blur. */
.coach-scrim {
  position: fixed; inset: 0; z-index: 80; background: oklch(0 0 0/.42);
  -webkit-backdrop-filter: blur(5px) saturate(.92); backdrop-filter: blur(5px) saturate(.92);
  transition: clip-path var(--dur-slow) var(--ease-in-out);
}
.coach-hole {
  position: fixed; z-index: 81; border-radius: var(--r-lg);
  box-shadow: 0 0 0 2px var(--brand), 0 0 0 7px oklch(64.6% .222 264/.16);
  transition: all var(--dur-slow) var(--ease-in-out);
}
.coach-card { position: fixed; z-index: 82; width: 310px; padding: 15px 16px; border-radius: var(--r-xl); background: var(--popover); box-shadow: var(--overlay-ring), var(--shadow-xl); transition: all var(--dur-slow) var(--ease-in-out); }
.coach-card h3 { margin: 0 0 5px; font-size: 14.5px; font-weight: 600; }
.coach-card p { margin: 0 0 13px; font-size: 12.5px; line-height: 1.5; color: var(--surface-fg-2); }
.coach-foot { display: flex; align-items: center; gap: 8px; }
.coach-foot .dots { display: flex; gap: 4px; flex: 1; }
.coach-foot .dots i { width: 5px; height: 5px; border-radius: 99px; background: var(--surface-fg-3); }
.coach-foot .dots i.on { background: var(--brand); width: 14px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 7px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 99px;
  background: var(--popover); box-shadow: var(--shadow-lg), 0 14px 30px -14px oklch(14.5% 0 0/.25);
  -webkit-backdrop-filter: blur(var(--overlay-blur)); backdrop-filter: blur(var(--overlay-blur));
  font-size: 13px; animation: toastIn var(--dur-slow) var(--ease-out);
}
.toast .icon { width: 15px; height: 15px; }
.toast.ok .icon { color: var(--success); } .toast.err .icon { color: var(--destructive); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- misc ---------- */
.empty-state { text-align: center; padding: 56px 20px; }
.empty-state .icon { width: 26px; height: 26px; margin: 0 auto 10px; color: var(--surface-fg-3); }
.empty-state h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 550; }
.empty-state p { margin: 0 0 14px; font-size: 13px; color: var(--surface-fg-2); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.searchbox { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 11px; border-radius: var(--r-md); background: var(--surface-primary); box-shadow: var(--ring-surface); font-size: 13px; color: var(--surface-fg-3); min-width: 220px; }
.searchbox .icon { width: 15px; height: 15px; }
.searchbox input { flex: 1; border: 0; outline: 0; background: none; font-size: 13px; color: var(--foreground); }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px; width: 1.5px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: -18.5px; top: 5px; width: 9px; height: 9px; border-radius: 99px; background: var(--surface-primary); box-shadow: 0 0 0 1.5px var(--border); }
.tl-item.ok::before { background: var(--success); box-shadow: 0 0 0 1.5px var(--success); }
.tl-item.fail::before { background: var(--destructive); box-shadow: 0 0 0 1.5px var(--destructive); }

/* ---------- Work: a secondary side pane, not a wall of cards ---------- */
.worksplit { display: flex; height: 100%; min-height: 0; }
.wsnav {
  width: 232px; flex-shrink: 0; padding: 18px 10px 18px 14px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1px;
}
.wsnav h4 {
  margin: 0 0 8px; padding: 0 8px; font-size: 12.5px; font-weight: 600;
  letter-spacing: 0; color: var(--surface-fg-1);
}
.wsnav > h4:first-child + .wsitem { margin-top: 0; }
.wsnav .wsitem {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 9px;
  border-radius: 10px; color: var(--surface-fg-1); font-size: 13px; text-align: left;
}
.wsnav .wsitem:hover { background: var(--muted); }
.wsnav .wsitem[aria-current="page"] { background: var(--secondary); }
.wsnav .wsitem .icon { width: 16px; height: 16px; color: var(--surface-fg-3); }
.wsnav .wsitem[aria-current="page"] .icon { color: var(--brand-content); }
.wsnav .wsitem .wl { flex: 1; min-width: 0; }
.wsnav .wsitem .wl b { display: block; font-weight: 550; }
.wsnav .wsitem .wl span { display: block; font-size: 11.5px; color: var(--surface-fg-2); }
.wsmain { flex: 1; min-width: 0; overflow-y: auto; }
.wsmain .pad { padding-top: 18px; }
@media (max-width: 1080px) { .wsnav { width: 186px; } .wsnav .wsitem .wl span { display: none; } }

/* ---------- skills picker: description lives on the item, as a tooltip ---------- */
.pop.skills { width: 268px; }
.pop.skills .skilllist { max-height: 300px; overflow-y: auto; }
.pop .mi.skill { position: relative; justify-content: flex-start; }
.pop .mi.skill .sk { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop .mi.skill .on { width: 15px; height: 15px; color: var(--brand-content); }
.pop .mi.skill[aria-pressed="true"] { background: var(--secondary); }
/* the description tooltip is portalled to <body> so the scrolling list cannot clip it */
.tipr {
  position: fixed; z-index: 90; width: 232px; padding: 9px 11px; border-radius: 10px;
  background: oklch(14.5% 0 0/.94); color: oklch(98.5% 0 0); font-size: 11.5px;
  font-weight: 400; line-height: 1.45; text-align: left; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-fast) var(--ease-out);
}
.tipr.on { opacity: 1; }

/* ---------- add-to-project picker inside the chat menu ---------- */
.pop .pfield {
  display: flex; align-items: center; gap: 8px; height: 30px; margin: 2px 4px 6px;
  padding: 0 9px; border-radius: var(--r-md); background: var(--surface-secondary);
  box-shadow: var(--ring-surface);
}
.pop .pfield .icon { width: 14px; height: 14px; color: var(--surface-fg-3); }
.pop .pfield input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 12.5px; }
.pop .backrow { display: flex; align-items: center; gap: 7px; padding: 4px 9px 6px; font-size: 12px; color: var(--surface-fg-2); }
.pop .backrow .icon { width: 14px; height: 14px; }

/* ---------- Apps and Projects: Workbench catalogue layouts, our tokens ---------- */

/* underline tabs with counts */
.utabs {
  display: flex; align-items: center; gap: 20px; margin: 0 0 16px;
  box-shadow: inset 0 -1px 0 var(--border);
}
.utab {
  position: relative; padding: 6px 1px 11px; font-size: 13px; font-weight: 450;
  color: var(--surface-fg-2); white-space: nowrap;
}
.utab:hover { color: var(--foreground); }
.utab[aria-selected="true"] { color: var(--blue-accent); font-weight: 550; }
.utab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  border-radius: 2px 2px 0 0; background: var(--blue-accent);
}
.utabs .searchbox { margin-bottom: 8px; }

/* colour-coded icon tiles, shared by both screens */
.tile {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  flex-shrink: 0; color: var(--foreground); background: var(--secondary);
}
.tile .icon { width: 17px; height: 17px; }
.t-sales { background: oklch(68.5% .169 237.323/.16); color: oklch(48% .16 237); }
.t-engineering { background: oklch(69.6% .17 162.48/.18); color: oklch(45% .13 162); }
.t-general { background: oklch(14.5% 0 0/.07); color: var(--surface-fg-1); }
.t-internal { background: oklch(78% .152 79/.22); color: oklch(48% .12 70); }
.t-finance { background: oklch(60.6% .25 292.717/.14); color: oklch(45% .2 292); }
.t-platform, .t-design { background: oklch(68.5% .169 237.323/.14); color: oklch(46% .15 237); }
.t-procurement, .t-operations { background: oklch(69.6% .17 162.48/.16); color: oklch(44% .12 162); }
.dark .t-general { background: oklch(98.5% 0 0/.1); color: var(--surface-fg-1); }

/* project rows */
.plist { display: flex; flex-direction: column; gap: 8px; }
.prj {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--r-lg); background: var(--surface-primary);
  box-shadow: var(--ring-surface); color: inherit;
  transition: background var(--dur-fast) var(--ease-out);
}
.prj:hover { background: var(--muted); }
.prj .who { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.prj .nm { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prj .meta { font-size: 12px; color: var(--surface-fg-2); }
.prj .btn.sm { pointer-events: none; }
.avstack { display: flex; align-items: center; padding-left: 6px; }
.avstack .av {
  width: 23px; height: 23px; border-radius: 50%; margin-left: -6px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 9.5px; font-weight: 550;
  background: var(--secondary); color: var(--surface-fg-1);
  box-shadow: 0 0 0 2px var(--surface-primary);
}
.avstack .av.more { background: transparent; color: var(--surface-fg-2); box-shadow: none; margin-left: 0; padding-left: 3px; }

/* app catalogue */
.searchbox.wide { width: 100%; min-width: 0; height: 38px; margin-bottom: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.filters .chip b { font-weight: 550; color: var(--surface-fg-2); }
.filters .chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-foreground); box-shadow: none; }
.filters .chip[aria-pressed="true"] b { color: var(--primary-foreground); opacity: .7; }
.appgrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
@media (max-width: 900px) { .appgrid { grid-template-columns: 1fr; } }
.appcard {
  display: flex; align-items: stretch; text-align: left; overflow: hidden;
  border-radius: var(--r-lg); background: var(--surface-primary); box-shadow: var(--ring-surface);
  transition: background var(--dur-fast) var(--ease-out);
}
.appcard:hover { background: var(--muted); }
.appcard > .tile { width: 58px; height: auto; border-radius: 0; }
.appcard > .tile .icon { width: 19px; height: 19px; }
.appcard .body { min-width: 0; flex: 1; padding: 11px 13px; display: flex; flex-direction: column; gap: 4px; }
.appcard .row1 { display: flex; align-items: center; gap: 8px; }
.appcard .nm { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appcard .d { font-size: 12.5px; line-height: 1.45; color: var(--surface-fg-2); }

/* ==========================================================================
   Mobile. Breakpoint follows Claude's: the persistent rail disappears below
   768px and becomes a drawer, content goes edge to edge with small gutters.
   ========================================================================== */
.mobnav { display: none; }

@media (max-width: 768px) {
  /* rail becomes an overlay drawer */
  .rail {
    position: fixed; z-index: 80; top: 0; left: 0; bottom: 0;
    width: min(302px, 86vw); margin: 0; border-radius: 0 18px 18px 0;
    transform: translateX(-102%);
    transition: transform var(--dur-slow) var(--ease-in-out);
  }
  /* opaque over the scrim: glass would let the dimmed page bleed through */
  .rail { background: var(--surface-primary); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .dark .rail { background: var(--neutral-900, #1a1a1a); }
  .rail.open { transform: none; }
  .rail.collapsed { width: min(302px, 86vw); }      /* desktop collapse is moot here */
  .rail.collapsed .lbl, .rail.collapsed .rail-foot-meta, .rail.collapsed .wordmark { opacity: 1; max-width: none; }
  .rail-scrim { position: fixed; inset: 0; z-index: 75; background: oklch(14.5% 0 0/.32); }
  .rail-head .iconbtn[data-act="collapse"] { display: none; }

  .mobnav { display: grid; margin-left: -4px; }
  .masthead { padding: 0 8px 0 4px; gap: 6px; }
  .crumb { font-size: 12.5px; }
  .crumb a, .crumb .sep { display: none; }          /* keep the current page only */
  .mast-title { max-width: 52vw; }

  /* content goes edge to edge */
  .pad { padding: 16px 14px 56px; }
  .hero { padding: 26px 14px 0; }
  .hero h1 { font-size: 21px; margin-bottom: 18px; }
  .orb { width: 56px; height: 56px; }
  .resume { padding: 0 14px 48px; margin-top: 28px; }
  .resume h2 { font-size: 16px; }
  h1.pt { font-size: 19px; }
  h2.sec { font-size: 15px; }
  .thread, .chat-composer { padding-left: 12px; padding-right: 12px; }
  .chat-composer { padding-bottom: 14px; }
  .msg.user .bubble { max-width: 88%; }

  /* one column everywhere */
  .grid.c2, .grid.c3, .grid.c4, .appgrid, .resume-grid { grid-template-columns: 1fr; }

  /* tables scroll inside their panel rather than pushing the page wide */
  .panel { overflow-x: auto; }
  table.tbl { min-width: 560px; }

  /* stacked panes */
  .split { flex-direction: column; overflow-y: auto; }
  .split-main { overflow: visible; }
  .ppane { width: auto; max-width: none; box-shadow: inset 0 1px 0 var(--border); }
  .designer { flex-direction: column; height: auto; }
  .dz-palette { width: auto; box-shadow: inset 0 -1px 0 var(--border); display: flex; flex-wrap: wrap; gap: 6px; }
  .dz-canvas { min-height: 320px; }
  .dz-cfg { width: auto; }

  /* rows and tap targets */
  .rail-item, .chat-row { height: 40px; }
  .prj { flex-wrap: wrap; }
  .prj .avstack, .prj .btn.sm { display: none; }
  .utabs { gap: 14px; overflow-x: auto; scrollbar-width: none; }
  .utabs::-webkit-scrollbar { display: none; }
  .utabs .searchbox { display: none; }
  .searchbox.wide { height: 40px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .filters::-webkit-scrollbar { display: none; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }

  /* notifications take the whole sheet */
  .npane { top: 8px; right: 8px; bottom: 8px; width: auto; left: 8px; max-width: none; }
  .npane { transform: translateX(calc(100% + 16px)); }
  .npane.open { transform: none; }

  /* popovers should never exceed the screen */
  .pop { max-width: calc(100vw - 24px); }
  .pop.skills { width: min(268px, calc(100vw - 24px)); }
}

@media (max-width: 560px) {
  /* a row is icon, title and one piece of meta — three columns will not fit */
  .panel .prow .rmeta:not(:last-of-type) { display: none; }
  .panel .prow { gap: 10px; }
  /* page actions become a full-width bar rather than crowding the top-right */
  .pad > .row.between { flex-wrap: wrap; gap: 8px; }
  .pad > .row.between .spacer { display: none; }
  .pad > .row.between .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 19px; }
  .pad { padding: 14px 12px 52px; }
  .mast-actions .chip { display: none; }            /* model picker moves out of the way */
  .prj .meta, .appcard .d { font-size: 11.5px; }
}
