:root {
  color-scheme: light;
  --ink: #0f2744;
  --gold: #c89b3c;
  --paper: #f8f9fb;
  --white: #fff;
  --muted: #496077;
  --rule: #ced8e3;
  --soft: #e8edf3;
  --error: #9d302c;
  font: 100%/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #a27111; outline-offset: 3px; }
button, input, select { font: inherit; }
h1, h2, h3, p, dl, figure { margin: 0; }
h1, h2, h3 { line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 4.2vw, 3.125rem); letter-spacing: -.04em; max-width: 26ch; }
h2 { font-size: clamp(1.375rem, 2.2vw, 1.75rem); letter-spacing: -.025em; }
h3 { font-size: 1.05rem; }

.frame { width: min(100% - 2rem, 68rem); margin-inline: auto; }
.skip { position: absolute; top: .5rem; left: 1rem; transform: translateY(-180%); background: var(--white); padding: .5rem; z-index: 2; }
.skip:focus { transform: none; }
.header { background: var(--white); border-top: 3px solid var(--gold); border-bottom: 1px solid var(--rule); }
.header .frame, .footer .frame { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.25rem; letter-spacing: -.045em; text-decoration: none; }
.seal { display: grid; place-items: center; width: 1.68rem; height: 1.68rem; border: 2px double var(--ink); background: var(--gold); border-radius: 4px; font-size: .82rem; letter-spacing: 0; }
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0 1rem; font-size: .875rem; }
.nav a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; }
.nav a[aria-current], .nav a:hover { text-decoration: underline; text-decoration-color: #a27111; text-decoration-thickness: 2px; }
.heading { padding-block: clamp(1.1rem, 4vw, 2.65rem) 1rem; }
.heading p { margin-top: .45rem; color: var(--muted); }
.heading time, .small { font-size: .85rem; color: var(--muted); }

.tool { background: var(--white); border: 1px solid var(--rule); border-radius: .5rem; }
.tool-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.inputs, .results, .tool-section { min-width: 0; padding: clamp(.875rem, 2vw, 1.5rem); }
.inputs + .results { border-left: 1px solid var(--rule); }
.tool-section { border-top: 1px solid var(--rule); }
.control-grid, .trip, .state-fields { display: grid; gap: .5rem; }
.control-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.trip { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; }
.trip + .trip { margin-top: .5rem; }
.field { display: grid; gap: .15rem; min-width: 0; }
label { font-size: .8rem; font-weight: 650; }
input, select { width: 100%; min-width: 0; padding: .35rem .4rem; height: 2.75rem; border: 1px solid #8799ad; border-radius: .25rem; background: var(--white); color: var(--ink); }
input::-webkit-date-and-time-value { text-align: left; }
.ref-field { max-width: 14rem; margin-bottom: .65rem; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: .35rem .7rem; border: 1px solid #8799ad; border-radius: .25rem; background: var(--white); color: var(--ink); cursor: pointer; font-size: .875rem; font-weight: 700; text-decoration: none; }
button:hover { background: var(--soft); }
.button { background: var(--ink); color: var(--white); border-color: var(--ink); }
.button:hover { background: #21415f; }
.remove { min-width: 2.75rem; font-size: 1.15rem; }
.error { color: var(--error); font-weight: 650; }
.error:empty, .pending:empty { display: none; }
.pending, .error { margin-top: .5rem; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; font-variant-numeric: tabular-nums; }
.metrics.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metrics div { min-width: 0; border-top: 2px solid var(--gold); padding-top: .35rem; }
.metrics dt { font-size: .8rem; font-weight: 700; }
.metrics dd { margin: .18rem 0 0; font-weight: 750; font-size: clamp(.94rem, 2.2vw, 1.4rem); line-height: 1.2; }
.metrics small { display: block; margin-top: .2rem; font-size: .75rem; font-weight: 500; }
.window { margin-top: .8rem; }
.timeline { display: grid; grid-template-columns: repeat(60, 1fr); gap: 2px; margin-block: .3rem; }
.timeline span { height: .4rem; background: var(--soft); border-radius: 1px; }
.timeline span.occupied { background: var(--ink); }
.window-dates { display: flex; justify-content: space-between; gap: .5rem; font-variant-numeric: tabular-nums; }
.state-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; max-width: 30rem; margin-block: .5rem; }
.state-result { font-weight: 700; }
summary { cursor: pointer; font-weight: 700; }
summary + p { margin-top: .5rem; }
details table, .results table { margin-top: .5rem; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; color: var(--muted); margin-bottom: .25rem; }
td, th { padding: .3rem .4rem; border-bottom: 1px solid var(--rule); }

.content { display: grid; gap: 1.6rem; margin-block: 1.5rem 2.4rem; }
.content > section, .prose > section { display: grid; gap: .55rem; }
.content p, .prose p, .prose li { max-width: 76ch; }
.pricing { border: 1px solid var(--rule); border-left: 4px solid var(--gold); padding: .85rem 1rem; background: var(--white); }
.pricing dl { display: grid; gap: .25rem .65rem; grid-template-columns: auto 1fr; }
.pricing dt { font-weight: 750; }
.pricing dd { margin: 0; }
.app-links { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .85rem; }
.faq { display: grid; gap: .8rem; }
.faq article { border-top: 1px solid var(--rule); padding-top: .65rem; }
.faq h3 { margin-bottom: .25rem; }
.prose { display: grid; gap: 1.35rem; max-width: 48rem; margin-bottom: 2.5rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.4rem; }
.notice { border-left: 4px solid var(--gold); background: var(--white); padding: .8rem 1rem; }
.footer { border-top: 1px solid var(--rule); padding-block: .65rem; }
.footer p { color: var(--muted); font-size: .85rem; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 46rem) {
  .header .frame, .footer .frame { display: block; }
  .header .brand { min-height: 2.75rem; }
  .header .nav { gap: 0 .75rem; }
  .header .nav a { min-height: 2rem; }
  .tool-main { grid-template-columns: minmax(0, 1fr); }
  .inputs + .results { border-top: 1px solid var(--rule); border-left: 0; }
}

@media (max-width: 23rem) {
  .frame { width: calc(100% - 1.25rem); }
  .timeline { gap: 1px; }
  .header .nav { font-size: .8rem; }
  td, th { padding-inline: .2rem; }
}

.app-shortcut { margin-top: .55rem; }
button:disabled { cursor: default; opacity: .55; }
