:root {
  color-scheme: light;
  --ink: #182c39;
  --muted: #485b68;
  --page: #f4f7f8;
  --surface: #fff;
  --line: #bccbd2;
  --brand: #195568;
  --brand-dark: #103e4d;
  --focus: #006c9c;
  --info-bg: #eaf3f7;
  --info: #224e61;
  --warn-bg: #fff4d9;
  --warn: #603b00;
  --error-bg: #fcebea;
  --error: #84251f;
  --good-bg: #e0f2e8;
  --good: #185840;
  --radius: 12px;
  --control-radius: 8px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: 1rem; line-height: 1.55; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); letter-spacing: -.035em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.125rem; }
p, ul, dl { margin: 0; }
a { color: var(--brand); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: absolute; z-index: 1; inset: 8px auto auto 8px; background: var(--surface); padding: 12px; transform: translateY(-150%); }
.skip:focus { transform: none; }
.shell { width: min(100%, 1120px); margin-inline: auto; padding-inline: 16px; }
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead-inner, .page-heading, .actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.masthead-inner { min-height: 68px; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand span { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: var(--brand-dark); color: var(--surface); border-radius: 8px; font-size: .85rem; }
main { min-height: 70vh; padding-block: 24px; }
main > * + *, .flow > * + *, .measure > * + * { margin-top: 16px; }
main > section + section { margin-top: 24px; }
.footer { padding-block: 20px 32px; color: var(--muted); }
.measure { width: min(100%, 520px); }
.eyebrow { color: var(--brand); font-size: .875rem; font-weight: 650; text-transform: uppercase; letter-spacing: .065em; margin-bottom: 8px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.badge { display: inline-block; border-radius: 100px; padding: 4px 10px; background: var(--info-bg); color: var(--info); font-size: .875rem; font-weight: 650; }
.badge.reviewed { background: var(--good-bg); color: var(--good); }
.notice { border-radius: var(--control-radius); background: var(--info-bg); color: var(--info); padding: 12px 16px; }
.notice.error { background: var(--error-bg); color: var(--error); }
.notice.warning { background: var(--warn-bg); color: var(--warn); }
.notice ul { margin-top: 8px; padding-left: 24px; }
.notice li + li { margin-top: 4px; }
.muted, small { color: var(--muted); }
.filename { overflow-wrap: anywhere; font-weight: 650; }
label { display: block; min-width: 0; font-weight: 650; }
input:not([type=checkbox]):not([type=hidden]) { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--control-radius); min-height: 44px; font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); }
input[type=file] { max-width: 420px; }
input[type=file]::file-selector-button { color: var(--brand-dark); font: inherit; cursor: pointer; }
.field-issue { display: block; margin-top: 4px; font-weight: 500; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.inline-form label { flex: 1 1 240px; max-width: 420px; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; flex: 0 0 auto; accent-color: var(--brand-dark); }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; background: var(--brand-dark); color: var(--surface); border: 1px solid var(--brand-dark); border-radius: var(--control-radius); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--brand); }
.secondary { background: var(--surface); color: var(--brand-dark); border-color: var(--line); }
.secondary:hover { background: var(--info-bg); }
button:disabled { opacity: .65; cursor: not-allowed; }
.upload-list { padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.upload-list li { padding: 8px 16px; display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; }
.upload-list li + li { border-top: 1px solid var(--line); }
.upload-list a { display: flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; font-weight: 650; }
.field-grid, .muscle-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); }
.muscle-row { padding-top: 12px; border-top: 1px solid var(--line); align-items: start; }
.muscle-label { grid-column: 1 / -1; }
.muscle-row button { align-self: end; justify-self: start; }
.details { overflow-wrap: anywhere; }
.details dt { font-weight: 650; }
.details dd { margin: 4px 0 0; min-height: 1.5rem; }
.table-wrap { overflow-x: auto; }
.print-only { display: none; }
.grid { border-collapse: collapse; width: 100%; min-width: 340px; font-variant-numeric: tabular-nums; }
.grid caption { text-align: left; font-weight: 700; padding: 0 0 6px; }
.grid th, .grid td { border: 1px solid var(--line); padding: 8px; overflow-wrap: anywhere; }
.grid thead th { background: var(--info-bg); }
.grid th:first-child { width: 52%; text-align: left; }
.grid th:not(:first-child), .grid td { text-align: right; }

@media (min-width: 640px) {
  .shell { padding-inline: 24px; }
  main { padding-block: 32px; }
  .panel { padding: 24px; }
  .muscle-row { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto; }
  .muscle-label { grid-column: auto; }
  .muscle-row button { align-self: start; margin-top: 28px; }
}

@media print {
  .print-only { display: block; }
  body, .panel { background: white; color: black; }
  .masthead, .footer, .no-print, .skip { display: none; }
  .grid th, .grid td { border-color: black; }
  .grid tr { break-inside: avoid; }
  .table-wrap { overflow: visible; }
}
