/* Rozma customer app. Mobile-first single column; bottom tab bar; brand red #ED3535. */
/* Colour tokens. --brand can be changed live from the Brand panel; ink and soft tints derive from it. */
:root {
  --bg: #FBF9F9; --surface: #FFFFFF; --sunk: #F3EFEF; --fg: #1D1718; --muted: #6E6264; --line: #EAE3E3;
  --brand: #ED3535;
  --brand-ink: color-mix(in srgb, var(--brand) 82%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 12%, var(--surface));
  --on-brand: #FFFFFF;
  --ok: #1F8A5B; --ok-soft: #E3F3EB; --warn: #A86A12; --warn-soft: #FBF0DC;
  --vendor: var(--brand);
  --radius: 14px; --radius-sm: 12px;
  --f-body: "Google Sans Flex", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-arabic: "IBM Plex Sans Arabic", "Google Sans Flex", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131011; --surface: #1C1718; --sunk: #241E1F; --fg: #F3EDED; --muted: #A89C9E; --line: #2F2728;
    --brand-ink: color-mix(in srgb, var(--brand) 70%, #fff);
    --brand-soft: color-mix(in srgb, var(--brand) 20%, var(--surface));
    --ok: #4CC38A; --ok-soft: #16302A; --warn: #E0A84A; --warn-soft: #33281A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131011; --surface: #1C1718; --sunk: #241E1F; --fg: #F3EDED; --muted: #A89C9E; --line: #2F2728;
  --brand-ink: color-mix(in srgb, var(--brand) 70%, #fff);
  --brand-soft: color-mix(in srgb, var(--brand) 20%, var(--surface));
  --ok: #4CC38A; --ok-soft: #16302A; --warn: #E0A84A; --warn-soft: #33281A;
  color-scheme: dark;
}
:root[data-corners="sharp"] { --radius: 6px; --radius-sm: 4px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
[dir="rtl"] body { font-family: var(--f-arabic); }
#app { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 8px) max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); min-height: 100vh; }
h1 { font-size: 26px; line-height: 1.2; margin: 12px 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 24px 0 10px; }
h3 { font-size: 16px; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* Top bar */
.top { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.top .back { width: 40px; height: 40px; border: 0; background: var(--sunk); border-radius: 50%; cursor: pointer; display: grid; place-items: center; font-size: 20px; }
[dir="rtl"] .top .back { transform: scaleX(-1); }
.brandmark { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; }
.brandmark i { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; }
.brandmark i::before { content: ""; width: 14px; height: 10px; border-top: 2.5px solid #fff; border-bottom: 2.5px solid #fff; }

/* Cards and lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; text-decoration: none; cursor: pointer; background: none; border: 0; width: 100%; text-align: start; }
.item:active { background: var(--sunk); }
.avatar { width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; background: var(--vendor); }
.chev { color: var(--muted); }
[dir="rtl"] .chev { transform: scaleX(-1); display: inline-block; }

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--brand); color: var(--on-brand); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--fg); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--brand-ink); border-color: var(--brand); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea { font: inherit; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--fg); width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.error { color: var(--brand-ink); font-size: 14px; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 99px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.daychip { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding: 8px 6px; border-radius: 12px; }
.daychip b { font-size: 18px; font-family: var(--f-mono); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 0; text-align: center; cursor: pointer; font-family: var(--f-mono); }
.slot[aria-pressed="true"] { background: var(--vendor); border-color: var(--vendor); color: var(--on-brand); }

/* Vendor hero */
.hero { margin: 4px -16px 0; padding: 18px 16px 20px; background: var(--vendor); color: #fff; border-radius: 0 0 22px 22px; }
.hero .top .back { background: rgba(255,255,255,.2); color: #fff; }
.hero h1 { margin-top: 8px; }
.levelbox { margin-top: 14px; background: rgba(255,255,255,.14); border-radius: 14px; padding: 12px 14px; }
.bar { height: 8px; background: rgba(255,255,255,.3); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: #fff; border-radius: 99px; }

/* Pills */
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--sunk); color: var(--muted); }
.pill.requested { background: var(--warn-soft); color: var(--warn); }
.pill.confirmed { background: var(--brand-soft); color: var(--brand-ink); }
.pill.completed { background: var(--ok-soft); color: var(--ok); }
.plus { color: var(--ok); }
.minus { color: var(--brand-ink); }

/* Big numbers */
.stat { font-family: var(--f-mono); font-size: 34px; font-weight: 600; line-height: 1; }

/* Tabs */
#tabs { position: fixed; inset: auto 0 0 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: center; padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
#tabs a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 12px; color: var(--muted); text-decoration: none; }
#tabs a svg { width: 24px; height: 24px; }
#tabs a[aria-current="page"] { color: var(--brand); font-weight: 600; }

/* Toast and sheet */
#toast { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); max-width: min(92vw, 480px); background: var(--fg); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.empty { text-align: center; padding: 36px 12px; color: var(--muted); }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }
.notice { background: var(--warn-soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.okbox { text-align: center; padding: 28px 8px 8px; }
.okbox .tick { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 14px; font-size: 36px; }
@media (prefers-reduced-motion: no-preference) { .fade { animation: fade .18s ease-out; } @keyframes fade { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: none; } } }

/* Logo */
.brandmark img { width: 28px; height: 28px; border-radius: 8px; object-fit: contain; }
.brandmark.big { font-size: 26px; }
.brandmark.big i, .brandmark.big img { width: 40px; height: 40px; border-radius: 11px; }

/* Brand panel */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--fg); }
.swatches input[type="color"] { width: 44px; height: 44px; border: 0; padding: 0; background: none; cursor: pointer; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 9px 14px; cursor: pointer; font-size: 14px; color: var(--muted); }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.voice { display: flex; flex-direction: column; gap: 4px; }
.voice label { font-size: 12px; color: var(--muted); font-family: var(--f-mono); }
.voice textarea { font: inherit; font-size: 15px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--fg); resize: vertical; min-height: 44px; }
.voice textarea.changed { border-color: var(--brand); }
.preview { border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px; }

/* Desktop: show the app inside a phone-sized frame. Phones: full screen. */
#stage, #device { min-height: 100vh; }
#aside { display: none; }
@media (min-width: 760px) and (min-height: 600px) {
  html, body { height: 100%; overflow: hidden; }
  body { background: radial-gradient(1200px 600px at 30% 20%, var(--brand-soft), transparent 60%), var(--sunk); }
  #stage { height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 48px; padding: 24px; }
  #device {
    position: relative; width: 390px; height: min(844px, calc(100vh - 48px)); min-height: 0; flex: none;
    background: var(--bg); border-radius: 46px; overflow: hidden; overflow: clip; /* clip: focus can't scroll the frame itself */
    box-shadow: 0 0 0 10px #111, 0 0 0 11px #333, 0 30px 80px rgba(0,0,0,.35);
  }
  #device::before { content: ""; position: absolute; z-index: 40; top: 10px; left: 50%; transform: translateX(-50%); width: 110px; height: 30px; border-radius: 20px; background: #111; }
  #app { height: 100%; overflow-y: auto; padding-top: 48px; padding-bottom: 96px; scrollbar-width: thin; }
  #tabs { position: absolute; padding-bottom: 18px; }
  #toast { position: absolute; bottom: 92px; }
  .hero { margin-top: -40px; padding-top: 52px; border-radius: 0 0 26px 26px; }
  #aside:not([hidden]) { display: block; max-width: 260px; color: var(--muted); font-size: 14px; }
  #aside .aside-title { color: var(--fg); font-weight: 700; font-size: 18px; margin-bottom: 8px; }
  #aside p + p { margin-top: 10px; }
  #aside a { color: var(--brand-ink); }
}
@media (min-width: 760px) and (max-width: 1000px) { #aside:not([hidden]) { display: none; } }
