/* Fin — daily market brief. Dark, mobile-first, matches westwald.io family. */
:root {
  --bg: #0b101c;
  --bg2: #0d1220;
  --card: #131a2c;
  --card2: #17203a;
  --line: #232c47;
  --text: #e8ecf5;
  --dim: #8b94ad;
  --dim2: #5d6578;
  --accent: #34d399;
  --accent-dim: rgba(52, 211, 153, 0.12);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.12);
  --blue: #7aa2ff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100svh;
  padding-bottom: env(safe-area-inset-bottom);
}

/* top nav (westwald.io family) */
.ww-nav { background: rgba(11, 16, 28, 0.9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px); }
.ww-nav-inner { max-width: 720px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 18px; align-items: center; }
.ww-nav a { color: var(--dim); text-decoration: none; font-size: 14px; font-weight: 600; }
.ww-nav a.active { color: var(--text); }
.ww-home { font-size: 18px !important; }

/* app bar */
.appbar {
  max-width: 720px; margin: 0 auto; padding: 22px 16px 6px;
  display: flex; justify-content: space-between; align-items: center;
}
.appbar-title { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.appbar-sub { color: var(--dim); font-size: 13px; margin-top: 2px; }
.appbar-date {
  width: 56px; height: 56px; border-radius: 16px; background: var(--card);
  border: 1px solid var(--line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.appbar-date .dow { font-size: 10px; font-weight: 800; color: var(--accent); letter-spacing: 1px; }
.appbar-date .day { font-size: 20px; font-weight: 800; line-height: 1.1; }

main { max-width: 720px; margin: 0 auto; padding: 10px 16px 40px; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; margin-top: 14px;
}
.sec-label {
  font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--dim); margin-bottom: 12px;
}
.sec-label .dim { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ai-badge {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 1px;
  color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(52,211,153,.35);
  border-radius: 999px; padding: 2px 8px; vertical-align: 2px; margin-left: 4px;
}

/* index cards */
.idx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.idx { background: var(--card2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px; text-align: center; }
.idx .k { font-size: 11px; font-weight: 700; color: var(--dim); letter-spacing: .4px; }
.idx .v { font-size: 22px; font-weight: 800; margin: 4px 0 2px; }
.idx .v.up { color: var(--accent); }
.idx .v.down { color: var(--red); }
.idx .s { font-size: 12px; color: var(--dim); }

.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.cell { background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.cell .k { font-size: 10px; color: var(--dim); font-weight: 600; }
.cell .v { font-size: 14px; font-weight: 700; margin-top: 2px; }
.month-note { font-size: 12px; color: var(--dim); margin-top: 12px; }

/* brief text */
.lede { font-size: 17px; font-weight: 500; line-height: 1.6; }
.body { margin-top: 12px; color: #c6cddf; font-size: 15px; }

/* drivers */
.driver { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; color: #c6cddf; }
.driver:first-of-type { border-top: none; padding-top: 0; }
.d-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.d-dot.up { background: var(--accent); box-shadow: 0 0 8px rgba(52,211,153,.7); }
.d-dot.warn { background: var(--amber); box-shadow: 0 0 8px rgba(251,191,36,.7); }
.d-dot.flat { background: var(--blue); box-shadow: 0 0 8px rgba(122,162,255,.7); }
.driver strong { color: var(--text); }

/* positions */
.pos { border-top: 1px solid var(--line); padding: 14px 0 4px; }
.pos:first-of-type { border-top: none; padding-top: 0; }
.pos-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ticker {
  font-weight: 800; font-size: 15px; letter-spacing: .5px; background: var(--card2);
  border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px;
}
.px { color: var(--dim); font-size: 14px; font-weight: 600; }
.stance { margin-left: auto; font-size: 11px; font-weight: 800; letter-spacing: .6px; border-radius: 999px; padding: 3px 10px; }
.stance--bear { color: var(--red); background: var(--red-dim); border: 1px solid rgba(248,113,113,.35); }
.stance--neutral { color: var(--amber); background: var(--amber-dim); border: 1px solid rgba(251,191,36,.35); }
.stance--bull { color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(52,211,153,.35); }
.pos p { font-size: 14.5px; color: #c6cddf; }

/* reads */
.read { display: block; text-decoration: none; color: inherit; border-top: 1px solid var(--line); padding: 13px 0; }
.read:first-of-type { border-top: none; padding-top: 0; }
.r-title { font-weight: 700; font-size: 15px; }
.read:hover .r-title, .read:active .r-title { color: var(--accent); }
.r-meta { font-size: 12px; color: var(--dim); margin-top: 2px; }
.r-why { font-size: 13.5px; color: #aab3c9; margin-top: 5px; }

/* archive */
.arch-row {
  display: flex; justify-content: space-between; gap: 10px; text-decoration: none; color: inherit;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.arch-row:first-of-type { border-top: none; padding-top: 0; }
.arch-row .dim { color: var(--dim); font-size: 13px; text-align: right; }

.foot { text-align: center; color: var(--dim); font-size: 12px; margin-top: 26px; line-height: 1.7; }
.back-link {
  display: inline-block; max-width: 720px; margin: 14px auto 0; padding: 0 16px;
  color: var(--accent); text-decoration: none; font-weight: 700; font-size: 14px;
}
body > .back-link { display: block; }

@media (min-width: 640px) {
  .strip { grid-template-columns: repeat(6, 1fr); }
}
