/* Project Alpha — "blueprint" design system (from Design.pdf)
   Barlow / Barlow Condensed · monochrome steel-blue charts ·
   registration-mark panel framing · light default, dark via [data-theme] */

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

:root {
  --page: #F1F1F2;        /* outer page */
  --surface: #FFFFFF;     /* content column */
  --ink: #17202B;
  --ink-2: #5B6472;
  --ink-3: #8B93A0;
  --hairline: #D8DADE;
  --mark: #9AA2AC;        /* registration marks */
  --accent: #2E5A85;      /* ink blue: links, chips, latest annotations */
  --accent-soft: #E8F0F8; /* chip backgrounds */
  --neg: #A03A2E;
  --bar: #7FA5C9;         /* primary series */
  --bar-2: #1F3A56;       /* dark navy pair (debt) */
  --bar-3: #BDD7EE;       /* pale pair (cash) */
  --grid-dot: #C9CDD3;
}
[data-theme="dark"] {
  --page: #101418;
  --surface: #171C22;
  --ink: #E6EAEF;
  --ink-2: #9CA5B1;
  --ink-3: #6E7783;
  --hairline: #2A313A;
  --mark: #4A525C;
  --accent: #8FB3D6;
  --accent-soft: #1E2A38;
  --neg: #D98A7F;
  --bar: #6E96BC;
  --bar-2: #A9C6E2;
  --bar-3: #33506E;
  --grid-dot: #333B45;
}

html { background: var(--page); }
body {
  color: var(--ink);
  font-family: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
.cond, h1, h2, .panel-title, .stat-v, .anno-v, .price-big {
  font-family: 'Barlow Condensed', 'Arial Narrow', 'Barlow', sans-serif;
  font-weight: 600;
}

.sheet {
  max-width: 1240px; margin: 0 auto;
  background: var(--surface);
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  min-height: 100vh;
  padding: 0 34px 40px;
}

/* registration-mark framing: crosses at all four corners + dashed hairline */
.frame {
  position: relative;
  border: 1px dashed var(--hairline);
  background:
    linear-gradient(var(--mark), var(--mark)) no-repeat -5px 50% / 0 0,
    linear-gradient(var(--mark), var(--mark)) no-repeat left -6px top 50% / 0 0;
}
.frame::before, .frame::after, .frame .fm::before, .frame .fm::after {
  content: ""; position: absolute; width: 13px; height: 13px;
  background:
    linear-gradient(var(--mark), var(--mark)) no-repeat 50% 0 / 1px 100%,
    linear-gradient(var(--mark), var(--mark)) no-repeat 0 50% / 100% 1px;
}
.frame::before { top: -7px; left: -7px; }
.frame::after { top: -7px; right: -7px; }
.frame .fm::before { bottom: -7px; left: -7px; }
.frame .fm::after { bottom: -7px; right: -7px; }

/* ---------------- top nav ---------------- */

.nav {
  display: flex; align-items: center; gap: 26px;
  padding: 14px 0 13px;
  border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14.5px; }
.brand .mark-icon { width: 15px; height: 15px; border: 1.5px solid var(--ink); position: relative; }
.brand .mark-icon::after { content: ""; position: absolute; inset: 2px 5px 5px 2px; background: var(--accent); }
.search-box {
  position: relative; flex: 1; max-width: 430px; margin: 0 auto;
  display: flex; align-items: center;
  background: var(--page); border: 1px solid var(--hairline); border-radius: 3px;
  height: 34px; padding: 0 12px; color: var(--ink-3);
}
.search-box svg { flex: none; margin-right: 8px; }
.search-box input {
  flex: 1; border: none; background: none; outline: none;
  color: var(--ink); font-family: inherit; font-size: 13.5px;
  text-transform: uppercase; letter-spacing: .04em;
}
.suggest {
  position: absolute; top: 37px; left: -1px; right: -1px; z-index: 30;
  background: var(--surface); border: 1px solid var(--hairline);
  box-shadow: 0 10px 30px rgba(23, 32, 43, .12); text-align: left;
}
.suggest div { padding: 8px 13px; font-size: 13px; cursor: pointer; display: flex; gap: 10px; }
.suggest div:hover { background: var(--accent-soft); }
.suggest .s-tk { font-weight: 600; min-width: 52px; }
.suggest .s-nm { color: var(--ink-2); }

.nav-links { display: flex; gap: 22px; font-size: 13.5px; }
.nav-links a { color: var(--ink); text-decoration: none; }
.nav-links a.soon { color: var(--ink-3); cursor: default; }
.theme-btn {
  border: 1px solid var(--hairline); background: none; color: var(--ink);
  width: 30px; height: 30px; border-radius: 3px; cursor: pointer; font-size: 13px;
}

/* ---------------- company header ---------------- */

.co-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 26px 0 4px; }
.co-id { display: flex; gap: 14px; }
.tick-pill {
  background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: 13px; letter-spacing: .05em;
  padding: 6px 10px; border-radius: 3px; height: fit-content; margin-top: 4px;
}
h1 { font-size: 30px; letter-spacing: .01em; line-height: 1.1; }
.co-tags { display: flex; gap: 8px; margin-top: 7px; font-size: 12px; color: var(--ink-2); }
.co-tags .xch { border: 1px solid var(--hairline); padding: 2px 8px; letter-spacing: .08em; font-size: 11px; }
.co-tags .sect { padding: 3px 0; }

.head-right { text-align: right; }
.price-big { font-size: 27px; }
.price-chg { font-size: 12.5px; color: var(--accent); margin-top: 2px; }
.price-chg.down { color: var(--neg); }
.price-src { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.head-actions { display: flex; gap: 14px; justify-content: flex-end; align-items: center; margin-top: 10px; }
.watch-btn {
  border: 1px solid var(--hairline); background: none; color: var(--ink);
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 3px; cursor: pointer;
}
.watch-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.filings-link { font-size: 12.5px; color: var(--accent); text-decoration: none; font-weight: 600; }

/* ---------------- stats strip ---------------- */

.stats-strip { margin: 22px 8px 8px; padding: 16px 4px 18px; display: flex; }
.stat-cell { flex: 1; padding: 0 20px; border-left: 1px solid var(--hairline); }
.stat-cell:first-child { border-left: none; }
.stat-k { font-size: 10.5px; letter-spacing: .13em; color: var(--ink-3); text-transform: uppercase; }
.stat-v { font-size: 21px; margin-top: 4px; }
.stat-v.neg { color: var(--neg); }
.stat-cell .pair { margin-top: 13px; }

/* ---------------- financials section ---------------- */

.fin-head { display: flex; align-items: baseline; gap: 20px; margin: 34px 0 4px; }
.fin-head h2 { font-size: 20px; }
.mode-toggle { display: flex; border: 1px solid var(--hairline); border-radius: 3px; overflow: hidden; }
.mode-toggle button {
  border: none; background: none; color: var(--ink-2); cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: .05em;
  padding: 5px 12px; border-left: 1px solid var(--hairline);
}
.mode-toggle button:first-child { border-left: none; }
.mode-toggle button.active { background: var(--accent); color: var(--surface); }
.fin-hint { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }

.panel-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 34px 30px; margin-top: 26px; padding: 0 8px;
}
@media (max-width: 900px) { .panel-grid { grid-template-columns: 1fr; } .stats-strip { flex-wrap: wrap; } .stat-cell { min-width: 30%; margin-bottom: 12px; } }

.panel { padding: 14px 16px 12px; }
.panel-top { display: flex; align-items: center; gap: 10px; }
.panel-title { font-size: 15.5px; letter-spacing: .01em; }
.panel-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.panel-ctl { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ranges { display: flex; border: 1px solid var(--hairline); border-radius: 2px; }
.ranges button {
  border: none; background: none; color: var(--ink-3); cursor: pointer;
  font-family: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: .05em;
  padding: 3px 8px; border-left: 1px solid var(--hairline);
}
.ranges button:first-child { border-left: none; }
.ranges button.active { color: var(--surface); background: var(--accent); }
.expand {
  border: none; background: none; color: var(--ink-3); cursor: pointer;
  font-size: 13px; padding: 2px 4px;
}
.expand:hover { color: var(--accent); }

.legend { display: flex; gap: 14px; margin: 8px 0 0; }
.legend-chip { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); }
.swatch { width: 9px; height: 9px; display: inline-block; }
.swatch.line-sw { height: 2px; }
.swatch.dash { background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 6px); }

.panel-body { margin-top: 10px; }
.panel-body svg { display: block; width: 100%; height: auto; }
.axis-text { fill: var(--ink-3); font-size: 10px; font-family: 'Barlow', Arial, sans-serif; }
.bar:hover, .hover-strip:hover { opacity: .85; }

.panel-foot { display: flex; align-items: baseline; gap: 10px; border-top: 1px solid var(--hairline); margin-top: 6px; padding-top: 9px; }
.anno-v { font-size: 17px; }
.anno-chg { font-size: 11.5px; color: var(--accent); font-weight: 600; }
.anno-cap { margin-left: auto; font-size: 11px; color: var(--ink-3); }

.empty-state {
  min-height: 200px; display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 12.5px; text-align: center; padding: 0 26px; line-height: 1.6;
}

.ad-slot { display: flex; align-items: center; justify-content: center; min-height: 300px; }
.ad-slot span { color: var(--ink-3); font-size: 11px; letter-spacing: .25em; }

/* ---------------- zoom modal ---------------- */

.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(23, 32, 43, .45);
  display: flex; align-items: center; justify-content: center; padding: 30px;
}
[data-theme="dark"] .modal { background: rgba(0, 0, 0, .62); }
.modal-card {
  background: var(--surface); border: 1px solid var(--hairline);
  width: min(1200px, 95vw); max-height: 92vh; overflow: auto;
  padding: 18px 26px 22px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; }
.modal-head .panel-title { font-size: 19px; }
#modal-close {
  border: 1px solid var(--hairline); background: none; color: var(--ink-2);
  width: 30px; height: 30px; cursor: pointer; font-size: 13px; border-radius: 3px;
}

/* ---------------- brief / notes ---------------- */

.brief { margin: 30px 8px 0; padding: 16px 20px 14px; }
.brief h3 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }
.brief-item { font-size: 12.5px; padding: 7px 0 0; color: var(--ink-2); line-height: 1.55; }
.brief-item .tag {
  font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 1px 7px; margin-right: 8px; border-radius: 2px;
}
.tag.warn { background: #F6E8D8; color: #8A5A17; }
[data-theme="dark"] .tag.warn { background: #3A2E1A; color: #D9A860; }
.tag.info { background: var(--accent-soft); color: var(--accent); }
.brief-when { color: var(--ink-3); margin-right: 6px; }
.brief-toggle { color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; display: inline-block; margin-top: 8px; }

/* ---------------- tooltip / footer ---------------- */

.tooltip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--surface); border: 1px solid var(--hairline);
  box-shadow: 0 8px 26px rgba(23, 32, 43, .16);
  padding: 8px 11px; font-size: 12px; line-height: 1.5; max-width: 300px;
}
.tooltip .t-label { color: var(--ink-3); font-size: 11px; }
.tooltip .t-value { font-weight: 600; }
.tooltip .t-flag { color: #8A5A17; font-size: 11px; }
[data-theme="dark"] .tooltip .t-flag { color: #D9A860; }

.foot {
  margin-top: 44px; border-top: 1px solid var(--hairline);
  padding: 16px 8px 0; font-size: 11.5px; color: var(--ink-3);
  text-align: center; line-height: 1.7;
}

.hidden { display: none; }
