/* Restaurant dashboard + login. Works on phones, tablets and laptops. */
:root {
  /* Dark green and white */
  --bg: #f3f7f5; --surface: #fff; --ink: #10261c; --muted: #5d7066; --line: #dde7e1;
  --accent: #154734; --accent-ink: #fff; --accent-soft: #e9f2ed; --danger: #b3261e; --gold: #154734;
  --radius: 14px; --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; }
h1 { font: 600 28px/1.15 var(--serif); }
h2 { font: 600 22px/1.2 var(--serif); }
h3 { font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.small { width: 20px; height: 20px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.narrow { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 14px; }
.card.empty { text-align: center; color: var(--muted); padding: 40px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.tight { gap: 2px; }
.row.wrap { flex-wrap: wrap; }
.row-end { display: flex; gap: 8px; justify-content: flex-end; }
.grow { flex: 1; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 14px; }
input, select, textarea {
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { background: var(--bg); color: var(--muted); }
textarea { resize: vertical; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  font: 500 14px var(--sans); color: var(--ink); text-decoration: none; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px;
}
.btn:hover { border-color: #b7cabe; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { color: var(--danger); }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.file-btn { display: inline-flex; flex-direction: row; }
.icon { border: 0; background: none; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 15px; color: var(--muted); }
.icon:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.icon:disabled { opacity: .3; cursor: default; }

/* App bar */
.appbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand-mark { font: 600 18px var(--serif); color: var(--accent); display: inline-flex; align-items: center; gap: 8px; }
.brand-mark .logo-mark { width: 1.5em; height: 1.5em; flex: none; }
.appbar { background: var(--accent); color: #fff; border-bottom-color: var(--accent); }
.appbar .brand-mark, .appbar .r-name { color: #fff; }
.appbar .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.appbar .btn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .6); }
.appbar .btn.ghost { border-color: transparent; }
.appbar select { background: #fff; color: var(--ink); border-color: transparent; }
.restaurant-switch { display: flex; align-items: center; gap: 10px; flex: 1 0 auto; }
.restaurant-switch #view-live { flex: none; }
.restaurant-switch select { width: auto; max-width: 280px; font-weight: 600; padding: 7px 10px; }
.r-name { font-weight: 600; }
.account { margin-left: auto; }
.vl-short { display: none; }
.vl-icon { display: none; }
.account-btn { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .14); color: #fff; font: 600 16px var(--sans); cursor: pointer; display: grid; place-items: center; padding: 0; }
.account-btn:hover, .account-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .26); border-color: #fff; }
.account-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.img-menu.account-menu { left: auto; right: 0; min-width: 190px; max-width: calc(100vw - 24px); color: var(--ink); }

.status-pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.status-pill[data-s=demo] { background: #fdf0d8; color: #8a5a00; }
.status-pill[data-s=past_due], .status-pill[data-s=cancelled] { background: #fbe4e2; color: var(--danger); }

.tabs { display: flex; gap: 4px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; font: 500 14px var(--sans); color: var(--muted); padding: 12px 14px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }

.tab-panel { max-width: 1000px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.panel-head p { margin: 4px 0 0; max-width: 560px; }

.links-fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; }
.links-fieldset legend { padding: 0 6px; }
.links-fieldset .show-links { font-weight: 600; margin-top: 4px; }
.links-fieldset > p { margin: 4px 0 10px; }

/* Owner view */

.banner { background: #fbe4e2; color: var(--danger); padding: 10px 24px; font-size: 14px; font-weight: 500; }
.banner a, .owner-note a { color: inherit; font-weight: 600; }
.owner-note { font-size: 14px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; }
.owner-note strong { color: var(--ink); font-weight: 600; }
.plan-status, .on-help { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; }
.on-help { margin-left: auto; overflow-wrap: anywhere; }
.plan-status { --tone: #2e7d32; --tone-soft: var(--accent-soft); }
.plan-status[data-tone="wait"] { --tone: #8a5a00; --tone-soft: #fbf0d9; }
.plan-status[data-tone="wait"] strong { color: var(--tone); }
.plan-status[data-tone="off"] { --tone: #5d7066; --tone-soft: #eef1ef; }
.ps-icon { width: 22px; height: 22px; border-radius: 999px; background: var(--tone-soft); color: var(--tone); display: inline-grid; place-items: center; flex: none; }
.ps-icon svg { width: 13px; height: 13px; }
.ps-sep { margin: 0 2px; opacity: .6; }
.owner-note .on-icon { color: var(--accent); display: inline-grid; place-items: center; flex: none; }
.owner-note .on-icon svg { width: 18px; height: 18px; }
.on-short { display: none; }
@media (max-width: 720px) {
  .on-help { margin-left: 0; }
  .owner-note .on-long { display: none; }
  .owner-note .on-short { display: inline; }
  .owner-note { padding: 8px 12px; row-gap: 4px; font-size: 13px; }
  .ps-sep { margin: 0 1px; }
}

/* Stats strip */
.bt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bt-head strong { font-size: 14px; color: var(--ink); }
.bt-head span { font-size: 12px; }
.bt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bt-list li { display: grid; grid-template-columns: 18px minmax(64px, auto) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.bt-rank { width: 18px; height: 18px; border-radius: 999px; background: var(--accent-soft); color: var(--accent) !important; font-size: 11px !important; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.bt-label { color: var(--ink) !important; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-bar { height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.bt-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bt-n { color: var(--ink) !important; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; min-width: 2ch; }
.bt-empty { margin: 0; font-size: 13px; color: var(--muted); }
.billing-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.billing-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; margin-bottom: 10px; }
.pay-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pay-method { margin: 4px 0 2px; flex-wrap: wrap; }
.pay-method button { padding: 8px 12px; }
.pay-history { margin: 6px 0 10px; font-size: 14px; }
.pay-history table { width: 100%; border-collapse: collapse; }
.pay-history th, .pay-history td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.pay-history th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.pay-history td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pay-history .wrap-x { overflow-x: auto; }
.billing-extra select { width: auto; }
.billing-form .span-all { grid-column: 1 / -1; margin: 0; }
.b-preview { font-size: 15px; }
.billing-extra { border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 12px; }
.billing-extra input { width: 100px; }
.billing-extra p { margin: 6px 0 0; }
.billing-form input:disabled { background: var(--bg); color: var(--muted); }
#billing-card > p.small { margin: 0; }
@media (max-width: 720px) { .billing-form, .pay-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .billing-form, .pay-form { grid-template-columns: minmax(0, 1fr); } }

/* Menu editor */
.category { padding: 0; overflow: hidden; }
.category.hidden-cat { opacity: .7; }
.cat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cat-title { display: flex; align-items: baseline; gap: 10px; }
.cat-title h3 { font: 600 19px var(--serif); }
.cat-head .cat-desc { flex-basis: 100%; order: 3; margin: -4px 0 0; font-size: 14px; white-space: pre-line; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-row { display: grid; grid-template-columns: 52px 1fr auto auto 22px; align-items: center; gap: 12px; padding: 10px 8px 10px 20px; border-bottom: 1px solid var(--line); background: #fff; }
.item-row.sold .item-name, .item-row.sold .thumb { opacity: .5; }
.item-row.hidden-item .item-sub, .item-row.hidden-item .thumb, .item-row.hidden-item .item-price, .item-row.hidden-item .switch, .item-row.hidden-item .tag { opacity: .45; }
.item-row.hidden-item .item-name { color: var(--muted); }
.thumb { width: 52px; height: 52px; border-radius: 10px; background: var(--bg); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-main { border: 0; background: none; text-align: left; padding: 0; cursor: pointer; min-width: 0; font: inherit; color: inherit; display: flex; flex-direction: column; }
.item-main:hover .item-name { text-decoration: underline; }
.item-name { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item-sub { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-price { font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.tag.special { background: var(--accent-soft); border-color: #c9ddd1; color: var(--accent); }

.switch { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 40px; height: 24px; border-radius: 12px; background: #cbd8d0; position: relative; transition: background .15s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch em { font-style: normal; font-size: 13px; color: var(--muted); width: 62px; }

.insert-cat { display: flex; align-items: center; gap: 10px; height: 22px; margin: 2px 0; }
#categories > .insert-cat:first-child { margin-top: -4px; }
#categories > .insert-cat:last-child { margin-bottom: 8px; }
.card.empty p { margin: 0 0 12px; }
.insert-cat::before, .insert-cat::after { content: ''; flex: 1; border-top: 1px dashed transparent; transition: border-color .15s; }
.insert-cat button { border: 0; background: none; padding: 2px 10px; border-radius: 999px; font: 500 13px var(--sans); color: var(--muted); opacity: .7; cursor: pointer; transition: opacity .15s, background .15s, color .15s; }
.insert-cat:hover::before, .insert-cat:hover::after, .insert-cat:focus-within::before, .insert-cat:focus-within::after { border-color: var(--accent); }
.insert-cat:hover button, .insert-cat button:focus-visible { opacity: 1; color: var(--accent); background: var(--accent-soft); }
@media (hover: none) { .insert-cat button { opacity: .8; } }
.subcat { margin: 0 16px 14px 32px; border: 1px solid var(--line); border-left: 3px solid var(--accent-soft); border-radius: 12px; overflow: hidden; background: #fff; }
.subcat .cat-head { padding: 10px 14px; }
.subcat .cat-title h4 { font: 600 16px var(--serif); margin: 0; }
.subcat.hidden-cat { opacity: .7; }
.subcat:last-child { margin-bottom: 16px; }
.cat-head .cat-title { flex: 1; min-width: 0; }
.cat-head .cat-actions { flex-wrap: wrap; justify-content: flex-end; order: 1; }
.cat-head .cat-corner { order: 2; flex-wrap: nowrap; padding-left: 8px; margin-left: 4px; border-left: 1px solid var(--line); }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 9px; border-radius: 999px; font: 600 13px var(--sans); color: var(--accent); cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.pill-btn svg { flex: none; }
.pill-btn.fill { background: var(--accent-soft); border: 1px solid transparent; }
.pill-btn.fill:hover { background: color-mix(in srgb, var(--accent) 16%, #fff); }
.pill-btn.line { background: #fff; border: 1px solid color-mix(in srgb, var(--accent) 45%, #fff); }
.pill-btn.line:hover { border-color: var(--accent); background: var(--accent-soft); }
.pill-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cat-corner .pill-btn { margin-right: 4px; }
.icon.bin { color: #b3261e; display: inline-grid; place-items: center; }
.icon.eye { color: var(--accent); display: inline-grid; place-items: center; }
.icon.eye.off { color: var(--muted); }
.icon.eye:hover { background: var(--accent-soft); }
.icon.bin:hover { background: #fdecea; color: #8c1d18; }
.cat-name { cursor: text; border-radius: 6px; }
.cat-name:hover, .cat-desc.editable:hover { text-decoration: underline dotted var(--muted); text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.cat-name:focus-visible, .cat-desc.editable:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cat-desc.editable { cursor: text; }
.add-desc { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; font: 500 13px var(--sans); color: var(--muted); opacity: .55; }
.cat-head .desc-row { flex-basis: 100%; order: 3; margin: -6px 0 0; }
.add-desc:hover, .add-desc:focus-visible { opacity: 1; color: var(--accent); }
@media (hover: none) { .add-desc { opacity: .8; } }
.inline-edit { border: 1.5px solid var(--accent); border-radius: 8px; box-shadow: 0 0 0 3px var(--accent-soft); background: #fff; color: var(--ink); }
.inline-name { font: 600 19px var(--serif); padding: 2px 8px; margin: -4px 0 -4px -9px; width: min(340px, 60vw); }
.subcat .inline-name { font-size: 16px; }
.inline-desc { flex-basis: 100%; order: 3; margin: -2px 0 0 -9px; padding: 6px 8px; font: 400 14px/1.45 var(--sans); width: calc(100% + 9px); resize: vertical; }
.cat-empty { margin: 0; padding: 12px 20px; }
.subcat .cat-empty { padding: 10px 14px; }
.category > .item-list + .subcat, .category > .cat-head + .subcat { margin-top: 14px; }
.item-row.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 35% { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); } 100% { background: transparent; box-shadow: inset 0 0 0 transparent; } }

/* Tables */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.table-card, .general-qr { display: flex; gap: 18px; align-items: flex-start; }
.qr-box { width: 120px; height: 120px; flex: none; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: #fff; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.table-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.table-info .link { font-size: 12px; }
.general-qr h3 { margin-bottom: 4px; }
.general-qr p { margin: 0 0 8px; }

/* Details */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.span2 { grid-column: 1 / -1; }
.logo-edit, .photo-edit { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; }
.logo-preview { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; background: var(--bg); flex: none; }
.logo-preview img, .photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-preview span { font: 600 30px var(--serif); color: var(--accent); }
.photo-preview { width: 96px; height: 96px; border-radius: 12px; border: 1px dashed var(--line); overflow: hidden; display: grid; place-items: center; background: var(--bg); flex: none; }
.photo-edit p { margin: 6px 0 0; }
#invite-form input { flex: 1; }
.login-status { display: flex; align-items: center; gap: 8px; margin: 12px 0; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #c9c1b4; flex: none; }
.dot.ok { background: #2e7d32; } .dot.wait { background: #d9a441; }
#admin-card { display: flex; flex-direction: column; gap: 12px; border-color: #c9ddd1; background: #f6faf7; }
#admin-card select { max-width: 280px; }
#people-card p { margin: 4px 0 0; }

/* Onboarding */
.slug-field { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.slug-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.slug-prefix { padding: 10px 0 10px 12px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.slug-field input { border: 0; box-shadow: none !important; padding-left: 2px; }

/* Dialogs */
.modal { border: 0; border-radius: 18px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink); }
.modal::backdrop { background: rgba(20, 16, 10, .45); }
.modal form { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.small-modal { width: min(420px, calc(100vw - 24px)); }
.small-modal h2 { font-size: 20px; margin-bottom: 6px; }
.small-modal p { margin: 0 0 10px; }
#cat-form .modal-body { display: grid; gap: 14px; }
#cat-form .modal-body h2, #cat-form .modal-body p { margin: 0; }
.special-dates { margin-top: 8px; gap: 12px; }
.special-dates label { flex: 1; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 100; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.admin-list { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.admin-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg); border-radius: 10px; min-width: 0; }
.admin-list .grow { min-width: 0; overflow-wrap: anywhere; }
#admin-form .row input { flex: 1; }

/* Login */
.stack { display: flex; flex-direction: column; gap: 14px; }
.login-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font: 500 14px var(--sans); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.login-card #msg { margin-top: 14px; }
.login-card h1 { margin-bottom: 4px; }
.login-card .brand-mark { margin-bottom: 18px; }
.sent { background: var(--accent-soft); border-radius: 12px; padding: 14px; }

/* Phones */
@media (max-width: 720px) {
  .appbar, .tabs { padding-left: 14px; padding-right: 14px; }
  .appbar { column-gap: 10px; }
  .appbar .restaurant-switch { flex: 1 1 0; min-width: 0; }
  .appbar .restaurant-switch select { max-width: 100%; min-width: 0; }
  /* one row: logo, restaurant (name or picker), status, View menu, account */
  .appbar { flex-wrap: nowrap; }
  .appbar:not(.owner-bar) .brand-mark .brand { display: none; }
  /* owners on phones: DigiDine on the left (not the restaurant name), then View menu and account */
  .appbar.owner-bar .brand-mark { flex: none; }
  .appbar.owner-bar .restaurant-switch .r-name { display: none; }
  .appbar.owner-bar .restaurant-switch { justify-content: flex-end; }
  .appbar .restaurant-switch { gap: 6px; }
  .appbar .restaurant-switch select { flex: 1 1 auto; width: 0; padding: 7px 8px; }
  .appbar .restaurant-switch .r-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto; }
  .appbar .restaurant-switch .status-pill { flex: none; }
  .appbar .restaurant-switch #view-live { padding: 6px 9px; }
  .appbar .account { flex: none; }
  .vl-long { display: none; }
  .vl-short { display: inline; }
  .tab-panel { padding: 16px 12px; }
  .item-row { grid-template-columns: 44px 1fr auto 22px; gap: 8px; padding: 10px 2px 10px 12px; }
  .item-row .grip { grid-column: 4; grid-row: 1 / span 2; }
  .thumb { width: 44px; height: 44px; }
  .item-row .switch { grid-column: 2 / 4; }
  .item-row .switch em { width: auto; }
  .subcat { margin: 0 8px 10px 14px; }
  .table-grid { grid-template-columns: 1fr; }
  .table-card { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .cat-head { padding: 12px; }
  /* phone: name on top; Dish, Sub-category, arrows, eye and bin all on one row below */
  .cat-head { column-gap: 4px; }
  .cat-head .cat-title { flex-basis: 100%; }
  .cat-head .cat-actions, .cat-head .cat-corner { display: contents; }
  .cat-head .pill-btn { order: 4; margin: 0; padding: 0 10px 0 6px; gap: 4px; height: 34px; }
  .cat-head .eye { margin-left: auto; }
  .cat-head .eye, .cat-head .bin, .cat-head .grip { order: 6; }
  .cat-head .icon { width: 26px; }
  .subcat .cat-head { padding: 10px 12px; }
}

.qr-big { display: block; width: min(320px, 100%); margin: 0 auto 12px; image-rendering: pixelated; }

/* Segmented choice (billing: how they pay) */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 7px; font: 500 14px var(--sans); color: var(--ink); cursor: pointer; min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }

/* Drag to reorder */
.grip { border: 0; background: none; padding: 6px 3px; margin: 0; border-radius: 6px; color: var(--muted); opacity: .5; cursor: grab; touch-action: none; display: inline-grid; place-items: center; -webkit-user-select: none; user-select: none; }
.grip:hover { opacity: 1; background: var(--bg); color: var(--ink); }
.grip:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 1px; }
.cat-corner .grip { margin-left: 2px; }
@media (hover: none) { .grip { opacity: .75; } }
.is-dragging, .is-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.dragging { box-shadow: 0 14px 34px rgba(16, 38, 28, .24); border-radius: 12px; opacity: .97; transition: none; }
.item-row.dragging { border: 1px solid var(--line); }
.drag-ph { box-sizing: border-box; list-style: none; border: 2px dashed color-mix(in srgb, var(--accent) 45%, #fff); border-radius: 12px; background: var(--accent-soft); }
li.drag-ph { margin: 4px 10px; }
.category > .drag-ph.subcat { margin: 14px 16px 14px 32px; }
#categories > .drag-ph { margin: 0 0 16px; }
.is-dragging .item-list.only-drop { min-height: 40px; }
.item-list:has(> .drag-ph) > .cat-empty { display: none; }
/* while dragging a category, fold every section to its header */
#categories.folding > .insert-cat { display: none; }
#categories.folding > .category > :not(.cat-head),
.category.folding > .subcat > :not(.cat-head) { display: none; }
#categories.folding > .category { margin-bottom: 10px; }
#categories.folding .cat-head, .category.folding > .subcat > .cat-head { border-bottom: 0; }

/* "Your dashboard" button on the Menu tab */
.insights-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.insights-btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.insights-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ib-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.ib-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ib-text strong { font-size: 15px; }
.ib-text span { font-size: 13px; color: var(--muted); }
.ib-go { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--accent); flex: none; }

/* Your dashboard */
.back-link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 0; margin-bottom: 6px; color: var(--accent); font: 600 14px var(--sans); cursor: pointer; }
.insights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ins-tiles { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ins-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ins-tile b { display: block; font: 600 30px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.ins-tile span { font-size: 13px; color: var(--muted); }
.ins-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ins-card.wide { grid-column: 1 / -1; }
.ins-card h3 { margin: 0; font: 600 16px var(--sans); }
.ins-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ins-sub { margin: -8px 0 0; font-size: 13px; color: var(--muted); }
.ins-empty { margin: 0; font-size: 13px; color: var(--muted); }
.seg.small button { padding: 4px 10px; font-size: 12px; min-height: 28px; }
/* horizontal bars (dishes, tables) */
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hbars li { display: grid; grid-template-columns: 20px minmax(0, 1fr) minmax(60px, 38%) 3ch; align-items: center; gap: 10px; font-size: 14px; }
.hbars .hb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbars .hb-track { height: 10px; border-radius: 999px; background: var(--accent-soft); }
.hbars .hb-track i { display: block; height: 100%; border-radius: 4px; background: var(--accent); min-width: 6px; }
.hbars .hb-n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
/* column charts (days, hours) */
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: 2px; height: 120px; padding-top: 18px; border-bottom: 1px solid var(--line); }
.cols .col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.cols .col i { display: block; width: min(70%, 28px); border-radius: 4px 4px 0 0; background: var(--accent); min-height: 2px; }
.cols .col.peak i { background: #0d2e21; }
.cols .col[data-tip]:hover::after, .cols .col[data-tip]:focus::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; z-index: 2; pointer-events: none; }
.cols .col:hover i { background: #0d2e21; }
.col-labels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin-top: 4px; font-size: 11px; color: var(--muted); text-align: center; }
.ins-note { margin: 0; font-size: 13px; color: var(--muted); }
.ins-note strong { color: var(--ink); }
/* menu summary */
.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.sum-grid div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.sum-grid b { display: block; font: 600 22px var(--serif); font-variant-numeric: tabular-nums; }
.sum-grid span { font-size: 12px; color: var(--muted); }
.nudges { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.nudges li { display: flex; gap: 8px; align-items: flex-start; }
.nudges .nd-icon { flex: none; width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.nudges .warn .nd-icon { background: #fbf0d9; color: #8a5a00; }
.nudges .good .nd-icon { background: var(--accent-soft); color: #2e7d32; }
.nudges small { display: block; color: var(--muted); font-size: 12px; }
/* prices table */
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 8px 6px 0; border-bottom: 1px solid var(--line); }
.price-table td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.price-table td:first-child { font-weight: 500; }
.price-table .num { text-align: right; white-space: nowrap; }
.price-table tfoot td { border-bottom: 0; font-weight: 600; }
@media (max-width: 720px) {
  .insights { grid-template-columns: minmax(0, 1fr); }
  .ins-tiles { gap: 8px; }
  .ins-tile { padding: 10px 12px; }
  .ins-tile b { font-size: 24px; }
  .price-table .hide-sm { display: none; }
}

/* Crop window */
.crop-modal { width: min(400px, calc(100vw - 24px)); }
.crop-modal .modal-body { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.crop-modal h2 { align-self: stretch; margin: 0; font-size: 20px; }
.crop-help { align-self: stretch; margin: -6px 0 0; }
.crop-stage { position: relative; border-radius: 12px; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; background: #e9efeb; max-width: 100%; }
.crop-stage:active { cursor: grabbing; }
.crop-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.crop-stage canvas { display: block; width: 100%; height: 100%; }
.crop-mask { position: absolute; left: 50%; top: 50%; width: var(--crop); height: var(--crop); transform: translate(-50%, -50%); box-shadow: 0 0 0 999px rgba(16, 38, 28, .55); border: 2px solid #fff; pointer-events: none; border-radius: 6px; }
.crop-modal[data-shape="circle"] .crop-mask { border-radius: 50%; }
.crop-zoom { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 320px; color: var(--muted); font-weight: 600; }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
.crop-logo-tools { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.crop-logo-tools[hidden] { display: none; }
.crop-logo-tools > p { margin: 0; text-align: center; }
.crop-bg { display: flex; align-items: center; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--sw); cursor: pointer; padding: 0; position: relative; display: inline-grid; place-items: center; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.swatch.custom { background: conic-gradient(#e53935, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935); overflow: hidden; }
.swatch.custom[aria-pressed="true"] { background: var(--sw); }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }

/* Menu colour (Restaurant details) */
.theme-select { display: flex; align-items: center; gap: 10px; }
.theme-select select { flex: 1; min-width: 0; }
.theme-swatch { width: 38px; height: 38px; border-radius: 10px; overflow: hidden; flex: none; border: 1px solid rgba(0,0,0,.1); background: linear-gradient(var(--main) 0 40%, var(--soft) 40% 100%); }

/* Tap-to-edit photo / logo */
.img-pick { position: relative; flex: none; }
.img-btn { padding: 0; cursor: pointer; position: relative; font: inherit; color: inherit; transition: box-shadow .15s, border-color .15s; overflow: visible !important; }
.logo-preview.img-btn > img { border-radius: 50%; }
.photo-preview.img-btn > img { border-radius: 11px; }
.img-btn:hover, .img-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.img-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.img-add { font: 300 34px var(--sans); color: var(--accent); line-height: 1; }
.img-btn .img-badge { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.img-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 38, 28, .18); padding: 6px; display: flex; flex-direction: column; }
.img-menu[hidden] { display: none; }
.img-mi { display: block; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 8px; font: 500 14px var(--sans); color: var(--ink); cursor: pointer; flex-direction: row; }
.img-mi:hover, .img-mi:focus-visible { background: var(--bg); outline: none; }
.img-mi.danger { color: var(--danger); }

/* Dish editor: photo top-left, name / price / category beside it */
.dish-top { display: flex; gap: 16px; align-items: flex-start; }
.dish-top .photo-edit { flex: none; }
.dish-top .photo-preview { width: 132px; height: 132px; }
.dish-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px 14px; }
.dish-fields .df-name { grid-column: 1 / -1; }
@media (max-width: 520px) {
  .dish-top .photo-preview { width: 96px; height: 96px; }
  .dish-fields { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
