:root {

  --bg-950: #e9f4fb;
  --bg-900: #fff4dd;
  --bg-800: #ffffff;
  --text-100: #123140;
  --text-300: #4b6570;
  --gold-500: #0f7e9b;
  --gold-400: #0b5f77;
  --surface: rgba(255, 255, 255, 0.96);
  --border: #c8dbe3;
  --shadow-lg: 0 12px 24px rgba(12, 54, 68, 0.12);

  --bg-top: #e9f4fb;
  --bg-bottom: #fff4dd;
  --card: #ffffff;
  --ink: #123140;
  --muted: #4b6570;
  --accent: #0f7e9b;
  --accent-strong: #095f76;
  --warm: #d67b19;
  --ok: #1a7f4e;
  --warn: #9a5d00;
  --border: #c8dbe3;
  --shadow: 0 12px 24px rgba(12, 54, 68, 0.12);
  --glow-a: rgba(19, 143, 176, 0.18);
  --glow-b: rgba(220, 132, 32, 0.18);
  --field-border: #a9c4cf;
  --field-bg: #f9fdff;
  --btn-border: #9dbac5;
  --btn-bg: #f6fbfd;
  --btn-primary-top: #0d839f;
  --btn-primary-bottom: #0b5f77;
  --btn-primary-text: #ffffff;
  --btn-primary-border: #0a5d74;
  --focus-ring: #ffad3b;
  --status-bg: #f7fbfd;
  --warn-bg: #fff7e8;
  --warn-border: #f3d49f;
  --check-bg: #f4f9fb;
  --check-muted: #7b8e95;
  --check-done-bg: #e8f8f0;
  --metric-border: #b8d1db;
  --metric-bg-top: #f7fcff;
  --metric-bg-bottom: #f1f9fd;
  --table-head-bg: #edf7fb;
  --table-row-border: #d4e5ed;
  --graph-border: #b4d0db;
  --graph-bg: #f9fcfe;
  --fbd-border: #bed6de;
  --fbd-bg: #f9fcff;
  --readout-border: #d0e1e8;
  --readout-bg: #f5fbfe;

}



* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", "IBM Plex Sans", sans-serif;
  color: var(--text-100);
  background: #e9f4fb;
  line-height: 1.45;
}

h1,
h2,
h3,
h4,
p,
ul {
  margin: 0;
}

.page-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 1.2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  background: linear-gradient(160deg, #ffffff, #f7fbfd);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 12px;
  border-radius: 14px 0 0 14px;
  background: var(--accent-strong);
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.hero-top > :first-child {
  min-width: 0;
  padding-left: 0.4rem;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.hero h1 {
  font-size: clamp(1.8rem, 2.7vw, 3rem);
  line-height: 1.05;
  margin-top: 0.35rem;
  margin-bottom: 0;
  color: var(--text-primary);
}

.subtitle {
  margin: 0.38rem 0 0;
  color: var(--muted);
  line-height: 1.35;
  max-width: 76ch;
}

.layout {
  display: grid;
  grid-template-columns: minmax(360px, 470px) minmax(0, 1fr);
  gap: 1rem;
}

.machine-centerpiece {
  padding: 0.9rem;
  margin-bottom: 1rem;
}

.controls {
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.controls h2 {
  font-size: 1.15rem;
}

.control-grid {
  display: grid;
  gap: 0.65rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
  color: var(--muted);
}

select,
button {
  border-radius: 10px;
  background: linear-gradient(160deg, #0d839f, #0b5f77);
  color: #ffffff;
  font-weight: 700;
  border: 1px solid #0a5d74;
  padding: 0.58rem 0.82rem;
  cursor: pointer;
}

select {
  border: 1px solid var(--field-border);
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  color: var(--ink);
  background: var(--field-bg);
}

.toggle-row {
  display: grid;
  gap: 0.45rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
}

.action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

button {
  border-radius: 10px;
  background: linear-gradient(160deg, #0d839f, #0b5f77);
  color: #ffffff;
  font-weight: 700;
  border: 1px solid #0a5d74;
  padding: 0.58rem 0.82rem;
  cursor: pointer;
}

button.primary {
  background: linear-gradient(160deg, var(--btn-primary-top), var(--btn-primary-bottom));
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-border);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.status {
  min-height: 2.1rem;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  background: var(--status-bg);
}

.status[data-tone="ok"] {
  color: var(--ok);
}

.status[data-tone="warn"] {
  color: var(--warn);
  background: var(--warn-bg);
  border-color: var(--warn-border);
}

.checklist {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.checklist li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: var(--check-bg);
  font-size: 0.88rem;
}

.checklist li span {
  color: var(--check-muted);
  font-size: 0.82rem;
}

.checklist li.done {
  background: var(--check-done-bg);
}

.checklist li.done span {
  color: var(--ok);
  font-weight: 700;
}

.split-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.mini-list {
  list-style: none;
  padding: 0;
  margin-top: 0.45rem;
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.metric-card {
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--metric-border);
  background: linear-gradient(170deg, var(--metric-bg-top), var(--metric-bg-bottom));
  display: grid;
  gap: 0.25rem;
}

.metric-card h4 {
  font-size: 0.88rem;
}

.metric-card p {
  font-size: 0.82rem;
  color: var(--muted);
}

.metric-value {
  color: var(--ink);
  font-weight: 700;
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  max-height: 240px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
}

thead {
  position: sticky;
  top: 0;
  background: var(--table-head-bg);
}

th,
td {
  border-bottom: 1px solid var(--table-row-border);
  padding: 0.45rem;
  text-align: left;
  font-size: 0.82rem;
}

.table-button {
  border-radius: 10px;
  background: linear-gradient(160deg, #0d839f, #0b5f77);
  color: #ffffff;
  font-weight: 700;
  border: 1px solid #0a5d74;
  padding: 0.58rem 0.82rem;
  cursor: pointer;
}

.graphs-column {
  display: grid;
  gap: 1rem;
}

.graph-card {
  padding: 0.75rem;
}

.graph-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.4rem;
}

.graph-toolbar h3 {
  font-size: 1rem;
}

.nudge-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.nudge-controls button {
  border-radius: 10px;
  background: linear-gradient(160deg, #0d839f, #0b5f77);
  color: #ffffff;
  font-weight: 700;
  border: 1px solid #0a5d74;
  padding: 0.58rem 0.82rem;
  cursor: pointer;
}

.graph {
  width: 100%;
  height: 260px;
  border: 1px solid var(--graph-border);
  border-radius: 8px;
  background: var(--graph-bg);
}

.graph-help {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.fit-eq {
  margin-top: 0.45rem;
  font-weight: 700;
}

.fit-q {
  margin-top: 0.2rem;
  color: var(--muted);
}

.fbd-figure {
  border: 1px solid var(--fbd-border);
  border-radius: 8px;
  background: var(--fbd-bg);
  padding: 0.3rem;
}

.fbd-figure svg {
  width: 100%;
  height: auto;
}

.machine-canvas {
  width: 100%;
  height: 240px;
  border: 1px solid var(--graph-border);
  border-radius: 8px;
  background: var(--graph-bg);
}

.machine-scrub {
  margin-top: 0.55rem;
  display: grid;
  gap: 0.25rem;
}

.machine-scrub input[type="range"] {
  width: 100%;
}

.machine-readout {
  margin-top: 0.5rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

.machine-readout p {
  margin: 0;
  padding: 0.4rem 0.45rem;
  border: 1px solid var(--readout-border);
  border-radius: 8px;
  background: var(--readout-bg);
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer {
  margin-top: 1rem;
  padding: 0.6rem 0.2rem 0.2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .controls {
    order: 2;
  }

  .graphs-column {
    order: 1;
  }
}

@media (max-width: 680px) {
  .action-row {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .graph {
    height: 220px;
  }

  .machine-canvas {
    height: 210px;
  }

  .machine-readout {
    grid-template-columns: 1fr;
  }
}
