/* Advance POS — application styles
   Breakpoints: phone < 640 · tablet portrait 640–1023 · tablet landscape / desktop >= 1024 */

:root {
  color-scheme: light;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #e2e7ef;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #7c889b;
  /* accent defaults; Settings → Appearance overrides these per site (see theme_css() in app/layout.php) */
  --primary: #f97316;
  --primary-hover: #db6513;
  --primary-soft: #feeee3;
  --on-primary: #111111;
  --primary-ink: #b45410; /* accent as text: meets 4.5:1 on the surface */
  --success: #0f7a55;
  --success-soft: #e2f5ec;
  --warning: #a55a05;
  --warning-soft: #fdf0d9;
  --danger: #c22f2f;
  --danger-soft: #fde7e7;
  --sidebar: #111111;
  --sidebar-2: #2e2e2e;
  --sidebar-text: #c9cbd1;
  --sidebar-strong: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .22);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 248px;
  --topbar-h: 60px;
  /* chart roles */
  --viz-1: #e2680f;
  --viz-grid: #e6e9ef;
  --viz-axis: #c5ccd8;
  --viz-muted: #7c889b;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e10; --surface: #18181b; --surface-2: #202024; --border: #2e2e34;
  --text: #ececef; --text-2: #b8b8c0; --muted: #8a8a94;
  --primary: #f97316; --primary-hover: #fa8431; --primary-soft: #40281a; --on-primary: #111111; --primary-ink: #f97316;
  --success: #3fc28f; --success-soft: #12322a; --warning: #f0b23f; --warning-soft: #3a2c10;
  --danger: #f07a7a; --danger-soft: #3c1b1e;
  --sidebar: #0c0c0c; --sidebar-2: #292929; --sidebar-text: #c9cbd1; --sidebar-strong: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --viz-1: #f97316; --viz-grid: #26262b; --viz-axis: #3a3a42; --viz-muted: #8a8a94;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e0e10; --surface: #18181b; --surface-2: #202024; --border: #2e2e34;
    --text: #ececef; --text-2: #b8b8c0; --muted: #8a8a94;
    --primary: #f97316; --primary-hover: #fa8431; --primary-soft: #40281a; --on-primary: #111111; --primary-ink: #f97316;
    --success: #3fc28f; --success-soft: #12322a; --warning: #f0b23f; --warning-soft: #3a2c10;
    --danger: #f07a7a; --danger-soft: #3c1b1e;
    --sidebar: #0c0c0c; --sidebar-2: #292929; --sidebar-text: #c9cbd1; --sidebar-strong: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --viz-1: #f97316; --viz-grid: #26262b; --viz-axis: #3a3a42; --viz-muted: #8a8a94;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
h2 { font-size: 1.35rem; letter-spacing: -.01em; text-wrap: balance; }
h3 { font-size: 1.02rem; }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.spacer { flex: 1; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Shell ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column;
  transition: transform .22s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; color: var(--sidebar-strong); }
.brand-mark { border-radius: 9px; flex: none; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text small { color: var(--sidebar-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; scrollbar-width: thin; }
.nav-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--sidebar-text); opacity: .6; padding: 16px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-weight: 500; font-size: .92rem;
}
.nav-link:hover { background: var(--sidebar-2); color: var(--sidebar-strong); text-decoration: none; }
.nav-link.active { background: var(--primary); color: var(--on-primary); }
.sidebar-foot { padding: 10px 14px 12px; font-size: .72rem; color: var(--sidebar-text); display: grid; gap: 6px; text-align: center; }
.sidebar-foot > span { opacity: .6; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(8, 13, 24, .55); z-index: 39; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 1.05rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { flex: 1; padding: 22px; width: 100%; max-width: 1440px; margin: 0 auto; }
.footer { padding: 14px 22px; text-align: center; font-size: .8rem; color: var(--muted); }

[data-sidebar-toggle] { display: none; }
body.sidebar-collapsed .sidebar, body.pos-page .sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .main, body.pos-page .main { margin-left: 0; }
body.pos-page [data-sidebar-toggle], body.sidebar-collapsed [data-sidebar-toggle] { display: inline-flex; }
body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
body.sidebar-open .sidebar-backdrop { display: block; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); width: min(280px, 84vw); }
  .main { margin-left: 0; }
  [data-sidebar-toggle] { display: inline-flex; }
  .content { padding: 16px; }
  .topbar { padding: 0 12px; }
}
@media (min-width: 1024px) {
  body:not(.pos-page) [data-sidebar-toggle] { display: inline-flex; }
}

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 550; font-size: .9rem; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--on-primary); }
.btn-danger:hover { filter: brightness(.94); background: var(--danger); }
.btn-success { background: var(--success); border-color: var(--success); color: var(--on-primary); }
.btn-success:hover { filter: brightness(.94); background: var(--success); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: .82rem; }
.btn-lg { min-height: 52px; padding: 12px 20px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; border: 0; background: var(--surface-2); color: var(--text-2);
}
button.chip { cursor: pointer; }
.chip .icon { width: 15px; height: 15px; }
.chip-warning { background: var(--warning-soft); color: var(--warning); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.badge-neutral { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--primary-soft); color: var(--primary-ink); }

.menu { position: relative; }
.menu summary { display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; padding: 5px 6px; border-radius: var(--radius-sm); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--surface-2); }
.menu-name { display: flex; flex-direction: column; line-height: 1.15; font-weight: 600; font-size: .86rem; }
.menu-name small { color: var(--muted); font-weight: 500; font-size: .74rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 50;
}
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px;
  background: none; color: var(--text); cursor: pointer; font-size: .9rem; text-align: left;
}
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); text-decoration: none; }
@media (max-width: 639px) { .menu-name, .menu summary > .icon, .topbar .btn-label { display: none; } }

/* ---------- Cards, page head ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head p { font-size: .82rem; }
.card-body { padding: 18px; }
.grid { display: grid; gap: 18px; }
.grid > .card + .card { margin-top: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 1023px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.stack { display: grid; gap: 18px; }
.stack > .card + .card { margin-top: 0; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .kpis { grid-template-columns: minmax(0, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi-label { font-size: .8rem; color: var(--text-2); font-weight: 550; display: flex; align-items: center; gap: 7px; }
.kpi-label .icon { width: 16px; height: 16px; color: var(--muted); }
.kpi-value { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; overflow-wrap: anywhere; line-height: 1.2; }
.kpi-note { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.delta-up { color: var(--success); font-weight: 650; }
.delta-down { color: var(--danger); font-weight: 650; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.field em { color: var(--danger); font-style: normal; }
.field small { font-size: .78rem; color: var(--muted); }
.field small.error, .error { color: var(--danger); }
input[type=text], input[type=search], input[type=number], input[type=email], input[type=tel], input[type=password],
input[type=date], input[type=file], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
input[type=file] { padding: 6px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.check { display: flex; align-items: center; gap: 9px; font-weight: 550; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-card { padding: 20px; max-width: 880px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.form-section { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); grid-column: 1 / -1; margin-top: 6px; }
@media (max-width: 639px) { .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); } .form-card { padding: 16px; } }

.toolbar { display: flex; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; align-items: flex-end; }
.toolbar .field { flex: 0 1 170px; }
.toolbar .search { flex: 1 1 220px; }
.search { position: relative; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 11px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 11px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table th.right, .table th.num { text-align: right; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; background: var(--surface-2); }
.table .actions { white-space: nowrap; }
.table .actions form { display: inline; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: .8rem; color: var(--muted); }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); flex: none; display: grid; place-items: center; font-weight: 700; color: var(--muted); font-size: .8rem; }
.with-thumb { display: flex; align-items: center; gap: 11px; min-width: 0; }

@media (max-width: 639px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .table-stack tbody tr:last-child { border-bottom: 0; }
  .table-stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 14px; text-align: right; }
  .table-stack td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 600; text-align: left; flex: none; }
  .table-stack td:first-child { font-weight: 650; font-size: .96rem; text-align: left; }
  .table-stack td:first-child::before { display: none; }
  .table-stack td.actions { justify-content: flex-end; padding-top: 8px; }
  .table-stack td.actions::before { display: none; }
  .table-stack tbody tr:hover td { background: none; }
  .table-stack .with-thumb { text-align: left; }
  .table:not(.table-stack) th, .table:not(.table-stack) td { padding: 10px 12px; }
}

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: .84rem; flex-wrap: wrap; }
.pagination-nav { display: flex; align-items: center; gap: 10px; }

.empty { text-align: center; padding: 46px 20px; }
.empty .icon { width: 40px; height: 40px; color: var(--muted); stroke-width: 1.5; margin-bottom: 10px; }
.empty p { margin: 6px 0 14px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info { background: var(--primary-soft); color: var(--primary-ink); }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; font-size: .9rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }

/* ---------- Modal ---------- */
.modal { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--text); width: min(480px, calc(100vw - 24px)); box-shadow: var(--shadow-lg); max-height: calc(100dvh - 24px); }
.modal::backdrop { background: rgba(8, 13, 24, .6); }
.modal-wide { width: min(640px, calc(100vw - 24px)); }
.modal-body { padding: 22px; display: grid; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.queue-list { display: grid; gap: 8px; max-height: 300px; overflow: auto; }
.queue-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .88rem; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-size: 11px; fill: var(--viz-muted); font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: var(--viz-grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--viz-axis); stroke-width: 1; }
.chart .bar { fill: var(--viz-1); }
.chart .band { fill: transparent; }
.chart .band.hover { fill: var(--text); fill-opacity: .05; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; padding: 7px 10px; border-radius: 8px;
  background: var(--text); color: var(--surface); font-size: .78rem; line-height: 1.35; white-space: nowrap;
  transform: translate(-50%, -100%); box-shadow: var(--shadow);
}
.chart-tip strong { display: block; font-size: .9rem; }
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: .86rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar-track { height: 14px; display: block; }
.hbar-fill { display: block; height: 100%; background: var(--viz-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-value { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Auth / error pages ---------- */
body.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1100px 600px at 15% -10%, color-mix(in srgb, var(--primary) 32%, var(--sidebar)) 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--primary) 16%, var(--sidebar)) 0%, transparent 55%), var(--sidebar);
}
.auth-wrap { width: min(420px, 100%); }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: 18px; padding: 30px 28px; box-shadow: var(--shadow-lg); display: grid; gap: 16px; }
.auth-card h1 { font-size: 1.35rem; }
.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-logo img { border-radius: 12px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: .8rem; color: var(--sidebar-text); }
.auth-foot a { color: var(--sidebar-strong); }
.error-code { font-size: 3rem; font-weight: 800; color: var(--primary-ink); line-height: 1; }

/* ---------- POS ---------- */
body.pos-page .content { padding: 0; max-width: none; display: flex; min-height: 0; }
body.pos-page .footer { display: none; }
body.pos-page .main { height: 100vh; height: 100dvh; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 380px; flex: 1; min-height: 0; width: 100%; }
.pos-products { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pos-bar { display: flex; gap: 10px; padding: 14px 16px 10px; }
.pos-bar .search { flex: 1; }
.pos-bar .search input { min-height: 46px; font-size: 1rem; }
.pos-cats { display: flex; gap: 8px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; flex: none; }
.pos-cats::-webkit-scrollbar { display: none; }
.cat-chip { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: .86rem; cursor: pointer; min-height: 38px; }
.cat-chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
/* max-content rows: cards clip their overflow, so auto rows would be squeezed to fit the scroll area */
.pos-grid { flex: 1; overflow-y: auto; padding: 2px 16px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); grid-auto-rows: max-content; gap: 12px; align-content: start; }
.p-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
  transition: transform .08s, border-color .12s, box-shadow .12s;
}
.p-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.p-card:active { transform: scale(.97); }
.p-card.out { opacity: .55; }
.p-img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; color: var(--muted); letter-spacing: .02em; }
.p-info { padding: 9px 11px 11px; display: grid; gap: 3px; }
.p-name { font-weight: 600; font-size: .86rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.p-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.p-price { font-weight: 750; color: var(--primary-ink); font-size: .96rem; }
.p-stock { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.p-stock.low { color: var(--warning); font-weight: 650; }
.p-stock.none { color: var(--danger); font-weight: 650; }

.pos-cart { display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); min-height: 0; }
.cart-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cart-head h3 { flex: 1; }
.cart-customer { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.cart-items { flex: 1; overflow-y: auto; padding: 4px 14px; min-height: 80px; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.cart-line:last-child { border-bottom: 0; }
.cart-name { font-weight: 600; font-size: .9rem; line-height: 1.25; }
.cart-each { font-size: .78rem; color: var(--muted); }
.cart-total { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.cart-controls { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.stepper button { width: 40px; height: 38px; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; color: var(--text); }
.stepper button:hover { background: var(--primary-soft); color: var(--primary-ink); }
.stepper input { width: 58px; min-height: 38px; border: 0; border-radius: 0; text-align: center; font-weight: 650; padding: 0 4px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.cart-empty .icon { width: 38px; height: 38px; stroke-width: 1.5; margin-bottom: 8px; }
.cart-foot { border-top: 1px solid var(--border); padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); display: grid; gap: 8px; background: var(--surface); }
.sum-row { display: flex; justify-content: space-between; font-size: .9rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sum-row.total { font-size: 1.3rem; font-weight: 750; color: var(--text); padding-top: 6px; border-top: 1px dashed var(--border); }
.discount-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 8px; }
.cart-buttons { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; }
.pos-cartbar { display: none; }
.cart-close { display: none; }

.pay-total { text-align: center; padding: 12px; background: var(--primary-soft); border-radius: var(--radius); }
.pay-total small { display: block; color: var(--text-2); font-weight: 600; }
.pay-total strong { font-size: 2rem; letter-spacing: -.02em; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.pay-method { padding: 10px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; cursor: pointer; min-height: 44px; }
.pay-method.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.quick-cash { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pay-change { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--success-soft); color: var(--success); font-weight: 700; }
.pay-change strong { font-size: 1.35rem; }
.pay-change.short { background: var(--danger-soft); color: var(--danger); }
.success-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: grid; place-items: center; margin: 0 auto; }
.success-mark .icon { width: 32px; height: 32px; stroke-width: 3; }

/* tablet portrait: slimmer cart */
@media (max-width: 1023px) and (min-width: 768px) {
  .pos { grid-template-columns: minmax(0, 1fr) 320px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
}
/* phones: cart becomes a bottom sheet */
@media (max-width: 767px) {
  .pos { grid-template-columns: minmax(0, 1fr); }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; padding-bottom: 92px; }
  .pos-bar { padding: 10px 12px 8px; }
  .pos-cats { padding: 0 12px 10px; }
  .pos-grid { padding-left: 12px; padding-right: 12px; }
  .pos-cart { position: fixed; inset: 0; z-index: 60; transform: translateY(100%); transition: transform .24s ease; border-left: 0; }
  .pos-cart.open { transform: none; }
  .cart-close { display: inline-flex; }
  .pos-cartbar {
    display: flex; align-items: center; gap: 10px; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 35;
    padding: 12px 16px; border: 0; border-radius: 14px; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 1rem; cursor: pointer; box-shadow: var(--shadow-lg);
  }
  .pos-cartbar .count { background: rgba(255, 255, 255, .22); border-radius: 999px; padding: 1px 9px; font-size: .86rem; }
}

/* ---------- Purchase form lines ---------- */
.lines { width: 100%; border-collapse: collapse; }
.lines th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 6px 6px 0; }
.lines td { padding: 5px 6px 5px 0; vertical-align: top; }
.lines td:last-child, .lines th:last-child { padding-right: 0; }
@media (max-width: 639px) {
  .lines thead { display: none; }
  .lines tr { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .lines td { padding: 0; }
  .lines td:first-child { grid-column: 1 / -1; }
  .lines td.line-total { display: none; }
}

/* ---------- Backups ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: .86rem; color: var(--muted); }
.step b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: .78rem; }
.step.active { color: var(--primary-ink); border-color: var(--primary); }
.step.active b { background: var(--primary); color: var(--on-primary); }
.step.done { color: var(--success); }
.step.done b { background: var(--success-soft); color: var(--success); }
.checks { display: grid; gap: 0; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.check-row:last-child { border-bottom: 0; }
.check-row small { display: block; color: var(--muted); }
.progress { height: 10px; border-radius: 999px; background: var(--primary-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .4s ease; }
.build-log { font-size: .88rem; display: grid; gap: 6px; }
.build-log div { display: flex; align-items: center; gap: 8px; }
.build-log .ok { color: var(--success); }
.build-log .fail { color: var(--danger); }
.howto { counter-reset: s; display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.howto li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: .9rem; }
.howto li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; display: grid; place-items: center; font-size: .8rem; }

/* ---------- Reports ---------- */
.report-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.report-link { display: flex; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.report-link:hover { border-color: var(--primary); text-decoration: none; }
.report-link .icon { width: 22px; height: 22px; color: var(--primary-ink); margin-top: 2px; }
.report-link strong { display: block; }
.report-link span { font-size: .82rem; color: var(--muted); }
.section-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 10px; font-weight: 700; }
.section-title:first-child { margin-top: 0; }

.report-sheet { padding: 26px; }
.report-letterhead { display: flex; align-items: center; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--text); }
.report-letterhead img { max-height: 62px; max-width: 150px; object-fit: contain; }
.report-company { flex: 1; min-width: 0; }
.report-company strong { font-size: 1.2rem; display: block; }
.report-company span { font-size: .82rem; color: var(--text-2); display: block; }
.report-title { text-align: right; }
.report-title h2 { font-size: 1.15rem; text-transform: uppercase; letter-spacing: .04em; }
.report-title span { font-size: .82rem; color: var(--text-2); display: block; }
.report-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--text-2); padding: 9px 0 16px; }
.report-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.report-summary div { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.report-summary small { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
.report-summary strong { font-size: 1.1rem; }
.report-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.report-table th { text-align: left; padding: 8px 10px; background: var(--surface-2); border-top: 1px solid var(--text-2); border-bottom: 1px solid var(--text-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.report-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.report-table th.num { text-align: right; }
.report-table tbody tr:nth-child(even) td { background: var(--surface-2); }
.report-table tfoot td { font-weight: 750; border-top: 2px solid var(--text); border-bottom: 2px solid var(--text); background: none; }
.report-table tr.row-strong td { font-weight: 750; border-top: 1px solid var(--text-2); background: none !important; }
.report-table tr.row-head td { font-weight: 700; text-transform: uppercase; font-size: .74rem; letter-spacing: .05em; color: var(--text-2); background: none !important; padding-top: 14px; }
.report-table tr.row-indent td:first-child { padding-left: 26px; }
.report-signatures { display: none; }
.report-foot { margin-top: 18px; font-size: .74rem; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
@media (max-width: 639px) {
  .report-sheet { padding: 16px; }
  .report-letterhead { flex-wrap: wrap; }
  .report-title { text-align: left; width: 100%; }
}

/* ---------- Print ---------- */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #fff; --surface: #fff; --surface-2: #f3f4f6; --border: #d5d9e0; --text: #000; --text-2: #333; --muted: #555;
    --primary-ink: #000; --viz-1: #555; --viz-grid: #e1e0d9;
  }
  body { background: #fff; font-size: 11pt; }
  .sidebar, .sidebar-backdrop, .topbar, .footer, .no-print, .alert[data-flash], dialog { display: none !important; }
  .main { margin: 0 !important; display: block; min-height: 0; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; border-radius: 0; }
  .report-sheet { padding: 0; }
  /* the letterhead already carries the report title */
  .content:has(.report-sheet) .page-head { display: none; }
  .report-table { font-size: 9.5pt; }
  .report-table thead { display: table-header-group; }
  .report-table tr { break-inside: avoid; }
  .report-signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; margin-top: 46px; font-size: 9.5pt; break-inside: avoid; }
  .report-signatures div { border-top: 1px solid #000; padding-top: 5px; text-align: center; }
  .table-wrap { overflow: visible; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Password show/hide ---------- */
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; height: 36px;
  display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer;
}
.password-toggle:hover { color: var(--text); }

/* ---------- Theme picker (Settings) ---------- */
.theme-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-preset { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 600; font-size: .84rem; color: var(--text); }
.theme-preset:hover { border-color: var(--text-2); }
.theme-preset .swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); flex: none; }
input[type=color] { width: 56px; height: 40px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field code { font: .86em ui-monospace, Menlo, Consolas, monospace; color: var(--text-2); }

/* ---------- Settings: business type, payment QR ---------- */
.mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 639px) { .mode-options { grid-template-columns: minmax(0, 1fr); } }
.mode-option { cursor: pointer; }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mode-option > span { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 14px; border: 2px solid var(--border); border-radius: var(--radius); height: 100%; }
.mode-option .icon { grid-row: span 2; width: 26px; height: 26px; color: var(--primary-ink); margin-top: 2px; }
.mode-option small { color: var(--muted); font-weight: 500; }
.mode-option input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.mode-option input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.qr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 8px; }
.qr-row { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.qr-row img, .qr-empty { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--border); flex: none; display: grid; place-items: center; color: var(--muted); }
.qr-row > div { display: grid; gap: 6px; min-width: 0; }

/* ---------- Vendor badge (Advance IT Services) ---------- */
/* The logo has white lettering, so the badge is always a black chip, framed so it also stands out on dark themes. */
.vendor-badge {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 14px; border-radius: 12px;
  background: #000; color: #d6d8de; font-size: .74rem; font-weight: 650; letter-spacing: .03em; text-decoration: none;
  border: 1px solid #3a3d45; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.vendor-badge:hover { text-decoration: none; color: #fff; border-color: #6b7080; }
.vendor-badge img { height: 40px; width: auto; display: block; }
.vendor-badge.block { display: flex; }
.sidebar .vendor-badge { padding: 6px 10px; gap: 8px; font-size: .68rem; }
.sidebar .vendor-badge img { height: 36px; }
.cart-brand .vendor-badge { display: flex; width: 100%; }
.auth-foot .vendor-badge img, .customer-display .vendor-badge img { height: 48px; }

/* ---------- POS: price level, notes, QR payment ---------- */
.cart-customer { display: grid; gap: 8px; }
.level-switch { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.level-switch button { min-height: 36px; border: 0; background: var(--surface); color: var(--text-2); font-weight: 650; cursor: pointer; }
.level-switch button + button { border-left: 1px solid var(--border); }
.level-switch button.active { background: var(--primary); color: var(--on-primary); }
.p-card { position: relative; }
.p-tag { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: .68rem; font-weight: 700; }
.cart-note { font-size: .78rem; color: var(--primary-ink); display: flex; gap: 5px; align-items: center; margin-top: 3px; }
.cart-note .icon { width: 13px; height: 13px; }
.note-chips, .guest-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.guest-chips .btn { min-width: 64px; }
#noteInput { min-height: 46px; }
.qr-pay { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.qr-pay img { width: 132px; height: 132px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--border); }
.qr-pay p { font-size: .82rem; margin: 4px 0 8px; }
@media (max-width: 420px) { .qr-pay { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.customer-display { width: min(560px, calc(100vw - 24px)); }
.customer-display .modal-body { gap: 16px; padding: 28px; }
.cd-company { font-size: 1.25rem; font-weight: 750; }
.cd-amount small { display: block; color: var(--muted); font-weight: 600; }
.cd-amount strong { font-size: 2.6rem; letter-spacing: -.02em; }
.customer-display img#cdQr { width: min(340px, 70vw); height: auto; aspect-ratio: 1; object-fit: contain; margin: 0 auto; background: #fff; padding: 10px; border-radius: 14px; border: 1px solid var(--border); }
.cd-method { font-weight: 650; color: var(--text-2); }
.cart-brand { padding-top: 4px; }

/* ---------- POS: restaurant floor ---------- */
.floor { display: none; }
.pos.show-floor { grid-template-columns: minmax(0, 1fr); }
.pos.show-floor > .pos-products, .pos.show-floor > .pos-cart, .pos.show-floor > .pos-cartbar { display: none !important; }
.pos.show-floor > .floor { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.floor-bar { display: flex; gap: 10px; padding: 14px 16px 10px; align-items: center; flex-wrap: wrap; }
.floor-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.floor-body { flex: 1; overflow-y: auto; padding: 0 16px 20px; }
.floor-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin: 2px 0 12px; }
.floor-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.dot.free { background: var(--success); } .dot.busy { background: var(--primary); } .dot.pending { background: var(--warning); }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.table-grid.small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.table-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 112px; padding: 14px; text-align: left; cursor: pointer;
  border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.table-card:hover { border-color: var(--text-2); }
.table-card .t-name { font-size: 1.15rem; font-weight: 750; }
.table-card .t-meta { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.table-card .t-meta .icon { width: 13px; height: 13px; }
.table-card .t-amount { font-weight: 750; font-size: 1.05rem; color: var(--primary-ink); }
.table-card .t-free { margin-top: auto; font-size: .78rem; font-weight: 650; color: var(--success); }
.table-card.free { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); }
.table-card.busy { border-color: var(--primary); background: var(--primary-soft); }
.table-card.busy.pending { border-color: var(--warning); border-style: dashed; }
.table-card .t-state { margin-top: auto; font-size: .74rem; font-weight: 700; color: var(--text-2); }
.table-card.pending .t-state { color: var(--warning); }
.order-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.order-title strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-title small { color: var(--muted); font-size: .76rem; }
.cart-buttons.rest { grid-template-columns: 1fr 1fr; }
.cart-buttons.rest #payBtn { grid-column: 1 / -1; }
#orderMenu .modal-body > .btn { justify-content: flex-start; }

/* ---------- Product form: type and recipe ---------- */
.mode-options.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .mode-options.cols-3 { grid-template-columns: minmax(0, 1fr); } }
.qty-unit { display: flex; align-items: center; gap: 6px; }
.qty-unit .unit { min-width: 28px; color: var(--muted); font-size: .84rem; }
.recipe-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.recipe-summary div { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); }
.recipe-summary small { display: block; color: var(--muted); font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.recipe-summary strong { font-size: 1.05rem; }

/* ---------- Help, manual, about ---------- */
.prose { font-size: .93rem; line-height: 1.65; color: var(--text); }
.prose p, .prose ul, .prose ol { margin: 0 0 10px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 3px 0; }
.prose h4 { margin: 16px 0 6px; font-size: .95rem; }
.prose code { font: .86em ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.manual { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.manual-toc { position: sticky; top: calc(var(--topbar-h) + 16px); padding: 14px; display: grid; gap: 2px; max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; }
.manual-toc strong { padding: 4px 8px 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.manual-toc a { display: flex; gap: 9px; align-items: center; padding: 7px 8px; border-radius: 7px; color: var(--text-2); font-size: .88rem; }
.manual-toc a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.manual-toc .icon { width: 16px; height: 16px; color: var(--muted); }
.manual-body { display: grid; gap: 18px; min-width: 0; }
.manual-body > .card + .card { margin-top: 0; }
.manual-section { padding: 20px 22px; scroll-margin-top: calc(var(--topbar-h) + 14px); }
.manual-section h3 { display: flex; align-items: center; gap: 10px; font-size: 1.12rem; margin-bottom: 12px; }
.manual-num { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); display: grid; place-items: center; font-size: .82rem; font-weight: 750; flex: none; }
.manual-foot { text-align: center; font-size: .8rem; }
@media (max-width: 900px) { .manual { grid-template-columns: minmax(0, 1fr); } .manual-toc { position: static; max-height: none; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } .manual-toc strong { grid-column: 1 / -1; } }
@media print { .manual { display: block; } .manual-section { break-inside: avoid-page; padding: 0 0 12px; } }
.help-search { padding: 16px; }
.help-search input { min-height: 48px; font-size: 1rem; }
.faq { padding: 6px 18px 14px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-of-type { border-bottom: 0; }
.faq-item summary { cursor: pointer; padding: 13px 0; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.2rem; line-height: 1; color: var(--muted); }
.faq-item[open] summary::after { content: '−'; }
.faq-item .prose { padding: 0 0 12px; color: var(--text-2); }
.help-links { padding: 8px; display: grid; }
.help-links a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 7px; color: var(--text); font-size: .9rem; }
.help-links a:hover { background: var(--surface-2); text-decoration: none; }
.help-links .icon { color: var(--primary-ink); }
.help-support { display: grid; gap: 10px; }
.about-brand { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.about-brand h2 { font-size: 1.5rem; }
.about-hero .card-body { display: grid; gap: 12px; }
.about-vendor { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
