@font-face {
  font-family: "AlphaMono";
  src: url("fonts/OTAlphaMono-Regular.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Alpha";
  src: url("fonts/OTAlpha-Regular.woff2") format("woff2");
  font-display: swap;
}

/*
  Layout constants
  --col    = 300px × √2  (exact value set via JS: document.documentElement.style.setProperty)
  --single = 600px
  --gap    = 20px
*/
:root {
  font-size: 13px;
  --col:    424.264px;  /* 300px × √2 — overridden by JS with Math.SQRT2 */
  --single: 600px;
  --gap:    20px;
  --bg:           #0a0005;
  --card:         #14000b;
  --section-hd:   #2e0c1e;
  --panel-hdr:    #46102b;
  --bg-subtle:    #200613;
  --border:       #331022;
  --border-light: #240a17;
  --green:      #35c274;
  --red:        #ff5c4d;
  --highlight:  #ff80af;
  --text:       #fff;
  --muted:      rgba(255,255,255,.55);
}

body {
  font-family: "Alpha", Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
  margin: 0;
  padding: 0;
  min-height: 200vh;
}

h1, h2 { font-family: "AlphaMono", monospace; }
h1 { font-size: 2.15rem; font-weight: normal; margin: 0 0 6px; }
h2 { font-size: 1.25rem; font-weight: normal; margin: 0 0 6px; }
h3 { font-size: 1rem;    font-weight: normal; margin: 0 0 4px; }

/* ── Page header ──────────────────────────────────── */
.page-header {
  width: var(--single);
  padding: 75px 0;
  box-sizing: border-box;
}

.page-header-logo {
  display: block;
  height: 65px;
  margin-bottom: 50px;
}

.eyebrow {
  font-family: Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--highlight);
  margin-bottom: 6px;
}

.page-header p {
  color: var(--muted);
  font-style: italic;
  font-size: 14px;
  margin: 0;
}

.page-header-instructions {
  color: var(--muted);
  font-size: 14px;
  margin: 10px 0 0;
  padding-left: 20px;
  line-height: 1.65;
}

.page-header-instructions ul {
  padding-left: 16px;
  margin: 2px 0 0;
}

.page-header-instructions li {
  margin-bottom: 2px;
}

/* ── Main grid ────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--col) var(--col);
  grid-template-rows: auto auto;   /* row 1: 2-col panels; row 2: hedge span */
  gap: var(--gap);
  width: calc(2 * var(--col) + var(--gap));
  margin: 0 auto;
  padding-bottom: 80px;
}

/* Hedge area spans both columns, content centred at 600px */
.hedge-area {
  grid-column: 1 / -1;
  width: var(--single);
  margin: 0 auto;
  display: grid;
  gap: var(--gap);
}

/* ── Panel ────────────────────────────────────────── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-hdr {
  display: flex;
  align-items: center;
  background: var(--panel-hdr);
  padding: 10px 16px;
  flex-shrink: 0;
}

.panel-hdr-text {
  font-family: "AlphaMono", monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: white;
}

.panel-body {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.panel-content {
  padding: 14px 16px;
}

.panel-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.panel-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.55;
}

/* ── Reset button ─────────────────────────────────── */
.reset-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 11px;
  padding: 4px 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.reset-btn:hover {
  border-color: var(--highlight);
  color: var(--highlight);
}

/* ── Panel section headings ───────────────────────── */
.section-hd {
  display: flex;
  align-items: center;
  font-family: "AlphaMono", monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
  padding: 10px 16px;
  background: var(--section-hd);
  border-top: 1px solid var(--panel-hdr);
  border-bottom: 1px solid var(--panel-hdr);
}

/* ── Interval table ───────────────────────────────── */
.int-table {
  width: 100%;
  border-collapse: collapse;
}

.int-table th {
  font-family: Arial, sans-serif;
  font-weight: normal;
  color: var(--muted);
  text-align: left;
  padding: 6px 8px 8px 0;
  border-bottom: 1px solid var(--border);
}

.int-table td {
  padding: 5px 8px 5px 0;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.int-table tr:last-child td { border-bottom: none; }

.int-table input[type="number"] {
  width: 60px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: "AlphaMono", monospace;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-subtle);
}

.int-table input[type="number"]:focus {
  outline: none;
  border-color: var(--highlight);
}

/* Locked display values (From column, last-row To) */
.locked-val {
  font-family: "AlphaMono", monospace;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 6px;
  display: inline-block;
}

/* Insert-after button */
.row-ins {
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--green);
  line-height: 1;
  width: 22px;
  height: 22px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.row-ins:hover {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

/* Delete button */
.row-del {
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--red);
  width: 22px;
  height: 22px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.row-del:hover {
  color: white;
  border-color: var(--red);
  background: var(--red);
}

/* ── Contract Properties panel ────────────────────── */

/* Bullet list in panel desc */
.panel-desc-list {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 14px;
  padding-left: 18px;
}

.panel-desc-list li { margin-bottom: 2px; }

/* Contract Properties table */
.props-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.props-table tr {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}

.props-table tr:last-child { border-bottom: none; }

.props-table th[scope="row"] {
  flex: 4;
  color: var(--muted);
  font-weight: normal;
  text-align: left;
  padding: 6px 16px 6px 0;
}

.props-table td {
  flex: 7;
  padding: 6px 0;
}


.props-table input[type="number"] {
  width: 68px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: "AlphaMono", monospace;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-subtle);
}

.props-table input[type="number"]:focus {
  outline: none;
  border-color: var(--highlight);
}

.scb-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px;
}

.scb-toggle-btn {
  padding: 6px 4px;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-family: "AlphaMono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.scb-toggle-btn.active {
  background: var(--panel-hdr);
  color: white;
}

/* Derived value — IH number */
.props-number {
  font-family: "AlphaMono", monospace;
  font-size: 16px;
  font-weight: bold;
  color: var(--green);
}

/* Monospaced display for participation values */
.props-mono {
  font-family: "AlphaMono", monospace;
  font-size: 13px;
}



/* ── Panel reveal animation ──────────────────────── */
#setCard, #ccChartPanel, #scbChartPanel, #setResultCard {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease,
              display 0.3s allow-discrete;
}

#setCard.is-hidden, #ccChartPanel.is-hidden,
#scbChartPanel.is-hidden, #setResultCard.is-hidden {
  display: none;
  opacity: 0;
  transform: translateY(10px);
}

@starting-style {
  #setCard, #ccChartPanel, #scbChartPanel, #setResultCard {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ── SET verdict card ─────────────────────────────── */
.verdict-content p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
  line-height: 1.6;
}

.verdict-content p:last-child { margin-bottom: 0; }

/* ── Chart ────────────────────────────────────────── */
.chart-axis-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 4px;
}

.chart-div {
  height: 340px;
  margin: 0 -16px;
}

/* ── IH strip (chart panel) ───────────────────────────── */
.ih-strip {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.ih-strip-label {
  font-family: Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.ih-strip-value {
  font-family: "AlphaMono", monospace;
  font-size: 26px;
  font-weight: bold;
  color: var(--green);
}

.ih-strip-unit {
  font-size: 13px;
  color: var(--muted);
}
