:root {
  color: #171915;
  background: #f3f0e6;
  font-family: "Aptos", "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  background-color: #f3f0e6;
  background-image: linear-gradient(rgba(23, 25, 21, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 25, 21, .045) 1px, transparent 1px);
  background-size: 24px 24px;
}
button, input, select, textarea { font: inherit; letter-spacing: 0; }
code, pre { font-family: "Cascadia Code", Consolas, monospace; }
.app-header {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  padding: 26px clamp(18px, 4vw, 56px);
  color: #f8f5ea;
  background: #171915;
  border-bottom: 5px solid #d6f132;
}
.eyebrow, .section-index { margin: 0 0 5px; color: #79d8d0; font: 700 12px/1 "Cascadia Code", monospace; text-transform: uppercase; }
h1, h2 { font-family: Bahnschrift, "Arial Narrow", sans-serif; letter-spacing: 0; }
h1 { margin: 0; font-size: clamp(25px, 4vw, 40px); font-weight: 650; }
h2 { margin: 0; font-size: 22px; }
.connection-meta { display: grid; gap: 8px; margin: 0; min-width: min(520px, 48vw); }
.connection-meta div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.connection-meta dt { color: #a8afa2; font-size: 12px; text-transform: uppercase; }
.connection-meta dd { margin: 0; overflow-wrap: anywhere; font: 12px/1.4 "Cascadia Code", monospace; }
main { width: min(1480px, 100%); margin: 0 auto; padding: 28px clamp(14px, 3vw, 42px) 56px; }
form { border: 1px solid #8a8e84; background: rgba(248, 246, 238, .96); }
.section-band { padding: 28px; border-bottom: 1px solid #b9b9ae; }
.section-heading { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(300px, 1.2fr); gap: 24px; align-items: end; margin-bottom: 24px; }
.section-heading > p { max-width: 720px; margin: 0; color: #51564d; line-height: 1.5; }
.section-index { color: #087b71; }
.field-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 7px; font-weight: 700; font-size: 13px; }
.field.span-2 { grid-column: span 2; }
.field small, th small { color: #656a61; font-size: 11px; font-weight: 400; line-height: 1.35; }
input, select, textarea {
  width: 100%; min-height: 42px; padding: 9px 11px; color: #171915; background: #fffef9;
  border: 1px solid #83877e; border-radius: 3px; outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #087b71; box-shadow: 0 0 0 3px rgba(8, 123, 113, .16); }
.schedule-builder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; padding: 20px; background: #e5e0d2; border-left: 5px solid #087b71; }
.schedule-builder .button { align-self: end; min-height: 42px; }
.period-table-wrap, .suite-table-wrap { margin-top: 22px; overflow-x: auto; border: 1px solid #8a8e84; }
table { width: 100%; border-collapse: collapse; background: #fffef9; }
th, td { padding: 9px; border-bottom: 1px solid #d1d1c7; text-align: left; vertical-align: top; }
th { color: #30342e; background: #ddd9cc; font-size: 11px; text-transform: uppercase; white-space: nowrap; }
th small { display: block; max-width: 130px; margin-top: 4px; text-transform: none; white-space: normal; }
.period-table { min-width: 1340px; }
.period-table input, .period-table select { min-width: 112px; min-height: 36px; padding: 7px; }
.period-table .period-reference { min-width: 150px; }
.period-table .period-time { min-width: 190px; }
.button { min-height: 40px; padding: 9px 16px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-weight: 750; }
.button:disabled { cursor: wait; opacity: .55; }
.button.primary { color: #fff; background: #14532d; }
.button.secondary { color: #f8f5ea; background: #087b71; }
.button.quiet { margin-top: 16px; color: #171915; background: #e9e5d9; border-color: #777b72; }
.button.remove-period { color: #821d30; background: transparent; border-color: #a94b5d; }
.button:hover:not(:disabled) { filter: brightness(.92); }
.submit-band { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 24px 28px; background: #d6f132; }
.submit-band .section-index { color: #435000; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.status-message { margin: 7px 0 0; color: #42483e; font-size: 13px; }
.status-message.success { color: #14532d; font-weight: 700; }
.status-message.error { color: #9f1239; font-weight: 700; }
.preview-layout { display: grid; grid-template-columns: 1fr 1fr; margin-top: 28px; border: 1px solid #8a8e84; background: #171915; color: #f8f5ea; }
.preview-layout > div { min-width: 0; padding: 22px; }
.preview-layout > div + div { border-left: 1px solid #5a5e56; }
.preview-layout p { color: #aeb5a8; font-size: 13px; }
pre { min-height: 320px; max-height: 600px; margin: 16px 0 0; padding: 16px; overflow: auto; color: #d6f132; background: #0e100d; border: 1px solid #454940; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.validation-suite { margin-top: 28px; padding: 20px; background: #f8f6ee; border: 1px solid #8a8e84; }
.validation-suite summary { cursor: pointer; font: 650 18px Bahnschrift, sans-serif; }
.validation-suite p { color: #51564d; }
.badge { display: inline-block; padding: 2px 7px; border-radius: 3px; font-weight: 700; font-size: 11px; }
.pass { color: #14532d; background: #dcfce7; }
.fail { color: #9f1239; background: #ffe4e6; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 1000px) {
  .app-header { display: block; }
  .connection-meta { min-width: 0; margin-top: 20px; }
  .field-grid, .schedule-builder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-layout { grid-template-columns: 1fr; }
  .preview-layout > div + div { border-left: 0; border-top: 1px solid #5a5e56; }
}
@media (max-width: 640px) {
  .app-header { padding: 20px 16px; }
  .connection-meta div, .section-heading, .field-grid, .schedule-builder { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .section-band { padding: 22px 16px; }
  .section-heading { gap: 10px; align-items: start; }
  .submit-band { align-items: stretch; flex-direction: column; padding: 20px 16px; }
  .actions { display: grid; }
  .button { width: 100%; }
  pre { min-height: 240px; }
}