@font-face {
    font-family: 'Manrope';
    src: url('../fonts/manrope-var.woff2') format('woff2-variations');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}
.settings-workspace-card { margin-bottom: 0; }
.settings-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.settings-link-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 82px;
    padding: 14px 16px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface-soft);
    color: var(--app-text);
    text-decoration: none;
    transition: border-color .16s var(--ease-base), background-color .16s var(--ease-base), transform .16s var(--ease-base);
}
.settings-link-card strong { font-size: 14px; }
.settings-link-card span { color: var(--app-muted); font-size: 12px; line-height: 1.5; }
.settings-link-card:hover,
.settings-link-card:focus-visible {
    border-color: var(--app-accent);
    background: var(--app-selected-bg);
    transform: translateY(-1px);
}

.learning-page { width: 100%; max-width: 1460px; margin: 0 auto; display: grid; gap: 18px; }
.learning-hero {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    padding: 28px 30px;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background:
        radial-gradient(circle at 88% 0%, rgba(23, 111, 174, .34), transparent 42%),
        linear-gradient(135deg, var(--app-surface), var(--app-surface-soft));
    box-shadow: var(--app-shadow-sm);
}
.learning-hero::after {
    content: "";
    position: absolute;
    right: -46px;
    bottom: -64px;
    width: 210px;
    height: 210px;
    border: 1px solid var(--app-border);
    border-radius: 50%;
    opacity: .32;
    pointer-events: none;
}
.learning-hero-copy { position: relative; z-index: 1; max-width: 720px; }
.learning-eyebrow { color: var(--app-link); font-size: 12px; font-weight: 700; letter-spacing: .18em; }
.learning-hero h1 { margin: 7px 0 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1.1; }
.learning-hero p { margin: 0; color: var(--app-muted); line-height: 1.7; }
.learning-hero-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(82px, 1fr));
    gap: 9px;
}
.learning-hero-stats > div {
    display: grid;
    gap: 3px;
    min-width: 82px;
    padding: 12px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, .12);
    text-align: center;
}
.learning-hero-stats strong { font-size: 20px; line-height: 1; }
.learning-hero-stats span { color: var(--app-muted); font-size: 12px; white-space: nowrap; }

.learning-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.learning-tab {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 17px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text);
    text-decoration: none;
    box-shadow: var(--app-shadow-sm);
    transition: border-color .16s var(--ease-base), background-color .16s var(--ease-base), transform .16s var(--ease-base);
}
.learning-tab:hover { border-color: var(--app-accent); transform: translateY(-1px); }
.learning-tab.is-active { border-color: var(--app-accent); background: var(--app-selected-bg); box-shadow: inset 0 0 0 1px var(--app-accent); }
.learning-tab-icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--app-info-bg);
    color: var(--app-info-text);
    font-size: 20px;
}
.learning-tab-copy { display: grid; gap: 3px; min-width: 0; }
.learning-tab-copy strong { font-size: 14px; }
.learning-tab-copy small { color: var(--app-muted); font-size: 12px; }
.learning-tab-count {
    margin-left: auto;
    min-width: 34px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--app-surface-raised);
    color: var(--app-muted);
    font-size: 12px;
    text-align: center;
}

.learning-admin-panel {
    border: 1px dashed var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    overflow: hidden;
}
.learning-admin-panel > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    padding: 14px 17px;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}
.learning-admin-panel > summary::-webkit-details-marker { display: none; }
.learning-admin-panel > summary span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--app-info-bg);
    color: var(--app-info-text);
}
.learning-admin-panel > summary small { color: var(--app-muted); font-weight: 400; }
.learning-admin-panel[open] > summary { border-bottom: 1px solid var(--app-border); }
.learning-upload-form { padding: 17px; }
.learning-upload-fields { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(260px, 1.6fr); gap: 14px; }
.learning-upload-form label { margin: 0; }
.learning-upload-form select,
.learning-upload-form input[type="file"] { margin-bottom: 0; }
.learning-upload-hint { margin: 10px 0 14px; color: var(--app-muted); font-size: 12px; line-height: 1.6; }

.learning-library { display: grid; gap: 14px; }
.learning-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
}
.learning-toolbar > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.learning-toolbar-kicker { width: 100%; color: var(--app-muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.learning-toolbar h2 { margin: 0; font-size: 20px; }
.learning-toolbar-count { color: var(--app-muted); font-size: 12px; }
.learning-search { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--app-muted); font-size: 12px; }
.learning-search input { width: min(320px, 48vw); margin: 0; padding: 8px 11px; }

.learning-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }
.learning-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-sm);
    overflow: hidden;
    transition: border-color .16s var(--ease-base), transform .16s var(--ease-base), box-shadow .16s var(--ease-base);
}
.learning-card:hover { border-color: var(--app-accent); transform: translateY(-2px); box-shadow: var(--app-shadow-lg); }
.learning-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 10px 13px;
    background: linear-gradient(135deg, var(--app-surface-soft), var(--app-surface-raised));
    border-bottom: 1px solid var(--app-border);
}
.learning-card-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--app-info-bg);
    color: var(--app-info-text);
    font-size: 18px;
}
.learning-kind { padding: 3px 7px; border-radius: 999px; background: var(--app-surface); color: var(--app-muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.learning-card-body { display: flex; flex: 1; flex-direction: column; gap: 7px; padding: 14px; }
.learning-card h3 { margin: 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.learning-folder { min-height: 32px; margin: 0; color: var(--app-muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.learning-card-meta { display: flex; gap: 10px; margin-top: auto; color: var(--app-muted); font-size: 12px; }
.learning-card-actions { display: flex; align-items: center; gap: 8px; padding: 0 14px 14px; }
.learning-primary {
    flex: 1;
    padding: 9px 12px;
    border-radius: 6px;
    background: var(--app-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}
.learning-primary:hover { background: var(--app-accent-hover); }
.learning-delete-form { margin: 0; }
.learning-delete {
    padding: 9px 11px;
    border: 1px solid var(--app-border);
    background: var(--app-danger-bg);
    color: var(--app-danger-text);
    font-size: 12px;
}
.learning-delete:hover { background: var(--app-danger-text); color: var(--app-danger-bg); }

.learning-empty {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 230px;
    padding: 30px;
    border: 1px dashed var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    text-align: center;
}
.learning-empty > span { font-size: 36px; }
.learning-empty h3 { margin: 0; }
.learning-empty p { margin: 0; color: var(--app-muted); font-size: 12px; }

.learning-reader-page,
.learning-video-page { width: min(100%, 1500px); margin: 0 auto; display: grid; gap: 12px; }
.learning-reader-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    padding: 13px 16px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
}
.learning-back { flex: 0 0 auto; color: var(--app-link); font-size: 12px; text-decoration: none; }
.learning-back:hover { text-decoration: underline; }
.learning-reader-heading { display: grid; flex: 1; gap: 3px; min-width: 200px; }
.learning-reader-heading strong { font-size: 14px; overflow-wrap: anywhere; }
.learning-reader-heading span { color: var(--app-muted); font-size: 12px; overflow-wrap: anywhere; }
.learning-view-chip { flex: 0 0 auto; padding: 5px 10px; border-radius: 999px; background: var(--app-warning-bg); color: var(--app-warning-text); font-size: 12px; }
.learning-reader-surface {
    height: calc(100vh - 210px);
    min-height: 540px;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--app-shadow-lg);
}
.learning-reader-surface iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.learning-reader-note { margin: 0; color: var(--app-muted); font-size: 12px; text-align: center; }
.learning-video-surface {
    display: grid;
    place-items: center;
    min-height: 420px;
    padding: 12px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #05080b;
    box-shadow: var(--app-shadow-lg);
}
.learning-video-surface video { display: block; width: 100%; max-height: calc(100vh - 250px); border-radius: 6px; background: #000; }

@media (max-width: 900px) {
    .learning-hero { padding: 22px; }
    .learning-hero-stats { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .learning-tabs { grid-template-columns: 1fr; }
    .learning-upload-fields { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .learning-page { gap: 12px; }
    .learning-hero h1 { font-size: 30px; }
    .learning-grid { grid-template-columns: 1fr; }
    .learning-toolbar { align-items: stretch; }
    .learning-search { width: 100%; }
    .learning-search input { width: 100%; }
    .learning-reader-surface { height: calc(100vh - 250px); min-height: 420px; }
    .learning-video-surface { min-height: 240px; padding: 6px; }
}
.learning-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.learning-upload-toggle {
    padding: 9px 13px;
    border: 1px solid var(--app-accent);
    background: var(--app-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.learning-upload-toggle:hover { background: var(--app-accent-hover); }
@media (max-width: 620px) {
    .learning-toolbar-actions { width: 100%; align-items: stretch; }
    .learning-toolbar-actions .learning-search { flex: 1; }
}

/* Magazine-style two-page PDF reader */
.learning-flipbook-page { width: min(100%, 1700px); }
.learning-flipbook-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.learning-flip-fullscreen {
    padding: 6px 11px;
    border: 1px solid var(--app-border);
    background: var(--app-surface-soft);
    color: var(--app-text);
    font-size: 12px;
}
.learning-flip-fullscreen:hover { background: var(--app-selected-bg); }
.learning-flipbook {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 12px;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
    height: calc(100vh - 208px);
    min-height: 620px;
    padding: 4px 8px;
}
.learning-flip-stage {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    height: 100%;
    min-width: 0;
    perspective: 1800px;
    transform-style: preserve-3d;
}
.learning-flip-stage::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 22px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(0,0,0,.20), rgba(255,255,255,.06) 50%, rgba(0,0,0,.24));
    opacity: .55;
    pointer-events: none;
    z-index: 2;
}
.learning-flip-turn {
    position: absolute;
    top: 0;
    bottom: 0;
    width: calc(50% - 3px);
    visibility: hidden;
    z-index: 4;
    pointer-events: none;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    will-change: transform;
}
.learning-flip-turn.is-next { right: 0; transform-origin: left center; }
.learning-flip-turn.is-prev { left: 0; transform-origin: right center; }
.learning-flip-turn.is-active { visibility: visible; }
.learning-flip-turn.is-next.is-active { animation: learning-page-turn-next .75s cubic-bezier(.4,0,.2,1) both; }
.learning-flip-turn.is-prev.is-active { animation: learning-page-turn-prev .75s cubic-bezier(.4,0,.2,1) both; }
.learning-flip-turn-face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 2px;
    background: #fff;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    box-shadow: 0 18px 40px rgba(0,0,0,.34);
}
.learning-flip-turn-face img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    user-select: none;
    -webkit-user-drag: none;
}
.learning-flip-turn-front { transform: rotateY(0deg); }
.learning-flip-turn-back { transform: rotateY(180deg); }
.learning-flip-turn-front::after,
.learning-flip-turn-back::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(255,255,255,.05) 35%, rgba(0,0,0,.10) 70%, rgba(0,0,0,.22));
}
@keyframes learning-page-turn-next {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(-180deg); }
}
@keyframes learning-page-turn-prev {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(180deg); }
}
@media (max-width: 620px) {
    .learning-flip-turn { width: calc(50% - 1.5px); }
    .learning-flip-stage::after { width: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .learning-flip-turn { display: none; }
}
.learning-flip-sheet {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .42);
}
.learning-flip-sheet::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 22px;
    pointer-events: none;
    opacity: .28;
}
.learning-flip-left::after { right: 0; background: linear-gradient(90deg, transparent, #000); }
.learning-flip-right::after { left: 0; background: linear-gradient(270deg, transparent, #000); }
.learning-flip-sheet img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    user-select: none;
    -webkit-user-drag: none;
}
.learning-flip-sheet img:not([src]), .learning-flip-sheet img[src=""] { visibility: hidden; }
.learning-flip-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 8px;
    background: var(--app-surface-soft);
    color: var(--app-muted);
    text-align: center;
}
.learning-flip-empty[hidden] { display: none; }
.learning-flip-empty span { font-size: 30px; opacity: .6; }
.learning-flip-empty small { font-size: 12px; }
.learning-flip-arrow {
    width: 48px;
    height: 76px;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text);
    font-size: 30px;
    line-height: 1;
    box-shadow: var(--app-shadow-sm);
}
.learning-flip-arrow:hover:not(:disabled) { background: var(--app-accent); color: #fff; }
.learning-flip-arrow:disabled { opacity: .22; cursor: not-allowed; }
.learning-flip-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 8px;
    background: rgba(4, 9, 14, .66);
    color: #fff;
    font-size: 12px;
    backdrop-filter: blur(2px);
}
.learning-flip-loading[hidden] { display: none; }
.learning-flip-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: learning-flip-spin .8s linear infinite;
}
@keyframes learning-flip-spin { to { transform: rotate(360deg); } }
.learning-flip-stage.is-turning-next { animation: learning-flip-out-next .16s ease-in both; }
.learning-flip-stage.is-turning-prev { animation: learning-flip-out-prev .16s ease-in both; }
.learning-flip-stage.is-entering-next { animation: learning-flip-in-next .22s ease-out both; }
.learning-flip-stage.is-entering-prev { animation: learning-flip-in-prev .22s ease-out both; }
@keyframes learning-flip-out-next {
    to { opacity: .15; transform: translateX(-22px) rotateY(-3deg) scale(.988); filter: blur(1px); }
}
@keyframes learning-flip-out-prev {
    to { opacity: .15; transform: translateX(22px) rotateY(3deg) scale(.988); filter: blur(1px); }
}
@keyframes learning-flip-in-next {
    from { opacity: .2; transform: translateX(26px) scale(.99); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes learning-flip-in-prev {
    from { opacity: .2; transform: translateX(-26px) scale(.99); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
.learning-flipbook-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 20px;
    color: var(--app-muted);
    font-size: 12px;
}
.learning-pdf-error { min-height: 320px; }
.learning-flipbook-page:fullscreen {
    box-sizing: border-box;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    padding: 12px 18px;
    background: var(--app-bg);
}
.learning-flipbook-page:fullscreen .learning-flipbook { height: calc(100vh - 150px); min-height: 420px; }
.learning-flipbook-page:fullscreen .learning-flipbook-footer { display: none; }
@media (max-width: 900px) {
    .learning-flipbook { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 7px; height: calc(100vh - 220px); min-height: 500px; }
    .learning-flip-arrow { width: 40px; height: 64px; font-size: 24px; }
}
@media (max-width: 620px) {
    .learning-flipbook { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 4px; height: calc(100vh - 240px); min-height: 380px; }
    .learning-flip-arrow { width: 32px; height: 52px; font-size: 20px; border-radius: 6px; }
    .learning-flip-stage { gap: 3px; }
    .learning-flipbook-tools { width: 100%; justify-content: flex-start; }
    .learning-flipbook-page:fullscreen { padding: 6px; }
    .learning-flipbook-page:fullscreen .learning-flipbook { height: calc(100vh - 120px); }
}/* Fullscreen viewport fit: fill the screen without vertical scrolling. */
.learning-flipbook-page:fullscreen {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 8px 12px;
    gap: 8px;
    overflow: hidden;
}
.learning-flipbook-page:fullscreen .learning-flipbook-bar {
    flex: 0 0 auto;
    min-width: 0;
    padding: 6px 10px;
}
.learning-flipbook-page:fullscreen .learning-flipbook {
    flex: 1 1 0%;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: hidden;
}
.learning-flipbook-page:fullscreen .learning-flipbook-footer,
.learning-flipbook-page:fullscreen .learning-reader-note {
    display: none;
}
@media (max-width: 900px) {
    .learning-flipbook-page:fullscreen {
        padding: 5px 7px;
        gap: 5px;
    }
    .learning-flipbook-page:fullscreen .learning-flipbook-bar {
        padding: 4px 7px;
    }
}/* Constrain the page row to the reader height so pages are never clipped. */
.learning-flipbook {
    grid-template-rows: minmax(0, 1fr);
}
.learning-flipbook-stage,
.learning-flip-sheet {
    min-height: 0;
}.learning-flip-sheet {
    box-sizing: border-box;
}/* TOC drawer and page-number jump */
.learning-flipbook-page { position: relative; }
.learning-flip-toc-toggle,
.learning-flip-jump button {
    padding: 6px 11px;
    border: 1px solid var(--app-border);
    background: var(--app-surface-soft);
    color: var(--app-text);
    font-size: 12px;
}
.learning-flip-toc-toggle:hover,
.learning-flip-jump button:hover { background: var(--app-selected-bg); }
.learning-flip-jump {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.learning-flip-jump label { color: var(--app-muted); font-size: 12px; }
.learning-flip-jump input {
    width: 74px;
    padding: 6px 7px;
    border: 1px solid var(--app-border);
    border-radius: 4px;
    background: var(--app-surface);
    color: var(--app-text);
    font-size: 12px;
}
.learning-flip-jump input:focus { outline: 2px solid var(--app-accent); outline-offset: 1px; }
.learning-flip-toc-backdrop {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: rgba(3, 8, 14, .55);
    backdrop-filter: blur(1px);
}
.learning-flip-toc {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 31;
    display: flex;
    flex-direction: column;
    width: min(390px, 88vw);
    border-right: 1px solid var(--app-border);
    background: var(--app-surface);
    box-shadow: 18px 0 50px rgba(0, 0, 0, .35);
}
.learning-flip-toc[hidden],
.learning-flip-toc-backdrop[hidden] { display: none; }
.learning-flip-toc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--app-border);
}
.learning-flip-toc-head div { display: grid; gap: 2px; }
.learning-flip-toc-head strong { font-size: 14px; }
.learning-flip-toc-head small { color: var(--app-muted); font-size: 12px; }
.learning-flip-toc-head button {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: var(--app-surface-soft);
    color: var(--app-text);
    font-size: 18px;
    line-height: 1;
}
.learning-flip-toc-status {
    padding: 9px 14px;
    border-bottom: 1px solid var(--app-border);
    color: var(--app-muted);
    font-size: 12px;
}
.learning-flip-toc-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    overflow: auto;
    overscroll-behavior: contain;
}
.learning-flip-toc-entry {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    padding: 6px 8px 6px calc(8px + (var(--toc-level, 1) - 1) * 14px);
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--app-text);
    text-align: left;
    font-size: 12px;
    line-height: 1.45;
}
.learning-flip-toc-entry:hover,
.learning-flip-toc-entry:focus-visible { background: var(--app-selected-bg); }
.learning-flip-toc-entry span:first-child { flex: 1; min-width: 0; }
.learning-flip-toc-entry span:last-child { flex: 0 0 auto; color: var(--app-muted); font-size: 12px; }
.learning-flip-toc-list.is-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 5px;
    padding: 10px;
}
.learning-flip-toc-page {
    padding: 6px 4px;
    border: 1px solid var(--app-border);
    border-radius: 4px;
    background: var(--app-surface-soft);
    color: var(--app-text);
    font-size: 12px;
}
.learning-flip-toc-page:hover,
.learning-flip-toc-page:focus-visible { background: var(--app-accent); color: #fff; }
.learning-flip-toc-page.is-current { border-color: var(--app-accent); color: var(--app-accent); font-weight: 700; }
@media (max-width: 620px) {
    .learning-flip-jump input { width: 62px; }
    .learning-flip-toc { width: min(340px, 92vw); }
}.learning-flip-toc-note { grid-column: 1 / -1; margin: 2px 0 0; color: var(--app-muted); font-size: 12px; }
