/* ===== Дизайн-токены: «Ноктюрн» — тёмная по умолчанию ===== */
:root {
    color-scheme: dark;
    --font-sans: 'Onest', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;

    --bg: #08090d;
    --bg-glow-1: rgba(224, 181, 122, 0.16);
    --bg-glow-2: rgba(110, 181, 168, 0.12);
    --surface: #11141b;
    --surface-2: #181c26;
    --surface-3: #242936;
    --border: rgba(243, 236, 224, 0.07);
    --border-strong: rgba(243, 236, 224, 0.15);
    --text: #f4f0e8;
    --text-2: #a8aeb9;
    --text-3: #6c7280;

    --accent: #e0b57a;
    --accent-2: #c46a4a;
    --accent-soft: rgba(224, 181, 122, 0.14);
    --accent-ink: #1a120c;
    --audio: #6eb5a8;
    --audio-soft: rgba(110, 181, 168, 0.16);
    --gradient: linear-gradient(135deg, #e8c48a 0%, #d47852 72%, #c45a4a 100%);

    --success: #4cc38a;
    --success-soft: rgba(76, 195, 138, 0.14);
    --danger: #f06a6a;
    --danger-soft: rgba(240, 106, 106, 0.14);
    --warning: #f2c14e;
    --warning-soft: rgba(242, 193, 78, 0.13);
    --info: #8eb0ff;
    --info-soft: rgba(142, 176, 255, 0.14);

    --overlay: rgba(4, 5, 8, 0.72);
    --shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.72);
    --shadow-lg: 0 40px 90px -28px rgba(0, 0, 0, 0.82);
    --ring: 0 0 0 3px rgba(224, 181, 122, 0.32);

    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 26px;
    --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
    --grain: 0.03;
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #f4efe6;
    --bg-glow-1: rgba(196, 106, 74, 0.12);
    --bg-glow-2: rgba(80, 140, 132, 0.08);
    --surface: #fffdf8;
    --surface-2: #f3eee4;
    --surface-3: #e7dfd1;
    --border: rgba(42, 32, 18, 0.08);
    --border-strong: rgba(42, 32, 18, 0.16);
    --text: #1c1813;
    --text-2: #5c564c;
    --text-3: #91897c;

    --accent: #b56e3a;
    --accent-2: #9a4536;
    --accent-soft: rgba(181, 110, 58, 0.12);
    --accent-ink: #fffdf8;
    --audio: #3e8a80;
    --audio-soft: rgba(62, 138, 128, 0.12);

    --success: #1f9d63;
    --success-soft: rgba(31, 157, 99, 0.12);
    --danger: #d64545;
    --danger-soft: rgba(214, 69, 69, 0.10);
    --warning: #a07510;
    --warning-soft: rgba(212, 160, 23, 0.14);
    --info: #3d6fd8;
    --info-soft: rgba(61, 111, 216, 0.10);

    --overlay: rgba(28, 22, 14, 0.46);
    --shadow: 0 14px 36px -16px rgba(70, 48, 16, 0.28);
    --shadow-lg: 0 36px 80px -28px rgba(70, 48, 16, 0.36);
    --ring: 0 0 0 3px rgba(181, 110, 58, 0.28);
    --grain: 0.035;
}

/* ===== База ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg);
}

body {
    position: relative;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(920px 560px at 6% -16%, var(--bg-glow-1), transparent 64%),
        radial-gradient(820px 540px at 108% -8%, var(--bg-glow-2), transparent 58%),
        radial-gradient(640px 420px at 70% 120%, rgba(196, 106, 74, 0.06), transparent 70%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 0.35s, color 0.35s;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: var(--grain);
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

a {
    color: inherit;
}

::selection {
    background: var(--accent-soft);
    color: var(--text);
}

:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border: 3px solid transparent;
    border-radius: 99px;
    background-clip: padding-box;
}

::-webkit-scrollbar-track {
    background: transparent;
}

.hidden {
    display: none !important;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

[data-theme="light"] .only-dark,
:root:not([data-theme="light"]) .only-light {
    display: none;
}

/* ===== Кнопки ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.22s var(--ease), box-shadow 0.22s, background 0.22s, color 0.22s, filter 0.22s, border-color 0.22s;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--gradient);
    color: var(--accent-ink);
    box-shadow: 0 12px 28px -12px rgba(196, 106, 74, 0.7);
}

.btn-primary:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 16px 34px -12px rgba(196, 106, 74, 0.8);
}

.btn-ghost {
    background: color-mix(in srgb, var(--surface-2) 88%, transparent);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--border-strong);
}

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

.btn-danger:hover:not(:disabled) {
    background: var(--danger);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-2);
    transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.icon-btn .icon {
    width: 20px;
    height: 20px;
}

/* ===== Поля ввода ===== */
.field,
.profile-field,
.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field label,
.profile-field label,
.form-group label {
    font-size: 12.5px;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-2);
}

.field input,
.field select,
.field textarea,
.profile-field input,
.profile-field select,
.profile-field textarea,
.form-group input,
.form-group select {
    width: 100%;
    padding: 13px 15px;
    font-size: 15px;
    color: var(--text);
    background: color-mix(in srgb, var(--surface-2) 88%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field textarea,
.profile-field textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.6;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.profile-field input:hover,
.profile-field select:hover,
.profile-field textarea:hover,
.form-group input:hover,
.form-group select:hover {
    border-color: var(--border-strong);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.profile-field input:focus,
.profile-field select:focus,
.profile-field textarea:focus,
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: var(--ring);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-3);
}

/* ===== Уведомления ===== */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 12000;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: min(520px, calc(100vw - 32px));
    padding: 12px 18px 12px 12px;
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    opacity: 0;
    transform: translate(-50%, 24px) scale(0.98);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.toast-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
}

.toast-icon .icon {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

.toast-success .toast-icon {
    color: var(--success);
    background: var(--success-soft);
}

.toast-error .toast-icon {
    color: var(--danger);
    background: var(--danger-soft);
}

.toast-info .toast-icon {
    color: var(--info);
    background: var(--info-soft);
}

.toast-message {
    flex: 1;
    font-size: 14.5px;
    font-weight: 500;
}

/* ===== Логотип ===== */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.03em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 13px;
    background: var(--gradient);
    color: var(--accent-ink);
    box-shadow: 0 10px 22px -10px rgba(196, 106, 74, 0.85);
}

.brand-mark .icon {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
}

/* ===== Обложки книг ===== */
.cover {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 2 / 3;
    width: 100%;
    padding: 14% 12% 12% 18%;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%),
        linear-gradient(155deg, var(--c1), var(--c2));
    border-radius: 5px 13px 13px 5px;
    box-shadow:
        0 22px 40px -20px rgba(0, 0, 0, 0.75),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    container-type: inline-size;
    isolation: isolate;
}

.cover::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.55;
}

.cover::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 9%;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.42), rgba(255, 255, 255, 0.16) 55%, rgba(0, 0, 0, 0.16));
}

.cover-p0::before {
    background:
        radial-gradient(circle at 86% 12%, rgba(255, 255, 255, 0.38) 0 16%, transparent 16.6%),
        radial-gradient(circle at 86% 12%, transparent 0 24%, rgba(255, 255, 255, 0.16) 24.5% 25.6%, transparent 26%);
}

.cover-p1::before {
    background: repeating-linear-gradient(-38deg, rgba(255, 255, 255, 0.1) 0 2px, transparent 2px 15px);
}

.cover-p2::before {
    background: repeating-radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.16) 0 1.4px, transparent 1.4px 15px);
}

.cover-p3::before {
    background: radial-gradient(rgba(255, 255, 255, 0.22) 1.1px, transparent 1.5px) 0 0 / 13px 13px;
    mask-image: linear-gradient(180deg, #000, transparent 78%);
}

.cover-band {
    width: 36%;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.cover-title {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: var(--font-serif);
    font-size: clamp(13px, 12cqi, 34px);
    font-weight: 600;
    line-height: 1.16;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.28);
    overflow-wrap: anywhere;
}

.cover-mark {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(8px, 6cqi, 12px);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0.78;
}

.cover-mark .icon {
    width: 1.35em;
    height: 1.35em;
}

/* ===== Модалки (общие: поддержка на входе и в библиотеке) ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: safe center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    background: var(--overlay);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fade-in 0.2s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
}

.modal {
    width: 100%;
    max-width: 520px;
    min-height: 0;
    max-height: min(720px, calc(100dvh - 32px));
    margin: auto;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: modal-in 0.28s var(--ease);
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 18px 14px 26px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(12px);
}

.modal-header h3 {
    overflow: hidden;
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 560;
    letter-spacing: -0.025em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.modal-body {
    padding: 8px 26px 28px;
}

.hint-text {
    margin-bottom: 18px;
    color: var(--text-2);
}

.field-hint {
    font-size: 12.5px;
    color: var(--text-3);
    text-align: right;
}

.settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.settings-actions > * {
    flex: 1;
}

.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    background: var(--surface-2);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.dropzone-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 50%;
}

.dropzone-title {
    font-weight: 750;
}

.dropzone-title u {
    color: var(--accent);
    text-underline-offset: 3px;
}

.dropzone-hint {
    font-size: 13px;
    color: var(--text-3);
}

.support-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal.modal-support {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal.modal-support .modal-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.support-form textarea {
    min-height: 120px;
}

.support-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    padding: 14px 26px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.support-actions > * {
    flex: 1;
}

.support-file {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.support-shots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.support-shot {
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.support-shot img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.support-shot-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    color: #fff;
    background: rgba(10, 10, 14, 0.55);
}

.support-shot-remove:hover {
    background: var(--danger);
}

.support-shot figcaption {
    padding: 6px 8px 8px;
    overflow: hidden;
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.modal.modal-desk {
    max-width: 680px;
    height: min(720px, calc(100dvh - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal.modal-desk .modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal.modal-desk .modal-header h3 {
    flex: 1;
}

.desk-back {
    transform: rotate(90deg);
}

.modal.modal-desk .modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    min-height: 0;
}

.desk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.desk-toolbar .hint-text {
    margin: 0;
}

.desk-toolbar .btn {
    flex-shrink: 0;
}

.desk-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}

.desk-date,
.desk-statuses {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--text-3);
}

.desk-date input {
    height: 36px;
    padding: 0 10px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
}

.desk-date input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.desk-statuses {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.desk-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 10px;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
}

.desk-status:has(input:checked) {
    color: var(--text);
    background: var(--accent-soft);
    border-color: var(--accent);
}

.desk-status input {
    accent-color: var(--accent);
}

.desk-empty {
    padding: 28px 8px;
    color: var(--text-3);
    text-align: center;
}

.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: auto;
}

.ticket-list li {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.ticket-item {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 6px;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.ticket-item:hover {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.ticket-top,
.chat-bubble header,
.chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ticket-top time,
.chat-bubble time {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-3);
}

.ticket-author {
    overflow: hidden;
    font-size: 13px;
    font-weight: 650;
    color: var(--text-2);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ticket-preview {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ticket-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 750;
    border-radius: 99px;
}

.ticket-status.status-waiting {
    color: var(--warning);
    background: var(--warning-soft);
}

.ticket-status.status-in_progress {
    color: var(--accent);
    background: var(--accent-soft);
}

.ticket-status.status-done {
    color: var(--success);
    background: var(--success-soft);
}

.ticket-status-field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-3);
}

.ticket-status-field select,
.chat-compose textarea {
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
}

.ticket-status-field select {
    height: 36px;
    padding: 0 8px;
}

.chat-head {
    align-items: flex-start;
}

.chat-log {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
}

.chat-bubble {
    max-width: min(100%, 460px);
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
}

.chat-bubble.role-user {
    align-self: flex-start;
    background: var(--surface-2);
}

.chat-bubble.role-admin {
    align-self: flex-end;
    background: var(--accent-soft);
    border-color: transparent;
}

.chat-bubble p {
    margin: 6px 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-shots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chat-shots img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 10px;
    background: var(--surface);
}

.chat-compose {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-compose textarea {
    flex: 1;
    min-height: 64px;
    max-height: 140px;
    padding: 10px 12px;
    resize: vertical;
}

.chat-compose .btn {
    flex-shrink: 0;
}

/* ===== Плашка cookie: не перекрывает страницу ===== */
.cookie-notice {
    position: fixed;
    z-index: 10000;
    right: 16px;
    bottom: 16px;
    left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    width: min(380px, calc(100vw - 32px));
    padding: 16px 16px 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: cookie-notice-in 0.35s var(--ease);
}

.cookie-notice p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-2);
}

.cookie-policy-link {
    display: inline;
    padding: 0;
    color: var(--accent);
    font-weight: 700;
    line-height: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-accept {
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 750;
    color: var(--accent-ink);
    background: var(--gradient);
    border-radius: 999px;
}

.cookie-accept:hover {
    filter: brightness(1.06);
}

@keyframes cookie-notice-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 960px) {
    .cookie-notice {
        right: 12px;
        bottom: 12px;
        left: auto;
    }
}

/* ===== Баннер подписки: без кнопки закрытия ===== */
.paywall {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: safe center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
    background: var(--overlay);
    backdrop-filter: blur(8px);
}

.paywall-card {
    width: min(520px, 100%);
    margin: auto;
    padding: 28px 26px 22px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.paywall-kicker {
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.paywall-card h2 {
    margin: 8px 0 10px;
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 560;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.paywall-lead {
    margin: 0 0 18px;
    color: var(--text-2);
}

.paywall-plans {
    display: grid;
    gap: 8px;
}

.paywall-plan {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-align: left;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.paywall-plan.is-selected {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.paywall-plan input {
    accent-color: var(--accent);
}

.paywall-plan b {
    display: block;
    font-size: 15px;
}

.paywall-plan span {
    color: var(--text-2);
    font-size: 13px;
}

.paywall-plan strong {
    font-variant-numeric: tabular-nums;
}

.paywall-custom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.paywall-custom input {
    width: 72px;
    height: 36px;
    padding: 0 10px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
}

.paywall-total {
    margin: 16px 0 12px;
    font-size: 18px;
    font-weight: 750;
}

.paywall-pay {
    width: 100%;
}

.paywall-note {
    min-height: 1.4em;
    margin: 10px 0 0;
    color: var(--text-2);
    font-size: 13.5px;
}

.paywall-leave {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    color: var(--text-3);
    font-size: 13.5px;
    text-decoration: underline;
    text-underline-offset: 3px;
}
