:root {
  --accent: #c8553d; --on-accent: #fff; --ink: #1f2a24; --paper: #f6efe3;
  --paper2: color-mix(in srgb, var(--paper) 88%, var(--ink));
  --card: color-mix(in srgb, var(--paper) 55%, #fff);
  --line: var(--ink);
  --soft: color-mix(in srgb, var(--ink) 58%, var(--paper));
  --tint: color-mix(in srgb, var(--accent) 14%, var(--paper));
  --ok: #2f7d4f; --warn: #b7791f; --bad: #b3261e;
  --r: 14px; --shadow: 3px 3px 0 var(--ink);
  --serif: "CairoAr", "Iowan Old Style", "Palatino Linotype", Palatino, "Noto Naskh Arabic", "Amiri", Georgia, "Traditional Arabic", serif;
  --sans: "Cairo", system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.5;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1.2px); background-size: 14px 14px;
  min-height: 100vh; padding-bottom: env(safe-area-inset-bottom);
}
.skip { position: absolute; inset-inline-start: -999px; } .skip:focus { inset-inline-start: 8px; top: 8px; background: #fff; padding: 6px 10px; z-index: 99; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; } h3 { font-size: 1.1rem; }
.wrap { max-width: 720px; margin-inline: auto; padding: 14px 14px 120px; }
.wrap.wide { max-width: 1000px; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 2px solid var(--ink); }
.top-in { max-width: 1000px; margin-inline: auto; padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand b { font-family: var(--serif); font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { width: 42px; height: 42px; flex: none; border: 2px solid var(--ink); border-radius: 12px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; box-shadow: 2px 2px 0 var(--ink); overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.logo.big { width: 72px; height: 72px; font-size: 2.4rem; border-radius: 20px; box-shadow: var(--shadow); }
.pill-btn { border: 2px solid var(--ink); background: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 700; font-size: .85rem; }
.pill-btn:hover { background: var(--tint); }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: transparent; padding: 6px 11px; font-weight: 700; font-size: .85rem; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* cards and bits */
.card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.card + .card, .stack > * + * { margin-top: 14px; }
.hero { padding: 18px; background: var(--tint); display: flex; gap: 14px; align-items: center; }
.hero p { margin: 4px 0 0; color: var(--soft); }
.hint { color: var(--soft); font-size: .88rem; }
.sec-h { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.num { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 800; font-size: .9rem; flex: none; }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap-r { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; } .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .grid3 { grid-template-columns: minmax(0, 1fr); } .dayrow .in { padding-inline: 6px; } }
@media (max-width: 520px) { .grid2.keep { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .grid2:not(.keep) { grid-template-columns: 1fr; } }
.tag { display: inline-block; font-size: .74rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--paper2); }
.tag.confirmed { background: #d8efdf; } .tag.pending { background: #fbe9bf; } .tag.arrived { background: #cfe3f7; } .tag.done { background: #e4e4e4; }
.tag.noshow { background: #f6c9c5; } .tag.cancelled { background: #eee; text-decoration: line-through; }
.tag.risk_high { background: #f6c9c5; } .tag.risk_medium { background: #fbe9bf; } .tag.risk_low { background: #d8efdf; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); padding: 10px 16px; font-weight: 800; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); text-decoration: none; color: var(--ink); min-height: 44px; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.wa { background: #25d366; color: #0b2e17; }
.btn.danger { background: #f6c9c5; }
.btn.small { padding: 5px 11px; min-height: 34px; font-size: .85rem; border-radius: 10px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* form */
label.f { display: block; font-weight: 700; font-size: .86rem; margin-bottom: 4px; }
.in { width: 100%; min-width: 0; border: 2px solid var(--ink); border-radius: 10px; background: #fff; padding: 9px 12px; min-height: 44px; }
textarea.in { min-height: 90px; resize: vertical; }
.in.err { border-color: var(--bad); background: #fdf0ef; }
.errmsg { color: var(--bad); font-weight: 700; font-size: .85rem; margin-top: 4px; }
.fld + .fld { margin-top: 12px; }
input[type=color] { width: 54px; height: 44px; border: 2px solid var(--ink); border-radius: 10px; padding: 2px; background: #fff; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }

/* services */
.cat-h { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); margin: 14px 0 6px; }
.svc { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 12px; cursor: pointer; margin-bottom: 8px; }
.svc[aria-pressed="true"] { background: var(--tint); box-shadow: var(--shadow); border-color: var(--accent); outline: 2px solid var(--accent); }
.svc .tick { width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 7px; display: grid; place-items: center; flex: none; font-weight: 900; background: #fff; }
.svc[aria-pressed="true"] .tick { background: var(--accent); color: var(--on-accent); }
.svc .p { font-weight: 800; white-space: nowrap; }

/* people chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--ink); background: var(--card); border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* day strip */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.day { flex: none; width: 64px; text-align: center; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); padding: 8px 0; cursor: pointer; scroll-snap-align: start; }
.day small { display: block; font-size: .72rem; color: var(--soft); font-weight: 700; } .day b { font-family: var(--serif); font-size: 1.35rem; }
.day[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); } .day[aria-pressed="true"] small { color: inherit; }
.day[disabled] { opacity: .35; cursor: not-allowed; background: var(--paper2); }

/* ticket-stub slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px 14px; padding-inline: 6px; }
.slot { position: relative; border: 2px solid var(--ink); border-radius: 10px; background: var(--card); padding: 10px 0; text-align: center; font-weight: 800; cursor: pointer; font-variant-numeric: tabular-nums; }
.slot::before, .slot::after { content: ""; position: absolute; top: 50%; width: 10px; height: 10px; background: var(--paper); border: 2px solid var(--ink); border-radius: 50%; transform: translateY(-50%); }
.slot::before { inset-inline-start: -7px; } .slot::after { inset-inline-end: -7px; }
.slot[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* sticky summary */
.dock { position: fixed; inset-inline: 0; bottom: 0; z-index: 25; background: var(--paper); border-top: 2px solid var(--ink); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
.dock-in { max-width: 720px; margin-inline: auto; display: flex; gap: 12px; align-items: center; }
.dock-in .sum { flex: 1; min-width: 0; font-size: .85rem; color: var(--soft); } .dock-in .sum b { color: var(--ink); font-size: 1rem; display: block; }

/* ticket result */
.ticket { position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); padding: 22px 18px; text-align: center; margin-top: 10px; }
.ticket::before, .ticket::after { content: ""; position: absolute; top: var(--cut, 48%); width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); }
.ticket::before { inset-inline-start: -14px; } .ticket::after { inset-inline-end: -14px; }
.ticket .big { font-family: var(--serif); font-size: 1.7rem; margin: 8px 0 2px; line-height: 1.2; } .ticket .time { font-family: var(--serif); font-size: 3rem; font-weight: 700; line-height: 1; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.ticket hr { border: 0; border-top: 2px dashed var(--ink); margin: 16px 8px; }
.stamp { display: inline-block; transform: rotate(-4deg); border: 3px solid var(--ok); color: var(--ok); border-radius: 8px; padding: 2px 12px; font-weight: 900; letter-spacing: .06em; font-size: 1.1rem; }
.msgbox { white-space: pre-wrap; text-align: start; background: #fff; border: 2px dashed var(--ink); border-radius: 10px; padding: 10px; font-size: .88rem; max-height: 180px; overflow: auto; }

/* owner */
.nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 25; background: var(--ink); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 4px; overflow-x: auto; }
.nav button { flex: 1 1 0; min-width: 0; max-width: 150px; border: 0; background: transparent; color: var(--paper); padding: 9px 4px; border-radius: 10px; font-weight: 700; font-size: .82rem; cursor: pointer; position: relative; white-space: nowrap; }
.nav button[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.nav .dot { position: static; margin-inline-start: 6px; display: inline-grid; vertical-align: middle; background: var(--accent); color: var(--on-accent); border-radius: 999px; min-width: 18px; height: 18px; font-size: .7rem; place-items: center; padding: 0 4px; border: 1.5px solid var(--ink); }
.nav button[aria-current="page"] .dot { background: var(--paper); color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.stat { border: 2px solid var(--ink); border-radius: 12px; background: var(--card); padding: 10px 12px; }
.stat b { display: block; font-family: var(--serif); font-size: 1.7rem; line-height: 1.1; } .stat span { font-size: .78rem; color: var(--soft); font-weight: 700; }
.stat.bad b { color: var(--bad); }
.bk { display: grid; grid-template-columns: 62px 1fr; gap: 10px; border: 2px solid var(--ink); background: var(--card); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.bk .t { font-family: var(--serif); font-weight: 800; font-size: 1.15rem; text-align: center; border-inline-end: 2px dashed var(--ink); padding-inline-end: 8px; font-variant-numeric: tabular-nums; } .bk .t small { display: block; font-size: .7rem; color: var(--soft); font-family: var(--sans); font-weight: 700; }
.bk.noshow, .bk.cancelled { opacity: .72; } .bk.done { background: var(--paper2); }
.bk .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.bk .who { font-weight: 800; } .bk .meta { font-size: .85rem; color: var(--soft); }
.banner { background: #fbe9bf; border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px; font-size: .88rem; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; }
.bars i { flex: 1; background: var(--accent); border: 1.5px solid var(--ink); border-radius: 3px 3px 0 0; min-height: 3px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); cursor: pointer; padding: 0; position: relative; overflow: hidden; }
.sw i { position: absolute; inset: 0 0 0 50%; }
.dayrow { display: grid; grid-template-columns: minmax(58px, 90px) 24px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; margin-bottom: 6px; }
.table-like { display: grid; gap: 8px; }
.li { display: flex; gap: 10px; align-items: center; border: 2px solid var(--ink); background: var(--card); border-radius: 12px; padding: 10px 12px; }

/* modal */
.scrim { position: fixed; inset: 0; background: rgba(20, 25, 22, .55); z-index: 50; display: grid; place-items: end center; }
.modal { background: var(--paper); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border: 2px solid var(--ink); border-radius: 20px 20px 0 0; padding: 16px; box-shadow: 0 -4px 0 var(--ink); }
@media (min-width: 700px) { .scrim { place-items: center; } .modal { border-radius: 20px; } }
.modal h3 { margin-bottom: 12px; }
#toast { position: fixed; inset-inline: 0; bottom: 96px; text-align: center; pointer-events: none; z-index: 80; }
#toast span { display: inline-block; background: var(--ink); color: var(--paper); padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: .9rem; box-shadow: var(--shadow); }
.foot { text-align: center; color: var(--soft); font-size: .78rem; margin-top: 30px; }
.pin-card { max-width: 340px; margin: 60px auto; text-align: center; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; word-break: break-all; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .btn:hover, .btn:active { transform: none; } }
@media print {
  .top, .nav, .dock, .stack, .banner, .foot, .skip, #toast, .scrim { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; max-width: none; }
  .ticket { box-shadow: none; margin: 0; break-inside: avoid; }
}

/* YK kit layer: logical spacing, stable focus and readable light/dark surfaces. */
:root { color-scheme: light; --yk-step: .5rem; --yk-surface: var(--paper); }
:root[data-yk-mode="dark"] { color-scheme: dark; --ok: #86efac; --warn: #fcd34d; --bad: #fda4af; }
:root { --card: var(--yk-surface); --soft: var(--ink); --tint: color-mix(in srgb, var(--accent) 9%, var(--paper)); }
.in, .msgbox, .svc .tick, input[type=color] { background: var(--paper); }
.in.err { background: var(--yk-surface); }
.tag:is(.confirmed,.pending,.arrived,.done,.noshow,.cancelled,.risk_high,.risk_medium,.risk_low),
.banner, .btn.danger { color: #0B0B0F; }
.yk-credit { display: inline-flex; align-items: center; gap: var(--yk-step); font-size: .875rem; }
.yk-credit img { display: block; inline-size: 24px; block-size: 24px; flex: none; }
.hero .yk-credit { margin-block-start: var(--yk-step); }
.hero > div { min-inline-size: 0; overflow-wrap: anywhere; }
.yk-footer { text-align: center; padding: 0 1rem calc(6rem + env(safe-area-inset-bottom)); }
.yk-footer p { margin-block: 0 .75rem; }
.yk-notice { max-inline-size: 46rem; margin: .75rem auto; padding: .75rem 1rem; }
.yk-visually-hidden { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:where(button, a, input, textarea, select):focus-visible, label.btn:focus-within {
  outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 3px var(--paper);
}
.seg button:focus-visible, .nav button:focus-visible { outline-offset: -4px; outline-color: currentColor; }
.skip:focus { color: #0B0B0F; }
.pill-btn, .seg button, .chip, .btn.small, .nav button { min-block-size: 44px; }
#main-content { scroll-margin-block-start: 5rem; }
@media (max-width: 420px) { .top-in { gap: 6px; padding-inline: 8px; } .seg button, .pill-btn { padding-inline: 7px; } }
@media print {
  .yk-footer, .yk-notice { display: none !important; }
  :root[data-yk-mode] { color-scheme: light; }
  .ticket { color: #000; background: #fff; }
}
