/* ============ DPP Compass — Integra Scientific (site design language) ============ */
:root {
  --primary: #4B3F72;
  --primary-container: #34285A;
  --gold: #C5A059;
  --gold-hover: #D4B26C;
  --gold-soft: rgba(197, 160, 89, 0.10);
  --bg: #F8F9FB;
  --surface: #FFFFFF;
  --surface-low: #F2F4F6;
  --ink: #131B2C;
  --muted: #494550;
  --faint: #7a7581;
  --line: #E4E6EB;
  --line2: #D5D8DF;
  --good: #2E7D5B;
  --warn: #B08830;
  --bad: #C0392B;
  --blue: #4B3F72;
  --blue-soft: rgba(75, 63, 114, 0.10);
  --amber: var(--gold);
  --amber-soft: var(--gold-soft);
  --radius: 2px;
  --shadow: 0 8px 30px rgba(19, 27, 44, 0.08);
  --font-head: "Manrope", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 500; }

a { color: var(--gold); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- header (Integra dark bar) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--primary-container);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(19, 27, 44, 0.10);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 16px;
  min-height: 64px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none;
  font-family: var(--font-head); font-weight: 700; font-size: 1.02rem; letter-spacing: 0.2px;
}
.brand svg { flex: 0 0 auto; }
.brand .plus { color: var(--gold); }
.tagline { color: rgba(255, 255, 255, 0.6); font-size: 0.78rem; display: none; }
@media (min-width: 980px) { .tagline { display: block; } }

.tools-back {
  color: rgba(255, 255, 255, 0.8) !important; font-size: 0.7rem !important; font-weight: 600;
  text-decoration: none; text-transform: uppercase; letter-spacing: 0.15em;
  padding: 7px 14px !important; border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 0 !important;
  white-space: nowrap; transition: color .15s, border-color .15s;
}
.tools-back:hover { color: var(--gold) !important; border-color: var(--gold) !important; background: transparent !important; }

nav.tabs { margin-left: auto; display: flex; gap: 2px; flex-wrap: wrap; }
nav.tabs button {
  appearance: none; border: 0; border-bottom: 1px solid transparent; background: transparent;
  color: rgba(255, 255, 255, 0.75); font-family: var(--font-body); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  padding: 9px 13px; cursor: pointer; border-radius: 0;
  transition: color .2s, border-color .2s;
}
nav.tabs button:hover { color: #fff; background: transparent; }
nav.tabs button[aria-selected="true"] { color: var(--gold); background: transparent; border-bottom-color: var(--gold); }
nav.tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
nav.tabs button .badge {
  display: inline-block; min-width: 18px; text-align: center;
  background: var(--gold); color: #fff; font-size: 0.66rem; font-weight: 700;
  border-radius: 0; padding: 1px 5px; margin-left: 6px; vertical-align: 1px;
}
nav.tabs button[aria-selected="true"] .badge { background: var(--gold); color: #fff; }

/* ---------- hero (dark page-header band, matches site PageShell) ---------- */
.hero-band { background: var(--primary-container); color: #fff; }
.hero { padding: 48px 0 44px; }
.hero .eyebrow {
  display: block; color: var(--gold); font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.25em; margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.8rem); line-height: 1.15; letter-spacing: -0.5px;
  font-weight: 300; max-width: 46rem;
}
.hero h1 em { font-style: italic; color: var(--gold); }
.hero p.lede { color: rgba(255, 255, 255, 0.7); max-width: 46rem; margin-top: 16px; font-weight: 300; }
.hero .privacy {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 20px;
  font-size: 0.72rem; color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase; letter-spacing: 0.1em;
  border: 1px solid rgba(255, 255, 255, 0.2); padding: 6px 14px; background: transparent;
}
.hero .privacy .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

/* ---------- stats strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 28px 0 8px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .num { font-family: var(--font-head); font-size: 1.7rem; font-weight: 300; color: var(--primary); }
.stat .lbl { color: var(--faint); font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; margin-top: 2px; }

/* ---------- sections / panels ---------- */
main { padding-bottom: 64px; }
section.panel { display: none; animation: fade .25s ease; padding-top: 26px; }
section.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.panel-head h2 { font-size: 1.45rem; font-weight: 400; letter-spacing: -0.3px; }
.panel-head .hint { color: var(--muted); font-size: 0.88rem; font-weight: 300; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px;
}

/* ---------- scoper ---------- */
.search-row { margin: 14px 0 18px; position: relative; max-width: 560px; }
.search-row input {
  width: 100%; padding: 13px 16px 13px 44px;
  background: var(--surface); border: 1px solid var(--line2); border-radius: var(--radius);
  color: var(--ink); font: inherit;
}
.search-row input::placeholder { color: var(--faint); }
.search-row input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.search-row .mag { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; cursor: pointer; text-align: left; color: var(--ink); font: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cat-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cat-card .top { display: flex; align-items: center; gap: 10px; }
.cat-card .icon { font-size: 1.4rem; }
.cat-card h3 { font-size: 1rem; font-weight: 600; }
.cat-card .dates { color: var(--muted); font-size: 0.82rem; margin-top: 8px; font-weight: 300; }
.no-results { color: var(--muted); padding: 20px 4px; }

.chip {
  display: inline-block; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; border-radius: var(--radius); padding: 4px 10px; margin-top: 12px;
}
.s-first { background: var(--gold-soft); color: #8a6d33; border: 1px solid rgba(197,160,89,.35); }
.s-horiz { background: var(--blue-soft); color: var(--primary); border: 1px solid rgba(75,63,114,.25); }
.s-sep { background: rgba(46, 125, 91, 0.08); color: var(--good); border: 1px solid rgba(46,125,91,.25); }
.s-cand { background: var(--surface-low); color: var(--muted); border: 1px solid var(--line); }
.s-excl { background: rgba(192, 57, 43, 0.06); color: var(--bad); border: 1px solid rgba(192,57,43,.25); }

/* ---------- detail drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(19, 27, 44, 0.45); z-index: 50;
  display: none;
}
.drawer-backdrop.open { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(520px, 100%);
  background: var(--surface); border-left: 1px solid var(--line2); z-index: 51;
  transform: translateX(105%); transition: transform .22s ease;
  overflow-y: auto; padding: 28px; box-shadow: -20px 0 60px rgba(19,27,44,.12);
}
.drawer.open { transform: none; }
.drawer .close-btn {
  position: absolute; top: 14px; right: 14px;
  background: var(--surface-low); border: 1px solid var(--line); color: var(--ink);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1rem;
}
.drawer .close-btn:hover { border-color: var(--gold); color: var(--gold); }
.drawer h3 { font-size: 1.3rem; font-weight: 500; display: flex; gap: 10px; align-items: center; padding-right: 40px; }
.drawer .verdict {
  margin: 14px 0; padding: 13px 15px; border-radius: var(--radius); font-weight: 600; font-size: 0.95rem;
  border: 1px solid var(--line2);
}
.v-first, .v-horizontal { background: var(--gold-soft); border-color: rgba(197,160,89,.4); }
.v-separate { background: rgba(46,125,91,.07); border-color: rgba(46,125,91,.3); }
.v-candidate { background: var(--surface-low); }
.v-excluded { background: rgba(192,57,43,.05); border-color: rgba(192,57,43,.3); }
.drawer dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0; font-size: 0.92rem; }
.drawer dt { color: var(--muted); }
.drawer dd { font-weight: 600; }
.drawer .note { color: var(--muted); font-size: 0.92rem; margin: 12px 0; }
.drawer h4 { margin: 20px 0 8px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--gold); font-family: var(--font-body); font-weight: 700; }
.drawer ul.fields { list-style: none; }
.drawer ul.fields li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.drawer ul.fields li:last-child { border-bottom: 0; }
.drawer ul.fields .fh { color: var(--muted); font-size: 0.8rem; display: block; }
.drawer .sources a { display: block; font-size: 0.85rem; margin: 5px 0; color: var(--primary); word-break: break-word; }
.drawer .watch-row { margin-top: 18px; }

/* ---------- buttons (Integra: gold, white text, square, uppercase) ---------- */
.btn {
  appearance: none; border: 0; border-radius: var(--radius); cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.15em;
  padding: 13px 22px;
  transition: background .15s, color .15s, border-color .15s, transform .12s;
}
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:active { transform: scale(0.97); }
.btn-amber { background: var(--gold); color: #fff; box-shadow: 0 6px 18px rgba(19,27,44,.10); }
.btn-amber:hover { background: var(--gold-hover); filter: none; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line2); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-blue { background: var(--primary); color: #fff; }
.btn-blue:hover { background: var(--primary-container); filter: none; }
.btn-sm { padding: 9px 15px; font-size: 0.66rem; }
.btn-danger { background: transparent; border: 1px solid rgba(192,57,43,.4); color: var(--bad); }
.btn-danger:hover { background: rgba(192,57,43,.06); }
.btn.watching { background: var(--gold-soft); color: #8a6d33; border: 1px solid rgba(197,160,89,.5); }

/* ---------- portfolio ---------- */
.port-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 18px; align-items: center; }
.port-toolbar .spacer { flex: 1; }

.overall {
  display: flex; align-items: center; gap: 18px; padding: 22px; margin-bottom: 18px;
  background: var(--primary-container); color: #fff;
  border: 0; border-radius: var(--radius);
  flex-wrap: wrap;
}
.ring { position: relative; width: 92px; height: 92px; flex: 0 0 auto; }
.ring svg { transform: rotate(-90deg); }
.ring .pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 300; font-size: 1.35rem; color: #fff;
}
.overall .desc { flex: 1; min-width: 220px; }
.overall .desc strong { font-family: var(--font-head); font-size: 1.1rem; font-weight: 500; }
.overall .desc p { color: rgba(255,255,255,.65); font-size: 0.9rem; margin-top: 4px; font-weight: 300; }

.plist { display: flex; flex-direction: column; gap: 12px; }
.prow {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow .15s;
}
.prow:hover { box-shadow: var(--shadow); }
.prow-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  width: 100%; background: none; border: 0; color: var(--ink); font: inherit; text-align: left;
}
.prow-head:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.prow-head .picon { font-size: 1.25rem; }
.prow-head .pname { font-weight: 600; }
.prow-head .psku { color: var(--faint); font-size: 0.8rem; }
.prow-head .pcat { color: var(--muted); font-size: 0.82rem; }
.prow-head .grow { flex: 1; min-width: 0; }
.bar { height: 6px; background: var(--surface-low); border-radius: 99px; overflow: hidden; width: 110px; flex: 0 0 auto; }
.bar i { display: block; height: 100%; border-radius: 99px; transition: width .3s ease; }
.pct-lbl { font-weight: 700; font-size: 0.9rem; width: 44px; text-align: right; flex: 0 0 auto; }
.chev { color: var(--faint); transition: transform .2s; flex: 0 0 auto; }
.prow.open .chev { transform: rotate(180deg); }

.prow-body { display: none; border-top: 1px solid var(--line); padding: 14px 16px 16px; background: #FCFCFD; }
.prow.open .prow-body { display: block; }
.fieldlist { display: grid; grid-template-columns: 1fr; gap: 4px; }
@media (min-width: 700px) { .fieldlist { grid-template-columns: 1fr 1fr; } }
.fieldrow {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: var(--radius);
  cursor: pointer; transition: background .12s;
}
.fieldrow:hover { background: var(--surface-low); }
.fieldrow input { margin-top: 3px; accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer; }
.fieldrow .fl { font-size: 0.92rem; }
.fieldrow .fh { color: var(--muted); font-size: 0.78rem; display: block; }
.prow-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

.empty {
  text-align: center; padding: 48px 20px; border: 1px dashed var(--line2); border-radius: var(--radius);
  color: var(--muted); background: var(--surface);
}
.empty .big { font-size: 2rem; margin-bottom: 8px; }
.empty .actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- add / csv modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(19,27,44,.5);
  display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--line2); border-radius: var(--radius);
  width: 100%; max-width: 560px; padding: 28px; position: relative; box-shadow: 0 30px 80px rgba(19,27,44,.2);
}
.modal h3 { font-size: 1.25rem; font-weight: 500; margin-bottom: 4px; }
.modal .sub { color: var(--muted); font-size: 0.88rem; margin-bottom: 16px; font-weight: 300; }
.modal label { display: block; font-size: 0.85rem; font-weight: 600; margin: 12px 0 5px; }
.modal input[type="text"], .modal select, .modal textarea {
  width: 100%; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line2);
  border-radius: var(--radius); color: var(--ink); font: inherit;
}
.modal textarea { min-height: 130px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.82rem; }
.modal input:focus, .modal select:focus, .modal textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.modal .row-btns { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal .close-btn {
  position: absolute; top: 12px; right: 12px;
  background: var(--surface-low); border: 1px solid var(--line); color: var(--ink);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
}
.modal .err { color: var(--bad); font-size: 0.85rem; margin-top: 10px; display: none; }
.modal .err.show { display: block; }
.modal .okmsg { color: var(--good); font-size: 0.85rem; margin-top: 10px; display: none; }
.modal .okmsg.show { display: block; }
.filehint { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.csv-note { background: var(--surface-low); border-radius: var(--radius); padding: 10px 12px; font-size: 0.8rem; color: var(--muted); margin-top: 10px; }
.csv-note code { color: #8a6d33; }

/* ---------- timeline ---------- */
.tl-scroll { overflow-x: auto; padding-bottom: 8px; }
.tl {
  position: relative; min-width: 760px; margin-top: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 24px;
}
.tl-years { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line2); }
.tl-years span { color: var(--faint); font-weight: 600; font-family: var(--font-body); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.15em; padding-bottom: 8px; }
.tl-now { position: absolute; top: 46px; bottom: 18px; width: 2px; background: var(--gold); z-index: 2; }
.tl-now::after {
  content: "you are here"; position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: #fff; background: var(--gold); border-radius: var(--radius); padding: 2px 8px;
}
.tl-row { position: relative; height: 58px; border-bottom: 1px dashed var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-row .tl-label {
  position: absolute; left: 0; top: 7px; font-size: 0.8rem; font-weight: 600;
  background: var(--surface-low); padding: 3px 10px; border-radius: var(--radius); z-index: 3;
  border: 1px solid var(--line);
}
.tl-track { position: absolute; left: 0; right: 0; top: 38px; height: 4px; background: var(--surface-low); border-radius: 99px; }
.tl-mile {
  position: absolute; top: 31px; width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--surface); cursor: default; z-index: 3; box-shadow: 0 1px 3px rgba(19,27,44,.2);
}
.tl-mile.done { background: var(--good); }
.tl-mile.est { background: var(--primary); }
.tl-mile.deadline { background: var(--gold); box-shadow: 0 0 0 4px rgba(197,160,89,.25); }
.tl-mile .tip {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--primary-container); color: #fff; border: 0; border-radius: var(--radius);
  padding: 7px 10px; font-size: 0.75rem; white-space: nowrap; display: none; z-index: 5;
  box-shadow: 0 8px 24px rgba(19,27,44,.25);
}
.tl-mile:hover .tip, .tl-mile:focus .tip { display: block; }
.tl-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; font-size: 0.8rem; color: var(--muted); }
.tl-legend .key { display: inline-flex; align-items: center; gap: 7px; }
.tl-legend .swatch { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.tl-empty-note { color: var(--muted); font-size: 0.88rem; margin-top: 12px; }

/* ---------- alerts ---------- */
.alert-sub { color: var(--muted); font-size: 0.9rem; margin: 6px 0 16px; max-width: 46rem; font-weight: 300; }
.watch-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.watch-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line2); border-radius: 999px; padding: 7px 14px;
  background: var(--surface); color: var(--muted); font: inherit; font-size: 0.82rem; cursor: pointer;
  transition: all .15s;
}
.watch-pill:hover { border-color: var(--gold); color: var(--ink); }
.watch-pill:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.watch-pill.on { background: var(--gold-soft); border-color: var(--gold); color: #8a6d33; font-weight: 600; }
.alist { display: flex; flex-direction: column; gap: 12px; }
.alert-card {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--primary);
  border-radius: var(--radius); padding: 16px 18px;
}
.alert-card.k-deadline { border-left-color: var(--gold); }
.alert-card.k-timeline { border-left-color: var(--primary); }
.alert-card.k-consultation { border-left-color: var(--good); }
.alert-card .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 0.78rem; color: var(--faint); margin-bottom: 5px; }
.alert-card .kind-tag { text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; font-size: 0.62rem; padding: 2px 8px; border-radius: var(--radius); background: var(--surface-low); color: var(--muted); }
.alert-card h3 { font-size: 0.98rem; font-weight: 600; margin-bottom: 4px; }
.alert-card p { color: var(--muted); font-size: 0.88rem; }
.alert-card .acts { margin-top: 10px; }
.alerts-empty { color: var(--muted); border: 1px dashed var(--line2); border-radius: var(--radius); padding: 26px; text-align: center; background: var(--surface); }

/* email preview */
.email-preview {
  background: var(--surface-low); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 8px;
}
.email-preview .eh { background: #E7EAF0; padding: 12px 16px; font-size: 0.82rem; }
.email-preview .eh div { margin: 2px 0; }
.email-preview .eh strong { color: var(--primary-container); }
.email-preview .eb { padding: 16px; white-space: pre-wrap; font-size: 0.88rem; line-height: 1.6; }
.email-modal-note { font-size: 0.78rem; color: var(--muted); margin-top: 10px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: var(--primary-container); border: 1px solid rgba(255,255,255,.1); color: #fff;
  padding: 12px 22px; border-radius: var(--radius); font-size: 0.88rem; z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  box-shadow: 0 16px 40px rgba(19,27,44,.3); max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- footer (Integra dark band) ---------- */
footer {
  background: var(--primary-container); color: rgba(255,255,255,.6);
  border-top: 1px solid rgba(255,255,255,.05);
  padding: 34px 0 40px; font-size: 0.83rem; font-weight: 300;
}
footer .wrap { display: flex; gap: 12px; flex-direction: column; }
footer strong { color: #fff; font-weight: 600; }
footer a { color: var(--gold); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .disclaimer { font-size: 0.74rem; color: rgba(255,255,255,.4); max-width: 60rem; line-height: 1.6; opacity: 1; }

/* ---------- small screens ---------- */
@media (max-width: 480px) {
  body { font-size: 15px; }
  .site-header .wrap { gap: 8px; }
  nav.tabs { margin-left: 0; width: 100%; }
  nav.tabs button { padding: 8px 10px; font-size: 0.62rem; }
  .hero { padding: 32px 0 30px; }
  .overall { gap: 14px; }
  .prow-head { flex-wrap: wrap; }
  .bar { width: 100%; order: 5; }
  .pct-lbl { order: 4; margin-left: auto; }
  .drawer { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- i18n (EN / zh-CN) ---------- */
.lang-zh .i18n-en{display:none!important}
html:not(.lang-zh) .i18n-zh{display:none!important}
.lang-toggle{
  background:transparent;color:rgba(255,255,255,.8);border:1px solid rgba(255,255,255,.3);
  border-radius:0;padding:7px 12px;font-size:.66rem;font-weight:600;
  letter-spacing:.15em;text-transform:uppercase;cursor:pointer;white-space:nowrap;
  font-family:inherit;transition:color .15s ease,border-color .15s ease;
}
.lang-toggle:hover{color:#C5A059;border-color:#C5A059;background:transparent}


/* ============ v2: homepage primary navbar + secondary tool bar ============ */
.site-header { background: transparent; border: 0; box-shadow: none; }

.pnav { background: var(--primary-container); box-shadow: 0 10px 30px rgba(19,27,44,.10); }
.pnav-inner {
  max-width: none; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 80px;
}
@media (min-width: 1024px) { .pnav-inner { padding: 0 48px; } }
.pnav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; flex: 0 0 auto; }
.pnav-logo { height: 34px; width: auto; display: block; }
.wordmark { display: flex; align-items: baseline; white-space: nowrap; color: #fff; }
.wordmark .wm-integra { font-family: "Montserrat", sans-serif; font-weight: 900; font-size: 1.4rem; letter-spacing: -0.05em; margin-right: 5px; }
.wordmark .wm-scientific { font-family: "Inter", sans-serif; font-weight: 300; font-size: 1.4rem; letter-spacing: -0.02em; opacity: .9; }

.pnav-links { display: none; align-items: center; gap: 28px; }
@media (min-width: 1280px) { .pnav-links { display: flex; } }
.pnav-links a {
  position: relative; color: rgba(255,255,255,.8); text-decoration: none;
  font-family: var(--font-body); font-size: .72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .18em; padding-bottom: 4px;
  white-space: nowrap; transition: color .3s;
}
.pnav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--gold); transition: width .3s;
}
.pnav-links a:hover { color: #fff; }
.pnav-links a:hover::after, .pnav-links a.active::after { width: 100%; }
.pnav-links a.active { color: var(--gold); }
.pnav-qr { font-size: 15px; vertical-align: middle; margin-right: 6px; color: var(--gold); }
.material-symbols-outlined { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

.pnav-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.portal-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold); color: #fff; text-decoration: none;
  height: 44px; padding: 0 24px; border-radius: 0;
  font-family: var(--font-body); font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .18em; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0,0,0,.10); transition: background .2s, transform .12s;
}
.portal-btn:hover { background: var(--gold-hover); }
.portal-btn:active { transform: scale(.97); }
.pnav .portal-btn { display: none; }
@media (min-width: 1280px) { .pnav .portal-btn { display: inline-flex; } }

/* lang toggle: exact same height as Client Portal button */
.lang-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 16px; border-radius: 0;
  background: transparent; color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.3);
  font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap; font-family: var(--font-body);
  transition: color .15s, border-color .15s;
}
.lang-toggle:hover { color: var(--gold); border-color: var(--gold); background: transparent; }

.nav-burger {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 5px; width: 44px; height: 44px; background: transparent; border: 0; cursor: pointer;
}
@media (min-width: 1280px) { .nav-burger { display: none; } }
.nav-burger span { display: block; width: 24px; height: 2px; background: #fff; transition: transform .3s, opacity .3s; }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.pnav-drawer {
  display: none; flex-direction: column; background: var(--primary-container);
  border-top: 1px solid rgba(255,255,255,.1); padding: 8px 24px 20px;
}
.pnav-drawer.open { display: flex; }
@media (min-width: 1280px) { .pnav-drawer.open { display: none; } }
.pnav-drawer a {
  color: rgba(255,255,255,.75); text-decoration: none; padding: 14px 0;
  font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .18em;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.pnav-drawer a:hover { color: #fff; }
.pnav-drawer a.active { color: var(--gold); }
.pnav-drawer .drawer-portal { border: 0; margin-top: 14px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: var(--gold); color: #fff; }

/* ---------- secondary tool bar ---------- */
.toolbar {
  background: var(--primary);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.toolbar-inner {
  display: flex; align-items: stretch; gap: 20px; flex-wrap: wrap;
  min-height: 54px;
}
.tool-id { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.tool-title {
  color: #fff; font-family: var(--font-head); font-weight: 600; font-size: .95rem;
  letter-spacing: .01em; white-space: nowrap;
}
.tool-desc {
  color: rgba(255,255,255,.55); font-size: .74rem; font-weight: 300;
  border-left: 1px solid rgba(255,255,255,.25); padding-left: 12px; white-space: nowrap;
  display: none;
}
@media (min-width: 760px) { .tool-desc { display: inline; } }

.toolbar nav.tabs { margin-left: auto; display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; align-items: stretch; }
.toolbar nav.tabs button {
  border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: rgba(255,255,255,.7); font-family: var(--font-body); font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .14em;
  padding: 0 14px; cursor: pointer; border-radius: 0; white-space: nowrap;
  display: inline-flex; align-items: center;
  transition: color .2s, border-color .2s, background .2s;
}
.toolbar nav.tabs button:hover { color: #fff; background: rgba(255,255,255,.05); }
.toolbar nav.tabs button[aria-selected="true"] { color: var(--gold); background: rgba(19,27,44,.25); border-bottom-color: var(--gold); }
.toolbar nav.tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.toolbar .tools-back {
  display: inline-flex; align-items: center; align-self: center;
  color: rgba(255,255,255,.75) !important; font-size: .66rem !important; font-weight: 600;
  text-transform: uppercase; letter-spacing: .15em; text-decoration: none;
  border: 1px solid rgba(255,255,255,.3) !important; border-radius: 0 !important;
  height: 32px; padding: 0 14px !important; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.toolbar .tools-back:hover { color: var(--gold) !important; border-color: var(--gold) !important; background: transparent !important; }

/* footer wordmark (header style, smaller) */
.wm-footer { display: inline-flex; vertical-align: baseline; }
.wm-footer .wm-integra { font-size: .95rem; margin-right: 3px; color: #fff; }
.wm-footer .wm-scientific { font-size: .95rem; color: #fff; }

@media (max-width: 480px) {
  .pnav-inner { padding: 0 16px; height: 68px; }
  .pnav-logo { height: 26px; }
  .wordmark .wm-integra, .wordmark .wm-scientific { font-size: 1.05rem; }
  .lang-toggle { height: 38px; padding: 0 10px; }
  .nav-burger { height: 38px; width: 38px; }
  .toolbar-inner { gap: 10px; }
  .toolbar nav.tabs { margin-left: 0; width: 100%; order: 5; }
  .toolbar nav.tabs button { padding: 10px 10px; font-size: .6rem; }
  .toolbar .tools-back { margin-left: auto; }
}

/* clamp horizontal overflow from off-canvas drawer */
html, body { overflow-x: hidden; }


/* ============ v3: toolbar responsive fix ============ */
/* Row logic: wide = [name | tabs | back] one row; narrow = row1 [name ... back], row2 tabs full-width scrollable */
.toolbar-inner { row-gap: 0; }
@media (max-width: 1100px) {
  .toolbar-inner { flex-wrap: wrap; padding-top: 6px; padding-bottom: 10px; }
  .toolbar .tool-id { order: 1; padding: 8px 0 4px; }
  .toolbar .tools-back { order: 2; margin-left: auto; align-self: center; }
  .toolbar nav.tabs { order: 3; margin-left: 0; width: 100%; justify-content: flex-start; border-top: 1px solid rgba(255,255,255,.12); }
  .toolbar nav.tabs button { padding: 11px 13px; }
}
@media (max-width: 480px) {
  .toolbar nav.tabs { order: 3; width: 100%; margin-left: 0; }
  .toolbar .tools-back { margin-left: auto; order: 2; }
  .tool-desc { display: none; }
}


/* ============ v4: mobile tabs fit ============ */
@media (max-width: 640px) {
  .toolbar nav.tabs { flex-wrap: wrap; overflow-x: visible; }
  .toolbar nav.tabs button {
    flex: 1 1 auto; justify-content: center;
    padding: 11px 8px; font-size: .6rem; letter-spacing: .1em;
  }
}
/* kill off-screen drawer shadow bleeding onto narrow screens */
.drawer { box-shadow: none; }
.drawer.open { box-shadow: -20px 0 60px rgba(19,27,44,.12); }


/* ============ v5: lang toggle == Client Portal height at every breakpoint (mirror homepage) ============ */
.pnav-actions { align-items: stretch; }
.portal-btn {
  height: auto;
  padding: 10px 20px;            /* = homepage py-2.5 px-5 */
  font-size: 10px;               /* = text-[10px] */
}
@media (min-width: 1350px) { .portal-btn { padding: 12px 24px; font-size: 12px; } }   /* py-3 px-6 text-xs */
@media (min-width: 1536px) { .portal-btn { padding: 14px 32px; font-size: 14px; } }   /* py-3.5 px-8 text-sm */
.lang-toggle {
  height: auto; align-self: stretch;
  padding: 10px 16px; font-size: 10px;
}
@media (min-width: 1350px) { .lang-toggle { padding: 12px 16px; font-size: 12px; } }
@media (min-width: 1536px) { .lang-toggle { padding: 14px 20px; font-size: 14px; } }
/* below 1280px the portal button is hidden: toggle pairs with the burger instead */
@media (max-width: 1279.98px) { .lang-toggle { align-self: center; height: 44px; padding: 0 14px; } }
@media (max-width: 480px)     { .lang-toggle { height: 38px; padding: 0 10px; } }
.nav-burger { align-self: center; }


/* ============ v6: shared chrome integration ============ */
/* navbar is fixed (like homepage) -> offset page, pin toolbar below it */
.toolbar {
  position: fixed; left: 0; right: 0; top: var(--ic-nav-h); z-index: 45;
}
/* push page content below both fixed bars: nav height + toolbar's own height */
main { padding-top: calc(var(--ic-nav-h) + var(--ic-toolbar-h, 54px)); }
.tool-disclaimer { background: var(--primary); border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0 20px; }
.tool-disclaimer p { color: rgba(255,255,255,.55); font-size: .74rem; line-height: 1.6; max-width: 60rem; font-weight: 300; }
