# Header chrome: keep paint cheap, keep the current look.

.qk-header-chrome {
    --qk-header-lt: #4fafa7;
    position: sticky;
    top: 0;
    z-index: 80;
    background: linear-gradient(rgba(12, 6, 18, 0.75), rgba(12, 6, 18, 0.85)), url("/img/header-bg.webp") center/cover no-repeat;
    border-bottom: 1px solid rgba(88, 28, 135, 0.4);
    box-shadow: none;
}

.qk-header-chrome.convert-studio-topbar {
    background: #161018;
    box-shadow: none;
}

.qk-header-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "lead"
        "actions";
    align-items: center;
    column-gap: 8px;
    row-gap: 4px;
    padding: 0;
}

.qk-header-lead {
    grid-area: lead;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas: "logo cat search";
    align-items: center;
    column-gap: 8px;
    min-width: 0;
    padding: 8px 10px 4px;
}

.qk-header-logo {
    grid-area: logo;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qk-header-logo::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.28) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.qk-header-logo__img {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.qk-header-logo:hover .qk-header-logo__img {
    transform: scale(1.08);
}

.qk-header-cat { grid-area: cat; position: relative; }
.qk-header-search { grid-area: search; min-width: 0; }

.qk-header-actions {
    grid-area: actions;
    min-width: 0;
    padding: 6px 10px 8px;
}

.qk-header-actions__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.qk-header-actions__row::-webkit-scrollbar { display: none; }

.qk-header-search form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.qk-header-search input {
    border: 0 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}

.qk-header-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 8px;
    flex-shrink: 0;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}
.qk-header-admin:hover { background: #b91c1c; }

.qk-header-lt {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 4px;
    flex-shrink: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--qk-header-lt, #4fafa7);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.qk-header-lt:hover { background: rgba(255, 255, 255, 0.08); }

.qk-header-nap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    padding: 0 6px;
    flex-shrink: 0;
    border: 1px solid rgba(251, 191, 36, 0.55);
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}
.qk-header-nap:hover { background: rgba(245, 158, 11, 0.28); border-color: #fbbf24; color: #fde68a; }

.qk-header-auth {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 9px;
    flex-shrink: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.qk-header-auth:hover { background: rgba(255, 255, 255, 0.16); }

.lt-coin {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2372bfb9' d='M12 1L6 11l6 11z'/%3E%3Cpath fill='%23368781' d='M12 1l6 10-6 11z'/%3E%3Cpath fill='%23c1f5f0' d='M5 8L1 16l11 6z'/%3E%3Cpath fill='%234fafa7' d='M5 8l7 14-3-7z'/%3E%3Cpath fill='%2372bfb9' d='M19 8l-4 7-3 7z'/%3E%3Cpath fill='%231F6964' d='M19 8l-7 14 11-6z'/%3E%3Cpath fill='%23bdf1ec' d='M12 15L9 19l3 3z'/%3E%3Cpath fill='%234fafa7' d='M12 15l3 4-3 3z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.qk-user-cluster {
    display: inline-flex;
    align-items: stretch;
    height: 28px;
    max-width: 140px;
    flex-shrink: 0;
    gap: 2px;
}

.qk-user-cluster__name {
    min-width: 0;
    max-width: 108px;
    display: inline-flex;
    align-items: center;
    padding: 0 4px 0 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    border-radius: 8px;
}
.qk-user-cluster__name:hover { background: rgba(255, 255, 255, 0.08); }
.qk-user-cluster__name span { font-weight: 800; }

.qk-user-cluster__logout { display: flex; margin: 0; }
.qk-user-cluster__logout button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
}
.qk-user-cluster__logout button:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fda4af;
}
.qk-user-cluster__logout svg { width: 13px; height: 13px; }

.qk-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    flex-shrink: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}
.qk-theme-toggle__swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: conic-gradient(#e8b84c 0 22%, #d6c29c 22% 42%, #aeb4bc 42% 62%, #657080 62% 80%, #303030 80% 100%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.qk-theme-toggle:hover,
.qk-theme-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, 0.08); }

.qk-notice-btn {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    flex-shrink: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #4fafa7 !important;
    cursor: pointer;
    touch-action: manipulation;
}
.qk-header-actions {
    --qk-header-lt: #4fafa7;
}
.qk-notice-btn svg,
.qk-chat-btn svg,
.qk-header-actions #global-chat-btn svg {
    width: 18px !important;
    height: 18px !important;
    fill: var(--qk-header-lt, #4fafa7) !important;
    color: var(--qk-header-lt, #4fafa7) !important;
}
.qk-notice-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #4fafa7 !important;
}
.qk-notice-badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    min-width: 11px;
    height: 11px;
    padding: 0 3px;
    border: 0;
    border-radius: 999px;
    background: #ef4444 !important;
    box-shadow: 0 0 0 1px rgba(12, 6, 18, 0.7);
    color: #fff !important;
    font-size: 7px;
    font-weight: 800;
    line-height: 11px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    pointer-events: none;
    white-space: nowrap;
}

.qk-chat-btn,
.qk-header-actions #global-chat-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    flex-shrink: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: #4fafa7 !important;
    cursor: pointer;
    right: auto;
    bottom: auto;
    left: auto;
    top: auto;
    transform: none;
    filter: none;
}
.qk-header-actions #global-chat-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #4fafa7 !important;
    transform: none;
}
.qk-header-actions #global-chat-badge {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    min-width: 11px;
    height: 11px;
    padding: 0 3px;
    border: 0;
    border-radius: 999px;
    background: #ef4444 !important;
    box-shadow: 0 0 0 1px rgba(12, 6, 18, 0.7);
    color: #fff !important;
    font-size: 7px;
    font-weight: 800;
    line-height: 11px;
    text-align: center;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    pointer-events: none;
    white-space: nowrap;
}

.qk-header-cat > div > button {
    border: 0 !important;
    background: transparent !important;
    padding: 6px !important;
    border-radius: 8px;
    color: #fff !important;
    opacity: 1;
    filter: none;
}
.qk-header-cat > div > button:hover { background: rgba(255, 255, 255, 0.08) !important; }
.qk-header-cat > div > button span {
    display: block;
    width: 20px;
    height: 3px;
    margin: 0 0 4px;
    border-radius: 1px;
    background: #fff !important;
    opacity: 1;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.65);
}
.qk-header-cat > div > button span:last-child {
    margin-bottom: 0;
}
.qk-header-cat > div > button svg {
    width: 16px;
    height: 16px;
    color: #fff !important;
    fill: #fff !important;
    stroke: none !important;
    background: #ed5565 !important;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.qk-header-actions .relative > button,
.qk-header-actions .relative > div > button {
    height: 28px;
    min-height: 28px;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.qk-header-actions .relative > button.qk-notice-btn {
    width: 36px;
    height: 36px;
    min-height: 36px;
}
.qk-header-actions .relative > button:hover,
.qk-header-actions .relative > div > button:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.ascension-btn {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0 0.78rem;
    gap: 0.34rem;
    overflow: hidden;
    border: 1px solid rgba(94, 234, 212, 0.34);
    border-radius: 0.55rem;
    color: #ccfbf1;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(17, 24, 39, 0.94) 48%, rgba(49, 46, 129, 0.72) 100%);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
}
.ascension-btn__glyph {
    width: 0.86rem;
    height: 0.86rem;
    flex: 0 0 auto;
    color: #99f6e4;
}
.ascension-btn--panel {
    min-height: 2.25rem;
    padding: 0 1rem;
    font-size: 0.86rem;
}
.qk-header-actions .ascension-btn {
    flex-shrink: 0;
    height: 28px;
    min-height: 28px;
    padding: 0 0.6rem;
    font-size: 0.68rem;
    gap: 0.22rem;
    border: 0;
    background: rgba(45, 212, 191, 0.14);
    color: #99f6e4;
    white-space: nowrap;
}
.qk-header-actions .ascension-btn__glyph { width: 0.72rem; height: 0.72rem; }
.qk-header-actions .ascension-btn:hover { background: rgba(45, 212, 191, 0.22); }

.qk-cat-menu,
.qk-notice-panel {
    position: fixed;
    z-index: 1000000;
    width: min(320px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-height: min(70dvh, 520px);
    margin: 0;
    border: 1px solid var(--qk-reader-line, #e2e8f0);
    border-radius: 14px;
    background: var(--qk-reader-paper, #fff);
    box-shadow: 0 14px 36px var(--qk-reader-shadow, rgba(15, 23, 42, 0.16));
    color: var(--qk-reader-text, #0f172a);
}
.qk-cat-menu { padding: 10px; overflow: auto; overscroll-behavior: contain; }
.qk-notice-panel { overflow: hidden; }
.qk-cat-menu__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}
.qk-cat-menu__item {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 38px;
    padding: 0 8px;
    border-radius: 9px;
    border: 1px solid var(--qk-reader-line, #e2e8f0);
    background: var(--qk-reader-paper-soft, #f8fafc);
    color: var(--qk-reader-text, #0f172a);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.qk-cat-menu__item:hover { border-color: var(--qk-reader-accent, #287e77); }

.qk-notice-panel__head,
.qk-notice-panel__foot { padding: 10px 12px; }
.qk-notice-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
}
.qk-notice-panel__title { font-size: 12px; font-weight: 800; }
.qk-notice-panel__count { font-size: 11px; font-weight: 700; color: var(--qk-reader-muted, #64748b); }
.qk-notice-panel__list { max-height: min(48dvh, 360px); overflow: auto; overscroll-behavior: contain; }
.qk-notice-panel__item { display: block; padding: 10px 12px; text-decoration: none; color: inherit; }
.qk-notice-panel__item:hover { background: var(--qk-reader-paper-soft, #f8fafc); }
.qk-notice-panel__text { margin: 0; font-size: 12px; font-weight: 500; line-height: 1.45; }
.qk-notice-panel__time { margin: 4px 0 0; font-size: 11px; color: var(--qk-reader-muted, #64748b); }
.qk-notice-panel__empty { padding: 28px 12px; text-align: center; font-size: 12px; color: var(--qk-reader-muted, #64748b); }
.qk-notice-panel__all {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    border: 1px solid var(--qk-reader-line, #e2e8f0);
    border-radius: 9px;
    background: var(--qk-reader-paper-soft, #f8fafc);
    color: var(--qk-reader-text, #0f172a);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.header-tabs-wrapper {
    background: transparent;
    border-bottom: 0;
}
.header-tabs-wrapper nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.header-tabs-wrapper nav::-webkit-scrollbar { display: none; }

.qk-header-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.qk-header-tabs::-webkit-scrollbar { display: none; }

.qk-header-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid var(--qk-reader-line, #e2e8f0);
    border-radius: 999px;
    background: var(--qk-reader-paper, #fff);
    box-shadow: 0 1px 2px var(--qk-reader-shadow, rgba(15, 23, 42, 0.06));
    color: var(--qk-reader-text, #334155);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.qk-header-tab svg { width: 14px; height: 14px; }
.qk-header-tab:hover {
    background: var(--qk-reader-paper-soft, #f8fafc);
}
.header-tab-active {
    box-shadow: 0 0 0 1px var(--qk-reader-accent, #287e77), 0 1px 2px var(--qk-reader-shadow, rgba(15, 23, 42, 0.08)) !important;
}

@media (min-width: 768px) {
    .qk-header-bar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "lead actions";
        row-gap: 0;
        padding: 8px 0;
    }
    .qk-header-search { max-width: 28rem; }
    .qk-header-lead,
    .qk-header-actions { padding: 0; }
    .qk-header-actions__row {
        width: max-content;
        justify-content: flex-end;
        gap: 6px;
        margin-left: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qk-header-logo__img { transition: none; }
}
/* QK Turbo Drive chrome — progress, fade, preview, busy, reduced-motion */

[x-cloak] {
    display: none !important;
}

@keyframes qk-turbo-fade-in {
    from { opacity: 0.85; }
    to { opacity: 1; }
}

html.is-turbo-ready #turbo-container.is-turbo-visit {
    animation: none;
}

#turbo-container {
    animation: none;
}

html[data-turbo-preview] *,
html[data-turbo-preview] *::before,
html[data-turbo-preview] *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

html[data-turbo-preview] #turbo-container,
body.no-turbo-animation #turbo-container,
body.chapter-reading-page #turbo-container,
body.post-show-page #turbo-container {
    animation: none !important;
    will-change: auto !important;
    transform: none !important;
    opacity: 1 !important;
}

.turbo-progress-bar {
    height: 2px !important;
    background: #287e77 !important;
    box-shadow: none !important;
}

html.is-turbo-busy {
    cursor: progress;
    pointer-events: none;
}

html.is-turbo-busy .qk-skip-link {
    pointer-events: auto;
}

body.hide-floating #tts-global-btn,
body.hide-floating #global-chat-btn:not(.qk-chat-btn) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

@media (prefers-reduced-motion: reduce) {
    html.is-turbo-ready #turbo-container.is-turbo-visit,
    #turbo-container {
        animation: none !important;
    }
    .turbo-progress-bar {
        display: none !important;
        transition: none !important;
    }
    body.hide-floating #tts-global-btn,
    body.hide-floating #global-chat-btn:not(.qk-chat-btn) {
        transform: none !important;
    }
}
/* Theme surfaces use inherited CSS variables. Selectors stay short and
   beat Tailwind utilities by specificity (no !important war). */

.transition-all {
    transition-property: transform, opacity, box-shadow;
}

html {
    background-color: var(--qk-reader-page, #f8fafc);
}

html[data-reader-theme="white"] {
    --qk-comment-cta-bg: #334155;
    --qk-comment-cta-fg: #ffffff;
    --qk-comment-cta-bd: #334155;
}
html[data-reader-theme="paper"] {
    --qk-comment-cta-bg: #5a4633;
    --qk-comment-cta-fg: #fffaf0;
    --qk-comment-cta-bd: #5a4633;
}
html[data-reader-theme="sepia"] {
    --qk-comment-cta-bg: #5c4028;
    --qk-comment-cta-fg: #f3e2c2;
    --qk-comment-cta-bd: #5c4028;
}
html[data-reader-theme="ghi"] {
    --qk-comment-cta-bg: #3d4a5c;
    --qk-comment-cta-fg: #f8fafc;
    --qk-comment-cta-bd: #3d4a5c;
}
html[data-reader-theme="gray"] {
    --qk-comment-cta-bg: #3f3f46;
    --qk-comment-cta-fg: #f7f7f7;
    --qk-comment-cta-bd: #3f3f46;
}
html[data-reader-theme="night"] {
    --qk-comment-cta-bg: #3f3f3f;
    --qk-comment-cta-fg: #ececec;
    --qk-comment-cta-bd: #555555;
}

html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) {
    background-color: var(--qk-reader-page, #f8fafc);
    color: var(--qk-reader-text, #1e293b);
}

html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) #turbo-container {
    color: var(--qk-reader-text, #1e293b);
}

html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .bg-white,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .bg-slate-900 {
    background-color: var(--qk-reader-paper, #fff);
}

html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .bg-gray-50,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .bg-slate-50,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .bg-gray-002 {
    background-color: var(--qk-reader-page, #f8fafc);
}

html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .bg-gray-100,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .bg-slate-100,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .bg-slate-800 {
    background-color: var(--qk-reader-paper-soft, #f8fafc);
}

html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .border-gray-100,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .border-gray-200,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .border-gray-300,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .border-slate-100,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .border-slate-200,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .border-slate-800 {
    border-color: var(--qk-reader-line, #e2e8f0);
}

html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-gray-800,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-gray-900,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-slate-800,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-slate-900,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-slate-700,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-slate-100 {
    color: var(--qk-reader-text, #1e293b);
}

html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-gray-700,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-gray-600,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-gray-500,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-gray-400,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-slate-600,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-slate-500,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-slate-400,
html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .text-slate-300 {
    color: var(--qk-reader-muted, #64748b);
}

html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) .qk-post-title {
    color: #4fafa7;
}

html[data-reader-theme] body:not(.convert-app-page):not(.qk-studio-page) a.qk-post-meta__cat {
    color: #44619d;
}

html[data-reader-theme].dark body:not(.convert-app-page):not(.qk-studio-page) a.qk-post-meta__cat,
html[data-reader-theme] body.dark:not(.convert-app-page):not(.qk-studio-page) a.qk-post-meta__cat {
    color: #6b8fc7;
}

html[data-reader-theme] body:not(.convert-app-page) textarea,
html[data-reader-theme] body:not(.convert-app-page) select,
html[data-reader-theme] body:not(.convert-app-page) input[type="text"],
html[data-reader-theme] body:not(.convert-app-page) input[type="search"],
html[data-reader-theme] body:not(.convert-app-page) input[type="email"],
html[data-reader-theme] body:not(.convert-app-page) input[type="password"],
html[data-reader-theme] body:not(.convert-app-page) input[type="number"],
html[data-reader-theme] body:not(.convert-app-page) input[type="url"] {
    background-color: var(--qk-reader-paper-soft, #f8fafc);
    color: var(--qk-reader-text, #1e293b);
    border-color: var(--qk-reader-line, #e2e8f0);
}

.qk-header-search input {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
    border: 0 !important;
}

.qk-header-search input::placeholder {
    color: #94a3b8 !important;
}

.qk-header-tab {
    background: var(--qk-reader-paper, #fff);
    border-color: var(--qk-reader-line, #e2e8f0);
    color: var(--qk-reader-text, #334155);
    box-shadow: 0 1px 2px var(--qk-reader-shadow, rgba(15, 23, 42, 0.06));
}

.header-tab-active {
    box-shadow: 0 0 0 1px var(--qk-reader-accent, #287e77), 0 1px 2px var(--qk-reader-shadow, rgba(15, 23, 42, 0.08));
}

.qk-site-footer {
    background: var(--qk-reader-page-soft, #eef2f7);
    border-color: var(--qk-reader-line, #e2e8f0);
    color: var(--qk-reader-muted, #64748b);
    content-visibility: auto;
    contain-intrinsic-size: 1px 240px;
}

.qk-site-footer a[title] {
    background-color: var(--qk-reader-paper, #fff);
    border-color: var(--qk-reader-line, #e2e8f0);
    color: var(--qk-reader-text, #334155);
}

.qk-site-footer nav a {
    color: var(--qk-reader-text, #334155);
}

.qk-site-footer p,
.qk-site-footer span {
    color: var(--qk-reader-muted, #64748b);
}

.modal {
    background: var(--qk-reader-paper, #fff);
    color: var(--qk-reader-text, #1e293b);
}

#comment-form {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
}

.comment-editor-wrapper {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--qk-reader-line, #e2e8f0);
    border-radius: 8px;
    background: var(--qk-reader-paper-soft, #f8fafc);
}

.comment-editor-wrapper textarea#body,
#comment-form textarea#body {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 180px;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 0;
    resize: vertical;
    background: transparent;
    color: var(--qk-reader-text, #1e293b);
    font-size: 14px;
    line-height: 1.5;
    box-shadow: none;
    outline: none;
}

.comment-editor-wrapper textarea#body::placeholder,
#comment-form textarea#body::placeholder {
    color: var(--qk-reader-muted, #64748b);
}

@media (pointer: coarse) {
    .comment-editor-wrapper textarea#body,
    #comment-form textarea#body {
        font-size: 16px;
    }
}

#comment-form .flex.justify-end {
    justify-content: flex-end;
    margin: 0;
}

#comment-form input[type="submit"],
.qk-comment-submit,
.qk-post-comment-submit,
#load-more-comments {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    min-height: 24px;
    padding: 0 12px;
    border: 1px solid var(--qk-comment-cta-bd, #334155);
    border-radius: 6px;
    background: var(--qk-comment-cta-bg, #334155);
    color: var(--qk-comment-cta-fg, #fff);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

#comment-form input[type="submit"]:hover,
.qk-comment-submit:hover,
.qk-post-comment-submit:hover,
#load-more-comments:hover {
    filter: none;
    opacity: 0.92;
}

.qk-post-card {
    contain: content;
}

.qk-ico {
    display: inline-block;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    background: currentColor;
    opacity: 0.7;
    -webkit-mask: var(--qk-ico) center / contain no-repeat;
    mask: var(--qk-ico) center / contain no-repeat;
}

.qk-ico--view {
    --qk-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3E%3C/svg%3E");
}

.qk-ico--comment {
    --qk-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='black' viewBox='0 0 20 20'%3E%3Cpath d='M2 5a2 2 0 012-2h7a2 2 0 012 2v4a2 2 0 01-2 2H9l-3 3v-3H4a2 2 0 01-2-2V5z'/%3E%3C/svg%3E");
}

.qk-ico--like {
    --qk-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='black' viewBox='0 0 20 20'%3E%3Cpath d='M2 10.5a1.5 1.5 0 113 0v6a1.5 1.5 0 01-3 0v-6zM6 10.333v5.43a2 2 0 001.106 1.79l.05.025A4 4 0 008.943 18h5.416a2 2 0 001.962-1.608l1.2-6A2 2 0 0015.56 8H12V4a2 2 0 00-2-2 1 1 0 00-1 1v.667a4 4 0 01-.8 2.4L6.8 7.933a4 4 0 00-.8 2.4z'/%3E%3C/svg%3E");
}

.qk-ico--upload {
    --qk-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='black' viewBox='0 0 16 16'%3E%3Cpath d='M8 2a5.53 5.53 0 00-3.594 1.342c-.766.66-1.321 1.52-1.464 2.383C1.266 6.095 0 7.555 0 9.318 0 11.366 1.708 13 3.781 13h8.906C14.502 13 16 11.57 16 9.773c0-1.636-1.242-2.969-2.834-3.194C12.923 3.999 10.69 2 8 2zm2.354 5.146a.5.5 0 01-.708.708L8.5 6.707V10.5a.5.5 0 01-1 0V6.707L6.354 7.854a.5.5 0 11-.708-.708l2-2a.5.5 0 01.708 0l2 2z'/%3E%3C/svg%3E");
}

.qk-ico--doc {
    --qk-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='black' viewBox='0 0 20 20'%3E%3Cpath d='M4.5 3A2.5 2.5 0 002 5.5v9A2.5 2.5 0 004.5 17h11a2.5 2.5 0 002.5-2.5v-9A2.5 2.5 0 0015.5 3h-11zM6.25 7.25h7.5a.75.75 0 010 1.5h-7.5a.75.75 0 010-1.5zm0 3h5.5a.75.75 0 010 1.5h-5.5a.75.75 0 010-1.5z'/%3E%3C/svg%3E");
}

.qk-ico--amber {
    color: #fbbf24;
    opacity: 1;
}

.qk-page-body,
.qk-page-main,
.qk-page-sidebar {
    display: block;
    min-width: 0;
}

.qk-site-aside {
    content-visibility: auto;
    contain-intrinsic-size: 1px 520px;
}

@media (max-width: 767.98px) {
    .qk-site-aside,
    .qk-page-sidebar {
        display: none;
    }
}

body.convert-app-page .convert-command-bar,
body.convert-app-page .convert-app-dock-inner,
body.convert-app-page .convert-page-header,
body.convert-app-page .reader-toolbar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    filter: none;
}
