:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
  --background: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #f0f3f4;
  --surface-raised: #ffffff;
  --sidebar: #f3f5f6;
  --line: #dfe5e7;
  --line-strong: #cbd4d7;
  --text: #1c2427;
  --text-soft: #68757a;
  --text-faint: #899499;
  --accent: #207765;
  --accent-strong: #165e50;
  --accent-soft: #e2f2ed;
  --blue: #426f9d;
  --blue-soft: #e7eef6;
  --coral: #c8604e;
  --coral-soft: #faebe8;
  --overlay: rgba(22, 29, 32, 0.78);
  --shadow: 0 14px 44px rgba(25, 37, 41, 0.14);
  --sidebar-width: 236px;
  --topbar-height: 64px;
  --tile-size: 180px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #111618;
  --surface: #181e21;
  --surface-soft: #222a2e;
  --surface-raised: #20272a;
  --sidebar: #151b1e;
  --line: #2d373b;
  --line-strong: #3b474c;
  --text: #edf2f3;
  --text-soft: #a0adb1;
  --text-faint: #7e8b90;
  --accent: #62bea6;
  --accent-strong: #7dceb8;
  --accent-soft: #18382f;
  --blue: #81a9d0;
  --blue-soft: #203244;
  --coral: #e28a79;
  --coral-soft: #3d2926;
  --overlay: rgba(10, 14, 16, 0.82);
  --shadow: 0 18px 56px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--background);
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

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

button,
select,
input[type="range"] {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent);
  outline-offset: 2px;
}

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

.button-icon,
.icon-button svg,
.search-field svg,
.nav-button svg,
.mobile-nav-button svg,
.select-field svg,
.size-field svg,
.selection-check svg,
.media-favorite svg,
.active-filter-chip svg,
.folder-cover-placeholder svg,
.empty-symbol svg,
.viewer-icon-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 18px 12px 14px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.brand,
.mobile-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand {
  gap: 11px;
  padding: 2px 8px 22px;
}

.brand-mark {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #163d36;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand-mark span {
  position: absolute;
  display: block;
  width: 11px;
  height: 14px;
  border-radius: 3px;
  background: #ffffff;
}

.brand-mark span:nth-child(1) {
  top: 8px;
  left: 7px;
  transform: rotate(-7deg);
}

.brand-mark span:nth-child(2) {
  top: 11px;
  left: 13px;
  background: #8dc6b6;
  transform: rotate(4deg);
}

.brand-mark span:nth-child(3) {
  top: 14px;
  left: 19px;
  background: #e19a7c;
  transform: rotate(10deg);
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brand-copy strong,
.mobile-brand strong {
  font-size: 15px;
  font-weight: 800;
}

.brand-copy small {
  color: var(--text-soft);
  font-size: 11px;
}

.sidebar-nav {
  display: grid;
  gap: 22px;
  overflow-y: auto;
}

.nav-section {
  display: grid;
  gap: 3px;
}

.nav-label {
  margin: 0 10px 6px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-button {
  display: grid;
  min-height: 42px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--text-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

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

.nav-button.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.nav-count {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 8px;
  color: var(--text-soft);
  background: var(--surface-raised);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.sidebar-footer {
  display: grid;
  min-width: 0;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 13px 10px 4px;
  border-top: 1px solid var(--line);
}

.sidebar-footer > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.sidebar-footer strong {
  font-size: 11px;
}

.sidebar-footer small {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.app-frame {
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 25;
  top: 0;
  display: grid;
  min-height: var(--topbar-height);
  grid-template-columns: minmax(280px, 660px) auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px clamp(18px, 3vw, 42px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px);
}

.mobile-brand,
.mobile-nav {
  display: none;
}

.search-field {
  display: grid;
  width: 100%;
  height: 42px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.search-field:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.search-field svg {
  color: var(--text-soft);
}

.search-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 13px;
}

.search-field input::placeholder {
  color: var(--text-faint);
}

.search-field kbd {
  min-width: 22px;
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--text-faint);
  background: var(--surface);
  font-size: 10px;
  font-family: inherit;
  text-align: center;
}

.topbar-actions,
.notice-actions,
.dialog-actions,
.viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 750;
  text-decoration: none;
}

.button {
  gap: 7px;
  padding: 8px 13px;
  font-size: 12px;
}

.icon-button {
  width: 38px;
  padding: 0;
  color: var(--text-soft);
  border-color: var(--line);
  background: var(--surface);
  font-size: 22px;
  line-height: 1;
}

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

.button-primary {
  color: #ffffff;
  border-color: #207765;
  background: #207765;
}

.button-primary:hover {
  border-color: #165e50;
  background: #165e50;
}

.button-secondary {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--surface);
}

.button-secondary:hover {
  background: var(--surface-soft);
}

.button-danger {
  color: #a8403b;
  border-color: #d9aaa6;
  background: #fff8f7;
}

.button-danger:hover {
  color: #8f302c;
  border-color: #c98f8a;
  background: #fff0ee;
}

[data-theme="dark"] .button-danger {
  color: #ffb6b0;
  border-color: #754844;
  background: #392624;
}

.metadata-button {
  position: relative;
}

.metadata-button-indicator {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--text-faint);
}

.metadata-button.has-metadata .metadata-button-indicator {
  background: #2a9b79;
}

.theme-dark-icon {
  display: none;
}

:root[data-theme="dark"] .theme-light-icon {
  display: none;
}

:root[data-theme="dark"] .theme-dark-icon {
  display: block;
}

main {
  width: min(100%, 1880px);
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 42px) 110px;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 15px;
  border-left: 4px solid var(--coral);
  background: var(--coral-soft);
}

.notice strong {
  font-size: 13px;
}

.notice p {
  max-width: 900px;
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.album-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0 20px;
}

.album-heading h1,
.album-heading p,
.empty-state h2,
.empty-state p,
.dialog h2,
.dialog p,
.viewer-info h2,
.viewer-info dl,
.viewer-info dd {
  margin: 0;
}

.heading-eyebrow {
  margin-bottom: 6px !important;
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.album-heading h1 {
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.15;
}

.album-heading #album-summary {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 12px;
}

.album-heading-actions {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.connection-mode {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 7px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 800;
}

.connection-mode::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
  content: "";
}

.refresh-button {
  width: 34px;
  min-height: 34px;
}

.scan-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
}

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.library-toolbar {
  position: sticky;
  z-index: 16;
  top: var(--topbar-height);
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 10px;
  margin: 0 calc(clamp(16px, 3vw, 42px) * -1) 12px;
  padding: 7px clamp(16px, 3vw, 42px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--background) 94%, transparent);
  backdrop-filter: blur(16px);
}

.toolbar-spacer {
  flex: 1;
}

.filter-group {
  display: inline-flex;
  min-height: 36px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.filter-button {
  min-width: 58px;
  padding: 6px 10px;
  border: 0;
  border-radius: 5px;
  color: var(--text-soft);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}

.filter-button.is-active {
  color: var(--text);
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.select-field,
.size-field {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text-soft);
  background: var(--surface);
}

.select-field select {
  height: 100%;
  padding: 0 22px 0 2px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 11px;
}

.size-field {
  width: 132px;
}

.size-field input {
  min-width: 0;
  width: 100%;
  accent-color: var(--accent);
}

.select-button {
  min-height: 36px;
}

.timeline-filter-button {
  min-height: 36px;
  padding-block: 6px;
}

.timeline-filter-button.is-active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--accent-soft);
}

.timeline-filter-count {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 4px;
  border-radius: 9px;
  color: #ffffff;
  background: var(--accent);
  font-size: 9px;
  line-height: 1;
}

.active-filters {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.active-filters::-webkit-scrollbar {
  display: none;
}

.active-filter-chip,
.active-filters-clear {
  display: inline-flex;
  min-height: 30px;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 750;
}

.active-filter-chip:hover {
  border-color: var(--accent);
}

.active-filter-chip svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.active-filters-clear {
  border-color: transparent;
  color: var(--text-soft);
  background: transparent;
}

.active-filters-clear:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.media-grid {
  display: block;
  min-height: 1px;
}

.timeline-rail {
  position: fixed;
  z-index: 14;
  right: 8px;
  top: calc(var(--topbar-height) + 74px);
  bottom: 24px;
  display: flex;
  width: 52px;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  overflow-y: auto;
  padding: 7px 4px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 8px 28px rgba(28, 42, 47, 0.08);
  backdrop-filter: blur(14px);
  scrollbar-width: none;
}

.timeline-rail::-webkit-scrollbar {
  display: none;
}

.timeline-rail button {
  min-height: 25px;
  padding: 4px 2px;
  border: 0;
  border-radius: 4px;
  color: var(--text-faint);
  background: transparent;
  font-size: 9px;
  font-weight: 750;
}

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

.timeline-rail button.is-active {
  color: #ffffff;
  background: var(--accent);
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 20px 14px;
  padding: 10px 0 24px;
}

.collection-section {
  padding: 4px 0 26px;
}

.collection-section + .collection-section {
  border-top: 1px solid var(--line);
}

.collection-section-header {
  display: flex;
  min-height: 38px;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0 3px;
}

.collection-section-header h2,
.collection-section-header p {
  margin: 0;
}

.collection-section-header h2 {
  font-size: 14px;
  line-height: 1.35;
}

.collection-section-header p {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.collection-grid {
  padding-bottom: 0;
}

.collection-card-custom .collection-cover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.collection-card-event .collection-cover {
  color: var(--coral);
  background: var(--coral-soft);
}

.collection-card:hover .collection-cover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 26px rgba(22, 36, 41, 0.13);
  transform: translateY(-1px);
}

.folder-card {
  display: grid;
  min-width: 0;
  gap: 9px;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.folder-card:hover .folder-cover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 26px rgba(22, 36, 41, 0.13);
  transform: translateY(-1px);
}

.folder-cover {
  aspect-ratio: 4 / 3;
  color: var(--blue);
  background: var(--blue-soft);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.folder-cover img {
  object-fit: contain;
}

.folder-cover-placeholder {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.folder-cover-placeholder svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.folder-cover.has-cover .folder-cover-placeholder {
  opacity: 0;
}

.folder-card-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 0 2px;
}

.folder-card-copy strong,
.folder-card-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-card-copy strong {
  font-size: 13px;
  line-height: 1.35;
}

.folder-card-copy small {
  color: var(--text-soft);
  font-size: 10px;
}

.map-view {
  display: grid;
  gap: 12px;
  min-height: 440px;
  padding: 2px 0 28px;
}

.map-view-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.map-view-header h2,
.map-view-header p {
  margin: 0;
}

.map-view-header h2 {
  margin-top: 3px;
  font-size: 21px;
}

.map-canvas {
  width: 100%;
  height: min(66vh, 680px);
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
  box-shadow: 0 10px 30px rgba(20, 31, 35, 0.08);
}

.map-empty {
  display: grid;
  min-height: 360px;
  place-content: center;
  gap: 6px;
  padding: 30px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  color: var(--text-soft);
  text-align: center;
}

.map-empty strong,
.map-empty p {
  margin: 0;
}

.map-empty strong {
  color: var(--text);
  font-size: 14px;
}

.map-empty p {
  max-width: 280px;
  font-size: 11px;
  line-height: 1.5;
}

.map-canvas .maplibregl-ctrl-group {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(20, 31, 35, 0.12);
}

.map-canvas .maplibregl-ctrl-group button {
  background-color: var(--surface);
}

.map-canvas .maplibregl-popup-content {
  min-width: 180px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(20, 31, 35, 0.18);
}

.map-popup {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 11px 12px;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.map-popup:hover {
  background: var(--surface-soft);
}

.map-popup strong,
.map-popup span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-popup strong {
  font-size: 11px;
}

.map-popup span {
  color: var(--text-soft);
  font-size: 9px;
}

.timeline-section {
  display: grid;
  gap: 7px;
  padding: 10px 0 18px;
}

.timeline-header {
  position: sticky;
  z-index: 12;
  top: calc(var(--topbar-height) + 54px);
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 9px;
  padding: 4px 2px;
  background: color-mix(in srgb, var(--background) 94%, transparent);
  backdrop-filter: blur(14px);
}

.timeline-select-button {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  background: var(--surface);
}

.timeline-select-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline-select-button:hover,
.timeline-select-button.is-selected {
  color: #ffffff;
  border-color: var(--accent);
  background: var(--accent);
}

.timeline-header h2 {
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-count {
  color: var(--text-faint);
  font-size: 10px;
  white-space: nowrap;
}

.timeline-grid,
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--tile-size)), 1fr));
  gap: 5px;
}

.skeleton-grid {
  padding-top: 10px;
}

.media-card {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--surface-soft);
  text-align: left;
}

.media-card:focus-visible {
  outline-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.media-card.is-skeleton {
  pointer-events: none;
}

.media-card.is-skeleton .media-preview,
.media-card.is-skeleton .skeleton-line {
  background: linear-gradient(90deg, var(--surface-soft) 25%, var(--surface) 50%, var(--surface-soft) 75%);
  background-size: 200% 100%;
  animation: skeleton-shift 1.2s ease-in-out infinite;
}

.skeleton-line {
  display: none;
}

@keyframes skeleton-shift {
  to {
    background-position: -200% 0;
  }
}

.media-preview {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: inherit;
  background: var(--surface-soft);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.metadata-placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  align-content: end;
  gap: 2px;
  padding: 10px;
  color: rgba(255, 255, 255, 0.94);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--metadata-placeholder-tone) 88%, #ffffff), var(--metadata-placeholder-tone));
  opacity: 1;
  transition: opacity 180ms ease;
}

.metadata-placeholder::before {
  position: absolute;
  top: 13%;
  left: 15%;
  width: 42%;
  height: 42%;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 3px;
  content: "";
  transform: rotate(-8deg);
}

.metadata-placeholder[data-orientation="portrait"]::before {
  width: 31%;
  height: 51%;
}

.metadata-placeholder[data-orientation="square"]::before {
  width: 39%;
  height: 39%;
}

.metadata-placeholder strong,
.metadata-placeholder small {
  position: relative;
  z-index: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metadata-placeholder strong {
  font-size: 12px;
  line-height: 1.2;
}

.metadata-placeholder small {
  color: rgba(255, 255, 255, 0.74);
  font-size: 9px;
}

.media-preview.is-thumbnail-ready .metadata-placeholder {
  opacity: 0;
}

.media-preview img {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  transition: filter 150ms ease, transform 150ms ease;
}

.media-card:hover .media-preview {
  border-color: var(--line-strong);
  box-shadow: 0 7px 18px rgba(20, 31, 35, 0.14);
}

.media-card:hover .media-preview img {
  filter: brightness(0.9);
}

.video-preview {
  color: #ffffff;
  background: #27363c;
}

.video-preview::before {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 21px solid #ffffff;
  content: "";
}

.media-type {
  position: absolute;
  z-index: 2;
  right: 6px;
  top: 6px;
  padding: 3px 5px;
  border-radius: 4px;
  color: #ffffff;
  background: rgba(18, 24, 27, 0.72);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.media-favorite {
  position: absolute;
  z-index: 3;
  right: 7px;
  bottom: 7px;
  display: none;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: #ffffff;
  background: rgba(190, 72, 76, 0.88);
  box-shadow: 0 2px 8px rgba(34, 18, 20, 0.24);
}

.media-favorite svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-card.is-favorite .media-favorite {
  display: grid;
}

.media-meta {
  position: absolute;
  z-index: 2;
  right: 5px;
  bottom: 5px;
  left: 5px;
  display: grid;
  min-width: 0;
  gap: 1px;
  padding: 6px 7px;
  border-radius: 5px;
  color: #ffffff;
  background: rgba(18, 24, 27, 0.78);
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.media-card:hover .media-meta,
.media-card:focus-visible .media-meta,
.media-card.is-selected .media-meta {
  opacity: 1;
  transform: translateY(0);
}

.media-name,
.media-folder,
.media-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-name {
  font-size: 10px;
  line-height: 1.35;
}

.media-folder,
.media-detail {
  color: #cbd5d8;
  font-size: 9px;
}

.media-detail {
  display: none;
}

.selection-check {
  position: absolute;
  z-index: 4;
  top: 7px;
  left: 7px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  color: transparent;
  background: rgba(18, 25, 28, 0.46);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.media-grid.is-selecting .selection-check,
.media-card:hover .selection-check,
.media-card.is-selected .selection-check {
  opacity: 1;
  transform: scale(1);
}

.media-card.is-selected .selection-check {
  color: #ffffff;
  border-color: #207765;
  background: #207765;
}

.media-card.is-selected .media-preview {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px var(--accent);
}

.empty-state {
  display: grid;
  min-height: 420px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 36px 16px;
  color: var(--text-soft);
  text-align: center;
}

.empty-symbol {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: var(--blue-soft);
}

.empty-symbol svg {
  width: 24px;
  height: 24px;
}

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

.empty-state p {
  max-width: 440px;
  font-size: 12px;
  line-height: 1.5;
}

.empty-state .button {
  margin-top: 8px;
}

.load-sentinel {
  height: 1px;
}

.selection-bar {
  position: fixed;
  z-index: 50;
  right: 50%;
  bottom: 18px;
  display: grid;
  width: min(calc(100% - 32px), 760px);
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
  gap: 12px 18px;
  padding: 10px 11px;
  overflow: hidden;
  border: 1px solid #39454a;
  border-radius: 8px;
  color: #ffffff;
  background: #182024;
  box-shadow: 0 18px 48px rgba(10, 16, 18, 0.3);
  transform: translateX(50%);
}

.selection-summary,
.selection-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.selection-summary > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.selection-summary strong,
.selection-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-summary strong {
  font-size: 12px;
}

.selection-summary span {
  color: #b4c2c7;
  font-size: 10px;
}

.selection-cancel {
  width: 34px;
  min-height: 34px;
  flex: 0 0 auto;
  color: #ffffff;
  border-color: #465359;
  background: #252f33;
}

.selection-actions {
  justify-content: flex-end;
}

.selection-actions .button {
  min-height: 34px;
  padding: 7px 10px;
}

.selection-actions .button-secondary {
  color: #edf3f4;
  border-color: #465359;
  background: #252f33;
}

.selection-actions #favorite-selected.is-active {
  color: #ffd5d7;
  border-color: #875155;
  background: #472d30;
}

.selection-progress-track {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  overflow: hidden;
  background: #303b40;
}

.selection-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  background: #63bda5;
  transition: width 160ms ease;
}

.selection-bar.is-busy .selection-actions button,
.selection-bar.is-busy #select-all-button {
  cursor: wait;
  opacity: 0.55;
}

.toast {
  position: fixed;
  z-index: 70;
  right: 20px;
  bottom: 20px;
  max-width: min(380px, calc(100% - 28px));
  padding: 10px 13px;
  border: 1px solid #3a474c;
  border-radius: 7px;
  color: #ffffff;
  background: #1b2428;
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 700;
}

body.has-selection .toast {
  bottom: 94px;
}

.dialog {
  width: min(calc(100% - 28px), 520px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(10, 15, 17, 0.58);
  backdrop-filter: blur(3px);
}

.filter-dialog form {
  display: grid;
  gap: 19px;
  padding: 23px;
}

.metadata-dialog-shell {
  display: grid;
  gap: 18px;
  padding: 23px;
}

.metadata-status-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.metadata-status-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  color: var(--blue);
  background: var(--blue-soft);
}

.metadata-status-icon svg {
  width: 22px;
  height: 22px;
}

.metadata-status-card strong,
.metadata-status-card p {
  margin: 0;
}

.metadata-status-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.metadata-status-card p,
.metadata-storage-note {
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.5;
}

.metadata-progress {
  display: grid;
  gap: 8px;
}

.metadata-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
  font-size: 10px;
}

.metadata-progress-track {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.metadata-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  background: #2a9b79;
  transition: width 120ms ease;
}

.metadata-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.metadata-actions .button-danger {
  margin-left: auto;
}

.metadata-storage-note {
  margin: -5px 0 0;
}

.collection-dialog form {
  display: grid;
  gap: 16px;
  padding: 23px;
}

.collection-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.collection-field > span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 750;
}

.collection-field input,
.collection-field select {
  width: 100%;
  height: 42px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: 0;
  color: var(--text);
  background: var(--surface);
}

.collection-field select {
  padding-right: 30px;
}

.collection-field input:focus,
.collection-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.collection-field input:disabled {
  cursor: default;
  color: var(--text-soft);
  background: var(--surface-soft);
}

.timeline-filter-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.timeline-filter-fields label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.timeline-filter-fields label > span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 750;
}

.timeline-filter-folder {
  grid-column: 1 / -1;
}

.timeline-filter-camera {
  grid-column: span 2;
}

.timeline-filter-fields select {
  width: 100%;
  height: 42px;
  min-width: 0;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: 0;
  color: var(--text);
  background: var(--surface);
}

.timeline-filter-fields select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.timeline-filter-fields select:disabled {
  cursor: default;
  opacity: 0.55;
}

.timeline-filter-actions {
  justify-content: space-between;
}

.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.dialog-header small {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.dialog-header h2 {
  margin-top: 4px;
  font-size: 21px;
}

.dialog-actions {
  justify-content: flex-end;
}

.viewer-dialog {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: #ffffff;
  background: #0e1214;
}

.viewer-dialog::backdrop {
  background: #0e1214;
}

.viewer-shell {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.viewer-header {
  z-index: 5;
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px clamp(12px, 2vw, 24px);
  border-bottom: 1px solid #2e383c;
  background: #151a1d;
}

.viewer-title {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.viewer-title strong,
.viewer-title small {
  overflow: hidden;
  max-width: 56vw;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-title strong {
  font-size: 12px;
}

.viewer-title small {
  color: #a9b4b8;
  font-size: 10px;
}

.viewer-icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: #edf2f3;
  background: transparent;
  text-decoration: none;
}

.viewer-icon-button:hover,
.viewer-icon-button[aria-pressed="true"] {
  border-color: #3c484d;
  background: #252d31;
}

#viewer-favorite[aria-pressed="true"] {
  color: #ffd0d3;
  border-color: #79484c;
  background: #472d30;
}

#viewer-favorite[aria-pressed="true"] svg {
  fill: currentColor;
}

#viewer-hide.is-restore {
  color: #bcebdc;
  border-color: #3e6f60;
  background: #20382f;
}

.viewer-workspace {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
}

.viewer-stage {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: 18px 64px;
  overflow: hidden;
}

.viewer-stage img,
.viewer-stage video {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-stage video {
  max-width: 1200px;
}

.viewer-loader {
  width: 34px;
  height: 34px;
  border: 3px solid #465156;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: viewer-spin 0.8s linear infinite;
}

.viewer-error {
  display: grid;
  justify-items: center;
  gap: 12px;
  color: #d9dfe0;
  text-align: center;
}

.viewer-error p {
  margin: 0;
}

@keyframes viewer-spin {
  to {
    transform: rotate(360deg);
  }
}

.viewer-nav {
  position: absolute;
  z-index: 4;
  top: 50%;
  display: grid;
  width: 40px;
  height: 52px;
  place-items: center;
  padding: 0;
  border: 1px solid #414c51;
  border-radius: 6px;
  color: #ffffff;
  background: rgba(22, 28, 31, 0.76);
  font-size: 30px;
  line-height: 1;
  transform: translateY(-50%);
}

.viewer-nav:disabled {
  cursor: default;
  opacity: 0.22;
}

.viewer-previous {
  left: 12px;
}

.viewer-next {
  right: 12px;
}

.viewer-shell.show-info .viewer-next {
  right: 326px;
}

.viewer-info {
  display: none;
  width: 314px;
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid #2e383c;
  color: #edf2f3;
  background: #171d20;
}

.viewer-shell.show-info .viewer-info {
  display: block;
}

.viewer-info-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid #2e383c;
}

.viewer-info-header h2 {
  font-size: 14px;
}

.viewer-info-list {
  display: grid;
}

.viewer-info-list > div {
  display: grid;
  gap: 5px;
  padding: 15px 18px;
  border-bottom: 1px solid #2b3438;
}

.viewer-info-list dt {
  color: #93a1a6;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.viewer-info-list dd {
  overflow-wrap: anywhere;
  color: #edf2f3;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

.viewer-info-list a {
  color: #9ed9ca;
  text-decoration: none;
}

.viewer-info-list a:hover {
  color: #c8f2e7;
  text-decoration: underline;
}

#viewer-info-description {
  white-space: pre-wrap;
}

.viewer-footer {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 15px 8px;
  color: #a8b4b8;
  background: #151a1d;
  font-size: 10px;
}

.viewer-footer #viewer-count {
  margin-left: auto;
}

.viewer-offline-status {
  padding: 3px 7px;
  border: 1px solid #3f6f5e;
  border-radius: 4px;
  color: #c5eadc;
  background: #1d382e;
  white-space: nowrap;
}

.login-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
  background: var(--background);
}

.login-shell {
  display: grid;
  width: min(100%, 420px);
  gap: 26px;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-heading {
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-heading .brand-mark {
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 11px;
  font-weight: 850;
}

.login-heading h1,
.login-heading p,
.login-error {
  margin: 0;
}

.login-heading h1 {
  margin-top: 2px;
  font-size: 23px;
}

.login-heading p {
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.login-form {
  display: grid;
  gap: 15px;
}

.login-form label {
  display: grid;
  gap: 6px;
}

.login-form label > span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  min-height: 43px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--text);
  background: var(--surface);
}

.login-form input:focus {
  border-color: var(--accent);
}

.login-error {
  padding: 9px 10px;
  border-left: 3px solid var(--coral);
  color: var(--coral);
  background: var(--coral-soft);
  font-size: 11px;
  font-weight: 700;
}

.login-submit {
  min-height: 43px;
  margin-top: 3px;
  padding: 9px 13px;
  border: 0;
  border-radius: 5px;
  color: #ffffff;
  background: #207765;
  cursor: pointer;
  font-weight: 800;
}

.login-submit:hover {
  background: #165e50;
}

@media (min-width: 1181px) {
  main {
    padding-right: 74px;
  }
}

@media (max-width: 1180px) {
  .timeline-rail {
    display: none;
  }
}

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

  .topbar {
    grid-template-columns: minmax(240px, 1fr) auto;
  }

  .size-field {
    width: 110px;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-height: 112px;
    --tile-size: 160px;
  }

  .sidebar {
    display: none;
  }

  .app-frame {
    margin-left: 0;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 8px 12px 10px;
  }

  .mobile-brand {
    display: flex;
    gap: 8px;
  }

  .mobile-brand .brand-mark {
    width: 32px;
    height: 32px;
  }

  .mobile-brand .brand-mark span {
    transform: scale(0.88);
  }

  .search-field {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .search-field kbd {
    display: none;
  }

  .topbar-actions .button {
    min-height: 36px;
    padding: 7px 10px;
  }

  main {
    padding: 14px 10px 152px;
  }

  .album-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 7px 2px 16px;
  }

  .album-heading h1 {
    font-size: 27px;
  }

  .album-heading-actions {
    justify-content: flex-start;
  }

  .library-toolbar {
    top: var(--topbar-height);
    margin: 0 -10px 8px;
    padding: 7px 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .library-toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar-spacer {
    min-width: 2px;
  }

  .size-field {
    display: none;
  }

  .select-field,
  .select-button {
    flex: 0 0 auto;
  }

  .timeline-header {
    top: calc(var(--topbar-height) + 52px);
  }

  .timeline-grid,
  .skeleton-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }

  .timeline-section {
    gap: 5px;
    padding-bottom: 14px;
  }

  .active-filters {
    margin-inline: 2px;
  }

  .folder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 8px;
    padding-top: 6px;
  }

  .collection-section {
    padding-bottom: 20px;
  }

  .collection-section-header {
    padding-top: 5px;
  }

  .map-view {
    min-height: 360px;
    gap: 10px;
  }

  .map-canvas {
    height: min(58vh, 560px);
    min-height: 340px;
  }

  .map-empty {
    min-height: 300px;
  }

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

  .media-preview.folder-cover {
    aspect-ratio: 4 / 3;
  }

  .media-preview {
    aspect-ratio: 1 / 1;
  }

  .media-meta {
    right: 3px;
    bottom: 3px;
    left: 3px;
  }

  .media-folder {
    display: none;
  }

  .media-type {
    right: 5px;
    top: 5px;
  }

  .notice {
    align-items: stretch;
    flex-direction: column;
  }

  .notice-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .notice-actions a {
    grid-column: 1 / -1;
  }

  .mobile-nav {
    position: fixed;
    z-index: 35;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    min-height: 68px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(18px);
  }

  .mobile-nav-button {
    display: grid;
    min-width: 0;
    place-items: center;
    gap: 3px;
    padding: 5px 3px;
    border: 0;
    border-radius: 6px;
    color: var(--text-soft);
    background: transparent;
    font-size: 9px;
    font-weight: 750;
  }

  .mobile-nav-button.is-active {
    color: var(--accent-strong);
    background: var(--accent-soft);
  }

  .selection-bar {
    bottom: 76px;
    width: calc(100% - 16px);
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
  }

  .selection-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .selection-actions .button {
    min-width: 0;
    padding: 7px 7px;
  }

  .selection-actions .button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .toast,
  body.has-selection .toast {
    right: 12px;
    bottom: 148px;
  }

  .viewer-title strong,
  .viewer-title small {
    max-width: 40vw;
  }

  .viewer-stage {
    padding: 10px 44px;
  }

  .viewer-nav {
    width: 34px;
    height: 48px;
  }

  .viewer-previous {
    left: 5px;
  }

  .viewer-next,
  .viewer-shell.show-info .viewer-next {
    right: 5px;
  }

  .viewer-info {
    position: absolute;
    z-index: 8;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(62vh, 520px);
    border-top: 1px solid #344046;
    border-left: 0;
    box-shadow: 0 -18px 46px rgba(0, 0, 0, 0.36);
  }
}

@media (max-width: 440px) {
  .topbar-actions .button span {
    display: none;
  }

  .topbar-actions .button {
    width: 36px;
    padding: 0;
  }

  .filter-button {
    min-width: 52px;
    padding: 6px 8px;
  }

  .select-field svg {
    display: none;
  }

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

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

  .filter-dialog form {
    padding: 18px;
  }

  .metadata-dialog-shell {
    padding: 18px;
  }

  .collection-dialog form {
    padding: 18px;
  }

  .metadata-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .metadata-actions .button {
    width: 100%;
  }

  .metadata-actions .button-danger {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .timeline-filter-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-filter-folder {
    grid-column: 1 / -1;
  }

  .timeline-filter-camera {
    grid-column: 1 / -1;
  }

  .viewer-header {
    min-height: 56px;
    padding-inline: 8px;
  }

  .viewer-icon-button {
    width: 32px;
    height: 32px;
  }

  .viewer-actions {
    gap: 0;
  }

  .viewer-title strong {
    max-width: 22vw;
  }

  .viewer-title small {
    display: none;
  }
}

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