:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --ink: #1c1c1f;
  --muted: #5d5c58;
  --line: #e4e1da;
  --brand: #1c1c1f;
  --link: #8a5a00;
  --alert: #c92d17;
  --brand-ink: #fff;
  --brand-soft: #fff1b8;
  --ok: #1d7a4b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 28, 31, .06), 0 8px 24px rgba(28, 28, 31, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.7 Cairo, system-ui, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .4em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 800; }
code { background: var(--brand-soft); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* top bar */
.topbar { display: flex; align-items: center; gap: 20px; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-family: Lalezar, Cairo; font-size: 20px; padding-top: 4px; }
.tabs { display: flex; gap: 4px; margin-inline-start: auto; flex-wrap: wrap; align-items: center; }
.tabs a { padding: 6px 14px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; }
.tabs a:hover { background: var(--bg); }
.tabs a.on { background: var(--ink); color: #fff; }
.tabs a.btn { color: var(--brand-ink); }
.tabs a.tab-admin { background: var(--brand-soft); color: #5a4300; }
.tabs a.tab-admin.on { background: var(--brand); color: #fff; }
.tabs a.tab-page { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--brand-soft); }
.tabs a.tab-page:hover { background: var(--brand-soft); }
.logout { margin: 0; }
button.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; }

.flash { max-width: 1100px; margin: 16px auto 0; width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.flash-ok { background: #e2f4e9; color: var(--ok); }
.flash-err, .alert { background: #fde6e3; color: #a3241a; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }

/* buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 10px; padding: 10px 20px; font: 700 15px Cairo, sans-serif; cursor: pointer; text-decoration: none; transition: transform .1s, background .15s; }
.btn:hover { background: #34343a; }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { background: var(--card); }
.btn-sm { padding: 6px 14px; font-size: 14px; }
.btn-lg { padding: 14px 28px; font-size: 17px; }
.btn-block { width: 100%; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; font: 400 16px Cairo, sans-serif; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); }
input[type=file] { padding: 7px !important; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
fieldset { border: 0; padding: 0 0 8px; margin: 0 0 18px; border-bottom: 1px dashed var(--line); }
fieldset:last-of-type { border-bottom: 0; }
legend { font-weight: 800; font-size: 16px; margin-bottom: 12px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-actions.col { flex-direction: column; margin-top: 8px; }

/* auth */
.auth { flex: 1; display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 400px; }

/* home */
.hero { max-width: 1100px; margin: 0 auto; padding: 64px 24px 40px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.eyebrow { color: var(--brand); font-weight: 800; margin: 0 0 8px; }
.hero h1 { font-size: 44px; line-height: 1.25; }
.hero h1 span { font-family: Lalezar, Cairo; color: var(--brand); font-weight: 400; font-size: 1.15em; }
.lead { font-size: 17px; color: #4b4239; max-width: 34em; }
.hero-cta { display: flex; gap: 12px; margin: 24px 0 18px; flex-wrap: wrap; }
.ticks { list-style: none; padding: 0; margin: 0; display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-weight: 600; }
.ticks li::before { content: '✓ '; color: var(--ok); }
.hero-art { position: relative; height: 380px; }
.paper { position: absolute; width: 200px; height: 280px; border-radius: 6px; box-shadow: 0 20px 40px rgba(28, 28, 31, .18); padding: 20px 18px; display: flex; flex-direction: column; gap: 9px; }
.paper b { font-family: Lalezar, Cairo; font-size: 30px; font-weight: 400; text-align: center; margin-bottom: 6px; }
.paper i { height: 8px; border-radius: 4px; background: currentColor; opacity: .25; }
.paper i:nth-child(odd) { width: 70%; }
.paper s { margin-top: auto; height: 26px; border-radius: 6px; background: currentColor; opacity: .9; }
.p1 { background: #d62828; color: #ffd23f; right: 0; top: 30px; transform: rotate(6deg); }
.p2 { background: #16130f; color: #c9a24a; right: 150px; top: 0; transform: rotate(-4deg); z-index: 2; }
.p2 b { font-family: 'Playfair Display', serif; letter-spacing: 4px; }
.p3 { background: #f1efea; color: #2a9d5c; right: 290px; top: 70px; transform: rotate(-11deg); }
.how { max-width: 1100px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.how > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.how span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; margin-bottom: 10px; }
.how p { margin: 0; color: var(--muted); }
.tpl-strip { max-width: 1100px; margin: 0 auto; padding: 24px 24px 56px; }
.tpl-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tpl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tpl-card p { margin: 0; color: var(--muted); font-size: 14px; }
.swatch { display: block; border-radius: 10px; height: 90px; margin-bottom: 12px; }
.swatch.tpl-delivery { background: linear-gradient(135deg, #d62828 0 60%, #ffd23f 60% 75%, #1b1b1b 75%); }
.swatch.tpl-elegant { background: radial-gradient(circle at 70% 30%, #2a241b, #0e0e10); box-shadow: inset 0 0 0 4px #0e0e10, inset 0 0 0 5px #c9a24a; }
.swatch.tpl-fresh { background: linear-gradient(135deg, #f1efea 0 55%, #1e7b4a 55% 70%, #f2b134 70%); }
.swatch.tpl-heritage { background: radial-gradient(ellipse 60% 70% at 50% 100%, #1f5f5b 60%, transparent 61%) 50% 100% / 100% 85% no-repeat,
  repeating-linear-gradient(45deg, rgba(31,95,91,.12) 0 1px, transparent 1px 10px), #efede8; box-shadow: inset 0 0 0 3px #efede8, inset 0 0 0 4px #b8862b; }

/* dashboard */
.dash { max-width: 1100px; width: 100%; margin: 0 auto; padding: 28px 16px 56px; flex: 1; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.dash-head p { margin: 0; }
.stat-row { display: flex; gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px; color: var(--muted); text-decoration: none; }
.stat b { color: var(--ink); font-size: 20px; margin-inline-end: 4px; }
.logo-row { display: flex; gap: 16px; align-items: center; }
.logo-box { width: 110px; height: 110px; border-radius: 12px; border: 1.5px dashed var(--line); display: grid; place-items: center; background: #fff; flex: none; overflow: hidden; }
.logo-box img { max-width: 90%; max-height: 90%; }
.logo-box span { color: var(--muted); font-size: 12px; }

.empty { text-align: center; margin-bottom: 18px; }
.cat { margin-bottom: 18px; padding: 0; overflow: visible; }
.cat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cat-head h2 { margin: 0; }
.cat-head small { color: var(--muted); font-weight: 600; font-size: 14px; margin-inline-start: 6px; }
.chips { display: flex; gap: 6px; margin-top: 4px; }
.chip { background: var(--brand-soft); color: #5a4300; border-radius: 999px; padding: 0 10px; font-size: 12px; font-weight: 700; }
.row-actions { display: flex; gap: 4px; align-items: center; }
.row-actions form { margin: 0; }
.icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 13px; color: var(--ink); list-style: none; }
.icon::-webkit-details-marker { display: none; }
.icon:disabled { opacity: .35; cursor: default; }
.icon:hover:not(:disabled) { border-color: var(--ink); }
.icon.danger:hover { background: #fde6e3; border-color: #a3241a; color: #a3241a; }
.pop { position: relative; }
.pop-body { position: absolute; inset-inline-end: 0; top: 38px; z-index: 5; width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.15); padding: 16px; }
.pop-body.wide { width: min(560px, 90vw); }
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; align-items: center; gap: 14px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.items li:target { background: #fff6d6; }
.item-main { flex: 1; min-width: 0; }
.item-main .muted { margin-inline-start: 8px; font-size: 13px; }
.star { color: #e3a008; }
.item-prices { display: flex; gap: 8px; }
.item-prices span { min-width: 52px; text-align: center; background: var(--bg); border-radius: 8px; padding: 2px 8px; font-weight: 700; }
.item-prices small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.add-item { padding: 12px 20px; }
.add-item summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.add-item form { margin-top: 12px; }
.prices { display: flex; gap: 10px; flex-wrap: wrap; }
.price-in { width: 110px; }
.new-cat { border-style: dashed; }

/* design page */
.design-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.design-side { position: sticky; top: 80px; }
.tpl-pick { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.tpl-opt { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; margin: 0; }
.tpl-opt:has(input:checked) { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 2px var(--ink) inset; }
.tpl-opt input { position: absolute; opacity: 0; }
.tpl-opt .swatch { width: 54px; height: 70px; margin: 0; flex: none; border-radius: 6px; }
.tpl-opt small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; line-height: 1.5; }
.color-row { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.color-row input[type=color] { width: 54px; height: 40px; border: 1.5px solid var(--line); border-radius: 10px; padding: 2px; background: #fff; cursor: pointer; }
.design-preview { min-width: 0; }
.preview-frame { position: relative; overflow: hidden; border-radius: var(--radius); background: #dedbd3; }
.preview-frame iframe { border: 0; transform-origin: top right; display: block; position: absolute; top: 0; right: 0; }

/* online page box */
.online { background: var(--brand-soft); margin: -22px -22px 18px; padding: 18px 22px 10px; border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0; }
.online legend { float: inline-start; width: 100%; }
.online-row { display: flex; gap: 20px; align-items: flex-start; clear: both; }
.online-main { flex: 1; min-width: 0; }
.slug-in { display: flex; align-items: stretch; margin-top: 4px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.slug-in:focus-within { border-color: var(--ink); }
.slug-host { padding: 9px 4px 9px 12px; color: var(--muted); font-weight: 400; white-space: nowrap; background: var(--bg); max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.slug-in input { border: 0 !important; margin: 0 !important; border-radius: 0 !important; min-width: 0; }
.online-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.online p { margin: 8px 0 0; }
.qr-box { flex: none; text-align: center; background: #fff; border-radius: 12px; padding: 8px 8px 4px; font-size: 13px; font-weight: 700; }
.qr-box img { display: block; }

/* orders */
.badge-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--alert); color: #fff; font-size: 12px; font-weight: 800; }
.order-settings { margin-bottom: 16px; }
.order-settings summary { cursor: pointer; font-weight: 800; display: flex; gap: 10px; align-items: center; }
.order-settings form { margin-top: 16px; }
.check.big { font-weight: 800; font-size: 15px; }
.lbl { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
label small { display: block; font-weight: 400; margin-top: 2px; }
.new-banner a { display: block; background: #fff2c2; color: #7a5300; font-weight: 800; text-align: center; padding: 10px; border-radius: 12px; margin-bottom: 14px; text-decoration: none; }
.status-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.status-tabs a { padding: 5px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; }
.status-tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.status-tabs b { background: var(--alert); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.order { padding: 0; overflow: hidden; display: flex; flex-direction: column; border-top: 4px solid var(--line); }
.order.st-new { border-top-color: var(--alert); }
.order.st-preparing { border-top-color: #e3a008; }
.order.st-delivering { border-top-color: #2563eb; }
.order.st-done { border-top-color: var(--ok); }
.order.st-cancelled { opacity: .6; }
.order-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.onum { font-size: 18px; }
.order-head time { color: var(--muted); font-size: 13px; margin-inline-start: 6px; }
.st-pill.st-new { background: #fde6e3; color: #a3241a; }
.st-pill.st-preparing { background: #fff2c2; color: #7a5300; }
.st-pill.st-delivering { background: #dbe7ff; color: #1d4ed8; }
.st-pill.st-done { background: #e2f4e9; color: var(--ok); }
.st-pill.st-cancelled { background: #eee; color: #666; }
.order-body { padding: 12px 16px; flex: 1; }
.cust b { font-size: 16px; }
.cust-links { display: flex; gap: 12px; margin: 2px 0 4px; font-weight: 700; font-size: 14px; }
.cust-links a { text-decoration: none; }
.otype, .onote { margin: 0 0 4px; font-size: 14px; }
.onote { background: #fff8e1; border-radius: 8px; padding: 4px 8px; }
.olines { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line); }
.olines li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 2px 0; }
.olines .otot { font-weight: 800; font-size: 16px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.order-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; background: var(--bg); border-top: 1px solid var(--line); }
.order-actions form { margin: 0; }

/* admin */
.btn-danger { background: transparent; color: #a3241a; box-shadow: inset 0 0 0 1.5px #e9b8b1; }
.btn-danger:hover { background: #fde6e3; }
.admin-search { display: flex; gap: 8px; margin-bottom: 16px; }
.admin-search input { margin: 0 !important; flex: 1; }
.admin-table-wrap { padding: 0; overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: start; font-size: 13px; color: var(--muted); font-weight: 700; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:target td { background: #fff6d6; }
.admin-table tr.is-off td:not(.a-actions) { opacity: .55; }
.admin-table small { display: block; font-size: 12px; }
.a-rest { display: flex; align-items: center; gap: 10px; }
.a-logo { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; flex: none; overflow: hidden; }
.a-logo img { max-width: 90%; max-height: 90%; }
.a-actions { white-space: nowrap; text-align: end; }
.a-actions form { display: inline; margin: 0; }
.pill { display: inline-block; border-radius: 999px; padding: 0 10px; font-size: 12px; font-weight: 700; }
.pill-on { background: #e2f4e9; color: var(--ok); }
.pill-off { background: #fde6e3; color: #a3241a; }

.site-foot { text-align: center; color: var(--muted); font-size: 13px; padding: 20px; white-space: nowrap; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .hero h1 { font-size: 34px; }
  .hero-art { display: none; }
  .how, .tpl-cards { grid-template-columns: 1fr; }
  .design-layout { grid-template-columns: 1fr; }
  .design-side { position: static; }
}
@media (max-width: 600px) {
  .topbar { padding: 10px 16px; gap: 8px; position: static; }
  .logout { margin-inline-start: auto; }
  .tabs { margin: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; order: 3; }
  .tabs a { white-space: nowrap; font-size: 14px; }
  .two, .three { grid-template-columns: 1fr; }
  .items li { flex-wrap: wrap; padding: 10px 14px; }
  .item-main { flex-basis: 100%; }
  .item-prices { flex: 1; }
  .cat-head { padding: 14px; align-items: flex-start; }
  .online { margin: -16px -16px 18px; padding: 16px 16px 8px; }
  .online-row { flex-direction: column; }
  .qr-box { align-self: center; }
  .pop-body, .pop-body.wide { position: fixed; inset-inline: 12px; top: auto; bottom: 12px; width: auto; max-height: 80vh; overflow: auto; }
  .card { padding: 16px; }
  .site-foot { font-size: 12px; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .admin-table td { padding: 3px 0; border: 0; }
  .admin-table td[data-label]:not(:first-child)::before { content: attr(data-label) ': '; color: var(--muted); font-size: 12px; }
  .a-actions { text-align: start; padding-top: 8px !important; }
}

/* ===== accessibility & touch (UI audit) ===== */
.ico { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }
.icon .ico { width: 18px; height: 18px; }
.btn .ico { width: 16px; height: 16px; }
.cust-links a, .otype, .onote { display: inline-flex; align-items: center; gap: 5px; }
.cust-links a { min-height: 36px; }
.tabs a { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.status-tabs a { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.add-item summary { min-height: 40px; display: flex; align-items: center; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.tpl-opt:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (max-width: 600px) {
  .icon { width: 44px; height: 44px; }
  .cat-head { flex-wrap: wrap; }
  .cat-head .row-actions, .items .row-actions { width: 100%; justify-content: flex-end; }
}
@media (min-width: 861px) and (max-width: 1000px) { .tpl-cards { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* food photos (dashboard) */
.item-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg); }
.item-thumb.none { display: grid; place-items: center; color: #b3afa4; border: 1.5px dashed var(--line); }
.item-thumb.none .ico { width: 20px; height: 20px; }
.photo-field { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.photo-field label { margin-bottom: 4px; }
.photo-prev { width: 72px; height: 72px; border-radius: 12px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--bg); border: 1.5px dashed var(--line); color: #b3afa4; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.photo-prev .ico { width: 26px; height: 26px; }
@media (max-width: 600px) { .item-thumb { width: 44px; height: 44px; } .items li .item-main { flex: 1 1 calc(100% - 60px); } }
.photo-note { margin: 2px 0 6px; font-size: 13px; color: var(--ok); font-weight: 600; }
.photo-note.warn { color: #8a4b00; background: #fff2c2; border-radius: 8px; padding: 6px 10px; }
.item-thumb.lowres { box-shadow: 0 0 0 2.5px #e3a008; }

/* ===== mobile hamburger menu (dashboard + admin) ===== */
.menu-btn, .nav-logout { display: none; }
@media (max-width: 760px) {
  .topbar:has(#menuBtn) { position: sticky; top: 0; flex-wrap: nowrap; }
  .topbar:has(#menuBtn) .logout { display: none; }
  .menu-btn { display: inline-grid; place-items: center; margin-inline-start: auto; width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; position: relative; }
  .menu-btn .ico { width: 22px; height: 22px; }
  .mb-close { display: none; }
  .topbar.open .mb-open { display: none; }
  .topbar.open .mb-close { display: grid; }
  .topbar.open .menu-btn { background: var(--ink); color: #fff; border-color: var(--ink); }
  .menu-dot { position: absolute; top: 8px; inset-inline-end: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--alert); box-shadow: 0 0 0 2px var(--card); }
  .topbar.open .menu-dot { display: none; }
  #mainNav { display: none; position: absolute; top: 100%; inset-inline: 0; margin: 0; width: auto; order: 0; overflow: visible;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 12px 14px; background: var(--card);
    border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px -18px rgba(28, 28, 31, .35); }
  .topbar.open #mainNav { display: flex; }
  #mainNav a { min-height: 48px; padding: 0 14px; border-radius: 12px; font-size: 16px; justify-content: flex-start; width: 100%; white-space: normal; }
  #mainNav a:not(.on):hover { background: var(--bg); }
  #mainNav .badge-n { margin-inline-start: auto; }
  .nav-logout { display: block; margin: 6px 0 0; padding-top: 6px; border-top: 1px dashed var(--line); }
  .nav-logout button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px;
    background: none; border: 0; color: var(--muted); font: 600 16px Cairo, sans-serif; cursor: pointer; }
  .nav-logout button:hover { background: var(--bg); }
  .nav-logout .ico { width: 18px; height: 18px; }
}

.swatch.tpl-app { background: #f4f5f9 url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 54 70' preserveAspectRatio='xMidYMid slice'><rect width='54' height='70' fill='%23f4f5f9'/><path d='M0 0H54V22Q54 26 50 26H4Q0 26 0 22Z' fill='%23cf3f0a'/><rect x='8' y='6' width='12' height='12' rx='4' fill='%23fff'/><rect x='24' y='8' width='22' height='3.5' rx='1.7' fill='%23fff'/><rect x='24' y='14' width='14' height='2.5' rx='1.2' fill='%23fff' opacity='.65'/><rect x='6' y='29' width='11' height='5' rx='2.5' fill='%2316161a'/><rect x='19' y='29' width='11' height='5' rx='2.5' fill='%23fff' stroke='%23d9dce6' stroke-width='.5'/><rect x='32' y='29' width='11' height='5' rx='2.5' fill='%23fff' stroke='%23d9dce6' stroke-width='.5'/><rect x='5' y='38' width='44' height='12' rx='4' fill='%23fff'/><rect x='8' y='40.5' width='7' height='7' rx='2.5' fill='%23f2b134'/><rect x='19' y='41' width='20' height='2.4' rx='1.2' fill='%2316161a'/><rect x='19' y='45' width='13' height='2' rx='1' fill='%23c3c8d8'/><rect x='5' y='53' width='44' height='12' rx='4' fill='%23fff'/><rect x='8' y='55' width='6' height='6' rx='2' fill='%231e7b4a'/><rect x='18' y='56.5' width='18' height='2.2' rx='1.1' fill='%2316161a'/><rect x='0' y='62' width='54' height='8' fill='%2316161a'/><circle cx='14' cy='66' r='1.5' fill='%23fff'/><circle cx='27' cy='66' r='1.5' fill='%23ffc21a'/><circle cx='40' cy='66' r='1.5' fill='%23fff'/></svg>") center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(28, 28, 31, .1); }

/* ===== sign-up: password checklist + email confirmation page ===== */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-inline-end: 48px !important; }
.pw-toggle { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); margin-top: 2px; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 12px; display: grid; place-items: center; }
.pw-toggle:hover { color: var(--ink); background: var(--bg); }
.pw-toggle .ico { width: 20px; height: 20px; }
.pw-help { animation: pw-in .2s ease-out; }
@keyframes pw-in { from { opacity: 0; translate: 0 -6px; } }
.pw-help[hidden] { display: none; }
.pw-meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin: -4px 0 8px; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: 999px; background: #c0392b; transition: width .2s ease, background-color .2s ease; }
.pw-meter span[data-level="2"] { background: #e3a008; }
.pw-meter span[data-level="3"] { background: #6aa84f; }
.pw-meter span[data-level="4"] { background: #1d7a4b; }
.pw-rules { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 6px; }
.pw-rules li::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; transition: all .15s ease; }
.pw-rules li.ok { color: var(--ok); font-weight: 700; }
.pw-rules li.ok::before { background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat; border-color: var(--ok); }
.pw-match { margin: -6px 0 12px; font-size: 13px; font-weight: 700; color: var(--ok); }
.pw-match.bad { color: #a3241a; }
.verify-card { max-width: 440px; }
.verify-ico { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.verify-ico .ico { width: 30px; height: 30px; }
.verify-mail { font-weight: 800; font-size: 17px; margin: 0 0 6px; word-break: break-all; }
.verify-card .btn { margin-top: 12px; }
.verify-out { margin-top: 12px; }
.dev-link { text-align: start; background: #fff8e1; border: 1px dashed #e3a008; border-radius: 12px; padding: 10px 12px; margin: 14px 0 2px; font-size: 13px; word-break: break-all; }
.dev-link a { display: block; margin-top: 4px; font-weight: 700; }
.chip.warn { background: #fff2c2; color: #7a5300; }
@media (max-width: 420px) { .pw-rules { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .pw-meter span, .pw-rules li::before { transition: none; } }
/* the password box types left-to-right, so the eye button sits on the physical right, away from the dots */
.pw-wrap input { padding-inline: 12px !important; padding-right: 52px !important; }
.pw-toggle { inset-inline-end: auto; right: 4px; left: auto; }

/* ---------- picture library ---------- */
.media-up { display: grid; gap: 10px; margin-bottom: 20px; max-width: 640px; }
.media-up label { margin: 0; }
.media-up .btn { justify-self: start; }
.quota-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 4px; }
.quota-bar span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.quota-bar span.full { background: var(--alert); }
.media-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.media-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.media-thumb { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #eae7e1; }
.media-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-meta { padding: 10px 12px 12px; display: grid; gap: 3px; justify-items: start; min-width: 0; }
.media-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.media-card > form { position: absolute; top: 8px; inset-inline-start: 8px; }
.media-card > form .icon { background: rgba(255, 255, 255, .92); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.owner-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chip-filter { display: inline-flex; gap: 6px; align-items: center; min-height: 40px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: 14px; }
.chip-filter b { color: var(--brand); }
.chip-filter small { color: var(--muted); }
.chip-filter.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-filter.on b, .chip-filter.on small { color: #fff; }
.pick-btn { margin-top: 4px; }
dialog.media-picker { border: 0; border-radius: 16px; padding: 0; width: min(720px, 94vw); max-height: 86vh; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); background: var(--card); color: var(--ink); }
dialog.media-picker::backdrop { background: rgba(14, 14, 16, .55); }
.mp-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); margin: 0; }
.mp-body { padding: 14px; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); overflow: auto; max-height: calc(86vh - 60px); }
.mp-item { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #eae7e1; aspect-ratio: 1; cursor: pointer; }
.mp-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-item:hover, .mp-item:focus-visible, .mp-item.on { border-color: var(--brand); outline: none; }
@media (max-width: 560px) { .media-grid { grid-template-columns: repeat(2, 1fr); } }

/* statistics page */
.range { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.range a { padding: 6px 14px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; min-height: 40px; display: inline-flex; align-items: center; }
.range a.on { background: var(--ink); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.kpi-soft { background: transparent; box-shadow: none; }
.kpi-l { color: var(--muted); font-size: 13px; font-weight: 700; }
.kpi-n { font-size: 30px; line-height: 1.2; font-weight: 800; }
.kpi-n small { font-size: 14px; font-weight: 700; color: var(--muted); }
.delta { font-size: 13px; font-weight: 700; color: var(--muted); }
.delta.up { color: var(--ok); }
.delta.down { color: #a3241a; }
.kpi-note { margin: 4px 2px 18px; }
.chart { margin-bottom: 14px; }
.chart header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chart h2 { margin: 0; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.lg::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.lg-v::before { background: #4a4944; } .lg-q::before { background: var(--brand); } .lg-o::before { background: var(--ok); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-top: 6px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.bar { display: block; width: 100%; border-radius: 4px 4px 0 0; min-height: 0; position: relative; overflow: hidden; transition: filter .15s; }
.bar-col:hover .bar { filter: brightness(1.25); }
.bar-v { background: #4a4944; } .bar-o { background: var(--ok); }
.bar-q { position: absolute; inset-inline: 0; bottom: 0; background: var(--brand); }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; align-items: start; }
.rank { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.rank li { display: flex; gap: 12px; align-items: center; }
.rank-n { width: 28px; height: 28px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-weight: 800; display: grid; place-items: center; flex: none; }
.rank-body { flex: 1; min-width: 0; }
.rank-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.rank-bar { height: 6px; border-radius: 99px; background: var(--line); margin-top: 5px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.split { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--line); margin-top: 12px; }
.split-d { background: var(--brand); } .split-p { background: var(--ok); }
.split-key { display: flex; gap: 18px; margin-top: 10px; flex-wrap: wrap; font-size: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 4px; }
.dot-d { background: var(--brand); } .dot-p { background: var(--ok); }
.hours { display: flex; align-items: flex-end; gap: 3px; height: 90px; border-bottom: 1px solid var(--line); }
.hr { flex: 1; background: #dedbd3; border-radius: 3px 3px 0 0; }
.hr.peak { background: var(--brand); }
@media (max-width: 600px) { .range { width: 100%; } .range a { flex: 1; justify-content: center; padding: 6px 4px; } .kpi-n { font-size: 26px; } .bars { gap: 1px; } }

/* menu import */
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.imp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.dl-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.imp-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.imp-head h2 { margin-bottom: 8px; }
.imp-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-blue { background: #e1ecf8; color: #1d4f86; }
.pill-soft { background: var(--line); color: var(--muted); }
.pill-warn { background: #fdf0d5; color: #8a5a00; }
.imp-table-wrap { padding: 0; overflow-x: auto; margin-bottom: 14px; }
.imp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.imp-table th, .imp-table td { padding: 9px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
.imp-table th { background: var(--bg); font-size: 12px; color: var(--muted); position: sticky; top: 0; }
.imp-table tr.is-skip td { opacity: .6; }
.imp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.imp-actions .btn[disabled] { opacity: .5; pointer-events: none; }

/* coupons on the orders page */
.coupons .coupon-form { margin-bottom: 4px; }
.coupon-table { margin-top: 16px; }
.coupons .coupon-actions { display: flex; gap: 6px; align-items: center; }
.coupons .coupon-actions form { margin: 0; }

.tbl-scroll { overflow-x: auto; margin-top: 16px; }
.tbl-scroll .coupon-table { margin-top: 0; min-width: 480px; }

/* upload: "إضافة صور" button + drop box (closed until asked for), Arabic file buttons */
.head-actions { align-items: center; }
.add-panel { margin-bottom: 18px; }
.dropzone { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 38px 20px 32px; border: 2px dashed #cdc9bf; border-radius: 22px; background: linear-gradient(180deg, #ffffff, #f6f5f1); cursor: pointer; transition: border-color .15s, background .15s, opacity .15s; }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand); }
.dropzone.over { border-color: var(--brand); border-style: solid; background: var(--brand-soft); }
.dropzone.busy { pointer-events: none; opacity: .8; }
.dz-ico { width: 64px; height: 64px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.dz-ico .ico { width: 30px; height: 30px; }
.dz-title { font-size: 21px; font-weight: 800; line-height: 1.4; }
.dz-or { color: var(--muted); font-size: 14px; }
.dz-btn { position: relative; cursor: pointer; padding: 11px 26px; font-size: 16px; }
.dz-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dz-btn:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.dz-hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.dz-state { margin: 6px 0 0; padding: 6px 16px; border-radius: 99px; font-weight: 700; font-size: 14px; background: #e2f4e9; color: var(--ok); }
.dz-state.warn { background: #fff2c2; color: #8a4b00; }
.dz-state.work { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.quota { margin: 0 0 18px; max-width: 420px; }

.file-native { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
label:has(> .file-native) { position: relative; cursor: pointer; }
.file-ui { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 6px; border: 1.5px dashed #cdc9bf; border-radius: 12px; background: var(--card); min-height: 52px; transition: border-color .15s; }
label:hover > .file-ui { border-color: var(--brand); }
.file-btn { flex: none; padding: 9px 18px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 14px; }
label:hover > .file-ui .file-btn { background: var(--brand); color: #fff; }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 400; font-size: 14px; }
.file-ui.has .file-name { color: var(--ink); font-weight: 700; }
.file-native:focus-visible + .file-ui { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ===== header: sign-up button hover, one row for visitors on phones, account menu, numbered menu badge ===== */
.tabs a.btn:hover { background: #34343a; color: var(--brand-ink); }
.tabs a.btn:active { transform: translateY(1px); }

.acct { position: relative; flex: none; margin-inline-start: 8px; }
.topbar > .brand + .acct { margin-inline-start: auto; }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 700 14px Cairo, sans-serif; cursor: pointer; transition: background .15s, border-color .15s; }
.acct-btn .ico { width: 20px; height: 20px; }
.acct-btn:hover, .acct-btn[aria-expanded="true"] { background: var(--bg); border-color: #cdc9bf; }
.acct-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 40; min-width: 240px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 22px 44px -20px rgba(28, 28, 31, .45); }
.acct-menu[hidden] { display: none; }
.acct-head { display: grid; padding: 8px 12px 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.acct-head b { font-size: 15px; }
.acct-head small { color: var(--muted); overflow-wrap: anywhere; }
.acct-menu a, .acct-menu form button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font: 600 15px Cairo, sans-serif; background: none; border: 0; cursor: pointer; text-align: start; }
.acct-menu a:hover, .acct-menu form button:hover { background: var(--bg); }
.acct-menu form { margin: 6px 0 0; padding-top: 6px; border-top: 1px dashed var(--line); }
.acct-menu form button { color: #a3241a; }
.acct-menu form .ico { width: 18px; height: 18px; }

.menu-badge { position: absolute; top: -7px; inset-inline-end: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--alert); color: #fff; font: 800 11px/20px Cairo, sans-serif; text-align: center; box-shadow: 0 0 0 2px var(--card); }
.topbar.open .menu-badge { display: none; }

@media (max-width: 760px) {
  .acct { order: 1; margin-inline-start: auto; }
  .menu-btn { order: 2; margin-inline-start: 0; }
  .acct-name { display: none; }
  .acct-btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .acct-menu { min-width: min(260px, calc(100vw - 32px)); }
}

/* visitors: the same hamburger as the dashboard, every link inside; the sign-up button stays visible beside it */
.anon-cta { display: none; }
@media (max-width: 899px) {
  .topbar:has(.tabs-anon) { flex-wrap: nowrap; position: sticky; top: 0; }
  .topbar:has(.tabs-anon) .anon-cta { display: inline-flex; margin-inline-start: auto; order: 1; }
  .topbar:has(.tabs-anon) .menu-btn { display: inline-grid; place-items: center; margin-inline-start: 0; order: 2; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; position: relative; }
  .topbar .tabs.tabs-anon { display: none; position: absolute; top: 100%; inset-inline: 0; margin: 0; width: auto; order: 0; overflow: visible; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 4px; padding: 8px 12px 14px;
    background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px -18px rgba(28, 28, 31, .35); z-index: 25; }
  .topbar.open .tabs.tabs-anon { display: flex; }
  .tabs-anon a { min-height: 48px; padding: 0 14px; border-radius: 12px; font-size: 16px; justify-content: flex-start; width: 100%; white-space: normal; }
  .tabs-anon .nav-cta { justify-content: center; margin-top: 6px; padding: 0 14px; }
  .tabs-anon .nav-login { box-shadow: inset 0 0 0 1.5px var(--line); justify-content: center; }
}
@media (max-width: 380px) { .topbar:has(.tabs-anon) .brand { font-size: 16px; } .topbar:has(.tabs-anon) .brand-mark { width: 28px; height: 28px; font-size: 17px; } }

/* wordmark: a red "6" tile followed by "ayam", always read left to right */
.brand { direction: ltr; gap: 2px; letter-spacing: -.2px; }
.brand-word { font-weight: 800; }
.brand-mark { margin-inline-end: 1px; }

/* logo: the Canva "6" (a fork inside the plate) is the 6 of 6ayam, followed by the word "ayam" */
.brand-glyph { display: block; height: 32px; width: auto; flex: none; }
.brand-word { font-size: 25px; font-weight: 800; line-height: 1; margin-inline-start: -1px; padding-top: 2px; }
@media (max-width: 380px) { .brand-glyph { height: 28px; } .brand-word { font-size: 22px; } }

/* header: the links of a visitor sit in a group; on phones they are plain rows of the menu panel */
.nav-pill { display: flex; align-items: center; gap: 2px; }
.btn-wa { background: #0f7a3d; color: #fff; }
.btn-wa:hover { background: #0b6330; }
.btn-wa .ico { width: 18px; height: 18px; }
@media (max-width: 899px) {
  .nav-pill { display: contents; }
  /* the logo stays on the right; the sign-up button and then the menu button sit on the left */
  .topbar:has(.tabs-anon) .anon-cta { order: 1; margin-inline-start: auto; }
  .topbar:has(.tabs-anon) .menu-btn { order: 2; margin-inline-start: 0; }
}
@media (max-width: 760px) {
  .acct { order: 1; margin-inline-start: auto; }
  .menu-btn { order: 2; margin-inline-start: 0; }
}

/* policies page */
.policy { max-width: 860px; margin: 0 auto; padding: 36px 20px 64px; }
.policy-head h1 { font: 400 clamp(34px, 5vw, 50px)/1.2 Lalezar, Cairo, sans-serif; }
.policy-head p { max-width: 38em; margin-top: 8px; }
.price-card { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px 36px; align-items: center; margin: 28px 0 22px; padding: 34px; border-radius: 30px; background: #1c1c1f radial-gradient(360px 220px at 0% 0%, rgba(201, 45, 23, .4), transparent 70%); color: #f6f5f1; box-shadow: 0 40px 60px -40px rgba(28, 28, 31, .7); }
.price-card .muted { color: #c9c5bb; }
.price-tag { display: inline-block; padding: 3px 14px; border-radius: 99px; background: rgba(255, 255, 255, .1); font-weight: 700; font-size: 14px; }
.price-num { display: flex; align-items: baseline; gap: 12px; margin: 10px 0 8px; }
.price-num b { font: 400 clamp(72px, 12vw, 110px)/1 Lalezar, Cairo; color: #ffc21a; }
.price-num span { font-size: 20px; font-weight: 800; }
.price-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.price-list li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.7; }
.price-list .ico { width: 18px; height: 18px; flex: none; margin-top: 5px; color: #ffc21a; stroke-width: 3; }
.price-card .btn { grid-column: 1 / -1; justify-self: start; background: #ffc21a; color: #1c1c1f; }
.price-card .btn:hover { background: #ffd04a; }
.policy-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.policy-toc a { padding: 7px 16px; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; }
.policy-toc a:hover { background: var(--brand-soft); color: var(--ink); }
.policy-body { display: grid; gap: 14px; }
.policy-body section { scroll-margin-top: 84px; padding: 26px 28px; border-radius: 22px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.policy-body h2 { font-size: 22px; margin-bottom: 10px; }
.policy-body ul { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; line-height: 1.85; }
.policy-body li::marker { color: var(--brand); }
.policy-body p { margin: 0 0 10px; line-height: 1.85; }
@media (max-width: 700px) { .price-card { grid-template-columns: 1fr; padding: 26px 22px; } .policy-body section { padding: 22px 20px; } }

.site-foot a { margin-inline-start: 12px; }

/* restaurant info page: setup card, field hints */
.setup { margin: 0 0 16px; padding: 16px 20px 18px; border-radius: var(--radius); background: #fff; box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 10px; }
.setup-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; }
.setup-pct { font-weight: 800; color: var(--muted); }
.setup-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.setup-bar span { display: block; height: 100%; border-radius: 999px; background: #ffc21a; transition: width .3s ease; }
.setup.is-done .setup-bar span { background: var(--ok); }
.setup-miss { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.chip-link { display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: 999px; background: var(--brand-soft); color: #5a4300; font-weight: 700; text-decoration: none; }
.chip-link:hover { background: #ffe58a; }
.hint { display: block; margin-top: 5px; font-size: 13px; font-weight: 400; color: var(--muted); line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { .setup-bar span { transition: none; } }
.setup.is-done { padding: 11px 18px; gap: 0; background: #ecf7f0; box-shadow: inset 0 0 0 1px #cfe8d9; }
.setup.is-done .setup-top { color: #15673f; font-size: 15px; }
.setup.is-done .setup-pct, .setup.is-done .setup-bar, .setup.is-done > p { display: none; }

.slug-preview { margin: 2px 0 12px; font-size: 14px; color: var(--ink); }
.slug-preview b { display: inline-block; padding: 2px 10px; border-radius: 8px; background: rgba(255,255,255,.7); box-shadow: inset 0 0 0 1px rgba(28,28,31,.12); word-break: break-all; }
#curVal[hidden] { display: none; }
#curSel { margin-bottom: 6px; }

/* logo: preview, uploader, "from library" and "remove" on one row on desktop */
@media (min-width: 720px) {
  .logo-row { display: flex; align-items: center; gap: 16px; }
  .logo-row > div:last-child { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
  .logo-row > div:last-child > label:first-child { flex: 1; min-width: 0; margin: 0; }
  .logo-row .pick-btn { flex: none; margin: 0; white-space: nowrap; }
  .logo-row label.check { flex: none; margin: 0; white-space: nowrap; }
}

.imp-photos { margin-top: 16px; }
.imp-photos h2 { margin-bottom: 6px; }
.imp-steps { margin: 8px 0 10px; padding-inline-start: 22px; display: grid; gap: 6px; line-height: 1.8; }

/* delivery fee: free / with a fee */
.deliv-box { display: grid; gap: 8px; align-content: start; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); width: fit-content; }
.seg-opt { display: inline-flex; align-items: center; margin: 0; min-height: 38px; padding: 0 18px; border-radius: 999px; cursor: pointer; font-weight: 700; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt:has(input:checked) { background: var(--ink); color: #fff; }
.seg-opt:has(input:focus-visible) { outline: 3px solid #ffc21a; outline-offset: 2px; }
#feeField[hidden] { display: none; }

/* design page on desktop: the save buttons sit at the top of the settings panel and the panel scrolls on its own,
   so nobody has to scroll the whole page to reach them */
@media (min-width: 861px) {
  .design-side { display: flex; flex-direction: column; max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain; padding-top: 0; }
  .design-side .form-actions.col { order: -1; position: sticky; top: 0; z-index: 3; margin: 0 -22px 14px; padding: 14px 22px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
  .design-side .form-actions.col .btn { min-height: 44px; }
}

/* orders: tidy settings summary and clearer action buttons */
.order-settings summary { flex-wrap: wrap; gap: 8px 10px; }
.order-settings summary .pill { white-space: nowrap; font-size: 13px; }
.os-title { display: inline-flex; align-items: center; gap: 8px; margin-inline-end: 6px; }
.os-title .ico { width: 18px; height: 18px; color: var(--muted); }
@media (max-width: 560px) { .os-title { flex: 1 1 100%; margin: 0; } }
.order-actions .ob { min-height: 40px; padding-inline: 18px; border-radius: 999px; font-weight: 800; border: 0; }
.order-actions .ob-preparing { background: #ffc21a; color: #1c1c1f; box-shadow: 0 8px 16px -10px rgba(255, 194, 26, .9); }
.order-actions .ob-preparing:hover { background: #ffd04a; }
.order-actions .ob-delivering { background: #1d4ed8; color: #fff; }
.order-actions .ob-delivering:hover { background: #1a43b9; }
.order-actions .ob-done { background: #15803d; color: #fff; }
.order-actions .ob-done:hover { background: #126a32; }
.order-actions .ob-cancelled, .order-actions .ob-new { padding-inline: 16px; }

/* the page opened from the WhatsApp "start" link */
.start-card { max-width: 520px; margin: 0 auto; display: grid; gap: 12px; }
.start-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-direction: row-reverse; }
.start-top h1 { margin: 0; }
.start-who { margin: 0; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 17px; }
.start-lines { list-style: none; margin: 0; padding: 0; display: grid; }
.start-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.start-lines .start-total { border: 0; font-size: 18px; font-weight: 800; }
.start-note { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); }
.ob-start { min-height: 56px; font-size: 18px; border-radius: 999px; background: #ffc21a; color: #1c1c1f; box-shadow: 0 12px 22px -12px rgba(255, 194, 26, .95); }
.ob-start:hover { background: #ffd04a; }

/* open-page buttons: breathing room under the link preview */
.online-actions { margin-top: 16px; }
.slug-preview { margin-bottom: 4px; }


/* ===== dashboard shell: the owner's menu is a side panel, separate from the website's top bar ===== */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); align-items: start; flex: 1; width: 100%; }
.shell-main { min-width: 0; display: flex; flex-direction: column; min-height: calc(100vh - 66px); }
.shell-main > .dash, .shell-main > main { width: 100%; }
.side { position: sticky; top: 66px; height: calc(100vh - 66px); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 18px 14px 24px; background: #fff; border-inline-end: 1px solid var(--line); }
.side-head { display: grid; gap: 4px; padding: 14px; border-radius: 16px; background: var(--brand-soft); }
.side-head small { color: #6b5a1a; font-size: 12.5px; }
.side-head b { font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.side-head .tab-page { margin-top: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 800; font-size: 14.5px; text-decoration: none; box-shadow: none; }
.side-head .tab-page:hover { background: #34343a; }
.side-head .tab-page .ico { width: 17px; height: 17px; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 700; }
.side-nav a .ico { width: 20px; height: 20px; color: var(--muted); flex: none; }
.side-nav a:hover { background: var(--bg); }
.side-nav a.on { background: var(--ink); color: #fff; }
.side-nav a.on .ico { color: #ffc21a; }
.side-nav a.tab-admin:not(.on) { background: var(--brand-soft); }
.side-nav .badge-n { margin-inline-start: auto; }
.side a:focus-visible { outline: 3px solid #ffc21a; outline-offset: 2px; }
.side-btn { display: none; position: relative; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; order: -1; }
.side-btn .ico { width: 22px; height: 22px; }
.side-btn .mb-close { display: none; }
body.side-open .side-btn .mb-open { display: none; }
body.side-open .side-btn .mb-close { display: grid; }
body.side-open .side-btn .menu-badge { display: none; }
.head-dash { margin-inline-start: auto; }
.head-dash .ico { width: 16px; height: 16px; }
.side-scrim { display: none; }
@media (max-width: 860px) {
  .shell { display: block; }
  .side-btn { display: inline-grid; }
  .side { position: fixed; z-index: 60; top: 0; bottom: 0; inset-inline-start: 0; width: min(310px, 88vw); height: auto; transform: translateX(100%); transition: transform .22s ease; box-shadow: none; padding-top: 22px; }
  body.side-open .side { transform: none; box-shadow: 0 0 60px rgba(28, 28, 31, .35); }
  .side-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(28, 28, 31, .45); }
  .shell-main { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }


/* phone dashboard: a bottom tab bar instead of a ☰ button */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar { position: fixed; z-index: 50; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -10px 28px -18px rgba(28, 28, 31, .4); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 4px 2px; border: 0; border-radius: 14px; background: transparent; color: var(--muted); font: 700 12px/1.2 Cairo, sans-serif; text-decoration: none; cursor: pointer; }
  .tabbar .tb-ico { position: relative; display: grid; place-items: center; width: 44px; height: 28px; border-radius: 999px; transition: background .15s; }
  .tabbar .tb-ico .ico { width: 21px; height: 21px; }
  .tabbar .on { color: var(--ink); }
  .tabbar .on .tb-ico { background: #ffc21a; }
  .tabbar .tb-badge { position: absolute; top: -4px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--alert); color: #fff; font: 800 11px/18px Cairo, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 0 2px #fff; }
  .tabbar a:focus-visible, .tabbar button:focus-visible { outline: 3px solid #ffc21a; outline-offset: 1px; }
  .shell-main { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .shell { --tabbar: 1; }
}
@media (prefers-reduced-motion: reduce) { .tabbar .tb-ico { transition: none; } }

.policy-toc a.on { background: var(--ink); color: #fff; box-shadow: none; }
.policy-toc { margin-top: 4px; }


/* menu page: foldable categories */
.cat-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.cat-toggle { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font: 700 14px Cairo, sans-serif; cursor: pointer; }
.cat-toggle b { font-weight: 800; }
.cat-toggle .ico { width: 18px; height: 18px; transition: rotate .2s; }
.cat-toggle[aria-expanded="true"] .ico { rotate: 180deg; }
.cat-toggle .ct-hint { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.cat-toggle:focus-visible { outline: 3px solid #ffc21a; outline-offset: 2px; }
.cat.is-closed .cat-head { border-bottom: 0; }
.cat-body[hidden] { display: none; }
@media (max-width: 560px) { .cat-toggle .ct-hint { display: none; } .cat-toggle { width: 100%; justify-content: center; } }
@media (prefers-reduced-motion: reduce) { .cat-toggle .ico { transition: none; } }

/* sign out at the bottom of the dashboard menu panel */
.side-out { margin: auto 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.side-out button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: #a3241a; font: 700 15px Cairo, sans-serif; cursor: pointer; }
.side-out button:hover { background: #fde6e3; }
.side-out button .ico { width: 20px; height: 20px; }
.side-out button:focus-visible { outline: 3px solid #ffc21a; outline-offset: 2px; }

/* categories tab + tidier buttons on the items page */
.cat-head .cat-edit { flex: none; }
.cat-list { padding: 0; overflow: hidden; }
.cat-list > h2 { margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 18px; }
.cats { list-style: none; margin: 0; padding: 0; }
.cats li { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.cats li:last-child { border-bottom: 0; }
.cats li:target { background: #fff6d6; }
.cats-main { flex: 1; min-width: 0; }
.cats-main b { font-size: 16px; }
.cats-main .muted { margin-inline-start: 8px; }
.cats-count { flex: none; min-height: 36px; display: inline-flex; align-items: center; gap: 5px; padding: 0 12px; border-radius: 999px; background: var(--bg); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.cats-count:hover { background: #ececea; }
.cats .row-actions { flex: none; padding-inline-start: 10px; border-inline-start: 1px solid var(--line); }
.items .row-actions { flex: none; gap: 2px; padding-inline-start: 10px; border-inline-start: 1px solid var(--line); }
.items .row-actions form:nth-child(2) { margin-inline-end: 6px; }
@media (max-width: 560px) {
  .cats li { flex-wrap: wrap; }
  .cats-main { flex-basis: 100%; }
  .cats .row-actions { margin-inline-start: auto; }
  .cat-head { flex-wrap: wrap; }
  .cat-head .cat-edit { width: 100%; justify-content: center; }
}

/* items page: buttons in a clear order */
.cat-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cat-tools .cat-toggle { margin-top: 0; }
.cat-tools .cat-edit { min-height: 40px; border-radius: 999px; }
@media (max-width: 560px) {
  .head-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .head-actions .btn { justify-content: center; text-align: center; padding-inline: 10px; }
  .head-actions .btn:last-child { grid-column: 1 / -1; }
  .cat-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .cat-tools { display: grid; grid-template-columns: 1fr auto; }
  .cat-tools .cat-toggle { width: auto; }
  .cat-head .cat-edit { width: auto; }
}
@media (max-width: 560px) {
  .head-actions .btn { white-space: nowrap; font-size: 14px; gap: 6px; }
}
@media (max-width: 560px) {
  .cats .row-actions, .items .row-actions { border-inline-start: 0; padding-inline-start: 0; }
}


/* ---- dashboard home: the link is the hero, sections are separate cards, one sticky save bar ---- */
.dform { display: grid; gap: 16px; }
.dform .linkcard { margin: 0; padding: 22px 24px; border: 0; border-radius: var(--radius); background: #1c1c1f; color: #fff; display: grid; gap: 8px; }
.dform .linkcard legend { float: none; width: auto; padding: 0; margin: 0 0 4px; font-size: 15px; font-weight: 700; color: #bdb8ae; }
.dform .lc-label { color: #fff; font-weight: 700; }
.dform .linkcard .slug-in { margin-top: 8px; background: #fff; border-radius: 12px; }
.dform .slug-preview { margin: 4px 0 0; color: #bdb8ae; font-size: 14px; }
.dform .slug-preview b { color: #ffc21a; font-size: 16px; }
.dform .lc-hint { margin: 0; color: #9d988d; font-size: 13px; }
.dform .lc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.dform .lc-actions .btn { background: #ffc21a; color: #1c1c1f; }
.dform .lc-actions .btn-ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px #55524b; }
.dform .lc-actions .btn-ghost:hover { background: #2c2c30; }
.dform .secs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.dform .sec { margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); display: grid; gap: 14px; }
.dform .sec:last-of-type { border: 1px solid var(--line); }
.dform .sec.wide { grid-column: 1 / -1; }
.dform .sec legend { float: none; width: auto; padding: 0; margin: 0 0 2px; display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; }
.dform .sec legend .ico { width: 20px; height: 20px; color: #8a6a00; }
.dform .sec label { margin: 0; }
.dform .sec .two { gap: 12px; }
.dform .save-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); box-shadow: 0 6px 24px rgba(28,28,31,.14), inset 0 0 0 1px var(--line); }
.dform .save-bar .btn:not(.btn-ghost) { min-width: 160px; justify-content: center; }
@media (max-width: 860px) {
  .dform .secs { grid-template-columns: 1fr; }
  .dform .linkcard { padding: 18px 16px; }
  .dform .sec { padding: 18px 16px; }
  .dform .save-bar { bottom: 84px; }
}
@media (max-width: 480px) {
  .dform .save-bar { flex-direction: row-reverse; }
  .dform .save-bar .btn:not(.btn-ghost) { flex: 1; min-width: 0; }
}

/* ---- QR tab ---- */
.qr-page { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; padding: 28px; }
.qr-big { padding: 18px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.qr-big img { display: block; width: 280px; height: 280px; }
.qr-side { display: grid; gap: 14px; min-width: 0; }
.qr-link { margin: 0; font-size: 18px; color: var(--muted); overflow-wrap: anywhere; }
.qr-link b { color: var(--ink); }
.qr-dl { display: flex; gap: 10px; flex-wrap: wrap; }
.qr-tips { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--muted); font-size: 14.5px; }
.qr-tips li { padding-inline-start: 18px; position: relative; }
.qr-tips li::before { content: ''; position: absolute; inset-inline-start: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: #ffc21a; }
@media (max-width: 760px) {
  .qr-page { grid-template-columns: 1fr; justify-items: stretch; padding: 20px 16px; gap: 20px; }
  .qr-big { justify-self: center; }
  .qr-big img { width: min(260px, 70vw); height: auto; }
  .qr-dl .btn { flex: 1; justify-content: center; }
}

/* fieldset legends: sit inside the card instead of cutting its border */
.dform fieldset { display: block; min-width: 0; }
.dform .sec > :not(legend) { margin-top: 0; }
.dform .sec > legend + * { clear: both; }
.dform .sec > :not(legend) + :not(legend) { margin-top: 14px; }
.dform .sec legend { float: inline-start; width: 100%; margin: 0 0 14px; }
.dform .linkcard > legend { float: inline-start; width: 100%; color: #bdb8ae; margin: 0 0 10px; }
.dform .linkcard > legend + * { clear: both; }
.dform .linkcard > :not(legend) + :not(legend) { margin-top: 8px; }
.dform .slug-preview b { background: transparent; padding: 0; }
.dform .linkcard .slug-host { color: #6f6a60; }
.dform .secs { grid-template-columns: 1fr; }
.dform .sec legend { margin-bottom: 14px; }
.dform .sec .two > label { min-width: 0; }
@media (min-width: 1560px) { .dform .secs { grid-template-columns: 1fr 1fr; } .dform .sec .two { grid-template-columns: 1fr; } }


/* order settings now live on the restaurant-data page; the orders page keeps a short status card */
.os-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 16px; }
.os-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.os-pills .pill { font-size: 13px; padding: 3px 12px; }
.os-card { margin-top: 16px; scroll-margin-top: 80px; display: grid; gap: 14px; }
.os-card:target { box-shadow: 0 0 0 3px #ffc21a, var(--shadow); }
.os-head { display: flex; align-items: center; gap: 10px; }
.os-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 17px; }
.os-head h2 .ico { width: 20px; height: 20px; color: #8a6a00; }
.os-card p { margin: 0; }
.os-card .osform { margin: 0; display: grid; gap: 14px; }
.os-card .os-save { display: flex; }

.os-links { display: flex; gap: 8px; flex-wrap: wrap; }
.coupon-form.card { display: grid; gap: 14px; margin-bottom: 16px; }
.coupon-form.card h2 { margin: 0; font-size: 17px; }
.coupon-list { padding: 0; overflow: hidden; }
.coupon-list > h2 { margin: 0; padding: 16px 20px; font-size: 17px; border-bottom: 1px solid var(--line); }
.coupon-list > p { padding: 16px 20px; margin: 0; }

.os-group { display: grid; gap: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.os-group h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--muted); }
.os-group label { margin: 0; }
.os-card .os-save .btn, .dform .save-bar .btn:not(.btn-ghost) { min-width: 120px; white-space: nowrap; }
.cat-tools .cat-edit { white-space: nowrap; }
.add-item { border-bottom: 1px solid var(--line); }

/* pickup choices: one row, wrapping only when the screen is really narrow */
.check-row { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.check-row .check { width: auto; margin: 0; padding: 0 14px; min-height: 44px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); gap: 8px; white-space: nowrap; }
.check-row .check:has(input:checked) { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px #e0b400; }
.check-row { flex-wrap: nowrap; }
.check-row .check { flex: 0 1 auto; justify-content: center; }
@media (max-width: 480px) {
  .check-row { gap: 6px; }
  .check-row .check { flex: 1 1 auto; padding: 0 10px; gap: 6px; font-size: 13.5px; }
}


/* sidebar identity card: logo or initial, name, and a quiet link to the public page */
.side-head { display: grid; gap: 12px; padding: 14px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); border-top: 4px solid #ffc21a; }
.side-head .sh-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.side-head .sh-av { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: #1c1c1f; color: #ffc21a; font-size: 22px; font-weight: 800; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
img.sh-av { background: #fff; padding: 2px; }
.side-head .sh-id { display: grid; gap: 1px; min-width: 0; }
.side-head small { color: var(--muted); font-size: 12.5px; }
.side-head b { font-size: 16.5px; line-height: 1.35; overflow-wrap: anywhere; }
.side-head .tab-page { margin: 0; min-height: 42px; border-radius: 12px; background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.side-head .tab-page:hover { background: #ffc21a; box-shadow: none; color: #1c1c1f; }
.side-head .tab-page .ico { width: 16px; height: 16px; }

/* admin: backup card */
.backup-card { display: grid; gap: 10px; margin-bottom: 16px; }
.bk-head { display: flex; align-items: center; gap: 10px; }
.bk-head h2 { margin: 0; font-size: 17px; }
.backup-card p { margin: 0; }
.bk-meta { font-size: 14px; color: var(--muted); }
.bk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bk-actions form { margin: 0; }

/* dashboard: sold-out switch on each item */
.so-form { margin: 0; flex: none; }
.so-btn { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 0; font: 700 13px Cairo, sans-serif; cursor: pointer; }
.so-btn.is-in { background: #e2f4e9; color: #1f7a4a; }
.so-btn.is-out { background: #fde6e3; color: #a3241a; }
.so-btn:hover { filter: brightness(.96); }
.so-btn:focus-visible { outline: 3px solid #ffc21a; outline-offset: 2px; }

/* status pill next to a page title: same height as the buttons beside it */
.dash-head .stat-row { align-items: center; flex-wrap: wrap; gap: 8px; }
.dash-head .stat-row .pill { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.dash-head .stat-row .pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-inline-end: 8px; }
.dash-head .stat-row .btn { min-height: 38px; }

/* opening-hours editor on the data page */
.hrs-top { display: grid; grid-template-columns: 1fr minmax(160px, 220px); gap: 16px; align-items: start; }
.week { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.week li { display: grid; grid-template-columns: minmax(110px, 1fr) auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.week li.off { opacity: .6; }
.week .wk-day { margin: 0; font-weight: 700; }
.week .wk-times { display: flex; gap: 10px; }
.week .wk-times label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--muted); }
.week input[type=time] { min-height: 40px; width: 118px; padding: 0 8px; direction: ltr; }
.wk-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 560px) { .hrs-top { grid-template-columns: 1fr; } .week li { grid-template-columns: 1fr; } .week .wk-times { justify-content: space-between; } .week input[type=time] { width: 100%; } .week .wk-times label { flex: 1; } }

/* an item row opens its edit box when tapped */
.items li.tap { cursor: pointer; }
.items li.tap:hover { background: #faf8f2; }
.items li.tap .row-actions, .items li.tap .so-form { cursor: default; }

.pop-body .check.avail { font-weight: 700; }
.pop-body .check.avail:has(input:not(:checked)) { color: #a3241a; }

/* simple opening-hours editor */
.hrs-times { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hrs-times input[type=time] { width: 100%; direction: ltr; text-align: start; }
.days-off { flex-wrap: wrap; }
.days-off .check { flex: 0 1 auto; }
.days-off .check:has(input:checked) { background: #fde6e3; box-shadow: inset 0 0 0 1.5px #d9776b; color: #a3241a; }
.now-closed:has(input:checked) { color: #a3241a; }

/* account menu header: restaurant logo (or its first letter) + name */
.acct-head { display: flex; align-items: center; gap: 12px; }
.acct-head b { min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.acct-av { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #1c1c1f; color: #ffc21a; font-weight: 800; font-size: 18px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
img.acct-av { background: #fff; padding: 2px; }

.acct-id { display: grid; gap: 1px; min-width: 0; }
.acct-id small { color: var(--muted); font-size: 12.5px; }
.acct-id b { font-size: 16px; }
/* signed-in on a public page: the dashboard button sits right next to the account icon */
.topbar .head-dash { order: 1; margin-inline-start: auto; }
.topbar .head-dash + .acct { margin-inline-start: 8px; }
/* signed in on a public page: «لوحة التحكم» and «حسابي» together on the left edge, with room above them */
.topbar .head-dash, .topbar .head-dash + .acct { order: 1; }
.topbar .head-dash { margin-inline-start: auto; }
.topbar .head-dash + .acct { margin-inline-start: 8px; }
.topbar:has(.head-dash) { padding-top: 20px; padding-bottom: 12px; }

/* phones: «دخول» sits right beside «ابدأ مجاناً» in the top bar (it used to be hidden inside the menu) */
.anon-login { display: none; }
@media (max-width: 899px) {
  .topbar:has(.tabs-anon) .anon-login { display: inline-flex; align-items: center; justify-content: center; order: 1; margin-inline-start: auto; min-height: 44px; padding: 0 16px; font-weight: 800; background: var(--card); }
  .topbar:has(.tabs-anon) .anon-login + .anon-cta { margin-inline-start: 8px; min-height: 44px; }
  .topbar:has(.tabs-anon) .anon-login[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--ink); }
}
@media (max-width: 340px) { .topbar:has(.tabs-anon) .anon-login { padding: 0 11px; } .topbar:has(.tabs-anon) .anon-cta { padding: 0 10px; } }
/* phones: the two buttons never wrap or stretch; on very narrow screens the logo word gives way first */
@media (max-width: 899px) {
  .topbar:has(.tabs-anon) .anon-login, .topbar:has(.tabs-anon) .anon-cta { white-space: nowrap; flex: none; line-height: 1.2; }
  .topbar:has(.tabs-anon) { gap: 6px; }
}
@media (max-width: 300px) {
  .topbar:has(.tabs-anon) .brand-word { display: none; }
  .topbar:has(.tabs-anon) .anon-login { padding: 0 9px; }
  .topbar:has(.tabs-anon) .anon-cta { padding: 0 9px; font-size: 13px; }
  .topbar:has(.tabs-anon) .menu-btn { width: 40px; height: 40px; }
}
/* admin pages: the account button sits on the far left, even though the menu button is between it and the logo */
.topbar > .side-btn + .acct { margin-inline-start: auto; }
@media (min-width: 861px) { .topbar > .side-btn + .acct { margin-inline-start: auto; } }

/* login: countdown after 5 wrong passwords */
.lock-box { display: grid; gap: 4px; justify-items: center; text-align: center; margin: 0 0 14px; padding: 14px; border-radius: 14px; background: #fff4e0; color: #7a4a00; font-weight: 600; }
.lock-time { font-size: 34px; font-weight: 800; letter-spacing: .04em; color: #1c1c1f; }
.auth-card .btn[disabled] { background: #d9d6cf; color: #7b776d; cursor: not-allowed; }

.a-email { position: relative; }
.a-email summary { list-style: none; cursor: pointer; }
.a-email summary::-webkit-details-marker { display: none; }
.a-email-form { display: flex; gap: 6px; margin-top: 6px; }
.a-email-form input { min-height: 36px; min-width: 190px; }


.a-email-form { flex-wrap: wrap; }
.admin-table .a-actions { flex-wrap: wrap; }
.a-email-form input[name=password] { min-width: 170px; }

/* iOS Safari: «float: inline-start» is not understood by older versions, so the legend stayed on the card's border.
   Plain «right» first (the dashboard is right-to-left), the logical value after it for browsers that know it. */
.dform .sec legend, .dform .linkcard > legend, .online legend { float: right; float: inline-start; width: 100%; }
.hrs-times > label { min-width: 0; }
.hrs-times input[type=time] { min-width: 0; max-width: 100%; box-sizing: border-box; -webkit-appearance: none; appearance: none; min-height: 46px; }
.dform input, .dform select { max-width: 100%; box-sizing: border-box; }
