/* Workspace — Library · Sources · Activity (signed-in shell).
 * One accent (green), neutral surfaces, compact 13px controls, left-aligned
 * names. Tokens mirror the design handoff; type is the app's Inter. */
:root {
  --ws-bg: #ffffff;
  --ws-side: #f7f8f7;
  --ws-fg: #26322a;
  --ws-muted: #738077;
  --ws-line: #e5eae6;
  --ws-soft: #eef4ee;
  --ws-green: #376341;
  --ws-green-ink: #ffffff;
  --ws-warn: #9a5b12;
  --ws-warn-bg: #fdf3e4;
  --ws-bad: #a13a3a;
  --ws-bad-bg: #fbeaea;
  --ws-radius: 8px;
  /* Sidebar: 200px by default (operator 2026-09-25: narrower, with a gap before the content), draggable
     168–320px; the chosen width lives in --ws-side-open-w (set by workspace.js from localStorage) so the
     collapsed rail can still keep the expanded footprint. --ws-gutter is the gap the handle sits in. */
  --ws-side-open-w: 200px;
  --ws-side-w: var(--ws-side-open-w);
  --ws-gutter: 20px;
  --ws-content-w: 760px;   /* 960 + 32px padding each side */
  --ws-content-wide-w: 1424px;
  --ws-chat-w: 300px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 13px/1.5 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ws-fg);
  background: var(--ws-bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button {
  cursor: pointer; border: 0; background: none; min-height: 36px; padding: 7px 11px;
  border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  white-space: nowrap;
}
button:hover { background: var(--ws-soft); }
button:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ws-green); outline-offset: 2px;
}
a { color: var(--ws-green); }
svg { width: 16px; height: 16px; flex: none; }
.primary { background: var(--ws-green); color: var(--ws-green-ink); font-weight: 550; }
.primary:hover { background: var(--ws-green); opacity: .92; }
.outline { border: 1px solid var(--ws-line); background: var(--ws-bg); }
.selected { background: var(--ws-soft); color: var(--ws-green); font-weight: 600; }
.danger { color: var(--ws-bad); }
.tiny { font-size: 11px; color: var(--ws-muted); }
.small { font-size: 12px; color: var(--ws-muted); }
.space { flex: 1; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
input[type=search], input[type=text], input[type=url], select, textarea {
  border: 1px solid var(--ws-line); border-radius: 7px; background: var(--ws-bg); padding: 9px 10px; min-width: 0;
}
textarea { display: block; width: 100%; resize: vertical; min-height: 120px; font-size: 14px; }
input[type=checkbox], input[type=radio] { accent-color: var(--ws-green); }

/* ── Shell ─────────────────────────────────────────────────────────── */
.ws-loading { max-width: 460px; margin: 80px auto; padding: 24px; }
.ws-loading p { margin: 4px 0 0 8px; }
#ws-gate { max-width: 460px; margin: 80px auto; padding: 24px; text-align: left; }
#ws-gate .brand { margin-bottom: 28px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 650; letter-spacing: -.4px; color: var(--ws-fg); text-decoration: none; padding: 4px 8px 14px; }
.brand b { background: var(--ws-green); color: var(--ws-green-ink); font-size: 12px; border-radius: 6px; padding: 4px 7px; font-weight: 700; }
.brand .beta { font-size: 10px; letter-spacing: .6px; text-transform: uppercase; color: var(--ws-green); background: var(--ws-soft); padding: 2px 6px; border-radius: 5px; font-weight: 600; }
#ws-gate h1 { font-size: 24px; letter-spacing: -.6px; margin: 0 0 8px; }
#ws-gate p { color: var(--ws-muted); margin: 0 0 18px; }
/* Sidebar + content travel together as one centred block; the content column keeps the refined widths. */
.ws-app { --ws-side-w: var(--ws-side-open-w); } /* resolved here, where workspace.js sets the chosen width */
.ws-app { display: grid; grid-template-columns: var(--ws-side-w) var(--ws-gutter) minmax(0, 1fr); min-height: 100vh; max-width: calc(var(--ws-side-w) + var(--ws-gutter) + var(--ws-content-w)); margin: 0 auto; }
/* The gap between sidebar and content doubles as the resize handle: a hairline that shows on hover, a pill in the middle. */
.side-resizer { cursor: col-resize; touch-action: none; position: sticky; top: 0; height: 100vh; align-self: start; user-select: none; }
.side-resizer:before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: transparent; transition: background .15s; }
.side-resizer:after { content: ''; position: absolute; left: calc(50% - 2px); top: calc(50% - 16px); height: 32px; width: 4px; border-radius: 4px; background: var(--ws-muted); opacity: 0; transition: opacity .15s; }
.side-resizer:hover:before, .side-resizer:focus-visible:before, .resizing-side .side-resizer:before { background: var(--ws-line); }
.side-resizer:hover:after, .side-resizer:focus-visible:after, .resizing-side .side-resizer:after { opacity: .5; }
.side-resizer:focus-visible { outline: none; }
.side-collapsed .side-resizer { pointer-events: none; }
.side-collapsed .side-resizer:after { display: none; }
.resizing-side, .resizing-side * { cursor: col-resize !important; }
.resizing-side .ws-app { transition: none; }
.ws-topbar { display: none; }
.ws-side {
  background: var(--ws-side); border-right: 1px solid var(--ws-line); padding: 18px 10px; display: flex; flex-direction: column; gap: 3px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
}
.ws-side .ws-add { justify-content: center; margin: 0 0 12px; min-height: 40px; color: var(--ws-green-ink); font-weight: 600; }
.ws-side .ws-add:hover { background: var(--ws-green); color: var(--ws-green-ink); opacity: .92; }
.ws-side .credits { display: block; margin: 8px 0 4px; padding: 10px 12px; border-radius: 8px; background: var(--ws-soft); text-decoration: none; color: var(--ws-fg); font-size: 12px; }
.ws-side .credits strong { display: block; font-weight: 600; }
.ws-side .credits .lbl { display: block; }
.ws-side .credits .line { color: var(--ws-muted); }
.ws-side .credits.low { background: var(--ws-warn-bg); }
.ws-side .credits.low .line { color: var(--ws-warn); }
.ws-side .credits .credits-ic { display: none; }
.ws-side button, .ws-side a.navlink {
  justify-content: flex-start; text-align: left; font-size: 12.5px; width: 100%; text-decoration: none; color: inherit; border-radius: 6px;
  min-height: 36px; padding: 7px 10px; display: flex; align-items: center; gap: 8px;
}
.ws-side a.navlink:hover { background: var(--ws-soft); }
.ws-side a.navlink.active, .ws-side button.active { background: var(--ws-soft); color: var(--ws-green); font-weight: 600; }
.ws-side .section-label { font-size: 10px; color: var(--ws-muted); letter-spacing: .7px; text-transform: uppercase; padding: 16px 10px 5px; }
.ws-side .pin-row { display: flex; align-items: center; gap: 2px; }
.ws-side .pin-row .pin { flex: 1; min-width: 0; }
.ws-side .pin-row .unpin { width: auto; min-height: 30px; min-width: 30px; padding: 4px; color: var(--ws-muted); opacity: 0; flex: none; }
.ws-side .pin-row:hover .unpin, .ws-side .pin-row:focus-within .unpin { opacity: 1; }
.ws-side .pin-row .unpin:hover { color: var(--ws-bad); }
@media (pointer: coarse) { .ws-side .pin-row .unpin { opacity: .7; } }
.ws-side .pin .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-side .who { display: flex; align-items: center; gap: 6px; padding: 10px 4px 0 10px; font-size: 11px; color: var(--ws-muted); border-top: 1px solid var(--ws-line); margin-top: 8px; }
.ws-side .who .email { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-side .who button { width: auto; min-height: 32px; padding: 4px 6px; color: var(--ws-muted); }
/* Content is centred in the space beside the sidebar at a readable width — every block shares the same edges; a folder with the find panel open may use more. */
.ws-main { min-width: 0; padding: 24px 32px 60px; max-width: var(--ws-content-w); }
.ws-tabs-mobile { display: none; }
.ws-topbar .signout-chip { display: none; }
@media (max-width: 650px) { .ws-topbar .signout-chip { display: inline-block; } }

/* ── Collapsible sidebar ───────────────────────────────────────────────
   Collapsed, the sidebar is a 64px icon rail. Labels are visually hidden, not removed, so every
   control keeps its accessible name; workspace.js shows the name as a tooltip on hover and focus.
   Phones (≤650px) never see the rail — they keep the bottom tabs. */
.ws-app { transition: grid-template-columns .18s ease; }
.side-head { display: flex; align-items: flex-start; gap: 4px; }
.side-head .brand { flex: 1; min-width: 0; }
.ws-side .side-toggle { width: 32px; min-height: 32px; padding: 0; margin-top: 2px; justify-content: center; color: var(--ws-muted); flex: none; }
.ws-side .side-toggle:hover { color: var(--ws-fg); }
.side-toggle .when-closed { display: none; }
.ws-side .pins-empty { display: block; padding: 4px 10px; }
.ws-tip { position: fixed; z-index: 2100; transform: translateY(-50%); background: var(--ws-fg); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.3; padding: 5px 8px; border-radius: 6px; max-width: min(360px, calc(100vw - 16px)); white-space: normal; overflow-wrap: anywhere; pointer-events: none; box-shadow: 0 4px 14px #0002; }
/* While the rail expands, labels stay on one line instead of wrapping in the still-narrow column. */
.side-expanding .ws-side .lbl, .side-expanding .ws-side .section-label, .side-expanding .ws-side .credits .line, .side-expanding .ws-side .brand { white-space: nowrap; }

/* Collapsed, the shell keeps its expanded width: the rail stays where the sidebar was and the content
   column takes the 176px the sidebar gave up, instead of the whole block re-centring. */
.ws-app.side-collapsed { --ws-side-w: 64px; max-width: calc(var(--ws-side-open-w) + var(--ws-gutter) + var(--ws-content-w)); }
.side-collapsed .ws-main { max-width: calc(var(--ws-content-w) + var(--ws-side-open-w) - 64px); }
/* No visible scrollbar on the rail: a classic 15px bar would squeeze the 44px controls off-centre. It still scrolls. */
.side-collapsed .ws-side { padding: 14px 10px; overflow-x: hidden; scrollbar-width: none; }
.side-collapsed .ws-side::-webkit-scrollbar { display: none; }
.side-collapsed .ws-side .lbl, .side-collapsed .ws-side .who .email { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.side-collapsed .ws-side .beta, .side-collapsed .ws-side .section-label, .side-collapsed #ws-pins > .tiny, .side-collapsed .ws-side .pin-row .unpin { display: none; }
.side-collapsed #ws-pins:not(:has(.pin-row)) { display: none; }
.side-collapsed .side-head { flex-direction: column; align-items: stretch; gap: 4px; }
.side-collapsed .side-head .brand { flex: none; justify-content: center; gap: 0; padding: 4px 0 2px; min-height: 40px; }
.side-collapsed .side-toggle .when-open { display: none; }
.side-collapsed .side-toggle .when-closed { display: block; }
.side-collapsed .ws-side button, .side-collapsed .ws-side a.navlink { justify-content: center; padding: 0; gap: 0; min-height: 40px; }
.side-collapsed .ws-side .side-toggle { width: 100%; margin: 0 0 8px; }
.side-collapsed .ws-side .who button { width: 100%; }
.side-collapsed #ws-pins { border-top: 1px solid var(--ws-line); margin-top: 10px; padding-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.side-collapsed .ws-side .pin { position: relative; }
.side-collapsed .ws-side .pin .ring { position: absolute; top: 2px; right: 2px; margin: 0; }
.side-collapsed .ws-side .pin .ring b { display: none; }
.side-collapsed .ws-side .pin .ring svg { width: 12px; height: 12px; }
.side-collapsed .ws-side .credits { display: flex; align-items: center; justify-content: center; padding: 0; min-height: 40px; }
.side-collapsed .ws-side .credits .credits-ic { display: block; color: var(--ws-green); }
.side-collapsed .ws-side .credits.low .credits-ic { color: var(--ws-warn); }
.side-collapsed .ws-side .who { justify-content: center; padding: 8px 0 0; }
@media (prefers-reduced-motion: reduce) { .ws-app { transition: none; } }

/* ── Page head / toolbar / lists ───────────────────────────────────── */
.head { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.library-tabs { display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--ws-line); margin: 4px 0 14px; flex-wrap: wrap; }
.library-tabs button[role=tab] { border-radius: 0; padding: 10px 0; color: var(--ws-muted); min-height: 40px; }
.library-tabs button[role=tab]:hover { background: none; color: var(--ws-fg); }
.library-tabs button[role=tab].current { color: var(--ws-fg); font-weight: 600; box-shadow: inset 0 -2px var(--ws-green); }
.library-tabs .nearby { margin-left: 2px; border: 1px solid var(--ws-line); border-radius: 7px; padding: 6px 11px; font-size: 12px; min-height: 34px; }
.library-tabs .nearby.selected { background: var(--ws-soft); color: var(--ws-green); }
.sort-static { font-size: 12px; color: var(--ws-muted); border: 1px solid var(--ws-line); border-radius: 7px; padding: 8px 11px; white-space: nowrap; }
.head h1 { font-size: 24px; line-height: 1.2; letter-spacing: -.7px; margin: 0 0 3px; overflow-wrap: anywhere; }
.head p { margin: 0; color: var(--ws-muted); }
h2 { font-size: 16px; letter-spacing: -.3px; margin: 0 0 8px; }
.crumb { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 12px; color: var(--ws-muted); flex-wrap: wrap; }
.crumb button { min-height: 30px; padding: 4px 6px; font-size: 12.5px; color: var(--ws-muted); }
/* Ancestors are the way back: they read as links. The current place is plain text. */
.crumb button:not(.folder-exit) { color: var(--ws-green); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; font-weight: 500; }
.crumb button:not(.folder-exit):hover { background: var(--ws-soft); text-decoration-thickness: 2px; }
.crumb > span:last-of-type { color: var(--ws-fg); font-weight: 500; }
.crumb .folder-exit { margin-left: auto; font-size: 22px; min-width: 36px; }
.global-search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--ws-line); border-radius: 9px; padding: 6px 10px 6px 14px; margin: 0 0 12px; max-width: 640px; background: var(--ws-bg); color: var(--ws-muted); }
.global-search:focus-within { border-color: var(--ws-green); box-shadow: 0 0 0 2px var(--ws-soft); }
.global-search input { flex: 1; border: 0; background: transparent; padding: 8px 0; min-width: 0; font-size: 14px; color: var(--ws-fg); }
.global-search input:focus-visible { outline: none; }
.global-search kbd { font: 11px/1 Inter, sans-serif; color: var(--ws-muted); border: 1px solid var(--ws-line); border-radius: 5px; padding: 5px 6px; }
.shortcuts { display: flex; gap: 4px 18px; flex-wrap: wrap; margin: 0 0 14px; }
/* Compact ingestion cards (simple-library direction, 2026-09-20) */
.ingest-shortcuts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 22px; }
.ingest-shortcuts button { display: flex; align-items: flex-start; gap: 10px; text-align: left; white-space: normal; border: 1px solid #dfe8df; background: #f6f9f2; color: var(--ws-green); border-radius: 10px; padding: 14px 12px; min-height: 84px; }
.ingest-shortcuts button:hover { background: #eaf2e3; border-color: #a9bea3; }
.ingest-shortcuts button svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.ingest-shortcuts strong { display: block; font-size: 13px; font-weight: 600; color: var(--ws-fg); }
.ingest-shortcuts small { display: block; font-size: 11px; margin-top: 4px; color: var(--ws-muted); line-height: 1.35; }
@media (max-width: 1000px) { .ingest-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* One search, a Filters popover and the sort — the files toolbar */
.files-toolbar { margin: 0 0 12px; }
.unified-search { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; min-width: 160px; max-width: 720px; border: 1px solid var(--ws-line); border-radius: 8px; padding-left: 12px; background: var(--ws-bg); color: var(--ws-muted); }
.unified-search:focus-within { border-color: var(--ws-green); box-shadow: 0 0 0 2px var(--ws-soft); }
.unified-search svg { width: 16px; height: 16px; flex: none; }
.unified-search input[type=search] { border: 0; flex: 1; max-width: none; min-width: 0; width: 100%; padding: 10px 10px 10px 0; background: transparent; color: var(--ws-fg); }
.unified-search input:focus-visible { outline: none; }
.filter-pop { position: relative; font-size: 12px; flex: none; }
.filter-pop summary { list-style: none; display: inline-flex; gap: 7px; align-items: center; padding: 8px 11px; border: 1px solid var(--ws-line); border-radius: 8px; cursor: pointer; min-height: 36px; background: var(--ws-bg); }
.filter-pop summary::-webkit-details-marker { display: none; }
.filter-pop summary svg { width: 15px; height: 15px; color: var(--ws-muted); }
.filter-pop[open] summary { border-color: var(--ws-green); }
.filter-pop > div { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: 270px; background: var(--ws-bg); padding: 16px; border: 1px solid var(--ws-line); border-radius: 10px; box-shadow: 0 12px 30px rgba(20, 37, 27, .14); display: flex; flex-direction: column; gap: 12px; }
.filter-pop > div > label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.filter-pop .chips { margin: 0; }
.filter-pop [data-clearfilters] { align-self: flex-start; min-height: 32px; }
.library-tabs .ask-button { margin-left: auto; color: var(--ws-green); }
/* Two-line rows with an icon tile */
.row .file-icon { width: 32px; height: 36px; border-radius: 7px; background: var(--ws-soft); display: grid; place-items: center; color: var(--ws-green); flex: none; overflow: visible; }
.row .file-icon svg { width: 16px; height: 16px; }
.row.file-row { min-height: 60px; padding: 8px 0; gap: 12px; }
.row.file-row .title { gap: 12px; padding: 4px 4px; }
.row .title .title-text { flex: 1; min-width: 0; white-space: normal; overflow: hidden; display: block; }
.row .title .title-text strong { display: block; font-weight: 550; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .title .row-meta { display: block; font-size: 11px; color: var(--ws-muted); margin-top: 3px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .title:has(input.inline) .title-text strong { display: none; }
.list-head.file-head { padding-right: 44px; }
.shortcuts button { border: 0; background: none; font-size: 13px; min-height: 36px; padding: 6px 2px; color: var(--ws-fg); border-radius: 4px; }
.shortcuts button:hover { background: none; color: var(--ws-green); text-decoration: underline; text-underline-offset: 4px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin: 10px 0 12px; flex-wrap: wrap; justify-content: flex-start; }
.toolbar input[type=search] { flex: 1 1 320px; min-width: 160px; max-width: 560px; }
.sort-controls { display: flex; align-items: center; gap: 6px; flex: none; }
.sort-pop { position: relative; }
.sort-trigger { border: 1px solid var(--ws-line); background: var(--ws-bg); border-radius: 7px; font-size: 12px; }
.sort-menu {
  position: absolute; right: 0; top: calc(100% + 6px); width: 210px; padding: 6px; background: var(--ws-bg); border: 1px solid var(--ws-line);
  border-radius: 10px; box-shadow: 0 8px 30px #0002; z-index: 30;
}
.sort-menu button { display: flex; justify-content: space-between; width: 100%; text-align: left; font-size: 12px; border-radius: 5px; }
.sort-menu button[aria-checked=true] { color: var(--ws-green); background: var(--ws-soft); }
.sort-caption { font-size: 10px; color: var(--ws-muted); padding: 6px 9px; letter-spacing: .4px; text-transform: uppercase; }
.sort-direction { width: 36px; padding: 8px; border-radius: 7px; }
.list-head { display: flex; justify-content: space-between; border-bottom: 1px solid var(--ws-line); padding: 8px 0; color: var(--ws-muted); font-size: 11px; }
.row { border-bottom: 1px solid var(--ws-line); display: flex; gap: 10px; align-items: center; padding: 7px 0; min-height: 49px; }
.row .title { flex: 1; min-width: 0; text-align: left; justify-content: flex-start; padding: 6px 4px; font-size: 12.5px; white-space: normal; }
.row .title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .pencil { min-height: 30px; min-width: 30px; padding: 4px; color: var(--ws-muted); opacity: 0; flex: none; }
.row:hover .pencil, .row:focus-within .pencil, .pencil:focus-visible, .pencil.is-cancel { opacity: 1; }
.pencil.is-cancel { color: var(--ws-bad); }
@media (pointer: coarse) { .row .pencil { opacity: .7; } }
.row .title input.inline, .h1-edit input.inline { font: inherit; width: 100%; min-width: 120px; padding: 4px 6px; border: 1px solid var(--ws-green); border-radius: 5px; background: var(--ws-bg); }
.row .title:has(input.inline) span { overflow: visible; white-space: normal; flex: 1; }
.h1-edit { display: flex; align-items: center; gap: 6px; }
.h1-edit .pencil { min-height: 32px; min-width: 32px; padding: 4px; color: var(--ws-muted); }
.h1-edit .pencil:hover { color: var(--ws-fg); }
.h1-edit input.inline { font-size: 22px; font-weight: 600; letter-spacing: -.5px; max-width: 480px; }
.row .meta { font-size: 11px; color: var(--ws-muted); white-space: nowrap; }
.row .pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--ws-soft); color: var(--ws-green); white-space: nowrap; }
.row .pill.warn { background: var(--ws-warn-bg); color: var(--ws-warn); }
.row .pill.bad { background: var(--ws-bad-bg); color: var(--ws-bad); }
.row .pill.muted { background: var(--ws-side); color: var(--ws-muted); }
/* Skeleton rows (2026-09-20): the page's shape before its data. Same row
   height as a real row; bars shimmer unless motion is reduced. */
.row.skel { pointer-events: none; }
.row.skel .title, .row.skel .meta, .row.skel .pill { display: flex; align-items: center; }
.row.skel .pill { background: transparent; padding: 0; }
.skel .bar { display: inline-block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--ws-soft) 0%, #e3ebe3 50%, var(--ws-soft) 100%); background-size: 200% 100%; animation: ws-shimmer 1.3s ease-in-out infinite; }
.row.skel .title .bar { height: 14px; }
@keyframes ws-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel .bar { animation: none; } }
.toolbar input[disabled] { opacity: .6; }
.row.has-hits { border-bottom: 0; }
.hits-inline { border-bottom: 1px solid var(--ws-line); padding: 0 0 10px 30px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; font-size: 12.5px; line-height: 1.5; color: var(--ws-fg); }
.hits-inline .cite { color: var(--ws-green); padding: 0; min-height: 22px; justify-content: flex-start; font-size: 11.5px; white-space: nowrap; }
.hits-inline span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
mark { background: #fff1a8; color: inherit; border-radius: 2px; padding: 0 1px; }
.search-summary { font-size: 12.5px; color: var(--ws-muted); margin: 0 0 8px; }
button.link { color: var(--ws-green); text-decoration: underline; min-height: 24px; padding: 2px 4px; }
.pager { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ws-muted); padding: 12px 0; flex-wrap: wrap; }
.state { padding: 34px 6px; color: var(--ws-muted); }
.state h2 { margin-top: 8px; color: var(--ws-fg); }
.state.err { color: var(--ws-bad); }
.notice { margin-top: 14px; font-size: 11px; color: var(--ws-muted); }
.panel { padding: 15px; border: 1px solid var(--ws-line); border-radius: var(--ws-radius); margin: 12px 0; }
.panelhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panelhead > div { flex: 1; min-width: 160px; }
.panel .small { margin-top: 3px; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--ws-line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border-radius: 0; padding: 9px 2px; color: var(--ws-muted); min-height: 38px; }
.tabs button.active { color: var(--ws-fg); box-shadow: inset 0 -2px var(--ws-green); background: none; }

/* folder actions menu */
.menu-host { position: relative; flex: none; }
.menu-btn { font-size: 18px; min-width: 36px; padding: 4px 8px; }
.menu {
  position: absolute; right: 0; top: 100%; z-index: 40; min-width: 180px; background: var(--ws-bg); border: 1px solid var(--ws-line);
  border-radius: 8px; padding: 5px; box-shadow: 0 8px 25px #0002;
}
.menu button { display: flex; width: 100%; text-align: left; justify-content: flex-start; font-size: 12.5px; border-radius: 5px; white-space: normal; }

/* ── Split (list + search panel) ───────────────────────────────────── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 10px var(--ws-chat-w); gap: 0; }
.split .meta.hide-m { display: none; }
.split .toolbar input[type=search] { flex-basis: 180px; max-width: none; }
.split .row .title span { max-width: 100%; }
.split > section:first-child { padding-right: 12px; min-width: 0; }
/* The ask panel stays in view beside the list: sticky, no taller than the viewport, conversation scrolls inside, composer always reachable. */
.chat { padding-left: 14px; display: flex; flex-direction: column; min-width: 0; overflow: hidden; position: sticky; top: 12px; align-self: start; height: calc(100vh - 24px); max-height: calc(100vh - 24px); }
.chat-resizer { align-self: stretch; }
.chat-resizer { cursor: col-resize; touch-action: none; position: relative; align-self: stretch; min-height: 200px; }
.chat-resizer:before { content: ''; position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--ws-line); }
.chat-resizer:after { content: ''; position: absolute; left: 2px; top: 45%; height: 32px; width: 5px; border-radius: 4px; background: var(--ws-muted); opacity: .35; }
.chat-resizer:hover:after, .chat-resizer:focus-visible:after { background: var(--ws-green); opacity: 1; }
body.resizing { user-select: none; cursor: col-resize; }
.chathead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.chathead .scope { flex-basis: 100%; order: 3; margin: -4px 0 0; border: 0; padding: 0; color: var(--ws-muted); }
.chathead strong { flex: 1; }
.scope { display: inline-flex; border: 1px solid var(--ws-line); border-radius: 6px; padding: 4px 8px; font-size: 11px; margin: 0 0 12px; align-self: flex-start; }
.composer { display: flex; gap: 5px; border: 1px solid var(--ws-line); border-radius: 9px; padding: 5px; margin-bottom: 12px; }
.composer input { border: 0; flex: 1; width: 80px; padding: 7px; background: transparent; }
.composer button { background: var(--ws-green); color: var(--ws-green-ink); min-width: 40px; }
.hits { overflow: auto; flex: 1; }
.conv { overflow: auto; flex: 1; min-height: 0; padding-right: 2px; }
.conv .q { background: var(--ws-soft); padding: 10px 12px; border-radius: 9px; margin: 6px 0 12px; font-size: 13px; }
.conv .a { font-size: 13px; line-height: 1.7; margin: 0 0 6px; }
.conv .a p { margin: 0 0 10px; white-space: pre-wrap; }
.conv .a code { font-family: inherit; font-size: 11.5px; color: var(--ws-muted); background: var(--ws-soft); padding: 1px 5px; border-radius: 4px; }
.conv .a blockquote { margin: 0 0 10px; padding: 2px 0 2px 10px; border-left: 2px solid var(--ws-line); color: var(--ws-muted); white-space: pre-wrap; }
.conv .src { font-size: 11px; color: var(--ws-muted); margin: 0 0 4px; }
.conv .cite { color: var(--ws-green); padding: 2px 0; font-size: 11.5px; min-height: 28px; justify-content: flex-start; text-align: left; white-space: normal; }
.conv .thinking { color: var(--ws-muted); font-size: 12px; padding: 8px 0 14px; }
.conv .err { color: var(--ws-bad); font-size: 12.5px; padding: 6px 0 12px; }
.conv .err a { color: inherit; }
.suggest { justify-content: flex-start; text-align: left; border: 1px solid var(--ws-line); margin: 0 0 10px; font-size: 12px; white-space: normal; }
.chat .composer { margin: 0 0 8px; }

.hit { padding: 10px 0; border-bottom: 1px solid var(--ws-line); }
.hit .cite { white-space: normal; color: var(--ws-green); padding: 2px 0; font-size: 11px; min-height: 26px; justify-content: flex-start; text-align: left; }
.hit p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.55; }
[data-openchat][aria-pressed=true] { box-shadow: inset 0 0 0 1px var(--ws-green); }

/* ── Dialogs ───────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: #0006; display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 1000; }
.dialog {
  background: var(--ws-bg); border: 1px solid var(--ws-line); border-radius: 12px; padding: 16px 18px; width: 520px; max-width: 100%;
  max-height: calc(100dvh - 24px); overflow: auto; box-shadow: 0 18px 60px #0003;
}
.dialog.wide { width: 560px; }
.dialoghead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dialoghead h2 { flex: 1; margin: 0; overflow-wrap: anywhere; }
.dialoghead button { font-size: 22px; min-width: 36px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--ws-line); padding-top: 14px; margin-top: 18px; flex-wrap: wrap; }
.actions .primary { min-height: 42px; padding: 9px 18px; }
label.field { display: block; margin: 12px 0; font-size: 12px; font-weight: 500; }
label.field select, label.field input, label.field textarea { display: block; width: 100%; margin-top: 6px; font-weight: 400; }
label.check { display: flex; gap: 9px; align-items: flex-start; margin: 12px 0; font-size: 12.5px; }
label.check input { margin-top: 3px; }
label.check.off { color: var(--ws-muted); }
.err-text { color: var(--ws-bad); font-size: 12px; margin: 8px 0 0; }
.note { font-size: 11.5px; color: var(--ws-muted); margin: 8px 0 0; }
.destinations { max-height: 260px; overflow: auto; border: 1px solid var(--ws-line); border-radius: 8px; margin-top: 10px; }
.destination { width: 100%; white-space: normal; display: flex; justify-content: space-between; gap: 12px; text-align: left; border-radius: 0; min-height: 42px; border-bottom: 1px solid var(--ws-line); }
.destination:last-child { border-bottom: 0; }
.destination span { overflow-wrap: anywhere; }
.destination small { font-size: 10px; color: var(--ws-muted); flex: none; }
.destination.selected { background: var(--ws-soft); color: var(--ws-green); }
.delete-choice { display: flex; gap: 10px; padding: 10px 0; align-items: flex-start; }
.stepper { display: flex; margin: 6px 0 20px; list-style: none; padding: 0; }
.stepper li { flex: 1; position: relative; min-width: 0; }
.stepper li:not(:last-child):after { content: ''; position: absolute; height: 1px; background: var(--ws-line); top: 15px; left: 34px; right: 8px; }
.stepper button { display: flex; flex-direction: column; align-items: flex-start; padding: 0; gap: 6px; border-radius: 0; font-size: 11px; color: var(--ws-muted); position: relative; z-index: 1; background: none; }
.stepper b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--ws-line); background: var(--ws-bg); font-size: 12px; font-weight: 600; }
.stepper .now { color: var(--ws-fg); font-weight: 600; }
.stepper .now b { background: var(--ws-green); color: var(--ws-green-ink); border-color: var(--ws-green); }
.stepper .done b { background: var(--ws-soft); color: var(--ws-green); border-color: var(--ws-green); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.choices button { border: 1px solid var(--ws-line); padding: 14px; display: flex; gap: 12px; align-items: center; text-align: left; white-space: normal; min-width: 0; }
.choices button > span { flex: 1; }
.choices small { display: block; color: var(--ws-muted); font-size: 11px; margin-top: 3px; font-weight: 400; }
.choices button > svg { width: 20px; height: 20px; color: var(--ws-green); }
.picker { display: block; border: 1px dashed var(--ws-line); border-radius: 8px; padding: 18px; margin: 14px 0; font-weight: 600; cursor: pointer; }
.picker.over { background: var(--ws-soft); border-color: var(--ws-green); }
.picker input { display: block; margin-top: 12px; max-width: 100%; font-size: 12px; font-weight: 400; }
.picked { max-height: 220px; overflow: auto; border: 1px solid var(--ws-line); border-radius: 7px; margin: 10px 0; }
.picked > div { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--ws-line); font-size: 12px; }
.picked > div:last-child { border-bottom: 0; }
.picked .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked .x { min-height: 28px; padding: 2px 8px; color: var(--ws-muted); }
.picked .bad { color: var(--ws-bad); }
.picked .prog { height: 4px; background: var(--ws-soft); border-radius: 2px; overflow: hidden; width: 90px; flex: none; }
.picked .prog i { display: block; height: 100%; background: var(--ws-green); width: 0; transition: width .2s; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12.5px; margin: 12px 0; }
.summary dt { color: var(--ws-muted); }
.summary dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.summary .warn { color: var(--ws-warn); }
.recordbox { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; flex-wrap: wrap; }
.recordbox .timer { font-variant-numeric: tabular-nums; font-size: 22px; letter-spacing: -.5px; }
.recordbox .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ws-bad); margin-right: 8px; animation: ws-blink 1s infinite; }
@keyframes ws-blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .recordbox .dot { animation: none; } .picked .prog i { transition: none; } }
.link-feedback { font-size: 12px; margin: 10px 0; }
.link-list { max-height: 170px; overflow: auto; border: 1px solid var(--ws-line); border-radius: 7px; padding: 6px 12px; margin: 10px 0; }
.link-list > div { padding: 5px 0; overflow-wrap: anywhere; font-size: 12px; display: flex; gap: 8px; }
.link-list .bad { color: var(--ws-bad); }
.link-list .n { flex: 1; }

/* toast */
#ws-toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: var(--ws-fg); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 12.5px; opacity: 0; transition: .25s; z-index: 2000; pointer-events: none; max-width: min(92vw, 520px); display: flex; gap: 12px; align-items: center; }
#ws-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#ws-toast.err { background: var(--ws-bad); }
#ws-toast button { color: #fff; text-decoration: underline; min-height: 28px; padding: 2px 6px; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --ws-gutter: 12px; }
  /* A 200px sidebar cannot fit W, the name, the beta badge and the collapse toggle in one row. */
  .side-head .beta { display: none; }
  .ws-main { padding: 18px 16px 70px; }
  .split { grid-template-columns: minmax(0, 1fr) 10px 260px; }
}
@media (max-width: 650px) {
  .ws-app { display: block; min-height: 0; }
  .ws-side, .side-resizer { display: none; }
  .ws-topbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--ws-line); position: sticky; top: 0; background: var(--ws-bg); z-index: 50; }
  .ws-topbar .brand { padding: 4px 0; font-size: 15px; }
  .ws-topbar .credits-chip { font-size: 12px; color: var(--ws-green); background: var(--ws-soft); padding: 6px 10px; border-radius: 999px; text-decoration: none; font-weight: 600; }
  .ws-topbar .signout-chip { font: inherit; font-size: 12px; color: var(--ws-muted); background: transparent; border: 1px solid var(--ws-line); padding: 6px 10px; border-radius: 999px; min-height: 32px; cursor: pointer; }
  .ws-main { padding: 14px 12px 76px; }
  .ws-main, .ws-main.wide { max-width: none; }
  .ws-app, .ws-app.wide { max-width: none; }
  .ws-tabs-mobile {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; background: var(--ws-bg); border-top: 1px solid var(--ws-line);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  }
  .ws-tabs-mobile a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 10.5px; color: var(--ws-muted); text-decoration: none; min-height: 44px; border-radius: 6px; }
  .ws-tabs-mobile a.active { color: var(--ws-green); font-weight: 600; }
  .head h1 { font-size: 21px; }
  .global-search kbd { display: none; }
  .shortcuts { gap: 2px 14px; }
  .ingest-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
  .ingest-shortcuts button { min-height: 66px; padding: 12px; }
  .ingest-shortcuts button:last-child { grid-column: 1 / -1; min-height: 50px; }
  .unified-search { flex-basis: 100%; max-width: none; }
  .filter-pop > div { right: auto; left: 0; width: min(270px, calc(100vw - 32px)); }
  .library-tabs { gap: 16px; }
  .list-head.file-head { padding-right: 0; }
  .split { display: block; }
  .chat-resizer { display: none; }
  .split > section:first-child { padding: 0; }
  /* On phones the ask panel is a sheet over the list, not a section below it. */
  .chat { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 72dvh; max-height: 72dvh; margin: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: var(--ws-bg); border-top: 1px solid var(--ws-line); border-radius: 14px 14px 0 0; box-shadow: 0 -12px 40px #0002; z-index: 950; }
  .row .meta.hide-m { display: none; }
  .panelhead > div { flex-basis: 100%; }
  .choices { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr; }
  .summary dd { text-align: left; }
  .overlay { padding: 0; align-items: flex-end; }
  .dialog { border-radius: 14px 14px 0 0; max-height: 92dvh; padding: 16px; width: 100%; }
  .composer input { font-size: 16px; }
  input[type=search], input[type=url], textarea { font-size: 16px; }
}

.insight { white-space: pre-wrap; font-size: 12.5px; line-height: 1.6; max-height: 60vh; overflow: auto; border: 1px solid var(--ws-line); border-radius: 8px; padding: 12px; }

/* Folder-level progress ring: a light processing colour while recordings run, a ✓ for five seconds once done. */
.ring { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-size: 11px; font-weight: 500; color: var(--ws-warn); vertical-align: middle; flex: none; }
.ring svg { width: 16px; height: 16px; transform: rotate(-90deg); flex: none; }
.ring .track { fill: none; stroke: var(--ws-warn-bg); stroke-width: 2.6; }
.ring .bar { fill: none; stroke: var(--ws-warn); stroke-width: 2.6; stroke-linecap: round; transition: stroke-dashoffset .6s ease; animation: ws-ring-pulse 1.8s ease-in-out infinite; }
.ring.done { color: var(--ws-green); }
.ring.done svg { transform: none; }
.ring-slot:empty { display: none; }
.h1-edit .ring { font-size: 12px; margin-left: 4px; }
.h1-edit .ring svg { width: 20px; height: 20px; }
.ws-side .pin .ring { margin-left: auto; font-size: 10px; }
.ws-side .pin .ring svg { width: 14px; height: 14px; }
.row .title .ring-slot { display: inline-flex; }
@keyframes ws-ring-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .ring .bar { animation: none; transition: none; } }

/* Date chips beside the All files search */
.chips { display: flex; margin: -4px 0 12px; align-items: center; gap: 6px; flex-wrap: wrap; }
.chips .tiny { margin-right: 2px; }
.chip { border: 1px solid var(--ws-line); background: var(--ws-bg); border-radius: 999px; padding: 5px 10px; font-size: 12px; min-height: 30px; }
.chip.on { background: var(--ws-green); color: var(--ws-green-ink); border-color: var(--ws-green); }
.row + .hits-inline { margin: 6px 0 10px; }

/* ── Business APIs and Credits, inside the workspace ─────────────────── */
/* The shared muted token measures about 4.1:1 on white; these pages use small muted text heavily, so it is
   darkened here (about 5.6:1) rather than changing the token for the whole app. */
.api-page, .credits-page { --ws-muted: #5c675f; }
.ws-side .credits.active { box-shadow: inset 0 0 0 2px var(--ws-green); }
/* The confirm dialog's danger button had a class but no style anywhere, so destructive confirmations looked safe. */
.primary.danger-btn, .primary.danger-btn:hover { background: var(--ws-bad); color: #fff; }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 7px 11px; border-radius: 6px; text-decoration: none; color: inherit; }
.api-page .panel, .credits-page .panel { margin-bottom: 14px; }
.api-page .panel h2, .credits-page .panel h2 { font-size: 15px; margin: 0 0 4px; letter-spacing: -.2px; }
.api-page .panelhead h2, .credits-page .panelhead h2 { margin: 0; }
.api-page code, .secret code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.key-create { display: flex; gap: 8px; margin: 12px 0 8px; flex-wrap: wrap; }
.key-create input { flex: 1 1 240px; }
.key-msg:empty { display: none; }
.key-msg { margin: 0 0 10px; font-size: 12.5px; }
.key-msg.err { color: var(--ws-bad); }
.key-msg a { color: var(--ws-green); font-weight: 600; }
.secret { border: 1px solid var(--ws-green); background: var(--ws-soft); border-radius: 8px; padding: 12px 14px; margin: 0 0 12px; display: grid; gap: 8px; }
.secret .small { color: #4f5a52; }
.secret-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.secret code { flex: 1 1 280px; min-width: 0; background: var(--ws-bg); border: 1px solid var(--ws-line); border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere; user-select: all; }
.keyname { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 12.5px; }
.keyname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.revoked .keyname { color: var(--ws-muted); }
.row .actions-inline { display: flex; gap: 6px; flex: none; }
.row .actions-inline button { min-height: 30px; padding: 4px 10px; }
.revoked-keys { margin-top: 6px; }
.revoked-keys summary { cursor: pointer; padding: 8px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0; }
.stat { border: 1px solid var(--ws-line); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.stat .k, .stat .n { font-size: 11px; color: var(--ws-muted); }
.stat .v { font-size: 20px; font-weight: 600; letter-spacing: -.4px; overflow-wrap: anywhere; }
.codeblock { margin: 10px 0 8px; border-radius: 8px; overflow: hidden; background: #1f2923; }
.codebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 12px; background: #172019; color: #c9d6cc; font-size: 11.5px; }
.codebar span { min-width: 0; overflow-wrap: anywhere; }
.codebar .copy { min-height: 28px; padding: 3px 10px; background: #ffffff1f; color: #fff; font-size: 12px; flex: none; }
.codebar .copy:hover { background: #ffffff33; }
.codeblock pre { margin: 0; color: #e8efe9; padding: 12px 14px; overflow-x: auto; white-space: pre; }
.codeblock pre code { font-size: 12px; line-height: 1.55; }
.credits-page .panel h2.balance-label { font-size: 12px; font-weight: 400; color: var(--ws-muted); margin: 0; letter-spacing: 0; }
.balance-big { font-size: 34px; font-weight: 650; letter-spacing: -1px; line-height: 1.15; margin: 2px 0; font-variant-numeric: tabular-nums; }
.balance-big small { font-size: 16px; color: var(--ws-muted); font-weight: 500; }
.balance.deficit { border-color: var(--ws-bad); }
.balance.deficit .balance-big { color: var(--ws-bad); }
.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0; }
.pack { border: 1px solid var(--ws-line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.pack.best { border-color: var(--ws-green); box-shadow: inset 0 0 0 1px var(--ws-green); }
.pack .tag { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--ws-green); font-weight: 600; }
.pack .price { font-size: 22px; font-weight: 650; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.pack button { margin-top: 6px; width: 100%; white-space: normal; }
@media (max-width: 900px) { .packs { grid-template-columns: 1fr; } }
@media (max-width: 650px) {
  .row .actions-inline { width: 100%; justify-content: flex-end; }
  .api-page .row, .credits-page .row { flex-wrap: wrap; }
  .key-create input { font-size: 16px; }
}

/* The file picker is a drop zone with one big action, not a bare browser control (operator 2026-09-20). */
.picker { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 26px 16px; border: 1.5px dashed var(--ws-line); border-radius: 12px; background: var(--ws-side); cursor: pointer; min-height: 132px; }
.picker:hover, .picker:focus-within, .picker.over { border-color: var(--ws-green); background: var(--ws-soft); }
.picker .picker-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--ws-bg); color: var(--ws-green); margin-bottom: 4px; }
.picker .picker-ico svg { width: 20px; height: 20px; }
.picker strong { font-size: 14px; color: var(--ws-fg); }
.picker .small { color: var(--ws-muted); }
.picker input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* Google Picker (2026-09-21): it positions itself absolutely against the
   document, so behind our modal it landed 800px above the viewport and the
   page only dimmed. Pin it to the viewport, above the Add-content dialog. */
.picker-dialog-bg { position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100vh !important; z-index: 10000 !important; }
.picker-dialog { position: fixed !important; top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important; z-index: 10001 !important; max-width: calc(100vw - 24px); max-height: calc(100vh - 24px); }

/* In-dialog Drive browser (2026-09-21) */
.drive-browser .toolbar { margin: 8px 0; }
.drive-browser .drive-crumb { margin-bottom: 4px; }
.drive-browser .destinations { max-height: 300px; }
.drive-row { display: flex; align-items: center; gap: 10px; padding: 0 8px 0 0; }
.drive-row .drive-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; border-radius: 0; min-height: 42px; font-size: 13px; cursor: pointer; }
.drive-row .drive-name svg { width: 16px; height: 16px; flex: none; color: var(--ws-green); }
.drive-row .drive-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-row .drive-name input { margin: 0; }
.drive-row .drive-pick { flex: none; min-height: 30px; padding: 4px 10px; font-size: 12px; }
.drive-row.selected { background: var(--ws-soft); }
.drive-row small { flex: none; font-size: 11px; color: var(--ws-muted); }
button.link { border: 0; background: none; color: var(--ws-green); text-decoration: underline; text-underline-offset: 3px; padding: 0; min-height: 0; font-size: inherit; }

/* A folder whose recordings live in its subfolders: a quiet line, not the big empty state. */
.state.small-state { padding: 18px 8px; }
.state.small-state p { margin: 0 0 10px; color: var(--ws-muted, #6b7280); }

/* The Workspace plan on the Credits page (operator 2026-09-21). */
.credits-page .plan-offer { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid #4d7c0f; background: #f7fee7; border-radius: 12px; }
.credits-page .plan-offer.active { border-color: var(--ws-line, #dfe5e0); background: #fff; }
.credits-page .plan-offer .po-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.credits-page .plan-offer .po-text b { font-size: 15px; }
.credits-page .plan-offer .po-text span { font-size: 13px; color: var(--ws-muted); line-height: 1.4; }
.credits-page .plan-offer button { flex: none; white-space: nowrap; }
@media (max-width: 560px) { .credits-page .plan-offer { flex-direction: column; align-items: stretch; } }

/* Encrypted Olympus DS2: the password input under the picked file (2026-09-21). */
.picked .dss-pw { padding: 6px 10px 10px; font-size: 13px; color: var(--ws-muted); }
.picked .dss-pw input { display: block; margin-top: 6px; width: 100%; max-width: 320px; }

/* Connector state pills on the Sources page (2026-09-21). */
.panel .pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--ws-soft, #eef2ee); color: var(--ws-muted); margin-right: 4px; }
.panel .pill.ok { background: #e7f5df; color: #2f6b1f; }

/* Folded options under the chooser (2026-09-22): destination, language, speakers. */
.ws-options { margin: 14px 0 4px; border: 1px solid var(--ws-line); border-radius: 8px; background: var(--ws-bg-2, transparent); }
.ws-options > summary { cursor: pointer; padding: 10px 12px; display: flex; gap: 10px; align-items: baseline; font-size: 13px; font-weight: 600; list-style: none; }
.ws-options > summary::-webkit-details-marker { display: none; }
.ws-options > summary::before { content: '▸'; font-size: 11px; opacity: .7; }
.ws-options[open] > summary::before { content: '▾'; }
.ws-options > summary .tiny { font-weight: 400; }
.ws-options-body { padding: 0 12px 12px; }
.ws-options-body label.field:first-child { margin-top: 4px; }
.file-row.pending .title-text strong { opacity: .8; }
.file-row.pending .pill { background: var(--ws-line); }

/* The transcript the reader just came back from (operator 2026-09-25: "go back to the previous visited transcript highlight little bit"). */
.row.last-visited { background: linear-gradient(90deg, var(--ws-soft) 0%, transparent 72%); box-shadow: inset 3px 0 0 var(--ws-green); border-radius: 0 8px 8px 0; }
.row.last-visited > .title { padding-left: 10px; }
.visited-tag { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ws-green); background: var(--ws-soft); border-radius: 999px; padding: 1px 7px; margin-right: 6px; vertical-align: middle; line-height: 16px; }
.row .title > .visited-tag { margin-left: 8px; margin-right: 0; flex: none; }

/* Paid-only region notice at the top of the Add content dialog (operator 2026-09-25: tell them before they submit). */
.region-gate { display: flex; align-items: center; gap: 14px; margin: 10px 0 14px; padding: 12px 14px; border-radius: 10px; background: var(--ws-warn-bg); border: 1px solid color-mix(in srgb, var(--ws-warn) 35%, transparent); }
.region-gate > div { flex: 1; min-width: 0; }
.region-gate strong { display: block; font-size: 13px; }
.region-gate p { margin: 3px 0 0; font-size: 12px; color: var(--ws-fg); line-height: 1.4; }
.region-gate .primary { flex: none; min-height: 36px; padding: 0 14px; }
@media (max-width: 650px) { .region-gate { flex-direction: column; align-items: stretch; } }

/* A submission refused at Start stays in All files as a Failed row with the reason. */
.row.file-row.failed .row-meta { color: var(--ws-bad); white-space: normal; }
.row.file-row.failed .file-icon { color: var(--ws-bad); background: color-mix(in srgb, var(--ws-bad) 10%, transparent); }

/* Header pager on All files: ‹ Page 1 of x ▾ › between the range and the column label. */
.list-head.file-head { align-items: center; gap: 12px; }
.list-head.file-head > span:first-child { flex: 1; min-width: 0; }
.head-pager { display: inline-flex; align-items: center; gap: 2px; }
.head-pager button { width: 26px; min-height: 26px; padding: 0; border-radius: 6px; color: var(--ws-muted); display: inline-grid; place-items: center; }
.head-pager button:hover:not(:disabled) { background: var(--ws-soft); color: var(--ws-fg); }
.head-pager button:disabled { opacity: .35; cursor: default; }
.head-pager button svg { width: 14px; height: 14px; }
.head-pager select { font: inherit; font-size: 11px; color: var(--ws-fg); background: var(--ws-bg); border: 1px solid var(--ws-line); border-radius: 6px; padding: 3px 22px 3px 8px; min-height: 26px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; background-size: 12px; }
@media (max-width: 650px) { .list-head.file-head { flex-wrap: wrap; } .list-head.file-head > span:last-child { display: none; } }
.head-pager select[data-perpick] { margin-right: 8px; }

/* Delete: a line sweeps across the row, then the row folds away (operator 2026-09-25). */
.row.deleting { position: relative; pointer-events: none; color: var(--ws-muted); transition: opacity .22s ease, max-height .24s ease, padding .24s ease, margin .24s ease, border-color .24s ease; max-height: 120px; overflow: hidden; }
.row.deleting::after { content: ''; position: absolute; left: 0; top: 50%; height: 2px; width: 0; background: var(--ws-bad); border-radius: 2px; transform: translateY(-50%); animation: ws-strike .6s cubic-bezier(.4, 0, .2, 1) forwards; }
.row.deleting .title, .row.deleting .pill, .row.deleting .meta { opacity: .55; }
.row.deleting.gone, .row.file-row.deleting.gone { opacity: 0; max-height: 0; min-height: 0; padding-top: 0; padding-bottom: 0; border-color: transparent; }
@keyframes ws-strike { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .row.deleting::after { animation: none; width: 100%; } .row.deleting { transition: none; } }
