/* ============================================================
   Roadline — American highway signage
   Display: Barlow Semi Condensed 600/700, uppercase + tracked
   Body/UI: Barlow 400/500/600, tabular numerals on data
   Green gantry surfaces, one amber center-line, ruled ledgers
   ============================================================ */

:root {
  color-scheme: light;

  /* palette */
  --surface: #FAFAF7;      /* warm off-white road-map paper */
  --panel: #FFFFFF;
  --ink: #16211B;
  --ink-soft: #4A564F;     /* readable secondary (7.3:1 on surface) */
  --gravel: #8B948E;       /* decorative / disabled only */
  --hairline: #E4E6E1;
  --line-strong: #C2C9C1;  /* form control borders */
  --green: #0E4B3B;        /* racing green gantry */
  --green-deep: #0A3B2E;
  --amber: #E8A33D;        /* signal amber: route + CTA only */
  --amber-deep: #D89127;
  --signal-red: #B03A2A;

  /* type */
  --font-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow Semi Condensed", "Arial Narrow", "Barlow", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* geometry */
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 14px;
  --gutter: clamp(16px, 4vw, 56px);
  --page-max: 1320px;
  --shadow-1: 0 1px 2px rgba(22, 33, 27, 0.05), 0 8px 24px rgba(22, 33, 27, 0.08);
  --shadow-2: 0 2px 4px rgba(22, 33, 27, 0.07), 0 16px 40px rgba(22, 33, 27, 0.14);

  /* focus ring: green on light surfaces, amber on green ones */
  --ring: var(--green);
}

/* ---------- base ---------- */

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: clip;
  background: var(--surface);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  accent-color: var(--green);
}

body.sheet-open {
  overflow: hidden;
}

h1,
h2,
h3,
p,
dl,
figure {
  margin: 0;
}

dd {
  margin: 0;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

::selection {
  background: rgba(232, 163, 61, 0.4);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.2;
}

/* ---------- controls ---------- */

button,
input,
select {
  font-family: var(--font-body);
  font-size: 1rem;
  text-transform: none;
  letter-spacing: normal;
}

button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--r-s);
  background: var(--green);
  color: var(--surface);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease,
    box-shadow 180ms ease, transform 120ms ease;
}

button:hover {
  background: var(--green-deep);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  background: var(--hairline);
  border-color: var(--hairline);
  color: var(--gravel);
  cursor: not-allowed;
  transform: none;
}

.secondary-button {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--ink);
}

.secondary-button:hover {
  background: var(--surface);
  border-color: var(--gravel);
}

.link-button {
  min-height: auto;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-weight: 600;
}

.link-button:hover {
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon-button {
  width: 40px;
  min-height: 40px;
  padding: 0;
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--ink);
  font-size: 1.4rem;
}

.icon-button:hover {
  background: var(--surface);
  border-color: var(--gravel);
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  background: var(--panel);
  color: var(--ink);
}

select {
  appearance: none;
  padding-right: 34px;
  background: var(--panel)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230E4B3B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 12px center;
}

input::placeholder {
  color: #6B7770;
  opacity: 1;
}

input:hover,
select:hover {
  border-color: var(--gravel);
}

input:focus-visible,
select:focus-visible {
  outline-offset: 1px;
  border-color: var(--green);
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- operator gantry: bulletin strip over route deck ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--green);
  color: var(--surface);
  border-bottom: 1px solid rgba(250, 250, 247, 0.16);
  --ring: var(--amber);
}

/* utility deck: the operator's road bulletin */
.deck-utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 5px var(--gutter) 6px;
  background: var(--green-deep);
  border-bottom: 1px solid rgba(250, 250, 247, 0.1);
}

.utility-line {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  color: rgba(250, 250, 247, 0.72);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.utility-line a {
  color: rgba(250, 250, 247, 0.92);
  text-decoration: none;
}

.utility-line a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* main deck: wordmark + route board left, quiet utilities right */
.deck-main {
  display: grid;
  grid-template-columns: auto auto minmax(16px, 1fr) auto auto;
  grid-template-areas: "brand nav . trips account";
  align-items: center;
  column-gap: clamp(14px, 2.2vw, 28px);
  padding: 9px var(--gutter) 11px;
}

.brand {
  grid-area: brand;
  display: grid;
  justify-items: start;
  gap: 3px;
  text-decoration: none;
}

.brand strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 1.8vw, 1.55rem);
  line-height: 0.9;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand span {
  color: rgba(250, 250, 247, 0.6);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.deck-nav {
  grid-area: nav;
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: clamp(2px, 0.8vw, 8px);
  border-left: 1px solid rgba(250, 250, 247, 0.28);
  padding-left: clamp(10px, 1.8vw, 22px);
}

.deck-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  color: rgba(250, 250, 247, 0.88);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

/* the amber center-line marks the leg of the route you are on */
.deck-nav a::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 4px;
  left: 10px;
  height: 3px;
  border-radius: 1.5px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 9px, transparent 9px 16px);
  opacity: 0;
  transition: opacity 140ms ease;
}

.deck-nav a:hover,
.deck-nav a[data-current] {
  color: #fff;
}

.deck-nav a:hover::after,
.deck-nav a[data-current]::after {
  opacity: 1;
}

.deck-trips {
  grid-area: trips;
  justify-self: end;
  padding: 6px 2px;
  color: rgba(250, 250, 247, 0.85);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.deck-trips:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.deck-trips[data-current] {
  color: #fff;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.account-slot {
  grid-area: account;
  display: flex;
  align-items: center;
  align-self: stretch;
  justify-content: flex-end;
  gap: 12px;
  border-left: 1px solid rgba(250, 250, 247, 0.28);
  padding-left: clamp(14px, 2.2vw, 28px);
}

.renter-name {
  max-width: 180px;
  overflow: hidden;
  color: rgba(250, 250, 247, 0.92);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar button {
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: rgba(250, 250, 247, 0.92);
  font-size: 0.88rem;
  font-weight: 600;
}

.topbar button:hover {
  background: transparent;
  color: #fff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ---------- page frame ---------- */

main {
  display: grid;
  gap: 48px;
  padding: 24px 0 88px;
}

.hero-shell,
.quick-stats,
.fleet-workspace,
.branch-section,
.trips-section {
  width: min(var(--page-max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  min-width: 0;
}

#fleet,
#branches,
#trips {
  scroll-margin-top: 108px;
}

/* ---------- hero: the guide sign ---------- */

.hero-panel {
  display: grid;
  gap: clamp(24px, 3.5vw, 36px);
  padding: clamp(32px, 5vw, 64px) clamp(20px, 4vw, 64px) clamp(24px, 4vw, 48px);
  border-radius: var(--r-l);
  background: var(--green);
  color: var(--surface);
  --ring: var(--amber);
}

.hero-copy {
  display: grid;
  gap: 16px;
}

.hero-copy p {
  max-width: 62ch;
  color: rgba(250, 250, 247, 0.85);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.6;
}

/* signature: the one amber center-line, pickup -> return */
.center-line {
  height: 4px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 26px, transparent 26px 46px);
}

.route-console {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr 1fr 0.9fr auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
  border-radius: var(--r-m);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-2);
  --ring: var(--green);
}

.route-console label {
  min-width: 0;
}

.route-console button {
  min-height: 48px;
  padding: 0 26px;
  background: var(--amber);
  border-color: transparent;
  color: var(--ink);
}

.route-console button:hover {
  background: var(--amber-deep);
}

/* ---------- mileage strip ---------- */

.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--hairline);
}

.quick-stats > div {
  display: grid;
  gap: 2px;
  padding: 18px 20px;
}

.quick-stats > div + div {
  border-left: 1px solid var(--hairline);
}

.quick-stats strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.quick-stats span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- section titles ---------- */

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-title p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.section-title select {
  max-width: 220px;
}

/* ---------- fleet workspace ---------- */

.fleet-workspace {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 336px;
  align-items: start;
  gap: 24px;
}

.fleet-results {
  min-width: 0;
}

.filters {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-m);
  background: var(--panel);
}

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

.filter-head strong {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
}

.filter-note {
  display: grid;
  gap: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-variant-numeric: tabular-nums;
}

.filter-note strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.filter-note span {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

/* ---------- vehicle cards ---------- */

.fleet-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.fleet-list:empty,
.branch-grid:empty,
.trips-list:empty,
.product-message:empty {
  display: none;
}

.fleet-row {
  display: flex;
  flex-direction: column;
  overflow: clip;
  border: 1px solid var(--hairline);
  border-radius: var(--r-m);
  background: var(--panel);
  box-shadow: var(--shadow-1);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 140ms ease;
}

.fleet-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.fleet-row.active {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green), var(--shadow-1);
}

.fleet-photo {
  aspect-ratio: 16 / 9;
  min-height: 0;
  background: var(--hairline);
}

.fleet-photo img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.fleet-body {
  display: grid;
  gap: 4px;
  padding: 14px 16px 12px;
}

.fleet-body p {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.vehicle-type {
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ruled spec table: seats / gearbox / year */
.specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--hairline);
}

.specs > div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  min-width: 0;
}

.specs > div + div {
  border-left: 1px solid var(--hairline);
}

.specs dt {
  color: var(--ink-soft);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.specs dd {
  overflow: hidden;
  font-weight: 500;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fleet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 12px 16px 14px;
}

.price-stack {
  display: grid;
  line-height: 1.1;
}

.price-stack strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.price-stack span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fleet-foot button {
  background: var(--panel);
  border-color: var(--green);
  color: var(--green);
}

.fleet-foot button:hover {
  background: var(--green);
  color: var(--surface);
}

.fleet-row.active .fleet-foot button {
  background: var(--green);
  color: var(--surface);
}

/* ---------- reservation rail ---------- */

.reservation-rail {
  position: sticky;
  top: 104px;
  min-width: 0;
}

.rail-card {
  display: grid;
  overflow: clip;
  border: 1px solid var(--hairline);
  border-radius: var(--r-m);
  background: var(--panel);
  box-shadow: var(--shadow-1);
}

.rail-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--hairline);
}

.rail-body {
  display: grid;
  gap: 6px;
  padding: 16px 18px 0;
}

.rail-body h2 {
  font-size: clamp(1.3rem, 1.8vw, 1.55rem);
}

.rail-body > p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 8px;
}

/* center-line echo: dashed amber separators in the summary */
.rail-body dl > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.rail-body dl > div + div {
  border-top: 1px dashed rgba(232, 163, 61, 0.65);
}

.rail-body dt {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.rail-body dd {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rail-body .total dd {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
}

.booking-form,
.reserve-gate {
  display: grid;
  gap: 10px;
  padding: 14px 18px 18px;
}

.reserve-gate {
  border-top: 1px solid var(--hairline);
  margin-top: 6px;
}

.reserve-gate p {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.booking-form button {
  min-height: 48px;
  background: var(--amber);
  border-color: transparent;
  color: var(--ink);
}

.booking-form button:hover {
  background: var(--amber-deep);
}

/* ---------- branch ledger ---------- */

.branch-grid {
  display: grid;
  overflow: clip;
  border: 1px solid var(--hairline);
  border-radius: var(--r-m);
  background: var(--panel);
}

.branch-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) auto;
  grid-template-areas:
    "city name meta"
    "city addr meta";
  column-gap: 20px;
  row-gap: 2px;
  align-items: start;
  padding: 16px 20px;
}

.branch-card + .branch-card {
  border-top: 1px solid var(--hairline);
}

.branch-card > span {
  grid-area: city;
  justify-self: start;
  align-self: center;
  padding: 4px 10px;
  border-radius: var(--r-s);
  background: var(--green);
  color: var(--surface);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.branch-card h3 {
  grid-area: name;
  font-size: 1.05rem;
}

.branch-card p {
  grid-area: addr;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.branch-card > div {
  grid-area: meta;
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
}

.branch-card small {
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.branch-card .branch-count {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- trips ledger ---------- */

.trips-list {
  display: grid;
  overflow: clip;
  border: 1px solid var(--hairline);
  border-radius: var(--r-m);
  background: var(--panel);
}

.trip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: clamp(16px, 2.5vw, 32px);
  padding: 16px 20px;
}

.trip-row + .trip-row {
  border-top: 1px solid var(--hairline);
}

.trip-row > div:first-child {
  display: grid;
  gap: 3px;
  justify-items: start;
}

.trip-row p {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.trip-status {
  display: inline-flex;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trip-status.completed {
  color: var(--ink-soft);
}

.trip-status.cancelled {
  color: var(--ink-soft);
  border-style: dashed;
}

.trip-dates {
  display: grid;
  gap: 2px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.trip-dates strong {
  font-weight: 600;
}

.trip-dates span {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.trip-row > strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

/* keeps the ledger action column aligned when a trip can no longer be cancelled */
.trip-slot {
  min-width: 86px;
  min-height: 1px;
}

/* ---------- messages & empty states ---------- */

.product-message {
  padding: 14px 18px;
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--green);
  border-radius: var(--r-s);
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.product-message.error {
  border-left-color: var(--signal-red);
}

.trips-section .product-message {
  margin-bottom: 12px;
}

.empty-state {
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-m);
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.trips-list > .empty-state,
.branch-grid > .empty-state {
  border: 0;
  border-radius: 0;
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.form-message.success {
  color: var(--green);
}

.form-message.error,
.form-message.warning {
  color: var(--signal-red);
}

/* ---------- account sheet ---------- */

.account-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.account-sheet[aria-hidden="false"] {
  display: block;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(14, 26, 20, 0.5);
}

.sheet-backdrop:hover {
  background: rgba(14, 26, 20, 0.5);
}

.sheet-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(720px, 100%);
  height: 100%;
  overflow: auto;
  padding: clamp(20px, 4vw, 36px);
  background: var(--surface);
  box-shadow: -24px 0 60px rgba(22, 33, 27, 0.25);
}

.account-sheet[aria-hidden="false"] .sheet-panel {
  animation: sheet-in 240ms ease;
}

.account-sheet[aria-hidden="false"] .sheet-backdrop {
  animation: sheet-fade 200ms ease;
}

@keyframes sheet-in {
  from {
    transform: translateX(32px);
    opacity: 0;
  }
}

@keyframes sheet-fade {
  from {
    opacity: 0;
  }
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.sheet-head span {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sheet-head h2 {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.auth-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-m);
  background: var(--panel);
}

.auth-card h3 {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.demo-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-s);
  background: var(--surface);
}

.demo-login div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.demo-login strong {
  font-size: 0.85rem;
}

.demo-login code {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.demo-login button {
  min-height: 36px;
  padding: 0 14px;
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--green);
  font-size: 0.85rem;
}

.demo-login button:hover {
  background: var(--surface);
  border-color: var(--gravel);
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  /* the roadside line keeps priority; the counter list yields */
  .utility-line + .utility-line {
    display: none;
  }
}

@media (max-width: 1200px) {
  .fleet-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .filters {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filter-head,
  .filter-note {
    grid-column: 1 / -1;
  }

  .reservation-rail {
    position: static;
  }

  .rail-card {
    max-width: 640px;
  }
}

@media (max-width: 900px) {
  .route-console {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-console button {
    grid-column: 1 / -1;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trip-row {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 12px;
  }

  .trip-row > strong {
    align-self: end;
  }

  .trip-row button {
    justify-self: end;
  }

  .trip-slot {
    display: none;
  }
}

@media (max-width: 760px) {
  .deck-utility {
    display: none;
  }

  .deck-main {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand account"
      "nav trips";
    row-gap: 6px;
  }

  .deck-nav {
    border-left: 0;
    padding-left: 0;
    margin-left: -10px; /* first label aligns with the wordmark */
    overflow-x: auto;
    scrollbar-width: none;
  }

  .deck-nav::-webkit-scrollbar {
    display: none;
  }

  .account-slot {
    border-left: 0;
    padding-left: 0;
  }

  .deck-trips {
    align-self: center;
  }

  #fleet,
  #branches,
  #trips {
    scroll-margin-top: 112px;
  }

  main {
    gap: 40px;
    padding-bottom: 64px;
  }

  .quick-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-stats > div + div {
    border-left: 0;
  }

  .quick-stats > div:nth-child(even) {
    border-left: 1px solid var(--hairline);
  }

  .quick-stats > div:nth-child(n + 3) {
    border-top: 1px solid var(--hairline);
  }

  .section-title {
    flex-direction: column;
    align-items: stretch;
  }

  .section-title select {
    max-width: none;
  }

  .branch-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "city"
      "name"
      "addr"
      "meta";
    row-gap: 6px;
  }

  .branch-card > div {
    justify-items: start;
    text-align: left;
    padding-top: 4px;
  }

  .auth-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .deck-main {
    column-gap: 12px;
  }

  .account-slot {
    gap: 10px;
  }

  .renter-name {
    max-width: 25vw;
  }

  .route-console {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .fleet-foot {
    flex-wrap: wrap;
  }

  .trip-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .trip-dates {
    text-align: left;
  }

  .trip-row button {
    justify-self: start;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .fleet-row:hover {
    transform: none;
  }
}
