:root {
    color-scheme: light;
    --ink: #161616;
    --muted: #6d6a63;
    --line: #d8d4cb;
    --paper: #f7f5ef;
    --panel: #fffef9;
    --soft: #ece9e1;
    --accent: #2f5f52;
    --accent-soft: #dce9e3;
    --danger: #8b342f;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html.dark-mode {
    color-scheme: dark;
    --ink: #f2efe7;
    --muted: #aaa9a1;
    --line: #3c403d;
    --paper: #151816;
    --panel: #1d211f;
    --soft: #252a27;
    --accent: #8fc8b0;
    --accent-soft: #29483d;
    --danger: #ed9a8d;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
}

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.library-app {
    display: grid;
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    height: 100vh;
    overflow: hidden;
}

.library-app.nav-collapsed { grid-template-columns: minmax(0, 1fr); }
.library-app.nav-collapsed .library-sidebar { display: none; }

.library-sidebar {
    display: flex;
    min-width: 0;
    min-height: 0;
    height: 100vh;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background: var(--soft);
}

.library-brand {
    padding: 24px 22px 18px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.library-brand h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 500;
    letter-spacing: -.03em;
}

.library-brand p:last-child {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.library-nav {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.library-nav a, .library-nav button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.library-nav a:hover, .library-nav button:hover { color: var(--ink); text-decoration: underline; }

.library-controls {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
}

.status-button { display: inline-flex; align-items: center; gap: 6px; }
.status-dot { width: 7px; height: 7px; border-radius: 999px; background: #aaa59a; }
.status-dot.is-ok { background: #2f765b; }
.status-dot.is-error { background: var(--danger); }

.library-controls label { display: grid; gap: 5px; min-width: 0; }

.library-controls input {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 9px 10px;
    background: var(--panel);
    color: var(--ink);
}

.text-button {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px 10px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.text-button:hover { border-color: #aaa59a; background: var(--panel); }

.navigation-toggle {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 11px;
    background: transparent;
    color: var(--ink);
    font-size: 12px;
    cursor: pointer;
}
.navigation-toggle:hover, .navigation-toggle:focus-visible { border-color: var(--accent); color: var(--accent); }

.tree-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
}

.tree-toolbar button {
    border: 0;
    padding: 0;
    background: none;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}

.tree-toolbar button:hover { color: var(--ink); }

.tree-toolbar span { margin-left: auto; color: var(--muted); font-size: 12px; }

.file-tree {
    min-height: 0;
    flex: 1;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 10px 10px 28px;
}

.file-tree details { margin: 1px 0; }

.file-tree summary {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 4px 7px;
    border-radius: 6px;
    color: #44413b;
    cursor: pointer;
    font-size: 13px;
    list-style: none;
}

.file-tree summary::-webkit-details-marker { display: none; }
.file-tree summary::before { content: "▸"; color: #8f8b82; font-size: 10px; }
.file-tree details[open] > summary::before { content: "▾"; }
.file-tree summary::after { content: "/"; color: #aaa59b; }
.file-tree summary:hover { background: rgba(255,255,255,.55); }

.tree-children { margin-left: 13px; padding-left: 7px; border-left: 1px solid #d6d2c9; }

.file-entry {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    border: 0;
    border-radius: 6px;
    padding: 6px 8px 6px 20px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.file-entry:hover { background: rgba(255,255,255,.65); }
.file-entry.is-selected { background: var(--accent-soft); color: #173d33; }
.file-entry-name { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.file-entry-title { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.folder-page-picker { max-width: 520px; margin: 24px 0 8px; }
.folder-page-picker label { display: grid; gap: 7px; }
.folder-page-picker select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel); color: var(--ink); }
.folder-page-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.folder-page-card { display: grid; min-width: 0; gap: 6px; min-height: 92px; align-content: start; border: 1px solid var(--line); border-radius: 9px; padding: 14px; background: var(--soft); color: var(--ink); text-align: left; cursor: pointer; }
.folder-page-card:hover, .folder-page-card:focus-visible { border-color: var(--accent); outline: none; transform: translateY(-1px); }
.folder-page-card-name { overflow: hidden; font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.2; text-overflow: ellipsis; }
.folder-page-card-path { overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.reader-pane {
    display: grid;
    min-width: 0;
    min-height: 0;
    height: 100vh;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    background: var(--panel);
}

.reader-bar {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--line);
}

.reader-path { min-width: 0; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.reader-status { margin-left: auto; color: var(--muted); font-size: 12px; }
.gallery-back-button {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 11px;
    background: transparent;
    color: var(--ink);
    font-size: 12px;
    cursor: pointer;
}
.gallery-back-button:hover, .gallery-back-button:focus-visible { border-color: var(--accent); color: var(--accent); }

.reader-workspace {
    display: grid;
    min-width: 0;
    min-height: 0;
    height: 100%;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
}

.reader-workspace.has-reel-media {
    grid-template-columns: minmax(0, 1fr) calc(var(--reel-player-width, 334px) + 14px);
}

.reader-scroll {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.reel-media-panel {
    display: grid;
    min-width: 0;
    min-height: 0;
    width: var(--reel-player-width, 334px);
    height: calc(100% - 24px);
    margin: 12px 14px 12px 0;
    grid-template-rows: minmax(0, var(--reel-media-height, 48%)) auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f2f0e9;
    box-shadow: 0 4px 18px rgba(32, 31, 28, .08);
}

.reel-media-panel[hidden] { display: none; }

.reel-video-stage {
    position: relative;
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0e1110;
}

.reel-video-stage video {
    display: block;
    width: min(100%, var(--reel-media-width, 100%));
    height: 100%;
    object-fit: contain;
    background: #000;
}

.carousel-viewer {
    position: relative;
    width: min(100%, var(--reel-media-width, 100%));
    height: 100%;
    overflow: hidden;
    background: #0e1110;
    touch-action: pan-y;
    user-select: none;
}

.carousel-viewer[hidden] { display: none; }

.carousel-viewer img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #0e1110;
    -webkit-user-drag: none;
}
.carousel-viewer img[hidden] { display: none; }
.carousel-viewer video { width: 100%; }

.app-page.reel-library-page .carousel-arrow {
    position: absolute;
    top: 50%;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    padding: 0;
    z-index: 2;
    border: 1px solid #fff8;
    border-radius: 999px;
    background: #161616;
    color: white;
    line-height: 1;
    cursor: pointer;
}

.app-page.reel-library-page .carousel-arrow:hover,
.app-page.reel-library-page .gallery-slide-arrow:hover { background: #303030; color: #fff; }
.app-page.reel-library-page .carousel-arrow[hidden] { display: none; }
.carousel-arrow.is-previous { left: 10px; }
.carousel-arrow.is-next { right: 10px; }

.carousel-position {
    position: absolute;
    right: 12px;
    bottom: 10px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(18, 20, 19, .66);
    color: white;
    font-size: 11px;
    letter-spacing: .04em;
}

.video-message { margin: 0; padding: 24px; color: #dfe4e1; font-size: 13px; text-align: center; }
.video-message[hidden], .reel-video-stage video[hidden] { display: none; }

.reel-creator-card {
    max-height: 20vh;
    overflow: auto;
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.reel-creator-card > strong { display: block; margin-bottom: 7px; font-size: 14px; }
.reel-description { color: #45423d; font-family: Georgia, "Times New Roman", serif; font-size: 13px; line-height: 1.48; }
.reel-description p { margin: 0 0 8px; }
.video-actions { display: flex; gap: 14px; padding-top: 5px; }
.video-actions a { color: var(--accent); font-size: 11px; text-underline-offset: 3px; }

.reel-comments-panel {
    display: grid;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.reel-comments-panel > header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 18px 9px;
    border-bottom: 1px solid var(--line);
}

.reel-comments-panel h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 500; }
.reel-comments-panel header span { margin-left: auto; color: var(--muted); font-size: 11px; }
.comments-list { min-height: 0; margin: 0; padding: 0 18px 28px; overflow-y: auto; list-style: none; }
.captured-comment { padding: 13px 0; border-bottom: 1px solid var(--line); }
.captured-comment header { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.captured-comment header span { margin-left: auto; color: var(--muted); font-size: 10px; text-align: right; }
.captured-comment p { margin: 6px 0 0; color: #383631; font-family: Georgia, "Times New Roman", serif; font-size: 13px; line-height: 1.48; }
.empty-comment { padding: 16px 0; color: var(--muted); font-size: 12px; }

.reader-content {
    width: min(100%, 860px);
    margin: 0 auto;
    padding: clamp(34px, 5vw, 70px) clamp(24px, 5vw, 66px) 100px;
}

.reader-content.is-gallery { width: min(100%, 1320px); }
.reel-gallery-document { color: var(--ink); }
.gallery-header { max-width: 760px; margin-bottom: 34px; }
.gallery-header h1 { margin: 0 0 14px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(40px, 6vw, 68px); font-weight: 500; letter-spacing: -.045em; line-height: 1; }
.gallery-header > p:last-child { margin: 0; color: var(--muted); font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.6; }
.reel-gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.reel-gallery-card {
    position: relative;
    display: block;
    min-width: 0;
    aspect-ratio: 4 / 5;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
    background: #373a37;
    color: white;
    text-align: left;
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.reel-gallery-card:hover, .reel-gallery-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.reel-gallery-card img,
.artifact-reel-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 180ms ease, transform 180ms ease; }
.reel-gallery-card.has-thumbnail img,
.artifact-reel-card.has-thumbnail img { opacity: 1; }
.reel-gallery-card:hover img,
.artifact-reel-card:hover img { transform: scale(1.025); }
.reel-card-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 10, 9, .12) 20%, rgba(8, 10, 9, .86) 100%); }
.reel-card-copy { position: absolute; inset: auto 0 0; display: grid; gap: 5px; padding: 18px; z-index: 1; }
.gallery-card-type, .artifact-reel-card small { color: #d9eee5; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.gallery-card-author { overflow: hidden; color: rgba(255,255,255,.88); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.reel-gallery-card strong { overflow-wrap: anywhere; font-family: Georgia, "Times New Roman", serif; font-size: clamp(21px, 2vw, 28px); font-weight: 500; line-height: 1.16; }
.gallery-card-date { color: rgba(255,255,255,.65); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; line-height: 1.4; }

/* Preserve natural media proportions independently of shared card resets. */
.app-page.reel-library-page .reel-gallery-card {
    display: block;
    width: 100%;
    height: auto;
    min-height: 120px;
    aspect-ratio: auto;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #262626 !important;
    color: #fff;
}
.app-page.reel-library-page .reel-gallery-card img {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    transform: none;
}
.app-page.reel-library-page .reel-gallery-card.has-media-size { min-height: 0; }
.app-page.reel-library-page .has-video-ratio .gallery-thumbnail { position: absolute; inset: 0; height: 100%; }
.app-page.reel-library-page .reel-gallery-card .reel-card-copy {
    position: absolute;
    inset: auto 10px 10px;
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(10, 10, 10, .82);
    color: #fff;
    pointer-events: none;
}
.app-page.reel-library-page .reel-gallery-card .gallery-card-author {
    color: #fff;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.35;
}
.app-page.reel-library-page .reel-gallery-card .gallery-card-date {
    color: #eee;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}
.app-page.reel-library-page .reel-gallery-card:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}

/* Independently flowing Reel lanes either side of full-proportion posts. */
.reel-library-page .reel-gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.gallery-reels { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gallery-posts { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.reel-library-page .gallery-open { position: relative; display: block; width: 100%; height: auto; text-decoration: none; }
.reel-library-page .gallery-open:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.reel-library-page .gallery-preview-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; pointer-events: none; }
.reel-library-page .reel-card-copy { transition: opacity 150ms ease; }
.reel-library-page .is-previewing .reel-card-copy { opacity: 0; }
.app-page.reel-library-page .gallery-post-card .gallery-open { height: auto; }
.app-page.reel-library-page .gallery-post-card img,
.app-page.reel-library-page .gallery-post-card .gallery-slide-video {
    position: static; display: block; width: 100%; height: auto; object-fit: contain; transform: none;
}
.app-page.reel-library-page .gallery-post-card img[hidden] { display: none; }
.reel-library-page .gallery-post-card .reel-card-copy { z-index: 2; }
.app-page.reel-library-page .gallery-slide-arrow {
    position: absolute; z-index: 3; display: grid; place-items: center;
    width: 38px; height: 38px; padding: 0; border: 1px solid #fff8;
    border-radius: 50%; background: #161616; color: white; cursor: pointer;
}
.app-page.reel-library-page .gallery-slide-arrow { top: 50%; transform: translateY(-50%); line-height: 1; }
.app-page.reel-library-page :is(.gallery-slide-arrow, .carousel-arrow) svg { display: block; width: 22px; height: 22px; color: #fff; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.app-page.reel-library-page :is(.gallery-slide-arrow, .carousel-arrow) svg path { fill: none; stroke: #fff; }
.gallery-previous { left: 8px; }
.gallery-next { right: 8px; }
.app-page.reel-library-page .gallery-slide-arrow[hidden] { display: none; }
.app-page.reel-library-page .gallery-slide-count { position: absolute; top: 10px; right: 10px; z-index: 2; border-radius: 12px; padding: 4px 8px; background: #111c; color: #fff; font-size: 11px; pointer-events: none; }
.gallery-slide-count:empty { display: none; }
.app-page.reel-library-page .gallery-media-status:not(:empty) { position: absolute; top: 54px; left: 10px; right: 10px; z-index: 4; padding: 6px 8px; border-radius: 6px; background: #111e; color: #fff; font-size: 11px; pointer-events: none; }
.gallery-post-card { touch-action: pan-y; }
.gallery-mobile-tabs { display: none; }
@media (hover: hover) {
    .gallery-slide-arrow, .gallery-slide-count { opacity: 0; transition: opacity 150ms ease; }
    .reel-gallery-card:hover .gallery-slide-arrow, .reel-gallery-card:focus-within .gallery-slide-arrow,
    .reel-gallery-card:hover .gallery-slide-count, .reel-gallery-card:focus-within .gallery-slide-count { opacity: 1; }
    .gallery-post-card:hover .reel-card-copy { opacity: 0; }
}
.gallery-post-card:focus-within .reel-card-copy { opacity: 0; }
@media (max-width: 760px) {
    .reel-library-page .reel-gallery-grid { display: flex; flex-direction: column; }
    .gallery-reels { display: contents; }
    .gallery-reel-card { order: var(--gallery-order); }
    .gallery-posts { width: 100%; }
    .gallery-mobile-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
    .gallery-mobile-tabs button { padding: 8px 12px; }
    .gallery-mobile-tabs [aria-pressed="true"] { text-decoration: underline; }
    .reel-gallery-grid[data-mobile-section="reels"] .gallery-posts,
    .reel-gallery-grid[data-mobile-section="posts"] .gallery-reels { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .reel-library-page .reel-gallery-card, .reel-library-page .reel-gallery-card img,
    .reel-library-page .reel-card-copy { transition: none; transform: none; }
}

.reader-empty { max-width: 580px; padding-top: 12vh; }
.reader-empty h2 { margin: 0 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: 38px; font-weight: 500; }
.reader-empty p { color: var(--muted); line-height: 1.7; }

.reel-document { color: #20201e; font-family: Georgia, "Times New Roman", serif; font-size: 18px; line-height: 1.72; }
.reel-sidecar-data[hidden] { display: none; }
.document-header { margin-bottom: 54px; }
.document-kicker { margin: 0 0 12px; color: var(--accent); font-family: Inter, ui-sans-serif, sans-serif; font-size: 12px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.reel-document h1 { max-width: 800px; margin: 0 0 22px; font-size: clamp(38px, 6vw, 68px); font-weight: 500; letter-spacing: -.045em; line-height: 1.02; }
.reel-document h2 { margin: 56px 0 16px; padding-top: 16px; border-top: 1px solid var(--line); font-family: Inter, ui-sans-serif, sans-serif; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.reel-document p { margin: 0 0 1.15em; }
.reel-document ul { padding-left: 1.25em; }
.reel-document a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.document-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0; }
.document-actions a, .document-actions button { border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; background: transparent; color: var(--ink); font-family: Inter, ui-sans-serif, sans-serif; font-size: 12px; text-decoration: none; cursor: pointer; }
.document-actions a:hover, .document-actions button:hover { border-color: var(--accent); color: var(--accent); }
.document-actions .spotify-brand-link { display: inline-grid; width: 36px; height: 36px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: #1ed760; background: #121212; }
.document-actions .spotify-brand-link:hover { color: #1fdf64; background: #000; transform: translateY(-1px); }
.spotify-brand-link svg { display: block; width: 36px; height: 36px; overflow: visible; }
.spotify-brand-link circle { fill: currentColor; }
.spotify-brand-link path { fill: #121212; }
.document-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 30px 0 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: Inter, ui-sans-serif, sans-serif; }
.document-meta div { min-width: 0; }
.document-meta dt { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.document-meta dd { margin: 5px 0 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.resource-list { padding: 0 !important; list-style: none; }
.resource-list > li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.resource-list .resource-type { display: block; margin-bottom: 4px; color: var(--muted); font-family: Inter, ui-sans-serif, sans-serif; font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.resource-list > li > a { font-size: 21px; }
.resource-list > li > p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.claim-list > li { margin: 18px 0; }
.confidence { margin-left: 8px; color: var(--muted); font-family: Inter, ui-sans-serif, sans-serif; font-size: 11px; text-transform: uppercase; }
.transcript { color: #363532; font-size: 16px; line-height: 1.8; }
.reel-audio-card { margin: 30px 0 8px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f6f5f1; }
.reel-audio-card h2 { margin: 0 0 12px; padding: 0; border: 0; }
.reel-audio-card .audio-identity { margin: 0 0 12px; font-family: Inter, ui-sans-serif, sans-serif; font-size: 14px; font-weight: 650; }
.reel-audio-card audio { display: block; width: min(100%, 520px); height: 36px; }
.audio-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-family: Inter, ui-sans-serif, sans-serif; font-size: 12px; }
.source-list { font-size: 15px; word-break: break-word; }
.justwatch-panel { display: grid; gap: 13px; margin: 24px 0 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.justwatch-widget-shell { min-height: 52px; overflow: hidden; border-radius: 7px; }
.justwatch-widget-shell .jw-widget-iframe { display: block; width: 100%; border: 0; }
.justwatch-panel-copy { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: Inter, ui-sans-serif, sans-serif; }
.justwatch-panel-copy > span { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.justwatch-panel-copy small { flex-basis: 100%; color: var(--muted); font-size: 11px; line-height: 1.5; }
.reel-document .justwatch-brand-link { display: inline-flex; align-items: center; min-height: 34px; border: 1px solid #fbc500; border-radius: 999px; padding: 7px 13px; background: #fbc500; color: #111; font: 800 12px/1 Inter, ui-sans-serif, sans-serif; letter-spacing: .01em; text-decoration: none; }
.reel-document .justwatch-brand-link:hover { border-color: #ffd82f; background: #ffd82f; color: #000; transform: translateY(-1px); }
.resource-hero { display: grid; gap: 9px; max-width: 680px; margin: 4px 0 34px; }
.resource-hero img { display: block; width: 100%; max-height: 720px; border: 1px solid var(--line); border-radius: 9px; object-fit: contain; background: #eceae4; }
.resource-hero figcaption { color: var(--muted); font-family: Inter, ui-sans-serif, sans-serif; font-size: 11px; }
.resource-media-section > p { color: var(--muted); font-size: 15px; }
.youtube-match-grid { display: grid; gap: 12px; }
.youtube-match { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #f6f5f1; }
.youtube-match summary { display: grid; grid-template-columns: minmax(150px, 240px) minmax(0, 1fr); gap: 15px; align-items: center; padding: 12px; cursor: pointer; list-style: none; }
.youtube-match summary::-webkit-details-marker { display: none; }
.youtube-match summary img { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; object-fit: cover; background: #ddd; }
.youtube-match summary > span { display: grid; gap: 5px; min-width: 0; }
.youtube-match summary small, .youtube-match summary > span > span { color: var(--muted); font-family: Inter, ui-sans-serif, sans-serif; font-size: 11px; }
.youtube-match summary strong { font-size: 19px; line-height: 1.25; }
.youtube-match-detail { padding: 0 12px 15px; }
.youtube-match-detail > p { color: var(--muted); font-size: 14px; }
.youtube-match-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-family: Inter, ui-sans-serif, sans-serif; font-size: 12px; }
.youtube-match-actions > a:not(.youtube-brand-link) { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; text-decoration: none; }
.youtube-match-detail .youtube-brand-link { display: inline-grid; width: 48px; height: 34px; place-items: center; color: #ff0033; border: 0; border-radius: 9px; background: transparent; }
.youtube-match-detail .youtube-brand-link:hover { color: #e6002e; transform: translateY(-1px); }
.youtube-brand-link img { display: block; width: 34px; height: 34px; border-radius: 7px; object-fit: contain; }
.youtube-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 12px 0; overflow: hidden; border-radius: 7px; background: #111; }
.youtube-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.youtube-profile-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 28px 0; overflow: hidden; border-radius: 9px; background: #111; }
.youtube-profile-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.youtube-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.youtube-library-card {
    position: relative;
    min-width: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0;
    background: #373a37;
    color: white;
    text-align: left;
    cursor: pointer;
}
.youtube-library-card:hover, .youtube-library-card:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.youtube-library-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.youtube-library-card:hover img { transform: scale(1.025); }
.youtube-library-card .reel-card-copy { gap: 3px; padding: 12px; }
.youtube-library-card small { color: #d9eee5; font-family: Inter, ui-sans-serif, sans-serif; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.youtube-library-card strong { overflow: hidden; font-size: 16px; font-weight: 500; line-height: 1.18; text-overflow: ellipsis; white-space: nowrap; }
.youtube-library-card .reel-card-copy > span { overflow: hidden; color: rgba(255,255,255,.86); font-family: Inter, ui-sans-serif, sans-serif; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.youtube-source-list { display: grid; gap: 1px; padding: 0 !important; border: 1px solid var(--line); background: var(--line); list-style: none; }
.youtube-source-list li { display: grid; gap: 3px; padding: 13px 15px; background: var(--panel); }
.youtube-source-list span { color: var(--muted); font-family: Inter, ui-sans-serif, sans-serif; font-size: 11px; }
.article-link-list { display: grid; gap: 1px; padding: 0 !important; border: 1px solid var(--line); background: var(--line); list-style: none; }
.article-link-list li { display: grid; gap: 3px; padding: 13px 15px; background: var(--panel); }
.article-link-list span { color: var(--muted); font-family: Inter, ui-sans-serif, sans-serif; font-size: 11px; }
.artifact-reel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.artifact-reel-card {
    position: relative;
    min-width: 0;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0;
    background: #373a37;
    color: white;
    text-align: left;
    cursor: pointer;
}
.artifact-reel-card:hover, .artifact-reel-card:focus-visible { border-color: var(--accent); outline: none; }
.artifact-reel-card .reel-card-copy { gap: 4px; padding: 12px; }
.artifact-reel-card strong { overflow-wrap: anywhere; font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-weight: 500; line-height: 1.18; }
.artifact-reel-card .reel-card-copy > span { overflow: hidden; color: rgba(255,255,255,.86); font-family: Inter, ui-sans-serif, sans-serif; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.related-resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.related-resource-card { display: grid; align-content: start; gap: 5px; min-width: 0; min-height: 94px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); text-decoration: none; }
.related-resource-card:hover, .related-resource-card:focus-visible { border-color: var(--accent); transform: translateY(-1px); outline: none; }
.related-resource-card small { color: var(--muted); font: 800 9px/1.3 Inter, ui-sans-serif, sans-serif; letter-spacing: .09em; text-transform: uppercase; }
.related-resource-card strong { overflow-wrap: anywhere; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 500; line-height: 1.18; }
.related-resource-card span { color: var(--muted); font: 600 10px/1.4 Inter, ui-sans-serif, sans-serif; }
.artifact-index-list { margin: 0; padding: 0 !important; list-style: none; }
.artifact-index-list > li { padding: 20px 0; border-bottom: 1px solid var(--line); }
.artifact-index-list h3 { margin: 0 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 500; }
.artifact-index-list p { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.list-index-list { margin: 0; padding: 0 !important; list-style: none; }
.list-index-list > li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.list-index-list > li > a { font-family: Georgia, "Times New Roman", serif; font-size: 22px; }
.list-index-list > li > p { margin: 6px 0; color: var(--muted); }
.list-index-list > li > span { color: var(--muted); font: 700 11px/1.4 Inter, ui-sans-serif, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.recreated-list { margin: 0; padding-left: 34px !important; counter-reset: recreated-list; }
.recreated-list > li { padding: 15px 0 15px 8px; border-bottom: 1px solid var(--line); }
.recreated-list > li > a { font-family: Georgia, "Times New Roman", serif; font-size: 22px; }
.recreated-list > li > p { margin: 6px 0 0; color: var(--muted); }
.artifact-source { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-family: Inter, ui-sans-serif, sans-serif; font-size: 12px; }
.empty-artifact { color: var(--muted); font-style: italic; }

.empty-message { padding: 20px; color: var(--muted); font-size: 13px; }
.error-message { color: var(--danger); }

.status-document { color: #24231f; font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.6; }
.status-document h1 { margin: 0 0 16px; font-size: clamp(38px, 6vw, 64px); font-weight: 500; letter-spacing: -.045em; line-height: 1; }
.status-document h2 { margin: 48px 0 14px; padding-top: 14px; border-top: 1px solid var(--line); font-family: Inter, ui-sans-serif, sans-serif; font-size: 13px; letter-spacing: .09em; text-transform: uppercase; }
.health-list { display: grid; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.health-row { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 13px 15px; background: var(--panel); font-family: Inter, ui-sans-serif, sans-serif; }
.health-row strong { font-size: 13px; text-transform: capitalize; }
.health-row p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.health-mark { color: var(--danger); font-weight: 800; }
.health-row.is-ok .health-mark { color: #2f765b; }
.status-totals, .emoji-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); background: var(--line); }
.status-totals div, .emoji-map div { padding: 14px; background: var(--panel); }
.status-totals dt, .emoji-map dt { color: var(--muted); font-family: Inter, ui-sans-serif, sans-serif; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.status-totals dd { margin: 5px 0 0; font-size: 28px; }
.emoji-map dd { margin: 6px 0 0; font-size: 19px; }
.emoji-map dd span { margin-left: 5px; color: var(--muted); font-family: Inter, ui-sans-serif, sans-serif; font-size: 11px; }
.status-log { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.status-log li { display: grid; gap: 3px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.status-log strong { font-family: Inter, ui-sans-serif, sans-serif; font-size: 13px; }
.status-log span { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.status-log p { margin: 2px 0 0; color: var(--danger); font-size: 13px; }
.self-test-results { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--soft); font-family: Inter, ui-sans-serif, sans-serif; font-size: 12px; }
.self-test-results strong { font-size: 13px; }
.self-test-results ol { display: grid; gap: 5px; margin: 9px 0; padding-left: 18px; }
.self-test-results li.is-ok { color: #245c48; }
.self-test-results li.is-error { color: var(--danger); }
.self-test-results > p:last-child { margin: 7px 0 0; color: var(--muted); }

.file-tree,
.reader-scroll,
.reel-creator-card,
.comments-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.file-tree::-webkit-scrollbar,
.reader-scroll::-webkit-scrollbar,
.reel-creator-card::-webkit-scrollbar,
.comments-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

@media (max-width: 760px) {
    .youtube-match summary { grid-template-columns: 1fr; }
    .library-app { grid-template-columns: 42% minmax(0, 1fr); }
    .library-brand { padding: 16px 14px; }
    .library-brand p:last-child, .library-nav { display: none; }
    .library-controls { grid-template-columns: 1fr; padding: 9px; }
    .library-controls button { display: none; }
    .tree-toolbar { padding: 8px 10px; }
    .reader-bar { padding: 10px 14px; }
    .reader-content { padding: 28px 18px 70px; }
    .reel-gallery-grid { grid-template-columns: 1fr; }
    .youtube-library-grid { grid-template-columns: 1fr; }
    .artifact-reel-grid, .related-resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reel-document { font-size: 16px; }
    .reel-document h1 { font-size: 34px; }
    .document-meta { grid-template-columns: 1fr; gap: 10px; }
    .reader-workspace.has-reel-media { grid-template-columns: minmax(0, 1fr); grid-template-rows: 58vh minmax(0, 1fr); }
    .reader-workspace.has-reel-media .reel-media-panel { grid-row: 1; width: calc(100% - 24px); height: calc(100% - 20px); margin: 10px 12px; grid-template-rows: minmax(0, var(--reel-media-height, 54%)) auto minmax(0, 1fr); }
    .reader-workspace.has-reel-media .reader-scroll { grid-row: 2; }
}

@media (min-width: 761px) and (max-width: 1120px) {
    .reel-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .youtube-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

html.dark-mode .library-sidebar,
html.dark-mode .reader-pane { background: var(--panel); }
html.dark-mode .file-tree summary { color: var(--ink); }
html.dark-mode .file-tree summary:hover,
html.dark-mode .file-entry:hover { background: rgba(255,255,255,.08); }
html.dark-mode .tree-children { border-color: var(--line); }
html.dark-mode .file-entry.is-selected { color: var(--ink); }
html.dark-mode .reel-document,
html.dark-mode .status-document { color: var(--ink); }
html.dark-mode .reel-description,
html.dark-mode .captured-comment p,
html.dark-mode .transcript { color: #d3d1c9; }
html.dark-mode .reel-audio-card,
html.dark-mode .youtube-match,
html.dark-mode .resource-hero img { background: var(--soft); }
html.dark-mode .youtube-match summary img { background: #303431; }

@media (max-width: 760px) {
    .library-app { display: block; height: 100dvh; }
    .library-app.nav-collapsed .library-sidebar { display: flex; }
    .library-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(88vw, 360px); height: 100dvh; border-right: 1px solid var(--line); box-shadow: 18px 0 45px rgba(0,0,0,.22); transform: translateX(-105%); transition: transform 180ms ease; }
    .library-app:not(.nav-collapsed) .library-sidebar { transform: translateX(0); }
    .library-app:not(.nav-collapsed)::after { content: ""; position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.42); pointer-events: none; }
    .library-brand { padding: 18px 16px 14px; }
    .library-brand p:last-child, .library-nav { display: block; }
    .library-nav { gap: 10px; margin-top: 13px; }
    .library-controls { grid-template-columns: minmax(0, 1fr) auto; padding: 10px; }
    .library-controls label { grid-column: 1 / -1; }
    .library-controls .text-button { display: inline-flex; justify-content: center; }
    .tree-toolbar { padding: 9px 10px; }
    .reader-pane { width: 100vw; height: 100dvh; }
    .reader-bar { position: relative; z-index: 25; min-height: 54px; gap: 8px; padding: 9px 12px; }
    .reader-path { font-size: 11px; }
    .reader-status { max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .reader-content { padding: 26px 16px 64px; }
    .folder-page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .folder-page-card { min-height: 78px; padding: 11px; }
    .folder-page-card-name { font-size: 15px; }
}
