:root {
  color-scheme: light;
  --ink: #20252c;
  --muted: #626b77;
  --line: #d8dde3;
  --soft: #f4f6f8;
  --error: #a2262c;
  --warning: #805614;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; }
button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid #aeb6c0;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}
button:hover { background: var(--soft); border-color: #858f9b; }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: #252b33; color: #fff; border-color: #252b33; }
.primary:hover { background: #414a55; border-color: #414a55; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #315f9c;
  outline-offset: 3px;
}
.masthead { border-bottom: 1px solid var(--line); padding: 11px 24px; }
.brand { font-size: 15px; font-weight: 650; text-decoration: none; }
main { max-width: 1600px; margin: auto; padding: 22px 24px; }
h1 { font-size: 22px; line-height: 1.25; font-weight: 650; margin: 0; }
h2 { font-size: 19px; line-height: 1.3; margin: 0; font-weight: 650; }
h3 { font-size: 15px; line-height: 1.35; margin: 0 0 12px; font-weight: 650; }
h4 { font-size: 13px; margin: 18px 0 8px; font-weight: 650; }
p { margin: 0 0 10px; }
.project-bar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.project-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 12px; margin-top: 5px; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.tabs { display: flex; gap: 16px; overflow: auto; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-radius: 0; padding: 9px 2px; white-space: nowrap; font-weight: 450; }
.tabs .active { box-shadow: inset 0 -2px var(--ink); font-weight: 650; }
.solve-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; }
.solve-bar p { margin: 0; font-size: 13px; }
.worksheet { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 22px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; min-width: 720px; text-align: left; }
th { padding: 10px 12px; background: var(--soft); font-size: 12px; font-weight: 600; color: #46505b; white-space: nowrap; }
td { padding: 11px 12px; border-top: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
td:first-child { min-width: 220px; }
td:first-child strong { display: block; font-size: 13px; font-weight: 600; }
td small { display: block; color: var(--muted); margin-top: 3px; font-size: 12px; }
td button { min-height: 32px; padding: 5px 8px; font-size: 12px; white-space: nowrap; }
.tag { font-size: 13px; }
.tag.gap, .result-gap { color: var(--error); font-weight: 600; }
.tag.changed, .result-unproven { color: var(--warning); }
.tag.stale { color: var(--muted); }
.lock-on { border-color: #737d89; font-weight: 650; }
.explanation { align-self: start; border-left: 1px solid var(--line); padding-left: 20px; font-size: 12px; }
.explanation h3 { margin-top: 0; }
.explanation ul { padding-left: 17px; margin: 8px 0 12px; }
.explanation li { margin-bottom: 5px; }
.explanation button { margin-top: 4px; }
.explanation details { margin-top: 10px; }
.facts { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin: 0 0 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.measure { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 16px; }
.measure > strong { display: block; margin-bottom: 9px; font-weight: 600; }
.loads { gap: 4px 12px; }
.under-table { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; }
.under-table span { display: none; font-size: 11px; color: var(--muted); }
.result-actions { padding-top: 10px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 22px 0 16px; }
.section-heading h3 { margin-bottom: 5px; }
.section-heading p { color: var(--muted); font-size: 12px; margin: 0; }
.people-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.person { display: flex; justify-content: space-between; gap: 16px; padding: 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.person > div { min-width: 0; }
.person h4 { margin: 0 0 6px; }
.person p { margin: 3px 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.person button { align-self: start; }
.setup-columns { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; }
.setup-columns h4 { margin-top: 0; }
.setup-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.setup-item > span { min-width: 0; }
.setup-columns > div > button { margin-top: 12px; }
details { margin-top: 20px; }
summary { cursor: pointer; font-weight: 550; margin-bottom: 8px; }
textarea { width: 100%; background: #fff; border: 1px solid #aeb6c0; border-radius: 3px; padding: 10px; margin: 8px 0; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
label { font-size: 12px; font-weight: 600; }
footer { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 14px; color: var(--muted); font-size: 12px; }
footer details { margin-top: 10px; max-width: 850px; }
.message { border: 1px solid var(--line); border-left: 3px solid #6c7784; padding: 12px; margin-bottom: 16px; background: var(--soft); }
.message.error { border-left-color: var(--error); }
dialog { width: min(550px, calc(100% - 28px)); max-height: 90dvh; padding: 22px; border: 1px solid #aeb6c0; border-radius: 4px; background: #fff; color: var(--ink); }
dialog::backdrop { background: #11182066; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.dialog-heading button { border: 0; padding: 0 5px; font-size: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.field input, .field select { width: 100%; min-width: 0; padding: 9px; border: 1px solid #aeb6c0; border-radius: 3px; background: #fff; color: var(--ink); }
fieldset { min-width: 0; border: 1px solid var(--line); padding: 12px; margin: 14px 0; }
legend { font-size: 12px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-weight: 400; }
.check input { width: 17px; height: 17px; flex-shrink: 0; accent-color: #424d5a; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.danger { color: var(--error); margin-right: auto; }
.form-error { color: var(--error); font-size: 12px; }
.block-time { display: block; overflow-wrap: anywhere; font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; font-variant-numeric: tabular-nums; font-weight: 400; }
.shift-block { margin-bottom: 22px; }
.shift-endpoint { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.shift-endpoint input { min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
[hidden] { display: none !important; }
@media (max-width: 1050px) {
  .worksheet { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .explanation { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; max-width: 520px; }
  .project-bar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 650px) {
  .masthead { padding: 10px 16px; }
  main { padding: 18px 16px; }
  h1 { font-size: 20px; }
  .project-bar { gap: 12px; }
  .project-bar .actions { gap: 6px; }
  .project-bar .actions button { font-size: 12px; padding: 7px 9px; }
  .tabs { gap: 12px; }
  .tabs button { font-size: 12px; padding: 10px 0; }
  .solve-bar { align-items: flex-start; gap: 12px; }
  .solve-bar .actions { flex-shrink: 0; }
  .solve-bar p { font-size: 12px; }
  .people-list, .setup-columns { grid-template-columns: 1fr; }
  .setup-columns { gap: 22px; }
  .section-heading { align-items: flex-start; }
  .under-table span { display: inline; }
  .result-actions button { font-size: 12px; }
  .shift-endpoint { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
