/* Healthy Kalories — shared styles (customer pages are mobile-first; admin adds admin.css) */

:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #efece3;
  --text: #1b2a21;
  --muted: #5b6a61;
  --border: #e0dccf;
  --primary: #1f7a4d;
  --primary-strong: #17613c;
  --primary-soft: #e4f2e9;
  --on-primary: #ffffff;
  --accent: #d9652f;
  --accent-soft: #fcebe1;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --warning: #8a5a00;
  --warning-soft: #fff3cf;
  --info: #25507a;
  --info-soft: #e8f0f8;
  --focus: #2b8a5c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 35, 25, 0.05), 0 6px 20px rgba(20, 35, 25, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --tap: 48px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111814;
    --surface: #18211c;
    --surface-2: #1f2a24;
    --text: #e8efe9;
    --muted: #a3b2a8;
    --border: #2d3a33;
    --primary: #3fae78;
    --primary-strong: #57c28d;
    --primary-soft: #1d3527;
    --on-primary: #08130d;
    --accent: #f08a57;
    --accent-soft: #3a2519;
    --danger: #f2877e;
    --danger-soft: #3b1f1c;
    --warning: #f0c35a;
    --warning-soft: #372d14;
    --info: #8fb9e6;
    --info-soft: #1b2a3a;
    --focus: #57c28d;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5rem; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-strong); }
img, svg { max-width: 100%; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.pre-line { white-space: pre-line; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: 0.5rem; }
.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }

/* ---------- Layout (customer) ---------- */

.app-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.app-header .inner {
  max-width: 640px; margin: 0 auto; padding: 0.6rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--text); font-weight: 700; }
.brand img { width: 32px; height: 32px; }
.brand span { font-size: 1.05rem; letter-spacing: -0.01em; }

.page { max-width: 640px; margin: 0 auto; padding: 1.25rem 1rem 6rem; }
.page.narrow { max-width: 480px; }

.hero { text-align: center; padding: 1.5rem 0 0.5rem; }
.hero img { width: 72px; height: 72px; }
.hero h1 { margin-top: 0.75rem; font-size: 1.75rem; }
.hero p { color: var(--muted); }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card h2 { margin-bottom: 0.75rem; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { border-color: var(--primary); }
.card-link:focus-visible { outline-offset: 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

.notice {
  border-radius: var(--radius-sm); padding: 0.75rem 0.9rem; margin-bottom: 1rem;
  background: var(--info-soft); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent);
}
.notice.warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.notice.danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.notice.success { background: var(--primary-soft); color: var(--primary-strong); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.notice strong { display: block; margin-bottom: 0.15rem; }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty .big { font-size: 2.2rem; line-height: 1; margin-bottom: 0.5rem; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--tap); padding: 0.7rem 1.2rem;
  border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; text-align: center;
  background: var(--surface-2); color: var(--text);
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: color-mix(in srgb, var(--surface-2) 80%, var(--text) 8%); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-strong); color: var(--on-primary); }
.btn.outline { background: transparent; border-color: var(--border); }
.btn.outline:hover { border-color: var(--primary); background: var(--primary-soft); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; padding-inline: 0.6rem; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 36px; padding: 0.4rem 0.8rem; font-size: 0.9rem; border-radius: 10px; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 64px; font-size: 1.15rem; border-radius: 16px; }
.btn .spinner { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.menu-buttons { display: grid; gap: 0.75rem; margin-top: 1.25rem; }
.menu-buttons .btn { justify-content: flex-start; padding-inline: 1.1rem; }
.menu-buttons .btn .icon { width: 28px; height: 28px; flex: none; }
.menu-buttons .btn small { display: block; font-weight: 400; font-size: 0.85rem; opacity: 0.85; }
.menu-buttons .btn .label { text-align: left; }

/* ---------- Forms ---------- */

.field { margin-bottom: 1rem; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.field .hint { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }
.field .req { color: var(--accent); margin-left: 0.15rem; }
.field .opt { color: var(--muted); font-weight: 400; font-size: 0.85rem; margin-left: 0.3rem; }

input[type="text"], input[type="tel"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], select, textarea {
  width: 100%; min-height: var(--tap);
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
.error-text { color: var(--danger); font-size: 0.875rem; margin-top: 0.3rem; }
.error-text:empty { display: none; }
.form-error { margin-bottom: 1rem; }

.check { display: flex; align-items: center; gap: 0.6rem; min-height: 40px; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }

.pin-input { letter-spacing: 0.4em; font-size: 1.2rem; }

.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.25rem; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.18rem 0.6rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; line-height: 1.4; white-space: nowrap;
  background: var(--surface-2); color: var(--muted);
}
.badge.green { background: var(--primary-soft); color: var(--primary-strong); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.amber { background: var(--warning-soft); color: var(--warning); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.orange { background: var(--accent-soft); color: var(--accent); }

/* ---------- Order wizard ---------- */

.steps { display: flex; gap: 0.35rem; margin: 0.25rem 0 1rem; }
.steps span { flex: 1; height: 5px; border-radius: 999px; background: var(--border); }
.steps span.done { background: var(--primary); }
.step-label { font-size: 0.85rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.6rem; }
.choice-list { display: grid; gap: 0.6rem; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.15rem;
  width: 100%; min-height: 64px; padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.choice:hover { border-color: var(--primary); }
.choice[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.choice[disabled] { opacity: 0.55; cursor: not-allowed; background: var(--surface-2); }
.choice .title { font-weight: 700; font-size: 1.05rem; }
.choice .sub { font-size: 0.85rem; color: var(--muted); }
.choice.date { align-items: center; text-align: center; min-height: 76px; }
.choice.date .day { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: 0.04em; }
.choice.date .num { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.choice.date .mon { font-size: 0.8rem; color: var(--muted); }
.choice.date .tag { font-size: 0.7rem; font-weight: 700; color: var(--primary); }

.product {
  display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; align-items: center;
  padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.product + .product { margin-top: 0.75rem; }
.product.selected { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.product .name { font-weight: 700; font-size: 1.05rem; }
.product .desc { grid-column: 1 / -1; color: var(--muted); font-size: 0.9rem; margin: 0; }
.product .price { font-weight: 700; color: var(--primary-strong); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--surface); }
.stepper button {
  width: 44px; height: 44px; border: 0; background: transparent; color: var(--primary-strong);
  font-size: 1.4rem; font-weight: 700; cursor: pointer; line-height: 1;
}
.stepper button:hover:not([disabled]) { background: var(--primary-soft); }
.stepper button[disabled] { color: var(--border); cursor: not-allowed; }
.stepper output { min-width: 2.2rem; text-align: center; font-weight: 700; font-size: 1.05rem; }

.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(20, 35, 25, 0.08);
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
}
.sticky-bar .inner { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; }
.sticky-bar .summary { flex: 1; line-height: 1.25; }
.sticky-bar .summary strong { font-size: 1.15rem; display: block; }

.lines { width: 100%; border-collapse: collapse; }
.lines td { padding: 0.45rem 0; border-bottom: 1px dashed var(--border); vertical-align: top; }
.lines tr:last-child td { border-bottom: 0; }
.lines .qty { color: var(--muted); white-space: nowrap; padding-left: 0.5rem; }
.lines .amt { text-align: right; white-space: nowrap; font-weight: 600; padding-left: 0.75rem; }
.total-row { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.15rem; padding-top: 0.75rem; margin-top: 0.5rem; border-top: 2px solid var(--border); }

.success-mark {
  width: 72px; height: 72px; border-radius: 50%; margin: 0.5rem auto 1rem;
  background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center;
}
.success-mark svg { width: 38px; height: 38px; }

.order-card .top { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.order-card .when { font-weight: 700; }
.order-card .meta { color: var(--muted); font-size: 0.9rem; }
.order-card .badges { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.order-card .bottom { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.95rem; }

.identifiers { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.identifiers .chip { background: var(--surface-2); border-radius: 8px; padding: 0.15rem 0.55rem; font-size: 0.9rem; }
.identifiers .chip b { font-weight: 600; color: var(--muted); margin-right: 0.3rem; }

/* ---------- Toast & dialog ---------- */

.toast-host { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 100; display: grid; gap: 0.5rem; width: min(92vw, 420px); pointer-events: none; }
.toast {
  background: var(--text); color: var(--bg); padding: 0.8rem 1rem; border-radius: 12px;
  box-shadow: var(--shadow); font-weight: 500; animation: toast-in 0.2s ease-out; pointer-events: auto;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--primary-strong); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

dialog {
  border: 0; border-radius: var(--radius); padding: 0; width: min(94vw, 520px);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
dialog::backdrop { background: rgba(10, 20, 15, 0.45); }
dialog .dialog-body { padding: 1.25rem; max-height: 80vh; overflow: auto; }
dialog .dialog-actions { display: flex; gap: 0.6rem; justify-content: flex-end; padding: 0.9rem 1.25rem; border-top: 1px solid var(--border); flex-wrap: wrap; }

.loading { display: flex; align-items: center; justify-content: center; gap: 0.6rem; color: var(--muted); padding: 2rem 0; }
.loading::before { content: ""; width: 20px; height: 20px; border: 2.5px solid var(--primary); border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }

.footer-note { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 2rem; }

@media (min-width: 560px) {
  .page { padding-top: 2rem; }
  .menu-buttons { grid-template-columns: 1fr 1fr; }
  .menu-buttons .btn.primary { grid-column: 1 / -1; }
}

@media print {
  .app-header, .sticky-bar, .toast-host, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; }
}

.inline-badge { margin-left: 0.5rem; vertical-align: middle; }
.mt { margin-top: 0.9rem; }
.card .stack-sm + .stack-sm { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Icons inside buttons/links */
svg.icon { width: 1.25em; height: 1.25em; flex: none; }
.btn { white-space: nowrap; }
.menu-buttons .btn { white-space: normal; }

/* ---------- Book for a day | Subscribe tabs ---------- */
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; padding: 0.3rem; background: var(--surface-2); border-radius: 14px; margin: 0.5rem 0 1rem; }
.mode-tabs.compact { display: flex; flex-wrap: wrap; margin-top: 1.25rem; }
.mode-tabs.compact .mode-tab { flex: 1 1 auto; }
.mode-tab {
  appearance: none; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font: inherit; font-weight: 700;
  padding: 0.6rem 0.75rem; min-height: var(--tap); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2;
}
.mode-tab small { font-weight: 500; font-size: 0.78rem; }
.mode-tab[aria-selected="true"] { background: var(--surface); color: var(--primary-strong); box-shadow: var(--shadow); }

/* ---------- Plans, payment summary, delivery dates ---------- */
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.plan-head h2 { margin: 0; }
.pay-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; }
.pay-row.strong { font-weight: 700; }
.pay-row.due { font-weight: 800; font-size: 1.2rem; border-top: 2px solid var(--border); margin-top: 0.35rem; padding-top: 0.6rem; color: var(--primary-strong); }
.pay-card .check { font-weight: 600; }
.date-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.date-table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 0.35rem 0.3rem; border-bottom: 1px solid var(--border); }
.date-table td { padding: 0.45rem 0.3rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.date-table .num { text-align: right; white-space: nowrap; }
.date-table tr.skipped td { color: var(--muted); font-style: italic; }
.date-table tfoot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--border); padding-top: 0.6rem; }
@media (max-width: 420px) { .date-table th:nth-child(2), .date-table td:nth-child(2) { display: none; } .date-table tr.skipped td:nth-child(2) { display: table-cell; } }
.big-amount { font-size: 1.8rem; font-weight: 800; margin: 0.5rem 0; }

/* ---------- Health Recharge ---------- */
.balance-card .balance { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--primary-strong); }
.balance-card label { font-weight: 600; display: block; margin-bottom: 0.4rem; }
.amount-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.balance-card .row input, .card form .row input { flex: 1 1 140px; width: auto; }
.credit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 0.5rem; }
.credit-grid strong { font-size: 1.15rem; }
.neg { color: var(--danger); }
.statement { display: grid; }
.statement .entry { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
.statement .entry:last-child { border-bottom: 0; }
.statement .amount { text-align: right; font-weight: 800; white-space: nowrap; }
.statement .amount.in { color: var(--primary-strong); }
.statement .amount.out { color: var(--text); }
.bill-order { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: inherit; }
.bill-order:hover { border-color: var(--primary); }
.bill-order .when { font-weight: 700; }
.bill-order .badges { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: flex-end; }
.balance-strip { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.balance-strip strong { font-size: 1.4rem; display: block; }
.link-like { color: var(--primary); font-weight: 700; }
.due-card { border-color: color-mix(in srgb, var(--warning) 45%, transparent); }

/* v1.5: payments list, small inline buttons, amount dialog */
.payments .entry.not-paid .amount { color: var(--muted); }
.fail-reason { color: var(--danger); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; word-break: break-all; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 0.2rem; min-height: 32px; padding: 0.2rem 0.7rem;
  border: 1px solid var(--primary); border-radius: 999px; background: var(--surface, #fff); color: var(--primary-strong);
  font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; white-space: nowrap; vertical-align: middle;
}
.mini-btn:hover { background: var(--primary-soft); }
.mini-btn:focus-visible { outline: 3px solid var(--focus, var(--primary)); outline-offset: 2px; }
.mini-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.amount-dialog input[type=number] { width: 100%; font-size: 1.2rem; }
.dialog-actions.wrap { flex-wrap: wrap; }
.install-tip { display: flex; gap: 0.6rem; align-items: flex-start; }
.install-tip .close { margin-left: auto; }
/* Uploaded pictures (Manage App Cosmetics) */
.hero img.custom { width: 100%; height: auto; max-height: 260px; object-fit: cover; border-radius: var(--radius); }
.brand img.custom { width: auto; max-width: 160px; height: 36px; object-fit: contain; }

/* ---------- v1.6: admin sign-in, set-up, joining, recovery codes ---------- */
.notice.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.page.narrow.wide-step { max-width: 720px; }
.auth-setup { display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.25rem; align-items: start; margin-bottom: 0.75rem; }
.qr-box { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 0.4rem; line-height: 0; }
canvas.qr { width: 200px; height: 200px; image-rendering: pixelated; }
.steps-list { margin: 0; padding-left: 1.2rem; }
.steps-list li { margin-bottom: 0.4rem; }
.secret-key { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.05rem; letter-spacing: 0.06em; background: var(--surface-2); padding: 0.35rem 0.6rem; border-radius: 8px; word-break: break-all; user-select: all; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.3rem; letter-spacing: 0.2em; max-width: 16rem; }
.pw-wrap { display: flex; gap: 0.4rem; align-items: center; }
.pw-wrap input { flex: 1; min-width: 0; }
fieldset.setup-part { border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem 1rem 0.25rem; margin: 0 0 1rem; }
fieldset.setup-part legend { font-weight: 700; padding: 0 0.35rem; }
.codes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem 1.5rem; padding-left: 1.6rem; margin: 1rem 0; }
.codes-grid code { font-size: 1.05rem; letter-spacing: 0.05em; }
.link-input { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; }
@media (max-width: 560px) {
  .auth-setup { grid-template-columns: 1fr; justify-items: center; }
  .codes-grid { grid-template-columns: 1fr; }
}
@media print {
  .recovery-codes .notice { border: 1px solid #999; }
}
.send-code { margin-bottom: 0.9rem; }
.verify-box + .verify-box { margin-top: 1rem; }

/* v1.11: the customer's delivery answer */
.delivery-answer q { font-style: italic; font-weight: 600; }
.delivery-answer .notice { margin-bottom: 0.5rem; }

/* v1.12: simpler Home — tinted Service Location plate, two buttons under ORDER NOW */
.card.loc-plate {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 28%, transparent);
  border-left: 5px solid var(--primary);
}
.card.loc-plate h2 { color: var(--primary-strong); }
.card.loc-plate .chip { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.menu-buttons.simple { grid-template-columns: 1fr 1fr; }
.menu-buttons.simple .btn.primary { grid-column: 1 / -1; }
.menu-buttons.simple .btn.outline { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
@media (min-width: 560px) { .menu-buttons.simple .btn.outline { flex-direction: row; align-items: center; } }
/* My profile: Health Recharge statements */
.money-section > h2 { margin-bottom: 0.5rem; }
.balance-line { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; }
.balance-line strong { font-size: 1.25rem; }
.money-section { scroll-margin-top: 80px; }

/* v1.13: floating labels — the field name sits inside the box, then shrinks to the top edge when typing */
.ff { position: relative; margin-bottom: 0.6rem; }
.ff > input, .ff > select, .ff > textarea { width: 100%; min-height: 54px; padding: 1.35rem 0.85rem 0.4rem; }
.ff > textarea { min-height: 96px; padding-top: 1.5rem; }
.ff > label {
  position: absolute; left: 0.9rem; top: 27px; transform: translateY(-50%); margin: 0;
  color: var(--muted); font-weight: 500; pointer-events: none; transition: top .15s, font-size .15s, color .15s;
  max-width: calc(100% - 1.8rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ff > input:focus ~ label, .ff > input:not(:placeholder-shown) ~ label,
.ff > textarea:focus ~ label, .ff > textarea:not(:placeholder-shown) ~ label,
.ff > select ~ label { top: 0.5rem; transform: none; font-size: 0.72rem; font-weight: 700; }
.ff > input:focus ~ label, .ff > textarea:focus ~ label, .ff > select:focus ~ label { color: var(--primary-strong); }
.ff .req { color: var(--accent); margin-left: 0.15rem; }
.ff > .error-text:empty { display: none; }
.ff > .hint { font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; }

/* v1.13: Create Account steps + location search */
.reg-steps { display: flex; gap: 0.3rem; margin: 0.4rem 0 0.35rem; }
.reg-steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); }
.reg-steps span.on { background: var(--primary); }
.reg-steplbl { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.9rem; }
.reg-steplbl b { color: var(--primary-strong); }
.reg-q { font-size: 1.05rem; margin: 0 0 0.6rem; }
.loc-pick { display: flex; gap: 0.5rem; align-items: flex-start; }
.loc-pick .grow { flex: 1; margin-bottom: 0; }
.search-btn { width: 54px; min-width: 54px; height: 54px; padding: 0; border-radius: 12px; background: var(--primary-soft); color: var(--primary-strong); border: 1.5px solid var(--primary); }
.form-actions.two { display: flex; gap: 0.6rem; }
.form-actions.two .btn { flex: 1; }
.mt-sm { margin-top: 0.5rem; }
dialog.sheet { width: min(520px, calc(100vw - 1.5rem)); }
.loc-results { display: flex; flex-direction: column; gap: 0.15rem; max-height: 55vh; overflow: auto; }
.loc-hit { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 0.1rem; padding: 0.65rem 0.6rem; border: 0; border-bottom: 1px solid var(--border); background: none; font: inherit; color: inherit; cursor: pointer; border-radius: 10px; }
.loc-hit:hover, .loc-hit.top { background: var(--primary-soft); }
.loc-hit-name { font-weight: 600; }
.loc-hit mark { background: #fff2a8; color: inherit; border-radius: 3px; }
.loc-sorry { text-align: center; padding: 0.6rem 0.4rem; }
.loc-sorry-icon { font-size: 2.4rem; }
.loc-sorry h3 { margin: 0.3rem 0; }
.loc-sorry p { color: var(--muted); }

/* v1.13: Home spacing + complaint icon */
.menu-buttons.simple .btn.primary { margin-bottom: 1.25rem; }
.cmp-row { display: flex; justify-content: center; margin-top: 2rem; }
.cmp-icon { position: relative; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1.5px solid var(--border); color: var(--primary-strong); box-shadow: var(--shadow); -webkit-touch-callout: none; }
.cmp-icon:hover, .cmp-icon:focus-visible { border-color: var(--primary); }
.cmp-count { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: #d92d20; color: #fff;
  border: 2px solid var(--surface); font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; }
.cmp-tip { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg);
  font-size: 0.8rem; line-height: 1.3; padding: 0.4rem 0.65rem; border-radius: 8px; white-space: nowrap; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5; }
.cmp-tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--text); }
.cmp-icon:hover .cmp-tip, .cmp-icon:focus-visible .cmp-tip, .cmp-icon.show-tip .cmp-tip { opacity: 1; }
/* Complaints page */
.cmp-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cmp-item { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--border); background: none; padding: 0.7rem 0.85rem; font: inherit; color: inherit; cursor: pointer; }
.cmp-item:first-child { border-top: 0; }
.cmp-item:hover { background: var(--primary-soft); }
.cmp-item .top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.cmp-new { display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: #d92d20; color: #fff; font-size: 0.7rem; font-weight: 700; vertical-align: middle; }
.cmp-item.is-new { background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.cmp-item .res { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-box { background: var(--surface-2); border-radius: 10px; padding: 0.6rem 0.75rem; margin: 0.4rem 0 0.8rem; white-space: pre-line; }
.cmp-box.res { background: var(--primary-soft); }
.cmp-svg { width: 28px; height: 28px; stroke-width: 2.2; }
