/* ── Custom properties ────────────────────────────────────────────────────── */
:root {
  --bg:     #ffffff;
  --text:   #111111;
  --border: #999999;
  --pre-bg: #f4f4f4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #1a1a1a;
    --text:   #e0e0e0;
    --border: #555555;
    --pre-bg: #2a2a2a;
  }
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 12px 16px;
  max-width: 100%;
  overflow-x: hidden;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}

th,
td {
  border: 1px solid var(--border);
  padding: 4px 8px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* First column (data point label) gets a narrower fixed share */
table > thead > tr > th:first-child,
table > tbody > tr > td:first-child {
  width: 40%;
}

/* Nested tables produced by renderer.js stay inside their cell */
td table {
  width: 100%;
  margin: 0;
}

/* ── Button ───────────────────────────────────────────────────────────────── */
#start-btn {
  min-height: 44px;
  padding: 8px 16px;
  cursor: pointer;
}

/* ── JSON output ──────────────────────────────────────────────────────────── */
#json-output {
  background: var(--pre-bg);
  padding: 12px;
  overflow: auto;
  font-size: 12px;
  color: var(--text);
  max-width: 100%;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Plan-locked cells ────────────────────────────────────────────────────── */
td.plan-locked {
  background-color: #f0e8c8;
  color: #7a6a40;
  font-style: italic;
}

@media (prefers-color-scheme: dark) {
  td.plan-locked {
    background-color: #3a3020;
    color: #c0a860;
  }
}

/* ── Mobile adjustments ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
  body {
    padding: 8px;
    font-size: 13px;
  }

  th,
  td {
    padding: 3px 5px;
    font-size: 12px;
  }

  #json-output {
    font-size: 11px;
  }
}
