:root {
  color-scheme: light;
  --bg: #f7f4f2;
  --bg-soft: rgba(255, 255, 255, 0.42);
  --surface: #ffffff;
  --surface-raised: rgba(255, 255, 255, 0.58);
  --glass: rgba(255, 255, 255, 0.54);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --ink: #171311;
  --muted: #706a66;
  --faint: #a59d98;
  --line: rgba(70, 54, 46, 0.13);
  --line-strong: rgba(70, 54, 46, 0.2);
  --coral: #f05d42;
  --coral-strong: #c83f2b;
  --coral-soft: rgba(240, 93, 66, 0.12);
  --blue: #2f6fed;
  --blue-soft: rgba(47, 111, 237, 0.1);
  --amber: #9a6500;
  --amber-soft: rgba(255, 246, 223, 0.8);
  --shine: rgba(255, 255, 255, 0.72);
  --shadow: 0 28px 80px rgba(48, 35, 30, 0.14);
  --shadow-soft: 0 14px 36px rgba(48, 35, 30, 0.09);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  --blur: blur(26px) saturate(1.36);
  --radius: 16px;
  --radius-lg: 28px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(240, 93, 66, 0.1), transparent 34%),
    linear-gradient(245deg, rgba(47, 111, 237, 0.08), transparent 38%),
    linear-gradient(180deg, #fffdfb 0, var(--bg) 34rem, #f2f4f7 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  letter-spacing: 0;
}

a {
  color: inherit;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.reset-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.app {
  min-height: 100vh;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  isolation: isolate;
}

.page {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-soft), var(--shadow-inner);
  padding: 7px 9px 7px 7px;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 13px;
  background: transparent;
  box-shadow:
    0 14px 30px rgba(240, 93, 66, 0.24),
    var(--shadow-inner);
  overflow: hidden;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1.02rem;
  line-height: 1.05;
  font-weight: 820;
}

.brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  padding: 0 13px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-inner);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.lang-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background: rgba(23, 19, 17, 0.06);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 900;
  box-shadow: var(--shadow-inner);
}

.hero {
  display: grid;
  gap: 28px;
  min-height: calc(100vh - 154px);
  align-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.42)),
    linear-gradient(155deg, rgba(240, 93, 66, 0.09), transparent 42%),
    var(--glass);
  box-shadow: var(--shadow), var(--shadow-inner);
  padding: clamp(24px, 7vw, 54px);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.55), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 34%);
  mask-image: linear-gradient(140deg, black 0 48%, transparent 72%);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  margin: 0 0 16px;
  max-width: 780px;
  font-size: clamp(2.15rem, 8vw, 5.8rem);
  font-weight: 760;
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-copy p {
  max-width: 650px;
  margin: 0;
  color: rgba(23, 19, 17, 0.66);
  font-size: clamp(1.02rem, 2vw, 1.22rem);
  line-height: 1.55;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.hero-points span {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-inner);
  padding: 8px 13px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.hero-actions {
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.home-rail {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.home-step,
.panel,
.map-card,
.encounter-detail,
.empty-state {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.42)),
    var(--surface-raised);
  box-shadow: var(--shadow-soft), var(--shadow-inner);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.home-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  padding: 16px;
}

.home-step span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  font-weight: 900;
}

.home-step strong {
  align-self: end;
}

.home-step p,
p.helper {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  min-height: 50px;
  padding: 0 17px;
  color: inherit;
  font-weight: 820;
  text-decoration: none;
  transition:
    transform 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 38%),
    linear-gradient(135deg, #ff7058, var(--coral) 54%, var(--coral-strong));
  color: white;
  box-shadow: 0 18px 34px rgba(240, 93, 66, 0.28), var(--shadow-inner);
}

.button-primary:hover:not(:disabled) {
  background: var(--coral-strong);
}

.button-secondary {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  box-shadow: var(--shadow-inner);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.button-quiet {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(23, 19, 17, 0.045);
  color: var(--ink);
}

.button-ghost {
  background: transparent;
  color: var(--muted);
}

.button.full {
  width: 100%;
}

.stack {
  display: grid;
  gap: 14px;
}

.setup-wrap,
.detail-page,
.guide-shell {
  display: grid;
  gap: 14px;
  width: min(100%, 860px);
  margin: 0 auto;
}

.setup-panel {
  width: min(520px, 100%);
  margin: 8vh auto 0;
}

.panel {
  padding: 18px;
}

.panel h1,
.panel h2,
.panel h3,
.results-hero h1,
.encounter-detail h2 {
  margin: 0;
}

.panel p,
.results-hero p,
.encounter-detail p {
  color: var(--muted);
  line-height: 1.52;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--coral-strong);
  font-size: 0.73rem;
  font-weight: 860;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.text-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  min-height: 50px;
  padding: 0 15px;
  font-size: 1rem;
  box-shadow: var(--shadow-inner);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
}

.text-input:focus {
  border-color: var(--coral);
  outline: 3px solid rgba(240, 93, 66, 0.16);
}

.room-layout {
  display: grid;
  gap: 14px;
}

.room-side,
.room-main {
  display: grid;
  gap: 14px;
  align-content: start;
}

.room-card h1 {
  font-size: 2rem;
  letter-spacing: 0;
}

.room-actions,
.action-grid,
.shortcut-actions,
.detail-actions {
  display: grid;
  gap: 10px;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.status-list {
  display: grid;
  gap: 8px;
}

.status-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
  padding: 12px;
  box-shadow: var(--shadow-inner);
}

.status-row strong,
.status-row span {
  display: block;
}

.status-row span:not(.status-dot) {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--faint);
}

.status-dot.is-ready {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(240, 93, 66, 0.13);
}

.role-picker,
.segmented,
.filter-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 18px;
  background: rgba(23, 19, 17, 0.055);
  padding: 4px;
  box-shadow: var(--shadow-inner);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.segmented.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segment,
.filter-tab {
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  min-height: 40px;
  padding: 4px 8px;
  font-weight: 850;
}

.segment small {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 760;
}

.segment.is-active,
.filter-tab.is-active {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(48, 35, 30, 0.09), var(--shadow-inner);
}

.upload-zone {
  display: grid;
  gap: 8px;
  border: 1px dashed rgba(70, 54, 46, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
  margin-top: 12px;
  padding: 18px;
}

.upload-zone:hover {
  border-color: var(--coral);
}

.upload-zone input {
  width: 100%;
  color: var(--muted);
}

.upload-zone strong,
.upload-zone span {
  display: block;
}

.upload-zone span {
  color: var(--muted);
  font-size: 0.88rem;
}

.quality-grid,
.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.quality-item,
.metric-card {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
  padding: 12px;
  box-shadow: var(--shadow-inner);
}

.quality-item span,
.metric-card span,
.quality-item strong,
.metric-card strong {
  display: block;
}

.quality-item span,
.metric-card span {
  color: var(--muted);
  font-size: 0.75rem;
}

.quality-item strong,
.metric-card strong {
  margin-top: 4px;
  font-size: 1.02rem;
}

.details-box {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
  margin-top: 12px;
  padding: 12px;
}

.details-box summary {
  cursor: pointer;
  font-weight: 850;
}

.details-box p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.results-shell {
  display: grid;
  gap: 14px;
}

.results-hero {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42)),
    var(--surface-raised);
  box-shadow: var(--shadow-soft), var(--shadow-inner);
  padding: 18px;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.results-hero h1 {
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1;
  font-weight: 760;
}

.filter-bar {
  display: grid;
  gap: 10px;
}

.filter-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.strict-toggle.is-active {
  border-color: rgba(240, 93, 66, 0.45);
  background: var(--coral-soft);
  color: var(--coral-strong);
}

.period-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 4px;
  scrollbar-width: none;
}

.period-strip::-webkit-scrollbar {
  display: none;
}

.period-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  cursor: pointer;
  min-height: 38px;
  padding: 0 12px;
  font-weight: 820;
  box-shadow: var(--shadow-inner);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.period-chip span {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(23, 19, 17, 0.08);
  color: var(--muted);
  font-size: 0.76rem;
}

.period-chip.is-active {
  border-color: rgba(240, 93, 66, 0.36);
  background: rgba(255, 236, 231, 0.74);
  color: var(--coral-strong);
}

.map-card {
  overflow: hidden;
  padding: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.34)),
    rgba(255, 255, 255, 0.42);
}

.leaflet-map {
  min-height: 360px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(47, 111, 237, 0.08), rgba(240, 93, 66, 0.08)),
    var(--bg-soft);
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    inset 0 18px 42px rgba(255, 255, 255, 0.18);
}

.overview-map {
  height: min(56vh, 520px);
}

.detail-map {
  min-height: 280px;
  height: 34vh;
}

.leaflet-container {
  font: inherit;
  background: var(--bg-soft);
}

.leaflet-tile {
  filter: saturate(0.58) contrast(0.9) brightness(1.05);
}

.leaflet-control-zoom {
  border: 1px solid rgba(255, 255, 255, 0.54) !important;
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.leaflet-control-zoom a {
  border: 0 !important;
  color: var(--ink) !important;
  background: rgba(255, 255, 255, 0.68) !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  box-shadow: var(--shadow-soft) !important;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.leaflet-control-attribution {
  border-radius: 8px 0 0 0;
  background: rgba(255, 255, 255, 0.62) !important;
  color: var(--muted) !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  padding: 2px 5px !important;
}

.leaflet-control-attribution a {
  color: var(--blue) !important;
}

.cruza-marker,
.person-marker,
.center-marker {
  background: transparent;
}

.cruza-marker span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid white;
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent),
    var(--ink);
  color: white;
  box-shadow: 0 10px 24px rgba(22, 22, 22, 0.22);
  font-size: 0.8rem;
  font-weight: 950;
}

.cruza-marker.is-active span {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent),
    var(--coral);
  transform: scale(1.12);
}

.person-marker span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  box-shadow: 0 8px 20px rgba(22, 22, 22, 0.18);
  font-size: 0.78rem;
  font-weight: 950;
}

.person-a span {
  background: var(--blue);
}

.person-b span {
  background: var(--coral);
}

.center-marker span {
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 8px 20px rgba(22, 22, 22, 0.2);
}

.empty-map,
.empty-state,
.map-fallback {
  display: grid;
  place-items: center;
  min-height: 260px;
  gap: 6px;
  border-radius: 22px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--bg-soft);
  background-size: 42px 42px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.empty-map strong,
.empty-state strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.results-grid {
  display: grid;
  gap: 14px;
}

.encounter-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.encounter-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
  cursor: pointer;
  padding: 12px;
  text-align: left;
  transition:
    border-color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
  box-shadow: var(--shadow-inner);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
}

.encounter-card:hover,
.encounter-card.is-selected {
  border-color: rgba(240, 93, 66, 0.42);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.pin-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 0.82rem;
  font-weight: 950;
}

.encounter-card.is-selected .pin-number {
  background: var(--coral);
  box-shadow: 0 10px 22px rgba(240, 93, 66, 0.24);
}

.encounter-card strong,
.encounter-card span,
.encounter-card small {
  display: block;
}

.encounter-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.encounter-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.encounter-card small {
  margin-top: 4px;
  color: var(--faint);
  font-size: 0.78rem;
}

.detail-dock {
  min-width: 0;
}

.encounter-detail {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.detail-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.encounter-detail h2 {
  font-size: clamp(1.35rem, 5vw, 2.2rem);
  line-height: 1.05;
}

.encounter-detail p {
  margin: 7px 0 0;
}

.detail-nav {
  display: flex;
  gap: 7px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-inner);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
}

.icon-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.photo-pair {
  display: grid;
  gap: 10px;
}

.photo-column {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
  padding: 12px;
  box-shadow: var(--shadow-inner);
}

.photo-column h3 {
  margin: 0 0 10px;
  font-size: 0.96rem;
}

.photo-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid rgba(70, 54, 46, 0.1);
}

.photo-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.photo-row > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 950;
  overflow: hidden;
}

.photo-row > span img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-upload {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
  box-shadow: var(--shadow-inner);
  cursor: pointer;
  padding: 13px;
}

.preview-upload input {
  width: 100%;
  color: var(--muted);
}

.preview-upload strong,
.preview-upload span {
  display: block;
}

.preview-upload span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.photo-row strong,
.photo-row small {
  display: block;
}

.photo-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.photo-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.guide-hero {
  display: grid;
  gap: 16px;
  overflow: hidden;
  padding: 16px;
}

.guide-list {
  display: grid;
  gap: 10px;
}

.guide-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: var(--shadow-soft), var(--shadow-inner);
  padding: 14px;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.guide-step > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  font-weight: 950;
}

.guide-step h3 {
  margin: 0 0 5px;
}

.guide-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.code-sample {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #161616;
  color: #f7f1ee;
  margin: 10px 0 0;
  padding: 12px;
  font-size: 0.78rem;
}

.bottom-nav {
  position: sticky;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
  margin-top: 16px;
  padding: 6px;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.bottom-nav button {
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--muted);
  min-height: 42px;
  font-size: 0.82rem;
  font-weight: 850;
}

.bottom-nav button.is-active {
  background: rgba(255, 255, 255, 0.76);
  color: var(--coral-strong);
  box-shadow: var(--shadow-inner);
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 2000;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: rgba(23, 19, 17, 0.88);
  color: white;
  box-shadow: var(--shadow);
  padding: 13px 14px;
  font-size: 0.9rem;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

@media (min-width: 760px) {
  .app {
    padding: 28px 32px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: end;
  }

  .home-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .room-layout {
    grid-template-columns: 350px minmax(0, 1fr);
    align-items: start;
  }

  .room-actions,
  .action-grid,
  .shortcut-actions,
  .detail-actions,
  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shortcut-panel,
  .guide-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .results-grid {
    grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
    align-items: start;
  }

  .encounter-list {
    max-height: calc(100vh - 260px);
    overflow: auto;
    padding-right: 3px;
  }

  .detail-dock {
    position: sticky;
    top: 18px;
  }

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

  .bottom-nav {
    display: none;
  }
}

@media (max-width: 560px) {
  .top-link {
    display: none;
  }

  .hero {
    min-height: calc(100vh - 122px);
    padding: 38px 24px;
  }

  .hero-copy h1 {
    font-size: 2.28rem;
    line-height: 1.02;
    font-weight: 740;
  }

  .results-hero {
    display: grid;
  }

  .results-hero .button {
    width: 100%;
  }

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

  .overview-map {
    height: 48vh;
  }

  .topbar {
    border-radius: 24px;
    width: 100%;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .button {
    min-height: 54px;
  }

  .guide-shell {
    width: 100%;
    gap: 10px;
  }

  .guide-hero,
  .guide-step {
    border-radius: 22px;
  }

  .guide-hero .button {
    width: 100%;
  }

  .guide-step {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 12px;
  }

  .guide-step h3 {
    font-size: 1rem;
  }

  .guide-step p {
    font-size: 0.9rem;
  }
}

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