/* Beacon Beam trusted chrome, on the Beacon brand (beacon-brand skill: tokens, two-blue rule,
   WCAG 2.1 AA). Self-hosted only: the trusted CSP is default-src 'self' with no inline style, so
   fonts, logos and icons all come from /static and every rule lives in this file. */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin.52d04440a9fa.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin-ext.5ffe46eeb00d.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

/* --- tokens ---------------------------------------------------------------------------------
   Light is the brand default; dark is the brand's own dark palette, chosen by the person (the
   account menu's Theme) or, on System, by the device setting.
   Every text pair is measured in tests/test_brand.py. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #ffffff;
  --subtle: #f1f5f9;
  --disabled-text: #94a3b8;  /* WCAG exempts disabled controls; kept a token so it is themed in one place */
  --line: #e2e8f0;            /* decorative dividers only */
  --edge: #64748b;            /* component boundaries: inputs, secondary buttons (3:1+) */
  --edge-strong: #334155;     /* a hovered input's border */
  --heading: #1b2a4a;
  --text: #334155;
  --muted: #64748b;           /* on --bg / --surface only */
  --muted-subtle: #475569;    /* muted text on --subtle */
  --link: #2e6fcc;
  --link-hover: #2660b3;
  --link-subtle: #2660b3;     /* links on --subtle */
  --primary: #2660b3;         /* primary button fill under a white label (6.2:1) */
  --primary-hover: #214f94;
  --primary-active: #1b2a4a;
  --on-primary: #ffffff;
  --brand: #3b86f2;           /* fills and graphics only, never text */
  --brand-fade: rgba(59, 134, 242, 0);
  --brand-green: #5bcc3e;
  --focus: #2e6fcc;
  --error: #dc2626;
  --error-text: #b91c1c;
  --error-bg: #fef2f2;
  --success-text: #15803d;
  --success-bg: #f0fdf4;
  --warn-text: #b45309;
  --warn-bg: #fffbeb;
  --info-bg: #eff6ff;
  --info-text: #2660b3;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --on-danger: #ffffff;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-xl: 0 12px 32px rgba(15, 23, 42, 0.14);
  --ring: rgba(59, 134, 242, 0.10);
  /* The sign-in brand panel: Beacon navy in both themes, with the logo's signal green. */
  --brand-panel: #1b2a4a;
  --on-brand-panel: #ffffff;
  --on-brand-panel-muted: #cbd5e1;
  --brand-panel-line: #475569;  /* decorative divider on the navy panel */
  --signal: #77d860;            /* the logo's arcs: graphics only */
  /* Behind a Beam's frame: a white sheet in light (as a plain page expects); none in dark. */
  --frame-bg: #ffffff;
  /* Type scale: the brand's mobile-first scale, stepped up on wide screens for real hierarchy. */
  --fs-display: 48px;
  --fs-h1: 32px;
  --fs-h2: 22px;
  --fs-h3: 18px;
  --fs-lede: 18px;
  --fs-small: 14px;
  --header-h: 56px;
  --radius: 6px;
  /* Density (the approved design pass): Drive/Claude sizes on desktop; the brand's 16px text and
     44px tap targets on phones (the media query below). */
  --fs: 14px;
  --fs-s: 13px;
  --h: 32px;      /* buttons, inputs, pickers */
  --row: 40px;    /* list rows */
  --switch-on: #2660b3;
  --menu-shadow: 0 4px 16px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.06);
  --edit-moved: #6d28d9;      /* direct editing: the "Moved" label */
  --radius-card: 16px;
}
/* The person's choice (theme.py renders it on <html>; System is the default). Dark is declared twice,
   identically (tests/test_brand.py pins that): once for Dark, once for System on a dark device. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12161c;
  --surface: #1a1f27;
  --subtle: #232a35;
  --line: #2a313c;
  --edge: #94a3b8;
  --heading: #f8fafc;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --muted-subtle: #cbd5e1;
  --link: #8dbaf8;
  --link-hover: #bfdbfe;
  --link-subtle: #8dbaf8;
  --primary: #2660b3;
  --primary-hover: #2e6fcc;
  --primary-active: #214f94;
  --on-primary: #ffffff;
  --brand: #5b9bf5;
  --brand-fade: rgba(91, 155, 245, 0);
  --brand-green: #7dd968;
  --focus: #5b9bf5;
  --error: #f87171;
  --error-text: #fca5a5;
  --error-bg: #3b1f2b;
  --success-text: #86efac;
  --success-bg: #183a2f;
  --warn-text: #fcd34d;
  --warn-bg: #3a2f1c;
  --info-bg: #1e3a64;
  --info-text: #bfdbfe;
  --danger: #f87171;
  --danger-hover: #fca5a5;
  --on-danger: #1b2a4a;
  --shadow-sm: 0 1px 3px rgba(2, 6, 23, 0.40);
  --shadow-md: 0 4px 12px rgba(2, 6, 23, 0.40);
  --shadow-lg: 0 8px 24px rgba(2, 6, 23, 0.45);
  --shadow-xl: 0 12px 32px rgba(2, 6, 23, 0.55);
  --ring: rgba(91, 155, 245, 0.11);
  --brand-panel: #1b2a4a;
  --on-brand-panel: #ffffff;
  --on-brand-panel-muted: #cbd5e1;
  --brand-panel-line: #475569;
  --signal: #7dd968;
  --frame-bg: transparent;
  --edge-strong: #cbd5e1;
  --switch-on: #5b9bf5;  /* the deep primary is 2.9:1 on --bg; a state cue needs 3:1 */
  --menu-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(148, 163, 184, 0.16);
  --edit-moved: #c4b5fd;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161c;
    --surface: #1a1f27;
    --subtle: #232a35;
    --line: #2a313c;
    --edge: #94a3b8;
    --heading: #f8fafc;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --muted-subtle: #cbd5e1;
    --link: #8dbaf8;
    --link-hover: #bfdbfe;
    --link-subtle: #8dbaf8;
    --primary: #2660b3;
    --primary-hover: #2e6fcc;
    --primary-active: #214f94;
    --on-primary: #ffffff;
    --brand: #5b9bf5;
    --brand-fade: rgba(91, 155, 245, 0);
    --brand-green: #7dd968;
    --focus: #5b9bf5;
    --error: #f87171;
    --error-text: #fca5a5;
    --error-bg: #3b1f2b;
    --success-text: #86efac;
    --success-bg: #183a2f;
    --warn-text: #fcd34d;
    --warn-bg: #3a2f1c;
    --info-bg: #1e3a64;
    --info-text: #bfdbfe;
    --danger: #f87171;
    --danger-hover: #fca5a5;
    --on-danger: #1b2a4a;
    --shadow-sm: 0 1px 3px rgba(2, 6, 23, 0.40);
    --shadow-md: 0 4px 12px rgba(2, 6, 23, 0.40);
    --shadow-lg: 0 8px 24px rgba(2, 6, 23, 0.45);
    --shadow-xl: 0 12px 32px rgba(2, 6, 23, 0.55);
    --ring: rgba(91, 155, 245, 0.11);
    --brand-panel: #1b2a4a;
    --on-brand-panel: #ffffff;
    --on-brand-panel-muted: #cbd5e1;
    --brand-panel-line: #475569;
    --signal: #7dd968;
    --frame-bg: transparent;
    --edge-strong: #cbd5e1;
    --switch-on: #5b9bf5;  /* the deep primary is 2.9:1 on --bg; a state cue needs 3:1 */
    --menu-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(148, 163, 184, 0.16);
    --edit-moved: #c4b5fd;
  }
}

/* --- base ------------------------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--fs);
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--heading); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 28px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); line-height: 1.3; font-weight: 600; }
h3 { font-size: var(--fs-h3); line-height: 1.4; font-weight: 600; }
@media (max-width: 640px) {
  :root { --fs-display: 30px; --fs-h1: 28px; --fs-lede: 16px; --fs: 16px; --fs-s: 14px; --h: 44px; --row: 52px; }
}
p { margin: 0 0 16px; }
a { color: var(--link); text-decoration: none; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration: underline; }
/* A link inside running text keeps its underline: colour alone isn't enough there (WCAG 1.4.1). */
p a:not(.btn), .lede a, .notice a, .fine-print a { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: var(--subtle); color: var(--heading); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }
bdi { unicode-bidi: isolate; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 16px; top: -64px; z-index: 50; padding: 8px 12px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-md); }
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); }
.lede { color: var(--muted); margin-bottom: 24px; }
.fine-print { color: var(--muted); font-size: 14px; margin: 24px 0 0; }
.error { color: var(--error-text); }

/* --- brand marks ----------------------------------------------------------------------------
   The logo is the supplied file drawn as a background (role="img" + aria-label in markup), so a
   trusted page needs no <img>; icons are single-color SVG masks that follow currentColor. */
.logo { display: block; flex: none; width: 84px; height: 44px; background: url("img/beacon-logo.e83d4a779e0b.png") center / contain no-repeat; }
.logo-lg { width: 122px; height: 64px; }
.product { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--heading); letter-spacing: -0.02em; text-decoration: none; }
.product::before {
  /* The Beam mark: a short bar of light, brand blue fading out. */
  content: ""; width: 20px; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-fade));
}
.brand-lockup { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; flex: none; }
.brand-lockup:hover { color: inherit; }
.brand-lockup .divider { width: 1px; height: 24px; background: var(--line); }
.icon { display: inline-block; flex: none; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.i-link { --i: url("icons/link.f39ee4c3c429.svg"); }
.i-list { --i: url("icons/list.45711c7179bd.svg"); }
.i-doc { --i: url("icons/doc.cf0943f4feac.svg"); }
.i-share { --i: url("icons/share.525581f8a6ff.svg"); }
.i-more { --i: url("icons/more.0a98594ae571.svg"); }
.i-more-v { --i: url("icons/more-v.c318ca83608a.svg"); }
.i-history { --i: url("icons/history.82056e7a7d1b.svg"); }
.i-bell-first { --i: url("icons/bell-first.ec17a38d3d1f.svg"); }
.i-bell-every { --i: url("icons/bell-every.b2ad7139b687.svg"); }
.i-eye { --i: url("icons/eye.772f085b01f0.svg"); }
.i-star { --i: url("icons/star.e8e30c0cdd09.svg"); }
.i-copy { --i: url("icons/copy.4766cabc874d.svg"); }
.i-trash { --i: url("icons/trash.556466a0a0e5.svg"); }
.i-search { --i: url("icons/search.8262d6fdb003.svg"); }
.i-signout { --i: url("icons/signout.7c5f25710d12.svg"); }
.i-check { --i: url("icons/check.8d0a315af360.svg"); }
.i-upload { --i: url("icons/upload.9aed640ae83d.svg"); }
.i-download { --i: url("icons/download.49f7e78b8d50.svg"); }
.i-back { --i: url("icons/back.84b2aad28918.svg"); }
.i-plug { --i: url("icons/plug.6ddebdccc128.svg"); }
.i-flag { --i: url("icons/flag.b59feae8ac5b.svg"); }
.i-flag-on { --i: url("icons/flag-on.aa78e9297890.svg"); }
.i-inbox { --i: url("icons/inbox.c5a39991d9f3.svg"); }
.i-user { --i: url("icons/user.7a6c06c82bc0.svg"); }
.i-x { --i: url("icons/x.62169d1989fd.svg"); }
.i-comment { --i: url("icons/comment.57b88d354ea3.svg"); }
.i-plus { --i: url("icons/plus.4490d467ce63.svg"); }
.i-edit { --i: url("icons/edit.c725ec7e4b62.svg"); }
.i-up { --i: url("icons/up.e8f31404ca6f.svg"); }
.i-down { --i: url("icons/down.3a79428886e0.svg"); }
.i-open { --i: url("icons/open.1dc321a16d8f.svg"); }
.i-move { --i: url("icons/move.177660df77b6.svg"); }
.i-out { --i: url("icons/out.a9db433d1ccb.svg"); }
.i-page { --i: url("icons/page.179ea62792b4.svg"); }
.i-sun { --i: url("icons/sun.4885103e05ec.svg"); }
.i-moon { --i: url("icons/moon.0de5a4a18ae1.svg"); }
.i-monitor { --i: url("icons/monitor.de155dce2d21.svg"); }
.i-folder { --i: url("icons/folder.752298aad692.svg"); }
.i-caret { --i: url("icons/caret.fb16f65151d2.svg"); }
.i-building { --i: url("icons/building.9728bec3ac32.svg"); }
.i-globe { --i: url("icons/globe.dd47f4a2a68a.svg"); }
.i-sync { --i: url("icons/sync.bdf6d1569550.svg"); }
.i-present { --i: url("icons/present.790fb4534c81.svg"); }
.i-exit-full { --i: url("icons/exit-full.32cf0359fc06.svg"); }

/* --- buttons (the design pass: primary, secondary, text, icon) ------------------------------------
   Secondary is the default; one primary per screen; .text for most actions (.ghost is its old name). */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--h); padding: 0 12px; margin: 0;
  font-family: inherit; font-size: var(--fs); font-weight: 500; line-height: 1;
  color: var(--heading); background: transparent;
  border: 1px solid var(--edge); border-radius: var(--radius);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
button:hover, .btn:hover { background: var(--subtle); color: var(--heading); text-decoration: none; }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
button.primary:hover, .btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
button.primary:active, .btn.primary:active { background: var(--primary-active); border-color: var(--primary-active); }
button.text, .btn.text, button.ghost, .btn.ghost { border-color: transparent; color: var(--link); padding: 0 8px; }
button.text:hover, .btn.text:hover, button.ghost:hover, .btn.ghost:hover { background: var(--subtle); color: var(--link-subtle); }
button.danger, .btn.danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
button.danger:hover, .btn.danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); color: var(--on-danger); }
button.block, .btn.block { width: 100%; }
button:disabled, button:disabled:hover { background: var(--line); border-color: var(--line); color: var(--disabled-text); cursor: default; }
/* A primary that is not ready yet (Move before a folder is picked) keeps its colour, faded. */
button.primary:disabled, button.primary:disabled:hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); opacity: 0.45; }
.btn .icon, button .icon { width: 16px; height: 16px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: var(--h); height: var(--h); padding: 0; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover, details[open] > summary.icon-btn { background: var(--subtle); color: var(--heading); }
.icon-btn .icon { width: 18px; height: 18px; }

/* --- forms: one boxed input ---------------------------------------------------------------------- */
label { display: block; margin: 0 0 4px; font-size: var(--fs-s); font-weight: 500; color: var(--text); }
.field { margin: 0 0 16px; }
.field .hint { margin: 4px 0 0; font-size: var(--fs-s); color: var(--muted); }
input[type="email"], input[type="text"], input[type="search"], input:not([type]), select, textarea {
  display: block; width: 100%; height: var(--h); padding: 0 10px;
  font-family: inherit; font-size: var(--fs); line-height: 1.4; color: var(--heading);
  background: transparent; border: 1px solid var(--edge); border-radius: var(--radius);
  transition: border-color 0.12s;
}
input[type="email"]:hover, input[type="text"]:hover, input[type="search"]:hover, input:not([type]):hover, select:hover, textarea:hover { border-color: var(--edge-strong); }
select { padding-right: 24px; cursor: pointer; }
select option { color: #1b2a4a; background: #fff; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
/* The report form's detail box: the boxed input, grown to a few lines and resizable down only. */
textarea { height: auto; min-height: 7.5em; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }

/* --- notices ---------------------------------------------------------------------------------- */
.notice { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius); font-size: 14px; line-height: 1.5; background: var(--info-bg); color: var(--info-text); }
.notice.error { background: var(--error-bg); color: var(--error-text); }
.notice.success { background: var(--success-bg); color: var(--success-text); }
.notice.warning { background: var(--warn-bg); color: var(--warn-text); }
.storage-line { margin: 0 0 16px; font-size: 14px; color: var(--muted, inherit); }
.storage-line.warn { color: var(--warn-text); }
.data-exports .export-table { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.data-exports form.table-export { display: flex; gap: 8px; }
.flash { list-style: none; padding: 0; margin: 0 0 24px; }
.flash:empty { display: none; }

/* --- app frame: the slim trusted header on every signed-in page ------------------------------ */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  height: var(--header-h); padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
/* The PNG carries transparent margin: a 92px box draws the wordmark at the brand's 80px minimum. */
.app-header .logo { width: 92px; height: 48px; }
.app-header .product { font-size: 16px; }
.app-nav { display: flex; gap: 4px; margin-left: 8px; }
.app-nav a { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: var(--radius); color: var(--text); font-weight: 500; font-size: 14px; text-decoration: none; }
.app-nav a:hover { background: var(--subtle); color: var(--heading); }
.app-nav a[aria-current="page"] { color: var(--heading); background: var(--subtle); }
.header-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.page { max-width: 64rem; margin: 0 auto; padding: 24px 16px 64px; }
.page.narrow { max-width: calc(600px + 32px); }
.page-head { margin: 0 0 20px; }
.page-head h1 { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.page-head .lede { margin: 6px 0 0; max-width: 64ch; font-size: var(--fs); line-height: 1.5; color: var(--muted); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 6px; font-size: var(--fs-s); color: var(--muted); }
.crumbs a { color: var(--link); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs bdi { display: inline-block; max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
/* Sections sit flat on the page, split by space and hairlines (no card around each block). */
.panel { background: none; border-radius: 0; box-shadow: none; padding: 0; }
.panel + .panel { margin-top: 28px; }
.panel h2 { margin-bottom: 6px; font-size: var(--fs); font-weight: 600; letter-spacing: 0; }
.panel h3 { margin: 16px 0 4px; font-size: var(--fs); font-weight: 600; }
.panel > :last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .app-nav { display: none; }
  .app-header .brand-lockup .divider, .app-header .product { display: none; }
  .page { padding: 20px 16px 48px; }
}

/* --- menus (a <details> disclosure; menu.js closes it on Escape and outside click) ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; border-radius: var(--radius); }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  width: max-content; min-width: 200px; max-width: min(320px, calc(100vw - 32px)); padding: 4px; margin: 0;
  background: var(--surface); border: 0; border-radius: 8px; box-shadow: var(--menu-shadow);
}
.menu-panel.left { right: auto; left: 0; }
.menu-meta { padding: 8px 12px 12px; margin: 0 0 4px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.menu-meta strong { display: block; color: var(--heading); font-size: 14px; font-weight: 600; }
.menu-item, .menu-panel form > button, .mi {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; height: auto; min-height: 32px; padding: 6px 10px; margin: 0;
  border: 0; border-radius: 4px; background: transparent;
  color: var(--text); font-family: inherit; font-size: var(--fs); font-weight: 400; line-height: 1.3; text-decoration: none; text-align: left; cursor: pointer;
}
.menu-item:hover, .menu-panel form > button:hover, .mi:hover { background: var(--subtle); color: var(--heading); text-decoration: none; }
.menu-item .icon, .menu-panel form > button .icon, .mi .icon { width: 16px; height: 16px; color: var(--muted); }
.menu-item.danger, .menu-panel form > button.danger, .mi.danger, .mi.danger .icon { color: var(--error-text); background: transparent; border: 0; }
.menu-item.danger:hover, .menu-panel form > button.danger:hover, .mi.danger:hover { background: var(--subtle); color: var(--error-text); }
.mi small { display: block; color: var(--muted-subtle); font-size: 12px; }
/* A role hint (Co-owner, D5-134) wraps inside the panel; rows in a people list never set nowrap on it. */
.rows.people .menu-panel .mi { white-space: normal; }
.rows.people .menu-panel .mi > span { min-width: 0; }
.mi .check { margin-left: auto; color: var(--link); visibility: hidden; }
.mi[aria-checked="true"] .check, .mi:has(input:checked) .check { visibility: visible; }
.mi[aria-disabled="true"], .mi[aria-disabled="true"]:hover { opacity: 0.5; cursor: default; background: transparent; }
.mi:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }

/* A picker: its value and a caret; the menu under it applies on pick. */
.pick {
  display: inline-flex; align-items: center; gap: 2px; height: var(--h); padding: 0 6px 0 10px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--heading); font-size: var(--fs); white-space: nowrap; cursor: pointer;
}
.pick:hover, details[open] > summary.pick { background: var(--subtle); }
.pick .icon { width: 14px; height: 14px; color: var(--muted); }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--subtle); color: var(--heading); font-weight: 600; font-size: 14px;
  border: 1px solid var(--line);
}
.menu > summary:hover .avatar { border-color: var(--edge); }

/* --- sign-in (the page clients see first) ----------------------------------------------------
   Two panels on a wide screen: Beacon navy on the left, carrying the logo, one line on what Beam is
   for, and the logo's own signal arcs rippling slowly outward; the form sits alone on the right.
   On a phone the navy panel becomes a band above the form. */
.auth-body { background: var(--surface); }
.auth-body, .consent { --fs: 16px; --h: 44px; }
.auth {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 6fr);
  min-height: 100vh; min-height: 100dvh; background: var(--surface);
}
.auth-brand {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: 48px;
  padding: 48px 64px; background: var(--brand-panel); color: var(--on-brand-panel);
}
.auth-brand .brand-lockup { position: relative; z-index: 1; }
.auth-brand .brand-lockup .divider { height: 32px; background: var(--brand-panel-line); }
.auth-brand .product { font-size: 22px; color: var(--on-brand-panel); }
.auth-pitch { position: relative; z-index: 1; margin: auto 0 0; max-width: 34rem; }
/* The waves never cross the words: the pitch carries a navy veil that fades in just below the
   logo row (inside the panel gap, so it never covers the logo) and is solid behind the text. */
.auth-pitch::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: -40px; bottom: -64px; left: -64px; right: -100vw;
  background: linear-gradient(to bottom, rgba(27, 42, 74, 0), var(--brand-panel) 40px);
}
.auth-headline {
  margin: 0 0 24px; font-size: var(--fs-display); line-height: 1.08; font-weight: 700;
  letter-spacing: -0.03em; color: var(--on-brand-panel); text-wrap: balance;
}
.auth-sub { margin: 0; max-width: 38ch; font-size: var(--fs-lede); line-height: 1.6; color: var(--on-brand-panel-muted); }

/* The signal: the logo's arcs keep rippling outward from its "o", across the navy panel. The waves
   sit inside the logo box, so they are placed by the supplied file's own geometry (the "o" is
   centered at 71.9% / 53% of the PNG) and follow the logo at any size. */
.auth-brand .logo { position: relative; }
.signal { position: absolute; left: 71.9%; top: 53%; z-index: -1; width: 0; height: 0; pointer-events: none; }
.signal .wave {
  position: absolute; left: 0; top: 0; width: 48px; height: 48px;
  border: 2px solid var(--signal); border-radius: 50%;
  transform: translate(-50%, -50%);
  /* Only the arcs above and below, as in the logo, feathered at their ends. */
  -webkit-mask: conic-gradient(#000 0 20deg, transparent 38deg 142deg, #000 160deg 200deg, transparent 218deg 322deg, #000 340deg);
  mask: conic-gradient(#000 0 20deg, transparent 38deg 142deg, #000 160deg 200deg, transparent 218deg 322deg, #000 340deg);
  opacity: 0;
  animation: signal-wave 16s cubic-bezier(0.3, 0.1, 0.6, 1) infinite;
}
.signal .wave:nth-child(2) { animation-delay: -4s; }
.signal .wave:nth-child(3) { animation-delay: -8s; }
.signal .wave:nth-child(4) { animation-delay: -12s; }
@keyframes signal-wave {
  0% { width: 48px; height: 48px; opacity: 0; }
  5% { opacity: 0.7; }
  100% { width: 1600px; height: 1600px; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .signal .wave { animation: none; }
  .signal .wave:nth-child(1) { width: 110px; height: 110px; opacity: 0.5; }
  .signal .wave:nth-child(2) { width: 200px; height: 200px; opacity: 0.34; }
  .signal .wave:nth-child(3) { width: 320px; height: 320px; opacity: 0.22; }
  .signal .wave:nth-child(4) { width: 480px; height: 480px; opacity: 0.12; }
}

.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 64px; background: var(--surface); }
.auth-shell { width: 100%; max-width: 420px; }
.auth-card h1 { margin: 0 0 12px; font-size: var(--fs-h1); line-height: 1.2; }
.auth-card .lede { margin: 0 0 40px; font-size: 17px; color: var(--muted-subtle); }
.auth-card .lede strong { color: var(--heading); font-weight: 600; overflow-wrap: anywhere; }
.auth-card .field { margin-bottom: 32px; }
.auth-card label { font-size: 14px; }
.auth-card .field .notice { margin: 12px 0 0; }
.auth-card button.primary, .auth-card .btn.primary { height: 52px; font-size: 17px; }
.auth-card .switch { margin: 24px 0 0; font-size: 15px; color: var(--text); }
.auth-card .switch a { font-weight: 600; }
.auth-foot { margin: 40px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--text); }
.auth-foot:empty { display: none; }
.auth-foot p { margin: 0 0 4px; }
.auth-foot .fine-print { margin: 0; font-size: 14px; color: var(--muted-subtle); }
.auth-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 16px 0 0; font-size: 14px; color: var(--muted-subtle); }
.auth-foot > .auth-account:first-child { margin-top: 0; }
.auth-account p { margin: 0; overflow-wrap: anywhere; }
.auth-account button { margin: 0 -12px; }
.auth-account strong { color: var(--heading); font-weight: 600; }
.code-input { height: 64px; font-size: 32px; font-weight: 600; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; padding-left: 0.4em; }
/* beacon_identity's own pages (access pending, SSO refused) on this layout: its published bi-* classes. */
.bi-card .bi-heading { margin: 0 0 12px; font-size: var(--fs-h1); line-height: 1.2; font-weight: 700; color: var(--heading); letter-spacing: -0.02em; }
.bi-card .bi-text, .bi-card .bi-footnote { color: var(--muted-subtle); margin: 0 0 32px; font-size: 17px; }
.bi-card .bi-footnote { margin: 0; font-size: 14px; }
.bi-card .bi-button { width: 100%; height: 52px; }
.consent dl { margin: 0 0 24px; }
.consent dt { font-size: 13px; font-weight: 500; color: var(--muted); }
.consent dd { margin: 4px 0 16px; color: var(--heading); overflow-wrap: anywhere; }
.consent ul { margin: 0 0 24px; padding-left: 20px; }
.consent .actions { display: flex; gap: 12px; }
.consent .actions button { flex: 1; height: 52px; }
@media (min-width: 1280px) {
  .auth { --fs-display: 56px; }
}
@media (max-width: 1100px) {
  .auth-brand, .auth-main { padding: 40px; }
}
/* Phone and narrow tablet: one column, the navy panel a band above the form. */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { gap: 32px; padding: 24px 16px 32px; }
  .auth-brand .logo-lg { width: 100px; height: 52px; }
  .auth-brand .brand-lockup .divider { height: 26px; }
  .auth-brand .product { font-size: 20px; }
  .auth-pitch { margin: 0; max-width: 34rem; }
  .auth-headline { margin: 0 0 12px; }
  .auth-pitch::before { top: -24px; left: -16px; bottom: -32px; background: linear-gradient(to bottom, rgba(27, 42, 74, 0), var(--brand-panel) 24px); }
  .auth-main { align-items: flex-start; padding: 32px 16px 48px; }
  .auth-shell { max-width: 440px; }
  .auth-card .lede { margin-bottom: 32px; }
}
@media (max-width: 480px) {
  .auth-sub { display: none; }  /* the band keeps to the logo and one line, so the form is in view */
  .code-input { font-size: 28px; letter-spacing: 0.3em; padding-left: 0.3em; }
}

/* --- lists and tables -------------------------------------------------------------------------- */
.rows { list-style: none; padding: 0; margin: 0; }
.rows > li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: var(--row); padding: 6px 0; border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; }
.rows .grow { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; }
.rows .who { color: var(--heading); font-weight: 400; }
.rows a.who { color: var(--link); text-decoration: none; }
.rows a.who:hover { color: var(--link-hover); text-decoration: underline; }
.rows .sub { display: block; font-size: var(--fs-s); color: var(--muted); }
/* People and settings: one line each; the control stays on the right at every width. */
.rows.people > li { flex-wrap: nowrap; }
.rows.people .grow { flex: 1 1 0; }
.rows.people .who:not(.wrap), .rows.people .sub.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .avatar { width: 28px; height: 28px; font-size: 12px; border: 0; background: var(--info-bg); color: var(--info-text); }
.rows .avatar.quiet { background: var(--subtle); color: var(--muted-subtle); }
.rows .role-fixed { padding-right: 10px; color: var(--muted); }
.rows .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; background: var(--subtle); color: var(--muted-subtle); }
.badge.live { background: var(--success-bg); color: var(--success-text); }
.badge.info { background: var(--info-bg); color: var(--info-text); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .who { color: var(--heading); font-weight: 600; }
/* Receipts on a phone: one stacked card per person, each value named by its column. */
@media (max-width: 640px) {
  .table.receipts, .table.receipts tbody, .table.receipts tr, .table.receipts td { display: block; }
  .table.receipts thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .table.receipts tr { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .table.receipts tr:first-child { padding-top: 0; }
  .table.receipts tr:last-child { border-bottom: 0; padding-bottom: 0; }
  .table.receipts td { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border: 0; text-align: right; font-size: 15px; }
  .table.receipts td::before { content: attr(data-label); flex: none; color: var(--muted); font-weight: 500; text-align: left; }
  .table.receipts td:first-child { display: block; padding: 0 0 8px; text-align: left; overflow-wrap: anywhere; }
  .table.receipts td:first-child::before { content: none; }
}
/* Keep after the .table.receipts rules (same specificity). Page data rows (Beam 118 #2): one card per row at every width, each answer named by its column
   in declared order, so a 10-question survey reads down the page instead of scrolling sideways. */
.table.data-rows, .table.data-rows tbody, .table.data-rows tr, .table.data-rows td { display: block; }
.table.data-rows thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.table.data-rows tr { max-width: 44rem; padding: 16px 0; border-bottom: 1px solid var(--line); }
.table.data-rows tr:first-child { padding-top: 0; }
.table.data-rows tr:last-child { border-bottom: 0; padding-bottom: 0; }
.table.data-rows td { display: grid; grid-template-columns: minmax(7rem, 14rem) minmax(0, 1fr); gap: 16px; padding: 4px 0; border: 0; text-align: left; overflow-wrap: anywhere; }
.table.data-rows td::before { content: attr(data-label); color: var(--muted); font-weight: 500; overflow-wrap: anywhere; }
.table.data-rows td:first-child { display: block; padding: 0 0 8px; }
.table.data-rows td:first-child::before { content: none; }
@media (max-width: 640px) { .table.data-rows td { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); font-size: 15px; } }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty h2 { margin-bottom: 8px; }
/* A whole-page status (not found, not allowed): the Beacon icon over a big plain answer. */
.empty.status { padding: 96px 16px 64px; color: var(--muted-subtle); }
.status-mark { position: relative; isolation: isolate; display: block; width: 108px; height: 48px; margin: 0 auto 48px; background: url("img/beacon-icon.3c172ea945f2.svg") center / contain no-repeat; }
/* The icon's own arcs carry on outward, still: the sign-in waves turned to the icon's sides. */
.status-mark .signal { left: 50%; top: 50%; transform: rotate(90deg); }
.status-mark .wave { animation: none; }
.status-mark .wave:nth-child(1) { width: 140px; height: 140px; opacity: 0.45; }
.status-mark .wave:nth-child(2) { width: 190px; height: 190px; opacity: 0.28; }
.status-mark .wave:nth-child(3) { width: 240px; height: 240px; opacity: 0.16; }
.status-mark .wave:nth-child(4) { display: none; }
.empty.status h1 { margin: 0 0 12px; font-size: var(--fs-h1); line-height: 1.2; }
.empty.status p { max-width: 46ch; margin: 0 auto 32px; font-size: var(--fs-lede); }
form.inline { display: inline; }
.actions-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* --- the shared Beam view ------------------------------------------------------------------------
   One slim trusted header (logo, title, provenance, one version pill, the headline actions and the
   account menu) and the Beam's sandboxed frame filling the rest of the window. The frame's size is
   set here, never by the page inside it (ACCEPTANCE A.0). */
body.viewing { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.beam-bar {
  position: relative; z-index: 20; flex: none;
  display: flex; align-items: center; gap: 12px;
  height: var(--header-h); padding: 0 12px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
/* A history view is never mistaken for the working version: a warning rule tops the bar at every width. */
.beam-bar.is-history { box-shadow: inset 0 3px 0 var(--warn-text); }
.beam-home { display: flex; align-items: center; flex: none; border-radius: var(--radius); padding: 0 4px; }
.beam-home .logo { width: 92px; height: 48px; }
.logo-mark { display: none; width: 40px; height: 20px; background: url("img/beacon-icon.3c172ea945f2.svg") center / contain no-repeat; }
.beam-ident { flex: 1 1 auto; min-width: 0; padding-left: 12px; border-left: 1px solid var(--line); }
.beam-title {
  margin: 0; font-size: 16px; line-height: 1.3; font-weight: 600; letter-spacing: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: isolate;
}
.beam-title:focus { outline: none; }
.beam-provenance { margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The version pill: number and state in one control; its menu holds versions, History and receipts. */
.version-menu { flex: none; }
.version-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 10px;
  border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap;
  background: var(--subtle); color: var(--muted-subtle);
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow 0.12s;
}
.version-pill:hover, .version-menu[open] > .version-pill { box-shadow: inset 0 0 0 1px currentColor; }
.version-pill.is-live { background: var(--success-bg); color: var(--success-text); }
.version-pill.is-ahead { background: var(--info-bg); color: var(--info-text); }
.version-pill.is-history { background: var(--warn-text); color: var(--surface); }  /* solid: 5.0:1 light, 11:1 dark */
.version-pill .pill-sync { width: 14px; height: 14px; }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.version-pill.is-private .pill-dot { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.pill-num { font-variant-numeric: tabular-nums; }
.pill-note { font-weight: 500; }
.pill-note::before { content: ""; display: inline-block; width: 1px; height: 12px; margin: 0 8px 0 2px; vertical-align: -1px; background: currentColor; opacity: 0.4; }
.version-pill::after {
  content: ""; width: 6px; height: 6px; margin: -3px 0 0 2px; flex: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
  transition: transform 0.12s;
}
.version-menu[open] > .version-pill::after { transform: translateY(3px) rotate(225deg); }
.version-panel { width: 320px; } /* menu.js picks the side with room (.left), Beam 121 #1 */
.version-state strong { margin-bottom: 2px; }
.version-state.is-history strong { color: var(--warn-text); }
.menu-label { margin: 0; padding: 8px 12px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.version-list { list-style: none; margin: 0 0 4px; padding: 0; }
.version-row { gap: 8px; }
.version-row .v-num { min-width: 32px; color: var(--heading); font-weight: 600; font-variant-numeric: tabular-nums; }
.version-row .v-when { flex: 1 1 auto; color: var(--muted); font-weight: 400; font-size: 13px; }
.version-row[aria-current="page"] { background: var(--subtle); box-shadow: inset 3px 0 0 var(--brand); }
.version-row[aria-current="page"] .v-when, .version-row:hover .v-when { color: var(--muted-subtle); }
.v-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.v-tag.working { background: var(--info-bg); color: var(--info-text); }
.v-tag.live { background: var(--success-bg); color: var(--success-text); }
/* Beam 365 release asks: an editor's "Ask the owner to bring vN to everyone"; the owner's card (DESIGN.md, mockup 01-06). */
.pill-ask { width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--warn-text); box-shadow: 0 0 0 2px var(--surface); flex: none; }
.menu-panel form.release-ask-form > button.release-ask-btn {
  justify-content: center; margin: 4px 0 6px; border: 1px solid var(--primary); border-radius: var(--radius); color: var(--primary); font-weight: 600;
}
.menu-panel form.release-ask-form > button.release-ask-btn .icon { color: inherit; }
.release-ask-done { margin: 2px 0 8px; padding: 8px 12px; border-radius: var(--radius); background: var(--info-bg); color: var(--info-text); font-size: 13px; line-height: 1.45; }
.release-ask-card { margin: 0 0 8px; padding: 10px 12px; border-radius: var(--radius); background: var(--warn-bg); border: 1px solid var(--edge); }
.release-ask-lead { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text); }
.release-ask-lead > strong { display: block; margin-bottom: 2px; font-size: 14px; color: var(--heading); }
.release-ask-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.release-ask-row > form.version-push { flex: 1 1 auto; display: block; }
.release-ask-row > form.version-push > button.menu-primary { width: 100%; margin: 0; }
.menu-panel .release-ask-row form > button.release-ask-notnow { width: auto; padding: 6px 8px; background: none; color: var(--muted); text-decoration: underline; font-weight: 500; }
.release-ask-line { display: block; }

.beam-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.beam-tools > form { display: contents; }
.beam-tools .menu-panel form:not(.narrow-only) { display: block; }
.beam-menu > summary { display: flex; border-radius: 50%; }
.menu-panel form > button.menu-primary { background: var(--primary); color: var(--on-primary); margin: 0 0 4px; }
.menu-panel form > button.menu-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.menu-panel form > button.menu-primary .icon { color: inherit; }
/* The page itself never scrolls (the frame fills it), so a tall menu scrolls inside itself. */
.beam-bar .menu-panel { max-height: calc(100vh - var(--header-h) - 16px); max-height: calc(100dvh - var(--header-h) - 16px); overflow-y: auto; }
.copy-link.copied { color: var(--success-text); }
.copy-link.copied .icon { --i: url("icons/check.8d0a315af360.svg"); }
.beam-stage { flex: 1 1 auto; min-height: 0; display: flex; }
/* The frame's own colors follow its document (CSS Color Adjust, used color-scheme). Light: a white
   sheet, as a plain page expects. Dark: no forced white. A Beam that declares no color-scheme then
   differs from this page's and the browser paints it an opaque light canvas, so black text stays
   readable; a Beam that declares "light dark" shows through to the page's dark background. */
.beam-frame { display: block; flex: 1 1 auto; width: 100%; height: 100%; border: 0; background: var(--frame-bg); }

/* GO Addendum 58: a file Beam with no preview gets a centred card in place of the frame (iOS Quick
   Look / Google Drive): a big type icon, the name, "TYPE · size", and a full-width Download. The icon's
   colour says the kind of file; its badge text is white on that colour (4.5:1+ for each). */
.file-card { margin: auto; width: calc(100% - 32px); max-width: 400px; box-sizing: border-box; padding: 40px 32px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md);
  --fc: #475569; }
.beam-stage.has-file-card { background: var(--subtle); overflow: auto; padding: 24px 0; box-sizing: border-box; }
.file-card[data-family="doc"], .dl-ext[data-family="doc"] { --fc: #2b579a; }
.file-card[data-family="sheet"], .dl-ext[data-family="sheet"] { --fc: #1e7e45; }
.file-card[data-family="slides"], .dl-ext[data-family="slides"] { --fc: #b7472a; }
.file-card[data-family="pdf"], .dl-ext[data-family="pdf"] { --fc: #b91c1c; }
.file-card[data-family="media"], .dl-ext[data-family="media"] { --fc: #6d28d9; }
.file-card-icon { position: relative; width: 84px; height: 104px; margin-bottom: 18px; }
.file-card-icon svg { display: block; width: 100%; height: 100%; }
.file-card-icon .fc-fill { fill: var(--fc); opacity: 0.14; }
.file-card-icon .fc-line { fill: none; stroke: var(--fc); stroke-width: 3; }
.file-card-icon .fc-rule { fill: none; stroke: var(--fc); stroke-width: 3; stroke-linecap: round; opacity: 0.55; }
.file-card-ext { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 5px 7px; border-radius: 5px;
  background: var(--fc); color: #ffffff; font-size: 13px; font-weight: 700; line-height: 1; letter-spacing: 0.04em; white-space: nowrap; }
.file-card-name { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 700; color: var(--heading); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.file-card-meta { margin: 0; color: var(--muted); font-size: 15px; }
.file-card-why { margin: 14px 0 0; color: var(--text); font-size: 14px; }
button.file-card-download { margin-top: 22px; width: 100%; min-height: 48px; justify-content: center; gap: 10px; font-size: 16px; border-radius: 10px; }
button.file-card-download .icon { width: 18px; height: 18px; }
/* D5-135 (GO Addendum 75): the blocked-frame notice. reach.js shows it in place of the frame when this network
   can't reach the content host; the same centred card as the file card above (mockup approved by Mike, Beam 155). */
.beam-stage.has-reach-notice { background: var(--subtle); overflow: auto; padding: 24px 0; box-sizing: border-box; }
.reach-notice { margin: auto; width: calc(100% - 32px); max-width: 480px; box-sizing: border-box; padding: 36px 32px 28px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); }
.reach-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px;
  background: var(--warn-bg); color: var(--warn-text); }
.reach-icon svg { width: 34px; height: 34px; }
.reach-notice h2 { margin: 0 0 12px; font-size: 21px; line-height: 1.3; font-weight: 700; color: var(--heading); }
.reach-notice p { margin: 0 0 10px; font-size: 15px; line-height: 1.55; color: var(--text); }
.reach-notice strong { white-space: nowrap; }
.reach-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 16px; }
.reach-actions button { width: 100%; min-height: 48px; justify-content: center; gap: 10px; font-size: 16px; border-radius: 10px; }
.reach-actions button .icon { width: 18px; height: 18px; }
.reach-actions button.copied, .reach-actions button.copied:hover { background: var(--success-bg); border-color: var(--success-bg); color: var(--success-text); }
.reach-note { width: 100%; margin-top: 18px; text-align: left; }
.reach-note summary { cursor: pointer; font-size: 14px; color: var(--muted); text-align: center; list-style: none; }
.reach-note summary::-webkit-details-marker { display: none; }
.reach-note summary::after { content: " \25BE"; }
.reach-note[open] summary::after { content: " \25B4"; }
.reach-note pre { margin: 10px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--subtle);
  font-family: inherit; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text);
  max-height: 260px; overflow: auto; }
.reach-notice p.reach-fine { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.reach-notice h2:focus { outline: none; }
.reach-notice h2:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
button.reach-anyway { margin-top: 6px; padding: 6px 8px; min-height: 32px; border: 0; background: none; font-size: 13px;
  color: var(--link); text-decoration: underline; cursor: pointer; }
button.reach-anyway:hover { background: none; color: var(--link-hover); }
@media (max-width: 600px) { .reach-notice { padding: 28px 20px 22px; } .reach-notice h2 { font-size: 19px; } }
/* D5-128 (Beam 131 mockup r3): every file download opens this dialog: the file chip, the virus-scan receipt with its
   Details, any caution, then Cancel / Download. Centred on a wide screen, a bottom sheet on a phone. Download is faded
   and ignores clicks while it arms (~1 s, D5-89; button.arming draws the bar). */
dialog.dialog.dl-dialog { max-width: 480px; margin: auto; padding: 24px 24px 20px; border-radius: 14px; box-sizing: border-box;
  font-size: 15px; line-height: 1.5; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25); max-height: calc(100dvh - 32px); overflow-y: auto; }
dialog.dl-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.dl-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.dl-badge { flex: none; width: 40px; height: 40px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; line-height: 1; }
.dl-badge[hidden] { display: none; }
dialog.dl-dialog h2 { margin: 0; font-size: 18px; line-height: 1.3; color: var(--heading); overflow-wrap: anywhere; }
.dl-badge:not([hidden]) + h2 { margin-top: 6px; }
.dl-file { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--subtle); font-size: 14px; }
.dl-file-text { min-width: 0; }
.dl-file b { display: block; color: var(--heading); font-weight: 600; overflow-wrap: anywhere; }
.dl-file-text > span { color: var(--muted-subtle); font-size: 13px; overflow-wrap: anywhere; }
.dl-ext { --fc: #475569; flex: none; padding: 6px 7px; border-radius: 5px; background: var(--fc); color: #ffffff;
  font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: 0.04em; }
.dl-body p { margin: 0 0 10px; }
.dl-body code { padding: 1px 5px; border-radius: 4px; background: var(--subtle); color: var(--heading); font-size: 14px; }
.dl-body strong { color: var(--heading); }
.dl-tip { color: var(--muted); font-size: 13px; }
.dl-scan { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.dl-ok { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 999px; background: var(--success-bg); color: var(--success-text);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; line-height: 1; }
button.dl-link { display: inline; height: auto; margin: 0 0 0 4px; padding: 0; border: 0; background: transparent; color: var(--link);
  font-size: inherit; font-weight: 400; text-decoration: underline; text-underline-offset: 2px; vertical-align: baseline; }
button.dl-link:hover { background: transparent; color: var(--link-hover); }
.dl-det { margin: 6px 0 0 26px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; color: var(--muted); }
.dl-det div { display: flex; gap: 8px; padding: 2px 0; }
.dl-det dt { flex: none; width: 118px; color: var(--text); }
.dl-det dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dl-det button.dl-sha { margin: 0; font-family: inherit; text-align: left; white-space: normal; overflow-wrap: anywhere; color: var(--muted);
  text-decoration-style: dotted; user-select: text; }
.dl-status { margin: 10px 0 0; color: var(--error-text); font-size: 14px; }
.dl-status:empty { margin: 0; }  /* still in the accessibility tree, so its error is announced */
dialog.dialog.dl-dialog .dl-acts { flex-direction: row; justify-content: flex-end; gap: 8px; margin-top: 18px; }
dialog.dl-dialog .dl-acts button { min-height: 40px; padding: 0 16px; border-radius: 9px; font-size: 15px; font-weight: 600; }
dialog.dl-dialog .dl-acts button.arming, dialog.dl-dialog .dl-acts button[aria-busy="true"] { opacity: 0.55; cursor: default; }
dialog.dl-dialog h2:focus { outline: none; }
dialog.dl-dialog h2:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 600px) {
  dialog.dialog.dl-dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: 16px 16px 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 24px); }
  dialog.dialog.dl-dialog .dl-acts { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  dialog.dl-dialog .dl-acts button { width: 100%; min-height: 48px; font-size: 16px; }
  .dl-det { margin-left: 0; }
  .dl-det dt { width: 104px; }
}
.toast { position: fixed; z-index: 15; top: calc(var(--header-h) + var(--save-bar-h, 0px) + 12px); right: 16px; max-width: min(420px, calc(100vw - 32px)); margin: 0; }
.toast .notice { box-shadow: var(--shadow-xl); margin: 0 0 8px; align-items: center; }
.toast .notice span { flex: 1; overflow-wrap: anywhere; }
.toast .dismiss { height: 28px; width: 28px; padding: 0; border: 0; color: inherit; flex: none; }
.toast .dismiss:hover { background: transparent; color: inherit; }
.narrow-only { display: none; }
@media (max-width: 960px) {
  /* Tighter: the pill keeps its number (and a history view keeps its word); the menu says the rest. */
  .version-pill:not(.is-history) .pill-note { display: none; }
  /* Beam 121 (#1): Copy link and Comment go icon-only (the words stay for screen readers), so the bar's
     buttons, Bring vN among them, fit down to 721 px instead of running off the right edge. */
  .beam-tools > .copy-link .copy-label, .beam-tools > .comment-toggle .comment-label, .beam-tools > .outline-toggle .outline-label { /* the bar's own buttons, never the menu's rows */
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}
@media (max-width: 720px) {
  .wide-only { display: none !important; }
  .menu-panel .narrow-only { display: flex; }
  .menu-panel p.narrow-only, .menu-panel hr.narrow-only, .beam-tools .menu-panel form.narrow-only { display: block; }
  .beam-home .logo { display: none; }
  .logo-mark { display: block; }
  .beam-bar { gap: 8px; padding: 0 8px; }
  .beam-ident { padding-left: 8px; }
  .beam-provenance { display: none; }
  /* Beam 107 #10: with no provenance line under it, the title may take two lines on a phone. */
  .beam-bar:not(.has-data-notice) .beam-title {
    white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
    font-size: 14px; line-height: 1.25; overflow-wrap: anywhere;
  }
  /* D-2: the page-data disclosure stays on phones (it is a disclosure, and Beams are mostly opened
     on phones), whatever else the header holds (Comment, the version pill, the menu): the controls
     sit at the top of the fixed-height bar and the notice takes its own full-width line along the
     bar's bottom, so the frame keeps its size. */
  .beam-bar.has-data-notice { align-items: flex-start; padding-top: 2px; } /* 36 px controls end at 38 px */
  .beam-provenance.has-data-notice { display: block; height: 0; margin: 0; overflow: visible; }
  .beam-provenance.has-data-notice .prov-by { display: none; }
  .beam-provenance.has-data-notice .data-notice {
    position: absolute; left: 8px; right: 8px; bottom: 2px;
    font-size: 11px; line-height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* Both menus open full-width under the bar, so neither runs off the screen's edge. */
  .version-menu, .beam-menu { position: static; }
  .beam-bar .menu-panel { left: 8px; right: 8px; width: auto; max-width: none; top: calc(100% + 4px); }
}

/* --- lists: "Your Beams" and a folder page (the design pass) ------------------------------------
   One table: folders first, then Beams. Names, owners and states only; no preview and no page byte. */
.head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 880px; margin: 0 0 16px; }
.head h1 { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.head h1 > .i-folder { width: 22px; height: 22px; color: var(--brand); }
/* Beam 124 F4: on phones a folder's name takes its own line and Upload / Share / ⋮ sit under it,
   right-aligned (so ⋮'s right-anchored menu opens on screen), and the name is never squeezed to one
   letter a line beside the buttons. */
@media (max-width: 640px) { .head.folder-head { justify-content: flex-end; } .head.folder-head h1 { flex-basis: 100%; } }
.head-line { max-width: 880px; margin: -8px 0 16px; }
.new-menu .menu-panel { min-width: 260px; }
.list-page .storage-line, .list-page .flash { max-width: 880px; }
.list-page .cap, .move .cap, .dialog .cap { font-size: var(--fs-s); color: var(--muted); margin: 12px 0 0; }

.tools { display: flex; gap: 12px; align-items: center; max-width: 880px; margin: 0 0 12px; }
.search { position: relative; flex: 1; max-width: 400px; margin: 0; }
.search .icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search input { padding-left: 32px; padding-right: 36px; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search-key {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border: 1px solid var(--edge); border-radius: 6px;
  font-family: inherit; font-size: 12px; font-weight: 500; line-height: 1; color: var(--muted); background: var(--surface); pointer-events: none;
}
.search input:focus ~ .search-key, .search input:not(:placeholder-shown) ~ .search-key { display: none; }
.sort-menu { margin-left: auto; }
table.list { width: 100%; max-width: 880px; border-collapse: collapse; }
table.list col.c-owner { width: 140px; }
table.list col.c-status { width: 170px; }
table.list col.c-upd { width: 110px; }
table.list col.c-act { width: 40px; }
table.list th { text-align: left; font-size: var(--fs-s); font-weight: 500; color: var(--muted); padding: 0 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { height: var(--row); padding: 0 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list tr.r:hover td, table.list tr.r:focus-within td { background: var(--subtle); }
table.list td.name { width: 100%; max-width: 0; }
table.list td.name a { display: flex; align-items: center; gap: 10px; color: var(--heading); overflow: hidden; }
table.list td.name a bdi { overflow: hidden; text-overflow: ellipsis; }
table.list td.name a:hover { text-decoration: none; }
table.list td.name a:hover bdi { text-decoration: underline; }
table.list .icon.kind { width: 18px; height: 18px; color: var(--muted); }
table.list .icon.kind.f { color: var(--brand); }
table.list td.m { color: var(--muted); font-size: var(--fs-s); overflow: hidden; text-overflow: ellipsis; }
table.list td.act { width: 1%; padding-right: 0; text-align: right; }
table.list td.act .menu { display: inline-block; }
table.list td.act .menu-panel { text-align: left; }
table.list td.name .sub { display: none; }
@media (max-width: 760px) {
  table.list .hide-s { display: none; }
  /* Phones (Beam 107 #10): the name wraps to two lines and the Status column, hidden above, sits
     under it as a muted line, so similar names can be told apart and the status stays. */
  table.list td.name { white-space: normal; padding-top: 6px; padding-bottom: 6px; }
  table.list td.name a bdi {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
    overflow: hidden; overflow-wrap: anywhere; line-height: 1.3;
  }
  table.list td.name .sub {
    display: block; padding-left: 28px; margin-top: 2px; font-size: var(--fs-s); line-height: 1.3; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  table.list td.name .sub.behind { color: var(--warn-text); }
}

/* Dialogs: a native <dialog> opened with showModal (menu.js; move.js for Move to…). */
dialog.dialog {
  width: calc(100% - 32px); max-width: 420px; margin: 96px auto auto; padding: 20px; border: 0; border-radius: 10px;
  background: var(--surface); color: var(--text); box-shadow: var(--menu-shadow);
}
dialog.dialog::backdrop { background: rgba(2, 6, 23, 0.5); }
dialog.dialog h2 { font-size: 16px; margin: 0 0 12px; overflow-wrap: anywhere; }
dialog.dialog .foot, .move .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.move-dialog .move-body { min-height: 120px; }

/* Move to…: the destination list and what the move changes (server-written, on the move page). */
.dest-set { margin: 0; padding: 0; border: 0; min-width: 0; }
.dest-filter { max-width: none; margin: 0 0 8px; }
.dest { list-style: none; padding: 0; margin: 0 0 12px; max-height: 50vh; overflow-y: auto; }
.dest li label { display: flex; align-items: center; gap: 10px; min-height: 36px; margin: 0; padding: 0 8px; border-radius: var(--radius); font-size: var(--fs); font-weight: 400; color: var(--heading); cursor: pointer; }
.dest li label:hover { background: var(--subtle); }
.dest li label:has(input:disabled) { color: var(--muted); cursor: default; }
.dest li label:has(input:disabled):hover { background: transparent; }
.dest li label:has(input:checked) { background: var(--subtle); }
.dest input { accent-color: var(--primary); margin: 0; flex: none; }
.dest .icon { width: 16px; height: 16px; color: var(--brand); }
.dest .icon.i-page { color: var(--muted); }
.dest .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dest .here { margin-left: auto; font-size: 12px; color: var(--muted); }
.move-pick .move-review { margin-bottom: 16px; }
.changes { border-left: 2px solid var(--brand); padding: 4px 0 4px 10px; font-size: var(--fs-s); color: var(--text); }
.changes p { margin: 0 0 4px; }
.changes p:last-child { margin-bottom: 0; }
.changes b { color: var(--heading); font-weight: 600; }
@media (max-width: 640px) {
  dialog.dialog { margin-top: 48px; }
  .dest li label { min-height: 44px; }
  /* Move and Cancel: full-width 44px targets, well apart, Move on top. */
  dialog.dialog .foot, .move .foot { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  dialog.dialog .foot .btn, .move .foot .btn { width: 100%; }
}

.no-match { padding: 64px 16px; }
.copy-toast { position: fixed; z-index: 30; left: 24px; bottom: 24px; max-width: min(560px, calc(100vw - 48px)); margin: 0; padding: 10px 14px; border-radius: var(--radius); background: #1e293b; color: #f8fafc; font-size: var(--fs); box-shadow: var(--menu-shadow); overflow-wrap: anywhere; }

/* Empty: a small stack of blank Beams, and what to do next. */
.empty-state { max-width: 34rem; margin: 48px auto 0; text-align: center; color: var(--text); }
.empty-state h2 { margin: 0 0 8px; }
.empty-state p { margin: 0 0 16px; }
.empty-art { position: relative; width: 208px; height: 136px; margin: 0 auto 32px; }
.empty-art span {
  position: absolute; left: 24px; top: 8px; width: 160px; height: 112px; border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.empty-art span:nth-child(1) { transform: rotate(-8deg) translate(-20px, 6px); opacity: 0.6; }
.empty-art span:nth-child(2) { transform: rotate(6deg) translate(18px, 2px); opacity: 0.8; }
.empty-art span:nth-child(3) {
  background:
    linear-gradient(90deg, var(--brand), var(--brand-fade)) 16px 18px / 56px 6px no-repeat,
    linear-gradient(var(--line), var(--line)) 16px 40px / 120px 6px no-repeat,
    linear-gradient(var(--line), var(--line)) 16px 54px / 96px 6px no-repeat,
    linear-gradient(var(--line), var(--line)) 16px 74px / 128px 22px no-repeat,
    var(--surface);
}
.empty-state.guest .empty-art span:nth-child(3) {
  background:
    radial-gradient(circle, var(--brand-green) 0 5px, transparent 6px) 16px 13px / 16px 16px no-repeat,
    linear-gradient(var(--line), var(--line)) 40px 18px / 64px 6px no-repeat,
    linear-gradient(var(--line), var(--line)) 16px 40px / 120px 6px no-repeat,
    linear-gradient(var(--line), var(--line)) 16px 54px / 96px 6px no-repeat,
    linear-gradient(var(--line), var(--line)) 16px 74px / 128px 22px no-repeat,
    var(--surface);
}
.empty-prompt {
  display: inline-block; padding: 12px 16px; border-radius: 16px 16px 16px 4px;
  background: var(--subtle); color: var(--heading); font-weight: 500;
}
.empty-links { font-size: 14px; }
.empty-links a { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }

@media (hover: none) { .search-key { display: none; } }
@media (max-width: 640px) {
  /* One row, as in the mockup: the search grows, the sort picker keeps its own width. */
  .tools { gap: 8px; }
  .tools .search { flex: 1 1 auto; min-width: 0; max-width: none; }
  .sort-menu { flex: none; }
  .sort-menu .pick { padding: 0 4px 0 8px; }
  .search-key { display: none; }
  .search input { padding-right: 10px; }
  .empty-state { margin-top: 24px; }
}

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

/* The folder Share page's name fields (until it gets the Share-page layout). */
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field-pair .field { margin-bottom: 8px; }
.field-hint { margin: 0 0 16px; font-size: var(--fs-s); color: var(--muted); }
@media (max-width: 480px) { .field-pair { grid-template-columns: 1fr; } }
/* --- share page: one add row (email, role, Share); name fields only for someone new ------------------ */
.share-add { margin: 0 0 28px; }
.add-row { display: flex; align-items: center; gap: 6px; }
.add-row > input { flex: 1; min-width: 0; }
/* Beam 186 (GO Addenda 97/98): Share-box suggestions (share-suggest.js), Beam and folder Share pages */
.add-row > .combo { flex: 1; min-width: 0; }
.combo { position: relative; }
.add-row { position: relative; }
.add-row > .combo { position: static; }  /* the list spans the whole row (role and Share included), as wide as Drive's */
.combo .suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: 6px 0; list-style: none; max-height: 360px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); }
.combo .suggest[hidden] { display: none; }
.suggest [role="group"], .suggest [role="group"] > ul { margin: 0; padding: 0; list-style: none; }
.suggest .grp { padding: 6px 12px 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.suggest .opt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; cursor: pointer; }
.suggest .opt[aria-selected="true"], .suggest .opt:not([aria-disabled="true"]):hover { background: var(--subtle); }
.suggest .opt[aria-disabled="true"] { opacity: 0.55; cursor: default; }
.suggest .avatar { flex: none; width: 28px; height: 28px; font-size: 12px; border: 0; background: var(--info-bg); color: var(--info-text); }
.suggest .avatar.guest { background: var(--warn-bg); color: var(--warn-text); }
.suggest .grow { flex: 1; min-width: 0; }
.suggest .who { display: block; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .sub { display: block; font-size: var(--fs-s); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest .opt[aria-selected="true"] .sub, .suggest .opt:not([aria-disabled="true"]):hover .sub, .suggest .opt[aria-selected="true"] .grp { color: var(--muted-subtle); }
.suggest mark { background: none; color: inherit; font-weight: 700; }
.suggest .tag { flex: none; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
@media (max-width: 480px) { .suggest .opt { min-height: 52px; } .combo .suggest { max-height: 300px; } }
/* Beam 188 (GO Addendum 98): "Add Google Contacts" under the Share box (share-contacts.js) */
.gcontacts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 6px 0 0; font-size: var(--fs-s); color: var(--muted); }
.gcontacts[hidden], .gcontacts [hidden] { display: none; }
.gcontacts .btn.ghost.small { padding: 0 6px; margin-left: -6px; }
.gcontacts .gc-msg:empty { display: none; }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.names .cap { grid-column: 1 / -1; margin: 0; font-size: var(--fs-s); color: var(--muted); }
.share-add.js .names:not(.open) { display: none; }
/* "Notify people" (GO Addendum 68): Beam, folder and bulk Share. The note shows only while the box is ticked. */
.notify { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; cursor: pointer; }
.notify input { accent-color: var(--primary); width: 16px; height: 16px; margin: 2px 0 0; flex: none; }
.notify .who { display: block; color: var(--heading); font-size: var(--fs); }
.notify .sub { display: block; font-size: var(--fs-s); color: var(--muted); }
.notify .when-off { display: none; }
.notify:has(input:not(:checked)) .when-on { display: none; }
.notify:has(input:not(:checked)) .when-off { display: block; }
/* Beam 147: "Show earlier comments" (same look as Notify people, right under it); hidden while Editor/Co-owner is picked */
.notify.history { margin-top: 10px; }
form[data-writer] .notify.history { display: none; }
.grant-row .since, .rows.grants .since { display: block; font-size: var(--fs-s); color: var(--muted); }
/* Beam 211 open alerts: the row's "Tells you..." line and the bell on the role button, in the brand colour. */
.grant-row .watch, .rows.grants .watch { display: block; font-size: var(--fs-s); color: var(--link); }
.pick .icon.bell { width: 18px; height: 18px; color: var(--link); }
.mi .icon.bell { color: var(--link); }
.mi-off-pad { display: inline-block; width: 16px; flex: none; }
.notify-channel { margin: 4px 0 0; }
.notify-channel .segmented { max-width: 440px; }
.notify-channel + .rows { margin-top: 18px; } /* Beam 231: the AI-changes email row under the channel choice */
.notify-uses .who { display: block; } /* one line per use (tags, opens) */
.menu-panel .mi-check { display: flex; align-items: flex-start; gap: 10px; height: auto; padding-top: 8px; padding-bottom: 8px; text-align: left; }
.menu-panel .mi-check small { display: block; }
.menu-panel .mi-check .box { width: 16px; height: 16px; margin-top: 2px; flex: none; border: 1.5px solid var(--muted); border-radius: 3px; display: inline-grid; place-items: center; color: #ffffff; }
.menu-panel .mi-check .box .icon { width: 12px; height: 12px; }
.menu-panel .mi-check[aria-checked="true"] .box { background: var(--primary); border-color: var(--primary); }
/* Beam 147: the composer's "People outside Beacon can see this comment" label (staff only; never a block) */
.cm-outside { display: flex; gap: 6px; align-items: flex-start; margin: 8px 0 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.cm-outside .icon { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.cm-outside b { font-weight: 600; color: var(--text); }
.cm-card > .cm-outside { margin-left: 34px; }
.cm-outside[hidden], .cm-card:not(.active) > .cm-outside, .sheet-list #sheet-body .cm-outside { display: none; }
.note-box { margin: 8px 0 0 24px; }
.note-box textarea { display: block; width: 100%; box-sizing: border-box; min-height: 64px; padding: 8px 10px; font: inherit; font-size: var(--fs); color: var(--text); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); resize: vertical; }
.note-box .hint { margin: 4px 0 0; font-size: var(--fs-s); color: var(--muted); }
.notify-wrap:has(.notify input:not(:checked)) .note-box { display: none; }
.share-add .notify-wrap + .bulk-link { margin-top: 14px; }
.field-notify { margin: 0 0 16px; }
.field-notify .notify { margin-top: 0; }
.bulk-in .notify-wrap { margin-top: 16px; }
.share-foot { display: flex; align-items: center; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.share-foot a { margin-left: auto; }
/* Add many people (bulk share, GO Addendum 50) */
.bulk-link { display: inline-flex; gap: 6px; align-items: center; margin-top: 10px; font-size: var(--fs-s); }
.bulk-in textarea { display: block; width: 100%; min-height: 150px; box-sizing: border-box; padding: 8px 10px; font: 13px/1.5 ui-monospace, Menlo, monospace; color: var(--text); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); }
.bulk-in .field-label { display: block; margin: 0 0 6px; color: var(--heading); }
.bulk-in input[type=file] { max-width: 100%; }
.bulk-in .or { margin: 18px 0 6px; font-size: var(--fs-s); color: var(--muted); }
.bulk-in .hint, .bulk-preview .hint, .hint.bulk { margin: 6px 0 0; font-size: var(--fs-s); color: var(--muted); }
.bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.bulk-actions .grow { flex: 1; }
.tally { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tally > span { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-s); background: var(--subtle); color: var(--muted-subtle); }
.tally > .ok { background: var(--success-bg); color: var(--success-text); }
.tally > .warn { background: var(--warn-bg); color: var(--warn-text); }
.tally > .bad { background: var(--error-bg); color: var(--error-text); }
.rows.people.preview > li { flex-wrap: wrap; }
.rows.preview .state { font-size: var(--fs-s); white-space: nowrap; }
.rows.preview .state.ok { color: var(--success-text); }
.rows.preview .state.warn { color: var(--warn-text); }
.rows.preview .state.bad { color: var(--error-text); }
.rows.preview .state.quiet { color: var(--muted); }
.rows.preview .avatar.warn { background: var(--warn-bg); color: var(--warn-text); }
.rows.preview .avatar.bad { background: var(--error-bg); color: var(--error-text); }
.rows.preview .row-names { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding-left: 38px; }
.rows .sub.warn-note { color: var(--warn-text); }
.rows.preview li.invalid .who, .rows.preview li.duplicate .who { text-decoration: line-through; color: var(--muted); }
@media (max-width: 520px) {
  .rows.preview .state { flex: 1 1 100%; padding-left: 38px; }
  .rows.preview .row-names { grid-template-columns: 1fr; }
}
form.switch-form { display: contents; }
@media (max-width: 640px) {
  .add-row { flex-wrap: wrap; }
  .add-row > input, .add-row > .combo { flex: 1 0 100%; }
  .add-row > .btn.primary { margin-left: auto; }
}

/* --- theme switch (System / Light / Dark): in each account menu and under every sign-in form -------
   One segmented control; the chosen segment is a lifted surface chip with a brand-blue icon. In a
   menu it spans the panel under its own label; under the sign-in form it is one quiet row. */
.theme-switch { display: block; margin: 0; padding: 0 0 4px; }
.theme-label { display: block; padding: 8px 12px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 10px; background: var(--subtle); }
.menu-panel:has(.theme-switch) { min-width: 272px; }
.segmented button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; min-width: 0; padding: 0 8px;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted-subtle);
  font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1; cursor: pointer; white-space: nowrap;
}
.segmented button .icon { width: 16px; height: 16px; }
.segmented button:hover { color: var(--heading); background: transparent; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--heading); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.segmented button[aria-pressed="true"] .icon { color: var(--brand); }
.segmented button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* Under the sign-in form: one right-aligned row, outside the card. */
.theme-switch.is-compact { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 0; margin: 24px 0 0; }
.theme-switch.is-compact .theme-label { padding: 0; font-size: 14px; font-weight: 500; color: var(--muted-subtle); }
.theme-switch.is-compact .segmented { display: inline-grid; }
.theme-switch.is-compact .segmented button { padding: 0 10px; }
/* Very narrow: icons only, the words kept for screen readers (each button's name). */
@media (max-width: 360px) {
  .segmented .seg-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}
@media (prefers-reduced-motion: no-preference) {
  .segmented button { transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease; }
}
.beam-tools .menu-panel form.theme-switch { display: block; }

/* --- feedback (Report a problem, admin view) ---------------------------------------------------- */
/* Report text is a person's or a model's words, shown escaped: keep its line breaks, never let a long run widen the page. */
.report-text { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.report-field { margin: 8px 0 0; font-size: 14px; }
.report-field .label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.report-meta { overflow-wrap: anywhere; }
.triggers { margin: 0; padding-left: 1.1em; }

/* --- comments (Addenda 12/13/15; the approved mockup) ------------------------------------------------
   Wide: a rail beside the frame (the frame narrows; nothing covers the page). Each card sits level with
   its spot from the page's `where`; whole-page and not-found threads sit at the top. Phones (<= 640px):
   one thread, or the composer, in a bottom sheet; the frame is inert while it is open. Z-order: header
   (20) > save bar (17) > comments (16) > toasts (15) > the frame. */
:root { --rail-w: 340px; }
.comment-toggle[aria-pressed="true"], .comment-toggle[aria-expanded="true"] { background: var(--info-bg); color: var(--info-text); }
.comment-count { margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: var(--on-primary); font-size: 12px; line-height: 18px; text-align: center; }
/* --md-bar-h: a Markdown Beam's save bar at the bottom while editing (md-edit.js); the layer stops above it. */
.comments-root { position: fixed; inset: calc(var(--header-h) + var(--save-bar-h, 0px)) 0 var(--md-bar-h, 0px) 0; pointer-events: none; z-index: 16; }
.comments-root [hidden] { display: none !important; }
.comments-root.sheet-modal::before { content: ""; position: absolute; inset: 0; background: rgba(15, 23, 42, 0.18); }
.comment-reconnecting { position: absolute; left: 12px; top: 8px; margin: 0; padding: 6px 10px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-md); font-size: 13px; color: var(--text); pointer-events: auto; }
.comment-hint { position: absolute; top: 12px; left: 0; right: 0; display: flex; justify-content: center; }
.comment-hint > div { display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 6px 0 14px; border-radius: 999px; background: var(--heading); color: var(--surface); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-xl); pointer-events: auto; }
.comment-hint kbd { font: inherit; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--muted-subtle); color: var(--surface); }
.comment-hint button { height: 26px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--muted-subtle); color: var(--surface); font-size: 12px; font-weight: 600; }
.comment-hint button:hover { background: var(--muted); color: var(--surface); }
.comment-hint .hint-more { margin-left: -4px; opacity: .75; white-space: nowrap; }
@media (max-width: 1100px) { .comment-hint .hint-more { display: none; } }
.hint-narrow { display: none; }
.comment-panel { position: absolute; top: 0; right: 0; bottom: 0; width: var(--rail-w); display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--line); pointer-events: auto; }
body.comments-open .beam-stage { margin-right: var(--rail-w); }
body.comments-open .comment-hint { right: var(--rail-w); }
/* Markdown Edit (Beam 193 follow-up): the editor's sticky toolbar (z-index 50, inside the stage) holds the
   layer's top edge and wraps to more rows as the stage narrows, so the hint sits at the layer's bottom, above
   the save bar (the layer stops at --md-bar-h), clear of every toolbar button at any width. Only its Done
   takes the pointer there: a click or a drag that ends on the pill reaches the words under it. */
body.md-staged .comment-hint { top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
body.md-staged .comment-hint > div { pointer-events: none; }
body.md-staged .comment-hint button { pointer-events: auto; }
body.comments-open .toast { right: calc(var(--rail-w) + 16px); }
.rail-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.rail-head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 600; color: var(--heading); }
select.comment-filter { width: auto; height: 32px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; }
select.comment-filter:focus { border: 1px solid var(--focus); }
.comments-root .icon-btn { width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 22px; flex: none; }
.comments-root .icon-btn:hover { background: var(--subtle); color: var(--heading); }
.rail-loose { flex: none; position: relative; max-height: 45%; overflow: auto; padding: 12px 12px 0; display: grid; gap: 8px; }
.rail-more { flex: none; align-self: center; height: 26px; margin: 6px 0 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; }
.rail-more:hover { color: var(--heading); }
.rail-loose:empty { display: none; }
.rail-cards { flex: 1 1 auto; position: relative; overflow-x: hidden; overflow-y: auto; min-height: 0; }
.comment-pages { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.cm-empty { margin: 4px; color: var(--muted); font-size: 14px; }

/* a thread card */
.cm-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 12px 14px; box-shadow: var(--shadow-sm); cursor: pointer; font-size: 14px; color: var(--text); transition: transform .18s ease, box-shadow .18s ease, top .2s ease; }
.rail-cards .cm-card { position: absolute; left: 12px; right: 12px; }
.rail-end { position: absolute; left: 0; width: 1px; height: 1px; visibility: hidden; pointer-events: none; }
.cm-card:hover { box-shadow: var(--shadow-md); }
.cm-card.active, .cm-composer { cursor: default; transform: translateX(-10px); box-shadow: var(--shadow-xl); border-color: transparent; z-index: 3; }
.cm-card.active::before, .cm-composer::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--brand); }
.cm-head { display: flex; align-items: center; gap: 8px; }
.cm-av { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 11px; font-weight: 700; color: #ffffff; }
.cm-meta { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.cm-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--heading); }
.cm-when { flex: none; font-size: 12px; color: var(--muted); }
.cm-actions { display: flex; margin: -4px -4px -4px 0; }
.cm-actions .icon-btn { display: none; }
.cm-card:hover .cm-actions .icon-btn, .cm-card:focus-within .cm-actions .icon-btn, .cm-card.active .cm-actions .icon-btn, .cm-card.flagged .cm-actions .flag { display: inline-flex; }
.cm-actions .flag.is-on { color: var(--warn-text); }
.cm-actions .done:hover { color: var(--success-text); background: var(--success-bg); }
.cm-body, .cm-removed { margin: 6px 0 0 34px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.cm-removed { color: var(--muted); font-style: italic; font-size: 13px; }
.cm-card:not(.active) > .cm-body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cm-history { margin: 4px 0 0 34px; font-size: 12px; color: var(--muted); }
.cm-quote { margin: 6px 0 0 34px; padding-left: 8px; border-left: 2px solid var(--line); color: var(--muted); font-size: 12px; font-style: italic; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-card.anchored > .cm-quote { display: none; }
.cm-composer .cm-quote { border-left: 0; padding-left: 0; display: block; }
.cm-chip-line { margin: 8px 0 0 34px; }
.cm-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--subtle); color: var(--muted-subtle); font-size: 12px; font-weight: 500; }
.cm-chip .icon { width: 13px; height: 13px; }
.cm-hidden .cm-chip { background: var(--warn-bg); color: var(--warn-text); }
.cm-hidden-why { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.cm-more { margin: 6px 0 0 34px; font-size: 12px; font-weight: 600; color: var(--link); }
.cm-card.active > .cm-more { display: none; }
.cm-reply { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cm-reply + .cm-reply { border-top: 0; margin-top: 4px; padding-top: 4px; }
.cm-card.active > .cm-reply { display: block; }
.cm-reply-box { display: none; margin: 12px 0 0 34px; gap: 8px; align-items: flex-end; }
.cm-card.active > .cm-reply-box { display: flex; }
.cm-reply-box textarea:placeholder-shown + button { display: none; }
.comments-root textarea.cm-input { width: 100%; height: auto; min-height: 40px; padding: 9px 12px; resize: none; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 14px; line-height: 1.4; }
.comments-root textarea.cm-input:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.cm-composer textarea.cm-input { min-height: 72px; margin-top: 10px; }
.cm-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.cm-link { height: auto; padding: 0; border: 0; background: none; color: var(--link); font-size: 12px; font-style: normal; font-weight: 600; }
.cm-link:hover { background: none; color: var(--link-hover); text-decoration: underline; }
.cm-error { margin: 8px 0 0 34px; color: var(--error-text); font-size: 13px; }
.cm-menu { position: absolute; right: 8px; top: 40px; z-index: 6; width: 232px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-xl); }
.cm-menu-item { display: flex; width: 100%; justify-content: flex-start; gap: 10px; height: 36px; padding: 0 10px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text); font-size: 14px; }
.cm-menu-item:hover { background: var(--subtle); color: var(--heading); }
.cm-menu-item > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-menu .cm-menu-item.danger { background: transparent; border: 0; color: var(--error-text); }
.cm-menu .cm-menu-item.danger:hover { background: var(--error-bg); color: var(--error-text); }
.cm-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.cm-reopen, .cm-discard { display: none; }

/* the phone sheet (Addendum 52): a column whose head stays put while the body scrolls; 44 px controls */
.comment-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 62%; display: flex; flex-direction: column; overflow: hidden; padding: 8px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.22); pointer-events: auto; }
.sheet-grab { flex: none; width: 40px; height: 4px; margin: 0 auto 6px; border-radius: 2px; background: var(--line); }
#sheet-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-bottom: 8px; }
.sheet-head { flex: none; display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.sheet-step { flex: 1; display: flex; align-items: center; justify-content: center; gap: 2px; }
.sheet-head b { min-width: 56px; text-align: center; color: var(--heading); font-size: 15px; font-weight: 600; }
.comments-root .comment-sheet .icon-btn { width: 44px; height: 44px; }
.comments-root .comment-sheet .icon-btn:disabled { opacity: .35; }
.comment-sheet .cm-link { min-height: 44px; font-size: 15px; }
.sheet-all { padding: 0 4px; }
.sheet-spot-new { display: flex; align-items: center; margin: 4px 0 0 34px; }
.sheet-list-head { flex: none; }
.sheet-list-top { display: flex; align-items: center; gap: 8px; }
.sheet-list-top h2 { flex: 1; margin: 0; text-align: center; font-size: 16px; }
.sheet-new { padding: 0 6px; }
.sheet-tabs { display: flex; gap: 4px; margin: 6px 0 10px; padding: 4px; border-radius: 12px; background: var(--subtle); }
.sheet-tabs button { flex: 1; height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; }
.sheet-tabs button[aria-selected="true"] { background: var(--surface); color: var(--heading); box-shadow: var(--shadow-sm); }
.sheet-full-head { display: none; }
/* The list: compact rows (no actions but Reopen), tap one to open it. */
.comments-root.sheet-list .comment-sheet { top: 0; max-height: none; border-radius: 0; }
.sheet-list #sheet-body .cm-card { padding: 12px 0; border-bottom: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.sheet-list #sheet-body .cm-actions, .sheet-list #sheet-body .cm-reply-box, .sheet-list #sheet-body .cm-menu { display: none !important; }
.sheet-list #sheet-body .cm-reopen { display: inline-flex; margin: 4px 0 0 34px; }
.sheet-list #sheet-body .cm-quote { display: block; }
/* Phone, Cancel with a draft typed: "Discard draft?" */
.comment-sheet .cm-discard:not([hidden]) { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.comment-sheet .cm-discard span { flex: 1; font-weight: 600; color: var(--heading); }
/* Typing: the sheet fills the visual viewport (above the keyboard); the text box row is pinned at its bottom. */
.comments-root.sheet-full { inset: auto; top: var(--vv-top, 0px); left: var(--vv-left, 0px); width: var(--vv-w, 100%); height: var(--vv-h, 100%); z-index: 30; }
.comments-root.sheet-full .comment-sheet { top: 0; max-height: none; border-radius: 0; padding-top: max(6px, env(safe-area-inset-top)); }
.comments-root.sheet-full .sheet-grab, .comments-root.sheet-full .sheet-head, .comments-root.sheet-full .sheet-list-head { display: none; }
.comments-root.sheet-full .sheet-full-head { flex: none; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); margin: 0 -16px 8px; padding: 0 16px 4px 8px; }
.sheet-full-head b { flex: 1; text-align: center; margin-right: 44px; color: var(--heading); font-size: 16px; }
.comments-root.sheet-full #sheet-body { display: flex; flex-direction: column; padding-bottom: 0; }
.comments-root.sheet-full #sheet-body > .cm-card { flex: 1 0 auto; display: flex; flex-direction: column; }
.comments-root.sheet-full .cm-composer > .cm-head { display: none; }
.comments-root.sheet-full .cm-composer > .cm-quote { margin-left: 0; font-size: 14px; }
.comments-root.sheet-list .sheet-grab { display: none; }
.comments-root.sheet-full .cm-entry, .comments-root.sheet-full .cm-card.active > .cm-reply-box { position: sticky; bottom: 0; margin-top: auto; display: flex; align-items: flex-end; gap: 8px; padding: 8px 0 4px; background: var(--surface); }
.comments-root.sheet-full .cm-reply-box { margin-left: 0; }
.comments-root.sheet-full .cm-entry { flex-wrap: wrap; }
.comments-root.sheet-full .cm-entry .cm-error { order: -1; flex-basis: 100%; margin: 0 0 4px; }
.comments-root.sheet-full .cm-entry textarea.cm-input { flex: 1; min-height: 44px; margin-top: 0; }
.comments-root.sheet-full .cm-entry .cm-foot { margin-top: 0; }
.comments-root.sheet-full .cm-entry [data-act=cancel] { display: none; }
.comment-sheet .cm-foot button, .comment-sheet .cm-reply-box button, .comment-sheet .cm-discard button { min-height: 44px; padding: 0 16px; }
.comment-sheet [data-act=whole] { display: inline-flex; align-items: center; }
.comment-sheet .cm-card { position: static; transform: none; box-shadow: none; border: 0; padding: 0; }
.comment-sheet .cm-card::before { display: none; }
.comment-sheet .cm-actions .icon-btn { display: inline-flex; }
.comment-sheet textarea.cm-input { font-size: 16px; }

/* switches: the Share page's Comments section and Mute in the avatar menu */
/* A switch saves on flip: a checkbox (comments.js) or a submit button (share.js / no JS). */
input.switch, button.switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 32px; height: 18px; min-width: 0; margin: 0; padding: 0;
  border: 0; border-radius: 9px; background: var(--edge); cursor: pointer; transition: background .15s;
}
input.switch::after, button.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #ffffff; transition: transform .15s; }
input.switch:checked, button.switch[aria-checked="true"], button.switch[aria-checked="true"]:hover { background: var(--switch-on); }
button.switch:hover { background: var(--edge); }
input.switch:checked::after, button.switch[aria-checked="true"]::after { transform: translateX(14px); }
input.switch:focus-visible, button.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 640px) {
  .mi { min-height: 44px; }
  input.switch, button.switch { width: 44px; height: 26px; border-radius: 13px; }
  input.switch::after, button.switch::after { width: 20px; height: 20px; top: 3px; left: 3px; }
  input.switch:checked::after, button.switch[aria-checked="true"]::after { transform: translateX(18px); }
  input.switch::before, button.switch::before { content: ""; position: absolute; inset: -9px -4px; }
}
.switch-row { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0; cursor: pointer; font-size: var(--fs); font-weight: 400; }
.switch-row .who { display: block; }
.menu-switch { display: flex; align-items: center; gap: 12px; margin: 0; padding: 8px 12px; border-radius: var(--radius); cursor: pointer; font-size: 12px; color: var(--muted); }
.menu-switch:hover { background: var(--subtle); }
.menu-switch strong { display: block; color: var(--heading); font-size: 14px; font-weight: 500; }
.menu-switch > span { flex: 1; }

/* Phone layout: the same query as comments.js phone() (landscape phones keep the sheet). */
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {
  .comment-panel { display: none; }
  body.comments-open .beam-stage { margin-right: 0; }
  body.comments-open .comment-hint { right: 0; }
  body.comments-open .toast { right: 16px; }
  .comment-toggle .comment-label { display: none; }
  .hint-wide { display: none; }
  .hint-narrow { display: inline; }
  .comments-root.sheet-open .comment-hint { display: none; }
  /* The mode hint: one line at the bottom right, never over the page's title. */
  .comment-hint { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); justify-content: flex-end; padding-right: 12px; }
  .comment-hint > div { height: 44px; }
  .comment-hint button { height: 36px; padding: 0 14px; font-size: 14px; }
  /* Toasts (Link copied, Comment resolved · Undo) show above the sheet, the list and the full-screen composer. */
  .toast { z-index: 31; }
}
/* A landscape phone: the sheet takes the height, leaving a strip of page above it. */
@media (pointer: coarse) and (max-height: 500px) {
  /* A landscape phone: the sheet is a panel on the right, full height, so the page stays in view (and live) beside it. */
  .comment-sheet { top: 0; left: auto; width: min(440px, 56vw); max-height: none; border-radius: 16px 0 0 16px; box-shadow: -8px 0 32px rgba(15, 23, 42, 0.22); }
  .comments-root.sheet-full .comment-sheet { left: 0; width: auto; border-radius: 0; }
  body.comments-side .beam-stage { margin-right: min(440px, 56vw); }
  /* Short screens: the composer drops its own author row and starts one line tall (it grows as you type). */
  .comment-sheet .cm-composer > .cm-head { display: none; }
  .comment-sheet .cm-composer textarea.cm-input { min-height: 44px; margin-top: 6px; }
  .comment-sheet .cm-composer .cm-foot { margin-top: 6px; }
}
.toast .toast-act { flex: none; height: 36px; padding: 0 12px; border: 0; background: transparent; color: var(--link); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .cm-card { transition: none; } }
/* S-1: a page asks to save a file; T's own bar, text only (view.js). It is its own full-width row
   between the header and the frame (body.viewing is a column), so it never covers or squeezes the
   header's controls and the frame shrinks to make room. Above the comments layer (16) so Save stays
   reachable; below the header (20) so the header's menus still open over it. */
.save-bar {
  position: relative; z-index: 17; flex: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: var(--info-bg); color: var(--heading); box-shadow: inset 3px 0 0 var(--brand);
  font-size: var(--fs-small); line-height: 1.4;
}
.save-bar p { margin: 0; }
.save-text { flex: 1 1 24rem; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; }
.save-lead, .save-size, .save-name-tail { flex: none; white-space: nowrap; }
.save-file { flex: 1 1 12rem; min-width: 0; display: flex; align-items: baseline; }
.save-name { min-width: 0; display: flex; font-weight: 600; }
.save-name bdi { min-width: 0; display: flex; direction: ltr; }  /* head then tail, whatever the name's script */
.save-name-head { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-bar .save-warning { flex-basis: 100%; order: 1; font-weight: 600; }
.save-actions { display: flex; gap: 8px; flex: none; margin-left: auto; }
@media (max-width: 720px) {
  .save-bar { padding: 8px; gap: 8px; }
  .save-text { flex-basis: 100%; }
}

/* B-1 file-first Beams: the viewer header's file line. */
.beam-bar .file-meta { margin: 0; font-size: 13px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28ch; }
.beam-bar .file-label { margin: 0; font-size: 12px; max-width: 36ch; color: var(--warn, #92400e); }
.file-label-strip { display: none; }
/* Beam 126 (D5-126 prod check): a label in the header row pushed the bar past the window from ~760 to 1035 px (the
   page scrolled sideways), so below 1280 px the label leaves the row for the strip under the header. */
@media (max-width: 1279px) {
  .beam-bar .file-label { display: none !important; }
  .file-label-strip { display: block; flex: none; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .file-label-strip .file-label { margin: 0; font-size: 12px; line-height: 16px; color: var(--warn, #92400e); }
}
@media (max-width: 720px) {
  /* Download is its icon alone on a phone (the word stays for screen readers), so Comment and the menu fit at 390 px. */
  .beam-bar .download-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.page-head h1 > .i-folder { width: .8em; height: .8em; margin-right: .3em; vertical-align: -.05em; }
.panel fieldset { margin: 0 0 16px; padding: 0; border: 0; }
.panel fieldset legend { font-weight: 600; margin-bottom: 8px; }
.panel fieldset label { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.page-head .row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; }
.folder-new-nojs { display: flex; gap: 8px; padding: 6px 10px; }

/* --- direct editing (Beam 114; the approved mockup ops/direct-edit-mockup) -----------------------
   T's own chrome only: the Edit button, the hint row under the header, the save row under the frame,
   the side panel beside the frame (Edit link, Review & save; full screen on a phone), the bullet/row
   menu (a popover, or a bottom sheet on a touch phone), the link chip and the confirm dialog. The page
   draws only its outlines and handles (annotate.js). Z-order: header (20) > menu, chip (19) > save
   bar (17) > comments (16) > toasts (15). */
.edit-toggle[aria-pressed="true"] { background: var(--info-bg); color: var(--info-text); }
.comment-toggle:disabled, .comment-toggle:disabled:hover { background: transparent; border-color: transparent; opacity: .55; }
.edit-hint { flex: none; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 14px; background: var(--info-bg); color: var(--info-text); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 500; line-height: 1.35; }
.edit-hint[hidden], .edit-bar[hidden], .edit-side[hidden], .edit-menu[hidden], .edit-chip[hidden] { display: none !important; }
.edit-esc { margin-left: auto; flex: none; font-size: 12px; font-weight: 400; color: var(--muted-subtle); }
.edit-bar { flex: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.06); position: relative; z-index: 17; }
.edit-count { flex: 1; min-width: 0; font-size: var(--fs); font-weight: 600; color: var(--heading); }
.edit-side { flex: none; width: 390px; max-width: 45vw; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); }
.edit-side-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 16px; }
.edit-side-head h2 { flex: 1; margin: 0; font-size: 16px; color: var(--heading); }
.edit-side .icon-btn { width: 32px; height: 32px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.edit-side .icon-btn:hover { background: var(--subtle); color: var(--heading); }
.edit-side-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 16px 12px; }
.edit-side-foot { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.edit-side-foot:empty { display: none; }
.edit-change { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.45; background: var(--surface); }
.edit-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.edit-k-t { color: var(--info-text); }
.edit-k-a { color: var(--success-text); }
.edit-k-r { color: var(--error-text); }
.edit-k-m { color: var(--edit-moved); }
.edit-k-l { color: var(--warn-text); }
.edit-where { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.edit-old { color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; white-space: pre-wrap; }
.edit-new { color: var(--heading); font-weight: 500; overflow-wrap: anywhere; white-space: pre-wrap; }
.edit-small { margin: 0; font-size: 12px; color: var(--muted); }
.edit-error { margin: 0; font-size: 13px; color: var(--error-text); }
.edit-banner { border-radius: 10px; padding: 10px 12px; font-size: 13px; background: var(--error-bg); color: var(--error-text); }
.edit-field { display: flex; flex-direction: column; gap: 4px; }
.edit-field label { margin: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.edit-field input { width: 100%; max-width: none; }
.edit-field input[readonly] { background: var(--subtle); color: var(--text); }
.edit-menu { position: fixed; z-index: 19; width: 200px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-xl); }
.edit-menu-item { display: flex; width: 100%; justify-content: flex-start; gap: 10px; height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text); font-size: 13px; font-weight: 500; }
.edit-menu-item:hover { background: var(--subtle); color: var(--heading); }
.edit-menu-item .icon { width: 15px; height: 15px; color: var(--muted); }
.edit-menu-item.is-danger, .edit-menu-item.is-danger .icon { color: var(--error-text); }
.edit-menu-item.is-danger:hover { background: var(--error-bg); color: var(--error-text); }
.edit-menu-item:disabled, .edit-menu-item:disabled:hover { background: transparent; color: var(--disabled-text); }
.edit-menu-item:disabled .icon { color: var(--disabled-text); }
.edit-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.edit-menu.is-sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; padding: 10px 14px 22px; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.18); }
.edit-menu.is-sheet .edit-menu-item { height: 44px; font-size: 15px; }
.edit-menu-head { margin: 0 0 6px; font-weight: 600; color: var(--heading); overflow-wrap: anywhere; }
.edit-chip { position: fixed; z-index: 19; display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-xl); font-size: 12px; color: var(--text); white-space: nowrap; }
.edit-chip button { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 999px; }
/* Armed after ~1 s (CLAUDE.md): the bar under the label fills while Save waits. */
button.arming { position: relative; overflow: hidden; }
button.arming::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(255, 255, 255, 0.75); transform-origin: left; animation: edit-arm 1s linear forwards; }
@keyframes edit-arm { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { button.arming::after { animation: none; transform: none; opacity: .5; } }
@media (max-width: 640px) {
  .edit-esc { display: none; }
  .edit-hint { font-size: 12px; }
  .edit-side { position: fixed; inset: 0; z-index: 21; width: auto; max-width: none; border-left: 0; }
  .edit-side-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .edit-side-foot button { flex: 1; height: 44px; }
  .edit-side-foot button[data-ed="side-close"], .edit-side-foot button[data-ed="copy"] { flex: none; }
  .edit-bar { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}

/* --- Web upload (GO Addendum 54): page-wide drop overlay and the bottom-right upload panel (upload.js) --- */
#upload-input { display: none; }
.up-overlay { position: fixed; inset: var(--header-h) 0 0 0; z-index: 40; display: flex; align-items: center; justify-content: center; pointer-events: none; background: color-mix(in srgb, var(--brand) 10%, transparent); border: 3px dashed var(--brand); border-radius: var(--radius); }
.up-overlay[hidden] { display: none; }
.up-drop { display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 14px 22px; border-radius: 12px; background: var(--primary); color: var(--on-primary); font-size: 17px; font-weight: 600; box-shadow: var(--menu-shadow); overflow-wrap: anywhere; }
.up-drop .icon { background: currentColor; }
.up-panel { position: fixed; z-index: 35; right: 16px; bottom: 0; width: 380px; max-width: calc(100vw - 32px); display: flex; flex-direction: column; max-height: min(70vh, 520px); background: var(--surface); color: var(--text); border-radius: 12px 12px 0 0; box-shadow: var(--menu-shadow); overflow: hidden; }
.up-panel[hidden] { display: none; }
.up-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 16px; background: #1b2a4a; color: #fff; }
.up-title { flex: 1; min-width: 0; margin: 0; font-size: 14px; font-weight: 600; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-ib { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--radius); background: transparent; color: inherit; cursor: pointer; }
.up-ib:hover { background: rgba(255, 255, 255, 0.12); }
.up-ib .icon { background: currentColor; }
.up-panel.collapsed .up-ib[aria-expanded] .icon { transform: rotate(180deg); }
.up-panel.collapsed .up-sub, .up-panel.collapsed .up-list, .up-panel.collapsed .up-notes { display: none; }
.up-sub { display: flex; align-items: center; gap: 8px; padding: 6px 16px; background: var(--subtle); color: var(--muted-subtle); font-size: 12px; }
.up-counts { flex: 1; }
.up-sub .btn.text { height: auto; padding: 0; font-size: 12px; }
.up-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; }
.up-row { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.up-kind { flex: none; width: 30px; height: 22px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; background: var(--subtle); color: var(--muted-subtle); font-size: 9px; font-weight: 800; }
.up-nm { flex: 1; min-width: 0; }
.up-f { font-size: 13px; font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-s { font-size: 12px; color: var(--muted); }
.up-s.err { color: var(--error-text); }
.up-s.ok { color: var(--success-text); }
.up-bar { height: 4px; margin-top: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.up-bar[hidden] { display: none; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.2s; }
.up-bar.scan i { width: 100%; background: repeating-linear-gradient(90deg, var(--brand) 0 12px, color-mix(in srgb, var(--brand) 40%, transparent) 12px 24px); }
.up-act { flex: none; font-size: 12px; font-weight: 600; }
.up-act .btn.text { height: auto; padding: 0; font-size: 12px; }
.up-st { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.up-row[data-state="done"] .up-st { background: var(--success-text); }
.up-row[data-state="failed"] .up-st, .up-row[data-state="refused"] .up-st { background: var(--error-text); }
.up-row[data-state="sending"] .up-st, .up-row[data-state="scanning"] .up-st, .up-row[data-state="preparing"] .up-st { background: var(--brand); }
.up-row[data-state="queued"] .up-st, .up-row[data-state="waiting"] .up-st { border: 2px dashed var(--edge); }
.up-row[data-state="cancelled"] .up-st { background: var(--edge); }
.up-note { margin: 0; padding: 8px 16px; font-size: 12px; background: var(--warn-bg); color: var(--warn-text); border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .up-panel { left: 0; right: 0; width: auto; max-width: none; max-height: 55vh; }
  .up-list { padding-bottom: env(safe-area-inset-bottom); }
  .up-ib { width: 44px; height: 44px; }
}

/* --- Markdown Beams (Beam 131 unit D; the approved mockup ops/beam-131-d-mockup) ------------------
   The shared editor (src/lib/beacon_editor) on T in place of the frame, Beam's save bar under it, and
   "Changes since" in the version menu. beam.css styles every <button>; the editor's own classes win
   again inside the stage through a zero-specificity reset. The editor and the frame both use the
   system font, so Edit reads like the preview. */
.md-stage { flex: 1 1 auto; min-width: 0; min-height: 0; overflow: auto; background: var(--be-color-bg); --be-header-height: 0px; }
.md-stage[hidden] { display: none; }
/* Addendum 99 (Beam 189, Mike: "like Google Docs we stay light on md document"): the Markdown
   document surface (Edit, an HTML box and its code, Source, the changes view) is a light sheet in
   every theme, like its preview in the frame. Beam's chrome around it keeps following the theme.
   Both palettes are the light ones, redeclared here because a dark theme sets them on <html>;
   tests/test_brand.py pins each value to its light source (this file's :root, beacon_editor's
   variables.css). The editor's link chip is appended to <body>, outside the stage, and is part of the
   same sheet. */
.md-stage,
.be-link-chip {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --subtle: #f1f5f9;
  --line: #e2e8f0;
  --edge: #64748b;
  --heading: #1b2a4a;
  --text: #334155;
  --muted: #64748b;
  --muted-subtle: #475569;
  --link: #2e6fcc;
  --link-hover: #2660b3;
  --link-subtle: #2660b3;
  --primary: #2660b3;
  --primary-hover: #214f94;
  --primary-active: #1b2a4a;
  --on-primary: #ffffff;
  --brand: #3b86f2;
  --brand-fade: rgba(59, 134, 242, 0);
  --brand-green: #5bcc3e;
  --focus: #2e6fcc;
  --error: #dc2626;
  --error-text: #b91c1c;
  --error-bg: #fef2f2;
  --success-text: #15803d;
  --success-bg: #f0fdf4;
  --warn-text: #b45309;
  --warn-bg: #fffbeb;
  --info-bg: #eff6ff;
  --info-text: #2660b3;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --on-danger: #ffffff;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-xl: 0 12px 32px rgba(15, 23, 42, 0.14);
  --ring: rgba(59, 134, 242, 0.10);
  --brand-panel: #1b2a4a;
  --on-brand-panel: #ffffff;
  --on-brand-panel-muted: #cbd5e1;
  --brand-panel-line: #475569;
  --signal: #77d860;
  --frame-bg: #ffffff;
  --edge-strong: #334155;
  --switch-on: #2660b3;
  --menu-shadow: 0 4px 16px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.06);
  --edit-moved: #6d28d9;
  --be-color-bg: #ffffff;
  --be-color-surface: #f6f8fa;
  --be-color-border: #d0d7de;
  --be-color-text: #1f2328;
  --be-color-text-muted: #656d76;
  --be-color-primary: #0969da;
  --be-color-primary-hover: #0550ae;
  --be-color-error: #cf222e;
  --be-color-success: #1a7f37;
  --be-color-success-bg: #dafbe1;
  --be-color-save: #cf222e;
  --be-color-save-hover: #a40e26;
  --be-tc-default: #57606a;
  --be-tc-author-1: #0969da;
  --be-tc-author-2: #8250df;
  --be-tc-author-3: #bf3989;
  --be-tc-author-4: #bc4c00;
  --be-tc-author-5: #1a7f37;
  --be-tc-author-6: #9a6700;
  --be-tc-author-7: #0e7490;
  --be-tc-author-8: #cf222e;
}
/* beacon_editor's own dark component rules ([data-theme="dark"] X, and [data-theme="system"] X on a dark
   device, in editor.css) match from <html>, so tokens alone cannot undo them: each gets its light rule
   back here, one class stronger and never over a light state rule (an active toolbar button keeps its
   blue on hover; a read-only Source box keeps no focus ring). tests/test_brand.py checks every one has
   its counterpart. */
:root .md-stage .toolbar-group button:not(.is-active):hover { background: #e8eaed; }
:root .md-stage .toolbar-group button.is-active { background: var(--be-color-primary); color: #fff; }
:root .md-stage .dropdown-danger:hover { background: #ffebe9; }
:root .md-stage .mode-toggle { background: var(--be-color-border); }
:root .md-stage .mode-btn { background: var(--be-color-surface); }
:root .md-stage .mode-btn.active { background: var(--be-color-text); color: var(--be-color-bg); }
:root .md-stage .mode-btn:hover:not(.active) { background: #e0e4e8; }
:root .md-stage .be-source-editor:focus:not([readonly]) { box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15); }
:root .md-stage .be-source-editor[readonly]:focus { box-shadow: none; }
:root .md-stage .be-version-panel { box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1); }
:root .md-stage .be-diff-add { background: #dafbe1; color: #1a7f37; }
:root .md-stage .be-diff-remove { background: #ffebe9; color: #cf222e; }
:where(.md-stage) button { height: auto; padding: 0; border: 0; gap: 0; font-size: inherit; line-height: normal; font-weight: inherit; background: none; color: inherit; border-radius: 0; }
.md-stage .toolbar-group button { border: 1px solid var(--be-color-border); }
.md-stage .be-highlight-changes { padding: 4px 10px; font-size: 12px; border: 1px solid var(--be-color-border); border-radius: 6px; }
.md-stage .be-markup-done { padding: 4px 12px; border: 1px solid var(--be-color-border); border-radius: 6px; }
.md-stage .be-markup-info { width: 18px; height: 18px; border: 1px solid var(--be-color-border); border-radius: 50%; font-size: 11px; }
.md-stage .tiptap, .md-stage .be-markup-content, .md-stage .be-source-editor { color: var(--be-color-text); }
.md-stage .tiptap, .md-stage .be-markup-content { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
.md-stage .tiptap-toolbar { max-width: none; padding: 6px max(16px, calc((100% - 880px) / 2)); }
.md-stage #be-btn-save, .md-stage .save-status { display: none !important; }
.md-stage.md-markup-only .tiptap-toolbar { display: none; }
/* Beam 165: while the changes view loads, only "Loading changes…" shows (no empty "Start writing…" editor). */
.md-stage.md-loading > :not(.md-stage-loading) { display: none !important; }
.md-stage-loading { margin: 48px auto; max-width: 880px; padding: 0 16px; color: var(--muted); font-size: 14px; }
.md-stage-loading[hidden] { display: none; }
/* Author colour 1 is the link blue: Beam's annotator starts at slot 2, and a marked link is not underlined twice. */
.md-stage .be-markup-content a[data-tc], .md-stage .be-markup-content [data-tc] a { text-decoration: none; }
.md-bar .edit-note { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.md-bar.is-error .edit-count { color: var(--error-text); }
.md-bar.is-error .edit-note { display: none; }
/* Beam 160: the autosave states ("Saving draft…" spinner, "● Draft saved 2:41 PM"), the Restore prompt and the
   draft's changes view (approved mockups ops/beam-160-mockup/review/01..04). */
.md-bar-icon { display: inline-block; vertical-align: -1px; margin-right: 7px; }
.md-bar-icon[hidden] { display: none; }
.md-bar-icon.is-dot { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; vertical-align: 1px; margin-right: 6px; }
.md-bar-icon.is-spin { width: 10px; height: 10px; box-sizing: border-box; border: 2px solid #cbd5e1; border-top-color: #1d4ed8; border-radius: 50%; animation: md-spin 0.8s linear infinite; }
@keyframes md-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .md-bar-icon.is-spin { animation: none; } }
dialog.dialog.md-restore { max-width: 420px; }
dialog.dialog.md-restore p { margin: 0; }
dialog.dialog.md-restore .foot { align-items: center; margin-top: 20px; }
.md-restore-gap { flex: 1; }
.md-restore .foot button[hidden] { display: none; }
.md-stage .be-markup-banner [hidden] { display: none !important; }
.md-stage .be-markup-done.md-draft-act { margin-left: 6px; }
.md-stage .be-markup-done.md-draft-act[data-md-draft="back"] { margin-left: auto; }
.md-stage .be-markup-done.md-draft-act.is-danger { color: var(--error-text); }
.md-stage .be-markup-done.md-draft-act.is-primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
/* Beam 193: comment spots in Edit (md-comments.js), the look of annotate.js's spots in the preview. A fixed layer
   over the part of the stage under the editor's toolbar; only the pins take clicks. Per-author colours are set
   from script (CSSOM), never inline markup. */
.md-cm-layer { position: fixed; overflow: hidden; pointer-events: none; z-index: 3; margin: 0; padding: 0; }
.md-cm-layer[hidden] { display: none; }
.md-cm-layer * { box-sizing: border-box; }
.md-cm-t { position: absolute; pointer-events: none; border-radius: 1px; }
.md-cm-t.md-cm-on { background: rgba(59, 134, 242, .34) !important; box-shadow: none !important; }
.md-cm-look .md-cm-t { background: rgba(253, 224, 71, .5); box-shadow: inset 0 -2px 0 #ca8a04; }
.md-cm-box { position: absolute; pointer-events: none; border-radius: 2px; }
.md-cm-box[hidden] { display: none; }
.md-cm-box.md-cm-on { outline: 2px solid #3b86f2; background: rgba(59, 134, 242, .18); }
.md-cm-box.md-cm-hover { outline: 2px dashed #3b86f2; background: rgba(59, 134, 242, .12); }
.md-cm-pin { position: absolute; width: 10px; height: 10px; border-radius: 50%; pointer-events: auto; cursor: pointer; box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0, 0, 0, .3); font: 700 11px/26px system-ui, sans-serif; color: #fff; text-align: center; }
.md-cm-pin[hidden] { display: none; }
.md-cm-pin::after { content: ""; position: absolute; inset: -10px; }
.md-cm-pin.md-cm-on { width: 26px; height: 26px; border-radius: 50% 50% 50% 4px; }
.md-cm-pin.md-cm-n { width: 22px; height: 22px; border-radius: 50%; background: #fff !important; color: #713f12; box-shadow: 0 0 0 2px #ca8a04, 0 1px 3px rgba(0, 0, 0, .3); font: 700 12px/22px system-ui, sans-serif; }
.md-cm-pin.md-cm-n::after { inset: -11px; }
.md-cm-pin.md-cm-n.md-cm-on { background: #ca8a04 !important; color: #fff; }
@keyframes md-cm-flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(59, 134, 242, 0); } 30% { box-shadow: 0 0 0 6px rgba(59, 134, 242, .45); } }
.md-cm-flash { animation: md-cm-flash .9s ease 2; }
@media (prefers-reduced-motion: reduce) { .md-cm-flash { animation: none; } }
.version-list li.md-vrow { display: flex; align-items: center; gap: 2px; }
.version-list li.md-vrow .version-row { flex: 1 1 auto; width: auto; min-width: 0; }
.v-changes { flex: none; font-size: 12px; font-weight: 600; color: var(--link); text-decoration: none; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.v-changes:hover { background: var(--subtle); text-decoration: none; }
.menu-item.md-highlight > span:last-child { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.menu-item.md-highlight .sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.md-saved form { display: contents; }
.versions .md-changes-link { flex: none; }
@media (max-width: 640px) {
  .md-stage .tiptap-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 6px 10px; }
  .md-stage .tiptap-toolbar::-webkit-scrollbar { display: none; }
  .md-stage .tiptap-toolbar .toolbar-spacer { display: none; }
  .md-stage .toolbar-right { position: sticky; right: -10px; background: var(--be-color-bg); padding-left: 6px; box-shadow: -8px 0 8px -4px rgba(15, 23, 42, .12); }
  .md-stage .be-highlight-changes { display: none !important; }
  .md-stage .be-markup-banner { flex-wrap: wrap; }
  .md-stage .be-markup-content table, .md-stage .tiptap table { display: block; max-width: 100%; overflow-x: auto; }
  .md-bar .edit-note { display: none; }
  .md-restore-gap { display: none; }
  .md-bar button { flex: none; height: 44px; }
  /* A refusal's sentence gets the bar's whole width, the buttons a row of their own below it (an
     iPhone squeezed it to one word a line, over the whole editor). */
  .md-bar:is(.is-error, .is-warn) { flex-wrap: wrap; row-gap: 8px; }
  .md-bar:is(.is-error, .is-warn) .edit-count { flex: 1 0 100%; font-size: 14px; line-height: 1.35; }
  .md-bar:is(.is-error, .is-warn) button:first-of-type { margin-left: auto; }
}

/* --- present mode (Beam 134, GO Addendum 65, D5-133) ----------------------------------------------
   Only on the person's own tap or key. Where the browser can, Present (or F) puts T's own stage
   (main.beam-stage) into browser full screen. On a phone in landscape without that (iPhone Safari),
   Present slides the header away and leaves T's Beacon chip in the corner; the chip, Esc or turning
   back to portrait brings the header back. The Beam's frame and its sandbox are untouched (no
   allow-fullscreen), so a page can never go full screen or hide the header itself. Present waits
   while comment UI, editing or the Markdown editor is in use. */
body:is(.editing, .edit-side-open, .md-staged, .comments-open, .comments-side, .ai-open) [data-present],
body:has(#comment-sheet:not([hidden]), .comments-root.commenting) [data-present] { display: none !important; }
[data-present][hidden], .present-exit[hidden], .present-chip[hidden] { display: none !important; } /* the [hidden] rule covers these too; said here so neither outlives its timer */
.present-btn .icon { width: 18px; height: 18px; }
.beam-stage:fullscreen { margin: 0; background: var(--frame-bg); }
.present-exit {
  position: absolute; top: 16px; right: 16px; z-index: 5;
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border: 0; border-radius: 999px; background: rgba(15, 27, 51, 0.9); color: #fff;
  font: 500 13px/1 var(--font, system-ui), system-ui, sans-serif; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  cursor: pointer; transition: opacity 0.3s;
}
.present-exit:hover { background: #0f1b33; color: #fff; }
.present-exit .icon { width: 16px; height: 16px; }
.present-exit .kbd { opacity: 0.7; font-size: 12px; }
.present-exit.faded { opacity: 0; pointer-events: none; }
/* T's chip: the Beacon mark and the exit icon, over the frame's corner (T's DOM, above the frame, so a page
   can't cover it). Dims after 3 s and stays tappable; 44 px to tap. */
.present-chip {
  position: fixed; z-index: 22; top: 10px; right: max(10px, env(safe-area-inset-right));
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 8px; margin: 0;
  border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--muted); box-shadow: 0 2px 10px rgba(15, 23, 42, 0.22); cursor: pointer; transition: opacity 0.4s;
}
.present-chip::before { content: ""; position: absolute; inset: -6px; }
.present-chip:hover { background: var(--surface); color: var(--heading); }
.present-chip .logo-mark { display: block; width: 30px; height: 16px; }
.present-chip .sep { width: 1px; height: 16px; background: var(--line); }
.present-chip .icon { width: 15px; height: 15px; }
.present-chip.dim { opacity: 0.4; }
body.presenting-lite .beam-bar {
  position: fixed; top: 0; left: 0; right: 0;
  transform: translateY(-100%); visibility: hidden;
  transition: transform 0.2s ease, visibility 0s linear 0.2s;
}
@media (prefers-reduced-motion: reduce) {
  .beam-bar, .present-exit, .present-chip { transition: none !important; }
}

/* --- Outline pane (Beam 158, GO Addendum 77; mockup ops/beam-158-outline/mockups/A-*) ----------------------
   T's own list of the page's H1-H3 (outline.py): on the left of the frame, so comments keep the right. On a
   phone it is a bottom sheet over a scrim. Presenting hides it. */
.outline-toggle[aria-pressed="true"] { background: var(--info-bg); color: var(--info-text); }
.outline-pane { flex: none; width: 272px; min-height: 0; display: flex; flex-direction: column; background: var(--bg); border-right: 1px solid var(--line); }
.outline-pane[hidden], .outline-scrim[hidden] { display: none; }
.outline-grab { display: none; }
.outline-head { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.outline-head h2 { flex: 1; margin: 0; font-size: 14px; font-weight: 700; color: var(--heading); }
.outline-list { list-style: none; margin: 0; padding: 10px 8px 16px; overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.ol-row { position: relative; display: flex; align-items: flex-start; border-radius: var(--radius); }
.ol-row:hover { background: var(--subtle); }
.ol-row.ol-hidden { display: none; }
.ol-go { flex: 1; min-width: 0; padding: 6px 30px 6px 30px; color: var(--muted); font-size: 13.5px; line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
/* The clamp sits on the text, not the padded link, so no third line shows through the padding. */
.ol-go bdi { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ol-go:hover { color: var(--heading); text-decoration: none; }
.ol-h1 .ol-go { padding-left: 10px; color: var(--heading); font-weight: 700; }
.ol-h2 .ol-go { color: var(--text); }
.ol-h3 .ol-go { padding-left: 46px; }
.ol-row.is-current { background: var(--info-bg); }
.ol-row.is-current .ol-go { color: var(--heading); font-weight: 600; }
.ol-row.is-current::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--brand); }
.ol-fold { position: absolute; left: 6px; top: 5px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.ol-fold:hover { background: var(--line); color: var(--heading); }
.ol-fold .icon { width: 14px; height: 14px; transition: transform .15s; }
.ol-fold[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.ol-link { position: absolute; right: 4px; top: 4px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; opacity: 0; }
.ol-row:hover .ol-link, .ol-link:focus-visible, .ol-link.copied { opacity: 1; }
.ol-link:hover { background: var(--line); color: var(--heading); }
.ol-link .icon { width: 14px; height: 14px; }
.ol-link.copied::after { content: "Link copied"; position: absolute; right: 0; top: -28px; padding: 3px 8px; border-radius: 5px; background: #0f172a; color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none; }
body.presenting .outline-pane, body.presenting-lite .outline-pane, .beam-stage:fullscreen .outline-pane { display: none !important; }
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {
  .outline-toggle .outline-label { display: none; }
  .outline-pane { position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 62%; z-index: 30; border: 0; border-radius: 16px 16px 0 0;
    background: var(--surface); box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.22); padding-bottom: env(safe-area-inset-bottom); }
  .outline-grab { display: block; flex: none; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--line); }
  .outline-head .icon-btn { width: 44px; height: 44px; }
  .outline-scrim { position: fixed; inset: 0; z-index: 29; background: rgba(15, 23, 42, 0.35); }
  .ol-go { font-size: 15.5px; padding-top: 11px; padding-bottom: 11px; }
  .ol-fold { top: 8px; width: 30px; height: 30px; }
  .ol-link { display: none; } /* the phone sheet is for going places (mockup A); section links are copied on a computer */
}
/* --- Admin usage view (/admin/beam/usage, GO Addendum 78): beacon_admin only, read-only. --- */
.page.usage { max-width: 76rem; }
.usage-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.usage-head .grow { flex: 1 1 24rem; }
.ro { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 12px; font-size: 12px; background: var(--subtle); color: var(--muted-subtle); }
.ro .icon { width: 14px; height: 14px; }
.usage-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 24px; overflow-x: auto; }
.usage-tabs a { padding: 8px 12px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.usage-tabs a:hover { color: var(--heading); }
.usage-tabs a[aria-current] { color: var(--heading); border-bottom-color: var(--brand); }
.usage-h { margin: 0; font-size: var(--fs); font-weight: 600; color: var(--heading); letter-spacing: 0; }
.usage-gap { margin-top: 18px; }
.usage-gap-lg { margin-top: 28px; }
.usage-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.usage-search { max-width: 320px; }
.usage-search input { width: 100%; height: var(--h); padding: 0 10px 0 32px; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--bg); color: var(--text); font: inherit; }
.usage-total { color: var(--muted); font-size: 13px; margin-left: auto; }
.usage-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 8px; background: var(--subtle); }
.usage-seg a { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 6px; color: var(--muted-subtle); font-size: 13px; text-decoration: none; white-space: nowrap; }
.usage-seg a:hover { color: var(--heading); }
.usage-seg a[aria-current] { background: var(--surface); color: var(--heading); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.usage-range { margin-left: auto; }
.usage-toolbar .usage-range { margin-left: 0; }
.usage-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.usage-stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.usage-stats .stat { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface); min-width: 0; }
.usage-stats .k { font-size: 13px; color: var(--muted); }
.usage-stats .v { font-size: 26px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 4px; overflow-wrap: anywhere; }
.usage-stats .s { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.usage-two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.usage-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--surface); min-width: 0; }
.usage-note { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.usage-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 4px 0 10px; flex-wrap: wrap; }
.usage-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.usage-legend .c1, .usage-chart .c1 { background: var(--brand); fill: var(--brand); }
.usage-legend .c2, .usage-chart .c2 { background: #8b5cf6; fill: #8b5cf6; }
.usage-chart { width: 100%; height: auto; display: block; }
.usage-chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.usage-chart line { stroke: var(--line); }
.usage-bars { list-style: none; margin: 0; padding: 0; }
.usage-bars li { display: grid; grid-template-columns: minmax(0, 7.5rem) 1fr 3rem; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.usage-bars li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-bars .bar { width: 100%; height: 8px; display: block; border-radius: 4px; overflow: hidden; }
.usage-bars .bar rect { fill: var(--brand); }
.usage-bars.green .bar rect { fill: var(--brand-green); }
.usage-bars .bar rect.track { fill: var(--subtle); }
.usage-bars .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.usage-table td { vertical-align: middle; }
.usage-table td .sub { display: block; font-size: 12px; color: var(--muted); }
.usage-table td.title a { color: var(--link); text-decoration: none; font-weight: 500; }
.usage-table td.title a:hover { text-decoration: underline; }
.usage-table td.title { overflow-wrap: anywhere; color: var(--heading); }
.usage-table td.person a { color: var(--heading); font-weight: 500; text-decoration: none; }
.usage-table td.person a:hover { text-decoration: underline; }
.usage-table .nowrap { white-space: nowrap; }
.usage-table th a { color: inherit; text-decoration: none; }
.usage-table th[aria-sort] a { color: var(--heading); }
.usage-table th .arrow { font-size: 10px; margin-left: 3px; }
.usage-table-wrap { overflow: visible; }
.badge.guest { background: var(--warn-bg); color: var(--warn-text); }
.usage-apps { display: flex; gap: 4px; flex-wrap: wrap; }
.usage-apps > span { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--subtle); color: var(--muted-subtle); white-space: nowrap; }
.usage-apps > span.none { background: none; }
/* "Shared with" chip; External is always amber and outlined so it stands out. */
.usage-access { display: inline-block; }
.usage-access > summary.sw { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 12px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; background: var(--info-bg); color: var(--info-text); }
.sw .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sw .icon { width: 12px; height: 12px; }
.sw .n { font-weight: 400; opacity: .85; }
.sw.sw-everyone { border-color: var(--info-text); }
.sw.sw-ext { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-text); }
.sw.sw-mix { background: linear-gradient(90deg, var(--info-bg) 0 50%, var(--warn-bg) 50% 100%); color: var(--heading); border-color: var(--warn-text); }
.sw.sw-mix .ext-part { color: var(--warn-text); }
.usage-access[open] > summary.sw { box-shadow: 0 0 0 2px var(--focus); }
.usage-access > summary.sw:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.usage-pop { width: 28rem; max-width: calc(100vw - 32px); padding: 14px 16px; font-size: 13px; white-space: normal; text-align: left; z-index: 30; }
.usage-pop .pop-title { font-size: 14px; color: var(--heading); margin: 0 0 2px; font-weight: 600; }
.usage-pop .pop-lead { color: var(--muted); margin: 0 0 10px; overflow-wrap: anywhere; }
.usage-pop .pop-wide { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--info-bg); color: var(--info-text); margin-bottom: 8px; }
.usage-pop .pop-wide .icon { flex: none; margin-top: 2px; }
.pop-people { list-style: none; margin: 0; padding: 0; max-height: 22rem; overflow: auto; }
.pop-people li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); align-items: start; }
.pop-people li:first-child { border-top: 0; }
.pop-people .avatar { width: 28px; height: 28px; font-size: 11px; border: 0; background: var(--info-bg); color: var(--info-text); grid-row: span 2; }
.pop-people li.guest .avatar { background: var(--warn-bg); color: var(--warn-text); }
.pop-people .nm { color: var(--heading); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-people .rl { color: var(--muted); font-size: 12px; text-align: right; }
.pop-people .meta { grid-column: 2 / 4; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.usage-pop .pop-foot { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; text-align: right; }
.usage-pop .pop-foot a { color: var(--link); text-decoration: none; }
.usage-private { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: 8px; background: var(--subtle); color: var(--muted-subtle); font-size: 13px; }
.usage-private .icon { flex: none; margin-top: 1px; }
.usage-private strong { color: var(--heading); }
.usage-private a { color: var(--link-subtle); }
.usage-person { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 8px 0 20px; }
.usage-person .grow { flex: 1 1 20rem; min-width: 0; }
.usage-person .avatar.big { width: 48px; height: 48px; font-size: 18px; border: 0; background: var(--info-bg); color: var(--info-text); }
.usage-person h1 { font-size: 20px; font-weight: 600; color: var(--heading); margin: 0; overflow-wrap: anywhere; }
.usage-person .sub { color: var(--muted); font-size: 13px; margin: 2px 0 0; overflow-wrap: anywhere; }
.usage-activity { list-style: none; margin: 0; padding: 0; }
.usage-activity li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.usage-activity li:first-child { border-top: 0; }
.usage-activity .when { color: var(--muted); width: 8.5rem; flex: none; font-variant-numeric: tabular-nums; }
.usage-activity .what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.usage-activity .priv { color: var(--muted); font-style: italic; }
@media (max-width: 860px) {
  .usage-two { grid-template-columns: 1fr; }
  .usage-stats.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .usage-stats, .usage-stats.five { grid-template-columns: 1fr 1fr; gap: 8px; }
  .usage-stats .stat { padding: 10px 12px; }
  .usage-stats .v { font-size: 22px; }
  .usage-search { max-width: none; flex: 1 1 100%; }
  .usage-total { margin-left: 0; flex: 1 1 100%; }
  /* Tables become cards (the data-rows pattern); the less-used columns live on the person page. */
  .usage-table, .usage-table tbody, .usage-table tr, .usage-table td { display: block; }
  .usage-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .usage-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .usage-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .usage-table td::before { content: attr(data-label); color: var(--muted); text-align: left; }
  .usage-table td:first-child { display: block; text-align: left; padding-bottom: 6px; }
  .usage-table td:first-child::before { content: none; }
  .usage-table td.ph-hide { display: none; }
  .usage-table td .sub { display: inline; margin-left: 6px; }
  .usage-table td.person .sub { display: block; margin: 0; }
  /* The who-has-access panel is a bottom sheet. */
  .usage-access .usage-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; border-radius: 14px 14px 0 0; padding: 8px 16px 28px; max-height: 75vh; overflow: auto; }
  .usage-access .usage-pop::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
  .pop-people { max-height: none; }
  .usage-activity .when { width: 6rem; }
}
.menu-panel .menu-group { margin: 4px 10px 2px; font-size: 12px; font-weight: 600; color: var(--muted); }

/* Storage quotas (GO Addendum 81 c; ~/Beacon/beam/ops/beam-161-quotas mockups): the meter, /storage, /admin/beam/storage. */
svg.meter { display: block; width: 100%; height: 8px; border-radius: 4px; overflow: hidden; }
svg.meter .track { fill: var(--subtle); }
svg.meter .fill { fill: var(--brand); }
svg.meter.warn .fill { fill: var(--warn-text); }
svg.meter.over .fill { fill: var(--danger); }
svg.meter.big { height: 12px; border-radius: 6px; }
.storage-meter { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; max-width: 880px; margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.storage-meter .meter { width: 160px; flex: none; }
.storage-meter a { color: var(--link); text-decoration: none; white-space: nowrap; }
.storage-meter a:hover { text-decoration: underline; }
.storage-meter .txt { min-width: 0; }
.storage-meter.warn .txt { color: var(--warn-text); }
.storage-meter.over .txt { color: var(--danger); }
.storage-meter .pend { white-space: nowrap; }
.store-card { border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; background: var(--surface); }
.store-card .big-num { font-size: 26px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; }
.store-card .of { color: var(--muted); font-size: 15px; font-weight: 400; }
.store-card .meter { margin: 12px 0 14px; }
.store-card .over-note { margin: 0 0 12px; color: var(--danger); font-size: 14px; }
.store-card .acts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.store-card .fine { font-size: 13px; color: var(--muted); margin: 14px 0 0; }
.parts { list-style: none; padding: 0; margin: 0 0 16px; }
.parts li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; border-top: 1px solid var(--line); }
.parts li:first-child { border-top: 0; }
.parts .n { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.parts .part-sub { color: var(--muted); font-size: 13px; }
.storage-page .store-card, .storage-page .req-status, .storage-page .using-sec, .storage-page .hist-sec { max-width: 880px; }
.req-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--info-bg); color: var(--info-text); margin: 0 0 16px; font-size: 14px; box-sizing: border-box; }
.req-status.ok { background: var(--success-bg); color: var(--success-text); }
.req-status.no { background: var(--subtle); color: var(--muted-subtle); }
.req-status .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.req-status .inline-form { display: inline; }
button.linklike { display: inline; height: auto; min-height: 0; background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-decoration: underline; }
.using-sec, .hist-sec { margin-top: 28px; }
.using-sec h2, .hist-sec h2, .handled h2 { margin: 0 0 4px; font-size: var(--fs); font-weight: 600; color: var(--heading); }
.using-lede, .default-note { font-size: 13px; color: var(--muted); margin: 0 0 10px; max-width: 72ch; }
.using-sec .usage-seg { margin-bottom: 8px; }
.using-more { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.using td .sub.shared { color: var(--warn-text); }
.using td.act form { margin: 0; }
.req-hist { list-style: none; padding: 0; margin: 0; }
.req-hist li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.req-hist li:first-child { border-top: 0; }
.req-hist .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.req-hist .note { grid-column: 2; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.ask-lead { color: var(--muted); font-size: 14px; margin: 4px 0 16px; }
.opt { font-weight: 400; color: var(--muted); }
.ask-nojs { display: grid; gap: 8px; margin-top: 12px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 14px; margin: 0 0 4px; }
label.check input { width: auto; height: auto; }
.badge.ok { background: var(--success-bg); color: var(--success-text); }
.badge.no { background: var(--subtle); color: var(--muted-subtle); }
.badge.over { background: var(--error-bg); color: var(--error-text); }
a.badge { text-decoration: none; }
.btn.small, button.small { height: 28px; min-height: 28px; padding: 0 10px; font-size: 13px; }
.req-cards { display: grid; gap: 12px; }
.req-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--surface); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; }
.req-card .who b { color: var(--heading); font-weight: 600; }
.req-card .who .sub { display: block; font-size: 12px; color: var(--muted); }
.req-card .use { display: grid; grid-template-columns: 140px auto; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 8px; }
.req-card .ask { font-size: 14px; margin-top: 8px; }
.req-card .muted-sm { color: var(--muted); font-size: 13px; }
.req-card .why { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--line); color: var(--text); font-size: 14px; background: var(--subtle); border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }
.req-card .side { display: flex; flex-direction: column; align-items: flex-end; }
.req-card .when { font-size: 12px; color: var(--muted); }
.req-card .decide-d { grid-column: 1 / -1; }
.req-card .decide-d + .decide-d { margin-top: -4px; }
.req-card .decide-d > summary { display: inline-flex; list-style: none; cursor: pointer; }
.req-card .decide-d > summary::-webkit-details-marker { display: none; }
.req-card .decide-d[open] > summary { box-shadow: 0 0 0 2px var(--focus); }
.decide { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 14px; display: grid; grid-template-columns: 10rem minmax(0, 1fr) auto; gap: 10px 12px; align-items: end; }
.decide.decline { grid-template-columns: minmax(0, 1fr) auto; }
.decide .field { margin: 0; }
.decide input { width: 100%; box-sizing: border-box; }
.decide .acts { display: flex; gap: 8px; }
.decide .hint { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin: 0; }
.handled { margin-top: 28px; }
.handled td .sub { display: block; }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.quota-usage td.used .meter { width: 120px; display: inline-block; vertical-align: middle; }
.req-card .use .meter { width: 140px; }
.quota-usage .pct { display: inline-block; width: 3rem; text-align: right; font-variant-numeric: tabular-nums; }
.quota-usage td.used .sub { display: inline; margin-left: 6px; }
.quota-usage td.act form, .quota-usage td.act dialog form { margin: 0; }
.quota-history .hnote { display: block; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .storage-meter .meter { width: 100%; }
  .store-card { padding: 16px; }
  .req-card { grid-template-columns: 1fr; }
  .req-card .side { align-items: flex-start; order: -1; }
  .decide, .decide.decline { grid-template-columns: 1fr; }
  .decide .acts .btn { flex: 1; }
  .req-hist li { grid-template-columns: 1fr; }
  .req-hist .note { grid-column: 1; }
  .quota-usage td.used .meter { width: 90px; }
  .usage-table td.act::before, .using td.act::before { content: none; }
}
/* --- External access, compact (GO Addendum 81 b): one row per outside person; click to expand. --- */
.ext-list { border-top: 1px solid var(--line); }
.ext-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 2fr) minmax(0, 1fr) 6rem; gap: 12px; align-items: center; padding: 10px 12px; }
.ext-head { font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.ext-person { border-bottom: 1px solid var(--line); }
.ext-person > summary { list-style: none; cursor: pointer; }
.ext-person > summary::-webkit-details-marker { display: none; }
.ext-person > summary:hover { background: var(--subtle); }
.ext-person > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ext-row .person { min-width: 0; }
.ext-row .who { display: block; color: var(--heading); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ext-row .sub { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ext-row .org, .ext-row .owners { overflow-wrap: anywhere; min-width: 0; }
.ext-row > span { min-width: 0; }
.ext-row .sw { max-width: 100%; overflow: hidden; }
.ext-toggle { justify-self: end; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 1px solid var(--edge); border-radius: var(--radius); font-size: 13px; color: var(--text); white-space: nowrap; }
.ext-toggle .hide, .ext-person[open] .ext-toggle .show { display: none; }
.ext-person[open] .ext-toggle .hide { display: inline; }
.sw.sw-send { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 12px; font-size: 12px; background: var(--subtle); color: var(--muted-subtle); white-space: nowrap; }
.usage .sw.sw-ext { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 12px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid var(--warn-text); background: var(--warn-bg); color: var(--warn-text); }
.ext-items { list-style: none; margin: 0; padding: 4px 12px 12px 24px; background: var(--subtle); }
.ext-items li { display: flex; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted-subtle); }
.ext-items li:first-child { border-top: 0; }
.ext-items .kind { width: 4rem; flex: none; color: var(--muted-subtle); }
.ext-items .what { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.ext-items .what .sub { display: inline; margin-left: 4px; color: var(--muted-subtle); font-size: 11px; }
@media (max-width: 640px) {
  .ext-head { display: none; }
  .ext-row { grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; }
  .ext-row .person { grid-column: 1 / -1; }
  .ext-row > [data-label] { display: contents; }
  .ext-row > [data-label]::before { content: attr(data-label); color: var(--muted); }
  .ext-row > .ph-hide { display: none; }
  .ext-row .sw { justify-self: start; }
  .ext-toggle { grid-column: 1 / -1; justify-self: start; border: 0; padding: 0; height: auto; color: var(--link); }
  .ext-items { padding: 4px 12px 12px; }
}

/* Export Beam / Export Folder (GO Addendum 108; templates/beam/export.html, static/beam/beam-export.js). */
dialog.dialog.export-dialog { width: min(560px, calc(100vw - 32px)); max-width: 560px; margin: auto; padding: 0; border-radius: 14px; box-sizing: border-box; }
dialog.export-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
dialog.export-dialog .export-loading, dialog.export-dialog .export-fail { padding: 18px 20px; }
.export-card { max-width: 560px; margin: 0 auto; background: var(--surface); }
.narrow .export-card { border: 1px solid var(--line); border-radius: 14px; }
.export-card .ex-head { padding: 18px 20px 4px; }
.export-card .ex-head h2 { margin: 0; font-size: 18px; color: var(--heading); }
.export-card .ex-head h2:focus { outline: none; }
.export-card .ex-head p { margin: 4px 0 0; font-size: 13px; }
.export-card .ex-form, .export-card .ex-made, .export-card .ex-past { padding: 10px 20px; }
.export-card .ex-error { margin: 8px 20px 0; }
.ex-field { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.ex-field label { font-weight: 600; color: var(--heading); font-size: 13px; }
.ex-field select { font: inherit; border: 1px solid var(--edge); border-radius: 8px; padding: 0 24px 0 10px; background: var(--bg); color: inherit; max-width: 100%; } /* fixed height (--h): vertical padding clipped descenders on prod */
.ex-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.ex-list li { display: flex; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-start; }
.ex-list li:first-child { border-top: 0; }
.ex-list input[type=checkbox] { margin: 3px 0 0; width: 16px; height: 16px; flex: none; accent-color: var(--primary); }
.ex-what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ex-what b { color: var(--heading); font-weight: 600; }
.ex-what small { display: block; color: var(--muted); font-size: 12.5px; }
.ex-tick { color: var(--success-text); font-weight: 700; width: 18px; flex: none; text-align: center; }
.ex-tick.off { color: var(--muted); }
.ex-skip { color: var(--muted) !important; text-decoration: line-through; }
.ex-lock { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.ex-sub { margin: 8px 0 0; padding: 8px 10px; background: var(--subtle); border-radius: 8px; }
.ex-sub label { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0; font-size: 13px; }
.ex-opts { margin-top: 10px; }
.ex-info { background: var(--info-bg); color: var(--info-text); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 10px 0 0; }
.ex-ok { background: var(--success-bg); color: var(--success-text); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 0; overflow-wrap: anywhere; }
.ex-busy { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 0; }
.ex-spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: ex-spin 0.8s linear infinite; flex: none; }
@keyframes ex-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ex-spin { animation: none; } }
.ex-skipped { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.ex-past h3 { font-size: 15px; color: var(--heading); margin: 0 0 6px; }
.ex-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ex-table th, .ex-table td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.ex-table th { color: var(--muted); font-weight: 600; font-size: 12px; border-top: 0; }
.export-card .ex-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); margin: 10px -20px 0; }
.export-card > .ex-foot { margin: 0; }
.ex-foot form { margin: 0; }
.ex-size { margin-right: auto; color: var(--muted); font-size: 13px; }
.ex-dl-status { margin: 0 0 8px; }
@media (max-width: 560px) {
  .ex-table th:nth-child(4), .ex-table td:nth-child(4) { display: none; }
  .export-card .ex-foot { flex-wrap: wrap; }
}

/* Beam 322 U4: a version's AI-made print PDF (approved mockup ops/beam-322-llm-pdf/mockup.html shots 1-7). The PDF is
   shown in a sandboxed frame of Beam's file viewer on the content host; everything else is T's own chrome. */
.menu-item.pdf-item { gap: 8px; }
.menu-item.pdf-item .pdf-label { flex: 1; min-width: 0; }
.pdf-chip { margin-left: auto; }
.menu-panel form > button.pdf-viewer-item { align-items: flex-start; }
.menu-panel form > button.pdf-viewer-item small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
dialog.dialog.pdf-dialog { width: min(680px, calc(100vw - 32px)); max-width: 680px; margin: auto; padding: 0; border-radius: 14px; box-sizing: border-box; }
dialog.pdf-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
dialog.pdf-dialog .pdf-loading, dialog.pdf-dialog .pdf-fail { padding: 18px 20px; }
.pdf-card { max-width: 680px; margin: 0 auto; background: var(--surface); }
.narrow .pdf-card { border: 1px solid var(--line); border-radius: 14px; }
.pdf-card .pdf-head { padding: 18px 20px 4px; }
.pdf-card .pdf-head h2 { margin: 0; font-size: 18px; color: var(--heading); }
.pdf-card .pdf-head h2:focus { outline: none; }
.pdf-card .pdf-head p { margin: 4px 0 0; font-size: 13px; }
.pdf-card .pdf-notice, .pdf-card .pdf-dl-status { margin: 8px 20px 0; }
.pdf-show { margin: 10px 20px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--subtle); }
.pdf-frame { display: block; width: 100%; height: min(52vh, 460px); border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.pdf-strip { display: flex; gap: 10px; margin: 10px 0 0; overflow-x: auto; }
.pdf-strip figure { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.pdf-strip img { display: block; width: 120px; height: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.pdf-show .cap { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.pdf-info, .pdf-ok, .pdf-warn, .pdf-ask { margin: 10px 20px 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.pdf-info { background: var(--info-bg); color: var(--info-text); }
.pdf-ok { background: var(--success-bg); color: var(--success-text); }
.pdf-ok a { color: inherit; }
.pdf-warn { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-text); }
.pdf-ask { border: 1px dashed var(--edge); text-align: center; padding: 18px 16px; }
.pdf-ask strong { display: block; color: var(--heading); font-size: 15px; margin: 0 0 4px; }
.pdf-body { padding: 0; }
.pdf-busy { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 10px 20px 0; }
.pdf-card .pdf-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); margin: 14px 0 0; }
.pdf-foot form { margin: 0; }
.pdf-grow { flex: 1; }
@media (max-width: 560px) {
  .pdf-frame { height: 48vh; }
  .pdf-card .pdf-foot .pdf-grow { flex-basis: 100%; height: 0; }
}

/* Beam 217 @-mentions (SPEC Beam 212, mockup panels 1-5): the suggestion list under a comment box, the name chip in
   a posted comment, the "Flagged for AI" note and the share-and-tag dialog. Colours are theme tokens, so dark mode
   follows them; the two fixed fills (the AI row's mark, the not-shared avatar) carry white initials at AA. */
.cm-mention { display: inline; padding: 0 4px; border-radius: 5px; background: var(--info-bg); color: var(--info-text); font-weight: 600; }
.cm-mention-zone { margin: 6px 0 0; }
.cm-reply-box.cm-tags { flex-wrap: wrap; }
.cm-reply-box.cm-tags > textarea { flex: 1 1 0; min-width: 0; }
.cm-reply-box > .cm-mention-zone { flex-basis: 100%; margin: 0; }
.cm-mention-list { max-height: 260px; overflow-y: auto; padding: 4px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-lg); font-size: 13.5px; cursor: default; }
.cm-mention-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.cm-mention-grp { padding: 8px 12px 3px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cm-mention-opt { display: flex; align-items: center; gap: 10px; padding: 6px 12px; cursor: pointer; }
.cm-mention-opt[aria-selected="true"], .cm-mention-opt:hover { background: var(--subtle); }
.cm-mention-opt.off, .cm-mention-opt.off:hover { opacity: .55; cursor: default; background: transparent; }
.cm-mention-opt .g, .mention-person-row .g { flex: 1; min-width: 0; }
.cm-mention-opt .n, .mention-person-row .n { display: block; color: var(--heading); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-mention-opt .e, .mention-person-row .e { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-mention-opt.off .e { white-space: normal; }
.cm-mention-opt[aria-selected="true"] .e { color: var(--muted-subtle); }
.cm-av.cm-mention-ai { background: linear-gradient(135deg, #c2410c, #92400e); }
.cm-av.cm-mention-quiet { background: #64748b; }
.cm-mention-role { flex: none; font-size: 12px; color: var(--muted); }
.cm-mention-tag { flex: none; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.cm-mention-tag.guest { background: var(--warn-bg); color: var(--warn-text); }
.cm-mention-tag.share { background: var(--info-bg); color: var(--info-text); }
.cm-mention-flag { display: inline-flex; align-items: center; gap: 2px; margin: 6px 0 0; padding: 1px 2px 1px 9px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text); font-size: 12px; font-weight: 700; }
.cm-mention-flag button { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; }
.cm-mention-flag button:hover { background: var(--subtle); color: var(--heading); }
.cm-mention-flag button .icon { width: 12px; height: 12px; }
.cm-mention-zone > .cm-mention-list + .cm-mention-flag { margin-top: 8px; }
/* Phone: the list sits above the text box pinned over the keyboard, and fits in what the keyboard leaves. */
.comments-root.sheet-full .cm-entry > .cm-mention-zone, .comments-root.sheet-full .cm-reply-box > .cm-mention-zone { order: -1; flex-basis: 100%; margin: 0 0 4px; }
.comment-sheet .cm-mention-list { max-height: min(240px, calc(var(--vv-h, 100vh) * 0.35)); }
.comment-sheet .cm-mention-opt { min-height: 44px; }
.sheet-list #sheet-body .cm-mention-zone { display: none !important; }
/* The share-and-tag dialog (mockup 2a/2b): one row per person, the Share page's role button and menu. */
dialog.dialog.mention-dialog { max-width: 460px; overflow: visible; }
.mention-dialog .mention-ask { margin: 0 0 12px; }
.mention-person { padding: 6px 0; }
.mention-names { display: flex; gap: 8px; margin: 0 0 8px; }
.mention-names input { flex: 1; min-width: 0; }
.mention-person-row { display: flex; align-items: center; gap: 10px; }
.mention-role { flex: none; }
.mention-role > summary.pick { border: 1px solid var(--line); background: var(--subtle); padding: 0 6px 0 10px; font-weight: 600; }
.mention-role .menu-panel .mi { white-space: normal; }
.mention-role .menu-panel .mi > span { min-width: 0; }
.mention-refused { margin: 4px 0 0 36px; font-size: 13px; color: var(--error-text); }
.mention-error { margin: 8px 0 0; font-size: 13px; color: var(--error-text); }
.mention-dialog .cap { font-size: var(--fs-s); color: var(--muted); margin: 10px 0 0; }
@media (max-width: 640px) {
  dialog.dialog.mention-dialog .foot .btn { min-height: 44px; }
  .mention-role .menu-panel { right: 0; max-width: calc(100vw - 48px); }
}
/* --- Find Beams (Beam 213, flag `find`; ops/beam-207-find-beams/mockup.html) ------------------------------ */
.find-page .head, .find-page .storage-meter, .find-page .find-tabs, .find-page .find-bar, .find-page .find-results { max-width: 1072px; }
.find-tabs { display: flex; gap: 4px; margin: 4px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.find-tab {
  padding: 10px 14px; margin-bottom: -1px; border-bottom: 3px solid transparent; white-space: nowrap;
  font-weight: 600; color: var(--muted); text-decoration: none;
}
.find-tab:hover { color: var(--heading); text-decoration: none; }
.find-tab[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.find-tab .n { margin-left: 6px; font-weight: 500; color: var(--muted); }
/* Phone width: the three tabs share the row and never scroll sideways or get cut off; a long label wraps
   inside its own tab (Mike's prod use-check, 2026-11-24: "★ Starred" was cut off at 390px). */
@media (max-width: 640px) {
  .find-tabs { overflow-x: visible; gap: 0; }
  .find-tab { flex: 1 1 0; min-width: 0; padding: 10px 6px; white-space: normal; text-align: center; overflow-wrap: break-word; }
  .find-tab .n { margin-left: 4px; }
}
.find-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 6px; }
.find-bar .search { flex: 1 1 260px; max-width: 420px; }
.find-bar .search input { border-radius: 999px; }
.find-chips { display: contents; }
.find-chip > summary.chip-btn {
  display: inline-flex; align-items: center; gap: 4px; height: var(--h); padding: 0 8px 0 12px; white-space: nowrap;
  border: 1px solid var(--edge); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: var(--fs);
}
.find-chip > summary.chip-btn .icon { width: 14px; height: 14px; color: var(--muted); }
.find-chip > summary.chip-btn.on { background: var(--info-bg); border-color: var(--primary); color: var(--info-text); font-weight: 600; }
.find-chip > summary.chip-btn.on .icon { color: var(--info-text); }
.find-chip .menu-panel { min-width: 220px; }
.find-sort { margin-left: auto; }
.find-clear { padding: 6px; white-space: nowrap; }
.find-chip .seg { display: flex; margin: 4px 6px 6px; border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; }
.find-chip .seg a { flex: 1; padding: 5px 8px; text-align: center; color: var(--text); text-decoration: none; }
.find-chip .seg a.sel { background: var(--primary); color: var(--on-primary); }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; border: 0; background: var(--info-bg); color: var(--info-text); flex: none; }
.find-range { display: grid; gap: 6px; padding: 0 10px 8px; }
.find-range label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-s); font-weight: 400; color: var(--text); }
.find-range input[type="date"] { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 2px 6px; }
.find-summary { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 2px 10px; font-size: var(--fs-s); color: var(--muted); }
.find-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.find-back .icon { width: 16px; height: 16px; }
.find-summary a.find-tog { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; white-space: nowrap; }
.find-summary a.find-tog:hover { text-decoration: none; color: var(--heading); }
.find-tog .sw { position: relative; width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 3px; background: var(--surface); flex: none; }
.find-tog[aria-checked="true"] .sw { background: var(--primary); border-color: var(--primary); }
.find-tog[aria-checked="true"] .sw::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--on-primary); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.find-folders { position: relative; margin: 10px 0 18px; }
.find-folders > summary { display: inline-flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; font-weight: 600; color: var(--heading); }
.find-folders > summary::-webkit-details-marker { display: none; }
.find-folders > summary .icon { width: 14px; height: 14px; color: var(--muted); transform: rotate(-90deg); transition: transform 0.15s; }
.find-folders[open] > summary .icon { transform: none; }
.find-folders > summary .n { padding: 0 7px; border-radius: 999px; background: var(--subtle); font-size: 12px; font-weight: 500; color: var(--muted); }
.find-all { position: absolute; right: 0; top: 0; font-weight: 600; text-decoration: none; }
.fcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 8px; }
.fcard { display: flex; gap: 10px; align-items: center; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; }
.fcard:hover { box-shadow: var(--shadow-lg); text-decoration: none; }
.fcard .ft { min-width: 0; }
.fcard b { display: block; color: var(--heading); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ficon { position: relative; width: 30px; height: 24px; margin-top: 4px; border-radius: 4px; background: #93c5fd; flex: none; }
.ficon::before { content: ""; position: absolute; top: -4px; left: 0; width: 12px; height: 6px; border-radius: 3px 3px 0 0; background: #93c5fd; }
table.find-list { max-width: none; }
table.find-list th a { color: inherit; text-decoration: none; }
table.find-list th a:hover { color: var(--heading); text-decoration: underline; }
table.find-list th a.sorted { color: var(--heading); font-weight: 600; }
table.find-list td { padding-top: 8px; padding-bottom: 8px; }
table.find-list td.name .nm { display: flex; gap: 10px; align-items: center; min-width: 0; }
table.find-list td.name .nm-t { min-width: 0; overflow: hidden; }
table.find-list td.name a { display: inline; font-weight: 600; }
table.find-list td.name a bdi { display: block; overflow: hidden; text-overflow: ellipsis; }
table.find-list td.name .sub { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
table.find-list td.ver { font-variant-numeric: tabular-nums; }
.kind-tile { display: grid; place-items: center; width: 26px; height: 30px; border-radius: 4px; flex: none; font-size: 10px; font-weight: 700; color: #ffffff; }
.kind-tile.k-page { background: #3b86f2; }
.kind-tile.k-doc { background: #0f766e; }
.kind-tile.k-file { background: #64748b; }
.badge.wide { background: var(--success-bg); color: var(--success-text); }
.find-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; margin: 18px 0; font-size: var(--fs-s); color: var(--muted); }
.find-size { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
table.find-list th.st, table.find-list td.st { width: 30px; padding-left: 4px; padding-right: 0; }
.star-form { margin: 0; }
.star { border: 0; background: none; cursor: pointer; font-size: 17px; line-height: 1; padding: 2px 4px; color: var(--muted); }
.star:hover { color: var(--star, #d97706); }
.star.on { color: var(--star, #d97706); }
table.find-list td.name .nm-line { display: flex; align-items: center; min-width: 0; }
table.find-list td.name .nm-line > a { min-width: 0; overflow: hidden; }
.newdot { flex: none;  display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 700; vertical-align: 1px; }
.find-hiddenbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 10px; padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); font-size: var(--fs-s); }
.find-hiddenbar a { margin-left: auto; }
.find-undo-toast { display: flex; gap: 14px; align-items: center; }
.find-undo-toast button { border: 0; background: none; padding: 0; color: #93c5fd; font: inherit; font-weight: 600; cursor: pointer; }
.find-size label { display: inline-flex; gap: 6px; align-items: center; margin: 0; font-weight: 400; color: var(--muted); white-space: nowrap; }
.find-size select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--edge); border-radius: 6px; padding: 3px 6px; }
@media (max-width: 760px) {
  .find-bar .search { flex-basis: 100%; max-width: none; }
  .find-sort { margin-left: 0; }
  table.find-list td.name .sub { padding-left: 0; white-space: nowrap; }
  table.find-list td.name a bdi { -webkit-line-clamp: 2; }
  .find-all { font-size: var(--fs-s); }
}
/* Gallery (S4; ops/beam-222-gallery-previews/mockup.html): another layout of the same rows. */
.i-grid { --i: url("icons/grid.e3647d4ecad4.svg"); }
.glayout { display: inline-flex; align-items: center; gap: 12px; margin-left: 8px; }
.find-sort + .glayout, .find-chips .glayout { margin-left: 8px; }
.gview { display: inline-flex; border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; }
.gview a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; color: var(--text); text-decoration: none; font-weight: 500; }
.gview a + a { border-left: 1px solid var(--edge); }
.gview a .icon { width: 16px; height: 16px; }
.gview a.sel { background: var(--primary); color: var(--on-primary); }
.gview a:hover { text-decoration: none; }
.gsize { display: inline-flex; align-items: center; gap: 8px; }
.gsize input[type="range"] { width: 110px; accent-color: var(--primary); }
.gsz-s, .gsz-l { display: inline-block; border: 1.5px solid var(--muted); border-radius: 2px; }
.gsz-s { width: 9px; height: 7px; }
.gsz-l { width: 15px; height: 12px; }
.gsize.js .gsize-links { display: none; }
.gsize:not(.js) .gsz-s, .gsize:not(.js) .gsz-l { display: none; }
.gsize-links { display: inline-flex; gap: 8px; font-size: var(--fs-s); }
.gsize-links a[aria-current] { font-weight: 700; text-decoration: none; color: var(--heading); }
.ggrid { --card: 280px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--card), 100%), 1fr)); gap: 16px; margin: 4px 0 0; padding: 0; list-style: none; }
.gcard { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.gcard:has(details[open]), .gcard:focus-within { z-index: 3; }  /* an open ⋮ panel paints above the next row's star and ⋮ (blind #2701 r2) */
.gcard:hover, .gcard:focus-within { box-shadow: var(--shadow-lg); }
.gpic { position: relative; aspect-ratio: 16 / 10; background: var(--subtle); border-bottom: 1px solid var(--line); border-radius: 9px 9px 0 0; overflow: hidden; }  /* the card itself never clips: its ⋮ menu opens past it (blind #2701 r1) */
.gpic img, .gpic video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.gnone { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: var(--fs-s); }
.kind-tile.big { width: 54px; height: 54px; border-radius: 10px; font-size: 14px; }
.gmoves, .gupd { position: absolute; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(15, 23, 42, 0.72); color: #ffffff; font-size: 11px; font-weight: 600; pointer-events: none; }
.gmoves { right: 8px; }
.gupd { left: 8px; }
.gcard.playing .gmoves { opacity: 0; }
.gbadges { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; pointer-events: none; }
.gbadges .newdot { margin-left: 0; }
.gfoot { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px 12px; min-width: 0; }
.gfoot .kind-tile { width: 22px; height: 22px; font-size: 8px; margin-top: 1px; }
.gtext { min-width: 0; flex: 1; }
.glink { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--heading); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.glink::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.glink:hover { text-decoration: none; }
.glink:focus-visible { outline: none; }
.gcard:has(.glink:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.gmeta { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gmeta .warn { color: var(--warn-text); }
.gstar, .gact { position: absolute; z-index: 2; opacity: 0; transition: opacity 0.12s; }
.gstar { top: 6px; right: 46px; }
.gact { top: 4px; right: 6px; }
.gstar .star { background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-lg); padding: 4px 6px; }
.gact .icon-btn { background: var(--surface); box-shadow: var(--shadow-lg); }
.gcard:hover .gstar, .gcard:hover .gact, .gcard:focus-within .gstar, .gcard:focus-within .gact, .gstar:has(.star.on), .gact details[open] { opacity: 1; }
.gstar:has(.star.on) { opacity: 1; }
@media (hover: none) {
  /* Touch: ⋮ sits in the card's foot, always there; the star shows only when starred (Drive's phone grid). */
  .gact { opacity: 1; top: auto; bottom: 6px; right: 2px; }
  .gact .icon-btn { background: none; box-shadow: none; }
  .gact .menu-panel { top: auto; bottom: calc(100% + 4px); }  /* opens upward from the foot */
  .gact .menu-panel.down { top: calc(100% + 4px); bottom: auto; }  /* ...unless that would leave the page (gallery.js) */
  .gfoot { padding-right: 40px; }
  .gstar:not(:has(.star.on)) { display: none; }
}
img.lthumb { width: 48px; height: 30px; flex: none; border-radius: 4px; border: 1px solid var(--line); object-fit: cover; object-position: top center; background: var(--subtle); }
@media (max-width: 760px) {
  .glayout { margin-left: 0; }
  .gsize { display: none; }
  .ggrid { grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); gap: 10px; }
}
.ggrid[data-card="1"] { --card: 160px; }
.ggrid[data-card="2"] { --card: 220px; }
.ggrid[data-card="3"] { --card: 280px; }
.ggrid[data-card="4"] { --card: 360px; }
.ggrid[data-card="5"] { --card: 480px; }
.folder-bar { display: flex; justify-content: flex-end; margin: 0 0 12px; }
table.list td.name a img.lthumb { margin-right: 10px; vertical-align: middle; }

/* Build with AI (Phase 2, Beam 279; mockup ops/beam-275-ai-panel-mockup, approved 2026-11-29). The right-hand slot it
   shares with Comments (opening one closes the other), below the save bar (--save-bar-h), same z-order as comments. */
.i-ai { --i: url("icons/ai.99be857bd0ad.svg"); }
.i-send { --i: url("icons/send.d2395bcbe8d8.svg"); }
.i-stop { --i: url("icons/stop.6a63fe43149a.svg"); }
.i-clip { --i: url("icons/clip.74bf1474495f.svg"); }
.i-ok { --i: url("icons/check.8d0a315af360.svg"); }
.i-warn { --i: url("icons/warn.4de9e03b2b61.svg"); }
.i-sheet { --i: url("icons/sheet.385c57936b0a.svg"); }
:root { --ai-w: 420px; }
.ai-toggle[aria-pressed="true"] { background: var(--info-bg); color: var(--info-text); }
.ai-root { position: fixed; top: calc(var(--header-h) + var(--save-bar-h, 0px)); right: 0; bottom: 0; width: var(--ai-w); z-index: 16; display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--line); }
.ai-root[hidden] { display: none; }
.ai-root [hidden] { display: none !important; }
body.ai-open .beam-stage { margin-right: var(--ai-w); }
body.ai-open .toast { right: calc(var(--ai-w) + 16px); }
.stage-note { position: fixed; top: calc(var(--header-h) + var(--save-bar-h, 0px) + 12px); left: calc((100vw - var(--ai-w)) / 2); transform: translateX(-50%); z-index: 15; display: flex; align-items: center; gap: 8px; background: var(--heading); color: var(--surface); font-size: 13px; padding: 7px 14px; border-radius: 99px; box-shadow: var(--shadow-lg); white-space: nowrap; pointer-events: none; }
.stage-note .dotpulse { background: var(--signal, var(--brand)); }
.ai-head { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.ai-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--heading); display: flex; align-items: center; gap: 8px; }
.ai-head h2 .icon { color: var(--primary); }
.ai-head .sp, .composer .bar .sp { flex: 1; }
.ai-root .ibtn { width: 32px; height: 32px; padding: 0; border: 0; background: none; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.ai-root .ibtn:hover { background: var(--subtle); color: var(--heading); }
.ai-status { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
/* Beam 310 U5: the Pulse line under the panel header (mockup 05/01) */
.ai-pulse { flex: none; display: flex; align-items: center; gap: 8px; padding: 7px 18px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.ai-pulse .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.ai-pulse.live .dot { background: var(--success-text); }
.ai-pulse.reconnect .dot { background: var(--warn-text); }
.ai-pulse .w { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-pulse .w b { color: var(--text); font-weight: 600; }
.ai-pulse a, .ai-pulse button { flex: none; color: var(--link-subtle, var(--link)); text-decoration: none; border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
.ai-root .card ol { margin: 0 0 10px; padding-left: 18px; }
.ai-meter { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 18px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--subtle); }
.ai-meter b { color: var(--text); font-weight: 600; }
.ai-meter span { flex: 1; min-width: 0; line-height: 1.45; }
.ai-meter a { color: var(--link-subtle, var(--link)); flex: none; text-decoration: none; }
.ai-meter.warn { background: var(--warn-bg); color: var(--warn-text); }
.ai-meter.warn b { color: var(--warn-text); }
.ai-meter .m-short { display: none; }
.ai-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 18px 8px; display: flex; flex-direction: column; gap: 14px; }
#ai-log { display: flex; flex-direction: column; gap: 14px; }
.msg-me { align-self: flex-end; max-width: 86%; background: var(--subtle); color: var(--heading); padding: 10px 14px; border-radius: 16px 16px 4px 16px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-me .files, .composer .files { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; white-space: normal; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12px; color: var(--text); max-width: 100%; }
.file-chip > span:not(.icon) { min-width: 0; overflow-wrap: anywhere; }
.file-chip .icon { color: var(--success-text); width: 18px; height: 18px; flex: none; }
.file-chip small { display: block; color: var(--muted); font-size: 11px; }
.file-chip .ok { color: var(--success-text); font-weight: 600; }
.file-x { border: 0; background: none; width: 20px; height: 20px; padding: 0; display: grid; place-items: center; margin-left: 2px; flex: none; }
.file-x .icon { width: 12px; height: 12px; color: var(--muted); }
.msg-ai { font-size: 14px; line-height: 1.6; color: var(--text); }
.msg-ai p { margin: 0 0 8px; }
.msg-ai .ai-words { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Beam 304: the AI's reply in words (mockup ops/beam-302-ai-feedback-mockup shots 09/12) + "Try next" suggestions */
.ai-reply { margin: 0 0 10px; overflow-wrap: anywhere; }
.ai-reply .reply-h { margin: 10px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ai-reply ul { margin: 0 0 4px; padding-left: 18px; }
.ai-reply li { margin: 0 0 4px; }
.ai-reply .try-next { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.ai-reply .try-next .reply-h { margin: 0 0 2px; }
.ai-reply .tip { display: flex; align-items: flex-start; justify-content: flex-start; gap: 10px; width: 100%; height: auto; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--subtle); color: var(--heading); font: inherit; font-size: 13px; font-weight: 400; line-height: 1.45; text-align: left; cursor: pointer;
  white-space: normal; overflow-wrap: anywhere; min-width: 0; max-width: 100%; } /* Beam 347: wrap, never run past the panel (T's buttons are nowrap) */
.ai-reply .tip:hover { border-color: var(--edge, var(--line)); background: var(--bg); }
.ai-reply .tip:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ai-reply .tip .arr { color: var(--primary); flex: none; }
.ai-reply .tip:disabled { opacity: .55; cursor: default; }
.ai-reply .try-next small { color: var(--muted); font-size: 12px; }
.ai-root .who { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--heading); margin-bottom: 6px; }
.ai-root .who .badge { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--info-bg); }
.ai-root .who .badge .icon { width: 13px; height: 13px; color: var(--primary); }
.ai-root .who .t { color: var(--muted); font-weight: 400; }
.steps { border: 1px solid var(--line); border-radius: 10px; margin: 4px 0 10px; overflow: hidden; }
.steps-head { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 12px; border: 0; border-radius: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--heading); background: var(--subtle); text-align: left; cursor: pointer; }
.steps-head .t { margin-left: auto; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.step { display: flex; gap: 10px; padding: 7px 12px; font-size: 13px; border-top: 1px solid var(--line); align-items: flex-start; }
.step .icon { margin-top: 3px; width: 14px; height: 14px; flex: none; }
.step.done .icon { color: var(--success-text); }
.step.now { color: var(--heading); font-weight: 500; }
.step small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.ai-root .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary); flex: none; margin-top: 3px; animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.dotpulse { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--ring); flex: none; }
.dot-ok { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-green, var(--success-text)); flex: none; }
.ai-root .caret { display: inline-block; width: 7px; height: 15px; background: var(--heading); vertical-align: -2px; margin-left: 2px; animation: ai-blink 1s steps(1) infinite; }
@keyframes ai-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ai-root .spin, .ai-root .caret { animation: none; } }
.ai-root .card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; background: var(--bg); }
.ai-root .card h3 { margin: 0 0 4px; font-size: 14px; color: var(--heading); display: flex; align-items: center; gap: 8px; }
.ai-root .card h3 .icon { flex: none; }
.ai-root .card p { margin: 0 0 10px; color: var(--text); line-height: 1.5; }
.ai-root .card .row { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-root .card.saved h3 .icon { color: var(--success-text); }
.ai-root .card.warn { background: var(--warn-bg); border-color: var(--warn-line, #fcd34d); }
.ai-root .card.warn h3, .ai-root .card.warn h3 .icon { color: var(--warn-text); }
.ai-root .card.info { background: var(--info-bg); border-color: var(--info-line, #bfdbfe); }
/* Beam 340: web searches (mockup 03/04). The exact text is shown as it will be sent. */
.step .web-q { display: block; margin: 4px 0 0; padding: 3px 8px; background: var(--subtle); border-radius: 6px; font: 12px/1.5 var(--mono, ui-monospace, monospace); color: var(--heading); white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-root .card.web-ask .web-text { margin: 0 0 10px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font: 13px/1.5 var(--mono, ui-monospace, monospace); color: var(--heading); white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-root .card.web-ask h3 .icon { color: var(--primary); }
.ai-root .web-alpha { background: var(--warn-bg); color: var(--warn-text); outline: 1px solid currentColor; border-radius: 3px; padding: 0 2px; }
.ai-root .card.web-ask .web-alpha-note { margin: -4px 0 10px; font-size: 12px; color: var(--warn-text); }
.ai-root .step small.web-alpha-note { color: var(--warn-text); }
.ai-root .card.err { background: var(--error-bg); border-color: var(--error-line, #fecaca); }
.ai-root .card.err h3, .ai-root .card.err h3 .icon { color: var(--error-text); }
.ai-root .card ul { margin: 0 0 10px; padding-left: 18px; }
.ai-root .card small { display: block; color: var(--muted); font-size: 12px; margin-top: 8px; }
.ai-root .cost { font-size: 12px; color: var(--muted); }
.ai-root .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-root .chip { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 99px; padding: 6px 12px; height: auto; font: inherit; font-size: 13px; font-weight: 400; white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.ai-root .chip:hover { background: var(--subtle); }
.ai-root .empty { margin: auto 0; padding: 8px 2px; border: 0; background: none; text-align: left; }
.ai-root .empty h3 { color: var(--heading); font-size: 18px; margin: 0 0 6px; }
.ai-root .empty p { color: var(--muted); font-size: 14px; margin: 0 0 16px; line-height: 1.5; }
.ai-foot { flex: none; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.composer { border: 1px solid var(--edge, var(--line)); border-radius: 14px; background: var(--bg); padding: 8px 8px 8px 12px; box-shadow: var(--shadow-sm); }
.composer:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--ring); }
.composer.off { background: var(--subtle); border-color: var(--line); }
.composer textarea.txt { display: block; width: 100%; min-height: 44px; max-height: 40vh; resize: none; border: 0; padding: 2px 0 6px; background: transparent; font: inherit; font-size: 14px; color: var(--heading); line-height: 1.5; box-shadow: none; outline: none; }
.composer textarea.txt:focus { border: 0; box-shadow: none; }
.composer .bar { display: flex; align-items: center; gap: 6px; }
.composer .att { width: 32px; height: 32px; padding: 0; border-radius: 8px; border: 0; background: none; display: grid; place-items: center; }
.composer .att .icon { color: var(--muted); width: 18px; height: 18px; }
.composer .go { width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 0; background: var(--primary); display: grid; place-items: center; }
.composer .go .icon { color: var(--on-primary, #fff); }
.composer .go.dim, .composer .go:disabled { background: var(--line); }
.composer .stop { height: 32px; border-radius: 99px; border: 1px solid var(--edge, var(--line)); background: var(--bg); color: var(--heading); display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; font: inherit; font-size: 13px; font-weight: 600; }
.composer .stop .icon { color: var(--heading); width: 12px; height: 12px; }
.foot-note { font-size: 11.5px; color: var(--muted); margin: 7px 2px 0; }
.drop-over { position: absolute; inset: 0; z-index: 10; background: color-mix(in srgb, var(--info-bg) 92%, transparent); display: grid; place-items: center; padding: 16px; }
.drop-box { width: 100%; height: 100%; box-sizing: border-box; border: 2px dashed var(--brand); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; color: var(--info-text); pointer-events: none; }
.drop-box .icon { width: 32px; height: 32px; color: var(--primary); }
.drop-box b { font-size: 18px; color: var(--heading); }
.drop-box span:not(.icon) { font-size: 13px; color: var(--text); }
.drop-box small { font-size: 12px; color: var(--muted); }
.ai-seg { display: none; }
.peek-bar { display: none; }
.ai-toast { position: fixed; z-index: 32; right: 16px; top: calc(var(--header-h) + var(--save-bar-h, 0px) + 12px); margin: 0; padding: 10px 14px; border-radius: var(--radius); background: var(--heading); color: var(--surface); font-size: 13px; box-shadow: var(--shadow-xl); }
body.ai-open .ai-toast { right: calc(var(--ai-w) + 16px); }
/* Phone (Mike's Q9): the panel takes the screen under the Beam bar; Chat | Page switches to the page. */
@media (max-width: 640px) {
  .ai-root { width: 100%; border-left: 0; }
  body.ai-open .beam-stage { margin-right: 0; visibility: hidden; }
  body.ai-open.ai-peek .beam-stage { visibility: visible; }
  body.ai-open.ai-peek .ai-root { display: none; }
  .ai-seg { display: flex; align-items: center; gap: 4px; margin: 8px 12px 0; background: var(--subtle); border-radius: 10px; padding: 3px; flex: none; }
  .ai-seg [role=tab] { flex: 1; height: 34px; border: 0; background: none; font: inherit; font-size: 14px; border-radius: 8px; color: var(--muted); }
  .ai-seg [role=tab].on { background: var(--bg); color: var(--heading); font-weight: 600; box-shadow: var(--shadow-sm); }
  .seg-x { flex: none; width: 36px; height: 36px; padding: 0; border: 0; background: none; display: grid; place-items: center; }
  .seg-x .icon { color: var(--muted); }
  .ai-head { display: none; }
  .ai-meter .m-long { display: none; }
  .ai-meter .m-short { display: inline; }
  .ai-toggle .ai-label { display: none; }
  .ai-body { padding: 14px 14px 8px; }
  .composer textarea.txt { font-size: 16px; }
  .stage-note { top: auto; bottom: 16px; left: 50%; }
  body.ai-open.ai-peek .peek-bar:not([hidden]) { position: fixed; left: 12px; right: 12px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 17; display: flex; align-items: center; gap: 10px; background: var(--heading); color: var(--surface); padding: 10px 14px; border-radius: 14px; font-size: 14px; box-shadow: var(--shadow-xl); }
  .peek-bar button { margin-left: auto; height: auto; padding: 0; border: 0; background: none; color: #93c5fd; font: inherit; font-weight: 600; }
  body.ai-open .toast, body.ai-open .ai-toast { right: 16px; }
  .drop-over { display: none !important; }
}
/* Account -> AI usage (Beam 280; mockup screen 14, ops/beam-275-ai-panel-mockup/usage.html). */
.ai-usage { max-width: 880px; margin: 0 auto; }
.aiu-big { border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.aiu-n { margin: 0; font-size: 34px; font-weight: 700; color: var(--heading); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.aiu-n small { font-size: 16px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
svg.aiu-meter { display: block; width: 100%; height: 10px; border-radius: 99px; overflow: hidden; margin: 12px 0 8px; }
svg.aiu-meter .track { fill: var(--subtle); }
svg.aiu-meter .fill { fill: var(--brand); }
svg.aiu-meter.warn .fill { fill: var(--warn-text); }
svg.aiu-meter.exhausted .fill { fill: var(--danger); }
svg.aiu-meter .tick { fill: var(--warn-text); opacity: 0.6; }
.aiu-cap { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.aiu-facts { display: grid; gap: 10px; margin: 0; font-size: 14px; align-content: center; }
.aiu-facts div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.aiu-facts div:last-child { border: 0; padding-bottom: 0; }
.aiu-facts dt { color: var(--muted); }
.aiu-facts dd { margin: 0; color: var(--heading); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.aiu-h { font-size: 16px; color: var(--heading); margin: 32px 0 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.aiu-h small { font-size: 13px; color: var(--muted); font-weight: 400; }
table.aiu-runs { width: 100%; border-collapse: collapse; font-size: 14px; }
table.aiu-runs th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.aiu-runs td { padding: 10px; border-bottom: 1px solid var(--line); color: var(--text); vertical-align: top; overflow-wrap: anywhere; }
table.aiu-runs .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.aiu-runs a { color: var(--link); text-decoration: none; }
table.aiu-runs a:hover { text-decoration: underline; }
table.aiu-runs .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
table.aiu-runs .gone { color: var(--muted); }
table.aiu-runs tr.aiu-more td { color: var(--muted); font-size: 13px; }
.aiu-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--subtle); color: var(--muted-subtle); margin-left: 6px; }
.aiu-tag.stop, .aiu-tag.fail { background: var(--warn-bg); color: var(--warn-text); }
.aiu-tag.slack { color: var(--edit-moved); }
svg.aiu-chart { display: block; width: 100%; height: 120px; border-bottom: 1px solid var(--line); }
svg.aiu-chart .bar { fill: var(--brand); opacity: 0.6; }
svg.aiu-chart .cur { fill: var(--brand); }
svg.aiu-chart .z { fill: var(--line); }
.aiu-labels { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; }
.aiu-note { color: var(--muted); font-size: 14px; }
.aiu-fine { font-size: 13px; color: var(--muted); margin-top: 26px; line-height: 1.6; border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 640px) {
  .aiu-big { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .aiu-n small { display: block; margin-top: 2px; }
  table.aiu-runs .wide { display: none; }
  table.aiu-runs td, table.aiu-runs th { padding: 9px 6px; }
  .aiu-labels li { visibility: hidden; }
  .aiu-labels li:nth-child(3n) { visibility: visible; }  /* every third, ending on the current period */
  .aiu-labels li:last-child { display: flex; justify-content: flex-end; }  /* overflows to the left, stays visible */
}
.aiu-cap + .aiu-cap { margin-top: 6px; }
.aiu-cap.aiu-alert { color: var(--warn-text); }
svg.aiu-meter.low .fill, svg.aiu-meter.held .fill, svg.aiu-meter.full .fill { fill: var(--warn-text); }

/* Build with AI, mockup 10: the Share page's provenance box (shown only when ai_provenance.share_box finds a source). */
.ai-share-box { border: 1px solid var(--warn-line, #fcd34d); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; background: var(--warn-bg); font-size: 13px; }
.ai-share-box h3 { margin: 0 0 4px; font-size: 14px; color: var(--warn-text); display: flex; align-items: center; gap: 8px; }
.ai-share-box h3 .icon { flex: none; }
.ai-share-box p { margin: 0 0 10px; color: var(--text); line-height: 1.5; }
.ai-share-box ul { list-style: none; margin: 0 0 10px; padding: 0; }
.ai-share-box li { display: flex; align-items: center; gap: 8px; padding: 4px 0; min-width: 0; }
.ai-share-box li .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ai-share-box .row { display: flex; flex-wrap: wrap; gap: 8px; }
.grants .sub.ai-missing { color: var(--warn-text); }
.grants .sub.pulse-blocked { color: var(--error-text); }

/* Build with AI, mockup 13b: New -> Describe it. */
.ai-describe { max-width: 720px; margin: 9vh auto 40px; padding: 0 16px; }
.ai-describe h1 { font-size: 30px; color: var(--heading); margin: 0 0 8px; display: flex; align-items: center; gap: 12px; }
.ai-describe h1 .icon { width: 26px; height: 26px; color: var(--primary); }
.ai-describe > .lede { color: var(--muted); margin: 0 0 22px; font-size: 15px; }
.ai-describe .composer { border: 1px solid var(--line); border-radius: 18px; padding: 12px 12px 10px 16px; background: var(--bg); }
.ai-describe .composer.focus:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--ring); }
.ai-describe .composer .txt { display: block; width: 100%; min-height: 96px; border: 0; outline: 0; resize: vertical; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.ai-describe .composer .bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ai-describe .composer .bar .sp { flex: 1; }
.ai-describe .composer .att { border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; }
.ai-describe .composer .files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ai-describe .where { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 12px 4px 0; font-size: 13px; color: var(--muted); }
.ai-describe .where b { color: var(--heading); font-weight: 500; }
.ai-describe .where .cost.warn { color: var(--warn-text); }
.ai-describe h2 { font-size: 13px; color: var(--muted-subtle, var(--muted)); font-weight: 600; margin: 30px 0 10px; }
.ai-describe .starts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ai-describe .start { text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 13px; color: var(--text); background: var(--bg); cursor: pointer; }
.ai-describe .start:hover { border-color: var(--focus); }
.ai-describe .start b { display: block; color: var(--heading); font-size: 14px; margin-bottom: 3px; }
@media (max-width: 640px) {
  .ai-describe { margin-top: 24px; }
  .ai-describe h1 { font-size: 24px; }
  .ai-describe .where { flex-direction: column; align-items: flex-start; gap: 6px; }
  .ai-describe .where .sep { display: none; }
  .ai-describe .starts { grid-template-columns: 1fr; }
  .ai-describe .composer .txt { min-height: 120px; }
}
.new-menu .mi.ai-first .icon { color: var(--primary); }

/* --- Beam 316: Build with AI building screen (ai-board.js; mockup ops/beam-302-ai-feedback-mockup shots 01/05/07/08/10/11) --- */
.ai-board { position: fixed; top: calc(var(--header-h) + var(--save-bar-h, 0px)); left: 0; right: 0; bottom: 0; z-index: 14; display: flex; flex-direction: column; gap: 18px; padding: 30px 44px 24px; overflow: auto; color: var(--text);
  background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 60%), var(--bg); }
body.ai-open .ai-board { right: var(--ai-w); }
.ai-board[hidden], .ai-done[hidden] { display: none; }
.ai-board.over-page { background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(6px) saturate(.8); backdrop-filter: blur(6px) saturate(.8); }
@media (max-width: 640px) { .ai-board.over-page { background: color-mix(in srgb, var(--bg) 96%, transparent); } } /* phone: the page bled through at 86% */
.ai-board.peeking { top: calc(var(--header-h) + var(--save-bar-h, 0px) + 12px); left: 16px; bottom: auto; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; overflow: visible; }
body.ai-open .ai-board.peeking { right: calc(var(--ai-w) + 16px); }
.ai-board .bd-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ai-board .sp { flex: 1; }
.ai-board .bd-track { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.ai-board .bd-track .ph { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); }
.ai-board .bd-track .ph.done { color: var(--success-text); border-color: transparent; background: var(--success-bg); }
.ai-board .bd-track .ph.skipped { opacity: .5; border-style: dashed; }
.ai-board .bd-track .ph.now { color: var(--heading); border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); font-weight: 600; }
.ai-board .bd-track .ph .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.ai-board .bd-track .ph.now .dot { background: var(--primary); opacity: 1; }
.ai-board .bd-track .sep { width: 14px; height: 1px; background: var(--line); }
.ai-board .bd-clock { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted-subtle); }
.ai-board .bd-btn { border: 1px solid var(--edge); background: transparent; color: var(--heading); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.ai-board .bd-btn:hover { background: var(--subtle); }
.ai-board .bd-line h2 { margin: 0; font-size: 26px; line-height: 1.25; color: var(--heading); font-weight: 600; letter-spacing: -.01em; max-width: 760px; }
.ai-board .bd-line .truth { margin: 8px 0 0; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.ai-board .bd-line .truth .live { width: 7px; height: 7px; border-radius: 50%; background: var(--signal, var(--brand-green)); flex: none; }
.ai-board .bd-line .truth.slow .live { background: var(--warn-text); }
.ai-board .bd-cold { max-width: 520px; }
.ai-board .bd-cold .rail { height: 6px; border-radius: 99px; background: var(--subtle); overflow: hidden; position: relative; }
.ai-board .bd-cold .rail i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--primary); transition: width .9s linear; }
.ai-board .bd-cold .rail .zone { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--primary) 22%, transparent); }
.ai-board .bd-cold .lbl { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.ai-board .bd-slow { border: 1px solid color-mix(in srgb, var(--warn-text) 40%, transparent); background: var(--warn-bg); color: var(--warn-text); border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.5; max-width: 620px; }
.ai-board .bd-slow b { color: var(--heading); }
.ai-board .bd-grid { display: grid; grid-template-columns: 280px 1fr; gap: 22px; min-height: 0; }
.ai-board .bd-grid.no-files { display: none; }
.ai-board h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; gap: 8px; align-items: center; }
.ai-board h3 .n { color: var(--muted-subtle); text-transform: none; letter-spacing: 0; font-weight: 400; }
.ai-board .fcard { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 13px; margin-bottom: 10px; font-size: 13px; }
.ai-board .fcard .top { display: flex; gap: 10px; align-items: center; color: var(--heading); font-weight: 600; min-width: 0; }
.ai-board .fcard .top .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-board .fcard .top .icon { width: 18px; height: 18px; color: var(--success-text); flex: none; }
.ai-board .fcard .facts { margin: 7px 0 0 28px; color: var(--muted-subtle); }
.ai-board .fcard.wait { opacity: .55; }
.ai-board .fcard.reading { border-color: var(--primary); }
.ai-board .fcard.failed .facts { color: var(--warn-text); }
.ai-board .fcard.read .facts { color: var(--success-text); }
.ai-board .bd-narr { border-top: 1px solid var(--line); padding-top: 14px; margin-top: auto; }
.ai-board .bd-narr .row { display: flex; gap: 10px; font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0 0 6px; overflow-wrap: anywhere; white-space: pre-wrap; }
.ai-board .bd-narr .row.new { color: var(--heading); }
.ai-board .bd-narr .row .t { flex: none; width: 34px; font-size: 11.5px; color: var(--muted); padding-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-board .bd-narr .row.old1 { opacity: .6; } .ai-board .bd-narr .row.old2 { opacity: .4; }
.ai-board .bd-strip { display: flex; align-items: center; gap: 12px; padding: 9px 12px 9px 16px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 94%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 13px; color: var(--text); flex-wrap: wrap; }
.ai-board .bd-strip .tag { background: var(--subtle); color: var(--heading); border-radius: 99px; padding: 2px 9px; font-weight: 600; font-size: 12px; }
.ai-board .bd-strip .mini { color: var(--heading); }
.ai-board .bd-strip .mini small { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.ai-board .bd-strip .note { color: var(--muted); }
body.ai-building .stage-note { display: none; }
.ai-done { position: fixed; left: 20px; bottom: 20px; z-index: 14; width: 380px; max-width: calc(100vw - 40px); border-radius: 14px; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow-xl); padding: 14px 16px; font-size: 13px; color: var(--text); }
/* Beam 347: with the panel open on a narrow desktop the card stays left of it, never under it (phone keeps 100vw - 40px). */
@media (min-width: 641px) { body.ai-open .ai-done { max-width: calc(100vw - var(--ai-w) - 40px); } }
.ai-done h4 { margin: 0 0 6px; font-size: 14px; color: var(--heading); display: flex; align-items: center; gap: 8px; }
.ai-done h4 .icon { color: var(--success-text); width: 16px; height: 16px; flex: none; }
.ai-done h4 .x { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; display: inline-flex; }
.ai-done .lead { margin: 0 0 8px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.ai-done .lead.muted { color: var(--muted); }
.ai-done .lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 6px; }
.ai-done .sugg { display: flex; flex-direction: column; gap: 6px; }
.ai-done .sugg button { justify-content: flex-start; text-align: left; border: 1px solid var(--line); background: var(--subtle); color: var(--heading); border-radius: 10px; padding: 7px 10px; font: inherit; font-size: 13px; display: flex; gap: 8px; align-items: baseline; cursor: pointer;
  height: auto; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; min-width: 0; max-width: 100%; } /* Beam 347: wrap inside the card */
.ai-done .sugg button:disabled { opacity: .5; cursor: default; }
.ai-done .sugg .arr { color: var(--link); flex: none; }
.ai-done .nextnote { display: block; font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }
.ai-done .row2 { display: flex; gap: 8px; margin-top: 10px; }
.ai-done .row2 a { color: var(--link); text-decoration: none; font-size: 13px; }
body.ai-building .ai-root .ai-words.live { display: none; } /* desktop: the board shows the words; the panel keeps the steps */
.ai-root .watch { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.ai-root .watch-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin: 0 0 8px; font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.msg-me.clamp { position: relative; max-height: calc(1.5em * 7 + 20px); overflow: hidden; }
.msg-me.clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: linear-gradient(transparent, var(--subtle)); }
.ai-root .more { align-self: flex-end; border: 0; background: none; font: inherit; font-size: 12px; color: var(--link); margin-top: -6px; cursor: pointer; padding: 2px 4px; }
@media (max-width: 640px) {
  .ai-board, body.ai-open .ai-board { right: 0; padding: 18px 16px calc(84px + env(safe-area-inset-bottom, 0px)); gap: 14px; }
  body.ai-open:not(.ai-peek) .ai-board, body.ai-open:not(.ai-peek) .ai-done { display: none; }
  body.ai-building .ai-root .ai-words.live { display: block; } /* phone Chat keeps the words: the board is under Page */
  .ai-board.peeking, body.ai-open .ai-board.peeking { left: 8px; right: 8px; top: calc(var(--header-h) + 8px); padding: 0; }
  .ai-board .bd-line h2 { font-size: 20px; }
  .ai-board .bd-track .sep { display: none; }
  .ai-board .bd-track .ph:not(.now) { padding: 4px 7px; }
  .ai-board .bd-track .ph:not(.now) .lab { display: none; }
  .ai-board .bd-grid { grid-template-columns: 1fr; }
  .ai-board .bd-narr .row { font-size: 13.5px; }
  .ai-done { left: 12px; right: 12px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* Beam 310 U4 (SPEC §4.5, mockup shot 08): the "Pulse data" credit line, Beam's own chrome under the page. */
.pulse-credit { flex: 0 0 auto; position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 14px;
  font-size: 12px; line-height: 1.4; background: var(--surface); border-top: 1px solid var(--line); color: var(--text); }
.pulse-credit .pulse-tag { font-weight: 600; color: var(--link); white-space: nowrap; }
.pulse-credit .pulse-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse-credit .pulse-who { margin-left: auto; white-space: nowrap; color: var(--muted); }
.pulse-credit .pulse-sources summary { cursor: pointer; white-space: nowrap; color: var(--heading); }
.pulse-credit .pulse-sources ul { position: absolute; right: 14px; bottom: 100%; margin: 0 0 6px; padding: 10px 14px 10px 28px;
  max-width: min(520px, calc(100vw - 28px)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-md); }
body.comments-open .pulse-credit { margin-right: var(--rail-w); }
@media (max-width: 640px) {
  .pulse-credit { flex-wrap: wrap; row-gap: 2px; }
  .pulse-credit .pulse-what { flex: 1 1 100%; order: 2; white-space: normal; }
  .pulse-credit .pulse-who { margin-left: 0; }
  body.comments-open .pulse-credit { margin-right: 0; }
}
