:root {
    color-scheme: light;
    --ink: #20251f;
    --muted: #727a70;
    --paper: #f7f3eb;
    --white: #fffefa;
    --line: #dedfd5;
    --leaf: #dce8d8;
    --leaf-strong: #a8c4a2;
    --accent-color: #b84f36;
    --danger: #a63d34;
    --sans: "Avenir Next", "Segoe UI", sans-serif;
    --display: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); font-family: var(--sans); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.menu-page {
    min-height: 100vh;
    background: var(--paper);
    background-image: radial-gradient(#bfc8b2 0.65px, transparent 0.65px);
    background-size: 17px 17px;
}
.menu-header, .menu-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1160px;
    margin: 0 auto;
    padding: 22px 34px;
}
.wordmark { color: var(--ink); text-decoration: none; font-size: 23px; font-weight: 700; letter-spacing: 0; }
.wordmark span { color: var(--accent-color); }
.header-note { color: var(--muted); font-size: 12px; }
.menu-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 300px;
    overflow: hidden;
    padding: 55px max(7vw, calc((100vw - 1092px) / 2));
    background: var(--leaf);
}
.menu-hero::after {
    position: absolute;
    right: -30px;
    bottom: -140px;
    width: 430px;
    height: 280px;
    border: 1px solid rgb(32 37 31 / 13%);
    border-radius: 50%;
    content: "";
    transform: rotate(-24deg);
}
.hero-copy { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 12px; color: var(--accent-color); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.menu-hero h1, .setup-wrap h1, .admin-heading h1 {
    margin: 0;
    font-family: var(--display);
    font-size: 48px;
    font-weight: 600;
    line-height: 1.1;
}
.hero-tagline { margin: 14px 0 0; color: #51594e; font-size: 15px; }
.hero-stamp {
    position: relative;
    z-index: 1;
    display: flex;
    width: 138px;
    height: 138px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(32 37 31 / 42%);
    border-radius: 50%;
    color: var(--ink);
    transform: rotate(9deg);
}
.hero-stamp span { font-size: 8px; font-weight: 700; letter-spacing: 1px; }
.hero-stamp strong { margin: 3px 0; font-family: var(--display); font-size: 22px; }
.hero-stamp i { position: absolute; right: 9px; bottom: 20px; color: var(--accent-color); font-size: 17px; font-style: normal; }
.category-nav {
    position: sticky;
    z-index: 3;
    top: 0;
    display: flex;
    max-width: 1160px;
    align-items: center;
    gap: 25px;
    margin: 0 auto;
    padding: 17px 34px;
    border-bottom: 1px solid var(--line);
    background: rgb(247 243 235 / 95%);
    backdrop-filter: blur(10px);
}
.category-nav > a { color: #535b51; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.category-nav > a:hover { color: var(--accent-color); }
.menu-search { display: flex; min-width: 150px; align-items: center; gap: 7px; margin-left: auto; color: var(--muted); }
.menu-search span { font-size: 20px; }
.menu-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.menu-content { max-width: 920px; margin: 0 auto; padding: 18px 34px 85px; }
.menu-category { padding-top: 31px; scroll-margin-top: 65px; }
.category-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 10px; }
.category-number { color: var(--accent-color); font-size: 10px; font-weight: 700; }
.category-heading h2 { margin: 0; font-family: var(--display); font-size: 25px; font-weight: 600; }
.category-rule { height: 1px; flex: 1; margin-left: 5px; background: var(--line); }
.menu-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 36px; }
.menu-item {
    display: flex;
    min-height: 132px;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid var(--line);
    animation: item-in 420ms both;
}
.menu-item:nth-child(2n) { animation-delay: 70ms; }
.item-copy { min-width: 0; padding: 16px 0; }
.item-copy h3 { margin: 0; font-size: 14px; font-weight: 700; }
.item-copy p { max-width: 290px; margin: 6px 0 8px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.item-price { display: inline-block; margin-top: 9px; color: var(--accent-color); font-size: 12px; }
.item-price span { font-size: 10px; }
.item-image { width: 82px; height: 82px; flex: 0 0 82px; border-radius: 4px; background: var(--leaf); object-fit: cover; }
.item-spark { display: grid; width: 60px; height: 60px; flex: 0 0 60px; place-items: center; border-radius: 50%; background: var(--leaf); color: var(--accent-color); font-size: 22px; }
.menu-empty { padding: 90px 20px; text-align: center; }
.menu-empty h2 { margin: 15px 0 7px; font-family: var(--display); font-size: 28px; }
.menu-empty p { color: var(--muted); font-size: 13px; }
.empty-mark { color: var(--accent-color); font-size: 24px; }
.no-results { padding: 35px 0; color: var(--muted); text-align: center; }
.menu-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.menu-footer b { color: var(--accent-color); }

.admin-page { min-height: 100vh; background: #f3f5f0; color: var(--ink); font-size: 13px; }
.setup-wrap { width: min(100% - 40px, 470px); margin: 0 auto; padding: 50px 0 70px; }
.setup-wrap .wordmark { display: inline-block; margin-bottom: 62px; }
.setup-wrap h1 { margin-bottom: 12px; font-size: 38px; }
.muted { color: var(--muted); line-height: 1.65; }
.form-stack { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 7px; color: #454d44; font-size: 11px; font-weight: 600; }
input, textarea, select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d5d9d0;
    border-radius: 3px;
    outline: none;
    background: var(--white);
    color: var(--ink);
    font-size: 13px;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #80997a; box-shadow: 0 0 0 3px rgb(168 196 162 / 23%); }
.button { display: inline-flex; min-height: 41px; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid transparent; border-radius: 3px; cursor: pointer; font-size: 12px; font-weight: 700; text-decoration: none; transition: transform 160ms, background 160ms; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--ink); color: #fffefa; }
.button-primary:hover { background: #394137; }
.button-secondary { background: var(--leaf); color: var(--ink); }
.button-quiet { min-height: 34px; background: transparent; color: var(--muted); }
.button-qr { border-color: var(--ink); background: transparent; color: var(--ink); }
.notice { margin: 20px 0; padding: 12px 14px; border-left: 3px solid #66805e; background: #e5eee1; color: #34462e; line-height: 1.5; }
.notice-error { border-color: var(--danger); background: #f8e8e4; color: #7d302a; }
.admin-topbar { display: flex; min-height: 68px; align-items: center; justify-content: space-between; padding: 0 max(28px, calc((100vw - 1120px) / 2)); border-bottom: 1px solid #e0e4db; background: var(--white); }
.admin-topbar .wordmark { font-size: 20px; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.topbar-actions form { margin: 0; }
.text-link { color: #455443; font-size: 11px; font-weight: 600; text-decoration: none; }
.admin-shell { width: min(100% - 56px, 1080px); margin: 0 auto; padding: 47px 0 90px; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 34px; }
.admin-heading h1 { font-size: 34px; }
.admin-section { padding: 28px 0 34px; border-top: 1px solid #dce0d7; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 19px; }
.section-title .eyebrow { margin-bottom: 6px; }
.section-title h2, .qr-dialog h2 { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 600; }
.count { display: inline-grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: #e1e8dd; font-family: var(--sans); font-size: 10px; vertical-align: 4px; }
.settings-grid { display: grid; grid-template-columns: 1.1fr 1fr 120px auto; align-items: end; gap: 13px; }
.color-field input { min-height: 42px; padding: 5px; }
.category-manager { display: grid; grid-template-columns: minmax(270px, .9fr) 1.1fr; align-items: start; gap: 30px; }
.inline-form { display: flex; gap: 9px; }
.inline-form input { min-width: 0; }
.category-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.category-list li { display: flex; min-height: 37px; align-items: center; gap: 8px; padding: 0 5px 0 12px; border: 1px solid #d9ded4; border-radius: 3px; background: var(--white); font-size: 11px; }
.category-list form { margin: 0; }
.icon-button { display: grid; width: 29px; height: 29px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; }
.icon-button:hover { background: #f0e3de; color: var(--danger); }
.product-form { display: grid; grid-template-columns: 1.1fr 1fr .65fr; align-items: end; gap: 13px; padding: 19px; border: 1px solid #dfe3da; background: var(--white); }
.product-form input[type="file"] { padding: 7px; font-size: 11px; }
.admin-image-preview { grid-column: span 2; width: 120px; height: 90px; border-radius: 3px; object-fit: cover; }
.field-wide { grid-column: span 2; }
.optional { color: #8c9389; font-weight: 400; }
.check-field { display: flex; min-height: 42px; align-items: center; gap: 8px; }
.check-field input { width: 16px; min-height: 16px; height: 16px; accent-color: #627b59; }
.product-list { margin-top: 18px; }
.product-edit { border-bottom: 1px solid #dce0d7; }
.product-edit:first-child { border-top: 1px solid #dce0d7; }
.product-edit summary { display: flex; min-height: 64px; align-items: center; gap: 20px; cursor: pointer; list-style: none; }
.product-edit summary::-webkit-details-marker { display: none; }
.product-summary-name { flex: 1; font-size: 13px; font-weight: 700; }
.product-summary-name small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 500; }
.availability { color: var(--muted); font-size: 10px; }
.availability.is-available { color: #557348; }
.edit-label { min-width: 57px; color: #65705f; font-size: 10px; text-align: right; }
.product-edit[open] .edit-label { color: var(--accent-color); }
.product-edit-body { padding: 0 0 20px; }
.product-edit-body .product-form { border: 0; background: transparent; padding: 5px 0 15px; }
.form-actions { display: flex; align-items: end; }
.delete-form { display: flex; justify-content: end; margin: 0; }
.text-danger { padding: 7px 0; border: 0; background: none; color: var(--danger); cursor: pointer; font-size: 11px; }
.empty-state { display: flex; align-items: center; gap: 12px; padding: 24px 5px; color: var(--muted); }
.empty-state p { margin: 0; }
.empty-state .empty-mark { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #c8d2c2; border-radius: 50%; font-size: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.qr-dialog { width: min(100% - 36px, 370px); padding: 32px; border: 1px solid var(--line); border-radius: 4px; background: var(--white); color: var(--ink); text-align: center; }
.qr-dialog::backdrop { background: rgb(24 30 23 / 54%); backdrop-filter: blur(2px); }
.qr-dialog .eyebrow { margin-top: 8px; }
.qr-dialog h2 { margin-bottom: 18px; }
.qr-dialog canvas { display: block; width: 220px; height: 220px; margin: 0 auto 14px; padding: 9px; background: white; }
.qr-dialog .muted { font-size: 11px; }
.dialog-close { position: absolute; top: 12px; right: 12px; font-size: 22px; }

@keyframes item-in {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
    .menu-header, .menu-footer { padding-right: 20px; padding-left: 20px; }
    .menu-hero { min-height: 255px; padding: 42px 24px; }
    .menu-hero h1 { max-width: 70%; font-size: 38px; }
    .hero-stamp { width: 100px; height: 100px; margin-left: 8px; }
    .hero-stamp span { font-size: 6px; }
    .hero-stamp strong { font-size: 17px; }
    .hero-stamp i { right: 5px; bottom: 12px; font-size: 13px; }
    .category-nav { gap: 17px; overflow-x: auto; padding: 14px 20px; }
    .category-nav > a { font-size: 11px; }
    .menu-search { min-width: 115px; }
    .menu-content { padding: 8px 20px 55px; }
    .menu-items { grid-template-columns: 1fr; }
    .menu-item { min-height: 112px; }
    .item-image { width: 72px; height: 72px; flex-basis: 72px; }
    .item-spark { width: 50px; height: 50px; flex-basis: 50px; }
    .admin-shell { width: min(100% - 36px, 600px); padding-top: 34px; }
    .admin-topbar { padding: 0 18px; }
    .topbar-actions { gap: 8px; }
    .text-link { max-width: 90px; text-align: right; }
    .settings-grid { grid-template-columns: 1fr 1fr; }
    .settings-grid label:first-of-type { grid-column: span 2; }
    .category-manager { grid-template-columns: 1fr; gap: 17px; }
    .product-form { grid-template-columns: 1fr 1fr; padding: 14px; }
    .product-form label:first-of-type { grid-column: span 2; }
    .field-wide { grid-column: span 2; }
    .form-actions { grid-column: span 2; }
    .product-edit summary { gap: 10px; }
    .availability { display: none; }
}

@media (max-width: 430px) {
    .header-note { max-width: 140px; font-size: 10px; text-align: right; }
    .menu-hero { min-height: 230px; }
    .menu-hero h1 { max-width: 63%; font-size: 34px; }
    .hero-tagline { max-width: 200px; font-size: 13px; }
    .hero-stamp { width: 83px; height: 83px; }
    .category-nav { gap: 15px; }
    .category-nav > a { font-size: 10px; }
    .menu-search { min-width: 95px; }
    .menu-search input { font-size: 10px; }
    .admin-heading { align-items: start; gap: 12px; }
    .admin-heading h1 { max-width: 220px; font-size: 28px; }
    .button-qr { padding: 0 10px; font-size: 10px; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-grid label:first-of-type { grid-column: auto; }
    .settings-grid .button { justify-self: start; }
    .inline-form { align-items: stretch; }
    .inline-form .button { padding: 0 10px; white-space: nowrap; }
    .product-form { grid-template-columns: 1fr; }
    .product-form label:first-of-type, .field-wide, .form-actions { grid-column: auto; }
    .product-edit-body .product-form { grid-template-columns: 1fr; }
    .product-edit-body .product-form label:first-of-type, .product-edit-body .field-wide, .product-edit-body .form-actions { grid-column: auto; }
    .product-edit summary { min-height: 60px; }
    .edit-label { min-width: 45px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}