/* Alphanumeric Hub — visual system
   Brand: Alphanumeric purple #462C6B → crimson #CA1E47 (alphanumeric.com logomark gradient).
   Frame & card language follows the Prospecting tool (dark gradient frame, gradient icon
   tiles, soft shadowed cards). Headings: Jost (open-licence geometric sans in the spirit of
   the site's Futura). All text/background pairs below meet WCAG AA for their sizes. */

@font-face {
  font-family: "Jost";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/jost-latin.woff2") format("woff2");
}

:root {
  /* Brand */
  --brand-purple: #462C6B;
  --brand-crimson: #CA1E47;
  --brand-grad: linear-gradient(120deg, #462C6B 0%, #8A2459 55%, #CA1E47 100%);
  --brand-grad-soft: linear-gradient(120deg, rgba(70, 44, 107, .10), rgba(202, 30, 71, .08));

  /* Frame (sidebar + top bar) */
  --frame-1: #120C24;
  --frame-2: #1C1236;
  --frame-3: #26174A;
  --frame-line: rgba(255, 255, 255, .08);
  --frame-text: #D9D3EA;
  --frame-muted: #9C92B8;
  --frame-hover: rgba(255, 255, 255, .06);

  /* Surfaces & text */
  --canvas: #F5F4FA;
  --surface: #FFFFFF;
  --surface-2: #FAF9FD;
  --text: #1B1530;
  --text-2: #5A5372;
  --text-3: #8A84A0;
  --border: #E6E2F0;
  --border-strong: #CFC8E0;

  /* Interactive */
  --primary: #5B2E86;           /* AA on white */
  --primary-hover: #47216B;
  --link: #6A2C8F;
  --focus: #CA1E47;
  --blue-soft: #F1ECFA;

  /* Status (text + colour, never colour alone) */
  --success: #087A55;  --success-bg: #E4F5EE;
  --warning: #8F5A06;  --warning-bg: #FDF1DC;
  --danger:  #B4183C;  --danger-bg:  #FCE7EC;
  --info-bg: #F0EEF7;

  /* Tile accents (as in the Prospecting tool, tuned toward the brand) */
  --t-purple: linear-gradient(145deg, #7B4FC4, #4E2C82);
  --t-crimson: linear-gradient(145deg, #F0506F, #C41E4A);
  --t-amber: linear-gradient(145deg, #FFB057, #F08A1C);
  --t-teal: linear-gradient(145deg, #3CCBA8, #149B7A);
  --t-blue: linear-gradient(145deg, #5C86FF, #3361E3);

  --shadow-xs: 0 1px 2px rgba(30, 18, 60, .05);
  --shadow-sm: 0 4px 14px rgba(30, 18, 60, .07);
  --shadow-md: 0 14px 34px rgba(30, 18, 60, .12);
  --shadow-pop: 0 24px 60px rgba(18, 10, 40, .25);

  --radius: 12px; --radius-lg: 16px; --radius-sm: 8px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --sidebar-w: 268px; --sidebar-compact: 76px; --topbar-h: 64px;
  --font: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Jost", "Futura", "Century Gothic", var(--font);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 14.5px/1.5 var(--font); color: var(--text); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 18% 0%, rgba(124, 79, 196, .07), transparent 32rem),
    radial-gradient(circle at 100% 30%, rgba(202, 30, 71, .045), transparent 28rem),
    var(--canvas);
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-crimson); }
h1, h2, h3, h4 { margin: 0 0 var(--s2); line-height: 1.2; font-weight: 600; font-family: var(--display); letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 600; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 var(--s3); }
small, .small { font-size: 13px; }
.muted { color: var(--text-2); }
.mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; 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: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
[hidden] { display: none !important; }
svg.ico, svg.chev { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
svg.chev { width: 14px; height: 14px; }
::selection { background: #EADCF7; }

/* ================= Frame: sidebar ================= */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.shell.compact { grid-template-columns: var(--sidebar-compact) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30; display: flex; flex-direction: column; color: var(--frame-text);
  background:
    radial-gradient(circle at 0% 0%, rgba(202, 30, 71, .22), transparent 16rem),
    radial-gradient(circle at 100% 100%, rgba(124, 79, 196, .25), transparent 18rem),
    linear-gradient(180deg, var(--frame-1) 0%, var(--frame-2) 60%, var(--frame-3) 100%);
  border-right: 1px solid var(--frame-line);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 14px; text-decoration: none; color: #fff; }
.brand .wordmark { height: 30px; width: auto; display: block; }
.brand .mark { display: none; width: 34px; height: 34px; }
.brand-name { display: flex; align-items: center; gap: 10px; padding: 0 20px 16px; }
.brand-name::before { content: ""; width: 3px; height: 26px; border-radius: 3px; background: var(--brand-grad); }
.brand-name strong { display: block; color: #fff; font-family: var(--display); font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.brand-name span { display: block; color: var(--frame-muted); font-size: 11.5px; }
.ws-switch { margin: 0 14px 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--frame-line); }
.ws-switch label { display: block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--frame-muted); margin-bottom: 4px; }
.ws-switch select {
  width: 100%; background: transparent; color: #fff; border: 0; padding: 2px 22px 2px 0; font: inherit; font-size: 14px; font-weight: 600; min-height: 0;
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9C0E2' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right center; background-size: 16px;
}
.ws-switch select option { color: var(--text); }
.nav-label { padding: 6px 22px 6px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--frame-muted); }
.nav { list-style: none; margin: 0; padding: 0 12px 8px; flex: 1; }
.nav li { margin: 2px 0; }
.nav-link, .nav-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 10px; color: var(--frame-text); text-decoration: none;
  font: inherit; font-size: 14px; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; min-height: 42px; transition: background .15s, color .15s;
}
.nav-link:hover, .nav-toggle:hover { background: var(--frame-hover); color: #fff; }
.nav-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.nav-toggle .label, .nav-link .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .chev { transition: transform .15s; opacity: .6; }
.nav .ico-tile { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .06); color: #CFC6E6; }
.nav .ico-tile svg { width: 17px; height: 17px; }
.nav-item.active > .nav-toggle, .nav-item.active > .nav-link { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-item.active > .nav-toggle .ico-tile, .nav-item.active > .nav-link .ico-tile { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 14px rgba(202, 30, 71, .35); }
.subnav { list-style: none; margin: 4px 0 8px; padding: 0 0 0 26px; position: relative; }
.subnav::before { content: ""; position: absolute; left: 26px; top: 4px; bottom: 4px; width: 1px; background: rgba(255, 255, 255, .1); }
.subnav a { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-left: 10px; padding: 7px 12px; border-radius: 8px; color: var(--frame-muted); text-decoration: none; font-size: 13.5px; }
.subnav a:hover { color: #fff; background: var(--frame-hover); }
.subnav a[aria-current="page"] { color: #fff; font-weight: 600; background: linear-gradient(90deg, rgba(202, 30, 71, .28), rgba(124, 79, 196, .14)); }
.subnav a[aria-current="page"]::before { content: ""; position: absolute; left: -11px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: #F0506F; }
.count { background: var(--brand-crimson); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; min-width: 20px; text-align: center; line-height: 19px; }
.nav-planned { display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: var(--frame-muted); font-size: 14px; opacity: .8; }
.nav-planned .tag { margin-left: auto; font-size: 10.5px; font-weight: 600; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 1px 8px; }
.sidebar-foot { border-top: 1px solid var(--frame-line); padding: 10px 12px 12px; }
.account { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--frame-text); font-size: 13.5px; border-radius: 12px; }
.account small { color: var(--frame-muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.account-menu { position: relative; }
.account-menu .menu { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px; }
.account-menu .menu a, .account-menu .menu button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font: inherit; font-size: 14px; background: none; border: 0; cursor: pointer; }
.account-menu .menu a:hover, .account-menu .menu button:hover { background: var(--canvas); }
.compact-btn { color: var(--frame-muted) !important; font-size: 13px !important; min-height: 36px !important; }
/* compact mode */
.shell.compact .brand-name, .shell.compact .ws-switch, .shell.compact .label, .shell.compact .chev, .shell.compact .subnav,
.shell.compact .account .who, .shell.compact .nav-planned .tag, .shell.compact .count, .shell.compact .nav-label { display: none; }
.shell.compact .brand { justify-content: center; padding: 18px 8px; }
.shell.compact .brand .wordmark { display: none; }
.shell.compact .brand .mark { display: block; }
.shell.compact .nav-link, .shell.compact .nav-toggle, .shell.compact .account, .shell.compact .nav-planned { justify-content: center; padding: 8px 0; }
.flyout { position: fixed; left: calc(var(--sidebar-compact) + 8px); background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 8px; min-width: 230px; z-index: 60; }
.flyout h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin: 6px 10px 6px; font-family: var(--font); }
.flyout a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.flyout a:hover, .flyout a[aria-current="page"] { background: var(--blue-soft); color: var(--primary); }

/* ================= Frame: top bar ================= */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s5); position: sticky; top: 0; z-index: 20; color: var(--frame-text);
  background: radial-gradient(circle at 30% -120%, rgba(202, 30, 71, .25), transparent 50%), linear-gradient(100deg, var(--frame-1), var(--frame-2) 70%, #23154A);
  border-bottom: 1px solid var(--frame-line); box-shadow: 0 8px 22px rgba(18, 10, 40, .12);
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13.5px; min-width: 0; flex: 1; overflow: hidden; }
.crumbs ol { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; min-width: 0; align-items: center; }
.crumbs li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--frame-muted); }
.crumbs li + li::before { content: "›"; margin-right: 8px; color: rgba(255, 255, 255, .3); }
.crumbs a { color: var(--frame-muted); text-decoration: none; }
.crumbs a:hover { color: #fff; }
.crumbs [aria-current] { color: #fff; font-weight: 600; }
.scope-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 4px 11px; color: var(--frame-text); white-space: nowrap; background: rgba(255,255,255,.04); }
.scope-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3CD39A; }
.search-btn { display: flex; align-items: center; gap: 10px; min-width: 250px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.06); color: var(--frame-muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.search-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.search-btn kbd { margin-left: auto; font: 11px var(--mono); border: 1px solid rgba(255,255,255,.18); border-radius: 5px; padding: 1px 6px; color: var(--frame-text); }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--frame-text); cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.icon-btn .dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; border-radius: 999px; background: var(--brand-crimson); color: #fff; font-size: 10px; font-weight: 700; line-height: 17px; padding: 0 4px; border: 2px solid var(--frame-2); }
.icon-btn.menu-btn { display: none; }
.topbar .btn-primary { box-shadow: 0 6px 16px rgba(202, 30, 71, .35); }
.content { padding: 28px 36px 56px; max-width: 1720px; width: 100%; }
.content.wide { max-width: none; }
.demo-banner { background: linear-gradient(90deg, #FFF3DA, #FFE9EE); color: #6B3A08; border-bottom: 1px solid #F3D8B4; padding: 7px 32px; font-size: 12.5px; }

/* ================= Page header & hero ================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-head p { color: var(--text-2); max-width: 72ch; margin: 6px 0 0; font-size: 15px; }
.page-head .actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 28px 32px; margin-bottom: 24px; color: #fff; align-items: center;
  background:
    radial-gradient(circle at 85% -20%, rgba(255, 255, 255, .16), transparent 40%),
    radial-gradient(circle at 0% 120%, rgba(202, 30, 71, .55), transparent 45%),
    linear-gradient(115deg, #2A1650 0%, #462C6B 45%, #8A2459 80%, #CA1E47 120%);
  box-shadow: 0 18px 40px rgba(70, 44, 107, .28);
}
.hero::after {
  content: ""; position: absolute; right: -40px; top: -60px; width: 300px; height: 300px; opacity: .14; pointer-events: none;
  background: url("../img/logomark-128.png") center / contain no-repeat; filter: brightness(0) invert(1);
}
.hero h1 { color: #fff; font-size: 32px; }
.hero p { color: rgba(255, 255, 255, .82); }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.75); margin-bottom: 6px; }
.hero .actions { position: relative; z-index: 1; }
.hero .btn { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); }
.hero .btn:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.hero .btn-primary { background: #fff; color: var(--brand-purple); border-color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.hero .btn-primary:hover { background: #F6F0FF; color: var(--brand-purple); }
.hero .badge { background: rgba(255,255,255,.15); color: #fff; }

/* ================= Buttons & forms ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .15s; }
.btn:hover { background: var(--surface-2); color: var(--text); border-color: #B9AFD3; }
.btn-primary { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(138, 36, 89, .28); }
.btn-primary:hover { color: #fff; filter: brightness(1.07); transform: translateY(-1px); background: var(--brand-grad); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #EBB3C1; }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-success { background: linear-gradient(145deg, #13A374, #087A55); border-color: transparent; color: #fff; box-shadow: 0 6px 14px rgba(8, 122, 85, .25); }
.btn-success:hover { background: linear-gradient(145deg, #15B07E, #08865D); border-color: transparent; color: #fff; filter: none; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(8, 122, 85, .32); }
.btn-success:focus-visible, .btn-primary:focus-visible { color: #fff; }
.btn-danger.btn-solid, .danger-zone .btn-danger { background: linear-gradient(145deg, #D63A5F, #A8183A); border-color: transparent; color: #fff; }
.danger-zone .btn-danger:hover { background: linear-gradient(145deg, #E04A6E, #B51C40); color: #fff; }
.btn-ghost-danger { background: transparent; border-color: transparent; color: var(--text-muted, #6B6585); min-height: 32px; padding: 5px 8px; }
.btn-ghost-danger:hover { background: var(--danger-bg); border-color: #EBB3C1; color: var(--danger); }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.row-actions form { margin: 0; }
.danger-zone { border-color: #F0C6D1; }
.danger-zone h2 { color: var(--danger); }
.export-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 4px; }
.export-quick button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.export-quick button:hover { border-color: #B9AFD3; box-shadow: 0 6px 16px rgba(70, 44, 107, .12); transform: translateY(-1px); }
.export-quick .fmt { font-weight: 700; font-size: 14px; color: var(--brand-purple, #462C6B); display: flex; align-items: center; gap: 6px; }
.export-quick .fmt-ext { font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 6px; color: #fff; background: var(--brand-grad); }
.export-quick .d { font-size: 12px; color: var(--text-muted, #6B6585); }
.export-quick button[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sm { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 1; background: #F1EFF6; border-color: #DDD8E8; color: #8A84A0; box-shadow: none; cursor: not-allowed; transform: none; filter: none; }
.btn-locked { gap: 8px; }
.approve-why { margin-top: 12px; }
.approve-why strong { display: flex; align-items: center; gap: 8px; }

/* Exact source snapshot with cited-area outline */
.snap { margin: 0; }
.snap-frame { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: #fff; }
.snap-frame img { display: block; width: 100%; height: auto; }
.snap-hl { position: absolute; border: 3px solid #E0A400; background: rgba(255, 207, 87, .22); border-radius: 6px; box-shadow: 0 0 0 4000px rgba(18, 10, 40, .18); pointer-events: none; }
.snap-hl + .snap-hl { box-shadow: none; }
.snap figcaption { margin-top: 6px; }
.snap-text { margin-top: 10px; }
.snap-text > summary { cursor: pointer; color: var(--text-2); }
.bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, rgba(202,30,71,.06), rgba(124,79,196,.05)); }
.bulk-bar .count-sel { font-weight: 700; color: var(--brand-purple); }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-decoration: underline; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.field > label, .field > .label { font-weight: 600; font-size: 13.5px; }
.field .hint { font-size: 12.5px; color: var(--text-2); }
.field .err { font-size: 13px; color: var(--danger); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=file], select, textarea {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 12px; width: 100%; min-height: 40px; transition: border-color .15s, box-shadow .15s; }
input[type=file] { padding: 8px; background: var(--surface-2); border-style: dashed; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: #8A5BC4; box-shadow: 0 0 0 4px rgba(124, 79, 196, .16); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; }
.check input { margin-top: 3px; accent-color: var(--primary); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s4); }
fieldset { border: 0; padding: 0; margin: 0 0 var(--s4); }
legend { font-weight: 600; margin-bottom: var(--s2); font-size: 15px; font-family: var(--display); }

.target-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; margin-bottom: 12px; transition: border-color .15s, box-shadow .15s; }
.target-card:hover { border-color: #C9B5E6; }
.target-card:has(input:checked) { border-color: var(--brand-crimson); box-shadow: 0 0 0 4px rgba(202, 30, 71, .1); background: linear-gradient(145deg, #fff, #FDF8FB); }
.target-card input { margin-top: 4px; }
.target-card strong { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-family: var(--display); font-size: 15px; color: var(--brand-purple); }

/* ================= Surfaces ================= */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.panel-pad { padding: 22px 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 16px 24px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.panel-head h2::before { content: ""; width: 4px; height: 18px; border-radius: 4px; background: var(--brand-grad); }
.panel-body { padding: 16px 24px; }
.stack > * + * { margin-top: var(--s4); }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--text-2); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.row-link { display: flex; justify-content: space-between; gap: var(--s3); align-items: center; text-decoration: none; color: inherit; border-radius: 10px; }
.row-link:hover .t { color: var(--brand-crimson); }
.t { font-weight: 600; color: var(--text); }

/* ================= Metric tiles (Prospecting-tool style) ================= */
.summary-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.summary {
  position: relative; overflow: hidden; background: linear-gradient(145deg, #fff, #FCFBFF); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 18px 18px 84px; min-height: 108px; box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s;
}
.summary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.summary::before {
  content: ""; position: absolute; left: 18px; top: 18px; width: 50px; height: 50px; border-radius: 14px; background: var(--t-purple);
  box-shadow: 0 8px 16px rgba(78, 44, 130, .28);
}
.summary::after { content: ""; position: absolute; top: -46px; right: -40px; width: 120px; height: 120px; border-radius: 50%; background: rgba(124, 79, 196, .05); }
.summary:not(:has(.tile-ico)) { padding-left: 18px; border-top: 3px solid transparent; border-image: var(--brand-grad) 1; border-image-slice: 1 0 0 0; }
.summary:not(:has(.tile-ico))::before { display: none; }
.summary .tile-ico { position: absolute; left: 31px; top: 31px; color: #fff; z-index: 1; }
.summary .tile-ico svg { width: 24px; height: 24px; }
.summary-row .summary:nth-child(5n+2)::before { background: var(--t-crimson); box-shadow: 0 8px 16px rgba(196, 30, 74, .28); }
.summary-row .summary:nth-child(5n+3)::before { background: var(--t-amber); box-shadow: 0 8px 16px rgba(240, 138, 28, .28); }
.summary-row .summary:nth-child(5n+4)::before { background: var(--t-teal); box-shadow: 0 8px 16px rgba(20, 155, 122, .28); }
.summary-row .summary:nth-child(5n+5)::before { background: var(--t-blue); box-shadow: 0 8px 16px rgba(51, 97, 227, .28); }
.summary .k { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.summary .v { font-family: var(--display); font-size: 28px; font-weight: 600; margin-top: 2px; line-height: 1.1; color: var(--text); letter-spacing: -.02em; }
.summary .d { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.summary a, .summary button { text-decoration: none; color: inherit; }

/* Tool cards (Home) */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tool-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); text-decoration: none; color: var(--text); transition: transform .16s, box-shadow .16s, border-color .16s; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #D8CCEB; color: var(--text); }
.tool-card .tool-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--t-purple); box-shadow: 0 8px 18px rgba(78, 44, 130, .28); }
.tool-card .tool-ico svg { width: 24px; height: 24px; }
.tool-card.tc-crimson .tool-ico { background: var(--t-crimson); box-shadow: 0 8px 18px rgba(196, 30, 74, .28); }
.tool-card.tc-amber .tool-ico { background: var(--t-amber); box-shadow: 0 8px 18px rgba(240, 138, 28, .3); }
.tool-card.tc-teal .tool-ico { background: var(--t-teal); box-shadow: 0 8px 18px rgba(20, 155, 122, .28); }
.tool-card h3 { font-size: 18px; margin: 4px 0 0; }
.tool-card p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.tool-card .go { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; color: var(--link); }
.tool-card::after { content: ""; position: absolute; right: -50px; top: -50px; width: 140px; height: 140px; border-radius: 50%; background: var(--brand-grad-soft); }

/* ================= Tables ================= */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid #EFECF6; vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: #FBF8FF; }
table.data a.t { text-decoration: none; }
table.data a.t:hover { color: var(--brand-crimson); }
table.data .sub { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ================= Toolbar, tabs, chips ================= */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.toolbar .grow { flex: 1 1 260px; }
.toolbar label { font-size: 11.5px; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 3px; }
.toolbar select, .toolbar input { min-height: 38px; padding: 7px 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--border); font-size: 13px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 4px 12px; color: var(--text); text-decoration: none; font-weight: 500; }
.chip:hover { border-color: var(--brand-crimson); color: var(--brand-crimson); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.panel > .tabs { margin-bottom: 0; padding: 0 12px; }
.tabs a { padding: 12px 14px; text-decoration: none; color: var(--text-2); font-size: 14px; font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--brand-purple); border-bottom-color: var(--brand-crimson); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); gap: var(--s3); flex-wrap: wrap; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg a { padding: 5px 14px; font-size: 13px; text-decoration: none; color: var(--text-2); font-weight: 600; }
.seg a[aria-current="true"] { background: var(--brand-grad); color: #fff; }

/* ================= Badges ================= */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; line-height: 16px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-neutral { background: var(--info-bg); color: #4A4362; }
.b-blue { background: #EFE8FB; color: #5B2E86; }
.b-success { background: var(--success-bg); color: var(--success); }
.b-warning { background: var(--warning-bg); color: var(--warning); }
.b-danger { background: var(--danger-bg); color: var(--danger); }
.b-plain::before { display: none; }
.tag-demo { background: #FFF1D6; color: #7A4A08; }

/* ================= States ================= */
.state { padding: 28px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: linear-gradient(145deg, #FCFBFF, #F7F4FC); text-align: center; }
.state h3 { margin-bottom: 4px; font-size: 16px; }
.state p { color: var(--text-2); margin: 0 auto 14px; max-width: 52ch; }
.alert { border-radius: var(--radius); padding: 13px 16px; font-size: 14px; border: 1px solid; margin-bottom: var(--s4); }
.alert strong { display: block; margin-bottom: 2px; }
.alert-info { background: #F4F1FB; border-color: #E0D7F0; }
.alert-success { background: var(--success-bg); border-color: #B5DFCD; color: #05553B; }
.alert-warning { background: var(--warning-bg); border-color: #EFD3A4; color: #6F4708; }
.alert-danger { background: var(--danger-bg); border-color: #F0BACA; color: #8A1430; }
.flash-stack { margin-bottom: var(--s4); }
.skeleton { background: linear-gradient(90deg, #EEEAF6 25%, #F7F5FB 50%, #EEEAF6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ================= Steps ================= */
.steps { display: flex; gap: 10px; list-style: none; margin: 0 0 24px; padding: 14px 18px; flex-wrap: wrap; font-size: 13.5px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-weight: 500; }
.steps li + li::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: var(--border); }
.steps .n { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface); }
.steps [aria-current="step"] { color: var(--text); font-weight: 700; }
.steps [aria-current="step"] .n { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 4px 10px rgba(202, 30, 71, .3); }
.steps .done { color: var(--success); }
.steps .done .n { background: var(--success-bg); color: var(--success); border-color: #B5DFCD; }
.stage-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.stage-list li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; color: var(--text-2); }

/* ================= Drawer / dialogs ================= */
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(420px, 100vw); background: var(--surface); box-shadow: var(--shadow-pop); z-index: 70; display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; color: #fff; background: linear-gradient(110deg, var(--frame-1), var(--brand-purple)); }
.drawer-head h2 { color: #fff; }
.drawer-head .icon-btn { color: #fff; }
.drawer-body { padding: 14px 22px; overflow-y: auto; flex: 1; background: var(--canvas); }
.job { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; font-size: 14px; box-shadow: var(--shadow-xs); }
.job .meta { display: flex; justify-content: space-between; gap: 8px; color: var(--text-3); font-size: 12.5px; margin-top: 6px; }
.job .acts { display: flex; gap: 8px; margin-top: 10px; }
.backdrop { position: fixed; inset: 0; background: rgba(18, 10, 40, .45); z-index: 65; }
dialog.palette { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(640px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); margin-top: 12vh; overflow: hidden; }
dialog.palette::backdrop, dialog.modal::backdrop { background: rgba(18, 10, 40, .45); backdrop-filter: blur(2px); }
.palette input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 18px 20px; font-size: 16px; min-height: 58px; }
.palette input:focus-visible { outline: none; box-shadow: none; }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 380px; overflow-y: auto; }
.palette li a { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 14px; }
.palette li a[aria-selected="true"], .palette li a:hover { background: var(--blue-soft); color: var(--primary); }
.palette .group { font-size: 12px; color: var(--text-3); }
.palette .scope { padding: 10px 20px 14px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); background: var(--surface-2); }
dialog.modal { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(580px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: var(--s2); background: var(--surface-2); }

/* ================= Knowledge Builder: inspect + review ================= */
.inspect { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.outline { max-height: calc(100vh - 260px); overflow-y: auto; }
.outline-item { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 11px 16px; border-bottom: 1px solid #EFECF6; text-decoration: none; color: inherit; font-size: 14px; }
.outline-item:hover { background: #FBF8FF; }
.outline-item[aria-current="true"] { background: linear-gradient(90deg, rgba(202, 30, 71, .08), rgba(124, 79, 196, .06)); box-shadow: inset 3px 0 0 var(--brand-crimson); }
.outline-item .no { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-3); min-width: 2.4em; }
.outline-item .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; text-decoration: none; }
.outline-item .meta { grid-column: 2; display: flex; gap: 4px; flex-wrap: wrap; }
.review { display: grid; grid-template-columns: var(--left, 270px) 6px minmax(440px, 1fr) 6px var(--right, 38%); height: calc(100vh - var(--topbar-h)); }
.review > section { overflow-y: auto; min-width: 0; background: var(--surface); }
.review .pane-left { background: var(--surface-2); }
.review .pane-right { background: #F8F6FC; }
.review .pane-center { padding: 22px 28px; }
.review .pane-center textarea#question { min-height: 72px; }
.gutter { cursor: col-resize; background: var(--border); border: 0; padding: 0; transition: background .15s; }
.gutter:hover, .gutter:focus-visible { background: var(--brand-crimson); }
.pane-title { position: sticky; top: 0; background: inherit; padding: 14px 18px; border-bottom: 1px solid var(--border); z-index: 2; }
.queue-item { display: block; padding: 11px 16px; border-bottom: 1px solid #EFECF6; text-decoration: none; color: var(--text); font-size: 13.5px; line-height: 1.45; }
.queue-item[aria-current="true"] { background: linear-gradient(90deg, rgba(202, 30, 71, .09), rgba(124, 79, 196, .05)); box-shadow: inset 3px 0 0 var(--brand-crimson); font-weight: 600; }
.queue-item:hover { background: #F4EFFB; }
.queue-item .badge { margin-top: 6px; }
.save-state { font-size: 13px; color: var(--text-2); }
.save-state[data-state="error"] { color: var(--danger); font-weight: 600; }
.save-state[data-state="saved"] { color: var(--success); }
.issue { border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 10px; padding: 13px 15px; margin-bottom: 12px; background: var(--surface); font-size: 14px; box-shadow: var(--shadow-xs); }
.issue.sev-blocking { border-left-color: var(--danger); background: linear-gradient(90deg, #FFF6F8, #fff 40%); }
.issue.sev-warning { border-left-color: #E39A1C; }
.issue .ev { font-size: 13px; margin-top: 6px; }
.cite { border: 1px solid var(--border); border-radius: 12px; padding: 13px; margin-bottom: 12px; background: var(--surface); box-shadow: var(--shadow-xs); }
.cite .btn[aria-pressed="true"] { background: var(--brand-grad); color: #fff; border-color: transparent; }
.cite blockquote { margin: 8px 0 0; padding-left: 12px; border-left: 3px solid #D8C9EE; font-size: 13px; white-space: pre-wrap; color: var(--text); }
.decision-bar { position: sticky; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-top: 1px solid var(--border); padding: 12px 0; display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-top: 24px; }

/* sanitized source preview */
.slide-canvas { position: relative; width: 100%; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font-size: clamp(8px, 1.05vw, 13px); box-shadow: var(--shadow-sm); }
.slide-canvas .shape { position: absolute; overflow: hidden; padding: 2px 4px; line-height: 1.25; color: #1F1835; }
.slide-canvas .shape p { margin: 0 0 2px; }
.slide-canvas .k-title { font-weight: 700; font-size: 1.35em; color: var(--brand-purple); }
.shape.boiler, .flow-block.boiler { color: #A29CB6; font-style: italic; }
.shape.hl, .flow-block.hl, .src-table .hl, details.notes.hl { background: rgba(255, 207, 87, .45); outline: 2px solid #E0A400; border-radius: 3px; }
.src-table { border-collapse: collapse; width: 100%; font-size: .95em; }
.src-table th, .src-table td { border: 1px solid #DDD5EA; padding: 2px 4px; text-align: left; vertical-align: top; }
.src-table th { background: #F4F0FA; }
.pic-ph { display: block; border: 1px dashed #BDB2D4; color: #6E6788; padding: 4px; font-size: .85em; text-align: center; height: 100%; background: repeating-linear-gradient(45deg, #FAF8FD, #FAF8FD 6px, #F3EFF9 6px, #F3EFF9 12px); }
.page-flow .flow-block, .flow-blocks .flow-block { padding: 7px 9px; border-bottom: 1px solid #F0EDF6; font-size: 14px; }
details.notes { margin-top: var(--s3); font-size: 13px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }

/* ================= Login ================= */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--canvas); }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 15% 110%, rgba(202, 30, 71, .7), transparent 50%), radial-gradient(circle at 90% 0%, rgba(124, 79, 196, .55), transparent 45%), linear-gradient(140deg, #120C24, #2A1650 55%, #462C6B); }
.login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 520px; height: 520px; background: url("../img/logomark-128.png") center / contain no-repeat; opacity: .16; }
.login-art img.wordmark { height: 38px; width: auto; align-self: flex-start; position: relative; z-index: 1; }
.login-art h2 { font-size: 40px; line-height: 1.1; color: #fff; max-width: 14ch; margin: 0 0 14px; }
.login-art p { color: rgba(255,255,255,.8); max-width: 44ch; font-size: 16px; }
.login-art ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.login-art li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.9); }
.login-art li span { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.12); display: grid; place-items: center; }
.login-art li svg { width: 16px; height: 16px; }
.login-side { display: grid; place-items: center; padding: 32px; }
.login { width: min(420px, 100%); background: var(--surface); border-radius: 20px; padding: 40px 36px; box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.login h1 { font-size: 26px; }
.login .btn-primary { width: 100%; min-height: 44px; font-size: 15px; }

/* ================= Print ================= */
@media print {
  .sidebar, .topbar, .no-print, .demo-banner { display: none !important; }
  .shell { display: block; }
  body { background: #fff; font-size: 12px; }
  .panel, .summary { box-shadow: none; break-inside: avoid; }
}

/* ================= Responsive ================= */
@media (max-width: 1180px) {
  .review { grid-template-columns: 240px 6px minmax(0, 1fr) 6px 40%; }
  .cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .inspect { grid-template-columns: 260px minmax(0, 1fr); }
  .search-btn { min-width: 0; }
  .search-btn .txt, .search-btn kbd { display: none; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 860px) {
  .shell, .shell.compact { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .shell.compact .label, .shell.compact .subnav, .shell.compact .chev, .shell.compact .ws-switch, .shell.compact .brand-name { display: revert; }
  .compact-btn { display: none !important; }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 0 12px; }
  .scope-pill { display: none; }
  .content { padding: 18px 16px 48px; }
  .hero { padding: 22px; border-radius: 16px; }
  .hero h1 { font-size: 26px; }
  .grid-2, .grid-3, .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .inspect { grid-template-columns: minmax(0, 1fr); }
  .outline { max-height: 280px; }
  .review { display: block; height: auto; }
  .review .gutter { display: none; }
  .review .pane-left { max-height: 240px; }
  h1 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ================= Prospecting actions ================= */
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.agenda-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.agenda-row > span:first-child { min-width: 0; }
.add-box { margin-top: 12px; }
.add-box > summary { list-style: none; cursor: pointer; display: inline-flex; }
.add-box > summary::-webkit-details-marker { display: none; }
.add-box[open] > summary { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
.form-grid .span-2, .form-grid > div:first-of-type { grid-column: 1 / -1; }
.ai-note { border: 1px solid var(--border); border-left: 3px solid #7C4FC4; border-radius: 10px; background: #FBF9FE; padding: 10px 14px; margin: 10px 0; }
.ai-note p { margin: 6px 0; }
.window-form { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin: 0; }
.window-form input[type=number] { width: 76px; min-height: 32px; padding: 4px 8px; }
.picks li { margin-bottom: 6px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } .agenda-row { flex-direction: column; } }
/* "More…" menu on analysis pages */
.menu-more { position: relative; }
.menu-more > summary { list-style: none; cursor: pointer; }
.menu-more > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 280px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: 0 12px 30px rgba(30, 20, 60, .16); }
.menu-pop form { margin: 0; width: 100%; }
.rename-form label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 4px; }
