:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --sunk: #f1ede6;
  --ink: #1c1917;
  --muted: #6b645c;
  --line: #e6e0d6;
  --accent: #b4441c;
  --accent-dark: #943512;
  --accent-soft: #fbece5;
  --cash: #45403a;
  --cash-soft: #ece8e2;
  --ok: #2d7a4b;
  --ok-soft: #e4f2e9;
  --danger: #b42318;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 2px 8px rgba(28, 25, 23, .04);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 64px;
  --cart-h: 120px;
}
@media (min-width: 768px) { :root { --cart-h: 84px; } }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

a { color: var(--accent-dark); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

/* ---------- header + nav ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-mark {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; letter-spacing: -.02em;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
.brand-where { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status {
  margin-left: auto;
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--sunk);
  border-radius: 999px;
  padding: 5px 10px 5px 22px;
  position: relative;
  white-space: nowrap;
}
.status::before {
  content: '';
  position: absolute; left: 10px; top: 50%;
  width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%;
  background: #a8a29e;
}
.status.is-open { color: var(--ok); background: var(--ok-soft); }
.status.is-open::before { background: var(--ok); }

.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  height: var(--nav-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--accent); }

@media (max-width: 420px) {
  .brand-where { display: none; }
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
  /* Only here: backdrop-filter would make the phone's fixed bottom nav position against the header. */
  .top {
    background: rgba(247, 245, 241, .92);
    backdrop-filter: saturate(1.2) blur(10px);
    -webkit-backdrop-filter: saturate(1.2) blur(10px);
  }
  .tabs {
    position: static;
    display: flex;
    gap: 4px;
    background: none;
    border: 0;
    padding: 0;
    margin-left: 8px;
  }
  .tabs a {
    height: 44px;
    flex-direction: row;
    gap: 8px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 15px;
  }
  .tabs svg { width: 18px; height: 18px; }
  .tabs a:hover { background: var(--sunk); color: var(--ink); }
  .tabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); }
  .top-inner { padding: 12px 24px; }
  .wrap { padding: 0 24px; }
}

/* ---------- shared bits ---------- */

.pill {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  vertical-align: middle;
  white-space: nowrap;
}

.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.key-cash { background: var(--cash); }
.key-card { background: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700; font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--sunk); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-quiet { border-color: transparent; background: var(--sunk); font-size: 14px; min-height: 44px; }
.btn-quiet:disabled { color: #a8a29e; cursor: default; background: transparent; }
.btn-danger { color: var(--danger); border-color: #f1c9c4; }
.btn-danger:hover { background: #fdf0ee; }
.link-btn {
  border: 0; background: none; padding: 8px 4px; min-height: 44px;
  color: var(--accent-dark); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(180, 68, 28, .35);
  outline-offset: 2px;
}

.disclaimer {
  margin: 22px 0 8px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.tag {
  display: inline-block;
  font-size: 12px; font-weight: 700;
  border-radius: 6px;
  padding: 1px 7px;
  white-space: nowrap;
}
.tag-card { background: var(--accent-soft); color: var(--accent-dark); }
.tag-cash { background: var(--cash-soft); color: var(--cash); }
.tag-machine { background: var(--ok-soft); color: var(--ok); margin-left: 4px; }

/* ---------- till ---------- */

.till, .dash-grid, .settings-grid, .settings-side { grid-template-columns: minmax(0, 1fr); }
.card { min-width: 0; }
.till { display: grid; gap: 14px; padding-top: 16px; padding-bottom: 8px; }

.till-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.till-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.machine-badge {
  font-size: 12px; font-weight: 700; color: var(--ok); background: var(--ok-soft);
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; margin: 0 -2px; }
.chips:empty { display: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.group + .group { margin-top: 18px; }
.group-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 2px 8px; }
.group-rows { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .group-rows { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .group-rows { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1200px) { .group-rows { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.tile { position: relative; min-width: 0; }
.tile-add {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start;
  width: 100%;
  min-height: 108px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
button.tile-add { cursor: pointer; }
button.tile-add:hover { border-color: #d3cabd; }
button.tile-add:active { transform: scale(.98); }
.tile.is-in .tile-add { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(180, 68, 28, .22); }
.t-name { font-weight: 800; font-size: 16px; letter-spacing: -.01em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-detail { color: var(--muted); font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-price { margin-top: auto; padding-top: 10px; font-weight: 800; color: var(--accent-dark); }
.t-qty {
  position: absolute; right: 12px; bottom: 12px;
  background: var(--ink); color: #fff;
  border-radius: 999px; padding: 1px 9px;
  font-size: 13px; font-weight: 800;
}
.tile-minus {
  position: absolute; top: -8px; right: -8px;
  width: 36px; height: 36px;
  border: 2px solid var(--bg); border-radius: 50%;
  background: var(--ink); color: #fff;
  font-size: 20px; font-weight: 800; line-height: 1;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(28, 25, 23, .2);
}
.tile-minus:active { transform: scale(.92); }
.fine { font-size: 14px; color: var(--muted); }
.empty { color: var(--muted); padding: 16px 2px; }

.card.sales { padding: 0; }
.sales summary {
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 56px;
  padding: 0 18px;
  cursor: pointer;
}
.sales summary::-webkit-details-marker { display: none; }
.sales summary h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.chev {
  width: 10px; height: 10px; margin: -4px 4px 0 0;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .2s;
}
.sales[open] .chev { transform: rotate(-135deg); margin-top: 4px; }
.sales-body { padding: 4px 18px 18px; border-top: 1px solid var(--line); }
.sales-body #clear { margin-top: 10px; }
.count { font-size: 13px; font-weight: 800; background: var(--sunk); border-radius: 999px; padding: 2px 9px; color: var(--muted); }

.target { margin: 12px 0 6px; display: grid; gap: 6px; }
.target-track { height: 8px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.target-fill { display: block; height: 100%; width: 0; background: var(--ok); border-radius: inherit; transition: width .4s ease; }
.target-text { font-size: 14px; color: var(--muted); }

.lines { list-style: none; margin: 0; padding: 0; }
.line {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto 36px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 4px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.line:first-child { border-top: 0; }
.line.is-new { animation: newline 1.6s ease; }
@keyframes newline { 0%, 30% { background: var(--accent-soft); } 100% { background: transparent; } }
.line.is-added .l-time { color: var(--accent-dark); font-weight: 700; }
.l-time { color: var(--muted); font-size: 14px; }
.l-what { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-what span { color: var(--muted); }
.l-price { font-weight: 800; text-align: right; white-space: nowrap; }
.l-del {
  width: 36px; height: 36px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px; line-height: 1;
  cursor: pointer;
}
button.l-del:hover { background: #fdf0ee; color: var(--danger); }

@media (max-width: 480px) {
  .line { grid-template-columns: 42px minmax(0, 1fr) auto 32px; grid-template-rows: auto auto; row-gap: 0; padding: 6px 0; }
  .l-time { grid-row: 1 / 3; }
  .l-what { grid-column: 2; grid-row: 1; }
  .l-tags { grid-column: 2; grid-row: 2; }
  .l-price { grid-column: 3; grid-row: 1 / 3; }
  .l-del { grid-column: 4; grid-row: 1 / 3; width: 32px; }
}

/* The order bar sits above the phone nav, and at the bottom edge from tablet up. */
.cartbar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  z-index: 25;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(28, 25, 23, .06);
}
html:not(.js) .cartbar { display: none; }
.cartbar-inner { display: grid; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
.cart-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.cart-count { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-total { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; white-space: nowrap; }
.cart-pay { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.pay-btn {
  min-height: 52px;
  border: 0; border-radius: var(--radius-sm);
  font-size: 17px; font-weight: 800; color: #fff;
  cursor: pointer;
  transition: opacity .15s, transform .08s;
}
.pay-cash { background: var(--cash); }
.pay-card { background: var(--accent); }
.pay-btn:not(:disabled):active { transform: scale(.98); }
.pay-btn:disabled { opacity: .35; cursor: default; }
.cart-clear { min-height: 52px; }

body[data-page="till"] { padding-bottom: calc(var(--nav-h) + var(--cart-h) + env(safe-area-inset-bottom)); }
body[data-page="till"] .toast { bottom: calc(var(--nav-h) + var(--cart-h) + 12px + env(safe-area-inset-bottom)); }

@media (min-width: 768px) {
  .cartbar { bottom: 0; }
  .cartbar-inner { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding-top: 14px; padding-bottom: 14px; }
  .cart-sum { flex-direction: row-reverse; justify-content: flex-end; }
  .cart-pay { grid-template-columns: 150px 150px auto; }
  body[data-page="till"] { padding-bottom: var(--cart-h); }
  body[data-page="till"] .toast { bottom: calc(var(--cart-h) + 16px); }
}
@media (min-width: 900px) {
  .till { gap: 18px; padding-top: 22px; }
  .card { padding: 22px; }
  .sales summary { padding: 0 22px; }
  .sales-body { padding: 4px 22px 22px; }
}

/* ---------- dashboard ---------- */

.dash, .settings { padding-top: 16px; padding-bottom: 8px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }

.today-chip {
  display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: 10px; align-items: baseline;
  text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 14px;
  box-shadow: var(--shadow);
}
.today-chip-label { font-size: 13px; font-weight: 700; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .06em; }
.today-chip-val { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.today-chip-sub { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }

.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.kpi { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-val { font-size: 24px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; margin-top: 2px; }
.kpi-sub { font-size: 13px; color: var(--muted); }
.kpi-lead .kpi-val { color: var(--accent-dark); }

@media (min-width: 768px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-val { font-size: 28px; }
}
@media (min-width: 1200px) {
  .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.dash-grid { display: grid; gap: 14px; margin-top: 14px; }
@media (min-width: 900px) {
  .dash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
    margin-top: 18px;
  }
}
@media (min-width: 1200px) {
  .dash-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
}

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h2 { font-size: 18px; letter-spacing: -.01em; }
.legend { display: flex; gap: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }

.bars { display: flex; align-items: stretch; gap: 8px; height: 180px; }
.bar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-val { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; min-height: 18px; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.bar-stack {
  width: 100%; max-width: 56px; margin: 0 auto;
  display: flex; flex-direction: column;
  border-radius: 6px 6px 2px 2px;
  overflow: hidden;
  min-height: 2px;
  transition: height .35s ease;
}
.seg { display: block; flex-basis: 0; min-height: 0; }
.seg-card { background: var(--accent); }
.seg-cash { background: var(--cash); }
.bar-lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.bar.is-today .bar-lbl { color: var(--accent-dark); font-weight: 800; }
.bar.is-today .bar-val { color: var(--ink); }
.bars-week .bar:not(.is-today) .bar-stack { opacity: .78; }
@media (max-width: 480px) { .bars-week .bar-val { font-size: 10px; } }

.days { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 15px; }
.days th, .days td { padding: 10px 6px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.days th:first-child { text-align: left; padding-left: 0; }
.days td:last-child { padding-right: 0; }
.days thead th { border-top: 0; font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 0; }
.days tbody th { font-weight: 600; }
.days .num-strong { font-weight: 800; }
.days tr.is-today { background: linear-gradient(90deg, var(--accent-soft), transparent); }
.days tfoot th, .days tfoot td { font-weight: 800; border-top: 2px solid var(--ink); }
@media (max-width: 520px) { .col-split { display: none; } }

.machine-state { font-weight: 700; margin: 4px 0 8px; }
.machine-state .dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; vertical-align: 1px; border-radius: 50%; background: #a8a29e; }
.machine-state.is-on .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(45, 122, 75, .08); } }

.lines-compact .line { grid-template-columns: 46px minmax(0, 1fr) auto auto 0; min-height: 44px; }
.lines-compact .l-del { display: none; }
@media (max-width: 480px) {
  .lines-compact .line { grid-template-columns: 42px minmax(0, 1fr) auto; }
}

/* ---------- settings ---------- */

.saved { display: inline-block; margin-left: 6px; color: var(--ok); font-weight: 700; opacity: 0; transition: opacity .2s; }
.saved.show { opacity: 1; }

.jump { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 14px; padding: 2px 0; }
.jump .chip { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
@media (min-width: 1000px) { .jump { display: none; } }
.settings section[id], .settings h2[id] { scroll-margin-top: 80px; }
.settings-grid { display: grid; gap: 14px; }
.settings-side { display: grid; gap: 14px; align-content: start; }
@media (min-width: 1000px) {
  .settings-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
  .settings-side { gap: 18px; }
}

.ed-cols, .ed-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 104px 44px;
  gap: 8px;
  align-items: center;
}
.ed-cols { margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 2px; }
.ed-group { margin-top: 14px; }
.ed-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.ed-group-head h3 { font-size: 15px; font-weight: 800; }
.ed-group-head .muted { font-size: 13px; }
.ed-group-head .link-btn { margin-left: auto; min-height: 0; padding: 0; font-size: 14px; }
.ed-row + .ed-row { margin-top: 6px; }

.ed-field input, .field select, .field input, .add-grid input, .add-grid select, .cat-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0 12px;
  font-size: 16px;
}
.ed-field input:hover, .add-grid input:hover { border-color: #d3cabd; }
.ed-name input { font-weight: 700; }
.ed-price, .money { position: relative; display: block; }
.ed-price .prefix, .money .prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.ed-price input, .money input { padding-left: 28px; font-weight: 800; }
.icon-btn {
  width: 44px; height: 44px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { background: #fdf0ee; color: var(--danger); }

@media (max-width: 560px) {
  .ed-cols { display: none; }
  .ed-row { grid-template-columns: minmax(0, 1fr) 96px 44px; grid-template-rows: auto auto; row-gap: 6px; padding: 8px 0; }
  .ed-row + .ed-row { margin-top: 0; border-top: 1px dashed var(--line); }
  .ed-name { grid-column: 1 / 3; }
  .ed-detail { grid-column: 1; grid-row: 2; }
  .ed-price { grid-column: 2; grid-row: 2; }
  .icon-btn { grid-column: 3; grid-row: 1; }
}

.add-form { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.add-form h3 { font-size: 16px; margin-bottom: 10px; }
.add-grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.add-grid label, .cat-form label, .field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.add-grid label:nth-child(2) { grid-column: 1 / -1; }
.add-grid .btn { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .add-grid { grid-template-columns: 1fr 1.4fr 1fr 110px auto; align-items: end; }
  .add-grid label:nth-child(2), .add-grid .btn { grid-column: auto; }
}
.cat-form { margin-top: 14px; display: flex; gap: 10px; align-items: end; }
.cat-form label { flex: 1; }

.field { margin: 14px 0 4px; }
#connect { margin-top: 6px; width: 100%; }
.machine-live { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.switch { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }

.shop-facts { margin: 0; display: grid; gap: 10px; font-size: 15px; }
.shop-facts div { display: grid; grid-template-columns: 80px 1fr; gap: 10px; }
.shop-facts dt { color: var(--muted); font-weight: 600; }
.shop-facts dd { margin: 0; }
#reset { margin-top: 12px; }

/* ---------- footer ---------- */

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  padding-top: 20px; padding-bottom: 28px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.foot-name { font-weight: 800; color: var(--ink); font-size: 15px; }
.hours { margin: 0; display: grid; gap: 2px; }
.hours div { display: flex; gap: 14px; justify-content: space-between; min-width: 200px; }
.hours dd { margin: 0; color: var(--ink); font-weight: 600; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  z-index: 40;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100vw - 32px);
  background: var(--ink); color: #fff;
  border-radius: 12px;
  padding: 8px 8px 8px 16px;
  min-height: 48px;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(28, 25, 23, .2);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast:not(:has(button)) { padding-right: 16px; }
.toast-undo {
  min-height: 36px; padding: 0 12px;
  border: 0; border-radius: 8px;
  background: rgba(255, 255, 255, .14); color: #fff;
  font-weight: 700; cursor: pointer;
}
.toast-undo:hover { background: rgba(255, 255, 255, .24); }
@media (min-width: 768px) { .toast { bottom: 24px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
