/* =====================================================================
   style.css — لوحة صاحب المطعم + لوحة المدير
   كل الألوان والخطوط والمسافات متعرّفة هنا في الكتلة دي بس (Design Tokens).
   ===================================================================== */
:root {
  /* الخط */
  --font: "Tajawal", "Cairo", "Segoe UI", Tahoma, "Noto Naskh Arabic", system-ui, sans-serif;
  /* الخلفيات */
  --bg: #eef2f1;
  --surface: #ffffff;
  --surface-2: #f5f8f7;
  /* النصوص */
  --ink: #16252a;
  --ink-2: #435860;
  --ink-3: #5f7379;
  /* الخطوط والحدود */
  --line: #d5dedc;
  --line-strong: #a9bab8;
  /* اللون الأساسي (أخضر مزرق غامق) */
  --brand: #0b5a62;
  --brand-hover: #084650;
  --brand-ink: #ffffff;
  --brand-soft: #dcefee;
  /* الحالات */
  --danger: #b3261e;
  --danger-hover: #8f1d17;
  --danger-soft: #fbe8e6;
  --ok: #1b6a39;
  --ok-soft: #e1f2e6;
  --warn: #7d4e00;
  --warn-soft: #fcefd0;
  /* شريط المدير العلوي (غامق) */
  --bar: #11262b;
  --bar-ink: #ffffff;
  --bar-soft: #27424a;
  /* التركيز بالكيبورد */
  --focus: #0a5bd8;
  /* الأنصاف والمسافات */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --tap: 48px;
  /* الظل والخلفية خلف النوافذ */
  --shadow: 0 1px 2px rgba(16, 37, 42, .06), 0 4px 14px rgba(16, 37, 42, .07);
  --backdrop: rgba(10, 24, 28, .55);
  /* أحجام الخط */
  --fs-s: .875rem;
  --fs-m: 1rem;
  --fs-l: 1.125rem;
  --fs-xl: 1.4rem;
  --fs-2xl: 1.8rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-m);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}
body.manager, body.login-only { padding-bottom: var(--sp-6); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--fs-xl); line-height: 1.3; }
h2 { font-size: var(--fs-l); line-height: 1.35; }
h3 { font-size: var(--fs-m); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: plaintext; text-align: left; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; margin: -1px !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- شريط انقطاع النت ---------- */
.offline-banner {
  position: sticky; top: 0; z-index: 60;
  background: var(--warn-soft); color: var(--warn);
  border-bottom: 2px solid var(--warn);
  padding: var(--sp-3) var(--sp-4); font-weight: 700; text-align: center;
}
.boot-note { padding: var(--sp-6); text-align: center; color: var(--ink-3); }

/* ---------- الأزرار ---------- */
.btn {
  min-height: var(--tap); padding: 0 var(--sp-5);
  border-radius: var(--r-md); border: 2px solid transparent;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  cursor: pointer; text-decoration: none; text-align: center; line-height: 1.2;
  background: var(--surface); color: var(--ink); border-color: var(--line-strong);
}
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { background: var(--danger); color: var(--brand-ink); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--brand); }
.btn-quiet:hover { background: var(--brand-soft); border-color: transparent; }
.btn-block { width: 100%; }
.btn-small { min-height: 44px; padding: 0 var(--sp-4); font-size: var(--fs-s); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--brand-ink); border-top-color: transparent; animation: spin .8s linear infinite;
}
.btn:not(.btn-primary):not(.btn-danger).is-busy::after { border-color: var(--ink-2); border-top-color: transparent; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; color: inherit;
}
.icon-btn:hover { background: var(--surface-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- الحقول ---------- */
.field { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.field > label { font-weight: 700; }
.field-hint { color: var(--ink-3); font-size: var(--fs-s); }
.field-error { color: var(--danger); font-weight: 700; font-size: var(--fs-s); min-height: 0; }
.field-error:empty { display: none; }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--tap); padding: var(--sp-2) var(--sp-4);
  background: var(--surface); border: 2px solid var(--line-strong); border-radius: var(--r-md);
  font-size: 1rem; /* 16px عشان الآيفون ما يكبّر الصفحة */
}
.field textarea { min-height: 96px; resize: vertical; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.pw-row { display: flex; gap: var(--sp-2); }
.pw-row input { flex: 1; }

.alert { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); border: 2px solid; font-weight: 500; }
.alert-error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); font-weight: 700; }
.alert-info { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-hover); }
.alert-warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.alert-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.alert + .alert, .alert + .field { margin-top: var(--sp-3); }

/* ---------- الشارات ---------- */
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-1); padding: 2px var(--sp-3);
  border-radius: 999px; font-size: var(--fs-s); font-weight: 700; background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line); white-space: nowrap;
}
.chip-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.chip-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.chip-brand { background: var(--brand-soft); color: var(--brand-hover); border-color: var(--brand); }

/* ---------- الكروت ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4); box-shadow: var(--shadow); }
.card + .card { margin-top: var(--sp-4); }
.card-title { margin-bottom: var(--sp-3); }

/* ---------- شاشة الدخول ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-4); }
.login-card { width: min(440px, 100%); background: var(--surface); border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: var(--shadow); border: 1px solid var(--line); }
.login-card h1 { margin: var(--sp-3) 0 var(--sp-2); }
.login-card .lead { color: var(--ink-2); margin-bottom: var(--sp-5); }
.mark { width: 44px; height: 44px; border-radius: 50%; border: 7px solid var(--brand); position: relative; flex: none; display: inline-block; }
.mark::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--brand); }

/* ---------- الإطار العام ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); max-width: 980px; margin: 0 auto; }
.topbar .mark { width: 32px; height: 32px; border-width: 5px; }
.topbar .mark::after { inset: 5px; }
.topbar .who { min-width: 0; flex: 1; }
.topbar .who strong { display: block; font-size: var(--fs-l); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .who span { font-size: var(--fs-s); color: var(--ink-3); }

.nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 40; display: flex; background: var(--surface); border-top: 1px solid var(--line-strong); padding-bottom: env(safe-area-inset-bottom); }
.nav button {
  flex: 1; min-height: 64px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; align-content: center; gap: 2px;
  font-size: var(--fs-s); font-weight: 700; color: var(--ink-3); position: relative;
}
.nav button[aria-current="page"] { color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); background: var(--brand-soft); }
.nav .badge {
  position: absolute; top: 6px; inset-inline-start: calc(50% + 6px); min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--danger); color: var(--brand-ink); font-size: 12px; display: grid; place-items: center; line-height: 1;
}

.page { max-width: 760px; margin: 0 auto; padding: var(--sp-4); }
.page-wide { max-width: 1040px; }
.page-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.page-head h1 { flex: 1; min-width: 0; }

@media (min-width: 900px) {
  body { padding-bottom: var(--sp-6); }
  .nav { position: static; border: 0; background: transparent; padding: 0; gap: var(--sp-2); inset: auto; }
  .nav button { flex: none; min-height: 48px; padding: 0 var(--sp-4); display: inline-flex; grid-auto-flow: column; gap: var(--sp-2); border-radius: var(--r-md); }
  .nav button[aria-current="page"] { box-shadow: none; }
  .nav .badge { position: static; }
  .topbar-inner { flex-wrap: nowrap; }
}

/* ---------- حالات التحميل والخطأ والفراغ ---------- */
.skel { background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 37%, var(--line) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-md); }
.skel-row { height: 88px; margin-bottom: var(--sp-3); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.state { text-align: center; padding: var(--sp-6) var(--sp-4); color: var(--ink-2); display: grid; gap: var(--sp-3); justify-items: center; }
.state h2 { color: var(--ink); }
.state p { max-width: 36ch; }

/* ---------- المنيو (المالك) ---------- */
.search { position: relative; margin-bottom: var(--sp-4); }
.search input { width: 100%; min-height: var(--tap); padding: var(--sp-2) var(--sp-5); padding-inline-start: 48px; border-radius: var(--r-md); border: 2px solid var(--line-strong); background: var(--surface); font-size: 1rem; }
.search .icon { position: absolute; inset-inline-start: 14px; top: 13px; color: var(--ink-3); pointer-events: none; }
.cat-title { display: flex; align-items: baseline; gap: var(--sp-2); margin: var(--sp-5) 0 var(--sp-3); }
.cat-title span { color: var(--ink-3); font-size: var(--fs-s); }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3); margin-bottom: var(--sp-3); display: grid; gap: var(--sp-3); }
.item.is-off { background: var(--surface-2); }
.item.is-saving { opacity: .7; }
.item.is-new { outline: 3px solid var(--brand); outline-offset: 2px; }
.item-top { display: flex; gap: var(--sp-3); align-items: center; }
.thumb { width: 56px; height: 56px; border-radius: var(--r-sm); background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; overflow: hidden; flex: none; font-weight: 700; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-name { font-weight: 700; font-size: var(--fs-l); overflow-wrap: anywhere; }
.item-sub { color: var(--ink-3); font-size: var(--fs-s); }
.item-actions { display: flex; gap: var(--sp-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.price-btn { flex: 1; min-width: 150px; justify-content: space-between; font-size: var(--fs-l); }
.price-btn .amount { font-variant-numeric: tabular-nums; }
.price-btn .unit { font-size: var(--fs-s); font-weight: 500; color: var(--ink-3); }
.variant-list { display: grid; gap: var(--sp-2); }
.variant-row { display: flex; align-items: center; gap: var(--sp-3); }
.variant-row .vname { flex: 0 0 5.5em; font-weight: 700; overflow-wrap: anywhere; }
.variant-row .price-btn { min-width: 0; }
.note-line { color: var(--ink-3); font-size: var(--fs-s); }

.switch { display: inline-flex; align-items: center; gap: var(--sp-3); min-height: var(--tap); padding: 0 var(--sp-3); background: transparent; border: 2px solid var(--line-strong); border-radius: var(--r-md); cursor: pointer; font-weight: 700; }
.switch .track { width: 48px; height: 28px; border-radius: 14px; background: var(--line-strong); position: relative; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.switch[aria-checked="true"] { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.switch[aria-checked="true"] .track { background: var(--danger); }
.switch[aria-checked="true"] .track::after { transform: translateX(-20px); }
.switch[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- إضافة صنف ---------- */
.img-pick { display: grid; gap: var(--sp-3); }
.img-pick .row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.img-preview { display: flex; gap: var(--sp-3); align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3); }
.img-preview img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-sm); background: var(--line); }
.progress-note { color: var(--ink-2); font-weight: 700; }

/* ---------- الطلبات ---------- */
.pills { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.pill { min-height: 44px; padding: 0 var(--sp-4); border-radius: 999px; border: 2px solid var(--line-strong); background: var(--surface); font-weight: 700; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.statusline { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); color: var(--ink-3); font-size: var(--fs-s); margin: var(--sp-3) 0; flex-wrap: wrap; }
.new-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); background: var(--brand); color: var(--brand-ink); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); margin-bottom: var(--sp-3); font-weight: 700; }
.new-banner .btn { min-height: 44px; background: var(--brand-ink); color: var(--brand); border-color: var(--brand-ink); }
.order { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: var(--sp-3); overflow: hidden; }
.order.is-new { border: 2px solid var(--brand); }
.order-head { width: 100%; text-align: start; border: 0; background: transparent; padding: var(--sp-3) var(--sp-4); cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: var(--sp-1) var(--sp-3); align-items: center; min-height: 64px; }
.order-head .code { font-weight: 700; font-size: var(--fs-l); letter-spacing: .08em; direction: ltr; justify-self: start; }
.order-head .total { font-weight: 700; font-size: var(--fs-l); font-variant-numeric: tabular-nums; text-align: end; }
.order-head .meta { color: var(--ink-2); font-size: var(--fs-s); display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.order-head .when { color: var(--ink-3); font-size: var(--fs-s); text-align: end; }
.order-body { padding: var(--sp-4); border-top: 1px dashed var(--line-strong); display: grid; gap: var(--sp-4); background: var(--surface-2); }
.o-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.o-line { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: start; }
.o-qty { font-weight: 700; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); min-width: 40px; text-align: center; padding: 0 var(--sp-2); }
.o-line small { display: block; color: var(--ink-3); }
.o-line .lt { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.o-totals { display: grid; gap: var(--sp-1); }
.o-totals div { display: flex; justify-content: space-between; gap: var(--sp-3); font-variant-numeric: tabular-nums; }
.o-totals .grand { font-weight: 700; font-size: var(--fs-l); border-top: 2px solid var(--ink); padding-top: var(--sp-2); margin-top: var(--sp-1); }
.o-info { display: grid; gap: var(--sp-2); }
.o-info dt { color: var(--ink-3); font-size: var(--fs-s); }
.o-info dd { margin: 0 0 var(--sp-2); overflow-wrap: anywhere; }
.o-info dl { margin: 0; }

/* ---------- النوافذ (Sheet) ---------- */
dialog.sheet {
  border: 0; padding: 0; background: var(--surface); color: var(--ink);
  width: min(560px, 100%); max-height: 92dvh; overflow: hidden;
  border-radius: var(--r-lg) var(--r-lg) 0 0; margin-block: auto 0; margin-inline: auto;
  flex-direction: column; box-shadow: var(--shadow);
}
dialog.sheet[open] { display: flex; animation: rise .18s ease-out; }
dialog.sheet.sheet-wide { width: min(760px, 100%); }
dialog.sheet::backdrop { background: var(--backdrop); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); padding-inline-end: var(--sp-2); border-bottom: 1px solid var(--line); }
.sheet-body { padding: var(--sp-4); overflow-y: auto; flex: 1; }
.sheet-foot { padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom)); display: grid; gap: var(--sp-2); border-top: 1px solid var(--line); background: var(--surface); }
.sheet-foot:empty { display: none; }
.sheet-text { color: var(--ink); font-size: var(--fs-l); }
.sheet-text + .sheet-text, .sheet-text + .alert, .alert + .sheet-text { margin-top: var(--sp-3); }
.price-input { font-size: var(--fs-2xl) !important; font-weight: 700; text-align: center; min-height: 64px !important; font-variant-numeric: tabular-nums; }
.change-line { display: flex; justify-content: center; align-items: baseline; gap: var(--sp-3); font-size: var(--fs-2xl); font-weight: 700; margin: var(--sp-3) 0; font-variant-numeric: tabular-nums; }
.change-line .from { color: var(--ink-3); text-decoration: line-through; font-size: var(--fs-xl); }
.cred-box { background: var(--surface-2); border: 2px dashed var(--line-strong); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); }
.cred-box small { color: var(--ink-3); display: block; }
.cred-box strong { font-size: var(--fs-xl); overflow-wrap: anywhere; user-select: all; }
@media (min-width: 700px) {
  dialog.sheet { border-radius: var(--r-lg); margin-block: auto; }
  .sheet-foot { grid-auto-flow: column; justify-content: start; }
}
@keyframes rise { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---------- التنبيهات السريعة ---------- */
#toasts { position: fixed; inset-inline: var(--sp-4); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 100; display: grid; gap: var(--sp-2); justify-items: center; pointer-events: none; }
body.manager #toasts, body.login-only #toasts { bottom: var(--sp-4); }
.toast { pointer-events: auto; max-width: 560px; width: 100%; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--bar); color: var(--bar-ink); font-weight: 700; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
@media (min-width: 900px) { #toasts { bottom: var(--sp-4); } }

/* ---------- لوحة المدير ---------- */
body.manager .topbar-inner { flex-wrap: wrap; }
body.manager .top-actions { width: 100%; }
body.manager .top-actions .btn { flex: 1; min-width: 0; padding: 0 var(--sp-3); white-space: nowrap; }
@media (max-width: 480px) { body.manager .top-actions .btn .icon { display: none; } }
@media (min-width: 700px) { body.manager .top-actions { width: auto; } body.manager .top-actions .btn { flex: none; padding: 0 var(--sp-4); } }
a.rest-row { text-decoration: none; color: inherit; font: inherit; }
a.rest-row:hover { border-color: var(--brand); }
.page-head .chip { align-self: center; }
body.manager .topbar { background: var(--bar); color: var(--bar-ink); border-color: var(--bar); }
body.manager .topbar .mark { border-color: var(--bar-ink); }
body.manager .topbar .mark::after { background: var(--bar-ink); }
body.manager .topbar .who span { color: var(--bar-ink); opacity: .8; }
body.manager .topbar .btn { background: transparent; color: var(--bar-ink); border-color: var(--bar-soft); }
body.manager .topbar .btn:hover { background: var(--bar-soft); }
body.manager .topbar .btn-primary { background: var(--brand-ink); color: var(--bar); border-color: var(--brand-ink); }
.top-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }
.stats { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.filters { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.rest-head { display: none; }
.rest-row { display: grid; gap: var(--sp-2); width: 100%; text-align: start; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); margin-bottom: var(--sp-3); cursor: pointer; min-height: 64px; }
.rest-row:hover { border-color: var(--brand); }
.rest-row .nm strong { font-size: var(--fs-l); display: block; overflow-wrap: anywhere; }
.rest-row .nm small { color: var(--ink-3); }
.rest-row .cell { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; color: var(--ink-2); }
.rest-row .cell .lbl { color: var(--ink-3); font-size: var(--fs-s); }
.tbl-lbl { color: var(--ink-3); font-size: var(--fs-s); }
@media (min-width: 900px) {
  .rest-head, .rest-row { display: grid; grid-template-columns: 2.2fr 1fr 1.7fr .8fr 1.4fr; gap: var(--sp-4); align-items: center; }
  .rest-head { padding: 0 var(--sp-4); color: var(--ink-3); font-size: var(--fs-s); font-weight: 700; margin-bottom: var(--sp-2); }
  .rest-row .cell .lbl { display: none; }
}
.detail-grid { display: grid; gap: var(--sp-4); }
@media (min-width: 900px) { .detail-grid { grid-template-columns: 1fr 1fr; align-items: start; } .detail-grid .card + .card { margin-top: 0; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-4); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.btn-stack { display: grid; gap: var(--sp-3); }
.report { display: grid; gap: var(--sp-3); margin-top: var(--sp-3); }
.report ul { margin: var(--sp-2) 0 0; padding-inline-start: var(--sp-5); display: grid; gap: var(--sp-2); }
.report .alert { overflow-wrap: anywhere; }
.file-drop { border: 2px dashed var(--line-strong); border-radius: var(--r-md); padding: var(--sp-4); background: var(--surface-2); display: grid; gap: var(--sp-3); }
.file-drop input[type=file] { font-size: 1rem; width: 100%; min-height: var(--tap); }
.file-drop input[type=file]::file-selector-button { min-height: 44px; padding: 0 var(--sp-4); margin-inline-end: var(--sp-3); border-radius: var(--r-md); border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.back { margin-bottom: var(--sp-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .btn.is-busy::after { animation: none; border-top-color: var(--brand-ink); }
}
