:root {
  color-scheme: dark;
  --bg: #0c0d10;
  --surface: #16171c;
  --surface-hover: #1e2026;
  --line: #1f2127;
  --line-field: #26282f;
  --line-strong: #2e3038;
  --text: #ecedf1;
  --text-2: #c9cad2;
  --muted: #9a9ca7;
  --subtle: #6f717c;
  --disabled: #4a4c55;
  --accent: #b3a4ff;
  --saved-bg: #1b1926;
  --saved-line: #3a3450;
  --saved-text: #d6ceff;
  --error: #ffadad;
  --chip: rgba(12, 13, 16, .72);
  --placeholder: #1b1c22;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--bg); color: var(--text); }
body.overlay-open { overflow: hidden; }
:root:has(> body.overlay-open) { overscroll-behavior-x: none; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
input { font: inherit; }
img, video { display: block; max-width: 100%; }

.topbar { position: sticky; z-index: 20; top: 0; height: 56px; border-bottom: 1px solid var(--line); background: var(--bg); }
.topbar-inner { width: min(1440px, 100%); height: 100%; margin: auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; flex: none; align-items: center; gap: 9px; min-height: 44px; font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.brand-free { color: var(--text); }
.brand-accent { color: var(--accent); }
.brand-mark { display: grid; grid-template-columns: repeat(2, 6px); grid-template-rows: repeat(2, 6px); gap: 2px; transform: rotate(-12deg); }
.brand-mark span { background: var(--accent); border-radius: 1.5px; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { opacity: .48; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search-form { flex: 0 1 520px; min-width: 0; margin: 0; }
.search-field { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 10px; border: 1px solid var(--line-field); border-radius: 8px; background: var(--surface); color: var(--muted); }
.search-field:focus-within { border-color: #4a4466; box-shadow: 0 0 0 3px rgba(179, 164, 255, .18); }
.search-icon { width: 16px; height: 16px; flex: none; }
.search-input { flex: 1; min-width: 0; height: 32px; padding: 0; border: 0; outline: none; background: transparent; color: var(--text); font-size: 14px; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-input::placeholder { color: var(--muted); }
.search-hint { padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); font: 12px system-ui, sans-serif; }
.search-clear { position: relative; width: 28px; height: 28px; padding: 7px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.search-clear::before { content: ""; position: absolute; inset: -8px; }
.search-clear svg { display: block; width: 14px; height: 14px; }
.search-clear:hover { background: var(--surface-hover); color: var(--text); }
.search-cancel { display: none; }
.favorites-link { display: inline-flex; align-items: center; gap: 8px; height: 36px; margin-left: auto; padding: 0 10px; border-radius: 8px; color: var(--text-2); font-size: 14px; }
.favorites-link:hover { background: var(--surface); }
.bookmark-icon { width: 16px; height: 16px; flex: none; }
.favorites-count { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #1f2027; font-size: 12px; text-align: center; }
.favorites-link[aria-current="page"] { background: var(--saved-bg); color: #fff; }
.favorites-link[aria-current="page"] .bookmark-icon { fill: var(--accent); stroke: var(--accent); }
.favorites-link[aria-current="page"] .favorites-count { background: #2a2640; }
.page { width: min(1440px, 100%); min-height: calc(100vh - 121px); margin: auto; padding: 0 24px 64px; }
.page-bar { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.page-bar h1 { min-width: 0; margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.page-bar-pager { display: flex; align-items: center; gap: 2px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.page-bar-pager-label { padding: 0 4px; }
.pager-label-short { display: none; }
.pager-arrow { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 6px; color: var(--text-2); }
.pager-arrow svg { width: 16px; height: 16px; }
.pager-arrow:hover { background: var(--surface); }
.pager-arrow.is-disabled { color: var(--disabled); }
.saved-note { color: var(--muted); font-size: 13px; }
.saved-bar { flex-wrap: wrap; }
.saved-tools { display: flex; gap: 8px; margin-left: auto; }
.saved-tools [hidden] { display: none; }
.saved-feedback { margin: 0 0 16px; color: var(--text-2); font-size: 13px; }
.saved-feedback:empty { display: none; }
.saved-feedback.is-error { color: var(--error); }
.pagination { margin-top: 32px; }
.pagination-links { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.page-link { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 8px; color: var(--text-2); font-size: 13px; }
.page-link:hover { background: var(--surface); }
.page-link[aria-current="page"] { background: var(--saved-bg); color: var(--saved-text); font-weight: 600; }
.page-link.is-disabled { color: var(--disabled); }
.page-gap { padding: 0 6px; color: var(--subtle); }
.album-heading { display: flex; flex-direction: column; gap: 8px; padding: 18px 0 20px; }
.album-back { position: relative; display: inline-flex; align-self: flex-start; align-items: center; gap: 2px; min-height: 32px; color: var(--muted); font-size: 13px; }
.album-back::before { content: ""; position: absolute; inset: -6px 0; }
.album-back svg { width: 16px; height: 16px; }
.album-back:hover { color: var(--text); }
.album-heading-main { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.album-heading h1 { max-width: 880px; margin: 0; font-size: 22px; line-height: 28px; font-weight: 600; overflow-wrap: anywhere; }
.album-file-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.album-favorite { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; }
.album-favorite::before { content: ""; position: absolute; inset: -6px 0; }
.album-favorite:hover { border-color: #3a3c46; background: var(--surface-hover); color: #fff; }
.album-favorite.is-saved { border-color: var(--saved-line); background: var(--saved-bg); color: var(--saved-text); }
.album-filter { display: inline-flex; flex: none; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.album-filter-option { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 13px; cursor: pointer; }
.album-filter-option::before { content: ""; position: absolute; inset: -4px 0; }
.album-filter-option:hover { color: var(--text); }
.album-filter-option[aria-pressed="true"] { background: var(--line-strong); color: var(--text); }
.album-filter-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.album-filter-option:disabled { cursor: default; color: var(--disabled); }
.album-filter-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.album-filter-option[aria-pressed="true"] .album-filter-count { color: var(--text-2); }
.album-filter-feedback { color: var(--error); font-size: 13px; }
.album-filter-feedback:empty { display: none; }
.favorite-feedback { color: var(--error); font-size: 13px; }
.favorite-feedback:empty { display: none; }
.empty-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.grid { display: grid; }
.album-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); column-gap: 16px; row-gap: 22px; }
.file-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.album-sentinel { display: block; width: 100%; min-height: 40px; margin-top: 24px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; }
.album-sentinel:hover { background: var(--surface-hover); }
.album-sentinel.load-error { color: var(--error); }
.album-card-shell { position: relative; min-width: 0; }
.album-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; border-radius: 8px; }
.album-card:focus-visible { outline-offset: 4px; }
.album-card .card-thumb { aspect-ratio: 4 / 3; border-radius: 6px; }
.card-favorite { position: absolute; z-index: 2; top: 6px; right: 6px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: var(--chip); color: #fff; cursor: pointer; opacity: 0; }
.card-favorite::before { content: ""; position: absolute; inset: -6px; }
.card-favorite .bookmark-icon { width: 16px; height: 16px; }
.card-favorite.is-saved { color: var(--accent); opacity: 1; }
.card-favorite:focus-visible, .album-card-shell:focus-within .card-favorite { opacity: 1; }
.card-favorite-feedback { display: block; margin-top: 4px; color: var(--error); font-size: 12px; }
.card-favorite-feedback:empty { display: none; }
.card-thumb { position: relative; overflow: hidden; background: var(--placeholder); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb.thumb-empty { background: #17181d; }
.card-thumb.thumb-empty::after { content: "No preview"; position: absolute; inset: 0; display: grid; place-content: center; color: var(--muted); font-size: 12px; text-align: center; }
.card-thumb.thumb-error::after { content: "Preview unavailable"; }
.card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 4px; }
.card-title { display: -webkit-box; margin: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--text); font-size: 13px; font-weight: 500; line-height: 18px; overflow-wrap: anywhere; }
.card-meta { color: var(--muted); font-size: 12px; line-height: 16px; }
.file-card { position: relative; display: block; min-width: 0; aspect-ratio: 1; border-radius: 4px; background: var(--placeholder); }
.file-card:focus-visible { z-index: 2; outline-offset: 2px; }
.file-card .card-thumb { width: 100%; height: 100%; border-radius: inherit; }
.type-badge { position: absolute; z-index: 1; top: 6px; left: 6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--chip); color: #fff; }
.type-badge svg { display: block; }
.extension-badge { width: auto; height: 20px; padding: 0 6px; border-radius: 5px; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.file-caption { position: absolute; top: calc(100% - 28px); right: 0; left: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; padding: 6px 8px; border-radius: 0 0 4px 4px; background: rgba(12, 13, 16, .82); backdrop-filter: blur(6px); font-size: 12px; line-height: 16px; opacity: 0; pointer-events: none; }
.file-name { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.file-size { flex: none; color: var(--muted); white-space: nowrap; }
.file-card:focus-visible .file-caption { opacity: 1; pointer-events: auto; }
@media (hover: hover) {
  .album-card-shell:hover .card-favorite { opacity: 1; }
  .album-card:hover .card-thumb { box-shadow: 0 0 0 1px rgba(255, 255, 255, .28); }
  .album-card:hover .card-title { text-decoration: underline; }
  .file-card:hover { z-index: 2; }
  .file-card:hover .file-caption { opacity: 1; pointer-events: auto; }
}
@media (hover: none) {
  .card-favorite:not(.is-saved) { pointer-events: none; }
  .card-favorite.is-saved { top: 0; right: 0; width: 44px; height: 44px; background: transparent; }
  .card-favorite.is-saved .bookmark-icon { width: 28px; height: 28px; padding: 6px; border-radius: 8px; background: var(--chip); }
}
.file-overlay { --video-controls-lift: 16px; --video-controls-bottom: calc(var(--video-controls-lift) + env(safe-area-inset-bottom) + var(--viewport-bottom-overlap, 0px)); position: fixed; z-index: 100; inset: 0; display: flex; flex-direction: column; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; background: #030305; color: #fff; overscroll-behavior-y: contain; }
.file-overlay:fullscreen { width: 100%; height: 100%; }
.overlay-header { position: relative; z-index: 5; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(4px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); background: #030305; }
.file-overlay.is-video .overlay-header { position: absolute; top: 0; right: 0; left: 0; background: transparent; }
.overlay-info { display: flex; flex: 1 1 auto; flex-direction: column; justify-content: center; min-width: 0; gap: 2px; touch-action: manipulation; }
.overlay-label { overflow: hidden; font-size: 14px; font-weight: 600; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.debug-panel { position: absolute; z-index: 10; top: 50%; left: 50%; display: grid; gap: 12px; width: min(320px, calc(100% - 32px)); padding: 16px; border-radius: 12px; background: #16171c; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.5); transform: translate(-50%, -50%); }
.debug-panel-count { margin: 0; font-size: 14px; text-align: center; }
.debug-panel-button { min-height: 44px; }
.gallery-counter { color: #ddd; font-size: 12px; line-height: 16px; }
.overlay-tools { display: flex; flex: none; gap: 2px; }
.overlay-tool { display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 10px; background: transparent; color: #ffffffe0; cursor: pointer; transition: background .16s, color .16s; }
.overlay-tool:hover, .overlay-tool:focus-visible, .overlay-tool[aria-expanded="true"] { background: #ffffff1c; color: #fff; }
.overlay-tool:focus-visible { outline-offset: -2px; }
.overlay-tool[hidden] { display: none; }
.gallery-stage { position: relative; flex: 1 1 0; min-height: 0; display: grid; place-items: center; overflow: clip; touch-action: none; }
.gallery-stage[data-zone] { cursor: pointer; }
.gallery-peek { position: absolute; inset: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; pointer-events: none; }
.gallery-peek img { width: 100%; max-width: 1440px; height: 100%; object-fit: contain; }
.gallery-peek img.is-full { width: auto; height: auto; max-width: 100%; max-height: 100%; }
.viewer { position: relative; width: 100%; height: 100%; display: grid; place-items: center; overflow: clip; }
.viewer-media { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
video.viewer-media { width: min(100%, 1440px); height: 100%; touch-action: auto; }
video.viewer-media:focus { outline: none; }
.video-status { position: absolute; z-index: 4; top: 50%; left: 50%; display: flex; align-items: center; gap: 12px; max-width: min(90vw, 440px); padding: 12px 16px; border-radius: 10px; background: #111c; color: #fff; font-size: 13px; text-align: center; transform: translate(-50%, -50%); }
.video-status[hidden] { display: none; }
.video-retry { padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; color: #c4baff; cursor: pointer; white-space: nowrap; }
.video-retry:hover, .video-retry:focus-visible { background: #ffffff1c; color: #fff; }
.video-scrim { position: absolute; z-index: 1; right: 0; left: 0; pointer-events: none; }
.video-scrim-top { top: 0; height: calc(120px + env(safe-area-inset-top)); background: linear-gradient(to bottom, rgba(0,0,0,.72) 0, rgba(0,0,0,.4) 50%, rgba(0,0,0,0) 100%); }
.video-scrim-bottom { bottom: 0; height: calc(var(--video-controls-bottom) + 128px); background: linear-gradient(to top, rgba(0,0,0,.78) 0, rgba(0,0,0,.5) 55%, rgba(0,0,0,0) 100%); }
.video-skip { position: absolute; z-index: 3; top: 50%; display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 16px; border-radius: 24px; background: rgba(12,13,16,.6); color: #fff; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden; transform: translate(-50%, -50%); transition: opacity .16s cubic-bezier(.2,.8,.2,1), visibility 0s linear .16s; }
.video-skip-back { left: 16.667%; }
.video-skip-forward { left: 83.333%; }
.video-skip.is-visible { opacity: 1; visibility: visible; transition: opacity .16s cubic-bezier(.2,.8,.2,1); }
.video-controls { position: absolute; z-index: 5; right: max(16px, env(safe-area-inset-right)); bottom: var(--video-controls-bottom); left: max(16px, env(safe-area-inset-left)); max-width: 1440px; margin: 0 auto; }
.video-seek { display: block; width: 100%; height: 44px; margin: 0; padding: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; touch-action: none; }
.video-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) 0 var(--played, 0%), rgba(255,255,255,.42) var(--played, 0%) var(--buffered, 0%), rgba(255,255,255,.2) var(--buffered, 0%) 100%); }
.video-seek::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) 0 var(--played, 0%), rgba(255,255,255,.42) var(--played, 0%) var(--buffered, 0%), rgba(255,255,255,.2) var(--buffered, 0%) 100%); }
.video-seek::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); appearance: none; -webkit-appearance: none; }
.video-seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.video-seek.is-scrubbing::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -7px; }
.video-seek.is-scrubbing::-moz-range-thumb { width: 18px; height: 18px; }
.video-seek:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.video-seek:disabled { cursor: default; }
.video-seek:disabled::-webkit-slider-thumb { visibility: hidden; }
.video-seek:disabled::-moz-range-thumb { visibility: hidden; }
.video-controls-row { display: flex; align-items: center; gap: 6px; height: 44px; margin: 0 -11px; }
.video-controls-spacer { flex: 1 1 auto; }
.video-control { display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer; }
.video-control:hover { background: #ffffff1c; }
.video-control:focus-visible, .video-speed-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.video-speed { position: relative; }
.video-speed-toggle { width: auto; min-width: 48px; padding: 0 8px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.video-time { font-size: 14px; line-height: 18px; font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; }
.video-speed-menu { position: absolute; right: 0; bottom: calc(100% + 6px); display: flex; flex-direction: column; min-width: 132px; padding: 6px; border-radius: 12px; background: rgba(22,23,28,.97); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.video-speed-menu[hidden] { display: none; }
.video-speed-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; text-align: left; cursor: pointer; }
.video-speed-item:hover, .video-speed-item:focus-visible { background: #ffffff1c; }
.video-speed-item[aria-checked="true"] { color: var(--accent); }
.video-center, .video-spinner { position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.video-center { display: grid; width: 72px; height: 72px; place-items: center; border: 0; border-radius: 50%; background: rgba(12,13,16,.6); color: #fff; cursor: pointer; }
.video-center:active { transform: translate(-50%, -50%) scale(.94); }
.video-spinner { display: none; width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: video-spin .8s linear infinite; pointer-events: none; }
.file-overlay.is-waiting .video-center { display: none; }
.file-overlay.is-waiting .video-spinner { display: block; }
.file-overlay.is-video .overlay-header, .video-scrim, .video-controls, .video-center { opacity: 1; visibility: visible; transition: opacity .16s cubic-bezier(.2,.8,.2,1); }
.file-overlay.video-chrome-hidden .overlay-header, .file-overlay.video-chrome-hidden .video-scrim, .file-overlay.video-chrome-hidden .video-controls, .file-overlay.video-chrome-hidden .video-center { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .16s cubic-bezier(.2,.8,.2,1), visibility 0s linear .16s; }
.file-overlay.is-scrubbing .overlay-header, .file-overlay.is-scrubbing .video-scrim-top, .file-overlay.is-scrubbing .video-center, .file-overlay.is-scrubbing .video-spinner { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .16s cubic-bezier(.2,.8,.2,1), visibility 0s linear .16s; }
.file-overlay.is-zoomed .gallery-stage { cursor: grab; }
.file-overlay.is-panning .gallery-stage { cursor: grabbing; }
@media (hover: hover) { .file-overlay.video-chrome-hidden .gallery-stage { cursor: none; } }
.viewer-unavailable { max-width: 540px; padding: 40px; color: #bbb; text-align: center; }
.overlay-loading, .overlay-error { color: #bbb; text-align: center; }
.overlay-error { color: #ffadad; }
.gallery-edges { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.gallery-edge { position: absolute; top: 50%; display: grid; width: 1px; height: 1px; overflow: hidden; place-items: center; border: 0; border-radius: 12px; background: #000000a0; color: #fff; clip-path: inset(50%); pointer-events: auto; }
.gallery-edge.previous { left: 8px; }
.gallery-edge.next { right: 8px; }
.gallery-edge:focus-visible { width: 48px; height: 96px; overflow: visible; clip-path: none; transform: translateY(-50%); outline-offset: -3px; }
.gallery-chevron { display: grid; width: 44px; height: 56px; place-items: center; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 50px; font-weight: 200; line-height: 1; }
.gallery-drawer { position: absolute; z-index: 4; top: calc(52px + env(safe-area-inset-top)); right: 0; left: 0; max-height: min(60vh, 560px); max-height: min(60dvh, 560px); overflow-y: auto; padding: 20px 20px 24px; border-bottom: 1px solid #ffffff44; background: #14141bf5; overscroll-behavior: contain; }
.gallery-drawer[hidden] { display: none; }
.gallery-drawer .related-section { width: min(1440px, 100%); margin: auto; }
@supports (width: 1cqw) {
  .gallery-stage { container-type: size; }
  .viewer-image { max-width: 100cqw; max-height: 100cqh; }
  .file-overlay.is-video video.viewer-media { width: min(100cqw, 1440px, 100cqh * var(--video-ratio, 1.7778)); height: auto; max-height: 100cqh; aspect-ratio: var(--video-ratio, 1.7778); }
}
.related-title { margin: 0 0 20px; font-size: 21px; letter-spacing: -.02em; }
.related-more { display: flex; width: 100%; min-height: 40px; margin-top: 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; }
.button:hover { background: var(--surface-hover); }
.state { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; color: var(--muted); }
.state p { max-width: 460px; margin: 0; line-height: 1.6; }
.state h1 { margin: 0; color: var(--text); font-size: 24px; }
.state-error { gap: 13px; }
.state-error .button { margin-top: 10px; }
.spinner { width: 26px; height: 26px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.empty { margin: 18px 0; color: var(--muted); font-size: 14px; }
.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 24px; width: min(1440px, 100%); margin: auto; padding: 6px 24px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 12px; }
.footer-text { padding: 8px 0; }
.footer-links { display: flex; margin: 0 -8px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; border-radius: 6px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer-links a:hover { color: var(--text); }
.footer-links a[aria-current="page"] { color: var(--text); text-decoration: none; }
.legal p, .legal ul { max-width: 68ch; margin: 0 0 14px; color: var(--text-2); font-size: 14px; line-height: 22px; }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 4px; }
.legal .legal-contact { margin: -6px 0 8px; }
.legal-contact a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.page-end { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 40px; padding: 14px 0 16px; border-top: 1px solid var(--line); }
.page-end-label { color: var(--muted); font-size: 11px; line-height: 14px; letter-spacing: .08em; text-transform: uppercase; }
.page-end-box { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; width: 300px; max-width: 100%; min-height: 300px; overflow: hidden; }
.page-end-box[data-tile] { min-height: 250px; }
.page-end-box > ins { display: block; }
.page-end-box.is-placeholder { justify-content: center; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 12px; }
.page-end-link { display: block; max-width: 100%; }
.page-end-link img { display: block; max-width: 100%; height: auto; }
@media (min-width: 960px) { .page-end-box { width: 900px; min-height: 250px; } }
.page:has(> .page-end:last-child) { min-height: 0; padding-bottom: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes video-spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@media (max-width: 600px) {
  .topbar-inner { gap: 8px; padding: 0 6px 0 16px; }
  .brand { position: relative; display: grid; place-items: center; width: 28px; height: 44px; }
  .brand::before { content: ""; position: absolute; inset: 0 -8px; }
  .brand-name { display: none; }
  .brand-mark { grid-template-columns: repeat(2, 7px); grid-template-rows: repeat(2, 7px); }
  .search-form { flex: 1; }
  .search-field { height: 40px; border-radius: 10px; }
  .search-input { height: 36px; font-size: 16px; }
  .search-hint { display: none; }
  .favorites-link { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-left: 0; padding: 0; border-radius: 10px; }
  .favorites-link .bookmark-icon { width: 20px; height: 20px; }
  .favorites-text { display: none; }
  .favorites-count { position: absolute; top: 6px; right: 4px; min-width: 16px; padding: 0 4px; background: #2a2b33; color: var(--text); font-size: 10px; line-height: 16px; }
  .topbar.searching .topbar-inner { gap: 4px; padding-right: 4px; }
  .topbar.searching .brand, .topbar.searching .favorites-link { display: none; }
  .topbar.searching .search-cancel { display: inline-block; flex: none; height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--text-2); font-size: 15px; cursor: pointer; }
  .page { padding: 0 16px 56px; }
  .page-bar { justify-content: space-between; gap: 8px; min-height: 56px; }
  .page-bar h1 { font-size: 16px; line-height: 22px; }
  .page-bar-pager .pager-arrow { width: 44px; height: 44px; }
  .page-bar-pager .pager-arrow svg { width: 18px; height: 18px; }
  .pager-label-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pager-label-short { display: inline; }
  .pagination .page-link { min-width: 44px; height: 44px; }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; row-gap: 18px; }
  .file-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .album-heading { gap: 6px; padding: 10px 0 16px; }
  .album-heading h1 { flex-basis: 100%; font-size: 18px; line-height: 24px; }
  .album-heading-main { justify-content: space-between; gap: 8px 12px; }
  .album-favorite { height: 40px; padding: 0 14px 0 12px; border-radius: 10px; font-size: 14px; }
  .album-filter { border-radius: 10px; }
  .album-filter-option { height: 36px; padding: 0 14px; border-radius: 8px; font-size: 14px; }
  .file-card { border-radius: 3px; }
  .type-badge { top: 5px; left: 5px; width: 20px; height: 20px; border-radius: 5px; }
  .extension-badge { width: auto; }
  .related-more, .album-sentinel, .button { min-height: 44px; }
  .footer { padding: 6px 16px; }
  .page-end { margin-top: 32px; }
  .viewer-open { display: none; }
}
@media (pointer: coarse) {
  .file-overlay { --video-controls-lift: 50px; }
  .favorites-link, .album-favorite, .album-back, .search-cancel { min-height: 44px; }
  .album-filter-option { min-height: 40px; }
  .page-bar-pager .pager-arrow, .pagination .pager-arrow { width: 44px; height: 44px; }
  .pagination .page-link { min-width: 44px; height: 44px; }
  .search-field { height: 44px; }
  .search-clear { width: 44px; height: 44px; margin-right: -8px; padding: 15px; }
  .search-clear::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation-duration: 1.8s; }
  .video-spinner { animation-duration: 1.8s; }
  .video-skip, .video-skip.is-visible { transition: none; }
  .video-center:active { transform: translate(-50%, -50%); }
  .file-overlay.is-video .overlay-header, .video-scrim, .video-controls, .video-center,
  .file-overlay.video-chrome-hidden .overlay-header, .file-overlay.video-chrome-hidden .video-scrim,
  .file-overlay.video-chrome-hidden .video-controls, .file-overlay.video-chrome-hidden .video-center,
  .file-overlay.is-scrubbing .overlay-header, .file-overlay.is-scrubbing .video-scrim-top,
  .file-overlay.is-scrubbing .video-center, .file-overlay.is-scrubbing .video-spinner { transition: none; }
}
