:root {
    --content-width: 1000px;
    --header-bg: #004d88;
    --hero-bg: #eef4fb;
    --hero-visual-bg: linear-gradient(135deg, rgba(63, 81, 181, 0.08) 0%, rgba(124, 58, 237, 0.06) 100%);
    --accent: #3F51B5;
    --accent-hover: #673AB7;
    --teal: #0d9488;
    --dark: #0f172a;
    --heading: #0f172a;
    --text: #0f172a;
    --text-muted: #64748b;
    --muted: #64748b;
    --primary: #ffffff;
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.06);
    --transition: 0.2s ease;
    --adm-bg: #f8fafc;
    --adm-surface: #ffffff;
    --adm-border: #e2e8f0;
    --adm-text: #0f172a;
    --adm-text-muted: #64748b;
    --adm-radius: 12px;
    --adm-radius-sm: 8px;
    --adm-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    --adm-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.06);
    --adm-transition: 0.2s ease;
}

/* Тёмная тема */
[data-theme="dark"] {
    --header-bg: #0f172a;
    --hero-bg: #131c31;
    --hero-visual-bg: linear-gradient(135deg, rgb(26 44 68) 0%, rgb(24 42 66) 100%);
    --heading: #f1f5f9;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --muted: #94a3b8;
    --bg: #0f172a;
    --card: #1e293b;
    --border: #334155;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.3);
    --adm-bg: #0f172a;
    --adm-surface: #1e293b;
    --adm-border: #334155;
    --adm-text: #e2e8f0;
    --adm-text-muted: #94a3b8;
    --adm-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    --adm-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .section--muted { background: #1e293b; }
[data-theme="dark"] .doc-content pre { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .doc-content code { background: #334155; border-color: #475569; color: #e2e8f0; }
[data-theme="dark"] .adm .url-box { background: #0f172a; color: #e2e8f0; border-color: #334155; }
[data-theme="dark"] .btn-outline { background: transparent; color: rgba(255,255,255,0.9); border-color: rgba(255,255,255,0.4); }
[data-theme="dark"] .btn-outline:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.6); color: #fff; }
[data-theme="dark"] .confirm-box { background: var(--adm-surface); border-color: var(--adm-border); }
[data-theme="dark"] .auth-err { background: rgba(185, 28, 28, 0.25); border-color: #7f1d1d; }
[data-theme="dark"] .auth-ok { background: rgba(22, 101, 52, 0.25); border-color: #14532d; }
[data-theme="dark"] .nav-cta { background: rgba(255,255,255,0.2); color: #fff !important; border: 1px solid rgba(255,255,255,0.35); }
[data-theme="dark"] .nav-cta:hover { background: rgba(255,255,255,0.3); }
[data-theme="dark"] .hero-doc-link { color: rgba(255, 255, 255, 0.9); }
[data-theme="dark"] .hero-doc-link:hover { color: #fff; }

/* Кнопка переключения темы в шапке */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    margin: 0 0.25rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}
.theme-toggle:active { transform: scale(0.96); }
.theme-toggle:focus-visible { outline: 2px solid rgba(255,255,255,0.8); outline-offset: 2px; }

.theme-toggle-icon {
    display: inline-block;
    width: 1.15rem;
    height: 1.15rem;
}
.theme-toggle-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.theme-toggle-sun { display: none; }
.theme-toggle-moon { display: block; }
[data-theme="dark"] .theme-toggle-sun { display: block; }
[data-theme="dark"] .theme-toggle-moon { display: none; }

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--adm-text);
    background: var(--adm-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 16px;
    min-width: 0;
}

.header {
    background: var(--header-bg);
    color: rgba(255, 255, 255, 0.95);
    padding: 1rem 0;
    box-shadow: 0 1px 8px rgba(0, 77, 136, 0.2);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 1.15rem;
}

.logo img {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.logo-text { letter-spacing: -0.02em; }

.nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.nav a {
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

.nav-cta {
    background: #fff;
    color: var(--header-bg) !important;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.nav-cta:hover { background: #f0f7ff; text-decoration: none; }

/* Site header: menu links separate from theme + CTA */
.site-header .header-inner {
    flex-wrap: wrap;
}
.site-header .nav-menu {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}
.site-header .header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    padding-left: 1rem;
    margin-left: 0.25rem;
}

.main { flex: 1; min-width: 0; padding-bottom: 3rem; }

img { max-width: 100%; height: auto; vertical-align: middle; }

.hero {
    padding: 5rem 0 5.5rem;
    background: var(--hero-bg);
    border-bottom: 1px solid var(--adm-border);
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
    min-width: 0;
}

.hero .hero-text { text-align: center; }

@media (min-width: 900px) {
    .hero-inner { grid-template-columns: 1fr 320px; gap: 3rem; }
    .hero .hero-text { text-align: left; }
    .hero .hero-actions { justify-content: flex-start; }
}

.hero-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--adm-text);
    margin-bottom: 0.75rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (min-width: 600px) {
    .hero-title { font-size: 2.1rem; }
}

.hero-lead {
    font-size: 1.05rem;
    color: var(--adm-text-muted);
    max-width: 540px;
    margin: 0 0 1.5rem;
    line-height: 1.6;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.hero .hero-text .hero-lead { margin-left: auto; margin-right: auto; }
@media (min-width: 900px) {
    .hero .hero-text .hero-lead { margin-left: 0; margin-right: 0; }
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-cta .hero-actions { margin-top: 0.5rem; }

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.hero-visual-inner {
    width: 100%;
    max-width: 350px;
    height: 180px;
}
.hero-visual-inner:has(img) {
    height: auto;
    padding: 0;
}
.hero-visual-inner img {
    width: 100%;
    height: auto;
    vertical-align: middle;
}

.hero-visual img {
    max-width: 100%;
    height: auto;
    display: block;
    padding: 30px;
}

.hero-doc-link {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--header-bg);
    text-decoration: none;
}

.hero-doc-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.btn {
    display: inline-block;
    padding: 0.65rem 1.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-save { background: #16a34a; color: #fff; font-weight: 600; }
.btn-save:hover { background: #15803d; }

.btn-danger { background: #dc2626; color: #fff; font-weight: 600; }
.btn-danger:hover { background: #b91c1c; }

.btn-outline {
    background: #fff;
    color: var(--accent);
    border: 1px solid var(--accent);
    font-weight: 600;
}

.btn-outline:hover { background: #eef4fb; border-color: var(--accent-hover); color: var(--accent-hover); }

.btn-secondary { background: var(--accent); color: #fff; font-weight: 600; }
.btn-secondary:hover { background: var(--accent-hover); }

.section {
    padding: 3rem 0;
}

.section--muted {
    background: #e2e8f0;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--adm-text);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.section-desc { color: var(--adm-text-muted); margin-bottom: 1.5rem; font-size: 1rem; font-weight: 400; line-height: 1.6; overflow-wrap: break-word; word-wrap: break-word; }

.how-list {
    list-style: none;
    padding-left: 0;
}

.how-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--adm-text);
    font-weight: 400;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.how-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
}

.how-list a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.how-list a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.doc-callout {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--adm-surface);
    border-radius: var(--adm-radius);
    border: 1px solid var(--adm-border);
    border-left: 4px solid var(--accent);
    font-size: 0.95rem;
    color: var(--adm-text);
}

.doc-callout a {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}

.doc-callout a:hover { text-decoration: underline; text-underline-offset: 2px; }

.faq-block { margin-top: 1.5rem; padding: 1.25rem 0; border-top: 1px solid var(--adm-border); }
.faq-block:first-of-type { margin-top: 1rem; padding-top: 0; border-top: none; }
.faq-block-title { font-size: 1.05rem; font-weight: 600; color: var(--adm-text); margin-bottom: 0.5rem; }
.faq-block p { margin-bottom: 0.5rem; color: var(--adm-text); }
.faq-steps { padding-left: 1.35rem; margin: 0.5rem 0 0; }
.faq-steps li { margin-bottom: 0.5rem; color: var(--adm-text); line-height: 1.55; }
.section-desc--small { font-size: 0.9375rem; margin-top: 1rem; }

.doc-page .section { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.doc-hero { padding-top: 2rem; padding-bottom: 1.5rem; }
.doc-hero-title { font-size: 1.6rem; font-weight: 700; color: var(--adm-text); margin-bottom: 0.75rem; line-height: 1.3; }
.doc-hero-lead { font-size: 1.05rem; color: var(--adm-text-muted); line-height: 1.6; max-width: var(--content-width); }
.doc-content { max-width: var(--content-width); margin: 0 auto; }
.doc-content .section-title { margin-top: 0.5rem; }
.doc-steps { padding-left: 1.25rem; margin: 0 0 1rem; }
.doc-steps li { margin-bottom: 0.6rem; color: var(--adm-text); line-height: 1.55; }
.doc-h3 { font-size: 1.1rem; font-weight: 600; color: var(--adm-text); margin: 1.25rem 0 0.5rem; }
.doc-table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--adm-border); border-radius: var(--adm-radius); -webkit-overflow-scrolling: touch; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.doc-table th, .doc-table td { padding: 0.65rem 1rem; text-align: left; border-bottom: 1px solid var(--adm-border); }
.doc-table th { background: var(--adm-surface); font-weight: 600; color: var(--adm-text); }
.doc-table tr:last-child td { border-bottom: none; }
.doc-faq { margin: 0; }
.doc-faq dt { font-weight: 600; color: #334155; margin-top: 1rem; }
.doc-faq dt:first-child { margin-top: 0; }
.doc-faq dd { margin: 0.35rem 0 0; padding-left: 0; color: #334155; line-height: 1.55; }
.doc-cta .hero-actions { margin-top: 0.5rem; }
.doc-content a { color: var(--accent); text-decoration: none; font-weight: 500; }
.doc-content a:hover { text-decoration: underline; text-underline-offset: 2px; }
.nav a.is-active { font-weight: 700; color: #fff; text-decoration: underline; text-underline-offset: 4px; }

.section-pricing { padding-top: 2rem; padding-bottom: 2.5rem; }
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    max-width: var(--content-width);
    margin: 0 auto;
}
.pricing-card {
    background: var(--adm-surface);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    box-shadow: var(--adm-shadow);
    transition: box-shadow var(--adm-transition), border-color var(--adm-transition);
}
.pricing-card:hover { box-shadow: var(--adm-shadow-hover); }
.pricing-card--featured { border-color: var(--accent); border-width: 2px; box-shadow: 0 4px 14px rgba(63, 81, 181, 0.15); }
.pricing-card--featured:hover { box-shadow: 0 6px 18px rgba(63, 81, 181, 0.2); }
.pricing-badge { position: absolute; top: -0.5rem; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.pricing-name { font-size: 1.2rem; font-weight: 700; margin: 0 0 0.35rem; color: var(--adm-text); }
.pricing-desc { font-size: 0.9rem; color: var(--adm-text-muted); margin: 0 0 0.75rem; }
.pricing-price { font-size: 1.5rem; font-weight: 800; margin: 0; color: var(--accent); }
.pricing-period { font-size: 0.85rem; color: var(--adm-text-muted); margin: 0 0 1rem; }
.pricing-btn { display: block; width: 100%; margin-top: 0.5rem; }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--adm-surface);
    border-radius: var(--adm-radius);
    padding: 0;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--adm-border);
    box-shadow: var(--adm-shadow);
    transition: box-shadow var(--adm-transition), transform var(--adm-transition), border-color var(--adm-transition);
    overflow: hidden;
}

.tool-card::before {
    content: "";
    display: block;
    height: 5px;
    background: var(--accent);
}

.tool-card:nth-child(2)::before { background: var(--teal); }

.tool-card:hover {
    box-shadow: var(--adm-shadow-hover);
    transform: translateY(-2px);
}

.tool-card:hover::before { height: 6px; }

.tool-card .tool-card-icon,
.tool-card .tool-card-title,
.tool-card .tool-card-desc {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
}

.tool-card .tool-card-icon { padding-top: 1.5rem; }
.tool-card .tool-card-desc { padding-bottom: 1.75rem; }

.tool-card-icon { display: block; margin-bottom: 0.75rem; color: var(--accent); }
.tool-card-icon .lucide { width: 2rem; height: 2rem; stroke: currentColor; }
.tool-card:nth-child(2) .tool-card-icon { color: var(--teal); }

.tool-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--adm-text);
    margin-bottom: 0.5rem;
}

.tool-card-desc { font-size: 0.95rem; color: var(--adm-text-muted); line-height: 1.55; font-weight: 400; }

.tool-page { padding: 2.5rem 0; flex: 1; }

.tool-container {
    background: var(--adm-surface);
    border-radius: var(--adm-radius);
    padding: 2rem;
    box-shadow: var(--adm-shadow);
    border: 1px solid var(--adm-border);
    max-width: var(--content-width);
    margin: 0 auto;
    transition: box-shadow var(--adm-transition);
}
.tool-container:hover { box-shadow: var(--adm-shadow-hover); }

.tool-container h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--adm-text);
    margin-bottom: 0.5rem;
    text-align: center;
}

.tool-description {
    text-align: center;
    color: var(--adm-text-muted);
    font-size: 1rem;
    margin-bottom: 1.75rem;
    font-weight: 400;
}

.input-group { margin-bottom: 1.25rem; }

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--adm-text-muted);
}

.input-group input[type="text"],
.input-group textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--adm-surface);
    color: var(--adm-text);
    transition: border-color var(--adm-transition), box-shadow var(--adm-transition);
}

.input-group textarea {
    min-height: 110px;
    resize: vertical;
}

.input-group input[type="text"]:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.12);
}

.settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.setting-group label { display: block; margin-bottom: 0.4rem; font-size: 0.875rem; font-weight: 600; color: var(--adm-text-muted); }

.setting-group select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-sm);
    font-size: 0.9375rem;
    background: var(--adm-surface);
    color: var(--adm-text);
    cursor: pointer;
    transition: border-color var(--adm-transition), box-shadow var(--adm-transition);
}

.setting-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.12);
}

.setting-group input[type="checkbox"] { margin-right: 0.5rem; }

.buttons { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

.result {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: var(--adm-bg);
    border-radius: var(--adm-radius-sm);
    border: 1px solid var(--adm-border);
    border-left: 4px solid var(--accent);
}

.result h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--adm-text); }

.output {
    font-family: ui-monospace, 'SF Mono', monospace;
    font-size: 0.9rem;
    padding: 0.85rem 1rem;
    background: var(--adm-surface);
    border-radius: var(--adm-radius-sm);
    min-height: 2.5rem;
    word-break: break-all;
    border: 1px solid var(--adm-border);
    color: var(--adm-text);
    font-weight: 400;
}

.footer {
    background: var(--header-bg);
    color: rgba(255, 255, 255, 0.95);
    padding: 1.75rem 0;
    margin-top: auto;
    box-shadow: 0 -1px 8px rgba(0, 77, 136, 0.2);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; }

.footer-links a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }

.footer-copy { font-size: 0.875rem; font-weight: 400; }

.doc-page { padding-top: 2rem; padding-bottom: 3rem; }

.doc-layout {display: flex;gap: 0;align-items: flex-start;margin-top: 1.5rem;max-width: 1024px;margin-left: auto;margin-right: auto;padding: 0 1rem;}
.doc-sidebar { flex-shrink: 0; width: 220px; position: sticky; top: 1.5rem; }
.doc-nav { display: flex; flex-direction: column; gap: 0.25rem; }
.doc-nav a { color: var(--adm-text); text-decoration: none; font-size: 0.9rem; padding: 0.4rem 0.6rem; border-radius: 6px; transition: background 0.15s, color 0.15s; }
.doc-nav a:hover { background: rgba(63, 81, 181, 0.08); color: var(--accent); }
.doc-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.doc-center { flex: 1; min-width: 0; background: #f8fafc; border-radius: 12px; padding: 1.5rem 1.75rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
[data-theme="dark"] .doc-center { background: #f1f5f9; color: #0f172a; }
[data-theme="dark"] .doc-center .section-title { color: #0f172a; }
[data-theme="dark"] .doc-center .doc-h3 { color: #1e293b; }
[data-theme="dark"] .doc-center p { color: #334155; }
[data-theme="dark"] .doc-center li { color: #334155; }
[data-theme="dark"] .doc-center .doc-table { color: #334155; }
[data-theme="dark"] .doc-center .doc-table th { background: #e2e8f0; color: #0f172a; border-color: #cbd5e1; }
[data-theme="dark"] .doc-center .doc-table td { border-color: #e2e8f0; }
[data-theme="dark"] .doc-center .doc-content a { color: #4338ca; }
[data-theme="dark"] .doc-center .doc-content code { background: #e2e8f0; border-color: #cbd5e1; color: #1e293b; }
.doc-center .section { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.doc-center .section--muted { background: transparent; }
.doc-center .section:first-child { padding-top: 0; }
.doc-cta-inner { max-width: none; }

.doc-content .doc-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--adm-text);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}
.doc-content h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--adm-text);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--accent);
}
.doc-content h2:first-of-type { margin-top: 0; }
.doc-content p { margin-bottom: 1rem; color: var(--adm-text); line-height: 1.65; }
.doc-content ul, .doc-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--adm-text);
    line-height: 1.65;
}
.doc-content li { margin-bottom: 0.35rem; }
.doc-content li ul, .doc-content li ol { margin-top: 0.35rem; margin-bottom: 0.5rem; }
.doc-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.doc-content a:hover { text-decoration: underline; text-underline-offset: 2px; }
.doc-content code {
    font-family: ui-monospace, 'SF Mono', monospace;
    font-size: 0.9em;
    padding: 0.15rem 0.4rem;
    background: var(--adm-bg);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius-sm);
    color: var(--adm-text);
}
.doc-content pre {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: var(--adm-radius-sm);
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
    border: 1px solid #334155;
}
.doc-content pre code {
    padding: 0;
    background: none;
    border: none;
    color: inherit;
}
.doc-content hr {
    border: none;
    border-top: 1px solid var(--adm-border);
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .container { padding: 0 14px; }
    .header-inner { flex-direction: row; align-items: center; }
    .logo { max-width: 150px; min-width: 0; font-size: 1rem; }
    .logo img { width: 30px; height: 30px; }
    .nav-cta { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
    .theme-toggle { width: 1.75rem; height: 1.75rem; }
    .theme-toggle-icon { width: 1rem; height: 1rem; }
    .nav { flex-wrap: wrap; }
    /* Site header: menu below first row on tablet/mobile */
    .site-header .header-inner { align-items: center; }
    .site-header .logo { order: 0; }
    .site-header .header-actions { order: 1; margin-left: auto; border-left: none; padding-left: 0; }
    .site-header .nav-menu { order: 2; flex-basis: 100%; width: 100%; padding-top: 0.75rem; margin-top: 0.5rem; border-top: 1px solid rgba(255, 255, 255, 0.25); }
    .hero { padding: 2.5rem 0 2rem; }
    .hero-title { font-size: 1.6rem; }
    .section { padding: 2rem 0; }
    .footer-inner { flex-direction: column; text-align: center; gap: 0.75rem; }
    .footer-links { justify-content: center; }
    .doc-layout { flex-direction: column; gap: 1rem; padding: 0 14px; }
    .doc-sidebar { position: static; width: 100%; }
    .doc-nav { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
    .doc-nav a { padding: 0.5rem 0.75rem; background: var(--adm-bg); border: 1px solid var(--adm-border); }
    .doc-center { padding: 1.25rem 1rem; }
}

@media (max-width: 480px) {
    .nav { flex-direction: column; align-items: flex-start; }
    .site-header .nav-menu { flex-direction: column; align-items: flex-start; }
    .tool-container { padding: 1.35rem; }
    .settings { grid-template-columns: 1fr; }
    .buttons { flex-direction: column; }
}

body.admin { line-height: 1.65; background: var(--adm-bg); color: var(--adm-text); }
.adm .adm-ctn {padding-bottom: 3rem;min-height: 60vh;min-width: 0;}
.adm .adm-nav {display: flex;flex-wrap: wrap;gap: 0.5rem;padding: 1.25rem 0 1.5rem;margin-bottom: 0;transition: border-color var(--adm-transition);}
.adm .adm-nav-btn { display: inline-block; padding: 0.6rem 1.25rem; border-radius: var(--adm-radius-sm); font-weight: 600; font-size: 0.9rem; letter-spacing: 0.01em; text-decoration: none; color: #fff; border: none; cursor: pointer; box-shadow: var(--adm-shadow); transition: transform var(--adm-transition), box-shadow var(--adm-transition), opacity var(--adm-transition); }
.adm .adm-nav-btn:hover { box-shadow: var(--adm-shadow-hover); }
.adm .adm-nav-btn:active { transform: translateY(0); }
.adm .adm-nav-btn--main { background: #2563eb; }
.adm .adm-nav-btn--main.is-active { background: #1d4ed8; box-shadow: 0 2px 8px rgba(29, 78, 216, 0.25); }
.adm .adm-nav-btn--campaigns { background: #7c3aed; }
.adm .adm-nav-btn--campaigns.is-active { background: #6d28d9; box-shadow: 0 2px 8px rgba(109, 40, 217, 0.25); }
.adm .adm-nav-btn--users { background: #0d9488; }
.adm .adm-nav-btn--users.is-active { background: #0f766e; box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25); }
.adm .adm-nav-btn--settings { background: #64748b; }
.adm .adm-nav-btn--settings.is-active { background: #475569; box-shadow: 0 2px 8px rgba(71, 85, 105, 0.25); }
.adm .adm-nav-btn:not(.is-active) { opacity: 0.9; }
.adm .adm-nav-btn:not(.is-active):hover { opacity: 1; }
.adm .card {padding: 1.5rem;margin-bottom: 1.75rem;background: var(--adm-surface);box-shadow: var(--adm-shadow);border: 1px solid var(--adm-border);transition: box-shadow var(--adm-transition), border-color var(--adm-transition);}
.adm .card:hover { box-shadow: var(--adm-shadow-hover); }
.adm .card:last-of-type { margin-bottom: 0; }
.adm .card h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; color: var(--adm-text); margin-bottom: 0.5rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--adm-border); }
.adm .card-desc {font-size: 0.9375rem;color: var(--adm-text-muted);margin-bottom: 1.5rem;line-height: 1.6;}
.adm .cl-plan-info {font-size: 0.9rem;font-weight: 600;color: var(--adm-text);padding-bottom: 1rem;}
.adm .help { font-size: 0.8125rem; color: var(--adm-text-muted); margin-top: 0.35rem; margin-bottom: 0.5rem; line-height: 1.5; }
.adm .help a { color: var(--accent); text-decoration: none; font-weight: 500; transition: opacity var(--adm-transition); }
.adm .help a:hover { text-decoration: underline; text-underline-offset: 2px; opacity: 0.9; }
.adm .section-label { display: inline-block; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #fff; margin-bottom: 0.75rem; margin-top: 1.25rem; padding: 0.35rem 0.65rem; background: var(--accent); border-radius: 6px; }
.adm .section-label:first-of-type { margin-top: 0; }
.adm .card label,
.adm .p-body label {display: block;font-weight: 600;margin-bottom: 0.4rem;font-size: 0.75rem;color: var(--adm-text-muted);}
.adm .card input[type="text"],
.adm .card input[type="password"],
.adm .card select,
.adm .p-body input[type="text"],
.adm .p-body select {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  font-size: 0.9375rem;
  background: var(--adm-surface);
  color: var(--adm-text);
  transition: border-color var(--adm-transition), box-shadow var(--adm-transition);
}
.adm .card select,
.adm .p-body select { cursor: pointer; }
.adm .card input::placeholder,
.adm .p-body input::placeholder { color: var(--adm-text-muted); }
.adm .card input:focus,
.adm .card select:focus,
.adm .p-body input:focus,
.adm .p-body select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.12);
}
.adm .card .row,
.adm .p-body .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 640px) {
  .adm .card .row,
  .adm .p-body .row { grid-template-columns: 1fr; }
}
.adm .card .btn,
.adm .admin .btn {padding: 0.7rem 1.1rem;border-radius: var(--adm-radius-sm);font-size: 0.9rem;font-weight: 600;cursor: pointer;border: none;color: #fff;text-decoration: none;transition: background-color var(--adm-transition), opacity var(--adm-transition);float: right;}
.adm .admin .btn-save { background: #059669; }
.adm .admin .btn-save:hover { background: #047857; }
.adm .admin .btn-secondary { background: var(--accent); }
.adm .admin .btn-secondary:hover { background: var(--accent-hover); }
.adm .admin .btn-danger { background: #dc2626; }
.adm .admin .btn-danger:hover { background: #b91c1c; }
.adm .btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; margin-top: 0; float: none; }
.adm .adm-settings-card .card-desc { margin-bottom: 1rem; }
.adm .adm-settings-block { margin-top: 1.5rem; padding: 1.25rem; background: var(--adm-bg); border: 1px solid var(--adm-border); border-radius: var(--adm-radius-sm); }
.adm .adm-settings-block:first-of-type { margin-top: 0; }
.adm .adm-settings-ttl { font-size: 1rem; font-weight: 600; color: var(--adm-text); margin: 0 0 0.5rem; }
.adm .adm-settings-form { margin-top: 0.75rem; }
.adm .adm-settings-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.adm .adm-settings-row .ca-inp { flex: 1; min-width: 200px; }
.adm .adm-settings-row--generate select.ca-inp { min-width: 180px; }
.adm .adm-key-display { display: inline-block; padding: 0.5rem 0.75rem; background: var(--adm-surface); border: 1px solid var(--adm-border); border-radius: var(--adm-radius-sm); font-size: 0.95rem; }
.adm .adm-keys-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.adm .adm-keys-table th, .adm .adm-keys-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--adm-border); }
.adm .adm-keys-table code { font-size: 0.85em; }
.adm .adm-users-card .card-desc { margin-bottom: 1rem; }
.adm .adm-users-wrap { overflow-x: auto; margin-top: 0.5rem; }
.adm .adm-users-tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.adm .adm-users-tbl th { text-align: left; padding: 0.6rem 0.85rem; background: var(--adm-border); color: var(--adm-text); font-weight: 600; }
.adm .adm-users-tbl td { padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--adm-border); vertical-align: middle; }
.adm .adm-users-tbl tbody tr:hover { background: var(--adm-bg); }
.adm .adm-users-act { text-align: right; white-space: nowrap; }
.adm .adm-plan-badge { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 6px; font-size: 0.8125rem; font-weight: 600; }
.adm .adm-plan-badge--free { background: #e2e8f0; color: #475569; }
.adm .adm-plan-badge--standard { background: #bfdbfe; color: #1e40af; }
.adm .adm-plan-badge--business { background: #a7f3d0; color: #065f46; }
.adm .adm-plan-badge--premium { background: #ddd6fe; color: #5b21b6; }
.adm .adm-plan-badge--pro { background: #bfdbfe; color: #1e40af; }
.adm .adm-plan-select { cursor: pointer; border: 1px solid rgba(0,0,0,0.12); min-width: 6rem; font-size: inherit; font-weight: inherit; }
.adm .adm-plan-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.adm .p-card { background: var(--adm-border); padding: 1.35rem 1.5rem; margin-bottom: 0; transition: box-shadow var(--adm-transition); }

.adm .p-hdr { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.adm .p-card .p-name { flex: 1; min-width: 180px; max-width: 280px; font-weight: 600; font-size: 1rem; padding: 0.55rem 0.75rem; border: 1px solid var(--adm-border); border-radius: var(--adm-radius-sm); background: var(--adm-surface); color: var(--adm-text); transition: border-color var(--adm-transition), box-shadow var(--adm-transition); }
.adm .p-card .p-name:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.12); }
.adm .p-card .p-badge { font-size: 0.75rem; font-family: ui-monospace, monospace; color: var(--adm-text-muted); font-weight: 500; background: var(--adm-surface); padding: 0.3rem 0.55rem; border-radius: 6px; border: 1px solid var(--adm-border); flex-shrink: 0; }
.adm .p-card-remove { margin-left: auto; opacity: 0.9; transition: opacity var(--adm-transition); }
.adm .p-card-remove:hover { opacity: 1; }
.adm .p-details { margin-top: 0.5rem; border: 1px solid var(--adm-border); border-radius: var(--adm-radius-sm); overflow: hidden; }
.adm .p-details-summary { padding: 0.5rem 0.75rem; font-size: 0.9rem; font-weight: 600; color: var(--adm-text); cursor: pointer; list-style: none; background: rgba(0,0,0,0.04); transition: background var(--adm-transition); }
.adm .p-details-summary::-webkit-details-marker { display: none; }
.adm .p-details-summary::before { content: "▶"; display: inline-block; margin-right: 0.4rem; font-size: 0.5rem; color: var(--accent); transition: transform var(--adm-transition); vertical-align: 0.05em; }
.adm .p-details[open] .p-details-summary::before { transform: rotate(90deg); }
.adm .p-details-summary:hover { background: rgba(0,0,0,0.07); }
.adm .p-body { margin-top: 0; padding: 1.35rem 1.5rem; background: var(--adm-surface); border-top: 1px solid var(--adm-border); }
.adm .p-card-save { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--adm-border); display: flex; justify-content: flex-end; align-items: center; }
.adm .p-card-save .btn-save-card { flex-shrink: 0; }
.adm .p-link-ttl { font-weight: 600; margin-bottom: 0.35rem; font-size: 1rem; color: var(--adm-text); }
.adm .p-link-hint { margin-bottom: 0.5rem; }
.adm .url-wrap--partner { margin-top: 0; margin-bottom: 1.25rem; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; width: 100%; }
.adm .url-wrap--partner .url-box { flex: 1; min-width: 200px; }
.adm .url-wrap--partner { min-width: 0; }
.adm .url-wrap--partner .btn-copy { margin-left: auto; }
.adm .p-sub { margin-top: 0.85rem; border-radius: var(--adm-radius-sm); border: 1px solid var(--adm-border); overflow: hidden; }
.adm .p-sub summary { font-weight: 600; font-size: 0.9rem; cursor: pointer; padding: 0.65rem 1rem; list-style: none; display: flex; align-items: center; gap: 0.5rem; transition: background var(--adm-transition); }
.adm .p-sub summary::-webkit-details-marker { display: none; }
.adm .p-sub summary::before { content: "▶"; font-size: 0.55rem; opacity: 0.7; transition: transform var(--adm-transition); }
.adm .p-sub[open] summary::before { transform: rotate(90deg); }
.adm .p-sub .dtl { padding: 1rem 1.25rem; border-top: 1px solid var(--adm-border); }
.adm .p-sub--metrika {border-left: 4px solid #FFC107;}
.adm .p-sub--metrika summary {background: rgba(124, 58, 237, 0.08);color: #FFEB3B;}
.adm .p-sub--metrika summary:hover { background: rgba(124, 58, 237, 0.12); }
.adm .p-sub--ga4 { border-left: 4px solid #ea4335; }
.adm .p-sub--ga4 summary { background: rgba(234, 67, 53, 0.08); color: #c5221f; }
.adm .p-sub--ga4 summary:hover { background: rgba(234, 67, 53, 0.12); }
.adm .p-body .m-block { margin-top: 0; }


.adm .yandex-counters-list { display: flex; flex-direction: column; gap: 0.75rem; }
.adm .yandex-counter-row.row { display: grid; grid-template-columns: 1fr 1fr 1fr 2.5rem; gap: 0.75rem; align-items: end; padding: 0.5rem 0.5rem; border: 1px solid var(--adm-border); border-radius: 5px; }
.adm .yandex-counter-row .yandex-counter-remove { flex-shrink: 0; margin-left: 0; }
@media (max-width: 640px) { .adm .yandex-counter-row.row { grid-template-columns: 1fr auto; } .adm .yandex-counter-row.row > div:first-child { grid-column: 1 / -1; } }

.adm .ga4-streams-list { display: flex; flex-direction: column; gap: 0.75rem; }
.adm .ga4-stream-row.row { display: grid; grid-template-columns: 1fr 1fr 1fr 2.5rem; gap: 0.75rem; align-items: end; padding: 0.5rem 0.5rem; border: 1px solid var(--adm-border); border-radius: 5px; }
.adm .ga4-stream-row .ga4-stream-remove { flex-shrink: 0; margin-left: 0; }
.adm .adm-remove-row-btn {margin-bottom: 7px;}
@media (max-width: 640px) { .adm .ga4-stream-row.row { grid-template-columns: 1fr auto; } .adm .ga4-stream-row.row > div:first-child { grid-column: 1 / -1; } }
.adm .mp-token-steps { font-size: 0.875rem; color: var(--adm-text-muted); background: var(--adm-bg); border-radius: var(--adm-radius-sm); margin-top: 0.75rem; margin-bottom: 0; border: 1px solid var(--adm-border); border-left: 4px solid var(--accent); line-height: 1.6; overflow: hidden; }
.adm .mp-token-steps summary.mp-title { font-weight: 600; color: var(--adm-text); font-size: 0.9rem; padding: 0.75rem 1.25rem; cursor: pointer; list-style: none; display: block; }
.adm .mp-token-steps summary.mp-title::-webkit-details-marker { display: none; }
.adm .mp-token-steps summary.mp-title::before { content: "▶"; display: inline-block; margin-right: 0.4rem; font-size: 0.5rem; color: var(--accent); transition: transform var(--adm-transition); }
.adm .mp-token-steps[open] summary.mp-title::before { transform: rotate(90deg); }
.adm .mp-token-steps ol { margin: 0; padding: 0 1.25rem 1rem 1.2rem; }
.adm .mp-token-steps li { margin-bottom: 0.3rem; }
.adm .mp-token-steps li:last-child { margin-bottom: 0; }
.adm .mp-token-steps em { font-style: normal; font-weight: 700; color: var(--adm-text); }
.adm .url-wrap { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; width: 100%; margin-top: 0.5rem; }
.adm .url-wrap .url-box, .adm .url-wrap pre.url-box { flex: 1; min-width: 0; }
.adm .url-box { background: #0f172a; color: #e2e8f0; padding: 0.85rem 1rem; border-radius: var(--adm-radius-sm); word-break: break-all; font-family: ui-monospace, monospace; font-size: 0.8125rem; line-height: 1.5; border: 1px solid #334155; }
.adm .url-wrap .btn-copy { margin-left: auto; flex-shrink: 0; }
.adm .btn-copy { padding: 0.5rem 0.9rem; font-size: 0.85rem; background: #059669; color: #fff; font-weight: 600; transition: background var(--adm-transition); }
.adm .btn-copy:hover { background: #047857; }
/* Модальное подтверждение — единый стиль с тостами и карточками */
.confirm-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; padding: 1rem; animation: confirm-fadeIn 0.2s ease; }
.confirm-box { background: var(--adm-surface, #fff); border: 1px solid var(--adm-border, #e2e8f0); border-radius: var(--adm-radius, 12px); box-shadow: 0 8px 32px rgba(0,0,0,0.18); max-width: 400px; width: 100%; padding: 1.35rem 1.5rem; animation: confirm-slideIn 0.25s ease; }
.confirm-title { font-size: 1rem; font-weight: 600; color: var(--adm-text, #1e293b); margin-bottom: 0.5rem; }
.confirm-msg { font-size: 0.9375rem; color: var(--adm-text-muted, #64748b); line-height: 1.5; margin-bottom: 1.25rem; }
.confirm-btns { display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap; }
.confirm-btns .btn { padding: 0.5rem 1rem; font-size: 0.9rem; font-weight: 600; border-radius: 8px; cursor: pointer; border: none; transition: opacity 0.15s; }
.confirm-btns .btn-confirm-ok { background: #dc2626; color: #fff; }
.confirm-btns .btn-confirm-ok:hover { opacity: 0.92; }
.confirm-btns .btn-confirm-cancel { background: var(--adm-bg, #f1f5f9); color: var(--adm-text, #334155); border: 1px solid var(--adm-border, #cbd5e1); }
.confirm-btns .btn-confirm-cancel:hover { opacity: 0.9; }
@keyframes confirm-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes confirm-slideIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* Всплывающие сообщения (тост) — по центру сверху */
.toast-container { position: fixed; top: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; width: min(420px, calc(100vw - 2rem)); pointer-events: none; }
.toast-container .msg-toast { pointer-events: auto; padding: 0.85rem 1.25rem; border-radius: var(--adm-radius-sm); font-size: 0.9rem; font-weight: 500; box-shadow: 0 4px 20px rgba(0,0,0,0.18); cursor: pointer; transform: translateY(-100%); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; width: 100%; box-sizing: border-box; text-align: center; }
.toast-container .msg-toast.msg-toast--in { transform: translateY(0); opacity: 1; }
.toast-container .msg-toast.msg-toast--out { transform: translateY(-100%); opacity: 0; }
.toast-container .msg-toast.msg-toast--ok { background: #059669; color: #fff; }
.toast-container .msg-toast.msg-toast--err { background: #dc2626; color: #fff; }
.adm .msg { padding: 0.9rem 1.25rem; border-radius: var(--adm-radius-sm); margin-bottom: 1rem; font-size: 0.9rem; font-weight: 500; }
.adm .msg.ok { background: #d1fae5; color: #065f46; }
.adm .msg.err { background: #fee2e2; color: #991b1b; }
.adm .m-list { overflow-x: auto; margin-top: 0.5rem; -webkit-overflow-scrolling: touch; min-width: 420px; background: var(--adm-bg); border-radius: var(--adm-radius-sm); border: 1px solid var(--adm-border); }
.adm .m-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.5rem; align-items: center; }
.adm .m-row.m-row-help { grid-template-columns: 1fr; }
.adm .m-row.m-row-help .m-cell-help { grid-column: 1; padding: 0.25rem 0.75rem 0.5rem; }
.adm .m-row.m-row-help .m-cell-help .help { margin: 0; font-size: 0.8125rem; opacity: 0.9; }
.adm .m-row-h .m-cell { padding: 0.55rem 1rem; background: var(--adm-border); font-weight: 600; color: var(--adm-text); font-size: 0.8125rem; }
.adm .m-row:not(.m-row-h) .m-cell { padding: 0.5rem 0.75rem; }
.adm .m-eq { justify-self: center; font-weight: 700; color: var(--adm-text-muted); }
.adm .m-list .m-inp,
.adm .m-list .m-lbl { margin: 0; padding: 0.4rem 0.55rem; border: 1px solid var(--adm-border); border-radius: 6px; font-size: 0.9rem; background: var(--adm-surface); color: var(--adm-text); width: 100%; max-width: 100%; box-sizing: border-box; transition: border-color var(--adm-transition), box-shadow var(--adm-transition); }
.adm .m-list .m-lbl { border: none; background: transparent; padding: 0.4rem 0; }
.adm .m-list .m-inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(63, 81, 181, 0.12); }
.adm .ca { margin-bottom: 2rem; padding: 1.5rem 1.75rem; background: var(--adm-surface); border: 1px solid var(--adm-border); border-radius: var(--adm-radius); }
.adm .cl-card + .ca { margin-top: 1rem; }
.adm .ca-ttl {font-size: 1rem;font-weight: 600;letter-spacing: -0.01em;color: var(--adm-text);margin-bottom: 0.35rem;}
.adm .ca-hint { font-size: 0.875rem; color: var(--adm-text-muted); margin-bottom: 1rem; line-height: 1.45; }
.adm .ca-row {display: flex;gap: 0.75rem;flex-direction: row;align-content: center;align-items: center;}
.adm .ca-inp {flex: 1;min-width: 200px;padding: 0.65rem 1rem;border: 1px solid var(--adm-border);border-radius: var(--adm-radius-sm);font-size: 1rem;background: var(--adm-surface);color: var(--adm-text);transition: border-color var(--adm-transition), box-shadow var(--adm-transition);}
.adm .ca-inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.12); }
.adm .ca-btn { flex-shrink: 0; }
.adm #projectsList { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; margin-bottom: 1.5rem; }
.adm .cl-empty { padding: 2rem; text-align: center; color: var(--adm-text-muted); background: var(--adm-bg); border-radius: var(--adm-radius); border: 1px solid var(--adm-border); font-size: 0.9375rem; }
@media (max-width: 480px) {
  .adm .ca-row { flex-direction: column; align-items: stretch; }
  .adm .ca-inp { min-width: 0; }
}
.adm .cb p:first-of-type { font-weight: 600; margin-bottom: 0.5rem; }
.adm .cb > * + * { margin-top: 0.5rem; }
.adm .adm-ubar { display: none; flex-direction: column; align-items: flex-end; justify-content: center; line-height: 1.35; }
.adm .adm-ubar.visible { display: flex; }
.adm .adm-ubar.adm-ubar--auth { display: flex; }
.adm .adm-uemail { opacity: 0.9; margin-right: 0; margin-bottom: 0.15rem; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.adm .adm-logout { color: rgba(255,255,255,0.9); text-decoration: none; font-size: 0.95rem; white-space: nowrap; }
.adm .adm-chart { margin-bottom: 1.75rem; }
.adm .ch-hdr { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0; }
.adm .ch-hdr h2 { margin-bottom: 0; padding-bottom: 0; border-bottom: none; flex: 1; min-width: 0; }
.adm .ch-filter { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; margin-top: 0.1rem; }
.adm .ch-filter-label { font-size: 0.875rem; font-weight: 600; color: var(--adm-text-muted); white-space: nowrap; }
.adm .ch-filter-select { padding: 0.4rem 0.65rem; border: 1px solid var(--adm-border); border-radius: var(--adm-radius-sm); font-size: 0.9rem; background: var(--adm-surface); color: var(--adm-text); min-width: 140px; }
.adm .ch-ctn { margin-top: 1rem; }
.adm .ch-legend { display: flex; gap: 1.25rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.adm .ch-legend-item { font-size: 0.875rem; font-weight: 500; color: var(--adm-text-muted); }
.adm .ch-legend-item::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.4rem; vertical-align: middle; }
.adm .ch-legend--cnt::before { background: #0ea5e9; }
.adm .ch-legend--pay::before { background: #10b981; }
.adm .ch-bars { display: grid; grid-template-columns: repeat(var(--ch-cols, 30), 1fr); align-items: end; height: 180px; padding: 0 0 1.5rem; }
.adm .ch-bw { position: relative; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; padding: 0 3px; }
.adm .ch-bar-group { display: flex; align-items: flex-end; flex: 1; min-height: 0; }
.adm .ch-bar { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; transition: opacity 0.15s; }
.adm .ch-bw:hover .ch-bar { opacity: 0.9; }
.adm .ch-bar--cnt { background: #0ea5e9; }
.adm .ch-bar--pay { background: #10b981; }
.adm .ch-bar-lbl { font-size: 0.6rem; color: var(--adm-text-muted); margin-top: 4px; white-space: nowrap; text-align: center; }
.adm .ch-tooltip { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; background: var(--adm-surface); border: 1px solid var(--adm-border); border-radius: 8px; padding: 0.5rem 0.65rem; box-shadow: 0 4px 14px rgba(0,0,0,0.18); white-space: nowrap; z-index: 20; pointer-events: none; }
.adm .ch-bw:hover .ch-tooltip { display: flex; flex-direction: column; gap: 0.2rem; }
.adm .ch-tooltip-date { font-size: 0.75rem; font-weight: 700; color: var(--adm-text); }
.adm .ch-tooltip-line { font-size: 0.8rem; color: var(--adm-text); display: flex; align-items: center; gap: 0.35rem; }
.adm .ch-tooltip-line b { font-weight: 700; }
.adm .ch-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.adm .ch-dot--cnt { background: #0ea5e9; }
.adm .ch-dot--pay { background: #10b981; }
.adm .adm-conv { margin-bottom: 1.75rem; }
.adm .c-filter-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.adm .c-filter-label { font-size: 0.875rem; font-weight: 600; color: var(--adm-text-muted); }
.adm .c-filter-select { padding: 0.4rem 0.65rem; border: 1px solid var(--adm-border); border-radius: var(--adm-radius-sm); font-size: 0.9rem; background: var(--adm-surface); color: var(--adm-text); min-width: 160px; }
.adm .c-wrap { overflow-x: auto; margin-top: 1rem; -webkit-overflow-scrolling: touch; min-width: 0; display: table; table-layout: auto; width: 100%; border-collapse: collapse; }
.adm .c-list { display: table-row-group; font-size: 0.9rem; }
.adm .c-cell { display: table-cell; overflow-wrap: break-word; word-break: break-word; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--adm-border); vertical-align: middle; min-width: 0; }
.adm .c-row { display: table-row; transition: background var(--adm-transition); }
.adm .c-hdr.c-row { display: table-row; border-bottom: 1px solid var(--adm-border); color: var(--adm-text-muted); font-weight: 600; font-size: 0.8125rem; }
.adm .c-hdr.c-row .c-cell { border-bottom: 1px solid var(--adm-border); }
.adm .c-list .c-row:hover .c-cell { background: var(--adm-bg); }
.adm .c-act { text-align: right; white-space: nowrap; }
.adm .c-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--adm-border); }
.adm .c-pagination-info { font-size: 0.875rem; color: var(--adm-text-muted); }
.adm .c-pagination-btns { display: flex; gap: 0.5rem; }
.adm .c-pagination-btn { min-width: 2.5rem; padding: 0.4rem 0.65rem; font-size: 0.9rem; }
.adm .c-pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }
/* Единый вид кнопки удаления (крестик) */
.adm .btn-del { transition: opacity var(--adm-transition); }
.adm .btn-danger.btn-icon {padding: 0.25rem;min-width: 1.65rem;min-height: 1.65rem;font-size: 1.1rem;line-height: 1;border-radius: 6px;display: inline-flex;align-items: center;justify-content: center;box-sizing: border-box;transition: opacity var(--adm-transition);}
.adm .btn-danger.btn-icon:hover { opacity: 0.92; }
.adm .adm-empty {color: var(--adm-text-muted);font-size: 0.9375rem;margin: 0;margin-bottom: 1rem;}

@media (max-width: 640px) {
  .adm .c-wrap { display: block; overflow-x: visible; }
  .adm .c-list { display: block; min-width: 0; }
  .adm .c-hdr.c-row { display: none; }
  .adm .c-list .c-row { display: block; border: 1px solid var(--adm-border); border-radius: 8px; margin-bottom: 0.75rem; padding: 0.75rem 1rem; background: var(--adm-surface); box-shadow: 0 1px 3px rgba(0,0,0,0.06); border-bottom: none; }
  .adm .c-list .c-row:hover { background: var(--adm-bg); }
  .adm .c-list .c-cell { display: block; padding: 0.25rem 0 0.5rem; border-bottom: none; }
  .adm .c-list .c-cell::before { content: attr(data-label); font-weight: 600; color: var(--adm-text-muted); font-size: 0.75rem; display: block; margin-bottom: 0.15rem; }
  .adm .c-list .c-act { padding-top: 0.5rem; border-top: 1px solid var(--adm-border); margin-top: 0.25rem; text-align: right; display: flex; justify-content: flex-end; align-items: center; }
  .adm .c-list .c-act::before { display: none; }
  .adm .c-list .c-row .c-act { padding-bottom: 0.125rem; }
  .adm .c-act { text-align: left; }
}

.adm .m-block { margin-top: 0.5rem; }
.adm .m-ttl { font-weight: 600; margin-bottom: 0.5rem; }
.adm .m-inp { width: 100%; min-width: 100px; }
.adm .m-lbl { font-weight: 600; color: var(--adm-text); white-space: nowrap; }
.adm .m-star { color: #dc2626; font-weight: 700; }

@media (max-width: 640px) {
  .adm .m-list { min-width: 0; overflow-x: visible; }
  .adm .m-row { grid-template-columns: 1fr; gap: 0.35rem; padding: 0.75rem 1rem; border-bottom: 1px solid #94a3b8; }
  .adm .m-row:last-child { border-bottom: none; }
  .adm .m-row-h { display: none; }
  .adm .m-row .m-cell:first-child { order: 2; }
  .adm .m-row .m-eq { display: none; }
  .adm .m-row .m-cell.m-lbl { order: 0; padding-bottom: 0.15rem; white-space: normal; word-break: break-word; font-size: 0.85rem; }
}

.adm .cb { margin-top: 1rem; }
.adm .cb-lbl { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.adm .cb-lbl-ga4 { margin: 0.75rem 0 0.35rem; }
.adm .url-pre { white-space: pre-wrap; margin: 0; min-height: auto; }
.adm .btn-remove { margin-top: 0; }

@media (max-width: 1023px) {
  .adm .card { padding: 1.35rem 1.5rem; margin-bottom: 1.25rem; }
  .adm .ch-bars { height: 170px; }
  .adm .ch-bar-lbl { font-size: 0.6rem; }
}
@media (max-width: 767px) {
  body.admin .header-inner { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
  body.admin .nav {display: contents;gap: 0.5rem;}
  body.admin .adm-ubar {display: grid;font-size: 0.85rem;text-align: right;}
  body.admin .adm-uemail { margin-right: 0; margin-bottom: 0.12rem; }
  body.admin .nav-cta { padding: 0.45rem 0.85rem; font-size: 0.9rem; }
  .adm .adm-ctn { padding: 1rem 0.75rem; }
  .adm .card { padding: 1rem 1rem; margin-bottom: 1rem; border-radius: 10px; }
  .adm .card h2 { font-size: 1.1rem; }
  .adm .card-desc { font-size: 0.9rem; }
  .adm .ch-ctn { margin-top: 0.5rem; }
  .adm .ch-legend { gap: 1rem; margin-bottom: 0.5rem; font-size: 0.8rem; }
  .adm .ch-bars { height: 150px; }
  .adm .ch-bar-lbl { font-size: 0.5rem; }
  .adm .p-card { padding: 1rem 1rem; }
  .adm .p-card .p-name { min-width: 0; max-width: none; width: 100%; }
  .adm .p-hdr { gap: 0.5rem; }
  .adm .p-card-remove { margin-left: auto; margin-top: 0.35rem; }
  .adm .msg { padding: 0.65rem 1rem; font-size: 0.85rem; }
  .toast-container { top: 0.75rem; width: calc(100vw - 1.5rem); }
  .toast-container .msg-toast { padding: 0.75rem 1rem; font-size: 0.85rem; }
  .adm .adm-nav { padding: 0.75rem 0 1rem; gap: 0.5rem; }
  .adm .adm-nav-btn { padding: 0.5rem 1rem; font-size: 0.9rem; }
}
@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .adm .adm-ctn { padding: 0.75rem 12px; }
  .adm .card { padding: 0.85rem 0.75rem; margin-bottom: 0.85rem; }
  .adm .card h2 { font-size: 1rem; padding-bottom: 0.4rem; }
  .adm .section-label { font-size: 0.65rem; padding: 0.25rem 0.5rem; margin-top: 0.75rem; }
  .adm .ch-bars { height: 130px; }
  .adm .ch-legend-item { font-size: 0.75rem; }
  .adm .ch-legend-item::before { width: 10px; height: 10px; }
  .adm .p-card { padding: 0.85rem 0.75rem; }
  .adm .p-body { padding: 1rem 1rem; }
  .adm .adm-nav { padding: 0.6rem 0 0.85rem; }
  .adm .adm-nav-btn { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
  .adm .ca-ttl { font-size: 0.95rem; }
  .adm .ca-hint { font-size: 0.8rem; margin-bottom: 0.75rem; }
  .adm .url-box { font-size: 0.7rem; padding: 0.65rem 0.75rem; }
  .adm .url-wrap--partner .url-box { min-width: 0; }
  .adm .btn-copy { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
}

/* --- Auth: Вход / Регистрация / Сброс пароля --- */
.auth-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.auth-err {
    background: #fef2f2;
    color: #b91c1c;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid #fecaca;
}

.auth-ok {
    background: #f0fdf4;
    color: #166534;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid #bbf7d0;
}

/* Карточка формы входа внутри админ-шаблона */
.auth-card-inline {
    max-width: 400px;
    margin: 2rem auto;
    padding: 1.75rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 1rem;
    margin-bottom: 0.35rem;
}
.auth-form .auth-label:first-of-type { margin-top: 0; }

.auth-input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--card);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    box-sizing: border-box;
}
.auth-input::placeholder { color: var(--text-muted); }
.auth-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.12);
}
.auth-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.auth-input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px var(--card) inset; }

.auth-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.auth-btn {
    width: 100%;
    min-height: 2.75rem;
    margin-top: 1.25rem;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition), opacity var(--transition);
}
.auth-btn:hover { background: var(--accent-hover); }
.auth-btn:active { opacity: 0.95; }
.auth-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.auth-link {
    color: var(--accent);
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition), text-decoration var(--transition);
}
.auth-link:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
.auth-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

@media (max-width: 480px) {
    .auth-card { padding: 1.5rem; }
    .auth-card-inline { padding: 1.25rem; margin: 1.25rem auto; }
    .auth-title { font-size: 1.25rem; }
    .auth-input { min-height: 2.5rem; }
}

.visually-hidden { position: absolute; left: -9999px; }
