:root {
    --ink: #1c1712;
    --muted: #6d645b;
    --paper: #f3eee6;
    --paper-deep: #e7dfd2;
    --card: #fffdf8;
    --line: #e4d9c8;
    --brand: #9d2c1c;
    --brand-dark: #7a2115;
    --accent: #1f6b4a;
    --ok: #e7f5ec;
    --warn: #fff3d8;
    --bad: #fde8e6;
    --shadow: 0 18px 50px rgba(48, 32, 16, .08);
    --font: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
    --display: "Fraunces", Georgia, serif;
    --radius: 18px;
    color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
}
body.sheet-open { overflow: hidden; }
img { max-width: 100%; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 560; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: clamp(2.1rem, 4vw, 4.4rem); margin: 0 0 .4em; }
h2 { font-size: 1.7rem; margin: 0 0 .4em; }
p { margin: 0 0 .8em; }

.btn, button, .side-foot button, .menu-admin button, .table-wrap button {
    border: 0;
    background: transparent;
    cursor: pointer;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 48px;
    padding: .7rem 1.1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 650;
}
.btn-brand { background: var(--brand); color: #fffaf6; }
.btn-brand:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.btn-line { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: #8e1b32; color: white; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }

.mark { width: 32px; height: 32px; color: var(--brand); display: block; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: inherit; text-decoration: none; font-weight: 700; }
.monogram, .logo {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    background: var(--brand); color: white; font-family: var(--display); font-size: 1.3rem;
}
.logo { object-fit: cover; }
.eyebrow { letter-spacing: .16em; text-transform: uppercase; font-size: .75rem; font-weight: 700; color: var(--brand); margin: 0 0 .6rem; }
.hint, .meta, small { color: var(--muted); }
.hint { font-size: .92rem; }
.banner, .form-error, .note-box {
    background: var(--warn);
    border-radius: 14px;
    padding: .85rem 1rem;
}
.form-error { background: var(--bad); }
.note-box { background: #fff6d8; font-weight: 650; }
.empty { color: var(--muted); padding: 1rem 0; }
.toasts { position: sticky; top: 0; z-index: 20; display: grid; gap: .4rem; padding: .6rem; }
.toast { margin: 0; padding: .75rem 1rem; border-radius: 12px; background: var(--ok); }
.toast-error { background: var(--bad); }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.landing { background: #17130f; color: #f6f0e6; min-height: 100vh; }
.landing a { color: inherit; }
.land-nav, .land-hero, .land-section, .land-foot { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.land-nav { display: flex; justify-content: space-between; align-items: center; padding: 22px 0; }
.land-nav nav { display: flex; gap: .8rem; align-items: center; }
.landing .mark { color: #e25a3c; }
.land-hero { padding: 4.5rem 0 3rem; }
.land-hero .lede { max-width: 40rem; font-size: 1.2rem; color: #e6dccf; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.4rem 0; }
.landing .btn-ghost { border-color: #8c8174; }
.facts { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; list-style: none; }
.facts li { border: 1px solid #3a322b; border-radius: 999px; padding: .35rem .75rem; color: #d9cec1; font-size: .92rem; }
.land-section { padding: 1rem 0 3rem; }
.feature-grid, .resto-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature-grid article, .resto-card {
    background: #221c17; border-radius: var(--radius); padding: 1.1rem 1.15rem; text-decoration: none;
}
.resto-card { display: flex; gap: .8rem; align-items: center; }
.resto-card small, .feature-grid p { color: #cbbdad; display: block; }
.swatch { width: 14px; height: 42px; border-radius: 99px; display: block; }
.land-foot { padding: 1rem 0 2.5rem; color: #b3a79a; }

.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-copy { padding: clamp(1.5rem, 4vw, 4rem); background: #17130f; color: #f6f0e6; }
.auth-copy .brand { color: #f6f0e6; }
.auth-copy .mark { color: #e25a3c; }
.demo-accounts { display: grid; gap: .7rem; margin-top: 2rem; }
.demo-accounts div { display: grid; }
.demo-accounts dt { color: #b3a79a; font-size: .8rem; }
.demo-accounts dd { margin: 0; font-weight: 650; }
.auth-card { display: grid; align-content: center; padding: clamp(1.5rem, 4vw, 4rem); }
.auth-card h2 { font-size: 2rem; }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .92rem; }
input, select, textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    background: white;
    border-radius: 12px;
    padding: .7rem .8rem;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.check input { width: auto; min-height: 0; }
.stack { display: grid; gap: .9rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }

.narrow-page { width: min(680px, calc(100% - 32px)); margin: 0 auto; padding: 3rem 0 4rem; }
.pay-amount { font-family: var(--display); font-size: 3rem; margin: .2rem 0; }
.pay-actions { display: grid; gap: .6rem; margin-top: 1rem; }

.store { width: min(980px, calc(100% - 28px)); margin: 0 auto; padding-bottom: 7rem; }
.store-bar {
    position: sticky; top: 0; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; gap: .8rem;
    background: rgba(243, 238, 230, .92); backdrop-filter: blur(10px);
    padding: .8rem 0;
}
.open-pill {
    display: inline-flex; gap: .4rem; align-items: baseline;
    background: var(--ok); color: var(--accent); border-radius: 999px; padding: .35rem .75rem; margin: 0;
}
.open-pill.is-closed { background: var(--bad); color: #8e1b32; }
.store-hero { display: grid; grid-template-columns: 1.4fr .8fr; gap: 1.5rem; padding: 1.2rem 0 1rem; }
.hours { background: var(--card); border-radius: var(--radius); padding: .8rem 1rem; border: 1px solid var(--line); }
.hours summary { cursor: pointer; font-weight: 700; }
.hours ul { list-style: none; padding: 0; margin: .7rem 0 0; }
.hours li, .ticket-line, .summary li, .menu-admin li {
    display: flex; justify-content: space-between; gap: 1rem; padding: .28rem 0;
}
.hours li.is-today { font-weight: 750; }
.chips { position: sticky; top: 68px; z-index: 4; display: flex; gap: .45rem; overflow: auto; padding: .4rem 0 .8rem; background: linear-gradient(var(--paper), var(--paper) 70%, transparent); }
.chips a { text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .8rem; white-space: nowrap; }
.chips a.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.menu-section { padding: .4rem 0 1.2rem; }
.menu-section header p { color: var(--muted); }
.dish { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.dish h3 { margin: 0 0 .2rem; font-size: 1.35rem; }
.dish p { color: var(--muted); margin: 0; }
.dish-buy { display: grid; justify-items: end; align-content: start; gap: .45rem; min-width: 7.5rem; }
.price { font-variant-numeric: tabular-nums; font-weight: 700; }
.add {
    min-width: 76px; min-height: 42px; border-radius: 999px; background: var(--brand); color: white; font-weight: 700;
}
.vat-note { font-size: .8rem; }
.store-foot { color: var(--muted); font-size: .92rem; padding-top: 1rem; }
.cart-bar {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
    width: min(520px, calc(100% - 24px));
    display: flex; justify-content: space-between; align-items: center;
    background: var(--ink); color: #f6f0e6; border-radius: 999px; padding: .85rem 1.1rem;
    box-shadow: var(--shadow); z-index: 6; font-weight: 700;
}
.sheet-back { position: fixed; inset: 0; background: rgba(28, 23, 18, .46); z-index: 30; }
.sheet {
    position: fixed; z-index: 31; background: var(--card); color: var(--ink);
    left: 50%; bottom: 0; transform: translateX(-50%);
    width: min(560px, 100%); max-height: min(92vh, 860px); overflow: auto;
    border-radius: 22px 22px 0 0; padding: 1rem 1rem 1.3rem;
    box-shadow: var(--shadow);
}
.sheet-head, .sheet-actions, .cart-sum { display: flex; justify-content: space-between; gap: .8rem; align-items: center; }
.sheet h2 { font-size: 1.8rem; margin: 0; }
.sheet fieldset { border: 0; padding: 0; margin: 0 0 .8rem; }
.sheet legend { font-weight: 750; padding: 0; }
.choice { display: flex; gap: .7rem; align-items: flex-start; background: var(--paper); border-radius: 14px; padding: .75rem .8rem; margin: .4rem 0; }
.choice input { width: auto; min-height: 0; margin-top: .25rem; }
.choice span { display: grid; }
.choice small { font-weight: 500; }
.icon-x { width: 42px; height: 42px; border-radius: 50%; background: var(--paper); font-size: 1.4rem; }
.stepper { display: inline-flex; align-items: center; gap: .3rem; background: var(--paper); border-radius: 999px; padding: .2rem; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; background: white; }
.cart-lines { list-style: none; padding: 0; margin: 0 0 1rem; }
.cart-lines li { display: flex; justify-content: space-between; gap: .8rem; padding: .8rem 0; border-top: 1px solid var(--line); }
.cart-lines small, .summary small, .lines span { display: block; color: var(--muted); font-weight: 500; }
.line-tools { display: grid; justify-items: end; gap: .35rem; }
.cart-sum { font-size: 1.15rem; }

.checkout, .confirm { width: min(1080px, calc(100% - 28px)); margin: 0 auto; padding: 1.4rem 0 3rem; }
.back { color: var(--muted); text-decoration: none; font-weight: 650; }
.checkout-grid, .split-panels { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1.2rem; align-items: start; }
fieldset { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: .9rem 1rem 1rem; margin: 0 0 .9rem; }
legend { font-family: var(--display); font-size: 1.25rem; padding: 0 .3rem; }
.summary { position: sticky; top: 12px; background: var(--card); border-radius: var(--radius); padding: 1rem; border: 1px solid var(--line); }
.summary ul, .lines, .events, .menu-admin, .mail-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.summary li { align-items: start; }
.summary dl, .confirm dl { margin: 0; }
.summary dl div, .confirm dl div { display: flex; justify-content: space-between; padding: .25rem 0; }
.total { font-size: 1.2rem; font-weight: 750; }
.order-code { font-family: var(--display); font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: .08em; margin: .2rem 0; }
.status-line { font-size: 1.25rem; font-weight: 700; }
.timeline { list-style: none; padding: 0; display: grid; gap: .45rem; }
.timeline li { padding: .55rem .8rem; border-radius: 12px; background: white; color: var(--muted); }
.timeline .is-current { background: var(--ink); color: white; }
.timeline .is-done { background: var(--ok); color: var(--accent); }
.plain { margin-top: 1rem; }

.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: #17130f; color: #f3ece3; padding: 1rem .8rem; display: flex; flex-direction: column; gap: 1rem; }
.side-brand { display: flex; gap: .7rem; align-items: center; color: inherit; text-decoration: none; }
.side-brand strong, .side-brand small { display: block; }
.side-brand small { color: #cbbdad; font-weight: 500; }
.sidebar .mark { color: #e25a3c; }
.side-nav { display: grid; gap: .15rem; }
.side-nav a { color: #f3ece3; text-decoration: none; padding: .55rem .7rem; border-radius: 10px; }
.side-nav a.is-active, .side-nav a:hover { background: #2a241e; }
.side-foot { margin-top: auto; display: grid; gap: .4rem; }
.side-foot a, .side-foot button { color: #cbbdad; text-align: left; padding: .4rem .7rem; }
.panel-main { padding: 1.3rem 1.3rem 3rem; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.page-head h1 { font-size: clamp(2rem, 3vw, 3rem); }
.impersonate { display: flex; justify-content: space-between; gap: 1rem; align-items: center; background: #fff3d8; border-radius: 14px; padding: .7rem .9rem; margin-bottom: 1rem; }
.impersonate p { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 1rem 0; }
.stat-grid article, .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.stat-grid span, .stat-grid small { color: var(--muted); display: block; }
.stat-grid strong { font-family: var(--display); font-size: 1.8rem; }
.card { margin: 1rem 0; }
.table-wrap { overflow: auto; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
td small { display: block; }
.inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.inline-form label { flex: 1 1 140px; }
.hour-row { display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: .6rem; align-items: end; }
.group-block { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .8rem; }
.logo-preview { width: 84px; height: 84px; object-fit: cover; border-radius: 16px; }
.bars { display: flex; align-items: end; gap: .7rem; min-height: 150px; }
.bars > div { flex: 1; display: grid; justify-items: center; gap: .25rem; }
.bar { width: 100%; max-width: 42px; background: var(--brand); border-radius: 8px 8px 3px 3px; }
textarea[readonly] { background: var(--paper); }

.is-kitchen { background: #12100e; }
.is-kitchen .sidebar { display: none; }
.is-kitchen .shell { display: block; }
.is-kitchen .panel-main { padding: 0; }
.kitchen { color: #f6f0e6; min-height: 100vh; padding: 1rem; }
.kitchen-bar { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center; justify-content: space-between; }
.kitchen h1 { font-size: 2rem; color: white; }
.kitchen .eyebrow { color: #e7b2a6; }
.clock { font-family: var(--display); font-size: 2rem; margin: 0; }
.live { margin: 0; color: #b3a79a; }
.k-board-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 1rem; }
.k-board-grid h2 { font-size: 1.15rem; display: flex; justify-content: space-between; }
.k-board-grid h2 span { color: #b3a79a; }
.ticket { background: #fffdf8; color: var(--ink); border-radius: 16px; padding: .9rem; margin-bottom: .7rem; }
.ticket header { display: flex; justify-content: space-between; gap: .8rem; align-items: flex-start; }
.ticket header > div:last-child { text-align: right; }
.ticket header strong, .ticket header > div:last-child span { display: block; }
.ticket header > div:last-child span { color: var(--muted); font-size: .85rem; }
.ticket .code { font-family: var(--display); font-size: 1.6rem; margin: 0; letter-spacing: .04em; }
.ticket ul { list-style: none; padding: 0; margin: .5rem 0; }
.ticket li { padding: .25rem 0; }
.ticket li span { display: block; color: var(--muted); }
.ticket.is-new { box-shadow: inset 6px 0 0 var(--brand); }
.eta { display: grid; gap: .2rem; margin: .4rem 0; font-size: .85rem; }
.eta-label { font-weight: 750; color: var(--accent); }
.who a { color: inherit; text-decoration: none; font-weight: 700; }
#sound-toggle.is-on { background: var(--accent); color: white; border-color: transparent; }

.ticket-print { width: min(360px, 100%); margin: 1rem auto; font-family: "Courier New", ui-monospace, monospace; }
.ticket-print h1 { font-family: inherit; font-size: 1.3rem; text-align: center; }
.ticket-print p { margin: .25rem 0; }
.ticket-sub { padding-left: .6rem; }
.page-print { background: white; }

@media (max-width: 980px) {
    .feature-grid, .resto-list, .stat-grid, .k-board-grid { grid-template-columns: 1fr 1fr; }
    .auth, .store-hero, .checkout-grid, .split-panels, .shell { grid-template-columns: 1fr; }
    .summary { position: static; }
    .sidebar { position: sticky; top: 0; z-index: 8; }
    .side-nav { display: flex; overflow: auto; }
    .side-nav a { white-space: nowrap; }
    .side-foot { display: flex; gap: .4rem; }
}
@media (max-width: 640px) {
    .feature-grid, .resto-list, .stat-grid, .k-board-grid, .split, .hour-row { grid-template-columns: 1fr; }
    .store-bar { flex-wrap: wrap; }
    .dish { display: grid; }
    .dish-buy { justify-items: start; grid-auto-flow: column; align-items: center; }
    .page-head, .impersonate { display: grid; }
}
@media (min-width: 800px) {
    .sheet { top: 8vh; bottom: auto; border-radius: 22px; max-height: 84vh; }
}
@media print {
    .page-print button, .sidebar, .toasts { display: none !important; }
    body { background: white; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .ticket.is-new { animation: none; }
}
