:root {
  --bg: #07111c;
  --bg-2: #0b1826;
  --card: #122033;
  --card-2: #182a40;
  --ink: #f3efe6;
  --muted: #93a3b5;
  --line: rgba(232, 214, 176, 0.12);
  --gold: #d4b37a;
  --gold-dim: #8d7344;
  --ok: #7dbaa3;
  --warn: #d4a054;
  --danger: #d17a7a;
  --pad: 20px;
  --radius: 22px;
  --dock: 72px;
  --serif: "Fraunces", "Times New Roman", serif;
  --sans: "Figtree", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 420px at 50% -80px, #14304a 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
}
body { padding-bottom: calc(var(--dock) + env(safe-area-inset-bottom)); }
button, input { font: inherit; }
h1, h2, .serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em; text-wrap: pretty; }
.top {
  padding: 22px var(--pad) 8px;
}
.kicker {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
h1 {
  margin: 6px 0 0;
  font-size: 34px;
  line-height: 1.05;
}
.lede {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 36rem;
}
main {
  padding: 8px var(--pad) 28px;
  display: grid;
  gap: 14px;
}
.panel {
  background: linear-gradient(180deg, var(--card) 0%, #101c2c 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
}
.panel.hero {
  padding: 18px 18px 16px;
  background:
    linear-gradient(135deg, rgba(212, 179, 122, 0.12), transparent 42%),
    linear-gradient(180deg, #173049 0%, #101d2c 100%);
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}
.meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}
.why { margin: 10px 0 0; font-size: 15px; }
.row-list { display: grid; gap: 0; }
.opp {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.opp:first-child { border-top: 0; padding-top: 4px; }
.opp h3 { margin: 0; font-size: 16px; font-family: var(--serif); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border: 1px solid var(--line);
}
.chip.gold { color: var(--gold); border-color: rgba(212, 179, 122, 0.28); }
.chip.ok { color: var(--ok); }
.chip.warn { color: var(--warn); }
.chip.danger { color: var(--danger); }
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters button, .pills button {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 40px;
}
.filters button.on, .pills button.on, .subtabs button.on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.check:first-child { border-top: 0; }
.check input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: var(--gold);
}
.actions {
  position: sticky;
  bottom: calc(var(--dock) + 8px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 8px;
}
.actions button, .ghost, .primary, .danger {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 12px;
  font-weight: 650;
  color: var(--ink);
  background: var(--card-2);
}
.primary { background: var(--gold); color: #1a1408; }
.danger { background: #3a1d22; color: #f0c4c4; }
.ghost { background: transparent; border: 1px solid var(--line); }
.dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: rgba(10, 20, 32, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 6px;
  backdrop-filter: blur(16px);
  z-index: 8;
}
.dock button {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  min-height: 52px;
  border-radius: 16px;
  padding: 6px 4px 8px;
}
.dock button.active {
  color: var(--ink);
  background: rgba(212, 179, 122, 0.12);
}
.dock svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.subtabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 40px;
  white-space: nowrap;
}
.kv { display: grid; gap: 10px; margin-top: 12px; }
.kv div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; }
.email {
  white-space: pre-wrap;
  font-size: 13.5px;
  line-height: 1.55;
  background: #0c1622;
  border-radius: 16px;
  padding: 14px;
  overflow: auto;
  max-height: 62vh;
}
.pdf-frame {
  width: 100%;
  height: 68vh;
  border: 0;
  border-radius: 16px;
  background: #0c1622;
}
.empty {
  padding: 28px 8px;
  text-align: center;
  color: var(--muted);
}
.empty strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
}
.pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }
#toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--dock) + 16px);
  background: #173328;
  color: var(--ok);
  padding: 12px 14px;
  border-radius: 14px;
  text-align: center;
  z-index: 9;
}
.back { margin-bottom: 4px; width: max-content; }
.sources { display: grid; gap: 8px; margin-top: 10px; }
.sources a, .sources p {
  margin: 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.sources a { color: var(--gold); }
@media (min-width: 840px) {
  #app { max-width: 760px; margin: 0 auto; }
  h1 { font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
