:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
  --base: #f5f7f2;
  --paper: #fcfdf9;
  --white: #fff;
  --ink: #162a22;
  --muted: #506459;
  --line: #dce5db;
  --forest: #142c23;
  --green: #245f46;
  --lime: #d9eeaa;
  --soft: #e8efe1;
  --focus: #377b56;
  --danger: #7d312f;
  --gutter: clamp(24px, 3.65vw, 58px);
  color: var(--ink);
  background: var(--base);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, a { touch-action: manipulation; }
button:disabled { cursor: default; opacity: .46; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip-link {
  position: fixed;
  z-index: 4;
  top: .5rem;
  left: .5rem;
  transform: translateY(-160%);
  padding: .8rem 1rem;
  border-radius: 8px;
  color: var(--forest);
  background: var(--lime);
}
.skip-link:focus { transform: translateY(0); }

.shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  color: #eff7f1;
  background: var(--forest);
  padding: 28px 18px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; padding-inline: 5px; }
.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  aspect-ratio: 1;
  border-radius: 11px;
  color: var(--forest);
  background: var(--lime);
}
.brand-mark .folder-icon { width: 19px; height: 15px; transform: translateY(1px); }
.brand-copy { display: grid; gap: 4px; }
.brand-copy strong { font-size: 1.13rem; font-weight: 750; line-height: 1.1; letter-spacing: -.038em; }
.brand-copy span { color: #b3c8b9; font-size: .81rem; font-weight: 550; line-height: 1.1; }
.mobile-brand { display: none; }
.folder-nav { min-height: 0; display: flex; flex-direction: column; margin-top: 52px; }
.folder-nav h2 {
  color: #adbfaf;
  margin: 0 0 11px 12px;
  font-size: .875rem;
  font-weight: 640;
}
#folders { overflow-y: auto; scrollbar-width: thin; padding: 3px; margin: -3px; }
.folder-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  margin-bottom: 5px;
  padding: 8px 11px;
  text-align: left;
  color: #e3eee6;
  background: transparent;
  font-size: .92rem;
}
.folder-button:hover { background: #ffffff12; }
.folder-button[aria-current="true"] { background: #2b4537; color: #e9f7d4; border-color: #42604c; }
.folder-button[aria-current="true"] .folder-icon { color: var(--lime); }
.folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { color: #c8d9c9; font-size: .81rem; font-variant-numeric: tabular-nums; }
.sidebar :focus-visible, .viewer :focus-visible { outline-color: var(--lime); }
.sidebar-footer { border-top: 1px solid #3e5447; margin-top: auto; padding: 12px 4px 0; }
.credit-button {
  display: inline-block;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .85rem;
  text-align: left;
  padding: 6px 0;
}
.sidebar .credit-button { color: #c5d6c8; }
.credit-button:hover { text-decoration: underline; text-underline-offset: .2em; }
.mobile-footer { display: none; }

.main { min-width: 0; }
.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-size: .9rem;
  white-space: nowrap;
}
.breadcrumbs strong { color: var(--ink); font-weight: 660; text-overflow: ellipsis; overflow: hidden; }
.breadcrumb-divider { color: #8a9b90; }
.breadcrumbs .folder-icon { color: var(--green); }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: .9rem;
  font-weight: 675;
  line-height: 1.23;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s, border-color .15s;
}
.button-primary { border-color: var(--forest); background: var(--forest); color: #f4faee; }
.button-primary:hover { background: var(--green); border-color: var(--green); }
.button-quiet { border-color: var(--line); background: var(--paper); color: var(--ink); }
.button-quiet:hover { background: var(--soft); border-color: #b2c5b3; }

.folder-icon, .link-icon, .clock-icon, .search-icon, .upload-icon, .download-icon, .grid-icon, .list-icon {
  display: inline-block;
  position: relative;
  flex: none;
  color: currentColor;
}
.folder-icon { width: 16px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; }
.folder-icon::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -1.5px;
  width: 7px;
  height: 4px;
  border: 1.5px solid currentColor;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
}
.link-icon { width: 17px; height: 14px; transform: rotate(-43deg); }
.link-icon::before, .link-icon::after {
  content: ""; position: absolute; top: 3px; width: 9px; height: 8px;
  border: 1.5px solid currentColor; border-radius: 4px;
}
.link-icon::before { left: 0; }
.link-icon::after { right: 0; }
.clock-icon { width: 15px; height: 15px; border: 1.5px solid currentColor; border-radius: 50%; }
.clock-icon::before {
  content: ""; position: absolute; width: 4px; height: 5px; top: 2px; left: 5px;
  border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
}
.search-icon { width: 13px; height: 13px; border: 1.6px solid currentColor; border-radius: 50%; }
.search-icon::after {
  content: ""; position: absolute; width: 5px; height: 1.6px;
  right: -3.8px; bottom: -1.1px; background: currentColor; transform: rotate(48deg);
}
.upload-icon, .download-icon { width: 15px; height: 16px; }
.upload-icon::before, .download-icon::before {
  content: ""; position: absolute; width: 1.5px; height: 10px;
  left: 6.75px; top: 1px; background: currentColor;
}
.upload-icon::after, .download-icon::after {
  content: ""; position: absolute; width: 7px; height: 7px; left: 4px; top: 2px;
  border-top: 1.5px solid currentColor; border-left: 1.5px solid currentColor; transform: rotate(45deg);
}
.upload-icon { border-bottom: 1.5px solid currentColor; }
.download-icon { transform: rotate(180deg); border-top: 1.5px solid currentColor; }
.grid-icon {
  width: 5px; height: 5px; margin: -7px 7px 0 0;
  border: 1.3px solid currentColor; border-radius: 1px;
  box-shadow: 7px 0 0 -1.3px var(--layout-bg), 7px 0 currentColor,
    0 7px 0 -1.3px var(--layout-bg), 0 7px currentColor,
    7px 7px 0 -1.3px var(--layout-bg), 7px 7px currentColor;
}
.list-icon { width: 13px; height: 2px; border-radius: 1px; background: currentColor; box-shadow: 0 -5px currentColor, 0 5px currentColor; }

.content { max-width: 1600px; padding: 28px var(--gutter) 60px; margin: 0 auto; }
.archive-banner {
  position: relative;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  min-height: clamp(248px, 24vw, 345px);
  overflow: hidden;
  border-radius: 20px;
  padding: clamp(24px, 4vw, 54px);
  color: #f7fff1;
  background: var(--forest);
  box-shadow: 0 15px 32px -21px #142c2360;
}
.archive-banner::before, .archive-banner::after { position: absolute; inset: 0; content: ""; pointer-events: none; }
.archive-banner::before {
  z-index: -3;
  background: radial-gradient(ellipse at 100% 12%, #3d6651 0%, transparent 67%), linear-gradient(120deg, #132b23, #264e3b);
}
.archive-banner::after { z-index: -1; background: linear-gradient(90deg, #122a22 0%, #122a22f0 25%, #122a2280 61%, #122a2226 100%); }
.cover {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: -2;
  width: 74%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 52%;
}
.banner-details { width: min(100%, 58ch); }
.archive-kind { color: #d8eab9; font-size: .92rem; font-weight: 685; margin-bottom: .7rem; }
.archive-banner h1 {
  font-size: clamp(2.25rem, 4.65vw, 4.7rem);
  font-weight: 740;
  letter-spacing: -.065em;
  line-height: 1.045;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.archive-meta { font-size: 1rem; color: #ecf6e7; margin-top: .9rem; line-height: 1.45; }
.availability {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 1rem;
  padding: .52rem .75rem;
  border-radius: 8px;
  border: 1px solid #d9eeaa72;
  background: #142c2371;
  color: #e9f4d5;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.status-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  min-height: 60px;
  padding: 12px 16px;
  margin-top: 16px;
  border: 1px solid #c5d7c2;
  border-radius: 12px;
  background: #eaf2e6;
  color: var(--forest);
  font-size: .92rem;
  line-height: 1.45;
}
.status-panel.is-error { color: var(--danger); border-color: #ebcfcc; background: #f9efed; }
#shared-status { justify-content: flex-start; }
.upload-details { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.upload-details progress { width: min(500px, 100%); height: 8px; accent-color: var(--green); display: block; margin-top: 9px; }
.loading-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid #b6cdb7;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gallery { margin-top: 32px; }
.gallery-heading, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gallery-heading { margin-bottom: 13px; }
.heading-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; min-width: 0; }
.heading-title h2 { font-size: clamp(1.43rem, 2.3vw, 2rem); letter-spacing: -.05em; line-height: 1.22; overflow-wrap: anywhere; }
.result-count { flex-shrink: 0; color: var(--muted); font-size: .89rem; font-variant-numeric: tabular-nums; }
.search {
  padding: 0 13px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 244px);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--paper);
}
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.search input {
  width: 100%; min-width: 0; flex: 1;
  min-height: 41px; outline: none; border: 0; padding: 0 0 0 3px;
  color: var(--ink); font-size: .93rem; background: transparent;
}
.search input::placeholder { color: #607267; opacity: 1; }
.toolbar { margin-bottom: 16px; }
.filter-group, .view-options, .layout-group { display: flex; align-items: center; gap: 6px; }
.filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--paper);
  font-weight: 630;
  font-size: .9rem;
  white-space: nowrap;
}
.filter-button span { font-size: .78rem; font-variant-numeric: tabular-nums; color: inherit; }
.filter-button:hover { color: var(--ink); border-color: #b9cdb9; background: #f1f6ed; }
.filter-button[aria-pressed="true"] { color: var(--forest); border-color: #bdd4ae; background: #e1efd5; }
.layout-group, .select-wrap { border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.layout-group { gap: 3px; padding: 3px; }
.layout-button {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: var(--layout-bg);
  --layout-bg: var(--paper);
}
.layout-button:hover { color: var(--ink); }
.layout-button[aria-pressed="true"] { --layout-bg: #e8efe2; color: var(--forest); }
.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap::after {
  content: ""; position: absolute; right: 13px; width: 6px; height: 6px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: translateY(-2px) rotate(45deg); pointer-events: none;
}
.select-wrap select {
  appearance: none; width: 100%; min-width: 0; min-height: 41px;
  border: 0; border-radius: inherit; padding: 0 33px 0 11px;
  background: transparent; color: var(--ink); text-overflow: ellipsis; font-size: .88rem;
}
.folder-picker { display: none; }

.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.media-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce5da;
  border-radius: 12px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 3px 8px -5px #142c2340;
  text-align: left;
  transition: border-color .17s, box-shadow .17s, translate .17s;
}
.media-card:hover { translate: 0 -2px; border-color: #aac2a9; box-shadow: 0 10px 18px -12px #142c2380; }
.card-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(145deg, #326b52, #15382b);
}
.card-preview img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.card-preview::after { content: ""; position: absolute; inset: 48% 0 0; background: linear-gradient(transparent, #0b251f55); pointer-events: none; }
.card-type, .duration {
  position: absolute;
  z-index: 1;
  padding: 4px 7px;
  border-radius: 6px;
  color: #fff;
  background: #122a22db;
  font-size: .77rem;
  font-weight: 670;
  line-height: 1.22;
}
.card-type { bottom: 8px; left: 8px; }
.duration { bottom: 8px; right: 8px; font-variant-numeric: tabular-nums; }
.play-icon {
  display: grid;
  position: absolute;
  z-index: 1;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #ffffff65;
  border-radius: 50%;
  color: #fff;
  background: #142c23ca;
}
.play-icon::after {
  content: "";
  margin-left: 3px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid currentColor;
}
.image-placeholder { color: #d9eeaa; transform: scale(1.4); }
.card-copy { display: grid; align-content: center; width: 100%; min-width: 0; gap: 5px; padding: 12px; }
.card-name { display: block; font-size: .93rem; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: block; color: var(--muted); font-size: .82rem; line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.media-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 7px; }
.is-list .media-card { flex-direction: row; min-height: 71px; align-items: stretch; }
.is-list .card-preview { width: 112px; aspect-ratio: auto; flex-shrink: 0; }
.is-list .play-icon { width: 28px; height: 28px; }
.is-list .play-icon::after { border-width: 5px 0 5px 8px; }
.is-list .card-type, .is-list .duration { display: none; }
.is-list .card-copy { flex: 1; min-width: 0; }
.empty-state {
  min-height: 206px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 9px;
  padding: 24px;
  border: 1px dashed #b9ccb7;
  border-radius: 13px;
  background: #f9fbf7;
  color: var(--muted);
  text-align: center;
}
.empty-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 1px; background: var(--soft); color: var(--green); border-radius: 10px; }
.empty-state h3 { color: var(--ink); font-size: 1.14rem; letter-spacing: -.025em; }
.empty-state p { max-width: 44ch; font-size: .95rem; line-height: 1.42; }
.empty-state .button { margin-top: 4px; }

.viewer {
  position: fixed;
  inset: 0;
  width: min(1120px, calc(100% - 34px));
  max-width: 100%;
  height: min(860px, calc(100vh - 28px));
  height: min(860px, calc(100dvh - 28px));
  max-height: calc(100% - 28px);
  margin: auto;
  padding: 0;
  border: 1px solid #375244;
  border-radius: 17px;
  color: #f2f8ef;
  background: #142b22;
  overflow: hidden;
  box-shadow: 0 20px 70px #06150db0;
}
.viewer::backdrop, .credits::backdrop { background: #071810bf; backdrop-filter: blur(6px); }
.viewer-panel {
  display: grid;
  grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.viewer-header, .viewer-footer { display: flex; align-items: center; min-width: 0; gap: 10px; padding: 10px 14px; background: #1a3529; }
.viewer-header { border-bottom: 1px solid #375244; }
.viewer-heading { min-width: 0; flex: 1; }
.viewer-heading h2 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 1rem; line-height: 1.3; }
.viewer-heading p { margin-top: 2px; color: #c8d9cc; font-size: .82rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.viewer-action, .close-button { background: #264538; color: #f3faf1; border-color: #496252; }
.viewer-action:hover:not(:disabled), .close-button:hover { background: #355849; border-color: #709680; }
.close-button { width: 44px; min-height: 44px; padding: 0; font-size: 1.45rem; flex: none; }
.viewer-stage {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
  background: #0b1c15;
  touch-action: pan-y;
}
.viewer-stage.is-video { touch-action: auto; }
.viewer-stage img, .viewer-stage video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  object-fit: contain;
  object-position: center;
}
.viewer-stage.is-loading::after {
  content: "";
  grid-area: 1 / 1;
  width: 28px;
  height: 28px;
  border: 2px solid #426655;
  border-top-color: var(--lime);
  border-radius: 50%;
  pointer-events: none;
  animation: spin 800ms linear infinite;
}
.viewer-stage > img { grid-area: 1 / 1; }
.viewer-error { max-width: min(100%, 40ch); padding: 15px 18px; color: #f1f5ef; text-align: center; line-height: 1.45; }
.viewer-footer { justify-content: center; border-top: 1px solid #375244; }
.viewer-position { min-width: 49px; color: #d8e7d9; font-size: .9rem; font-variant-numeric: tabular-nums; text-align: center; }
.credits {
  max-width: min(520px, calc(100vw - 26px));
  max-height: calc(100dvh - 26px);
  padding: 24px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}
.credits h2 { font-size: 1.28rem; letter-spacing: -.035em; }
.credits ul { display: grid; gap: 10px; padding-left: 17px; color: var(--muted); font-size: .93rem; }
.credits a { color: var(--green); }
.drop-overlay {
  position: fixed;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: #142c23db;
  color: #e9f7d3;
}
.drop-overlay::after { content: ""; position: absolute; inset: 21px; border: 2px dashed #d9eeaa; border-radius: 20px; }
.drop-overlay strong { font-size: clamp(1.55rem, 4vw, 2.65rem); letter-spacing: -.045em; text-align: center; padding: 24px; }

@media (max-width: 1180px) {
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .shell { grid-template-columns: 182px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .sidebar .brand { gap: 9px; }
  .sidebar .brand-mark { flex-basis: 34px; }
  .sidebar .brand-copy strong { font-size: 1rem; }
  .sidebar .brand-copy span { font-size: .76rem; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  :root { --gutter: clamp(13px, 4vw, 24px); }
  .shell { display: block; }
  .sidebar, .breadcrumbs { display: none; }
  .mobile-brand { display: flex; padding: 0; gap: 8px; }
  .mobile-brand .brand-mark { flex-basis: 34px; border-radius: 8px; }
  .mobile-brand .brand-mark .folder-icon { width: 16px; height: 12px; }
  .mobile-brand .brand-copy { gap: 3px; }
  .mobile-brand .brand-copy strong { font-size: 1rem; }
  .mobile-brand .brand-copy span { color: var(--muted); font-size: .74rem; }
  .topbar { min-height: 62px; flex-wrap: wrap; padding-block: 8px; gap: 10px; }
  .topbar-actions { flex-wrap: wrap; margin-inline-start: auto; gap: 6px; }
  .button { padding-inline: 10px; font-size: .875rem; }
  .content { padding-top: 15px; padding-bottom: 30px; }
  .archive-banner { min-height: 229px; border-radius: 14px; padding: 21px; }
  .cover { width: 100%; }
  .archive-banner::after { background: linear-gradient(0deg, #122a22 2%, #122a22d4 34%, #122a2260 72%, #122a222b 100%); }
  .archive-banner h1 { font-size: clamp(2.05rem, 8vw, 3.2rem); }
  .archive-meta { font-size: .92rem; margin-top: .55rem; }
  .archive-kind { margin-bottom: .55rem; }
  .availability { margin-top: .75rem; }
  .gallery { margin-top: 23px; }
  .gallery-heading { flex-wrap: wrap; margin-bottom: 9px; }
  .heading-title { width: 100%; }
  .search { width: 100%; }
  .folder-picker { display: flex; margin-bottom: 9px; padding-left: 11px; }
  .folder-picker .folder-icon { color: var(--muted); }
  .folder-picker select { padding-left: 10px; }
  .toolbar { flex-wrap: wrap; gap: 8px; margin-bottom: 11px; }
  .filter-group, .view-options { gap: 5px; }
  .view-options { margin-left: auto; }
  .filter-button { padding-inline: 9px; gap: 5px; }
  .toolbar > .filter-group { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  .media-grid { gap: 9px; }
  .card-copy { padding: 9px; }
  .card-type, .duration { font-size: .73rem; }
  .play-icon { width: 35px; height: 35px; }
  .play-icon::after { border-width: 5px 0 5px 8px; }
  .mobile-footer { display: block; margin-top: 15px; }
  .viewer {
    width: calc(100% - 16px);
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100% - 16px);
    border-radius: 12px;
  }
  .viewer-header, .viewer-footer { padding: 8px; gap: 6px 8px; }
  .viewer-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "details close" "download .";
  }
  .viewer-heading { grid-area: details; }
  .viewer-heading h2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  #download { grid-area: download; justify-self: start; }
  .viewer-header .close-button { grid-area: close; align-self: start; }
  .viewer-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }
  .viewer-action { min-height: 44px; gap: 5px; }
  .viewer-footer .viewer-action { min-width: 0; padding-inline: 6px; text-align: center; white-space: normal; }
}
@media (max-width: 420px) {
  .filter-group { flex: 1 0 100%; }
  .filter-button { flex: 1; }
  .view-options { width: 100%; }
  .view-options .sort-picker { flex: 1; min-width: 0; }
}
@media (max-width: 335px) {
  .topbar-actions .button { padding-inline: 8px; }
  .topbar-actions .button-primary .upload-icon { display: none; }
  .mobile-brand .brand-copy span { display: none; }
  .archive-banner { padding: 16px; }
  .media-grid { gap: 7px; }
  .card-name { font-size: .87rem; }
  .viewer-action .download-icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
