/* Trenim · календарь записи. Дизайн-система без внешних библиотек */

:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-2: #f0f0f3;
    --text: #17171c;
    --muted: #6e6e7a;
    --line: #e6e6eb;
    --accent: #e8574f;
    --accent-hover: #d9463e;
    --accent-ink: #ffffff;
    --accent-soft: #fdecea;
    --ok: #1f9d55;
    --ok-soft: #e3f5ea;
    --warn: #b7791f;
    --warn-soft: #fdf3e1;
    --danger: #d64545;
    --danger-soft: #fbe9e9;
    --info: #3b6fd8;
    --info-soft: #e8effc;
    --shadow-sm: 0 1px 2px rgba(20, 20, 30, .06);
    --shadow: 0 6px 24px rgba(20, 20, 30, .08);
    --shadow-lg: 0 16px 48px rgba(20, 20, 30, .18);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --header-h: 60px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e0e11;
        --surface: #18181d;
        --surface-2: #222229;
        --text: #f1f1f4;
        --muted: #9b9ba7;
        --line: #2b2b33;
        --accent: #ff6a61;
        --accent-hover: #ff7f77;
        --accent-ink: #1a0b0a;
        --accent-soft: rgba(255, 106, 97, .14);
        --ok: #4cc685;
        --ok-soft: rgba(76, 198, 133, .14);
        --warn: #e6b04d;
        --warn-soft: rgba(230, 176, 77, .14);
        --danger: #ff6b6b;
        --danger-soft: rgba(255, 107, 107, .14);
        --info: #7aa2ff;
        --info-soft: rgba(122, 162, 255, .14);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow: 0 6px 24px rgba(0, 0, 0, .35);
        --shadow-lg: 0 16px 48px rgba(0, 0, 0, .6);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(24px, 5vw, 32px); line-height: 1.2; letter-spacing: -.02em; }
h2 { font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
h3 { font-size: 17px; line-height: 1.35; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
svg { width: 1.1em; height: 1.1em; flex-shrink: 0; vertical-align: -.15em; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Каркас ---------- */

.container { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 16px; }
.container--wide { max-width: 1040px; }

.app-main { flex: 1 0 auto; padding: 24px 0 48px; }
.app-main--with-tabbar { padding-bottom: 96px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--lg { gap: 24px; }
.stack--sm { gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }

/* ---------- Шапка ---------- */

.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--line);
}
.app-header__inner { height: var(--header-h); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 999px;
    color: var(--muted); font-weight: 500; font-size: 15px;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.is-active { color: var(--text); background: var(--surface-2); }
.nav svg { width: 18px; height: 18px; }

/* Нижняя панель вкладок тренера на телефоне */
.tabbar { display: none; }

@media (max-width: 720px) {
    .nav--trainer { display: none; }
    .tabbar {
        display: grid; grid-template-columns: repeat(4, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        backdrop-filter: saturate(1.6) blur(14px);
        -webkit-backdrop-filter: saturate(1.6) blur(14px);
        border-top: 1px solid var(--line);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .tabbar a {
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: 8px 4px 10px; color: var(--muted); font-size: 11px; font-weight: 500;
    }
    .tabbar a:hover { text-decoration: none; }
    .tabbar a.is-active { color: var(--accent); }
    .tabbar svg { width: 24px; height: 24px; }
}

.app-footer { padding: 24px 0 32px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- Карточки ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__head h2, .card__head h3 { display: flex; align-items: center; gap: 10px; }
.card__icon {
    width: 36px; height: 36px; flex: 0 0 36px;
    display: grid; place-items: center;
    border-radius: 10px; background: var(--accent-soft); color: var(--accent);
}
.card__icon svg { width: 20px; height: 20px; }

/* ---------- Кнопки ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 18px;
    border: 1px solid transparent; border-radius: 12px;
    background: var(--surface-2); color: var(--text);
    font-weight: 600; font-size: 15px; line-height: 1.2;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color .15s, border-color .15s, transform .05s, opacity .15s;
}
.btn:hover { text-decoration: none; background: color-mix(in srgb, var(--surface-2) 80%, var(--text)); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: default; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: 0 0 18px; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger-soft) 70%, var(--danger)); color: #fff; }
.btn--tg { background: #2aabee; color: #fff; }
.btn--tg:hover { background: #1d9bdc; }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: 40px; min-height: 40px; border-radius: 12px; }

.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; }

/* ---------- Формы ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 14px; font-weight: 600; }
.field__hint { font-size: 13px; color: var(--muted); }
.input, .textarea, .select {
    width: 100%; min-height: 46px; padding: 11px 14px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--line); border-radius: 12px;
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1 1 auto; min-width: 0; }
.input-prefix {
    display: flex; align-items: center; min-height: 46px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden;
}
.input-prefix span { padding: 0 4px 0 14px; color: var(--muted); white-space: nowrap; font-size: 14px; }
.input-prefix input { border: 0; outline: 0; background: transparent; padding: 11px 14px 11px 0; flex: 1; min-width: 0; }
.input-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.search {
    position: relative;
}
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 42px; }

/* Переключатель */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
    position: relative; flex: 0 0 46px; height: 28px; border-radius: 999px;
    background: var(--line); transition: background-color .2s;
}
.switch__track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.switch input:checked + .switch__track { background: var(--ok); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 4px var(--accent-soft); }

.checkbox { width: 22px; height: 22px; accent-color: var(--accent); cursor: pointer; flex: 0 0 22px; }

/* ---------- Мелкие элементы ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap;
    background: var(--surface-2); color: var(--muted);
}
.badge svg { width: 13px; height: 13px; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--accent { background: var(--accent-soft); color: var(--accent); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto; padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface); color: var(--text);
    font-size: 14px; font-weight: 500; cursor: pointer;
}
.chip.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip__count { color: var(--muted); margin-left: 4px; }
.chip.is-active .chip__count { color: inherit; opacity: .7; }

.avatar {
    width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700; font-size: 16px; color: #fff;
    background: hsl(var(--hue, 4) 62% 56%);
}
.avatar--lg { width: 64px; height: 64px; flex-basis: 64px; font-size: 24px; }

.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress__bar { height: 100%; border-radius: inherit; background: var(--ok); }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.alert { padding: 14px 16px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; }
.alert--info { background: var(--info-soft); color: var(--info); }
.alert--warn { background: var(--warn-soft); color: var(--warn); }
.alert--danger { background: var(--danger-soft); color: var(--danger); }
.alert--ok { background: var(--ok-soft); color: var(--ok); }

.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: .6; }
.empty h3 { color: var(--text); margin-bottom: 4px; }

.kbd-copy { cursor: pointer; border-bottom: 1px dashed currentColor; }

/* ---------- Страница записи: тренер ---------- */

.hero-trainer { display: flex; align-items: center; gap: 16px; }
.hero-trainer h1 { font-size: clamp(22px, 5vw, 28px); }

/* Лента дат */
.date-strip {
    display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
    padding: 4px 2px 8px; margin: 0 -2px; scrollbar-width: none;
}
.date-strip::-webkit-scrollbar { display: none; }
.date-chip {
    flex: 0 0 64px; scroll-snap-align: start;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 10px 0 8px; border-radius: 16px;
    background: var(--surface); border: 1px solid var(--line);
    cursor: pointer; transition: border-color .15s, background-color .15s, transform .1s;
}
.date-chip:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.date-chip__dow { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.date-chip__day { font-size: 22px; font-weight: 700; line-height: 1.1; }
.date-chip__month { font-size: 11px; color: var(--muted); }
.date-chip__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-top: 3px; }
.date-chip.is-full .date-chip__dot { background: var(--line); }
.date-chip.is-full .date-chip__day { color: var(--muted); }
.date-chip.is-weekend .date-chip__dow { color: var(--accent); }
.date-chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.date-chip.is-active .date-chip__dow,
.date-chip.is-active .date-chip__month,
.date-chip.is-active .date-chip__day { color: var(--accent-ink); }
.date-chip.is-active .date-chip__dot { background: var(--accent-ink); }

.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.day-nav__title { font-weight: 700; font-size: 18px; }
.day-nav__title::first-letter { text-transform: uppercase; }

/* Сетка слотов */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.slot {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 68px; padding: 8px 6px; border-radius: 14px;
    border: 1px solid var(--line); background: var(--surface);
    font-weight: 700; font-size: 18px; text-align: center;
    transition: border-color .15s, background-color .15s, transform .05s;
}
.slot__note { font-size: 11px; font-weight: 500; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot--free { cursor: pointer; border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.slot--free .slot__note { color: var(--ok); }
.slot--free:hover { background: var(--ok-soft); border-color: var(--ok); }
.slot--free:active { transform: scale(.98); }
.slot--busy, .slot--past { background: var(--surface-2); color: var(--muted); border-color: transparent; }
.slot--past { opacity: .55; }
.slot--client {
    cursor: pointer; background: var(--accent-soft); color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.slot--client .slot__note { color: var(--accent); font-weight: 600; }
.slot--client:hover { border-color: var(--accent); }
.slot--unpaid::after {
    content: ""; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%;
    background: var(--warn);
}

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Мои тренировки */
.booking {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
}
.booking__date {
    flex: 0 0 56px; text-align: center; padding: 6px 0; border-radius: 12px;
    background: var(--accent-soft); color: var(--accent);
}
.booking__date b { display: block; font-size: 20px; line-height: 1.1; }
.booking__date span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.booking__body { flex: 1 1 auto; min-width: 0; }
.booking__time { font-weight: 700; }
.booking__meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

/* Загрузка */
.skeleton {
    border-radius: 14px; min-height: 68px;
    background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 60%, var(--surface)) 50%, var(--surface-2) 75%);
    background-size: 200% 100%; animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Шторка / диалог ---------- */

.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(10, 10, 14, .45); animation: fade .2s; }
.sheet__panel {
    position: relative; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto;
    background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
    box-shadow: var(--shadow-lg); animation: slide-up .25s cubic-bezier(.2, .8, .2, 1);
}
.sheet__grip { width: 40px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto 14px; }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet__close {
    width: 36px; height: 36px; flex: 0 0 36px; border: 0; border-radius: 50%;
    background: var(--surface-2); color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.sheet__close svg { width: 18px; height: 18px; }
@media (min-width: 721px) {
    .sheet { align-items: center; padding: 24px; }
    .sheet__panel { border-radius: var(--radius-lg); padding-bottom: 24px; animation: pop .2s cubic-bezier(.2, .8, .2, 1); }
    .sheet__grip { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(100%); } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

.summary-line {
    display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface-2);
}
.summary-line svg { width: 22px; height: 22px; color: var(--accent); flex: 0 0 22px; }

/* ---------- Лоадер долгих операций (App.loader) ---------- */

.loader {
    position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .2s;
}
.loader[hidden] { display: none; }
.loader__card {
    width: min(100%, 320px); padding: 28px 24px 24px; border-radius: var(--radius-lg); text-align: center;
    background: var(--surface); box-shadow: var(--shadow-lg); animation: pop .25s cubic-bezier(.2, .8, .2, 1);
}
.loader__icon { position: relative; width: 56px; height: 56px; margin: 0 auto 16px; }
.loader__spinner {
    position: absolute; inset: 0; border-radius: 50%;
    border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
.loader__check {
    position: absolute; inset: 0; width: 100%; height: 100%; padding: 12px; border-radius: 50%;
    background: var(--ok); color: #fff; opacity: 0; transform: scale(.6);
    transition: opacity .2s, transform .3s cubic-bezier(.2, 1.4, .4, 1);
}
.loader__check path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.loader.is-done .loader__spinner { opacity: 0; transition: opacity .15s; }
.loader.is-done .loader__check { opacity: 1; transform: scale(1); }
.loader.is-done .loader__check path { animation: draw .35s .1s ease-out forwards; }
.loader__title { font-size: 18px; font-weight: 700; }
.loader__text { min-height: 1.4em; margin-top: 6px; color: var(--muted); font-size: 15px; }
.loader__text.is-in { animation: text-in .3s ease-out; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes text-in { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
    .loader__spinner { animation-duration: 2s; }
    .loader__text.is-in, .loader__card, .loader { animation: none; }
}

/* ---------- Уведомления ---------- */

.toasts {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
    display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none;
}
.app-main--with-tabbar ~ .toasts, body.has-tabbar .toasts { bottom: 88px; }
.toast {
    padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg);
    box-shadow: var(--shadow-lg); font-size: 15px; animation: pop .2s; pointer-events: auto;
}
.toast--error { background: var(--danger); color: #fff; }
.toast--ok { background: var(--ok); color: #fff; }

/* ---------- Клиенты ---------- */

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.stat b { display: block; font-size: 24px; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }

.clients { display: flex; flex-direction: column; gap: 10px; }
.client { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; scroll-margin-top: calc(var(--header-h) + 12px); }
.client[open] { box-shadow: var(--shadow); }
.client > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.client > summary::-webkit-details-marker { display: none; }
.client__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client__sub { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.client__chevron { width: 20px; height: 20px; color: var(--muted); transition: transform .2s; flex: 0 0 20px; }
.client[open] .client__chevron { transform: rotate(180deg); }
.client__select { display: flex; align-items: center; }
.client__body { padding: 4px 16px 18px; display: flex; flex-direction: column; gap: 18px; border-top: 1px solid var(--line); }
.client__section h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 8px; }

.tabs { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); gap: 2px; }
.tabs button {
    border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer;
    font-size: 14px; font-weight: 600; color: var(--muted);
}
.tabs button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.events { display: flex; flex-direction: column; gap: 8px; }
.event {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: 12px; background: var(--surface-2);
}
.event--paid { background: var(--ok-soft); }
.event__when { flex: 0 0 auto; min-width: 92px; }
.event__when b { display: block; font-size: 15px; }
.event__when span { font-size: 12px; color: var(--muted); }
.event__what { flex: 1 1 auto; min-width: 0; font-size: 14px; }
.event__what .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; display: block; }
.event__actions { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }
.event__actions .input { width: 70px; min-height: 34px; padding: 4px 8px; border-radius: 10px; font-size: 14px; }

/* Панель массовой рассылки */
.bulk-bar {
    position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 40;
    width: min(94vw, 520px); display: flex; align-items: center; gap: 12px;
    padding: 10px 10px 10px 18px; border-radius: 16px; background: var(--text); color: var(--bg);
    box-shadow: var(--shadow-lg); animation: slide-up .25s;
}
body.has-tabbar .bulk-bar { bottom: 84px; }
.bulk-bar .btn { background: var(--accent); color: var(--accent-ink); }

/* ---------- Профиль / вход ---------- */

.share-link { display: flex; gap: 8px; }
.share-link .input { font-size: 14px; }
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; }
.steps li::before {
    content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center; font-size: 14px; font-weight: 700; background: var(--accent-soft); color: var(--accent);
}
.steps img { margin-top: 10px; border-radius: 12px; border: 1px solid var(--line); }
details.disclosure > summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure[open] > summary { margin-bottom: 16px; }

.auth-card { max-width: 420px; margin: 24px auto 0; }
.auth-card .brand { justify-content: center; margin-bottom: 8px; }

/* ---------- Главная ---------- */

.hero { text-align: center; padding: 32px 0 8px; }
.hero h1 { font-size: clamp(28px, 7vw, 44px); max-width: 640px; margin: 0 auto; }
.hero p { max-width: 520px; margin: 16px auto 0; color: var(--muted); font-size: 18px; }
.hero .row { justify-content: center; margin-top: 28px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.feature { padding: 20px; }
.feature .card__icon { margin-bottom: 12px; }
.feature p { color: var(--muted); font-size: 14px; margin-top: 4px; }

@media (max-width: 520px) {
    .card { padding: 16px; }
    .stats { gap: 8px; }
    .stat { padding: 12px; }
    .stat b { font-size: 20px; }
    .event { flex-wrap: wrap; }
    .event__actions { width: 100%; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
