@font-face {
  font-family: Inter;
  src: url("assets/inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fafafa;
  --surface: #ffffff;
  --ink: #18181b;
  --muted: #52525b;
  --rule: #e4e4e7;
  --field: #a1a1aa;
  --green: #18181b;
  --green-light: #f4f4f5;
  --map: #1a1a1a;
  --focus: #2563eb;
  --yellow: #facc15;
  font: 16px/1.5 Inter, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
h1, h2, p, dl, dd { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.masthead { border-bottom: 1px solid var(--rule); background: var(--surface); }
.masthead-inner, .workspace { width: min(100% - 64px, 1352px); margin-inline: auto; }
.masthead-inner {
  min-height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
h1 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); letter-spacing: -.045em; }
.quiet-button {
  min-height: 44px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 5px;
  font-weight: 650;
}
.quiet-button:hover { background: var(--green-light); }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 20px;
  align-items: stretch;
  padding-block: 22px 36px;
}
.operations { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.tabs {
  min-width: 0;
  margin: 0;
  padding: 5px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: #f4f4f5;
}
.tab {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  font-size: .875rem;
  line-height: 1.2;
  font-weight: 650;
  color: #52525b;
}
.tab:hover { background: #eaeaec; }
.tab[aria-current="page"] {
  color: var(--green);
  background: var(--surface);
  border-color: #e4e4e7;
}

.work-panel, .map-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 7px;
}
.work-panel { flex: 1; }
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
}
h2 { font-size: 1.35rem; letter-spacing: -.035em; line-height: 1.2; }
.count { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.table { width: 100%; border-collapse: collapse; text-align: left; }
.table th, .table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.table :is(th, td):first-child { padding-left: 23px; }
.table :is(th, td):last-child { padding-right: 23px; }
.table th { background: #fafafa; color: var(--muted); font-size: .77rem; font-weight: 650; }
.table td { font-size: .93rem; }
.plate, .slot-code, time { font-family: inherit; font-variant-numeric: tabular-nums; font-size: .88em; }
.plate { font-weight: 700; }
.slot-code {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #e4e4e7;
  border-radius: 3px;
  background: var(--green-light);
  color: var(--green);
  font-weight: 700;
}
.table time { color: var(--muted); }

.fields { display: grid; gap: 15px; padding: 21px 23px; }
.field { display: grid; gap: 6px; color: var(--muted); font-size: .86rem; font-weight: 650; }
.field :is(input, select), .selected-slot {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--field);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 400;
}
.field select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318181b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}
@media (forced-colors: active) {
  .field select { appearance: auto; padding-right: 10px; background-image: none; }
}
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.action {
  justify-self: start;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 4px;
  background: var(--green);
  color: white;
  font-size: .875rem;
  font-weight: 650;
}
.action:disabled { background: #f4f4f5; color: #52525b; }
.ticket-selection {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fafafa;
}
.ticket-selection dt { color: var(--muted); font-size: .77rem; }
.ticket-selection dd { margin-top: 3px; font-size: .86rem; font-weight: 650; }

.map-panel { align-self: start; }
.map-panel .panel-heading { border-bottom: 0; padding-bottom: 10px; }
.map-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 20px 15px;
}
.map-legend div { padding-left: 12px; border-left: 1px solid var(--rule); }
.map-legend div:first-child { padding: 0; border: 0; }
.map-legend dt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .79rem; }
.map-legend dt::before { content: ""; width: 9px; height: 9px; border: 1px solid #52525b; border-radius: 2px; background: var(--key); }
.map-legend dd { font-size: 1.13rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.lot-scroll {
  overflow: auto;
  margin: 0 12px 12px;
  border-radius: 5px;
  background: var(--map);
}
.map-board {
  display: grid;
  grid-template-columns: 63px minmax(0, 1fr);
  min-width: 534px;
  padding: 17px 15px;
  background: var(--map);
  color: white;
}
.access-lane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: start;
  padding: 6px 5px 6px 0;
  border-right: 1px dashed #c2a836;
}
.gate, .row-letter, .aisle { color: #e4e4e7; font-size: .68rem; font-weight: 600; }
.gate { display: grid; gap: 8px; }
.barrier { width: 34px; height: 4px; background: var(--yellow); transform: rotate(-19deg); transform-origin: left; }
.barrier::before { display: block; width: 5px; height: 8px; margin-top: -2px; background: var(--yellow); content: ""; }
.parking-deck { display: grid; padding-left: 8px; }
.aisle { display: flex; align-items: center; gap: 9px; min-height: 39px; padding-left: 24px; }
.aisle::after { content: ""; flex: 1; border-top: 1px dashed #c2a836; }
.aisle.cross { min-height: 56px; }
.stalls { display: grid; grid-template-columns: 20px repeat(var(--spaces, 8), minmax(0, 1fr)); }
.row-letter { align-self: center; }
.stall {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  min-height: 70px;
  padding: 4px 1px;
  border: 1px solid var(--yellow);
  border-left: 0;
  color: #f4f4f5;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1;
}
.stall:nth-child(2) { border-left: 1px solid var(--yellow); }
.reverse .stall { border-top: 0; justify-content: start; }
a.stall { cursor: pointer; }
a.stall:hover, .stall[aria-current] { background: #403714; }
.stall[aria-current] { box-shadow: inset 0 0 0 2px var(--yellow); }
.stall.maintenance { background: repeating-linear-gradient(135deg, #27241a 0 5px, #41371b 5px 10px); }
.stall.maintenance small { margin-top: 4px; color: #fef3c7; font-size: .56rem; }
.car {
  position: absolute;
  top: 6px;
  left: 50%;
  width: min(57%, 28px);
  height: 45px;
  transform: translateX(-50%);
  border: 1px solid #09090b;
  border-radius: 7px 7px 5px 5px;
  background: var(--body);
  box-shadow: -2px 0 #101010, 2px 0 #101010;
}
.car::before, .car::after { position: absolute; content: ""; inset-inline: 14%; background: #27363b; }
.car::before { top: 9px; height: 9px; border-radius: 3px 3px 1px 1px; }
.car::after { bottom: 7px; height: 6px; border-radius: 1px 1px 2px 2px; }
.reverse .car { top: auto; bottom: 6px; transform: translateX(-50%) rotate(180deg); }
.car.white { --body: #f6f6f6; }
.car.silver { --body: #aeb8c1; }
.car.teal { --body: #5bc1b3; }

.query { padding: 12px 20px 15px; border-top: 1px solid var(--rule); }
.query-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.query h3 { margin: 0; font-size: .91rem; font-weight: 650; }
.query pre {
  overflow: auto;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: #fafafa;
  font: .8rem/1.55 Consolas, ui-monospace, monospace;
}
.query code { font: inherit; }
.sql-keyword { color: #153ba0; font-weight: 700; }
.sql-routine { color: #6b3483; }
.sql-literal { color: #246431; }
.sql-parameter { color: #8a4108; font-weight: 700; }
.query-parameter { display: flex; align-items: baseline; gap: 7px; margin-top: 8px; font-size: .8rem; }
.query-parameter code { color: var(--muted); }
.about {
  width: min(440px, 100% - 28px);
  max-height: calc(100% - 28px);
  padding: 21px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}
.about::backdrop { background: #18181b55; }
.about-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 13px; }
.about p { margin-block: 10px; }
.about ul { margin-block: 8px 14px; padding-left: 20px; }
.about dt { color: var(--muted); font-size: .82rem; }
.about dd + dt { margin-top: 8px; }

@media (max-width: 890px) {
  .masthead-inner, .workspace { width: min(100% - 32px, 640px); }
  .workspace { grid-template-columns: 1fr; gap: 16px; padding-block: 17px 24px; }
}
@media (max-width: 430px) {
  .masthead-inner, .workspace { width: calc(100% - 24px); }
  .masthead-inner { min-height: 63px; }
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab { font-size: .8rem; min-height: 44px; }
  .query { padding-inline: 13px; }
  .panel-heading, .fields { padding-inline: 13px; }
  .table :is(th, td):first-child { padding-left: 13px; }
  .table :is(th, td):last-child { padding-right: 13px; }
  .table th, .table td { padding-inline: 6px; }
  .table td { font-size: .83rem; }
  .map-legend { padding-inline: 13px; }
}
.tab, a.stall { text-decoration: none; }
.table-wrap { overflow-x: auto; }
.table small { display: inline-block; margin-left: 5px; color: var(--muted); }
.text-link { color: #18181b; font-weight: 600; text-underline-offset: 2px; }
.field-button { justify-self: start; }
.field small, .empty { color: var(--muted); font-weight: 400; }
.empty { padding: 13px 20px 18px; font-size: .9rem; }
.ticket-selection { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feedback { margin: 0; padding: 10px 13px; border: 1px solid; border-radius: 6px; font-size: .875rem; }
.feedback.success { color: #14532d; border-color: #bbdec2; background: #f0fdf4; }
.feedback.error { color: #881f1f; border-color: #eac1c1; background: #fef2f2; }
.query-parameter { align-items: flex-start; gap: 9px; }
.query-parameter code { min-width: 0; overflow-wrap: anywhere; }
.query pre { white-space: pre; }
a.stall:focus-visible { z-index: 1; outline: 2px solid white; outline-offset: -4px; }

@media (max-width: 600px) {
  .tab, .quiet-button, .action { min-height: 44px; }
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.extra-form { border-top: 1px solid var(--rule); }
.chevron { display: inline-block; font-weight: 800; }
.extra-form summary::-webkit-details-marker { display: none; }
.extra-form[open] summary .chevron { transform: rotate(90deg); }
.extra-form summary { display: flex; align-items: center; gap: 8px; list-style: none; padding: 12px 20px; min-height: 44px; cursor: pointer; font-size: .9rem; font-weight: 650; }
.extra-form summary:hover { background: #fafafa; }
.extra-form .fields { padding-top: 5px; }
@media (max-width: 600px) {
  .extra-form summary { padding-inline: 13px; }
}
