/* ForkPath — two-panel financial scenario planner */

:root {
  --bg: #0f0f0f;
  --panel: #181818;
  --panel-alt: #1f1f1f;
  --border: #2a2a2a;
  --text: #e8e4df;
  --muted: #6b6b6b;
  --accent: #c9973a;
  --accent-dim: #8a6525;
  --scenario-1: #4ade80;
  --scenario-2: #38bdf8;
  --scenario-3: #f87171;
  --radius: 8px;
  --transition: 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* ── Layout ──────────────────────────────────────────────── */
#app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}

/* ── Left panel ──────────────────────────────────────────── */
.panel-left {
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-logo h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.panel-logo span {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 12px 4px;
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'Satoshi', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color var(--transition);
  position: relative;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--accent);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

/* ── Scenario builder ─────────────────────────────────────── */
.scenario-builder {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.scenario-builder h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 4px;
}

.scenario-builder p {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.4;
}

.scenario-group {
  margin-bottom: 20px;
  padding: 14px;
  background: var(--panel-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.scenario-group h3 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scenario-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-optimistic { background: var(--scenario-1); }
.dot-baseline   { background: var(--scenario-2); }
.dot-conservative { background: var(--scenario-3); }

.field {
  margin-bottom: 10px;
}

.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.field input {
  width: 100%;
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Satoshi', sans-serif;
  font-size: 0.85rem;
  transition: border-color var(--transition);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Right panel — graph ─────────────────────────────────── */
.panel-right {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
}

.graph-header {
  margin-bottom: 20px;
}

.graph-header h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent);
}

.graph-header p {
  font-size: 0.75rem;
  color: var(--muted);
}

.graph-container {
  flex: 1;
  position: relative;
  min-height: 0;
}

#graph {
  width: 100%;
  height: 100%;
}

.graph-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ── Axis labels ─────────────────────────────────────────── */
.axis-label {
  font-family: 'Satoshi', sans-serif;
  font-size: 11px;
  fill: var(--muted);
}

.axis-label-accent {
  font-family: 'Satoshi', sans-serif;
  font-size: 11px;
  fill: var(--accent);
}

.grid-line {
  stroke: var(--border);
  stroke-width: 1;
}

.scenario-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-optimistic { stroke: var(--scenario-1); }
.line-baseline   { stroke: var(--scenario-2); }
.line-conservative { stroke: var(--scenario-3); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }

  .panel-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .scenario-builder {
    overflow-y: visible;
  }

  .panel-right {
    min-height: 400px;
  }
}
