/**
 * Назначение: единая адаптивная тема публичных страниц, кабинета и админки.
 */

:root {
    color-scheme: light;
    --ink: #101828;
    --muted: #667085;
    --line: #e4e7ec;
    --soft: #f4f7fb;
    --surface: #ffffff;
    --primary: #175cd3;
    --primary-dark: #0b4db7;
    --primary-soft: #eaf2ff;
    --accent: #10b981;
    --danger: #b42318;
    --danger-soft: #fef3f2;
    --success: #067647;
    --success-soft: #ecfdf3;
    --shadow: 0 18px 48px rgba(16, 24, 40, 0.08);
    --radius: 18px;
    --page: 1180px;
}

/* Спокойная анимация анализа не изображает неизвестный процент готовности. */
.audit-progress-card { position: relative; overflow: hidden; text-align: center; padding: 48px 28px; background: radial-gradient(ellipse at 50% 0, #edf5ff 0, #fff 70%); }
.audit-progress-card h2 { margin: 12px 0; font-size: clamp(1.6rem, 4vw, 2rem); }
.audit-analysis-message { max-width: 610px; min-height: 52px; margin: 0 auto 24px; color: var(--muted); line-height: 1.6; }
.audit-analysis-visual { position: relative; width: 144px; height: 144px; margin: 0 auto 28px; }
.audit-analysis-core { position: absolute; inset: 32px; display: grid; place-items: center; border-radius: 24px; background: #fff; color: var(--primary); box-shadow: 0 10px 30px #175cd31a; font-size: 3rem; }
.audit-analysis-orbit { position: absolute; inset: 0; border: 1px dashed #b9d5fb; border-radius: 50%; animation: audit-orbit 22s linear infinite; }
.audit-analysis-orbit::after { content: ''; position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 6px #175cd312; }
.audit-analysis-dot { position: absolute; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; animation: audit-pulse 2.8s ease-in-out infinite; }
.audit-analysis-dot.dot-one { left: 4px; top: 80px; }
.audit-analysis-dot.dot-two { right: 5px; top: 32px; animation-delay: .8s; }
.audit-analysis-dot.dot-three { right: 36px; bottom: 2px; animation-delay: 1.6s; }
.audit-analysis-track { width: min(360px, 100%); height: 4px; margin: 0 auto 28px; border-radius: 8px; background: #e4eefb; overflow: hidden; }
.audit-analysis-track span { display: block; width: 38%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #77b6ff, var(--primary)); animation: audit-scan 2.4s ease-in-out infinite alternate; }
.audit-analysis-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 22px; padding: 0; margin: 0 0 26px; list-style: none; color: var(--muted); font-size: .86rem; }
.audit-analysis-steps li::before { content: '○'; margin-right: 7px; }
.audit-analysis-steps .is-complete { color: var(--success); }
.audit-analysis-steps .is-complete::before { content: '✓'; }
.audit-analysis-steps .is-active { color: var(--primary); font-weight: 700; }
.audit-analysis-steps .is-active::before { content: '●'; }
.integrations-page .integration-card > .field-help { margin: -10px 30px 26px; line-height: 1.65; }
@keyframes audit-orbit { to { transform: rotate(360deg); } }
@keyframes audit-pulse { 50% { opacity: .4; transform: scale(.7); } }
@keyframes audit-scan { from { transform: translateX(-60%); } to { transform: translateX(220%); } }
@media (max-width: 600px) { .audit-progress-card { padding: 32px 18px; } .audit-analysis-steps { display: grid; grid-template-columns: 1fr 1fr; text-align: left; } .integrations-page .integration-card > .field-help { margin-inline: 20px; } }
@media (prefers-reduced-motion: reduce) { .audit-analysis-orbit, .audit-analysis-dot, .audit-analysis-track span { animation: none; } }

[hidden] { display: none !important; }
.analysis-form { max-width: 760px; }
.analysis-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.analysis-date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 600px) { .analysis-date-fields { grid-template-columns: 1fr; gap: 0; } .analysis-actions .button { width: 100%; } }
.button:disabled { cursor: default; opacity: 0.55; transform: none; }
.integration-heading, .results-heading, .results-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.integration-form { max-width: 680px; margin-top: 28px; }
.integration-test { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.integration-card p { color: var(--muted); }
.cloud-prices { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.cloud-prices summary { cursor: pointer; color: var(--primary); font-weight: 650; width: fit-content; }
.cloud-prices .table-scroll { margin-top: 16px; max-height: 420px; }
.cloud-prices table { min-width: 620px; }
.cloud-price-schedule { max-width: 680px; }
.integrations-page { max-width: 1100px; }
.integrations-page .integration-card { margin-bottom: 24px; scroll-margin-top: 24px; padding: 0; overflow: hidden; }
.integrations-page .integration-card:target { border-color: #a9c7fa; box-shadow: 0 0 0 3px rgba(23, 92, 211, 0.08); }
.integrations-page .integration-card > .flash-region { width: auto; margin: 0 30px 18px; padding-top: 0; }
.integrations-page .integration-heading { padding: 26px 30px 16px; }
.integrations-page .integration-heading .eyebrow { margin-bottom: 5px; }
.integrations-page .integration-intro { margin: 0; padding: 0 30px 24px; }
.integrations-page .integration-tool-links { display: flex; flex-wrap: wrap; gap: 7px 16px; margin: -14px 0 0; padding: 0 30px 22px; font-size: 0.85rem; }
.integration-step { border-top: 1px solid var(--line); padding: 22px 30px 26px; }
.integration-step:nth-of-type(even) { background: #fbfcfe; }
.integration-step-heading { display: flex; align-items: flex-start; gap: 14px; }
.integration-step-heading > span { flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 0.78rem; font-weight: 800; }
.integration-step-heading h3 { margin: 1px 0 3px; font-size: 1.03rem; }
.integration-step-heading p { margin: 0; font-size: 0.87rem; }
.integrations-page .integration-doc-links { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 16px 0 0 44px; font-size: 0.88rem; }
.integrations-page .integration-form, .integrations-page .integration-test, .integrations-page .cloud-price-schedule { margin: 18px 0 0 44px; padding: 0; border: 0; }
.integrations-page .integration-step-body { margin: 16px 0 0 44px; max-width: 680px; }
.integrations-page .integration-step-body .integration-test { margin: 14px 0; }
.integrations-page .integration-form .form-field:last-of-type { margin-bottom: 16px; }
.integrations-page .cloud-prices { margin: 20px 0 0 44px; padding-top: 18px; }
.integrations-page .cloud-prices table { min-width: 620px; }
@media (max-width: 760px) {
    .integrations-page .integration-heading { padding: 22px 20px 14px; }
    .integrations-page .integration-card > .flash-region { margin-inline: 20px; }
    .integrations-page .integration-intro { padding: 0 20px 20px; }
    .integrations-page .integration-tool-links { padding: 0 20px 20px; }
    .integration-step { padding: 20px; }
    .integrations-page .integration-doc-links, .integrations-page .integration-form, .integrations-page .integration-test, .integrations-page .cloud-price-schedule, .integrations-page .integration-step-body, .integrations-page .cloud-prices { margin-left: 0; }
}
.table-sort-button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; text-align: left; cursor: pointer; }
.table-sort-button:hover { color: var(--primary); }
.model-select-enhanced { display: none !important; }
.model-picker { position: relative; min-width: 0; }
.model-picker-trigger { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.model-picker-trigger::after { content: '⌄'; flex: 0 0 auto; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.model-picker-trigger:hover { border-color: #98a2b3; }
.model-picker-trigger:focus-visible { border-color: var(--primary); outline: 3px solid rgba(23, 92, 211, 0.18); }
.model-picker-panel { position: absolute; z-index: 60; top: calc(100% - 4px); right: 0; width: min(620px, calc(100vw - 48px)); padding: 10px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff; box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18); }
.form-field .model-picker-search { width: 100%; min-height: 40px; margin-bottom: 8px; }
.model-picker-list { max-height: 320px; overflow: auto; }
.model-picker-option { display: grid; width: 100%; gap: 2px; padding: 10px 11px; border: 0; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.model-picker-option:hover, .model-picker-option:focus-visible { background: var(--primary-soft); outline: none; }
.model-picker-option[aria-current="true"] { color: var(--primary); font-weight: 700; }
.form-field .model-picker-option small { display: none; margin-top: 0; color: var(--muted); font-size: 0.77rem; font-weight: 500; }
.form-field .model-picker-option:hover small, .form-field .model-picker-option:focus-visible small { display: block; }
.model-price-preview { margin: 7px 0 0; color: var(--muted); font-size: 0.78rem; }
.tool-settings-form, .audit-intro, .audit-result { margin-bottom: 28px; }
.tool-settings-form textarea, .audit-intro textarea { width: 100%; resize: vertical; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 24px 0; }
.settings-limits { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.checkbox-field { margin: 22px 0; }
.checkbox-field label, .recommendation-choice { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.audit-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.audit-summary span { padding: 10px 14px; border-radius: 999px; background: #eef2ff; color: #27346b; }
.audit-export-actions { margin: 22px 0; }
/* Результат проверки: сначала короткий список действий, подробности раскрывает пользователь. */
.audit-result-compact { padding: 26px; }
.audit-result-compact .integration-heading { align-items: flex-start; }
.audit-result-compact h2 { overflow-wrap: anywhere; }
.audit-result-summary { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }
.audit-input-details { margin: 16px 0 20px; color: var(--muted); font-size: 0.88rem; }
.audit-input-details summary, .audit-other-actions summary { cursor: pointer; width: fit-content; font-weight: 650; }
.audit-input-details p { overflow-wrap: anywhere; }
.audit-input-details details { margin-top: 12px; }
.audit-input-details pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; background: var(--soft); padding: 14px; }
.audit-consistency-ok { color: var(--success); font-size: 0.85rem; margin: 0 0 20px; }
.audit-result-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.audit-result-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 0.88rem; }
.audit-result-tabs a span { padding: 1px 7px; border-radius: 6px; background: var(--soft); font-size: 0.78rem; }
.audit-result-tabs a:hover { background: var(--soft); }
.audit-result-tabs a[aria-current="page"] { background: var(--primary-soft); border-color: #c6d7f5; color: var(--primary); }
.audit-result-tabs a[aria-current="page"] span { background: white; }
.audit-panel-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0; }
.audit-panel-intro p { color: var(--muted); font-size: 0.85rem; margin: 0; }
.audit-text-button { padding: 5px 0; color: var(--primary); background: none; border: 0; font: inherit; font-size: 0.84rem; font-weight: 650; cursor: pointer; flex-shrink: 0; }
.audit-text-button:hover { text-decoration: underline; }
.audit-suggestion { padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; background: var(--surface); }
.audit-suggestion-heading { display: flex; align-items: flex-start; gap: 12px; }
.audit-suggestion-heading input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 5px 0 0; flex: 0 0 auto; accent-color: var(--primary); }
.audit-suggestion-title { min-width: 0; flex: 1; }
.audit-suggestion-title h3 { margin: 0; font-size: 1.08rem; overflow-wrap: anywhere; }
.analysis-results [hidden] { display: none !important; }
.analysis-result-description { margin: 16px 0; }
.analysis-suggestion-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.analysis-suggestion-heading h3 { margin: 0; font-size: 1.08rem; overflow-wrap: anywhere; flex: 1; min-width: 180px; }
.analysis-suggestion-heading .status-chip { flex-shrink: 0; }
.analysis-query-scroll { overflow-x: auto; }
.analysis-query-scroll table { min-width: 560px; }
.audit-review-label { display: block; color: #92400e; font-size: 0.76rem; margin-bottom: 4px; }
.audit-reason-preview { margin: 8px 0; color: var(--muted); font-size: 0.9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.audit-suggestion-meta { margin: 8px 0; font-size: 0.78rem; color: var(--muted); }
.audit-inline-warning { margin: 10px 0; border-left: 3px solid #eab308; padding: 5px 10px; font-size: 0.84rem; color: #854d0e; background: #fffbeb; overflow-wrap: anywhere; }
.audit-proposal-editor { margin: 14px 0; }
.audit-suggestion-details > summary { cursor: pointer; color: var(--primary); font-size: 0.85rem; font-weight: 650; list-style: none; margin-top: 12px; }
.audit-suggestion-details > summary::-webkit-details-marker { display: none; }
.audit-suggestion-details > summary span { display: inline-block; margin-left: 4px; }
.audit-suggestion-details[open] > summary span { transform: rotate(180deg); }
.audit-suggestion-details > p { font-size: 0.9rem; }
.audit-query-table { table-layout: fixed; margin-top: 16px; font-size: 0.84rem; }
.audit-query-table th, .audit-query-table td { white-space: normal; overflow-wrap: anywhere; padding: 12px 8px; vertical-align: top; }
.audit-query-table th:first-child { width: 55%; }
.audit-query-table th:not(:first-child) { width: 15%; }
.audit-query-table td:not(:first-child) { font-variant-numeric: tabular-nums; }
.audit-query-table th { text-transform: none; letter-spacing: 0; font-size: 0.78rem; }
.audit-query-warning { margin: 6px 0; color: #92400e; font-size: 0.78rem; }
.audit-query-source { margin-top: 6px; font-size: 0.78rem; }
.audit-query-source summary { color: var(--muted); cursor: pointer; }
.audit-query-source dl { margin: 10px 0; }
.audit-query-source dl div { margin-top: 7px; }
.audit-query-source dt { color: var(--muted); }
.audit-query-source dd { margin: 0; }
.audit-more-queries { margin-top: 10px; }
.audit-action-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; margin-top: 20px; background: white; border: 1px solid #c6d7f5; border-radius: 12px; box-shadow: 0 4px 20px rgba(16,24,40,0.1); }
.audit-action-bar > div { margin-right: auto; }
.audit-action-bar > div strong, .audit-action-bar > div span { display: block; }
.audit-action-bar .field-help { margin: 0; font-size: 0.75rem; }
.audit-action-status:empty { display: none; }
.audit-action-status { flex-basis: 100%; margin: 0; font-size: 0.82rem; color: var(--muted); }
.audit-export-note { font-size: 0.78rem; }
.audit-panel-empty { padding: 28px 0; }
.audit-panel-empty h3 { font-size: 1rem; }
.audit-panel-empty p { color: var(--muted); font-size: 0.9rem; }
.audit-other-actions { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; color: var(--muted); font-size: 0.85rem; }
.audit-other-actions > button, .audit-other-actions form { margin-top: 14px; }
@media (max-width: 680px) {
    .account-card.audit-result-compact { padding: 16px; }
    .audit-result-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .audit-result-tabs a { padding: 8px; font-size: 0.78rem; justify-content: space-between; gap: 4px; }
    .audit-panel-intro { align-items: flex-start; }
    .audit-suggestion { padding: 14px; }
    .audit-suggestion-title h3 { font-size: 1rem; }
    .audit-suggestion-heading { gap: 8px; flex-wrap: wrap; }
    .audit-suggestion-title { flex-basis: calc(100% - 30px); }
    .audit-suggestion-heading > button { margin-left: 26px; }
    .audit-query-table thead { display: none; }
    .audit-query-table, .audit-query-table tbody { display: block; }
    .audit-query-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
    .audit-query-table td { border: 0; padding: 10px 4px; }
    .audit-query-table td:first-child { grid-column: 1 / -1; }
    .audit-query-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.7rem; }
    .audit-action-bar { bottom: 8px; padding: 12px; gap: 8px; }
    .audit-action-bar > div { flex-basis: 100%; display: flex; align-items: center; gap: 8px; }
    .audit-action-bar .button { flex: 1 1 0; min-width: 0; padding: 8px; white-space: normal; font-size: 0.78rem; }
}
.recommendation-group { margin-top: 30px; }
.recommendation-card { margin-top: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.recommendation-card .form-field { margin: 16px 0; }
.recommendation-card input[data-recommendation-proposal] { width: 100%; }
.recommendation-card details { margin-top: 16px; }
.recommendation-card summary { cursor: pointer; font-weight: 700; }
.recommendation-warning { padding: 12px 14px; border-radius: 10px; background: #fff7ed; color: #9a3412; }
.badge-queued, .badge-running { background: #fef3c7; color: #92400e; }
.badge-completed { background: #dcfce7; color: #166534; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.field-help { font-size: 0.875rem; color: var(--muted); margin: 10px 0 0; }
.semantics-form { margin-top: 24px; }
.workspace-card .button { margin-top: 22px; position: relative; z-index: 1; }
.results-toolbar input { width: 100%; min-height: 48px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 13px; }
.results-heading { margin: 32px 0 20px; }
.results-heading h2 { margin: 0; }
.results-heading p { margin: 8px 0 0; color: var(--muted); }
.phrase-results { margin-bottom: 24px; }
.results-toolbar { padding: 24px; }
.results-toolbar h3 { margin-bottom: 16px; }
.results-actions { justify-content: flex-start; margin-bottom: 16px; }
.sort-button { border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.main-nav { flex-wrap: wrap; }

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

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-underline-offset: 0.2em;
}

a:hover {
    color: var(--primary-dark);
}

button,
input {
    font: inherit;
}

:focus-visible {
    outline: 3px solid rgba(23, 92, 211, 0.35);
    outline-offset: 3px;
}

.page-shell,
.header-inner,
.footer-inner,
.flash-region {
    width: min(calc(100% - 40px), var(--page));
    margin-inline: auto;
}

.narrow-shell {
    width: min(calc(100% - 40px), 720px);
}

.site-header {
    position: relative;
    z-index: 10;
    border-bottom: 1px solid rgba(228, 231, 236, 0.8);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 750;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand:hover {
    color: var(--ink);
}

.brand-mark {
    width: 48px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: white;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    box-shadow: 0 7px 18px rgba(23, 92, 211, 0.22);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
}

.main-nav > a:not(.button) {
    color: #344054;
    font-size: 0.94rem;
    font-weight: 600;
    text-decoration: none;
}

.nav-form {
    margin: 0;
}

.button {
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 18px rgba(23, 92, 211, 0.18);
}

.button-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.button-secondary {
    border-color: #cfd8e6;
    background: white;
    color: #344054;
}

.button-secondary:hover,
.button-quiet:hover {
    border-color: #aebbd0;
    background: var(--soft);
    color: var(--ink);
}

.button-quiet {
    border-color: var(--line);
    background: transparent;
    color: #475467;
    box-shadow: none;
}

.button-danger {
    border-color: #fecdca;
    background: var(--danger-soft);
    color: var(--danger);
}

.button-danger:hover {
    background: #fee4e2;
    color: #912018;
}

.button-small {
    min-height: 38px;
    padding: 8px 13px;
    font-size: 0.875rem;
}

.button-full {
    width: 100%;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1,
h2,
h3 {
    margin-top: 0;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

h1 {
    margin-bottom: 22px;
    font-size: clamp(2.4rem, 5.5vw, 4.75rem);
}

h2 {
    font-size: clamp(1.65rem, 3vw, 2.45rem);
}

h3 {
    font-size: 1.15rem;
}

.hero {
    min-height: 610px;
    padding-block: 88px 96px;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
    align-items: center;
    gap: clamp(48px, 8vw, 110px);
}

.home-access {
    flex: 1;
    min-height: 660px;
    padding-block: 72px 96px;
    display: grid;
    place-items: center;
    position: relative;
}

.home-access::before {
    content: "";
    position: absolute;
    inset: 0 calc(50% - 50vw);
    z-index: -1;
    background:
        radial-gradient(circle at 50% 22%, rgba(23, 92, 211, 0.13), transparent 34%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 74%);
}

.access-panel {
    width: min(100%, 510px);
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: clamp(32px, 7vw, 54px);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    text-align: center;
}

.access-logo {
    width: 78px;
    height: 60px;
    margin: 0 auto 28px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    box-shadow: 0 14px 30px rgba(23, 92, 211, 0.22);
}

.access-panel h1 {
    margin-bottom: 14px;
    font-size: clamp(2.25rem, 7vw, 3.45rem);
}

.access-panel > p:not(.eyebrow) {
    margin: 0 auto;
    color: var(--muted);
}

.access-actions {
    margin-top: 30px;
    display: grid;
    gap: 11px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 77px 0 auto;
    height: 530px;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 78% 35%, rgba(23, 92, 211, 0.12), transparent 30%),
        linear-gradient(180deg, #fff 0%, #f9fbff 100%);
}

.hero-copy {
    max-width: 690px;
}

.hero-lead {
    max-width: 650px;
    margin: 0;
    color: #475467;
    font-size: clamp(1.08rem, 2vw, 1.28rem);
    line-height: 1.7;
}

.hero-actions {
    margin-top: 34px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.workflow-card {
    position: relative;
    padding: 28px;
    overflow: hidden;
    border: 1px solid rgba(213, 221, 234, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.workflow-card::after {
    content: "";
    position: absolute;
    right: -65px;
    bottom: -85px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.08);
}

.workflow-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.status-chip,
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 750;
    line-height: 1.2;
}

.status-chip {
    background: var(--primary-soft);
    color: var(--primary);
}

.workflow-count,
.muted-cell {
    color: var(--muted);
    font-size: 0.875rem;
}

.workflow-list {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0;
    list-style: none;
}

.workflow-list li {
    padding-block: 19px;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 14px;
    align-items: start;
    border-top: 1px solid var(--line);
}

.workflow-list li:first-child {
    border-top: 0;
}

.step-number {
    color: var(--primary);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.84rem;
    font-weight: 800;
}

.workflow-list strong,
.workflow-list small {
    display: block;
}

.workflow-list strong {
    margin-bottom: 3px;
    font-size: 1.04rem;
}

.workflow-list small {
    color: var(--muted);
    font-size: 0.9rem;
}

.principles {
    padding-block: 80px 110px;
}

.section-intro {
    max-width: 580px;
    margin-bottom: 35px;
}

.principle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
}

.principle-grid article {
    padding: 30px 32px 20px 0;
}

.principle-grid article + article {
    padding-left: 32px;
    border-left: 1px solid var(--line);
}

.principle-index {
    color: var(--primary);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 800;
}

.principle-grid h3 {
    margin: 34px 0 10px;
}

.principle-grid p {
    margin: 0;
    color: var(--muted);
}

.flash-region {
    padding-top: 18px;
}

.alert {
    border: 1px solid #b2ddff;
    border-radius: 12px;
    padding: 13px 16px;
    background: #eff8ff;
    color: #175cd3;
}

.alert + .alert {
    margin-top: 8px;
}

.alert-success {
    border-color: #abefc6;
    background: var(--success-soft);
    color: var(--success);
}

.alert-error {
    border-color: #fecdca;
    background: var(--danger-soft);
    color: var(--danger);
}

.alert-title {
    margin: 0 0 4px;
    font-weight: 750;
}

.alert ul {
    margin: 6px 0 0;
    padding-left: 22px;
}

.dashboard-heading h1,
.admin-heading h1 {
    font-size: clamp(2.2rem, 4vw, 3.6rem);
}

.form-card,
.panel,
.account-card,
.table-card,
.search-form {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.form-card {
    padding: clamp(24px, 4vw, 38px);
}

.form-card .alert {
    margin-bottom: 22px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 7px;
    color: #344054;
    font-size: 0.9rem;
    font-weight: 700;
}

.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 13px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.form-field input:not([type="checkbox"]):not([type="radio"]):hover,
.form-field select:hover,
.form-field textarea:hover {
    border-color: #98a2b3;
}

.form-field input:not([type="checkbox"]):not([type="radio"]):focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(23, 92, 211, 0.12);
}

.form-field textarea {
    line-height: 1.55;
    resize: vertical;
}

.form-field.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.form-field input[type="checkbox"],
.form-field input[type="radio"] {
    width: 19px;
    height: 19px;
    min-height: 0;
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--primary);
}

.tool-settings-form #prompt {
    min-height: 440px;
}

.prompt-history {
    margin-bottom: 28px;
}

/* История расположена рядом с редактором, но по умолчанию занимает одну строку. */
.semantic-region-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.semantic-region-actions .is-active { background: var(--accent, #1769d1); color: #fff; border-color: var(--accent, #1769d1); }
.semantic-region-search { margin-top: 12px; }
.semantic-region-results { display: grid; gap: 4px; margin-top: 8px; }
.semantic-region-result { width: 100%; padding: 9px 11px; border: 1px solid var(--line, #dbe2ee); border-radius: 8px; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.semantic-region-result:hover, .semantic-region-result:focus { border-color: var(--accent, #1769d1); background: #f4f8ff; }
.semantic-region-result strong, .semantic-region-result small { display: block; }
.semantic-region-result small { margin-top: 2px; color: var(--muted, #6d798b); }
.semantic-region-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.semantic-region-tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px 5px 9px; border-radius: 16px; background: #eaf2ff; color: #174d99; font-size: 14px; }
.semantic-region-tag button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.semantic-region-tag button:hover { background: #cdddf5; }

.help-tooltip {
    position: relative;
    display: inline-grid;
    width: 18px;
    height: 18px;
    place-items: center;
    margin-left: 4px;
    border: 1px solid var(--line, #b8c3d5);
    border-radius: 50%;
    color: var(--accent, #1769d1);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

.help-tooltip::after {
    position: absolute;
    z-index: 20;
    bottom: calc(100% + 8px);
    left: 50%;
    width: 250px;
    padding: 9px 11px;
    border-radius: 8px;
    background: #20324d;
    color: #fff;
    box-shadow: 0 8px 20px rgb(20 39 70 / 18%);
    content: attr(data-tooltip);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity .15s ease, transform .15s ease;
}

.help-tooltip:hover::after,
.help-tooltip:focus::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.prompt-history-compact {
    margin-top: 12px;
    border-top: 1px solid var(--line);
}

.prompt-history-compact > summary {
    padding: 11px 0;
    color: var(--primary);
    cursor: pointer;
    font-weight: 700;
}

.prompt-history-content { padding: 2px 0 4px; }

.prompt-version-list-compact {
    max-height: 330px;
    overflow-y: auto;
}

.prompt-version-list-compact .prompt-version-item summary {
    padding: 10px 12px;
    font-size: .92rem;
}

.prompt-version-list-compact .prompt-version-item pre {
    max-height: 220px;
    padding: 12px;
    font-size: .84rem;
}

.prompt-version-list {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.prompt-version-item + .prompt-version-item {
    border-top: 1px solid var(--line);
}

.prompt-version-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    cursor: pointer;
    background: #f8fafc;
}

.prompt-version-meta {
    color: var(--muted);
    font-size: 0.85rem;
    text-align: right;
}

.prompt-version-item pre {
    max-height: 360px;
    margin: 0;
    padding: 16px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: inherit;
    font-size: 0.88rem;
    line-height: 1.55;
}

.prompt-version-item .results-actions {
    padding: 0 16px 16px;
}

/* Автоматический сбор семантики: спокойная форма, живой прогресс и компактный результат. */
.semantic-start {
    margin-bottom: 26px;
    display: grid;
    grid-template-columns: minmax(230px, .62fr) minmax(0, 1.38fr);
    gap: clamp(34px, 7vw, 80px);
    padding: clamp(28px, 5vw, 48px);
}

.semantic-start-copy p:not(.eyebrow),
.semantic-panel-heading p,
.semantic-result-hero p {
    color: var(--muted);
}

.semantic-start-copy h2 { margin-bottom: 12px; }
.semantic-start-copy p:last-child { margin: 0; line-height: 1.65; }
.semantic-start form { min-width: 0; }
.optional-label { margin-left: 6px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.semantic-region-field { max-width: 100%; }

.semantic-progress-card {
    position: relative;
    min-height: 560px;
    overflow: hidden;
    padding: clamp(28px, 5vw, 50px);
    background: linear-gradient(145deg, #fff 0%, #f6f9ff 100%);
}

.semantic-progress-head,
.semantic-result-hero,
.semantic-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.semantic-progress-head h2,
.semantic-result-hero h2 { margin-bottom: 8px; }

.semantic-orbit {
    width: 132px;
    height: 132px;
    margin: 58px auto 32px;
    position: relative;
    border: 1px solid #d8e4f7;
    border-radius: 50%;
    animation: semantic-spin 4s linear infinite;
}

.semantic-orbit::before,
.semantic-orbit::after {
    content: "";
    position: absolute;
    border-radius: 50%;
}
.semantic-orbit::before { inset: 25px; background: radial-gradient(circle at 35% 30%, #75a6ff, var(--primary)); box-shadow: 0 18px 40px rgba(23, 92, 211, .25); }
.semantic-orbit::after { width: 18px; height: 18px; top: -9px; left: 57px; background: #10b981; box-shadow: 0 0 0 7px rgba(16, 185, 129, .12); }
.semantic-orbit span { position: absolute; inset: -17px; border: 1px dashed #c5d5ec; border-radius: 50%; }
.semantic-orbit i { position: absolute; width: 10px; height: 10px; right: -21px; top: 57px; border-radius: 50%; background: #f59e0b; }
@keyframes semantic-spin { to { transform: rotate(360deg); } }

.semantic-current-stage { max-width: 620px; margin: 0 auto 12px; display: flex; justify-content: space-between; gap: 20px; }
.semantic-current-stage span { color: var(--muted); }
.semantic-progress-track { max-width: 620px; height: 9px; margin: 0 auto 34px; overflow: hidden; border-radius: 99px; background: #e8eef8; }
.semantic-progress-track span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #54a0ff); transition: width 500ms ease; }
.semantic-steps { max-width: 720px; margin: 0 auto 26px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; list-style: none; }
.semantic-steps li { color: #98a2b3; font-size: .82rem; text-align: center; }
.semantic-steps li span { width: 13px; height: 13px; margin: 0 auto 8px; display: block; border: 2px solid #cbd5e1; border-radius: 50%; background: #fff; }
.semantic-steps li.is-active { color: var(--primary); font-weight: 700; }
.semantic-steps li.is-active span { border-color: var(--primary); box-shadow: 0 0 0 5px rgba(23, 92, 211, .1); }
.semantic-steps li.is-complete { color: #047857; }
.semantic-steps li.is-complete span { border-color: #10b981; background: #10b981; }
.semantic-progress-card > .field-help { text-align: center; }

.semantic-result { display: grid; gap: 20px; }
.semantic-result-hero { border-radius: 22px; padding: clamp(28px, 5vw, 46px); background: #0d1b36; color: #fff; }
.semantic-result-hero h2 { max-width: 800px; color: #fff; font-size: clamp(1.6rem, 3vw, 2.45rem); }
.semantic-result-hero p { margin: 0; color: #bdcbe2; }
.semantic-ready-mark { width: 58px; height: 58px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #10b981; font-size: 1.6rem; font-weight: 800; }
.semantic-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.semantic-summary-grid article { border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: #fff; }
.semantic-summary-grid strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 1.8rem; letter-spacing: -.04em; }
.semantic-summary-grid span { color: var(--muted); font-size: .88rem; }
.semantic-result-tabs { padding: 5px; display: flex; gap: 5px; border: 1px solid var(--line); border-radius: 13px; background: #f3f6fa; }
.semantic-result-tabs button { min-height: 44px; border: 0; border-radius: 9px; padding: 9px 16px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-weight: 700; }
.semantic-result-tabs button.is-active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgba(16, 24, 40, .08); }
.semantic-result-tabs button span { margin-left: 5px; border-radius: 99px; padding: 2px 7px; background: #e9eff9; font-size: .76rem; }
.semantic-panel { border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 4vw, 30px); background: #fff; }
.semantic-panel-heading { margin-bottom: 22px; }
.semantic-panel-heading h3 { margin-bottom: 5px; font-size: 1.3rem; }
.semantic-panel-heading p { margin: 0; }
.semantic-result-details { margin-top: 20px; }
.semantic-result-details > summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.semantic-result-details[open] > summary { margin-bottom: 18px; }
.semantic-result .table-scroll { overflow-x: visible; }
.semantic-result table { width: 100%; min-width: 0; table-layout: fixed; }
.semantic-result th:first-child { width: 75%; }
.semantic-result td { overflow-wrap: anywhere; }
.semantic-group-chips { margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.semantic-group-chips span { border: 1px solid #dbe4f0; border-radius: 99px; padding: 7px 11px; background: #f8fafc; color: #475467; font-size: .82rem; }
.semantic-group-chips b { margin-left: 4px; color: var(--primary); }
.semantic-limit-note { color: var(--muted); text-align: center; font-size: .85rem; }
.semantic-negative-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.semantic-negative-list article { border: 1px solid var(--line); border-radius: 12px; padding: 17px; }
.semantic-negative-list strong { color: #b42318; }
.semantic-negative-list p { margin: 7px 0; color: #475467; }
.semantic-negative-list small { color: var(--muted); }
.semantic-reason-cell { max-width: 560px; white-space: normal; line-height: 1.5; }

.semantic-stage-settings { margin-top: 25px; border-top: 1px solid var(--line); padding-top: 25px; }
.semantic-stage-settings > div:first-child { margin-bottom: 20px; }
.semantic-stage-settings > div:first-child h3 { margin: 4px 0 7px; }
.semantic-stage-settings > div:first-child p { margin: 0; color: var(--muted); }
.semantic-stage-number { color: var(--primary); font: 800 .78rem ui-monospace, Consolas, monospace; }
.semantic-admin-settings textarea { min-height: 230px; }
.system-status-card { margin-bottom: 24px; }
.system-status-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.system-status-grid div { padding: 16px; border-right: 1px solid var(--line); }
.system-status-grid div:last-child { border-right: 0; }
.system-status-grid span, .system-status-grid strong { display: block; }
.system-status-grid span { margin-bottom: 5px; color: var(--muted); font-size: .78rem; }
.admin-error-text { color: var(--danger); font-size: .8rem; white-space: normal; }

@media (max-width: 800px) {
    .semantic-start { grid-template-columns: 1fr; }
    .semantic-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .semantic-negative-list { grid-template-columns: 1fr; }
    .semantic-steps { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
    .system-status-grid { grid-template-columns: repeat(2, 1fr); }
    .system-status-grid div:nth-child(2) { border-right: 0; }
}

@media (max-width: 560px) {
    .semantic-progress-head, .semantic-result-hero, .semantic-panel-heading { flex-direction: column; }
    .semantic-summary-grid { grid-template-columns: 1fr; }
    .semantic-result-tabs { flex-wrap: wrap; }
    .semantic-result-tabs button { flex: 1 1 auto; }
    .semantic-orbit { margin-top: 38px; }
}

@media (max-width: 640px) {
    .prompt-version-item summary { align-items: flex-start; flex-direction: column; }
    .prompt-version-meta { text-align: left; }
}

.form-field small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.8rem;
}

.form-switch {
    margin: 20px 0 0;
    color: var(--muted);
    text-align: center;
}

.form-switch a {
    font-weight: 700;
}

.dashboard,
.admin-page {
    flex: 1;
    padding-block: 42px 72px;
}

.dashboard-heading,
.admin-heading {
    margin-bottom: 26px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.dashboard-heading h1,
.admin-heading h1 {
    margin-bottom: 8px;
}

.admin-heading h1 {
    font-size: clamp(2rem, 3vw, 2.6rem);
}

.account-email,
.admin-heading p:not(.eyebrow) {
    margin: 0;
    color: var(--muted);
    font-size: 1.03rem;
}

.workspace-card {
    min-height: 300px;
    margin-bottom: 24px;
    border-radius: 24px;
    padding: clamp(30px, 7vw, 70px);
    display: flex;
    align-items: center;
    gap: 28px;
    overflow: hidden;
    position: relative;
    background: #0d1b36;
    color: white;
}

.workspace-card::after {
    content: "";
    position: absolute;
    width: 310px;
    height: 310px;
    right: -90px;
    top: -150px;
    border: 70px solid rgba(91, 141, 239, 0.14);
    border-radius: 50%;
}

.workspace-card .status-chip {
    margin-bottom: 14px;
    background: rgba(100, 164, 255, 0.18);
    color: #bfdbfe;
}

.workspace-card h2 {
    margin-bottom: 12px;
    color: white;
}

.workspace-card p {
    max-width: 650px;
    margin: 0;
    color: #c8d4e8;
}

.workspace-icon {
    width: 76px;
    height: 76px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 22px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: #dbeafe;
    font-family: Georgia, serif;
    font-size: 1.45rem;
}

.account-card {
    padding: 30px;
    box-shadow: none;
}

.account-card h2 {
    margin-bottom: 0;
    font-size: 1.45rem;
}

.account-details {
    margin: 28px 0 0;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    border-top: 1px solid var(--line);
}

.account-details div {
    padding: 22px 20px 0 0;
}

.account-details div + div {
    padding-left: 20px;
    border-left: 1px solid var(--line);
}

.account-details dt {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.account-details dd {
    margin: 5px 0 0;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.badge-active {
    background: var(--success-soft);
    color: var(--success);
}

.badge-blocked {
    background: var(--danger-soft);
    color: var(--danger);
}

.search-form {
    margin-bottom: 18px;
    padding: 20px;
    box-shadow: none;
}

.search-form .form-field {
    margin: 0;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-row input {
    max-width: 520px;
}

.table-card {
    overflow: hidden;
    box-shadow: none;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    background: #f8fafc;
    color: #475467;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #fbfcfe;
}

.email-cell {
    min-width: 220px;
    color: var(--ink);
    font-weight: 650;
}

.action-cell {
    text-align: right;
}

.action-cell form {
    margin: 0;
}

.empty-state {
    padding: 64px 24px;
    text-align: center;
}

.empty-state h2 {
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.pagination {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--muted);
    font-size: 0.9rem;
}

.audit-history-card {
    padding: 0;
    overflow: hidden;
}

.audit-history-card .results-toolbar {
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
}

.audit-history-list {
    display: grid;
}

.audit-history-item {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
    transition: background 160ms ease;
}

.audit-history-item:last-child {
    border-bottom: 0;
}

.audit-history-item:hover {
    background: #f8fafc;
}

.audit-history-main {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.audit-history-main strong,
.audit-history-summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-history-meta,
.audit-history-summary {
    color: var(--muted);
    font-size: 0.88rem;
}

.audit-history-side {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 0 0 auto;
}

.audit-history-arrow {
    color: var(--primary);
    font-size: 1.2rem;
}

.tool-tabs {
    margin: -12px 0 28px;
    padding: 5px;
    display: inline-flex;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}

.tool-tabs a {
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

.tool-tabs a[aria-current="page"] {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(16, 24, 40, 0.1);
}

.mail-page { max-width: 1100px; }
.mail-page > .tool-tabs { flex-wrap: wrap; }
.mail-page > .account-card + .account-card { margin-top: 20px; }
.mail-page .account-card > h2 { margin-bottom: 18px; }
.mail-smtp-settings {
    min-width: 0;
    margin: 0 0 20px;
    padding: 16px 16px 0;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.mail-smtp-settings legend { padding-inline: 6px; font-weight: 700; }
.mail-template-layout {
    display: grid;
    grid-template-columns: minmax(0, 245px) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
}
.mail-template-nav.account-card { display: grid; gap: 4px; padding: 8px; }
.mail-template-nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.mail-template-nav a:hover,
.mail-template-nav a[aria-current="page"] { background: #eff6ff; color: var(--primary); }
.mail-template-preview {
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    overflow-wrap: anywhere;
}
.mail-template-preview summary { cursor: pointer; font-weight: 700; }
.mail-template-preview p { margin: 12px 0 0; }
.mail-template-preview-body { white-space: pre-wrap; }

@media (max-width: 680px) {
    .mail-template-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .mail-page .account-card:not(.mail-template-nav) { padding: 18px; }
}

.admin-audit-filters {
    margin-bottom: 20px;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(170px, 240px) auto;
    align-items: end;
    gap: 14px;
}

.admin-audit-filters .form-field {
    margin: 0;
}

.admin-audit-detail {
    margin-bottom: 20px;
}

.admin-audit-facts {
    margin: 24px 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

.admin-audit-facts > div {
    min-width: 0;
    padding: 16px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.admin-audit-facts > div:nth-child(3n) {
    border-right: 0;
}

.admin-audit-facts > div:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.admin-audit-facts dt {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.admin-audit-facts dd {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    font-weight: 650;
}

.admin-recommendation-list {
    margin: 18px 0;
    display: grid;
    gap: 10px;
}

.admin-recommendation-list article {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.admin-recommendation-list p {
    margin: 4px 0 0;
    color: var(--muted);
}

.admin-audit-source {
    margin-top: 22px;
}

.admin-audit-source summary {
    cursor: pointer;
    font-weight: 750;
}

.admin-audit-source pre {
    max-height: 320px;
    padding: 14px;
    overflow: auto;
    border-radius: 10px;
    background: #f8fafc;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.admin-model-cell {
    overflow-wrap: anywhere;
}

.admin-tool-history .results-toolbar {
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 20px;
    flex-wrap: wrap;
}

.admin-tool-history .results-toolbar h2 { margin: 0; }

.admin-ai-model {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.admin-ai-model + .admin-ai-model { margin-top: 14px; }
.admin-ai-name { font-weight: 650; overflow-wrap: anywhere; }
.admin-ai-provider { font-size: 0.75rem; }
.admin-ai-stage { color: var(--muted); font-size: 0.7rem; }

.admin-audit-table {
    table-layout: fixed;
}

.admin-audit-table th,
.admin-audit-table td {
    padding: 13px 12px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.admin-audit-table th:nth-child(1) { width: 14%; }
.admin-audit-table th:nth-child(2) { width: 18%; }
.admin-audit-table th:nth-child(3) { width: 24%; }
.admin-audit-table th:nth-child(4) { width: 15%; }
.admin-audit-table th:nth-child(5) { width: 17%; }
.admin-audit-table th:nth-child(6) { width: 12%; }

.admin-audit-table .email-cell {
    min-width: 0;
}

.admin-audit-table td > div { min-width: 0; }
.admin-audit-table .badge { max-width: 100%; white-space: normal; }

.clickable-table-row {
    cursor: pointer;
    transition: background 150ms ease, box-shadow 150ms ease;
}

.clickable-table-row:hover {
    background: var(--primary-soft);
}
.table-linked-row { transition: background 150ms ease; }
.table-linked-row:hover,
.table-linked-row:focus-within { background: var(--primary-soft); }
.table-linked-row a:not(.button) { color: inherit; text-decoration: none; text-underline-offset: 3px; transition: color 150ms ease; }
.table-linked-row a:not(.button):hover { color: var(--primary); text-decoration: underline; }
.table-linked-row a:not(.button):focus-visible { color: var(--primary); outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 2px; }

.clickable-table-row:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.error-panel {
    margin-block: 80px;
    padding: clamp(30px, 7vw, 58px);
}

.error-panel h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.error-panel p:not(.eyebrow) {
    margin-bottom: 28px;
    color: var(--muted);
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    background: #fbfcfe;
}

.footer-inner {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: var(--muted);
    font-size: 0.86rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-block: 70px;
        gap: 44px;
    }

    .hero-copy {
        max-width: 760px;
    }

    .workflow-card {
        max-width: 650px;
    }

    .form-card {
        width: min(100%, 620px);
    }

    .principle-grid {
        grid-template-columns: 1fr;
    }

    .principle-grid article,
    .principle-grid article + article {
        padding: 24px 0;
        border-left: 0;
        border-bottom: 1px solid var(--line);
    }

    .principle-grid h3 {
        margin-top: 16px;
    }
}

@media (max-width: 980px) {
    .admin-audit-table thead {
        display: none;
    }

    .admin-audit-table,
    .admin-audit-table tbody,
    .admin-audit-table tr,
    .admin-audit-table td {
        display: block;
        width: 100%;
    }

    .admin-audit-table tr {
        padding: 10px 16px;
        border-bottom: 1px solid var(--line);
    }

    .admin-audit-table tr:last-child {
        border-bottom: 0;
    }

    .admin-audit-table td {
        padding: 7px 0;
        display: grid;
        grid-template-columns: 125px minmax(0, 1fr);
        gap: 12px;
        border: 0;
    }

    .admin-audit-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
}

@media (max-width: 680px) {
    .settings-grid,
    .settings-limits { grid-template-columns: 1fr; }
    .audit-history-item {
        padding: 18px;
        align-items: flex-start;
        gap: 12px;
    }

    .audit-history-summary {
        white-space: normal;
    }

    .audit-history-side {
        gap: 8px;
        flex-direction: column;
        align-items: flex-end;
    }

    .admin-audit-filters,
    .admin-audit-facts {
        grid-template-columns: 1fr;
    }

    .admin-audit-facts > div,
    .admin-audit-facts > div:nth-child(3n),
    .admin-audit-facts > div:nth-last-child(-n + 3) {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .admin-audit-facts > div:last-child {
        border-bottom: 0;
    }

    .page-shell,
    .header-inner,
    .footer-inner,
    .flash-region {
        width: min(calc(100% - 28px), var(--page));
    }

    .header-inner {
        min-height: 70px;
        align-items: flex-start;
        padding-block: 14px;
    }

    .brand {
        min-height: 40px;
    }

    .brand > span:last-child {
        display: none;
    }

    .main-nav {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .main-nav > a:not(.button) {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    h1 {
        font-size: clamp(2.25rem, 12vw, 3.4rem);
    }

    .hero {
        min-height: auto;
        padding-block: 54px 64px;
    }

    .hero::before {
        height: 650px;
    }

    .workflow-card {
        padding: 22px;
    }

    .principles {
        padding-block: 56px 76px;
    }

    .dashboard,
    .admin-page {
        padding-block: 44px 70px;
    }

    .dashboard-heading,
    .admin-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-card {
        min-height: 350px;
        align-items: flex-start;
        flex-direction: column;
    }

    .account-details {
        grid-template-columns: 1fr;
    }

    .account-details div,
    .account-details div + div {
        padding: 17px 0;
        border-left: 0;
        border-bottom: 1px solid var(--line);
    }

    .account-details div:last-child {
        border-bottom: 0;
    }

    .search-row {
        align-items: stretch;
        flex-direction: column;
    }

    .search-row input {
        max-width: none;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .footer-inner {
        padding-block: 24px;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
    }
}

/* Кабинет и админка: отдельные меню и компактное рабочее пространство. */
.member-area, .admin-area { background: #f6f8fc; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.area-switch { font-size: 0.85rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.member-area .header-inner, .admin-area .header-inner { gap: 24px; flex-wrap: wrap; padding-block: 16px; }
.member-area .main-nav, .admin-area .main-nav { gap: 8px; margin-right: auto; }
.member-area .main-nav > a, .admin-area .main-nav > a { padding: 9px 12px; border-radius: 8px; }
.main-nav > a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.nav-dropdown { position: relative; }
.nav-dropdown summary { display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); font-weight: 650; list-style: none; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after { content: '⌄'; color: var(--muted); font-size: 0.8rem; }
.nav-dropdown summary:hover, .nav-dropdown summary.nav-current-group { background: var(--primary-soft); color: var(--primary); }
.nav-dropdown-menu { position: absolute; z-index: 20; top: calc(100% + 7px); left: 0; display: none; min-width: 230px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 10px 24px rgba(16, 24, 40, 0.12); }
.nav-dropdown[open] .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: 9px 10px; border-radius: 7px; color: var(--ink); font-size: 0.88rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.nav-dropdown-menu a:hover, .nav-dropdown-menu a:focus-visible, .nav-dropdown-menu a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.admin-area .site-header { border-top: 4px solid #293b60; }
.admin-area .brand-mark { background: #293b60; box-shadow: none; }
.cabinet { padding-block: 48px 72px; }
.cabinet-welcome { display: flex; align-items: center; justify-content: space-between; gap: 36px; margin-bottom: 44px; }
.cabinet-welcome h1 { font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1.14; letter-spacing: -0.04em; margin: 0 0 18px; }
.cabinet-welcome h1 span { color: #5c708f; }
.welcome-description { max-width: 590px; color: var(--muted); margin: 0; line-height: 1.65; }
.member-identity { display: flex; align-items: center; gap: 12px; max-width: 330px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.member-identity > div { min-width: 0; }
.member-identity strong { display: block; overflow-wrap: anywhere; font-size: 0.9rem; }
.member-avatar { flex: 0 0 42px; height: 42px; display: grid; place-items: center; background: #eaf0fc; border-radius: 50%; color: var(--primary); font-weight: 750; }
.identity-caption, .identity-status { display: block; font-size: 0.75rem; color: var(--muted); }
.identity-status { color: var(--success); margin-top: 3px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { font-size: 1.35rem; margin: 0; }
.section-heading p { color: var(--muted); font-size: 0.9rem; margin: 5px 0 0; }
.section-heading > span { color: var(--muted); font-size: 0.85rem; }
.section-heading > a { font-size: 0.85rem; font-weight: 650; text-decoration: none; }
.tool-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.tool-cards-single { grid-template-columns: minmax(0, 1fr); }
.tool-card { display: flex; flex-direction: column; align-items: flex-start; padding: 30px; border: 1px solid #dce3ed; border-radius: 20px; background: white; box-shadow: 0 5px 18px rgba(16, 24, 40, 0.025); }
.audit-card { background: linear-gradient(135deg, #f3f7ff, #fff 75%); border-color: #c6d7f5; }
.tool-card-top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 16px; margin-bottom: 25px; }
.tool-symbol { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; background: #e9f5f3; color: #167269; font-size: 1.8rem; }
.audit-card .tool-symbol { background: #e4edff; color: var(--primary); }
.tool-tag { font-size: 0.75rem; color: #5c6a80; font-weight: 650; }
.tool-card h3 { font-size: 1.45rem; line-height: 1.3; margin: 0 0 12px; letter-spacing: -0.025em; }
.tool-card p { color: var(--muted); margin: 0; line-height: 1.65; font-size: 0.95rem; }
.tool-features { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; margin: 22px 0 28px; }
.tool-features li { background: #f2f5f9; border-radius: 6px; padding: 5px 9px; font-size: 0.74rem; color: #4b5b71; }
.tool-card > .button { margin-top: auto; }
.tool-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.tool-card small { margin-top: 12px; font-size: 0.75rem; color: var(--muted); }
.recent-checks { margin-top: 40px; }
.history-empty { display: flex; gap: 20px; align-items: center; padding: 28px; border: 1px dashed #cbd5e1; border-radius: 16px; background: white; }
.empty-symbol { font-size: 2rem; color: #94a3b8; }
.history-empty h3 { font-size: 1rem; margin: 0 0 6px; }
.history-empty p { font-size: 0.9rem; color: var(--muted); max-width: 620px; margin: 0; }
.history-empty .button { margin-left: auto; flex-shrink: 0; }
.recent-list { background: white; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.recent-check { display: flex; align-items: center; gap: 18px; padding: 20px 24px; color: var(--ink); text-decoration: none; }
.recent-check + .recent-check { border-top: 1px solid var(--line); }
.recent-check:hover { background: #f8faff; }
.recent-check > div { flex: 1; min-width: 0; }
.recent-check strong { display: block; overflow-wrap: anywhere; font-size: 0.95rem; }
.recent-check div span { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.workflow-note { display: flex; gap: 24px; align-items: baseline; margin-top: 28px; padding: 22px 0; color: var(--muted); font-size: 0.85rem; }
.workflow-note strong { flex-shrink: 0; color: #475467; }
.workflow-note p { margin: 0; }
.admin-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.admin-shortcut { display: flex; flex-direction: column; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: white; text-decoration: none; color: var(--ink); }
.admin-shortcut:hover { border-color: #93b5ef; box-shadow: 0 8px 24px rgba(23, 92, 211, 0.06); }
.shortcut-number { color: #7890b2; font-size: 0.85rem; font-weight: 700; margin-bottom: 25px; }
.admin-shortcut h2 { font-size: 1.35rem; margin-bottom: 12px; }
.admin-shortcut p { color: var(--muted); font-size: 0.95rem; margin: 0 0 28px; }
.card-link { margin-top: auto; font-size: 0.85rem; font-weight: 700; color: var(--primary); }
a:focus-visible, button:focus-visible { outline: 3px solid #84adff; outline-offset: 4px; }
@media (max-width: 1000px) {
    .member-area .main-nav, .admin-area .main-nav { order: 3; width: 100%; justify-content: flex-start; }
    .header-actions { margin-left: auto; }
    .admin-shortcuts { grid-template-columns: 1fr; }
    .cabinet-welcome { align-items: flex-start; }
    .member-identity { max-width: 260px; }
}
@media (max-width: 680px) {
    .cabinet { padding-block: 30px 48px; }
    .cabinet-welcome { flex-direction: column; gap: 24px; margin-bottom: 32px; }
    .member-identity { max-width: 100%; width: 100%; }
    .tool-cards { grid-template-columns: 1fr; gap: 16px; }
    .tool-card { padding: 24px; }
    .header-actions { gap: 10px; }
    .area-switch { font-size: 0.75rem; }
    .member-area .header-inner, .admin-area .header-inner { flex-direction: row; gap: 12px; }
    .member-area .brand > span:last-child, .admin-area .brand > span:last-child { font-size: 0.85rem; }
    .member-area .main-nav, .admin-area .main-nav { gap: 3px; }
    .member-area .main-nav > a, .admin-area .main-nav > a { font-size: 0.8rem; padding: 8px; }
    .nav-dropdown summary { padding: 8px; font-size: 0.8rem; }
    .admin-area .main-nav { position: relative; }
    .nav-dropdown { position: static; }
    .nav-dropdown-menu { left: 0; right: auto; min-width: 210px; max-width: 100%; }
    .history-empty { flex-wrap: wrap; padding: 24px; }
    .history-empty .button { margin-left: 0; }
    .workflow-note { flex-direction: column; gap: 8px; }
    .recent-check { padding: 18px; gap: 10px; }
}

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

.direct-account { padding: 28px; margin-bottom: 24px; }
.direct-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

.direct-connect-page { max-width: 760px; padding-block: 32px 48px; }
.direct-connect-card { padding: 32px; }
.direct-connect-heading { margin-bottom: 24px; }
.direct-connect-card h1 { font-size: clamp(1.65rem, 4vw, 2rem); line-height: 1.2; letter-spacing: -0.025em; margin: 0 0 12px; }
.direct-connect-heading > p:last-child { margin: 0; color: var(--muted); line-height: 1.6; }
.direct-connect-step { display: flex; gap: 16px; padding: 22px; margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; }
.direct-connect-step.is-active { border-color: var(--primary); background: #f7faff; }
.direct-step-number { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; color: var(--muted); background: #eef1f5; font-weight: 700; }
.is-active .direct-step-number { color: #fff; background: var(--primary); }
.direct-step-content { min-width: 0; flex: 1; }
.direct-step-content h2 { margin: 3px 0 10px; font-size: 1.1rem; line-height: 1.4; }
.direct-step-content > p { margin: 0 0 16px; color: var(--muted); line-height: 1.6; }
.direct-step-content .form-field { margin: 16px 0; }
.direct-step-content .field-help { margin: 10px 0 0; }
.direct-open-status { display: block; margin-top: 12px; font-size: 0.85rem; line-height: 1.5; color: var(--muted); }
.direct-open-status[hidden], .direct-loading-status[hidden] { display: none; }
.direct-loading-status { margin: 12px 0 0; color: var(--primary); line-height: 1.5; }
.direct-connect-messages { margin: 0 0 16px; padding: 12px 14px; color: #9f2536; background: #fff1f2; border-radius: 8px; font-size: 0.9rem; overflow-wrap: anywhere; }
.direct-connect-messages p { margin: 0; line-height: 1.5; }
.direct-connect-messages p + p { margin-top: 8px; }
.direct-step-content input[aria-invalid="true"] { border-color: #b82d42; }
.direct-connect-help { margin-top: 24px; font-size: 0.9rem; line-height: 1.6; color: var(--muted); }
.direct-connect-help summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.direct-connect-help p { margin: 12px 0; }
.direct-connect-footer { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.direct-connect-cancel { padding: 4px 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.9rem; cursor: pointer; text-align: left; }
.direct-connect-cancel:hover { color: var(--primary); text-decoration: underline; }
.direct-connect-cancel:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.direct-connect-retry > p { color: var(--muted); line-height: 1.6; }
@media (max-width: 600px) {
    .direct-connect-page { padding-block: 20px 32px; }
    .direct-connect-card { padding: 22px 18px; }
    .direct-connect-step { padding: 16px 12px; gap: 10px; }
    .direct-step-number { width: 28px; height: 28px; flex-basis: 28px; }
    .direct-step-content .button { width: 100%; padding-inline: 12px; }
}

/* Кабинет Директа и компактные карточки пользователей. */
.direct-welcome { margin-bottom: 28px; align-items: flex-start; }
.direct-welcome h1 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); }
.direct-member-email { overflow-wrap: anywhere; font-size: .85rem; padding-top: 8px; }
.direct-account-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.direct-account-heading h2 { margin: 0 0 12px; overflow-wrap: anywhere; }
.direct-account-heading .eyebrow { margin-bottom: 8px; }
.direct-account-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--muted); font-size: .9rem; margin: 20px 0; }
.direct-account-meta strong { color: var(--ink); }
.direct-actions { align-items: center; }
.dashboard .direct-account { padding: 20px 22px; margin-bottom: 20px; }
.dashboard .has-connection { position: relative; }
.dashboard .direct-login-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.dashboard .direct-login-row h2 { margin: 0; font-size: 1.15rem; line-height: 1.4; }
.dashboard .direct-account-heading .eyebrow { margin: 0 0 6px; font-size: .7rem; }
.dashboard .direct-account-meta { margin-top: 12px; font-size: .85rem; }
.dashboard .direct-actions .button { padding: 10px 14px; font-size: .85rem; }
.dashboard .has-connection .direct-account-heading > div { max-width: 55%; }
.dashboard .has-connection .direct-actions { position: absolute; top: 20px; right: 80px; margin: 0; max-width: 38%; justify-content: flex-end; }
.dashboard .has-connection .direct-account-meta { margin-bottom: 0; }
.direct-actions .field-help { margin: 0; }
.direct-account-menu { position: relative; flex-shrink: 0; }
.direct-account-menu summary { display: grid; place-items: center; width: 42px; height: 38px; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; font-size: 1.4rem; line-height: 1; list-style: none; }
.direct-account-menu summary::-webkit-details-marker { display: none; }
.direct-account-menu summary:hover { background: var(--soft); }
.direct-account-menu summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.direct-account-menu > div { position: absolute; right: 0; top: 46px; z-index: 5; min-width: 220px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: white; box-shadow: 0 8px 24px #15254215; }
.direct-account-menu .button { width: 100%; color: var(--danger); justify-content: flex-start; }
.direct-error { padding: 12px 16px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); overflow-wrap: anywhere; }
.badge-neutral { background: var(--soft); color: var(--muted); }
.direct-cell-caption { display: block; color: var(--muted); font-size: .8rem; margin-top: 5px; font-weight: 400; overflow-wrap: anywhere; }
.direct-campaign-table { table-layout: fixed; }
.direct-campaign-table th, .direct-campaign-table td { white-space: normal; overflow-wrap: anywhere; padding: 18px 20px; }
.direct-campaign-table th:first-child { width: 38%; }
.direct-campaign-table th:nth-child(2) { width: 25%; }
.direct-campaign-table th:nth-child(3) { width: 20%; }
.direct-campaign-table th:nth-child(4) { width: 17%; }
.direct-campaign-table .badge { white-space: normal; }
.admin-users-table th:nth-child(1) { width: 31%; }
.admin-users-table th:nth-child(2) { width: 18%; }
.admin-users-table th:nth-child(3) { width: 28%; }
.admin-users-table th:nth-child(4) { width: 23%; }
.admin-users-table a { font-weight: 650; }
.admin-user-choice { display: flex; align-items: center; gap: 10px; }
.admin-user-choice input[type="checkbox"] { width: 18px; height: 18px; flex: none; }
#archive-users { margin-bottom: 12px; }
.admin-users-search { display: grid; grid-template-columns: minmax(210px, .7fr) minmax(0, 1.5fr); gap: 20px; align-items: end; }
.admin-user-page h1 { overflow-wrap: anywhere; font-size: clamp(1.5rem, 3vw, 2.5rem); }
.user-section-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0 0 24px; font-size: .9rem; }
.admin-user-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; margin: 24px 0; }
.admin-user-facts dt { color: var(--muted); font-size: .8rem; margin-bottom: 6px; }
.admin-user-facts dd { margin: 0; font-size: .95rem; font-weight: 600; overflow-wrap: anywhere; }
.direct-diagnostics { margin-top: 18px; }
.admin-user-page .direct-action-help { margin: 12px 0 0; max-width: 760px; line-height: 1.6; }
.direct-diagnostics-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.direct-diagnostics-section > h3 { margin: 0 0 16px; font-size: 1.05rem; line-height: 1.4; }
.direct-diagnostics-section .direct-diagnostics { margin-top: 0; }
.direct-diagnostics-section .admin-user-facts { margin-top: 0; }
.direct-test-result { margin: 18px 0; padding: 16px; background: var(--soft); border-radius: 12px; }
.direct-test-result p { margin-bottom: 0; overflow-wrap: anywhere; }
.user-history-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin-top: 28px; }
.user-history-list { list-style: none; padding: 0; margin: 20px 0 0; }
.user-history-list li { padding: 14px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.user-history-list a { display: block; }
.user-history-grid h2 { font-size: 1.15rem; }
.admin-user-page section[id] { scroll-margin-top: 24px; }
@media (max-width: 1000px) {
    .admin-user-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard .has-connection .direct-actions { position: static; max-width: none; justify-content: flex-start; margin-top: 12px; }
    .dashboard .has-connection .direct-account-heading > div { max-width: calc(100% - 60px); }
}
@media (max-width: 760px) {
    .admin-users-search { grid-template-columns: 1fr; gap: 16px; }
    .direct-welcome { gap: 12px; }
    .direct-account { padding: 20px; }
    .direct-account-meta { flex-direction: column; gap: 8px; }
    .direct-campaign-table, .direct-campaign-table tbody, .direct-campaign-table tr, .direct-campaign-table td { display: block; width: 100%; }
    .direct-campaign-table thead { display: none; }
    .direct-campaign-table tr { padding: 16px 20px; border-bottom: 1px solid var(--line); }
    .direct-campaign-table tr:last-child { border-bottom: 0; }
    .direct-campaign-table td { padding: 8px 0; border: 0; }
    .direct-campaign-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .75rem; margin-bottom: 4px; }
    .admin-users-table th { width: auto; }
}

/* Структура подключённых кампаний. */
.direct-selection-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin:18px 0; }
.direct-select-name { display:flex; gap:12px; align-items:flex-start; }
.direct-select-name input[type=checkbox] { width:18px; height:18px; margin:3px 0 0; flex-shrink:0; accent-color:var(--primary); }
.direct-structure-heading { display:flex; align-items:center; justify-content:space-between; gap:24px; margin:22px 0; }
.direct-structure-heading h1 { font-size:clamp(1.5rem,3vw,2.3rem); margin:0; overflow-wrap:anywhere; }
.direct-structure-status { display:flex; flex-wrap:wrap; gap:12px 22px; align-items:center; color:var(--muted); font-size:.85rem; margin:20px 0; }
.direct-notice { padding:16px 20px; border:1px solid var(--line); background:var(--soft); border-radius:12px; font-size:.9rem; overflow-wrap:anywhere; }
.direct-structure-tabs { display:flex; flex-wrap:wrap; gap:8px; border-bottom:1px solid var(--line); padding:12px 0; margin:24px 0; }
.direct-structure-tabs a { padding:10px 16px; text-decoration:none; border-radius:10px; color:var(--muted); }
.direct-structure-tabs a[aria-current=page] { color:var(--primary); background:var(--soft); font-weight:650; }
.direct-structure-filters { display:flex; flex-wrap:wrap; gap:16px; align-items:end; margin:24px 0; }
.direct-structure-filters label { flex:1; min-width:200px; }
.direct-structure-filters select, .direct-structure-filters input { width:100%; margin-top:8px; }
.direct-counts { display:flex; flex-wrap:wrap; gap:12px 24px; padding:20px 0; border-top:1px solid var(--line); }
.direct-counts strong { margin-left:8px; }
.direct-settings { margin-top:20px; }
.direct-settings summary { cursor:pointer; font-weight:650; padding:12px 0; }
.direct-settings-list { margin:12px 0; }
.direct-settings-list > div { display:grid; grid-template-columns:minmax(150px, .4fr) minmax(0,1fr); gap:20px; padding:8px 0; border-bottom:1px solid var(--line); }
.direct-settings-list dt { color:var(--muted); font-size:.85rem; overflow-wrap:anywhere; }
.direct-settings-list dd { margin:0; font-size:.9rem; overflow-wrap:anywhere; }
.direct-settings-list .direct-settings-list { margin:0; }
.direct-ad-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.direct-ad { padding:22px; margin:0; overflow-wrap:anywhere; }
.direct-ad-meta { display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px; color:var(--muted); font-size:.8rem; }
.direct-ad h3 { font-size:1.1rem; margin:16px 0 10px; }
.direct-ad-text { white-space:pre-wrap; line-height:1.6; }
.direct-ad-link { display:block; margin-top:12px; }
.direct-autotargeting { margin-top:32px; }
.direct-autotargeting .direct-ad { margin-bottom:16px; }
@media(max-width:760px) {
 .direct-structure-heading { align-items:flex-start; flex-direction:column; }
 .direct-ad-list { grid-template-columns:1fr; }
 .direct-settings-list > div { grid-template-columns:1fr; gap:6px; }
 .direct-structure-tabs a { padding:8px 10px; }
}
.direct-structure-filters select, .direct-structure-filters input { min-height:44px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--ink); font:inherit; }
.direct-structure-filters select:focus, .direct-structure-filters input:focus { outline:2px solid var(--primary-soft); border-color:var(--primary); }
.direct-select-all { display:flex; align-items:center; gap:8px; font-size:.85rem; color:var(--muted); }
.direct-select-all input { width:18px; height:18px; accent-color:var(--primary); }
.direct-readable-settings { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; margin:18px 0 0; }
.direct-readable-settings > section { padding:20px; border:1px solid var(--line); border-radius:12px; min-width:0; }
.direct-readable-settings h3 { margin:0 0 16px; font-size:1rem; }
.direct-strategy-card + .direct-strategy-card { margin-top:22px; padding-top:18px; border-top:1px solid var(--line); }
.direct-strategy-card h4 { color:var(--muted); font-size:.85rem; font-weight:500; margin:0 0 6px; }
.direct-strategy-name { margin:0 0 12px; font-weight:650; }
.direct-readable-facts { margin:0; }
.direct-readable-facts > div { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:12px; padding:10px 0; border-bottom:1px solid var(--line); }
.direct-readable-facts > div:last-child { border-bottom:0; }
.direct-readable-facts dt { color:var(--muted); font-size:.85rem; overflow-wrap:anywhere; }
.direct-readable-facts dd { margin:0; font-size:.9rem; overflow-wrap:anywhere; }
@media(max-width:900px) { .direct-readable-settings { grid-template-columns:1fr; } }
@media(max-width:480px) { .direct-readable-facts > div { grid-template-columns:1fr; gap:5px; } .direct-readable-settings > section { padding:16px; } }

/* Один блок на рекламную платформу: кабинет, действия и кампании. */
.advertising-platform { border:1px solid var(--line); border-radius:18px; background:var(--surface); margin-bottom:28px; }
.advertising-platform-header { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; padding:22px 24px; border-bottom:1px solid var(--line); }
.advertising-platform-identity { display:flex; align-items:flex-start; gap:14px; min-width:0; }
.advertising-platform-icon { display:grid; place-items:center; width:42px; height:42px; flex-shrink:0; border-radius:12px; background:#fff2ed; color:#d93621; font-size:1.4rem; font-weight:700; }
.advertising-platform-identity h2 { margin:0 0 8px; font-size:1rem; }
.advertising-platform-login { display:flex; flex-wrap:wrap; align-items:center; gap:10px; overflow-wrap:anywhere; }
.advertising-platform-login strong { font-size:1.05rem; }
.advertising-platform-updated { margin:8px 0 0; color:var(--muted); font-size:.8rem; }
.advertising-platform-actions { display:flex; align-items:flex-start; gap:12px; flex-shrink:0; }
.advertising-platform-actions .field-help { display:block; margin:6px 0 0; text-align:center; font-size:.75rem; }
.advertising-platform-content { padding:22px 24px 16px; }
.platform-campaign-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.platform-campaign-actions { display:flex; flex-wrap:wrap; gap:8px; }
.platform-campaign-heading h3 { margin:0; font-size:1.05rem; display:flex; align-items:center; gap:8px; }
.platform-campaign-heading .field-help { margin:8px 0 0; }
.platform-campaign-count { display:inline-grid; place-items:center; min-width:26px; padding:3px 7px; background:var(--soft); border-radius:8px; color:var(--muted); font-size:.8rem; }
.platform-connected-count { white-space:nowrap; color:var(--muted); font-size:.85rem; }
.platform-connected-count strong { color:var(--ink); }
.advertising-platform .direct-selection-toolbar { padding:12px 16px; background:var(--soft); border-radius:10px; gap:12px 18px; margin:18px 0 12px; }
.advertising-platform .direct-selection-toolbar .field-help { margin:0 0 0 auto; font-size:.8rem; }
.advertising-platform .table-card { border:0; border-radius:0; box-shadow:none; margin:0; }
.advertising-platform .direct-campaign-table th { padding:12px; font-size:.7rem; background:var(--surface); }
.advertising-platform .direct-campaign-table td { padding:16px 12px; }
.advertising-platform .direct-campaign-table th:first-child, .advertising-platform .direct-campaign-table td:first-child { padding-left:0; }
.advertising-platform .direct-campaign-table th:last-child, .advertising-platform .direct-campaign-table td:last-child { padding-right:0; }
.platform-campaign-check { display:grid; place-items:center; width:18px; flex-shrink:0; margin-top:3px; color:#067647; font-weight:700; }
.platform-data-note { margin:14px 0 0; padding-top:14px; border-top:1px solid var(--line); color:var(--muted); font-size:.78rem; line-height:1.6; }
@media(max-width:760px) {
 .advertising-platform-header { flex-direction:column; padding:18px; gap:16px; }
 .advertising-platform-actions { width:100%; justify-content:space-between; flex-wrap:wrap; }
 .advertising-platform-content { padding:18px; }
 .platform-campaign-heading { align-items:flex-start; flex-wrap:wrap; gap:10px; }
 .advertising-platform .direct-selection-toolbar { align-items:flex-start; flex-direction:column; padding:12px; }
 .advertising-platform .direct-selection-toolbar .field-help { margin:0; }
 .advertising-platform .direct-campaign-table tr { padding:14px 0; }
 .advertising-platform .direct-campaign-table td { padding:6px 0; }
}

.platform-campaign-picker { margin-top:20px; border:1px solid var(--line); border-radius:12px; scroll-margin-top:20px; }
.platform-campaign-picker > summary { cursor:pointer; display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:16px; font-size:.9rem; font-weight:650; list-style:none; }
.platform-campaign-picker > summary::before { content:'+'; font-size:1.15rem; color:var(--primary); }
.platform-campaign-picker[open] > summary::before { content:'−'; }
.platform-campaign-picker > summary .field-help { margin:0; font-weight:400; }
.platform-picker-body { padding:0 16px 16px; border-top:1px solid var(--line); }
.platform-picker-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:16px 0; }
.platform-picker-heading > p { margin:0; }
.platform-picker-heading form { flex-shrink:0; text-align:right; }
.platform-picker-heading form .field-help { display:block; margin:6px 0 0; font-size:.75rem; }
.platform-picker-search label { display:block; color:var(--muted); font-size:.8rem; margin-bottom:8px; }
.platform-picker-search > div { display:flex; gap:10px; align-items:center; }
.platform-picker-search input { flex:1; min-width:0; border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:var(--surface); color:var(--ink); font:inherit; }
.platform-picker-search input:focus { outline:2px solid var(--primary-soft); border-color:var(--primary); }
.platform-picker-search a { font-size:.8rem; }
.platform-picker-list { list-style:none; margin:0; padding:0; }
.platform-picker-list li { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 0; border-bottom:1px solid var(--line); }
.platform-picker-list li:last-child { border-bottom:0; }
.platform-picker-list label { display:flex; align-items:center; gap:12px; min-width:0; cursor:pointer; }
.platform-picker-list strong { font-size:.9rem; overflow-wrap:anywhere; }
.platform-picker-list input { width:18px; height:18px; flex-shrink:0; accent-color:var(--primary); }
.platform-picker-state { flex-shrink:0; color:var(--muted); font-size:.8rem; }
.platform-picker-empty { margin:18px 0 0; color:var(--muted); font-size:.9rem; }
.advertising-platform .empty-state { padding:24px 12px; }
.platform-campaign-options summary { cursor:pointer; color:var(--muted); font-size:.8rem; margin-top:8px; }
.campaign-analysis-note { display:grid; justify-items:start; gap:6px; margin-top:10px; font-size:.8rem; color:var(--muted); }
.campaign-analysis-note-required { width:fit-content; padding:8px 10px; border:1px solid #f3d58b; border-radius:10px; background:#fffaeb; color:#92400e; }
.campaign-analysis-note-required > span { font-weight:600; }
.campaign-analysis-note-pending { width:fit-content; padding:8px 10px; border:1px solid #f3d58b; border-radius:10px; background:#fffaeb; color:#92400e; }
.campaign-analysis-note-pending > span { font-weight:600; }
.campaign-pending-summary { display:flex; align-items:center; flex-wrap:wrap; gap:4px 14px; margin-bottom:20px; padding:12px 16px; border:1px solid #f3d58b; border-radius:10px; background:#fffaeb; color:#92400e; font-size:.9rem; }
.campaign-analysis-cta { border-color:#d9a23b; background:#fef3c7; color:#78350f; }
.campaign-analysis-cta:hover { border-color:#b7791f; background:#fde68a; color:#78350f; }
#analysis-description, #analysis-pending, #manual-analysis, #analysis-status-title, #connected-campaigns { scroll-margin-top:20px; }
@media(max-width:760px) {
 .platform-picker-heading { flex-direction:column; align-items:flex-start; }
 .platform-picker-heading form { text-align:left; }
 .platform-picker-list li { align-items:flex-start; flex-direction:column; gap:6px; }
 .platform-picker-state { margin-left:30px; }
 .platform-picker-search > div { flex-wrap:wrap; }
 .platform-picker-search input { flex-basis:65%; }
}

.proposal-form > label, .proposal-filters > label { display: grid; gap: 8px; margin: 16px 0; font-size: .9rem; }
.proposal-form input:not([type=checkbox]):not([type=hidden]), .proposal-form select, .proposal-form textarea,
.proposal-filters input:not([type=hidden]), .proposal-filters select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.proposal-form > .button { margin: 6px 8px 6px 0; }
.proposal-form > label:has(input[type=checkbox]) { display: flex; align-items: flex-start; }
.proposal-form input[type=checkbox], .analysis-suggestion-heading input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); }
.analysis-suggestion-heading > label { display: flex; align-items: flex-start; gap: 10px; overflow-wrap: anywhere; }
.audit-suggestion details { margin: 12px 0; }
.audit-suggestion pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32rem; overflow: auto; }
.proposal-filters { grid-template-columns: minmax(200px, 1fr) minmax(160px, .65fr) minmax(200px, .7fr) auto; }
.proposal-filters > label { margin: 0; }
@media(max-width: 1000px) { .proposal-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media(max-width: 600px) { .proposal-filters { grid-template-columns: 1fr; } }

.analysis-list-scroll { overflow-x: auto; }
.analysis-list { width: 100%; border-collapse: collapse; font-size: .9rem; }
.analysis-list th { text-align: left; color: var(--muted); font-size: .8rem; font-weight: 500; }
.analysis-list th, .analysis-list td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.analysis-list th:first-child, .analysis-list td:first-child { padding-left: 0; }
.analysis-list small { display: block; margin-top: 5px; color: var(--muted); font-size: .8rem; }
.analysis-list .status-chip { margin: 3px 4px 3px 0; }
.analysis-list td:last-child { text-align: right; white-space: nowrap; }
.analysis-list .button { padding: 8px 12px; }
details.account-card > summary { cursor: pointer; font-weight: 600; }
details.account-card[open] > summary { margin-bottom: 18px; }
[data-proposal-list] > .proposal-form { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); margin-bottom: 16px; }
[data-proposal-list] > .audit-suggestion { padding: 12px 16px; margin: 8px 0; }
[data-proposal-list] > .audit-suggestion > p { margin: 5px 0; color: var(--muted); }
[data-proposal-list] > .audit-suggestion > details { margin-top: 8px; }
.proposal-form details > label { display: grid; gap: 8px; margin: 12px 0; }
@media(max-width: 760px) { .analysis-list { min-width: 620px; } }
.direct-analysis-detail-page { padding-top: 24px; }
.direct-analysis-detail-page h1 { font-size: 2rem; margin: 0 0 10px; }
.analysis-detail-heading > p { margin: 8px 0; }
.analysis-detail-heading > details { margin-top: 12px; }
.direct-analysis-detail-page .tool-tabs { margin: 12px 8px 16px 0; }
.direct-analysis-detail-page .analysis-detail-heading { padding: 20px 24px; }
[data-proposal-list] > .proposal-form { max-width: none; }
[data-proposal-list] > .proposal-form .analysis-actions { margin: 0; gap: 10px; }
[data-proposal-list] > .proposal-form details { margin-top: 10px; }
.audit-readable-inputs { display: grid; gap: 20px; margin-top: 24px; }
.audit-readable-inputs > section,
.audit-readable-inputs > .audit-readable-report,
.audit-readable-inputs > .audit-readable-source { margin: 0; padding: 20px; border: 1px solid #dbe2ea; border-radius: 12px; background: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .04); }
.audit-readable-inputs > section > h3 { margin-top: 0; }
.audit-readable-inputs > .audit-readable-report > summary { font-size: 1.15rem; }
.audit-readable-inputs details { margin: 12px 0; }
.audit-readable-inputs summary { cursor: pointer; font-weight: 600; }
.audit-readable-inputs details details { margin-left: 16px; }
.audit-readable-inputs li { margin: 6px 0; overflow-wrap: anywhere; }
.audit-readable-inputs pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 480px; overflow: auto; }
.audit-readable-json { padding: 12px; background: #f8fafc; border-radius: 8px; }
.audit-readable-json > button { margin: 12px 8px 0 0; }
.audit-readable-search { display: flex; gap: 12px; align-items: end; margin: 16px 0; }
.audit-readable-search label { display: grid; gap: 6px; flex: 1; }
.audit-readable-table { min-width: 850px; }
.audit-readable-table td { vertical-align: top; }
.audit-readable-pagination { display: flex; align-items: center; gap: 20px; margin: 16px 0; }
.audit-readable-batch { border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; }
.audit-readable-batch > summary { line-height: 1.6; }
.audit-readable-inputs .audit-request-original { display: none; }
.proposal-evidence-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.proposal-evidence-row:last-child { border-bottom: 0; }
.proposal-evidence-row p { margin: 5px 0; overflow-wrap: anywhere; }
.proposal-compact-card .audit-reason-preview { display: block; margin: 10px 0; line-height: 1.55; overflow: visible; }
.proposal-compact-card > .audit-inline-warning { margin: 8px 0; }
.proposal-card-editor > summary { display: inline-flex; cursor: pointer; list-style: none; }
.proposal-card-editor > summary::-webkit-details-marker { display: none; }
.proposal-card-editor[open] > summary { margin-bottom: 12px; }
.proposal-convert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.proposal-convert-actions .button[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
.proposal-card-editor[data-proposal-conversion-panel][open] { padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.proposal-explanation-editor { margin: 14px 0; }
.proposal-explanation-editor > summary { cursor: pointer; }
.application-filters { display: grid; grid-template-columns: minmax(160px, 1.4fr) repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 10px; padding: 14px 16px; margin-bottom: 16px; }
.application-filters > label { display: grid; gap: 5px; min-width: 0; margin: 0; color: var(--muted); font-size: .78rem; }
.application-filters input, .application-filters select { width: 100%; min-width: 0; box-sizing: border-box; height: 36px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: .82rem; }
.application-filters input:focus, .application-filters select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.application-filters > .button { min-height: 36px; padding: 7px 12px; font-size: .82rem; }
.application-journal { min-width: 0; }
.application-journal-note { margin: 0; padding: 0 24px 16px; }
.application-journal > .pagination { padding: 0 16px 20px; flex-wrap: wrap; }
.application-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .85rem; }
.application-table th { color: #475467; font-size: .76rem; font-weight: 800; text-align: left; }
.application-table th, .application-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: normal; overflow-wrap: anywhere; }
.application-table th:first-child { width: 16%; }
.application-table th:nth-child(2) { width: 22%; }
.application-table th:nth-child(3) { width: 23%; }
.application-table th:nth-child(4) { width: 18%; }
.application-table td > strong { display: block; font-weight: 600; line-height: 1.5; }
.application-table small { display: block; margin-top: 5px; color: var(--muted); font-size: .76rem; }
.application-table td[data-label="Изменение"] > small { margin: 0 0 5px; }
.application-campaign-link { display: block; margin-top: 6px; line-height: 1.5; }
.application-place-name { display: block; line-height: 1.5; }
.application-table .application-place-level { margin: 0 0 5px; }
.application-detail-label { display: block; margin-bottom: 3px; color: var(--muted); }
.application-table .badge { max-width: 100%; box-sizing: border-box; white-space: normal; text-align: left; line-height: 1.4; }
.application-result-message { margin: 8px 0; line-height: 1.5; }
.application-details { min-width: 0; max-width: 100%; margin-top: 10px; font-size: .78rem; white-space: normal; overflow-wrap: anywhere; }
.application-details summary { cursor: pointer; color: var(--muted); }
.application-details p { margin: 8px 0; }
.application-details pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-size: .72rem; }
@media(max-width: 1100px) { .application-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .application-filters > label:first-of-type { grid-column: 1 / -1; } .application-filters > .button { justify-self: start; } }
@media(max-width: 800px) {
    .application-table, .application-table tbody { display: block; }
    .application-table thead { display: none; }
    .application-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; border-bottom: 1px solid var(--line); }
    .application-table td, .application-table td:first-child { display: block; width: auto; padding: 0; border: 0; min-width: 0; }
    .application-table td::before { content: attr(data-label); display: block; margin-bottom: 6px; color: var(--muted); font-size: .75rem; }
    .application-table td:last-child { grid-column: 1 / -1; }
}
@media(max-width: 480px) { .application-filters { grid-template-columns: minmax(0, 1fr); } .application-table tr { grid-template-columns: minmax(0, 1fr); } }
.proposal-card-history { padding-top: 12px; border-top: 1px solid var(--line); }
.proposal-card-history > summary { color: var(--muted); font-size: .85rem; cursor: pointer; }
.proposal-card-history pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; }
.analysis-query-scroll .proposal-evidence-table { min-width: 850px; table-layout: auto; }
.proposal-evidence-table th:first-child { width: 32%; }
.proposal-evidence-table th:nth-child(2) { width: 30%; }
.proposal-evidence-table td { vertical-align: top; }
@media(max-width: 760px) { .audit-readable-search { flex-direction: column; align-items: stretch; } }
/* Работа от имени клиента сохраняет административный вход. */
.client-view-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 6px max(20px, calc((100% - 1280px) / 2)); background: #fff5db; color: #59451d; border-bottom: 1px solid #e7ce91; font-size: 12px; line-height: 1.4; }
.client-view-context { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; min-width: 0; }
.client-view-context strong { font-weight: 600; overflow-wrap: anywhere; }
.client-view-context span { color: #786334; }
.client-view-banner form { flex-shrink: 0; }
.client-view-banner .button { min-height: 28px; padding: 4px 9px; border-radius: 7px; font-size: 12px; line-height: 1.4; }
.client-view-launch { margin-bottom: 24px; }
.admin-users-table td:last-child .button { white-space: normal; }
@media (min-width: 761px) {
    .admin-users-table th:nth-child(1) { width: 25%; }
    .admin-users-table th:nth-child(2) { width: 14%; }
    .admin-users-table th:nth-child(3) { width: 19%; }
    .admin-users-table th:nth-child(4) { width: 20%; }
    .admin-users-table th:nth-child(5) { width: 22%; }
}
@media (max-width: 700px) { .client-view-banner { padding: 6px 14px; } .client-view-context { flex-direction: column; align-items: flex-start; } }
@media (max-width: 400px) { .client-view-banner { flex-wrap: wrap; } }
/* Карточка создания ЕПК использует существующие поля, кнопки и цвета кабинета. */
.creation-page .account-card { margin-bottom: 20px; }
.creation-page .results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0; margin-bottom: 18px; }
.creation-page .results-toolbar h2 { margin: 0; }
.creation-page .badge { background: #edf2fc; color: #265caf; }
.creation-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; margin: 16px 0; }
.creation-fields label,.creation-editor label,.creation-selection label { display: block; margin: 8px 0; }
.creation-page textarea,.creation-page input:not([type=checkbox]),.creation-page select { width: 100%; }
.creation-page input:not([type=checkbox]):not([type=hidden]),.creation-page select,.creation-page textarea { min-height: 48px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 13px; background: var(--surface); color: var(--ink); font: inherit; }
.creation-page textarea { line-height: 1.55; resize: vertical; }
.creation-page input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); vertical-align: middle; margin-right: 8px; }
.creation-hours input[type=checkbox] { margin: 0; }
.creation-page label { color: #344054; font-size: .92rem; }
.creation-page label>input:not([type=checkbox]),.creation-page label>select,.creation-page label>textarea { display: block; margin-top: 7px; }
.creation-page fieldset { margin: 20px 0; border: 1px solid #e2e5ec; border-radius: 12px; padding: 16px; }
.creation-choices { display: flex; flex-wrap: wrap; gap: 16px; }
.creation-choices label { display: inline-flex; gap: 8px; align-items: center; }
.creation-pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 600px; overflow-y: auto; }
.creation-hours,.creation-table { overflow-x: auto; }
.creation-hours table { min-width: 800px; }
.creation-hours th,.creation-hours td { padding: 5px; text-align: center; }
.creation-review { display: grid !important; grid-template-columns: 1fr 1fr; gap: 16px; align-items: center; }
.creation-page details { margin: 12px 0; }
.creation-page .field-help { display: block; }
@media(max-width: 720px) { .creation-fields,.creation-review { grid-template-columns: 1fr !important; } }

/* Форма заявки: одна страница с примерами и понятным следующим шагом. */
.creation-intake { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.creation-request-form, .creation-intake-aside { min-width: 0; }
.creation-form-section { padding: clamp(22px, 3vw, 34px); }
.creation-section-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 26px; }
.creation-section-heading > span { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 12px; color: var(--primary); background: var(--primary-soft); font-size: .85rem; font-weight: 700; }
.creation-section-heading h2 { margin: 0 0 6px; font-size: 1.2rem; }
.creation-section-heading p, .creation-intake-aside p { margin: 0; color: var(--muted); line-height: 1.65; }
.creation-request-form .form-field { margin-bottom: 22px; }
.creation-request-form .form-field:last-child { margin-bottom: 0; }
.creation-request-form .form-field > label { display: block; margin-bottom: 8px; font-weight: 600; }
.creation-request-form .field-help { margin: 8px 0 0; font-size: .82rem; line-height: 1.6; }
.creation-request-form input::placeholder, .creation-request-form textarea::placeholder { color: #8a94a5; }
.creation-request-form input:focus, .creation-request-form textarea:focus { outline: 3px solid #175cd318; outline-offset: 1px; border-color: var(--primary); }
.creation-request-form .semantic-region-search { margin-top: 0; }
.creation-account { background: linear-gradient(145deg, #fff, #f3f7ff); }
.creation-intake-aside h2 { margin: 10px 0 12px; font-size: 1.08rem; line-height: 1.4; }
.creation-intake-aside .creation-account-login { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; margin-bottom: 12px; }
.creation-next ol { list-style: none; counter-reset: creation-step; padding: 0; margin: 18px 0 0; }
.creation-next li { counter-increment: creation-step; position: relative; padding-left: 32px; margin-bottom: 22px; }
.creation-next li:last-child { margin-bottom: 0; }
.creation-next li::before { content: counter(creation-step); position: absolute; left: 0; top: 0; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: .75rem; font-weight: 700; }
.creation-next strong, .creation-next span { display: block; font-size: .86rem; }
.creation-next span { color: var(--muted); margin-top: 6px; line-height: 1.6; }
.creation-budget-field { max-width: 420px; }
.creation-submit { padding-top: 8px; }
.creation-submit p { color: var(--muted); font-size: .85rem; max-width: 540px; line-height: 1.6; margin: 14px 0 0; }
@media(max-width: 960px) { .creation-intake { grid-template-columns: 1fr; } .creation-intake-aside { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; } }
@media(max-width: 600px) { .creation-intake-aside { grid-template-columns: 1fr; gap: 0; } .creation-submit .button { width: 100%; } }

/* Общий компактный блок состояния и управления кампанией. */
.direct-campaign-table td { vertical-align:top; }
.direct-state-panel { display:grid; gap:12px; min-width:0; }
.direct-state-summary { min-width:0; }
.direct-state-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; }
.direct-state-badge { display:inline-flex; align-items:center; gap:7px; padding:6px 10px; font-size:.78rem; line-height:1.35; font-weight:700; border-radius:8px; }
.direct-state-badge::before { content:""; width:6px; height:6px; flex-shrink:0; border-radius:50%; background:currentColor; }
.direct-state-badge-enabled { color:#067647; background:#ecfdf3; }
.direct-state-badge-paused { color:#92400e; background:#fffaeb; }
.direct-state-badge-inactive { color:#475467; background:#f2f4f7; }
.direct-state-moderation { color:var(--muted); font-size:.75rem; line-height:1.5; }
.direct-state-explanation { margin:8px 0 0; color:var(--ink); font-size:.82rem; line-height:1.6; overflow-wrap:anywhere; }
.direct-state-controls { display:grid; gap:10px; min-width:0; }
.direct-state-checked { margin:0; color:var(--muted); font-size:.73rem; line-height:1.5; }
.direct-state-checked span { white-space:nowrap; }
.direct-state-progress { margin:0; color:#92400e; font-size:.78rem; line-height:1.5; }
.direct-state-error { margin:0; font-size:.78rem; line-height:1.5; }
.direct-state-actions { display:flex; align-items:stretch; flex-wrap:wrap; gap:8px; margin:0; }
.direct-state-actions .direct-state-action { flex:1 1 128px; min-width:0; min-height:36px; padding:8px 10px; gap:6px; border-radius:8px; font-size:.75rem; font-weight:600; white-space:nowrap; box-shadow:none; }
.direct-state-action svg { flex-shrink:0; }
.direct-state-action-suspend { background:var(--surface); border-color:var(--line); color:#475467; }
.direct-state-action-resume { background:#eff6ff; border-color:#bfdbfe; color:#175cd3; }
.direct-state-action-suspend:not(:disabled):hover { background:#f9fafb; border-color:#98a2b3; transform:none; }
.direct-state-action-resume:not(:disabled):hover { background:#dbeafe; border-color:#84adff; transform:none; }
.direct-state-actions .direct-state-action:disabled { background:#f9fafb; border-color:#eaecf0; color:#98a2b3; opacity:1; }
.direct-state-action:focus-visible { outline:3px solid #b2ccff; outline-offset:2px; }
.direct-state-panel-card { grid-template-columns:minmax(0,1fr) minmax(260px,auto); gap:20px 32px; align-items:start; padding:18px 20px; margin:20px 0; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.direct-state-panel-card .direct-state-controls { max-width:340px; }
.direct-state-panel-card .direct-state-checked { text-align:right; }
@media(max-width:760px) {
 .direct-state-panel-card { grid-template-columns:minmax(0,1fr); padding:16px; gap:14px; }
 .direct-state-panel-card .direct-state-controls { max-width:none; }
 .direct-state-panel-card .direct-state-checked { text-align:left; }
 .direct-state-panel .direct-state-actions { max-width:360px; }
}

.app-legal-links{font-size:11px;line-height:1.8}.registration-offer{display:flex;align-items:flex-start;gap:10px;font-size:13px;line-height:1.6;margin:18px 0 10px}.registration-offer input{width:17px;min-width:17px;height:17px;margin-top:3px;accent-color:#745af5}.registration-offer a,.registration-privacy a{color:#7052b7;text-decoration:underline}.registration-privacy{font-size:11px;color:#7c718c;line-height:1.7;margin-bottom:18px}
.registration-offer input[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.registration-offer-error { margin: 0 0 10px; color: var(--danger); font-size: 13px; }

/* Визуальный стиль клиентского кабинета ZUSTI. */
@font-face {
    font-family: Manrope;
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/manrope/manrope-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: Manrope;
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/manrope/manrope-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:is(.member-area, .auth-page) {
    --ink: #171c38;
    --muted: #656a80;
    --line: #e4e0ef;
    --soft: #f4f1fb;
    --primary: #6347d4;
    --primary-dark: #4f36b2;
    --primary-soft: #eee9ff;
    --shadow: 0 12px 32px rgb(46 33 92 / 7%);
    background: #f8f7fc;
    font-family: Manrope, "Segoe UI", Arial, sans-serif;
}

:is(.member-area, .auth-page) .site-header {
    border-bottom-color: var(--line);
}

.member-area .main-nav > a:hover {
    background-color: var(--primary-soft);
    color: var(--primary-dark);
}

.member-area .button-primary {
    box-shadow: 0 8px 18px rgb(99 71 212 / 18%);
}

.member-area :is(a, button):focus-visible {
    outline-color: #8268e5;
}

.member-area .cabinet-welcome {
    padding: clamp(18px, 3vw, 34px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: radial-gradient(ellipse at top right, #dbf5f7, transparent 68%), #f0ebff;
}

.member-area :is(.advertising-platform, .tool-card) {
    border-color: var(--line);
    box-shadow: var(--shadow);
}

.member-area .tool-symbol {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.auth-page {
    --auth-lilac: #e4d8ff;
    --auth-cyan: #d9f2f3;
    background:
        radial-gradient(ellipse 32rem 24rem at 25% 38%, var(--auth-lilac), transparent),
        radial-gradient(ellipse 29rem 22rem at 78% 62%, var(--auth-cyan), transparent),
        #f8f7fc;
}

.auth-page .auth-layout {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    width: min(calc(100% - 32px), 440px);
    gap: 22px;
    padding-block: clamp(24px, 5vw, 56px);
}

.auth-page .auth-copy {
    text-align: center;
}

.auth-page .auth-copy .eyebrow {
    display: inline-block;
    margin: 0 0 12px;
    padding: 4px 10px;
    border-radius: 99px;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.auth-page .auth-copy h1 {
    margin: 0 0 8px;
    font-size: clamp(1.65rem, 4vw, 2.3rem);
    line-height: 1.15;
    letter-spacing: -0.045em;
}

.auth-page .auth-copy > p:not(.eyebrow) {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.auth-page .form-card {
    width: 100%;
    padding: clamp(20px, 5vw, 32px);
    border-color: #e3d9f3;
    border-radius: 20px;
    box-shadow: 0 14px 36px rgb(61 40 101 / 9%);
}

.auth-page .form-field input:not([type="checkbox"]) {
    border-color: #d8d0e7;
    background: #fcfbfe;
}

.auth-page .form-field input:not([type="checkbox"]):focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.auth-page .button-primary {
    border-radius: 99px;
    box-shadow: 0 8px 18px rgb(99 71 212 / 18%);
}

@media (max-width: 600px) {
    .auth-page {
        --auth-lilac: #eee6ff;
        --auth-cyan: #e7f6f7;
    }
}

.integrations-page summary.integration-heading { cursor: pointer; list-style: none; }
.integrations-page details:not([open]) > summary.integration-heading .eyebrow { display: none; }
.integrations-page summary.integration-heading::-webkit-details-marker { display: none; }
.integrations-page summary.integration-heading::after { content: '▾'; margin-inline-start: .5rem; }
.integrations-page details[open] > summary.integration-heading::after { content: '▴'; }
.integrations-page summary.integration-heading .status-chip { margin-inline-start: auto; }

.plans-grid,
.billing-plan-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.plans-page { max-width: 1060px; }
.plans-grid .plan-editor { min-width: 0; padding: clamp(18px, 3vw, 30px); }
.plan-editor-heading { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.plan-editor-heading h2 { margin: 0 0 8px; overflow-wrap: anywhere; }
.plan-editor-heading p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; color: var(--muted); }
.plan-editor-heading strong { color: var(--ink); font-size: 1.7rem; letter-spacing: -.03em; }
.plan-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.plan-editor-fields .form-field { margin: 0; min-width: 0; }
.plan-name-field { grid-column: 1 / -1; }

.plans-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
}
.plans-form-actions { margin-top: 22px; }
.plans-form-actions p { margin: 0; }

.billing-onboarding, .billing-access-summary { margin-bottom: 24px; }
.billing-onboarding > p { margin: 14px 0 0; }
.billing-access-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    border-inline-start: 4px solid var(--primary);
}
.billing-access-summary h2 { margin: 0; }
.billing-access-summary p { margin: 5px 0 0; color: var(--muted); }
.billing-access-summary .billing-analysis-reminder { margin-top:10px; padding:8px 12px; border-inline-start:3px solid #d9a23b; border-radius:6px; background:#fffaeb; color:#78350f; font-size:.875rem; }
.billing-analysis-reminder a { color:inherit; text-decoration:underline; white-space:nowrap; }
.dashboard-payment-success {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 24px;
}
.dashboard-payment-status { display: flex; align-items: center; gap: 12px; }
.dashboard-payment-status p { margin: 3px 0 0; font-size: .9rem; }
.dashboard-payment-icon {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    height: 36px;
    border-radius: 50%;
    background: #d1fadf;
}
.dashboard-payment-success > .button { max-width: 100%; text-align: center; }
.billing-plan-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--ink);
    text-decoration: none;
    overflow-wrap: anywhere;
}
.billing-plan-option:hover { border-color: var(--primary); }
.billing-plan-option small { display: block; margin-top: 3px; color: var(--muted); }
.billing-plan-option > span:last-child { color: var(--primary); font-weight: 700; }

@media (max-width: 680px) {
    .plans-grid, .billing-plan-options { grid-template-columns: 1fr; }
    .plans-form-actions .button { width: 100%; }
}


.billing-access-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--primary-soft);
}
.billing-access-notice p { margin: 0; }
.advertising-platform .billing-access-notice { margin-bottom: 16px; }
.billing-checkout-option { display: flex; flex-direction: column; align-items: flex-start; }
.billing-checkout-option > .button { margin-top: auto; }
.billing-checkout-list { padding-inline-start: 1.3rem; line-height: 1.7; }
.billing-checkout-alternative { margin-top: 22px; }
.billing-checkout-alternative h2 { margin-bottom: 12px; font-size: 1.1rem; }
.billing-checkout-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.billing-payment-card .badge { margin-bottom: 8px; }

.billing-onboarding {
    background: radial-gradient(ellipse at top right, #e4f8f9, transparent 57%), #fff;
    padding: clamp(18px, 3vw, 32px);
}
.billing-onboarding > .eyebrow { margin: 0 0 7px; }
.billing-onboarding h2 { margin-bottom: 18px; }
.onboarding-option {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 8px 24px rgb(30 31 77 / 6%);
    text-decoration: none;
}
.onboarding-option:hover { border-color: var(--primary); }
.onboarding-art { display: grid; place-items: center; }
.onboarding-art-ai { background: radial-gradient(ellipse at 68% 20%, #faf6ff, transparent 68%), #eee8ff; }
.onboarding-art-direct { background: radial-gradient(ellipse at 68% 30%, #f7ffff, transparent 68%), #e0f4f3; }
@media (prefers-reduced-motion: no-preference) {
    .onboarding-illustration-card { animation: onboarding-card-lift 2.2s ease-in-out 2; }
    .onboarding-spark {
        transform-box: fill-box;
        transform-origin: center;
        animation: onboarding-twinkle 2.2s ease-in-out 2 both;
    }
    .onboarding-illustration-row { animation: onboarding-row-reveal 2.2s ease-out 2 both; }
    .onboarding-motion-offset { animation-delay: .35s; }
    .onboarding-option-arrow { transition: transform 180ms ease; }
    .onboarding-option:is(:hover, :focus-visible) .onboarding-option-arrow { transform: translateX(6px); }
}
@keyframes onboarding-card-lift {
    0%, 100% { transform: translateY(0); }
    32% { transform: translateY(-14px); }
    58% { transform: translateY(3px); }
    78% { transform: translateY(0); }
}
@keyframes onboarding-twinkle {
    0%, 100% { opacity: 1; }
    36% { transform: rotate(28deg) scale(1.55); }
    68% { transform: rotate(0) scale(.9); opacity: .55; }
}
@keyframes onboarding-row-reveal {
    0%, 8% { transform: translateX(15px); opacity: .16; }
    36% { transform: translateX(-3px); opacity: 1; }
    52%, 100% { transform: translateX(0); opacity: 1; }
}
.onboarding-art svg { display: block; width: 100%; height: clamp(94px, 13vw, 130px); }
.onboarding-option-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: clamp(14px, 2vw, 22px);
}
.onboarding-option strong { display: block; font-size: 1.06rem; }
.onboarding-option small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.5; }
.onboarding-option-arrow {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 700;
}
.billing-access-expired {
    align-items: flex-start;
    border-inline-start-color: #d49a42;
    background: #fffaf2;
    padding: clamp(16px, 2vw, 24px);
}
.billing-expiry-details { display: flex; align-items: flex-start; gap: 12px; flex: 1 1 440px; min-width: 0; }
.billing-expiry-details h2 { font-size: 1.1rem; }
.billing-expiry-details p { font-size: .9rem; line-height: 1.5; }
.billing-expiry-date { font-weight: 650; }
.billing-expiry-icon {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    height: 34px;
    border-radius: 9px;
    color: #875214;
    background: #fff0d7;
}

.admin-tariff-form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}
.admin-tariff-form .form-field { flex: 0 1 auto; min-width: 0; max-width: min(270px, 100%); margin: 0; }
.admin-tariff-form .form-field :is(select, input[type="date"]) { min-height: 38px; padding: 6px 10px; font-size: .9rem; }
.admin-tariff-date, .admin-tariff-activation { margin-top: 12px; }
.admin-tariff-date > summary, .admin-tariff-activation > summary {
    width: fit-content;
    color: var(--primary);
    font-size: .9rem;
    cursor: pointer;
}
.plan-terms-editor { margin-top: 28px; }

.admin-log-card { padding: clamp(1rem, 3vw, 1.75rem); }

.admin-log-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-log-heading h2 { margin: 0; }
.admin-log-file, .admin-log-note { color: var(--muted); font-size: 0.875rem; }
.admin-log-file { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0 0; }
.admin-log-file code, .admin-log-row code { padding: 0.125rem 0.35rem; border-radius: 0.25rem; background: #f0f3f8; }
.admin-log-health { margin-top: 1.25rem; }
.admin-log-note { margin: 1rem 0 0; }

.admin-log-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem;
}

.admin-log-controls label {
    display: grid;
    gap: 0.25rem;
    color: var(--muted);
    font-size: 0.875rem;
}

.admin-log-clear {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.admin-log-clear-all {
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.admin-log-controls select {
    min-height: 2.375rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid #d2dbea;
    border-radius: 0.55rem;
    background-color: #fff;
    color: inherit;
}

.admin-log-list {
    margin-top: 1rem;
    padding: 0;
    list-style: none;
    border: 1px solid #dce3ed;
    border-radius: 0.75rem;
}

.admin-log-list:empty { display: none; }
.admin-log-list > li + li { border-top: 1px solid #dce3ed; }

.admin-log-row {
    display: grid;
    grid-template-columns: 0.65rem 10rem minmax(0, 1fr) 10.5rem;
    align-items: center;
    gap: 0.45rem 0.9rem;
    padding: 0.8rem 1rem;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.admin-log-row-with-meta { grid-template-columns: 0.65rem 10rem minmax(0, 1fr) minmax(8rem, auto) 10.5rem; }
.admin-log-row::-webkit-details-marker { display: none; }
.admin-log-list > li:first-child summary { border-radius: 0.7rem 0.7rem 0 0; }
.admin-log-list > li:last-child details:not([open]) summary { border-radius: 0 0 0.7rem 0.7rem; }
.admin-log-list > li:only-child details:not([open]) summary { border-radius: 0.7rem; }
.admin-log-row:hover, .admin-log-list details[open] > .admin-log-row { background: #f5f7fb; }

.admin-log-row::before {
    content: '▸';
    color: var(--muted);
}

.admin-log-list details[open] > summary::before { content: '▾'; }
.admin-log-row strong { font-size: 0.95rem; }
.admin-log-row code { display: inline-block; margin-left: 0.25rem; font-size: 0.8rem; }
.admin-log-time, .admin-log-meta { color: var(--muted); font-size: 0.875rem; }
.admin-log-time { font-variant-numeric: tabular-nums; }
.admin-log-label {
    justify-self: end;
    padding: 0.2rem 0.55rem;
    border-radius: 1rem;
    background: #f0f3f8;
    font-size: 0.78rem;
    text-align: center;
}
.admin-log-warning { color: #82500b; }
.admin-log-error { color: #a62323; }
.admin-log-label.admin-log-error { background: #fdecec; }
.admin-log-label.admin-log-warning { background: #fff2d9; }
.admin-log-label.admin-log-success { color: #20674a; background: #e8f5ee; }

.admin-log-detail {
    margin: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid #dce3ed;
    background: #fafbfd;
    overflow-wrap: anywhere;
}

.admin-log-text, .admin-log-payload {
    max-height: 24rem;
    overflow: auto;
    font: 0.875rem/1.6 monospace;
    white-space: pre-wrap;
}

.admin-log-endpoint { margin-top: 0; }
.admin-log-payload { margin: 0.35rem 0 0.65rem; padding: 0.75rem; border: 1px solid #dde4ef; border-radius: 0.5rem; background: #fff; }

.admin-log-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
    gap: 0.75rem 1.5rem;
}

.admin-log-fields { margin: 0.5rem 0; }
.admin-log-fields > div { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; }
.admin-log-fields dt { color: var(--muted); }
.admin-log-fields dd { margin: 0; }
.admin-log-cron-output { margin-top: 1rem; }
.admin-log-cron-output > summary { cursor: pointer; }

.admin-logs-page :is(h1, h2, h3, strong, code, .eyebrow, .tool-tabs a, .button, .admin-log-label) {
    font-weight: 400;
}

@media (max-width: 900px) {
    .admin-log-row, .admin-log-row-with-meta { grid-template-columns: 0.65rem minmax(0, 1fr) auto; }
    .admin-log-row::before { grid-column: 1; grid-row: 1; }
    .admin-log-time { grid-column: 2; grid-row: 1; }
    .admin-log-row strong { grid-column: 2; grid-row: 2; }
    .admin-log-meta { grid-column: 2; grid-row: 3; }
    .admin-log-label { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 420px) {
    .admin-log-row, .admin-log-row-with-meta { grid-template-columns: 0.65rem minmax(0, 1fr); }
    .admin-log-label { grid-column: 2; grid-row: auto; justify-self: start; }
}
