/* Atlas / gallery edition. Layout tokens live here; no runtime styling library. */
:root {
  color-scheme: light;
  --bg: #fff; --sidebar: #fcfcfc; --surface: #f7f7f7; --hover: #f1f1f1; --shimmer: rgba(255,255,255,.07);
  --media: #373537; --media-text: #a9a7ab;
  --text: #202023; --muted: #737378; --subtle: #939398;
  --line: #ebebed; --line-strong: #dedee1; --selected: #eeeeef;
  --accent: #262628; --accent-text: #fff; --focus: #5d6c9a;
  --shadow: 0 1px 2px #0000000c; --shadow-pop: 0 12px 44px #00000016;
  --sidebar-width: 208px; --topbar-height: 72px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px; font-synthesis: none; -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171719; --sidebar: #141416; --surface: #202023; --hover: #28282c; --shimmer: rgba(255,255,255,.07);
  --text: #eeedef; --muted: #a4a3aa; --subtle: #8a8990;
  --line: #2a2a2f; --line-strong: #3a393f; --selected: #2b2b30;
  --accent: #ededef; --accent-text: #202023; --focus: #b7c4e9;
  --shadow: 0 1px 2px #00000033; --shadow-pop: 0 16px 48px #00000050;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; background: none; }
button, a { touch-action: manipulation; }
button:disabled { cursor: default; opacity: .3; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
svg { vertical-align: middle; flex-shrink: 0; }
kbd { font: 11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--muted); white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 14px; z-index: 300; padding: 12px; border-radius: 8px; background: var(--accent); color: var(--accent-text); }
.skip-link:focus { top: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 37px; padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); font-weight: 500; line-height: 1.3; white-space: nowrap; }
.button:hover { background: var(--hover); }
.button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); box-shadow: var(--shadow); }
.button.primary:hover { opacity: .9; }
.button.soft { background: var(--surface); }
.icon-btn, .small-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; padding: 0; border-radius: 9px; color: var(--muted); }
.icon-btn:hover, .small-icon:hover { background: var(--hover); color: var(--text); }
.small-icon { width: 28px; height: 28px; }
.small-icon svg { width: 16px; height: 16px; }
.text-action { color: var(--muted); padding: 5px 0; }
.text-action:hover { color: var(--text); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-width); display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--line); }
.brand { height: var(--topbar-height); flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 0 25px; }
#brand-name { font-size: 19px; font-weight: 720; letter-spacing: -.6px; white-space: nowrap; }
.sidebar-content { min-height: 0; flex: 1; overflow: auto; padding: 14px 14px 20px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 39px; padding: 9px 11px; border-radius: 10px; text-align: left; font-size: 12px; font-weight: 500; }
.nav-item > span:first-child { display: flex; color: var(--muted); }
.nav-item > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--selected); color: var(--text); }
.nav-item.active > span:first-child { color: var(--text); }
.count { margin-left: auto; font-size: 10px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
#all-assets .count { border: 1px solid var(--line-strong); padding: 2px 5px; border-radius: 6px; box-shadow: 0 1px 1px #00000008; }
.primary-nav { display: grid; gap: 3px; }
.nav-heading { display: flex; align-items: center; justify-content: space-between; margin: 25px 10px 7px; height: 22px; font-size: 11px; font-weight: 500; color: var(--muted); }
.nav-heading .small-icon { width: 22px; height: 22px; opacity: .6; }
.nav-heading:hover .small-icon, .nav-heading .small-icon:focus-visible { opacity: 1; }
#categories .nav-item { font-weight: 400; min-height: 35px; padding-block: 8px; font-size: 11.5px; gap: 10px; }
#categories .nav-item svg { width: 15px; height: 15px; }
#categories .count { opacity: .7; font-size: 10px; }
.collections-heading { margin-top: 27px; }
#collections .nav-item > span:first-child { color: #bb815c; }
#collections .nav-item:nth-child(3n+2) > span:first-child { color: #61937a; }
#collections .nav-item:nth-child(3n+3) > span:first-child { color: #8e83ad; }
.nav-loading { padding: 10px; color: var(--muted); font-size: 11px; }
.sidebar-bottom { padding: 12px 14px; }
.sidebar-bottom .nav-item { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.sidebar-bottom kbd { margin-left: auto; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 0 11px; color: var(--muted); font-size: 10px; }
.sidebar-foot > span { display: flex; align-items: center; gap: 12px; }
.library-actions .text-action { font-size: 11px; }
.library-actions .text-action:hover { color: var(--text); }
.status-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #72937b; flex-shrink: 0; }
.workspace { height: 100%; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }
.notice-banner { flex-shrink: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 0; margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
.notice-group { display: flex; flex-wrap: wrap; justify-content: center; }
.notice-group > * + *::before, .notice-group + .notice-group::before { content: '·'; margin: 0 8px; color: var(--subtle); }
@media (max-width:600px) {
  .notice-banner { padding: 7px 12px; font-size: 10.5px; }
  .notice-optional { display: none; }
  .notice-group { width: 100%; }
  .notice-group + .notice-group::before { content: none; }
}
.notice-banner a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.notice-banner a:hover { text-decoration-color: currentColor; }
.notice-banner a[hidden] { display: none; }
.topbar { height: var(--topbar-height); flex-shrink: 0; display: flex; align-items: center; gap: 21px; padding: 0 30px 0 23px; border-bottom: 1px solid var(--line); }
.search-wrap { display: flex; align-items: center; gap: 10px; width: 300px; height: 38px; padding: 0 8px 0 13px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); box-shadow: 0 1px 1px #00000004; }
.search-wrap > svg { width: 16px; height: 16px; color: var(--muted); }
.search-wrap:focus-within { border-color: var(--muted); }
#search { background: transparent; min-width: 0; flex: 1; border: 0; outline: none; height: 100%; padding: 0; font-size: 12px; }
#search::placeholder { color: var(--muted); }
#search::-webkit-search-cancel-button { display: none; }
.search-shortcut { padding: 2px 4px; border: 1px solid var(--line-strong); border-radius: 5px; box-shadow: var(--shadow); font-size: 10px; }
.search-wrap:has(.search-clear:not([hidden])) .search-shortcut { display: none; }
.search-clear { width: 22px; height: 24px; }
.top-actions { display: flex; align-items: center; gap: 23px; margin-left: auto; }
.source-button { font-size: 11px; background: var(--surface); min-height: 36px; }
.source-button svg { width: 14px; height: 14px; }
.main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 32px; }
.page-heading { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: center; align-content: center; padding: 22px 0 20px; flex-shrink: 0; }
.heading-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.collection-manage:not([hidden]) + .heading-controls { margin-left: 0; }
.clear-category { width: 24px; height: 24px; color: var(--muted); }
.clear-category:hover { color: var(--text); }
.clear-category[hidden] { display: none; }
.title-line { display: flex; align-items: center; gap: 12px; min-width: 0; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.55px; line-height: 1.3; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-count { flex-shrink: 0; color: var(--muted); font-size: 11px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 7px; font-variant-numeric: tabular-nums; }
.page-description { flex-basis: 100%; margin: 6px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.page-description > span { display: block; }
.page-description a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.page-description a:hover { text-decoration-color: currentColor; }
.collection-manage { margin-left: auto; font-size: 11px; }
.collection-manage svg { width: 15px; }
.sort-select { position: relative; display: flex; }
.sort-select::after { content: ''; position: absolute; right: 11px; top: 50%; width: 10px; height: 6px; margin-top: -3px; background: var(--muted); pointer-events: none;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.sort-select select { appearance: none; -webkit-appearance: none; min-height: 32px; padding: 0 30px 0 11px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--text); font-size: 11.5px; cursor: pointer; transition: background 120ms, border-color 120ms; }
.sort-select select:hover { background: var(--surface); border-color: var(--line-strong); }
.sort-select select:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.view-switch { display: flex; align-items: center; padding: 3px; border: 1px solid var(--line); border-radius: 9px; gap: 2px; }
.view-switch .icon-btn { width: 26px; height: 25px; border-radius: 5px; }
.view-switch .icon-btn svg { width: 14px; height: 14px; }
.view-switch .active { background: var(--selected); color: var(--text); }
select { min-height: 33px; padding: 6px 26px 6px 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--bg); font-size: 11px; }
.results-scroll { min-height: 0; flex: 1; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; outline: none; padding: 1px 2px 20px; margin: 0 -2px; }
.virtual-stage { position: relative; width: 100%; }
.asset-card { position: absolute; contain: layout style; }
.asset-open { width: 100%; height: 100%; text-align: left; padding: 0; display: flex; flex-direction: column; border-radius: 16px; }
.asset-image { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 17px; border: 1px solid var(--line); background: var(--media); }
.asset-image img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform 180ms ease, opacity 220ms ease; }
.asset-image.is-loading img, .detail-preview.is-loading > img { opacity: 0; }
.asset-image.is-loading::before, .detail-preview.is-loading::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, var(--shimmer) 50%, transparent 80%); transform: translateX(-100%); animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.virtual-stage:has(> .skeleton-card) { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.skeleton-card { display: flex; flex-direction: column; }
.skeleton-line { height: 9px; width: 72%; margin: 12px 0 0 3px; border-radius: 4px; background: var(--surface); }
.skeleton-line.short { width: 38%; margin-top: 8px; }
@media (hover:hover) { .asset-open:hover .asset-image img { transform: scale(1.025); } }
.asset-caption { display: flex; flex-direction: column; width: 100%; padding: 12px 3px 0; gap: 6px; }
.asset-name { font-size: 12px; line-height: 1.2; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-subline { display: flex; align-items: center; gap: 0; min-width: 0; color: var(--muted); font-size: 10px; }
.asset-category { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-size { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.load-tag { flex-shrink: 0; margin-left: 7px; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 5px; font-size: 9.5px; line-height: 1.5; color: var(--muted); cursor: help; }
.asset-category:not(:empty) + .asset-size:not(:empty)::before { content: '·'; margin: 0 6px; color: var(--subtle); }
.save-btn { position: absolute; right: 11px; top: 11px; display: flex; align-items: center; justify-content: center; width: 31px; height: 31px; border-radius: 9px; background: #ffffffed; color: #444; box-shadow: 0 1px 4px #0000000a; opacity: 0; transition: opacity 120ms; }
.asset-card:hover .save-btn, .asset-card:focus-within .save-btn, .save-btn.is-saved { opacity: 1; }
.save-btn.is-saved svg { fill: currentColor; }
.save-btn:hover { color: #bc5f52; background: #fff; }
.missing-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; }
.asset-image .missing-preview, .detail-preview .missing-preview, .film-thumb { color: var(--media-text); }
.asset-card.list .asset-open { flex-direction: row; align-items: center; padding: 7px; gap: 13px; border: 1px solid var(--line); border-radius: 12px; }
.asset-card.list .asset-image { width: 59px; height: 59px; flex-shrink: 0; border-radius: 8px; }
.asset-card.list .asset-caption { padding: 0 47px 0 0; min-width: 0; gap: 7px; }
.asset-card.list .asset-subline { margin-top: 3px; }
.asset-card.list .save-btn { top: 21px; right: 13px; background: var(--surface); color: var(--muted); opacity: 1; }
.empty-state { padding: 80px 20px; text-align: center; color: var(--muted); }
.empty-state > svg { margin-bottom: 12px; }
.empty-state h2 { color: var(--text); font-size: 18px; font-weight: 550; letter-spacing: -.4px; }
.empty-state p { max-width: 330px; margin: 10px auto 22px; line-height: 1.7; font-size: 12px; }
.filter-mobile, .sidebar-shade { display: none; }
/* Full-screen, image-first viewer. Only the optional iframe uses WebGL. */
dialog { color: var(--text); background: var(--bg); border: 1px solid var(--line); padding: 0; box-shadow: var(--shadow-pop); }
dialog::backdrop { background: #15151b52; }
.asset-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; overflow: hidden; }
.asset-dialog[open] { display: flex; flex-direction: column; }
.preview-topbar { height: var(--topbar-height); flex-shrink: 0; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.preview-close { border: 1px solid var(--line-strong); color: var(--text); }
.preview-top-left { display: flex; align-items: center; gap: 12px; min-width: 80px; }
.preview-position { color: var(--muted); font-size: 10px; white-space: nowrap; }
.filmstrip { display: flex; gap: 7px; min-width: 0; overflow: auto; scrollbar-width: none; padding: 4px 2px; }
.filmstrip::-webkit-scrollbar { display: none; }
.film-thumb { display: block; width: 44px; height: 44px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; flex-shrink: 0; background: var(--media); }
.film-thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; display: block; }
.film-thumb[aria-current="true"] { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.film-thumb:hover { border-color: var(--muted); }
.preview-actions { display: flex; align-items: center; gap: 7px; }
.preview-actions .icon-btn { border: 1px solid var(--line-strong); color: var(--text); }
.preview-actions .icon-btn.active { background: var(--selected); }
.preview-actions .button { font-size: 11px; min-height: 36px; }
.preview-actions [aria-pressed="true"] svg { fill: currentColor; }
.preview-body { flex: 1; min-height: 0; display: flex; position: relative; }
.preview-main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 76px 22px; overflow: auto; }
.stage-frame { width: min(100%, 660px, calc(100dvh - 244px)); aspect-ratio: 1; flex-shrink: 0; }
.detail-preview { position: relative; width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--media); }
.detail-preview > img { width: 100%; height: 100%; object-fit: contain; display: block; transition: opacity 240ms ease; }
.detail-preview > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--media); opacity: 0; transition: opacity 240ms ease; }
.detail-preview.is-3d > iframe { opacity: 1; }
.detail-preview.is-3d > img { opacity: 0; }
.viewer-progress { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(260px, calc(100% - 32px)); display: grid; gap: 8px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow-pop); font-size: 10.5px; color: var(--muted); z-index: 1; }
.viewer-progress[hidden] { display: none; }
.viewer-progress-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-progress-bar { position: relative; height: 3px; border-radius: 3px; overflow: hidden; background: var(--line); }
.viewer-progress-bar > i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(var(--progress, 0)); transition: transform 200ms ease; }
.viewer-progress.indeterminate .viewer-progress-bar > i { transform: scaleX(.3); animation: viewer-indeterminate 1.2s ease-in-out infinite; }
@keyframes viewer-indeterminate { from { translate: -100% 0; } to { translate: 340% 0; } }
.preview-caption > .button { flex-shrink: 0; font-size: 11px; min-height: 35px; }
.preview-caption > .button[hidden] { display: none; }
.preview-caption { width: min(100%, 660px, calc(100dvh - 244px)); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 1px 0; }
.preview-caption h2 { margin: 0; font-size: 15px; font-weight: 550; letter-spacing: -.25px; }
.preview-caption p { font-size: 10px; color: var(--muted); margin: 7px 0 0; }
.preview-nav { position: absolute; top: calc(50% - 32px); width: 36px; height: 36px; color: var(--text); }
.preview-prev { left: 23px; }
.preview-next { right: 23px; }
.viewer-status { width: min(100%, 660px); min-height: 20px; margin-top: 12px; font-size: 11px; color: var(--muted); line-height: 1.6; text-align: center; }
.viewer-status:empty { display: none; }
.detail-info { width: 340px; flex-shrink: 0; border-left: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; padding: 23px 25px 30px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.info-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.info-heading strong { font-size: 14px; font-weight: 550; }
.detail-category { display: block; color: var(--muted); font-size: 10px; margin-bottom: 8px; }
.detail-info h3 { font-size: 20px; line-height: 1.4; margin: 0 0 12px; font-weight: 550; letter-spacing: -.4px; }
.detail-description { color: var(--muted); font-size: 11px; line-height: 1.8; }
.section-label { margin: 26px 0 12px; color: var(--muted); font-size: 10px; font-weight: 550; letter-spacing: .5px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 5px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 10px; color: var(--muted); }
.tag:hover { color: var(--text); background: var(--hover); }
.tag.ai { border-style: dashed; }
.metadata { margin: 0; font-size: 10.5px; }
.metadata > div { display: flex; justify-content: space-between; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; text-align: right; }
.command-wrap { margin-top: 20px; font-size: 10px; color: var(--muted); line-height: 1.6; }
.command-wrap > p { font-size: 9px; letter-spacing: .3px; }
.command-wrap > code { display: block; padding: 10px; background: var(--surface); border-radius: 8px; overflow-wrap: anywhere; font-size: 10px; color: var(--text); }
.command-wrap > button { font-size: 10px; padding: 8px 0; color: var(--text); }
.detail-footer { font-size: 9px; line-height: 1.8; color: var(--muted); overflow-wrap: anywhere; margin-top: 22px; }
.menu-wrap { position: relative; }
.download-menu { position: absolute; z-index: 8; right: 0; top: 45px; min-width: 235px; padding: 6px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-pop); }
.download-menu a, .download-menu button { display: flex; align-items: center; width: 100%; text-align: left; gap: 9px; padding: 10px; border-radius: 7px; font-size: 11px; }
.download-menu a:hover, .download-menu button:hover { background: var(--surface); }
.download-menu kbd { margin-left: auto; min-width: 18px; padding: 1px 5px; border: 1px solid var(--line-strong); border-radius: 4px; font: inherit; font-size: 10px; text-align: center; color: var(--muted); }
#more-menu { min-width: 200px; }
/* Small dialogs, forms and feedback. */
.dialog-heading { display: flex; align-items: center; justify-content: space-between; padding: 17px 23px; border-bottom: 1px solid var(--line); }
.dialog-heading strong { font-size: 13px; font-weight: 550; }
.collection-dialog { width: 410px; max-width: calc(100% - 32px); max-height: calc(100dvh - 64px); border-radius: 16px; }
.collection-body { padding: 20px 24px 24px; }
.collection-body p { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 0 0 17px; }
.field-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.text-input { width: 100%; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); padding: 10px 12px; }
.form-error { min-height: 18px; margin-top: 9px; font-size: 11px; color: #b14a3d; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.form-actions .button { font-size: 12px; }
.danger-button { margin-right: auto; color: #b14a3d; font-size: 11px; }
.collection-choices { display: grid; gap: 6px; max-height: 300px; overflow: auto; margin-bottom: 16px; }
.collection-choice { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.collection-choice:hover { background: var(--surface); }
.collection-choice input { accent-color: var(--accent); }
.collection-choice .count { margin-left: auto; }
.toast { position: fixed; z-index: 150; bottom: 28px; left: 50%; transform: translateX(-50%); max-width: min(480px, calc(100% - 32px)); padding: 12px 17px; background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow-pop); border-radius: 10px; font-size: 12px; line-height: 1.5; pointer-events: none; }
/* Toast is promoted into a modal when needed so native top-layer does not hide it. */
.no-js { position: fixed; inset: 0; z-index: 200; padding: 40px; background: var(--bg); }
@media (min-width:1700px) { .main { padding-inline: 40px; } }
@media (max-width:1100px) { .preview-position { display: none; } .preview-top-left { min-width: auto; } .preview-topbar { gap: 14px; } .filmstrip { max-width: 350px; } .preview-main { padding-inline: 55px; } .detail-info { width: 310px; padding-inline: 20px; } .page-description { font-size: 11px; } }
@media (max-width:800px) {
  :root { --topbar-height: 64px; }
  .sidebar { transform: translateX(-100%); width: 248px; transition: transform 160ms ease; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-pop); }
  .sidebar-shade { display: block; position: fixed; z-index: 29; inset: 0; width: 100%; height: 100%; border-radius: 0; background: #14141a4d; }
  .workspace { margin-left: 0; }
  .topbar { padding-inline: 16px; gap: 12px; }
  .filter-mobile { display: inline-flex; width: 30px; }
  .search-wrap { width: 280px; }
  .main { padding-inline: 22px; }
  .page-heading { min-height: 76px; }
  .page-description { font-size: 11px; }
  .detail-info { position: absolute; z-index: 6; inset: 0 0 0 auto; background: var(--bg); width: min(360px, 90%); box-shadow: var(--shadow-pop); }
  .preview-topbar { padding-inline: 16px; }
  .preview-top-left { display: flex; }
  .filmstrip { flex: 1; }
  .preview-actions { gap: 6px; }
  .preview-actions .button > span { display: none; }
  .preview-actions .button { width: 36px; padding: 0; }
}
@media (max-width:540px) {
  .topbar { padding-inline: 14px; gap: 10px; }
  .top-actions { margin-left: 0; gap: 0; }
  .search-wrap { flex: 1; width: auto; height: 37px; min-width: 0; }
  .search-shortcut { display: none; }
  .source-button { width: 34px; padding: 0; border: 0; background: none; }
  .source-button span:first-child { display: none; }
  .source-button svg { width: 17px; height: 17px; }
  .main { padding-inline: 17px; }
  .page-heading { min-height: 74px; gap: 8px; }
  h1 { font-size: 21px; }
  .title-line { gap: 9px; }
  .title-count { font-size: 10px; }
  .page-description { display: none; }
  .virtual-stage:has(> .skeleton-card) { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .view-switch { padding: 2px; }
  .view-switch .icon-btn { width: 24px; }
  .asset-image { border-radius: 13px; }
  .asset-caption { padding: 11px 1px 0; }
  .asset-name { font-size: 11px; }
  .asset-subline { font-size: 9px; }
  .save-btn { width: 28px; height: 28px; top: 8px; right: 8px; opacity: 1; background: #ffffffe0; }
  .save-btn svg { width: 14px; height: 14px; }
  .collection-manage { padding: 7px; min-height: 32px; }
  .collection-manage > span:last-child { display: none; }
  .preview-topbar { display: grid; grid-template-columns: 1fr auto; height: 124px; padding: 12px 16px 10px; gap: 10px; }
  .preview-top-left { grid-column: 1; grid-row: 1; }
  .preview-position { display: inline; }
  .preview-actions { grid-column: 2; grid-row: 1; }
  .filmstrip { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; max-width: 100%; padding: 3px 2px; }
  .film-thumb { width: 38px; height: 38px; border-radius: 9px; }
  .preview-main { padding: 28px 17px 18px; justify-content: flex-start; }
  .stage-frame { width: min(100%, 420px, calc(100dvh - 310px)); max-height: none; margin-top: auto; }
  .detail-preview { border-radius: 18px; }
  .preview-caption { width: 100%; max-width: 420px; padding-top: 19px; flex-wrap: wrap; gap: 18px; }
  .preview-caption h2 { font-size: 15px; }
  .preview-caption p { font-size: 10px; }
  .preview-prev, .preview-next { top: auto; bottom: 15px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; }
  .preview-prev { left: 17px; }
  .preview-next { right: 17px; }
  .preview-main { padding-bottom: 66px; }
  .detail-info { inset: 12px 0 0; width: 100%; border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; padding: 18px 22px 30px; }
  .viewer-status { font-size: 10px; }
  .download-menu { right: -77px; min-width: 245px; }
}
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (hover:none) { .save-btn { opacity: 1; } }
