:root {
  --bg: #f6f4ee;
  --panel: #ffffff;
  --ink: #18211f;
  --muted: #697571;
  --line: #ddd8cd;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #d97706;
  --danger: #b42318;
  --shadow: 0 16px 40px rgba(24, 33, 31, .08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand-dark); font-weight: 700; text-decoration: none; }
button, .button { border: 0; border-radius: 8px; background: var(--brand); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px; font-weight: 800; }
button:hover, .button:hover { background: var(--brand-dark); }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); width: 100%; }
.link { background: transparent; color: var(--brand-dark); min-height: auto; padding: 0; }
.danger { color: var(--danger); }
.eyebrow { color: var(--accent); font-size: .78rem; font-weight: 900; letter-spacing: .08em; margin: 0 0 8px; text-transform: uppercase; }
.alert { border-radius: 8px; font-weight: 700; padding: 12px 14px; }
.success { background: #e7f8f1; color: #116149; }
.error { background: #fff0ed; color: var(--danger); }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.auth-card { width: min(440px, 100%); padding: 28px; }
.auth-card h1, .panel h2, .topbar h1 { margin: 0 0 18px; }

label { color: var(--muted); display: grid; font-size: .9rem; font-weight: 800; gap: 8px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0; padding: 14px; }
legend { color: var(--muted); font-size: .78rem; font-weight: 900; padding: 0 6px; text-transform: uppercase; }
input, textarea, select { background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font: inherit; min-height: 42px; padding: 10px 12px; width: 100%; }
textarea { min-height: 110px; resize: vertical; }
.codearea { font-family: Consolas, ui-monospace, monospace; min-height: 240px; }
.check { align-items: center; display: flex; gap: 10px; }
.check input { width: auto; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: #17211f; color: #fff; display: flex; flex-direction: column; gap: 22px; padding: 24px; }
.brand-mark { align-items: center; background: var(--accent); border-radius: 8px; color: #221406; display: flex; font-weight: 900; height: 48px; justify-content: center; width: 54px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar a { border-radius: 8px; color: #dce5e2; padding: 11px 12px; }
.sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar form { margin-top: auto; }
.admin-main { padding: 28px; overflow-x: hidden; }
.topbar { align-items: center; display: flex; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.topbar h1 { font-size: clamp(1.8rem, 3vw, 3rem); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stats article { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.stats span { color: var(--brand); display: block; font-size: 2.4rem; font-weight: 900; }
.stats p { color: var(--muted); margin: 4px 0 0; }
.panel { padding: 22px; }
.split { display: grid; grid-template-columns: minmax(340px, 520px) 1fr; gap: 18px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid h2, .form-grid .wide, .form-grid button { grid-column: 1 / -1; }
.settings-form { display: block; }
.settings-tabs { border-bottom: 1px solid var(--line); display: flex; gap: 8px; margin: 0 0 20px; overflow-x: auto; padding-bottom: 10px; }
.settings-tab { background: transparent; border: 1px solid var(--line); color: var(--muted); flex: none; min-height: 38px; padding: 0 14px; }
.settings-tab:hover, .settings-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.settings-panel { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-panel.active { display: grid; }
.settings-panel .wide, .settings-panel h2, .settings-panel h3 { grid-column: 1 / -1; }
.settings-panel h2:not(:first-child) { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 18px; }
.settings-actions { border-top: 1px solid var(--line); display: flex; justify-content: flex-end; margin-top: 22px; padding-top: 18px; }
.corner-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.logo-preview { align-content: start; background: #f9f7f1; border: 1px dashed var(--line); border-radius: 8px; display: grid; gap: 10px; min-height: 130px; padding: 14px; }
.logo-preview span { color: var(--muted); font-size: .78rem; font-weight: 900; text-transform: uppercase; }
.logo-preview img { background: #fff; border: 1px solid var(--line); border-radius: 8px; height: 96px; max-width: 220px; object-fit: contain; padding: 10px; width: 100%; }
.logo-preview p { color: var(--muted); margin: 0; }
.table-panel { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 8px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.table-group-title { color: var(--muted); font-size: .9rem; margin: 22px 0 8px; }
.table-group-title:first-of-type { margin-top: 0; }
.settings-subtitle { color: var(--ink); font-size: 1rem; margin: 4px 0 0; }
.admin-pill { background: #fff0d9; border: 1px solid #f0c27a; border-radius: 999px; color: #9e3a2c; display: inline-flex; font-size: .72rem; font-weight: 900; margin: 0 6px 4px 0; padding: 4px 8px; text-transform: uppercase; }
.sortable-table tbody:empty::after { color: var(--muted); content: "No items in this group."; display: table-row; height: 44px; }
.sort-cell { align-items: center; display: flex; gap: 10px; min-width: 120px; }
.drag-handle { background: #f4f1e8; border: 1px solid var(--line); color: var(--muted); cursor: grab; font-size: .72rem; min-height: 30px; padding: 0 10px; text-transform: uppercase; }
.drag-handle:hover { background: #ece7db; color: var(--ink); }
tr.dragging { opacity: .45; }
tr[draggable="true"] { cursor: grab; }
.inline { display: inline; margin-left: 12px; }
.publish-panel pre { background: #17211f; border-radius: 8px; color: #f7f3ea; overflow: auto; padding: 16px; }

.menu-shell { min-height: 100vh; }
.public-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr); gap: 32px; min-height: 58vh; padding: clamp(28px, 6vw, 84px); align-items: center; }
.public-logo { display: block; object-fit: contain; }
.menu-title { font-size: clamp(3rem, 9vw, 7.5rem); line-height: .92; margin: 0; }
.hero-copy { color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.4rem); line-height: 1.6; max-width: 680px; }
.hero-details { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 13px; line-height: 1.65; margin-top: 8px; max-width: 760px; }
.hero-details p { margin: 0; }
.hero-image { aspect-ratio: 4/5; border-radius: 8px; box-shadow: var(--shadow); height: auto; object-fit: cover; width: 100%; }
.hero-centered { display: block; text-align: center; }
.hero-centered .hero-copy { margin-left: auto; margin-right: auto; }
.hero-centered .hero-details { margin-left: auto; margin-right: auto; }
.hero-centered .hero-image { display: none; }
.mobile-category-nav { display: none; }
.public-menu { padding: 0 clamp(18px, 5vw, 72px) 72px; }
.menu-section { margin-top: 44px; }
.menu-section h2 { border-bottom: 1px solid var(--line); font-size: clamp(1.6rem, 3vw, 2.6rem); margin: 0 0 18px; padding-bottom: 14px; }
.category-heading h2 { align-items: center; display: flex; gap: 12px; }
.category-heading h2 span { display: block; }
.category-heading p { color: var(--muted); line-height: 1.55; margin: -8px 0 20px; max-width: 760px; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.menu-card { border-radius: 8px; overflow: hidden; }
.menu-card img { aspect-ratio: 4/3; display: block; object-fit: cover; width: 100%; }
.menu-card-body { padding: 18px; }
.item-heading { align-items: start; display: flex; gap: 14px; justify-content: space-between; }
.item-heading h3 { margin: 0; }
.localized-name span, .localized-description span { display: block; }
.localized-name .en-name { line-height: 1.25; margin-top: 3px; text-transform: uppercase; }
.localized-description .en-description { line-height: 1.35; margin-top: 4px; text-transform: uppercase; }
.price { white-space: nowrap; }
.menu-card p { color: var(--muted); line-height: 1.55; margin: 10px 0 0; }
.featured-section .menu-card { border-color: rgba(15, 118, 110, .35); }
.image-manager { background: #f9f7f1; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.image-manager h3 { font-size: 1rem; margin: 0 0 12px; }
.image-manager p { color: var(--muted); margin: 0; }
.image-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(128px, 160px)); justify-content: start; }
.image-frame { background: #fff; border: 1px solid var(--line); border-radius: 8px; margin: 0; max-width: 160px; overflow: hidden; position: relative; width: 100%; }
.image-frame img { aspect-ratio: 1; display: block; object-fit: cover; width: 100%; }
.image-frame figcaption { display: grid; gap: 8px; padding: 10px; }
.image-delete-button { background: #dc2626; border: 2px solid #fff; border-radius: 999px; box-shadow: 0 8px 18px rgba(15, 23, 42, .2); color: #fff; font-size: .75rem; font-weight: 900; height: 30px; line-height: 1; min-height: 0; padding: 0; position: absolute; right: 8px; top: 8px; width: 30px; z-index: 2; }
.image-delete-button:hover { background: #b91c1c; }
.image-frame.deleting { opacity: .55; }
.image-frame.deleting::after { align-items: center; background: rgba(15, 23, 42, .62); color: #fff; content: "Deleting..."; display: flex; font-weight: 900; inset: 0; justify-content: center; position: absolute; text-align: center; z-index: 1; }
.image-frame.deleting .image-delete-button { display: none; }
.image-frame.deleting figcaption { pointer-events: none; }

@media (max-width: 920px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .public-hero { grid-template-columns: 1fr; }
  .corner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .admin-main, .sidebar { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-panel.active, .corner-grid { grid-template-columns: 1fr; }
  .topbar { align-items: stretch; flex-direction: column; }
  .sidebar nav { grid-template-columns: 1fr; }
  .public-hero { min-height: auto; padding: 28px 18px; }
}

.menu-target-mobile {
  background: var(--paper);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

.menu-target-mobile .public-hero {
  display: block;
  margin: 0 auto;
  max-width: 1100px;
  min-height: auto;
  padding: 56px 24px 0;
}

.menu-target-mobile .public-logo {
  max-height: 220px;
  object-fit: contain;
}

.menu-target-mobile .eyebrow {
  color: #CB573A;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  margin: 8px 0 6px;
  text-transform: uppercase;
}

.menu-target-mobile .menu-title {
  font-size: clamp(34px, 10vw, 84px);
  font-weight: 700;
  line-height: .9;
  margin: 16px 0 14px;
  overflow-wrap: anywhere;
}

.menu-target-mobile .hero-copy {
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  max-width: 45ch;
  text-transform: uppercase;
}

.menu-target-mobile .hero-image {
  display: none;
}

.menu-target-mobile .mobile-category-nav {
  background: transparent;
  border-bottom: 1px solid transparent;
  display: block;
  margin-top: 48px;
  position: sticky;
  top: 0;
  transition: background .18s ease, border-color .18s ease, backdrop-filter .18s ease;
  z-index: 20000;
}

.menu-target-mobile .mobile-category-nav.is-stuck {
  backdrop-filter: blur(8px);
  border-bottom-color: var(--line);
}

.menu-target-mobile .nav-inner {
  display: flex;
  gap: 22px;
  margin: 0 auto;
  max-width: 1100px;
  overflow-x: auto;
  padding: 14px 24px;
  scrollbar-width: none;
}

.menu-target-mobile .nav-inner::-webkit-scrollbar {
  display: none;
}

.menu-target-mobile .mobile-category-nav a {
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  display: flex;
  flex: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  gap: 8px;
  padding: 6px 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.menu-target-mobile .swatch {
  background: var(--cat);
  border-radius: 50%;
  height: 10px;
  opacity: .45;
  width: 10px;
}

.menu-target-mobile .mobile-category-nav a.active {
  border-color: var(--cat);
  color: var(--ink);
}

.menu-target-mobile .mobile-category-nav a.active .swatch {
  opacity: 1;
}

.menu-target-mobile .public-menu {
  margin: 0 auto;
  max-width: 1100px;
  padding: 8px 24px 40px;
}

.menu-target-mobile .menu-section {
  margin-top: 0;
  padding: 56px 0 6px;
  scroll-margin-top: 64px;
}

.menu-target-mobile .category-heading {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}

.menu-target-mobile .cup-icon {
  background: linear-gradient(180deg, color-mix(in srgb, var(--cat) 55%, white), var(--cat) 38%, var(--cat));
  border-radius: 0 0 9px 9px;
  flex: none;
  height: 34px;
  position: relative;
  width: 34px;
}

.menu-target-mobile .cup-icon::after {
  background: color-mix(in srgb, var(--cat) 20%, white 80%);
  border: 1px solid var(--line);
  border-radius: 4px;
  content: "";
  height: 6px;
  left: -2px;
  position: absolute;
  right: -2px;
  top: -3px;
}

.menu-target-mobile .category-icon {
  color: var(--cat);
  flex: none;
  font-size: 30px;
  line-height: 1;
}

.menu-target-mobile .category-heading h2 {
  border: 0;
  display: block;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  padding: 0;
}

.menu-target-mobile .category-heading .category-en-name {
  font-family: "IBM Plex Mono", monospace;
  margin-top: 2px;
}

.menu-target-mobile .category-heading p {
  color: var(--cat);
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.4;
  margin: 2px 0 0;
  text-transform: uppercase;
}

.menu-target-mobile .menu-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.menu-target-mobile .menu-card {
  background: transparent;
  border: 0;
  min-width: 0;
  overflow: visible;
}

.menu-target-mobile .card-image {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  overflow: hidden;
  place-items: center;
}

.menu-target-mobile .card-image img {
  aspect-ratio: auto;
  display: block;
  filter: brightness(1.1);
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.product-placeholder {
  align-items: center;
  background:
    radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--cat) 18%, transparent), transparent 34%),
    linear-gradient(135deg, #f8f3e8, #e8dfce);
  color: color-mix(in srgb, var(--cat) 64%, #6c5d57);
  display: flex;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.placeholder-mark {
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 10px color-mix(in srgb, currentColor 9%, transparent);
  display: block;
  height: min(42%, 108px);
  max-height: 108px;
  max-width: 108px;
  opacity: .58;
  position: relative;
  width: min(42%, 108px);
}

.placeholder-mark::before,
.placeholder-mark::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  left: 50%;
  opacity: .65;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.placeholder-mark::before {
  height: 2px;
  width: 58%;
}

.placeholder-mark::after {
  height: 58%;
  width: 2px;
}

.menu-target-mobile .card-copy {
  background: #fff0d9;
  border: 1px solid #cac8c0;
  border-radius: 0 0 20px 20px;
  border-top: 0;
  padding: 20px;
}

.menu-target-mobile .item-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.menu-target-mobile .item-heading h3 {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
  overflow-wrap: anywhere;
}

.menu-target-mobile .item-heading .en-name {
  font-family: "IBM Plex Mono", monospace;
}

.menu-target-mobile .price {
  color: #4d1e1e;
  font-size: 20px;
  font-weight: 600;
  margin-top: -5px;
  white-space: nowrap;
}

.menu-target-mobile .menu-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 7px 0 0;
}

@media (max-width: 760px) {
  .menu-target-mobile .public-hero {
    padding: 36px 18px 0;
  }

  .menu-target-mobile .nav-inner {
    padding: 12px 18px;
  }

  .menu-target-mobile .public-menu {
    padding: 6px 18px 32px;
  }

  .menu-target-mobile .menu-section {
    padding-top: 42px;
  }

  .menu-target-mobile .menu-grid {
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .menu-target-mobile .public-hero {
    padding-top: 28px;
  }

  .menu-target-mobile .hero-copy {
    font-size: 14px;
  }

  .menu-target-mobile .mobile-category-nav {
    margin-top: 32px;
  }

  .menu-target-mobile .category-heading {
    align-items: flex-start;
  }

  .menu-target-mobile .category-heading h2 {
    font-size: clamp(22px, 8vw, 25px);
  }

  .menu-target-mobile .category-heading p {
    white-space: normal;
  }

  .menu-target-mobile .menu-grid {
    grid-template-columns: 1fr;
  }

  .menu-target-mobile .item-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .menu-target-mobile .item-heading h3 {
    font-size: clamp(15px, 5vw, 17px);
    min-width: 0;
  }

  .menu-target-mobile .item-heading .price {
    justify-self: end;
    margin-left: 0;
    text-align: right;
    transform: translateY(5px);
  }
}
