/* studio: the look of the product film (motion/), the last layer. Overrides only, built on the tokens so both themes follow.
   A lifted window over a warm field, labelled island tabs and composer chips, a quiet briefing with reading-size text, underlined drawer tabs,
   chips for codes (ICD-10 mono, HCC in sky), one soft focus ring on the composer. --emblem is the logo's amber (img/icon.svg). */
:root { --emblem: #E69B40; --lift-2: 0 1px 2px rgba(31,30,29,.04), 0 24px 64px rgba(31,30,29,.10); --float: 0 1px 2px rgba(31,30,29,.05), 0 10px 30px rgba(31,30,29,.09); }
:root:not([data-theme="light"]) { --lift-2: 0 1px 2px rgba(0,0,0,.3), 0 24px 64px rgba(0,0,0,.42); --float: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35); }

/* the wordmark: lowercase, tight */
.ah-brand b, .sidebar .brand > div { font-weight: 700; font-size: 19px; letter-spacing: -.03em; font-family: var(--sans); }

/* the field behind the window, and the window */
body:has(#agent.on) { background:
  radial-gradient(1100px 720px at 6% -12%, color-mix(in srgb, var(--emblem) 13%, transparent), transparent 70%),
  radial-gradient(1000px 820px at 104% 112%, color-mix(in srgb, var(--primary) 11%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
.main:has(#agent.on) { background: transparent; }
.ag-main, .ag[data-size="classic"] > .ag-main, .ag[data-size="large"] > .ag-main { border-color: var(--border); box-shadow: var(--lift-2); }

/* the island: labels on every tab, the AI mark in amber, a soft float */
.islandmsg .isl { border-color: var(--border-strong); background: var(--surface); box-shadow: var(--float); }
.isl-bar { gap: 2px; padding: 6px 8px; }
.isl-t span, .isl-t.on span { display: inline !important; }
.isl-t { height: 34px; padding: 0 12px; gap: 7px; font-size: 13.5px; color: var(--muted); }
.isl-t .ico, .isl-t svg { opacity: .8; }
.isl-t b { background: none; color: var(--faint); font-weight: 500; min-width: 0; padding: 0; }
.isl-t.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.isl-t.on b { background: none; color: var(--muted); }
.isl-t b.isl-warn { background: var(--red-soft); color: var(--red); padding: 0 6px; }
.isl-ai { height: 34px; padding: 0 12px 0 10px; background: none; color: var(--text); }
.isl-ai .ico, .isl-ai svg { color: var(--emblem); }
.isl-ai b { font-size: 13.5px; letter-spacing: 0; font-weight: 700; }
.isl-ai:hover { background: var(--surface-2); }
.isl-ai.on { background: var(--surface-2); color: var(--text); }
@media (max-width: 760px) { .isl-t span { display: none !important; } .isl-t.on span { display: inline !important; } }

/* the briefing: a quiet box, the mark instead of a badge, text at reading size */
.ag-msgs > .ag-m.summsg { padding: 18px clamp(16px, 3vw, 26px) 12px; border-color: var(--border); border-radius: 18px; background: color-mix(in srgb, var(--surface-2) 70%, var(--bg)); box-shadow: none; }
.hero-h { gap: 10px; margin-bottom: 8px; }
.hero-av { width: auto; height: auto; padding: 0; background: none; color: var(--emblem); border-radius: 0; }
.hero-av b { display: none; }
.hero-av .ico, .hero-av svg { width: 20px; height: 20px; }
.hero-who { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; }
.hero-who b { font: 700 15px/1.3 var(--sans); letter-spacing: .01em; }
.hero-who small { font-size: 13.5px; color: var(--faint); }
.ag-m.summsg .ag-answer { font-size: 18px; line-height: 1.6; color: var(--text); }
.sum-act { margin-top: 12px; padding-top: 2px; }
.sa { padding-top: 10px; }
.sa + .sa { margin-top: 4px; border-top: 1px solid var(--border); }
.sa h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 4px; font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.sa h4 .ico, .sa h4 svg { display: none; }
.sa-r .sa-main { padding: 6px 8px; margin: 0 -8px; border-radius: 10px; }
.sa-l1 b { font-size: 15px; font-weight: 700; }
.sa-m { font-size: 14.5px; color: var(--muted); }
.pc-tag { padding: 2px 9px; border-radius: 999px; background: var(--red-soft); color: var(--red); font-size: 12px; font-weight: 500; }
.sa-more { color: var(--amber); }

/* the answer: reading size */
.ag-answer { font-size: 17px; line-height: 1.58; }
.ag-answer h5 { font: 700 15px var(--sans); letter-spacing: 0; }
.cite { font-family: var(--mono); font-weight: 600; }

/* codes and chips: ICD-10 mono, HCC in sky, the therapy chip as a soft pill */
.pc-icd { padding: 3px 8px; border-radius: 7px; background: var(--surface-3); color: var(--muted); font: 600 12px/1.2 var(--mono); }
.pc-hcc { padding: 3px 8px; border-radius: 7px; background: var(--sky-soft); color: var(--sky); font: 600 12px/1.2 var(--mono); }
.th-chip { padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }

/* the island's condition cards */
.isl-body .cn { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 14px 18px; }
.isl-body .cn-name b { font-size: 16px; font-weight: 700; }
.isl-body .cn-nar { font-size: 14.5px; line-height: 1.5; color: var(--muted); }

/* the composer: one rounded field with a soft lift; labelled chips inside */
.ag-main .ag-composer textarea { border-radius: 24px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: 0 1px 2px rgba(31,30,29,.05), 0 6px 20px rgba(31,30,29,.06); -webkit-backdrop-filter: none; backdrop-filter: none; font-size: 16.5px; line-height: 24px; }
.ag-main .ag-composer textarea:focus, .ag-main .ag-composer textarea:focus-visible { outline: none; border-color: color-mix(in srgb, var(--primary) 45%, var(--border-strong)); box-shadow: 0 0 0 4px var(--primary-soft), 0 6px 20px rgba(31,30,29,.06); }
.ctxc { height: 30px; padding-inline: 12px; border-color: var(--border); background: var(--surface-2); color: var(--muted); font-size: 13px; }
.ctxc:not(.on) .cl, .ctxc .cl { display: inline; }
.ctxc .ico { color: var(--muted); }
.ctxc.on { background: var(--amber-soft); border-color: color-mix(in srgb, var(--emblem) 55%, var(--border)); color: var(--text); }
.ctxc.on .ico { color: var(--amber); }

/* the chips above the composer: plain pills */
.st-chip { height: 34px; padding: 0 15px; border-color: var(--border); background: var(--surface); font-size: 13.5px; box-shadow: 0 1px 2px rgba(31,30,29,.04); }
.st-chip .ico { display: none; }
.st-chip.lead { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--surface); color: var(--primary-text); font-weight: 600; }
.st-chip:hover { background: var(--surface-2); border-color: var(--border-strong); }

/* the drawer: underlined tabs with labels, a quiet filter, square ticks, the selection in amber */
.dr-tabs { padding: 0; gap: 2px; border: 0; background: none; }
.dr-tab { position: relative; height: 38px; padding: 0 12px; border-radius: 0; background: none; font-size: 13.5px; }
.dr-tab .cl, .dr-tab.on .cl { display: inline; }
.dr-tab.on { background: none; box-shadow: none; color: var(--text); font-weight: 600; }
.dr-tab.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px; background: var(--emblem); }
.dr-s { border-color: transparent; background: var(--surface-2); border-radius: 12px; }
.dr-ck { border-radius: 6px; }
.dr-row { padding: 9px 12px; border-radius: 12px; }
.dr-row.on { background: var(--amber-soft); }
.ag-main > .drawer .drawer-panel { border-radius: 22px 22px 0 0; }

/* the veil behind an open island, drawer or panel: the page steps back, light and blurred, not greyed out */
.ag-composer.dr-on::before, .ag-main > .drawer .drawer-bg { background: color-mix(in srgb, var(--bg) 52%, transparent); backdrop-filter: blur(6px) saturate(.9); -webkit-backdrop-filter: blur(6px) saturate(.9); }
:root:not([data-theme="light"]) .ag-composer.dr-on::before, :root:not([data-theme="light"]) .ag-main > .drawer .drawer-bg { background: rgba(0, 0, 0, .34); }
.islandmsg.is-open .isl, .ag-main > .drawer .drawer-panel, .ag-drawer { box-shadow: 0 1px 2px rgba(31,30,29,.05), 0 24px 60px rgba(31,30,29,.16); }
/* the briefing's status dot sits beside the mark, not on it */
.hero-av .hero-live { top: -4px; right: -7px; width: 9px; height: 9px; }

/* ---- polish pass: the film's colours and type scale ---- */
:root { --brand-grad: linear-gradient(92deg, #c27a26 0%, #9a6a2c 40%, #3a674f 100%); }
/* the warm field inside the window (the film's two glows: amber top left, green bottom right) */
.ag-main, .ag[data-size="classic"] > .ag-main, .ag[data-size="large"] > .ag-main { background:
  radial-gradient(900px 620px at -4% -8%, color-mix(in srgb, var(--emblem) 12%, transparent), transparent 70%),
  radial-gradient(900px 720px at 104% 108%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 70%), var(--bg); }
/* gradient type for the headings of the empty and welcome states, as in the film's titles */
.ag-empty h2, .wl-h h2, .lg-box h2 { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-family: var(--sans); font-weight: 700; letter-spacing: -.025em; }

/* your message: the film's warm grey with dark text (not a green fill) */
.ag-m.u .b, :root[data-theme="light"] .ag-m.u .b { background: var(--surface-3); color: var(--text); border: 0; border-radius: 22px; padding: 12px 20px; font-size: 17px; line-height: 1.45; font-weight: 400; box-shadow: none; }
.ag-m .b.dict, :root[data-theme="light"] .ag-m .b.dict { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 1px 2px rgba(31,30,29,.04); }

/* the header: a patient pill with an avatar, readable sizes */
.apphead { background: color-mix(in srgb, var(--bg) 92%, transparent); }
.apphead .bar-pt { height: 38px; padding: 0 12px 0 5px; gap: 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.apphead .bar-pt svg { width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: var(--primary-soft); stroke: var(--primary-text); }
.apphead .bar-pt select { font: 600 15px var(--sans); color: var(--text); }
.ah-meta { font-size: 13.5px; }
.apphead .btn.sm, .apphead .bar-btn { font-size: 14px; }
.apphead .chip { font-size: 12.5px; }

/* one type scale, a step up (the film's sizes) */
.isl-t, .isl-ai b { font-size: 14.5px; }
.st-chip, .qa { font-size: 14px; }
.ctxc, .dr-tab { font-size: 13.5px; }
.ag-main .ag-composer textarea { font-size: 17.5px; }
.isl-body .pc-main b, .isl-body .pc-t b, .isl-r-1 b, .dr-row b, .sa-l1 b { font-size: 15.5px; font-weight: 700; }
.isl-sub, .isl-r-m, .pc-m, .cn-meta, .dr-row small { font-size: 13.5px; }
.ig h4 { font: 600 12.5px var(--sans); letter-spacing: .08em; }
.isl-body .ai-link, .isl-body .btn.sm, .ns-btn { font-size: 13.5px; }
.ag-answer { font-size: 17.5px; }
.ag-think { font-size: 15.5px; }

/* quieter extras: the welcome tip and the Dig deeper pill */
.wl-tip { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 10px 14px; font-size: 14px; box-shadow: 0 1px 2px rgba(31,30,29,.04); }
.qa { height: 34px; padding: 0 15px; border-color: var(--border); background: var(--surface); box-shadow: 0 1px 2px rgba(31,30,29,.04); }
.qa:hover { background: var(--surface-2); border-color: var(--border-strong); }

/* action items as the film's cards: a hairline card per item, soft filled chips, boxed actions */
.isl-body li.ai { margin: 0 0 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(31,30,29,.04); }
.isl-body li.ai .pc-main { padding: 10px 12px; }
.isl-body li.ai .pc-main:hover { background: var(--surface-2); border-radius: 13px; }
.isl-body li.ai .ic { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; color: var(--faint); }
.ai-badge, .ai-badge.kind { border: 0; background: var(--surface-3); color: var(--muted); padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.ai-badge.late { background: var(--red-soft); color: var(--red); }
/* the pull hint: a quiet card, not a dashed box */
.ag-hint { border: 1px solid var(--border); border-style: solid; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(31,30,29,.04); }
.ag-hint .hph { border: 0; background: var(--amber-soft); color: var(--amber); border-radius: 999px; }
.ag-hint .ag-chip { height: 32px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13.5px; }
.ag-tail .ag-hint, .ag-hint[class*="ph-"] { background: var(--surface); border-color: var(--border); }
.pc-tag, .ai-badge { text-transform: none; letter-spacing: 0; }

/* ---- dialogs: the film's billing modal for every one (codes, pull approval, Mark done / Snooze / Dismiss, the welcome, the note, the menus) ---- */
.modal-bg, .ai-dlg-bg, .wl-scrim { background: rgba(31,30,29,.18); backdrop-filter: blur(6px) saturate(.9); -webkit-backdrop-filter: blur(6px) saturate(.9); }
:root:not([data-theme="light"]) .modal-bg, :root:not([data-theme="light"]) .ai-dlg-bg, :root:not([data-theme="light"]) .wl-scrim { background: rgba(0,0,0,.45); }
.modal-box, .ai-dlg, .wl-box .wl { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 2px 6px rgba(31,30,29,.06), 0 30px 80px rgba(31,30,29,.20); }
.wl-box { border-radius: 22px; }
.modal-box { width: min(780px, 94vw); padding: 24px 28px 20px; }
.ai-dlg { width: min(600px, 100%); padding: 22px 26px 18px; }
/* the head: a bold title, a small uppercase eyebrow, a round close */
.modal-box .agm-h h3, .ai-dlg .dl-h h2 { margin: 0; font: 700 21px/1.25 var(--sans); letter-spacing: -.01em; color: var(--text); }
.ai-dlg .dl-h small { display: block; margin-bottom: 3px; font: 600 12.5px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.modal-box .agm-h [data-code-close], .modal-box .agm-h [data-agm-close], .ai-dlg .dl-h .dr-x { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--faint); font-size: 15px; }
.modal-box .agm-b p, .modal-box p, .ai-dlg .dl-why { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.modal-box .agm-b p b { color: var(--text); }
/* code rows: hairline cards, mono codes, soft tier pills */
.cd-modal-list { margin: 14px 0 10px; }
.cd-row { padding: 12px 16px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.cd-top { display: flex; align-items: center; gap: 10px; }
.modal-box .cd-chip { display: inline-flex; align-items: baseline; gap: 8px; padding: 0; border: 0; background: none; }
.modal-box .cd-chip b, .modal-box .cd-chip .mono { font: 700 15px var(--mono); color: var(--text); }
.modal-box .cd-chip em { font-style: normal; font-size: 12.5px; color: var(--faint); }
.cd-desc { margin-top: 4px; font-size: 15px; font-weight: 600; color: var(--text); }
.cd-why { font-size: 13.5px; color: var(--muted); }
.modal-box .chip.green, .modal-box .chip.amber { margin-left: auto; padding: 4px 11px; border: 0; border-radius: 999px; font-size: 13px; font-weight: 600; }
.modal-box .chip.green { background: var(--green-soft); color: var(--green); }
.modal-box .chip.amber { background: var(--amber-soft); color: var(--amber); }
/* the foot: no rule, pill buttons; the primary solid green, the rest quiet */
.modal-box .agm-f, .ai-dlg .dl-foot { align-items: center; gap: 10px; margin-top: 18px; padding-top: 0; border-top: 0; }
.modal-box .agm-f .btn, .ai-dlg .dl-foot .ai-btn { height: 42px; padding: 0 20px; border-radius: 999px; font: 600 15px var(--sans); }
.modal-box .agm-f .btn.primary, .ai-dlg .dl-foot .ai-btn.pri { min-width: 168px; justify-content: center; border: 0; background: var(--primary); color: var(--primary-ink); }
.modal-box .agm-f .btn.ghost, .ai-dlg .dl-foot .ai-btn:not(.pri) { border: 0; background: none; color: var(--muted); }
.modal-box .agm-f .btn.ghost:hover, .ai-dlg .dl-foot .ai-btn:not(.pri):hover { color: var(--text); background: var(--surface-2); }
.ai-dlg .dl-who { font-size: 13px; color: var(--faint); }
/* fields inside a dialog */
.ai-dlg input:not([type="radio"]):not([type="checkbox"]), .ai-dlg select, .ai-dlg textarea { border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); padding: 10px 12px; font: 15px/1.45 var(--sans); }
.ai-dlg input:focus, .ai-dlg select:focus, .ai-dlg textarea:focus { outline: none; border-color: color-mix(in srgb, var(--primary) 45%, var(--border-strong)); box-shadow: 0 0 0 4px var(--primary-soft); }
/* the note popover and the header menus: the same card */
.ag-notepop, .vmenu { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 2px 6px rgba(31,30,29,.06), 0 24px 60px rgba(31,30,29,.16); -webkit-backdrop-filter: none; backdrop-filter: none; }
:root:not([data-theme="light"]) .ag-notepop { background: var(--surface); }
.ag-notepop { padding: 18px; }
.np-h b { font: 700 17px var(--sans); }
.np-h span { font-size: 13.5px; }
.ag-notepop textarea { border-radius: 12px; font-size: 15.5px; }
.wl-h h2, .ag-empty h2, .lg-box h2 { width: fit-content; }
.ag-empty h2 { margin-inline: auto; }
.ai-dlg :focus-visible { outline-offset: 1px; }
.np-f .btn { height: 38px; padding: 0 16px; border-radius: 999px; font-size: 14px; }

/* ---- the whole app, as in the film ---- */
/* the warm field on every page, not only the assistant */
body { background:
  radial-gradient(1100px 720px at 6% -12%, color-mix(in srgb, var(--emblem) 12%, transparent), transparent 70%),
  radial-gradient(1000px 820px at 104% 112%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }
.main { background: transparent; }
/* the header: quiet; the provider's view drops the console's counts; status chips are neutral */
body:not(.dev) .ah-meta { display: none; }
.apphead .chip { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 3px 10px; }
.apphead .btn.sm.ghost, .apphead .bar-btn { color: var(--muted); border-radius: 999px; }
.apphead .btn.sm.ghost:hover, .apphead .bar-btn:hover { color: var(--text); background: var(--surface-2); }
/* the composer's own buttons: round and bordered like the film's mic; send stays the green circle */
.ag-composer .note, .ag-composer .mic { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--muted); }
.ag-composer .note:hover, .ag-composer .mic:hover { color: var(--text); background: var(--surface-2); }
.ag-composer .send { width: 38px; height: 38px; }
/* the console's other pages share the window: a hairline card, a soft lift, the film's radius */
.card, .panel, .adm-card, .stat { border-color: var(--border); border-radius: 16px; box-shadow: 0 1px 2px rgba(31,30,29,.04); }
/* page titles bold and tight, as in the film; the search page's wordmark like the header's */
.page-head h1, .su-head h2 { font-family: var(--sans); font-weight: 700; letter-spacing: -.025em; }
.page-head h1 { font-size: 26px; }
.gs-logo > span:not(.logo) { font-family: var(--sans); font-weight: 700; letter-spacing: -.035em; }
.wl-f .btn, .lg-box .btn { border-radius: 999px; height: 42px; padding: 0 22px; font-weight: 600; }
.main h1 { font-family: var(--sans); font-weight: 700; letter-spacing: -.025em; }

/* ---- the island as in the film: a pill with the mark, what it is and the counts; open, the same head over text tabs ---- */
.islandmsg .isl { padding: 0; }
.isl-head { display: flex; align-items: center; gap: 10px; width: 100%; height: 52px; padding: 0 16px 0 18px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; white-space: nowrap; border-radius: inherit; }
.isl-head:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.isl-head > b { font: 700 15px var(--sans); letter-spacing: -.01em; }
.isl-head .isl-mark { display: grid; place-items: center; width: 20px; height: 20px; color: var(--emblem); }
.isl-head .isl-mark .ico, .isl-head .isl-mark svg { width: 19px; height: 19px; }
.isl-head.busy .isl-mark { animation: spin 2.4s linear infinite; }
.isl-sum { font-size: 13.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; }
.isl-sum em { font-style: normal; }
.isl-sum .isl-late { color: var(--red); }
.isl-sum .isl-new { color: var(--amber); }
.isl-chev { display: grid; place-items: center; margin-left: auto; padding-left: 14px; color: var(--faint); transition: transform .2s; }
.islandmsg.is-open .isl-chev { transform: rotate(180deg); }
.ag-isl.nudge:not(.is-open) .isl-chev { animation: islDip 5s ease-in-out 1.6s infinite; }
/* closed: only the head; open: the tabs beneath it, underlined, text only */
.islandmsg:not(.is-open) .isl-bar { display: none; }
.islandmsg.is-open .isl-head { border-radius: 24px 24px 0 0; }
.isl-bar { justify-content: flex-start; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.isl-t, .isl-t.on { height: 42px; padding: 0 12px; border-radius: 0; background: none; font-size: 15px; }
.isl-t.on { color: var(--text); font-weight: 600; }
.isl-bar { position: relative; }
.isl-ul { position: absolute; left: 0; bottom: 0; width: 0; height: 2px; border-radius: 2px; background: var(--emblem); opacity: 0; pointer-events: none; transition: transform .4s var(--isl-io, ease), width .4s var(--isl-io, ease), opacity .2s; }   /* one underline that slides from tab to tab (island.js islUnderline) */
.isl-t:hover { background: none; color: var(--text); }
.isl-t b, .isl-t.on b { margin-left: 2px; font-size: 12.5px; color: var(--faint); }
@media (max-width: 760px) { .isl-t span, .isl-t.on span { display: inline !important; } .isl-sum { display: none; } .isl-bar { overflow-x: auto; } }

/* ---- the drawer as in the film: tabs and close on one row, the filter beneath, labelled pills, a green selection bar ---- */
.dr-h { flex-wrap: wrap; row-gap: 8px; }
.dr-h .dr-tabs { order: 1; flex: 1 1 auto; }
.dr-h .dr-x { order: 2; }
.dr-h .dr-s { order: 3; flex: 1 0 100%; margin: 0; }
.dr-pill { height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font: 500 13px var(--sans); white-space: nowrap; cursor: pointer; }
.dr-pill:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.dr-btns { gap: 6px; }
.dr-sel { align-items: center; gap: 12px; margin-top: 8px; padding: 6px 8px 6px 16px; border: 0; border-radius: 12px; background: var(--primary); color: var(--primary-ink); font-size: 14.5px; }
.dr-sel .sel-n b { font-weight: 700; }
.dr-sel .sel-n .ico { color: var(--primary-ink); }
.dr-sel .sel-k { color: color-mix(in srgb, var(--primary-ink) 72%, transparent); }
.dr-sel .btn.primary { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--primary-ink); color: var(--primary); font-weight: 600; }
.dr-sel .icon-btn { color: var(--primary-ink); }
.dr-wrap:has(> .dr-row.on) { border-radius: 12px; background: var(--amber-soft); }
.dr-wrap > .dr-row.on { background: none; }
.dr-ck { display: grid; place-items: center; }
.dr-row.on .dr-ck { box-shadow: none; }
.dr-row.on .dr-ck::after { content: '✓'; color: var(--primary-ink); font: 800 11px/1 var(--sans); }
/* the drawer's tabs are text, as in the film */
.dr-tab .ico, .dr-tab > svg { display: none; }

/* ---- your note (typed or dictated): a white card with dark text in both themes (70-glass painted its text white for a green fill) ---- */
.ag-m .b.dict, :root[data-theme="light"] .ag-m .b.dict, :root:not([data-theme="light"]) .ag-m .b.dict { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 1px 2px rgba(31,30,29,.04); }
.ag-m .b.dict .dtext, :root[data-theme="light"] .ag-m .b.dict .dtext, .ag-m .b.dict .dtext textarea, :root[data-theme="light"] .ag-m .b.dict .dtext textarea { color: var(--text); }
.ag-m .b.dict .dtext textarea { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.ag-m .b.dict .dtext.empty::before, .ag-m .b.dict .dtext.empty::after { background: var(--muted); }
.ag-m .b.dict.live { border-color: color-mix(in srgb, var(--red) 40%, var(--border)); box-shadow: 0 0 0 4px var(--red-soft); }
.b.dict .dacts { border-top: 1px solid var(--border); }

/* ---- billing: the shared drawer becomes the film's modal whenever it holds the billing sheet ---- */
@keyframes billIn { from { opacity: 0; transform: translate(-50%, -47%) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%); } }
.ag-main > .drawer:has([data-bill-root]) .drawer-panel { top: 50%; left: 50%; right: auto; bottom: auto; width: min(820px, calc(100% - 48px)); max-height: min(86%, 780px); min-height: 0; padding: 22px 28px 0; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); box-shadow: 0 2px 6px rgba(31,30,29,.06), 0 30px 80px rgba(31,30,29,.20); transform: translate(-50%, -50%); animation: billIn .24s cubic-bezier(.2, .8, .2, 1) both; }
.ag-main > .drawer:has([data-bill-root]) .drawer-panel::before { display: none; }
.ag-main > .drawer:has([data-bill-root]) .drawer-panel > .row { position: absolute !important; top: 18px; right: 20px; z-index: 3; margin: 0 !important; padding: 0; background: none; }
.ag-main > .drawer:has([data-bill-root]) .drawer-panel > .row .muted { display: none; }
.ag-main > .drawer:has([data-bill-root]) .drawer-panel > .row .btn { height: 34px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); }
.bill .bl-h { padding-right: 96px; gap: 12px; }
.bill .bl-h h2 { font: 700 21px/1.25 var(--sans); letter-spacing: -.01em; }
.bill .bl-h .chip { border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); border-radius: 999px; font-size: 13px; }
.bill .bl-lead { font-size: 14.5px; color: var(--muted); }
.bill .bl-sec { font: 600 12.5px var(--sans); letter-spacing: .08em; color: var(--faint); margin: 18px 0 8px; }
.ag-main > .drawer .bill .bl-cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.bill .bl-card, .ag-main > .drawer .bill .bl-card { padding: 12px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.bill .bl-top b { font-size: 15.5px; font-weight: 700; }
.bill .bl-from, .bill .bl-note { font-size: 13.5px; }
.bill .bl-chip { height: 32px; padding: 0 12px 0 8px; border-color: var(--border); background: var(--surface); }
.bill .bl-chip b { font: 700 14px var(--mono); }
.bill .bl-ck { border-radius: 6px; }
.ag-main > .drawer:has([data-bill-root]) .bl-foot { justify-content: flex-end; margin: 18px -28px 0; padding: 14px 28px 18px; border-top: 1px solid var(--border); box-shadow: none; }
.bill .bl-foot .btn { height: 42px; padding: 0 20px; border-radius: 999px; font: 600 15px var(--sans); }
.bill .bl-foot .btn.primary { min-width: 168px; justify-content: center; }
.bill .bl-foot .chip.green { padding: 6px 14px; border: 0; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 600; }

/* ---- narrow windows: the header sheds labels before anything collides ---- */
.apphead .ah-l { min-width: 0; }
.apphead .ah-r { flex-shrink: 0; }
@media (max-width: 1180px) { .apphead #agFresh { display: none !important; } }
@media (max-width: 980px) { .apphead .bar-btn span, .apphead #ahFont span { display: none; } .apphead #agStmts { display: none !important; } }

/* ---- loose ends from the sweep ---- */
/* the billing line under an answer: the film's chips (green Supported, amber Review), mono codes */
.cd-lbtn { height: 34px; padding: 0 10px 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px rgba(31,30,29,.04); font-size: 14px; }
.cd-lbtn:hover { background: var(--surface-2); }
.cd-lbtn .cd-bill { font-weight: 700; color: var(--text); }
.cd-line .cd-chip { height: 24px; padding: 0 9px; border: 0; border-radius: 8px; }
.cd-line .cd-chip b { font: 600 13px var(--mono); color: inherit; }
.cd-line .cd-chip.sup { background: var(--green-soft); color: var(--green); }
.cd-line .cd-chip.rev { background: var(--amber-soft); color: var(--amber); }
.cd-lbtn .cd-car { color: var(--amber); font-weight: 600; }
/* the "new" dot on Changes: a dot, beside the label */
.isl-t.isl-hot::after { top: 12px; right: 2px; bottom: auto; left: auto; width: 7px; height: 7px; border-radius: 50%; }
/* toasts: the film's card, top right under the header (never over the composer) */
#toasts { top: calc(var(--head-h, 52px) + 14px); bottom: auto; right: 20px; }
.toast { border: 1px solid var(--border); border-left: 0; border-radius: 14px; background: var(--surface); color: var(--text); padding: 12px 16px 12px 14px; box-shadow: 0 2px 6px rgba(31,30,29,.06), 0 16px 40px rgba(31,30,29,.14); -webkit-backdrop-filter: none; backdrop-filter: none; font-size: 14px; position: relative; }
.toast::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--green); }
.toast.warn::before { background: var(--amber); } .toast.bad::before { background: var(--red); }
:root:not([data-theme="light"]) .toast { background: var(--surface); }
/* the conversation fades under the island, as in the film, and into the chips above the composer: a row cut by the bottom edge reads as "more below", never as text under the chips */
#agMsgs { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 56px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to bottom, transparent 0, #000 56px, #000 calc(100% - 24px), transparent); }
/* the "New here?" tip: one quiet line on the briefing's foot, beside "Dig deeper" (never a card of its own that the chips above the composer could cut) */
.pc-foot { flex-wrap: wrap; row-gap: 8px; }
.pc-foot .wl-tip { flex: 1 1 auto; justify-content: flex-end; min-width: 0; gap: 8px; padding: 0; border: 0; background: none; box-shadow: none; font-size: 13.5px; color: var(--muted); }
.pc-foot .wl-tip .wl-ic { display: none; }
.pc-foot .wl-tip button { margin-left: 0; }
.pc-foot .pc-by { flex: 1 0 100%; }
body:not(.dev) .pc-foot .pc-by { display: none; }
/* a disabled primary looks disabled */
.btn.primary:disabled, .btn.primary[disabled], .ai-btn.pri:disabled { opacity: .45; cursor: default; }
/* Console view: the skill picker in the header scrolls and fades at its edge instead of cutting a word. The left group keeps its own width
   (its status chips never slide under the picker); the picker takes what is left and scrolls. */
@media (min-width: 900px) { body.dev .apphead .ah-l { flex: none; } }
.ah-skills { min-width: 0; flex: 0 1 auto; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.ag-ctx.tight .ctxc:not(.on) .cl { display: none; } .ag-ctx.tight .ctxc { padding-inline: 10px; }   /* the record chips when the row does not fit (drawer.js agComposerFit): icon and count, the tip names them */
