* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; }
button, input { font: inherit; }

.logo { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 8px; background: var(--accent) center/contain no-repeat; border: 3px solid var(--ink); }
.logo.sm { width: 30px; height: 30px; margin: 0; border-width: 2px; }

.btn { appearance: none; border: 1px solid transparent; border-radius: 12px; padding: 10px 16px; font-weight: 700; cursor: pointer; transition: transform .12s ease, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ok { background: var(--ready); color: var(--ready-ink); }
.btn.ghost { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 600; }
.btn.sm { padding: 6px 12px; font-size: 14px; }
.btn.big { width: 100%; padding: 16px; font-size: 18px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(360px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 28px; text-align: center; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card p { margin: 0; color: var(--muted); }
.login-card input { text-align: center; font-size: 26px; letter-spacing: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.err { color: var(--red) !important; font-weight: 600; }

/* ---------- cashier: always a dark teal kiosk ---------- */
body.kiosk {
  height: 100vh; overflow: hidden;
}
body.kiosk .app { height: 100vh; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand-logo img { display: block; height: 36px; width: auto; } /* sub-brand lockup, ≥ 180 px wide */
.brand-stacked img { display: block; width: 140px; height: auto; margin: 0 auto 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; }
.stats-bar { flex: 1; display: flex; justify-content: center; gap: 22px; color: var(--muted); font-size: 15px; }
.stats-bar b { color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.bar-end { display: flex; align-items: center; gap: 12px; }
.clock { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; direction: ltr; }
.conn { font-size: 14px; }
.conn.on { color: var(--ready); }
.conn.off { color: var(--red); }
.bar .btn.ghost { border-radius: 999px; }

.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px 1fr 1fr; }
.layout > section { min-height: 0; overflow-y: auto; padding: 20px; border-inline-start: 1px solid var(--line); }
.layout > section:first-child { border-inline-start: 0; background: var(--panel); }
@media (max-width: 960px) { body.kiosk { height: auto; overflow: auto; } body.kiosk .app { height: auto; } .layout { grid-template-columns: 1fr; } .stats-bar { display: none; } .bar { flex-wrap: wrap; } }

.new { display: flex; flex-direction: column; gap: 12px; }
.new h2, .col h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.num-display { width: 100%; background: var(--bg); border: 2px solid transparent; border-radius: 18px; height: 150px; text-align: center; font: inherit; font-size: 84px; font-weight: 800; color: var(--accent); direction: ltr; font-variant-numeric: tabular-nums; outline: 0; }
.num-display:focus { border-color: var(--accent); }
.num-display::placeholder { color: var(--line); }
.lbl { color: var(--muted); font-size: 14px; }
.hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; text-align: center; }
.new .btn.primary.big { font-size: 17px; }

.col h3 .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.col.ready h3 .dot { background: var(--ready); }
.count { background: var(--line); color: var(--ink); border-radius: 999px; padding: 0 10px; font-size: 13px; }
.count.ready { background: var(--ready); color: var(--ready-ink); }
.list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.empty { color: var(--muted); font-size: 14px; padding: 18px; border: 1px dashed var(--line); border-radius: 16px; text-align: center; }

.order { background: var(--card); border-radius: 16px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; animation: pop .25s ease; position: relative; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.order.is-ready { background: var(--ready-bg); }
.o-num { font-size: 40px; font-weight: 800; min-width: 84px; text-align: center; direction: ltr; font-variant-numeric: tabular-nums; line-height: 1; cursor: pointer; }
.is-ready .o-num { color: var(--ready-num); }
.o-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13px; color: var(--muted); }
.o-meta .called { color: var(--called); font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--line); color: var(--muted); white-space: nowrap; }
.badge.good { background: color-mix(in srgb, var(--ready) 16%, transparent); color: var(--ready); }
.badge.warn { background: color-mix(in srgb, var(--amber) 14%, transparent); color: var(--amber); }
.o-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.o-actions .btn.ghost { border-radius: 12px; }
.is-ready .o-actions .btn.ghost { color: var(--ink); border-color: var(--ready-line); }
.is-ready .o-actions .link { border: 0; text-decoration: underline; }

/* mini ticket preview (landing, sign-up, owner panel) */
.tkp { --hero: var(--accent); --hero-ink: var(--accent-ink); background: var(--hero); color: var(--hero-ink); border-radius: 22px; padding: 20px 40px 26px; text-align: center; width: min(70vw, 240px); transition: background .3s; }
.tkp-label { display: block; font-size: 14px; font-weight: 600; opacity: .8; }
.tkp .num { display: block; font-size: 72px; font-weight: 800; line-height: 1.1; direction: ltr; font-variant-numeric: tabular-nums; }
.tkp.ringing { animation: tkshake .45s linear infinite; }
@keyframes tkshake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .tkp.ringing { animation: none; } }

/* QR overlay */
.overlay { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; z-index: 10; }
.qr-card { background: var(--card); border-radius: 24px; padding: 22px; width: min(620px, 100%); display: flex; flex-direction: column; gap: 16px; box-shadow: 0 30px 60px -20px var(--shadow); }
.qr-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; color: var(--muted); }
.qr-head b { font-size: 28px; color: var(--ink); }
.qr-body { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
@media (max-width: 560px) { .qr-body { grid-template-columns: 1fr; justify-items: center; } }
.qr-svg { width: min(300px, 70vw); aspect-ratio: 1; background: #fff; padding: 10px; border-radius: 16px; }
.qr-svg svg { width: 100%; height: 100%; display: block; }
.qr-side { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.steps { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; }
.step i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: inline-grid; place-items: center; font-style: normal; font-size: 13px; }
.step.done { color: var(--ok); }
.step.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done i::after { content: '✓'; }
.timer { position: relative; width: 74px; height: 74px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 3; }
.timer .track { stroke: var(--line); }
.timer .prog { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100.53; transition: stroke-dashoffset 1s linear; }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 22px; }
.qr-side small { color: var(--muted); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 600; z-index: 40; max-width: calc(100% - 32px); }

/* ---------- shared staff UI (owner panel, admin, sign-up) ---------- */
a { color: inherit; }
.page { max-width: 980px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; }
.card h2 { margin: 0 0 14px; font-size: 18px; }
.card h2 small { color: var(--muted); font-weight: 600; font-size: 13px; margin-inline-start: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 14px; color: var(--muted); font-weight: 600; }
.field input, .field select {
  padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%;
}
.field .hint { margin: 0; font-size: 12px; }
.field .ltr { direction: ltr; text-align: left; }
.prefix { display: flex; align-items: stretch; direction: ltr; }
.prefix span { padding: 11px 10px; border: 1px solid var(--line); border-inline-end: 0; border-radius: 12px 0 0 12px; background: var(--line); color: var(--muted); font-size: 14px; white-space: nowrap; }
.prefix input { border-radius: 0 12px 12px 0 !important; }
.ok-text { color: var(--ok); font-weight: 600; font-size: 13px; }
.bad-text { color: var(--red); font-weight: 600; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; box-shadow: inset 0 -3px 6px rgba(0,0,0,.25); padding: 0; }
.swatch.sel { border-color: var(--ink); }
.swatches input[type=color] { width: 40px; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--bg); cursor: pointer; }
.seg { align-self: flex-start; display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 9px 16px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.sel { background: var(--ink); color: var(--bg); }
.preview { display: grid; place-items: center; padding: 18px; border-radius: 16px; background: var(--bg); }
.logo-row { display: flex; align-items: center; gap: 12px; }
.logo-row img { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: #fff; border: 1px solid var(--line); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--bg); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }

.sub-box { border-radius: 16px; padding: 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.sub-box.good { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.sub-box.warn { background: color-mix(in srgb, var(--amber) 12%, transparent); }
.sub-box.bad { background: color-mix(in srgb, var(--red) 10%, transparent); }
.sub-box b { font-size: 18px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 12px; }
.plan { border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.plan b { display: block; }

.banner { padding: 10px 16px; text-align: center; font-weight: 600; font-size: 14px; }
.banner.warn { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }
.banner.bad { background: var(--red); color: #fff; }
.banner a { font-weight: 700; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: right; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; }
.dot-c { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-inline-end: 6px; }
.pill { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.good { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--amber) 13%, transparent); color: var(--amber); }
.pill.bad { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }

dialog { border: 0; border-radius: 20px; padding: 22px; background: var(--card); color: var(--ink); width: min(440px, calc(100% - 32px)); box-shadow: 0 30px 60px -20px var(--shadow); }
dialog::backdrop { background: var(--scrim); }
dialog h3 { margin: 0 0 14px; }

.code-box { text-align: center; background: var(--bg); border-radius: 14px; padding: 10px 14px; width: 100%; }
.code-box small { display: block; color: var(--muted); font-size: 12px; }
.code-box b { font-size: 28px; letter-spacing: 4px; font-variant-numeric: tabular-nums; }
.logo.img { background: #fff center/contain no-repeat; box-shadow: none; border: 1px solid var(--line); }
.login-card a { font-size: 14px; text-decoration: none; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 760px) { .grid3 { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; gap: 8px; }
.plan .price { font-size: 22px; font-weight: 700; }
.plan .price small { font-size: 13px; color: var(--muted); font-weight: 600; }
.plan.current { border-color: var(--ok); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 15%, transparent); }
.btn.wa { background: var(--wa); color: #fff; }
.banner a.wa-link { color: inherit; text-decoration: underline; margin-inline-start: 6px; }
a.btn { text-decoration: none; }

.track-qr { width: 150px; height: 150px; flex: none; background: #fff; border-radius: 12px; padding: 6px; }
.track-qr svg { width: 100%; height: 100%; display: block; }

.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); padding: 6px 10px; }
.is-ready .o-actions .btn.danger { color: var(--red); }
.subs { display: flex; flex-direction: column; gap: 14px; }
.sub-item { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pkg-row { margin-bottom: 8px; } .pkg-row input { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.sub-item input { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }

/* themed confirm dialog (confirm.js) */
dialog.confirm { text-align: center; width: min(380px, calc(100% - 32px)); animation: pop .18s ease; }
.confirm-icon { width: 54px; height: 54px; border-radius: 50%; margin: 2px auto 12px; display: grid; place-items: center; font-size: 28px; font-weight: 800; background: var(--accent); color: var(--accent-ink); }
.confirm-icon.danger { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
dialog.confirm h3 { margin: 0 0 6px; font-size: 20px; }
dialog.confirm p { margin: 0 0 18px; color: var(--muted); line-height: 1.7; }
.confirm-actions { display: flex; flex-direction: column; gap: 8px; }
.confirm-actions .btn { padding: 13px; font-size: 16px; border-radius: 14px; }
.btn.danger-solid { background: var(--red); color: #fff; }

/* ---------- cancelled orders: top-bar chip + drawer ---------- */
.chip-btn { appearance: none; cursor: pointer; font: inherit; font-size: 15px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; display: inline-flex; align-items: center; gap: 6px; }
.chip-btn b { color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.chip-btn.has { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); background: color-mix(in srgb, var(--red) 10%, transparent); }
.chip-btn.has b { color: var(--red); }
.chip-btn:hover { border-color: var(--muted); }
.drawer-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 30; }
.drawer { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(380px, 100%); background: var(--bg); color: var(--ink); border-inline-start: 1px solid var(--line); z-index: 31; display: flex; flex-direction: column; padding: 18px; gap: 12px; overflow-y: auto; box-shadow: 0 0 40px -10px var(--shadow); animation: drawer-in .22s ease; }
@keyframes drawer-in { from { transform: translateX(-24px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-note { margin: auto 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.order.is-cancelled { opacity: .92; }
.order.is-cancelled .o-num { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 3px; cursor: default; }
.toast-action { appearance: none; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; padding: 0 4px; }
@media (max-width: 960px) { .drawer { inset-block: auto 0; inset-inline: 0; width: 100%; max-height: 80vh; border-radius: 20px 20px 0 0; border-inline-start: 0; border-top: 1px solid var(--line); } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }

/* end-of-order button (owner panel preview) */
.btn.cta { display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; background: var(--accent); color: var(--accent-ink); padding: 14px 18px; font-size: 17px; border-radius: 14px; width: 100%; }
.cta-icon { display: inline-flex; }
.cta-icon svg { width: 22px; height: 22px; }

.cta-types { display: flex; flex-wrap: wrap; gap: 8px; }
.cta-type { appearance: none; cursor: pointer; font: inherit; font-weight: 600; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: inline-flex; align-items: center; gap: 8px; }
.cta-type svg { width: 18px; height: 18px; }
.cta-type.sel { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* on-screen keypad (cashier entry) */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key { appearance: none; cursor: pointer; font: inherit; font-size: 26px; font-weight: 800; padding: 14px 0; border-radius: 14px; border: 0; background: var(--card); color: var(--ink); font-variant-numeric: tabular-nums; }
.key:active { transform: scale(.95); }
.key.back { color: var(--muted); font-size: 22px; }
.key.enter { background: var(--accent); color: var(--accent-ink); }

/* drag a card between columns */
.order.draggable { cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.order.dragging { opacity: .35; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: .96; box-shadow: 0 18px 40px -12px var(--shadow); transform-origin: top left; cursor: grabbing; }
body.is-dragging { cursor: grabbing; -webkit-user-select: none; user-select: none; }
.layout > .col.drop-target { outline: 2px dashed var(--line); outline-offset: -8px; border-radius: 16px; transition: outline-color .15s, background .15s; }
.layout > .col.drop-ok { outline: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.layout > .col.ready.drop-ok { outline-color: var(--ready); background: color-mix(in srgb, var(--ready) 12%, transparent); }

/* ---------- packages (owner panel, sign-up, admin) ---------- */
.pkg-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pkg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pkg-head b { font-size: 18px; }
.plan .price.ask { font-size: 16px; }
.pkg-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; }
.pkg-feats li { display: flex; gap: 8px; }
.pkg-feats li::before { content: '✓'; color: var(--ok); font-weight: 800; }
.pkg-totals { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); }
.pkg-total { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.pkg-total small { color: var(--muted); font-weight: 600; }
.pkg-total b { font-variant-numeric: tabular-nums; }
.btn.pkg-period { width: 100%; text-align: center; }
label.pkg-card { cursor: pointer; position: relative; }
label.pkg-card:has(.pkg-radio:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
label.pkg-card:has(.pkg-radio:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.pkg-radio { position: absolute; top: 14px; inset-inline-end: 14px; width: 18px; height: 18px; accent-color: var(--ink); }
.pkg-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

/* a package feature the café does not have: hint + upgrade button */
.lock { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line); background: var(--bg); margin-bottom: 12px; }
.lock b { font-size: 15px; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.field textarea { padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%; font: inherit; resize: vertical; }
.field label small { font-weight: 600; }

/* social links editor */
.social-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.social-edit select, .social-edit input { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
.social-edit input { flex: 1; min-width: 180px; direction: ltr; text-align: left; }
.social-edit input.bad { border-color: var(--red); }
.social-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.social-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.social-ic svg { width: 22px; height: 22px; }

/* menu editor */
.menu-add { margin: 16px 0 12px; }
.menu-add input { flex: 1; min-width: 200px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.menu-cats { display: flex; flex-direction: column; gap: 14px; }
.menu-cat { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.menu-cat > .row { width: 100%; }
.menu-cat-name { flex: 1; min-width: 160px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-weight: 700; }
.menu-rows { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.menu-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px; border-radius: 12px; background: var(--bg); }
.menu-row.off { opacity: .65; }
.menu-thumb { width: 48px; height: 48px; flex: none; border-radius: 10px; object-fit: cover; background: var(--line); }
.menu-row-txt { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.menu-ops { gap: 6px; }
.menu-avail { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); cursor: pointer; }
.btn.ghost.danger { color: var(--red); }

/* offers composer + history */
.offer-form { margin-top: 14px; }
.offer-list { display: flex; flex-direction: column; gap: 10px; }
.offer-row { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.offer-row p { margin: 0; line-height: 1.6; }
.pill:not(.good):not(.warn):not(.bad) { background: var(--line); color: var(--muted); }
.pkg-row { gap: 8px; } .pkg-row .row { gap: 8px; }
.pkg-feat { gap: 6px; font-size: 14px; color: var(--muted); cursor: pointer; }
.renew-total { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-weight: 700; }
.renew-total:empty { display: none; }

/* offer composer: how the push will look on the phone */
.push-preview { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); max-width: 380px; }
.push-preview img { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.push-preview div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.push-preview b { font-size: 14px; overflow-wrap: anywhere; }
.push-preview span { font-size: 13px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.push-preview small { color: var(--muted); font-size: 11px; }

/* owner panel: section nav + one upgrade summary instead of a lock box per card */
.owner-nav { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.owner-nav a { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; background: var(--card); }
.owner-nav a:hover, .owner-nav a:focus-visible { background: var(--ink); color: var(--bg); }
.page > .card, .page > form.card { scroll-margin-top: 64px; }
.upgrade-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; border-style: dashed; }
.lock.compact { padding: 8px 12px; margin-bottom: 0; border-style: solid; }
.lock.compact b { font-weight: 600; font-size: 14px; color: var(--muted); }

/* packages: recommended badge, per-month saving, checkmark on the chosen card */
.pill.pkg-reco { background: var(--accent); color: var(--accent-ink); }
.pkg-card.recommended { border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); }
.pkg-total { flex-wrap: wrap; }
.pkg-total .pkg-save { color: var(--ok); font-weight: 700; flex: 1; text-align: end; }
.pkg-tick { position: absolute; top: 12px; inset-inline-end: 40px; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 800; }
label.pkg-card:has(.pkg-radio:checked) .pkg-tick { display: grid; }

/* menu editor: drag handle + inline price */
.drag-handle { flex: none; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; padding: 6px 4px; color: var(--muted); font-size: 20px; line-height: 1; }
.drag-handle:active { cursor: grabbing; }
.menu-cat.dragging, .menu-row.dragging { opacity: .6; box-shadow: 0 10px 28px -12px var(--shadow); position: relative; z-index: 2; }
.menu-price-box { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.menu-price-in { width: 76px; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); direction: ltr; text-align: left; font: inherit; }

/* owner panel: menu pages */
.menu-pages-bar { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.menu-chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.menu-tab { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 7px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.menu-tab.sel { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.menu-page-add input { flex: 1; min-width: 200px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }

/* admin: menu design dialog */
dialog.design-dlg { width: min(1120px, calc(100% - 24px)); max-height: calc(100dvh - 24px); }
.design-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.design-form { max-height: calc(100dvh - 150px); overflow-y: auto; padding-inline-end: 6px; display: flex; flex-direction: column; gap: 10px; }
.design-preview { position: sticky; top: 0; }
.design-preview iframe { width: 390px; max-width: 100%; height: min(720px, calc(100dvh - 160px)); border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.design-sect { margin: 12px 0 0; font-size: 15px; padding-top: 10px; border-top: 1px solid var(--line); }
.design-form input[type=color] { width: 64px; height: 38px; padding: 2px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.design-form select, .design-form .design-page > input, .design-form .design-actions + * { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; }
.design-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.design-upload > span:first-child { flex: 1; min-width: 150px; }
.design-page { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.design-actions { position: sticky; bottom: 0; background: var(--card); padding: 10px 0; }
@media (max-width: 900px) { .design-grid { grid-template-columns: 1fr; } .design-preview { position: static; } }
