/* Layout: one narrow column, like a catalogue entry with a time sheet underneath. */
:root {
  --bg: #f1f4f3;
  --surface: #ffffff;
  --ink: #16211f;
  --muted: #55645f;
  --line: #d3dcd9;
  --accent: #0d5c4f;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe9;
  --warn: #8a4b00;
  --warn-soft: #fbecd5;
  --bad: #a12a22;
  --bad-soft: #fbe3e0;
  --full: #e4e9e7;
  --text: 12px;
  --heading: 14px;
  --figure: 14px;
  --figure-box: 2.5rem;
  --display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --body: "Montserrat", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101715; --surface: #18211e; --ink: #e8efec; --muted: #9fb0aa; --line: #30403b;
    --accent: #5fd0b5; --accent-ink: #06231c; --accent-soft: #173b32;
    --warn: #f0b768; --warn-soft: #3c2b12; --bad: #f29a91; --bad-soft: #43201d; --full: #222d2a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101715; --surface: #18211e; --ink: #e8efec; --muted: #9fb0aa; --line: #30403b;
  --accent: #5fd0b5; --accent-ink: #06231c; --accent-soft: #173b32;
  --warn: #f0b768; --warn-soft: #3c2b12; --bad: #f29a91; --bad-soft: #43201d; --full: #222d2a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--text)/1.55 var(--body); }
.page {
  max-width: 44rem; margin: 0 auto;
  padding-block: 2rem 4rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 1.5rem;
}
.page > * { min-width: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: var(--heading); font-weight: 700; }
h2 { font-size: var(--heading); font-weight: 600; }
h3 { font-size: var(--heading); font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.lot-head { display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.25rem; align-items: start; }
.lot-tag {
  border: 1px solid var(--line); border-radius: 6px; padding: .2rem .6rem; text-align: center;
  min-width: 4.5rem; min-height: var(--figure-box); font-family: var(--display); font-variant-numeric: tabular-nums;
}
.lot-tag small { display: block; font: 700 var(--text)/1.2 var(--body); letter-spacing: .1em; text-transform: uppercase; }
.lot-tag strong { display: block; font-size: var(--figure); font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.lot-text { display: grid; gap: .35rem; min-width: 0; }
.address { color: var(--muted); font-weight: 600; }
.notes { grid-column: 1 / -1; white-space: pre-line; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem; display: grid; gap: 1rem; }
.panel > * { min-width: 0; }
.step-title { display: flex; gap: .6rem; align-items: baseline; }
.step-title span { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }

.party { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stepper button { width: var(--figure-box); height: var(--figure-box); border: 0; background: var(--bg); color: var(--ink); font-size: var(--figure); cursor: pointer; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { width: var(--figure-box); text-align: center; font: 700 var(--figure) var(--display); font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); }

.next {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
  background: var(--accent-soft); border-radius: 6px; padding: .85rem 1rem;
}
.next div { min-width: 0; }
.next small { display: block; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.day { display: grid; gap: .5rem; }
.day + .day { margin-top: .5rem; }
.slots { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.slot {
  display: grid; gap: .45rem; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 6px; padding: .7rem .85rem;
}
.slot:hover:not(:disabled) { border-color: var(--accent); }
.slot[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.slot:disabled { cursor: not-allowed; background: var(--full); color: var(--muted); }
.slot-row { display: grid; gap: .1rem; }
.slot-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.slot-state { font-weight: 600; font-variant-numeric: tabular-nums; }
.slot-state.few { color: var(--warn); }
.meter { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.slot:disabled .meter i { background: var(--muted); }

.notice { border-radius: 6px; padding: .8rem 1rem; }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--bad-soft); }
.notice.good { background: var(--accent-soft); }

form { display: grid; gap: .9rem; }
.field { display: grid; gap: .25rem; min-width: 0; }
.field label { font-weight: 600; }
.field input {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--muted); border-radius: 5px; padding: .6rem .7rem;
}
.two { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-block; font: 700 var(--text) var(--body); text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 1.5px solid var(--accent); border-radius: 6px; padding: .7rem 1.2rem;
}
.btn:disabled { opacity: .55; cursor: wait; }
.btn.quiet { background: transparent; color: var(--accent); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--surface); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.lot-link { display: flex; justify-content: space-between; gap: 1rem; align-items: center; text-decoration: none; color: var(--ink); }
.lot-link small { color: var(--muted); display: block; }
.brand { font-weight: 700; color: var(--muted); }
.fine { color: var(--muted); }

/* Staff pages */
.page.wide { max-width: 70rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); white-space: nowrap; }
td form { display: inline-flex; gap: .4rem; align-items: center; }
td input[type=number] { width: 5rem; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--muted); border-radius: 4px; padding: .25rem .4rem; }
.small-btn { font: 600 var(--text) var(--body); padding: .3rem .65rem; border-radius: 5px; cursor: pointer; background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.small-btn.danger { color: var(--bad); border-color: var(--bad); }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-weight: 700; background: var(--full); white-space: nowrap; }
.pill.open { background: var(--accent-soft); color: var(--accent); }
.pill.scheduled { background: var(--warn-soft); color: var(--warn); }
.topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.copy { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: var(--text); overflow-wrap: anywhere; }
.three { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); align-items: end; }

/* Phones zoom in on form fields with text under 16px, so touch screens keep that size. */
@media (pointer: coarse) {
  .field input, td input[type=number] { font-size: 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .slot, .btn { transition: border-color .12s, background-color .12s; }
}
