/* Клиентское приложение студии. Тот же образ, что у сервиса: лист журнала записи —
   бумага, чернила, линейки. Фирменный цвет студии (--brand) отмечает выбранное время и главную кнопку.
   Файл самостоятельный: кабинет владельца живёт на styles.css и его не задевает. */
:root {
  --brand: #2d6be4;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 13%, #fff);
  --paper: #f4f6f9;
  --sheet: #ffffff;
  --ink: #172036;
  --ink-2: #4b5671;
  --ink-3: #6f7a92;
  --rule: #e1e6ee;
  --rule-2: #c9d2de;
  --ok: #17845a;
  --warn: #b26a00;
  --danger: #c93a34;
  --focus: #2d6be4;
  --font: Geologica, "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: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { scroll-padding-bottom: calc(96px + var(--safe-b)); -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh; background: var(--paper); color: var(--ink);
  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.12; font-weight: 700; }
p { margin: 0; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); 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 { letter-spacing: -.035em; font-variation-settings: "SHRP" 100; }

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

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 22px; border: 0; border-radius: 14px;
  background: var(--brand); color: var(--brand-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(.95); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule-2); }
.btn.ink { background: var(--ink); color: #fff; }
.btn .icon { width: 18px; height: 18px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--rule-2); background: var(--sheet); color: var(--ink);
  display: grid; place-items: center; flex: none;
}
.link-btn { border: 0; background: none; color: var(--ink-2); font-weight: 500; padding: 10px 6px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.link-btn:active { color: var(--ink); }

/* ---------- поля ---------- */
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 15px; font-weight: 500; }
.field label em { font-style: normal; color: var(--ink-3); font-weight: 400; }
.input {
  width: 100%; min-height: 54px; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--rule-2);
  background: var(--sheet); outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: #98a2b6; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(45, 107, 228, .22); }
.input[aria-invalid="true"] { border-color: var(--danger); }
textarea.input { min-height: 88px; resize: vertical; }
.err { color: var(--danger); font-size: 14px; font-weight: 500; }

/* ---------- шапка ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: calc(14px + var(--safe-t)) 0 0; }
.mark {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 14px;
}
.mark.logo { background: #fff; padding: 3px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--rule-2); }
.mark.logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.topbar .sp { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--rule-2); border-radius: 999px; background: var(--sheet); font-size: 15px; font-weight: 500; }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

/* ---------- главная ---------- */
/* логотип и название в одну строку; шапки над ними нет */
.intro { margin: calc(22px + var(--safe-t)) 0 0; }
.intro-head { display: flex; align-items: center; gap: 14px; }
.intro-head .mark { width: 56px; height: 56px; border-radius: 15px; font-size: 18px; }
.intro-head .mark.logo img { border-radius: 11px; }
.intro h1 { flex: 1; min-width: 0; font-size: clamp(26px, 7.65vw, 37px); line-height: 1; overflow-wrap: anywhere; }
.page-title:first-child { margin-top: calc(22px + var(--safe-t)); }
.intro .lede { margin-top: 12px; color: var(--ink-2); font-size: 17px; max-width: 40ch; }
.facts-line { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 15px; }
.facts-line span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.off { background: var(--danger); }
.facts-line .icon { width: 15px; height: 15px; color: var(--ink); }

.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(--rule); }

.sec { margin-top: 36px; }
.sec > h2 { font-size: 22px; letter-spacing: -.025em; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.sec-note { color: var(--ink-2); font-size: 15px; margin-top: 10px; }

/* ближайшие окна: крупное время — главное на экране */
.soon { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 16px; }
.slot {
  display: grid; gap: 1px; justify-items: start; padding: 10px 12px; border: 1px solid var(--rule-2); border-radius: 12px;
  background: var(--sheet); text-align: left;
}
.slot small { font-size: 13px; color: var(--ink-3); }
.slot b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.slot:active { border-color: var(--brand); background: var(--brand-soft); }
.slot.skeleton { height: 64px; border: 0; }

/* прайс — строки журнала */
.ledger { display: grid; }
.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-size: 17px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.svc-row small { grid-column: 1 / -1; color: var(--ink-3); font-size: 14px; }
.svc-row p { grid-column: 1 / -1; color: var(--ink-2); font-size: 14px; line-height: 1.45; max-width: 52ch; }
.svc-row:active { background: var(--brand-soft); }
.more-link { margin-top: 6px; padding-left: 0; }

.install-row { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 28px; 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(--ink-2); font-size: 14px; }

.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(--ink-2); }
.c-row b { display: block; font-weight: 500; }
.c-row small { display: block; color: var(--ink-3); font-size: 14px; }
.chev { color: var(--ink-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(--ink-2); border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.hours-grid .today { color: var(--ink); font-weight: 600; }

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

/* ---------- страницы ---------- */
.page-title { margin: 26px 0 8px; }
.page-title h1 { font-size: 36px; }
.page-title p { margin-top: 8px; color: var(--ink-2); }

/* моя запись — талон: время крупно */
.ticket { margin-top: 18px; background: var(--sheet); border: 1px solid var(--rule-2); border-radius: 18px; overflow: hidden; }
.ticket-top { padding: 18px 20px 16px; border-bottom: 1px dashed var(--rule-2); }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.state .dot { background: var(--ok); }
.state.wait { color: var(--warn); }
.state.wait .dot { background: var(--warn); }
.ticket-when { margin-top: 10px; }
.ticket-when b { display: block; font-size: 56px; line-height: .95; font-weight: 700; letter-spacing: -.045em; font-variation-settings: "SHRP" 100; font-variant-numeric: tabular-nums; }
.ticket-when span { display: block; margin-top: 6px; font-size: 17px; }
.ticket-body { padding: 6px 20px 8px; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--ink-2); }
.kv b { font-weight: 500; text-align: right; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); }
.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 var(--rule); }
.actions .icon { color: var(--ink-2); }
.ticket-call { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--sheet); border: 1px solid var(--rule-2); text-decoration: none; }
.ticket-call b { display: block; font-weight: 500; }
.ticket-call small { color: var(--ink-3); }
.cancel-link { display: flex; margin: 10px auto 0; color: var(--danger); }
.mine-list { display: grid; gap: 26px; }

.empty-state { text-align: left; padding: 28px 0 8px; }
.empty-state h3 { font-size: 22px; letter-spacing: -.02em; }
.empty-state p { margin: 8px 0 20px; color: var(--ink-2); }

/* ---------- нижние вкладки ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--sheet) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--rule-2); 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(--ink-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(--ink); }
.tabbar button.on::before { content: ""; position: absolute; top: -1px; left: 26%; right: 26%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.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(23, 32, 54, .42); 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(--sheet); border-radius: 22px 22px 0 0;
  box-shadow: 0 -16px 48px -24px rgba(23, 32, 54, .5);
  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-size: 24px; letter-spacing: -.03em; font-variation-settings: "SHRP" 100; outline: none; }
.sheet-head p { margin-top: 4px; color: var(--ink-2); 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 10px; flex: none; }
.steps i { height: 3px; border-radius: 3px; background: var(--rule); }
.steps i.on { background: var(--ink); }

.pick-list { display: grid; }
.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(--ink-3); font-size: 14px; }
.pick .price { grid-row: 1; grid-column: 2; font-weight: 600; white-space: nowrap; }
.pick:active { background: var(--brand-soft); }

.svc-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 0 14px; }
.svc-line b { font-size: 17px; font-weight: 600; }
.svc-line span { color: var(--ink-2); white-space: nowrap; }
.days { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px 14px; padding: 2px 20px; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; width: 54px; padding: 9px 0 8px; border-radius: 12px; border: 1px solid var(--rule-2); background: var(--sheet);
  display: grid; justify-items: center; gap: 2px;
}
.day small { font-size: 13px; color: var(--ink-3); }
.day b { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.day.sel { background: var(--ink); border-color: var(--ink); color: #fff; }
.day.sel small { color: rgba(255, 255, 255, .75); }
.day[disabled] { opacity: .35; cursor: default; }
.other-date { margin-bottom: 18px; }
.times { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.time { min-height: 48px; border-radius: 12px; border: 1px solid var(--rule-2); background: var(--sheet); font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.time.sel { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.note { padding: 16px 0; color: var(--ink-2); font-size: 15px; border-top: 1px solid var(--rule); }

.review { border: 1px solid var(--rule-2); border-radius: 16px; padding: 4px 18px; margin-bottom: 16px; }
.review h3 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; padding: 14px 0 6px; }
.policy { color: var(--ink-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(--ink-2); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.consent a { color: var(--ink); }
.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: var(--sheet); 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(--paper); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg.me { background: var(--ink); color: #fff; 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(--ink-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: 14px; text-align: left; border: 1.5px solid var(--brand); background: var(--brand-soft); }
.sugg b { display: block; font-size: 15px; font-weight: 600; }
.sugg small { color: var(--ink-2); 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(--paper); border: 1px solid var(--rule-2); margin: 6px 0 18px; }
.seg button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.seg button.on { background: var(--ink); color: #fff; }
.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: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; }
.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(--ink-2); }

/* ---------- служебное ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translate(-50%, 12px); z-index: 90;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 500; 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(--ink); animation: spin .8s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--rule) 0%, #eef1f5 50%, var(--rule) 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: 30px; margin: 8px 0 6px; }
.doc .sub { color: var(--ink-2); margin: 0 0 18px; }
.doc section { padding: 18px 0; border-top: 1px solid var(--rule-2); }
.doc h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.doc p, .doc li { color: var(--ink-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(--ink-2); font-weight: 500; }
