        :root {
            --sidebar-bg: #1f2228;
            --sidebar-text: #c6ccd7;
            --sidebar-text-active: #ffffff;
            --sidebar-line: #343a45;
            --sidebar-highlight: #4a90e2;
            --bar-bg: #1a1e23;
            --bar-border: #374151;
            --text-primary: #e5e7eb;
            --text-faint: #6b7280;
            --sidebar-default-width: clamp(216px, 19.2vw, 420px);
            --sidebar-width: var(--sidebar-default-width);
            --resizer-width: 8px;
            --reader-bg: #f5f5f0;
            --reader-border: #d2d2c7;
            --reader-text: #1f1f1f;
            --ui-ink: #2b2d30;
            --button: #2f4864;
            --button-hover: #3f6188;
        }

        * { box-sizing: border-box; }

        body {
            margin: 0;
            color: var(--reader-text);
            background: linear-gradient(120deg, #ecebe3 0%, #e3e0d2 100%);
            min-height: 100dvh;
            overflow: hidden;
            font-family: "Public Sans", sans-serif;
        }

        .material-symbols-outlined {
            font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
            font-size: 24px;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .layout {
            display: grid;
            grid-template-columns: var(--sidebar-width) var(--resizer-width) 1fr;
            grid-template-rows: auto 1fr;
            height: 100dvh;
        }

        .layout.is-resizing {
            cursor: col-resize;
        }

        .sidebar {
            grid-column: 1;
            grid-row: 2;
            background: var(--sidebar-bg);
            color: var(--sidebar-text);
            border-right: 0;
            display: grid;
            grid-template-rows: auto 1fr auto;
            min-height: 0;
            font-family: "Public Sans", sans-serif;
            font-size: 13px;
        }

        .sidebar-footer {
            padding: 12px 0 10px 0;
            display: flex;
            justify-content: center;
            background: var(--sidebar-bg);
            border-top: 1px solid var(--sidebar-line);
        }

        .sidebar-resizer {
            grid-column: 2;
            grid-row: 2;
            position: relative;
            cursor: col-resize;
            touch-action: none;
            background: linear-gradient(180deg, #2a2f38 0%, #252a32 100%);
        }

        .sidebar-resizer::before {
            content: "";
            position: absolute;
            left: 50%;
            top: 0;
            transform: translateX(-50%);
            width: 2px;
            height: 100%;
            background: var(--sidebar-line);
            transition: background-color 0.15s ease;
        }

        .sidebar-resizer:hover::before,
        .layout.is-resizing .sidebar-resizer::before,
        .sidebar-resizer:focus-visible::before {
            background: var(--sidebar-highlight);
        }

        .sidebar-resizer:focus-visible {
            outline: 0;
            box-shadow: inset 0 0 0 2px rgba(74, 144, 226, 0.35);
        }

        .titlebar {
            padding: 10px 16px 6px;
            border-bottom: 0;
            min-height: 40px;
            display: flex;
            align-items: flex-start;
            font-size: 0.8rem;
            letter-spacing: 0.03em;
            color: var(--sidebar-highlight);
            opacity: 1;
            text-transform: none;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.2;
        }

        .toc-wrap {
            min-height: 0;
            overflow: auto;
            padding: 4px 0 8px;
            direction: rtl;
            scrollbar-width: thin;
            scrollbar-color: #444d5b #1f2228;
        }

        .toc-wrap .toc-list {
            direction: ltr;
        }

        .toc-wrap::-webkit-scrollbar {
            width: 10px;
        }

        .toc-wrap::-webkit-scrollbar-track {
            background: #1f2228;
        }

        .toc-wrap::-webkit-scrollbar-thumb {
            background: #3b4350;
            border-radius: 999px;
            border: 2px solid #1f2228;
        }

        .toc-wrap::-webkit-scrollbar-thumb:hover {
            background: #4a5464;
        }

        .toc-wrap::-webkit-scrollbar-corner {
            background: #1f2228;
        }

        .toc-list {
            list-style: none;
            margin: 0;
            padding: 0;
        }

        .toc-list.nested {
            padding-left: 11px;
            margin: 2px 0 0;
        }

        .toc-node {
            display: block;
        }

        .toc-branch > summary {
            list-style: none;
            cursor: default;
            display: flex;
            align-items: center;
            gap: 2px;
            padding-left: 8px;
        }

        .toc-branch > summary::-webkit-details-marker {
            display: none;
        }

        .toc-link {
            color: var(--sidebar-text);
            display: block;
            padding: 6px 10px 6px 2px;
            text-decoration: none;
            border-left: 2px solid transparent;
            font-size: 0.8rem;
            line-height: 1.2;
            flex: 1;
            min-width: 0;
        }

        .toc-link.leaf {
            padding-left: 24px;
        }

        .toc-toggle {
            width: 12px;
            min-width: 12px;
            height: 12px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #9aa5b6;
        }

        .toc-toggle::before {
            content: "\25B8";
            font-size: 10px;
            line-height: 1;
            transition: transform 0.12s ease;
            transform-origin: 45% 55%;
        }

        .toc-branch[open] > summary .toc-toggle::before {
            transform: rotate(90deg);
        }

        .toc-link:hover {
            color: var(--sidebar-text-active);
            background: #2b313b;
        }

        .toc-link.active {
            color: var(--sidebar-text-active);
            background: rgba(74, 144, 226, 0.28);
            border-left-color: var(--sidebar-highlight);
            font-weight: 700;
        }



        .reader {
            grid-column: 3;
            grid-row: 2;
            display: grid;
            grid-template-rows: 1fr;
            min-height: 0;
        }

        .toolbar {
            grid-column: 1 / -1;
            grid-row: 1;
            display: block;
            border-bottom: 0;
            padding: 0;
            background: transparent;
        }

        .topbar-track {
            height: 3.5rem;
            padding: 0 1rem;
            display: flex;
            align-items: center;
            gap: 0.6rem;
            background: var(--bar-bg);
            border-bottom: 1px solid var(--bar-border);
            transition: background 0.25s, border-color 0.25s;
        }

        .toolbar-left {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            min-width: 0;
            flex: 0 0 auto;
        }

        .topbar-book-meta {
            min-width: 0;
            display: grid;
            gap: 2px;
        }

        .topbar-book-title {
            color: #d1d5db;
            font-size: 0.9rem;
            font-weight: 700;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: min(26vw, 260px);
        }

        .topbar-book-author {
            color: #9ca3af;
            font-size: 0.72rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: min(26vw, 260px);
        }

        .topbar-title {
            margin: 0;
            font-size: 0.9375rem;
            font-weight: 600;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: min(22vw, 300px);
        }

        .topbar-page-icon {
            color: #f59e0b;
            font-size: 1.2rem;
            line-height: 1;
            flex-shrink: 0;
        }

        .topbar-middle {
            position: relative;
            width: auto;
            flex: 1 1 540px;
            max-width: min(58vw, 760px);
            min-width: 280px;
        }

        .topbar-track.is-search-collapsed .topbar-middle {
            display: none;
        }

        .topbar-search-wrap {
            position: relative;
        }

        .topbar-search {
            width: 100%;
            background: #24292e;
            border: none;
            border-radius: 8px;
            padding: 9px 98px 9px 14px;
            color: #d1d5db;
            font-size: 0.875rem;
            outline: none;
        }

        .topbar-search::placeholder {
            color: #6b7280;
        }

        .search-icon {
            position: absolute;
            right: 11px;
            top: 50%;
            transform: translateY(-50%);
            border: 0;
            background: transparent;
            color: #6b7280;
            font-size: 20px;
            padding: 0;
            width: 20px;
            height: 20px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .search-icon:hover {
            color: #d1d5db;
        }

        .search-hit-nav {
            position: absolute;
            right: 34px;
            top: 50%;
            transform: translateY(-50%);
            display: inline-flex;
            align-items: center;
            gap: 2px;
            padding: 2px;
            border-radius: 8px;
            background: #1e2429;
            border: 1px solid #313944;
        }

        .search-hit-nav-btn {
            border: 0;
            background: transparent;
            color: #b3bdcc;
            width: 20px;
            height: 20px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            cursor: pointer;
            padding: 0;
        }

        .search-hit-nav-btn:hover {
            background: #2d3640;
            color: #ffffff;
        }

        .search-hit-nav-btn:disabled {
            cursor: default;
            opacity: 0.4;
        }

        .search-hit-nav-btn .material-symbols-outlined {
            font-size: 16px;
        }

        .search-hit-count {
            min-width: 46px;
            text-align: center;
            color: #9aa8bb;
            font-size: 0.71rem;
            letter-spacing: 0.03em;
        }

        .search-results-panel {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            right: 0;
            background: #1f252c;
            border: 1px solid #3a4451;
            border-radius: 10px;
            box-shadow: 0 16px 26px rgba(5, 8, 12, 0.45);
            z-index: 38;
            overflow: hidden;
        }

        .search-results-meta {
            padding: 8px 11px;
            border-bottom: 1px solid #2f3742;
            color: #9aa8bb;
            font-size: 0.74rem;
            background: #1b2026;
        }

        .search-results-list {
            list-style: none;
            margin: 0;
            padding: 0;
            max-height: min(44dvh, 420px);
            overflow: auto;
        }

        .search-results-item {
            border-bottom: 1px solid #29313b;
        }

        .search-results-item:last-child {
            border-bottom: 0;
        }

        .search-result-btn {
            width: 100%;
            border: 0;
            background: transparent;
            color: #d2d9e4;
            text-align: left;
            padding: 9px 11px;
            cursor: pointer;
            display: grid;
            gap: 4px;
        }

        .search-result-btn:hover {
            background: #262f3a;
        }

        .search-result-btn.is-active {
            background: #2d3f55;
        }

        .search-result-title {
            font-size: 0.79rem;
            color: #9fc4ff;
        }

        .search-result-snippet {
            font-size: 0.79rem;
            line-height: 1.35;
            color: #c9d2df;
        }

        .topbar-right {
            margin-left: auto;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 14px;
            flex: 0 0 auto;
        }

        .preview-badge {
            display: inline-flex;
            align-items: center;
            padding: 6px 10px;
            border-radius: 999px;
            border: 1px solid rgba(245, 158, 11, 0.45);
            background: rgba(245, 158, 11, 0.12);
            color: #fde68a;
            font-size: 0.73rem;
            font-weight: 700;
            white-space: nowrap;
        }

        .sidebar-toggle {
            display: none;
            width: 38px;
            height: 38px;
            border: 1px solid #2a2f37;
            border-radius: 10px;
            background: #1a1e23;
            color: #d1d5db;
            cursor: pointer;
            flex: 0 0 auto;
            align-items: center;
            justify-content: center;
            padding: 0;
        }

        .sidebar-toggle:hover {
            background: #232932;
            color: #ffffff;
        }

        .sidebar-toggle .burger-lines,
        .sidebar-toggle .burger-lines::before,
        .sidebar-toggle .burger-lines::after {
            display: block;
            width: 17px;
            height: 2px;
            border-radius: 2px;
            background: currentColor;
            content: "";
            transition: transform 0.2s ease, opacity 0.2s ease;
        }

        .sidebar-toggle .burger-lines {
            position: relative;
        }

        .sidebar-toggle .burger-lines::before {
            position: absolute;
            left: 0;
            top: -6px;
        }

        .sidebar-toggle .burger-lines::after {
            position: absolute;
            left: 0;
            top: 6px;
        }

        body.mobile-sidebar-open .sidebar-toggle .burger-lines {
            transform: rotate(45deg);
        }

        body.mobile-sidebar-open .sidebar-toggle .burger-lines::before {
            transform: translateY(6px) rotate(-90deg);
        }

        body.mobile-sidebar-open .sidebar-toggle .burger-lines::after {
            opacity: 0;
        }

        .logo-link {
            width: 40px;
            height: 40px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            background: #2b3340;
            border: 1px solid #3b4556;
            flex: 0 0 auto;
            padding: 4px;
            text-decoration: none;
        }

        .app-back:hover {
            filter: brightness(1.06);
        }

        .logo-link img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .title {
            color: #d1d5db;
            font-size: 0.93rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .topbar-action {
            border: 0;
            background: transparent;
            color: #9ca3af;
            padding: 0;
            width: 24px;
            height: 24px;
            cursor: default;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .user-menu {
            position: relative;
            display: inline-block;
            cursor: pointer;
        }

        .user-avatar {
            width: 40px;
            height: 40px;
            overflow: hidden;
            border-radius: 9999px;
            border: 2px solid #374151;
        }

        .user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .signup-pill {
            display: flex;
            align-items: center;
            gap: 8px;
            background: #2d333b;
            border: 1px solid #3e4552;
            border-radius: 12px;
            color: #8ea4ff;
            font-weight: 500;
            padding: 8px 14px;
            text-decoration: none;
            line-height: 1;
        }

        .signup-icon-wrap {
            background: #5a67d8;
            border-radius: 9999px;
            width: 28px;
            height: 28px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #ffffff;
            flex: 0 0 auto;
        }

        .signup-text {
            font-size: 0.875rem;
            letter-spacing: 0.02em;
            white-space: nowrap;
        }

        .dropdown-menu {
            position: absolute;
            right: 0;
            top: calc(100% + 8px);
            width: 224px;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.2s ease;
            z-index: 50;
        }

        .user-menu:hover .dropdown-menu,
        .user-menu:focus-within .dropdown-menu {
            opacity: 1;
            visibility: visible;
        }

        .dropdown-panel {
            background: #2d333b;
            border: 1px solid #3e4552;
            border-radius: 8px;
            box-shadow: 0 12px 24px rgba(0, 0, 0, 0.34);
            overflow: hidden;
            padding: 4px 0;
        }

        .dropdown-link,
        .dropdown-btn {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 16px;
            color: #d1d5db;
            text-decoration: none;
            background: transparent;
            border: 0;
            font-size: 0.875rem;
            font-weight: 500;
            text-align: left;
        }

        .dropdown-link:hover,
        .dropdown-btn:hover {
            background: #373e47;
        }

        .dropdown-icon {
            font-size: 20px;
        }

        .dropdown-icon.blue { color: #60a5fa; }
        .dropdown-icon.green { color: #22c55e; }
        .dropdown-icon.red { color: #ef4444; }

        .dropdown-btn {
            cursor: pointer;
        }

        .toolbar-controls {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 0;
        }



        .btn {
            border: 0;
            color: #fff;
            background: #2d333b;
            border-radius: 8px;
            padding: 8px 13px;
            font-size: 0.84rem;
            letter-spacing: 0.02em;
            cursor: pointer;
        }

        .btn:hover {
            background: #373e47;
        }

        .btn.disabled {
            pointer-events: none;
            opacity: 0.4;
        }

        .btn.secondary {
            background: #ec5b13;
        }

        .btn.secondary:hover {
            opacity: 0.9;
        }

        .reader-editor-link {
            width: 40px;
            height: 40px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            border: 1px solid #d16839;
            background: #ec5b13;
            color: #ffffff;
            text-decoration: none;
            box-shadow: 0 6px 18px rgba(236, 91, 19, 0.22);
            transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease;
            flex: 0 0 auto;
        }

        .reader-editor-link:hover {
            transform: translateY(-1px);
            filter: brightness(0.96);
            box-shadow: 0 10px 20px rgba(236, 91, 19, 0.28);
        }

        .reader-editor-link .material-symbols-outlined {
            font-size: 20px;
        }

        .progress {
            background: rgba(245, 245, 240, 0.84);
            border: 1px solid var(--reader-border);
            color: #303238;
            border-radius: 999px;
            padding: 4px 10px;
            font-size: 0.78rem;
            min-width: 58px;
            text-align: center;
        }

        .stage {
            position: relative;
            min-height: 0;
            display: flex;
            flex-direction: column;
            background: radial-gradient(circle at 20% 0%, #fcfcf8 0, var(--reader-bg) 58%);
            touch-action: pan-y pinch-zoom;
            overscroll-behavior-x: contain;
        }

        #book-frame {
            width: 100%;
            flex: 1;
            min-height: 0;
            border: 0;
            background: var(--reader-bg);
            touch-action: pan-y pinch-zoom;
        }

        .frame-footer {
            flex-shrink: 0;
            min-height: 56px;
            padding: 8px 14px 10px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 12px;
            border-top: 1px solid var(--reader-border);
            background: rgba(245, 245, 240, 0.92);
        }

        .frame-progress {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
            flex: 0 1 auto;
        }

        .frame-footer.has-tts-active .frame-progress {
            display: none;
        }

        .frame-nav {
            display: flex;
            align-items: center;
            gap: 7px;
            flex-shrink: 0;
            margin-left: auto;
        }

        .tts-filter-toggle {
            border: 1px solid #b8b3a3;
            background: #f8f5ea;
            color: #5a5446;
            border-radius: 9999px;
            padding: 0.24rem 0.58rem;
            font-size: 0.66rem;
            font-weight: 700;
            letter-spacing: 0.03em;
            cursor: pointer;
            white-space: nowrap;
            text-transform: uppercase;
            line-height: 1.1;
        }

        .tts-filter-toggle.is-active {
            border-color: #15803d;
            background: #e9f7ef;
            color: #166534;
        }

        .tts-player {
            flex: 1;
            min-width: 220px;
            flex-basis: 320px;
            order: 0;
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 4px 8px;
            border: 1px solid var(--reader-border);
            border-radius: 9999px;
            background: rgba(255, 255, 255, 0.62);
        }

        .tts-player[hidden] {
            display: none !important;
        }

        .tts-progress {
            flex: 1;
            min-width: 0;
            accent-color: #ec5b13;
            cursor: pointer;
        }

        .tts-time {
            font-size: 0.72rem;
            color: #5a5b5f;
            min-width: 88px;
            text-align: center;
            letter-spacing: 0.02em;
        }

        .tts-cancel-btn {
            border: 1px solid #d98e6b;
            background: #fff3ec;
            color: #8d3511;
            border-radius: 9999px;
            padding: 0.18rem 0.6rem;
            font-size: 0.68rem;
            font-weight: 700;
            letter-spacing: 0.03em;
            cursor: pointer;
            white-space: nowrap;
        }

        .tts-cancel-btn:hover {
            background: #fee9dd;
        }

        .viewer-page-btn {
            width: 2.4rem;
            height: 2.4rem;
            border-radius: 9999px;
            background: #ec5b13;
            border: 0;
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 3px 14px rgba(236, 91, 19, 0.45);
            transition: transform 0.14s, background 0.14s, opacity 0.2s;
        }

        .viewer-page-btn:hover {
            transform: scale(1.09);
            background: #d44e0d;
        }

        .viewer-page-btn:active {
            transform: scale(0.93);
        }

        .viewer-page-btn .material-symbols-outlined {
            font-size: 1.05rem;
            line-height: 1;
        }

        .viewer-page-btn.is-speaking {
            background: #d44e0d;
            box-shadow: 0 0 0 2px rgba(236, 91, 19, 0.25), 0 3px 14px rgba(236, 91, 19, 0.55);
        }

        .viewer-page-btn.disabled,
        .viewer-page-btn:disabled {
            opacity: 0.3;
            cursor: not-allowed;
            transform: none;
        }

        .corner-progress {
            background: rgba(245, 245, 240, 0.84);
            border: 1px solid var(--reader-border);
            color: #303238;
            border-radius: 999px;
            padding: 4px 10px;
            font-size: 0.78rem;
        }

        .sidebar-backdrop {
            display: none;
        }

        .modal-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(12, 14, 18, 0.56);
            z-index: 30;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 18px;
        }

        .modal-backdrop.is-open {
            display: flex;
        }

        .modal-card {
            width: min(640px, 100%);
            max-height: 88dvh;
            overflow: auto;
            background: #24292e;
            border: 1px solid #3e4552;
            border-radius: 14px;
            box-shadow: 0 20px 44px rgba(0, 0, 0, 0.24);
            padding: 16px;
        }

        .modal-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 12px;
        }

        .modal-title {
            margin: 0;
            color: #f8fafc;
            font-size: 1rem;
        }

        .modal-close {
            border: 0;
            background: #2d333b;
            color: #d1d5db;
            border-radius: 8px;
            width: 36px;
            height: 36px;
            cursor: pointer;
            font-size: 1.1rem;
        }

        .modal-close:hover {
            background: #373e47;
            color: #fff;
        }

        .comment-user-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }

        .comment-user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 999px;
            border: 2px solid #3e4552;
            object-fit: cover;
            flex: 0 0 auto;
        }

        .comment-user-name {
            margin: 0;
            color: #60a5fa;
            font-size: 0.9rem;
            font-weight: 700;
        }

        .comment-user-subtitle {
            margin: 2px 0 0;
            color: #9ca3af;
            font-size: 0.78rem;
        }

        .comment-form {
            display: grid;
            gap: 10px;
        }

        .comment-label {
            display: grid;
            gap: 6px;
            color: #d1d5db;
            font-size: 0.86rem;
            font-weight: 600;
        }

        .comment-input,
        .comment-textarea {
            border: 1px solid #3e4552;
            border-radius: 10px;
            padding: 10px;
            font: inherit;
            color: #f3f4f6;
            background: #1f2429;
        }

        .comment-textarea {
            min-height: 130px;
            resize: vertical;
        }

        .selection-note {
            border: 1px solid #3e4552;
            border-radius: 10px;
            padding: 10px;
            background: #1f2429;
            color: #9ca3af;
            font-size: 0.82rem;
            max-height: 140px;
            overflow: auto;
            white-space: pre-wrap;
        }

        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }

        .post-preview-wrap {
            display: none;
            margin-top: 4px;
            border: 1px solid #3e4552;
            border-radius: 12px;
            background: #1e2329;
            padding: 12px;
        }

        .post-preview-wrap.is-visible {
            display: block;
        }

        .post-preview-head {
            color: #d1d5db;
            font-size: 0.82rem;
            margin: 0 0 8px;
        }

        .post-preview-card {
            border: 1px solid #2f3741;
            border-radius: 10px;
            background: #24292e;
            overflow: hidden;
        }

        .post-preview-note {
            margin: 8px 2px 0;
            color: #9ca3af;
            font-size: 0.74rem;
            line-height: 1.3;
        }

        .post-preview-content {
            color: #d1d5db;
            font-size: 0.9rem;
            line-height: 1.5;
            padding: 12px;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .post-preview-content h2 {
            margin: 0 0 8px;
            font-size: 1.15rem;
            color: #f8fafc;
        }

        .post-preview-content b {
            font-weight: 700;
        }

        .post-preview-content a {
            color: #60a5fa;
            text-decoration: underline;
            text-underline-offset: 2px;
        }

        .post-preview-content .reader-quote-cover {
            width: 640px;
            height: 360px;
            max-width: 100%;
            object-fit: cover;
            border-radius: 0.75rem;
            border: 1px solid #3e4552;
            margin-bottom: 10px;
            display: block;
        }

        .post-language-controls {
            display: flex;
            align-items: center;
            gap: 6px;
            margin: 8px 0 10px;
        }

        .post-language-toggle {
            border: 1px solid #3e4552;
            background: #1f2429;
            color: #cbd5e1;
            border-radius: 9999px;
            padding: 0.15rem 0.45rem;
            min-width: 2.2rem;
            font-size: 0.68rem;
            font-weight: 700;
            text-transform: uppercase;
            line-height: 1.2;
            cursor: pointer;
        }

        .post-language-toggle[data-target-language="da"] {
            color: #fca5a5;
            border-color: #7f1d1d;
        }

        .post-language-toggle[data-target-language="en"] {
            color: #93c5fd;
            border-color: #1e3a8a;
        }

        .post-language-toggle[data-target-language="da"].is-active {
            background: #7f1d1d;
            color: #fee2e2;
        }

        .post-language-toggle[data-target-language="en"].is-active {
            background: #1e3a8a;
            color: #dbeafe;
        }

        .post-language-toggle:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

        .post-content-input {
            width: 100%;
            min-height: 138px;
            resize: vertical;
            border: 1px solid #3e4552;
            border-radius: 10px;
            padding: 10px;
            font: inherit;
            color: #f3f4f6;
            background: #1f2429;
            margin-bottom: 10px;
        }

        .is-hidden {
            display: none !important;
        }

        .feedback {
            font-size: 0.82rem;
            min-height: 1.1em;
            color: #fca5a5;
        }

        @media (max-width: 900px) {
            .layout {
                grid-template-columns: 1fr;
                grid-template-rows: auto 1fr;
                overflow: hidden;
            }

            .sidebar-resizer {
                display: none;
            }

            .sidebar {
                position: fixed;
                left: 0;
                top: 0;
                bottom: 0;
                width: min(340px, 75vw);
                max-width: 75vw;
                z-index: 35;
                border-right: 0;
                transform: translateX(-102%);
                transition: transform 0.22s ease;
                box-shadow: 12px 0 28px rgba(0, 0, 0, 0.33);
            }

            .toolbar {
                grid-column: 1;
                grid-row: 1;
            }

            .reader {
                grid-column: 1;
                grid-row: 2;
            }

            .sidebar-toggle {
                display: inline-flex;
            }

            .topbar-track {
                height: 3.5rem;
                min-height: 3.5rem;
                flex-wrap: nowrap;
                padding-top: 0;
                padding-bottom: 0;
                gap: 8px;
                overflow-x: auto;
            }

            .toolbar-left {
                flex: 0 0 auto;
            }

            .topbar-title {
                max-width: 34vw;
            }

            .topbar-middle {
                order: 0;
                flex: 1 1 auto;
                max-width: none;
                min-width: 0;
            }

            .topbar-book-title {
                max-width: min(38vw, 220px);
            }

            .topbar-book-author {
                max-width: min(34vw, 190px);
            }

            .topbar-right {
                gap: 6px;
                flex: 0 0 auto;
            }

            .preview-badge {
                display: none;
            }

            .toolbar-controls {
                flex-wrap: nowrap;
                gap: 6px;
            }

            .frame-footer {
                min-height: 52px;
                padding: 7px 10px 9px;
                display: grid;
                grid-template-columns: minmax(0, 1fr) auto;
                grid-template-areas: "progress nav";
                align-items: center;
                gap: 6px 8px;
            }

            .frame-footer.has-tts-active {
                grid-template-areas: "tts nav";
            }

            .frame-progress {
                grid-area: progress;
                gap: 6px;
                min-width: 0;
                overflow: hidden;
            }

            .progress,
            .corner-progress {
                padding: 3px 8px;
                font-size: 0.72rem;
            }

            .frame-nav {
                grid-area: nav;
                gap: 6px;
                margin-left: 0;
                align-self: center;
            }

            .tts-filter-toggle {
                padding: 0.2rem 0.46rem;
                font-size: 0.61rem;
            }

            .tts-player {
                grid-area: tts;
                width: 100%;
                max-width: 100%;
                min-width: 0;
                gap: 6px;
                padding: 3px 6px;
            }

            .tts-time {
                min-width: 70px;
                font-size: 0.66rem;
                white-space: nowrap;
            }

            .tts-cancel-btn {
                padding: 0.12rem 0.45rem;
                font-size: 0.64rem;
            }

            .viewer-page-btn {
                width: 2.15rem;
                height: 2.15rem;
            }

            .tts-debug-log {
                padding: 7px 10px 9px;
                font-size: 0.68rem;
                max-height: 116px;
            }

            #open-comment-modal,
            #open-post-modal {
                display: none;
            }

            #open-epub-editor {
                display: none;
            }

            .topbar-action {
                display: none;
            }

            .signup-pill {
                padding: 6px;
                border-radius: 9999px;
            }

            .signup-text {
                display: none;
            }

            .sidebar-backdrop {
                position: fixed;
                inset: 0;
                background: rgba(5, 8, 12, 0.5);
                opacity: 0;
                pointer-events: none;
                transition: opacity 0.2s ease;
                z-index: 34;
                display: block;
            }

            body.mobile-sidebar-open .sidebar {
                transform: translateX(0);
            }

            body.mobile-sidebar-open .sidebar-backdrop {
                opacity: 1;
                pointer-events: auto;
            }

            body.mobile-sidebar-open {
                overflow: hidden;
            }

            .topbar-track.is-search-collapsed .topbar-book-title {
                max-width: min(48vw, 270px);
            }

            .topbar-track.is-search-collapsed .topbar-book-author {
                max-width: min(44vw, 230px);
            }

        }

        @media (max-width: 720px) {
            .topbar-book-author {
                display: none;
            }

            .topbar-book-title {
                max-width: min(42vw, 210px);
                font-size: 0.84rem;
            }

            .topbar-track.is-search-collapsed .topbar-book-title {
                max-width: min(56vw, 280px);
            }
        }

        @media (max-width: 560px) {
            .tts-time {
                min-width: 58px;
                font-size: 0.62rem;
            }
        }

        @media (max-width: 420px) {
            .tts-time {
                display: none;
            }
        }
