:root {
  color-scheme: light;
  --bg-primary: #E6D9C8;
  --bg-secondary: #F6EEE4;
  --bg-card: #fffaf3;
  --bg-card-strong: #fffdf8;
  --bg-elevated: #fff8ef;
  --bg-overlay: rgba(255, 250, 243, .78);
  --bg-input: #fffdf8;
  --bg-hover: #fff5e8;
  --bg-soft: rgba(63, 42, 30, .06);
  --text-primary: #2C2119;
  --text-secondary: #6C5848;
  --text-muted: #8A7462;
  --accent: #3F2A1E;
  --accent-hover: #2C2119;
  --accent-pressed: #6F472C;
  --accent-ink: #fffaf3;
  --border: #C9B8A2;
  --border-soft: #D9C9B5;
  --border-accent: rgba(63, 42, 30, .46);
  --success: #63784B;
  --warning: #B48637;
  --danger: #8F3F2C;
  --danger-soft: rgba(143, 63, 44, .14);
  --glow-accent: 0 0 0 1px rgba(63, 42, 30, .1), 0 14px 38px rgba(63, 42, 30, .12);
  --focus-ring: rgba(180, 134, 55, .24);
  --shadow: 0 14px 38px rgba(63, 42, 30, .11);
  --shadow-strong: 0 22px 58px rgba(63, 42, 30, .18);
  --media-bg: #F0E4D4;
  --placeholder-bg: linear-gradient(135deg, #fff3e2 0%, #f3dfd0 52%, #ead8c4 100%);
  --placeholder-glow: radial-gradient(circle at 28% 24%, rgba(255, 253, 248, .9), transparent 24%);
  --topbar-bg: rgba(255, 250, 243, .94);
  --topbar-shadow: 0 8px 30px rgba(63, 42, 30, .09);
  --surface-translucent: rgba(255, 250, 243, .86);
  --section-link-bg: rgba(255, 250, 243, .82);
  --banner-bg: #fff3e4;
  --banner-text: var(--danger);
  --logo-dark-bg: #3F2A1E;
  --logo-dark-border: rgba(255, 255, 255, .12);
  --on-dark-primary: #FFFFFF;
  --on-dark-secondary: rgba(255, 255, 255, .82);
  --gallery-control-bg: rgba(37, 33, 29, .58);
  --gallery-control-border: rgba(255, 255, 255, .75);
  --gallery-control-text: #FFFFFF;
  --drop-overlay-bg: rgba(255, 248, 239, .9);
  --menu-photo-manager-bg: linear-gradient(180deg, rgba(246, 238, 228, .8), rgba(255, 250, 243, .96));

  --bg: var(--bg-primary);
  --panel: var(--bg-card);
  --panel-strong: var(--bg-card-strong);
  --cream: var(--bg-card-strong);
  --line: var(--border);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --navy: var(--border-soft);
  --navy-soft: var(--bg-hover);
  --navy-action: var(--accent);
  --gold: var(--accent);
  --gold-hover: var(--accent-hover);
  --blush: #B88A78;
  --terracotta: var(--danger);
  --accent-2: var(--accent-hover);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #1C140F;
  --bg-secondary: #221A14;
  --bg-card: #2A211A;
  --bg-card-strong: #31271F;
  --bg-elevated: #382D24;
  --bg-overlay: rgba(28, 20, 15, .78);
  --bg-input: #241B15;
  --bg-hover: #3A2D23;
  --bg-soft: rgba(230, 217, 200, .08);
  --text-primary: #F5EDE4;
  --text-secondary: #C4B8A9;
  --text-muted: #9E8D7C;
  --accent: #E6D9C8;
  --accent-hover: #F5EDE4;
  --accent-pressed: #D2BEA7;
  --accent-ink: #1C140F;
  --border: #4A3729;
  --border-soft: #3F2A1E;
  --border-accent: rgba(230, 217, 200, .56);
  --success: #9BB37B;
  --warning: #C89A54;
  --danger: #D47C62;
  --danger-soft: rgba(212, 124, 98, .16);
  --glow-accent: 0 0 0 1px rgba(230, 217, 200, .16), 0 16px 42px rgba(230, 217, 200, .08);
  --focus-ring: rgba(230, 217, 200, .26);
  --shadow: 0 16px 42px rgba(0, 0, 0, .34);
  --shadow-strong: 0 24px 70px rgba(0, 0, 0, .46);
  --media-bg: #221A14;
  --placeholder-bg: linear-gradient(135deg, #31271F 0%, #2A211A 54%, #1C140F 100%);
  --placeholder-glow: radial-gradient(circle at 28% 24%, rgba(230, 217, 200, .18), transparent 28%);
  --topbar-bg: rgba(42, 33, 26, .94);
  --topbar-shadow: 0 10px 34px rgba(0, 0, 0, .34);
  --surface-translucent: rgba(42, 33, 26, .86);
  --section-link-bg: rgba(42, 33, 26, .82);
  --banner-bg: rgba(200, 154, 84, .14);
  --banner-text: var(--accent-hover);
  --logo-dark-bg: #1C140F;
  --logo-dark-border: rgba(230, 217, 200, .16);
  --on-dark-primary: var(--text-primary);
  --on-dark-secondary: var(--text-secondary);
  --gallery-control-bg: rgba(28, 20, 15, .72);
  --gallery-control-border: rgba(230, 217, 200, .48);
  --gallery-control-text: var(--text-primary);
  --drop-overlay-bg: rgba(28, 20, 15, .84);
  --menu-photo-manager-bg: linear-gradient(180deg, rgba(49, 39, 31, .92), rgba(42, 33, 26, .98));
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
input,
select,
textarea,
button {
  accent-color: var(--accent);
}

.topbar {
  --brand-logo-height: 56px;
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  box-shadow: var(--topbar-shadow);
}
.topbar[data-logo-surface="dark"] {
  border-bottom-color: var(--logo-dark-border);
  background: var(--logo-dark-bg);
  box-shadow: var(--shadow);
}
.topbar[data-logo-surface="dark"] p {
  color: var(--on-dark-secondary);
}
.topbar[data-logo-surface="dark"] h1 {
  color: var(--on-dark-primary);
}
.topbar[data-logo-surface="dark"] .primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.topbar[data-logo-surface="dark"] .primary:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--accent-ink);
}
.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.theme-toggle-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: inset -5px -3px 0 var(--panel);
}
html[data-theme="dark"] .theme-toggle-icon {
  box-shadow: 0 0 14px rgba(230, 217, 200, .28);
}
.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}
.brand-logo-link {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  height: var(--brand-logo-height);
  max-width: min(58vw, 430px);
}
.brand-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.brand-copy p {
  max-width: 32ch;
  font-size: 13px;
}
.visually-hidden-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.site-banner {
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--banner-bg);
  color: var(--banner-text);
  font-weight: 600;
}

h1, h2, h3, p { margin: 0; letter-spacing: 0; }
h1, h2 { font-family: "Playfair Display", Georgia, serif; }
h1 { font-size: 28px; line-height: 1.05; }
h2 { font-size: 24px; margin: 0 0 12px; }
h3 { font-size: 16px; line-height: 1.25; }
p { color: var(--muted); }

button, input, select, textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease, transform .18s ease;
}

button:disabled { opacity: .45; cursor: not-allowed; }
button:hover:not(:disabled) {
  border-color: var(--border-accent);
  background: var(--bg-hover);
  box-shadow: var(--glow-accent);
}
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}
.ghost { background: transparent; }

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 16px;
}
.site-info {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: center;
  margin: 0 16px 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-translucent);
  box-shadow: var(--shadow);
}
.site-info h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 20px;
}
.site-footer {
  overflow: hidden;
}
.footer-brand {
  display: flex;
  min-width: 0;
  gap: 12px;
  align-items: center;
}
.footer-logo-wrap {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: min(230px, 42vw);
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}
.site-footer[data-logo-surface="dark"] .footer-logo-wrap {
  border-color: var(--logo-dark-border);
  background: var(--accent);
}
.footer-logo {
  display: block;
  width: 100%;
  max-height: 58px;
  object-fit: contain;
}
.footer-copy {
  min-width: 0;
}
.footer-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.site-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.site-links a {
  font-weight: 700;
  color: var(--accent);
}

.sections {
  position: sticky;
  top: 82px;
  align-self: start;
  display: grid;
  gap: 8px;
}

.section-link {
  text-align: left;
  background: var(--section-link-bg);
  box-shadow: var(--shadow);
}

.menu {
  display: grid;
  gap: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.item, .order-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.item:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-strong);
  transform: translateY(-1px);
}
.item.is-highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(230, 217, 200, .18), var(--shadow-strong);
  scroll-margin: 120px;
}

.item[data-status="missing"], .item[data-status="variant_needs_label"] { border-color: var(--danger); }
.item[data-status="review"] { border-color: var(--warning); }

.media {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 5 / 4;
  border-radius: 8px 8px 0 0;
  background: var(--media-bg);
  color: var(--muted);
  overflow: hidden;
}

.media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus-x, 50%) var(--focus-y, 50%);
  transition: transform .28s ease;
}

.item:hover .media img {
  transform: scale(1.05);
}

.gallery-nav {
  position: absolute;
  top: auto;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-color: var(--gallery-control-border);
  border-radius: 8px;
  background: var(--gallery-control-bg);
  color: var(--gallery-control-text);
  transform: none;
}
.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }
.gallery-count {
  position: absolute;
  left: 50%;
  bottom: 13px;
  border-radius: 8px;
  padding: 4px 8px;
  background: var(--gallery-control-bg);
  color: var(--gallery-control-text);
  font-size: 12px;
  transform: translateX(-50%);
}

.photo-placeholder {
  display: grid;
  place-items: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 14px;
  text-align: center;
  background:
    var(--placeholder-glow),
    var(--placeholder-bg);
}
.photo-placeholder svg {
  width: min(62%, 150px);
  height: auto;
}
.photo-placeholder strong {
  color: var(--text);
  font-size: 14px;
}
.photo-placeholder span {
  max-width: 18ch;
  color: var(--muted);
  font-size: 12px;
}
.plate { fill: rgba(230, 217, 200, .12); stroke: var(--accent); stroke-width: 5; }
.camera { fill: var(--accent); opacity: .18; }
.lens { fill: var(--blush); opacity: .38; }
.eye { fill: var(--accent); }
.smile, .spark {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linecap: round;
}
.spark { stroke-width: 6; opacity: .55; }

.item-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}
.item-description {
  color: var(--muted);
  font-size: 13px;
}
.item-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.item-facts span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12px;
}
.item-ingredients,
.item-allergens {
  color: var(--muted);
  font-size: 12px;
}
.item-allergens {
  color: var(--terracotta);
}

.price-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.comment-link {
  width: max-content;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
}
.comment-list {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
}
.comment-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 10px;
}

.badge {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--muted);
  font-size: 12px;
  background: var(--bg-soft);
}

dialog {
  width: min(720px, calc(100vw - 20px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 0;
  background: var(--panel);
  box-shadow: var(--shadow-strong);
}

.dialog { display: grid; gap: 14px; padding: 16px; }
.dialog header, .checkout-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.cart-lines { display: grid; gap: 8px; }
.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.cart-line span { color: var(--muted); }
.quantity-actions { display: inline-flex; gap: 4px; }
.quantity-actions button { width: 34px; height: 34px; padding: 0; }
.history-lookup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.history-list {
  display: grid;
  gap: 10px;
}
.history-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}
.history-items {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.checkout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

label { display: grid; gap: 5px; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  color: var(--text);
  background: var(--panel-strong);
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--focus-ring);
  border-color: var(--accent);
}
.wide { grid-column: 1 / -1; }
.result { min-height: 22px; color: var(--accent-2); }
.is-hidden { display: none !important; }
.visually-hidden-file {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.totals {
  display: grid;
  gap: 3px;
  color: var(--muted);
}
.totals strong { color: var(--text); }
.checkout-note {
  color: var(--accent);
  font-size: 13px;
}
.option-choices {
  display: grid;
  gap: 8px;
}
.choice-group {
  display: grid;
  gap: 8px;
}
.option-choice {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: var(--panel-strong);
}
.option-choice input { width: auto; }

.admin {
  display: grid;
  gap: 16px;
  padding: 16px;
}
.admin-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.admin-tools.compact {
  grid-template-columns: repeat(auto-fit, minmax(180px, 260px));
}
.menu-filters {
  grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(160px, .7fr));
}
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.admin-panel {
  display: grid;
  gap: 14px;
}
.admin-create {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.admin-create summary {
  cursor: pointer;
  padding: 12px;
  color: var(--text);
  font-weight: 600;
}
.admin-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}
.bot-settings-grid {
  align-items: start;
  padding: 0;
}
.bot-settings-grid textarea {
  min-height: 84px;
  resize: vertical;
}
.brand-palette {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-translucent);
  box-shadow: var(--shadow);
}
.brand-swatch {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 9px;
  align-items: center;
  min-width: 0;
}
.brand-swatch span {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--swatch-color);
  box-shadow: inset 0 0 0 1px rgba(230, 217, 200, .2);
}
.brand-swatch strong {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.15;
}
.brand-swatch small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}
.site-logo-settings {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.site-logo-settings-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}
.site-logo-settings-head h2 {
  margin: 0;
  font-size: 20px;
}
.site-logo-settings-head label {
  width: min(180px, 100%);
}
.logo-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.logo-option {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.logo-option:hover,
.logo-option:focus-within,
.logo-option.is-selected {
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}
.logo-option.is-selected {
  transform: translateY(-1px);
}
.logo-option-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.logo-option-preview {
  position: relative;
  display: grid;
  place-items: center;
  height: 82px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.logo-option-preview--light {
  background: white;
}
.logo-option-preview--dark {
  border-color: var(--logo-dark-border);
  background: var(--logo-dark-bg);
}
.logo-option-preview img {
  position: absolute;
  inset: 10px;
  display: block;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  object-fit: contain;
}
.logo-option-title {
  color: var(--text);
  font-weight: 700;
}
.logo-option small {
  color: var(--muted);
}
.site-logo-preview {
  display: grid;
  place-items: center;
  min-height: calc(var(--brand-logo-height, 56px) + 24px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  overflow: hidden;
}
.site-logo-preview[data-logo-surface="dark"] {
  border-color: var(--logo-dark-border);
  background: var(--logo-dark-bg);
}
.site-logo-preview img {
  display: block;
  width: auto;
  max-width: 100%;
  height: var(--brand-logo-height, 56px);
  object-fit: contain;
}
.admin-inline-check {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--text);
}
.admin-inline-check input { width: auto; }
.admin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--panel);
  color: var(--muted);
}
.admin-stats strong { color: var(--text); }
.card-upload-preview {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.card-upload-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.card-upload-head span {
  color: var(--muted);
  font-size: 13px;
}
.card-upload-files {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}
.card-upload-files figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}
.card-upload-files img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
}
.card-upload-files figcaption {
  padding: 6px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.admin-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}
.backup-table {
  min-width: 720px;
}
.customer-history-table {
  min-width: 760px;
}
.loyalty-table {
  min-width: 900px;
}
.delivery-zone-table {
  min-width: 1280px;
}
.admin-table th,
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.table-line {
  display: block;
  color: var(--text);
}
.customer-merge-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}
@media (max-width: 640px) {
  .backup-table {
    min-width: 0;
  }
  .backup-table thead {
    display: none;
  }
  .backup-table,
  .backup-table tbody,
  .backup-table tr,
  .backup-table td {
    display: block;
    width: 100%;
  }
  .backup-table tr {
    padding: 10px;
    border-bottom: 1px solid var(--line);
  }
  .backup-table tr:last-child {
    border-bottom: 0;
  }
  .backup-table td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
    padding: 5px 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }
  .backup-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
  }
  .customer-history-table {
    min-width: 0;
  }
  .customer-history-table thead {
    display: none;
  }
  .customer-history-table,
  .customer-history-table tbody,
  .customer-history-table tr,
  .customer-history-table td {
    display: block;
    width: 100%;
  }
  .customer-history-table tr {
    padding: 10px;
    border-bottom: 1px solid var(--line);
  }
  .customer-history-table tr:last-child {
    border-bottom: 0;
  }
  .customer-history-table td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
    padding: 5px 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }
  .customer-history-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
  }
  .loyalty-table {
    min-width: 0;
  }
  .loyalty-table thead {
    display: none;
  }
  .loyalty-table,
  .loyalty-table tbody,
  .loyalty-table tr,
  .loyalty-table td {
    display: block;
    width: 100%;
  }
  .loyalty-table tr {
    padding: 10px;
    border-bottom: 1px solid var(--line);
  }
  .loyalty-table tr:last-child {
    border-bottom: 0;
  }
  .loyalty-table td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
    padding: 5px 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }
  .loyalty-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
  }
}
.admin-menu-board {
  min-width: 0;
}
.admin-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  align-items: start;
}
.admin-dish-card {
  position: relative;
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.admin-dish-card:hover,
.admin-dish-card:focus-visible {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-strong);
  transform: translateY(-1px);
}
.admin-dish-card:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
.admin-dish-card.is-photo-drop::after,
.admin-dish-card.is-uploading::after {
  content: attr(data-upload-label);
  position: absolute;
  inset: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--border-accent);
  border-radius: 8px;
  background: var(--drop-overlay-bg);
  color: var(--accent);
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(4px);
}
.admin-dish-media {
  position: relative;
  width: 100%;
  margin: 0;
  aspect-ratio: 5 / 4;
  border-radius: 8px 8px 0 0;
  background: var(--media-bg);
  overflow: hidden;
}
.admin-dish-media img,
.admin-dish-empty-photo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus-x, 50%) var(--focus-y, 50%);
  color: var(--muted);
  font-size: 13px;
  transition: transform .28s ease;
}

.admin-dish-card:hover .admin-dish-media img {
  transform: scale(1.05);
}
.admin-dish-empty-photo {
  background:
    var(--placeholder-glow),
    var(--placeholder-bg);
}
.admin-dish-photo-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--gallery-control-bg);
  color: var(--gallery-control-text);
  font-size: 12px;
}
.admin-card-thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}
.admin-card-thumbs button {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border-radius: 6px;
  border-color: transparent;
  background: var(--media-bg);
}
.admin-card-thumbs button.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(230, 217, 200, .2);
}
.admin-card-thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus-x, 50%) var(--focus-y, 50%);
}
.admin-dish-body {
  display: grid;
  flex: 1;
  gap: 8px;
  padding: 12px;
}
.admin-dish-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.admin-dish-title-row h3 {
  overflow-wrap: anywhere;
  font-size: 17px;
}
.admin-dish-title-row strong {
  white-space: nowrap;
  color: var(--accent);
}
.admin-dish-body p {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 13px;
}
.admin-dish-body small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.admin-dish-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.admin-dish-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 12px;
}
.admin-dish-tags .is-strong {
  border-color: var(--border-accent);
  background: rgba(230, 217, 200, .12);
  color: var(--accent);
}
.admin-dish-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.admin-dish-quick label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.15;
}
.admin-dish-quick input {
  width: auto;
  margin: 0;
}
.admin-dish-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px 12px;
}
.admin-dish-actions button {
  min-height: 40px;
  padding-inline: 8px;
}
.admin-photo-cell {
  width: 76px;
}
.admin-photo-cell img,
.admin-photo-empty {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--media-bg);
  color: var(--muted);
  object-fit: cover;
  object-position: center center;
  font-size: 12px;
}
.admin-table input[type="number"],
.admin-table input[type="text"],
.admin-table textarea {
  min-width: 120px;
  margin-bottom: 6px;
  padding: 8px;
}
.admin-table textarea {
  min-width: 260px;
  min-height: 60px;
  resize: vertical;
}
.admin-checks {
  min-width: 150px;
}
.admin-checks label {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--text);
}
.admin-checks input {
  width: auto;
}
.photo-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.photo-review-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.photo-review-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
  background: var(--media-bg);
}
.photo-review-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}
.photo-review-body small {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.comment-moderation-grid {
  display: grid;
  gap: 12px;
}
.comment-admin-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.comment-admin-card textarea {
  resize: vertical;
}
.orders { display: grid; gap: 12px; }
.order-card { padding: 14px; display: grid; gap: 10px; }
.order-head, .order-actions, .order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.order-head { justify-content: space-between; }
.order-items { color: var(--muted); }
.order-items div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.order-items div:last-child { border-bottom: 0; }
.order-total {
  display: grid;
  gap: 4px;
  color: var(--muted);
}
.order-total strong { color: var(--text); }
.payment-page {
  display: grid;
  gap: 14px;
  width: min(520px, calc(100vw - 24px));
  margin: 48px auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-menu-actions {
  display: grid;
  gap: 6px;
  min-width: 148px;
}

.admin-editor-dialog {
  width: min(980px, calc(100vw - 20px));
}

.editor-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.editor-grid {
  padding: 0;
}

.menu-photo-manager {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--menu-photo-manager-bg);
}

.photo-manager-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.photo-manager-head h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
}

.photo-manager-head p {
  margin-top: 3px;
  font-size: 13px;
}

.photo-drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 118px;
  padding: 18px;
  border: 1.5px dashed var(--border-accent);
  border-radius: 22px;
  background: var(--bg-input);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.photo-drop-zone.is-active,
.photo-drop-zone:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  box-shadow: var(--glow-accent);
}

.photo-drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-drop-zone strong {
  font-size: 16px;
}

.photo-drop-zone span {
  color: var(--muted);
  font-size: 13px;
}

.photo-upload-preview,
.menu-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}

.photo-upload-preview figure,
.menu-photo-card {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.photo-upload-preview img,
.menu-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: var(--focus-x, 50%) var(--focus-y, 50%);
  background: var(--media-bg);
}

.photo-image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.photo-image-button:hover:not(:disabled) {
  box-shadow: none;
}

.photo-upload-preview figcaption,
.menu-photo-card-body {
  padding: 9px;
}

.photo-upload-preview figcaption,
.menu-photo-card small,
.photo-source-note {
  display: block;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.photo-tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.photo-tech-list span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 11px;
  line-height: 1.2;
}

.photo-checksum {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.menu-photo-card[draggable="true"] {
  cursor: grab;
}

.menu-photo-card.is-dragging {
  opacity: .6;
  border-color: var(--accent);
}

.photo-move-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.photo-move-actions button {
  min-height: 34px;
  padding: 5px 8px;
  font-size: 18px;
  line-height: 1;
}

.menu-photo-card-body {
  display: grid;
  gap: 7px;
}

.photo-card-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-weight: 600;
}

.photo-alt-field {
  color: var(--muted);
  font-size: 12px;
}

.photo-alt-field input {
  min-height: 36px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
}

.photo-focus-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.photo-focus-fields label {
  color: var(--muted);
  font-size: 12px;
}

.photo-focus-fields input {
  padding: 0;
}

.photo-upload-progress {
  width: 100%;
  height: 9px;
  accent-color: var(--accent);
}

.photo-preview-dialog {
  width: min(940px, calc(100vw - 20px));
}

.photo-preview-image {
  display: block;
  width: 100%;
  max-height: min(72vh, 760px);
  object-fit: contain;
  border-radius: 8px;
  background: var(--media-bg);
}

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; padding: 10px; }
  .site-info,
  .footer-details { grid-template-columns: 1fr; }
  .site-info { margin: 0 10px 10px; }
  .sections {
    position: static;
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .section-link { flex: 0 0 auto; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .admin-menu-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .checkout-grid { grid-template-columns: 1fr; }
  .topbar { align-items: start; }
  .brand-logo-link { max-width: 62vw; }
  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }
  .topbar-actions button {
    flex: 1 1 130px;
  }
  .cart-line { grid-template-columns: 1fr auto; }
  .cart-line > strong { grid-column: 1 / -1; }
  .history-lookup { grid-template-columns: 1fr; }
  .admin-tools { grid-template-columns: 1fr; }
  .comment-form { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .admin { padding: 10px; }
  .topbar { gap: 10px; padding: 10px; }
  .brand-lockup { gap: 8px; }
  .brand-logo-link { max-width: 54vw; }
  .brand-copy p { font-size: 12px; }
  .footer-brand {
    align-items: start;
    flex-direction: column;
  }
  .footer-logo-wrap {
    width: 100%;
  }
  .logo-picker { grid-template-columns: 1fr; }
  .admin-menu-grid { grid-template-columns: 1fr; }
  .admin-dish-actions { grid-template-columns: 1fr; }
  .dialog { padding: 12px; }
  .dialog header { align-items: start; }
}
