/* Mastly — стили сайта. Шрифт Golos Text хранится у нас (static/fonts, лицензия OFL): сайт не обращается к сторонним доменам. */
/* Тема «Небо» (1.7) — единая и только светлая (как в утверждённом макете): синий акцент на светло-сером,
   белые карточки, лёгкие тени. Синий = «можно нажать». Тёмный режим телефона тему не меняет.
   Контраст текста и белых надписей на кнопках — не ниже WCAG AA (4.5:1), проверено в тестах. */
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/static/fonts/golos-text-var.woff") format("woff");
}
:root {
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #eef1f7; --ink: #0f172a; --muted: #5d6578; --line: #e3e7ef;
  --accent: #3358e8; --accent-ink: #ffffff; --accent-soft: #e6ecff;
  --ok: #157347; --ok-soft: #e2f4ea; --warn: #8a5300; --warn-soft: #fcefd9; --bad: #c0261c; --bad-soft: #fde6e3;
  --hatch: rgba(15, 23, 42, .07);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .05);
  --backdrop: rgba(15, 23, 42, .38);
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r-s: 12px; --r-m: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.25; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.stack { display: grid; gap: 16px; align-content: start; }
.stack-s { display: grid; gap: 8px; align-content: start; }  /* в растянутой карточке строки не разъезжаются */
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }

/* шапка */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav a, .nav button { color: var(--ink); text-decoration: none; padding: 7px 12px; border-radius: 999px; font: 600 .9rem var(--font); border: 0; background: transparent; cursor: pointer; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav a:hover, .nav button:hover { background: var(--surface-2); }

main { max-width: 960px; margin: 0 auto; padding: 20px 16px 64px; }
.narrow { max-width: 480px; margin-inline: auto; }

/* карточки и блоки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px; }
.card-list { display: grid; gap: 10px; }
.flash { background: var(--ok-soft); color: var(--ok); border-radius: var(--r-s); padding: 10px 14px; font-weight: 600; }
.error-box { background: var(--bad-soft); color: var(--bad); border-radius: var(--r-s); padding: 10px 14px; font-weight: 600; }
.dev-box { border: 1px dashed var(--warn); color: var(--warn); border-radius: var(--r-s); padding: 8px 12px; font-size: .9rem; }
.demo-strip { background: var(--warn-soft); color: var(--warn); border-radius: var(--r-s); padding: 6px 12px; font-size: .85rem; font-weight: 600; text-align: center; }

/* формы */
label { font-weight: 600; font-size: .95rem; }
.field { display: grid; gap: 6px; }
.field .hint { font-size: .85rem; color: var(--muted); font-weight: 400; }
.field .err { color: var(--bad); font-size: .85rem; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=search], input[type=url],
input[type=number], input[type=time], input[type=date], select, textarea {
  width: 100%; font: 1rem var(--font); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-s); padding: 11px 12px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 90px; resize: vertical; }
input[type=file] { max-width: 100%; font: .95rem var(--font); color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.code-input { font: 600 1.6rem var(--mono); letter-spacing: .4em; text-align: center; }
.choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice label { border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; background: var(--surface); cursor: pointer; display: grid; gap: 2px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-s); padding: 10px 16px; font: 600 .95rem var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); border-color: var(--bad-soft); }
.btn.wide { width: 100%; padding: 13px 16px; font-size: 1rem; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font: 600 .9rem var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* статусы */
.pill { display: inline-flex; gap: 6px; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.idle { background: var(--surface-2); color: var(--muted); }

/* запись */
.hero-master { display: flex; gap: 14px; align-items: center; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; flex: none; }
.svc { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-s); padding: 12px 14px; text-decoration: none; color: var(--ink); }
.svc:hover { border-color: var(--accent); }
.svc[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.svc b { font-weight: 700; }
.days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.day { flex: none; min-width: 64px; text-align: center; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-s); padding: 8px 10px; text-decoration: none; color: var(--ink); line-height: 1.25; }
.day b { display: block; font-size: 1.1rem; }
.day span { font-size: .8rem; color: var(--muted); }
.day[aria-current="date"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day[aria-current="date"] span { color: var(--accent-ink); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.slot { border: 1.5px solid var(--accent); border-radius: var(--r-s); padding: 9px 0; text-align: center; color: var(--ink); text-decoration: none; font: 500 .95rem var(--mono); background: var(--surface); }
.slot:hover { background: var(--accent); color: var(--accent-ink); }
.summary { display: grid; gap: 6px; border: 1px dashed var(--line); border-radius: var(--r-s); padding: 12px; }
.summary div { display: flex; justify-content: space-between; gap: 10px; }
.summary .total { font-weight: 700; border-top: 1px solid var(--line); padding-top: 6px; }

/* кабинет */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.day-head { font-weight: 800; margin: 6px 0 4px; }
.bk { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.bk:first-child { border-top: 0; }
.bk .time { font: 500 .95rem var(--mono); }
.bk .time span { display: block; color: var(--muted); font-size: .85rem; }
.bk .main { display: grid; gap: 4px; min-width: 0; }
.share { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.share img { width: 132px; height: 132px; background: #fff; border-radius: 8px; padding: 6px; }
.hours-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-top: 0; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.legal { max-width: 70ch; }
.legal h2 { margin-top: 18px; }
.legal p, .legal li { margin-top: 8px; }
footer { max-width: 960px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: .85rem; display: flex; gap: 14px; flex-wrap: wrap; }
.htmx-request .htmx-indicator { opacity: 1; } .htmx-indicator { opacity: 0; transition: opacity .2s; }

@media (max-width: 560px) {
  h1 { font-size: 1.35rem; }
  .bk { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .share { grid-template-columns: minmax(0, 1fr); }
  .hours-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hours-row .day-name { grid-column: 1 / -1; }
  .choice { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.legend { font-size: .875rem; color: var(--muted); margin-bottom: 6px; }
.grid-auto { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.maxw { max-width: 640px; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 14px; }

/* перерывы, выбор окна мастером */
.bk.off { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--hatch) 6px 8px); border-radius: var(--r-s); padding-inline: 8px; }
.slot-pick label { position: relative; cursor: pointer; }
.slot-pick input { position: absolute; opacity: 0; pointer-events: none; }
.slot-pick label:has(input:checked) { background: var(--accent); color: var(--accent-ink); }
.slot-pick label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
button.slot { cursor: pointer; }
.choice label { position: relative; }

/* форма перерыва: показываем только поля выбранного режима (без JavaScript) */
.to-form:has(input[name=mode][value=days]:checked) .only-hours { display: none; }
.to-form:has(input[name=mode][value=hours]:checked) .only-days { display: none; }
/* карточки тарифов: кнопки на одной линии */
.plan { display: flex; flex-direction: column; gap: 8px; }
.plan .btn { margin-top: auto; }
/* аналитика мастера */
.stat { font: 800 1.5rem var(--font); font-variant-numeric: tabular-nums; margin: 2px 0; }
.bar-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.hbar { width: 100%; height: 8px; display: block; background: var(--surface-2); border-radius: 2px; }
.hbar rect { fill: var(--accent); }
.narrow-input { max-width: 110px; padding: 7px 10px; }

/* ---------- вход и регистрация ---------- */
.auth-layout { display: grid; grid-template-columns: minmax(0, 460px); justify-content: center; gap: 24px; align-items: start; }
.auth-layout.with-side { grid-template-columns: minmax(0, 460px) minmax(0, 340px); }
@media (max-width: 820px) { .auth-layout.with-side { grid-template-columns: minmax(0, 460px); } .auth-layout .perks { order: -1; } }
.auth-card { display: grid; gap: 16px; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 16px; }
fieldset.plain[hidden] { display: none; }
/* ползунки: сегментированный переключатель с «едущей» подложкой */
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.seg a { position: relative; z-index: 1; text-align: center; padding: 9px 10px; border-radius: 999px; font-weight: 700; color: var(--muted); text-decoration: none; transition: color .2s; }
.seg a[aria-checked="true"] { color: var(--accent-ink); }
.seg .thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--accent); transition: transform .25s cubic-bezier(.3, .7, .4, 1); }
.seg[data-pos="1"] .thumb { transform: translateX(100%); }
.seg.role .thumb { background: var(--ink); }
.seg.role a[aria-checked="true"] { color: var(--bg); }
@media (prefers-reduced-motion: reduce) { .seg .thumb, .seg a { transition: none; } }
.pw { position: relative; }
.pw input { padding-right: 84px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; padding: 6px 8px; color: var(--muted); font: 600 .8rem var(--font); }
.meter { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s, background .2s; }
.meter i[data-level="2"] { background: var(--warn); }
.meter i[data-level="3"], .meter i[data-level="4"] { background: var(--ok); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }
.perks { background: var(--accent-soft); border-radius: var(--r-m); padding: 20px; display: grid; gap: 14px; align-content: start; }
.perks ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.perks li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.perks li b { display: block; }
.perks .ic { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.mailbox { border: 1px dashed var(--line); border-radius: var(--r-s); padding: 14px; background: var(--surface-2); display: grid; gap: 8px; }

/* ---------- каналы напоминаний ---------- */
.channels { display: grid; gap: 10px; }
.ch { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; background: var(--surface); }
.ch .logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: .85rem; }
.ch .logo.email { background: #6b5e6d; } .ch .logo.telegram { background: #2a9fd8; } .ch .logo.max { background: #5b3df5; }
.ch .logo.webpush { background: #1d7550; } .ch .logo.whatsapp { background: #25a35a; }
.ch.off { opacity: .65; }
.ch form { margin: 0; }
@media (max-width: 480px) { .ch { grid-template-columns: 40px minmax(0, 1fr); } .ch > :last-child { grid-column: 1 / -1; justify-self: start; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mailbox form.row input[type=email] { flex: 1 1 220px; width: auto; }
.mt-s { margin-top: 10px; }
.dev-letter { white-space: pre-wrap; word-break: break-word; margin: 0; }

/* ---------- поиск с подсказками: город, клиент ---------- */
.pick { position: relative; }
.pick-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s);
  box-shadow: 0 12px 32px rgba(36, 26, 38, .14); max-height: min(320px, 50vh); overflow-y: auto; }
.pick-list li { display: grid; gap: 1px; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.pick-list li[aria-selected="true"] { background: var(--accent-soft); }
@media (hover: hover) { .pick-list li[data-i]:hover { background: var(--surface-2); } }
.pick-list li .sub { font-size: .8rem; color: var(--muted); }
.pick-list mark { background: none; color: var(--accent); font-weight: 700; }
.pick-list .pick-empty { color: var(--muted); cursor: default; font-size: .9rem; }
details.pick-more summary { cursor: pointer; color: var(--accent); font-size: .875rem; font-weight: 600; width: fit-content; }
details.pick-more summary::marker { color: var(--muted); }
.slug-row { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); overflow: hidden; }
.slug-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.slug-prefix { display: flex; align-items: center; padding: 0 4px 0 12px; color: var(--muted); font-size: .9rem; white-space: nowrap; background: var(--surface-2);
  flex: 0 1 auto; min-width: 0; max-width: 62%; overflow: hidden; direction: rtl; }  /* длинный домен (тестовый туннель) обрезается слева: «…/m/» видно всегда */
.slug-prefix > span { direction: ltr; unicode-bidi: isolate; }
.slug-row input { border: 0; border-radius: 0; box-shadow: none !important; min-width: 0; }
.slug-prefix { max-width: 55%; overflow: hidden; text-overflow: ellipsis; }

/* ---------- услуга: депозит и пометка о цене ---------- */
.choice-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .choice-3 { grid-template-columns: minmax(0, 1fr); } }
.choice label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.dep .only-fixed, .dep .only-percent, .dep .dep-only { display: none; }
.dep:has(input[name=deposit_kind][value=fixed]:checked) .only-fixed,
.dep:has(input[name=deposit_kind][value=percent]:checked) .only-percent { display: grid; }
.dep:has(input[name=deposit_kind][value=fixed]:checked) .dep-only,
.dep:has(input[name=deposit_kind][value=percent]:checked) .dep-only { display: flex; }
.hint.block { display: block; font-size: .85rem; color: var(--muted); font-weight: 400; }
.price-note { color: var(--accent); font-weight: 800; margin-left: 2px; }
.nowrap { white-space: nowrap; }
.svc-card summary { cursor: pointer; list-style: none; }
.svc-card summary::-webkit-details-marker { display: none; }

/* ---------- приглашение коллеги ---------- */
.ref-card { border-color: var(--accent-soft); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.ref-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.ref-steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; display: grid; gap: 2px; }
.ref-steps b { color: var(--accent); font-size: 1.15rem; }
.ref-steps span { font-size: .85rem; color: var(--muted); }
.grow { flex: 1 1 220px; width: auto; }
.svc .price { display: grid; justify-items: end; text-align: right; gap: 1px; flex: none; }
.svc .price .small { font-size: .75rem; }
.summary .price-hint { display: block; }

/* ---------- календарь на 2 недели ---------- */
.cal-grid { display: grid; gap: 6px; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head span { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-day { display: grid; grid-template-rows: auto 1fr auto; gap: 4px; min-height: 72px; padding: 8px; border-radius: var(--r-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; min-width: 0; }
a.cal-day:hover { border-color: var(--accent); }
.cal-day.outside { background: transparent; border-style: dashed; color: var(--muted); opacity: .5; }
.cal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.cal-top b { font-size: 1rem; }
.cal-now { font-size: .65rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .03em; }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal-meta { font-size: .78rem; color: var(--muted); align-self: center; line-height: 1.2; }
.cal-meta b { color: var(--ink); font-size: .95rem; }
.cal-add { color: var(--accent); font-weight: 800; }
.cal-bar { width: 100%; height: 4px; display: block; background: var(--surface-2); border-radius: 2px; }
.cal-bar rect { fill: var(--muted); }
.cal-day.some .cal-bar rect { fill: var(--ok); }
.cal-day.busy .cal-bar rect { fill: var(--warn); }
.cal-day.full .cal-bar rect { fill: var(--accent); }
.cal-day.full { background: var(--accent-soft); }
.cal-day.off { background: repeating-linear-gradient(135deg, var(--surface) 0 6px, var(--hatch) 6px 8px); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--surface-2); border: 1px solid var(--line); }
.dot.some { background: var(--ok); border-color: var(--ok); } .dot.busy { background: var(--warn); border-color: var(--warn); }
.dot.full { background: var(--accent); border-color: var(--accent); }
.dot.off { background: repeating-linear-gradient(135deg, var(--surface) 0 3px, var(--muted) 3px 4px); }
.bk-note { background: var(--surface-2); border-radius: 6px; padding: 6px 8px; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .cal-row { gap: 4px; } .cal-grid { gap: 4px; }
  .cal-day { min-height: 58px; padding: 6px 5px; }
  .cal-word, .cal-now, .cal-offtxt { display: none; }
  .cal-meta { font-size: .72rem; }
}

/* ---------- запись клиента мастером: постоянный / новый ---------- */
[hidden] { display: none !important; }
.stack-xs { display: grid; gap: 2px; min-width: 0; }
.client-mode:has(input[name=client_mode][value=new]:checked) .only-existing,
.client-mode:has(input[name=client_mode][value=existing]:checked) .only-new { display: none; }
.client-mode .seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 420px) { .client-mode .seg-2 label { padding: 10px; } .client-mode .seg-2 .small { display: none; } }
/* Без скрипта — обычный список; со скриптом — поиск и карточка выбранного клиента. */
[data-client-pick]:not(.js-on) .pick, [data-client-pick]:not(.js-on) [data-client-chosen] { display: none !important; }
[data-client-pick].js-on .client-select { display: none; }
.client-chosen { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--r-s); padding: 10px 12px; }
.note-field textarea { min-height: 76px; }
.tpl-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px;
  border: 1px dashed var(--accent); background: var(--accent-soft); border-radius: var(--r-s); padding: 12px; }

/* ---------- аналитика: кликабельные карточки и детализация ---------- */
a.stat-card { display: grid; gap: 2px; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
a.stat-card:hover { border-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { a.stat-card:hover { transform: translateY(-1px); } }
a.stat-card.warn .stat { color: var(--warn); }
.stat-more { margin-top: 6px; font-size: .85rem; font-weight: 700; color: var(--accent); }
.metric-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.metric-tabs a { flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-weight: 700; font-size: .9rem; text-decoration: none; }
.metric-tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.summary-strip { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.summary-strip > div { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; }
table.list th.num, table.list td.num { text-align: right; }
.invite-pill { width: fit-content; }
/* подсказки вне .field (группы радиокнопок, fieldset) — тем же мелким серым шрифтом */
.hint { font-size: .85rem; color: var(--muted); font-weight: 400; }
input[readonly] { background: var(--surface-2); color: var(--muted); }

/* ---------- 1.5: салон, фото, специализации, разделы ---------- */
.salon-head { display: flex; align-items: center; gap: 12px; }
.salon-logo { width: 56px; height: 56px; border-radius: var(--r-s); object-fit: cover; border: 1px solid var(--line); background: var(--surface); }
.salon-name { font-size: 1.05rem; }
.avatar.photo { object-fit: cover; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .8rem; font-weight: 700; }
.chip-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .9rem; }
.chip-check input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.media-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.media-item { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.media-thumb { width: 96px; height: 96px; flex: none; border-radius: var(--r-s); object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); }
.media-thumb.round { border-radius: 50%; }
.media-thumb.empty { display: grid; place-items: center; color: var(--muted); font: 700 1.6rem var(--font); }
.media-item input[type=file] { flex: 1 1 180px; min-width: 0; max-width: 100%; font-size: .85rem; }
.media-item > .stack-s { min-width: 0; flex: 1 1 0; }
.media-item form.row { flex-wrap: wrap; }
@media (max-width: 520px) { .media-thumb { width: 64px; height: 64px; } .media-item { gap: 10px; } }
.sec-row { flex-wrap: nowrap; gap: 6px; }
.sec-row input[type=text] { min-width: 0; }
@media (max-width: 560px) { .sec-row { flex-wrap: wrap; } }
.sec-title { margin-top: 6px; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.client-head { display: flex; gap: 14px; align-items: center; }
.client-ava { width: 72px; height: 72px; }
.client-cell { display: flex; gap: 10px; align-items: flex-start; }
.client-mini { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.client-filter select { width: auto; flex: 0 1 180px; }
a.chip { text-decoration: none; }

/* ---- выбор языка ---- */
.lang-pick { position: relative; }
.lang-pick > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; cursor: pointer; font: 600 .85rem var(--font); color: var(--ink); }
.lang-pick > summary::-webkit-details-marker { display: none; }
.lang-pick > summary:hover, .lang-pick[open] > summary { background: var(--surface-2); }
.lang-pick svg { width: 16px; height: 16px; }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; min-width: 180px; max-height: 70vh; overflow: auto;
  background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgb(0 0 0 / .12); }
.lang-list button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink); font: 500 .92rem var(--font); cursor: pointer; }
.lang-list button:hover, .lang-list button:focus-visible { background: var(--surface-2); }
.lang-list button[aria-current="true"] { background: var(--surface-2); font-weight: 700; }
.lang-list button[aria-current="true"]::after { content: " ✓"; color: var(--accent); }

/* элементы стопок не раздвигают страницу на телефоне (длинные слова, поля файлов, команды) */
.stack > *, .stack-s > * { min-width: 0; }

/* ---- тема «Небо» (1.7): карточки — тень вместо рамки, кнопки чуть квадратнее, крупные цифры ---- */
.card { border-color: transparent; box-shadow: var(--shadow); }
.btn, button.btn, a.btn { border-radius: var(--r-s); }
input, select, textarea { border-radius: var(--r-s); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
body { letter-spacing: -.005em; }
h1, h2 { letter-spacing: -.02em; }

/* ---- «Расписание» (1.7): день крупно → полоса дней → три цифры → лента дня ---- */
.desk-only { display: inline-flex; }
.sched { gap: 14px; }
.sched-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.sched-wd { color: var(--muted); font-size: .9rem; font-weight: 500; }
.sched-head h1 { font-size: 1.75rem; letter-spacing: -.02em; }
.daystrip { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 6px; margin-inline: -2px;
  scrollbar-width: none; }
.daystrip::-webkit-scrollbar { display: none; }
.ds { flex: none; scroll-snap-align: start; width: 52px; display: grid; justify-items: center; gap: 1px; padding: 7px 0 6px;
  border-radius: 14px; text-decoration: none; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.ds span { font-size: .68rem; color: var(--muted); font-weight: 600; text-transform: lowercase; }
.ds b { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ds-dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.ds-dot.free, .ds-dot.some { background: var(--accent); opacity: .45; }
.ds-dot.busy { background: var(--accent); opacity: .75; }
.ds-dot.full { background: var(--accent); }
.ds.off { background: transparent; box-shadow: none; color: var(--muted); }
.ds.off b { color: var(--muted); }
.ds[aria-current="date"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 14px rgba(51, 88, 232, .28); }
.ds[aria-current="date"] span, .ds[aria-current="date"] b { color: var(--accent-ink); }
.ds[aria-current="date"] .ds-dot { background: var(--accent-ink); opacity: .9; }
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats3 > div { background: var(--surface); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); display: grid; gap: 1px; min-width: 0; }
.stats3 b { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats3 span { font-size: .78rem; color: var(--muted); }
.tl { display: grid; gap: 8px; }
.ap { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--surface);
  border-radius: 14px; padding: 11px 12px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.ap time { font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ap time small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); }
.ap-main { display: grid; gap: 1px; min-width: 0; }
.ap-main b { font-weight: 600; overflow-wrap: anywhere; }
.ap-main > span { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.ap-main .bk-note { color: var(--ink); background: var(--surface-2); border-radius: 8px; padding: 3px 8px; margin-top: 3px; font-size: .82rem; }
.ap-tags { display: grid; gap: 4px; justify-items: end; align-self: start; }
.bk-item { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; position: relative; overflow: hidden; }
.bk-item::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.bk-item.inactive { opacity: .6; }
.bk-item.inactive::before { background: var(--line); }
.ap-link { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 12px; color: inherit; text-decoration: none; }
.ap-link:hover { background: var(--surface-2); }
.ap-actions { display: flex; gap: 8px; padding: 0 12px 11px 80px; flex-wrap: wrap; }
.ap.free { background: transparent; box-shadow: none; border: 1.5px dashed #c5cfe3; }
.ap.free b { color: var(--accent); }
.ap.free:hover { background: var(--accent-soft); border-color: var(--accent); }
.ap-plus { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.ap.closed { background: repeating-linear-gradient(135deg, var(--surface) 0 8px, var(--surface-2) 8px 10px); box-shadow: none; grid-template-columns: 58px minmax(0, 1fr); }
.ap.empty-day { grid-template-columns: minmax(0, 1fr); text-align: left; }
.ap.empty-day > div { display: grid; gap: 8px; }
.share-mini .share-url { overflow-wrap: anywhere; }
.qr-more summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .92rem; }
.qr-more img { margin-top: 10px; background: #fff; border-radius: 12px; padding: 8px; box-shadow: var(--shadow); }

/* ---- меню на телефоне (1.6): нижняя панель (A1) или плитки (A4) — выбор в «Ещё» или в меню профиля ---- */
.tabbar, .fab, .avatar-menu, .mobile-only { display: none; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.tile { display: grid; gap: 4px; align-content: start; background: var(--surface); border-radius: var(--r-m); padding: 14px 16px;
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none; min-height: 96px; }
.tile:hover { box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.tile-n { font: 800 1.7rem/1 var(--font); color: var(--accent); font-variant-numeric: tabular-nums; }
.tile-m { color: var(--muted); font-size: .85rem; }
.back-home { font-weight: 700; text-decoration: none; margin-bottom: 10px; }
@media (max-width: 760px) {
  .nav .desk { display: none; }
  .has-tabbar .desk-only { display: none; }
  .sched-head h1 { font-size: 1.6rem; }
  .mobile-only { display: inline-block; }
  .has-tabbar main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .has-tabbar footer { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  .has-tabbar .tabs, body:not(.has-tabbar) .tabs { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px max(4px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); }
  .tabbar > a, .tabbar summary { display: grid; justify-items: center; gap: 2px; padding: 5px 0; color: var(--muted); text-decoration: none;
    font: 600 .68rem/1.1 var(--font); cursor: pointer; list-style: none; text-align: center; }
  .tabbar summary::-webkit-details-marker { display: none; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar [aria-current="page"], .tab-more[open] summary { color: var(--accent); }
  .tabbar [aria-current="page"] svg, .tab-more[open] summary svg { background: var(--accent-soft); border-radius: 999px; padding: 3px 14px; box-sizing: content-box; }
  .tabbar > a svg, .tabbar summary svg { padding: 3px 14px; box-sizing: content-box; }
  .tab-more .sheet { position: fixed; inset: auto 0 calc(64px + env(safe-area-inset-bottom, 0px)) 0; z-index: 22; background: var(--surface);
    border-radius: 22px 22px 0 0; box-shadow: 0 -12px 30px rgba(0, 0, 0, .18); padding: 12px max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px));
    display: grid; gap: 2px; max-height: 70vh; overflow: auto; }
  .tab-more .sheet a, .tab-more .sheet button { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%;
    padding: 12px 10px; border: 0; border-radius: 12px; background: none; color: var(--ink); text-decoration: none; font: 600 1rem var(--font); cursor: pointer; text-align: left; }
  .tab-more .sheet a:hover, .tab-more .sheet button:hover, .tab-more .sheet a[aria-current="page"] { background: var(--accent-soft); }
  body:has(.tab-more[open]) .fab { display: none; }
  .tab-more[open] summary::before { content: ""; position: fixed; inset: 0; z-index: 18; background: var(--backdrop); }
  .tab-more[open] summary { position: relative; z-index: 21; } /* фон — внутри summary (слой 21), лист выше (22), иначе фон перехватывает нажатия */
  .fab { display: grid; place-items: center; position: fixed; z-index: 21; right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(78px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; border-radius: 50%; background: var(--accent);
    color: var(--accent-ink); font: 700 30px/1 var(--font); text-decoration: none; box-shadow: 0 8px 20px rgba(0, 0, 0, .22); }
  .avatar-menu { display: block; position: relative; }
  .avatar-menu summary { list-style: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
    background: var(--accent-soft); color: var(--accent); font-weight: 800; }
  .avatar-menu summary::-webkit-details-marker { display: none; }
  .menu-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 220px; background: var(--surface); border-radius: 16px;
    padding: 6px; box-shadow: 0 14px 34px rgba(0, 0, 0, .2); display: grid; }
  .menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 11px 12px; border: 0; border-radius: 10px; background: none;
    color: var(--ink); text-decoration: none; font: 600 .95rem var(--font); cursor: pointer; }
  .menu-pop a:hover, .menu-pop button:hover { background: var(--accent-soft); }
  .top-in { flex-wrap: nowrap; }
}

/* ---- перенос по согласию клиента (1.8) ---- */
.offer-box { border: 1.5px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.offer-opt { justify-content: flex-start; gap: 6px; }
.picked { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.picked li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.steps { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--muted); }
.pick-slots .slot { text-decoration: none; display: grid; place-items: center; }
.pick-slots .slot.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pick-slots .slot.disabled { opacity: .4; border-style: dashed; }
.own-time summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.own-time form { margin-top: 10px; }
.own-time input[type=time] { width: auto; flex: 1; min-width: 0; }
