/* TrendSignal — drop-in replacement for static/style.css */

:root {
  --paper: #fffdf8;
  --ink: #12100c;
  --line: #e8e2d4;
  --muted: #6b665c;
  --faint: #a39c8b;
  --ghost: #e0d9c8;
  --dash: #c9c1ad;
  --blue: #3563c9;
  --red: #c94f3d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f0eee9;
  color: var(--ink);
  font-family: "Space Grotesk", Helvetica, Arial, sans-serif;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.app {
  width: 100%;
  max-width: 1000px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

/* ---------- top bar ---------- */
.topbar {
  background: var(--ink);
  padding: 16px 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.topbar .brand { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--paper); }
.topbar .tagline {
  font: 400 11px/1 "JetBrains Mono", ui-monospace, Menlo, monospace;
  letter-spacing: 0.1em;
  color: #8a8578;
}

/* ---------- two-column body ---------- */
.body { display: grid; grid-template-columns: 318px 1fr; }
@media (max-width: 820px) { .body { grid-template-columns: 1fr; } }

.rail {
  padding: 32px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 26px;
}
@media (max-width: 820px) { .rail { border-right: none; border-bottom: 1px solid var(--line); } }

.eyebrow {
  font: 400 10.5px/1 "JetBrains Mono", ui-monospace, Menlo, monospace;
  letter-spacing: 0.14em;
  color: var(--faint);
}

/* ---------- the big r ---------- */
.r-value {
  font-size: 96px;
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: -0.05em;
  margin: 12px 0 0;
}
.r-value.empty { color: var(--ghost); }
.r-strength { font-size: 14px; font-weight: 500; color: var(--red); margin: 10px 0 0; }
.r-note { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin: 8px 0 0; text-wrap: pretty; }
.r-note strong { font-weight: 500; color: var(--ink); }

/* ---------- term pickers ---------- */
.picker { display: flex; flex-direction: column; gap: 10px; }

.slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
/* the select's <span> wrapper defaults to fit-content width, which shrinks
   the clickable area down to the text instead of filling the slot */
.slot > span {
  flex: 1;
  min-width: 0;
}
.slot:hover { background: #f5f2ea; }
.slot.empty { border-style: dashed; border-color: var(--dash); }
.slot.empty:hover { border-color: var(--ink); }
.slot .label {
  display: block;
  font: 400 10px/1 "JetBrains Mono", ui-monospace, Menlo, monospace;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-bottom: 3px;
}
.slot .value { font-size: 15px; font-weight: 500; color: var(--ink); }
.slot.empty .value { color: var(--faint); }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; display: block; }
.dot.a { background: var(--blue); }
.dot.b { background: var(--red); }
.dot.pending { border: 1.5px dashed var(--dash); }

/* native selects styled as slots */
.slot select {
  appearance: none;
  border: none;
  background: transparent;
  font: 500 15px/1 "Space Grotesk", Helvetica, sans-serif;
  color: var(--ink);
  padding: 0;
  width: 100%;
  cursor: pointer;
}
.slot select:focus { outline: none; }

/* ---------- buttons ---------- */
.btn {
  font: 500 14px/1 "Space Grotesk", Helvetica, sans-serif;
  color: var(--paper);
  background: var(--ink);
  border: none;
  border-radius: 7px;
  padding: 15px 18px;
  margin-top: 4px;
  cursor: pointer;
}
.btn:hover { background: #332e24; }
.btn:disabled { color: #b8b0a0; background: #f1ede3; cursor: not-allowed; }

/* ---------- presets ---------- */
.presets { display: flex; flex-direction: column; gap: 9px; padding-top: 22px; border-top: 1px solid var(--line); }
.presets a {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #d6cfbd;
  text-underline-offset: 3px;
}
.presets a:hover { text-decoration-color: var(--ink); }

/* ---------- stats footer in rail ---------- */
.stats { display: flex; gap: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .k { font: 400 10px/1 "JetBrains Mono", ui-monospace, Menlo, monospace; letter-spacing: 0.12em; color: var(--faint); }
.stat .v { font-size: 18px; font-weight: 500; }

/* ---------- chart column ---------- */
.chart-col { padding: 32px 32px 22px; display: flex; flex-direction: column; gap: 14px; }

.chart-frame { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px; }
.chart-frame img { display: block; width: 100%; height: auto; border-radius: 4px; }

.chart-empty {
  position: relative;
  border: 1px dashed #ded7c5;
  border-radius: 8px;
  background: repeating-linear-gradient(135deg, #faf7ef 0 9px, #f3eee2 9px 18px);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}
.chart-empty .headline {
  font: 500 12px/1 "JetBrains Mono", ui-monospace, Menlo, monospace;
  letter-spacing: 0.12em;
  color: #8a8578;
}
.chart-empty .sub { font-size: 13px; line-height: 1.5; color: var(--faint); max-width: 34ch; margin: 8px auto 0; text-wrap: pretty; }

/* ---------- legend ---------- */
.legend { display: flex; gap: 22px; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.legend i { width: 18px; height: 3px; display: block; }
.legend i.a { background: var(--blue); }
.legend i.b { background: var(--red); }
.legend i.off { background: #ded7c5; }
.legend span.off { color: #c1baa8; }

/* ---------- error ---------- */
.error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fdf1ee;
  border: 1px solid #f0cfc6;
  border-radius: 7px;
  padding: 12px 14px;
  font-size: 13px;
  color: #8f2f1d;
}
.error .bullet { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }

.footnote {
  font: 400 11.5px/1.5 "JetBrains Mono", ui-monospace, Menlo, monospace;
  color: var(--faint);
  margin: 6px 0 0;
}
