/* /public/assets/css/dashboard.css */

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text: #172033;
    --muted: #718096;
    --line: #e5eaf2;
    --accent: #5b5ce2;
    --accent-hover: #4748c8;
    --success: #16804d;
    --success-bg: #eaf8f0;
    --danger: #b42318;
    --danger-bg: #fff0ef;
    --sidebar-width: 260px;
    --navigator-width: 300px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}.auth-page {
    min-height: 100vh;
    background: #050608;
    color: #edf0f7;
}

.auth-backdrop {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.68);
}

.auth-modal {
    position: relative;
    width: min(100%, 400px);
    padding: 34px 32px 30px;
    border: 1px solid #30323d;
    border-radius: 17px;
    background: #17181f;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.auth-modal h1 {
    margin: 0 0 2px;
    color: #f1f3fa;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    margin: 0 0 24px;
    color: #e2e4eb;
    font-size: 15px;
}

.auth-close {
    position: absolute;
    top: 14px;
    right: 19px;
    color: #8c8e96;
    font-size: 31px;
    font-weight: 300;
    line-height: 1;
    text-decoration: none;
}

.auth-close:hover {
    color: #f1f3fa;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin-bottom: 16px;
}

.auth-tab-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.auth-tab-label {
    padding: 9px;
    border: 1px solid #353742;
    border-radius: 8px;
    color: #777a84;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
}

.auth-tab-input:checked + .auth-tab-label {
    border-color: #f0f1f5;
    color: #f0f1f5;
    font-weight: 700;
}

.auth-tab-input:focus-visible + .auth-tab-label {
    outline: 2px solid #16a7ed;
    outline-offset: 2px;
}

.auth-tab-input:checked ~ #auth-login-identifier {
    /* Поле входа общее: сервер определяет телефон или email по введённому значению. */
}

.auth-modal .form-field {
    margin-bottom: 16px;
}

.auth-modal input {
    height: 43px;
    padding: 10px 13px;
    border-color: #272933;
    border-radius: 8px;
    background: #0b0c11;
    color: #f0f1f5;
}

.auth-modal input::placeholder {
    color: #777983;
}

.auth-modal input:focus {
    border-color: #16a7ed;
    box-shadow: 0 0 0 3px rgba(22, 167, 237, 0.16);
}

.auth-submit {
    width: 100%;
    padding: 13px 16px;
    border: 0;
    border-radius: 8px;
    background: #0ca6ed;
    box-shadow: 0 8px 18px rgba(12, 166, 237, 0.22);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.auth-submit:hover {
    background: #0498dc;
}

.auth-switch {
    margin: 22px 0 0;
    color: #d6d8e0;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.auth-switch a,
.auth-link-button {
    color: inherit;
    font-weight: 800;
    text-decoration: none;
}

.auth-errors,
.auth-message {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(244, 89, 89, 0.12);
    color: #ffaaa6;
    font-size: 13px;
    line-height: 1.4;
}

.auth-message {
    background: rgba(12, 166, 237, 0.13);
    color: #9bdcff;
}

.auth-errors p {
    margin: 0;
}

.auth-errors p + p {
    margin-top: 5px;
}

.auth-resend-form {
    margin-top: 17px;
    text-align: center;
}

.auth-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

@media (max-width: 480px) {
    .auth-backdrop {
        padding: 16px;
    }

    .auth-modal {
        padding: 31px 24px 26px;
    }
}

a {
    color: inherit;
}

.app {
    display: grid;
    min-height: 100vh;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--navigator-width);
}

.sidebar {
    padding: 24px 16px;
    border-right: 1px solid var(--line);
    background: var(--surface);
}

.sidebar-right {
    border-right: 0;
    border-left: 1px solid var(--line);
}

.brand {
    display: block;
    margin: 0 10px 34px;
    color: var(--text);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.7px;
    text-decoration: none;
}

.brand span {
    color: var(--accent);
}

.menu-title {
    margin: 0 10px 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.menu {
    display: grid;
    gap: 4px;
    margin-bottom: 28px;
}

.menu a {
    padding: 11px 12px;
    border-radius: 10px;
    color: #4b5a70;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.menu a.active,
.menu a:hover {
    background: #efefff;
    color: var(--accent);
}

.workspace {
    min-width: 0;
    padding: 32px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-model-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.ai-model-switch label {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.ai-model-switch select {
    width: auto;
    min-width: 96px;
    padding: 6px 28px 6px 8px;
    font-size: 13px;
}

.ai-model-switch .button {
    padding: 7px 10px;
    font-size: 13px;
}

.theme-toggle {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.theme-toggle:hover {
    background: var(--surface-muted);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101827;
    --surface: #182235;
    --surface-muted: #202d42;
    --text: #edf2f7;
    --muted: #a9b7ca;
    --line: #324158;
    --accent: #8b8df7;
    --accent-hover: #a5a7ff;
    --success: #68d391;
    --success-bg: #153d2c;
    --danger: #feb2b2;
    --danger-bg: #4a2024;
}

html[data-theme="dark"] .menu a,
html[data-theme="dark"] .tree-item,
html[data-theme="dark"] .tree-part {
    color: #c2cede;
}

html[data-theme="dark"] .menu a.active,
html[data-theme="dark"] .menu a:hover,
html[data-theme="dark"] .navigator-action-link {
    background: #25265a;
    color: #b7b9ff;
}

html[data-theme="dark"] .project.selected,
html[data-theme="dark"] .navigator-action-link:hover {
    background: #24294b;
}

html[data-theme="dark"] .project:hover {
    border-color: #6668d8;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    border-color: var(--line);
    background: var(--surface-muted);
    color: var(--text);
}

html[data-theme="dark"] .status {
    background: #2b3a51;
    color: #c7d2e2;
}

html[data-theme="dark"] .navigator-next-step,
html[data-theme="dark"] .profile-note {
    background: var(--surface-muted);
    color: #c2cede;
}

html[data-theme="dark"] .page-loader {
    background: rgba(16, 24, 39, 0.78);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: 28px;
    letter-spacing: -0.7px;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.user-chip {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 15px;
    border-radius: 10px;
    font-size: 14px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert ul {
    margin: 0;
    padding-left: 18px;
}.dashboard-notifications {
    position: fixed;
    z-index: 200;
    top: 20px;
    right: 20px;
    display: grid;
    width: min(420px, calc(100vw - 32px));
    gap: 10px;
    pointer-events: none;
}

.dashboard-notification {
    padding: 13px 15px;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(23, 32, 51, 0.16);
    font-size: 14px;
    line-height: 1.5;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.dashboard-notification.is-success {
    background: var(--success-bg);
    color: var(--success);
}

.dashboard-notification.is-error {
    background: var(--danger-bg);
    color: var(--danger);
}

.dashboard-notification.is-hidden {
    opacity: 0;
}

.dashboard-notification ul {
    margin: 0;
    padding-left: 18px;
}

@media (max-width: 820px) {
    .dashboard-notifications {
        top: auto;
        right: 16px;
        bottom: 16px;
        left: 16px;
        width: auto;
    }

    .dashboard-notification {
        padding: 15px 16px;
        box-shadow: 0 14px 32px rgba(23, 32, 51, 0.28);
        font-size: 15px;
    }
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}.neurocoin-test-panel {
    margin-bottom: 20px;
}

.neurocoin-package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.neurocoin-package {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-muted);
}

.neurocoin-package h3 {
    margin: 0 0 7px;
    font-size: 16px;
}

.neurocoin-package p,
.neurocoin-test-sale p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.neurocoin-package-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.neurocoin-package-meta strong {
    font-size: 15px;
}

.neurocoin-package-meta span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.neurocoin-test-sales {
    display: grid;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.neurocoin-test-sale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-muted);
}

.neurocoin-test-sale p {
    margin-top: 4px;
}

.neurocoin-test-sale-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 640px) {
    .neurocoin-test-sale {
        align-items: flex-start;
        flex-direction: column;
    }
}

.card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.card-header h2 {
    margin: 0;
    font-size: 17px;
}

.card-body {
    padding: 20px;
}

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.project {
    display: flex;
    min-height: 178px;
    flex-direction: column;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.project:hover {
    border-color: #bbbdf9;
    box-shadow: 0 8px 20px rgba(23, 32, 51, 0.08);
    transform: translateY(-1px);
}

.project.selected {
    border-color: var(--accent);
    background: #f9f9ff;
    box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.1);
}

.project-title {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.project-premise {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.project-meta,
.project-style {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.project-meta {
    margin-top: auto;
}

.project-style {
    margin-top: 7px;
}

.status {
    display: inline-flex;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 99px;
    background: #edf0f5;
    color: #536276;
    font-size: 11px;
    font-weight: 700;
}

.form-field {
    display: grid;
    gap: 7px;
    margin-bottom: 15px;
}

label {
    color: #4b5a70;
    font-size: 13px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #d8e0eb;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 14px;
}

textarea {
    min-height: 94px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.12);
}

.button {
    padding: 10px 14px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

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

.button-danger {
    background: var(--danger);
}

.button-danger:hover {
    background: #8f1d14;
}

.button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.button-loader {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -2px;
    animation: button-loader-spin 0.7s linear infinite;
}

.page-loader {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(245, 247, 251, 0.72);
}

.page-loader.is-visible {
    display: flex;
}

.page-loader-indicator {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 14px 17px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(23, 32, 51, 0.14);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.page-loader-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(91, 92, 226, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: button-loader-spin 0.7s linear infinite;
}

@keyframes button-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

.empty {
    padding: 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.project-overview {
    padding: 20px;
    border-bottom: 1px solid var(--line);
}

.project-overview h2 {
    margin-bottom: 8px;
    font-size: 21px;
}

.project-overview p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.profile-note {
    margin-top: 14px;
    padding: 11px 12px;
    border-radius: 9px;
    background: var(--surface-muted);
    color: #536276;
    font-size: 13px;
    line-height: 1.45;
}

.profile-note strong {
    color: var(--text);
}

.project-settings {
    border-top: 1px solid var(--line);
}

.project-settings summary {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 18px 20px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.project-settings summary::-webkit-details-marker {
    display: none;
}

.project-settings summary::after {
    margin-left: auto;
    content: "⌄";
    font-size: 18px;
    line-height: 1;
}

.project-settings[open] summary::after {
    content: "⌃";
}

.project-settings-content {
    border-top: 1px solid var(--line);
}

.collapsible-section > summary {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 18px 20px;
    border-top: 1px solid var(--line);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.collapsible-section > summary::-webkit-details-marker {
    display: none;
}

.collapsible-section > summary::after {
    margin-left: auto;
    content: "⌄";
    font-size: 18px;
    line-height: 1;
}

.collapsible-section[open] > summary::after {
    content: "⌃";
}

.structure-options {
    display: grid;
    gap: 14px;
}

.structure-option {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-muted);
}

.structure-option h3 {
    margin-bottom: 8px;
    font-size: 15px;
}

.structure-option p {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.structure-option-part {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.structure-option-part strong {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

.structure-option-chapters {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}.structure-option-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.button-secondary {
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
}

.button-secondary:hover {
    background: #efefff;
}

html[data-theme="dark"] .button-secondary:hover {
    background: #25265a;
}

.character-card-details {
    margin-top: 12px;
}

.character-card-details > summary {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.character-card-details-content {
    margin-top: 12px;
}

.scene-draft-versions {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.scene-draft-version {
    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.scene-draft-content {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    text-indent: 0;
    white-space: normal;
}.scene-draft-content p {
    margin: 0 0 8px;
    text-indent: 1.2em;
}

.scene-draft-content p:last-child {
    margin-bottom: 0;
}.has-text-block-navigation {
    position: relative;
    padding-right: 42px;
}

.text-block-navigation-button {
    position: absolute;
    right: 0;
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--accent);
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.text-block-navigation-button-down {
    top: 0;
}

.text-block-navigation-button-up {
    bottom: 0;
}

.text-block-navigation-button:hover {
    border-color: var(--accent);
    background: var(--surface-muted);
}

@media (max-width: 820px) {
    .has-text-block-navigation {
        padding-right: 36px;
    }

    .text-block-navigation-button {
        width: 28px;
        height: 28px;
    }
}

.character-card-description {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.generation-status {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.generation-status.error {
    color: var(--danger);
}

.generation-status.is-pending,
.navigator-action-note.is-pending {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-loader {
    display: inline-block;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border: 2px solid rgba(91, 92, 226, 0.22);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: button-loader-spin 0.7s linear infinite;
}

.navigator-toggle {
    display: none;
}

.navigator-heading {
    margin: 0 10px 22px;
    font-size: 18px;
}

.navigator-project {
    margin: -8px 10px 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.tree {
    display: grid;
    gap: 3px;
}

.tree-item,
.tree-part {
    padding: 9px 10px;
    border-radius: 8px;
    color: #46556b;
    font-size: 13px;
}

.tree-part {
    font-weight: 700;
}

.tree-chapters {
    display: grid;
    gap: 2px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}

.tree-chapter {
    padding: 7px 8px;
    color: var(--muted);
    font-size: 13px;
}

/* В правом навигаторе остаётся компактная структура и состояние планирования. */
.sidebar-right .tree-chapter > form,
.sidebar-right .tree-chapter > details {
    display: none;
}

/* Кнопка после сообщения об ошибке повторно ставит план главы в очередь. */
.sidebar-right .tree-chapter > .navigator-action-note + form {
    display: inline-block;
    margin-top: 7px;
}

.sidebar-right .tree-chapter > .navigator-action-note + form .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #bbbdf9;
    border-radius: 7px;
    background: #f9f9ff;
    color: transparent;
    font-size: 0;
    line-height: 1;
}

.sidebar-right .tree-chapter > .navigator-action-note + form .button::after {
    color: var(--accent);
    content: "↻";
    font-size: 17px;
    font-weight: 700;
}

.sidebar-right .tree-chapter > .navigator-action-note + form .button:hover {
    background: #efefff;
}

html[data-theme="dark"] .sidebar-right .tree-chapter > .navigator-action-note + form .button {
    border-color: #6668d8;
    background: #25265a;
}

html[data-theme="dark"] .sidebar-right .tree-chapter > .navigator-action-note + form .button::after {
    color: #b7b9ff;
}

/* Ручные формы и отображение сцен отключены до следующих этапов. */
.navigator-actions {
    display: grid;
    gap: 10px;
    margin: 26px 10px 0;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.navigator-actions .button {
    width: 100%;
}

.navigator-action-note {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.navigator-action-link {
    display: block;
    padding: 10px;
    border: 1px solid #bbbdf9;
    border-radius: 9px;
    background: #f9f9ff;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.navigator-action-link:hover {
    background: #efefff;
}

.navigator-next-step {
    padding: 11px 12px;
    border-radius: 9px;
    background: var(--surface-muted);
    color: #536276;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.tree-chapter a {
    color: inherit;
    text-decoration: none;
}

.tree-chapter a:hover {
    color: var(--accent);
}

.manuscript-body {
    margin: 0 auto;
    padding: 36px clamp(20px, 6vw, 72px);
    max-width: 900px;
}

.manuscript-chapter {
    scroll-margin-top: 24px;
}

.manuscript-chapter + .manuscript-chapter {
    margin-top: 48px;
}

.manuscript-chapter h2 {
    margin: 0 0 28px;
    font-size: 21px;
    line-height: 1.35;
}

.manuscript-scene {
    scroll-margin-top: 24px;
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.65;
}

.manuscript-scene + .manuscript-scene {
    margin-top: 28px;
}

.manuscript-scene p {
    margin: 0 0 8px;
    text-indent: 1.2em;
}

.manuscript-scene p:last-child {
    margin-bottom: 0;
}

.manuscript-scene .manuscript-scene-missing {
    color: var(--danger);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    text-indent: 0;
}

.manuscript-part-divider {
    margin: 56px 0;
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    letter-spacing: 0.18em;
    text-align: center;
}@media (min-width: 821px) {
    .sidebar:not(.sidebar-right) {
        position: sticky;
        top: 0;
        align-self: start;
        height: 100vh;
        overflow-y: auto;
    }
}

.page-header {
    position: sticky;
    z-index: 10;
    top: 0;
    margin: -32px -32px 28px;
    padding: 32px 32px 20px;
    background: var(--bg);
}

@media (min-width: 1181px) {
    .sidebar-right {
        align-self: start;
    }
}@media (min-width: 1181px) {
    .sidebar-right {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }
}@media (max-width: 1180px) {
    .app {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .sidebar-right {
        position: fixed;
        z-index: 20;
        top: 0;
        right: 0;
        bottom: 0;
        display: block;
        width: min(310px, calc(100vw - 44px));
        overflow-y: auto;
        border-left: 1px solid var(--line);
        box-shadow: -12px 0 30px rgba(23, 32, 51, 0.12);
        transform: translateX(100%);
        transition: transform 0.2s ease;
    }

    .sidebar-right.is-open {
        transform: translateX(0);
    }

    .navigator-toggle {
        position: fixed;
        z-index: 21;
        top: 50%;
        right: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 82px;
        padding: 0;
        border: 1px solid var(--line);
        border-right: 0;
        border-radius: 12px 0 0 12px;
        background: var(--surface);
        color: var(--accent);
        font-size: 20px;
        font-weight: 800;
        cursor: pointer;
        transform: translateY(-50%);
        box-shadow: -4px 4px 14px rgba(23, 32, 51, 0.08);
    }

    .navigator-toggle.is-open {
        right: min(310px, calc(100vw - 44px));
    }
}

.tariffs-card {
    max-width: 1040px;
}

.tariffs-note {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

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

.tariffs-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.tariffs-table th,
.tariffs-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.tariffs-table th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tariffs-table td {
    color: var(--text);
    font-size: 14px;
}

.tariffs-table code {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

.tariff-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px dashed var(--accent);
    color: var(--text);
    font-weight: 700;
    cursor: help;
    outline: none;
}

.tariff-title::after {
    width: 15px;
    height: 15px;
    border: 1px solid currentColor;
    border-radius: 50%;
    color: var(--accent);
    content: "?";
    font-size: 10px;
    font-weight: 800;
    line-height: 13px;
    text-align: center;
}

.tariff-title::before {
    position: absolute;
    z-index: 5;
    bottom: calc(100% + 9px);
    left: 0;
    width: min(330px, 70vw);
    padding: 10px 12px;
    border-radius: 8px;
    background: #172033;
    color: #fff;
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    visibility: hidden;
}

.tariff-title:hover::before,
.tariff-title:focus-visible::before {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.tariff-title:focus-visible {
    border-radius: 3px;
    box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.15);
}

.tariff-cost {
    color: var(--accent) !important;
    font-size: 15px !important;
    font-weight: 800;
    white-space: nowrap;
}@media (max-width: 820px) {
    .app {
        display: block;
    }

    .sidebar:not(.sidebar-right) {
        position: sticky;
        z-index: 11;
        top: 0;
        padding: 16px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        background: var(--surface);
    }

    .brand {
        margin: 0 0 16px;
    }

    .menu {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-bottom: 0;
    }

    .menu-title {
        display: none;
    }

    .workspace {
        padding: 20px 14px;
    }.workspace {
        padding: 20px 14px;
    }

    .page-header {
        margin: -20px -14px 20px;
        padding: 20px 14px 14px;
    }

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

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

    .page-header {
        gap: 12px;
    }

    .user-chip {
        display: none;
    }
}