/* Layout: one narrow column for phones; the dashboard widens to a 2-col grid. */
:root {
  --bg: #F3F5F2;
  --surface: #FFFFFF;
  --ink: #12302F;
  --muted: #5B6F6C;
  --line: #DCE3DF;
  --accent: #0E6B63;
  --accent-ink: #FFFFFF;
  --accent-soft: #E1F0EC;
  --star: #E9A23B;
  --star-off: #D5DCD8;
  --warn-soft: #FFF3E0;
  --warn-ink: #8A4B00;
  --ok: #1E7F4F;
  --font-display: "Baloo 2", "Nirmala UI", "Segoe UI", system-ui, sans-serif;
  --font-body: "Hind", "Nirmala UI", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1615; --surface: #15211F; --ink: #E4EEEB; --muted: #9DB1AD; --line: #2A3A37;
    --accent: #4FBFB2; --accent-ink: #062320; --accent-soft: #173431; --star: #F2B34F; --star-off: #34433F;
    --warn-soft: #3A2A12; --warn-ink: #F6C987; --ok: #6FD39F; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D1615; --surface: #15211F; --ink: #E4EEEB; --muted: #9DB1AD; --line: #2A3A37;
  --accent: #4FBFB2; --accent-ink: #062320; --accent-soft: #173431; --star: #F2B34F; --star-off: #34433F;
  --warn-soft: #3A2A12; --warn-ink: #F6C987; --ok: #6FD39F; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 var(--font-body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: max(16px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-bottom, 0px));
}
[hidden] { display: none !important; }
h1, h2 { font-family: var(--font-display); line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 1.65rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 600; }
.sub { color: var(--muted); margin: 0; }
.hint { color: var(--muted); font-size: .9rem; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- customer page ---------- */
.sheet { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mark {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font: 700 1.05rem var(--font-display);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.brand-text strong { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.1; }
.brand-text span { color: var(--muted); font-size: .85rem; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lang button { border: 0; background: none; padding: 6px 10px; font-size: .85rem; cursor: pointer; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

.step { display: flex; flex-direction: column; gap: 14px; }
.stars { display: flex; justify-content: space-between; gap: 6px; margin-top: 6px; }
.star {
  flex: 1; aspect-ratio: 1; max-width: 72px; border: 0; background: none; padding: 4px; cursor: pointer;
  transition: transform .15s ease;
}
.star svg { width: 100%; height: 100%; fill: var(--star-off); transition: fill .15s ease; }
.star.on svg { fill: var(--star); }
.star:active { transform: scale(.92); }
.rate-label { min-height: 1.5em; margin: 0; text-align: center; font-family: var(--font-display); font-size: 1.2rem; color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 8px 14px; cursor: pointer; font-size: .95rem;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); min-width: 0; }
.field textarea, .field input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--surface); color: var(--ink); font-size: 1rem; resize: vertical;
}
.field textarea[aria-invalid="true"] { border-color: var(--warn-ink); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 12px; padding: 13px 16px; font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); font-weight: 500; padding-block: 6px; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.google svg { width: 22px; height: 22px; background: #fff; border-radius: 50%; padding: 2px; flex: none; }
.linkish { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; align-self: center; font-size: .9rem; }

.drafts { display: flex; flex-direction: column; gap: 10px; }
.draft {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; line-height: 1.45;
}
.draft[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.skeleton { height: 64px; border-radius: var(--radius); background: linear-gradient(90deg, var(--line), var(--surface), var(--line)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skeleton.short { height: 40px; width: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.private { background: var(--warn-soft); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.private h2, .private .sub { color: var(--warn-ink); }
.private form { display: flex; flex-direction: column; gap: 10px; }
.ok { color: var(--ok); margin: 0; font-weight: 600; }
.done { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; }
.done ol { margin: 6px 0 0; padding-left: 20px; }
.foot { color: var(--muted); font-size: .8rem; text-align: center; border-top: 1px solid var(--line); padding-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- owner dashboard ---------- */
.admin { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-top h1 { font-size: 1.5rem; }
.range { display: flex; gap: 6px; flex-wrap: wrap; }
.range a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--muted); font-size: .9rem; background: var(--surface); }
.range a[aria-current="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.banner { background: var(--warn-soft); color: var(--warn-ink); border-radius: 12px; padding: 12px 14px; font-size: .95rem; }
.banner code { font-size: .85rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel h2 { font-size: 1.05rem; }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.frow { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; font-size: .92rem; }
.fbar { height: 12px; background: var(--accent-soft); border-radius: 6px; overflow: hidden; }
.fbar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.frow b, .num { font-variant-numeric: tabular-nums; text-align: right; }
.dist .fbar i { background: var(--star); }
.days { display: flex; align-items: flex-end; gap: 4px; height: 90px; border-bottom: 1px solid var(--line); }
.days span { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.days-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.list li { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.list li:first-child { border-top: 0; padding-top: 0; }
.meta { color: var(--muted); font-size: .8rem; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; background: var(--accent-soft); color: var(--ink); margin-right: 6px; }
.pill.low { background: var(--warn-soft); color: var(--warn-ink); }
.empty { color: var(--muted); font-size: .92rem; }
.qr-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
#qr { background: #fff; padding: 10px; border-radius: 10px; line-height: 0; }
.url-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.url-row code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: var(--bg); padding: 6px 8px; border-radius: 8px; font-size: .85rem; }
.btn.small { padding: 7px 12px; font-size: .9rem; border-radius: 10px; }
.login { max-width: 340px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.err { color: var(--warn-ink); margin: 0; }

/* Printable counter card */
.card-print { max-width: 380px; margin: 0 auto; background: #fff; color: #12302F; border: 2px solid #12302F; border-radius: 18px; padding: 28px 24px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.card-print h1 { font-size: 1.9rem; color: #0E6B63; }
.card-print .stars-print { color: #E9A23B; font-size: 1.8rem; letter-spacing: 4px; }
.card-print p { margin: 0; }
@media print { body { background: #fff; } .no-print { display: none !important; } }
