/* Клиентское приложение студии. Образ сервиса — табло: время записи на «флипах»,
   сигнальный жёлтый для главного действия. Фон окрашен в глубокий оттенок фирменного цвета студии,
   поэтому у каждой студии своё приложение. Файл самостоятельный: кабинет владельца живёт на styles.css. */
:root {
  --brand: #3b5bff;
  --brand-ink: #ffffff;
  --bg: color-mix(in oklab, var(--brand) 40%, #0c0f2e);
  --panel: color-mix(in oklab, var(--brand) 20%, #0a0c26);
  --flap: rgba(5, 7, 25, .5);
  --flap-2: rgba(5, 7, 25, .66);
  --text: #eef0ff;
  --text-2: rgba(238, 240, 255, .84);
  --text-3: rgba(238, 240, 255, .68);
  --rule: rgba(238, 240, 255, .16);
  --rule-2: rgba(238, 240, 255, .34);
  --signal: #ffc83d;
  --ink: #0f1433;
  --milk: #eef0ff;
  --ok: #7cf0b0;
  --warn: #ffc83d;
  --danger: #ffb4a8;
  --display: Tektur, "Arial Narrow", system-ui, sans-serif;
  --font: Onest, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-b: env(safe-area-inset-bottom);
  --safe-t: env(safe-area-inset-top);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { background: var(--bg); scroll-padding-bottom: calc(96px + var(--safe-b)); -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(88px + var(--safe-b));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 700; }
p { margin: 0; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.wrap { max-width: 520px; margin: 0 auto; padding: 0 20px; }
.title { font-family: var(--display); font-stretch: 75%; font-weight: 800; letter-spacing: -.005em; }

.icon { width: 20px; height: 20px; flex: none; }
.icon.sm { width: 16px; height: 16px; }

/* ---------- флипы табло ---------- */
.flaps { display: inline-flex; gap: 2px; }
.fl {
  position: relative; width: 1.02em; height: 1.45em; display: grid; place-items: center; flex: none;
  font: 600 1em/1 var(--display); font-stretch: 85%;
  background: linear-gradient(var(--flap) 0 50%, var(--flap-2) 50% 100%); border-radius: .16em; overflow: hidden;
}
.fl::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .55); }
.fl i { position: relative; z-index: 1; font-style: normal; display: block; }
.fl[data-ch=":"] { width: .42em; background: none; }
.fl[data-ch=":"]::after { display: none; }
.fl.go i { animation: flip .07s linear; }
.fl.go2 i { animation: flip2 .07s linear; }
@keyframes flip { from { transform: scaleY(.15); opacity: .4; } to { transform: scaleY(1); opacity: 1; } }
@keyframes flip2 { from { transform: scaleY(.15); opacity: .4; } to { transform: scaleY(1); opacity: 1; } }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 0 22px; border: 0; border-radius: 12px;
  background: var(--signal); color: var(--ink); font-weight: 600; font-size: 17px; text-decoration: none;
  transition: filter .15s ease, transform .15s var(--ease);
}
.btn:active { transform: translateY(1px); filter: brightness(.94); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--rule-2); }
.btn.ink { background: var(--milk); color: var(--ink); }
.btn .icon { width: 18px; height: 18px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--rule-2); background: transparent; color: var(--text);
  display: grid; place-items: center; flex: none;
}
.link-btn { border: 0; background: none; color: var(--text-2); font-weight: 500; padding: 10px 6px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.link-btn:active { color: var(--text); }

/* ---------- поля ---------- */
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 15px; font-weight: 500; }
.field label em { font-style: normal; color: var(--text-3); font-weight: 400; }
.input {
  width: 100%; min-height: 54px; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--rule-2);
  background: rgba(5, 7, 25, .28); outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: rgba(238, 240, 255, .5); }
.input:focus { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(255, 200, 61, .22); }
.input[aria-invalid="true"] { border-color: var(--danger); }
input[type="date"].input { color-scheme: dark; }
textarea.input { min-height: 88px; resize: vertical; }
.err { color: var(--danger); font-size: 14px; font-weight: 500; }

/* ---------- шапка ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(14px + var(--safe-t)) 0 0; }
.mark {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--milk); color: var(--ink); font: 700 17px/1 var(--display); font-stretch: 85%;
}
.mark.logo { background: #fff; padding: 3px; overflow: hidden; }
.mark.logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: rgba(5, 7, 25, .3); font-size: 14px; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.off { background: var(--danger); }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--signal); color: var(--ink); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

/* ---------- главная ---------- */
.intro { margin: 24px 0 0; }
.intro h1 { font-size: clamp(46px, 15vw, 66px); line-height: .9; overflow-wrap: anywhere; }
.intro .lede { margin-top: 12px; color: var(--text-2); font-size: 17px; max-width: 40ch; }
.intro .rating { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 15px; color: var(--text-2); }
.intro .rating .icon { width: 15px; height: 15px; color: var(--signal); fill: var(--signal); }

.photos { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 22px -20px 0; padding: 0 20px; scroll-snap-type: x mandatory; }
.photos::-webkit-scrollbar { display: none; }
.photos img { flex: none; width: 72%; max-width: 320px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; scroll-snap-align: start; background: var(--panel); }

.sec { margin-top: 34px; }
.sec > h2 { font-size: 32px; line-height: .95; }
.sec-note { color: var(--text-3); font-size: 15px; margin-top: 8px; }

/* ближайшее время — мини-табло */
.soon { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; margin: 16px 0 18px; }
.slot { display: grid; gap: 6px; justify-items: start; padding: 0; border: 0; background: none; text-align: left; }
.slot small { font-size: 13px; color: var(--text-3); }
.slot .flaps { font-size: clamp(16px, 5vw, 22px); }
.slot:active .fl { background: var(--signal); color: var(--ink); }
.slot.skeleton { height: 60px; border-radius: 8px; }

/* прайс */
.ledger { display: grid; margin-top: 12px; border-top: 1px solid var(--rule-2); }
.svc-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; width: 100%;
  padding: 16px 0; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left;
}
.svc-row b { font-size: 17px; font-weight: 500; line-height: 1.3; }
.svc-row .price { font: 700 22px/1 var(--display); font-stretch: 80%; white-space: nowrap; }
.svc-row small { grid-column: 1 / -1; color: var(--text-3); font-size: 14px; }
.svc-row p { grid-column: 1 / -1; color: var(--text-2); font-size: 14px; line-height: 1.45; max-width: 52ch; }
.svc-row:active { background: rgba(5, 7, 25, .2); }
.more-link { margin-top: 6px; padding-left: 0; color: var(--text); text-decoration: underline; text-decoration-color: var(--signal); text-underline-offset: 4px; }

.install-row { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 30px; padding: 14px 16px; border: 1px dashed var(--rule-2); border-radius: 14px; background: none; text-align: left; }
.install-row img { width: 44px; height: 44px; border-radius: 11px; }
.install-row b { display: block; font-weight: 600; }
.install-row small { color: var(--text-3); font-size: 14px; }

.contacts { margin-top: 12px; border-top: 1px solid var(--rule-2); }
.c-row { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.c-row > .icon { color: var(--signal); }
.c-row b { display: block; font-weight: 500; }
.c-row small { display: block; color: var(--text-3); font-size: 14px; }
.chev { color: var(--text-3); transition: transform .2s ease; }
details.hours summary { list-style: none; cursor: pointer; }
details.hours summary::-webkit-details-marker { display: none; }
details.hours[open] .chev { transform: rotate(90deg); }
.hours-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; padding: 10px 0 14px 34px; font-size: 15px; color: var(--text-2); border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.hours-grid .today { color: var(--signal); font-weight: 600; }

.footer { text-align: center; font-size: 13px; color: var(--text-3); margin: 36px 0 8px; }
.footer a { color: var(--text-2); }

/* ---------- страницы ---------- */
.page-title { margin: 24px 0 8px; }
.page-title h1 { font-size: 48px; line-height: .92; }
.page-title p { margin-top: 10px; color: var(--text-2); }

/* моя запись — талон с вырезами и временем на флипах */
.ticket {
  --notch: 12px; margin-top: 18px; background: var(--milk); color: var(--ink); border-radius: 16px;
  -webkit-mask: radial-gradient(circle var(--notch) at 0 var(--cut, 150px), #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% var(--cut, 150px), #0000 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle var(--notch) at 0 var(--cut, 150px), #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle var(--notch) at 100% var(--cut, 150px), #0000 98%, #000) right / 51% 100% no-repeat;
}
.ticket-top { height: 150px; padding: 18px 20px 0; border-bottom: 2px dashed rgba(15, 20, 51, .25); }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: #1d6b48; }
.state .dot { background: #1fa66a; }
.state.wait { color: #8a5a00; }
.state.wait .dot { background: #e0a400; }
.ticket-when { margin-top: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ticket-when .flaps { font-size: 34px; color: var(--text); --flap: #1b2156; --flap-2: #151a46; }
.ticket-when span { font-size: 15px; text-align: right; color: #3c4370; padding-bottom: 4px; }
.ticket-body { padding: 8px 20px 6px; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid rgba(15, 20, 51, .12); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: #4a5180; }
.kv b { font-weight: 500; text-align: right; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(15, 20, 51, .12); }
.actions > * { display: grid; justify-items: center; gap: 6px; padding: 14px 4px; border: 0; background: none; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink); }
.actions > * + * { border-left: 1px solid rgba(15, 20, 51, .12); }
.actions .icon { color: #4a5180; }
.cancel-link { display: flex; margin: 10px auto 0; color: var(--danger); }
.mine-list { display: grid; gap: 26px; }

.empty-state { text-align: left; padding: 24px 0 8px; }
.empty-state h3 { font: 800 30px/1 var(--display); font-stretch: 75%; }
.empty-state p { margin: 10px 0 20px; color: var(--text-2); }

/* ---------- нижние вкладки ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--panel); border-top: 1px solid var(--rule); padding-bottom: var(--safe-b); }
.tabbar nav { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar button {
  position: relative; min-height: 60px; border: 0; background: none; color: var(--text-3);
  display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 12px; font-weight: 500;
}
.tabbar button .icon { width: 22px; height: 22px; }
.tabbar button.on { color: var(--signal); }
.tabbar button.on::before { content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--signal); }
.tabbar .count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; }

/* ---------- шторка ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(4, 6, 20, .55); z-index: 40; opacity: 0; transition: opacity .24s ease; pointer-events: none; }
.backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-width: 520px; margin: 0 auto; max-height: 92dvh;
  display: flex; flex-direction: column; background: var(--panel); border-radius: 22px 22px 0 0;
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .6);
  transform: translateY(105%); transition: transform .34s var(--ease); visibility: hidden;
}
.sheet.open { transform: translateY(0); visibility: visible; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--rule-2); margin: 10px auto 0; flex: none; }
.sheet-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 20px 10px; flex: none; }
.sheet-head h2 { font: 800 32px/.95 var(--display); font-stretch: 75%; outline: none; }
.sheet-head p { margin-top: 6px; color: var(--text-3); font-size: 15px; }
.sheet-head .icon-btn { width: 40px; height: 40px; }
.sheet-body { overflow-y: auto; padding: 4px 20px 22px; overscroll-behavior: contain; flex: 1; }
.sheet-foot { padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--rule); flex: none; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 20px 12px; flex: none; }
.steps i { height: 4px; border-radius: 3px; background: var(--rule); }
.steps i.on { background: var(--signal); }

.pick-list { display: grid; border-top: 1px solid var(--rule-2); }
.pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: baseline; padding: 15px 0; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; width: 100%; }
.pick b { font-size: 17px; font-weight: 500; }
.pick small { grid-column: 1; color: var(--text-3); font-size: 14px; }
.pick .price { grid-row: 1; grid-column: 2; font: 700 21px/1 var(--display); font-stretch: 80%; white-space: nowrap; }

.svc-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 2px 0 14px; }
.svc-line b { font-size: 17px; font-weight: 600; }
.svc-line span { font: 700 20px/1 var(--display); font-stretch: 80%; white-space: nowrap; }
.days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 16px; padding: 2px 20px; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; width: 54px; padding: 8px 0 9px; border-radius: 10px; border: 0; background: var(--flap);
  display: grid; justify-items: center; gap: 2px;
}
.day small { font-size: 13px; color: var(--text-3); }
.day b { font: 700 22px/1 var(--display); font-stretch: 85%; }
.day.sel { background: var(--milk); color: var(--ink); }
.day.sel small { color: #4a5180; }
.day[disabled] { opacity: .3; cursor: default; }
.other-date { margin-bottom: 18px; }
.times { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.time {
  position: relative; min-height: 50px; border-radius: 8px; border: 0; overflow: hidden;
  background: linear-gradient(var(--flap) 0 50%, var(--flap-2) 50% 100%); font: 600 21px/1 var(--display); font-stretch: 85%;
}
.time::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .5); z-index: 0; }
.time span { position: relative; z-index: 1; }
.time.sel { background: var(--signal); color: var(--ink); }
.note { padding: 16px 0; color: var(--text-2); font-size: 15px; border-top: 1px solid var(--rule); }

.review { background: var(--milk); color: var(--ink); border-radius: 14px; padding: 4px 18px; margin-bottom: 16px; }
.review h3 { font: 800 26px/1 var(--display); font-stretch: 75%; padding: 16px 0 8px; }
.policy { color: var(--text-2); font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text-2); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--signal); flex: none; }
.consent a { color: var(--text); }
.back-link { display: flex; justify-content: center; margin-top: 4px; }

/* ---------- помощник ---------- */
.chat-log { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.chips button { border: 1px solid var(--rule-2); background: transparent; padding: 9px 14px; border-radius: 999px; font-size: 15px; min-height: 42px; }
.msg { max-width: 86%; padding: 11px 15px; border-radius: 18px; white-space: pre-line; font-size: 16px; line-height: 1.45; }
.msg.bot { background: var(--flap); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg.me { background: var(--milk); color: var(--ink); border-bottom-right-radius: 6px; align-self: flex-end; }
.typing { display: inline-flex; gap: 4px; padding: 15px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .25; } }
.sugg { display: grid; gap: 6px; }
.sugg button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; text-align: left; border: 0; background: var(--signal); color: var(--ink); }
.sugg b { display: block; font-size: 15px; font-weight: 600; }
.sugg small { color: #3c4370; font-size: 14px; }
.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form .field { flex: 1; margin: 0; }
.chat-form .field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.send { width: 54px; height: 54px; padding: 0; flex: none; }

/* ---------- установка на экран ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; border-radius: 12px; background: var(--flap); margin: 6px 0 18px; }
.seg button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; }
.seg button.on { background: var(--milk); color: var(--ink); }
.how { margin: 0; padding: 0; list-style: none; counter-reset: s; border-top: 1px solid var(--rule); }
.how li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--rule); counter-increment: s; font-size: 16px; }
.how li::before { content: counter(s); width: 28px; height: 28px; border-radius: 6px; flex: none; display: grid; place-items: center; background: var(--signal); color: var(--ink); font: 700 16px/1 var(--display); }
.app-badge { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; }
.app-badge img { width: 56px; height: 56px; border-radius: 14px; }
.app-badge small { color: var(--text-3); }

/* ---------- служебное ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translate(-50%, 12px); z-index: 90;
  background: var(--signal); color: var(--ink); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 15px;
  opacity: 0; transition: opacity .24s ease, transform .24s var(--ease); pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--rule); border-top-color: var(--signal); animation: spin .8s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--flap) 0%, rgba(238, 240, 255, .1) 50%, var(--flap) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- страница обработки данных студии ---------- */
.doc { padding-block: 24px 56px; }
.doc h1 { font-size: 44px; line-height: .95; margin: 8px 0 10px; }
.doc .sub { color: var(--text-2); margin: 0 0 18px; }
.doc section { padding: 18px 0; border-top: 1px solid var(--rule); }
.doc h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.doc p, .doc li { color: var(--text-2); font-size: 15px; line-height: 1.6; margin: 0 0 8px; max-width: 65ch; }
.doc ul { margin: 0; padding-left: 20px; }
.doc .back { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); font-weight: 500; }
