body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #eef2f5;
    color: #172b3a;
}

.topbar {
    height: 132px;
    background: #172b3a;
    border-bottom: 4px solid #a7afb7;
}

.topbar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
    padding-left: 64px;
    box-sizing: border-box;
}

.top-logo {
    width: 86px;
    height: 86px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
}

.brand {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1;
    color: #ffffff;
}

.subtitle {
    margin-top: 12px;
    color: #eef3f7;
    font-size: 16px;
    white-space: nowrap;
}

.container {
    padding: 54px 0 0 64px;
}

.hero {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #d7dde3;
    border-radius: 8px;
    width: 760px;
    min-height: 330px;
    padding: 58px 64px 44px;
    box-shadow: 0 8px 24px rgba(23, 43, 58, 0.10);
    box-sizing: border-box;
}

.hero h1 {
    font-size: 64px;
    line-height: 1;
    margin: 0;
    color: #172b3a;
    letter-spacing: 4px;
    font-weight: 800;
}

.accent-line {
    width: 64px;
    height: 4px;
    background: #8fa1b2;
    border-radius: 2px;
    margin: 28px 0 24px;
}

.hero p {
    font-size: 22px;
    line-height: 1.45;
    color: #566474;
    margin: 0;
}

.divider {
    margin: 30px 0 28px;
    border-top: 1px solid #d9dee3;
}

.actions {
    display: flex;
    gap: 28px;
}

button {
    background: #172b3a;
    color: white;
    border: 0;
    padding: 14px 24px;
    border-radius: 5px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(23, 43, 58, 0.22);
}

button.secondary {
    background: #6f7b86;
}

.button {
    display: inline-block;
    text-decoration: none;
    background: #172b3a;
    color: white;
    border: 0;
    padding: 14px 24px;
    border-radius: 5px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(23, 43, 58, 0.22);
}

.button.secondary {
    background: #6f7b86;
}

.form-card {
    background: white;
    border: 1px solid #d7dde3;
    border-radius: 8px;
    width: 720px;
    padding: 46px 56px;
    box-shadow: 0 8px 24px rgba(23, 43, 58, 0.10);
}

.form-card h1 {
    margin: 0 0 30px;
    font-size: 42px;
    color: #172b3a;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #172b3a;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #cbd3dc;
    border-radius: 5px;
    font-size: 16px;
}

.case-card {
    padding: 20px 0;
}

.case-card strong {
    font-size: 22px;
    color: #172b3a;
}

.scroll-target {
    scroll-margin-top: 24px;
}

.workspace-entry {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid #cbd7e2;
    border-radius: 8px;
    background: #f3f7fa;
}

.workspace-entry h3 {
    margin: 0 0 8px;
}

.workspace-entry p {
    margin: 0 0 16px;
    line-height: 1.5;
}

.workspace-page {
    width: min(1180px, calc(100vw - 128px));
    padding-bottom: 64px;
}

.workspace-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    color: #5d6b78;
    font-size: 14px;
}

.back-link {
    color: #172b3a;
    text-decoration: none;
    font-weight: 700;
}

.workspace-card {
    background: #ffffff;
    border: 1px solid #d7dde3;
    border-radius: 10px;
    padding: 30px 34px;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(23, 43, 58, 0.08);
}

.workspace-card h1,
.workspace-card h2,
.workspace-card h3 {
    color: #172b3a;
}

.workspace-card h1 {
    margin: 0 0 10px;
    font-size: 38px;
}

.workspace-card h2 {
    margin: 0 0 18px;
}

.workspace-lead {
    margin: 0 0 28px;
    color: #536270;
    font-size: 18px;
    line-height: 1.5;
}

.workspace-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.workspace-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}

.workspace-fieldset legend {
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 18px;
}

.target-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.target-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 12px 14px;
    border: 1px solid #cbd3dc;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    box-sizing: border-box;
}

.target-option:has(input:checked) {
    border-color: #547b9c;
    background: #edf5fb;
    box-shadow: inset 0 0 0 1px #547b9c;
}

.target-option input {
    width: auto;
    margin: 0;
}

.field-hint,
.workspace-muted {
    margin-top: 8px;
    color: #6a7783;
    font-size: 14px;
    line-height: 1.45;
}

.workspace-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.eyebrow {
    margin-bottom: 6px;
    color: #6c7a86;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.new-materials {
    margin-bottom: 22px;
    padding: 12px 14px;
    border-left: 4px solid #8098aa;
    background: #f5f8fa;
    line-height: 1.45;
}

.result-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 18px;
}

.result-block {
    padding: 20px;
    border: 1px solid #dbe3ea;
    border-radius: 8px;
    background: #f8fafc;
}

.result-block h3 {
    margin: 0 0 12px;
}

.result-block ul,
.result-block ol {
    margin: 0;
    padding-left: 22px;
}

.result-block li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.evidence-gaps {
    margin-top: 18px;
}

.draft-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.draft-actions form {
    margin: 0;
}

.draft-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 18px;
}

.draft-header h2 {
    margin: 0;
}

@media (max-width: 900px) {
    .workspace-page {
        width: auto;
        margin-right: 24px;
    }

    .target-grid,
    .result-grid {
        grid-template-columns: 1fr;
    }

    .workspace-topline,
    .draft-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Единый крупный текст рабочей комнаты и проектов документов */
.workspace-page {
    font-size: 18px;
    line-height: 1.55;
}

.workspace-card p,
.workspace-card li,
.workspace-card label,
.workspace-card input,
.workspace-card select,
.workspace-card textarea,
.workspace-card button,
.workspace-card .button,
.workspace-card .field-hint,
.workspace-card .workspace-muted,
.workspace-card .new-materials,
.workspace-card .draft-body {
    font-size: 18px;
}

.result-block li,
.new-materials,
.draft-body {
    line-height: 1.6;
}

.draft-body {
    margin: 0;
    font-family: Arial, sans-serif;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #172b3a;
}

.workspace-topline {
    font-size: 16px;
}

/* Читаемое отображение рабочих документов: не полотно, а разделы и тезисы */
.draft-result {
    overflow: hidden;
}

.draft-body {
    max-width: 980px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    font-size: 18px;
    line-height: 1.55;
    white-space: normal;
    color: #172b3a;
}

.draft-section-title {
    margin: 30px 0 14px;
    padding: 0 0 9px;
    border-bottom: 1px solid #d7e0e7;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 800;
}

.draft-section-title:first-child {
    margin-top: 0;
}

.draft-bullet {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    column-gap: 8px;
    align-items: start;
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.55;
}

.draft-bullet-mark {
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
}

.draft-question {
    margin: 18px 0 8px;
    padding: 13px 16px;
    border-left: 4px solid #547b9c;
    border-radius: 0 7px 7px 0;
    background: #edf4f8;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 800;
}

.draft-answer {
    margin: 0 0 18px 18px;
    padding: 12px 16px;
    border: 1px solid #d9e2e8;
    border-radius: 7px;
    background: #ffffff;
    font-size: 18px;
    line-height: 1.55;
}

.draft-paragraph {
    margin: 14px 0;
    font-size: 18px;
    line-height: 1.55;
}

.draft-numbered {
    margin: 14px 0;
    padding-left: 1.8em;
    text-indent: -1.8em;
    font-size: 18px;
    line-height: 1.55;
    font-weight: 400;
}

.draft-spacer {
    height: 10px;
}

@media (max-width: 900px) {
    .draft-body {
        max-width: none;
    }

    .draft-section-title {
        font-size: 20px;
    }
}


/* Матрица доказывания: читаемые карточки вместо текстовой псевдотаблицы */
.evidence-matrix {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.evidence-matrix-row {
    overflow: hidden;
    border: 1px solid #cbd7e2;
    border-radius: 10px;
    background: #f8fafc;
    box-shadow: 0 4px 14px rgba(23, 43, 58, 0.07);
}

.evidence-matrix-thesis {
    padding: 20px 22px;
    border-bottom: 1px solid #cbd7e2;
    background: #eaf2f7;
}

.matrix-row-number {
    margin-bottom: 6px;
    color: #587187;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.evidence-matrix-thesis h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.35;
}

.evidence-matrix-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.matrix-cell {
    min-width: 0;
    padding: 18px 22px 20px;
    border-right: 1px solid #d8e1e8;
    border-bottom: 1px solid #d8e1e8;
    background: #ffffff;
}

.matrix-cell:nth-child(2n) {
    border-right: 0;
}

.matrix-cell:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.matrix-cell-existing {
    background: #f7fbf8;
}

.matrix-cell-missing {
    background: #fffaf2;
}

.matrix-cell-action {
    background: #f4f8fb;
}

.matrix-cell-label {
    margin-bottom: 8px;
    color: #526879;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 800;
    text-transform: uppercase;
}

.matrix-cell-text {
    font-size: 18px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .evidence-matrix-grid {
        grid-template-columns: 1fr;
    }

    .matrix-cell,
    .matrix-cell:nth-child(2n),
    .matrix-cell:nth-last-child(-n + 2) {
        border-right: 0;
        border-bottom: 1px solid #d8e1e8;
    }

    .matrix-cell:last-child {
        border-bottom: 0;
    }
}

/* PARUS Universal Workspace v1 */
.analysis-summary {
    margin: 22px 0;
    padding: 22px 24px;
    border-left: 5px solid #456f8f;
    border-radius: 8px;
    background: #edf4f8;
}

.analysis-summary h3 {
    margin-top: 0;
}

.analysis-summary p:last-child {
    margin-bottom: 0;
}

.source-grid {
    align-items: stretch;
}

.fact-list {
    margin: 0;
    padding-left: 24px;
}

.fact-list li {
    margin-bottom: 16px;
}

.fact-source {
    margin-top: 5px;
    color: #557084;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.fact-note {
    margin-top: 5px;
    color: #344f62;
    font-size: 16px;
}

.user-facts-block {
    background: #fffaf1;
}

.conclusion-list li {
    margin-bottom: 14px;
}

.status-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e8eef3;
    color: #455d70;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.conclusion-supported {
    border-left: 4px solid #4d8a61;
    padding-left: 12px;
}

.conclusion-conditional {
    border-left: 4px solid #c38a2a;
    padding-left: 12px;
}

.conclusion-hypothesis {
    border-left: 4px solid #8a6a9f;
    padding-left: 12px;
}

.compact-grid {
    margin-top: 20px;
}

.risk-block {
    background: #fff8f4;
}

.limitation-block {
    background: #f8f8fa;
}

.next-actions-block {
    margin-top: 20px;
    background: #f3f8f4;
}

.workspace-details {
    margin-top: 20px;
    border: 1px solid #d2dde5;
    border-radius: 8px;
    background: #ffffff;
}

.workspace-details summary {
    cursor: pointer;
    padding: 15px 18px;
    font-weight: 800;
}

.details-body {
    padding: 0 18px 18px;
}

.issue-card {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid #dde5ea;
    border-radius: 7px;
    background: #f9fbfc;
}

.issue-card p {
    margin: 7px 0;
}

.document-builder-form {
    margin-top: 20px;
}

.document-builder-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.document-options {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.check-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid #d4dee6;
    border-radius: 7px;
    background: #f8fafb;
}

.check-option input {
    width: auto;
    margin-top: 4px;
}

.compact-select {
    max-width: 480px;
}

.review-details {
    margin-bottom: 22px;
    background: #fffaf0;
}

.universal-matrix .evidence-matrix-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
    .document-builder-grid,
    .universal-matrix .evidence-matrix-grid {
        grid-template-columns: 1fr;
    }

    .status-badge {
        display: block;
        width: fit-content;
        margin: 7px 0 0;
    }
}


/* PARUS start presentation */
.parus-intro {
    width: min(1180px, calc(100vw - 128px));
    padding-bottom: 72px;
}

.parus-intro-hero {
    max-width: 1020px;
    padding: 58px 62px;
    border: 1px solid #d7dde3;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 32px rgba(23, 43, 58, 0.10);
    box-sizing: border-box;
}

.parus-intro-kicker {
    margin-bottom: 18px;
    color: #587187;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.parus-intro-hero h1 {
    max-width: 900px;
    margin: 0;
    color: #172b3a;
    font-size: 48px;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.parus-intro-lead {
    max-width: 850px;
    margin: 26px 0 0;
    color: #536270;
    font-size: 21px;
    line-height: 1.55;
}

.parus-intro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 34px;
}

.parus-primary-action {
    padding-left: 28px;
    padding-right: 28px;
}

.parus-capabilities,
.parus-workflow {
    margin-top: 48px;
}

.parus-section-heading {
    margin-bottom: 22px;
}

.parus-section-heading h2 {
    margin: 0;
    color: #172b3a;
    font-size: 32px;
    line-height: 1.25;
}

.parus-capability-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.parus-capability-card {
    position: relative;
    min-height: 210px;
    padding: 28px 30px;
    border: 1px solid #d7e0e7;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(23, 43, 58, 0.06);
    box-sizing: border-box;
}

.parus-capability-number {
    margin-bottom: 18px;
    color: #7890a3;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.parus-capability-card h3 {
    margin: 0 0 12px;
    color: #172b3a;
    font-size: 24px;
    line-height: 1.25;
}

.parus-capability-card p {
    margin: 0;
    color: #596877;
    font-size: 17px;
    line-height: 1.55;
}

.parus-principle {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
    margin-top: 48px;
    padding: 36px 40px;
    border-radius: 10px;
    background: #172b3a;
    color: #ffffff;
}

.parus-principle-mark {
    padding-top: 4px;
    color: #b9c9d6;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.parus-principle h2 {
    margin: 0 0 14px;
    color: #ffffff;
    font-size: 30px;
    line-height: 1.25;
}

.parus-principle p {
    max-width: 800px;
    margin: 0;
    color: #e0e8ee;
    font-size: 18px;
    line-height: 1.55;
}

.parus-command-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.parus-command-examples span {
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    font-size: 15px;
}

.parus-workflow-list {
    overflow: hidden;
    border: 1px solid #d7e0e7;
    border-radius: 10px;
    background: #ffffff;
}

.parus-workflow-step {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 18px;
    padding: 24px 30px;
    border-bottom: 1px solid #e0e6eb;
}

.parus-workflow-step:last-child {
    border-bottom: 0;
}

.parus-step-number {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e9f0f5;
    color: #29485f;
    font-size: 17px;
    font-weight: 800;
}

.parus-workflow-step h3 {
    margin: 1px 0 7px;
    color: #172b3a;
    font-size: 20px;
}

.parus-workflow-step p {
    margin: 0;
    color: #5e6d79;
    font-size: 16px;
    line-height: 1.5;
}

.parus-source-note {
    margin-top: 28px;
    padding: 20px 24px;
    border-left: 5px solid #8098aa;
    border-radius: 7px;
    background: #f5f8fa;
    color: #4e606e;
    font-size: 16px;
    line-height: 1.55;
}

.parus-final-action {
    display: flex;
    justify-content: space-between;
    gap: 36px;
    align-items: center;
    margin-top: 32px;
    padding: 30px 34px;
    border: 1px solid #d7dde3;
    border-radius: 10px;
    background: #ffffff;
}

.parus-final-action h2 {
    margin: 0 0 7px;
    color: #172b3a;
    font-size: 28px;
}

.parus-final-action p {
    margin: 0;
    color: #65727e;
    font-size: 16px;
}

.parus-final-action .parus-intro-actions {
    margin-top: 0;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .parus-intro {
        width: auto;
        margin-right: 24px;
    }

    .parus-intro-hero {
        padding: 40px 34px;
    }

    .parus-intro-hero h1 {
        font-size: 38px;
    }

    .parus-capability-grid {
        grid-template-columns: 1fr;
    }

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

    .parus-final-action {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 620px) {
    .parus-intro-hero {
        padding: 32px 24px;
    }

    .parus-intro-hero h1 {
        font-size: 32px;
    }

    .parus-intro-lead {
        font-size: 18px;
    }

    .parus-workflow-step {
        grid-template-columns: 44px minmax(0, 1fr);
        padding: 20px;
    }
}

/* PARUS Workspace: ожидание ответа и переход к последнему ходу */

#workspace-turn-latest {
    scroll-margin-top: 24px;
}

body.parus-working-open {
    overflow: hidden;
}

.parus-working-overlay[hidden] {
    display: none;
}

.parus-working-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(23, 43, 58, 0.62);
    backdrop-filter: blur(3px);
}

.parus-working-card {
    width: min(520px, calc(100vw - 48px));
    padding: 38px 42px 34px;
    box-sizing: border-box;
    border: 1px solid #d7e0e7;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.parus-working-brand {
    margin-bottom: 22px;
    color: #587187;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.parus-working-spinner {
    width: 58px;
    height: 58px;
    margin: 0 auto 24px;
    box-sizing: border-box;
    border: 6px solid #dbe4ea;
    border-top-color: #172b3a;
    border-radius: 50%;
    animation: parus-working-spin 0.9s linear infinite;
}

.parus-working-card h2 {
    margin: 0 0 12px;
    color: #172b3a;
    font-size: 27px;
    line-height: 1.25;
}

.parus-working-card p {
    margin: 0;
    color: #60707e;
    font-size: 17px;
    line-height: 1.5;
}

.parus-working-progress {
    position: relative;
    overflow: hidden;
    height: 6px;
    margin: 26px 0 18px;
    border-radius: 999px;
    background: #e1e8ed;
}

.parus-working-progress-bar {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 38%;
    border-radius: 999px;
    background: #587187;
    animation: parus-working-progress 1.35s ease-in-out infinite;
}

.parus-working-note {
    color: #7a8791;
    font-size: 14px;
}

.workspace-form button:disabled,
.document-builder-form button:disabled {
    opacity: 0.72;
    cursor: wait;
}

@keyframes parus-working-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes parus-working-progress {
    0% {
        left: -38%;
    }

    50% {
        left: 50%;
    }

    100% {
        left: 100%;
    }
}

@media (max-width: 620px) {
    .parus-working-card {
        padding: 30px 24px 28px;
    }

    .parus-working-card h2 {
        font-size: 23px;
    }
}

/* =========================
   AUTH / ACCOUNT
   ========================= */

.topbar-account {
    margin-left: auto;
    padding-right: 64px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-user {
    text-align: right;
}

.topbar-user-email {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
}

.topbar-user-role {
    margin-top: 5px;
    color: #b9c6d0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.topbar-login,
.topbar-logout {
    display: inline-block;
    box-sizing: border-box;
    padding: 10px 18px;
    border: 1px solid #71818e;
    border-radius: 5px;
    background: transparent;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: none;
}

.topbar-login:hover,
.topbar-logout:hover {
    background: rgba(255, 255, 255, 0.08);
}

.topbar-logout-form {
    margin: 0;
}

.auth-card {
    width: 560px;
}

.auth-kicker {
    margin-bottom: 12px;
    color: #758696;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-lead {
    margin: -12px 0 28px;
    color: #5f6e7b;
    font-size: 17px;
    line-height: 1.55;
}

.auth-message {
    margin: 0 0 22px;
    padding: 12px 14px;
    border: 1px solid #bfcbd4;
    border-radius: 5px;
    background: #f4f7f9;
    color: #344b5d;
    line-height: 1.4;
}

.auth-message.error {
    border-color: #d4a9a9;
    background: #fff4f4;
    color: #8b2f2f;
}

.auth-code-input {
    max-width: 220px;
    font-size: 28px !important;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-align: center;
}

.auth-change-email {
    display: inline-block;
    margin-left: 18px;
    color: #53697b;
    font-size: 14px;
    font-weight: 700;
}

.auth-note {
    margin: 26px 0 0;
    color: #7a8791;
    font-size: 14px;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .topbar-account {
        padding-right: 24px;
    }

    .topbar-user {
        display: none;
    }
}


/* =========================
   ADMIN
   ========================= */

.topbar-admin {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 5px;
    color: #d8e2e9;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.topbar-admin:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.admin-card {
    width: min(1120px, calc(100vw - 80px));
}

.admin-kicker {
    margin-bottom: 10px;
    color: #758696;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-lead,
.admin-empty,
.admin-note {
    color: #667684;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #d9e0e5;
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: #687986;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-link,
.admin-back {
    color: #315a78;
    font-weight: 700;
    text-decoration: none;
}

.admin-link:hover,
.admin-back:hover {
    text-decoration: underline;
}

.admin-back {
    display: inline-block;
    margin-bottom: 18px;
}

.admin-user-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 24px 0 34px;
}

.admin-user-meta > div {
    padding: 14px;
    border: 1px solid #d7e0e6;
    border-radius: 6px;
    background: #f7f9fa;
}

.admin-user-meta span {
    display: block;
    margin-bottom: 5px;
    color: #7a8995;
    font-size: 12px;
}

.admin-user-meta strong {
    color: #1d3445;
    font-size: 14px;
}

.admin-case-list {
    margin-bottom: 34px;
}

.admin-case-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #dce3e8;
}

.admin-case-row small {
    display: block;
    margin-top: 5px;
    color: #7b8994;
}

.admin-case-row form {
    flex: 0 0 auto;
    margin: 0;
}

.admin-case-row button {
    width: auto;
    margin: 0;
}

.admin-secondary-button {
    border: 1px solid #aab7c0 !important;
    background: #ffffff !important;
    color: #425b6d !important;
    box-shadow: none !important;
}

@media (max-width: 850px) {
    .admin-card {
        width: auto;
    }

    .admin-user-meta {
        grid-template-columns: 1fr 1fr;
    }

    .admin-case-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Wallet foundation */
.topbar-user-balance {
    margin-top: 4px;
    color: #d9e6ef;
    font-size: 13px;
}

.wallet-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    margin: 4px 0 28px;
    padding: 16px 18px;
    border: 1px solid #cbd6df;
    border-radius: 7px;
    background: #f5f8fa;
}

.wallet-summary span {
    color: #607484;
    font-size: 14px;
}

.wallet-summary strong {
    color: #172b3a;
    font-size: 22px;
}

.wallet-table .wallet-amount {
    white-space: nowrap;
    font-weight: 700;
}

.wallet-positive {
    color: #1f6b42;
}

.wallet-negative {
    color: #9b2f2f;
}

/* Billing stage 2A */
.billing-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin: 0 0 22px;
}

.billing-summary-grid > div {
    padding: 14px 16px;
    border: 1px solid #d6e0e7;
    border-radius: 7px;
    background: #f7f9fb;
}

.billing-summary-grid span {
    display: block;
    margin-bottom: 6px;
    color: #667b8a;
    font-size: 12px;
}

.billing-summary-grid strong {
    color: #172b3a;
    font-size: 16px;
}

.billing-table-wrap {
    margin-bottom: 28px;
}

.billing-event-table small {
    display: block;
    margin-top: 3px;
    color: #6e808d;
    font-size: 11px;
}

.billing-event-table td {
    vertical-align: top;
}

/* Balance gate + admin adjustments */
.billing-blocked-alert {
    margin: 0 0 22px;
    padding: 15px 18px;
    border: 1px solid #d3a2a2;
    border-radius: 7px;
    background: #fff4f4;
    color: #7a2424;
    line-height: 1.45;
}

.admin-wallet-form {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(260px, 1.6fr) auto;
    gap: 12px;
    align-items: end;
    margin: 0 0 10px;
}

.admin-wallet-form label {
    display: grid;
    gap: 6px;
    color: #536879;
    font-size: 13px;
}

.admin-wallet-form input,
.admin-wallet-form select {
    width: 100%;
    box-sizing: border-box;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #bccbd6;
    border-radius: 5px;
    background: #fff;
    color: #172b3a;
    font: inherit;
}

.admin-wallet-form button {
    min-height: 40px;
    white-space: nowrap;
}

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

/* Monetization / payments */
.case-list-actions,
.admin-heading-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.secondary-button {
    background: #526878;
}
.payment-card {
    max-width: 860px;
}
.payment-lead,
.payment-note {
    color: #607484;
    line-height: 1.55;
}
.topup-form,
.receipt-form {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
    margin: 22px 0;
}
.topup-form label,
.receipt-form label {
    display: grid;
    gap: 7px;
    min-width: 280px;
    flex: 1;
}
.topup-form input,
.receipt-form input,
.payment-review-form input {
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #b9c8d3;
    border-radius: 6px;
    font: inherit;
}
.payment-amount {
    margin: 20px 0;
    font-size: 20px;
}
.payment-amount strong {
    font-size: 28px;
    color: #102c3d;
}
.payment-steps {
    line-height: 1.7;
    padding-left: 24px;
}
.payment-qr-wrap {
    display: flex;
    justify-content: center;
    margin: 22px 0;
}
.payment-qr {
    display: block;
    width: min(430px, 92%);
    height: auto;
    border: 1px solid #d4dde4;
    border-radius: 10px;
    background: white;
}
.payment-success,
.payment-review,
.payment-error {
    padding: 16px 18px;
    border-radius: 7px;
    margin: 18px 0;
    line-height: 1.55;
}
.payment-success {
    background: #edf8f1;
    border: 1px solid #a9d5b8;
    color: #215b37;
}
.payment-review {
    background: #fff8e7;
    border: 1px solid #e4c978;
    color: #6a5313;
}
.payment-error {
    background: #fff0f0;
    border: 1px solid #e0a6a6;
    color: #8f2626;
}
.wide-card {
    max-width: 1500px;
}
.payment-admin-table code,
.payment-success code {
    font-family: Consolas, monospace;
    word-break: break-all;
}
.payment-review-form {
    display: grid;
    gap: 6px;
    margin: 4px 0 10px;
    min-width: 190px;
}
.payment-review-form button {
    width: 100%;
}
.wallet-breakdown-inline {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 8px 0 18px;
    color: #607484;
}
.wallet-breakdown-inline strong {
    color: #172b3a;
}


/* Payment phone transfer + receipt processing */
.payment-recipient-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 22px;
}
.payment-recipient-card > div {
    padding: 14px 16px;
    border: 1px solid #d4dde4;
    border-radius: 7px;
    background: #f7f9fa;
}
.payment-recipient-card span {
    display: block;
    margin-bottom: 6px;
    color: #6d7e8b;
    font-size: 12px;
}
.payment-recipient-card strong {
    display: block;
    color: #172b3a;
    font-size: 17px;
    word-break: break-word;
}
.payment-processing-overlay[hidden] {
    display: none !important;
}
.payment-processing-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(13, 35, 50, 0.58);
}
.payment-processing-card {
    width: min(440px, calc(100vw - 48px));
    box-sizing: border-box;
    padding: 28px 30px;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.24);
    text-align: center;
}
.payment-processing-card strong,
.payment-processing-card span,
.payment-processing-card small {
    display: block;
}
.payment-processing-card strong {
    margin-top: 14px;
    color: #172b3a;
    font-size: 20px;
}
.payment-processing-card span {
    margin-top: 8px;
    color: #526878;
    line-height: 1.45;
}
.payment-processing-card small {
    margin-top: 10px;
    color: #7a8995;
}
.payment-processing-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto;
    border: 4px solid #d8e2e9;
    border-top-color: #17384d;
    border-radius: 50%;
    animation: payment-spin 0.8s linear infinite;
}
body.payment-processing-active {
    overflow: hidden;
}
@keyframes payment-spin {
    to { transform: rotate(360deg); }
}
@media (max-width: 720px) {
    .payment-recipient-card {
        grid-template-columns: 1fr;
    }
}


/* About PARUS */
.about-page {
    max-width: 980px;
    line-height: 1.62;
}
.about-page h1 {
    margin-bottom: 4px;
}
.about-page h2 {
    margin-top: 26px;
    margin-bottom: 12px;
    color: #17384d;
}
.about-page hr {
    margin: 30px 0 8px;
    border: 0;
    border-top: 1px solid #d9e1e6;
}
.about-page li {
    margin: 5px 0;
}
.about-steps li {
    margin: 10px 0;
}


/* Production safety: admin anti-fraud visibility */
.admin-fraud-banner {
    margin: 14px 0 18px;
    padding: 12px 14px;
    border: 1px solid #d6a43a;
    border-radius: 7px;
    background: #fff7e3;
    color: #704d00;
}
.admin-fraud-count {
    color: #a13c24;
    white-space: nowrap;
}

/* Admin economics */
.admin-economics {
    margin-top: 28px;
}

.admin-economics-heading {
    align-items: end;
    margin-bottom: 14px;
}

.admin-economics-heading h2 {
    margin-bottom: 6px;
}

.admin-economics-heading .admin-note {
    margin: 0;
    max-width: 680px;
}

.admin-economics-filter {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.admin-economics-filter label {
    display: grid;
    gap: 5px;
    color: #667b8a;
    font-size: 12px;
    font-weight: 700;
}

.admin-economics-filter input {
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid #c8d3db;
    border-radius: 5px;
    background: #ffffff;
    color: #172b3a;
}

.admin-economics-filter button {
    min-height: 38px;
}

.economics-summary-grid {
    margin-top: 14px;
}

.economics-summary-grid small,
.economics-table small {
    display: block;
    margin-top: 4px;
    color: #71828e;
    font-size: 11px;
}

.economics-positive {
    color: #207044 !important;
}

.economics-negative {
    color: #a02d2d !important;
}

.economics-definition {
    margin-top: -8px;
    margin-bottom: 18px;
    line-height: 1.5;
}

@media (max-width: 760px) {
    .admin-economics-filter {
        width: 100%;
    }

    .admin-economics-filter label,
    .admin-economics-filter input,
    .admin-economics-filter button {
        width: 100%;
    }
}

