:root {
  color-scheme: light;
  --canvas: #f5f4ed;
  --paper: #fffef9;
  --ink: #202922;
  --muted: #525c52;
  --line: #dbded2;
  --light-line: #e9ebe2;
  --accent: #244934;
  --accent-dark: #183625;
  --selected: #e9efe2;
  --full: #b9cead;
  --short: #edd9ad;
  --post: #344f3b;
  --error: #8a3b28;
  --error-bg: #f8ece5;
  --font: "Aptos", "Segoe UI", system-ui, sans-serif;
  --display: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 1rem/1.5 var(--font); }
p, h1, h2, h3, dl { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .47; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.shell { width: min(100% - 64px, 1160px); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 750; text-decoration: none; }
.brand-icon { display: inline-flex; gap: 3px; height: 22px; align-items: center; color: var(--accent); position: relative; }
.brand-icon::before, .brand-icon::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; }
.brand-icon::before { top: 8px; }
.brand-icon::after { bottom: 5px; }
.brand-icon i { background: currentColor; width: 4px; height: 19px; clip-path: polygon(50% 0, 100% 18%, 100% 100%, 0 100%, 0 18%); }
.guide-link { font-size: .875rem; font-weight: 650; text-underline-offset: 4px; }
.guide-link span { margin-left: 5px; }

.intro { padding: 40px 0 34px; }
h1 { font: 400 clamp(2.5rem, 5.65vw, 4.65rem)/.99 var(--display); letter-spacing: -.055em; color: var(--accent-dark); }
.title-break { display: none; }
.intro p { margin-top: 16px; font-size: clamp(.98rem, 1.7vw, 1.14rem); color: var(--muted); max-width: 39rem; }
.workspace { display: grid; grid-template-columns: minmax(260px, 328px) minmax(0, 1fr); align-items: start; gap: 20px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 3px 12px #21372a07; padding: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h2 { font-size: 1.22rem; line-height: 1.23; letter-spacing: -.025em; }
h3 { font-size: 1rem; line-height: 1.25; }
.help { font-size: .9rem; color: var(--muted); }
.field-help { font-size: .82rem; color: var(--muted); }
.inputs > .help { margin: 13px 0 20px; }
.inputs label { display: block; font-size: .9rem; font-weight: 650; line-height: 1.3; margin-bottom: 5px; }
input { border: 1px solid #b9c2b4; border-radius: 7px; background: #fff; width: 100%; padding: 8px 11px; min-height: 43px; font-variant-numeric: tabular-nums; }
input + label, .field-help + label { margin-top: 17px; }
input + .field-help { margin-top: 4px; }
input[aria-invalid] { border-color: var(--error); }
.feedback { color: var(--error); background: var(--error-bg); border-left: 3px solid #bb795e; border-radius: 4px; margin-top: 11px; padding: 8px 11px; font-size: .88rem; }
.text-button { padding: 5px 0; color: var(--accent); background: transparent; border: 0; font-size: .82rem; font-weight: 700; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.primary { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 45px; margin-top: 23px; padding: 8px 13px; background: var(--accent); border: 1px solid transparent; border-radius: 8px; color: #fff; font-weight: 650; }
.primary:hover { background: var(--accent-dark); }
.primary span { font-size: 1.16rem; }

.result-heading { flex-wrap: wrap; }
#layout-heading { scroll-margin-top: 16px; }
.print-title { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.secondary { border: 1px solid #bac5b7; border-radius: 7px; background: var(--paper); padding: 6px 11px; color: var(--accent); font-size: .82rem; font-weight: 650; min-height: 35px; }
.secondary:not(:disabled):hover { background: var(--selected); }
#empty-state { padding-top: 16px; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.choices button { display: flex; align-items: flex-start; flex-direction: column; text-align: left; justify-content: center; gap: 3px; min-height: 61px; min-width: 0; background: var(--paper); border: 1px solid #cdd4c6; border-radius: 8px; padding: 8px 11px; }
.choices button:hover { border-color: var(--accent); }
.choices button[aria-pressed="true"] { color: var(--accent-dark); border-color: #657d60; background: var(--selected); box-shadow: inset 0 0 0 1px #657d60; }
.choices span { font-size: .88rem; line-height: 1.2; font-weight: 740; }
.choices small { color: var(--muted); line-height: 1.2; font-size: .78rem; }
.choices .unavailable small { color: var(--error); }
.selection { padding: 18px 0 0; }
.selection-title { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: baseline; gap: 5px 12px; }
.selection-title p { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.selection .help { margin-top: 4px; }
.drawing { display: grid; height: 55px; margin: 17px 3px 0; border-bottom: 2px solid var(--post); position: relative; }
.bay { height: 42px; display: grid; place-items: center; position: relative; align-self: end; font-size: .8rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; border-top: 2px solid #354e37; }
.bay::before, .bay:last-child::after { content: ""; position: absolute; width: 4px; top: -8px; bottom: -2px; background: var(--post); border-radius: 2px 2px 0 0; z-index: 1; }
.bay::before { left: -2px; }
.bay:last-child::after { right: -2px; }
.bay-full { background: repeating-linear-gradient(90deg, var(--full) 0 12px, #a8c19c 12px 13px); }
.bay-short { background: repeating-linear-gradient(90deg, var(--short) 0 12px, #e1c896 12px 13px); }
.ruler { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); font-size: .78rem; margin: 5px 0 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 11px; background: var(--full); border: 1px solid #749169; border-radius: 2px; margin-right: 3px; }
#key-cut i { background: var(--short); border-color: #b89a57; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; border-top: 1px solid var(--light-line); border-bottom: 1px solid var(--light-line); margin-top: 13px; padding: 9px 0; }
.metrics dt { color: var(--muted); font-size: .8rem; line-height: 1.25; }
.metrics dd { margin: 0; font-size: 1.4rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.marks-heading { margin: 16px 0 7px; }
.marks-heading p { margin-top: 3px; }
.table-wrap { border: 1px solid var(--light-line); border-radius: 7px; overflow: auto; max-height: 290px; }
table { border-collapse: separate; border-spacing: 0; width: 100%; text-align: left; font-size: .85rem; font-variant-numeric: tabular-nums; }
th, td { padding: 5px 11px; border-bottom: 1px solid var(--light-line); }
thead th { position: sticky; top: 0; background: #f2f4ed; font-weight: 700; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:nth-child(even) { background: #fafbf6; }
.status:not(:empty) { margin-top: 9px; }
#copy-label { display: block; margin-top: 10px; font-weight: 650; }
#copy-text { width: 100%; margin-top: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }

.guide { padding: 37px 0 42px; scroll-margin-top: 14px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px; margin-top: 16px; }
.guide-grid > div { border-top: 1px solid #b5c1af; padding-top: 10px; }
.guide p { margin-top: 6px; font-size: .88rem; color: var(--muted); }
.guide p.guide-note { margin-top: 16px; }

@media (max-width: 840px) {
  .shell { width: min(100% - 40px, 1160px); }
  .card { padding: 18px; }
  .workspace { grid-template-columns: minmax(230px, 275px) minmax(0, 1fr); gap: 12px; }
  .choices button { padding: 7px; }
  .intro { padding-top: 33px; }
}

@media (max-width: 690px) {
  .workspace, .guide-grid { grid-template-columns: 1fr; }
  .workspace { gap: 14px; }
  .guide-grid { gap: 13px; }
}

@media (max-width: 425px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { min-height: 57px; }
  .title-break { display: initial; }
  .intro { padding: 25px 0 21px; }
  .intro p { margin-top: 11px; }
  .card { padding: 14px; }
  .bay { font-size: .7rem; }
  .metrics dt { font-size: .75rem; }
  th, td { padding-inline: 8px; }
}

@media print {
  body { background: white; color: black; }
  .shell { width: 100%; }
  .site-header, .intro, .inputs, .guide, .actions, .choices, .status, #copy-text, #copy-label { display: none !important; }
  .workspace { display: block; }
  .results { padding: 0; border: 0; box-shadow: none; }
  #layout-heading { display: none; }
  .print-title { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.15; }
  .selection { break-inside: avoid; }
  .drawing, .legend { print-color-adjust: exact; }
  .table-wrap { max-height: none; overflow: visible; }
  thead th { position: static; }
  tr { break-inside: avoid; }
}
