:root {
  --paper: #f3efe6;
  --ink: #1b1916;
  --muted: #5c564c;
  --line: #ddd4c6;
  --white: #fffcf7;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.45;
}

.wrap {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
}

.top {
  border-bottom: 1px solid var(--line);
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.mark {
  margin: 0;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 28px;
  line-height: 1;
  font-weight: 600;
}

.mark span {
  display: block;
  margin-top: 4px;
  font-family: "Avenir Next", Avenir, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.top-actions, .dock {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-solid {
  background: var(--ink);
  color: var(--paper);
}

.btn-line {
  background: transparent;
  color: var(--ink);
}

.where {
  margin: 28px 0 0;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 0;
  max-width: 12ch;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 38ch;
  margin: 16px 0 0;
  font-size: 19px;
}

h2 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.jobs { margin-top: 36px; }

.job-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.job {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.job h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.job p { margin: 4px 0 0; }

.price {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

#where-line { white-space: pre-line; }

.map {
  height: 320px;
  margin-top: 18px;
  background: #e4dfd4;
}

.return-line {
  margin: 4px auto 28px;
}

.desk-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 8px;
}

.desk-actions .text-book { margin-top: 0; }

.map-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.soon {
  margin: 0;
  align-self: center;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.ev-label {
  margin: 10px 0 0;
  list-style: none;
}

.ev-label h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.text-book {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.facts {
  display: grid;
  gap: 22px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--ink);
}

.facts p { margin: 0; }

.rule {
  margin: 28px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rule h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.rule p { margin: 0; }

.cancel-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.cancel-form[hidden] { display: none; }

.yes-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
}

.yes-line input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--ink);
}

.cancel-form .btn { justify-self: start; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quiet {
  color: var(--muted);
  font-size: 15px;
}

.foot {
  margin-top: 28px;
  padding-bottom: 28px;
  color: var(--muted);
  font-size: 14px;
}

.foot a { color: inherit; }

.dock {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.dock .btn { flex: 1; }

dialog {
  width: min(480px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
}

dialog::backdrop { background: rgba(27, 25, 22, 0.45); }

#book-form {
  padding: 18px 18px 22px;
  overflow: auto;
  max-height: calc(100vh - 24px);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-head h2 {
  margin: 0;
  font-family: "Iowan Old Style", Palatino, Georgia, serif;
  font-size: 32px;
  letter-spacing: 0;
  text-transform: none;
}

.close {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

fieldset {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.choice span {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.field {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input, .field select {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: 400 17px/1.3 "Avenir Next", Avenir, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

.times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.times label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.times input { position: absolute; opacity: 0; }

.times input:focus-visible + span,
.times label:has(input:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.times label:has(input:checked) {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.times label:has(input:disabled) { display: none; }

.total {
  display: flex;
  justify-content: space-between;
  margin: 18px 0 0;
  font-size: 18px;
  font-weight: 600;
}

.total strong {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.pay { width: 100%; margin-top: 12px; }

.note {
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  font-size: 15px;
}

.field input:focus, .field select:focus, .btn:focus-visible, .text-book:focus-visible, .close:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (min-width: 760px) {
  .facts { grid-template-columns: 1fr 1fr; gap: 28px; }
  .foot { padding-bottom: 48px; }
}

@media (max-width: 759px) {
  .top-actions { display: none; }
  .dock { display: flex; }
  main.wrap { padding-bottom: 12px; }
  .foot { padding-bottom: 96px; }
  dialog {
    width: 100%;
    max-height: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
  }
  #book-form { max-height: 100%; }
}
