:root {
  color-scheme: dark;
  --bg: #11161a;
  --panel: #171d22;
  --panel-2: #20282e;
  --text: #eef2f4;
  --muted: #99a3ad;
  --line: rgba(160, 174, 185, 0.18);
  --accent: #76b9dc;
  --gold: #ffd166;
  --green: #7bd88f;
  --rose: #ef6f8f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 1120px;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
}

button, select { font: inherit; }

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 72px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 16, 21, 0.96), rgba(13, 18, 22, 0.9));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}

h1, h2, p { margin: 0; }
h1 { font-size: 25px; letter-spacing: 0; }
h2 { margin-bottom: 10px; font-size: 13px; color: #cbd3da; }

.brand-block {
  display: grid;
  gap: 4px;
}

.topbar p, .hint, .zoom-readout {
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  position: relative;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.icon-help-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border-color: rgba(216, 226, 232, 0.18);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 800;
  font-style: italic;
}

.icon-help-button:hover {
  border-color: rgba(118, 185, 220, 0.45);
  color: var(--accent);
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 340px minmax(620px, 1fr) 420px;
}

.workspace.empty-workspace {
  grid-template-columns: 1fr;
}

.workspace.empty-workspace .controls,
.workspace.empty-workspace .detail {
  display: none;
}

.panel {
  min-height: 0;
  overflow: auto;
  background: var(--panel);
}

.controls { border-right: 1px solid var(--line); }
.detail { border-left: 1px solid var(--line); }
.panel section { padding: 16px; border-bottom: 1px solid var(--line); }

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

select {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
}

button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
}

button:hover { border-color: var(--accent); }
button.primary {
  border-color: var(--accent);
  color: #081016;
  background: var(--accent);
  font-weight: 700;
}
button.secondary {
  border-color: rgba(118, 185, 220, 0.48);
  background: rgba(118, 185, 220, 0.1);
}
.preset-grid,
.mode-grid {
  padding: 3px;
  border: 1px solid rgba(216, 226, 232, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}
.preset-grid button,
.mode-grid button {
  height: auto;
  min-height: 34px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}
.preset-grid button.active,
.mode-grid button.active {
  border-color: rgba(216, 226, 232, 0.18);
  background: #26313a;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(118, 185, 220, 0.14);
}
button.favorite-active { border-color: var(--gold); color: #151006; background: var(--gold); }
button.ghost { background: transparent; }
button.wide-action { width: 100%; margin-top: 10px; }
button.like-button {
  width: 44px;
  height: 36px;
  padding: 0;
  font-size: 18px;
}

.detail-actions {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
}

.detail-actions .wide-action {
  margin-top: 0;
}

.detail-actions .share-action {
  height: 40px;
  box-shadow: 0 10px 30px rgba(118, 185, 220, 0.16);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid rgba(216, 226, 232, 0.2);
  border-radius: 10px;
  background: rgba(24, 31, 36, 0.96);
  color: var(--text);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  font-size: 13px;
  line-height: 1.5;
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 245;
  display: grid;
  place-items: center;
  padding: 28px;
}

.share-modal[hidden] { display: none; }

.share-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 8, 0.74);
  backdrop-filter: blur(3px);
}

.share-modal-dialog {
  position: relative;
  width: min(900px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  border: 1px solid rgba(216, 226, 232, 0.28);
  border-radius: 10px;
  background: #101315;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.62);
}

.share-modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #15191c;
}

.share-modal-head strong,
.share-modal-head span {
  display: block;
}

.share-modal-head strong {
  color: var(--text);
  font-size: 15px;
}

.share-modal-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.share-modal-head button {
  width: 30px;
  height: 30px;
  padding: 0;
}

.share-modal-body {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px;
}

.share-preview-panel {
  display: grid;
  place-items: center;
  justify-self: center;
  width: min(80vw, 680px, calc(80vh - 152px));
  max-width: 680px;
  max-height: calc(100vh - 190px);
  aspect-ratio: 4 / 5;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #080b0d;
}

.share-preview-panel img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.share-actions {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.share-actions button {
  min-height: 38px;
}

.share-actions .x-action {
  background: #eef2f4;
  border-color: #eef2f4;
  color: #081016;
}

@media (max-width: 720px) {
  .share-actions {
    grid-template-columns: 1fr;
  }
}

.author-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.author-links a {
  padding: 5px 9px;
  border: 1px solid rgba(216, 226, 232, 0.18);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}

.load-actions, .preset-grid, .mode-grid, .stats { display: grid; gap: 8px; }
.preset-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.map-preset-description {
  max-width: 760px;
  margin-top: 4px;
}
.drop-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.map-wrap {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: #0f1418;
}

.map-wrap.empty-mode {
  grid-template-rows: 1fr;
}

.map-wrap.empty-mode .analysis-summary,
.map-wrap.empty-mode .map-toolbar,
.map-wrap.empty-mode .map {
  display: none;
}

.map-wrap:not(.empty-mode) .empty-state {
  display: none;
}

.empty-state {
  min-height: 0;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 34px;
  background-color: #081016;
  background-image:
    radial-gradient(circle at 26% 62%, rgba(118, 185, 220, 0.20), transparent 22%),
    radial-gradient(circle at 74% 36%, rgba(255, 209, 102, 0.14), transparent 18%),
    radial-gradient(circle at 62% 82%, rgba(118, 185, 220, 0.12), transparent 18%),
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(145deg, #071017, #11171b 48%, #081016);
  background-size: auto, auto, auto, 76px 76px, 76px 76px, auto;
}

.empty-state::before,
.empty-state::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.empty-state::before {
  opacity: 0.35;
  background-image:
    radial-gradient(circle, rgba(118, 185, 220, 0.32) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 209, 102, 0.24) 1px, transparent 1.5px);
  background-position: 22% 58%, 72% 33%;
  background-size: 18px 18px, 22px 22px;
  mask-image: radial-gradient(circle at 50% 52%, black, transparent 72%);
}

.empty-state::after {
  opacity: 0.26;
  background:
    repeating-radial-gradient(ellipse at 30% 70%, transparent 0 58px, rgba(118, 185, 220, 0.2) 59px 60px, transparent 61px 116px),
    repeating-radial-gradient(ellipse at 72% 38%, transparent 0 52px, rgba(255, 209, 102, 0.14) 53px 54px, transparent 55px 104px);
}

.empty-state-card {
  width: min(820px, 100%);
  position: relative;
  z-index: 1;
  overflow: hidden;
  display: grid;
  justify-items: center;
  gap: 20px;
  padding: 30px 36px 34px;
  border: 1px solid rgba(216, 226, 232, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 22% 0%, rgba(118, 185, 220, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025)),
    rgba(18, 24, 29, 0.86);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(10px);
}

.empty-visual {
  position: relative;
  width: 100%;
  height: 236px;
  overflow: hidden;
  border: 1px solid rgba(216, 226, 232, 0.12);
  border-radius: 18px;
  background-image:
    radial-gradient(circle at 35% 58%, rgba(118, 185, 220, 0.24), transparent 24%),
    radial-gradient(circle at 67% 50%, rgba(255, 209, 102, 0.17), transparent 24%),
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: auto, auto, 68px 68px, 68px 68px;
  background-color: rgba(8, 12, 15, 0.38);
}

.empty-visual::before {
  content: "";
  position: absolute;
  inset: 28px 60px 44px 78px;
  border-left: 1px solid rgba(220, 229, 235, 0.28);
  border-bottom: 1px solid rgba(220, 229, 235, 0.28);
  border-radius: 0 0 0 8px;
}

.empty-visual::after {
  content: "";
  position: absolute;
  left: 41%;
  top: 25%;
  width: 260px;
  height: 130px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.15), transparent 64%);
  filter: blur(10px);
}

.visual-dot,
.visual-thumb {
  position: absolute;
  display: block;
}

.visual-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(118, 185, 220, 0.58);
  box-shadow: 0 0 18px rgba(118, 185, 220, 0.72);
}

.visual-dot.d1 { left: 27%; top: 62%; box-shadow: 24px -18px 0 rgba(118,185,220,0.48), 54px 8px 0 rgba(118,185,220,0.36), 88px -26px 0 rgba(118,185,220,0.42); }
.visual-dot.d2 { left: 52%; top: 34%; background: rgba(255, 209, 102, 0.68); box-shadow: 34px 22px 0 rgba(255,209,102,0.46), 76px 64px 0 rgba(255,209,102,0.34), -28px 54px 0 rgba(255,209,102,0.38); }
.visual-dot.d3 { left: 44%; top: 70%; box-shadow: 30px -10px 0 rgba(118,185,220,0.34), 92px 2px 0 rgba(118,185,220,0.24); }
.visual-dot.d4 { left: 72%; top: 28%; background: rgba(255, 209, 102, 0.55); box-shadow: 38px 36px 0 rgba(255,209,102,0.3), -58px 16px 0 rgba(255,209,102,0.26); }

.visual-thumb {
  z-index: 1;
  width: 74px;
  height: 52px;
  border: 2px solid rgba(216, 226, 232, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.2), transparent 36%),
    linear-gradient(35deg, rgba(118,185,220,0.2), transparent 54%),
    rgba(118, 185, 220, 0.15);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
}

.visual-thumb::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(220, 229, 235, 0.28);
}

.visual-thumb.t1 { left: 24%; top: 28%; transform: rotate(-5deg); }
.visual-thumb.t2 { right: 20%; bottom: 30%; transform: rotate(5deg); border-color: rgba(255, 209, 102, 0.8); box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.2), 0 14px 30px rgba(0,0,0,0.4); }
.visual-thumb.t2::after,
.visual-thumb.t4::after {
  background: var(--gold);
}
.visual-thumb.t3 { left: 42%; bottom: 24%; transform: rotate(3deg); }
.visual-thumb.t4 { left: 63%; top: 23%; transform: rotate(-4deg); border-color: rgba(255, 209, 102, 0.55); }
.visual-thumb.t5 { right: 8%; top: 18%; transform: rotate(3deg); opacity: 0.45; }
.visual-thumb.t6 { left: 16%; bottom: 22%; transform: rotate(4deg); opacity: 0.62; }

.visual-axis {
  position: absolute;
  z-index: 2;
  color: rgba(220, 229, 235, 0.64);
  font-size: 12px;
  font-weight: 700;
}

.visual-axis.x {
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
}

.visual-axis.x-left { left: 18%; bottom: 18px; }
.visual-axis.x-right { right: 17%; bottom: 18px; }

.visual-axis.y {
  left: 64px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
}

.visual-axis.y-top { left: 70px; top: 30px; }
.visual-axis.y-bottom { left: 64px; bottom: 40px; }

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.empty-state-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 34px;
  line-height: 1.28;
  text-align: center;
  text-wrap: balance;
}

.empty-state-card p {
  max-width: 640px;
  color: #c5ced6;
  font-size: 15px;
  line-height: 1.75;
  text-align: center;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.empty-actions button {
  height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.css-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.css-icon.shield {
  width: 15px;
  height: 17px;
  border: 2px solid rgba(118, 185, 220, 0.86);
  border-radius: 8px 8px 10px 10px;
  clip-path: polygon(50% 0, 100% 18%, 88% 74%, 50% 100%, 12% 74%, 0 18%);
}

.css-icon.shield::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 5px;
  height: 8px;
  border-right: 2px solid rgba(118, 185, 220, 0.86);
  border-bottom: 2px solid rgba(118, 185, 220, 0.86);
  transform: rotate(40deg);
}

.css-icon.lock {
  width: 15px;
  height: 12px;
  margin-top: 3px;
  border: 2px solid rgba(118, 185, 220, 0.86);
  border-radius: 4px;
}

.css-icon.lock::before {
  content: "";
  position: absolute;
  left: 3px;
  top: -9px;
  width: 7px;
  height: 9px;
  border: 2px solid rgba(118, 185, 220, 0.86);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.css-icon.lock::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 3px;
  height: 4px;
  border-radius: 999px;
  background: rgba(118, 185, 220, 0.86);
}

.css-icon.image {
  border: 2px solid currentColor;
  border-radius: 4px;
}

.css-icon.image::before {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 9px;
  height: 7px;
  background: linear-gradient(135deg, transparent 48%, currentColor 49% 58%, transparent 59%);
}

.css-icon.image::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 3px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.css-icon.folder {
  width: 20px;
  height: 15px;
  margin-top: 2px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.css-icon.folder::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -6px;
  width: 9px;
  height: 6px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.empty-actions button.primary {
  min-width: 136px;
  font-weight: 700;
}

.analysis-summary {
  display: block;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #11181d;
}

.summary-lead {
  display: grid;
  gap: 6px;
}

.summary-lead strong {
  color: var(--text);
  font-size: 18px;
}

.summary-lead p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.result-card,
.legend-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(216, 226, 232, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.result-card span {
  color: var(--muted);
  font-size: 11px;
}

.result-card strong,
.legend-card strong {
  color: var(--text);
  font-size: 15px;
}

.result-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.result-card.highlight {
  border-color: rgba(255, 209, 102, 0.34);
  background: rgba(255, 209, 102, 0.055);
}

.summary-card {
  --summary-accent: var(--blue);
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(216, 226, 232, 0.12);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
}

.trend-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.summary-card-head,
.summary-counts,
.hist-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.summary-card-head {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.summary-icon {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--summary-accent) 20%, transparent);
  color: var(--summary-accent);
  font-size: 12px;
  font-weight: 800;
}

.summary-card strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
}

.summary-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.style-summary {
  gap: 8px;
  padding: 12px;
  border-color: rgba(118, 185, 220, 0.24);
  background: linear-gradient(135deg, rgba(118, 185, 220, 0.11), rgba(255, 255, 255, 0.035));
}

.style-summary strong {
  font-size: 20px;
}

.style-summary p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 12px;
  line-height: 1.55;
}

.summary-counts {
  justify-content: flex-start;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}

.summary-counts span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.mini-histogram {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 3px;
  height: 32px;
  padding: 4px 0 0;
}

.hist-bar {
  min-height: 4px;
  border-radius: 5px 5px 2px 2px;
  background: color-mix(in srgb, var(--summary-accent) 42%, rgba(255, 255, 255, 0.12));
  opacity: 0.6;
}

.hist-bar.active {
  background: var(--summary-accent);
  opacity: 1;
  box-shadow: 0 0 16px color-mix(in srgb, var(--summary-accent) 34%, transparent);
}

.hist-labels {
  color: var(--muted);
  font-size: 9px;
}

.theme-focal { --summary-accent: #a78bfa; }
.theme-aperture { --summary-accent: #7bd88f; }
.theme-iso { --summary-accent: #ffae42; }
.theme-shutter { --summary-accent: #67b7ff; }
.theme-favorite { --summary-accent: var(--gold); }

.map-toolbar {
  min-height: 52px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.map-title { font-size: 15px; font-weight: 700; }

.map {
  position: relative;
  min-height: 0;
  margin: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #101315;
  contain: layout paint;
}

.map-zoom-controls {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(216, 226, 232, 0.16);
  border-radius: 10px;
  background: rgba(15, 20, 24, 0.84);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
}

.map-zoom-controls:hover {
  border-color: rgba(118, 185, 220, 0.38);
}

.map-zoom-controls button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.04);
}

.map-zoom-controls .zoom-readout {
  min-width: 42px;
  text-align: center;
  font-size: 12px;
}

.cluster-popup {
  position: absolute;
  z-index: 5;
  width: min(760px, calc(100% - 24px));
  max-height: min(560px, calc(100% - 24px));
  overflow: hidden;
  border: 1px solid rgba(110, 198, 255, 0.58);
  border-radius: 8px;
  background: rgba(15, 20, 24, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
}

.cluster-popup[hidden] { display: none; }

.cluster-popup-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--line);
}

.cluster-popup-title strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.cluster-popup-title span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.cluster-popup-title button {
  width: 26px;
  height: 26px;
  padding: 0;
}

.cluster-popup-grid {
  max-height: 488px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  padding: 12px;
}

.popup-thumb {
  height: auto;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 7px;
  border-color: rgba(220, 229, 235, 0.44);
  background: #273039;
}

.popup-thumb img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
}

.popup-thumb span {
  display: block;
  padding: 3px 2px 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.popup-thumb.selected { border: 3px solid var(--accent); }
.popup-thumb.favorite { box-shadow: inset 0 0 0 3px var(--gold); }

#mapCanvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#mapCanvas.dragging { cursor: grabbing; }

.stat {
  display: grid;
  gap: 4px;
}

.stat-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #dce5eb;
  font-size: 12px;
}

.bar {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #2b333a;
}

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

.rating-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.notice-panel {
  display: grid;
  gap: 12px;
}

.notice-card,
.promo-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #151a1e;
}

.notice-card strong,
.promo-card strong {
  color: var(--text);
  font-size: 13px;
}

.notice-card p,
.promo-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.promo-card {
  margin-top: 6px;
  border-style: dashed;
  background: #12171a;
}

.legend-card p {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.legend-card.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  padding: 10px;
}

.legend-card.compact strong {
  grid-column: 1 / -1;
  font-size: 12px;
}

.legend-card.compact p {
  gap: 6px;
  font-size: 11px;
  line-height: 1.2;
}

.legend-swatch {
  width: 16px;
  height: 12px;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,0.72);
  background: #26313a;
}

.legend-swatch.favorite {
  border-color: var(--gold);
}

.legend-badge {
  min-width: 22px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #151006;
  background: var(--gold);
  font-size: 11px;
  font-weight: 700;
}

.legend-heat {
  width: 20px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(118, 185, 220, 0.25), rgba(255, 209, 102, 0.8));
}

.drop-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 100;
  background: rgba(8, 12, 15, 0.78);
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  pointer-events: none;
}

.drop-overlay.visible {
  display: grid;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  background: rgba(4, 7, 9, 0.72);
  backdrop-filter: blur(3px);
}

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

.loading-card {
  width: min(420px, calc(100vw - 48px));
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(216, 226, 232, 0.26);
  border-radius: 8px;
  background: #15191c;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.56);
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(216, 226, 232, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.loading-card strong {
  color: var(--text);
  font-size: 15px;
}

.loading-card p {
  color: var(--muted);
  font-size: 13px;
}

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

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 28px;
}

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

.photo-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 8, 0.74);
  backdrop-filter: blur(3px);
}

.photo-viewer-dialog {
  position: relative;
  width: min(1180px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(216, 226, 232, 0.28);
  border-radius: 8px;
  background: #101315;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.62);
}

.photo-viewer-head,
.photo-viewer-foot {
  padding: 12px 14px;
  background: #15191c;
  border-color: var(--line);
}

.photo-viewer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.photo-viewer-head strong,
.photo-viewer-head span {
  display: block;
}

.photo-viewer-head strong {
  font-size: 13px;
  color: var(--text);
}

.photo-viewer-head span,
.viewer-summary {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.photo-viewer-head button {
  width: 30px;
  height: 30px;
  padding: 0;
}

.photo-viewer-body {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #090c0e;
}

.photo-viewer-body img {
  max-width: 100%;
  max-height: calc(100vh - 220px);
  display: block;
  object-fit: contain;
}

.photo-viewer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
}

.viewer-rating-row {
  margin: 0;
}

.viewer-like-button {
  width: 56px;
  height: 42px;
  font-size: 24px;
}

.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  justify-content: flex-end;
}

.guide-modal[hidden] { display: none; }

.guide-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 8, 0.28);
}

.guide-modal-dialog {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  height: 100vh;
  overflow: auto;
  border-left: 1px solid rgba(216, 226, 232, 0.2);
  background:
    radial-gradient(circle at 18% 4%, rgba(118, 185, 220, 0.13), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(255, 209, 102, 0.07), transparent 24%),
    linear-gradient(rgba(255,255,255,0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.026) 1px, transparent 1px),
    #11171c;
  background-size: auto, auto, 38px 38px, 38px 38px, auto;
  box-shadow: -18px 0 56px rgba(0, 0, 0, 0.42);
}

.guide-modal-dialog::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 26% 22%, rgba(91, 166, 222, 0.1), transparent 18%),
    radial-gradient(circle at 82% 62%, rgba(255, 202, 92, 0.06), transparent 20%);
  opacity: 0.85;
}

.guide-modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(18, 27, 33, 0.96), rgba(17, 23, 28, 0.92));
  backdrop-filter: blur(8px);
}

.guide-modal-head strong,
.guide-modal-head span {
  display: block;
}

.guide-modal-head strong {
  color: var(--text);
  font-size: 16px;
}

.guide-modal-head span {
  max-width: 340px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.guide-modal-head button {
  width: 30px;
  height: 30px;
  padding: 0;
}

.guide-drawer-body {
  position: relative;
  display: grid;
  gap: 0;
  padding: 6px 18px 18px;
}

.guide-section {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(216, 226, 232, 0.12);
}

.guide-section:not(.guide-section-privacy):not(.guide-author)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 17px;
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: rgba(118, 185, 220, 0.28);
}

.guide-section-privacy {
  margin: 8px 0 4px;
  padding: 12px;
  border: 1px solid rgba(118, 185, 220, 0.24);
  border-radius: 10px;
  background:
    radial-gradient(circle at 100% 0%, rgba(118, 185, 220, 0.14), transparent 34%),
    rgba(118, 185, 220, 0.065);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.guide-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-section strong {
  color: var(--text);
  font-size: 13px;
  padding-left: 10px;
}

.guide-section p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.guide-section-privacy strong,
.guide-author strong {
  padding-left: 0;
}

.guide-action-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guide-action-pills span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid rgba(216, 226, 232, 0.12);
  border-radius: 999px;
  color: #cbd3da;
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
}

.guide-pill-icon {
  position: relative;
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  color: #91c8ea;
}

.guide-pill-icon.zoom {
  border: 1px solid currentColor;
  border-radius: 50%;
}

.guide-pill-icon.zoom::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 1px;
  right: -4px;
  bottom: -2px;
  background: currentColor;
  transform: rotate(45deg);
}

.guide-pill-icon.move::before,
.guide-pill-icon.move::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.guide-pill-icon.move::before {
  left: 1px;
  right: 1px;
  top: 4px;
  height: 1px;
}

.guide-pill-icon.move::after {
  top: 1px;
  bottom: 1px;
  left: 4px;
  width: 1px;
}

.guide-pill-icon.select {
  border: 1px solid currentColor;
  border-radius: 3px;
}

.guide-pill-icon.select::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: currentColor;
}

.guide-legend-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.guide-legend-list span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 7px;
  border: 1px solid rgba(216, 226, 232, 0.1);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  line-height: 1.25;
}

.guide-legend-list .legend-swatch {
  flex: 0 0 auto;
}

.guide-author {
  border-bottom: 0;
  padding-bottom: 6px;
}

.guide-author-links {
  margin-top: 4px;
}

.guide-visual {
  position: relative;
  height: 150px;
  overflow: hidden;
  border: 1px solid rgba(216, 226, 232, 0.18);
  border-radius: 8px;
  background: #0b0f11;
}

.visual-map {
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
}

.heat {
  position: absolute;
  width: 150px;
  height: 110px;
  border-radius: 50%;
  filter: blur(22px);
}

.heat-a { left: 34px; top: 22px; background: rgba(34, 197, 94, 0.38); }
.heat-b { right: 34px; bottom: 20px; background: rgba(14, 165, 233, 0.42); }

.thumb,
.stack,
.large-photo {
  position: absolute;
  border: 2px solid var(--gold);
  border-radius: 7px;
  background: linear-gradient(135deg, #7db7d8, #273039 48%, #d9a45f);
  box-shadow: 0 8px 20px rgba(0,0,0,0.42);
}

.thumb { width: 42px; height: 42px; }
.t1 { left: 62px; top: 54px; }
.t2 { left: 152px; top: 34px; }
.t3 { right: 74px; bottom: 36px; }

.visual-cluster .stack {
  width: 86px;
  height: 72px;
  left: calc(50% - 43px);
  top: 36px;
}

.s1 { transform: translate(16px, -12px); opacity: 0.55; }
.s2 { transform: translate(8px, -6px); opacity: 0.75; }
.s3 { transform: translate(0, 0); }

.badge {
  position: absolute;
  left: calc(50% + 30px);
  top: 26px;
  min-width: 28px;
  height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #151006;
  background: var(--gold);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
}

.large-photo {
  inset: 18px 64px 38px 26px;
  border-color: rgba(216, 226, 232, 0.32);
}

.like-demo {
  position: absolute;
  right: 30px;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 42px;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: var(--gold);
  font-size: 22px;
}

.visual-heat {
  display: flex;
  align-items: stretch;
  padding: 34px;
  gap: 6px;
}

.visual-heat span {
  flex: 1;
  border-radius: 6px;
}

.visual-heat span:nth-child(1) { background: #2563eb; opacity: 0.52; }
.visual-heat span:nth-child(2) { background: #06b6d4; opacity: 0.64; }
.visual-heat span:nth-child(3) { background: #22c55e; opacity: 0.78; }
.visual-heat span:nth-child(4) { background: #facc15; opacity: 0.9; }
.visual-heat span:nth-child(5) { background: #ef4444; }
