:root {
  color-scheme: light;
  --ink: #211e1a;
  --paper: #f6f1e9;
  --surface: #fffdf8;
  --line: #cfc4b6;
  --muted: #584e43;
  --rust: #94331d;
  --amber: #ffb27a;
  --mono: ui-monospace, "Courier New", monospace;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
.wrap { width: min(100% - 2rem, 75rem); margin-inline: auto; }
.masthead {
  color: var(--paper);
  background: repeating-linear-gradient(125deg, #2d271f 0 1px, #211e1a 1px 22px);
  border-bottom: 6px solid var(--amber);
  padding: 1.5rem 0 clamp(2rem, 6vw, 4rem);
}
nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
nav a { color: var(--amber); }
a { color: var(--rust); text-underline-offset: .22em; }
h1, h2, h3 { line-height: 1.12; margin: 0; }
h1 { margin-top: 1.8rem; font-size: clamp(2.4rem, 7.4vw, 5.8rem); letter-spacing: -.07em; }
h2 { font-size: clamp(1.55rem, 3vw, 2rem); letter-spacing: -.045em; margin-bottom: 1rem; }
h3 { font-size: 1rem; }
p { margin: .8rem 0; }
.masthead p { font-size: clamp(1rem, 2.5vw, 1.2rem); max-width: 36ch; margin-bottom: 0; }
main { padding-block: clamp(1.4rem, 4vw, 3rem); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, .48fr); gap: clamp(1.4rem, 4vw, 3rem); align-items: start; }
aside { background: var(--surface); border-top: 4px solid var(--ink); padding: 1.25rem; }
aside h3 { margin-top: 1.4rem; }
aside dl { margin: 0; }
aside dl div { display: flex; justify-content: space-between; gap: 1rem; padding-block: .45rem; border-bottom: 1px solid var(--line); }
aside dd { margin: 0; text-align: right; font-weight: 650; }
.note { font-size: .875rem; color: var(--muted); }
.window, .location-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
fieldset { margin: 1rem 0; min-width: 0; border: 1px solid var(--line); background: var(--surface); padding: .9rem; }
legend { padding-inline: .45rem; font: 700 .86rem var(--mono); }
label { display: grid; align-content: end; gap: .25rem; font-size: .875rem; font-weight: 620; }
input, select, button { color: var(--ink); font: inherit; }
input, select { width: 100%; min-width: 0; height: 2.65rem; padding: .4rem; border: 1px solid #8a7c6e; border-radius: 3px; background: var(--surface); }
button { min-height: 2.75rem; padding: .45rem .85rem; border: 1px solid #8a7c6e; border-radius: 3px; background: var(--surface); font-weight: 650; cursor: pointer; }
button:hover { background: #ece1d4; }
.remove { align-self: end; justify-self: start; font-size: .875rem; }
.actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.primary { color: white; background: var(--rust); border-color: var(--rust); }
.primary:hover { background: #762411; }
:focus-visible { outline: 3px solid #a14817; outline-offset: 3px; }
.masthead :focus-visible { outline-color: var(--amber); }
.results { margin-top: 2.25rem; border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.results > p { color: var(--muted); }
.route { padding: .9rem; border: 1px solid var(--line); background: var(--surface); margin-top: .7rem; overflow-wrap: anywhere; }
time { font-family: var(--mono); }
.route ul { margin: .45rem 0 0; padding-left: 1.2rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; text-align: left; width: 100%; background: var(--surface); }
td, th { padding: .65rem .8rem; border-bottom: 1px solid var(--line); }
td:nth-child(3), td:nth-child(4) { font-family: var(--mono); white-space: nowrap; }
td:first-child, th:first-child { overflow-wrap: anywhere; }
.overdue, .error { color: var(--rust); font-weight: 700; }
.missing { color: #67441e; }
.due-soon { color: #764211; }
footer { border-top: 1px solid var(--line); padding-block: 1rem 2rem; display: flex; gap: 1.4rem; }
@media (max-width: 58rem) { .layout { grid-template-columns: 1fr; } }
@media (max-width: 36rem) {
  .window, .location-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  input, select { font-size: 1rem; }
}
