:root {
  --ink: #262626;
  --ink-soft: #666666;
  --paper: #F1F1F1;
  --paper-raised: #FFFFFF;
  --denim: #3A3A3A;
  --denim-deep: #1F1F1F;
  --orange: #FF6200;
  --orange-deep: #E85000;
  --steel: #999999;
  --line: #E1E1E1;
  --green: #CC530C;
  --green-bg: #FDECE0;
  --red: #A8402C;

  --font-display: 'Archivo Black', 'Arial Black', sans-serif;
  --font-body: 'Work Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 4px;
  --shadow-card: 0 2px 0 var(--line), 0 10px 24px -14px rgba(38, 38, 38, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  background-image:
    linear-gradient(90deg, rgba(38,38,38,0.035) 1px, transparent 1px),
    linear-gradient(rgba(38,38,38,0.035) 1px, transparent 1px);
  background-size: 28px 28px;
}

#root { min-height: 100vh; display: flex; flex-direction: column; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.08;
  margin: 0;
  text-transform: uppercase;
}
p { margin: 0; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink);
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.btn:hover { transform: translate(-1px, -1px); }
.btn:active { transform: translate(0, 0); }

.btn-primary { background: var(--orange); border-color: var(--orange-deep); color: #fff; box-shadow: 3px 3px 0 var(--ink); }
.btn-primary:hover { box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:active { box-shadow: 1px 1px 0 var(--ink); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--paper-raised); box-shadow: 3px 3px 0 var(--orange); }
.btn-dark:hover { box-shadow: 4px 4px 0 var(--orange); }

.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange-deep); background: var(--green-bg); }

.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 12px; }

/* ---------- forms ---------- */

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--denim); outline: none; }
.field textarea { resize: vertical; min-height: 96px; }
.field input.has-error, .field select.has-error, .field textarea.has-error {
  border-color: var(--red);
  background: #FDECE8;
}
.field input.has-error:focus, .field select.has-error:focus, .field textarea.has-error:focus {
  border-color: var(--red);
  outline: 2px solid #F3B3A3;
}
.required-mark { color: var(--red); font-weight: 700; margin-left: 2px; }
.field-error {
  color: #fff;
  background: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
}
.field-error::before { content: '!'; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: #fff; color: var(--red); font-size: 11px; }
.field-hint { color: var(--steel); font-size: 13px; margin-top: 6px; }
.field-hint-success { color: #1a7f37; font-weight: 600; }
.field-hint-error { color: var(--red); font-weight: 600; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.banner { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 20px; border: 2px solid; }
.banner-error { background: var(--red); border-color: #7A2C1D; color: #fff; font-weight: 700; }
.banner-success { background: var(--green-bg); border-color: var(--green); color: var(--green); }

/* ---------- confirm dialog ---------- */

.confirm-dialog {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px;
  max-width: 360px;
  width: calc(100% - 40px);
}
.confirm-dialog::backdrop { background: rgba(38, 38, 38, 0.5); }
.confirm-dialog p { margin: 0 0 8px; }
.confirm-dialog p:last-of-type { margin-bottom: 18px; }
.confirm-dialog .dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- chips / tags ---------- */

.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border: 2px solid var(--line);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--paper-raised);
  color: var(--ink-soft);
  transition: all 0.12s ease;
}
.chip.selected { background: var(--denim); border-color: var(--denim-deep); color: #fff; }

.chip { position: relative; cursor: pointer; user-select: none; }
.chip-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip:has(.chip-input:checked) { background: var(--denim); border-color: var(--denim-deep); color: #fff; }
.chip:has(.chip-input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 2px; }

.tag {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--orange);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---------- status stamp ---------- */

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 3px;
  border: 2px solid currentColor;
  transform: rotate(-2deg);
}
.stamp-available { color: var(--green); }
.stamp-busy { color: var(--steel); }
.stamp::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- work-ticket card (signature element) ---------- */

.ticket {
  position: relative;
  background: var(--paper-raised);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ticket-perforation { border-top: 2px dashed var(--line); margin: 2px 0; }

.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ticket-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--denim);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  flex-shrink: 0;
}
.ticket-id { font-family: var(--font-mono); font-size: 11px; color: var(--steel); letter-spacing: 0.06em; }

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--orange-deep);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after { content: ''; flex: 1; height: 2px; background: var(--line); }

/* ---------- layout helpers ---------- */

.card {
  background: var(--paper-raised);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  padding: 28px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.spinner {
  width: 18px; height: 18px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- site chrome ---------- */

.site-header {
  border-bottom: 2px solid var(--orange);
  background: var(--paper-raised);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  flex-wrap: nowrap;
  gap: 10px;
  position: relative;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 0; }
.brand-logo { height: 48px; width: auto; max-width: 275px; display: block; flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; flex-shrink: 0; }
.nav-links a { white-space: nowrap; }

/* Below desktop width, the nav stays inline (no dropdown, no menu
   button, no stacking) by fluidly shrinking the logo, the buttons'
   padding/font-size/border, and the header/gap spacing with the
   viewport — the buttons keep their box (border/background/shadow),
   just at a smaller scale. Sized from real measurements so "Register"
   (the longest label) never wraps or overflows, all the way to 320px. */
@media (max-width: 767px) {
  .site-header-inner {
    padding: clamp(4px, 2vw, 14px) clamp(6px, 2vw, 16px);
    gap: clamp(3px, 1.5vw, 10px);
  }
  .brand { gap: clamp(3px, 1.2vw, 8px); }
  .brand-logo { height: clamp(17px, 6vw, 34px); max-width: none; }

  .nav-links { gap: clamp(2px, 1.6vw, 10px); }
  .nav-links a {
    padding: clamp(3px, 1.4vw, 9px) clamp(5px, 2vw, 16px);
    font-size: clamp(8px, 2.2vw, 12px);
    gap: clamp(3px, 1vw, 8px);
    border-width: 1px;
  }
  .nav-links a.btn-primary,
  .nav-links a.btn-dark { box-shadow: 2px 2px 0 var(--ink); }
  .nav-links a.btn-primary:hover,
  .nav-links a.btn-dark:hover { box-shadow: 2px 2px 0 var(--ink); transform: none; }
}

.site-footer {
  border-top: 2px solid var(--ink);
  margin-top: auto;
  background: var(--ink);
  color: var(--paper);
}
.site-footer-inner {
  padding: 28px 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-note { font-family: var(--font-mono); font-size: 13px; opacity: 0.75; }

main { flex: 1; }

/* ---------- home hero ---------- */

.hero { border-bottom: 2px solid var(--ink); background: var(--paper-raised); }
.hero-inner {
  padding: 64px 24px 48px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; } }
.hero-title { font-size: clamp(36px, 5vw, 58px); margin-bottom: 16px; }
.hero-sub { font-size: 17px; color: var(--ink-soft); max-width: 460px; margin-bottom: 28px; }
.hero-ticket { transform: none; }

/* ---------- directory ---------- */

.directory-wrap { padding: 40px 24px 80px; }
.search-card { margin-bottom: 32px; padding: 20px; }
.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.results-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
/* Grid items default to min-width:auto, sizing to their content's
   min-content width instead of the track — without this, a card whose
   content can't shrink (long name, unbroken tag list) forces the whole
   grid, and the page, wider than the viewport. */
.directory-grid > .ticket { min-width: 0; }
.empty-state { text-align: center; padding: 48px; }

/* ---------- listing / profile card bits ---------- */

.avatar-photo { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.trade-label { font-family: var(--font-mono); font-size: 12px; color: var(--orange-deep); font-weight: 700; margin-top: 2px; }
.muted-line { font-family: var(--font-mono); font-size: 12px; color: var(--steel); margin-top: 4px; }
.bio-clamp { font-size: 14px; color: var(--ink-soft); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.listing-meta { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 13px; margin-top: auto; padding-top: 8px; }

.profile-wrap { padding: 48px 24px 80px; max-width: 760px; }
.back-link { font-family: var(--font-mono); font-size: 13px; color: var(--steel); }
.profile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.profile-name-row { display: flex; gap: 16px; align-items: center; }

.auth-wrap { padding: 48px 24px 80px; max-width: 640px; }
.auth-wrap.narrow { max-width: 440px; padding-top: 64px; }

.dashboard-wrap { padding: 40px 24px 80px; max-width: 780px; }
.dashboard-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; }

.photo-row { display: flex; align-items: center; gap: 16px; }
.photo-actions { display: flex; gap: 8px; }

/* ---------- list resets (chip-grid / tag-list used on <ul>) ---------- */

ul.chip-grid, ul.tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag-muted { background: var(--steel); }

/* ---------- accessibility helpers ---------- */

.visually-hidden {
  position: absolute;
  /* !important: this class is used on inputs nested inside more specific
     component selectors (e.g. `.field input`) that would otherwise win
     the cascade and undo the hiding — most visibly, expanding the hidden
     file input on the photo-upload control to the page's full width and
     causing page-wide horizontal overflow. */
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 100;
  font-family: var(--font-mono);
  font-size: 13px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- fieldsets (form grouping) ---------- */

fieldset {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 4px;
  margin: 0 0 24px;
}
fieldset legend {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange-deep);
  padding: 0 8px;
}

/* ---------- small layout utility classes (replace one-off inline styles) ---------- */

.mb-0 { margin-bottom: 0; }
.mt-14 { margin-top: 14px; }
.flex-gap-10 { display: flex; gap: 10px; }
.flex-1 { flex: 1; }
.inline-flex { display: inline-flex; }
.text-center { text-align: center; }
.rate-figure { font-weight: 600; font-family: var(--font-mono); }

.listing-card { text-decoration: none; }
.listing-identity { display: flex; gap: 12px; min-width: 0; flex: 1 1 auto; }
.listing-identity > div { min-width: 0; }
.listing-card .listing-name, .listing-card .trade-label, .listing-card .muted-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-head .stamp { flex-shrink: 0; }
.listing-name { font-size: 17px; }

.avatar-photo-lg { width: 72px; height: 72px; }
.avatar-lg { width: 72px; height: 72px; font-size: 22px; }

/* ---------- bookings ---------- */

.booking-detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 13px;
}
.booking-detail-list div { display: contents; }
.booking-detail-list dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--steel);
  align-self: center;
}
.booking-detail-list dd {
  margin: 0;
  font-family: var(--font-mono);
  align-self: center;
}
.booking-detail-list a { color: var(--denim); text-decoration: underline; }

.booking-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}

/* ---------- hover states (orange) ---------- */

.nav-links a { transition: color 0.12s ease, border-color 0.12s ease; }
/* Navigation menu items don't change on hover — this cancels the general
   .btn hover effects (transform/shadow/color shift) specifically for nav. */
.nav-links a:hover { transform: none; box-shadow: none; border-color: var(--line); color: inherit; background: none; }
.nav-links a.btn-primary:hover { color: #fff; background: var(--orange-deep); box-shadow: 0 0 0 3px rgba(255,255,255,0.6); }
.bottom-nav-item:hover { color: inherit; background: none; }


.ticket { transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease; }
a.ticket:hover {
  border-color: var(--orange);
  box-shadow: 0 2px 0 var(--orange), 0 12px 26px -14px rgba(242, 101, 15, 0.35);
  transform: translateY(-2px);
}

.chip:hover { border-color: var(--orange); }
.chip:has(.chip-input:checked):hover { border-color: var(--orange-deep); }

.back-link { transition: color 0.12s ease; }
.back-link:hover { color: var(--orange-deep); }



.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--orange); }

/* ---------- service picker (plain list, not chips) ---------- */

.service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  max-height: 320px;
  overflow-y: auto;
  background: var(--paper-raised);
}
.service-list li + li { border-top: 1px solid var(--line); }

.service-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.1s ease;
}
.service-row:hover { background: var(--green-bg); }
.service-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
  flex-shrink: 0;
}
.service-row:has(input:checked) {
  background: var(--green-bg);
  font-weight: 600;
}

/* ---------- availability calendar ---------- */

.avail-calendar { margin-bottom: 20px; }
.avail-calendar-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.avail-calendar table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.avail-calendar th {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--steel);
  font-weight: 600;
  padding: 4px 0;
  text-align: center;
}
.avail-calendar td {
  text-align: center;
  font-size: 13px;
  font-family: var(--font-mono);
  padding: 8px 2px;
  border: 1px solid var(--line);
}
.avail-empty { border: 1px solid transparent; background: transparent; }
.avail-day-open { background: var(--green-bg); color: var(--orange-deep); font-weight: 700; transition: background 0.12s ease, transform 0.12s ease; }
.avail-day-open:hover { background: var(--orange); color: #fff; }
.avail-day-closed { background: var(--paper); color: var(--steel); }
.avail-day-past { background: transparent; color: var(--line); }
.avail-day-today { outline: 2px solid var(--orange); outline-offset: -2px; border-radius: 3px; }

.avail-day-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.avail-day-open:hover .avail-day-link { color: #fff; }
.avail-day-open:has(.avail-day-link.is-selected) {
  background: var(--orange);
  color: #fff;
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
.avail-day-link.is-selected { color: #fff; }

.avail-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.avail-legend span { display: inline-flex; align-items: center; gap: 6px; }
.avail-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--line); }
.avail-legend .swatch-open { background: var(--green-bg); border-color: var(--orange-deep); }
.avail-legend .swatch-closed { background: var(--paper); }

.day-toggle-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.day-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  min-width: 56px;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.day-toggle:hover { border-color: var(--orange); }
.day-toggle:has(input:checked) { background: var(--green-bg); border-color: var(--orange-deep); font-weight: 700; color: var(--orange-deep); }
.day-toggle input { accent-color: var(--orange); }

.blocked-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
}
.blocked-date-row + .blocked-date-row { border-top: 1px solid var(--line); }

/* ---------- mobile / tablet responsiveness ---------- */

@media (max-width: 640px) {
  .container { padding: 0 16px; }

  .hero-inner { padding: 40px 16px 32px; gap: 28px; }
  .hero-title { font-size: clamp(28px, 8vw, 40px); }
  .hero-sub { font-size: 15px; }

  .directory-wrap { padding: 24px 16px 56px; }
  .search-grid { grid-template-columns: 1fr; }
  .directory-grid { grid-template-columns: 1fr; gap: 20px; }

  .card { padding: 20px; }
  .ticket { padding: 18px; }

  .auth-wrap, .auth-wrap.narrow { padding: 32px 16px 56px; max-width: 100%; }
  .dashboard-wrap, .profile-wrap { padding: 24px 16px 56px; }

  .dashboard-head, .profile-head { flex-direction: column; align-items: flex-start; }
  .dashboard-head h1, .profile-head h1 { font-size: 24px; }

  fieldset { padding: 14px 14px 2px; }

  .btn { padding: 12px 18px; font-size: 13px; }
  .btn-block { width: 100%; }

  .grid-2 { gap: 20px; }

  .avail-calendar td { padding: 6px 1px; font-size: 12px; }
  .avail-calendar th { font-size: 10px; }

  .day-toggle { min-width: 44px; padding: 8px 2px; font-size: 11px; }

  .booking-detail-list { font-size: 12px; }
  .booking-actions { flex-direction: column; align-items: stretch; }
  .booking-actions .btn { width: 100%; }

  .listing-identity { gap: 10px; }
  .listing-name { font-size: 16px; }
}

@media (max-width: 400px) {
  .hero-title { font-size: 26px; }
  .avail-calendar td { padding: 5px 1px; font-size: 11px; }
}

/* Touch targets: keep interactive elements comfortably tappable on phones */
@media (pointer: coarse) {
  .btn, .chip, .service-row, .day-toggle { min-height: 40px; }
  .field input, .field select { min-height: 44px; }
}

/* ---------- app-style bottom nav ---------- */
/* Logged-out visitors: normal top nav, bottom nav only appears on mobile
   (handled in the mobile media query below). Logged-in: bottom nav is the
   primary navigation everywhere, desktop included — see .is-authed rules. */

.bottom-nav {
  display: none;
  justify-content: center;
  align-items: stretch;
  gap: 4px;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--orange);
  box-shadow: 0 -4px 16px -6px rgba(0,0,0,0.25);
  z-index: 50;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 560px) {
  .bottom-nav-item { flex: 0 0 100px; }
}
.bottom-nav-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  color: rgba(255,255,255,0.8);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-radius: 8px;
  transition: color 0.12s ease, background 0.12s ease;
}
.bottom-nav-item svg { width: 22px; height: 22px; }

.bottom-nav-item.active { color: #fff; background: rgba(255,255,255,0.18); }
.bottom-nav-badge {
  position: absolute;
  top: 2px;
  left: 50%;
  margin-left: 6px;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  padding: 0 4px;
  background: #fff;
  color: var(--orange-deep);
  border: 1px solid var(--orange-deep);
}

/* Logged-in: bottom nav is the primary navigation at every screen size. */
.app-shell.is-authed .bottom-nav { display: flex; }
.app-shell.is-authed { padding-bottom: 68px; }
.app-shell.is-authed .site-footer { display: none; }
.app-shell.is-authed .nav-desktop-only { display: none; }

@media (max-width: 780px) {
  .bottom-nav { display: flex; }
  .app-shell { padding-bottom: 68px; }
  .site-footer { display: none; }
  .nav-desktop-only { display: none; }
  /* The page title is redundant with the bottom-nav's active tab and can
     hide on mobile, but the availability status/toggle inside the same
     header must stay reachable at every width — it has no other control
     anywhere else in the app. */
  .dashboard-head { margin-bottom: 16px; }
  .dashboard-head-title { display: none; }
  .dashboard-availability { flex-wrap: wrap; }
  .dashboard-quicklinks { display: none; }
}

/* ---------- plain checkbox rows (tools / vehicle etc) ---------- */

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  padding: 8px 0;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
  flex-shrink: 0;
}

.trait-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.trait-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
}
.trait-badge svg { width: 13px; height: 13px; stroke: var(--orange-deep); }

/* ---------- single-month calendar with side arrows ---------- */

.calendar-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.calendar-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--orange);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.12s ease, transform 0.12s ease;
}
.calendar-arrow:hover { background: var(--orange-deep); transform: scale(1.06); }
.calendar-arrow-disabled { background: var(--line); color: var(--steel); cursor: not-allowed; }

@media (max-width: 480px) {
  .calendar-nav-row { gap: 8px; }
  .calendar-arrow { width: 32px; height: 32px; font-size: 15px; }
}

/* ---------- required field marker ---------- */
.required-mark { color: var(--red); margin-left: 3px; font-weight: 700; }

/* ---------- star rating input (pure CSS, no JS) ---------- */

.star-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
}
.star-rating input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.star-rating label {
  font-size: 34px;
  line-height: 1;
  color: var(--line);
  cursor: pointer;
  transition: color 0.1s ease;
}
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
  color: var(--orange);
}
.star-rating input:focus-visible + label {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- rating display (read-only, on cards/profile) ---------- */

.rating-display {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.rating-display .stars { color: var(--orange); letter-spacing: 1px; }
.rating-display .count { color: var(--steel); font-weight: 500; }

.review-card {
  padding: 16px 0;
}
.review-card + .review-card { border-top: 1px solid var(--line); }
.review-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.review-card-name { font-weight: 700; font-size: 14px; }
.review-card-date { font-family: var(--font-mono); font-size: 11px; color: var(--steel); }
.review-card-stars { color: var(--orange); letter-spacing: 1px; margin-bottom: 6px; }
.review-card-comment { font-size: 14px; color: var(--ink-soft); }

/* ---------- global page-loading indicator ---------- */

#page-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(241, 241, 241, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#page-loading-overlay.is-visible { display: flex; }
.page-loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(38, 38, 38, 0.15);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: page-loading-spin 0.7s linear infinite;
}
@keyframes page-loading-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .page-loading-spinner { animation-duration: 1.6s; }
}

/* ---------- subscription plan picker ---------- */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.plan-card { text-align: center; }
.plan-price { font-family: var(--font-display); font-size: 40px; color: var(--orange-deep); line-height: 1; }

/* ---------- homepage "what we do" explainer ---------- */

.what-we-do {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 40px;
}

/* ---------- booking summary breakdown ---------- */

.booking-summary-grid { display: flex; gap: 20px; flex-wrap: wrap; }
.booking-summary-grid dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--steel); margin-bottom: 2px; }
.booking-summary-grid dd { font-family: var(--font-mono); font-weight: 700; font-size: 15px; margin: 0; }
