/* Тема Skitto Tattoo: нежно-розовый фон, белые карточки, малиновый акцент.
   Все цвета заданы переменными. Тёмная тема ниже меняет только их значения:
   те же розовые и малиновые оттенки, но на глубоком винном фоне. */
:root {
  color-scheme: light;
  --bg: #FBE9EE;
  --card: #FFFFFF;
  --powder: #F6D5DF;
  --stripe: #F8E1E8;
  --line: #F3D3DD;
  --pink: #EBBFCC;
  --dash: #D79AAE;
  /* Рамки полей, чипов и кнопок с обводкой: заметнее, чем --pink, чтобы их было видно на светлом фоне. */
  --edge: #C17E96;
  /* Тонкая рамка карточки: в светлой теме не нужна, в тёмной отделяет карточку от фона. */
  --card-edge: transparent;
  --bar: #F0B8C9;
  --accent: #C42B62;   /* акцент в тексте, значках и рамках */
  --fill: #C42B62;     /* заливка кнопок, на ней белый текст */
  --ink: #2A1A21;
  --muted: #654652;
  --plum: #7A3E6B;
  --err: #8E1F45;
  --paper: #FFFFFF;    /* лист под эскизом */
  --toast-bg: #2A1A21;
  --toast-ink: #FFFFFF;
  --scrim: rgba(42, 26, 33, 0.45);
  --scrim-deep: rgba(42, 26, 33, 0.92);
  --glow-a: #FFFFFF;
  --glow-b: #F3BFD0;
  --shade: rgba(196, 43, 98, 0.1);
  --dragon-body: #EBBFCC;
  --dragon-detail: #D79AAE;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-hi: rgba(255, 255, 255, 0.9);
  --glass-sheen: rgba(255, 255, 255, 0.55);
  --glass-shadow: rgba(122, 30, 70, 0.12);
  --glass-edge-a: rgba(255, 255, 255, 0.95);
  --glass-edge-b: rgba(235, 191, 204, 0.75);
  --glass-edge-c: rgba(196, 43, 98, 0.35);
  --glass-ring: rgba(255, 255, 255, 0.9);
  --pill-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(251, 233, 238, 0.85));
  --pill-edge: rgba(196, 43, 98, 0.16);
  --pill-shadow: rgba(196, 43, 98, 0.16);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-top: max(env(safe-area-inset-top, 0px), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1A1015;
  --card: #30202A;
  --powder: #3A2430;
  --stripe: #312029;
  --line: #3F2A34;
  --pink: #5A3947;
  --dash: #8C5D6F;
  --edge: #7A5262;
  --card-edge: rgba(255, 255, 255, 0.06);
  --bar: #6B3A4D;
  --accent: #F27FA5;
  --fill: #C42B62;
  --ink: #FBE9EE;
  --muted: #D4B6C2;
  --plum: #DDA6D0;
  --err: #FF9DB5;
  --paper: #E9DCE1;    /* эскизы нарисованы на белом: в тёмной теме лист чуть приглушён, чтобы не слепил */
  --toast-bg: #FBE9EE;
  --toast-ink: #2A1A21;
  --scrim: rgba(8, 4, 6, 0.62);
  --scrim-deep: rgba(8, 4, 6, 0.94);
  --glow-a: rgba(196, 43, 98, 0.2);
  --glow-b: rgba(122, 62, 107, 0.42);
  --shade: rgba(0, 0, 0, 0.28);
  --dragon-body: #7E4864;
  --dragon-detail: #BC7C9C;
  --glass: rgba(40, 26, 33, 0.55);
  --glass-hi: rgba(255, 255, 255, 0.12);
  --glass-sheen: rgba(255, 255, 255, 0.07);
  --glass-shadow: rgba(0, 0, 0, 0.35);
  --glass-edge-a: rgba(255, 255, 255, 0.28);
  --glass-edge-b: rgba(255, 255, 255, 0.08);
  --glass-edge-c: rgba(242, 127, 165, 0.45);
  --glass-ring: rgba(40, 26, 33, 0.9);
  --pill-bg: linear-gradient(180deg, rgba(242, 127, 165, 0.24), rgba(242, 127, 165, 0.1));
  --pill-edge: rgba(242, 127, 165, 0.3);
  --pill-shadow: rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
/* Открыто не из Telegram: пустая страница */
html.no-tg body > * { display: none !important; }
/* Двойное нажатие не приближает страницу: в приложении это мешает быстрым нажатиям. Щипок пальцами работает. */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/20px var(--sans);
  /* Без одиноких коротких слов в последней строке абзаца */
  text-wrap: pretty;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--muted); text-decoration: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, p { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

#app {
  position: relative;
  max-width: 480px;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.screen {
  flex: 1;
  min-width: 0;
  padding: calc(20px + var(--safe-top)) 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.is-busy .btn, .is-busy .chip, .is-busy .iconbtn { pointer-events: none; opacity: 0.65; }

/* Текст */
.h1 { font: 500 30px/36px var(--serif); font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
.h2 { font: italic 500 20px/26px var(--serif); font-variant-numeric: lining-nums; }
.num { font-family: var(--serif); font-style: italic; font-weight: 500; font-variant-numeric: lining-nums; white-space: nowrap; }
.label { font-size: 12px; line-height: 18px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.label.accent { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 19px; }
.tiny { font-size: 13px; line-height: 17px; }
.b { font-weight: 600; }
.accent { color: var(--accent); }
.plum { color: var(--plum); }
.center { text-align: center; }
.pre { white-space: pre-line; overflow-wrap: anywhere; }

/* Раскладка */
.col { display: flex; flex-direction: column; min-width: 0; }
.row { display: flex; align-items: center; min-width: 0; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.g2 { gap: 2px; } .g4 { gap: 4px; } .g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g14 { gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
/* В формах поля выравниваются по нижнему краю, чтобы длинная подпись не сдвигала соседнее поле. */
.grid2:has(> .field), .grid3:has(> .field) { align-items: end; }
.rule { flex: 1; height: 1px; background: var(--pink); }
.spark { flex-shrink: 0; color: var(--accent); }

/* Карточки и списки */
.card { background: var(--card); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; box-shadow: inset 0 0 0 1px var(--card-edge); }
.card.bordered { border: 1px solid var(--line); }
.card.accent-border { border: 1px solid var(--accent); background: transparent; }
.card.dashed { background: transparent; border: 1px dashed var(--pink); }
a.card, button.card { color: var(--ink); text-align: left; border: 1px solid var(--line); width: 100%; }
.list { background: var(--card); border-radius: 16px; padding: 4px 16px; display: flex; flex-direction: column; box-shadow: inset 0 0 0 1px var(--card-edge); }
.li { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; }
.li:last-child { border-bottom: none; }
.li > .val { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.tile { min-height: 92px; padding: 12px; border-radius: 14px; background: var(--card); color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
.tile svg { color: var(--accent); }
.stat { padding: 10px 12px; border-radius: 12px; background: var(--card); display: flex; flex-direction: column; gap: 2px; min-width: 0; box-shadow: inset 0 0 0 1px var(--card-edge); }
.stat .num { font-size: 18px; line-height: 26px; }
.stat .cap { font-size: 12px; line-height: 14px; color: var(--muted); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--pink); border-radius: 16px; }

/* Главная: кнопки связи */
.btn.contact { min-height: 52px; border-radius: 14px; border-color: var(--line); font-size: 13px; font-weight: 500; padding: 0 8px; gap: 6px; white-space: nowrap; }
.btn.contact svg { color: var(--accent); }

/* Инфо: строки меню и списки пунктов */
.menu-row { min-height: 64px; font-size: 15px; }
.lead { font-size: 15px; line-height: 22px; }
.points .li { align-items: flex-start; justify-content: flex-start; padding: 12px 0; font-size: 15px; line-height: 22px; }
.pt-ico { display: flex; flex-shrink: 0; padding-top: 1px; }
.pt-dot { width: 6px; height: 6px; margin: 8px 7px 0; flex-shrink: 0; border-radius: 50%; background: var(--accent); }
.pt-num { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--dash); display: flex; align-items: center; justify-content: center; font: italic 500 14px/1 var(--serif); font-variant-numeric: lining-nums; color: var(--accent); }
.note { flex-direction: row; align-items: flex-start; gap: 10px; padding: 12px 14px; font-size: 14px; line-height: 20px; }
.note > span:first-child { display: flex; }

/* Кнопки */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--edge); background: transparent; color: var(--ink);
  font: 400 14px/20px var(--sans); text-align: center;
}
.btn.primary { border-color: var(--fill); background: var(--fill); color: #FFFFFF; font-weight: 600; }
.btn.big { min-height: 52px; border-radius: 14px; font-size: 16px; }
.btn.outline-accent { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btn.ghost { border-color: transparent; color: var(--accent); font-weight: 600; padding: 0 8px; }
.btn.dashed { border-style: dashed; border-color: var(--dash); }
.btn.white { background: var(--card); }
.btn[disabled], .btn.off { opacity: 0.55; pointer-events: none; }
.iconbtn { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 0; border: none; border-radius: 12px; background: transparent; color: var(--ink); }
.iconbtn.bordered { border: 1px solid var(--edge); }
.topbar { display: flex; align-items: center; gap: 4px; min-height: 44px; margin-left: -10px; }
.topbar.plain { margin-left: 0; justify-content: space-between; }

/* Чипы, переключатели */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
/* Все варианты видны сразу: кнопки переносятся на следующую строку, а не уезжают за край. */
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip { flex-shrink: 0; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--edge); background: transparent; color: var(--ink); font-size: 14px; white-space: nowrap; }
.chip.on { border-color: var(--fill); background: var(--fill); color: #FFFFFF; font-weight: 600; }
.chip.off { border-color: var(--line); color: var(--muted); text-decoration: line-through; pointer-events: none; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-edge); }
.seg > button { flex: 1; min-height: 44px; padding: 0 6px; border: none; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; }
.seg > button.on { background: var(--pink); color: var(--ink); font-weight: 600; }
/* Тот же переключатель ссылками: разделы одного экрана. */
.seg > a { flex: 1; min-height: 44px; padding: 0 6px; border-radius: 10px; color: var(--muted); font-size: 14px; display: flex; align-items: center; justify-content: center; }
.seg > a.on { background: var(--pink); color: var(--ink); font-weight: 600; }
/* Три длинных слова в ряд: буквы чуть мельче, чтобы помещались на узком экране. */
.seg.tight > button { padding: 0 2px; font-size: 13px; min-width: 0; }
.tag { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--pink); font-size: 12px; white-space: nowrap; }
.tag.plum { border-color: var(--plum); color: var(--plum); }
.tag.acc { border-color: var(--accent); color: var(--accent); }
.tag.dim { border-color: var(--dash); color: var(--muted); }
.switch { width: 52px; height: 44px; padding: 0; border: none; background: transparent; display: flex; align-items: center; justify-content: flex-end; }
.switch > span { width: 48px; height: 28px; padding: 3px; border-radius: 14px; background: var(--pink); display: flex; align-items: center; transition: background 0.15s; }
.switch > span > span { width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; transition: transform 0.15s; }
.switch[aria-checked="true"] > span { background: var(--fill); }
.switch[aria-checked="true"] > span > span { transform: translateX(20px); }

/* Поля */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 12px; line-height: 18px; color: var(--muted); }
.input { width: 100%; min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--edge); background: var(--card); color: var(--ink); font-size: 16px; font-weight: 500; -webkit-appearance: none; appearance: none; }
.input:focus { border-color: var(--accent); outline: none; }
/* Шрифт в полях не меньше 16px: иначе iPhone при нажатии на поле приближает весь экран. */
textarea.input { min-height: 88px; padding: 12px; font-weight: 400; font-size: 16px; line-height: 22px; resize: none; }
/* iPhone рисует поля даты и времени по-своему: ниже остальных, с текстом по центру и шире своей ячейки.
   Приводим их к виду обычного поля. */
input[type="date"].input, input[type="time"].input { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; height: 48px; line-height: 46px; text-align: left; }
input[type="date"].input::-webkit-date-and-time-value, input[type="time"].input::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type="search"].input { -webkit-appearance: none; appearance: none; }
input[type="search"].input::-webkit-search-decoration { -webkit-appearance: none; }
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237A5A66' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; font-size: 16px; }

:root[data-theme="dark"] select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23C7A3B0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }

/* Фото */
.photo { display: block; width: 100%; object-fit: cover; border-radius: 12px; background: var(--powder); border: 0; padding: 0; }
.ph { border-radius: 12px; background: repeating-linear-gradient(135deg, var(--stripe) 0 8px, var(--card) 8px 16px); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); text-align: center; }
.thumb { width: 72px; height: 72px; flex-shrink: 0; border-radius: 12px; object-fit: cover; background: var(--powder); border: 0; padding: 0; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.add-photo { width: 72px; height: 72px; flex-shrink: 0; border-radius: 12px; border: 1px dashed var(--dash); background: transparent; color: var(--ink); display: flex; align-items: center; justify-content: center; }
.paper { border-radius: 12px; background: var(--paper); overflow: hidden; }
.paper.dim { opacity: 0.45; }

/* Нижнее меню */
/* Нижнее меню: стеклянная плашка, отодвинута от краёв и висит над содержимым.
   Под ней видно размытое содержимое экрана, подсветка текущей вкладки переплывает при переходе. */
.tabbar {
  position: sticky; bottom: calc(10px + var(--safe-bottom)); z-index: 5;
  display: flex; margin: 0 10px calc(10px + var(--safe-bottom)); padding: 5px;
  border-radius: 28px; isolation: isolate;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: 0 12px 32px var(--glass-shadow), 0 2px 6px var(--glass-shadow), inset 0 1px 0 var(--glass-hi);
}
/* Обводка с переливом: светлая сверху слева, с розовым отблеском справа. */
.tabbar::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: linear-gradient(135deg, var(--glass-edge-a), var(--glass-edge-b) 45%, var(--glass-edge-c) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* Блик сверху, как на стекле. */
.tabbar::before {
  content: ''; position: absolute; left: 1px; right: 1px; top: 1px; height: 50%; border-radius: 27px 27px 14px 14px; pointer-events: none; z-index: -1;
  background: linear-gradient(180deg, var(--glass-sheen), transparent);
}
.tab-pill {
  position: absolute; z-index: -1; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / var(--n, 5));
  border-radius: 22px; transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform 0.45s cubic-bezier(0.3, 1.25, 0.45, 1);
  background: var(--pill-bg);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 1px var(--pill-edge), 0 4px 14px var(--pill-shadow);
}
.tab { flex: 1; min-width: 0; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; line-height: 13px; letter-spacing: -0.01em; color: var(--muted); position: relative; border-radius: 22px; -webkit-tap-highlight-color: transparent; }
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab svg { transition: transform 0.3s ease; }
.tab.on { color: var(--accent); font-weight: 600; }
.tab.on svg { transform: translateY(-1px) scale(1.06); }
.tab:active svg { transform: scale(0.9); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .tabbar { background: var(--card); } }
@media (prefers-reduced-motion: reduce) { .tab-pill { transition: none; } }
.tab .dot { position: absolute; top: 7px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--glass-ring); }

/* Календарь мастера */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { font-size: 12px; line-height: 20px; color: var(--muted); text-align: center; }
.day { height: 56px; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 15px; }
.day.past { border-color: transparent; color: var(--muted); }
.day.has { background: var(--card); color: var(--ink); }
.day.off { border-color: transparent; background: repeating-linear-gradient(135deg, var(--pink) 0 5px, var(--bg) 5px 10px); color: var(--muted); }
.day.today { border-color: var(--ink); font-weight: 600; }
.day.sel { border-color: var(--fill); background: var(--fill); color: #FFFFFF; font-weight: 600; }
.day .sum { font-size: 11px; line-height: 12px; color: var(--plum); font-weight: 400; }
.day.sel .sum { color: #FFFFFF; }
.day .pt { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.day.sel .pt { background: #FFFFFF; }
.datechip { flex-shrink: 0; width: 48px; height: 64px; padding: 0; border-radius: 12px; border: 1px solid var(--edge); background: transparent; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.datechip .wd { font-size: 12px; line-height: 14px; color: var(--muted); }
.datemonth { flex-shrink: 0; align-self: center; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; line-height: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 0 2px; }
.datechip .dn { font-size: 16px; line-height: 20px; font-weight: 600; }
.datechip.on { border-color: var(--fill); background: var(--fill); color: #FFFFFF; }
.datechip.on .wd { color: #FFFFFF; }
.datechip.off { border-color: transparent; background: repeating-linear-gradient(135deg, var(--pink) 0 5px, var(--bg) 5px 10px); color: var(--muted); pointer-events: none; }
.datechip.off .dn { font-weight: 400; }
/* Рабочий день, на который всё занято: нажимается, чтобы попросить сообщить, когда освободится. */
.datechip.full { border-style: dashed; border-color: var(--dash); color: var(--muted); }
.datechip.full .dn { font-weight: 400; }
.datechip.full.on { border-style: solid; border-color: var(--fill); background: var(--fill); color: #FFFFFF; }
.wait { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px dashed var(--dash); }
.wait.on { border: 1px solid var(--accent); background: var(--card); }
.wait .btn { flex-shrink: 0; min-height: 40px; }
/* У мастера: кто ждёт, что на день освободится время. */
.wait-note { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--card); }
/* Небольшое действие текстом, без рамки: например, «Свободное время» под календарём. */
.grid2.tight .btn { padding: 0 6px; font-size: 14px; white-space: nowrap; }
.link-btn { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 600; }
/* Месяц в панели переноса: компактнее, чем на экране календаря. */
.cal.mini .day { height: 40px; font-size: 14px; }
.cal.mini .day:disabled { opacity: 0.4; }
.iconbtn:disabled { opacity: 0.35; pointer-events: none; }
/* Время, на которое уже есть запись: выбрать можно, но видно, что занято. */
.chip.busy { border-style: dashed; border-color: var(--dash); color: var(--muted); }
.chip.busy.on { border-style: solid; border-color: var(--fill); color: #FFFFFF; }

/* График */
.bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; align-items: end; height: 162px; }
.bars > div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; line-height: 16px; }
.bars .bar { width: 100%; min-height: 2px; border-radius: 6px 6px 0 0; background: var(--bar); }
.bars .cur .bar { background: var(--accent); }
.bars .cur .v { color: var(--accent); font-weight: 600; }
.bars .m { color: var(--muted); }

/* Всплывающие элементы */
.toast { pointer-events: none; position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translateX(-50%); z-index: 60; width: max-content; max-width: min(440px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: var(--toast-bg); color: var(--toast-ink); font-size: 14px; line-height: 20px; box-shadow: 0 6px 24px rgba(42, 26, 33, 0.25); }
.toast.err { background: #8E1F45; color: #FFFFFF; }
.backdrop { position: fixed; inset: 0; z-index: 40; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; max-height: min(88dvh, calc(100dvh - var(--safe-top) - 16px)); overflow-y: auto; background: var(--bg); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 14px; }
.viewer { position: fixed; inset: 0; z-index: 70; background: var(--scrim-deep); display: flex; align-items: center; justify-content: center; padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom)); border: 0; width: 100%; }
.viewer { flex-direction: column; gap: 14px; }
.viewer img { max-width: 100%; max-height: calc(100% - 66px); border-radius: 8px; -webkit-touch-callout: default; }
.viewer-bar { display: flex; gap: 10px; }
.viewer-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; min-width: 48px; padding: 0 18px; border-radius: 24px; border: 1px solid rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.14); color: #FFFFFF; font-size: 15px; font-weight: 600; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.viewer-btn[data-v="close"] { padding: 0; }
.devbar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 12px; background: #2A1A21; color: #FFFFFF; font-size: 12px; }
.devbar button { min-height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.5); background: transparent; color: #FFFFFF; font-size: 12px; }
body:has(> .devbar) #app { min-height: calc(100dvh - 40px); }
.devbar button.on { background: #FFFFFF; color: #2A1A21; border-color: #FFFFFF; }
.splash-msg .devbar { position: relative; z-index: 101; }
#splash-text { text-align: center; }
.loading { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 240px; }
.loading .spark { animation: sk-twinkle 1.4s ease-in-out infinite; }
.wordmark-name { font: italic 500 36px/40px var(--serif); }
.wordmark-sub { font-size: 11px; line-height: 16px; letter-spacing: 0.46em; text-transform: uppercase; color: var(--muted); }
.caps { font-size: 12px; line-height: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* Экран загрузки */
.splash { position: fixed; inset: 0; z-index: 100; overflow: hidden; background: var(--bg); transition: opacity 0.35s ease; }
.splash.hide { opacity: 0; pointer-events: none; }
.splash-glow { position: absolute; border-radius: 50%; }
.splash-glow.a { left: 50%; top: 50%; width: 540px; height: 540px; margin: -300px 0 0 -270px; background: radial-gradient(closest-side, var(--glow-a) 0%, transparent 100%); }
.splash-glow.b { right: -180px; bottom: -200px; width: 460px; height: 460px; background: radial-gradient(closest-side, var(--glow-b) 0%, transparent 100%); }
.splash-in { position: relative; height: 100%; max-width: 480px; margin: 0 auto; padding: calc(28px + var(--safe-top)) 24px calc(28px + var(--safe-bottom)); display: flex; flex-direction: column; }
.splash-top { display: flex; align-items: center; gap: 10px; font-size: 12px; line-height: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.splash-mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; min-height: 0; }
.splash-logo { width: min(330px, 100%, 44dvh); aspect-ratio: 401.6 / 396.4; }
.splash-load { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.splash-load .bar { width: 148px; height: 2px; border-radius: 1px; background: var(--pink); overflow: hidden; }
.splash-load .bar div { width: 100%; height: 100%; background: var(--accent); transform-origin: left center; transform: scaleX(0); }
.splash-bottom { display: flex; justify-content: center; }
/* Девиз студии. Он стоит только на заставке: целиком, две строки, прописные с разрядкой */
.motto { display: flex; flex-direction: column; align-items: center; text-align: center; font: 500 12px/24px var(--sans); letter-spacing: 0.24em; text-transform: uppercase; color: var(--ink); }
.motto span { white-space: nowrap; padding-left: 0.24em; }
/* Логотип: розовый крылатый дракон за надписью (рисует dragon.ts, цвета из темы) */
.logo { display: block; width: 100%; height: auto; overflow: visible; }
/* Кнопка темы: половинка ромбика. В тёмной теме он переворачивается. */
.theme-btn { width: 44px; height: 44px; flex-shrink: 0; padding: 0; border-radius: 50%; border: 1px solid var(--edge); background: var(--card); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.theme-btn svg { transition: transform 0.55s cubic-bezier(0.3, 1.4, 0.5, 1); }
.theme-btn:active svg { transform: scale(0.86); }
:root[data-theme="dark"] .theme-btn svg { transform: rotate(180deg); }
:root[data-theme="dark"] .theme-btn:active svg { transform: rotate(180deg) scale(0.86); }
.theme-ico { display: flex; }
.theme-ico svg { transition: transform 0.55s cubic-bezier(0.3, 1.4, 0.5, 1); }
:root[data-theme="dark"] .theme-ico svg { transform: rotate(180deg); }
:root[data-theme="dark"] .only-light, :root:not([data-theme="dark"]) .only-dark { display: none; }
/* Смена темы: новая тема расходится кругом от кнопки, как капля краски. Где браузер так не умеет, цвета просто плавно меняются. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after { transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, fill 0.35s ease, stroke 0.35s ease !important; }
.tw { animation: sk-twinkle 2.6s ease-in-out infinite; }
.tw.d2 { animation-delay: -1.3s; }
.tw.d3 { animation-delay: -0.6s; }

/* Экран выбора входа (его видит только мастер) */
.gate { position: relative; overflow: hidden; gap: 0; padding: calc(28px + var(--safe-top)) 24px calc(28px + var(--safe-bottom)); }
.gate > * { position: relative; }
.gate > .gate-glow { position: absolute; border-radius: 50%; pointer-events: none; }
.gate-glow.a { left: 50%; top: 0; width: 540px; height: 540px; margin: -150px 0 0 -270px; background: radial-gradient(closest-side, var(--glow-a) 0%, transparent 100%); }
.gate-glow.b { right: -190px; bottom: -210px; width: 460px; height: 460px; background: radial-gradient(closest-side, var(--glow-b) 0%, transparent 100%); }
.gate-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 26px; padding: 20px 0 28px; min-width: 0; }
.gate-mark { position: relative; display: flex; justify-content: center; padding: 18px 0; }
.gate-mark .logo { width: min(270px, 100%, 34dvh); }
.gate span.tw { display: inline-flex; }
.choice {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 108px; padding: 18px 14px 18px 18px; border-radius: 22px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); text-align: left;
  box-shadow: 0 12px 32px var(--shade);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.choice:active { transform: scale(0.975); box-shadow: 0 6px 16px rgba(196, 43, 98, 0.12); }
.choice > * { position: relative; }
.choice .ico { width: 54px; height: 54px; flex-shrink: 0; border-radius: 50%; background: var(--powder); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.choice .cap { font-size: 12px; line-height: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.choice .ttl { font: italic 500 27px/32px var(--serif); }
.choice .sub { font-size: 13px; line-height: 18px; color: var(--muted); }
.choice .go { display: flex; color: var(--dash); }
.choice.dark { border-color: var(--fill); background: var(--fill); color: #FFFFFF; box-shadow: 0 16px 36px rgba(196, 43, 98, 0.34); }
.choice.dark .ico { background: rgba(255, 255, 255, 0.18); color: #FFFFFF; }
.choice.dark .cap, .choice.dark .sub { color: rgba(255, 255, 255, 0.86); }
.choice.dark .go { color: rgba(255, 255, 255, 0.86); }

/* Плавное появление: начинается, когда заставка уходит */
.rise { animation: sk-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
/* Экран тихо обновил данные: новые блоки появляются без анимации входа. */
.quiet .rise { animation: none; }
.rise.d1 { animation-delay: 0.07s; }
.rise.d2 { animation-delay: 0.14s; }
.rise.d3 { animation-delay: 0.22s; }
.rise.d4 { animation-delay: 0.3s; }
.rise.d5 { animation-delay: 0.38s; }
body:not(.splash-done) .rise { animation-play-state: paused; }

/* PIN-код кабинета */
.pin { align-items: center; gap: 0; padding-left: 24px; padding-right: 24px; --key: clamp(54px, calc(var(--tg-viewport-stable-height, 100dvh) * 0.094), 74px); }
.pin-top { align-self: stretch; display: flex; min-height: 44px; margin-left: -10px; }
.pin-head { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pin-badge { position: relative; width: 64px; height: 64px; margin-bottom: 8px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--accent); box-shadow: 0 12px 30px var(--shade); transition: background 0.2s, color 0.2s, border-color 0.2s; }
.pin-badge > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity 0.2s, transform 0.2s; }
.pin-badge .b { opacity: 0; transform: scale(0.5); }
.pin-badge.ok { border-color: var(--fill); background: var(--fill); color: #FFFFFF; }
.pin-badge.ok .a { opacity: 0; transform: scale(0.5); }
.pin-badge.ok .b { opacity: 1; transform: none; }
.pin-title { font: 500 28px/34px var(--serif); }
.pin-sub { max-width: 290px; min-height: 36px; }
.pin-dots { display: flex; gap: 20px; padding: 22px 0 12px; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--dash); background: transparent; transition: background 0.12s, border-color 0.12s, transform 0.12s; }
.pin-dot.on { border-color: var(--accent); background: var(--accent); transform: scale(1.15); }
.pin-dots.checking .pin-dot { animation: sk-pulse 0.9s ease-in-out infinite; }
.pin-dots.checking .pin-dot:nth-child(2) { animation-delay: 0.12s; }
.pin-dots.checking .pin-dot:nth-child(3) { animation-delay: 0.24s; }
.pin-dots.checking .pin-dot:nth-child(4) { animation-delay: 0.36s; }
.pin-dots.err { animation: sk-shake 0.45s ease; }
.pin-dots.err .pin-dot { border-color: var(--err); background: var(--err); }
.pin-dots.ok .pin-dot { border-color: var(--plum); background: var(--plum); animation: sk-pop 0.4s ease; }
.pin-msg { min-height: 40px; max-width: 310px; text-align: center; font-size: 13px; line-height: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pin-msg.err { color: var(--err); font-weight: 500; }
.keypad { display: grid; grid-template-columns: repeat(3, var(--key)); gap: 12px 26px; margin-top: 10px; }
.key {
  width: var(--key); height: var(--key); padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 500 28px/1 var(--serif); font-variant-numeric: lining-nums;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  box-shadow: 0 4px 14px var(--shade);
  transition: transform 0.08s ease, background 0.08s ease, opacity 0.15s ease;
}
.key:active { transform: scale(0.93); border-color: var(--pink); background: var(--powder); }
.key.flat { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.key[disabled] { opacity: 0.4; pointer-events: none; }
.pin-foot { min-height: 44px; margin: 8px 0 auto; display: flex; align-items: center; }
/* Невысокие экраны: убираем украшения, чтобы клавиатура и обе кнопки входа помещались без прокрутки */
@media (max-height: 760px) {
  .pin-badge { display: none; }
  .gate-mark { padding: 12px 0; }
  .gate-mid { gap: 20px; padding: 14px 0 20px; }
}
@media (max-height: 660px) {
  .pin { padding-top: calc(8px + var(--safe-top)); padding-bottom: 8px; --key: clamp(46px, calc(var(--tg-viewport-stable-height, 100dvh) * 0.098), 74px); }
  .pin-top { min-height: 40px; }
  .pin-sub { display: none; }
  .pin-dots { padding: 14px 0 10px; }
  .pin-msg { min-height: 36px; line-height: 18px; }
  .keypad { gap: 8px 24px; margin-top: 4px; }
  .pin-foot { min-height: 40px; margin-top: 2px; }
  .gate { padding-top: calc(16px + var(--safe-top)); padding-bottom: calc(14px + var(--safe-bottom)); }
  .gate-mark { padding: 6px 0; }
  .gate-mark .logo { width: 250px; }
  .gate-mid { gap: 14px; padding: 8px 0 12px; }
  .gate .gate-foot { display: none; }
  .choice { min-height: 88px; padding: 12px 12px 12px 14px; border-radius: 18px; }
  .choice .ico { width: 44px; height: 44px; }
  .choice .ttl { font-size: 24px; line-height: 28px; }
}
@media (max-height: 520px) {
  .gate-mark { padding: 0; }
  .gate-mark .logo { width: 200px; }
  .choice { min-height: 76px; }
  .choice .cap { display: none; }
  .pin-top { min-height: 36px; }
  .pin-msg { min-height: 32px; }
  .keypad { gap: 6px 22px; }
  .pin-foot { min-height: 36px; }
}

@keyframes sk-twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes sk-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes sk-shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-9px); }
  36% { transform: translateX(8px); }
  54% { transform: translateX(-6px); }
  72% { transform: translateX(4px); }
  88% { transform: translateX(-2px); }
}
@keyframes sk-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes sk-pop {
  0% { transform: scale(1.15); }
  45% { transform: scale(1.5); }
  100% { transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (max-width: 359px) {
  .screen { padding-left: 12px; padding-right: 12px; }
  .chips { margin: 0 -12px; padding: 0 12px; }
  .h1 { font-size: 26px; line-height: 32px; }
  .gate { padding-left: 16px; padding-right: 16px; }
  .contacts { grid-template-columns: minmax(0, 1fr); }
  .motto { font-size: 11px; line-height: 22px; letter-spacing: 0.2em; }
  .choice .ttl { font-size: 24px; line-height: 28px; }
  .keypad { gap: 10px 20px; }
}

/* Главная клиента: витрина */
.hero { position: relative; border-radius: 18px; overflow: hidden; height: min(280px, 72vw); background: var(--powder); }
.hero-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; color: #FFFFFF; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; }
.hero-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(42, 26, 33, 0) 62%, rgba(42, 26, 33, 0.55) 100%); pointer-events: none; }
.hero-ttl { position: absolute; z-index: 1; left: 14px; right: 14px; bottom: 26px; font: italic 500 20px/26px var(--serif); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-dots { position: absolute; z-index: 1; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.hero-dots span { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.5); transition: width 0.2s ease, background 0.2s ease; }
.hero-dots span.on { width: 18px; background: #FFFFFF; }
/* Стрелки ленты работ: только там, где есть мышь. На телефоне ленту листают пальцем. */
.hero-nav { display: none; position: absolute; z-index: 2; top: 50%; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(42, 26, 33, 0.35); color: #FFFFFF; align-items: center; justify-content: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity 0.2s ease; }
.hero-nav.prev { left: 10px; }
.hero-nav.next { right: 10px; }
@media (hover: hover) and (pointer: fine) {
  .hero-nav { display: flex; }
  .hero:hover .hero-nav, .hero-nav:focus-visible { opacity: 1; }
  .hero-track, .hscroll, .chips { cursor: grab; }
}
/* Ленту тянут мышью: прилипание к карточкам выключено, пока её тащат. */
.dragging { cursor: grabbing !important; scroll-snap-type: none !important; scroll-behavior: auto !important; user-select: none; }
.dragging * { pointer-events: none; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.fcard { flex: 0 0 132px; display: flex; flex-direction: column; gap: 2px; min-width: 0; color: var(--ink); font-size: 14px; }
.fcard-img { display: block; height: 132px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); margin-bottom: 6px; overflow: hidden; }
.fcard-img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; display: block; }
.fcard .b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard .num { font-size: 16px; }
.more { display: flex; align-items: center; gap: 2px; font-size: 13px; color: var(--accent); font-weight: 600; min-height: 28px; }
.steps { background: var(--card); border-radius: 16px; padding: 6px 16px; display: flex; flex-direction: column; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }

/* Кабинет: "Ждут вас", счётчики на фильтрах, сеансы на сегодня */
.count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--fill); color: #FFFFFF; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.count.soft { background: var(--powder); color: var(--muted); }
.todo { min-height: 60px; }
.todo-cap { font-size: 12px; line-height: 16px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.chip-n { margin-left: 6px; font-size: 12px; opacity: 0.7; }
/* Три фильтра со счётчиками должны помещаться в ряд без прокрутки. */
.chips.fit { gap: 6px; margin: 0; padding: 0; }
/* Узкий телефон: фильтры не помещаются - листаются, у края растворяются (класс fade-r ставит приложение). */
.chips.fit .chip { flex: 1 1 auto; min-height: 40px; padding: 0 8px; font-size: 13px; }
.today-card { gap: 4px; padding: 14px 16px 6px; }
.wiz { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wiz-step { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; color: var(--muted); white-space: nowrap; }
.wiz-step + .wiz-step::before { content: ''; flex: 1 1 12px; min-width: 12px; height: 1px; background: var(--pink); }
.wiz-step + .wiz-step { flex: 1; }
.wiz-n { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--pink); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.wiz-step.on { color: var(--ink); font-weight: 600; }
.wiz-step.on .wiz-n { border-color: var(--fill); background: var(--fill); color: #FFFFFF; }
.wiz-step.done { color: var(--plum); }
.wiz-step.done .wiz-n { border-color: var(--plum); color: var(--plum); }
.wiz-step.done + .wiz-step::before { background: var(--plum); }
.stages { display: flex; margin: 0; padding: 0; list-style: none; }
.stage { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; line-height: 14px; color: var(--muted); text-align: center; }
.stage + .stage::before { content: ''; position: absolute; top: 13px; right: calc(50% + 17px); width: calc(100% - 34px); height: 1px; background: var(--pink); }
.stage-n { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--pink); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.stage.done { color: var(--plum); }
.stage.done .stage-n { border-color: var(--plum); color: var(--plum); }
.stage.done + .stage::before { background: var(--plum); }
.stage.on { color: var(--ink); font-weight: 600; }
.stage.on .stage-n { border-color: var(--fill); background: var(--fill); color: #FFFFFF; }
.need { align-self: flex-start; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--accent); color: var(--accent); font-size: 13px; line-height: 18px; font-weight: 600; }
.clip2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.setup-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px dashed var(--accent); color: var(--accent); font-size: 14px; font-weight: 500; }
.today-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink); }
.today-row .num { font-size: 18px; width: 52px; flex-shrink: 0; }
.fcard.pick { padding: 0; border: 0; background: none; text-align: left; }
.fcard.pick.on .fcard-img { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sketch-img { display: block; width: 100%; border-radius: 14px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); padding: 0; }
.sketch-img img { display: block; width: 100%; max-height: 420px; object-fit: contain; }

/* Сертификат: карточка с двумя сторонами */
.flip { display: block; width: 100%; padding: 0; border: 0; background: none; aspect-ratio: 148 / 105; perspective: 1400px; -webkit-tap-highlight-color: transparent; }
.flip-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.7s cubic-bezier(0.3, 0.7, 0.2, 1); }
.flip.on .flip-in { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; display: block; border-radius: 2.5% / 3.5%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 14px 30px var(--shade), 0 2px 6px var(--shade); }
.flip-face.back { transform: rotateY(180deg); }
.cstyles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cstyle { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 6px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px; line-height: 18px; }
.cstyle.on { border-color: var(--accent); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--accent); }
.cstyle-img { display: block; width: 100%; border-radius: 8px; overflow: hidden; }
.cert-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.cert-row.dead { background: transparent; border-style: dashed; border-color: var(--pink); }
.cert-row.dead .cert-mini { opacity: 0.55; }
.cert-mini { flex: 0 0 84px; border-radius: 6px; overflow: hidden; }
.cert-row-body { min-width: 0; }
.cert-row-sum { font-size: 18px; line-height: 24px; }
.cert-row .tag { min-height: 24px; padding: 0 8px; flex-shrink: 0; }
.cert-hero { border-radius: 14px; overflow: hidden; box-shadow: 0 14px 30px var(--shade), 0 2px 6px var(--shade); }
.cert-hero svg { display: block; width: 100%; height: auto; }
.code { font: 600 19px/28px var(--sans); letter-spacing: 0.06em; color: var(--accent); white-space: nowrap; user-select: all; -webkit-user-select: all; }
@media (prefers-reduced-motion: reduce) { .flip-in { transition: none; } }
@media (max-width: 359px) {
  .seg.tight > button { font-size: 12px; }
  .code { font-size: 16px; letter-spacing: 0.04em; }
  .hscroll { margin: 0 -12px; padding: 0 12px 2px; }
}

/* Отзывы на главной клиента: оценка в 2ГИС и лента отзывов */
button.more { background: none; border: 0; padding: 0; }
.stars { display: inline-flex; gap: 1px; color: var(--dash); }
.stars svg { display: block; }
.stars .on { color: var(--accent); }
.stars .on svg { fill: currentColor; }
.rating { display: flex; align-items: center; gap: 12px; }
.rating > .num { font-size: 40px; line-height: 44px; color: var(--ink); }
.rcard { flex: 0 0 264px; display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-align: left; min-width: 0; }
.rcard-text { font-size: 14px; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 5; line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.rcard-who { font-size: 13px; margin-top: auto; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.review-row { align-items: stretch; }

/* "Приведи друга" */
.card.friend { flex-direction: row; align-items: center; gap: 14px; }
.friend-hero { gap: 8px; }
.friend-sum { font-size: 40px; line-height: 46px; color: var(--accent); }

/* Готовые ответы мастера над полем сообщения клиенту */
.tpls { display: flex; flex-direction: column; gap: 6px; }
.tpl { text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--edge); background: var(--card); color: var(--ink); font-size: 14px; line-height: 19px; }

/* Полноэкранный режим Telegram на телефоне: под строкой состояния (часы, батарея) сплошной фон,
   чтобы при прокрутке текст не уходил под неё. В обычном режиме высота нулевая. */
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; height: var(--tg-safe-area-inset-top, 0px); background: var(--bg); z-index: 35; pointer-events: none; }

/* Вход по отпечатку или лицу */
.pin-offer { display: flex; justify-content: center; color: var(--accent); padding: 4px 0 2px; }
.key.flat[data-act="bio"] { color: var(--accent); }

/* Пасхалка: пламя дракона поверх экрана */
.fire-layer { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }
.flyby { position: fixed; inset: 0; z-index: 89; pointer-events: none; overflow: hidden; }
.flyby-dim { position: absolute; inset: 0; opacity: 0; background: rgba(26, 12, 19, 0.62); }
:root[data-theme="light"] .flyby-dim { background: rgba(74, 22, 48, 0.58); }
.flyby-glow { position: absolute; left: -30%; top: -25%; width: 160%; height: 150%; background: radial-gradient(closest-side, rgba(242, 127, 165, 0.32), rgba(242, 127, 165, 0)); }
.flyby-dragon { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; will-change: transform; }
.wordmark, .gate-mark { cursor: default; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-touch-callout: none; }
.egg-pulse { animation: egg-pulse 0.32s ease; }
@keyframes egg-pulse { 30% { transform: scale(calc(1 + var(--egg, 1) * 0.018)) rotate(calc(var(--egg, 1) * -0.6deg)); } }

/* Рассылка: кнопки оформления, фото или видео, предпросмотр сообщения как в Telegram */
.fmt { display: flex; gap: 6px; flex-wrap: wrap; }
.fmt-btn { min-width: 44px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--dash); background: var(--card); color: var(--ink); font-size: 15px; }
.fmt-btn[data-key="**"] { font-weight: 800; }
.fmt-btn[data-key="__"] { font-style: italic; font-family: var(--serif); }
.fmt-btn[data-key="++"] { text-decoration: underline; }
.fmt-btn[data-key="~~"] { text-decoration: line-through; }
#b-count.err { color: var(--err); font-weight: 600; }
.bc-media { position: relative; border-radius: 14px; overflow: hidden; background: var(--powder); }
.bc-media img, .bc-media video { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.bc-media .iconbtn { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; background: rgba(42, 26, 33, 0.6); color: #FFFFFF; }
.bc-bubble { align-self: flex-start; max-width: 92%; border-radius: 16px 16px 16px 6px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.bc-bubble-media { display: block; width: 100%; max-height: 220px; object-fit: cover; }
.bc-bubble-text { padding: 10px 12px 0; font-size: 15px; line-height: 21px; overflow-wrap: anywhere; }
.bc-bubble-text .spoiler { background: var(--muted); color: transparent; border-radius: 4px; }
.bc-bubble-foot { padding: 8px 12px 10px; font-size: 13px; line-height: 18px; font-style: italic; color: var(--muted); }
.bc-bubble-btn { align-self: flex-start; max-width: 92%; min-width: 60%; text-align: center; padding: 9px 12px; border-radius: 12px; background: var(--powder); color: var(--accent); font-size: 14px; font-weight: 600; }

/* Действие, которое нельзя отменить: удалить, заблокировать, отменить запись */
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); background: transparent; }
/* Последний шаг такого действия, после которого уже не передумать */
.btn.danger.solid { background: var(--err); border-color: var(--err); color: var(--card); }

/* Подсказка у незаполненного поля при записи */
.need-glow { animation: need-glow 1.3s ease; border-radius: 14px; }
@keyframes need-glow { 0%, 60% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.nudge { align-self: flex-start; margin-top: 6px; padding: 7px 12px; border-radius: 10px; background: var(--fill); color: #FFFFFF; font-size: 13px; line-height: 18px; font-weight: 600; animation: nudge-in 0.18s ease-out; }
@keyframes nudge-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .need-glow, .nudge { animation: none; } }

/* Лента листается вбок: у края, за которым есть ещё, содержимое растворяется */
.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px); mask-image: linear-gradient(90deg, transparent, #000 36px); }
.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }

/* Второстепенное действие на карточке: обводка цветом акцента. Главная залитая кнопка на экране одна. */
.btn.outline { border-color: var(--accent); color: var(--accent); background: transparent; }

/* Заголовки переносятся ровными строками, а не «длинная строка + одно слово» */
.h1, .h2, .toast, .empty-title { text-wrap: balance; }

/* Заглушка экрана при загрузке. Видна только если данные идут дольше 0,2 с. */
.skel { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; animation: skel-in 0.25s ease 0.2s both; }
@keyframes skel-in { from { opacity: 0; } }
.sk { display: block; background: var(--powder); border-radius: 12px; animation: sk-breathe 1.6s ease-in-out infinite; }
@keyframes sk-breathe { 50% { opacity: 0.55; } }
.sk-title { width: 58%; height: 30px; border-radius: 10px; }
.sk-list { display: flex; flex-direction: column; background: var(--card); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--card-edge); }
.sk-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.sk-row + .sk-row { border-top: 1px solid var(--line); }
.sk-dot { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.sk-line { height: 12px; border-radius: 6px; }
.sk-line.thin { height: 9px; }
.sk-hero { height: 300px; border-radius: 20px; }
.sk-tile { height: 190px; border-radius: 16px; }
.sk-tile.short { height: 64px; }
.sk-btn { height: 48px; border-radius: 14px; }
.g6 { gap: 6px; }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* Пустой экран: маленький контурный дракон над текстом */
.dg-mark { display: block; width: 92px; height: auto; margin: 0 auto 2px; }

/* Крестик очистки в поиске: в цвет акцента вместо системного синего */
input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; cursor: pointer;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Под эскизом в кабинете мастера: один раз или без ограничений. Нажатие переключает. */
.rep-chip { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 34px; padding: 0 12px; border-radius: 17px; border: 1px dashed var(--dash); background: transparent; color: var(--muted); font: 500 13px/16px var(--sans); }
.rep-chip.on { border: 1px solid var(--accent); background: var(--powder); color: var(--accent); }

/* Возврат в деньгах дня */
.num.neg { color: var(--err); }
.day .sum.neg { color: var(--err); }
.day.sel .sum.neg { color: #FFFFFF; }
.month-money { color: var(--muted); text-decoration: none; }
