:root {
  color-scheme: light;
  --md-sys-color-primary: #5748c8;
  --md-sys-color-on-primary: #fff;
  --md-sys-color-primary-container: #e8e1ff;
  --md-sys-color-on-primary-container: #1c1261;
  --md-sys-color-background: #f8f7fc;
  --md-sys-color-surface: #fff;
  --md-sys-color-surface-container: #f0eef6;
  --md-sys-color-on-surface: #1d1b20;
  --md-sys-color-on-surface-variant: #494650;
  --md-sys-color-outline: #797680;
  --md-sys-color-outline-variant: #cbc6d2;
  --md-sys-shape-corner-full: 999px;
  --md-sys-shape-corner-large: 24px;
  --md-sys-shape-corner-medium: 16px;
  --brand-font: Roboto, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-family: var(--brand-font);
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-background);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

html { min-width: 320px; min-height: 100%; background: var(--md-sys-color-background); }

body { min-width: 320px; min-height: 100vh; margin: 0; }

a { color: inherit; }

.app-shell { min-height: 100vh; }

.top-app-bar {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  padding-inline: max(32px, calc((100vw - 1420px) / 2));
  background: var(--md-sys-color-background);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--md-sys-color-primary);
  font-family: var(--brand-font);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.7px;
  text-decoration: none;
}

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

.docs-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1px;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.docs-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.docs-action:hover { transform: translateY(-1px); border-color: var(--md-sys-color-primary); background: var(--md-sys-color-primary-container); }

.random-action {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 40px;
  border: 0;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1px;
  text-decoration: none;
  box-shadow: 0 2px 3px rgb(42 31 111 / 18%);
  transition: box-shadow 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.random-action svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.random-action:hover { transform: translateY(-1px); background: #493bb7; box-shadow: 0 4px 8px rgb(42 31 111 / 22%); }
.top-actions .random-action, .top-actions .docs-action { width: 136px; min-height: 48px; gap: 8px; padding-inline: 12px; font-size: 14px; }
.top-actions .random-action svg { width: 18px; height: 18px; }
.random-action:focus-visible, .docs-action:focus-visible, .brand:focus-visible, .photo-link:focus-visible, .back-link:focus-visible { outline: 3px solid #8577ee; outline-offset: 4px; }

.main-content { width: min(100% - 64px, 1420px); margin: 0 auto; padding: 42px 0 72px; }
.gallery-section { min-height: calc(100vh - 106px); }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 0 0 28px; }
.section-heading h1 {
  margin: 0;
  color: var(--md-sys-color-on-surface);
  font-family: var(--brand-font);
  font-size: clamp(42px, 4vw, 56px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1.2;
  text-wrap: balance;
}
.photo-count { margin: 7px 0 0; color: var(--md-sys-color-on-surface-variant); font-size: 14px; line-height: 20px; letter-spacing: 0.25px; }

.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.photo-link { position: relative; display: block; overflow: hidden; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-surface-container); aspect-ratio: 1.27 / 1; }
.photo-link img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 220ms cubic-bezier(0.2, 0, 0, 1); }
.photo-link:hover img { transform: scale(1.035); }

.empty-state {
  display: flex;
  min-height: min(460px, calc(100vh - 250px));
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 76px;
  text-align: center;
}

.empty-icon { display: grid; width: 76px; height: 76px; place-items: center; margin-bottom: 22px; border-radius: 26px; background: var(--md-sys-color-primary-container); color: var(--md-sys-color-primary); }
.empty-icon svg { width: 43px; height: 43px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.empty-icon rect, .empty-icon path { stroke: currentColor; }
.empty-icon circle { fill: currentColor; stroke: none; }
.empty-state h2 { margin: 0; color: var(--md-sys-color-on-surface); font-size: 18px; font-weight: 600; line-height: 28px; letter-spacing: 0.1px; }
.empty-state p { margin: 6px 0 0; color: var(--md-sys-color-on-surface-variant); font-size: 14px; line-height: 20px; letter-spacing: 0.25px; }

.has-photos .empty-state { display: none; }
.has-photos .random-action { display: inline-flex; }
.no-photos .random-action { display: none; }

.viewer-page { height: 100vh; overflow: hidden; }
.viewer-bar { min-height: 76px; gap: 20px; }
.viewer-back { display: inline-flex; min-width: 140px; align-items: center; gap: 9px; color: var(--md-sys-color-on-surface-variant); font-size: 14px; font-weight: 600; text-decoration: none; }
.viewer-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.viewer-back:focus-visible, .icon-button:focus-visible, .download-action:focus-visible { outline: 3px solid #8577ee; outline-offset: 4px; }
.viewer-tools { display: flex; min-width: 190px; align-items: center; justify-content: flex-end; gap: 8px; }
.icon-button { display: grid; width: 42px; height: 42px; flex: none; place-items: center; padding: 0; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 50%; background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease; }
.icon-button:hover { border-color: var(--md-sys-color-primary); background: var(--md-sys-color-primary-container); }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.zoom-level { min-width: 48px; color: var(--md-sys-color-on-surface-variant); font-variant-numeric: tabular-nums; font-size: 13px; text-align: center; }
.viewer-main { display: grid; width: min(100% - 48px, 1536px); height: calc(100vh - 76px); grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; margin: 0 auto; padding-bottom: 24px; }
.viewer-stage { position: relative; display: flex; min-width: 0; min-height: 0; align-items: center; justify-content: center; overflow: auto; border-radius: var(--md-sys-shape-corner-large); background: #eeedf2; overscroll-behavior: contain; }
.viewer-image { display: block; max-width: min(100%, 1400px); max-height: calc(100vh - 150px); object-fit: contain; transform-origin: center center; transition: transform 160ms ease-out; user-select: none; }
.viewer-loading { color: var(--md-sys-color-on-surface-variant); font-size: 14px; }
.zoom-hint { position: absolute; right: 14px; bottom: 12px; margin: 0; padding: 8px 12px; border: 1px solid rgb(255 255 255 / 70%); border-radius: var(--md-sys-shape-corner-full); background: rgb(255 255 255 / 84%); color: var(--md-sys-color-on-surface-variant); font-size: 12px; pointer-events: none; backdrop-filter: blur(12px); }
.viewer-error { max-width: 340px; padding: 24px; text-align: center; }
.viewer-error h1 { margin: 0; font-size: 20px; }
.viewer-error p { margin: 10px 0 20px; color: var(--md-sys-color-on-surface-variant); font-size: 14px; line-height: 1.7; }
.viewer-error .random-action { min-height: 44px; padding: 0 22px; font-size: 14px; }
.viewer-stage.has-error { overflow: auto; }
.viewer-details { display: flex; min-width: 0; flex-direction: column; padding: 28px 24px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--md-sys-shape-corner-large); background: var(--md-sys-color-surface); }
.viewer-details-heading { padding-bottom: 24px; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.detail-eyebrow { color: var(--md-sys-color-primary); font-size: 11px; font-weight: 750; letter-spacing: 1.3px; }
.viewer-details h1 { display: -webkit-box; overflow: hidden; margin: 10px 0 0; color: var(--md-sys-color-on-surface); font-size: 22px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.metadata-list { display: grid; gap: 0; margin: 8px 0 26px; }
.metadata-item { display: flex; min-width: 0; flex-direction: column; gap: 5px; padding: 15px 0; border-bottom: 1px solid var(--md-sys-color-outline-variant); }
.metadata-item dt { color: var(--md-sys-color-on-surface-variant); font-size: 12px; letter-spacing: 0.2px; }
.metadata-item dd { overflow-wrap: anywhere; margin: 0; color: var(--md-sys-color-on-surface); font-size: 14px; font-weight: 600; line-height: 1.5; }
.download-action { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; gap: 10px; margin-top: auto; padding: 0 20px; border-radius: var(--md-sys-shape-corner-full); background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); font-size: 14px; font-weight: 650; text-decoration: none; box-shadow: 0 2px 3px rgb(42 31 111 / 18%); transition: background-color 150ms ease, transform 150ms ease; }
.download-action:hover { transform: translateY(-1px); background: #493bb7; }
.download-action svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.viewer-footnote { margin: 14px 0 0; color: var(--md-sys-color-on-surface-variant); font-size: 11px; line-height: 1.7; text-align: center; }
.viewer-footnote kbd { padding: 1px 5px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 5px; background: var(--md-sys-color-surface-container); font: inherit; }

.viewer-page.is-fullscreen { position: fixed; inset: 0; z-index: 1000; width: 100vw; height: 100vh; overflow: hidden; background: #111; }
.viewer-page.is-fullscreen .app-shell { min-height: 100%; height: 100%; }
.viewer-page.is-fullscreen .viewer-bar { position: fixed; z-index: 20; inset: 0 0 auto; min-height: 76px; background: linear-gradient(rgb(0 0 0 / 72%), transparent); }
.viewer-page.is-fullscreen .viewer-bar .brand, .viewer-page.is-fullscreen .viewer-back { color: #fff; }
.viewer-page.is-fullscreen .viewer-tools .icon-button { border-color: rgb(255 255 255 / 30%); background: rgb(255 255 255 / 13%); color: #fff; }
.viewer-page.is-fullscreen .viewer-tools .icon-button:hover { background: rgb(255 255 255 / 24%); }
.viewer-page.is-fullscreen .zoom-level { color: #fff; }
.viewer-page.is-fullscreen .viewer-main { display: block; width: 100%; height: 100vh; padding: 0; }
.viewer-page.is-fullscreen .viewer-stage { position: fixed; z-index: 10; inset: 0; border-radius: 0; background: #111; }
.viewer-page.is-fullscreen .viewer-image { max-width: 100vw; max-height: 100vh; }
.viewer-page.is-fullscreen .viewer-details { display: none; }
.viewer-page.is-fullscreen .zoom-hint { bottom: 18px; border-color: rgb(255 255 255 / 15%); background: rgb(32 32 32 / 76%); color: #fff; }
.viewer-page.is-fullscreen .viewer-error { color: #fff; }

.docs-content { width: min(100% - 64px, 1000px); margin: 0 auto; padding: 48px 0 88px; }
.docs-title { margin: 0; color: var(--md-sys-color-on-surface); font-size: clamp(40px, 5vw, 56px); font-weight: 700; letter-spacing: -0.06em; line-height: 1.15; }
.docs-intro { max-width: 720px; margin: 16px 0 36px; color: var(--md-sys-color-on-surface-variant); font-size: 17px; line-height: 1.7; }
.doc-section { padding: 28px 0; border-top: 1px solid var(--md-sys-color-outline-variant); }
.doc-section h2 { margin: 0 0 12px; font-size: 22px; font-weight: 650; letter-spacing: -0.4px; }
.doc-section p, .doc-section li { color: var(--md-sys-color-on-surface-variant); font-size: 15px; line-height: 1.8; }
.doc-section p { margin: 8px 0; }
.doc-section ul { display: grid; gap: 5px; padding-left: 22px; }
.endpoint { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 16px 20px; border-radius: var(--md-sys-shape-corner-medium); background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.method { flex: none; font-size: 13px; font-weight: 750; letter-spacing: .7px; }
.endpoint code { overflow-wrap: anywhere; font-size: 14px; }
.code-block { overflow-x: auto; margin: 16px 0; padding: 18px 20px; border-radius: var(--md-sys-shape-corner-medium); background: #211f27; color: #f4f0fa; font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; font-size: 13px; line-height: 1.75; tab-size: 2; }
.status-list { display: grid; gap: 12px; margin: 16px 0 0; }
.status-row { display: grid; grid-template-columns: 90px 1fr; gap: 16px; align-items: start; }
.status-row dt { color: var(--md-sys-color-primary); font-size: 14px; font-weight: 700; }
.status-row dd { margin: 0; color: var(--md-sys-color-on-surface-variant); font-size: 14px; line-height: 1.7; }
.parameter-list { display: grid; gap: 14px; margin-top: 18px; }
.parameter-option .endpoint { margin-top: 0; }
.parameter-option p { margin: 7px 4px 0; font-size: 14px; }
.back-link { display: inline-flex; margin-top: 14px; color: var(--md-sys-color-primary); font-size: 14px; font-weight: 600; text-decoration: none; }

@media (max-width: 760px) {
  .top-app-bar { min-height: 72px; padding-inline: 24px; }
  .main-content { width: min(100% - 48px, 620px); padding-top: 26px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .photo-link { border-radius: 14px; aspect-ratio: 0.92 / 1; }
  .docs-content { width: min(100% - 48px, 620px); padding-top: 35px; }
  .viewer-page { height: auto; min-height: 100vh; overflow: auto; }
  .viewer-bar { min-height: 68px; gap: 10px; padding-inline: 18px; }
  .viewer-back { min-width: auto; font-size: 13px; }
  .viewer-bar .brand { font-size: 23px; }
  .viewer-tools { min-width: auto; gap: 5px; }
  .icon-button { width: 38px; height: 38px; }
  .reset-zoom { display: none; }
  .viewer-main { width: calc(100% - 32px); height: auto; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-bottom: 18px; }
  .viewer-stage { min-height: min(58vh, 620px); }
  .viewer-image { max-width: 100%; max-height: 58vh; }
  .zoom-hint { font-size: 11px; }
  .viewer-details { padding: 22px; }
  .viewer-details-heading { padding-bottom: 17px; }
  .metadata-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; margin-bottom: 20px; }
}

@media (max-width: 420px) {
  .top-app-bar { min-height: 68px; padding-inline: 16px; }
  .brand { gap: 8px; font-size: 22px; }
  .top-actions { gap: 8px; }
  .docs-action { min-height: 42px; gap: 6px; padding-inline: 12px; font-size: 12px; }
  .docs-action svg { width: 16px; height: 16px; }
  .random-action { min-height: 42px; gap: 8px; padding-inline: 16px; font-size: 13px; }
  .random-action svg { width: 17px; height: 17px; }
  .top-actions .random-action, .top-actions .docs-action { width: 108px; min-height: 42px; gap: 6px; padding-inline: 8px; font-size: 12px; }
  .top-actions .random-action svg { width: 16px; height: 16px; }
  .main-content { width: calc(100% - 32px); padding-top: 25px; }
  .section-heading { margin-bottom: 19px; }
  .section-heading h1 { font-size: 36px; }
  .photo-grid { gap: 10px; }
  .photo-link { border-radius: 12px; }
  .empty-state { min-height: 360px; padding-bottom: 46px; }
  .docs-content { width: calc(100% - 32px); padding-top: 30px; }
  .docs-title { font-size: 38px; }
  .docs-intro { margin: 12px 0 28px; font-size: 15px; }
  .doc-section { padding: 22px 0; }
  .doc-section h2 { font-size: 19px; }
  .doc-section p, .doc-section li { font-size: 14px; }
  .endpoint { align-items: flex-start; gap: 10px; padding: 14px; }
  .endpoint code { font-size: 12px; }
  .code-block { padding: 14px; font-size: 12px; }
  .status-row { grid-template-columns: 72px 1fr; gap: 10px; }
  .viewer-bar { min-height: 64px; padding-inline: 12px; }
  .viewer-back { gap: 5px; font-size: 12px; }
  .viewer-back svg { width: 17px; height: 17px; }
  .viewer-bar .brand { font-size: 19px; letter-spacing: -0.6px; }
  .viewer-tools { gap: 3px; }
  .icon-button { width: 34px; height: 34px; }
  .icon-button svg { width: 17px; height: 17px; }
  .zoom-level { min-width: 40px; font-size: 11px; }
  .viewer-main { width: calc(100% - 20px); }
  .viewer-stage { min-height: 55vh; border-radius: 18px; }
  .viewer-image { max-height: 55vh; }
  .zoom-hint { right: 8px; bottom: 8px; padding: 7px 9px; font-size: 10px; }
  .viewer-details { padding: 18px; border-radius: 18px; }
  .viewer-details h1 { font-size: 19px; }
  .metadata-item { padding: 12px 0; }
  .viewer-page.is-fullscreen .viewer-bar { min-height: 64px; padding-inline: 12px; }
}

@media (max-width: 360px) {
  .top-app-bar { padding-inline: 10px; }
  .brand { font-size: 19px; }
  .top-actions { gap: 5px; }
  .top-actions .random-action, .top-actions .docs-action { width: 100px; gap: 4px; padding-inline: 6px; font-size: 11px; }
  .top-actions .random-action svg, .top-actions .docs-action svg { width: 14px; height: 14px; }
}

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

/* Preview refresh: open masonry, filters, and a shared light/dark palette. */
html[data-theme="dark"] {
  color-scheme: dark;
  --md-sys-color-primary: #c8b9ff;
  --md-sys-color-on-primary: #2d216b;
  --md-sys-color-primary-container: #45377a;
  --md-sys-color-on-primary-container: #eee8ff;
  --md-sys-color-background: #121016;
  --md-sys-color-surface: #1d1b20;
  --md-sys-color-surface-container: #27242c;
  --md-sys-color-on-surface: #f4eff7;
  --md-sys-color-on-surface-variant: #cbc4d0;
  --md-sys-color-outline: #938e99;
  --md-sys-color-outline-variant: #49454f;
}

body { background: var(--md-sys-color-background); transition: background-color 180ms ease, color 180ms ease; }
html[data-theme="light"] body { background: #f8f7fc !important; color: #1d1b20; }
html[data-theme="dark"] body { background: #121016 !important; color: #f4eff7; }
html[data-theme="dark"] .app-shell { background: #121016; }
.theme-action { display: grid; width: 48px; height: 48px; flex: none; place-items: center; padding: 0; border: 1px solid var(--md-sys-color-outline-variant); border-radius: 50%; background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease; }
.theme-action:hover { transform: translateY(-1px); border-color: var(--md-sys-color-primary); background: var(--md-sys-color-primary-container); }
.theme-action svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; padding: 0; border: 0; margin: -1px; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: -8px 0 25px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-button { min-height: 38px; padding: 0 16px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--md-sys-shape-corner-full); background: transparent; color: var(--md-sys-color-on-surface-variant); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease; }
.filter-button:hover { border-color: var(--md-sys-color-primary); color: var(--md-sys-color-primary); }
.filter-button.is-active { border-color: var(--md-sys-color-primary); background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.search-field { display: flex; width: min(270px, 100%); min-height: 44px; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid var(--md-sys-color-outline-variant); border-radius: var(--md-sys-shape-corner-full); background: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface-variant); }
.search-field:focus-within { border-color: var(--md-sys-color-primary); outline: 3px solid color-mix(in srgb, var(--md-sys-color-primary) 25%, transparent); }
.search-field svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--md-sys-color-on-surface); font: inherit; font-size: 13px; }
.search-field input::placeholder { color: var(--md-sys-color-on-surface-variant); }

.photo-grid { display: block; column-count: 3; column-gap: 16px; }
.photo-link { display: block; break-inside: avoid; height: auto; margin: 0 0 16px; aspect-ratio: auto; }
.photo-link img { height: auto; aspect-ratio: auto; object-fit: contain; }
.photo-link[hidden] { display: none; }
.photo-grid.is-filtered .photo-link { animation: gallery-in 180ms ease both; }
@keyframes gallery-in { from { opacity: .45; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.viewer-nav-button:disabled { opacity: .35; cursor: default; pointer-events: none; }
.viewer-theme-action { margin-left: 2px; }
html[data-theme="dark"] .viewer-stage { background: #100f13; }
html[data-theme="dark"] .empty-icon { background: var(--md-sys-color-primary-container); }
html[data-theme="dark"] .code-block { background: #0d0c10; }

@media (max-width: 760px) {
  .gallery-toolbar { align-items: stretch; flex-direction: column; gap: 12px; margin-top: -2px; }
  .search-field { width: 100%; }
  .photo-grid { column-count: 2; column-gap: 12px; }
  .photo-link { margin-bottom: 12px; border-radius: 14px; }
  .top-actions .random-action, .top-actions .docs-action { width: 108px; }
  .top-actions .theme-action { width: 42px; height: 42px; }
  .viewer-tools { flex-wrap: nowrap; }
}

@media (max-width: 420px) {
  .gallery-toolbar { margin-bottom: 18px; }
  .filter-group { gap: 6px; }
  .filter-button { min-height: 35px; padding-inline: 13px; font-size: 12px; }
  .photo-grid { column-gap: 10px; }
  .photo-link { margin-bottom: 10px; border-radius: 12px; }
  .top-actions .theme-action { width: 42px; height: 42px; }
  .viewer-theme-action { display: none; }
}

@media (max-width: 340px) {
  .top-actions { gap: 4px; }
  .top-actions .random-action, .top-actions .docs-action { width: 94px; padding-inline: 4px; }
  .top-actions .theme-action { width: 36px; height: 36px; }
}
