@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --surface-muted: #f3f4f6;
  --ink: #111827;
  --muted: #4b5563;
  --subtle: #6b7280;
  --line: #e5e7eb;
  --accent: #2536d8;
  --accent-dark: #1e2bb8;
  --accent-soft: #eef2ff;
  --mark: #f97316;
  --mark-dark: #ea580c;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --chart-left-pad: 34px;
  --chart-right-pad: 18px;
  --range-thumb-size: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mobile-gate {
  display: none;
}

.mobile-gate-card {
  width: min(420px, calc(100vw - 36px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.mobile-gate-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 34px;
  margin-bottom: 24px;
}

.mobile-gate h1 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.mobile-gate p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.mobile-gate .primary-button {
  margin-top: 8px;
}

.mobile-gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.mobile-gate-actions .primary-button,
.mobile-gate-actions .secondary-button {
  margin-top: 0;
}

.form-privacy-note {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.form-email-note {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.form-email-note a {
  color: var(--accent);
  font-weight: 600;
}

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

.app-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 30px;
  display: grid;
  grid-template-columns: 328px minmax(0, 1fr);
  gap: 26px 22px;
  align-items: start;
}

.topbar {
  grid-column: 1;
  margin: 0;
}

.toolbar-row {
  grid-column: 2;
  margin: 0;
}

.site-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 8px 0 0;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 400;
}

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

.footer-link {
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.footer-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.legal-page {
  width: min(760px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 64px 0;
  color: var(--ink);
}

.legal-page h1 {
  margin: 0 0 28px;
  font-size: 42px;
  font-weight: 800;
  line-height: 1.1;
}

.legal-page h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.legal-page a {
  color: var(--accent);
  font-weight: 600;
}

.legal-back-link {
  display: inline-block;
  margin-bottom: 32px;
}

.collapsed-panel-slot {
  display: none;
}

.topbar p {
  width: 300px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  text-align: justify;
  letter-spacing: 2px;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  width: 300px;
  padding-left: 0;
}

.topbar .brand-logo-text {
  display: block;
  width: auto;
  height: 44px;
  max-height: 44px;
  object-fit: contain;
  object-position: left center;
}

.topbar-actions,
.slider-row,
.photo-details {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 82px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  align-items: center;
}

.view-control-group,
.toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.photo-controls {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 0ms linear 220ms;
}

.photo-controls.is-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0ms;
}

.view-control-group {
  grid-column: 1;
}

.toolbar-buttons {
  grid-column: 3;
  justify-content: flex-end;
}

.secondary-button.is-active {
  min-width: 190px;
}

#rememberAlbumsButton {
  margin-left: 0;
}

.view-select-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.view-mode-select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.view-segments {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}

.view-segment {
  min-width: 78px;
  min-height: 42px;
  padding: 0 16px;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
}

.view-segment + .view-segment {
  border-left: 1px solid var(--line);
}

.view-segment.is-active {
  background: var(--accent);
  color: #fff;
}

.view-segment:disabled {
  color: var(--subtle);
  cursor: not-allowed;
  opacity: 0.45;
}

.view-segment:disabled:hover {
  background: transparent;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 10px;
  padding: 0 18px;
  white-space: nowrap;
}

.primary-button::before,
.secondary-button::before {
  content: "";
  display: none;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--button-icon) center / contain no-repeat;
  mask: var(--button-icon) center / contain no-repeat;
}

#rememberAlbumsButton {
  --button-icon: url("assets/icons/bookmark_border.svg");
}

#clearAlbumsButton {
  --button-icon: url("assets/icons/refresh.svg");
}

#addAlbumButton {
  --button-icon: url("assets/icons/photo_library.svg");
}

.icon-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--mark);
}

.icon-action-button::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("assets/icons/email.svg") center / contain no-repeat;
  mask: url("assets/icons/email.svg") center / contain no-repeat;
}

.icon-action-button:hover {
  background: #fff7ed;
}

.share-action-button::before {
  -webkit-mask-image: url("assets/icons/share.svg");
  mask-image: url("assets/icons/share.svg");
}

#rememberAlbumsButton::before,
#clearAlbumsButton::before,
#addAlbumButton::before {
  display: block;
}

#addAlbumButton span[aria-hidden="true"] {
  display: none;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

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

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

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

.secondary-button.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.secondary-button.is-restoring {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.secondary-button.is-restoring::before {
  display: block;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  background: transparent;
  -webkit-mask: none;
  mask: none;
  animation: button-spin 0.8s linear infinite;
}

.secondary-button:disabled {
  cursor: wait;
}

.secondary-button.is-unavailable {
  color: var(--muted);
}

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

.save-session-dialog,
.app-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.save-session-dialog::backdrop,
.app-dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.save-session-dialog form,
.app-dialog form {
  position: relative;
  padding: 24px;
}

.involve-dialog {
  padding: 24px;
}

.welcome-dialog {
  width: min(920px, calc(100vw - 32px));
  overflow: hidden;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  align-items: stretch;
}

.welcome-dialog[open] {
  display: grid;
}

.welcome-dialog form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 28px;
}

.welcome-dialog-media {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 18px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
}

.welcome-dialog-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(72vh, 560px);
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
}

.welcome-dialog-list {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.welcome-dialog-list li::marker {
  color: var(--accent);
}

.fullscreen-image-dialog {
  width: min(96vw, 1500px);
  height: min(94vh, 1000px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #0f1417;
  color: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.4);
}

.fullscreen-image-dialog::backdrop {
  background: rgba(15, 23, 42, 0.72);
}

.fullscreen-image-dialog img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 52px 24px 60px;
  object-fit: contain;
}

.fullscreen-close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.fullscreen-close-button:hover {
  background: #fff;
}

.fullscreen-image-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-session-dialog h2,
.app-dialog h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.save-session-dialog p,
.app-dialog p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.scan-summary-list {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.scan-summary-list li::marker {
  color: var(--accent);
}

.dialog-close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.dialog-close-button:hover {
  background: var(--surface-muted);
}

.hidden-field {
  position: absolute;
  left: -9999px;
}

.form-field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  font-weight: 400;
}

.form-field textarea {
  resize: vertical;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.form-checkbox input {
  margin-top: 4px;
}

.scan-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(5px);
}

.scan-progress-overlay[hidden] {
  display: none;
}

.scan-progress-card {
  width: min(440px, calc(100vw - 36px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.scan-progress-card h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.scan-progress-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
}

.scan-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.scan-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--mark);
  transition: width 120ms ease;
}

.scan-progress-card .secondary-button {
  margin-top: 18px;
}

.thanks-page {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 24px;
  padding: 24px;
}

.thanks-panel {
  width: min(440px, calc(100vw - 48px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.thanks-panel h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.thanks-panel p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
}

.primary-link-button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border-radius: 10px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

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

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.demo-button {
  display: none;
}

.workspace {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 328px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.workspace.sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

.graph-cta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(37, 54, 216, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, #eef2ff 0%, #fff7ed 100%);
  box-shadow: var(--shadow);
}

.graph-cta h2 {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.graph-cta p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.graph-cta-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.setup-panel,
.analysis-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.setup-panel {
  position: relative;
  min-height: 0;
  padding: 24px;
  align-self: stretch;
  overflow: visible;
  transition: width 220ms ease, padding 220ms ease;
}

.setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 0;
  line-height: 1;
}

.icon-button::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin: auto;
  background: currentColor;
  -webkit-mask: url("icons/collapse.svg") center / contain no-repeat;
  mask: url("icons/collapse.svg") center / contain no-repeat;
}

.setup-panel.is-collapsed .icon-button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 0;
  font-weight: 800;
}

.setup-panel.is-collapsed .icon-button::before {
  -webkit-mask-image: url("icons/expand.svg");
  mask-image: url("icons/expand.svg");
}

.icon-button:hover {
  background: var(--surface-muted);
}

.setup-panel label {
  display: block;
  margin-bottom: 0;
  color: var(--ink);

  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.setup-content {
  margin-top: 8px;
}

.setup-panel.is-collapsed {
  width: 64px;
  padding: 20px 11px;
}

.setup-panel.is-collapsed label,
.setup-panel.is-collapsed .note,
.setup-panel.is-collapsed .metric-label,
.setup-panel.is-collapsed .metric-value,
.setup-panel.is-collapsed .metric-chevron,
.setup-panel.is-collapsed .skipped-card {
  display: none;
}

.setup-panel.is-collapsed .setup-header {
  justify-content: center;
}

.setup-panel.is-collapsed .setup-content {
  margin-top: 22px;
}

#albumInput {
  display: none;
}

.note {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 16px;
  font-weight: 400;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 28px 0 22px;
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 10px;
  background: #fff;
}

.metric-card,
.photo-stat-card,
.detail-pill {
  border-radius: 10px;
  background: var(--surface-muted);
}

.metric-card {
  min-width: 0;
  padding: 0 12px;
}

.metric-card {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.72);
  background: #fff;
  color: inherit;
  text-align: left;
}

.metric-card::before {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  background: currentColor;
  color: #374151;
  -webkit-mask: var(--metric-icon) center / contain no-repeat;
  mask: var(--metric-icon) center / contain no-repeat;
}

#camerasMetricButton {
  --metric-icon: url("assets/icons/camera_alt.svg");
}

#focalMetricButton {
  --metric-icon: url("assets/icons/focal_length.svg");
}

#aperturesMetricButton {
  --metric-icon: url("assets/icons/camera.svg");
}

#isosMetricButton {
  --metric-icon: url("assets/icons/iso.svg");
}

#shuttersMetricButton {
  --metric-icon: url("assets/icons/shutter_speed.svg");
}

#albumsMetricButton {
  --metric-icon: url("assets/icons/albums.svg");
}

.metric-card.has-exclusions .metric-label::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}

.setup-panel.is-collapsed .metric-card.has-exclusions::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.metric-card:last-of-type {
  border-bottom: 0;
}

.metric-button:hover {
  background: #f8fafc;
}

.metric-button[aria-expanded="true"] {
  background: var(--accent-soft);
}

.metric-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.metric-value {
  display: block;
  font-size: 18px;
  font-weight: 760;
  color: var(--ink);
}

.metric-label {
  color: #1f2937;
  font-size: 18px;
  font-weight: 400;
}

.metric-chevron {
  color: #4b5563;
  width: 16px;
  height: 16px;
  overflow: hidden;
  font-size: 0;
  background: currentColor;
  -webkit-mask: url("icons/expand.svg") center / contain no-repeat;
  mask: url("icons/expand.svg") center / contain no-repeat;
}

.photo-stat-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0 14px;
  margin-top: 24px;
  padding: 24px 18px;
  background: #fff;
  border-radius: 10px;
}

.photo-stat-card .metric-value {
  font-size: 30px;
  line-height: 1;
}

.photo-stat-card .metric-label {
  grid-column: 2;
  color: var(--muted);
  font-size: 16px;
}

.photo-stat-icon {
  grid-row: span 2;
  width: 36px;
  height: 36px;
  align-self: center;
  background: var(--accent);
  -webkit-mask: url("assets/icons/photo_library.svg") center / contain no-repeat;
  mask: url("assets/icons/photo_library.svg") center / contain no-repeat;
}

.skipped-card {
  display: none;
}

.setup-panel.is-collapsed .metric-grid {
  gap: 12px;
  margin: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.setup-panel.is-collapsed .metric-card {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  grid-template-columns: 1fr;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.setup-panel.is-collapsed .metric-button[aria-expanded="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.setup-panel.is-collapsed .metric-card::before {
  width: 28px;
  height: 28px;
}

.setup-panel.is-collapsed .metric-button:hover {
  background: var(--surface-muted);
}

.setup-panel.is-collapsed .photo-stat-card {
  display: grid;
  width: 40px;
  margin-top: 20px;
  padding: 0;
  grid-template-columns: 1fr;
  place-items: center;
  background: transparent;
  box-shadow: none;
}

.setup-panel.is-collapsed .photo-stat-icon {
  grid-row: auto;
}

.setup-panel.is-collapsed .photo-stat-card .metric-value {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 12px;
}

.options-panel {
  position: absolute;
  top: var(--options-top, 140px);
  left: calc(100% + 14px);
  z-index: 20;
  width: 330px;
  max-width: calc(100vw - 390px);
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.status-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  max-width: min(680px, calc(100vw - 48px));
  padding: 12px 16px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.94);
  color: #fff;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.status-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.options-panel-title {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.album-list,
.option-list {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  padding-right: 0;
  padding-bottom: 18px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), rgba(0, 0, 0, 0.35) calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), rgba(0, 0, 0, 0.35) calc(100% - 12px), transparent 100%);
}

.album-list::-webkit-scrollbar,
.option-list::-webkit-scrollbar {
  display: none;
}

.album-row,
.option-row {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #eef4f1;
}

.album-row {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.option-row {
  grid-template-columns: 34px 52px minmax(0, 1fr) 38px;
}

.option-row.is-excluded {
  opacity: 0.55;
}

.option-count {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  text-align: right;
}

.option-bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9e2df;
}

.option-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.album-name,
.option-name {
  overflow: hidden;
  font-size: 18px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-meta,
.option-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.remove-album-button,
.toggle-option-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.remove-album-button:hover,
.toggle-option-button:hover {
  background: var(--accent-soft);
}

.toggle-option-button[aria-pressed="true"] {
  color: var(--accent);
}

.viewer {
  min-width: 0;
}

.viewer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  min-width: 0;
}

.viewer-grid.is-double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.viewer-grid.is-triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.viewer-grid.is-double .image-stage,
.viewer-grid.is-triple .image-stage {
  height: clamp(420px, 43vh, 620px);
  min-height: 420px;
}

.viewer-grid.is-double .chart-controls,
.viewer-grid.is-triple .chart-controls {
  align-items: stretch;
  flex-direction: column;
}

.viewer-grid.is-double .focal-mode,
.viewer-grid.is-triple .focal-mode {
  align-items: stretch;
  flex-direction: column;
  margin-left: 0;
}

.image-stage {
  position: relative;
  height: clamp(460px, 48vh, 620px);
  min-height: 460px;
  overflow: hidden;
  background: #171b1e;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.image-stage img {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

.image-stage.has-image img {
  display: block;
}

.image-stage.is-image-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--mark);
  border-radius: 999px;
  animation: image-spinner 0.8s linear infinite;
  transform: translate(-50%, -50%);
}

.image-stage.is-image-loading img {
  opacity: 0.28;
}

@keyframes image-spinner {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.empty-state {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  gap: 6px;
  place-items: center;
  align-content: center;
  color: #d6dcdf;
  cursor: pointer;
  text-align: center;
}

.empty-state strong {
  font-size: 22px;
}

.empty-add-button {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  min-height: 42px;
  border-radius: 10px;
  padding: 0 18px;
  background: var(--mark);
  color: #fff;
  font-weight: 600;
}

.empty-add-button:hover {
  background: var(--mark-dark);
}

.image-stage.has-image .empty-state {
  display: none;
}

.image-stage-tools {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-focal-badge {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(17, 24, 39, 0.88);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.image-gallery-button,
.fullscreen-image-button,
.magnifier-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.88);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.image-gallery-button.is-hidden,
.fullscreen-image-button.is-hidden,
.magnifier-button.is-hidden {
  display: none;
}

.image-gallery-button::before,
.fullscreen-image-button::before,
.magnifier-button::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
}

.image-gallery-button::before {
  -webkit-mask: url("assets/icons/photo_library.svg") center / contain no-repeat;
  mask: url("assets/icons/photo_library.svg") center / contain no-repeat;
}

.fullscreen-image-button::before {
  -webkit-mask: url("icons/fullscreen.svg") center / contain no-repeat;
  mask: url("icons/fullscreen.svg") center / contain no-repeat;
}

.magnifier-button::before {
  -webkit-mask: url("icons/search.svg") center / contain no-repeat;
  mask: url("icons/search.svg") center / contain no-repeat;
}

.image-gallery-button:hover,
.image-gallery-button[aria-expanded="true"],
.fullscreen-image-button:hover,
.magnifier-button:hover {
  background: var(--accent);
}

.magnifier-button.is-active {
  position: relative;
  background: var(--mark);
}

.magnifier-button.is-active::after {
  content: attr(data-zoom);
  position: absolute;
  right: -5px;
  bottom: -6px;
  min-width: 22px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #fff;
  color: var(--mark);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.image-magnifier {
  position: absolute;
  z-index: 6;
  width: 170px;
  height: 170px;
  border: 3px solid var(--mark);
  border-radius: 999px;
  background-color: #111827;
  background-repeat: no-repeat;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.image-gallery-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  overflow: auto;
  padding: 64px 22px 22px;
  background: rgba(17, 24, 28, 0.96);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.image-stage.is-gallery-open .image-gallery-overlay {
  display: block;
}

.image-gallery-overlay::-webkit-scrollbar {
  display: none;
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.thumbnail-button {
  position: relative;
  display: block;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #0f1417;
}

.thumbnail-button.is-loading {
  display: block;
}

.thumbnail-button.is-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--mark);
  animation: thumbnail-spin 0.8s linear infinite;
  transform: translate(-50%, -50%);
}

.thumbnail-button.is-loading img {
  opacity: 0;
}

.thumbnail-button img {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-button:hover,
.thumbnail-button.is-selected {
  border-color: var(--mark);
}

@keyframes thumbnail-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.image-stage.is-gallery-open > img,
.image-stage.is-gallery-open > .nav-button {
  visibility: hidden;
}

.nav-button {
  position: absolute;
  top: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 0;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.nav-button::before {
  content: "";
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: var(--nav-icon) center / contain no-repeat;
  mask: var(--nav-icon) center / contain no-repeat;
}

.nav-button:hover {
  background: #fff;
}

.nav-button.left {
  left: 14px;
  --nav-icon: url("icons/collapse.svg");
}

.nav-button.right {
  right: 14px;
  --nav-icon: url("icons/expand.svg");
}

.photo-details {
  justify-content: space-between;
  min-height: 58px;
  padding: 18px 10px 16px;
}

.photo-details > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.filename {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 300;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-pill {
  flex: 0 0 84px;
  min-width: 84px;
  padding: 7px 10px;
  color: var(--accent);
  font-size: 16px;
  text-align: center;
  white-space: nowrap;
  background: transparent;
}

.analysis-panel {
  padding: 22px 26px 26px;
}

.chart-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.chart-controls > .focal-mode {
  margin-left: auto;
}

.bracket-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.bracket-toggle input {
  accent-color: var(--mark);
}

.bracket-slider-toggle {
  justify-content: flex-end;
  margin: 4px var(--chart-right-pad) 0 var(--chart-left-pad);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-controls label,
.focal-mode {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-controls select {
  min-height: 38px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.focal-mode {
  display: flex;
  align-items: center;
  gap: 10px;
}

.segmented-control {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
}

.segment-button {
  min-height: 34px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.segment-button.is-active {
  background: var(--accent);
  color: #fff;
}

.chart-wrap {
  position: relative;
}

.chart {
  width: 100%;
  height: 170px;
  display: block;
  overflow: visible;
}

.chart text {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 600;
  vector-effect: non-scaling-stroke;
}

.chart .axis {
  stroke: var(--line);
  stroke-width: 1;
}

.chart .series {
  fill: none;
  stroke: var(--mark);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.chart .area {
  fill: rgba(249, 115, 22, 0.16);
  stroke: none;
}

.chart .dot {
  fill: var(--mark);
}

.chart .dot-hit {
  fill: transparent;
  cursor: pointer;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.22);
}

.slider-row {
  position: relative;
  display: block;
  margin-top: 8px;
  padding-left: var(--chart-left-pad);
  padding-right: var(--chart-right-pad);
  padding-bottom: 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.slider-row span {
  position: absolute;
  bottom: 0;
  flex: none;
  white-space: nowrap;
}

#minFocalLabel {
  left: var(--chart-left-pad);
}

#maxFocalLabel {
  right: var(--chart-right-pad);
}

.slider-row input {
  display: block;
  min-width: 0;
  width: 100%;
  margin: 0;
  accent-color: var(--mark);
}

.range-stack {
  position: relative;
  height: 24px;
  margin-left: calc(var(--range-thumb-size) / 2);
  margin-right: calc(var(--range-thumb-size) / 2);
}

.range-stack::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: var(--line);
}

.bracket-range-fill {
  display: none;
  position: absolute;
  left: var(--bracket-start, 0%);
  right: calc(100% - var(--bracket-end, 0%));
  top: 50%;
  height: 4px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: rgba(249, 115, 22, 0.28);
  pointer-events: none;
  z-index: 1;
}

.slider-row.is-bracket .bracket-range-fill {
  display: block;
}

.range-stack input {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  pointer-events: none;
}

.range-stack input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

.range-stack input::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

.range-stack input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--range-thumb-size);
  height: var(--range-thumb-size);
  margin-top: -7px;
  border: 0;
  border-radius: 50%;
  background: var(--mark);
  pointer-events: auto;
}

.range-stack input::-moz-range-thumb {
  width: var(--range-thumb-size);
  height: var(--range-thumb-size);
  border: 0;
  border-radius: 50%;
  background: var(--mark);
  pointer-events: auto;
}

.range-stack input.range-end {
  display: none;
}

.slider-row.is-bracket .range-stack input.range-end {
  display: block;
  z-index: 4;
}

.slider-row.is-bracket .range-stack input:not(.range-end) {
  z-index: 3;
}

.slider-row.is-bracket .range-stack input::-webkit-slider-thumb {
  position: relative;
  z-index: 3;
}

.selected-range {
  position: relative;
  min-height: 48px;
  margin-top: 2px;
  margin-left: calc(var(--chart-left-pad) + var(--range-thumb-size) / 2);
  margin-right: calc(var(--chart-right-pad) + var(--range-thumb-size) / 2);
  font-weight: 800;
}

#selectedFocalLabel {
  position: absolute;
  left: var(--selected-focal-position, 0%);
  transform: translateX(-50%);
  white-space: nowrap;
}

.selected-range span + span {
  position: absolute;
  top: 26px;
  right: 0;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .mobile-gate {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: grid;
    place-items: center;
    padding: 18px;
    background: var(--bg);
  }

  .welcome-dialog #welcomeAddPhotosButton {
    display: none;
  }

  .welcome-dialog[open] {
    display: block;
  }

  .welcome-dialog form {
    padding: 24px;
  }

  .welcome-dialog-media {
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .welcome-dialog-image {
    max-height: 42vh;
  }

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

  .app-shell {
    display: block;
    padding: 16px;
  }

  .topbar,
  .toolbar-row,
  .workspace,
  .site-footer {
    display: block;
  }

  .site-footer span {
    display: block;
  }

  .footer-actions {
    display: flex;
    margin-top: 8px;
  }

  .topbar-actions {
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .setup-panel {
    margin-bottom: 16px;
    overflow: hidden;
  }

  .graph-cta {
    display: grid;
    gap: 14px;
    margin-top: 16px;
  }

  .graph-cta-actions {
    flex-wrap: wrap;
  }

  .options-panel {
    position: static;
    width: auto;
    max-width: none;
    margin: 0 0 8px;
  }

  .image-stage {
    height: clamp(420px, 58vh, 700px);
    min-height: 420px;
  }

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

@media (pointer: coarse) {
  .mobile-gate {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: grid;
    place-items: center;
    padding: 18px;
    background: var(--bg);
  }

  .welcome-dialog #welcomeAddPhotosButton {
    display: none;
  }

  .welcome-dialog[open] {
    display: block;
  }

  .welcome-dialog form {
    padding: 24px;
  }

  .welcome-dialog-media {
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .welcome-dialog-image {
    max-height: 42vh;
  }

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

@media (max-width: 560px) {
  .topbar-actions,
  .photo-details {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .nav-button {
    width: 42px;
    height: 60px;
  }
}
