/* Hallmark · pre-emit critique: P5 H5 E5 S5 R4 V5 */
/* Hallmark · genre: atmospheric · macrostructure: Map / Diagram · theme: sodium-asphalt · enrichment: none · nav: N5 · footer: Ft2 */
/* ux-designer overhaul: map-first HUD, 60-30-10 glass overlays, stepped bottom sheets */

:root {
  --color-paper: oklch(0.16 0.02 70);
  --color-paper-2: oklch(0.2 0.025 70);
  --color-paper-3: oklch(0.24 0.03 70);
  --color-ink: oklch(0.94 0.02 85);
  --color-muted: oklch(0.76 0.03 75);
  --color-line: oklch(0.36 0.03 70);
  --color-accent: oklch(0.76 0.14 75);
  --color-accent-ink: oklch(0.18 0.03 70);
  --color-focus: oklch(0.8 0.14 75);
  --color-danger: oklch(0.72 0.16 28);
  --color-glass: oklch(0.18 0.025 70 / 0.78);
  --color-glass-strong: oklch(0.16 0.025 70 / 0.88);
  --color-map: oklch(0.22 0.02 70);
  --color-bubble-mine: oklch(0.32 0.05 75);
  --color-bubble-theirs: oklch(0.26 0.02 70);
  --font-display: "IBM Plex Serif", "Palatino Linotype", Palatino, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5625rem;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --radius-sheet: 16px;
  --radius-card: 16px;
  --radius-pill: 999px;
  --radius-input: 12px;
  --blur-glass: 18px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --dur-micro: 100ms;
  --dur-short: 200ms;
  --dur-med: 280ms;
  --z-base: 1;
  --z-raised: 10;
  --z-sticky: 200;
  --z-modal: 400;
  --z-toast: 500;
  --shadow-float: 0 8px 28px oklch(0.12 0.02 70 / 0.45);
}

html,
body {
  overflow: hidden;
  height: 100%;
  color-scheme: dark;
  touch-action: manipulation;
  -webkit-tap-highlight-color: oklch(0.76 0.14 75 / 0.18);
}

dialog:not([open]),
[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.45;
  font-weight: 400;
}

.skip {
  position: absolute;
  left: var(--space-md);
  top: var(--space-sm);
  z-index: calc(var(--z-toast) + 1);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-radius: var(--radius-pill);
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  min-height: 100svh;
  overflow: clip;
}

.view {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#view-home,
#view-wallet,
#view-account {
  background: var(--color-paper);
}

#view-experiences {
  position: relative;
  overflow: hidden;
}

#map-wrap,
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: var(--color-map);
}

#map-wrap {
  z-index: 0;
}

#map {
  isolation: isolate;
  z-index: 0;
  background: var(--color-map);
}

#map.map-engine-leaflet .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) saturate(0.55) brightness(0.9) contrast(0.95);
}

#map:has(.gm-style) {
  padding-bottom: calc(5.25rem + env(safe-area-inset-bottom));
}

.mast {
  position: absolute;
  top: calc(var(--space-sm) + env(safe-area-inset-top));
  left: var(--space-md);
  z-index: var(--z-sticky);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  max-width: calc(100vw - 5.5rem);
  min-width: 0;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-glass);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-float);
}

#app[data-chip="locating"] .mast {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.mast-kicker,
.mast-who {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mast-kicker {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.mast-who {
  font-size: var(--text-sm);
  font-weight: 500;
}

.lockup {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
}

h1,
h2 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  margin: 0 0 var(--space-sm);
  overflow-wrap: anywhere;
  min-width: 0;
  text-wrap: balance;
}

h2 {
  font-size: var(--text-lg);
  line-height: 1.2;
}

.presence {
  position: absolute;
  top: calc(var(--space-sm) + env(safe-area-inset-top));
  left: var(--space-md);
  right: auto;
  z-index: var(--z-sticky);
  max-width: calc(100vw - 5.5rem);
  min-width: 0;
  margin: 0;
  padding: var(--space-sm) var(--space-md);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  background: var(--color-glass);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-float);
}

#app:not([data-chip="locating"]) .presence {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.fine {
  margin: 0 0 var(--space-sm);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.req {
  color: var(--color-accent);
  font-weight: 600;
}

.optional {
  color: var(--color-muted);
  font-weight: 400;
  font-size: var(--text-sm);
}

.recs {
  position: absolute;
  left: var(--space-md);
  top: calc(4.25rem + env(safe-area-inset-top));
  z-index: var(--z-sticky);
  width: min(calc(100% - 2 * var(--space-md)), 16rem);
  max-height: 22dvh;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-xs);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--color-glass);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
}

.recs[hidden] {
  display: none;
}

.recs h2 {
  margin: 0;
  font-size: var(--text-md);
}

.recs #recs-copy {
  display: none;
}

.recs ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}

.rec-peek {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  min-width: 0;
  text-align: left;
  border-radius: var(--radius-pill);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-paper-3);
  border: 1px solid var(--color-line);
}

.rec-caption {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.rec-dist {
  flex: 0 0 auto;
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.recs-empty {
  display: grid;
  gap: var(--space-sm);
}

.recs-empty p {
  margin: 0;
}

.map-filters {
  position: absolute;
  right: var(--space-md);
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  z-index: var(--z-sticky);
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0;
  max-width: calc(100% - 2 * var(--space-md));
  padding: 2px;
  overflow-x: auto;
  background: var(--color-glass);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-float);
}

.map-filters button {
  min-height: 48px;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border-radius: var(--radius-pill);
  border-color: transparent;
  white-space: nowrap;
}

.map-filters button[aria-pressed="true"] {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-color: var(--color-accent);
}

.dock {
  position: absolute;
  left: var(--space-md);
  right: var(--space-md);
  bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
  z-index: var(--z-sticky);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: var(--space-xs);
  min-height: 48px;
  padding: var(--space-xs);
  background: var(--color-glass-strong);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-float);
}

.dock button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-sm);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-ink);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.dock svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabs {
  flex: 0 0 auto;
  z-index: var(--z-sticky);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: var(--space-xs);
  min-height: 48px;
  padding: var(--space-xs);
  padding-bottom: calc(var(--space-xs) + env(safe-area-inset-bottom));
  background: var(--color-glass-strong);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border-top: 1px solid var(--color-line);
}

.tabs a {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.tabs a[aria-current="page"] {
  color: var(--color-accent);
}

.tabs svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabs a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.tabs a:active {
  transform: scale(0.98);
}

.home-stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: calc(var(--space-xl) + env(safe-area-inset-top)) var(--space-lg) var(--space-lg);
  max-width: 28rem;
}

.home-headline {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: 1.15;
  margin: 0 0 var(--space-sm);
}

.home-lead {
  margin: 0;
  color: var(--color-muted);
  max-width: 36ch;
}

.home-actions {
  margin-top: auto;
  display: grid;
  gap: var(--space-sm);
  position: sticky;
  bottom: 0;
  padding-top: var(--space-md);
  padding-bottom: var(--space-sm);
  background: var(--color-paper);
}

.home-quiet {
  margin: 0;
  text-align: center;
}

.page-shell {
  min-height: 100%;
  display: grid;
  align-content: start;
  gap: var(--space-md);
  padding: calc(var(--space-lg) + env(safe-area-inset-top)) var(--space-lg) var(--space-md);
  max-width: 28rem;
}

.page-shell h1 {
  margin: 0;
}

.page-shell > label {
  display: grid;
  gap: var(--space-sm);
}

.page-sticky {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
  padding: var(--space-md) 0;
  background: var(--color-paper);
}

.page-sticky .primary {
  flex: 1 1 100%;
}

#view-wallet .wallet-row {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding-top: var(--space-md);
  background: var(--color-paper);
}

.exp-mode {
  position: absolute;
  left: var(--space-md);
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  z-index: var(--z-sticky);
  display: flex;
  gap: 0;
  padding: 2px;
  background: var(--color-glass);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-float);
}

.exp-mode button {
  min-height: 48px;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border-radius: var(--radius-pill);
  border-color: transparent;
  white-space: nowrap;
}

.exp-mode button[aria-pressed="true"] {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-color: var(--color-accent);
}

#exp-list {
  position: absolute;
  inset: 0;
  z-index: var(--z-raised);
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(4.25rem + env(safe-area-inset-top)) var(--space-md) calc(10.5rem + env(safe-area-inset-bottom));
  background: var(--color-paper);
}

#exp-pin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}

.exp-pin-row {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  min-width: 0;
  text-align: left;
  border-radius: var(--radius-card);
  padding: var(--space-md);
  background: var(--color-paper-3);
  border: 1px solid var(--color-line);
}

#consent-bar {
  position: fixed;
  left: var(--space-md);
  right: var(--space-md);
  top: calc(var(--space-sm) + env(safe-area-inset-top));
  z-index: var(--z-toast);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-glass-strong);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
}

#consent-bar[hidden] {
  display: none;
}

#consent-bar p {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
}

#consent-bar menu {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
}

button {
  font: inherit;
  font-weight: 500;
  color: var(--color-ink);
  background: var(--color-paper-3);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  padding: var(--space-sm) var(--space-md);
  min-height: 48px;
  touch-action: manipulation;
  transition: transform var(--dur-micro) var(--ease-out), opacity var(--dur-short) var(--ease-out),
    background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out),
    border-color var(--dur-short) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled) {
    border-color: var(--color-accent);
    color: var(--color-ink);
  }

  button.primary:hover:not(:disabled) {
    color: var(--color-accent-ink);
  }
}

button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-color: var(--color-accent);
  font-weight: 600;
}

button.chip {
  min-height: 44px;
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.sheet {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 88dvh;
  margin: 0;
  padding: 0;
  inset: auto 0 0 0;
  border: 0;
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  background: var(--color-paper-2);
  color: var(--color-ink);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  overscroll-behavior: contain;
}

.sheet[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-in var(--dur-med) var(--ease-out);
}

.sheet[open] form,
#sheet-pin-detail[open] {
  display: flex;
  flex-direction: column;
  max-height: 88dvh;
  min-height: 0;
}

.sheet::backdrop {
  background: oklch(0.1 0.02 70 / 0.55);
}

.sheet-grabber {
  width: 2.5rem;
  height: 4px;
  margin: var(--space-sm) auto var(--space-xs);
  border-radius: var(--radius-pill);
  background: var(--color-line);
  flex: 0 0 auto;
}

.sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0 var(--space-lg) var(--space-sm);
}

.sheet-head h2 {
  margin: 0;
}

.sheet-step-label {
  margin: 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.sheet-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--space-lg) var(--space-md);
  display: grid;
  gap: var(--space-md);
}

.sheet-sticky {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
  padding: var(--space-md) var(--space-lg);
  padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
  background: var(--color-paper-2);
  border-top: 1px solid var(--color-line);
}

.sheet-sticky .primary {
  flex: 1 1 100%;
}

.form-step {
  display: grid;
  gap: var(--space-md);
}

.form-step[hidden] {
  display: none;
}

.sheet label,
fieldset {
  display: grid;
  gap: var(--space-sm);
}

fieldset {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  padding: var(--space-md);
  margin: 0;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 48px;
}

fieldset input[type="radio"],
fieldset input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}

.wallet-field {
  display: grid;
  gap: var(--space-sm);
}

.wallet-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: stretch;
}

.wallet-row button {
  flex: 1 1 auto;
  white-space: nowrap;
}

input,
textarea {
  font: inherit;
  font-size: var(--text-md);
  width: 100%;
  min-width: 0;
  color: var(--color-ink);
  background: var(--color-paper-3);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-input);
  padding: 0.75rem var(--space-md);
  min-height: 48px;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-muted);
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
}

input[type="file"] {
  min-height: 48px;
  padding: var(--space-sm);
}

input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.err {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin: 0 var(--space-lg) var(--space-sm);
  color: var(--color-danger);
  font-size: var(--text-sm);
}

.err::before {
  content: "!";
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--color-danger);
  color: var(--color-accent-ink);
  font-weight: 700;
  font-size: var(--text-xs);
  line-height: 1;
}

.err[hidden] {
  display: none;
}

#pin-detail {
  flex: 0 1 auto;
  padding: 0 var(--space-lg) var(--space-md);
  min-width: 0;
}

#pin-detail p {
  margin: 0 0 var(--space-sm);
}

#negotiate {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  padding: 0 var(--space-lg);
  border-top: 1px solid var(--color-line);
  padding-top: var(--space-md);
}

#negotiate[hidden] {
  display: none;
}

#negotiate-threads,
#negotiate-messages {
  list-style: none;
  margin: 0 0 var(--space-sm);
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}

#negotiate-threads {
  max-height: 6rem;
  overflow: auto;
}

#negotiate-threads[hidden] {
  display: none;
}

#negotiate-threads button {
  width: 100%;
  text-align: left;
}

#negotiate-messages {
  flex: 1 1 auto;
  min-height: 7rem;
  max-height: 28dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding-bottom: var(--space-sm);
}

.bubble {
  max-width: 86%;
  padding: var(--space-sm) var(--space-md);
  border-radius: 16px 16px 16px 6px;
  background: var(--color-bubble-theirs);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.bubble-mine {
  margin-left: auto;
  border-radius: 16px 16px 6px 16px;
  background: var(--color-bubble-mine);
}

.bubble-kind {
  display: block;
  margin-bottom: 2px;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

.negotiate-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-sm);
  align-items: end;
  padding-top: var(--space-sm);
}

.negotiate-composer label {
  margin: 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-sm) 0;
}

#btn-arrive,
#btn-buy {
  min-height: 52px;
  font-size: var(--text-lg);
}

#ar {
  position: fixed;
  inset: 0;
  background: var(--color-paper);
  z-index: var(--z-modal);
}

#ar[hidden] {
  display: none;
}

#cam,
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ar-hud {
  position: absolute;
  left: var(--space-md);
  right: var(--space-md);
  bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--color-glass-strong);
  backdrop-filter: blur(var(--blur-glass));
  -webkit-backdrop-filter: blur(var(--blur-glass));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
}

.ar-hud menu,
.ar-clusters {
  display: grid;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
}

.ar-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.ar-cluster button {
  flex: 1 1 auto;
  min-width: 48px;
  min-height: 48px;
  white-space: nowrap;
}

.ar-browse {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.ar-settle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "buy buy"
    "trade done";
}

.ar-settle #btn-buy {
  grid-area: buy;
  flex: 1 1 100%;
}

.ar-settle #btn-trade {
  grid-area: trade;
}

.ar-settle #btn-leave {
  grid-area: done;
}

.ar-sensors button {
  font-size: var(--text-sm);
}

.self-loadout {
  display: grid;
  gap: var(--space-sm);
}

.self-loadout[hidden] {
  display: none;
}

.self-loadout ul {
  display: flex;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
}

.self-loadout li {
  display: grid;
  gap: var(--space-xs);
  min-width: 4.5rem;
  max-width: 6.5rem;
}

.self-loadout img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: var(--radius-input);
  border: 1px solid var(--color-line);
  background: var(--color-paper-3);
}

.self-loadout span {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

#ar-status {
  margin: 0;
}

#ar-art {
  position: absolute;
  left: 50%;
  top: 18%;
  display: block;
  max-height: 36vh;
  max-width: min(72vw, 20rem);
  margin: 0;
  transform: translateX(-50%);
  border-radius: var(--radius-card);
  filter: none;
  pointer-events: none;
}

#ar-art.blur-on {
  filter: blur(14px);
}

#overlay {
  pointer-events: none;
}

.leaflet-container,
#map .gm-style {
  background: var(--color-map);
  font-family: var(--font-body);
}

#map .gm-bundled-control {
  margin-top: calc(4.5rem + env(safe-area-inset-top));
}

#map .gm-style-cc,
#map .gm-bundled-control-on-bottom {
  margin-bottom: calc(5.25rem + env(safe-area-inset-bottom));
}

.leaflet-top.leaflet-left {
  top: calc(6.25rem + env(safe-area-inset-top));
}

.leaflet-bottom {
  bottom: calc(6.5rem + env(safe-area-inset-bottom));
}

.leaflet-control-attribution {
  max-width: 55vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(12%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 40rem) {
  .sheet {
    width: min(100%, 28rem);
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  #ar,
  .ar-hud,
  #ar-art,
  .ar-cluster button,
  button,
  .tabs a {
    transition: none;
  }

  button:active:not(:disabled),
  .tabs a:active {
    transform: none;
  }

  .sheet[open] {
    animation: none;
  }
}
