/* ===== SoulHeal — базовые стили ===== */

:root {
    --bg-page: #f1eff9;
    --bg-surface: #fbfaff;
    --bg-surface-alt: #f5f3fb;
    --bg-hero: linear-gradient(180deg, #f9f8fd 0%, #f3f1fa 100%);
    --text-heading: #322a4d;
    --text-body: #6a6585;
    --text-muted: #8f8aa6;
    --accent: #6e59ae;
    --accent-rgb: 110, 89, 174;
    --accent-strong: #5a4890;
    --accent-soft: #efe9fb;
    --coral: #e8794f;
    --coral-soft: #fdefe8;
    --teal: #2e8c86;
    --border: #edecf6;
    --shadow-card: 0 14px 30px -22px rgba(60, 50, 110, 0.18);
    --shadow-soft: 0 8px 18px -12px rgba(110, 89, 174, 0.3);
    --btn-gradient: linear-gradient(135deg, #8a73c9, #6e59ae);
    --danger: #d3564a;
    --success: #2e8c6f;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
}

:root[data-theme="dark"] {
    --bg-page: #100d1c;
    --bg-surface: #1c1730;
    --bg-surface-alt: #191428;
    --bg-hero: linear-gradient(180deg, #1c1730 0%, #171227 100%);
    --text-heading: #f5f3ff;
    --text-body: #bcb6d9;
    --text-muted: #8f89ab;
    --accent: #b3a2e6;
    --accent-rgb: 179, 162, 230;
    --accent-strong: #cabdf0;
    --accent-soft: #2a2447;
    --coral: #ff9576;
    --coral-soft: #382a2c;
    --teal: #52c6b7;
    --border: #262041;
    --shadow-card: 0 16px 34px -20px rgba(0, 0, 0, 0.4);
    --shadow-soft: 0 8px 20px -10px rgba(0, 0, 0, 0.45);
    --btn-gradient: linear-gradient(135deg, #9c88d9, #7c65bd);
    --danger: #ef7b70;
    --success: #6bd6b3;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body { height: 100%; }
body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-page);
    color: var(--text-body);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}
main { flex: 1 0 auto; display: flex; flex-direction: column; }
.site-footer { flex-shrink: 0; }

h1, h2, h3, h4 {
    font-family: 'Quicksand', 'Nunito', sans-serif;
    color: var(--text-heading);
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.6em;
}

p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo { height: 42px; width: auto; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

.eyebrow {
    display: inline-block;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--coral);
    margin-bottom: 14px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 13.5px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: var(--btn-gradient);
    color: #ffffff;
    box-shadow: var(--shadow-soft);
}
.btn-primary:hover { box-shadow: 0 10px 22px -10px rgba(110, 89, 174, 0.45); }
.btn-ghost {
    background: transparent;
    color: var(--text-heading);
    border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-surface-alt); }
.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline:hover { background: var(--accent-soft); }
.btn-lg { padding: 12px 24px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--coral-soft); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 100px;
}
.logo-link { display: flex; align-items: center; margin-right: auto; }
.logo-link .logo { height: 60px; }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-body);
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active {
    color: var(--text-heading);
    border-bottom-color: var(--coral);
}
.header-actions { display: flex; align-items: center; gap: 20px; }
.header-text-link {
    font-weight: 600;
    font-size: 14.5px;
    color: var(--text-body);
}
.header-text-link:hover { color: var(--text-heading); }

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-surface-alt);
    color: var(--text-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.user-menu { display: flex; align-items: center; gap: 22px; }
.user-link { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 700; color: var(--text-heading); font-size: 14.5px; }
.user-link:hover .user-name { color: var(--accent); }

.avatar-img { border-radius: 50%; object-fit: cover; display: block; }
.avatar-fallback {
    border-radius: 50%;
    background: var(--btn-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    flex-shrink: 0;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}
.nav-toggle span { width: 16px; height: 2px; background: var(--text-heading); margin: 0 auto; }

.mobile-nav {
    display: none;
    flex-direction: column;
    padding: 8px 24px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}
.mobile-nav a { padding: 12px 0; font-weight: 600; border-bottom: 1px solid var(--border); }
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav.open { display: flex; }

@media (max-width: 860px) {
    .main-nav, .header-actions .btn, .header-actions .header-text-link, .user-menu { display: none; }
    .nav-toggle { display: flex; }
    .header-actions { gap: 10px; }
}

/* ===== Hero ===== */
.hero {
    background: var(--bg-hero);
    border-bottom: 1px solid var(--border);
}
.hero-inner {
    padding: 84px 0 90px;
    max-width: 720px;
}
.hero h1 { font-size: 44px; margin-bottom: 20px; }
.hero .lead { font-size: 17.5px; color: var(--text-body); max-width: 560px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===== Sections ===== */
.section { padding: 76px 0; }
.section-alt { background: var(--bg-surface-alt); }
.section-head { max-width: 640px; margin-bottom: 46px; }
.section-head h2 { font-size: 30px; }
.section-head p { color: var(--text-muted); font-size: 16px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ===== Cards / Grids ===== */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 900px) {
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-card);
}

.step-card { padding: 28px; border-radius: var(--radius-md); }
.step-num {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
    font-size: 17px;
}
.step-card h3 { font-size: 19px; margin-bottom: 8px; }
.step-card p { color: var(--text-muted); font-size: 14.5px; margin-bottom: 0; }

.problem-card { text-align: left; }
.problem-card .glyph { font-size: 26px; margin-bottom: 14px; display: block; }

/* Practice cards */
.practice-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.practice-card, .test-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.practice-card:hover, .test-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 36px -22px rgba(60, 50, 110, 0.28);
}
:root[data-theme="dark"] .practice-card:hover,
:root[data-theme="dark"] .test-card:hover {
    box-shadow: 0 20px 36px -20px rgba(0, 0, 0, 0.5);
}
.cat {
    align-self: flex-start;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--teal);
    background: color-mix(in srgb, var(--teal) 14%, transparent);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}
.cat-highlight { color: var(--accent-strong); }
.practice-card h3 { font-size: 20px; margin-bottom: 10px; }
p.summary { color: var(--text-muted); font-size: 14.5px; flex-grow: 1; }
.practice-card .meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border);
    font-size: 13.5px; color: var(--text-muted);
}
.practice-card .meta a { color: var(--accent); font-weight: 700; }
.badge-done {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 700; color: var(--success);
}

.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.filter-chip {
    padding: 8px 18px; border-radius: 999px;
    font-size: 13.5px; font-weight: 600; color: var(--text-body); background: var(--bg-surface-alt);
}
.filter-chip:hover { color: var(--text-heading); }
.filter-chip.active { background: var(--accent); color: #fff; }

/* Practice detail */
.practice-detail-head { max-width: 720px; }
.practice-body { max-width: 720px; background: var(--bg-surface); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-card); }
.practice-body p { color: var(--text-body); }
.practice-actions { margin-top: 28px; display: flex; align-items: center; gap: 16px; }

/* Quote */
.quote-block {
    max-width: 760px; margin: 0 auto; text-align: center;
}
.quote-block blockquote {
    font-family: 'Quicksand', sans-serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0 0 18px;
}
.quote-block cite { color: var(--text-muted); font-style: normal; font-size: 14.5px; }

/* CTA band */
.cta-band {
    background: var(--btn-gradient);
    border-radius: var(--radius-lg);
    padding: 56px;
    text-align: center;
    color: #fff;
}
.cta-band h2 { color: #fff; font-size: 28px; }
.cta-band p { color: rgba(255,255,255,0.85); max-width: 480px; margin: 0 auto 26px; }
.cta-band .btn-primary { background: #fff; color: #4b3b82; box-shadow: none; }
.cta-band .btn-primary:hover { background: #fff; box-shadow: 0 8px 18px -8px rgba(0,0,0,0.35); }

/* ===== Footer ===== */
.site-footer { background: var(--bg-surface-alt); border-top: 1px solid var(--border); padding: 60px 0 0; }
.footer-inner { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr 1fr; gap: 24px; padding-bottom: 36px; }
.footer-brand p { color: var(--text-muted); font-size: 14px; margin-top: 16px; max-width: 320px; }
.footer-col h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-body); font-size: 14px; margin-bottom: 9px; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0 22px; font-size: 13px; color: var(--text-muted); }
.footer-bottom-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-fineprint { margin: 10px 0 0; font-size: 10.5px; color: var(--text-muted); opacity: 0.6; line-height: 1.5; max-width: 680px; }
@media (max-width: 760px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

/* ===== Auth pages ===== */
.auth-shell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 940px;
    margin: 0 auto;
    padding: 40px 24px;
}
.auth-shell .auth-card { width: 100%; }
.auth-card {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.auth-side {
    position: relative;
    background: linear-gradient(160deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}
.auth-side::before, .auth-side::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
    filter: blur(2px);
}
.auth-side::before { width: 220px; height: 220px; top: -80px; right: -70px; }
.auth-side::after { width: 160px; height: 160px; bottom: -60px; left: -50px; background: rgba(255,255,255,0.1); }
.auth-side-icon-wrap {
    display: inline-flex; align-items: center; justify-content: center;
    width: 62px; height: 62px;
    background: #ffffff;
    border-radius: 18px;
    margin-bottom: 22px;
    position: relative; z-index: 1;
}
.auth-side-icon { width: 38px; height: 38px; display: block; }
.auth-side h2 { color: #fff; font-size: 22px; margin-bottom: 12px; position: relative; z-index: 1; }
.auth-side p { color: rgba(255,255,255,0.82); font-size: 14.5px; position: relative; z-index: 1; }
.auth-side-quote {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,0.22);
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #fff;
    position: relative;
    z-index: 1;
}
.auth-form-panel { padding: 48px 44px; }
.auth-form-panel h1 { font-size: 25px; }
.auth-form-panel .sub { color: var(--text-muted); margin-bottom: 26px; font-size: 14.5px; }

@media (max-width: 760px) {
    .auth-card { grid-template-columns: 1fr; }
    .auth-side { padding: 32px 30px; }
    .auth-side-quote { display: none; }
    .auth-form-panel { padding: 32px 26px; }
}

.field { margin-bottom: 18px; }
.field-center { display: flex; justify-content: center; }
.field label { display: block; font-weight: 700; font-size: 13.5px; color: var(--text-heading); margin-bottom: 8px; }
.field input, .field textarea, .field select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-page);
    color: var(--text-heading);
    font-family: inherit;
    font-size: 14.5px;
}
.field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238f8aa6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    cursor: pointer;
}
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .field select { background-color: var(--bg-surface-alt); }
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.field textarea { resize: vertical; min-height: 120px; }
.form-foot { text-align: center; margin-top: 22px; font-size: 14px; color: var(--text-muted); }
.form-foot a { color: var(--accent); font-weight: 700; }
.link-button {
    background: none; border: none; padding: 0; margin: 0;
    color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit;
}
.link-button:hover { text-decoration: underline; }

.alert {
    padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 20px;
    font-size: 14px; font-weight: 600;
}
.alert-error { background: var(--coral-soft); color: var(--danger); }
.alert-success { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.alert-dev { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

.code-input {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 12px;
    font-family: 'Quicksand', sans-serif;
    padding: 14px 14px 14px 26px;
}

.avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.field-hint { font-size: 12px; color: var(--text-muted); margin: 6px 0 0; }
.file-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-upload-input {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.file-upload-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
    background: var(--bg-surface-alt); color: var(--text-heading); font-weight: 600; font-size: 13.5px;
    cursor: pointer; transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}
.file-upload-btn:hover { background: var(--accent-soft); color: var(--accent); transform: translateY(-1px); }
.file-upload-input:focus-visible + .file-upload-btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-upload-name { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; max-width: 220px; white-space: nowrap; }
.avatar-presets-block { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.avatar-presets-label { font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 12px; }
.avatar-presets-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.avatar-preset-form { display: contents; }
.avatar-preset-btn {
    width: 48px; height: 48px; border-radius: 50%; padding: 0; overflow: hidden; cursor: pointer;
    background: none; border: 3px solid transparent; transition: border-color 0.15s ease, transform 0.15s ease;
}
.avatar-preset-btn img { width: 100%; height: 100%; border-radius: 50%; }
.avatar-preset-btn:hover { transform: scale(1.08); }
.avatar-preset-btn.active { border-color: var(--accent); }

/* ===== Карта сайта ===== */
.sitemap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.sitemap-list li { margin-bottom: 10px; }
.sitemap-list a { color: var(--text-body); font-size: 14.5px; }
.sitemap-list a:hover { color: var(--accent); }
@media (max-width: 900px) { .sitemap-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .sitemap-grid { grid-template-columns: 1fr; } }

.mood-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.mood-option { position: relative; }
.mood-option input { position: absolute; opacity: 0; }
.mood-option label {
    display: flex; align-items: center; gap: 6px;
    padding: 9px 15px; border-radius: 999px;
    font-size: 14px; font-weight: 600; cursor: pointer; margin: 0;
    background: var(--bg-surface-alt);
}
.mood-option input:checked + label { background: var(--accent); color: #fff; }

/* ===== Diary ===== */
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page-head {
    padding: 56px 0 28px;
    animation: fade-up 0.5s ease both;
}
.page-head h1 { font-size: 34px; }
.page-head p { color: var(--text-muted); max-width: 600px; }
.page-head + .section { padding-top: 12px; }
.page-head-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 16px; }
.page-head-links a { font-size: 13.5px; font-weight: 700; color: var(--accent); }
.page-head-links a:hover { text-decoration: underline; }
.section--compact { padding-top: 40px; }
.items-start { align-items: start; }
.card-title { font-size: 17px; margin-bottom: 2px; }
.alert-narrow { max-width: 720px; }
.question-form-actions .btn-primary { flex: 1; }
.panel-title { font-size: 19px; margin-bottom: 18px; }
.panel-title-tight { font-size: 19px; margin-bottom: 6px; }
.field-grow { margin-bottom: 0; flex: 1; }
.card-spaced { margin-bottom: 24px; }
.sub-spaced { margin-bottom: 18px; }
.eyebrow-tight { margin-bottom: 4px; }
.mb-0 { margin-bottom: 0; }
.state-card {
    max-width: 640px; margin: 0 auto 28px; padding: 38px 40px;
    background: linear-gradient(165deg, var(--bg-surface) 0%, var(--accent-soft) 145%);
}
.snapshot-pillars { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; }
.snapshot-pillar-chip {
    font-size: 13px; font-weight: 600; color: var(--text-body);
    background: var(--bg-surface-alt); border-radius: 999px; padding: 6px 14px;
}
.snapshot-pillar-chip strong { color: var(--accent); font-family: 'Quicksand', sans-serif; margin-left: 3px; }
.panel-title-lg { font-size: 22px; }

.diary-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 30px;
    align-items: start;
}
@media (max-width: 900px) {
    .diary-layout { grid-template-columns: 1fr; }
}
.diary-stats { display: flex; gap: 14px; margin-bottom: 28px; }
.stat-pill {
    flex: 1; background: var(--bg-surface); box-shadow: var(--shadow-soft);
    border-radius: var(--radius-md); padding: 16px; text-align: center;
}
.stat-pill strong { display: block; font-family: 'Quicksand', sans-serif; font-size: 24px; color: var(--accent); }
.stat-pill span { font-size: 12.5px; color: var(--text-muted); }

.entry-list { display: flex; flex-direction: column; gap: 16px; }
.entry-card {
    background: var(--bg-surface); box-shadow: var(--shadow-soft); border-radius: var(--radius-md);
    padding: 22px 24px;
}
.entry-card .entry-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.entry-card h3 { font-size: 17.5px; margin-bottom: 0; }
.entry-card .mood-tag { font-size: 20px; }
.entry-card .date { font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px; }
.entry-card p { color: var(--text-body); font-size: 14.5px; white-space: pre-line; margin-bottom: 12px; }
.entry-card .entry-actions { display: flex; gap: 14px; }
.entry-card .entry-actions button {
    background: none; border: none; color: var(--text-muted); font-size: 13px; font-weight: 700; cursor: pointer; padding: 0;
}
.entry-card .entry-actions button:hover { color: var(--danger); }

.empty-state {
    text-align: center; padding: 50px 20px; color: var(--text-muted);
    background: var(--bg-surface); border: 1px dashed var(--border); border-radius: var(--radius-md);
}

/* ===== About page ===== */
.value-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 10px; }
@media (max-width: 700px) { .value-list { grid-template-columns: 1fr; } }
.value-item { display: flex; gap: 14px; }
.value-item .glyph {
    width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
    display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.value-item h3 { font-size: 16.5px; margin-bottom: 4px; }
.value-item p { font-size: 14px; color: var(--text-muted); margin-bottom: 0; }

/* ===== Состояние: график динамики ===== */
.chart-sub { font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; }
.chart-headline { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.chart-big-num { font-family: 'Quicksand', sans-serif; font-size: 34px; font-weight: 700; color: var(--text-heading); }
.chart-headline-label { font-size: 13.5px; color: var(--text-muted); font-weight: 600; }
.line-chart { width: 100%; height: auto; display: block; margin-top: 8px; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-point { fill: var(--bg-surface); stroke: var(--accent); stroke-width: 2; cursor: pointer; }
.chart-point-current { fill: var(--coral); stroke: var(--bg-surface); stroke-width: 3; }
.chart-axis-labels {
    display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-muted);
    margin-top: 6px; padding: 0 2px;
}
.chart-axis-value { fill: var(--text-muted); font-size: 10px; font-family: 'Manrope', sans-serif; }
.chart-card { display: flex; flex-direction: column; }
.chart-card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.chart-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    gap: 10px; min-height: 160px; padding: 20px; border-radius: var(--radius-md); background: var(--bg-surface-alt);
}
.chart-placeholder p { color: var(--text-muted); font-size: 14px; max-width: 320px; margin: 0; }

/* ===== Radar / профиль ===== */
.radar-chart { width: 100%; max-width: 340px; height: auto; display: block; margin: 8px auto 0; }
.radar-grid { fill: none; stroke: var(--border); stroke-width: 1; }
.radar-axis { stroke: var(--border); stroke-width: 1; }
.radar-shape { fill: var(--accent); fill-opacity: 0.22; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.radar-dot { fill: var(--accent); stroke: var(--bg-surface); stroke-width: 2; }
.radar-label { fill: var(--text-muted); font-size: 11px; font-weight: 600; font-family: 'Manrope', sans-serif; }

/* ===== Слайдеры отметки дня ===== */
.pillar-form { margin-top: 12px; }
.pillar-row { margin-bottom: 20px; }
.pillar-row-head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
    font-size: 14px; color: var(--text-body); margin-bottom: 10px;
}
.pillar-row-head strong { color: var(--text-heading); }
.pillar-row-head output {
    font-family: 'Quicksand', sans-serif; font-weight: 700; color: var(--accent); font-size: 15px;
}
input[type="range"] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px;
    background: var(--border);
    outline: none; cursor: pointer; position: relative; z-index: 1;
}
input[type="range"]:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%;
    background: var(--btn-gradient); border: 3px solid #ffffff; cursor: pointer;
    box-shadow: 0 3px 10px -1px rgba(var(--accent-rgb), 0.55);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.22); box-shadow: 0 4px 16px -1px rgba(var(--accent-rgb), 0.7); }
input[type="range"]::-moz-range-thumb {
    width: 26px; height: 26px; border-radius: 50%; background: var(--btn-gradient); border: 3px solid #ffffff;
    cursor: pointer; box-shadow: 0 3px 10px -1px rgba(var(--accent-rgb), 0.55);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}
input[type="range"]:active::-moz-range-thumb { transform: scale(1.22); }
input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: transparent; }
.slider-wrap { position: relative; display: flex; align-items: center; }
.slider-fill {
    position: absolute; left: 0; height: 8px; border-radius: 999px;
    background: linear-gradient(to right, var(--accent), var(--coral));
    transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none; z-index: 0;
}
.pillar-form-foot { display: flex; align-items: center; gap: 16px; margin-top: 8px; flex-wrap: wrap; }

/* ===== Тесты ===== */
.notice-box {
    background: var(--coral-soft); color: var(--text-body); border-radius: var(--radius-md);
    padding: 16px 20px; font-size: 14px; line-height: 1.6; margin-bottom: 28px;
    border-left: 3px solid var(--coral);
}
.test-card { display: flex; flex-direction: column; }
.test-card.test-card-soon { opacity: 0.6; }
.test-duration { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.test-meta { font-size: 12.5px; color: var(--text-muted); text-align: center; margin: 10px 0 0; }
.badge-soon {
    display: inline-block; align-self: flex-start; background: var(--bg-surface-alt); color: var(--text-muted);
    font-size: 12.5px; font-weight: 700; padding: 8px 16px; border-radius: 999px;
}
.test-narrow { max-width: 640px; margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 18px; font-size: 14px; font-weight: 600; color: var(--text-muted); }
.back-link:hover { color: var(--accent); }
.test-progress { font-size: 13px; color: var(--text-muted); font-weight: 600; margin: 4px 0 6px; }
.test-question { font-size: 22px; margin-bottom: 26px; }
.question-form input[type="range"] { margin-bottom: 10px; }
.question-form-actions { display: flex; gap: 12px; margin-top: 20px; }
.qval-out {
    font-family: 'Quicksand', sans-serif; font-weight: 700; color: var(--accent); font-size: 16px;
}
.test-progress-bar { height: 5px; border-radius: 999px; background: var(--border); margin-bottom: 22px; overflow: hidden; }
.test-progress-bar-fill { height: 100%; background: var(--btn-gradient); border-radius: 999px; transition: width 0.25s ease; }
.result-head { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.result-badge {
    flex-shrink: 0; width: 84px; height: 84px; border-radius: 50%;
    background-image: linear-gradient(var(--bg-surface), var(--bg-surface)), var(--btn-gradient);
    background-origin: border-box; background-clip: padding-box, border-box;
    border: 3px solid transparent;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: var(--shadow-soft);
}
.result-badge-num { font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 23px; color: var(--text-heading); line-height: 1.1; }
.result-badge-max { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.result-scale { margin: 20px 0; }
.result-scale-track { position: relative; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--coral)); }
.result-scale-marker {
    position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%;
    background: #ffffff; border: 3px solid var(--accent-strong); transform: translate(-50%, -50%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.result-scale-labels { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-muted); margin-top: 8px; }
.test-result-title { font-size: 22px; margin-bottom: 0; }
.tip-box {
    background: var(--accent-soft); border-radius: var(--radius-md); padding: 18px 22px; margin: 22px 0;
}
.tip-box h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-strong); margin-bottom: 6px; }
.tip-box p { margin-bottom: 0; color: var(--text-body); font-size: 14.5px; }

.related-practices { margin: 24px 0; }
.related-practices h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 12px; }
.related-practices-list { display: flex; flex-direction: column; gap: 8px; }
.related-practice-card {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 13px 16px; border-radius: var(--radius-sm); background: var(--bg-surface-alt);
    transition: background 0.15s ease, transform 0.15s ease;
}
.related-practice-card:hover { background: var(--accent-soft); transform: translateX(2px); }
.related-practice-title { font-size: 14.5px; font-weight: 600; color: var(--text-heading); }
.related-practice-meta { font-size: 12.5px; color: var(--text-muted); flex-shrink: 0; }

.voice-status { font-size: 13px; color: var(--text-muted); display: block; margin-top: 6px; }

@keyframes voice-rec-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
@keyframes voice-mic-ring {
    0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.45); }
    100% { box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0); }
}

/* ===== Composer: textarea + inline mic button (как в Telegram/VK) ===== */
.composer { position: relative; }
.composer textarea { padding-right: 52px; }
.composer-mic {
    position: absolute;
    right: 10px; bottom: 10px;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--btn-gradient);
    color: #fff;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform 0.15s ease, background 0.15s ease;
    animation: voice-mic-ring 2s ease-out infinite;
}
.composer-mic:hover { transform: scale(1.06); }
.composer-mic.is-recording { background: var(--danger); animation: none; }
.composer-mic .icon-stop { color: #fff; }

.composer-recording {
    display: flex; align-items: center; gap: 9px;
    margin-top: 8px; padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: var(--coral-soft);
    font-size: 12px; color: var(--text-muted);
}
.composer-rec-dot {
    flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%;
    background: var(--danger);
    animation: voice-rec-pulse 1.1s ease-in-out infinite;
}
.composer-rec-bars { display: flex; align-items: center; gap: 2px; height: 20px; flex-shrink: 0; }
.composer-rec-bar { width: 2.5px; min-height: 3px; border-radius: 2px; background: var(--danger); }
.composer-rec-time { flex-shrink: 0; font-variant-numeric: tabular-nums; color: var(--text-heading); font-weight: 700; }
.composer-rec-hint { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Voice bubble player (waveform, в стиле Telegram/VK) ===== */
.voice-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 999px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    margin-top: 10px;
}
.voice-bubble audio { display: none; }
.voice-bubble-toggle {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--btn-gradient);
    color: #fff;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform 0.15s ease;
}
.voice-bubble-toggle:hover { transform: scale(1.06); }
.voice-bubble-toggle svg { width: 12px; height: 12px; }
.voice-bubble-toggle .icon-play { margin-left: 1px; }
.voice-bubble-wave {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 2px;
    height: 28px;
    cursor: pointer;
}
.voice-bubble-wave-bar {
    flex: 1;
    min-width: 1px;
    border-radius: 2px;
    background: rgba(var(--accent-rgb), 0.28);
    transition: background 0.1s ease;
}
.voice-bubble-wave-bar.is-played { background: var(--accent); }
.voice-bubble-time {
    flex-shrink: 0;
    font-size: 11.5px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 30px;
}
.voice-bubble-remove {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.voice-bubble-remove:hover { background: var(--coral-soft); color: var(--danger); border-color: var(--coral-soft); }
.voice-bubble-entry { margin: 10px 0 12px; }

.trigger-linked-practice { font-size: 13.5px; color: var(--text-body); margin-bottom: 12px; }
.trigger-linked-practice a { color: var(--accent); font-weight: 700; }
.trigger-linked-practice-empty { color: var(--text-muted); }

.trigger-widget {
    margin: 4px 0 22px; padding: 18px 20px; border-radius: var(--radius-md);
    background: var(--bg-surface-alt);
}
.trigger-widget h3 { font-size: 14px; margin-bottom: 8px; }
.trigger-widget p { font-size: 13.5px; color: var(--text-body); margin-bottom: 10px; }
.trigger-widget p:last-child { margin-bottom: 0; }
.trigger-widget a { color: var(--accent); font-weight: 700; }
.trigger-widget-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.trigger-chip {
    font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent-strong);
    transition: background 0.15s ease, transform 0.15s ease;
}
.trigger-chip:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.trigger-chip-plain { cursor: default; }
.trigger-chip-plain:hover { background: var(--accent-soft); color: var(--accent-strong); transform: none; }
.trigger-widget-manage { font-size: 12.5px; }

/* ===== Юридические документы ===== */
.legal-doc { max-width: 760px; }
.legal-doc h2 { font-size: 19px; margin-top: 36px; }
.legal-doc h2:first-of-type { margin-top: 0; }
.legal-doc p { color: var(--text-body); font-size: 15px; }
.legal-doc a { color: var(--accent); font-weight: 700; }
.legal-list { margin: 0 0 16px; padding-left: 20px; list-style: disc; }
.legal-list li { color: var(--text-body); font-size: 15px; margin-bottom: 10px; line-height: 1.6; }
.legal-list strong { color: var(--text-heading); }

/* ===== Чекбокс согласия ===== */
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-field input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.checkbox-field label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.checkbox-field a { color: var(--accent); font-weight: 700; }

/* ===== Страницы ошибок ===== */
.error-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: var(--bg-page); padding: 24px;
}
.error-card {
    max-width: 440px; text-align: center; background: var(--bg-surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card); padding: 48px 40px;
}
.error-icon { width: 56px; height: 56px; margin: 0 auto 20px; }
.error-code {
    font-family: 'Quicksand', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: 3px;
    color: var(--coral); margin-bottom: 10px;
}
.error-card h1 { font-size: 24px; margin-bottom: 12px; }
.error-card p { color: var(--text-muted); font-size: 14.5px; margin-bottom: 26px; }

/* ===== Календарь состояния ===== */
.cal-card {
    margin-top: 24px; padding: 40px;
    background: linear-gradient(160deg, var(--bg-surface) 0%, var(--accent-soft) 190%);
    transition: opacity 0.15s ease;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.cal-nav { display: flex; align-items: center; gap: 18px; }
.cal-nav-btn {
    width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--bg-surface); color: var(--text-body); font-weight: 600; box-shadow: var(--shadow-soft);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.cal-nav-btn:hover { background: var(--accent-soft); color: var(--accent); transform: scale(1.08); }
.cal-month-label { font-family: 'Quicksand', sans-serif; font-weight: 600; font-size: 16px; color: var(--text-heading); min-width: 140px; text-align: center; }
.cal-wrap { max-width: 640px; margin: 0 auto; }
.cal-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 10px;
    font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: center; text-transform: uppercase;
    letter-spacing: 1px; opacity: 0.75;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.cal-cell {
    aspect-ratio: 1; border-radius: 18px; background: var(--bg-surface);
    position: relative;
    font-size: 11px; color: var(--text-muted);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, background-color 0.25s ease;
}
.cal-cell-empty { background: transparent; }
.cal-cell-filled {
    background-color: rgba(var(--accent-rgb), var(--cell-alpha));
    color: var(--text-heading); cursor: default;
}
.cal-cell-filled:hover { transform: translateY(-2px) scale(1.05); box-shadow: var(--shadow-soft); }
.cal-cell-today { box-shadow: 0 0 0 2px var(--coral) inset; animation: cal-today-breathe 3.2s ease-in-out infinite; }
.cal-cell-filled.cal-cell-today:hover { box-shadow: 0 0 0 2px var(--coral) inset, var(--shadow-soft); }
@keyframes cal-today-breathe {
    0%, 100% { box-shadow: 0 0 0 2px var(--coral) inset; }
    50% { box-shadow: 0 0 0 2px var(--coral) inset, 0 0 0 5px color-mix(in srgb, var(--coral) 25%, transparent); }
}
.cal-day-num { position: absolute; top: 7px; right: 9px; line-height: 1; font-size: 10px; opacity: 0.55; }
.cal-day-val {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: 'Quicksand', sans-serif; font-weight: 600; font-size: 14px; color: var(--accent-strong);
}
:root[data-theme="dark"] .cal-day-val { color: var(--text-heading); }
.cal-legend { display: flex; align-items: center; gap: 7px; margin-top: 24px; font-size: 11.5px; color: var(--text-muted); }
.cal-legend-swatch { width: 15px; height: 15px; border-radius: 6px; background-color: rgba(var(--accent-rgb), var(--cell-alpha)); }

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

@media (max-width: 560px) {
    .cal-card { padding: 28px 22px; }
    .cal-wrap { max-width: 100%; }
    .cal-grid, .cal-weekdays { gap: 6px; }
    .cal-cell { border-radius: 12px; font-size: 9.5px; }
    .cal-day-val { font-size: 12px; }
}

/* ===== Экспорт ===== */
.export-body { background: var(--bg-page); }
.export-wrap { max-width: 860px; margin: 0 auto; padding: 32px 24px 80px; }
.export-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.export-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.export-doc { background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 48px; }
.export-header { display: flex; align-items: center; gap: 18px; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.export-header .logo { height: 34px; }
.export-header h1 { font-size: 22px; margin-bottom: 4px; }
.export-header p { color: var(--text-muted); font-size: 13.5px; margin: 0; }
.export-doc h2 { font-size: 17px; margin-top: 36px; padding-top: 4px; }
.export-doc h2:first-of-type { margin-top: 0; }
.export-empty { color: var(--text-muted); font-size: 14px; }
.export-entry { padding: 16px 0; border-bottom: 1px solid var(--border); }
.export-entry:last-child { border-bottom: none; }
.export-entry-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.export-entry h3 { font-size: 15.5px; margin-bottom: 6px; }
.export-entry p { font-size: 14px; color: var(--text-body); white-space: pre-line; margin-bottom: 0; }
.export-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.export-table th, .export-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.export-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.export-footer-note { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); text-align: center; }

@media print {
    .no-print { display: none !important; }
    .export-wrap { max-width: 100%; padding: 0; }
    .export-doc { box-shadow: none; border-radius: 0; padding: 0; }
    body, .export-body { background: #ffffff !important; }
}
