:root {
  --bg: #0e1319;
  --panel: #151c24;
  --panel-border: #293340;
  --text: #e4eaf1;
  --muted: #98a5b5;
  --selected: #69d5a2;
  --burst: #5ba6ff;
  --danger: #ff9c9c;
  --shadow: none;
  --radius-lg: 0;
  --radius-md: 0;
  --radius-sm: 0;
  --font-sans: "Avenir Next", "Segoe UI", sans-serif;
}

body {
  background: #0e1319;
}

.page-glow {
  display: none;
}

.shell {
  width: 100%;
  padding: 0;
}

#loginView {
  max-width: 84rem;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem);
}

#loginView .login-panel {
  border-radius: 7px;
  background: #151c24;
  box-shadow: none;
  backdrop-filter: none;
}

#loginView .field input,
#loginView .primary-button {
  border-radius: 5px;
}

#appView {
  min-width: 0;
}

#appView [hidden] {
  display: none !important;
}

#appView .panel {
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

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

.review-header {
  position: relative;
  z-index: 20;
  background: #151c24;
  border-bottom: 1px solid #293340;
}

.review-header-main,
.review-header-sub {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 1.4rem;
}

.review-header-main {
  min-height: 4.55rem;
  gap: 0.65rem;
}

.review-header-sub {
  min-height: 3.65rem;
  gap: 1.1rem;
  border-top: 1px solid #293340;
}

.review-header-spacer {
  flex: 1 1 auto;
  min-width: 0;
}

.review-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
  margin-right: 0.35rem;
  font-size: 1.16rem;
  letter-spacing: -0.04em;
}

.review-brand > svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: none;
  stroke: #69d5a2;
  stroke-width: 1.7;
}

.runtime-badge {
  border-radius: 2px;
  font-size: 0.62rem;
}

.header-dropdown {
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
}

.header-dropdown > summary {
  list-style: none;
  cursor: pointer;
}

.header-dropdown > summary::-webkit-details-marker {
  display: none;
}

.header-picker,
.header-icon-button,
.mini-status-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.55rem;
  padding: 0 0.75rem;
  border: 1px solid #303b49;
  border-radius: 6px;
  background: #0e1319;
  color: #e4eaf1;
  box-shadow: none;
}

.header-picker:hover,
.header-icon-button:hover,
.mini-status-card:hover,
.header-dropdown[open] > summary {
  border-color: #506171;
  background: #1b2530;
}

.header-picker > svg,
.header-icon-button > svg {
  width: 1.18rem;
  height: 1.18rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-picker > span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.header-picker .picker-chevron {
  width: 0.8rem;
  height: 0.8rem;
  margin-left: 0.2rem;
  color: #98a5b5;
}

.author-picker .header-picker {
  max-width: min(21rem, 25vw);
}

.date-picker .header-icon-button {
  border-color: #303b49;
  background: #0e1319;
}

.date-picker.has-date .header-icon-button {
  border-color: #54bb8b;
  color: #8de2b8;
  background: #1b302b;
}

.header-popover.date-popover {
  width: 17.8rem;
  padding: 0.8rem;
}

.calendar-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.calendar-month-nav strong {
  color: #e4eaf1;
  font-size: 0.88rem;
  font-weight: 650;
  white-space: nowrap;
}

.calendar-month-nav button {
  width: 2rem;
  height: 2rem;
  border: 1px solid #344150;
  border-radius: 4px;
  background: #121b23;
  color: #c8d2dc;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.calendar-month-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
  text-align: center;
}

.calendar-weekdays {
  margin-bottom: 0.35rem;
  color: #8294a3;
  font-size: 0.67rem;
  font-weight: 600;
}

.calendar-days > * {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
}

.calendar-day {
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #8294a3;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

button.calendar-day {
  cursor: pointer;
}

.calendar-day.available {
  border-color: #71d5a3;
  color: #e6f9ee;
  font-weight: 700;
}

.calendar-day.available:hover,
.calendar-day.available:focus-visible {
  background: #27483a;
  outline: none;
}

.calendar-day.selected {
  border-color: #81e1b0;
  background: #81e1b0;
  color: #0e2118;
}

.calendar-clear {
  width: 100%;
  min-height: 2.3rem;
  margin-top: 0.7rem;
  border: 1px solid #344150;
  border-radius: 4px;
  background: #121b23;
  color: #c8d2dc;
  cursor: pointer;
  font-size: 0.78rem;
}

.calendar-clear:hover:not(:disabled) {
  border-color: #71d5a3;
  color: #e6f9ee;
}

.calendar-clear:disabled {
  opacity: 0.45;
  cursor: default;
}

.dir-picker .header-picker {
  width: 2.55rem;
  min-width: 2.55rem;
  max-width: none;
  padding: 0;
}

.header-icon-button {
  width: 2.55rem;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: #b3beca;
}

.header-icon-button:focus-visible,
.header-picker:focus-visible,
.mini-status-card:focus-visible,
.last-picked-button:focus-visible,
.photo-card:focus-visible {
  outline: 2px solid #69d5a2;
  outline-offset: 2px;
}

.header-popover {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  z-index: 40;
  width: max-content;
  max-width: min(25rem, calc(100vw - 1rem));
  max-height: min(27rem, 70dvh);
  overflow: auto;
  padding: 0.38rem;
  border: 1px solid #344150;
  border-radius: 7px;
  background: #1a232d;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  color: #e4eaf1;
}

.align-right .header-popover,
.mini-dropdown .header-popover {
  right: 0;
  left: auto;
}

.photographer-tabs {
  display: grid;
  gap: 0.15rem;
  min-width: 16rem;
  margin: 0;
  border: 1px solid #344150;
  background: #1a232d;
}

.photographer-tabs .photographer-tab,
.dir-menu-item,
.action-menu > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 2.55rem;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #e4eaf1;
  text-align: left;
  box-shadow: none;
}

.photographer-tabs .photographer-tab:hover,
.dir-menu-item:hover,
.action-menu > button:hover {
  background: #263443;
}

.photographer-tabs .photographer-tab.active,
.dir-menu-item.active {
  background: #253a36;
  color: #8de2b8;
}

.photographer-tabs .photographer-tab strong {
  border-radius: 3px;
  background: #303b49;
}

.dir-menu {
  min-width: min(12rem, calc(100vw - 1rem));
}

.dir-menu-item {
  display: grid;
  gap: 0.2rem;
  justify-content: stretch;
}

.dir-menu-item span {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #98a5b5;
  font-size: 0.74rem;
}

.menu-empty {
  margin: 0;
  padding: 0.75rem;
  color: #98a5b5;
}

.mini-status-card {
  border-color: transparent;
  background: transparent;
  border-radius: 4px;
  padding: 0 0.4rem;
}

.mini-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  box-shadow: none;
}

.mini-status-online .mini-status-dot,
.mini-status-offline .mini-status-dot {
  box-shadow: none;
}

.mini-status-connection svg {
  width: 1.15rem;
  height: 1.15rem;
}

.mini-status-speed {
  color: #98a5b5;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mini-popover {
  width: 20rem;
  padding: 0.8rem;
  line-height: 1.45;
}

.mini-popover strong {
  display: block;
  margin-bottom: 0.35rem;
}

.mini-popover .mini-network-icon {
  width: 1.4rem;
  height: 1.4rem;
}

.action-menu {
  width: 15rem;
}

.action-menu .menu-heading {
  display: block;
  padding: 0.6rem;
  overflow-wrap: anywhere;
  color: #98a5b5;
  font-size: 0.78rem;
}

.action-menu .danger-action {
  color: #ffaaaa;
}

.stats-disclosure {
  border-bottom: 1px solid #344150;
}

.stats-disclosure > summary {
  padding: 0.7rem 0.65rem;
  cursor: pointer;
}

.stats-disclosure dl {
  margin: 0 0 0.5rem;
  padding: 0 0.65rem;
}

.stats-disclosure dl > div {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.2rem 0;
  font-size: 0.75rem;
}

.stats-disclosure dt {
  color: #98a5b5;
}

.stats-disclosure dd {
  margin: 0;
  max-width: 10rem;
  overflow-wrap: anywhere;
  text-align: right;
}

.source-picker-summary {
  width: 2.55rem;
  border-color: #69d5a2;
  background: #274b3c;
  color: #c6f4db;
  box-shadow: inset 0 -2px 0 #69d5a2;
}

.source-picker .source-picker-summary:hover,
.source-picker[open] > .source-picker-summary {
  border-color: #8de2b8;
  background: #315b48;
}

.source-picker-summary svg,
.source-tabs .source-tab svg {
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.source-picker-summary > span {
  display: inline-flex;
}

.source-tabs {
  display: grid;
  gap: 0.15rem;
  width: min(13.5rem, calc(100vw - 1rem));
  min-width: min(12rem, calc(100vw - 1rem));
  margin: 0;
}

.source-tabs .photographer-tab {
  justify-content: flex-start;
  width: 100%;
  min-height: 2.65rem;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #e4eaf1;
  text-align: left;
}

.source-tabs .source-tab:hover:not(:disabled) {
  background: #223b31;
  color: #d9f6e6;
}

.source-tabs .photographer-tab.active {
  border: 0;
  background: #253a36;
  color: #c6f4db;
  box-shadow: none;
}

.source-tabs .source-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.source-tabs .photographer-tab strong {
  margin-left: auto;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.summary-panel {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.summary-panel > div {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.summary-panel strong {
  color: #e4eaf1;
  font-size: 0.94rem;
}

.summary-panel span {
  color: #98a5b5;
  font-size: 0.8rem;
}

.summary-panel svg,
.preview-quality-field svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: #98a5b5;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary-panel .summary-selected svg {
  stroke: #69d5a2;
}

.preview-quality-field {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.25rem;
  min-width: 0;
  padding-left: 0.8rem;
  border-left: 1px solid #344150;
}

.preview-quality-field select {
  max-width: 5.5rem;
  min-height: 2.4rem;
  padding: 0 0.3rem;
  border: 0;
  background: #151c24;
  color: #e4eaf1;
  font-weight: 700;
}

.preview-quality-status {
  max-width: 10rem;
  margin: 0;
}

.archive-info,
.sequence-gap-notice {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.grid-panel {
  margin: 0;
  padding: 0.7rem 1.4rem 2rem;
  border: 0;
  background: #0e1319;
  overflow: visible;
}

.grid-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.3rem;
  padding: 0 0 0.65rem;
}

.grid-toolbar-bottom {
  margin-top: 1.25rem;
  padding: 0.8rem 0 0;
  border-top: 1px solid #293340;
}

.toolbar-left {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.65rem;
  width: auto;
}

.page-range-label {
  flex: 0 0 auto;
  color: #98a5b5;
  font-size: 0.83rem;
  font-variant-numeric: tabular-nums;
}

.last-picked-button,
.audio-filter-button,
.selected-filter-button,
.page-arrow-button,
.page-label,
.photo-jump-field button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #aebbc8;
  box-shadow: none;
}

.last-picked-button {
  width: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
  border-color: #344e44;
  background: #20392f;
  color: #a9ebc8;
}

.last-picked-button:hover:not(:disabled) {
  border-color: #69d5a2;
  background: #285040;
}

.last-picked-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.last-picked-button svg,
.audio-filter-button svg {
  width: 1.12rem;
  height: 1.12rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.audio-filter-button,
.selected-filter-button {
  width: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
}

.selected-filter-button.active {
  border-color: #69d5a2;
  background: #69d5a2;
  color: #0b2017;
}

.audio-filter-button.active {
  background: #263443;
  color: #e4eaf1;
}

.pager {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.2rem;
  width: auto;
}

.page-arrow-button {
  min-width: 2.45rem;
  padding: 0;
  font-size: 1.45rem;
  line-height: 1;
}

.page-arrow-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-label {
  order: 0;
  min-width: 4.7rem;
  padding: 0 0.3rem;
  color: #e4eaf1;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.page-label:hover:not(:disabled),
.page-arrow-button:hover:not(:disabled),
.audio-filter-button:hover {
  background: #25303c;
}

.photo-jump-field {
  position: static;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.15rem;
  width: auto;
  min-height: 2.5rem;
  padding: 0 0.18rem;
  border: 1px solid #344150;
  border-radius: 5px;
  background: #1a232d;
  box-shadow: none;
}

.photo-jump-field input {
  flex: 0 0 auto;
  width: 3.25rem;
  min-height: 2.25rem;
  padding: 0 0.15rem;
  border: 0;
  background: transparent;
  text-align: center;
  appearance: textfield;
}

.photo-jump-field input::-webkit-inner-spin-button,
.photo-jump-field input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.photo-jump-field button {
  width: 2.2rem;
  min-width: 2.2rem;
  min-height: 2.2rem;
  padding: 0;
  background: #69d5a2;
  color: #0b2017;
}

.photo-jump-field button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.photo-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 0.95rem;
}

.photo-card {
  width: fit-content;
  max-width: min(100%, 22rem);
  padding: 0 0 0.4rem;
  overflow: hidden;
  border: 1px solid #293340;
  border-radius: 6px;
  background: #151c24;
  box-shadow: none;
}

.photo-card img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 11.75rem;
  margin: 0 auto;
  object-fit: contain;
  background: #222d39;
}

.photo-card-name {
  padding: 0.44rem 0.55rem 0;
  color: #b7c3cf;
  font-size: 0.75rem;
}

.photo-card-selected {
  border-color: #69d5a2;
  background: #192c27;
  box-shadow: inset 0 0 0 1px #69d5a2;
}

.photo-card-selected .photo-card-name {
  color: #dcf8e8;
}

.photo-card-badge {
  top: 0.45rem;
  right: 0.45rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 4px;
  background: #69d5a2;
  color: #0b2017;
  box-shadow: none;
}

.photo-card-badge,
.viewer-candidate.active,
.viewer-flash {
  background: #69d5a2;
  color: #0b2017;
}

.photo-card-markers {
  top: 0.45rem;
  left: 0.45rem;
}

.viewer-backdrop {
  background: #0e1319;
  backdrop-filter: none;
}

.viewer-surface {
  background: #0e1319;
}

.viewer-image {
  max-width: min(96vw, 1680px);
  max-height: min(86dvh, 1200px);
  border-radius: 0;
  box-shadow: none;
}

.viewer-index {
  border: 1px solid #344150;
  border-radius: 4px;
  background: #1a232d;
  box-shadow: none;
  backdrop-filter: none;
}

.viewer-action-button,
.viewer-candidate,
.viewer-sequence-skip {
  border: 1px solid #344150;
  border-radius: 4px;
  background: #1a232d;
  box-shadow: none;
  backdrop-filter: none;
}

.viewer-candidate.active {
  border-color: #69d5a2;
  background: #69d5a2;
}

.viewer-flash[hidden] {
  display: none;
}

.viewer-info-panel {
  border-radius: 5px;
  background: #1a232d;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  backdrop-filter: none;
}

.viewer-meta {
  border-radius: 3px;
  background: #263443;
  backdrop-filter: none;
}

@media (max-width: 1050px) {
  .review-header-main,
  .review-header-sub {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .review-header-main {
    flex-wrap: wrap;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .review-header-sub {
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .review-header-sub .review-header-spacer {
    flex-basis: 1rem;
  }

  .grid-panel {
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

@media (max-width: 720px) {
  body {
    background: #0e1319;
  }

  .shell {
    padding: 0;
  }

  .review-header-main,
  .review-header-sub {
    padding-right: max(0.75rem, env(safe-area-inset-right));
    padding-left: max(0.75rem, env(safe-area-inset-left));
  }

  .review-brand {
    margin: 0 0.1rem 0 0;
    font-size: 1rem;
  }

  .review-brand > svg {
    display: none;
  }

  .runtime-badge {
    display: none;
  }

  .source-picker {
    flex: 0 0 auto;
  }

  .source-picker-summary {
    width: 2.35rem;
    min-height: 2.5rem;
  }

  .author-picker {
    flex: 0 1 auto;
  }

  .dir-picker {
    flex: 0 0 2.5rem;
  }

  .author-picker .header-picker {
    width: auto;
    max-width: min(11rem, 34vw);
  }

  .date-picker {
    flex: 0 0 auto;
  }

  .date-picker .header-popover {
    right: 0;
    left: auto;
  }

  .dir-picker .header-picker {
    width: 2.5rem;
    min-width: 2.5rem;
    max-width: none;
  }

  .dir-picker .header-popover {
    right: 0;
    left: auto;
  }

  .mini-dropdown .header-popover {
    right: auto;
    left: 0;
    width: min(20rem, calc(100vw - 1rem));
  }

  .review-header-main > .review-header-spacer {
    flex-basis: 100%;
  }

  .review-header-sub > .review-header-spacer {
    display: none;
  }

  .summary-panel {
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    overflow: visible;
  }

  .summary-panel > div {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .preview-quality-field {
    padding-left: 0.45rem;
  }

  .grid-panel {
    padding: 0.7rem 0.75rem 1.5rem;
    overflow: visible;
    border-radius: 0;
  }

  .grid-toolbar {
    align-items: stretch;
    gap: 0.35rem;
    padding-bottom: 0.75rem;
  }

  .toolbar-left {
    display: flex;
    flex-basis: 100%;
    gap: 0;
  }

  .page-range-label {
    flex-basis: 100%;
  }

  .last-picked-button,
  .audio-filter-button,
  .selected-filter-button {
    width: 2.4rem;
    min-width: 2.4rem;
    min-height: 2.75rem;
  }

  .pager {
    justify-content: space-between;
    gap: 0;
    width: 100%;
  }

  .pager.editing-jump .page-arrow-first,
  .pager.editing-jump .page-arrow-last {
    display: none;
  }

  .page-label {
    flex: 0 0 auto;
    min-width: 3.5rem;
    order: 0;
    text-align: center;
  }

  .page-arrow-button {
    min-width: 2.4rem;
    min-height: 2.75rem;
    padding: 0;
    border-radius: 5px;
  }

  .photo-jump-field {
    min-height: 2.75rem;
  }

  .photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .photo-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-bottom: 0.35rem;
    border-radius: 5px;
  }

  .photo-card img {
    max-height: 9rem;
  }

  .photo-card-name {
    padding: 0.35rem 0.4rem 0;
    font-size: 0.67rem;
  }

  .viewer-surface {
    padding-right: max(0.65rem, env(safe-area-inset-right));
    padding-left: max(0.65rem, env(safe-area-inset-left));
  }

  .viewer-topline {
    left: max(0.65rem, env(safe-area-inset-left));
    right: calc(max(0.65rem, env(safe-area-inset-right)) + 9rem);
  }

  .viewer-name {
    max-width: 100%;
  }

  .viewer-actions {
    right: max(0.65rem, env(safe-area-inset-right));
    gap: 0.25rem;
  }

  .viewer-action-button {
    width: 2.6rem;
    height: 2.6rem;
  }

  .viewer-index {
    top: calc(max(0.65rem, env(safe-area-inset-top)) + 3.2rem);
  }
}

@media (max-width: 440px) {
  .review-header-main {
    gap: 0.35rem;
  }

  .author-picker {
    flex: 0 1 auto;
  }

  .dir-picker {
    flex: 0 0 2.5rem;
  }

  .author-picker .header-picker {
    gap: 0.25rem;
    padding-right: 0.35rem;
    padding-left: 0.35rem;
  }

  .header-picker {
    gap: 0.35rem;
    min-height: 2.75rem;
    padding: 0 0.5rem;
    font-size: 0.8rem;
  }

  .mini-status-card,
  .header-icon-button {
    min-height: 2.75rem;
  }

  .header-icon-button {
    width: 2.75rem;
  }

  .mini-status-speed {
    max-width: 7rem;
    overflow: hidden;
    font-size: 0.67rem;
    text-overflow: ellipsis;
  }

  .summary-panel {
    flex-basis: 100%;
  }

  .preview-quality-field {
    border-left: 0;
    padding-left: 0;
  }

}

#adminPanel {
  position: relative;
  max-width: 950px;
  margin: 1.2rem auto 0;
  padding: 20px;
  border: 1px solid #293340;
  background: #151c24;
  font-size: 13px;
}

#adminPanel .admin-head { align-items: center; }
#adminPanel .admin-head h3 { margin: 0; font-size: 17px; font-weight: 650; }
#adminPanel .admin-head p { margin: 4px 0 0; color: #98a5b5; font-size: 12px; }
#adminPanel .admin-layout { display: block; max-width: 850px; margin: 20px auto 0; }
#adminPanel .admin-account-row { display: flex; align-items: end; gap: 10px; }
#adminPanel .admin-account-select { flex: 1; }
#adminPanel .admin-form {
  display: block;
  margin-top: 14px;
  padding: 20px;
  border: 1px solid #293340;
  border-radius: 6px;
  background: #0e1319;
}

#adminPanel .admin-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; color: #98a5b5; font-size: 11px; }
#adminPanel .admin-field input,
#adminPanel .admin-field select {
  width: 100%; min-width: 0; height: 36px; padding: 0 10px;
  border: 1px solid #344152; border-radius: 6px;
  background: #151c24; color: #e4eaf1; font-size: 13px;
}
#adminPanel .admin-field input:focus,
#adminPanel .admin-field select:focus { outline: 2px solid #69d5a2; outline-offset: 1px; }
#adminPanel .admin-button,
#adminPanel .admin-icon-button {
  min-height: 34px; padding: 0 12px; border: 1px solid #344152; border-radius: 6px;
  background: #1a2430; color: #e4eaf1; font-size: 12px; font-weight: 600;
}
#adminPanel .admin-button:hover:not(:disabled),
#adminPanel .admin-icon-button:hover:not(:disabled) { background: #242f3c; }
#adminPanel button:disabled { opacity: 0.48; cursor: not-allowed; }
#adminPanel .admin-icon-button { display: grid; place-items: center; width: 36px; padding: 0; }
#adminPanel .admin-icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#adminPanel .admin-delete-button { color: #ff9c9c; }
#adminPanel .admin-form-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
#adminPanel .admin-form-heading h4 { margin: 0 0 3px; font-size: 15px; overflow-wrap: anywhere; }
#adminPanel .admin-form-heading span { color: #98a5b5; font-size: 12px; overflow-wrap: anywhere; }
#adminPanel .admin-active-toggle,
#adminPanel .admin-check-label { display: inline-flex; align-items: center; gap: 8px; color: #e4eaf1; cursor: pointer; }
#adminPanel input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; accent-color: #69d5a2; }
#adminPanel .admin-identity-fields { display: grid; grid-template-columns: 1fr 1fr 160px; gap: 12px; }
#adminPanel .admin-password-section { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; margin-top: 18px; }
#adminPanel .admin-current-password > span { color: #98a5b5; font-size: 11px; }
#adminPanel .admin-current-password p { margin: 5px 0 0; color: #98a5b5; font-size: 12px; line-height: 1.4; }
#adminPanel .admin-password-control { display: flex; border: 1px solid #344152; border-radius: 6px; background: #151c24; }
#adminPanel .admin-password-control input { border: 0; background: transparent; }
#adminPanel .admin-inline-button { padding: 0 8px; border: 0; background: transparent; color: #98a5b5; font-size: 11px; }
#adminPanel .admin-note { margin: 17px 0 0; color: #98a5b5; font-size: 12px; }
#adminPanel .admin-access-section { margin-top: 22px; }
#adminPanel .admin-access-section h5 { margin: 0 0 9px; font-size: 12px; font-weight: 650; }
#adminPanel .admin-author-list { display: grid; gap: 8px; max-height: 370px; overflow-y: auto; padding: 0; border: 0; background: none; }
#adminPanel .admin-author-group { border: 1px solid #293340; border-radius: 6px; background: #151c24; }
#adminPanel .admin-author-heading { display: flex; justify-content: space-between; gap: 12px; min-height: 40px; padding: 9px 12px; }
#adminPanel .admin-author-name { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
#adminPanel .admin-all-folders { white-space: nowrap; color: #98a5b5; }
#adminPanel .admin-author-folders { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; padding: 10px 12px; border-top: 1px solid #293340; font-size: 12px; }
#adminPanel .admin-folder-check { min-width: 0; }
#adminPanel .admin-folder-check span { overflow-wrap: anywhere; }
#adminPanel .admin-mini-section { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 12px; border: 1px solid #293340; border-radius: 6px; }
#adminPanel .admin-mini-section div { display: grid; gap: 3px; }
#adminPanel .admin-mini-section span { color: #98a5b5; font-size: 12px; }
#adminPanel .admin-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 20px; padding-top: 14px; border-top: 1px solid #293340; }
#adminPanel .admin-dirty-label { margin-right: auto; color: #e6b970; font-size: 12px; }
#adminPanel .admin-button-primary { border-color: #69d5a2; background: #69d5a2; color: #0e1319; }
#adminPanel .admin-button-primary:hover:not(:disabled) { background: #84e2b5; }
#adminPanel .admin-status { min-height: 18px; margin-top: 8px; font-size: 12px; }
#adminPanel .admin-token-box { margin-top: 12px; border-radius: 6px; }
#adminPanel .admin-delete-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(2, 6, 10, 0.8); }
#adminPanel .admin-delete-card { width: min(420px, 100%); padding: 20px; border: 1px solid #46515e; border-radius: 8px; background: #151c24; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45); }
#adminPanel .admin-delete-card h4 { margin: 0 0 10px; font-size: 17px; }
#adminPanel .admin-delete-card p { color: #98a5b5; line-height: 1.45; }
#adminPanel .admin-delete-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
#adminPanel .admin-button-danger { border-color: #d87575; background: #9f3d45; color: white; }
#adminPanel .admin-delete-error { color: #ff9c9c !important; }

.photo-card {
  width: 204px;
  max-width: min(100%, 204px);
}

.photo-card-media {
  position: relative;
  display: grid;
  place-items: center;
  width: 202px;
  max-width: 100%;
  height: 135px;
  overflow: hidden;
  background: #222d39;
}

.photo-card-media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  margin: auto;
}

.photo-card-loading .photo-card-media img { visibility: hidden; }

.photo-card-loading .photo-card-media::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid #536575;
  border-top-color: #69d5a2;
  border-radius: 50%;
}

.photo-card-loading.photo-card-loader-visible .photo-card-media::after {
  animation: grid-thumb-spin 1s linear infinite;
}

.photo-card-error .photo-card-media img { display: none; }
.photo-card-error .photo-card-media::after {
  content: "!";
  color: #ff9c9c;
  font-size: 18px;
  font-weight: 700;
}

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

@media (prefers-reduced-motion: reduce) {
  .photo-card-loading.photo-card-loader-visible .photo-card-media::after { animation: none; }
}

@media (max-width: 700px) {
  #adminPanel { margin: 8px; padding: 14px; }
  #adminPanel .admin-head { align-items: flex-start; }
  #adminPanel .admin-head h3 { font-size: 15px; }
  #adminPanel .admin-form { padding: 14px; }
  #adminPanel .admin-identity-fields { grid-template-columns: 1fr 1fr; }
  #adminPanel .admin-password-section { grid-template-columns: 1fr 1fr; }
  #adminPanel .admin-password-section > button { justify-self: start; }
}

@media (max-width: 720px) {
  .photo-card { width: 100%; max-width: 100%; }
  .photo-card-media { width: 100%; }
  .photo-grid > .photo-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 0.65rem) / 2);
  }
}

@media (max-width: 460px) {
  #adminPanel .admin-head { flex-wrap: wrap; }
  #adminPanel .admin-identity-fields,
  #adminPanel .admin-password-section { grid-template-columns: 1fr; }
  #adminPanel .admin-author-heading { flex-wrap: wrap; }
  #adminPanel .admin-all-folders { margin-left: 24px; }
  #adminPanel .admin-actions { flex-wrap: wrap; }
  #adminPanel .admin-dirty-label { flex-basis: 100%; }
  #adminPanel button, #adminPanel select, #adminPanel input { min-height: 44px; }
  #adminPanel .admin-field input, #adminPanel .admin-field select { height: 44px; font-size: 16px; }
}

.photo-card-badge {
  top: 0.32rem;
  right: 0.32rem;
  width: 1.45rem;
  height: 1.45rem;
}

.photo-card-badge > .check-icon {
  width: 0.73rem;
  height: 0.73rem;
}

.nas-check-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
}

.nas-check-icon > svg:first-child {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nas-check-icon > .check-icon {
  position: absolute;
  top: -0.07rem;
  right: -0.05rem;
  width: 0.75rem;
  height: 0.75rem;
  padding: 0.09rem;
  border-radius: 50%;
  background: #0b2017;
  color: #69d5a2;
}

.viewer-topline {
  top: max(0.85rem, env(safe-area-inset-top));
  left: 50%;
  right: auto;
  width: max-content;
  max-width: calc(100vw - 17rem);
  transform: translateX(-50%);
  justify-content: center;
  padding: 0.35rem 0.55rem;
  border: 1px solid #344150;
  border-radius: 4px;
  background: #1a232d;
}

.viewer-position {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-width: 0;
  max-width: 100%;
}

.viewer-index {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  flex: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #aab7c4;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
}

.viewer-name {
  display: block;
  min-width: 0;
  max-width: none;
  margin: 0;
  overflow: hidden;
  color: #e4eaf1;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-meta {
  flex: none;
  margin: 0;
  padding: 0.12rem 0.25rem;
  font-size: 0.7rem;
}

.viewer-actions {
  top: max(0.45rem, env(safe-area-inset-top));
  right: max(0.45rem, env(safe-area-inset-right));
  gap: 0.1rem;
}

.viewer-action-button {
  position: relative;
  isolation: isolate;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: transparent;
  font-size: 1rem;
  backdrop-filter: none;
}

.viewer-action-button::before {
  position: absolute;
  z-index: -1;
  inset: 0.33rem;
  border: 1px solid #344150;
  border-radius: 4px;
  background: #1a232d;
  content: "";
}

.viewer-action-button.active {
  background: transparent;
  color: #69d5a2;
}

.viewer-action-button.active::before {
  border-color: #69d5a2;
}

.viewer-info-button { font-size: 1rem; }
.viewer-close { font-size: 1.45rem; }
.fullscreen-icon { width: 0.95rem; height: 0.95rem; }

.viewer-candidate,
.viewer-flash {
  width: 3.2rem;
  height: 3.2rem;
  bottom: max(0.9rem, env(safe-area-inset-bottom));
}

.viewer-candidate > .check-icon,
.viewer-flash > .check-icon {
  width: 1.12rem;
  height: 1.12rem;
}

.viewer-candidate .nas-check-icon,
.viewer-flash .nas-check-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.viewer-candidate .nas-check-icon > .check-icon,
.viewer-flash .nas-check-icon > .check-icon {
  top: -0.1rem;
  right: -0.08rem;
  width: 1rem;
  height: 1rem;
}

@media (max-width: 700px) {
  .viewer-topline {
    top: calc(max(0.45rem, env(safe-area-inset-top)) + 3.25rem);
    left: 50%;
    right: auto;
    max-width: calc(100vw - 1.2rem);
  }

  .viewer-name { max-width: none; }

  .viewer-action-button {
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .viewer-candidate,
  .viewer-flash {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 4px;
    background: #1a232d;
    backdrop-filter: none;
  }

  .viewer-candidate.active {
    background: #69d5a2;
  }
}

.photo-grid-frame {
  position: relative;
  isolation: isolate;
}

.photo-grid {
  position: relative;
  z-index: 1;
}

.photo-burst-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.photo-burst-segment {
  --burst-accent: #59aaf0;
  position: absolute;
  box-sizing: border-box;
  border-right: 4px solid #fff;
  background: linear-gradient(to top,
    color-mix(in srgb, var(--burst-accent) 32%, transparent),
    color-mix(in srgb, var(--burst-accent) 12%, transparent) 38%,
    transparent 82%);
}

.photo-burst-segment[data-burst-palette="1"] { --burst-accent: #388dd7; }
.photo-burst-segment[data-burst-palette="2"] { --burst-accent: #70c5e8; }
.photo-burst-segment[data-burst-palette="3"] { --burst-accent: #6d93e5; }

.photo-burst-segment[data-separator-before] { border-left: 4px solid #fff; }

.photo-burst-segment::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 0;
  left: 2px;
  height: 3px;
  border-radius: 3px;
  background: var(--burst-accent);
  box-shadow: 0 0 7px color-mix(in srgb, var(--burst-accent) 55%, transparent);
}

.photo-grid .photo-card[data-burst-group]:not(.photo-card-selected) {
  border-color: transparent;
  background: rgba(15, 21, 28, 0.36);
}

.viewer-filmstrip {
  position: absolute;
  top: var(--viewer-filmstrip-top, 75%);
  left: 50%;
  z-index: 5;
  width: var(--viewer-filmstrip-width, max-content);
  max-width: calc(100vw - 1rem);
  box-sizing: border-box;
  padding: 0.3rem;
  transform: translateX(-50%);
  border: 1px solid #344150;
  border-radius: 4px;
  background: #101b27;
}

.viewer-filmstrip[hidden] { display: none; }

.viewer-filmstrip-track {
  display: flex;
  gap: 0.25rem;
}

.viewer-filmstrip-item {
  flex: 1 1 0;
  min-width: 0;
  width: clamp(5.4rem, 24vw, 7.2rem);
  height: var(--viewer-filmstrip-thumb-height, clamp(6.36rem, 27.6vw, 8.28rem));
  padding: 0;
  overflow: hidden;
  border: 2px solid #344150;
  border-radius: 2px;
  background: #222d39;
  cursor: pointer;
}

.viewer-filmstrip-item.active {
  border-color: var(--burst);
  outline: 2px solid var(--burst);
  outline-offset: 1px;
}

.viewer-filmstrip-item.selected { border: 4px solid #69d5a2; }

.viewer-filmstrip-item:not(.selected):hover { border-color: #a9d3ff; }

.viewer-filmstrip-overflow {
  position: absolute;
  bottom: 0.55rem;
  z-index: 1;
  padding: 0.15rem 0.4rem;
  border: 1px solid #46586a;
  border-radius: 3px;
  background: #101b27;
  color: #e4eaf1;
  font-size: 1.5rem;
  font-weight: 750;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.viewer-filmstrip-overflow.before { left: 0.55rem; }
.viewer-filmstrip-overflow.after { right: 0.55rem; }
.viewer-filmstrip-overflow[hidden] { display: none; }

.viewer-filmstrip-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.viewer-filmstrip-item.image-error img { visibility: hidden; }

.viewer.has-filmstrip .viewer-image {
  top: var(--viewer-image-top, 50%);
  max-height: min(86dvh, var(--viewer-image-max-height, 86dvh), 1200px);
}

.viewer.has-filmstrip .viewer-candidate,
.viewer.has-filmstrip .viewer-flash {
  top: var(--viewer-candidate-top);
  bottom: auto;
}

.viewer-candidate.active:hover {
  transform: translateX(-50%) translateY(-1px);
}

.viewer.has-filmstrip .viewer-sequence-skip {
  top: var(--viewer-sequence-skip-top);
  bottom: auto;
}

.preview-actions-panel { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #2d3948; }
.preview-actions-list { display: grid; gap: .6rem; color: #b4bfcc; }
.preview-action-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; padding: .7rem; background: #151f2b; }
.preview-action-row > div { flex: 1 1 18rem; min-width: 0; overflow-wrap: anywhere; }
.preview-action-row strong { font-size: .85rem; font-weight: 500; color: #e1e8ee; }
.preview-action-row p { margin: .35rem 0 0; font-size: .75rem; }
.preview-action-row.has-error { border-left: 2px solid #d9ab64; }
