/* ครัวคุณนิว — design tokens + components
   พาเลต: ครีมอุ่น + แดงพริก (1 สีหลัก + neutral scale) */

:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --surface-2: #f4ede2;
  --ink: #231c17;
  --muted: #6b5f56;
  --line: #e6dccd;
  --primary: #b3261e;
  --primary-hover: #951d17;
  --primary-soft: #f7e3df;
  --on-primary: #ffffff;
  --success: #2f6b3a;
  --success-soft: #e3efe4;
  --danger: #b3261e;
  --focus: #b3261e;
  --shadow: 0 1px 2px rgba(35, 28, 23, .06), 0 4px 16px rgba(35, 28, 23, .06);
  --shadow-lg: 0 12px 40px rgba(35, 28, 23, .18);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  --container: 1440px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 68px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16110e;
    --surface: #1f1814;
    --surface-2: #2a211c;
    --ink: #f3ece4;
    --muted: #b2a598;
    --line: #3a2f28;
    --primary: #e25a45;
    --primary-hover: #ec7461;
    --primary-soft: #3b1e18;
    --on-primary: #1a0e0b;
    --success: #7fc28a;
    --success-soft: #1f3322;
    --danger: #ef7b69;
    --focus: #ec7461;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16110e;
  --surface: #1f1814;
  --surface-2: #2a211c;
  --ink: #f3ece4;
  --muted: #b2a598;
  --line: #3a2f28;
  --primary: #e25a45;
  --primary-hover: #ec7461;
  --primary-soft: #3b1e18;
  --on-primary: #1a0e0b;
  --success: #7fc28a;
  --success-soft: #1f3322;
  --danger: #ef7b69;
  --focus: #ec7461;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s4); top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: var(--s2) var(--s4); border-radius: var(--radius-sm); text-decoration: none; }
.skip-link:focus { top: var(--s3); }

.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

main { min-height: 60vh; }
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section-alt { background: var(--surface-2); }

.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--primary); text-transform: uppercase; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); }
.section-head h2 { font-size: clamp(26px, 3.2vw, 36px); margin-top: var(--s2); }
.section-head p { color: var(--muted); max-width: 52ch; margin-top: var(--s2); }
.lead { font-size: 18px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s5);
  border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover:not(:disabled) { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); padding: 0 var(--s3); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-lg { min-height: 52px; padding: 0 var(--s6); font-size: 16px; }
.btn-sm { min-height: 36px; padding: 0 var(--s3); font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: var(--radius); border: 1px solid transparent; background: transparent; cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-2); }

.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: var(--s4); height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: var(--s3); text-decoration: none; font-weight: 700; font-size: 19px; }
.brand-mark { width: 38px; height: 38px; border-radius: var(--radius); background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }
.brand-mark .icon { width: 22px; height: 22px; }
.brand small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.2; }
.brand span { line-height: 1.2; }
.nav { display: none; margin-left: auto; gap: var(--s1); }
.nav a { text-decoration: none; padding: var(--s2) var(--s3); border-radius: var(--radius-sm); font-weight: 500; color: var(--muted); }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: var(--s1); margin-left: auto; }
.header-cta { display: none; margin-left: var(--s2); }
@media (min-width: 1100px) { .header-cta { display: inline-flex; } }
.cart-count {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--primary); color: var(--on-primary);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.cart-count[hidden] { display: none; }
.cart-count.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.3); } }
.menu-toggle { display: inline-grid; }
@media (min-width: 900px) {
  .nav { display: flex; }
  .menu-toggle { display: none; }
  .header-actions { margin-left: var(--s2); }
}
@media (max-width: 359px) {
  .brand small { display: none; }
  .brand { font-size: 17px; gap: var(--s2); }
  .header-inner { gap: var(--s2); }
}
.mobile-nav { display: none; border-top: 1px solid var(--line); padding: var(--s2) 0 var(--s4); }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: var(--s3) var(--s4); text-decoration: none; font-weight: 500; border-radius: var(--radius-sm); }
.mobile-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
@media (min-width: 900px) { .mobile-nav, .mobile-nav.open { display: none; } }

.status-chip { display: inline-flex; align-items: center; gap: var(--s2); font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--success-soft); color: var(--success); }
.status-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-chip.closed { background: var(--surface-2); color: var(--muted); }

/* ---------- hero ---------- */
.hero { padding: clamp(32px, 5vw, 80px) 0 clamp(48px, 6vw, 96px); }
.hero-grid { display: grid; gap: var(--s6); align-items: center; }
@media (min-width: 768px) { .hero-grid { grid-template-columns: 1fr 1fr; gap: clamp(32px, 4vw, 72px); } }
@media (min-width: 1280px) { .hero-grid { grid-template-columns: 1.1fr 1fr; } }
.hero h1 { font-size: clamp(34px, 5vw, 68px); line-height: 1.15; margin: var(--s4) 0; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero .lead { max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
@media (max-width: 479px) { .hero .hero-cta .btn { flex: 1 1 100%; } }
.hero-facts { display: flex; flex-wrap: wrap; gap: var(--s5); margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); }
.hero-facts div { display: flex; align-items: center; gap: var(--s2); color: var(--muted); font-size: 14px; }
.hero-facts .icon { color: var(--primary); }
.hero-media { position: relative; }
.hero-media .main-img { width: 100%; aspect-ratio: 4 / 3; max-height: 72vh; object-fit: cover; border-radius: var(--radius-lg); background: var(--surface-2); }
@media (min-width: 768px) and (max-width: 1099px) { .hero-media .main-img { aspect-ratio: 4 / 5; } }
.hero-card {
  position: absolute; left: var(--s4); bottom: var(--s4);
  display: flex; align-items: center; gap: var(--s3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3) var(--s4); box-shadow: var(--shadow);
}
.hero-card img { width: 52px; height: 52px; border-radius: var(--radius-sm); object-fit: cover; }
.hero-card strong { display: block; font-size: 15px; }
.hero-card span { font-size: 13px; color: var(--muted); }
@media (min-width: 1100px) { .hero-card { left: calc(-1 * var(--s6)); bottom: var(--s6); } }

/* ---------- features / steps ---------- */
.grid-3 { display: grid; gap: clamp(16px, 2vw, 24px); }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.feature { padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.feature-icon { width: 44px; height: 44px; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: var(--s4); }
.feature h3 { font-size: 18px; margin-bottom: var(--s2); }
.feature p { color: var(--muted); font-size: 15px; }
.step-num { font-size: 13px; font-weight: 700; color: var(--primary); letter-spacing: .06em; }

/* ---------- dish cards ---------- */
.dish-grid { display: grid; gap: clamp(12px, 1.4vw, 20px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.dish {
  container-type: inline-size;
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow .2s, border-color .2s;
}
.dish:hover { box-shadow: var(--shadow); }
.dish-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; border: 0; padding: 0; cursor: pointer; width: 100%; }
.dish-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease, opacity .3s; opacity: 0; }
.dish-media img.loaded { opacity: 1; }
.dish:hover .dish-media img { transform: scale(1.04); }
.dish-media.img-error::after { content: "ไม่สามารถโหลดรูปได้"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.badge {
  position: absolute; top: var(--s3); left: var(--s3);
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; box-shadow: var(--shadow);
}
.badge .icon { width: 14px; height: 14px; color: var(--primary); }
.dish-body { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); flex: 1; }
.dish-top { display: flex; justify-content: space-between; gap: var(--s3); align-items: start; }
.dish h3 { font-size: 17px; }
.price { font-weight: 700; color: var(--primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dish-desc { color: var(--muted); font-size: 14px; line-height: 1.55; flex: 1; }
.spice { display: inline-flex; gap: 1px; color: var(--primary); }
.spice .icon { width: 14px; height: 14px; }
.spice .off { color: var(--line); }
.dish-actions { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s2); }
.dish-actions .btn { flex: 1; padding: 0 var(--s3); }
@container (max-width: 270px) {
  .dish-actions { flex-wrap: wrap; }
  .dish-actions .qty { flex: 1 1 100%; justify-content: space-between; }
  .dish-actions .btn { flex: 1 1 100%; }
}
/* compact list card on small phones: image left, text right */
@media (max-width: 479px) {
  .dish-grid.list-sm { grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
  .list-sm .dish { flex-direction: row; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: var(--s4) 0; gap: var(--s3); overflow: visible; }
  .list-sm .dish:hover { box-shadow: none; }
  .list-sm .dish-media { width: 104px; flex: none; aspect-ratio: 1; border-radius: var(--radius); align-self: start; }
  .list-sm .badge { top: 6px; left: 6px; font-size: 11px; padding: 2px 7px; }
  .list-sm .badge .icon { display: none; }
  .list-sm .dish-body { padding: 0; gap: 4px; min-width: 0; }
  .list-sm .dish h3 { font-size: 16px; }
  .list-sm .dish-desc { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .list-sm .dish-actions { flex-wrap: nowrap; margin-top: var(--s1); }
  .list-sm .dish-actions .qty { flex: none; height: 38px; }
  .list-sm .dish-actions .qty button { width: 32px; }
  .list-sm .dish-actions .btn { flex: 1; min-height: 38px; font-size: 14px; }
  .list-sm .dish-actions .btn .label-long { display: none; }
}
@media (max-width: 359px) {
  .list-sm .dish-media { width: 84px; }
  .list-sm .dish-actions { flex-wrap: wrap; }
  .list-sm .dish-actions .qty { flex: 1 1 100%; justify-content: space-between; }
  .list-sm .dish-actions .btn { flex: 1 1 100%; }
}

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); height: 44px; background: var(--surface); }
.qty button { width: 38px; height: 100%; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ink); border-radius: var(--radius); }
.qty button:hover:not(:disabled) { background: var(--surface-2); }
.qty button:disabled { color: var(--line); cursor: not-allowed; }
.qty output, .qty input { width: 32px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; border: 0; background: transparent; }
.qty-sm { height: 36px; }
.qty-sm button { width: 32px; }

/* skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.dish.is-skeleton .dish-media { cursor: default; }
.dish.is-skeleton .sk-line { height: 14px; margin-bottom: var(--s2); }

/* ---------- menu page ---------- */
.page-head { padding-top: clamp(24px, 4vw, 48px); padding-bottom: var(--s5); }
.page-head h1 { font-size: clamp(30px, 4.2vw, 44px); margin-top: var(--s2); }
.page-head p { color: var(--muted); margin-top: var(--s2); max-width: 60ch; }
/* layout: mobile = sticky toolbar ; ≥1100 = sidebar | list ; ≥1280 = sidebar | list | cart panel */
.menu-layout { display: block; padding-bottom: var(--s8); }
.menu-toolbar {
  position: sticky; top: var(--header-h); z-index: 20;
  display: flex; flex-direction: column; gap: var(--s3);
  margin: 0 calc(-1 * var(--gutter)); padding: var(--s3) var(--gutter);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
@media (min-width: 768px) and (max-width: 1099px) { .menu-toolbar { flex-direction: row; align-items: center; } .menu-toolbar .search { width: 260px; } .menu-toolbar .chips { flex: 1; min-width: 0; } }
.side-title { display: none; }
.search { position: relative; flex: none; }
@media (min-width: 1100px) {
  .menu-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: clamp(24px, 2.5vw, 40px); align-items: start; }
  .menu-toolbar {
    top: calc(var(--header-h) + var(--s5)); margin: 0; padding: 0; border: 0; background: none; gap: var(--s4);
    max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; padding-top: var(--s6);
  }
  .side-title { display: block; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .06em; margin-bottom: calc(-1 * var(--s2)); }
  .menu-section { scroll-margin-top: calc(var(--header-h) + 16px); }
}
@media (min-width: 1280px) { .menu-layout { grid-template-columns: 220px minmax(0, 1fr) 340px; } }
@media (min-width: 1600px) { .menu-layout { grid-template-columns: 240px minmax(0, 1fr) 380px; } }

.cart-panel { display: none; }
@media (min-width: 1280px) {
  .cart-panel {
    display: flex; flex-direction: column; position: sticky; top: calc(var(--header-h) + var(--s5)); margin-top: var(--s6);
    max-height: calc(100vh - var(--header-h) - 48px);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  }
  .cart-panel .panel-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
  .cart-panel .panel-head h2 { font-size: 17px; display: flex; gap: var(--s2); align-items: center; }
  .cart-panel .panel-body { flex: 1; overflow-y: auto; padding: 0 var(--s5); min-height: 120px; }
  .cart-panel .panel-foot { padding: var(--s4) var(--s5); border-top: 1px solid var(--line); display: grid; gap: var(--s3); }
  .cart-panel .empty { padding: var(--s6) var(--s2); }
  .cart-panel .empty-icon { width: 48px; height: 48px; }
}
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 44px; padding: 0 var(--s3) 0 40px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.chips { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 38px; padding: 0 var(--s4); border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 500; font-size: 14px; color: var(--muted);
  display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap;
}
.chip[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }
.menu-section { padding: var(--s6) 0 0; scroll-margin-top: calc(var(--header-h) + 124px); }
.menu-section h2 { font-size: 22px; margin-bottom: var(--s4); display: flex; align-items: baseline; gap: var(--s3); }
.menu-section h2 small { font-size: 14px; color: var(--muted); font-weight: 500; }
.menu-list { min-width: 0; }
.menu-list > .menu-section:first-child { padding-top: var(--s5); }
@media (min-width: 1100px) { .menu-list > .menu-section:first-child { padding-top: var(--s6); } }

.empty {
  text-align: center; padding: var(--s8) var(--s4); color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: var(--s3);
}
.empty-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 18px; }

/* ---------- dialog ---------- */
dialog.sheet {
  width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden;
}
dialog.sheet::backdrop { background: rgba(20, 14, 10, .55); }
@media (max-width: 639px) {
  dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  dialog.sheet[open] { animation: sheet-up .25s ease; }
  .sheet-foot { padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom)); }
  .sheet-body { padding: var(--s4); gap: var(--s4); }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
dialog.sheet[open] { display: flex; flex-direction: column; animation: pop .2s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px); } }
.sheet-media { position: relative; aspect-ratio: 16 / 9; max-height: 30vh; width: 100%; background: var(--surface-2); flex: none; }
.sheet-media img { width: 100%; height: 100%; object-fit: cover; }
.sheet-close { position: absolute; top: var(--s3); right: var(--s3); background: var(--surface); box-shadow: var(--shadow); }
.sheet-close:hover { background: var(--surface-2); }
.sheet-body { padding: var(--s5); overflow-y: auto; display: flex; flex-direction: column; gap: var(--s5); }
.sheet-body h2 { font-size: 22px; }
.sheet-foot { display: flex; gap: var(--s3); padding: var(--s4) var(--s5); border-top: 1px solid var(--line); background: var(--surface); flex: none; }
.sheet-foot .btn { flex: 1; }
.option-group legend { font-weight: 600; margin-bottom: var(--s2); padding: 0; }
.option-group { border: 0; padding: 0; margin: 0; }
.option-group .hint { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: var(--s2); }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: var(--s2); }
.seg label, .check {
  display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: 14px;
}
.seg label { justify-content: center; flex-wrap: wrap; column-gap: 4px; row-gap: 0; text-align: center; line-height: 1.3; padding: 6px 10px; }
.seg-add { font-size: 12px; color: var(--muted); white-space: nowrap; }
.seg label:has(input:checked) .seg-add { color: inherit; }
.seg input, .check input { accent-color: var(--primary); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.check { justify-content: space-between; }
.check span:first-of-type { display: flex; align-items: center; gap: var(--s2); }
.check:has(input:checked) { border-color: var(--primary); }
.check-list { display: grid; gap: var(--s2); }

/* ---------- drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(20, 14, 10, .5); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(420px, 100%);
  background: var(--surface); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s ease; visibility: hidden;
}
.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-open .drawer { transform: none; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--s2) var(--s5); }
.drawer-foot { padding: var(--s4) var(--s5); border-top: 1px solid var(--line); display: grid; gap: var(--s3); }

.line-item { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s3); padding: var(--s4) 0; border-bottom: 1px solid var(--line); align-items: start; }
.line-item:last-child { border-bottom: 0; }
.line-item img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.line-item h3 { font-size: 15px; }
.line-item .opts { font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.line-item .row { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.line-item .line-price { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--muted); cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; border-radius: var(--radius-sm); }
.link-btn:hover { color: var(--danger); }

.totals { display: grid; gap: var(--s2); font-size: 15px; }
.totals div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.totals .muted { color: var(--muted); }
.totals .grand { font-size: 18px; font-weight: 700; padding-top: var(--s2); border-top: 1px dashed var(--line); margin-top: var(--s1); }
.note-box { font-size: 13px; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); padding: var(--s2) var(--s3); display: flex; gap: var(--s2); align-items: center; }
.note-box .icon { color: var(--primary); }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }

/* ---------- forms ---------- */
.form { display: grid; gap: var(--s4); }
.form-row { display: grid; gap: var(--s4); }
@media (min-width: 640px) { .form-row.two { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 600; font-size: 14px; }
.field .req { color: var(--danger); }
.field .optional { color: var(--muted); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: var(--s2) var(--s3); border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); cursor: not-allowed; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }
.error-msg { font-size: 13px; color: var(--danger); display: none; align-items: center; gap: 4px; }
.field.has-error .error-msg { display: flex; }
.help { font-size: 13px; color: var(--muted); }
.form-alert { display: none; gap: var(--s2); align-items: start; padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--primary-soft); color: var(--danger); font-size: 14px; }
.form-alert.show { display: flex; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s5); }
@media (min-width: 768px) { .card { padding: var(--s6); } }
.card h2 { font-size: 20px; margin-bottom: var(--s4); display: flex; align-items: center; gap: var(--s2); }
.card h2 .num { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 13px; display: grid; place-items: center; }

/* ---------- checkout ---------- */
.checkout-grid { display: grid; gap: var(--s5); padding-bottom: var(--s8); align-items: start; }
@media (min-width: 960px) { .checkout-grid { grid-template-columns: minmax(0, 1fr) 360px; } .summary { position: sticky; top: calc(var(--header-h) + var(--s4)); } }
@media (min-width: 1280px) { .checkout-grid { grid-template-columns: minmax(0, 1fr) 400px; } }
@media (min-width: 1440px) {
  .checkout-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 400px; }
  .checkout-grid > div { grid-column: 1 / 3; grid-template-columns: 1fr 1fr; align-items: start; }
  .checkout-grid > div > section:first-child { grid-row: span 2; }
}
@media (max-width: 479px) { .card { padding: var(--s4); } .line-item { grid-template-columns: 56px 1fr auto; } .line-item img { width: 56px; height: 56px; } }
.checkout-grid > div { display: grid; gap: var(--s5); }
.hidden { display: none !important; }
.qr-box { display: flex; gap: var(--s4); align-items: center; padding: var(--s4); border: 1px dashed var(--line); border-radius: var(--radius); }
.qr-box svg.qr { width: 96px; height: 96px; flex: none; color: var(--ink); }

.confirm { max-width: 640px; margin: 0 auto; padding: var(--s7) 0 var(--s8); text-align: center; }
.confirm-icon { width: 64px; height: 64px; margin: 0 auto var(--s4); border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; }
.confirm-icon .icon { width: 32px; height: 32px; }
.confirm h1 { font-size: clamp(26px, 4vw, 34px); }
.order-no { display: inline-block; margin-top: var(--s3); font-weight: 700; letter-spacing: .06em; font-variant-numeric: tabular-nums; background: var(--surface-2); padding: var(--s1) var(--s3); border-radius: var(--radius-sm); }
.timeline { list-style: none; margin: var(--s6) 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); text-align: center; }
.timeline li { position: relative; font-size: 13px; color: var(--muted); padding-top: 40px; line-height: 1.35; }
@media (max-width: 380px) { .timeline li { font-size: 12px; } }
.timeline li::before { content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.timeline li:first-child::before { display: none; }
.timeline .dot { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--line); display: grid; place-items: center; z-index: 1; }
.timeline .dot .icon { width: 16px; height: 16px; }
.timeline li.done { color: var(--ink); font-weight: 600; }
.timeline li.done .dot { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.timeline li.done::before, .timeline li.current::before { background: var(--primary); }
.timeline li.current .dot { border-color: var(--primary); color: var(--primary); }
.timeline li.current { color: var(--ink); font-weight: 600; }
.confirm .card { text-align: left; margin-top: var(--s5); }

/* ---------- contact ---------- */
.contact-grid { display: grid; gap: clamp(16px, 2vw, 24px); padding-bottom: var(--s8); align-items: start; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); } }
.contact-side { display: grid; gap: clamp(16px, 2vw, 24px); }
@media (min-width: 640px) and (max-width: 959px) { .contact-side { grid-template-columns: 1fr 1fr; } .contact-side .map-box { grid-column: 1 / -1; aspect-ratio: 21 / 9; } }
.contact-main { display: grid; gap: clamp(16px, 2vw, 24px); }
.visit-grid { display: grid; gap: var(--s6); align-items: start; }
@media (min-width: 768px) { .visit-grid { grid-template-columns: 1fr 1fr; gap: clamp(32px, 4vw, 64px); } }
.info-list { display: grid; gap: var(--s4); }
.info-item { display: flex; gap: var(--s4); align-items: start; }
.info-item .feature-icon { margin: 0; flex: none; }
.info-item h3 { font-size: 15px; }
.info-item p, .info-item a { color: var(--muted); font-size: 15px; }
.info-item a:hover { color: var(--primary); }
.hours { width: 100%; border-collapse: collapse; font-size: 15px; }
.hours td { padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.hours td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.hours tr.today td { color: var(--primary); font-weight: 600; }
.map-box { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.map-box iframe { width: 100%; height: 100%; border: 0; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: var(--s4) 0; font-weight: 600; display: flex; justify-content: space-between; gap: var(--s4); align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform .2s; color: var(--muted); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details p { padding-bottom: var(--s4); color: var(--muted); }
.success-panel { text-align: center; padding: var(--s6) var(--s4); display: grid; gap: var(--s3); justify-items: center; }

/* ---------- cta band ---------- */
.cta-band { background: var(--ink); color: var(--bg); border-radius: var(--radius-lg); padding: var(--s7) var(--s5); display: grid; gap: var(--s5); align-items: center; }
@media (min-width: 900px) { .cta-band { grid-template-columns: 1fr auto; padding: var(--s7); } }
.cta-band h2 { font-size: clamp(24px, 3vw, 32px); }
.cta-band p { opacity: .75; margin-top: var(--s2); }
.cta-band .btn-primary { background: var(--primary); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: var(--s7) 0 var(--s5); margin-top: var(--s7); font-size: 14px; color: var(--muted); }
.footer-grid { display: grid; gap: var(--s6); }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; } }
.site-footer h3 { font-size: 14px; color: var(--ink); margin-bottom: var(--s3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.footer-bottom { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: var(--s5); transform: translateX(-50%); z-index: 80; display: grid; gap: var(--s2); width: max-content; max-width: calc(100% - 32px); }
.toast {
  display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4);
  background: var(--ink); color: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: 14px; animation: toast-in .25s ease;
}
.toast .icon { color: #7fc28a; }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 4px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* mobile cart bar on menu page */
.cart-bar {
  position: fixed; left: var(--s4); right: var(--s4); bottom: var(--s4); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  background: var(--primary); color: var(--on-primary); border: 0; border-radius: var(--radius);
  padding: 0 var(--s4); height: 56px; font-weight: 600; box-shadow: var(--shadow-lg); cursor: pointer;
}
.cart-bar[hidden] { display: none; }
.cart-bar span { display: inline-flex; align-items: center; gap: var(--s2); }
.cart-bar { max-width: 560px; margin: 0 auto; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 1280px) { .cart-bar { display: none; } }
body.has-cart-bar .site-footer { padding-bottom: 96px; }
@media (min-width: 1280px) { body.has-cart-bar .site-footer { padding-bottom: var(--s5); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.nowrap { white-space: nowrap; }
.dish-grid.cols-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .dish-grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .dish-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }

/* ---------- category tiles (home) ---------- */
.cat-grid { display: grid; gap: clamp(10px, 1.4vw, 20px); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }
.cat-tile { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; background: var(--surface-2); isolation: isolate; }
@media (max-width: 639px) { .cat-tile { aspect-ratio: 1; } }
.cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; z-index: -2; }
.cat-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20, 12, 8, .82), rgba(20, 12, 8, 0) 60%); z-index: -1; }
.cat-tile:hover img { transform: scale(1.05); }
.cat-tile span { position: absolute; left: var(--s4); right: var(--s4); bottom: var(--s4); color: #fff; }
.cat-tile strong { display: block; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.3; }
.cat-tile small { font-size: 13px; opacity: .8; }

/* sidebar category list (menu page, ≥1100) — kept after base .chip rules so it wins */
@media (min-width: 1100px) {
  .menu-toolbar .chips { flex-direction: column; overflow: visible; gap: 2px; }
  .menu-toolbar .chip { width: 100%; height: 44px; display: flex; justify-content: space-between; border: 0; border-radius: var(--radius); background: transparent; font-size: 15px; }
  .menu-toolbar .chip:hover { background: var(--surface-2); color: var(--ink); }
  .menu-toolbar .chip[aria-current="true"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
}

@media (min-width: 1920px) { html { font-size: 17px; } body { font-size: 17px; } }

/* ---------- sold out / missing image / load error ---------- */
.dish.is-soldout .dish-media img { filter: grayscale(1); opacity: .55; }
.dish.is-soldout .dish-media { cursor: not-allowed; }
.dish.is-soldout h3, .dish.is-soldout .price { color: var(--muted); }
.badge-soldout { background: var(--ink); color: var(--bg); }
.no-img, .line-noimg { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); background: var(--surface-2); }
.line-noimg { width: 64px; height: 64px; border-radius: var(--radius-sm); }
.load-error { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s5); padding: var(--s4) var(--s5); border-radius: var(--radius); background: var(--primary-soft); color: var(--ink); }
.load-error > .icon { color: var(--danger); }
.load-error p { color: var(--muted); font-size: 14px; }
.load-error .btn { margin-left: auto; }
@media (max-width: 479px) { .load-error { flex-wrap: wrap; } .load-error .btn { margin-left: 0; } }

/* =========================================================
   Admin (/admin)
   ========================================================= */
.btn-danger { background: var(--danger); color: var(--on-primary); }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); }
.icon-btn-danger:hover { color: var(--danger); background: var(--primary-soft); }
@media (max-width: 479px) { .hide-xs { display: none !important; } }
.toast-error { background: var(--danger); color: #fff; }
.toast-error .icon { color: #fff; }

/* PIN */
.pin-screen { min-height: 100dvh; display: grid; place-items: center; padding: var(--s5) var(--gutter); }
.pin-card { width: min(400px, 100%); display: grid; justify-items: center; gap: var(--s3); text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(24px, 5vw, 40px); box-shadow: var(--shadow); }
.pin-card h1 { font-size: 22px; margin-top: var(--s2); }
.pin-mark { width: 52px; height: 52px; }
.pin-inputs { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s2); border: 0; padding: 0; margin: var(--s3) 0 0; width: 100%; }
.pin-inputs input {
  width: 100%; aspect-ratio: 1 / 1.15; min-width: 0; text-align: center; font-size: 24px; font-weight: 700;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink);
}
.pin-inputs input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pin-inputs input:disabled { opacity: .5; }
.pin-inputs.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pin-error { min-height: 22px; font-size: 14px; color: var(--danger); }
.pin-card .btn-ghost { margin-top: var(--s1); }

/* dashboard */
.admin-main { padding-top: clamp(20px, 3vw, 40px); padding-bottom: var(--s8); }
.admin-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.admin-head h1 { font-size: clamp(26px, 3vw, 34px); }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-bottom: var(--s4); }
.stat { display: flex; flex-direction: column; align-items: start; gap: 2px; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: left; }
.stat span { font-size: 13px; color: var(--muted); }
.stat strong { font-size: clamp(20px, 2.4vw, 26px); font-variant-numeric: tabular-nums; }
.stat:hover { border-color: var(--muted); }
.stat[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.stat[aria-pressed="true"] span, .stat[aria-pressed="true"] strong { color: var(--primary); }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s4); }
.admin-toolbar .search { flex: 1 1 240px; }
.admin-toolbar .select { width: auto; flex: 0 1 220px; min-height: 44px; }

.a-rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.a-row { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
.a-row:first-child { border-top: 0; }
.a-row-head { display: none; }
.a-col-item { display: flex; align-items: center; gap: var(--s3); flex: 1; min-width: 0; }
.a-thumb { width: 56px; height: 56px; border-radius: var(--radius-sm); object-fit: cover; flex: none; background: var(--surface-2); }
.a-thumb-empty { display: grid; place-items: center; color: var(--muted); }
.a-item-text { display: grid; min-width: 0; gap: 2px; }
.a-item-text strong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; }
.a-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none; }
.a-meta-sm { font-variant-numeric: tabular-nums; }
.a-col-cat, .a-col-price { display: none; }
.a-col-status { flex: none; }
.a-col-actions { flex: none; display: flex; gap: 2px; }
.a-row.is-off .a-thumb { filter: grayscale(1); opacity: .6; }
.a-row.is-off .a-item-text strong { color: var(--muted); }
.pill { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.a-count { margin-top: var(--s3); text-align: right; }
@media (max-width: 479px) { .a-row { flex-wrap: wrap; gap: var(--s2) var(--s3); } .a-col-item { flex: 1 1 100%; } .a-col-status { margin-left: 68px; } .a-col-actions { margin-left: auto; } }
@media (min-width: 768px) {
  .a-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 90px 80px 96px; }
  .a-row-head { display: grid; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--muted); padding-top: var(--s2); padding-bottom: var(--s2); }
  .a-col-cat, .a-col-price { display: block; }
  .a-col-price { font-weight: 600; font-variant-numeric: tabular-nums; }
  .a-col-cat { color: var(--muted); font-size: 14px; }
  .a-meta-sm { display: none; }
  .a-desc { display: block; }
  .a-col-actions { justify-content: end; }
}
@media (min-width: 1280px) { .a-row { grid-template-columns: minmax(0, 1fr) 200px 110px 90px 110px; } .a-thumb { width: 64px; height: 64px; } }

/* switch */
.switch { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch:checked { background: var(--success); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: progress; }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.switch-row > span { display: grid; gap: 2px; }

/* form dialog */
dialog.sheet-wide { width: min(640px, calc(100% - 32px)); }
dialog.sheet-wide form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.sheet-headbar { display: flex; align-items: center; justify-content: space-between; padding: var(--s3) var(--s3) var(--s3) var(--s5); border-bottom: 1px solid var(--line); flex: none; }
.sheet-headbar h2 { font-size: 19px; }
dialog.sheet-wide .sheet-body { flex: 1; min-height: 0; }
dialog.sheet-confirm { width: min(440px, calc(100% - 32px)); text-align: center; }
dialog.sheet-confirm .sheet-body { align-items: center; gap: var(--s3); padding-top: var(--s6); }
.confirm-danger { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--danger); }
.check .help { font-size: 12px; text-align: right; }
@media (max-width: 479px) { .check { flex-wrap: wrap; padding: var(--s2) var(--s3); } .check .help { text-align: left; flex-basis: 100%; padding-left: 24px; } }

.dropzone { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; transition: border-color .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); }
.dropzone.has-image { border-style: solid; }
.dropzone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.has-image input[type=file] { pointer-events: none; }
.dropzone:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.dz-empty { display: grid; justify-items: center; gap: 4px; text-align: center; color: var(--muted); padding: var(--s4); pointer-events: none; }
.dz-empty strong { color: var(--ink); }
.dz-actions { display: flex; gap: var(--s2); margin-top: var(--s2); }
.dz-actions label { cursor: pointer; }
.a-switch { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; font-size: 13px; color: var(--muted); }
@media (min-width: 768px) { .a-switch-text { display: none; } }
@media (max-width: 639px) {
  dialog.sheet, dialog.sheet-wide, dialog.sheet-confirm { width: 100%; max-width: 100%; max-height: 92dvh; inset: auto 0 0 0; margin: 0; }
  dialog.sheet-wide form { max-height: 92dvh; }
}
