:root {
  --bg: #0d0c0a; --surface: #1a1814; --surface-2: #23201a; --line: rgba(201,164,92,.22);
  --gilt: #c9a45c; --gilt-soft: #ecd29a; --text: #f7f5f0; --text-soft: #b9c7c1;
  --red: #e0626a; --ok: #6fcf8a;
  --display: 'Cinzel', Georgia, serif; --body: 'Figtree', system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom); --safe-t: env(safe-area-inset-top);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overscroll-behavior-y: contain; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gilt); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1.5px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-block { width: 100%; margin-top: 12px; }
.btn-gilt { background: linear-gradient(180deg, #e7cd93, #c9a45c 55%, #b08840); color: #17130b; border-color: #e9d29e; }
.btn-line { background: transparent; border-color: var(--line); color: var(--text); }
.btn-danger { background: transparent; border-color: rgba(224,98,106,.5); color: var(--red); }
.btn[disabled] { opacity: .5; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 26px; line-height: 1; cursor: pointer; display: grid; place-items: center; }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; }
.login-mark { font: 600 60px/1 var(--display); letter-spacing: .2em; padding-left: .2em; color: var(--gilt); text-align: center; }
.login-sub { text-align: center; color: var(--text-soft); margin: 4px 0 28px; }
.login-card label { font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
input, select, textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 17px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gilt); }
.err { color: var(--red); font-weight: 600; margin: 12px 0 0; }
.demo-note { background: rgba(212,169,79,.15); color: var(--gilt-soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; text-align: center; }

/* App shell */
.app { min-height: 100dvh; padding-bottom: calc(76px + var(--safe-b)); }
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: calc(12px + var(--safe-t)) 18px 12px; background: rgba(13,12,10,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.bar-title { margin: 0; font: 600 24px/1.1 var(--display); letter-spacing: .04em; color: var(--gilt); }
.live { width: 10px; height: 10px; border-radius: 50%; background: var(--text-soft); opacity: .5; }
.live.on { background: var(--ok); opacity: 1; box-shadow: 0 0 0 4px rgba(111,207,138,.18); }
.views { max-width: 640px; margin: 0 auto; padding: 16px; }
.lead { color: var(--text-soft); margin: 0 0 14px; font-size: 15px; }
.h2 { font-size: 18px; margin: 28px 0 8px; }
.hint { color: var(--text-soft); font-size: 14px; margin: 12px 0 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.empty { text-align: center; color: var(--text-soft); padding: 36px 12px; border: 1px dashed var(--line); border-radius: 16px; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 6px calc(6px + var(--safe-b)); background: rgba(13,12,10,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.tab { border: 0; background: none; color: var(--text-soft); font-size: 12px; font-weight: 600; padding: 6px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.tab-ico { font-size: 20px; line-height: 1.2; }
.tab[aria-current="page"] { color: var(--gilt); }

/* Bookings */
.alert-cta { width: 100%; margin-bottom: 14px; padding: 14px; border-radius: 14px; border: 1.5px dashed var(--gilt); background: rgba(212,169,79,.1); color: var(--gilt-soft); font-weight: 600; cursor: pointer; }
.daynav { display: grid; grid-template-columns: 44px 1fr 44px; gap: 10px; align-items: center; }
.daynav-label { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; }
.day-total { color: var(--text-soft); font-size: 14px; margin: 10px 2px 12px; }
.bk { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 12px; display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px; }
.bk.new { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 30% { background: #4a2a1c; border-color: var(--gilt); } }
.bk-time { font: 700 20px/1.1 var(--body); font-variant-numeric: tabular-nums; }
.bk-time small { display: block; font-weight: 500; font-size: 13px; color: var(--text-soft); margin-top: 2px; }
.bk-name { font-weight: 700; font-size: 17px; }
.bk-svc { color: var(--text-soft); font-size: 15px; }
.bk-note { grid-column: 2; font-size: 14px; background: rgba(255,255,255,.05); border-radius: 8px; padding: 6px 10px; margin-top: 4px; }
.bk-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.bk-actions .btn { min-height: 40px; padding: 0 12px; font-size: 14px; border-radius: 10px; flex: 1 1 auto; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }
.chip-online { background: rgba(201,164,92,.18); color: var(--gilt-soft); }
.chip-done { background: rgba(111,207,138,.18); color: var(--ok); }
.chip-cancel, .chip-noshow { background: rgba(224,98,106,.16); color: var(--red); }
.bk.dim { opacity: .55; }
.fab { position: fixed; right: 18px; bottom: calc(84px + var(--safe-b)); width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--gilt); color: var(--bg); font-size: 32px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.4); cursor: pointer; z-index: 15; }

/* Services */
.svc { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; text-align: left; width: 100%; }
.svc-main { flex: 1; }
.svc-name { font-weight: 700; }
.svc-meta { color: var(--text-soft); font-size: 14px; }
.svc-price { font: 700 20px/1 var(--body); color: var(--gilt); }
.svc.off { opacity: .5; }

/* Hours */
.hrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hrow:last-of-type { border-bottom: 0; }
.hrow-day { font-weight: 700; }
.hrow-times { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.hrow-times span { color: var(--text-soft); font-size: 14px; }
.hrow.closed .hrow-times { display: none; }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; min-height: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #3d3830; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--gilt); outline-offset: 2px; }
.off-form { display: grid; gap: 10px; margin-bottom: 12px; }
.off-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 14px; }

/* Settings */
.status-line { margin: 0 0 4px; font-weight: 600; }
.status-line.ok { color: var(--ok); }
.install { background: rgba(212,169,79,.1); border-radius: 12px; padding: 4px 14px; margin: 10px 0; font-size: 15px; }
.install ol { padding-left: 20px; margin: 6px 0 12px; }
.row-field { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 600; font-size: 15px; }
.site-link { display: block; text-align: center; color: var(--gilt-soft); margin: 22px 0 8px; }

/* Sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92dvh; overflow-y: auto; background: var(--bg); border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 8px 18px calc(18px + var(--safe-b)); animation: up .22s ease-out; max-width: 640px; margin: 0 auto; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet, .bk.new { animation: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 12px; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.sheet label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-line { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; }

.toast { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 60; width: min(92vw, 440px); background: var(--gilt); color: var(--bg); padding: 14px 16px; border-radius: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4); }

.btn-wa { background: #25d366; color: #062b14; border-color: #4be283; gap: 6px; font-weight: 700; }
.btn-wa svg { width: 17px; height: 17px; flex: none; }
.wa-preview { white-space: pre-wrap; font: 14px/1.45 var(--body); background: #0b1a12; border: 1px solid rgba(37,211,102,.3); color: #e7f7ec; border-radius: 12px; padding: 12px 14px; margin: 8px 0 4px; max-height: 42dvh; overflow: auto; }
