:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #192e43;
  background: #f2f5f8;
}

* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 960px; margin: 0 auto; padding: 48px 24px; }
a { color: #174f77; }
.eyebrow { font-size: .78rem; letter-spacing: .13em; text-transform: uppercase; color: #536b82; }
.eyebrow a { color: inherit; }
h1 { font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -.03em; margin: 12px 0; line-height: 1.12; }
.intro { font-size: 1.1rem; color: #536b82; max-width: 66ch; }
p, footer { line-height: 1.6; }
.panel { margin-top: 24px; padding: 24px 28px; background: white; border: 1px solid #d7e1ea; border-radius: 14px; }
h2 { margin: 0 0 16px; font-size: 1.2rem; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
input, select {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-weight: 400;
  color: #192e43;
  padding: 7px 9px;
  border: 1px solid #b9c8d6;
  border-radius: 6px;
  background: white;
}
input:disabled { background: #f2f5f8; }
button {
  font: inherit;
  padding: 9px 15px;
  border-radius: 7px;
  border: 1px solid #174f77;
  background: #174f77;
  color: white;
  cursor: pointer;
}
button:hover:not(:disabled) { filter: brightness(.93); }
button:disabled { opacity: .45; cursor: not-allowed; }
.secondary { background: white; color: #174f77; }
:focus-visible { outline: 3px solid #e7a840; outline-offset: 3px; }
.hint, footer { color: #536b82; font-size: .88rem; }
#status { margin: 12px 0 0; }
#error { color: #9a2323; font-size: .9rem; font-weight: 600; }
footer { margin-top: 28px; }
[hidden] { display: none !important; }

@media (max-width: 600px) {
  main { padding: 24px 16px; }
  .panel { padding: 18px; }
}

.viewer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 15.5rem); gap: 20px; }
canvas { width: 100%; height: auto; display: block; border: 1px solid #cbd8e4; border-radius: 8px; background: #f5f8fb; }
.facts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; margin-bottom: 0; }
.facts dt { color: #536b82; font-size: .83rem; }
.facts dd { margin: 3px 0 0; font-variant-numeric: tabular-nums; font-weight: 650; }
legend { font-weight: 650; padding: 0; margin-bottom: 8px; }
.field { display: grid; gap: 5px; font-size: .86rem; font-weight: 600; margin-bottom: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 740px) {
  .viewer { grid-template-columns: 1fr; }
}
#preset, #method { margin: 0 0 10px; }
label[for="preset"], label[for="method"] { margin-bottom: 5px; }
.view-settings { margin-top: 18px; padding-top: 4px; border-top: 1px solid #d7e1ea; }
.view-settings legend { padding-right: 8px; }
.view-settings input { accent-color: #174f77; }
.view-settings input[type="range"] { padding: 0; }
.switch { display: flex; align-items: center; gap: 7px; margin: 8px 0 0; color: #40586e; font-size: .88rem; }
.switch input { width: auto; }

.phase { display: block; margin-top: 12px; }
.phase output { float: right; }
.phase input { margin: 8px 0 0; accent-color: #174f77; }
.steps { margin-top: 10px; }
.table-scroll { overflow: auto; max-height: 34rem; border: 1px solid #d7e1ea; border-radius: 6px; margin: 12px 0; }
table { border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 10px; border: 1px solid #e0e8ef; text-align: right; white-space: nowrap; }
th { background: #f2f5f8; }
details { margin-top: 16px; }
summary { cursor: pointer; }
