:root {
  --bg: #0a0e14;
  --panel: #111721;
  --panel-2: #161d29;
  --border: #1f2937;
  --grid: #1a2230;
  --text: #e6edf3;
  --muted: #8b98a9;
  --gold: #f5b301;
  --amber: #ffb000;
  --green: #2ec27e;
  --red: #ff5c5c;
  --blue: #4aa8ff;
  --mono: "SFMono-Regular", "Consolas", "Roboto Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ===== Subscribe gate ===== */
.gate {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 50% 30%, #0d1422, #05070b 80%);
}
html.has-access .gate { display: none; }
.gate.unlocking { opacity: 0; transition: opacity .5s ease; pointer-events: none; }
.gate-card {
  width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--gold);
  border-radius: 10px; padding: 32px 30px; box-shadow: 0 20px 70px rgba(0,0,0,.6);
}
.gate-brand { color: var(--gold); font-size: 11px; letter-spacing: 3px; font-weight: 700; }
.gate-title { color: var(--text); font-size: 24px; margin: 12px 0 8px; letter-spacing: .5px; }
.gate-sub { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 16px; }
.gate-sub em { color: var(--gold); font-style: italic; }
.gate-perks { list-style: none; padding: 0; margin: 0 0 20px; }
.gate-perks li { color: var(--text); font-size: 12.5px; padding: 5px 0; }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-form input {
  background: #0a0e14; border: 1px solid var(--border); border-radius: 5px; color: var(--text);
  font-family: var(--mono); font-size: 14px; padding: 12px 14px;
}
.gate-form input:focus { outline: none; border-color: var(--gold); }
.gate-form button {
  background: var(--gold); color: #0a0e14; border: none; font-family: var(--mono); font-weight: 700;
  letter-spacing: 1px; font-size: 13px; padding: 13px; border-radius: 5px; cursor: pointer;
}
.gate-form button:hover { filter: brightness(1.1); }
.gate-form button:disabled { opacity: .6; cursor: wait; }
.gate-msg { font-size: 12px; min-height: 16px; margin-top: 10px; }
.gate-msg.ok { color: var(--green); }
.gate-msg.err { color: var(--red); }
.gate-fine { color: var(--muted); font-size: 11px; margin-top: 14px; line-height: 1.5; }
.gate-em { color: var(--gold); }
#gatePending button#gateCheckBtn {
  width: 100%; background: var(--gold); color: #0a0e14; border: none; font-family: var(--mono);
  font-weight: 700; letter-spacing: 1px; font-size: 13px; padding: 13px; border-radius: 5px; cursor: pointer;
}
#gatePending button#gateCheckBtn:hover { filter: brightness(1.1); }
#gatePending button#gateCheckBtn:disabled { opacity: .6; cursor: wait; }
.gate-link { background: none; border: none; color: var(--gold); font-family: var(--mono);
  font-size: 11px; text-decoration: underline; cursor: pointer; padding: 0; }

/* ===== Top bar ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  background: linear-gradient(180deg, #0d1320, #0a0e14);
  border-bottom: 2px solid var(--gold);
}
.topbar .brandblock { display: flex; align-items: baseline; gap: 14px; }
.topbar h1 {
  font-size: 16px; letter-spacing: 2px; margin: 0; color: var(--gold);
  font-weight: 700;
}
.topbar .sub { color: var(--muted); font-size: 11px; letter-spacing: 1px; }
.topbar .right { display: flex; align-items: center; gap: 16px; }
.clock { color: var(--green); font-size: 13px; letter-spacing: 1px; }
.asof { color: var(--muted); font-size: 11px; }
.refresh-btn {
  background: var(--gold); color: #0a0e14; border: none; font-family: var(--mono);
  font-weight: 700; font-size: 12px; letter-spacing: 1px; padding: 8px 16px;
  border-radius: 4px; cursor: pointer; transition: filter .15s;
}
.refresh-btn:hover { filter: brightness(1.1); }
.refresh-btn:active { transform: translateY(1px); }
.refresh-btn.loading { opacity: .6; cursor: wait; }

/* ===== Layout ===== */
.grid {
  display: grid; gap: 12px; padding: 14px;
  grid-template-columns: repeat(12, 1fr);
}
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  padding: 12px 14px; min-width: 0; position: relative;
}
.panel h2 {
  font-size: 11px; letter-spacing: 1.5px; color: var(--gold); margin: 0 0 10px;
  text-transform: uppercase; border-bottom: 1px solid var(--border); padding-bottom: 6px;
}
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
@media (max-width: 1100px) {
  .col-3,.col-4,.col-5,.col-6,.col-7,.col-8 { grid-column: span 12; }
}

/* ===== Health score ===== */
.health-wrap { display: flex; align-items: center; gap: 20px; }
.health-num { font-size: 56px; font-weight: 700; line-height: 1; }
.health-meta { flex: 1; }
.health-label { font-size: 16px; letter-spacing: 2px; font-weight: 700; }
.health-sub { color: var(--muted); font-size: 11px; margin-top: 4px; }
.health-bar { height: 14px; background: var(--panel-2); border-radius: 7px; overflow: hidden; margin-top: 10px; border: 1px solid var(--border); }
.health-fill { height: 100%; border-radius: 7px; transition: width .6s ease; }
.scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-top: 3px; }

/* ===== Verdict / "What this means for you" ===== */
.verdict { border-left: 3px solid var(--gold); }
.verdict-head { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: .3px; margin-bottom: 6px; }
.verdict-body { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 12px; max-width: 95ch; }
.takeaways { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 800px) { .takeaways { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .takeaways { grid-template-columns: 1fr; } }
.tk { background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 10px 12px; border-top: 2px solid var(--muted); }
.tk.good { border-top-color: var(--green); }
.tk.warn { border-top-color: var(--gold); }
.tk.bad  { border-top-color: var(--red); }
.tk .tk-label { font-size: 10px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.tk .tk-text { font-size: 12px; color: var(--text); margin-top: 4px; line-height: 1.45; }

/* ===== Info tooltip ===== */
.info { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px;
  border: 1px solid var(--muted); color: var(--muted); border-radius: 50%; font-size: 9px; margin-left: 6px;
  cursor: help; position: relative; vertical-align: middle; }
.info:hover { border-color: var(--gold); color: var(--gold); }
.info .tip { display: none; position: absolute; bottom: 140%; left: 50%; transform: translateX(-50%);
  width: 230px; background: #0c1118; border: 1px solid var(--gold); border-radius: 6px; padding: 9px 11px;
  color: var(--text); font-size: 11px; line-height: 1.45; text-align: left; z-index: 20; box-shadow: 0 6px 20px rgba(0,0,0,.5);
  white-space: normal; overflow-wrap: break-word; font-weight: 400; }
.info .tip b { color: var(--gold); }
.info:hover .tip, .info:focus .tip { display: block; }
/* Header icons: anchor the tip to the PANEL (not the icon) so it always fits */
.info.hdr { text-transform: none; position: static; }
.info.hdr .tip { left: 12px; right: 12px; width: auto; top: 40px; bottom: auto; transform: none; }

/* ===== Indicator table ===== */
table.ind { width: 100%; border-collapse: collapse; }
table.ind th {
  text-align: right; color: var(--muted); font-size: 10px; letter-spacing: .5px;
  padding: 6px 8px; border-bottom: 1px solid var(--border); font-weight: 600;
}
table.ind th:first-child { text-align: left; }
table.ind td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.ind td:first-child { text-align: left; color: var(--text); }
table.ind tr:hover td { background: var(--panel-2); }
.spark { width: 132px; height: 28px; }
.hint { color: var(--muted); font-size: 10px; margin-top: 8px; letter-spacing: .3px; }
.pill { padding: 2px 7px; border-radius: 3px; font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.pill.beat { background: rgba(46,194,126,.15); color: var(--green); }
.pill.miss { background: rgba(255,92,92,.15); color: var(--red); }
.pill.inline { background: rgba(139,152,169,.15); color: var(--muted); }
.sig { font-size: 10px; font-weight: 700; }
.sig.gp { color: var(--green); }
.sig.gn { color: var(--red); }
.sig.ip { color: var(--amber); }
.up { color: var(--green); }
.down { color: var(--red); }
.flat { color: var(--muted); }

/* ===== Quadrant ===== */
.quad { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; }
.quad .cell {
  border: 1px solid var(--border); border-radius: 4px; padding: 14px 8px; text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); background: var(--panel-2);
}
.quad .cell.active { background: var(--gold); color: #0a0e14; border-color: var(--gold); box-shadow: 0 0 14px rgba(245,179,1,.3); }
.quad .cell small { display: block; font-weight: 400; font-size: 9px; margin-top: 4px; opacity: .8; }
.quad-axes { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; margin-top: 6px; }

/* ===== Fed / FedWatch ===== */
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--grid); }
.kv .k { color: var(--muted); font-size: 11px; }
.kv .v { color: var(--text); font-weight: 700; }
.fw-meeting { color: var(--blue); font-size: 11px; margin: 10px 0 6px; letter-spacing: .5px; }
.fw-row { display: grid; grid-template-columns: 78px 1fr 38px; align-items: center; gap: 8px; margin: 4px 0; }
.fw-row .lbl { font-size: 11px; color: var(--muted); }
.fw-bar { height: 10px; background: var(--panel-2); border-radius: 5px; overflow: hidden; border: 1px solid var(--border); }
.fw-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--amber)); }
.fw-row .pct { text-align: right; font-weight: 700; font-size: 11px; }

/* ===== Rate outlook ===== */
.ro-dir { font-size: 23px; font-weight: 700; letter-spacing: 1px; margin: 2px 0 4px; }
.ro-dir.good { color: var(--green); }
.ro-dir.bad { color: var(--red); }
.ro-dir.warn { color: var(--gold); }
.ro-sub { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 12px; }

/* ===== Markets ===== */
.mkt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 700px){ .mkt { grid-template-columns: repeat(2,1fr);} }
.mcard { background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 10px; }
.mcard .mname { color: var(--muted); font-size: 10px; letter-spacing: .5px; }
.mcard .mval { font-size: 20px; font-weight: 700; margin: 2px 0; }
.mcard .mchg { font-size: 11px; font-weight: 700; }
.mcard .mspark { position: relative; height: 40px; margin-top: 8px; }
.mcard .mspark canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

/* ===== Calendar ===== */
.cal { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; }
@media (max-width: 700px){ .cal { grid-template-columns: 1fr; } }
.cal-item { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--grid); }
.cal-item .cn { color: var(--text); font-size: 11px; }
.cal-item .cd { color: var(--gold); font-size: 11px; font-weight: 700; }
.cal-item .ct { color: var(--muted); font-size: 10px; }

/* ===== Footer ===== */
.footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 18px; color: var(--muted); font-size: 10px;
  border-top: 1px solid var(--border); margin-top: 6px;
}
.footer .note { max-width: 70%; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.35;} }

/* ===== Mobile: stack topbar + turn the indicator table into cards ===== */
@media (max-width: 720px) {
  body { font-size: 13px; }

  /* Tooltips become a full-width bottom sheet so they never overrun the screen */
  .info .tip,
  .info.hdr .tip {
    position: fixed; left: 12px; right: 12px; width: auto; max-width: none;
    bottom: 16px; top: auto; transform: none; font-size: 12.5px; padding: 13px 15px;
    box-shadow: 0 -6px 30px rgba(0,0,0,.7);
  }
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; }
  .topbar h1 { font-size: 14px; }
  .topbar .sub { display: none; }
  .topbar .right { width: 100%; justify-content: space-between; }
  .refresh-btn { padding: 8px 12px; }
  .grid { padding: 10px; gap: 10px; }
  .health-num { font-size: 44px; }

  table.ind thead { display: none; }
  table.ind, table.ind tbody, table.ind tr, table.ind td { display: block; width: 100%; }
  table.ind tr {
    background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
    margin-bottom: 10px; padding: 8px 10px;
  }
  table.ind tr:hover td { background: transparent; }
  table.ind td {
    display: flex; justify-content: space-between; align-items: center;
    text-align: right; padding: 5px 0; border-bottom: 1px solid var(--grid);
  }
  table.ind td:first-child {
    font-weight: 700; color: var(--gold); font-size: 13px; border-bottom: 1px solid var(--border);
    padding-bottom: 7px; margin-bottom: 3px;
  }
  table.ind td::before {
    content: attr(data-label); color: var(--muted); font-size: 10px; letter-spacing: .5px;
    text-transform: uppercase; text-align: left; margin-right: 12px;
  }
  table.ind td:first-child::before { content: ""; margin: 0; }
  table.ind td.spark-cell { display: none; } /* hide tiny sparkline on phone cards */
}
