/* Lumen Room: warm light theme. Amber is the accent; deep amber (--accent-text) is used for small text so it passes WCAG AA. */
:root {
  --ink: #1C1917;
  --accent: #D97706;
  --accent-text: #92400E;   /* 7:1 on white, 6.4:1 on the tint */
  --accent-tint: #FEF3E2;
  --accent-line: #F3C98B;
  --sand: #FBF8F3;          /* page */
  --card: #FFFFFF;
  --muted: #78716C;         /* 4.8:1 on white, 4.5:1 on the page */
  --line: #E7E5E4;
  --line-strong: #D6D3D1;
  --solid: #1C1917;         /* primary buttons, active tab */
  --solid-hover: #44403C;
  --on-solid: #FFFFFF;
  --surface-dark: #1C1917;  /* banner, stats panel, toast (always light text) */
  --on-dark: #FFFFFF;
  --on-dark-muted: #D6D3D1;
  --disabled-bg: #F5F5F4;
  --disabled-text: #A8A29E;
  --ok: #15803D;
  --ok-tint: #F0FDF4;
  --ok-line: #BBF7D0;
  --bad: #B91C1C;
  --chat-bg: #F4EEE3;
  --bubble: #DCF8C6;
  --bubble-text: #1C1917;
  --bubble-time: #57534E;
  --shadow: 0 1px 2px rgba(28, 25, 23, .05), 0 4px 14px rgba(28, 25, 23, .05);
  color-scheme: light;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r: 14px;
}

:root[data-theme="dark"] {
  --ink: #FAFAF9;
  --accent-text: #FBBF24;
  --accent-tint: rgba(217, 119, 6, .18);
  --accent-line: rgba(217, 119, 6, .5);
  --sand: #1C1917;
  --card: #292524;
  --muted: #A8A29E;
  --line: #44403C;
  --line-strong: #57534E;
  --solid: #FAFAF9;
  --solid-hover: #E7E5E4;
  --on-solid: #1C1917;
  --surface-dark: #0C0A09;
  --disabled-bg: #231F1D;
  --disabled-text: #78716C;
  --ok: #4ADE80;
  --ok-tint: rgba(74, 222, 128, .12);
  --ok-line: rgba(74, 222, 128, .3);
  --bad: #F87171;
  --chat-bg: #12100F;
  --bubble: #14532D;
  --bubble-text: #F0FDF4;
  --bubble-time: #A7C9B3;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Banner */
.banner {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface-dark);
  color: var(--on-dark-muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  padding: 8px 14px;
  padding-top: calc(8px + env(safe-area-inset-top));
}
.banner a { color: var(--on-dark); font-weight: 600; text-underline-offset: 2px; }

/* Layout */
.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: calc(100dvh - 34px);
  display: flex; flex-direction: column;
  padding: 0 16px;
}
.brand { text-align: center; padding: 26px 0 14px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.logo {
  margin: 6px 0 0;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -.01em; color: var(--ink);
}
.logo svg { flex: none; color: var(--ink); }
.logo .flash { fill: var(--accent); stroke: none; }
.brand { position: relative; }
.theme-btn {
  position: absolute; top: 14px; right: 0;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
}
.theme-btn:hover { border-color: var(--accent); }
.theme-btn svg { display: block; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }

/* Toggle */
.toggle { box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; margin: 6px 0 18px;
}
.tab {
  position: relative;
  border: 0; background: transparent; color: var(--muted);
  padding: 10px 8px; border-radius: 999px; font-weight: 600; font-size: 14px;
  transition: background .2s, color .2s;
}
.tab.is-active { background: var(--solid); color: var(--on-solid); }
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-left: 7px; vertical-align: middle;
}

.stage { flex: 1; padding-bottom: 24px; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Progress */
.progress { display: flex; gap: 6px; margin: 0 0 18px; }
.progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .3s; }
.progress i.on { background: var(--accent); }

.pitch { box-shadow: var(--shadow);
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r);
  background: var(--card);
  padding: 14px 16px; margin-bottom: 18px; color: var(--muted); font-size: 13.5px;
}
.pitch strong { color: var(--ink); font-weight: 700; }

h2 { font-weight: 800; font-size: 24px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.01em; }
h3 { font-weight: 700; font-size: 17px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 14px; }
.back { background: none; border: 0; color: var(--muted); padding: 4px 0 10px; font-size: 13.5px; font-weight: 600; }
.back:hover { color: var(--ink); }

/* Chips summary */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.chip { box-shadow: var(--shadow);
  font-size: 12.5px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.chip b { font-weight: 700; }

/* Service cards */
.list { display: grid; gap: 10px; }
.svc { box-shadow: var(--shadow);
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  text-align: left; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px; transition: border-color .2s, background .2s, transform .1s;
}
.svc:active { transform: scale(.99); }
.svc .ph {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--sand); border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--muted); font-weight: 700; font-size: 14px;
}
.svc .nm { font-weight: 700; font-size: 15px; }
.svc .bl { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.svc .pr { text-align: right; white-space: nowrap; }
.svc .pr b { display: block; font-weight: 700; font-size: 15px; }
.svc .pr span { color: var(--muted); font-size: 12px; }
.svc.sel { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); }
.svc.sel .ph { background: var(--card); border-color: var(--accent); color: var(--accent-text); }

/* Date strip */
.strip {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
  margin: 0 -16px 18px; padding: 2px 16px 10px; scroll-padding-inline: 16px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.day { box-shadow: var(--shadow);
  flex: 0 0 64px; scroll-snap-align: start;
  display: grid; justify-items: center; gap: 1px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 4px; min-height: 84px; align-content: center;
}
.day .w { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.day .n { font-weight: 700; font-size: 22px; line-height: 1.15; }
.day .m { font-size: 11px; color: var(--muted); }
.day .rq { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; font-weight: 600; }
.day.sel { background: var(--accent-tint); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); }
.day.sel .w, .day.sel .m, .day.sel .rq { color: var(--accent-text); }

/* Time slots */
.grp { margin: 0 0 18px; }
.grp h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { box-shadow: var(--shadow);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 4px; text-align: center; font-weight: 600; font-size: 14px;
  transition: border-color .15s, background .15s;
}
.slot.sel { background: var(--accent-tint); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); font-weight: 700; }
.slot.taken { color: var(--disabled-text); text-decoration: line-through; background: var(--disabled-bg); box-shadow: none; cursor: not-allowed; font-weight: 400; }

/* Panels / forms */
.card { box-shadow: var(--shadow);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; margin-bottom: 14px;
}
.note { color: var(--muted); font-size: 13px; margin: 0; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.field input {
  width: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 13px 14px; font-size: 16px; /* 16px stops iOS zoom */
}
.field input::placeholder { color: var(--muted); opacity: .8; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.field .err { color: var(--bad); font-size: 12.5px; min-height: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span:first-child { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; }
.kv.big b { font-size: 20px; font-weight: 700; }
.secure { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin: 6px 0 14px; }
.fine { text-align: center; color: var(--muted); font-size: 12px; margin: 6px 0 0; }

/* Bank transfer */
.xfer { padding: 16px 16px 14px; }
.xfer-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.xfer-h h3 { margin: 0; font-size: 17px; }
.rec { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); background: var(--accent-tint); padding: 3px 9px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.xrow { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.xrow:first-of-type { border-top: 0; }
.xrow span { grid-column: 1 / -1; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.xrow b { font-weight: 700; font-size: 16px; min-width: 0; }
.xrow .acct { font-weight: 700; font-size: 22px; letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--ink); }
.copy {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 7px 12px; font-size: 12.5px; font-weight: 600;
}
.copy:active { background: var(--sand); }
.timer { margin: 4px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.timer b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 700; }
.altpay {
  display: block; width: 100%; background: none; border: 0; color: var(--muted);
  padding: 8px 0 4px; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px;
}
.altpay:hover { color: var(--ink); }

/* CTA */
.cta {
  position: sticky; bottom: 0; z-index: 20;
  margin: 0 -16px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: var(--sand);
  border-top: 1px solid var(--line);
}
.cta-note { text-align: center; color: var(--muted); font-size: 12.5px; margin: 0 0 8px; min-height: 18px; }
.cta-note b { color: var(--ink); font-weight: 700; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 0; border-radius: 999px; padding: 15px 20px;
  background: var(--solid); color: var(--on-solid);
  font-weight: 600; font-size: 16px;
  transition: opacity .2s, transform .1s;
}
.btn:hover { background: var(--solid-hover); }
.btn:active { transform: scale(.99); background: var(--solid-hover); }
.btn[disabled] { opacity: .35; cursor: not-allowed; background: var(--solid); }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); }
.btn.ghost:hover, .btn.ghost:active { background: var(--sand); }
.btn.slim { width: auto; padding: 10px 16px; font-size: 14px; }
.btn + .btn { margin-top: 10px; }
.spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; animation: sp .7s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* Confirmation */
.done { text-align: center; padding-top: 6px; }
.tick {
  width: 72px; height: 72px; margin: 4px auto 14px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ok-tint);
  border: 2px solid var(--ok);
  animation: pop .5s cubic-bezier(.2,1.4,.4,1) both;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.done .card { box-shadow: var(--shadow); text-align: left; }
.chat-lbl { text-align: left; color: var(--muted); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 6px; font-weight: 600; }
.chat {
  background: var(--chat-bg); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 12px; margin-bottom: 12px; display: flex; justify-content: flex-end;
}
.bubble {
  position: relative; max-width: 88%; text-align: left;
  background: var(--bubble); color: var(--bubble-text); border-radius: 10px 10px 2px 10px;
  padding: 8px 10px 6px; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere;
}
.bubble .bt { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: var(--bubble-time); margin-top: 3px; }
.btn.wa-btn, .btn.wa-btn:hover, .btn.wa-btn:active { background: #0F7B4F; color: #fff; }
.btn.wa-btn:hover { background: #0B6340; }
.btn.wa-btn svg { color: #fff; flex: none; }
.ref { font-size: 12px; letter-spacing: .12em; color: var(--muted); margin: 0 0 14px; text-transform: uppercase; font-weight: 600; }

/* Owner */
.stat {
  border-radius: var(--r);
  background: var(--surface-dark); color: var(--on-dark);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.stat .lbl { color: var(--on-dark-muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.stat .val { font-weight: 800; font-size: 38px; line-height: 1.15; margin: 4px 0 2px; }
.stat .note { color: var(--on-dark-muted); }
.stat .val.flash { animation: flash 1s ease; }
@keyframes flash { 30% { color: #FCD34D; } }
.sec { margin: 0 0 22px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.sec-h h3 { margin: 0; }
.sec-h span { color: var(--muted); font-size: 12.5px; text-align: right; }
.bk { box-shadow: var(--shadow);
  display: grid; grid-template-columns: 62px 1fr; gap: 12px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px;
}
.bk.new { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); }
.bk .t { font-weight: 700; font-size: 16px; line-height: 1.2; }
.bk .t small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; font-weight: 400; }
.bk .c { font-weight: 700; }
.bk .s { color: var(--muted); font-size: 13px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.badge {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px; font-weight: 600;
  background: var(--ok-tint); color: var(--ok); border: 1px solid var(--ok-line);
}
.badge.new { background: var(--accent-tint); color: var(--accent-text); border-color: var(--accent-line); }
.empty { color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 16px; text-align: center; font-size: 13.5px; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.pill { box-shadow: var(--shadow);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--ink);
}
.pill:active { border-color: var(--accent); }
.cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.cell { box-shadow: var(--shadow);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 3px; text-align: center; min-height: 54px;
  display: grid; align-content: center; gap: 1px; transition: background .15s, border-color .15s;
}
.cell b { font-weight: 600; font-size: 13px; }
.cell small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px; }
.cell.booked { background: var(--ok-tint); border-color: var(--ok-line); cursor: default; }
.cell.booked small { color: var(--ok); }
.cell.mock { background: transparent; border-style: dashed; cursor: default; box-shadow: none; }
.cell.past { opacity: .45; cursor: default; }
.cell.blocked {
  background: repeating-linear-gradient(135deg, var(--accent-tint), var(--accent-tint) 6px, var(--card) 6px, var(--card) 12px);
  border-color: var(--accent);
}
.cell.blocked small { color: var(--accent-text); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 11.5px; margin: 10px 0 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--line); }
.legend .a { background: var(--card); } .legend .b { background: var(--ok-tint); border-color: var(--ok-line); } .legend .c { background: var(--accent-tint); border-color: var(--accent); }

/* Footer */
.foot { text-align: center; color: var(--muted); font-size: 11.5px; padding: 6px 0 18px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 90;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--surface-dark); color: var(--on-dark);
  padding: 11px 16px; border-radius: 12px; font-size: 13.5px; max-width: min(92vw, 420px); text-align: center;
  transition: opacity .25s, transform .25s; box-shadow: 0 10px 30px rgba(28,25,23,.25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 640px) {
  .logo { font-size: 32px; }
  .slots { grid-template-columns: repeat(4, 1fr); }
  .cells { grid-template-columns: repeat(6, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
