/* Bids Tender — Digital Move theme (navy #000882, sky #4DBDFF, ink #09152B) */

:root,
:root[data-theme="light"] {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #dfe5ee;
  --border-strong: #d3dae4;
  --text: #09152b;
  --text-2: #4b5a74;
  --text-3: #7d8ca5;

  --brand: #000882;
  --brand-hover: #000666;
  --brand-ink: #ffffff;
  --brand-soft: #e8ecff;
  --brand-text: #000882;
  --sky: #4dbdff;
  --sky-soft: #e5f4ff;
  --violet: #6854e8;
  --violet-soft: #efecff;

  --success: #0b8a5f;
  --success-soft: #e3f6ee;
  --warning: #b45309;
  --warning-soft: #fff3e0;
  --danger: #d12424;
  --danger-soft: #fdeaea;
  --neutral-soft: #eef1f6;

  --side-bg: #09152b;
  --side-text: #a8b4cb;
  --side-muted: #5f6e8a;
  --side-active: rgba(77, 189, 255, 0.14);
  --side-active-text: #ffffff;
  --side-border: rgba(255, 255, 255, 0.07);

  --hero: radial-gradient(120% 140% at 100% 0%, rgba(77, 189, 255, 0.55) 0%, rgba(77, 189, 255, 0) 55%),
          radial-gradient(90% 120% at 0% 100%, rgba(104, 84, 232, 0.45) 0%, rgba(104, 84, 232, 0) 60%),
          linear-gradient(135deg, #000882 0%, #0a1aa0 55%, #1b3fc4 100%);

  --donut-1: #000882;
  --donut-2: #6854e8;
  --donut-3: #4dbdff;
  --donut-4: #c3ccd9;

  --shadow-sm: 0 1px 2px rgba(9, 21, 43, 0.05);
  --shadow: 0 1px 2px rgba(9, 21, 43, 0.04), 0 6px 20px rgba(9, 21, 43, 0.06);
  --shadow-lg: 0 20px 50px rgba(0, 8, 130, 0.22);
  --ring: 0 0 0 3px rgba(77, 189, 255, 0.35);

  --radius: 14px;
  --radius-sm: 9px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #060c1a;
  --surface: #0d1628;
  --surface-2: #111c33;
  --border: #1c2942;
  --border-strong: #26365a;
  --text: #e8eef8;
  --text-2: #a7b3c9;
  --text-3: #6d7c98;

  --brand: #4dbdff;
  --brand-hover: #7accff;
  --brand-ink: #06122a;
  --brand-soft: rgba(77, 189, 255, 0.13);
  --brand-text: #7accff;
  --sky: #4dbdff;
  --sky-soft: rgba(77, 189, 255, 0.13);
  --violet: #9b8cff;
  --violet-soft: rgba(155, 140, 255, 0.14);

  --success: #3dd598;
  --success-soft: rgba(61, 213, 152, 0.12);
  --warning: #f5b84a;
  --warning-soft: rgba(245, 184, 74, 0.12);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.13);
  --neutral-soft: rgba(167, 179, 201, 0.1);

  --side-bg: #040917;
  --side-text: #93a1bb;
  --side-muted: #4f5d79;
  --side-border: rgba(255, 255, 255, 0.06);

  --hero: radial-gradient(120% 140% at 100% 0%, rgba(77, 189, 255, 0.4) 0%, rgba(77, 189, 255, 0) 55%),
          radial-gradient(90% 120% at 0% 100%, rgba(104, 84, 232, 0.4) 0%, rgba(104, 84, 232, 0) 60%),
          linear-gradient(135deg, #00065e 0%, #0a1590 55%, #1636a8 100%);

  --donut-1: #4dbdff;
  --donut-2: #9b8cff;
  --donut-3: #2b6fd6;
  --donut-4: #2a3a5c;

  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--neutral-soft); padding: 1px 5px; border-radius: 5px; }
.mono, .num { font-family: var(--mono); font-size: 12px; letter-spacing: 0; }
.num { display: block; color: var(--text-3); }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Buttons */
button, .button, input, select, textarea { font: inherit; color: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  background: var(--brand); color: var(--brand-ink);
  border: 1px solid var(--brand); border-radius: 10px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
/* Brand hover only on primary actions — not icon, chat chrome, or text/filter controls */
button:is(.button, .block):not(.quiet):not(.light):not(.glass):hover,
button:not([class]):hover,
a.button:not(.quiet):not(.light):not(.glass):hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--brand-ink);
  text-decoration: none;
}
button:active, .button:active { transform: translateY(1px); }
button .i, .button .i { width: 16px; height: 16px; }
button.quiet, .button.quiet {
  background: var(--surface); color: var(--text); border-color: var(--border-strong);
}
button.quiet:hover, .button.quiet:hover { background: var(--surface-2); border-color: var(--text-3); color: var(--text); }
.button.light { background: #fff; color: #000882; border-color: #fff; }
.button.light:hover { background: #eaf6ff; border-color: #eaf6ff; color: #000882; }
.button.glass {
  background: rgba(255, 255, 255, 0.1); color: #fff;
  border-color: rgba(255, 255, 255, 0.28); box-shadow: none;
  backdrop-filter: blur(6px);
}
.button.glass:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.5); color: #fff; }
button.block, .button.block { width: 100%; height: 44px; }
.icon-btn {
  width: 38px; height: 38px; padding: 0;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); box-shadow: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn.on-dark { background: transparent; color: var(--side-text); border-color: var(--side-border); }
.icon-btn.on-dark:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
:root[data-theme="dark"] .t-sun { display: none; }
:root:not([data-theme="dark"]) .t-moon { display: none; }
.theme-toggle span { display: inline-flex; }
button:focus-visible, a:focus-visible, .button:focus-visible { outline: none; box-shadow: var(--ring); }

/* Forms */
label { display: block; }
label span, legend, .kicker {
  display: block; margin: 0 0 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  letter-spacing: 0; text-transform: none;
}
input, select, textarea {
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: var(--ring); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
.lede { color: var(--text-2); max-width: 70ch; margin: 6px 0 0; }
.fine { color: var(--text-3); font-size: 13px; margin: 8px 0 0; }
.warn { color: var(--warning); margin: 8px 0 0; }
.notice {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 20px; padding: 12px 14px;
  background: var(--sky-soft); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--sky) 35%, transparent);
  border-radius: var(--radius-sm);
}
.notice .i { color: var(--brand-text); }

/* App shell */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 20px 14px 14px;
  background: var(--side-bg); color: var(--side-text);
  border-right: 1px solid var(--side-border);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.logo {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  background: #fff; border-radius: 11px;
  box-shadow: 0 6px 16px rgba(77, 189, 255, 0.25);
}
.logo img { width: 34px; height: 34px; object-fit: contain; }
.brand-name { display: block; font-family: var(--display); font-weight: 800; font-size: 16.5px; letter-spacing: -0.01em; line-height: 1.15; }
.brand-sub { display: block; font-size: 12px; color: var(--sky); font-weight: 500; }
.side-label { margin: 14px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--side-muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--side-text); font-weight: 500; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav a.on { background: var(--side-active); color: #fff; }
.nav a.on .i { color: var(--sky); }
.nav a.on::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--sky);
}
.side-foot {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 8px 4px; border-top: 1px solid var(--side-border);
}
.side-foot form { margin: 0 0 0 auto; }
.avatar {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #4dbdff, #6854e8);
  color: #fff; font-weight: 700;
}
.who { min-width: 0; }
.who-org, .who-mail { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-org { color: #fff; font-weight: 600; font-size: 13.5px; }
.who-mail { font-size: 12px; color: var(--side-muted); }

.shell { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.crumb { margin: 0; color: var(--text-3); font-size: 13.5px; white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 600; }
.top-search { position: relative; margin-left: auto; width: min(360px, 40vw); }
.top-search .i { position: absolute; left: 12px; top: 11px; width: 17px; height: 17px; color: var(--text-3); }
.top-search input { height: 38px; padding-left: 38px; background: var(--surface); }
.content { width: 100%; max-width: 1320px; padding: 28px 32px 56px; margin: 0 auto; }

/* Page heads */
.page-head { margin-bottom: 22px; }
.page-head h1, .content > h1, .sheet h1 {
  font-family: var(--display); font-weight: 800;
  font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; margin: 0;
}

/* Hero */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: center;
  padding: 34px 36px;
  background: var(--hero); color: #fff;
  border-radius: 20px; box-shadow: var(--shadow-lg);
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1;
  right: -120px; bottom: -220px; width: 520px; height: 520px;
  border-radius: 50%; border: 46px solid rgba(255, 255, 255, 0.05);
}
.hero-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12.5px; font-weight: 500; color: #e6f4ff;
}
.hero-chip .i { width: 14px; height: 14px; }
.hero h1 {
  font-family: var(--display); font-weight: 800;
  font-size: 34px; line-height: 1.12; letter-spacing: -0.025em;
  margin: 16px 0 10px; color: #fff;
}
.hero p { margin: 0; max-width: 56ch; color: #cfe3ff; font-size: 15.5px; }
.hero p b { color: #fff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.next-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px; color: #fff;
  backdrop-filter: blur(12px);
  transition: transform 0.2s, background 0.2s;
}
.next-card:hover { text-decoration: none; background: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }
.next-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.next-top .mono { color: #bcd6ff; }
.next-count { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; color: #cfe3ff; font-weight: 500; }
.next-count b {
  font-family: var(--display); font-weight: 800; font-size: 64px;
  line-height: 1; letter-spacing: -0.04em; color: #fff;
}
.meter { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.16); overflow: hidden; margin: 4px 0 8px; }
.meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4dbdff, #ffb86b, #ff6b6b); }
.next-title { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.3; }
.next-meta { color: #bcd6ff; font-size: 13px; }
.next-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 600; font-size: 13.5px; color: #fff; }
.next-go .i { width: 16px; height: 16px; transition: transform 0.2s; }
.next-card:hover .next-go .i { transform: translateX(3px); }

/* Pills & tags */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--neutral-soft); color: var(--text-2);
}
.pill .i { width: 13px; height: 13px; }
.pill.urgent { background: var(--danger-soft); color: var(--danger); }
.pill.soon { background: var(--warning-soft); color: var(--warning); }
.pill.later { background: var(--success-soft); color: var(--success); }
.pill.closed { background: var(--neutral-soft); color: var(--text-3); }
.next-card .pill { background: rgba(255, 255, 255, 0.92); }
.next-card .pill.urgent { color: #c81e1e; }
.next-card .pill.soon { color: #b45309; }
.next-card .pill.later { color: #0b8a5f; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand-text);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin: 22px 0; }
.kpi {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto;
  column-gap: 14px; align-items: center;
  padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.kpi:hover { transform: translateY(-2px); }
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-text);
}
.kpi .kpi-icon { grid-row: 1 / span 2; }
.kpi-icon .i { width: 21px; height: 21px; }
.kpi-icon.danger { background: var(--danger-soft); color: var(--danger); }
.kpi-icon.warning { background: var(--violet-soft); color: var(--violet); }
.kpi-icon.success { background: var(--success-soft); color: var(--success); }
.kpi-icon.muted { background: var(--neutral-soft); color: var(--text-3); }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--text-2); align-self: end; }
.kpi-value {
  font-family: var(--display); font-weight: 800; font-size: 30px;
  line-height: 1.1; letter-spacing: -0.02em; align-self: start;
}
.kpi-foot { grid-column: 1 / -1; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--text-3); }

/* Cards & grid */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }
.card {
  min-width: 0;
  padding: 20px 22px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 16.5px; letter-spacing: -0.01em; }
.card-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.link .i { width: 15px; height: 15px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 10px; text-align: center; color: var(--text-3); }
.empty-state p { margin: 0; }

/* Table */
.table { margin: 0 -22px; }
.tr {
  display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.3fr) 130px 120px;
  gap: 16px; align-items: center;
  padding: 13px 22px; border-top: 1px solid var(--border);
  color: inherit; text-decoration: none; transition: background 0.15s;
}
a.tr:hover { background: var(--surface-2); text-decoration: none; }
a.tr:hover .t-title { color: var(--brand-text); }
.tr.th { padding-top: 9px; padding-bottom: 9px; background: var(--surface-2); font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.t-notice { display: flex; align-items: center; gap: 12px; min-width: 0; }
.t-notice > span:last-child { min-width: 0; }
.t-avatar {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-text);
  font-family: var(--display); font-weight: 800;
}
.t-avatar.muted { background: var(--neutral-soft); color: var(--text-3); }
.t-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 600; line-height: 1.35; transition: color 0.15s; }
.t-sub { display: block; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.t-date { font-size: 13px; font-weight: 500; }
.t-date small { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; padding: 6px 0; }
.donut {
  width: 150px; height: 150px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: conic-gradient(
    var(--donut-1) 0 var(--p1),
    var(--donut-2) var(--p1) var(--p2),
    var(--donut-3) var(--p2) var(--p3),
    var(--donut-4) var(--p3) 100%);
}
.donut span {
  width: 104px; height: 104px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--surface); font-size: 12px; color: var(--text-3);
}
.donut b { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1; color: var(--text); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; min-width: 130px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.legend b { margin-left: auto; color: var(--text); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot.c1 { background: var(--donut-1); }
.dot.c2 { background: var(--donut-2); }
.dot.c3 { background: var(--donut-3); }
.dot.c4 { background: var(--donut-4); }

/* Timeline */
.legend-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.swatch { width: 14px; height: 8px; border-radius: 3px; background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); display: inline-block; }
.cal-track { position: relative; height: 150px; margin: 6px 4px 0; }
.cal-soon { position: absolute; left: 0; top: 0; height: 46px; background: var(--warning-soft); border-radius: 8px 0 0 8px; }
.cal-line { position: absolute; left: 0; right: 0; top: 46px; height: 2px; background: var(--border-strong); border-radius: 2px; }
.cal-today, .cal-tick { position: absolute; top: 0; height: 46px; }
.cal-today { border-left: 2px dashed var(--brand-text); }
.cal-today span {
  position: absolute; top: 6px; left: 6px;
  padding: 1px 7px; border-radius: 6px;
  background: var(--brand); color: var(--brand-ink);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.cal-tick { top: 30px; height: 16px; border-left: 1px solid var(--border-strong); }
.cal-tick span { position: absolute; top: -20px; left: -16px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.cal-track ol { list-style: none; margin: 0; padding: 0; }
.pin { position: absolute; top: 40px; width: 210px; }
.pin::before {
  content: ""; display: block;
  width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  background: var(--brand); border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--brand);
}
.pin.soon::before { background: var(--warning); box-shadow: 0 0 0 2px var(--warning), 0 0 0 7px var(--warning-soft); }
.pin::after { content: ""; position: absolute; left: 0; top: 16px; height: 10px; border-left: 1px dashed var(--text-3); }
.pin.lane-1::after { height: 52px; }
.pin a { display: block; padding: 22px 0 0 0; margin-left: -10px; color: inherit; text-decoration: none; }
.pin.lane-1 a { padding-top: 64px; }
.pin a > span { background: var(--surface); }
.pin.flip { transform: translateX(-100%); text-align: right; }
.pin.flip::before { margin-left: calc(100% - 7px); }
.pin.flip::after { left: auto; right: 0; }
.pin.flip a { margin-left: 0; margin-right: -10px; }
.pin-date { display: block; font-size: 12.5px; font-weight: 700; color: var(--brand-text); }
.pin.soon .pin-date { color: var(--warning); }
.pin-name { display: block; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin a:hover .pin-name { color: var(--text); }

/* Keyword bars */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; margin-bottom: 6px; }
.bar-label b { font-weight: 600; }
.bar-track { display: block; height: 8px; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--donut-1), var(--donut-3)); }
:root[data-theme="dark"] .bar-track span { background: linear-gradient(90deg, #2b6fd6, #4dbdff); }

/* Simple list */
.simple-list { list-style: none; margin: 0 -22px; padding: 0; }
.simple-list a {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 22px; border-top: 1px solid var(--border); color: inherit;
}
.simple-list a:hover { background: var(--surface-2); text-decoration: none; }

/* Summary card */
.sum-date { margin: 0; font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.sum-from { display: flex; align-items: center; gap: 6px; margin: 4px 0 14px; color: var(--text-3); font-size: 13px; }
.sum-from .i { width: 15px; height: 15px; }
.sum-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sum-stats div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.sum-stats span { display: block; font-size: 12px; color: var(--text-3); }
.sum-stats b { font-family: var(--display); font-size: 22px; font-weight: 800; }
.callout { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 500; }
.callout .i { width: 16px; height: 16px; }
.callout.success { background: var(--success-soft); color: var(--success); }
.callout.warning { background: var(--warning-soft); color: var(--warning); }

/* Bids list */
.tabs {
  display: inline-flex; gap: 4px; margin: 0 0 16px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.tabs a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 9px;
  color: var(--text-2); font-weight: 500; font-size: 13.5px; text-decoration: none;
}
.tabs a:hover { background: var(--surface-2); color: var(--text); }
.tabs a.on { background: var(--brand); color: var(--brand-ink); }
.tabs span { padding: 0 7px; border-radius: 99px; background: var(--neutral-soft); font-size: 12px; color: inherit; }
.tabs a.on span { background: rgba(255, 255, 255, 0.2); }
.search { max-width: 360px; margin: 0 0 18px; }
.rows {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.bid {
  display: grid; grid-template-columns: 4px minmax(0, 1fr) 150px 100px;
  gap: 18px; align-items: center;
  padding: 16px 20px 16px 0; border-top: 1px solid var(--border);
  color: inherit; text-decoration: none; transition: background 0.15s;
}
.bid:first-child { border-top: 0; }
.bid:hover { background: var(--surface-2); text-decoration: none; }
.bid:hover .bid-title { color: var(--brand-text); }
.bar { align-self: stretch; background: var(--brand); border-radius: 0 4px 4px 0; }
.bar.moss { background: var(--sky); }
.bid-title { display: block; font-weight: 600; font-size: 15px; margin: 2px 0; }
.buyer { display: block; color: var(--text-3); font-size: 13px; }
.when { margin: 0; font-size: 13.5px; font-weight: 500; }
.when.soon, .when.soon .clock { color: var(--warning); }
.when.closed { color: var(--text-3); }
.clock { display: block; color: var(--text-3); font-size: 12px; font-weight: 400; }
.stamp-mini {
  justify-self: start; margin: 0;
  padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
  background: var(--success-soft); color: var(--success);
}
.stamp-mini.passed, .stamp-mini.ignored, .stamp-mini.set_aside { background: var(--neutral-soft); color: var(--text-3); }
.stamp-mini.review, .stamp-mini.pending { background: var(--warning-soft); color: var(--warning); }
.stamp-mini.error { background: var(--danger-soft); color: var(--danger); }
.stamp-mini.processed { background: var(--brand-soft); color: var(--brand-text); }
.empty {
  padding: 48px 20px; text-align: center; color: var(--text-3);
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty svg { width: 64px; height: 48px; fill: none; stroke: var(--text-3); stroke-width: 1.4; margin: 0 auto 10px; }

/* Bid sheet */
.sheet { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.sheet > div {
  padding: 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.sheet-side { position: sticky; top: 84px; }
.sheet h1 { font-size: 26px; margin-bottom: 4px; }
.sheet-num { margin: 12px 0 16px; font-size: 13px; }
.sheet-buyer { margin: 0 0 20px; font-size: 15px; }
.stamp {
  display: inline-block; margin: 0;
  padding: 4px 12px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600;
  background: var(--success-soft); color: var(--success);
}
.stamp.passed, .stamp.set_aside { background: var(--neutral-soft); color: var(--text-2); }
.stamp.review { background: var(--warning-soft); color: var(--warning); }
.hits { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.hits li { padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.where { display: block; color: var(--text-2); font-size: 12.5px; font-weight: 400; }
.reason { margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.reason p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.reason footer { margin-top: 8px; color: var(--text-3); font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; align-items: center; }
.actions form { margin: 0; }
.facts {
  display: grid; grid-template-columns: 170px minmax(0, 1fr); margin: 0 0 20px;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.facts dt, .facts dd { margin: 0; padding: 10px 14px; border-top: 1px solid var(--border); }
.facts dt:first-of-type, .facts dd:first-of-type { border-top: 0; }
.facts dt { background: var(--surface-2); font-size: 13px; font-weight: 500; color: var(--text-3); }
.facts dd { font-weight: 500; overflow-wrap: anywhere; }
.cats { color: var(--text-2); margin: 0 0 18px; }
.sheet h2.kicker { margin: 22px 0 8px; font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--text); }
.prose { max-width: 75ch; white-space: pre-wrap; margin: 0; color: var(--text-2); line-height: 1.65; }
.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.docs li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.docs .i { color: var(--brand-text); }

/* Keywords / Inbox / Summaries */
.add-word, .paste, .mail-form {
  display: grid; gap: 16px; margin: 0 0 20px; padding: 20px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.add-word { grid-template-columns: 1fr 1.6fr auto; align-items: end; }
.paste { max-width: 760px; }
.stack, .sender-rules { display: grid; gap: 14px; }
.words {
  list-style: none; margin: 0 0 20px; padding: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.words li { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border); }
.words li:first-child { border-top: 0; }
.term { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.words:not(.mailbox-list) .term::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sky); }
.note { margin: 2px 0 0; color: var(--text-3); font-size: 13.5px; }
.mailbox-list li { align-items: start; }
.mailbox-list .sender-rules { margin-top: 12px; max-width: 460px; }
.recheck { margin: 0 0 20px; }
.fields { display: grid; grid-template-columns: 1.2fr 0.8fr 1fr; gap: 16px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
fieldset { display: grid; gap: 12px; margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
legend { padding: 0 6px; font-family: var(--display); font-weight: 700; color: var(--text); font-size: 13.5px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.check input { width: 16px; }
.check span { margin: 0; font-size: 14px; }
.digest {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
.digest:first-child { border-top: 0; }
.digest p { margin: 0; }
.digest .num { text-align: right; }

/* Powered by Prudle Labs (same pattern as Prudle Triage) */
.side .powered { margin-top: auto; }
.powered {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 14px 10px 12px; text-decoration: none;
  border-top: 1px solid var(--side-border);
}
.powered:hover { text-decoration: none; }
.powered:hover .powered-brand { opacity: 0.9; }
.powered-label { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--side-muted); }
.powered-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; letter-spacing: -0.02em; color: #fff; line-height: 1.1; }
.powered-brand img { display: block; height: 22px; width: auto; object-fit: contain; }
.prudle-accent { color: #009bd8; }
.side .side-foot { margin-top: 0; }
.powered-row { flex-direction: row; align-items: center; gap: 10px; padding: 0; border: 0; }
.powered-row .powered-label { color: #a9c4ef; }
.powered-row .prudle-accent { color: #4dc4f5; }

/* Sign in */
.gate { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.gate-brand {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 44px 52px; background: var(--hero); color: #fff;
}
.gate-brand::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, transparent, #000 60%);
}
.gate-brand::after {
  content: ""; position: absolute; z-index: -1; right: -180px; top: -160px;
  width: 560px; height: 560px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, 0.05);
}
.gate-top { display: flex; align-items: center; gap: 14px; }
.gate-logo { width: 60px; height: 60px; padding: 7px; border-radius: 16px; background: #fff; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25); flex: none; }
.gate-name { display: block; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; line-height: 1.15; }
.gate-product { display: block; font-size: 13.5px; font-weight: 500; color: var(--sky); }
.gate-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.gate-pitch h2 {
  font-family: var(--display); font-weight: 800; font-size: 36px; line-height: 1.15;
  letter-spacing: -0.025em; margin: 18px 0 24px; max-width: 18ch;
}
.gate-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.gate-pitch li { display: flex; align-items: center; gap: 12px; color: #d8e8ff; }
.gate-pitch li .i { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.12); color: #fff; }
.gate-legal { margin: 0; font-size: 12.5px; color: #a9c4ef; }
.gate-form { position: relative; display: grid; place-items: center; padding: 40px 24px; }
.gate-card { width: 100%; max-width: 400px; }
.gate-card h1 { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.02em; margin: 0; }
.gate-card .lede { margin-bottom: 26px; }
.seed-form { margin-top: 12px; }
.gate-theme { position: absolute; top: 20px; right: 20px; }

/* Responsive */
@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr 1fr; }
  .grid .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 6px; padding: 12px 16px;
  }
  .brand { padding: 0; margin-right: auto; }
  .side-label { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 7px 10px; font-size: 13px; }
  .nav a.on::before { display: none; }
  .nav { order: 2; }
  .side-foot { order: 1; margin: 0; padding: 0; border: 0; }
  .side-foot .avatar, .who { display: none; }
  .side .powered { display: none; }
  .topbar { padding: 0 16px; height: 58px; }
  .crumb { display: none; }
  .top-search { width: auto; flex: 1; }
  .content { padding: 18px 16px 40px; }
  .hero { padding: 24px 20px; border-radius: 16px; }
  .hero h1 { font-size: 26px; }
  .grid, .sheet, .fields, .split, .add-word, .gate { grid-template-columns: 1fr; }
  .tr { grid-template-columns: minmax(0, 1fr) auto; }
  .tr.th, .t-tags, .t-date { display: none; }
  .bid { grid-template-columns: 4px minmax(0, 1fr) auto; }
  .bid .when { display: none; }
  .sheet-side { position: static; }
  .gate-brand { padding: 28px 24px; }
  .gate-pitch h2 { font-size: 26px; }
  .tabs { display: flex; overflow-x: auto; max-width: 100%; }
  .digest { grid-template-columns: 1fr; gap: 6px; }
  .digest .num { text-align: left; }
}
@media (max-width: 520px) {
  .kpis { gap: 12px; }
  .kpi { padding: 14px; grid-template-columns: 1fr; }
  .kpi .kpi-icon { grid-row: auto; width: 36px; height: 36px; margin-bottom: 8px; }
  .kpi-foot { display: none; }
  .cal-card { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.fine:empty { display: none; }
.paste > button, .mail-form > button, .sender-rules > button { justify-self: start; }

/* Keywords page */
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.page-head-row form { margin: 0; flex: none; }
.kpis-compact { margin-top: 0; }
.kpis-compact .kpi { grid-template-rows: auto auto; padding: 16px 18px; }
.kpis-compact .kpi-value { font-size: 26px; }
.callout-bar {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 18px; padding: 14px 16px;
  background: var(--warning-soft);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
  border-radius: var(--radius);
}
.callout-bar .kpi-icon { background: var(--surface); color: var(--warning); flex: none; }
.callout-bar div { flex: 1; min-width: 0; }
.callout-bar b { display: block; }
.callout-bar p { margin: 2px 0 0; color: var(--text-2); font-size: 13.5px; }
.callout-bar form { margin: 0; flex: none; }
.kw-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.kw-side { display: grid; gap: 18px; position: sticky; top: 84px; }
.kw-items { list-style: none; margin: 0 -22px -20px; padding: 0; }
.kw-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px;
  padding: 16px 22px; border-top: 1px solid var(--border);
  transition: background 0.15s;
}
.kw-item:hover { background: var(--surface-2); }
.kw-item.paused .kw-term, .kw-item.paused .kw-note { color: var(--text-3); }
.kw-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kw-term { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.kw-note { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; max-width: 70ch; }
.kw-note.empty-note { color: var(--text-3); font-style: italic; }
.kw-hits { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.kw-bid {
  display: inline-flex; align-items: center; gap: 5px; max-width: 320px;
  padding: 3px 9px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kw-bid .i { width: 14px; height: 14px; flex: none; color: var(--brand-text); }
.kw-bid:hover { color: var(--brand-text); border-color: var(--brand-text); text-decoration: none; }
.kw-actions { display: flex; align-items: flex-start; gap: 6px; }
.kw-actions form { margin: 0; }
.button.small { height: 38px; padding: 0 12px; font-size: 13px; }
.icon-btn .i { width: 17px; height: 17px; }
.icon-btn.danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); }
.kw-edit-form {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 12px 14px;
  margin-top: 8px; padding: 16px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 12px;
}
.kw-edit-form[hidden] { display: none; }
.kw-edit-form textarea { min-height: 42px; }
.kw-edit-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.tips ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tips li { position: relative; padding-left: 16px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.tips li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--sky); }
.tips b { color: var(--text); font-weight: 600; }
.tips .card-head h2 { display: flex; align-items: center; gap: 8px; }
.tips .card-head .i { color: var(--warning); }
@media (max-width: 1100px) {
  .kw-layout { grid-template-columns: 1fr; }
  .kw-side { position: static; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .page-head-row { flex-direction: column; align-items: flex-start; }
  .kw-side { grid-template-columns: 1fr; }
  .kw-item { grid-template-columns: 1fr; }
  .kw-edit-form { grid-template-columns: 1fr; }
  .callout-bar { flex-wrap: wrap; }
}

/* Bids table */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; }
.toolbar .tabs { margin: 0; }
.toolbar-tools { display: flex; gap: 10px; align-items: center; margin: 0; }
.field-icon { position: relative; width: 300px; }
.field-icon .i { position: absolute; left: 12px; top: 12px; width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.field-icon input { padding-left: 38px; }
.select-wrap select {
  width: auto; padding: 0 34px 0 12px; font-weight: 500; font-size: 13.5px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d8ca5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.table-card { padding: 0; overflow: hidden; }
.table-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.table-meta p { margin: 0; font-size: 13.5px; color: var(--text-2); }
.table-meta b { color: var(--text); font-weight: 600; }
.table-flag { display: inline-flex; align-items: center; gap: 6px; color: var(--warning) !important; font-weight: 500; }
.table-flag .i { width: 15px; height: 15px; }
.bt-row {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.3fr) 124px 128px 96px 20px;
  gap: 18px; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--border);
  color: inherit; text-decoration: none;
  transition: background 0.12s;
}
.bt-row:first-child { border-top: 0; }
a.bt-row:hover { background: var(--surface-2); text-decoration: none; }
a.bt-row:hover .bt-title { color: var(--brand-text); }
a.bt-row:hover .bt-go { color: var(--brand-text); transform: translateX(2px); }
.bt-head {
  padding-top: 10px; padding-bottom: 10px;
  background: var(--surface-2);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3);
}
.bt-notice { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bt-text { min-width: 0; }
.bt-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--text);
  transition: color 0.12s;
}
.bt-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; min-width: 0; font-size: 12.5px; color: var(--text-3); }
.bt-meta > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-meta .mono { font-size: 11.5px; flex: 0 1 auto; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); flex: none; }
.bt-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag.more { background: var(--neutral-soft); color: var(--text-2); }
.bt-date { font-size: 13.5px; font-weight: 500; color: var(--text); }
.bt-date span, .bt-date small { display: block; }
.bt-date small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-top: 1px; }
.muted-dash { color: var(--text-3); font-size: 13px; }
.bt-go { color: var(--text-3); display: flex; transition: transform 0.15s, color 0.15s; }
.bt-go .i { width: 17px; height: 17px; }
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.status.matched { color: var(--success); }
.status.matched::before { background: var(--success); }
.status.review { color: var(--warning); }
.status.review::before { background: var(--warning); }
.status.passed, .status.set_aside { color: var(--text-3); }
.table-card .empty-state { padding: 48px 20px; }
.table-card .empty-state p { color: var(--text-2); line-height: 1.6; }
.table-card .empty-state b { color: var(--text); }
@media (max-width: 1100px) {
  .bt-row { grid-template-columns: minmax(0, 1fr) 120px 120px 20px; }
  .bt-row > :nth-child(2), .bt-row > :nth-child(5) { display: none; }
}
@media (max-width: 860px) {
  .toolbar-tools { width: 100%; }
  .field-icon { flex: 1; width: auto; }
  .bt-head { display: none; }
  .bt-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px 16px; }
  .bt-row > :nth-child(3), .bt-row > :nth-child(6) { display: none; }
}
.tabs a { white-space: nowrap; flex: none; }
@media (max-width: 860px) {
  .bt-meta .mono, .bt-meta .dot-sep { display: none; }
}

/* Bid detail */
.i.flip-x { transform: scaleX(-1); }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.back-link .i { width: 16px; height: 16px; }
.back-link:hover { color: var(--brand-text); text-decoration: none; }
.bid-hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px 24px 18px;
}
.bid-hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--donut-1), var(--sky)); }
.bid-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.bid-num { color: var(--text-3); }
.bid-hero h1 {
  margin: 10px 0 6px; max-width: none;
  font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.22; letter-spacing: -0.02em;
}
.bid-buyer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; color: var(--text-2); font-size: 15px; }
.bid-buyer .i { width: 16px; height: 16px; color: var(--brand-text); }
.bid-hero-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.bid-hero-bar-links {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-width: 0; flex: 1 1 240px;
}
.bid-hero-bar-links .button { height: 40px; padding: 0 16px; flex: none; }
.hero-link-meta { font-size: 13px; color: var(--text-3); }
.hero-link-meta.muted { font-style: italic; }
.hero-inline-link {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600;
}
.hero-inline-link .i { width: 14px; height: 14px; }
.bid-hero-bar-tools {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px;
  flex: 1 1 280px;
}
.link-host { font-size: 12.5px; color: var(--text-3); text-align: right; max-width: 240px; }
.bid-hero-secondary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.bid-hero-secondary form { margin: 0; }
.bid-hero-secondary button { height: 36px; padding: 0 12px; font-size: 13px; }
.bid-hero + .callout-bar { margin-top: 18px; }
.date-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin: 18px 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.date-cell { padding: 16px 20px; border-left: 1px solid var(--border); }
.date-cell:first-child { border-left: 0; }
.date-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.date-label .i { width: 15px; height: 15px; }
.date-value { display: block; margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--text); }
.date-cell.hot { background: var(--warning-soft); }
.date-cell.hot .date-label, .date-cell.hot .date-value { color: var(--warning); }
.date-cell-cost { background: var(--violet-soft); }
.date-cell-cost .date-label { color: var(--violet); }
.date-sub { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.cost-strip-link { font-family: var(--mono); color: var(--violet); text-decoration: none; }
.cost-strip-link:hover { text-decoration: underline; }
.bid-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.bid-main, .bid-side { display: grid; gap: 18px; min-width: 0; }
.bid-side { position: sticky; top: 112px; align-self: start; max-height: calc(100vh - 124px); overflow: auto; }
.bid-main .prose { max-width: 72ch; font-size: 15px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; }
.cat-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.doc-list { list-style: none; margin: 0 -22px -20px; padding: 0; }
.doc-list li { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--border); }
.doc-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--danger-soft); color: var(--danger); }
.doc-icon .i { width: 17px; height: 17px; }
.doc-name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; margin: 0; }
.info-grid dt, .source-list dt { font-size: 12px; font-weight: 500; color: var(--text-3); }
.info-grid dd { margin: 3px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.hit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hit-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); }
.hit-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--surface); color: var(--brand-text); }
.hit-icon .i { width: 16px; height: 16px; }
.hit-list b { display: block; color: var(--brand-text); font-weight: 600; }
.hit-list small { display: block; font-size: 12px; color: var(--text-2); }
.why {
  margin: 14px 0 0; padding: 12px 14px;
  border-left: 3px solid var(--sky); border-radius: 0 10px 10px 0;
  background: var(--surface-2); color: var(--text-2); font-size: 13.5px; line-height: 1.6;
}
.confidence { margin-top: 16px; }
.source-list { display: grid; gap: 0; margin: 0; }
.source-list div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.source-list div:first-child { border-top: 0; padding-top: 0; }
.source-list dd { margin: 0; font-size: 13.5px; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .bid-layout { grid-template-columns: 1fr; }
  .bid-side { position: static; }
  .date-strip { grid-template-columns: 1fr 1fr; }
  .date-cell:nth-child(3) { border-left: 0; }
  .date-cell:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 860px) {
  .bid-hero { padding: 18px 16px 16px; }
  .bid-hero h1 { font-size: 22px; }
  .bid-hero-bar { flex-direction: column; align-items: stretch; }
  .bid-hero-bar-tools { justify-content: flex-start; }
  .link-host { text-align: left; }
  .info-grid { grid-template-columns: 1fr; }
  .doc-list .link { display: none; }
}

/* Tender documents & analysis */
.i.flip-y { transform: scaleY(-1); }
.docs-card .card-head { margin-bottom: 12px; }
.live-dot .i { animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dropzone { display: grid; gap: 10px; margin: 0 0 6px; }
.dropzone-area {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 14px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone-area:hover, .dropzone-area.over { border-color: var(--sky); background: var(--sky-soft); }
.dropzone-area b { font-size: 13.5px; }
.dropzone-area small { font-size: 12px; color: var(--text-3); }
.dropzone-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; height: 100%; }
.dropzone-picked { margin: 0; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.file-list { list-style: none; margin: 12px -22px -20px; padding: 0; }
.file-list.flat { margin-top: 0; }
.file-list > li { border-top: 1px solid var(--border); }
.file-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 22px; color: inherit; }
.file-row:hover { background: var(--surface-2); text-decoration: none; }
.file-row.child { padding-left: 44px; }
.file-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--neutral-soft); color: var(--text-2); }
.file-icon .i { width: 16px; height: 16px; }
.file-icon.big { width: 46px; height: 46px; border-radius: 12px; }
.file-icon.big .i { width: 22px; height: 22px; }
.file-icon.k-pdf { background: var(--danger-soft); color: var(--danger); }
.file-icon.k-docx, .file-icon.k-doc, .file-icon.k-rtf { background: var(--brand-soft); color: var(--brand-text); }
.file-icon.k-xlsx, .file-icon.k-xls, .file-icon.k-csv { background: var(--success-soft); color: var(--success); }
.file-icon.k-zip { background: var(--warning-soft); color: var(--warning); }
.file-icon.k-image { background: var(--violet-soft); color: var(--violet); }
.file-text { min-width: 0; }
.file-name { display: block; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { display: block; font-size: 12px; color: var(--text-3); margin: 1px 0 0; }

.analysis-tools { display: flex; align-items: center; gap: 8px; }
.analysis-tools form { margin: 0; }
.small-btn { height: 34px !important; padding: 0 12px !important; font-size: 13px !important; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.cost-chip { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; padding: 4px 10px; border-radius: 99px; background: var(--violet-soft); color: var(--violet); font-size: 12.5px; font-weight: 600; }
.cost-chip-inline { max-width: 100%; }
.cost-chip .i { width: 14px; height: 14px; flex: none; }
.cost-chip-main { font-family: var(--mono); font-weight: 700; color: var(--violet); }
.cost-chip-sub { font-size: 11px; font-weight: 600; color: var(--text-2); opacity: 0.95; }
.cost-link { font-size: 12px; font-weight: 600; color: var(--brand-text); white-space: nowrap; }
.cost-link:hover { text-decoration: underline; }
.bid-hero-cost-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; justify-content: flex-start; margin: 0; }
.hero-analyse-form { margin: 0; }
.card-head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; }
.analysis-tools .cost-link { margin-left: 2px; }
.analysis-wait { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 10px; background: var(--sky-soft); color: var(--text-2); font-size: 13.5px; }
.analysis-source-note { margin: 6px 0 0; font-size: 12.5px; color: var(--text-3); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--brand-text); animation: spin 0.8s linear infinite; flex: none; }
.bid-section-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 4px 14px;
  margin-bottom: 4px;
  position: sticky;
  top: 56px;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bid-section-nav::-webkit-scrollbar { display: none; }
.bid-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.bid-nav-link .i { width: 15px; height: 15px; opacity: 0.85; }
.bid-nav-link:hover { border-color: var(--brand-text); color: var(--brand-text); text-decoration: none; }
.bid-nav-link.active { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand-text) 35%, var(--border)); color: var(--brand-text); }
.bid-nav-badge {
  min-width: 18px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--neutral-soft);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.bid-nav-link.active .bid-nav-badge { background: var(--surface); }
.bid-nav-link.muted-nav { cursor: default; opacity: 0.85; }

.brief-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.brief-kpi {
  flex: 1 1 100px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  text-align: center;
}
.brief-kpi.warn { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); background: color-mix(in srgb, var(--warning-soft) 50%, var(--surface)); }
.brief-kpi-val { display: block; font-family: var(--display); font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; }
.brief-kpi-label { display: block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }

.text-btn {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-btn:hover {
  opacity: 0.85;
  background: none;
  border-color: transparent;
  box-shadow: none;
}

.analysis-summary.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
}
.analysis-summary.clamped.expanded {
  display: block;
  -webkit-line-clamp: unset;
}

.profile-panel {
  border-top: 1px solid var(--border);
  margin: 0 -22px;
  padding: 0 22px;
}
.profile-panel:first-of-type { border-top: 0; }
.profile-panel > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  cursor: pointer;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  list-style: none;
}
.profile-panel > summary::-webkit-details-marker { display: none; }
.profile-panel > summary::after {
  content: "";
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.profile-panel[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.profile-panel > summary .i { width: 16px; height: 16px; color: var(--brand-text); }
.panel-count {
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--neutral-soft);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}
.profile-panel-body { padding: 0 0 16px; }
.card-head.compact { padding-bottom: 8px; }

.contact-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.contact-card {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.contact-card header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.contact-title { margin: 0 0 8px; font-size: 13px; color: var(--text-2); }
.contact-channels { margin: 8px 0 10px; display: grid; gap: 8px; }
.contact-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px 10px; align-items: start; font-size: 13px; }
.contact-row dt {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-3);
}
.contact-row dt .i { width: 13px; height: 13px; }
.contact-row dd { margin: 0; min-width: 0; }
.contact-email {
  display: inline-block;
  max-width: 100%;
  color: var(--brand-text);
  font-weight: 600;
  word-break: break-all;
  line-height: 1.45;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.contact-email:hover { opacity: 0.88; }
.contact-phone { color: var(--text); font-weight: 500; word-break: break-word; }
.contact-missing { margin: 6px 0 0; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.side-contact-card .contact-channels { margin-bottom: 0; }
.side-contact-card .contact-row { grid-template-columns: 58px minmax(0, 1fr); }

.action-deck { scroll-margin-top: 120px; }
.questions-export {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.question-list.compact li { padding: 10px 12px; }

.matrix-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.matrix-search {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0;
}
.matrix-search .i { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.matrix-search input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.matrix-search input:focus { outline: none; box-shadow: var(--ring); border-color: var(--brand-text); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.filter-chip:hover {
  background: var(--surface-2);
  border-color: var(--brand-text);
  color: var(--brand-text);
  box-shadow: none;
}
.filter-chip.on { background: var(--brand-soft); border-color: var(--brand-text); color: var(--brand-text); }
.matrix-toolbar-actions { display: flex; gap: 12px; }
.matrix-empty { margin: 12px 0; padding: 14px; border-radius: 10px; background: var(--warning-soft); color: var(--warning); font-size: 13.5px; font-weight: 500; }

.sticky-jump {
  position: sticky;
  top: 108px;
  z-index: 15;
  background: var(--surface);
  padding-top: 8px;
  margin-top: -4px;
  box-shadow: 0 8px 12px -10px var(--bg);
}

details.item-group {
  margin: 0 0 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
details.item-group > summary.cat-title {
  margin: 0;
  padding: 12px 14px;
  cursor: pointer;
  scroll-margin-top: 140px;
  list-style: none;
}
details.item-group > summary.cat-title::-webkit-details-marker { display: none; }
details.item-group > summary.cat-title::after {
  content: "";
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
}
details.item-group[open] > summary.cat-title::after { transform: rotate(-135deg); }
details.item-group .item-list { padding: 0 10px 10px; }

.card-details { padding: 0; overflow: hidden; }
.card-details > summary.card-head {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  margin: 0;
}
.card-details > summary.card-head::-webkit-details-marker { display: none; }
.card-details-body { padding: 0 22px 20px; }

.side-contact-cards { display: grid; gap: 10px; }
.side-contact-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
}
.side-contact-card .block { display: block; margin-top: 4px; word-break: break-word; }
.side-contact-card b { font-size: 14px; }
.info-grid.tight { gap: 8px 12px; }
.portal-link { margin: 12px 0 0; }
.notice-contact-warn { margin-top: 10px; font-size: 12.5px; line-height: 1.45; align-items: flex-start; }
.notice-contact-warn b { font-weight: 700; }

#brief, #profile, #actions, #analysis, #documents, #contact { scroll-margin-top: 120px; }

.tender-profile { scroll-margin-top: 120px; }
.profile-facts { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 12px; }
.profile-fact { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; min-width: 120px; }
.profile-fact.wide { flex: 1 1 100%; }
.profile-fact-label { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); }
.profile-lead { margin: 0 0 10px; font-size: 14.5px; line-height: 1.6; color: var(--text); }
.profile-note { margin: 0 0 8px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.profile-note b { color: var(--text); font-weight: 600; }
.profile-note.warn { padding: 10px 12px; border-radius: 10px; background: var(--warning-soft); color: var(--text-2); }
.profile-note.warn .i { width: 14px; height: 14px; vertical-align: -2px; color: var(--warning); }
.profile-section-title { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; font-family: var(--display); font-size: 14px; font-weight: 700; color: var(--text); }
.profile-section-title .i { width: 16px; height: 16px; color: var(--brand-text); }
.profile-table-wrap { overflow-x: auto; margin: 0 -4px; }
.profile-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.profile-table th, .profile-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.profile-table th { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); }
.profile-ref-cell .ref { margin: 0; }
.date-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.date-row { padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.date-row.hot { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: color-mix(in srgb, var(--danger-soft) 35%, var(--surface)); }
.date-row-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 4px; }
.date-event { font-weight: 600; color: var(--text); }
.date-resolved { font-family: var(--mono); font-size: 12.5px; color: var(--brand-text); }
.date-written { font-size: 12.5px; }
.date-flag { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 12px; color: var(--warning); }
.date-flag .i { width: 13px; height: 13px; flex: none; }
.criteria-list, .check-list, .compact-list, .flag-list, .risk-list, .question-list { list-style: none; margin: 0; padding: 0; }
.criteria-list li, .check-list li { padding: 8px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.criteria-list li:first-child, .check-list li:first-child { border-top: 0; }
.criteria-name { font-weight: 600; margin-right: 8px; }
.criteria-points { font-family: var(--mono); font-size: 12px; padding: 2px 7px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-text); }
.check-list .check-name { font-weight: 600; margin-right: 6px; }
.compact-list li { padding: 5px 0; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.flag-list .compact { margin-bottom: 8px; padding: 10px 12px; font-size: 13px; }
.risk-list li { position: relative; padding: 6px 0 6px 16px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.risk-list li::before { content: ""; position: absolute; left: 0; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.question-list { counter-reset: q; display: grid; gap: 12px; }
.question-list li { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.question-text { margin: 0; font-weight: 600; line-height: 1.5; color: var(--text); }
.side-contact-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.side-contact-list li { padding: 8px 0; border-top: 1px solid var(--border); line-height: 1.5; }
.side-contact-list li:first-child { border-top: 0; }
.analysis-summary { margin: 0 0 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); line-height: 1.65; }
.analysis-head { align-items: flex-start; margin-bottom: 14px; }
.analysis-head-main { flex: 1; min-width: 0; }
.analysis-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13px; color: var(--text-2); }
.analysis-stats-head { margin: 8px 0 4px; }
.analysis-meta { margin: 0 !important; font-size: 13px; color: var(--text-3); }
.analysis-stats b { color: var(--text); }
.analysis-stats .muted { margin-left: auto; color: var(--text-3); font-size: 12px; }
@media (max-width: 860px) {
  .analysis-stats-head .muted { margin-left: 0; flex: 1 1 100%; }
}
.warn-text { color: var(--warning) !important; display: inline-flex; align-items: center; gap: 5px; }
.ok-text { color: var(--success); display: inline-flex; align-items: center; gap: 5px; }
.warn-text .i, .ok-text .i { width: 15px; height: 15px; }
.cat-jump { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.cat-jump a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: var(--neutral-soft); color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.cat-jump a:hover { background: var(--brand-soft); color: var(--brand-text); text-decoration: none; }
.cat-jump span { font-weight: 700; color: var(--text); }
.cat-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-family: var(--display); font-size: 14.5px; font-weight: 700; scroll-margin-top: 84px; }
.cat-title span { padding: 0 8px; border-radius: 99px; background: var(--neutral-soft); font-size: 12px; color: var(--text-2); }
.item-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.item.unverified { border-color: color-mix(in srgb, var(--warning) 40%, transparent); background: color-mix(in srgb, var(--warning-soft) 45%, var(--surface)); }
.item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.item-title { font-weight: 600; line-height: 1.4; }
.item-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge .i { width: 12px; height: 12px; }
.badge.must { background: var(--danger-soft); color: var(--danger); }
.badge.qty { background: var(--brand-soft); color: var(--brand-text); font-family: var(--mono); font-weight: 500; }
.badge.due { background: var(--warning-soft); color: var(--warning); }
.item-detail { margin: 6px 0 0; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.item-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ref {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 3px 9px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font-size: 12px;
}
.ref span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--text); }
.ref .i { width: 13px; height: 13px; color: var(--success); flex: none; }
.ref.bad .i { color: var(--warning); }
.ref:hover { border-color: var(--brand-text); text-decoration: none; }

/* Document viewer */
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.doc-head-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.doc-head h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.doc-head-actions { display: flex; align-items: center; gap: 8px; }
.doc-head-actions form { margin: 0; }
.page-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
.page-index { position: sticky; top: 84px; padding: 14px 10px; max-height: calc(100vh - 110px); overflow: auto; }
.page-index h2 { margin: 0 8px 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.page-index ol { list-style: none; margin: 0; padding: 0; }
.page-index a { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px; border-radius: 7px; color: var(--text-2); font-size: 13px; }
.page-index a:hover { background: var(--surface-2); text-decoration: none; }
.page-index small { font-size: 10.5px; color: var(--warning); font-weight: 600; }
.page-stack { display: grid; gap: 14px; min-width: 0; }
.page-card { scroll-margin-top: 84px; padding: 0; overflow: hidden; }
.page-card.is-target { box-shadow: 0 0 0 2px var(--sky), var(--shadow); }
.page-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13.5px; }
.page-card-head .link { margin-left: auto; }
.page-text { padding: 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.65; color: var(--text-2); max-height: 70vh; overflow: auto; }
.page-text mark { background: color-mix(in srgb, var(--sky) 35%, transparent); color: var(--text); border-radius: 3px; padding: 1px 2px; }

/* AI usage */
.spend-chart { display: grid; grid-template-columns: repeat(30, 1fr); align-items: end; gap: 4px; height: 160px; padding-top: 8px; }
.spend-col { height: 100%; display: flex; align-items: flex-end; }
.spend-bar { width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--sky), var(--donut-1)); }
.spend-col:hover .spend-bar { opacity: 0.8; }
.spend-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--text-3); }
.usage-rows { list-style: none; margin: 0; padding: 0; }
.usage-rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.usage-rows li:first-child { border-top: 0; }
.usage-rows small { display: block; font-size: 12px; color: var(--text-3); font-family: var(--sans); }
.usage-rows b { font-family: var(--mono); font-weight: 500; font-size: 13px; }
.usage-rows a { color: var(--text); font-weight: 500; }
.sub-head { margin: 18px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.usage-table { margin: 0 -22px -20px; }
.u-row { display: grid; grid-template-columns: 110px minmax(0, 1.2fr) minmax(0, 1.4fr) 150px 90px; gap: 12px; align-items: center; padding: 9px 22px; border-top: 1px solid var(--border); font-size: 13px; }
.u-row small { display: block; color: var(--text-3); font-size: 11.5px; }
.u-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.u-head { background: var(--surface-2); font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); }
@media (max-width: 1100px) {
  .page-layout { grid-template-columns: 1fr; }
  .page-index { position: static; max-height: 240px; }
  .u-row { grid-template-columns: 100px minmax(0, 1fr) 120px 80px; }
  .u-row > :nth-child(3) { display: none; }
}
@media (max-width: 860px) {
  .analysis-stats .muted { margin-left: 0; }
  .u-row { grid-template-columns: minmax(0, 1fr) 80px; }
  .u-row > :nth-child(1), .u-row > :nth-child(4) { display: none; }
}
.item-issue { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 12.5px; font-weight: 500; color: var(--warning); }
.item-issue .i { width: 14px; height: 14px; flex: none; }
.file-problem { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 10px; margin: -2px 0 0; padding: 0 22px 10px 64px; }
.file-problem.child { padding-left: 86px; }
.file-problem p { flex: 1 1 100%; margin: 0; font-size: 12px; line-height: 1.45; color: var(--warning); overflow-wrap: anywhere; }
.file-problem form { margin: 0 0 0 auto; flex: none; }
.retry-btn { height: 30px !important; padding: 0 10px !important; font-size: 12.5px !important; gap: 5px !important; }
.retry-btn .i { width: 14px !important; height: 14px !important; }
.docs-card .card-head form { margin: 0; }

/* Desk alerts & bid intelligence (Layer A/B) */
.alert-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.alert-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; text-decoration: none; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); max-width: 100%;
}
.alert-chip .i { width: 14px; height: 14px; flex: none; }
.alert-chip.urgent { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.alert-chip.warn { border-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.alert-chip.soon { border-color: var(--sky); background: var(--sky-soft); color: var(--brand-text); }
.decision-pill {
  font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; background: var(--surface-2);
}
.decision-pill.go { background: var(--success-soft); color: var(--success); }
.decision-pill.no_go { background: var(--danger-soft); color: var(--danger); }
.decision-pill.maybe { background: var(--warning-soft); color: var(--warning); }
.decision-grid { display: flex; flex-wrap: wrap; gap: 16px 24px; margin: 0 0 12px; }
.decision-stat-val { display: block; font-family: var(--display); font-size: 22px; font-weight: 800; }
.decision-stat-label { font-size: 12px; color: var(--text-3); font-weight: 600; }
.brief-kpi.decision-go .brief-kpi-val { color: var(--success); }
.brief-kpi.decision-no_go .brief-kpi-val { color: var(--danger); }
.brief-kpi.decision-maybe .brief-kpi-val { color: var(--warning); }
.blocker-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.blocker-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--warning); }
.theme-list { margin: 12px 0 0; padding-left: 1.2rem; color: var(--text-2); }
.outline-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 14px; }
.outline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.outline-title { font-weight: 600; }
.draft-block { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.draft-block:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.prose.compact { font-size: 14px; line-height: 1.6; margin: 0; color: var(--text-2); }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.change-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
/* Floating tender chat widget */
.tender-chat-widget {
  position: fixed; z-index: 1200;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  right: max(20px, env(safe-area-inset-right, 0px));
  pointer-events: none;
}
.tender-chat-widget > * { pointer-events: auto; }
.chat-fab {
  position: relative; z-index: 1200;
  display: inline-flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 18px 0 14px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-text), color-mix(in srgb, var(--brand-text) 70%, var(--violet)));
  color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--brand-text) 35%, transparent);
}
.chat-fab:hover { filter: brightness(1.05); box-shadow: 0 8px 28px color-mix(in srgb, var(--brand-text) 35%, transparent); }
.tender-chat-widget.is-open .chat-fab {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.tender-chat-widget.is-open .chat-fab:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
  filter: none;
}
.tender-chat-widget.is-open .chat-fab-icon .i { color: var(--brand-text); }
.chat-fab-icon .i { width: 20px; height: 20px; color: #fff; }
.chat-panel[hidden],
.chat-backdrop[hidden] {
  display: none !important;
}
.chat-backdrop {
  position: fixed; inset: 0; z-index: 1199; background: rgba(9, 21, 43, 0.35);
  backdrop-filter: blur(2px);
}
[data-theme="dark"] .chat-backdrop { background: rgba(0, 0, 0, 0.55); }
.chat-panel {
  position: absolute; right: 0; bottom: 64px; z-index: 1201;
  width: min(560px, calc(100vw - 32px));
  height: min(780px, calc(100vh - 96px));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: 0 20px 56px rgba(9, 21, 43, 0.2);
  overflow: hidden;
}
.chat-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px 14px; border-bottom: 1px solid var(--border); flex: none;
  background: var(--surface-2);
}
.chat-panel-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.chat-panel-head p { margin: 2px 0 0; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.chat-panel-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.chat-close {
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-2);
  box-shadow: none;
}
.chat-close:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}
.chat-thread {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 16px 18px; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.chat-empty { padding: 8px 0 4px; color: var(--text); font-size: 14.5px; }
.chat-empty p { margin: 0 0 12px; line-height: 1.55; }
.chat-starters { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-starter {
  font: inherit; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand-text) 30%, var(--border));
  background: var(--brand-soft); color: var(--brand-text); cursor: pointer;
}
.chat-starter:hover {
  background: var(--brand-soft);
  border-color: var(--brand-text);
  color: var(--brand-text);
  filter: brightness(0.98);
  box-shadow: none;
}
.chat-msg { display: flex; max-width: 100%; }
.chat-msg-user { justify-content: flex-end; }
.chat-msg-assistant { justify-content: flex-start; }
.chat-bubble {
  max-width: min(100%, 640px); padding: 12px 14px; border-radius: 14px;
  font-size: 15px; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--border-strong, var(--border));
  color: var(--text); box-shadow: 0 1px 0 rgba(9, 21, 43, 0.04);
}
.chat-msg-user .chat-bubble {
  background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--sky-soft) 55%, var(--brand-soft)));
  border-color: color-mix(in srgb, var(--brand-text) 35%, var(--border));
  font-weight: 600; font-size: 14.5px; color: var(--text);
}
.chat-msg-assistant .chat-bubble {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--brand-text) 12%, var(--border));
}
.chat-bubble-pending { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.chat-typing-dots {
  display: inline-flex; align-items: center; gap: 4px; height: 12px;
}
.chat-typing-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand-text);
  opacity: 0.35; animation: chat-dot 1.1s ease-in-out infinite;
}
.chat-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.chat-typing-cursor {
  display: inline-block; width: 2px; height: 1em; margin-left: 2px;
  vertical-align: text-bottom; background: var(--brand-text);
  animation: chat-cursor-blink 0.9s step-end infinite;
}
@keyframes chat-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.chat-answer {
  margin: 0; font-size: 15px; font-weight: 500; line-height: 1.65; color: var(--text);
}
.chat-answer-formatted { white-space: normal; }
.chat-answer-formatted p { margin: 0 0 10px; }
.chat-answer-formatted p:last-child { margin-bottom: 0; }
.chat-md-heading { font-weight: 800; color: var(--text); margin-top: 4px !important; }
.chat-md-h { margin: 14px 0 8px; font-size: 14px; font-weight: 800; letter-spacing: 0.02em; color: var(--brand-text); }
.chat-md-list { margin: 0 0 10px; padding-left: 1.25rem; display: grid; gap: 6px; }
.chat-md-list li { line-height: 1.55; }
.chat-md-list li strong, .chat-md-heading strong { color: var(--text); }
.chat-sources { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.chat-sources-toggle {
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 0; border: 0; background: none;
  color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px;
}
.chat-sources-toggle:hover {
  background: none;
  border-color: transparent;
  color: var(--brand-text);
  filter: brightness(0.92);
  box-shadow: none;
}
.chat-source-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chat-source-chips[hidden] { display: none !important; }
.chat-source-chip {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  padding: 7px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--brand-text) 35%, var(--border));
  background: var(--brand-soft); color: var(--brand-text);
}
.chat-source-chip:hover {
  background: var(--brand-soft);
  border-color: var(--brand-text);
  color: var(--brand-text);
  filter: brightness(0.98);
  box-shadow: none;
}
.chat-source-chip-verified { border-color: var(--success); background: color-mix(in srgb, var(--success-soft) 80%, var(--brand-soft)); }
.chat-source-modal {
  position: fixed; inset: 0; z-index: 1400; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.chat-source-modal[hidden] { display: none !important; }
.chat-source-backdrop { position: absolute; inset: 0; background: rgba(9, 21, 43, 0.45); backdrop-filter: blur(3px); }
[data-theme="dark"] .chat-source-backdrop { background: rgba(0, 0, 0, 0.6); }
.chat-source-dialog {
  position: relative; z-index: 1; width: min(920px, calc(100vw - 32px)); max-height: min(88vh, 820px);
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 24px 64px rgba(9, 21, 43, 0.22); overflow: hidden;
}
.chat-source-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.chat-source-head h3 { margin: 0; font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.chat-source-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.chat-source-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.chat-source-body {
  flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 0;
}
.chat-source-pdf { width: 100%; height: min(42vh, 420px); border: 0; border-bottom: 1px solid var(--border); background: #525659; }
.chat-source-text {
  padding: 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px;
  line-height: 1.65; color: var(--text); max-height: 40vh; overflow: auto;
}
.chat-source-text mark {
  background: color-mix(in srgb, var(--sky) 40%, transparent); color: var(--text);
  border-radius: 3px; padding: 1px 2px;
}
body.chat-source-open { overflow: hidden; }
.chat-meta {
  display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 0;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
}
.chat-meta b { font-weight: 800; text-transform: capitalize; }
.chat-confidence-high b { color: var(--success); }
.chat-confidence-medium b { color: var(--brand-text); }
.chat-confidence-low b { color: var(--warning); }
.chat-confidence-none b { color: var(--danger); }
.chat-bubble .ask-cites {
  margin: 12px 0 0; padding: 10px 12px 10px 14px; list-style: none;
  background: color-mix(in srgb, var(--sky-soft) 65%, var(--surface));
  border-left: 3px solid var(--brand-text); border-radius: 0 10px 10px 0;
  font-size: 13.5px; line-height: 1.55; color: var(--text);
}
.chat-bubble .ask-cites li { margin: 0 0 8px; }
.chat-bubble .ask-cites li:last-child { margin-bottom: 0; }
.chat-bubble .ask-cites .mono {
  display: inline-block; margin-bottom: 2px;
  font-weight: 700; font-size: 12px; color: var(--brand-text);
}
.chat-composer {
  display: flex; gap: 10px; align-items: flex-end; padding: 12px 16px 16px;
  border-top: 1px solid var(--border); flex: none; background: var(--surface);
}
.chat-composer textarea {
  flex: 1; min-height: 48px; max-height: 120px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border-strong, var(--border)); font: inherit; font-size: 14.5px;
  font-weight: 500; color: var(--text); resize: none; line-height: 1.45;
}
.chat-composer textarea::placeholder { color: var(--text-3); font-weight: 400; }
.chat-composer .button { height: 48px; flex: none; padding: 0 18px; font-size: 14px; }
@media (max-width: 620px) {
  .tender-chat-widget { right: 12px; bottom: 12px; left: 12px; }
  .chat-panel {
    position: fixed; left: 12px; right: 12px; bottom: 72px; width: auto;
    height: min(85vh, 780px);
  }
  .chat-fab-label { display: none; }
  .chat-fab { width: 56px; height: 56px; padding: 0; justify-content: center; border-radius: 50%; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
