*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--deep);
  font-family: var(--font);
  font-size: var(--fs-label);
  line-height: var(--lh-label);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--deep); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.title { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 600; color: var(--deep); margin: 0; }
.para { font-size: var(--fs-para); line-height: var(--lh-para); font-weight: 500; color: var(--blue); margin: 0; }
.label { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 500; }
.meta { font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: 300; color: var(--grey); }

/* Every section title carries the app's 36 × 3 green bar (TitleAccent). */
.section-title { display: flex; flex-direction: column; gap: 6px; margin: 0 0 var(--s16); }
.section-title h1, .section-title h2 { font-size: 16px; line-height: 22px; font-weight: 600; margin: 0; color: var(--deep); }
.section-title::after { content: ""; width: 36px; height: 3px; background: var(--green); }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: var(--border); border-radius: var(--radius); padding: var(--s16); }
.card.soft { background: var(--lav-soft); border-color: transparent; }
.info { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--lav); color: var(--blue); font-size: var(--fs-meta); line-height: 18px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); padding: 0 20px; border-radius: var(--radius);
  border: 2px solid var(--blue); background: var(--blue); color: #fff;
  font-size: var(--fs-label); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--blue-pressed); border-color: var(--blue-pressed); }
.btn.secondary { background: #fff; color: var(--blue); }
.btn.secondary:hover { background: var(--line); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--grey); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn:disabled { background: var(--disabled); border-color: var(--disabled); color: var(--grey-text); cursor: default; }
.btn.small { height: 34px; padding: 0 14px; font-size: var(--fs-meta); }
.btn.block { display: flex; width: 100%; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-pill); font-size: var(--fs-meta); font-weight: 600; line-height: 1.2; white-space: nowrap; }
.chip.blue { background: var(--lav); color: var(--blue); }
.chip.green { background: var(--green); color: var(--deep); }
.chip.warn { background: var(--warn-chip); color: var(--deep); }
.chip.danger { background: var(--danger-wash); color: var(--danger); }
.chip.grey { background: #F0F0F0; color: var(--grey-text); }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--radius-chip); border: var(--border); background: #fff; color: var(--blue); font-weight: 500; cursor: pointer; }
.filter-chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- demo label ---------- */
.demo-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--radius-pill);
  border: 1.5px dashed var(--warn); background: var(--warn-wash); color: var(--warn);
  font-size: 11px; font-weight: 600; line-height: 16px; white-space: nowrap; vertical-align: middle;
}
.demo-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }

/* ---------- language switch ---------- */
.lang-switch { display: inline-flex; border: var(--border); border-radius: var(--radius-chip); overflow: hidden; background: #fff; }
.lang-switch button { border: 0; background: transparent; color: var(--blue); padding: 5px 12px; font-size: var(--fs-meta); font-weight: 600; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* ---------- app frame ---------- */
.topbar { height: 64px; display: flex; align-items: center; gap: var(--s16); padding: 0 var(--s24); background: #fff; border-bottom: var(--border); }
.topbar .logo { height: 54px; width: auto; display: block; margin: 0 -6px; }
.topbar .divider { width: 2px; height: 30px; background: var(--line); }
.page { padding: var(--s24); max-width: 1440px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: var(--s16); }
.stack.tight { gap: 0; }
.spacer { flex: 1 1 auto; }
.row { display: flex; align-items: center; gap: var(--s12); flex-wrap: wrap; }

/* ---------- split view: office + phone ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: var(--s20); height: 100vh; padding: var(--s16); background: #EEF3FA; }
.split iframe { width: 100%; height: 100%; border: var(--border); border-radius: var(--radius); background: var(--ground); }
.phone { align-self: center; justify-self: center; width: 395px; height: min(820px, calc(100vh - 32px)); padding: 12px; border-radius: 44px; background: #0B1220; }
.phone iframe { border: 0; border-radius: 34px; }
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; height: auto; }
  .split > iframe { height: 80vh; }
}

/* ---------- driver (mobile) frame ---------- */
.driver { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--ground); display: flex; flex-direction: column; }
.driver-top { display: flex; align-items: center; gap: var(--s12); padding: var(--s12) var(--s16); background: #fff; border-bottom: var(--border); }
.driver-top .logo { height: 44px; width: auto; display: block; margin: -4px -6px; }
.driver-body { padding: var(--s16); display: flex; flex-direction: column; gap: var(--s12); }

/* ---------- placeholder (until the ticket that owns the screen lands) ---------- */
.placeholder { border: 2px dashed var(--line); border-radius: var(--radius); padding: var(--s24); color: var(--grey); }

/* ---------- form fields (app text field: 2px blue border, radius 10) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: var(--fs-meta); font-weight: 500; color: var(--blue); }
.field input, .field textarea, .field-select {
  width: 100%; min-height: var(--btn-h); padding: 10px 14px; border: 2px solid var(--blue); border-radius: var(--radius);
  background: #fff; color: var(--blue); font-size: var(--fs-label);
}
.field input:focus, .field textarea:focus, .field-select:focus { outline: none; border-color: var(--deep); color: var(--deep); }
.field input::placeholder { color: var(--grey); }
.form-error { margin: 0; color: var(--danger); font-size: var(--fs-meta); font-weight: 500; }
.center { text-align: center; }

/* ---------- signed-in user ---------- */
.user-chip { display: flex; align-items: center; gap: var(--s12); padding-left: var(--s16); border-left: var(--border); }
@media (max-width: 720px) { .user-chip .stack { display: none; } }

.info > .demo-badge { align-self: flex-start; flex: none; }
.lang-switch { flex: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
  border: var(--border); border-radius: var(--radius); background: #fff; color: var(--blue); cursor: pointer; }
.icon-btn:hover { border-color: var(--blue); }
.stack > .section-title { margin-bottom: 0; }
.self-start { align-self: flex-start; }

/* ---------- demo bar (DEMO-15) ---------- */
.demobar { position: sticky; top: 0; z-index: 30; background: #FFF9E0; border-bottom: 2px solid var(--warn-chip); }
.demobar-row { display: flex; align-items: center; gap: 8px 10px; padding: 8px var(--s16); overflow-x: auto; white-space: nowrap; }
.demobar-field { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-meta); color: var(--grey-text); }
.demobar-field select { height: 34px; border: var(--border); border-radius: var(--radius); padding: 0 8px; font: inherit; color: var(--deep); background: #fff; max-width: 220px; }
.demobar-sep { width: 2px; height: 24px; background: var(--warn-chip); flex: none; }
.demobar .btn.small { flex: none; }
.demobar .small-check { font-size: var(--fs-meta); flex-wrap: nowrap; }
.demobar .small-check input { width: 16px; height: 16px; }
.demobar-pill { position: fixed; right: 12px; bottom: 12px; z-index: 30; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-pill); border: 2px solid var(--warn-chip); background: #FFF9E0; color: var(--deep); font: inherit; font-size: var(--fs-meta); cursor: pointer; }
@media (min-width: 721px) { .demobar-row { flex-wrap: wrap; overflow-x: visible; } }
@media (min-width: 1101px) { body[data-bar="open"] .split { height: calc(100vh - var(--bar-h, 54px)); } }
body[data-bar="open"] .phone { height: min(820px, calc(100vh - var(--bar-h, 54px) - 32px)); }

/* ---------- push notifications on the phone (DEMO-15) ---------- */
.push { display: flex; flex-direction: column; gap: 4px; margin: 8px var(--s16) 0; padding: 10px 12px; border: 2px solid var(--blue); border-radius: var(--radius); background: #fff; color: var(--deep); }
.push-app { font-size: var(--fs-meta); color: var(--grey); }
.push .demo-badge { align-self: flex-start; }
.bell { position: relative; }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.self-end { align-self: flex-end; }
