/* Core theme: clean, airy, research vibe; accessible colors (AA) */
:root {
  --bg: #F7F8FA;
  --surface: #ffffff;
  --text: #1E1E1E;
  --muted: #6B7280;
  --border: #E5E7EB;
  --accent: #3B82F6;
  --accent-600: #2563EB;
  --buy: #10B981;
  --sell: #EF4444;
  --hold: #6B7280;
  --shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Banner */
#top-banner { background: #FFF7ED; border-bottom: 1px solid #FED7AA; }
#top-banner p { margin: 0; }
.banner__inner { display: flex; gap: 12px; align-items: start; padding: 10px 0; }
#banner-dismiss { margin-left: auto; }

/* Acknowledgment modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal { width: min(640px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 16px; }
.modal h3 { margin: 0 0 8px; font-size: 20px; }
.modal p { margin: 8px 0; color: var(--text); }
.modal__fine { color: var(--muted); font-size: 13px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--border); }
.header__inner { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 600; }
.brand__name { letter-spacing: 0.2px; }
.nav { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--text); text-decoration: none; padding: 6px 8px; border-radius: 6px; }
.nav a:hover, .nav a:focus { background: #F3F4F6; outline: none; }

/* Masthead */
.masthead { padding: 28px 0 8px; }
.masthead__title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.masthead h1 { font-size: 34px; line-height: 1.2; margin: 0; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 999px; background: #EEF2FF; color: #3730A3; border: 1px solid #C7D2FE; font-size: 12px; font-weight: 600; }
.asof { margin: 6px 0 0; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin: 16px 0 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 14px; }
.card__title { font-size: 14px; margin: 0 0 6px; color: var(--muted); }
.card__value { font-size: 18px; margin: 0; font-variant-numeric: tabular-nums; }

/* Sections */
.section { padding: 24px 0; }
.section__head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.section__head h2 { font-size: 26px; margin: 0; }
.section__subtitle { color: var(--muted); margin: 0; }

/* Disclaimer box */
.disclaimer-box { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; box-shadow: var(--shadow); }
.link { color: var(--accent); text-decoration: none; }
.link:hover, .link:focus { text-decoration: underline; }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.controls input[type="search"], .controls select { height: 36px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.controls input[type="search"]:focus, .controls select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; background: var(--accent); color: #fff; border: 1px solid var(--accent-600); border-radius: 8px; text-decoration: none; cursor: pointer; }
.btn:hover, .btn:focus { background: var(--accent-600); outline: none; }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { background: #F3F4F6; }
.btn--disabled { opacity: 0.5; pointer-events: none; }

/* Table */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
caption { text-align: left; padding: 10px; color: var(--muted); }
thead th { position: sticky; top: 0; background: #F9FAFB; border-bottom: 1px solid var(--border); text-align: left; padding: 10px; cursor: pointer; }
tbody td { border-top: 1px solid var(--border); padding: 10px; }
th:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Summary */
.summary { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; box-shadow: var(--shadow); }
.date-chip { display:inline-flex; align-items:center; height:20px; padding:0 8px; border-radius:999px; font-size:12px; font-weight:700; margin-left:6px; }
.date-chip--buy { background:#064E3B; color:#A7F3D0; border:1px solid #0F3C2E; }
.date-chip--sell { background:#7F1D1D; color:#FECACA; border:1px solid #5D1313; }

/* Fallback */
.fallback { margin-top: 12px; }
.fallback textarea { width: 100%; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 13px; }
.fallback__actions { margin-top: 8px; display: flex; gap: 10px; align-items: center; }

/* Chart placeholder */
.chart-placeholder { margin-top: 12px; background: repeating-linear-gradient(-45deg, #F3F4F6, #F3F4F6 10px, #E5E7EB 10px, #E5E7EB 20px); border: 1px dashed var(--border); border-radius: 8px; padding: 40px; text-align: center; color: var(--muted); }
.caveat { color: var(--muted); margin: 0; }

/* Lists */
.bullets { margin: 0; padding-left: 18px; }
.bullets li { margin-bottom: 6px; }
.bullets strong { color: var(--text); }

/* Footer */
.site-footer { margin-top: 24px; border-top: 1px solid var(--border); background: var(--surface); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.footer__nav { display: flex; gap: 12px; list-style: none; margin: 0; padding: 0; }
.footer__nav a { color: var(--text); text-decoration: none; }
.footer__nav a:hover, .footer__nav a:focus { text-decoration: underline; }
.footer__disclaimer { padding: 0 0 14px; color: var(--muted); font-size: 14px; }

/* Responsive */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .nav { gap: 8px; }
  .hero h1 { font-size: 28px; }
  thead th { font-size: 13px; }
  tbody td { font-size: 13px; }
}

/* Dashboard grid */
/* removed side-by-side grid per request; chart now full-width & taller */

.dashboard { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; }
.dashboard > .card { height: 100%; }
.dashboard__main { display: block; }
.dashboard__aside { display: flex; flex-direction: column; gap: 16px; }

.metric-strip { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.metric__label { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.metric__value { font-weight: 700; font-size: 18px; }

.signals-list { display: grid; gap: 8px; }
.signal-card { background: #0B1220; border: 1px solid #1F2A44; border-radius: 8px; padding: 10px 12px; display:flex; align-items:center; justify-content:flex-start; gap:10px; }
.signal-card__left { display:flex; align-items:center; gap:8px; }
.signal-card__symbol { font-weight:800; letter-spacing:0.3px; color:#FFFFFF; }
.signal-card__date { color:#9DB4D4; font-size:12px; }
.sig-chip { display:inline-flex; align-items:center; gap:6px; padding:2px 8px; border-radius:999px; font-size:12px; font-weight:700; }
.sig-chip.buy { background:#064E3B; color:#A7F3D0; }
.sig-chip.sell { background:#7F1D1D; color:#FECACA; }

@media (max-width: 920px) {
  .dashboard { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

/* New signals banner */
.banner-new { background: #0B1220; border: 1px solid #1F2A44; border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); color: #E5F4FF; }
.chip { display:inline-flex; align-items:center; gap:6px; padding:2px 8px; border-radius:999px; font-size:12px; font-weight:600; }
.chip--buy { background:#064E3B; color:#A7F3D0; }
.chip--sell { background:#7F1D1D; color:#FECACA; }

/* Pulse highlight for new rows */
@keyframes pulseRow { 0%{ box-shadow:0 0 0 0 rgba(59,130,246,0.0);} 50%{ box-shadow:0 0 0 6px rgba(59,130,246,0.15);} 100%{ box-shadow:0 0 0 0 rgba(59,130,246,0.0);} }
.row--new { animation: pulseRow 2s ease-out 2; }
.row--buy { outline: 1px solid rgba(34,197,94,0.35); }
.row--sell { outline: 1px solid rgba(239,68,68,0.35); }

