/* tearai.online — MAURI State Witness
   mission-control dark theme, precision-engineering aesthetic.
   for fresko ◆ */

:root {
  --bg: #0a0d14;
  --bg-2: #10141f;
  --bg-3: #1a1f2e;
  --fg: #e6eaf2;
  --fg-dim: #8a93a8;
  --fg-mute: #4b5266;
  --accent: #6de7c1;
  --accent-2: #8aa6ff;
  --green: #4ad68a;
  --amber: #f0b860;
  --red: #ef6772;
  --grid: #232938;
  --mono: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ─── gate ───────────────────────────────────────────────────────────────── */
.gate {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(109,231,193,0.08), transparent 60%),
    var(--bg);
}
.gate-inner {
  width: min(420px, 92vw);
  text-align: center;
  padding: 32px;
}
.wordmark {
  font-family: var(--mono);
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: var(--fg-dim);
  margin-bottom: 28px;
}
.wordmark .mark { color: var(--fg); }
.wordmark .dot  { color: var(--accent); margin: 0 0.35em; }
.wordmark .sub  { color: var(--fg-mute); font-size: 0.85em; }
.gate h1 {
  font-weight: 300;
  font-size: 28px;
  letter-spacing: 0.03em;
  margin: 0 0 8px 0;
}
.gate .tag {
  color: var(--fg-dim);
  font-style: italic;
  margin: 0 0 28px 0;
}
#unlock-form {
  display: flex; gap: 8px;
}
#unlock-form input {
  flex: 1;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--grid);
  border-radius: 4px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.05em;
}
#unlock-form input:focus {
  outline: none;
  border-color: var(--accent);
}
#unlock-form button {
  padding: 12px 18px;
  background: var(--accent);
  color: var(--bg);
  border: 0;
  border-radius: 4px;
  font-weight: 600;
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: lowercase;
  cursor: pointer;
}
#unlock-form button:hover { background: #82ecc9; }
.error {
  color: var(--red);
  font-family: var(--mono);
  margin-top: 16px;
}
.foot {
  margin-top: 40px;
  color: var(--fg-mute);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
}

/* ─── view ───────────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--grid);
  background: var(--bg-2);
  position: sticky; top: 0; z-index: 10;
}
.brand {
  font-family: var(--mono);
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--fg-dim);
}
.brand .mark { color: var(--fg); }
.brand .dot  { color: var(--accent); margin-left: 0.35em; }
.chip {
  padding: 4px 10px;
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
}
.chip-live { background: rgba(74,214,138,0.18); color: var(--green); border: 1px solid rgba(74,214,138,0.4); }
.chip-dark { background: rgba(239,103,114,0.15); color: var(--red); border: 1px solid rgba(239,103,114,0.4); }
.reason {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
}
.spacer { flex: 1; }
.updated {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
}
.dark-banner {
  margin: 12px 24px;
  padding: 14px 18px;
  background: rgba(239,103,114,0.08);
  border: 1px solid rgba(239,103,114,0.3);
  border-radius: 4px;
  color: var(--fg);
  font-size: 13px;
}
.band {
  padding: 20px 24px;
  border-bottom: 1px solid var(--grid);
}
.band h2 {
  margin: 0 0 16px 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.band h2 .sub {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-mute);
  margin-left: 8px;
}
.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}
.chart-pane {
  background: var(--bg-2);
  border: 1px solid var(--grid);
  border-radius: 4px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.chart-head {
  display: flex; justify-content: space-between; align-items: baseline;
}
.chart-instrument {
  font-family: var(--mono);
  letter-spacing: 0.1em;
  color: var(--fg);
}
.chart-price {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}
.chart-price.stale { color: var(--fg-mute); }
.chart-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
}
.chart-canvas {
  width: 100%; height: 100px;
  background: var(--bg-3);
  border-radius: 3px;
}
.axes {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.axis {
  background: var(--bg-2);
  border: 1px solid var(--grid);
  border-radius: 4px;
  padding: 10px;
  text-align: center;
}
.axis-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.axis-bar {
  height: 60px;
  background: var(--bg-3);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.axis-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, var(--accent), var(--accent-2));
  transition: height 0.4s ease;
}
.axis-fill.dark { background: var(--fg-mute); opacity: 0.3; }
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.metric {
  background: var(--bg-2);
  border: 1px solid var(--grid);
  border-radius: 4px;
  padding: 14px;
}
.metric-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 6px;
}
.metric-value {
  font-family: var(--mono);
  font-size: 20px;
  color: var(--fg);
}
.metric-value.big { font-size: 28px; color: var(--accent); }
.ledger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ledger-cell {
  background: var(--bg-2);
  border: 1px solid var(--grid);
  border-radius: 4px;
  padding: 14px;
}
.positions {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}
.positions th, .positions td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--grid);
}
.positions th:first-child, .positions td:first-child {
  text-align: left;
}
.positions th {
  color: var(--fg-mute);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 10px;
}
.actions {
  background: var(--bg-2);
  border: 1px solid var(--grid);
  border-radius: 4px;
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12px;
}
.action-row {
  padding: 6px 0;
  border-bottom: 1px solid var(--grid);
  display: flex; gap: 12px;
}
.action-row:last-child { border-bottom: 0; }
.action-ts { color: var(--fg-mute); min-width: 150px; }
.action-kind { color: var(--accent); min-width: 80px; text-transform: uppercase; }
.muted { color: var(--fg-mute); font-style: italic; }
.footbar {
  padding: 18px 24px;
  display: flex; gap: 10px; align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  text-transform: lowercase;
}
