@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&display=swap');

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f3eae2;
    color: #1a1a1a;
}

.panel {
    max-width: 960px;
    margin: 40px auto;
    padding: 24px;
    background: #f8f2ea;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    box-shadow: none;
    color: #1f211f;
    font-family: 'Cormorant Garamond', serif;
}

.panel-error {
    border: 1px solid #f4c6cc;
    background: #fff4f6;
}

.panel-soft {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(31, 33, 31, 0.2);
    border-radius: 4px;
    margin: 12px 0;
}

h2,
h3 {
    margin-top: 0;
}

.toolbar,
.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0;
}

input,
textarea,
button {
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #ccd3dc;
}

textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    margin-top: 8px;
}

button {
    cursor: pointer;
    background: #fff;
}

button:hover {
    background: #f1f4f8;
}

.list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #f9fbfd;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
}

.chapter {
    border-top: 1px solid #e8ecf2;
    margin-top: 16px;
    padding-top: 16px;
}

.block {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px 0;
}

.meta {
    color: #64748b;
    font-size: 13px;
}

.topics h4 {
    margin: 10px 0 6px;
}

.voice-status {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.meta-warn {
    color: #b45309;
    font-weight: 600;
}

.admin-footer .actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0;
}

.books-page {
    --chat-paper-bg: #f3eae2;
    --chat-paper-panel: #f8f2ea;
    --chat-ink-primary: #1f211f;
    --chat-ink-secondary: #4a4a4a;
    --chat-line: rgba(31, 33, 31, 0.2);
    --chat-radius: 4px;
    --chat-font-body: 'Cormorant Garamond', serif;
    --chat-font-ui: 'Century Gothic', 'CenturyGothic', 'AppleGothic', 'Segoe UI', sans-serif;
    max-width: 980px;
    margin: 24px auto;
    border-radius: var(--chat-radius);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--chat-paper-panel);
    box-shadow: none;
    color: var(--chat-ink-primary);
    font-family: var(--chat-font-body);
}

.books-page h2 {
    margin: 0 0 8px;
    font-size: 42px;
    line-height: 1.05;
    font-weight: 600;
}

.books-page .meta {
    color: var(--chat-ink-secondary);
    font-family: var(--chat-font-ui);
}

.books-page .books-toolbar,
.books-page .actions {
    gap: 10px;
}

.books-page .books-input {
    min-width: 260px;
    border: 1px solid var(--chat-line);
    border-radius: var(--chat-radius);
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.45);
    font-family: var(--chat-font-ui);
    color: var(--chat-ink-primary);
}

.books-page .books-list {
    gap: 12px;
}

.books-page .list-item {
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid var(--chat-line);
    border-radius: var(--chat-radius);
    padding: 12px;
}

.books-page .book-main {
    min-width: 220px;
}

.books-page .book-share-line {
    margin-top: 4px;
    font-size: 13px;
    font-family: var(--chat-font-ui);
    word-break: break-all;
}

.books-page .book-share-line a {
    color: var(--chat-ink-secondary);
}

.books-page .books-share-wrap {
    position: relative;
    display: inline-flex;
}

.books-page .books-copy-popup {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 8px 12px;
    border: 1px solid rgba(31, 33, 31, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--chat-ink-primary);
    font-family: var(--chat-font-ui);
    font-size: 12px;
    line-height: 1;
    z-index: 5;
    box-shadow: 0 6px 14px rgba(31, 33, 31, 0.08);
}

.books-page .books-copy-popup::before,
.books-page .books-copy-popup::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}

.books-page .books-copy-popup::before {
    bottom: -7px;
    border-top: 7px solid rgba(31, 33, 31, 0.22);
}

.books-page .books-copy-popup::after {
    bottom: -6px;
    border-top: 7px solid rgba(255, 255, 255, 0.96);
}

.books-page .books-btn {
    border: 1px solid rgba(31, 33, 31, 0.28);
    background: #ebe4d7;
    color: var(--chat-ink-primary);
    border-radius: var(--chat-radius);
    padding: 10px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    font-family: var(--chat-font-ui);
}

.books-page .books-btn:hover {
    background: #e2dbc9;
}

.book-editor-page {
    max-width: 1180px;
    margin: 24px auto;
    padding: 20px;
    background: transparent;
    border: none;
    box-shadow: none;
    max-height: calc(100dvh - 130px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.book-editor-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.book-main-title-wrap {
    position: relative;
    width: 100%;
    padding-right: 42px;
    min-height: 36px;
}

.book-main-title {
    margin: 0;
    font-size: 36px;
    line-height: 1.1;
}

.book-title-edit-wrap {
    position: relative;
    width: min(560px, 100%);
}

.book-title-input,
.chapter-title-input {
    width: 100%;
    border: 1px solid rgba(31, 33, 31, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
    padding: 12px 46px 12px 12px;
    font-family: var(--chat-font-ui);
    color: var(--chat-ink-primary);
    box-sizing: border-box;
}

.book-edit-emoji {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(31, 33, 31, 0.22);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.chapter-edit-emoji {
    border: none;
    background: transparent;
    box-shadow: none;
}

.book-editor-page .books-btn {
    border: 1px solid rgba(31, 33, 31, 0.28);
    background: #ebe4d7;
    color: var(--chat-ink-primary);
    border-radius: var(--chat-radius);
    padding: 10px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    font-family: var(--chat-font-ui);
}

.book-editor-page .books-btn:hover {
    background: #e2dbc9;
}

.book-spread-flow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid rgba(31, 33, 31, 0.14);
    background: #fcfaf7;
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(31, 33, 31, 0.08);
    overflow: hidden;
    position: relative;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.book-spread-flow::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 34px;
    transform: translateX(-50%);
    background: linear-gradient(90deg,
            rgba(31, 33, 31, 0.01) 0%,
            rgba(31, 33, 31, 0.05) 50%,
            rgba(31, 33, 31, 0.01) 100%);
    pointer-events: none;
}

.book-leaf {
    min-height: 0;
    height: 100%;
    padding: 24px 20px 28px;
    border-right: 1px solid rgba(31, 33, 31, 0.08);
    position: relative;
    padding-bottom: 56px;
    overflow: hidden;
}

.book-leaf:nth-child(2n) {
    border-right: none;
}

.book-leaf-head {
    font-family: var(--chat-font-ui);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--chat-ink-secondary);
    margin-bottom: 12px;
}

.book-page-corner {
    position: absolute;
    bottom: 14px;
    font-family: var(--chat-font-ui);
    font-size: 14px;
    color: var(--chat-ink-secondary);
}

.book-page-corner-left {
    left: 16px;
}

.book-page-corner-right {
    right: 16px;
}

.book-flow-item {
    border: 1px solid rgba(31, 33, 31, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
    padding: 12px;
    margin: 0 0 12px;
}

.book-flow-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.book-flow-heading-main {
    flex: 1;
}

.book-flow-chapter-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.15;
}

.book-flow-text-wrap {
    position: relative;
    margin-top: 8px;
    padding-right: 34px;
}

.book-flow-text {
    margin: 0;
    text-indent: 0;
    font-size: 16px;
    line-height: 1.7;
}

.book-flow-text.rich-text p {
    margin: 0 0 12px;
    text-indent: 0;
}

.book-flow-text.rich-text p:last-child {
    margin-bottom: 0;
}

.book-flow-actions {
    margin-bottom: 0;
}

.block-edit-emoji {
    top: 0;
    right: 0;
}

.book-spread {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 0;
    border: 1px solid rgba(31, 33, 31, 0.14);
    background: #fcfaf7;
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(31, 33, 31, 0.08);
    overflow: hidden;
    position: relative;
}

.book-spread::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 40%;
    width: 34px;
    transform: translateX(-50%);
    background: linear-gradient(90deg,
            rgba(31, 33, 31, 0.01) 0%,
            rgba(31, 33, 31, 0.05) 50%,
            rgba(31, 33, 31, 0.01) 100%);
    pointer-events: none;
}

.spread-page {
    min-height: 640px;
    padding: 26px 24px 34px;
    background: #fcfaf7;
}

.spread-right-page {
    border-left: 1px solid rgba(31, 33, 31, 0.08);
    max-height: 74vh;
    overflow: auto;
}

.spread-page-head {
    font-family: var(--chat-font-ui);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--chat-ink-secondary);
    margin-bottom: 14px;
}

.spread-book-name {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.1;
    font-weight: 600;
}

.spread-subtitle {
    margin: 0 0 18px;
    font-family: var(--chat-font-ui);
    color: var(--chat-ink-secondary);
}

.book-index-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-index-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(31, 33, 31, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
    padding: 9px 10px;
    gap: 10px;
}

.book-index-title {
    font-family: var(--chat-font-ui);
    font-size: 13px;
}

.book-index-meta {
    min-width: 22px;
    text-align: center;
    font-family: var(--chat-font-ui);
    font-size: 12px;
    color: var(--chat-ink-secondary);
}

.book-chapter-card {
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid rgba(31, 33, 31, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
}

.book-chapter-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.chapter-title-edit-wrap {
    width: 100%;
    max-width: 500px;
}

.book-add-block-toolbar {
    margin-top: 10px;
}

.new-block-text {
    min-width: 250px;
    flex: 1;
}

.book-block-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(31, 33, 31, 0.12);
    border-radius: 8px;
}

.book-block-actions {
    margin-bottom: 0;
}

.book-danger-btn {
    border-color: rgba(145, 62, 62, 0.35) !important;
}

.book-empty-text {
    margin: 18px 0 0;
    color: var(--chat-ink-secondary);
    font-family: var(--chat-font-ui);
}

.book-pagination {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

.book-pagination-side {
    min-height: 24px;
    display: flex;
    align-items: center;
}

.book-pagination-side-left {
    justify-content: flex-start;
}

.book-pagination-side-right {
    justify-content: flex-end;
}

.book-page-link {
    border: none;
    background: transparent;
    padding: 0;
    font-family: var(--chat-font-ui);
    color: var(--chat-ink-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.book-pagination-center {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.book-page-num {
    min-width: 30px;
    height: 30px;
    border: 1px solid rgba(31, 33, 31, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    font-family: var(--chat-font-ui);
    color: var(--chat-ink-primary);
    padding: 0 8px;
}

.book-page-num.is-active {
    background: #ebe4d7;
    border-color: rgba(31, 33, 31, 0.34);
}

.book-page-num:disabled {
    cursor: default;
    opacity: 1;
}

@media (max-width: 560px) {
    .books-page {
        margin: 10px 12px;
        padding: 16px;
    }

    .books-page h2 {
        font-size: 34px;
    }

    .books-page .books-input {
        min-width: 100%;
    }

    .books-page .list-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .book-editor-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .book-editor-page {
        max-height: calc(100dvh - 104px);
        margin: 8px 12px;
        padding: 12px;
    }

    .book-title-edit-wrap {
        width: 100%;
    }

    .book-spread,
    .book-spread-flow {
        grid-template-columns: 1fr;
    }

    .book-spread::before,
    .book-spread-flow::before {
        display: none;
    }

    .spread-page {
        min-height: auto;
        padding: 18px 14px 20px;
    }

    .spread-right-page {
        border-left: none;
        border-top: 1px solid rgba(31, 33, 31, 0.08);
        max-height: none;
    }

    .book-leaf {
        min-height: 0;
        height: 100%;
        border-right: none;
        border-top: 1px solid rgba(31, 33, 31, 0.08);
        padding-bottom: 52px;
    }

    .book-leaf:first-child {
        border-top: none;
    }

    .book-pagination {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .book-pagination-side-left,
    .book-pagination-side-right,
    .book-pagination-center {
        justify-content: center;
    }
}

.chat-page {
    --chat-paper-bg: #f3eae2;
    --chat-paper-panel: #f8f2ea;
    --chat-ink-primary: #1f211f;
    --chat-ink-secondary: #4a4a4a;
    --chat-highlight-green: #9bad85;
    --chat-line: rgba(31, 33, 31, 0.2);
    --chat-radius: 4px;
    --chat-font-body: 'Cormorant Garamond', serif;
    --chat-font-ui: 'Century Gothic', 'CenturyGothic', 'AppleGothic', 'Segoe UI', sans-serif;
    background: var(--chat-paper-bg);
    color: var(--chat-ink-primary);
    font-family: var(--chat-font-body);
    margin: 0;
}

.chat-top-nav {
    text-align: center;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--chat-ink-secondary);
    padding: 26px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-app {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 34px 28px 120px;
}

.chat-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
    align-items: start;
}

.chat-panel {
    background: var(--chat-paper-panel);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--chat-radius);
    padding: 20px;
}

.chat-left-panel {
    min-height: 520px;
}

.chat-left-panel h1 {
    margin: 0 0 6px;
    font-size: 42px;
    font-weight: 600;
    line-height: 1.05;
}

.chat-section-title {
    margin: 0 0 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--chat-ink-secondary);
    border-bottom: 1px solid var(--chat-line);
    display: inline-block;
    padding-bottom: 2px;
}

.chat-hint {
    margin: 0 0 18px;
    font-size: 24px;
    line-height: 1.5;
    font-style: italic;
}

.chat-hint p {
    margin: 0 0 18px;
}

.chat-hint p:last-child {
    margin-bottom: 0;
}

.chat-hint .marker {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.chat-page .record-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 6px 0 14px;
    padding: 14px;
    border: 1px dashed var(--chat-line);
    border-radius: var(--chat-radius);
    background: rgba(255, 255, 255, 0.3);
}

.chat-mobile-record-sticky {
    display: none;
    font-family: var(--chat-font-ui);
}

.chat-mobile-record-sticky * {
    font-family: var(--chat-font-ui);
}

.chat-page .timer {
    font-family: var(--chat-font-ui);
    font-size: 14px;
    color: var(--chat-ink-secondary);
}

.chat-page .record-row .timer-under-btn {
    flex-basis: 100%;
}

.chat-page .timer .timer-caption,
.chat-page .timer .timer-value {
    display: block;
}

.chat-page .timer .timer-value {
    margin-top: 2px;
}

.chat-page .btn-rec {
    border: 1px solid rgba(31, 33, 31, 0.28);
    background: #ebe4d7;
    color: var(--chat-ink-primary);
    font-family: var(--chat-font-ui);
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    line-height: 1;
    min-height: 38px;
    border-radius: var(--chat-radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

.chat-page .btn-rec .rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c43a3a;
    box-shadow: 0 0 0 2px rgba(196, 58, 58, 0.18);
    display: inline-block;
    flex-shrink: 0;
}

.chat-page .btn-rec .rec-label {
    color: #c43a3a;
    font-weight: 700;
}

.chat-page .mode-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 8px 0 14px;
    font-family: var(--chat-font-ui);
    font-size: 12px;
    color: var(--chat-ink-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.chat-page .switch {
    position: relative;
    width: 52px;
    height: 28px;
    display: inline-block;
    flex-shrink: 0;
}

.chat-page .mode-toggle {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    pointer-events: none;
}

.chat-page .slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    border: 1px solid var(--chat-line);
    background: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: background .2s ease;
}

.chat-page .slider::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: var(--chat-highlight-green);
    transition: transform .2s ease;
}

.chat-page .mode-toggle:checked~.mode-switch .slider::before {
    transform: translateX(24px);
}

.chat-page .voice-only,
.chat-page .text-only {
    display: none;
}

.chat-page .mode-toggle:not(:checked)~.voice-only {
    display: block;
}

.chat-page .mode-toggle:checked~.text-only {
    display: block;
}

.chat-page aside.chat-panel,
.chat-page aside.chat-panel * {
    font-family: var(--chat-font-ui);
}

.chat-page textarea {
    width: 100%;
    min-height: 220px;
    border: 1px dashed var(--chat-line);
    background: rgba(255, 255, 255, 0.45);
    border-radius: var(--chat-radius);
    padding: 16px;
    font-family: var(--chat-font-ui);
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.chat-page .limit {
    margin-top: 8px;
    text-align: right;
    font-size: 12px;
    color: var(--chat-ink-secondary);
    font-family: var(--chat-font-ui);
}

.chat-page .text-submit-wrap {
    margin-top: 12px;
}

.chat-page .text-submit-wrap button {
    font-family: var(--chat-font-ui);
}

.chat-page .btn-rec.btn-text-submit {
    text-transform: none;
    letter-spacing: normal;
    justify-content: center;
}

.chat-topic-block+.chat-topic-block {
    margin-top: 20px;
}

.chat-topic-block-first {
    margin-top: 18px;
}

.chat-topic-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.chat-topic {
    display: inline-block;
    border-radius: var(--chat-radius);
    padding: 7px 12px;
    font-size: 16px;
    line-height: 1.1;
    cursor: pointer;
    border: 1px solid var(--chat-line);
    background: transparent;
    color: var(--chat-ink-primary);
}

.chat-result {
    margin-top: 12px;
}

.chat-result.panel-soft {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--chat-line);
    border-radius: var(--chat-radius);
    padding: 14px;
    margin: 10px 0 14px;
}

.chat-result p {
    margin: 0 0 10px;
}

.chat-result p:last-child {
    margin-bottom: 0;
}

.chat-result-desktop {
    display: block;
}

.chat-result-mobile {
    display: none;
}

.chat-bottom-bar,
.admin-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    border-top: 1px solid #d6cdc4;
    background: #f3eae2;
    padding: 16px 12px;
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    z-index: 20;
}

.admin-footer.panel,
.admin-footer.panel-soft {
    max-width: none;
    margin: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    box-shadow: none;
}

.chat-bottom-bar button,
.admin-footer button {
    border: 1px solid rgba(31, 33, 31, 0.2);
    background: transparent;
    color: #1f211f;
    border-radius: 4px;
    padding: 9px 16px;
    font-size: 18px;
    font-family: 'Century Gothic', 'CenturyGothic', 'AppleGothic', 'Segoe UI', sans-serif;
    cursor: pointer;
}

.chat-bottom-bar .logout-mobile {
    display: none;
}

@media (max-width: 900px) {
    .chat-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .chat-app {
        padding: 18px 12px 110px;
    }

    .chat-left-panel h1 {
        font-size: 34px;
    }

    .chat-hint {
        font-size: 22px;
    }

    .chat-topic {
        font-size: 18px;
    }

    .chat-page .mode-switch {
        font-size: 11px;
        gap: 8px;
    }

    .chat-mobile-record-sticky {
        display: block;
        position: sticky;
        top: 0;
        z-index: 15;
        background: var(--chat-paper-panel);
        padding: 10px 0 8px;
        margin: 0 0 12px;
    }

    .chat-left-panel {
        display: flex;
        flex-direction: column;
    }

    .chat-left-panel .chat-mobile-record-sticky {
        order: 1;
    }

    .chat-left-panel h1 {
        order: 2;
    }

    .chat-left-panel .chat-section-title {
        order: 3;
    }

    .chat-left-panel .chat-hint {
        order: 4;
    }

    .chat-mobile-record-sticky .mode-switch {
        margin: 0 0 10px;
    }

    .chat-mobile-record-sticky .record-row {
        margin: 0;
    }

    .chat-page aside .mode-switch {
        display: none;
    }

    .chat-page .voice-only .record-row {
        display: none;
    }

    .chat-result-desktop {
        display: none;
    }

    .chat-result-mobile {
        display: block;
    }

    .chat-bottom-bar .logout-desktop {
        display: none;
    }

    .chat-bottom-bar .logout-mobile {
        display: inline;
    }
}

.auth-page {
    --chat-paper-bg: #f3eae2;
    --chat-paper-panel: #f8f2ea;
    --chat-ink-primary: #1f211f;
    --chat-ink-secondary: #4a4a4a;
    --chat-line: rgba(31, 33, 31, 0.2);
    --chat-radius: 4px;
    --chat-font-body: 'Cormorant Garamond', serif;
    --chat-font-ui: 'Century Gothic', 'CenturyGothic', 'AppleGothic', 'Segoe UI', sans-serif;
    background: var(--chat-paper-bg);
    min-height: 100vh;
    color: var(--chat-ink-primary);
}

.auth-wrap {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 40px 16px 80px;
}

.auth-card {
    background: var(--chat-paper-panel);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--chat-radius);
    padding: 24px;
    font-family: var(--chat-font-body);
}

.auth-card h1 {
    margin: 0 0 8px;
    font-size: 42px;
    line-height: 1.05;
}

.auth-subtitle {
    margin: 0 0 16px;
    font-size: 22px;
    line-height: 1.35;
    font-style: italic;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin: 0 0 14px;
}

.auth-tab-btn {
    border: 1px solid var(--chat-line);
    background: transparent;
    color: var(--chat-ink-primary);
    border-radius: var(--chat-radius);
    padding: 8px 14px;
    font-size: 16px;
    cursor: pointer;
    font-family: var(--chat-font-ui);
}

.auth-tab-btn.is-active,
.auth-tab-btn:disabled {
    background: #ebe4d7;
}

.auth-form {
    display: grid;
    gap: 10px;
}

.auth-form input {
    border: 1px solid var(--chat-line);
    border-radius: var(--chat-radius);
    padding: 10px 12px;
    font-size: 16px;
    font-family: var(--chat-font-ui);
    background: rgba(255, 255, 255, 0.45);
}

.auth-submit {
    margin-top: 14px;
}

.auth-submit button {
    border: 1px solid var(--chat-line);
    background: #ebe4d7;
    color: var(--chat-ink-primary);
    border-radius: var(--chat-radius);
    padding: 10px 16px;
    font-size: 16px;
    cursor: pointer;
    font-family: var(--chat-font-ui);
}

@media (max-width: 560px) {
    .auth-wrap {
        padding: 18px 12px 32px;
    }

    .auth-card h1 {
        font-size: 34px;
    }

    .auth-subtitle {
        font-size: 20px;
    }
}
