@font-face {
  font-family: "Open Sans";
  src: url("assets/fonts/OpenSans-Variable.ttf") format("truetype");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --vision-gray-light: #cccccc;
  --vision-gray: #666666;
  --light-teal: #66cccc;
  --vision-teal: #339999;
  --vision-teal-dark: #055553;
  --vision-coral: #df7f58;
  --teal-50: #e6f7f7;
  --teal-500: #10b9b9;
  --teal-600: #069592;
  --teal-700: #197d7d;
  --neutral-0: #ffffff;
  --neutral-50: #f2f2f2;
  --neutral-100: #f7f7f7;
  --neutral-200: #dfdfdf;
  --neutral-300: #cccccc;
  --neutral-500: #666666;
  --neutral-700: #4d4d4d;
  --neutral-900: #1b1b1b;
  --neutral-950: #262626;
  --green-50: #edfbed;
  --green-500: #3ebe61;
  --green-700: #1f7a3a;
  --red-50: #fdecec;
  --red-500: #d64545;
  --red-700: #a12c2c;
  --amber-50: #fdf5e3;
  --amber-500: #d6a243;
  --amber-700: #8a6212;
  --coral-50: #fcefea;
  --coral-700: #a9502e;
  --blue-50: #e8f0fb;
  --blue-700: #1d4f91;
  --violet-50: #f1edfa;
  --violet-700: #5b3a9e;

  --bg: #f2f2f2;
  --card: #ffffff;
  --muted: #f7f7f7;
  --fg: #1b1b1b;
  --muted-fg: #666666;
  --border: #dfdfdf;
  --input: #cccccc;
  --primary: #33a3a3;
  --primary-hover: #237878;
  --primary-fg: #ffffff;
  --link: #197d7d;
  --accent: #e0f1f1;
  --accent-fg: #055553;
  --brand-deep: #055553;
  --brand-coral: #df7f58;
  --sidebar: #262626;
  --sidebar-fg: #ffffff;
  --sidebar-muted: #c8c8c8;
  --sidebar-active: #33a3a3;
  --success: #3ebe61;
  --success-soft: #edfbed;
  --success-fg: #1f7a3a;
  --destructive: #d64545;
  --destructive-soft: #fdecec;
  --destructive-fg: #a12c2c;
  --warning: #d6a243;
  --warning-soft: #fdf5e3;
  --warning-fg: #8a6212;
  --info-soft: #e8f0fb;
  --info-fg: #1d4f91;
  --secondary-fg: #055553;

  --radius-base: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-card: 16px;
  --radius-full: 999px;

  --sidebar-w: 240px;
  --header-h: 64px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --shadow-menu: 0 4px 12px rgba(0, 0, 0, 0.10);
  --font: "Open Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-decoration: none; }
img { display: block; max-width: 100%; }

/* typography */
.h1 { font-size: 24px; font-weight: 700; line-height: 1.25; margin: 0; color: var(--fg); }
.h2 { font-size: 18px; font-weight: 700; line-height: 1.3; margin: 0; color: var(--fg); }
.h3 { font-size: 16px; font-weight: 700; line-height: 1.3; margin: 0; color: var(--fg); }
.body { font-size: 14px; font-weight: 400; }
.body-strong { font-size: 14px; font-weight: 600; }
.body-bold { font-size: 14px; font-weight: 700; }
.caption { font-size: 12px; font-weight: 400; line-height: 1.4; }
.caption-strong { font-size: 12px; font-weight: 600; line-height: 1.4; }
.overline { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.kpi { font-size: 28px; font-weight: 700; line-height: 1.15; margin: 0; }
.muted { color: var(--muted-fg); }
.link { color: var(--link); font-weight: 600; font-size: 12px; background: none; border: 0; padding: 0; cursor: pointer; }
.link:hover { text-decoration: underline; }
.crumb { color: var(--link); font-size: 12px; font-weight: 600; margin: 0 0 4px; }

/* layout shell */
.app {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.brand {
  padding: 24px 36px 20px;
  display: flex;
  justify-content: center;
}
.brand img {
  width: 168px;
  height: auto;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0 16px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 20px;
  border: 0;
  background: transparent;
  color: var(--sidebar-muted);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  width: 100%;
  position: relative;
  border-radius: 0;
}
.nav-item svg { flex: 0 0 20px; width: 20px; height: 20px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.04); }
.nav-item.active {
  color: var(--sidebar-active);
  font-weight: 600;
  background: transparent;
}
.nav-item.active::after {
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 2px 0 0 2px;
  background: var(--sidebar-active);
}
.sidebar-foot {
  padding: 12px 0 20px;
  margin-top: auto;
}
.sidebar-foot .nav-item { color: var(--sidebar-muted); }

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-agency .name { font-size: 14px; font-weight: 700; color: var(--fg); line-height: 1.2; }
.topbar-agency .meta { font-size: 12px; color: var(--muted-fg); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.icon-btn {
  width: 32px; height: 32px;
  border: 0; background: transparent; color: var(--muted-fg);
  display: grid; place-items: center; border-radius: var(--radius-md);
  padding: 0;
}
.icon-btn:hover { background: var(--muted); color: var(--fg); }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; padding: 0; color: inherit; text-align: left;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-deep); color: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.user-chip .who { display: flex; flex-direction: column; }
.user-chip .who .nm { font-size: 14px; font-weight: 600; line-height: 1.2; }
.user-chip .who .role { font-size: 12px; color: var(--muted-fg); }
.user-chip .chev { color: var(--muted-fg); }

.page {
  padding: 24px 32px 32px;
  display: none;
  flex-direction: column;
  gap: 24px;
}
.page.active { display: flex; }

/* page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  overflow: visible;
  position: relative;
  z-index: 25;
}
.page-header .titles { flex: 1; min-width: 0; }
.page-header .titles .h1 { margin-top: 0; }
.page-header .sub { margin: 6px 0 0; color: var(--muted-fg); font-size: 14px; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 10px 16px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
.btn svg { width: 16px; height: 16px; flex: 0 0 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; font-weight: 600; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-secondary { background: #fff; color: var(--brand-deep); border-color: var(--brand-deep); }
.btn-secondary:hover { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--brand-deep); border-color: transparent; }
.btn-ghost:hover { background: var(--accent); }
.btn[disabled], .btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-block { width: 100%; }

/* stepper */
.stepper {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 24px;
}
.stepper-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted-fg);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}
.step .dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--muted-fg);
  flex: 0 0 32px;
}
.step.is-current { color: var(--fg); font-weight: 700; }
.step.is-current .dot {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}
.step.is-done { color: var(--fg); font-weight: 600; }
.step.is-done .dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--brand-deep);
}
.step-line {
  flex: 1 1 24px;
  height: 2px;
  background: var(--border);
  border-radius: var(--radius-full);
  min-width: 16px;
}
.step-line.is-done { background: var(--primary); }

/* cards */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.card-pad { padding: 20px; }
.card + .card { /* spacing comes from page gap */ }

/* callouts */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
}
.callout .co-icon { flex: 0 0 16px; margin-top: 2px; }
.callout .co-body { flex: 1; min-width: 0; }
.callout .co-title { font-size: 14px; font-weight: 700; margin: 0; }
.callout .co-text { font-size: 12px; margin: 2px 0 0; line-height: 1.4; }
.callout.info { background: var(--info-soft); color: var(--info-fg); }
.callout.success { background: var(--success-soft); color: var(--success-fg); }
.callout.danger { background: var(--destructive-soft); color: var(--destructive-fg); }
.callout.warning { background: var(--warning-soft); color: var(--warning-fg); }
.callout .co-actions { margin-left: auto; flex-shrink: 0; align-self: center; }

/* badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-base);
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-neutral { background: var(--neutral-50); color: var(--neutral-700); }
.badge-draft { background: #f2f2f2; color: var(--neutral-700); border-color: var(--border); background: #fff; }
.badge-recommended, .badge-selected, .badge-quote {
  background: var(--accent);
  color: var(--brand-deep);
}
.badge-success, .badge-uploaded, .badge-passed, .badge-fixed,
.badge-better, .badge-same {
  background: var(--success-soft);
  color: var(--success-fg);
}
.badge-warning, .badge-missing, .badge-inreview {
  background: var(--warning-soft);
  color: var(--warning-fg);
}
.badge-danger, .badge-unresolvable {
  background: var(--destructive-soft);
  color: var(--destructive-fg);
}
.badge-info, .badge-mismatch {
  background: var(--info-soft);
  color: var(--info-fg);
}
.badge-ho5 {
  background: var(--teal-50);
  color: var(--brand-deep);
}
.badge-outline {
  background: #fff;
  color: var(--neutral-700);
  border-color: var(--border);
}

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--fg); }
.input, .select, select.input {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  color: var(--fg);
  background: #fff;
  width: 100%;
}
.select, select.input { appearance: none; padding-right: 32px; }
.select-wrap { position: relative; }
.select-wrap .chev {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted-fg); pointer-events: none;
}
.input:focus, .select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}

/* upload grid */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.slot-head, .docs-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slot-head .h3 { flex: 1; }
.slot-desc { color: var(--muted-fg); margin: 12px 0 16px; }

.dropzone {
  border: 1px dashed var(--input);
  background: var(--muted);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag { background: var(--accent); border-color: var(--primary); }
.dropzone .dz-title { font-weight: 600; font-size: 14px; }
.dropzone .dz-sub { font-size: 12px; color: var(--muted-fg); }
.file-row {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.file-row .file-icon { color: var(--muted-fg); flex: 0 0 20px; }
.file-row .file-meta { flex: 1; min-width: 0; }
.file-row .file-meta .fn { font-weight: 600; }
.file-row .file-meta .fs { font-size: 12px; color: var(--muted-fg); }
.icon-x {
  width: 28px; height: 28px; border: 0; background: none; color: var(--muted-fg);
  display: grid; place-items: center; border-radius: 6px; padding: 0;
}
.icon-x:hover { background: var(--muted); color: var(--fg); }

.docs-head { margin-bottom: 8px; }
.docs-tools { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.seg {
  display: inline-flex;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted-fg);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
}
.seg button.is-on {
  background: #fff;
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.doc-types {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}
.doc-type {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.doc-type .dt-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.doc-type p { margin: 0; font-size: 12px; color: var(--muted-fg); }

/* tables */
.table-wrap { width: 100%; overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-fg);
  padding: 10px 16px;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data th.is-num, table.data td.is-num { text-align: right; }
table.data td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--fg);
}
table.data tr:last-child td { border-bottom: 0; }
table.data .two { display: flex; flex-direction: column; gap: 1px; }
table.data .two .sub { font-size: 12px; color: var(--muted-fg); }
table.data a.ref, .ref-link {
  color: var(--link);
  font-weight: 600;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head .sub { margin: 4px 0 0; font-size: 12px; color: var(--muted-fg); }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted-fg);
}

/* flags / inline fix */
.fix-row td { background: var(--muted); padding: 16px 16px 16px 0; }
.fix-panel {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding-left: 16px;
}
.fix-panel .field { flex: 1; }
.row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; flex-wrap: nowrap; }
.editing-label { font-size: 12px; font-weight: 600; color: var(--muted-fg); }

/* grouping */
.filter-card { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.group-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.group-head.matched { background: var(--success-soft); }
.group-head.referrals { background: var(--warning-soft); }
.group-head.knockouts { background: var(--destructive-soft); }
.group-head .gh-main { flex: 1; min-width: 0; }
.group-head .gh-title { display: flex; align-items: baseline; gap: 8px; }
.group-head .gh-count { font-weight: 600; color: var(--muted-fg); font-size: 14px; }
.group-head .gh-sub { margin: 2px 0 0; font-size: 12px; color: var(--muted-fg); }
.group-head .gh-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding-top: 2px; white-space: nowrap; }
.group-head.matched .gh-sub { color: var(--success-fg); }
/* keep sub muted-green-ish; actual screenshot sub is muted dark on green bg */
.group-head.matched .gh-sub { color: #3a5a44; }

.reason-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.reason-bar .lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-fg); margin-right: 4px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 12px;
  color: var(--fg);
  cursor: pointer;
}
.pill strong { font-weight: 600; }
.pill.is-on { background: #fff; border-color: var(--border); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.pill.is-on, .pill:hover { border-color: var(--border); }

.delta { font-weight: 700; color: var(--success-fg); }
.delta.zero { color: var(--fg); }
.cov-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.check {
  width: 16px; height: 16px;
  border: 1.5px solid var(--primary);
  border-radius: 4px;
  background: var(--primary);
  display: inline-grid; place-items: center;
  color: #fff;
  padding: 0;
  flex: 0 0 16px;
}
.check.off {
  background: #fff;
  border-color: var(--input);
  color: transparent;
}

/* compare options */
.callout-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.option-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.opt {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opt.is-selected { border: 2px solid var(--primary); padding: 19px; }
.opt.is-dim { background: var(--muted); }
.opt .opt-top { display: flex; align-items: center; gap: 6px; }
.opt .opt-top .overline { flex: 1; color: var(--muted-fg); }
.opt .price { font-size: 28px; font-weight: 700; margin: 4px 0 0; }
.opt .opt-sub { font-size: 12px; color: var(--success-fg); margin: 0; }
.opt.is-dim .opt-sub { color: var(--destructive-fg); }
.opt.is-dim .price, .opt.is-dim .h3 { color: var(--muted-fg); }
.opt .opt-lines {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.opt .line { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.opt .line .k { color: var(--muted-fg); }
.opt .line .v { font-weight: 600; }
.opt .line .v.good { color: var(--success-fg); }
.opt .line .v.bad { color: var(--destructive-fg); }
.opt .btn { margin-top: 12px; }

.eq-panel .tiles {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}
.eq-panel .tile { padding: 16px 20px; }
.eq-panel .tile + .tile { border-left: 1px solid var(--border); }
.eq-panel .tile .lbl { font-size: 12px; font-weight: 600; color: var(--muted-fg); }
.eq-panel .tile .val { font-size: 18px; font-weight: 700; margin: 4px 0; }
.eq-panel .tile .val.warn { color: var(--warning-fg); }
.eq-panel .tile .meta { font-size: 12px; color: var(--muted-fg); }

.sbs-tools { display: flex; align-items: center; gap: 16px; }
.section-row td {
  background: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-fg);
  padding: 8px 16px;
}
.better-cell { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--success-fg); }
.prem-cell { display: flex; align-items: baseline; gap: 8px; font-weight: 700; }
.prem-cell .delta { font-size: 14px; }

/* footer bar */
.step-actions {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.step-actions .status { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.step-actions .status .ok { color: var(--success-fg); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.step-actions .status .extra { font-size: 12px; color: var(--muted-fg); }

/* export menu */
.menu-anchor { position: relative; display: inline-flex; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-menu);
  padding: 4px;
  z-index: 40;
  display: none;
}
.menu.open { display: block; }
.menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 8px 12px 8px 12px;
  font-size: 14px;
  color: var(--fg);
  border-radius: 6px;
}
.menu button:hover { background: var(--muted); }
.menu button { padding-left: 32px; }
.menu button.is-checked { background: var(--muted); padding-left: 12px; }
.menu button .tick { width: 16px; color: var(--fg); flex: 0 0 16px; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* toast / modal */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--neutral-900);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  max-width: min(520px, 90vw);
  text-align: center;
}
.toast.show { opacity: 1; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(27,27,27,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  width: min(480px, 100%);
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}
.modal p { color: var(--muted-fg); margin: 8px 0 0; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

.hidden { display: none !important; }
.spacer { flex: 1; }

@media (max-width: 1100px) {
  .upload-grid, .callout-row, .filter-row { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr 1fr; }
  .doc-types { grid-template-columns: 1fr; }
}
