/* styles.css — settlethedebt.com · theme_05 "Maritime Chartroom Workbench"
   Tokens: bg #0c192c · surface #132640 · ink #f1f5f9 · accent #38bdf8 · muted #94a3b8
   System sans + monospace coordinate tables. Zero external assets. */

:root {
  --bg: #0c192c;
  --surface: #132640;
  --surface-2: #0f2038;
  --ink: #f1f5f9;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, .12);
  --muted: #94a3b8;
  --line: #27405f;
  --danger: #f87171;
  --warn: #fbbf24;
  --pass: #34d399;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(56, 189, 248, .10), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}
h1, h2, h3 { line-height: 1.2; color: var(--ink); }
h1 { font-size: 2.15rem; margin: .2em 0 .45em; letter-spacing: -.01em; }
h2.sec { font-size: 1.45rem; margin: 0 0 .45em; }
h3 { font-size: 1.1rem; margin: 1.15em 0 .4em; }
a { color: var(--accent); }
a:hover, a:focus { text-decoration-thickness: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .86em; }
code { font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; color: var(--accent); font-weight: 700; }
.readout { font-family: var(--mono); font-size: .9rem; color: var(--ink); }

/* ---------- top horizon bar ---------- */
header.site {
  background: linear-gradient(180deg, rgba(19, 38, 64, .96), rgba(12, 25, 44, .96));
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
header.site .wrap.horizon { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.brand { font-size: 1.28rem; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.brand span { color: var(--accent); }
nav.primary { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
nav.primary a { color: var(--muted); text-decoration: none; font-size: .9rem; }
nav.primary a:hover, nav.primary a:focus { color: var(--accent); }
.disc-chip {
  font-size: .72rem; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; background: var(--surface-2); white-space: nowrap;
}

/* ---------- hero + disclosure ---------- */
.hero { padding: 42px 0 24px; }
.hero p { max-width: 74ch; }
.hero .disc {
  background: rgba(251, 191, 36, .10);
  border-left: 3px solid var(--warn);
  padding: 10px 14px; border-radius: 0 8px 8px 0;
  font-size: .88rem; margin-top: 14px; color: var(--ink);
}

/* ---------- horizontal calculator strip ---------- */
.chart-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 8px 0 26px;
}
.calc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 86px;
}
.calc-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.calc-value { display: block; font-family: var(--mono); font-size: 1.18rem; font-weight: 700; margin-top: 8px; color: var(--ink); }

/* ---------- wizard ---------- */
.wizard { margin: 8px 0 30px; }
.progress { height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.progress > span { display: block; height: 100%; background: var(--accent); width: 0%; transition: width .25s ease; }
.progress-meta { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-bottom: 16px; font-family: var(--mono); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.step-tab {
  font: inherit; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; color: var(--ink);
}
.step-tab .num { display: block; font-family: var(--mono); font-size: .72rem; color: var(--accent); }
.step-tab .lbl { font-size: 1rem; font-weight: 700; }
.step-tab[aria-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.step-tab .done-mark { float: right; color: var(--accent); font-weight: 700; }
.panel { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.panel.active { display: block; }
.panel h2 { margin-top: 0; }
.checklist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.checklist li {
  display: flex; align-items: center; gap: 10px; font-size: .9rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}
.checklist li .tick { color: var(--muted); }
.checklist li.done .tick { color: var(--pass); font-weight: 700; }
.checklist li.done { border-color: var(--pass); }
.wiz-nav { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- controls ---------- */
.strip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.field label { display: block; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface-2); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field textarea { min-height: 90px; resize: vertical; font-family: var(--mono); font-size: .82rem; }
.field input[type="range"] { padding: 0; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
.score { font-family: var(--mono); font-weight: 700; }

/* ---------- rules / rubric ---------- */
.rubric { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rubric li {
  display: flex; gap: 10px; align-items: flex-start; font-size: .9rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
}
.rubric li input { margin-top: 4px; accent-color: var(--accent); }
.rule { display: flex; gap: 10px; align-items: flex-start; }
.rule-badge {
  flex: 0 0 auto; font-family: var(--mono); font-size: .68rem; font-weight: 800;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.rule.pass .rule-badge { color: var(--pass); border-color: var(--pass); background: rgba(52, 211, 153, .08); }
.rule.warn .rule-badge { color: var(--warn); border-color: var(--warn); background: rgba(251, 191, 36, .08); }
.rule.fail .rule-badge { color: var(--danger); border-color: var(--danger); background: rgba(248, 113, 113, .08); }
.rule-detail { display: block; font-size: .8rem; color: var(--muted); margin-top: 3px; }
.rule.pass { border-color: rgba(52, 211, 153, .35); }
.rule.warn { border-color: rgba(251, 191, 36, .35); }
.rule.fail { border-color: rgba(248, 113, 113, .4); }

/* ---------- scenario cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin-bottom: 18px; }
.scenario-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.scenario-card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.scenario-card .blurb { font-size: .82rem; color: var(--muted); margin: 0 0 10px; }
.scenario-card .stat { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; padding: 3px 0; border-top: 1px dashed var(--line); }
.scenario-card .stat .k { color: var(--muted); }
.scenario-card .stat .v { font-family: var(--mono); font-weight: 700; }
.scenario-card.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* ---------- plot canvas ---------- */
.plot { width: 100%; height: auto; display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; margin-top: 12px; }
.plot .grid-line { stroke: var(--line); stroke-width: 1; }
.plot .axis { stroke: var(--muted); stroke-width: 1.3; }
.plot text { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.channel-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0 4px; }
.channel-stats .stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; display: flex; justify-content: space-between; gap: 8px; font-size: .84rem; }
.channel-stats .k { color: var(--muted); }
.channel-stats .v { font-family: var(--mono); font-weight: 700; }

/* ---------- buttons / export ---------- */
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 8px;
  padding: 10px 18px; border: 1px solid var(--accent); background: var(--accent); color: #06121f;
}
.btn:hover { background: #7dd3fc; }
.btn.secondary { background: var(--surface); color: var(--accent); }
.btn.secondary:hover { background: var(--accent-soft); }
.btn:disabled { opacity: .55; cursor: default; }
.export-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.receipt {
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px;
  word-break: break-all;
}

/* ---------- prose / footer ---------- */
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px 26px; margin-bottom: 30px; }
.prose ul.tight { padding-left: 20px; }
footer.site { border-top: 1px solid var(--line); background: var(--surface-2); margin-top: 20px; }
footer.site .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; font-size: .85rem; color: var(--muted); }
footer.site nav { display: flex; gap: 14px; flex-wrap: wrap; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  h1 { font-size: 1.55rem; }
  nav.primary { margin-left: 0; }
  .panel, .strip-grid, .prose { padding: 16px; }
  .disc-chip { display: none; }
  .calc-card { min-height: 74px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress > span { transition: none; }
}
