:root {
  --stage-bg: #171813;
  --panel: #1b1e18;
  --fine-line: #30332c;
  --accent-dark: #3d2b21;
}
body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  background: var(--paper);
}
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
fieldset { min-width: 0; }
legend { padding-inline: 5px; }
p, h1, h2, h3 { overflow-wrap: anywhere; }
.preview-bar {
  z-index: 2;
  border-bottom: 1px solid var(--fine-line);
  background: #1b1d17;
}
.preview-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 1120px);
  min-height: 56px;
  gap: 16px;
  margin-inline: auto;
  padding-inline: clamp(12px, 4vw, 30px);
}
.preview-brand, .role-nav, .role-nav a { display: flex; align-items: center; }
.preview-brand { gap: 8px; color: var(--muted); white-space: nowrap; font-size: 12px; }
.preview-brand img { border-radius: 8px; }
.role-nav { gap: 4px; }
.role-nav a { min-height: 36px; gap: 6px; padding: 6px 12px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 500; }
.role-nav .icon { width: 14px; height: 14px; }
.role-nav a[aria-current] { color: var(--accent-soft); background: var(--accent-dark); }
.language-switch { color: var(--accent-soft); font-size: 13px; font-weight: 700; padding: 6px 4px; }
.test-clock-bar { padding: 6px 12px; text-align: center; color: var(--accent-soft); background: #37291e; font-size: 12px; }
.connected-screen { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #4a4b43 transparent; outline: none; }
.loading-state { padding: 60px 20px; text-align: center; color: var(--muted); }
.connected-page { max-width: 720px; margin-inline: auto; padding: 25px clamp(18px, 4vw, 36px) 34px; }
.flow-page { max-width: 620px; }
.home-connected, .office-page { max-width: 1040px; }
.connected-brand { display: inline-flex; align-items: center; width: 142px; }
.connected-logo { width: 100%; height: auto; }
.home-connected .home-hero { min-height: 305px; }
.home-connected .hero-copy { padding: clamp(22px, 5vw, 46px); }
.home-connected .home-hero h1 { margin-top: 0; font-size: clamp(37px, 7.3vw, 70px); letter-spacing: -.045em; }
.home-connected .hero-description { max-width: 275px; font-size: 15px; }
.home-connected .hero-car { width: 63%; max-width: 600px; inset-inline-end: -3%; }
.home-connected .favorite { min-height: 125px; padding: 15px; }
.home-connected .favorite strong { font-size: 16px; }
.customer-welcome {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  min-height: 100%;
  max-width: 480px;
  padding-block: 28px 40px;
  text-align: center;
}
.welcome-logo { width: min(45%, 165px); height: auto; }
.welcome-car { width: min(90%, 365px); max-height: 27vh; object-fit: contain; }
.customer-welcome h1 { max-width: 12ch; font-size: clamp(34px, 9vw, 54px); line-height: 1.05; }
:lang(ar) .customer-welcome h1 { max-width: none; }
.customer-welcome p { max-width: 31ch; color: var(--muted); line-height: 1.5; }
.welcome-actions { display: grid; width: min(100%, 285px); gap: 6px; margin-top: 6px; }
.welcome-actions button { min-height: 46px; justify-content: center; }
.coverage { padding-block: 16px; border-top: 1px solid var(--fine-line); }
.coverage h2 { font-size: 14px; }
.coverage p { margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.connected-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 18px; }
.connected-heading h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.08; letter-spacing: -.025em; }
.connected-heading p { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.connected-heading > .status-tag { align-self: start; }
.tab-bar { width: min(100%, 520px); }
.panel, .connected-order, .metric, .agenda-column {
  padding: 15px;
  border: 1px solid var(--fine-line);
  border-radius: 15px;
  background: var(--panel);
}
.stack { display: grid; gap: 12px; }
.stack > .field + .field, .stack > .flow-cta, .stack > .total-line { margin-top: 0; }
.stack .field > span { color: var(--ink); font-size: 13px; font-weight: 700; }
.stack .field small { color: var(--muted); font-size: 12px; }
.stack > .inline-link { justify-self: start; }
.stack > .section-heading { margin-bottom: 0; }
.panel h2 { font-size: 17px; }
.quiet { color: var(--muted); font-size: 13px; line-height: 1.5; }
.warning-text { color: var(--accent-soft); font-size: 14px; line-height: 1.5; }
.button-row, .order-line { display: flex; gap: 9px; align-items: center; }
.button-row { flex-wrap: wrap; }
.order-line { justify-content: space-between; }
.order-line bdi { color: var(--accent-soft); font-weight: 700; }
.total-line { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 15px; }
.wash-choices { padding: 0; border: 0; }
.wash-choices legend, .car-details legend { color: var(--accent-soft); font-size: 13px; font-weight: 700; }
.wash-choices legend { padding-block: 6px; }
.choice-row { position: relative; cursor: pointer; }
.choice-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.choice-row:has(:checked) { border-color: var(--accent); background: #30251e; }
.minor-details {
  padding: 11px 13px;
  border: 1px solid var(--fine-line);
  border-radius: 12px;
  background: var(--panel);
}
.minor-details summary { color: var(--accent-soft); cursor: pointer; font-size: 14px; line-height: 1.45; }
.minor-details[open] summary { margin-bottom: 10px; }
.minor-details ul { margin: 0; padding-inline-start: 20px; font-size: 14px; }
.extras-list { display: grid; gap: 8px; margin-top: 10px; }
.extras-list p { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.periods { display: flex; gap: 6px; }
.periods button { min-height: 36px; padding: 5px 11px; border: 1px solid var(--fine-line); border-radius: 9px; color: var(--muted); font-size: 13px; }
.periods button[aria-pressed="true"] { background: var(--accent-dark); color: var(--accent-soft); border-color: #72523e; }
.connected-page .time-list { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); max-height: 270px; overflow-y: auto; padding: 2px 2px 3px; }
.connected-page [data-form="pick-time"] .time-list { grid-template-columns: repeat(auto-fit, minmax(131px, 1fr)); }
.day-choice:disabled { opacity: .54; }
.connected-page .date-list { padding-bottom: 8px; }
.select-field select { min-width: 0; text-overflow: ellipsis; }
.field input[type="file"] { font-size: 13px; max-width: 100%; }
.field input::file-selector-button { color: var(--ink); background: var(--soft); border: 0; border-radius: 6px; padding: 7px; margin-inline-end: 8px; }
.connected-order { display: grid; gap: 7px; transition: border-color .12s; }
.connected-order:hover { border-color: #735442; }
.connected-order p, .connected-order small, .order-line small { color: var(--muted); font-size: 12px; }
.connected-order bdi { font-size: 13px; }
.status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 50px;
  padding: 4px 8px;
  background: var(--soft);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.status-en_route, .status-payment_review { background: var(--accent-dark); color: var(--accent-soft); }
.status-complete { background: #243728; color: #a7dbb0; }
.status-cancelled { background: #3b2826; color: #f6bbb2; }
.car-line { display: flex; align-items: center; gap: 9px; margin-block: 11px; }
.car-line div { display: grid; flex: 1; min-width: 0; gap: 3px; }
.car-line small { color: var(--muted); font-size: 12px; }
.plate { flex: none; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 12px; }
.order-facts .warning-text { margin-block: 8px; }
.contact-info { margin-top: 10px; }
.danger-button { min-height: 44px; padding: 8px 13px; border: 1px solid #65403b; border-radius: 11px; color: #ffb5a9; background: #342322; font-size: 14px; font-weight: 700; }
.check-row { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.check-row input { accent-color: var(--accent); }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.photo-grid a { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-grid span { display: block; padding: 7px 10px; font-size: 13px; }
.receipt { margin-top: 14px; }
.receipt p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.receipt .inline-link { margin-top: 7px; }
.staff-login { max-width: 440px; padding-top: clamp(24px, 6vh, 60px); }
.staff-logo { width: 150px; margin-bottom: 24px; }
.staff-actions > .primary-button { min-height: 48px; }
.office-tools { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.office-tools .field { min-width: 150px; }
.office-tools .field span { color: var(--muted); font-size: 12px; }
.metric-grid, .agenda { display: grid; gap: 10px; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric { display: grid; gap: 6px; }
.metric strong { font-size: clamp(18px, 4vw, 28px); }
.metric span { color: var(--muted); font-size: 12px; }
.agenda { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.agenda-column { align-self: start; background: #161813; }
.agenda-empty { padding: 11px 0; }
.history { padding: 0; list-style: none; }
.history li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.history li small { color: var(--muted); }
.tracking-panel { margin-top: 10px; }
.tracking-map {
  position: relative;
  height: clamp(180px, 38vw, 270px);
  margin-top: 12px;
  overflow: hidden;
  direction: ltr;
  border-radius: 11px;
  background-color: #e5e3d7;
  background-image: linear-gradient(#d0cdc3 1px, transparent 1px), linear-gradient(90deg, #d0cdc3 1px, transparent 1px);
  background-size: 21px 21px;
}
.tracking-map .route-map { position: absolute; inset: 0; }
.map-grid img { position: absolute; inset: 0 auto auto 0; max-width: none; }
.map-marker { position: absolute; display: grid; place-items: center; width: 34px; height: 34px; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 7px #0005; }
.van-marker { background: #24251e; color: #fff1df; }
.parking-marker { background: var(--accent); color: #332317; }
.map-credit { position: absolute; bottom: 0; right: 0; padding: 3px 4px; background: #fffe; color: #333; font-size: 10px; }
.map-meta { margin-top: 5px; }
.live-indicator { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 4px #f4824c28; }
.connected-dialog {
  width: min(calc(100% - 24px), 460px);
  max-height: min(88vh, 690px);
  padding: 19px;
  border: 1px solid #54473c;
  border-radius: 17px;
  background: var(--panel);
  color: var(--ink);
}
.connected-dialog::backdrop { background: #080807b9; }
.connected-dialog > .order-line { margin-bottom: 14px; }
.connected-dialog h2 { font-size: 19px; }
.connected-toast {
  position: fixed;
  z-index: 5;
  inset-inline-start: 50%;
  bottom: 78px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 12px 15px;
  border: 1px solid #715741;
  border-radius: 12px;
  background: #342b24;
  color: var(--ink);
  box-shadow: 0 7px 25px #0005;
  text-align: center;
  font-size: 14px;
}
[dir="rtl"] .connected-toast { transform: translateX(50%); }
@media (max-width: 640px) {
  .preview-bar-inner { gap: 5px; }
  .preview-brand span { display: none; }
  .role-nav a { padding-inline: 8px; }
  .role-nav .icon { display: none; }
  .home-connected .home-hero { min-height: 270px; }
  .home-connected .hero-description { max-width: 180px; }
  .home-connected .hero-car { width: 78%; inset-inline-end: -12%; }
  .agenda, .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .agenda { grid-template-columns: 1fr; }
  .tracking-steps { gap: 4px; }
  .tracking-steps li { font-size: 10px; }
  .tracking-steps li span { width: 28px; height: 28px; }
}
@media print {
  body { display: block; height: auto; color: #161612; background: #fff; color-scheme: light; }
  .preview-bar, .app-footer, .connected-toast, .order-detail > :not(.receipt), .receipt button { display: none; }
  .connected-screen { overflow: visible; }
  .receipt { color: #161612; background: #fff; border-color: #aaa; }
  .receipt :is(p, bdi) { color: #161612; }
}
.crew-identity { display: flex; align-items: center; gap: 12px; }
.crew-avatar { display: block; inline-size: 52px; block-size: 52px; object-fit: cover; border-radius: 50%; flex: 0 0 52px; }
.crew-initial { display: grid; place-items: center; font-weight: 700; background: var(--soft); }
