:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #edf3f0;
  --surface-hover: #e6efeb;
  --text: #18231f;
  --text-secondary: #5e6c66;
  --text-muted: #83908a;
  --border: #d9e2de;
  --border-strong: #c7d3ce;
  --accent: #16745a;
  --accent-dark: #0d5d47;
  --accent-soft: #dceee7;
  --warning: #a86912;
  --warning-soft: #f7e9c7;
  --danger: #b64036;
  --shadow: 0 12px 36px rgba(26, 46, 38, 0.12);
  --topbar-height: 68px;
  --sidebar-width: 236px;
  --content-max: 1480px;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--topbar-height);
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 7px;
}

.brand-mark .icon {
  width: 22px;
  height: 22px;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.25;
}

.brand-copy strong {
  overflow: hidden;
  max-width: 320px;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy span {
  overflow: hidden;
  max-width: 320px;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.release-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  background: var(--warning);
  border-radius: 50%;
}

.release-state.is-ready .status-dot {
  background: var(--accent);
}

.release-state.is-error .status-dot {
  background: var(--danger);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  cursor: pointer;
  place-items: center;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.icon-button:hover {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--border);
}

.icon-button:focus-visible,
.category-item:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.file-card:focus-visible,
.text-button:focus-visible,
.search-box:focus-within,
.select-control:focus-within {
  outline: 3px solid rgba(22, 116, 90, 0.22);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  min-height: calc(100vh - var(--topbar-height));
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: var(--topbar-height);
  align-self: start;
  height: calc(100vh - var(--topbar-height));
  padding: 22px 14px;
  background: #f8faf9;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-item {
  display: grid;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  cursor: pointer;
  align-items: center;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  color: var(--text-secondary);
  text-align: left;
  background: transparent;
  border-radius: 6px;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.category-item:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.category-item.is-active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-weight: 700;
}

.category-item .icon {
  width: 18px;
  height: 18px;
}

.category-item span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  min-width: 25px;
  padding: 1px 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
}

.category-item.is-active .category-count {
  color: var(--accent-dark);
}

.sidebar-summary {
  margin-top: 30px;
  padding: 18px 10px 0;
  border-top: 1px solid var(--border);
}

.summary-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.summary-heading .icon {
  width: 16px;
  height: 16px;
}

.sidebar-summary dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.sidebar-summary dl div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-summary dt {
  color: var(--text-muted);
  font-size: 12px;
}

.sidebar-summary dd {
  overflow: hidden;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-content {
  width: min(100%, var(--content-max));
  min-width: 0;
  margin: 0 auto;
  padding: 26px 30px 60px;
}

.announcement {
  display: flex;
  min-height: 44px;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 28px;
  padding: 11px 14px;
  color: #5f4a19;
  background: var(--warning-soft);
  border-left: 3px solid #d29a35;
  border-radius: 4px;
}

.announcement .icon {
  width: 17px;
  height: 17px;
  margin-top: 2px;
}

.announcement p {
  margin: 0;
  font-size: 13px;
}

.library-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.library-heading h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
}

.result-summary {
  margin: 7px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.view-switch {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.view-switch .icon-button {
  width: 34px;
  height: 32px;
  flex-basis: 34px;
}

.view-switch .icon-button.is-active {
  color: var(--accent-dark);
  background: var(--surface);
  border-color: var(--border-strong);
}

.toolbar {
  display: grid;
  margin: 22px 0 20px;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
}

.search-box {
  display: flex;
  min-width: 0;
  height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.search-box .icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.select-control {
  position: relative;
  display: inline-flex;
  width: 150px;
  height: 42px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.select-control select {
  width: 100%;
  height: 100%;
  padding: 0 36px 0 12px;
  cursor: pointer;
  appearance: none;
  background: transparent;
  border: 0;
  outline: 0;
}

.select-control .icon {
  position: absolute;
  right: 11px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.mobile-category-control {
  display: none;
}

.loading-grid,
.file-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.loading-grid[hidden] {
  display: none;
}

.skeleton-card {
  aspect-ratio: 0.84;
  overflow: hidden;
  background:
    linear-gradient(
      100deg,
      #e9eeec 20%,
      #f7f9f8 38%,
      #e9eeec 58%
    );
  background-size: 200% 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  animation: skeleton-loading 1.35s linear infinite;
}

@keyframes skeleton-loading {
  to {
    background-position-x: -200%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.file-card {
  position: relative;
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.file-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 24px rgba(25, 46, 38, 0.09);
}

.file-thumbnail {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.file-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.file-card:hover .file-thumbnail img {
  transform: scale(1.018);
}

.thumbnail-badges {
  position: absolute;
  inset: 10px 10px auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.file-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 8px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  background: rgba(20, 29, 26, 0.82);
  border-radius: 4px;
}

.pending-badge {
  color: #68460c;
  background: rgba(255, 236, 189, 0.94);
}

.card-body {
  display: flex;
  min-width: 0;
  min-height: 154px;
  flex: 1;
  flex-direction: column;
  padding: 15px;
}

.file-card h2 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.file-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 14px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.file-facts {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  color: var(--text-muted);
  font-size: 11px;
}

.file-facts span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-facts .separator {
  flex: 0 0 auto;
  color: var(--border-strong);
}

.card-actions {
  display: grid;
  min-height: 48px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 10px 15px;
  border-top: 1px solid var(--border);
}

.preview-link {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.preview-link .icon {
  width: 16px;
  height: 16px;
}

.download-button {
  display: inline-flex;
  min-width: 94px;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  border-radius: 5px;
  transition:
    background-color 160ms ease,
    opacity 160ms ease;
}

.download-button:hover {
  background: var(--accent-dark);
}

.download-button .icon {
  width: 16px;
  height: 16px;
}

.download-button[aria-disabled="true"] {
  cursor: not-allowed;
  color: var(--text-muted);
  background: var(--surface-soft);
}

.file-grid.is-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-grid.is-list .file-card {
  display: grid;
  min-height: 104px;
  grid-template-columns: 156px minmax(0, 1fr) 176px;
}

.file-grid.is-list .file-card:hover {
  transform: none;
}

.file-grid.is-list .file-thumbnail {
  height: 100%;
  min-height: 102px;
  aspect-ratio: auto;
  border-right: 1px solid var(--border);
  border-bottom: 0;
}

.file-grid.is-list .card-body {
  min-height: 102px;
  justify-content: center;
  padding: 13px 18px;
}

.file-grid.is-list .file-description {
  margin: 5px 0 8px;
  -webkit-line-clamp: 1;
}

.file-grid.is-list .file-facts {
  margin-top: 0;
}

.file-grid.is-list .card-actions {
  min-height: 100%;
  grid-template-columns: 1fr;
  align-content: center;
  justify-items: stretch;
  padding: 14px;
  border-top: 0;
  border-left: 1px solid var(--border);
}

.file-grid.is-list .preview-link {
  justify-content: center;
}

.empty-state {
  padding: 80px 20px;
  color: var(--text-secondary);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-icon {
  display: grid;
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  place-items: center;
  color: var(--text-muted);
  background: var(--surface-soft);
  border-radius: 50%;
}

.empty-icon .icon {
  width: 28px;
  height: 28px;
}

.empty-state h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.empty-state p {
  margin: 7px 0 0;
  font-size: 13px;
}

.preview-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.preview-dialog::backdrop {
  background: rgba(15, 24, 21, 0.58);
  backdrop-filter: blur(3px);
}

.dialog-shell {
  display: flex;
  max-height: calc(100vh - 34px);
  flex-direction: column;
}

.dialog-header {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px 14px 22px;
  border-bottom: 1px solid var(--border);
}

.dialog-header > div {
  min-width: 0;
}

.dialog-header h2 {
  overflow: hidden;
  margin: 2px 0 0;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-type-label {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.preview-layout {
  display: grid;
  min-height: 0;
  flex: 1;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
}

.preview-stage {
  display: grid;
  min-width: 0;
  min-height: 480px;
  padding: 28px;
  place-items: center;
  background: #e9eeec;
  overflow: auto;
}

.preview-stage img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 8px 28px rgba(24, 35, 31, 0.16);
}

.preview-stage video {
  width: 100%;
  max-height: 68vh;
  background: #111;
}

.preview-stage audio {
  width: min(520px, 100%);
}

.preview-placeholder {
  display: flex;
  width: min(480px, 100%);
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  text-align: center;
}

.preview-placeholder img {
  width: 100%;
  box-shadow: none;
}

.preview-placeholder p {
  margin: 0;
  font-size: 13px;
}

.preview-details {
  min-width: 0;
  padding: 24px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

.preview-description {
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-size: 13px;
}

.file-metadata {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
}

.file-metadata div {
  display: grid;
  min-width: 0;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
}

.file-metadata dt {
  color: var(--text-muted);
  font-size: 12px;
}

.file-metadata dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--text);
  font-size: 12px;
}

.checksum-block {
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.checksum-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.checksum-heading > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
}

.checksum-heading .icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.text-button {
  display: inline-flex;
  height: 28px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  cursor: pointer;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  border-radius: 4px;
}

.text-button:hover {
  background: var(--accent-soft);
}

.text-button .icon {
  width: 14px;
  height: 14px;
}

.checksum-block code {
  display: block;
  overflow-wrap: anywhere;
  color: #34443e;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  line-height: 1.6;
}

.download-sources {
  margin-top: 24px;
}

.download-sources h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

#download-source-list {
  display: grid;
  gap: 8px;
}

.source-link {
  display: grid;
  min-height: 46px;
  padding: 8px 10px;
  align-items: center;
  grid-template-columns: 32px minmax(0, 1fr) 18px;
  gap: 9px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.source-link:hover {
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.source-link.is-primary {
  border-color: #8bbbab;
}

.source-link[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

.source-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 5px;
}

.source-icon .icon {
  width: 16px;
  height: 16px;
}

.source-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.source-copy strong {
  font-size: 12px;
}

.source-copy span {
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-link > .icon {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
  background: #22312c;
  border-radius: 5px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1240px) {
  .loading-grid,
  .file-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  :root {
    --sidebar-width: 210px;
  }

  .main-content {
    padding-right: 22px;
    padding-left: 22px;
  }

  .loading-grid,
  .file-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preview-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 62px;
  }

  .topbar {
    padding: 0 14px;
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand-copy strong {
    max-width: 180px;
    font-size: 15px;
  }

  .brand-copy span {
    max-width: 180px;
  }

  .release-state {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    width: 100%;
    padding: 18px 14px 46px;
  }

  .announcement {
    margin-bottom: 22px;
  }

  .library-heading {
    align-items: center;
  }

  .library-heading h1 {
    font-size: 23px;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) 46%;
  }

  .search-box {
    grid-column: 1 / -1;
  }

  .select-control {
    width: 100%;
  }

  .mobile-category-control {
    display: inline-flex;
  }

  .loading-grid,
  .file-grid {
    gap: 12px;
  }

  .file-grid.is-list .file-card {
    grid-template-columns: 110px minmax(0, 1fr);
  }

  .file-grid.is-list .card-actions {
    display: flex;
    min-height: 48px;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .preview-dialog {
    width: 100vw;
    max-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .dialog-shell {
    max-height: 100vh;
  }

  .preview-layout {
    display: block;
    overflow-y: auto;
  }

  .preview-stage {
    min-height: 310px;
    padding: 14px;
  }

  .preview-stage img,
  .preview-stage video {
    max-height: 55vh;
  }

  .preview-details {
    padding: 20px;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}

@media (max-width: 520px) {
  .loading-grid,
  .file-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-card h2 {
    font-size: 15px;
  }

  .file-grid.is-list .file-card {
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr);
  }

  .file-grid.is-list .file-thumbnail {
    height: 100%;
    min-height: 118px;
    aspect-ratio: auto;
    border-right: 1px solid var(--border);
    border-bottom: 0;
  }

  .file-grid.is-list .card-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 380px) {
  .brand-copy span {
    display: none;
  }

  .brand-copy strong {
    max-width: 150px;
  }

  .library-heading {
    gap: 10px;
  }

  .view-switch {
    flex: 0 0 auto;
  }
}
