:root {
  color-scheme: light;
  --bg-deep: #f4efe6;
  --bg-card: #faf6ef;
  --bg-panel: #f4efe6;
  --bg-elevated: #faf6ef;
  --accent: #c2754c;
  --second: #6b7f5c;
  --text-primary: #3d2817;
  --text-secondary: #8a6f4a;
  --text-muted: #d4c7b5;
  --border: #e5dcc9;
  --border-mid: #d4c7b5;
  --success: #4a7a52;
  --error: #b5482f;
  --shadow: 0 20px 60px rgba(61, 40, 23, 0.12);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-deep: #0a1018;
  --bg-card: #0f1923;
  --bg-panel: #131f2b;
  --bg-elevated: #1a2535;
  --accent: #ffb627;
  --second: #ff6b35;
  --text-primary: #f2e8d5;
  --text-secondary: #7a8fa6;
  --text-muted: #3d5068;
  --border: rgba(255, 182, 39, 0.16);
  --border-mid: rgba(255, 182, 39, 0.28);
  --success: #3db87a;
  --error: #e53935;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

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

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(194, 117, 76, 0.08), transparent 34%),
    linear-gradient(300deg, rgba(107, 127, 92, 0.1), transparent 38%),
    var(--bg-deep);
}

.app-shell.public-mode {
  grid-template-columns: 1fr;
}

.app-shell.public-mode .side-nav,
.app-shell.public-mode .topbar,
.app-shell.public-mode .mobile-nav {
  display: none;
}

.app-shell.public-mode .workspace {
  min-height: 100vh;
  padding: 28px;
}

.side-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-card) 86%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  font-size: 26px;
  font-weight: 900;
}

.brand img {
  border-radius: 12px;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab,
.mobile-tab {
  border: 0;
  color: var(--text-secondary);
  background: transparent;
}

.tab {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 8px;
  font-weight: 800;
  text-align: left;
}

.tab span {
  width: 24px;
  text-align: center;
}

.tab.is-active,
.mobile-tab.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.side-actions {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  margin-top: auto;
}

.nav-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.nav-profile strong,
.nav-profile span {
  display: block;
}

.nav-profile span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-card) 82%, transparent);
  box-shadow: 0 10px 34px rgba(61, 40, 23, 0.06);
}

.kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 8px;
  font-size: 22px;
  line-height: 1.2;
}

p {
  color: var(--text-secondary);
  line-height: 1.5;
}

.topbar-actions,
.row-actions,
.section-head,
.stats-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
}

.primary-button,
.ghost-button,
.text-button,
.icon-button,
.filter {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 0;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--accent), var(--second));
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  background: var(--bg-card);
}

.compact {
  min-height: 38px;
}

.text-button {
  border: 0;
  color: var(--accent);
  background: transparent;
}

.icon-button {
  border: 1px solid var(--border);
  color: var(--accent);
  background: var(--bg-card);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.quick-strip {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
  overflow-x: auto;
}

.map-layout,
.split-layout,
.profile-layout,
.pro-layout,
.bar-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 18px;
}

.map-panel,
.panel,
.profile-card,
.auth-card,
.confirmation-card,
.chat-panel,
.conversation-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.map-panel {
  position: relative;
  min-height: calc(100vh - 190px);
  overflow: hidden;
}

.map-canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(32deg, transparent 48%, color-mix(in srgb, var(--border) 58%, transparent) 49%, transparent 51%),
    linear-gradient(142deg, transparent 48%, color-mix(in srgb, var(--border) 50%, transparent) 49%, transparent 51%),
    var(--bg-panel);
}

.district,
.road,
.map-marker,
.user-dot {
  position: absolute;
}

.district {
  border: 1px solid var(--border);
  border-radius: 38% 62% 56% 44%;
}

.district-a {
  inset: 9% 18% 31% 7%;
  transform: rotate(-14deg);
}

.district-b {
  inset: 28% 8% 12% 31%;
  transform: rotate(18deg);
}

.road {
  height: 12px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--border-mid) 42%, transparent);
}

.road-a {
  left: -7%;
  right: 8%;
  top: 42%;
  transform: rotate(-18deg);
}

.road-b {
  left: 18%;
  right: -12%;
  top: 61%;
  transform: rotate(28deg);
}

.map-marker {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 25px 25px 25px 4px;
  color: white;
  transform: rotate(-45deg);
  box-shadow: 0 12px 38px rgba(181, 72, 47, 0.28);
}

.map-marker span {
  transform: rotate(45deg);
}

.map-marker.hot {
  left: 54%;
  top: 30%;
  background: var(--error);
}

.map-marker.warm {
  left: 28%;
  top: 54%;
  background: var(--accent);
}

.map-marker.calm {
  left: 72%;
  top: 61%;
  background: var(--second);
}

.user-dot {
  left: 47%;
  top: 55%;
  width: 18px;
  height: 18px;
  border: 4px solid white;
  border-radius: 50%;
  background: #2f80ed;
  box-shadow: 0 0 0 10px rgba(47, 128, 237, 0.15);
}

.bottom-card {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  backdrop-filter: blur(18px);
}

.bottom-card h2,
.event-hero h2 {
  margin-top: 8px;
}

.feed-column,
.cards-grid,
.friend-list,
.group-list,
.spot-list,
.pro-events,
.activity-feed {
  display: grid;
  gap: 12px;
}

.feed-column {
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding-right: 4px;
}

.spot-card,
.event-card,
.friend-card,
.group-card,
.conversation,
.activity-item,
.pro-event {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}

button.spot-card,
button.friend-card,
button.group-card {
  width: 100%;
  color: inherit;
  text-align: left;
}

button.friend-card:hover,
button.group-card:hover,
button.spot-card:hover {
  border-color: var(--border-mid);
  background: var(--bg-elevated);
}

.spot-card,
.conversation,
.friend-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spot-icon,
.avatar,
.profile-avatar,
.avatar-row span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--text-primary);
  background: var(--bg-elevated);
  font-weight: 900;
}

.spot-icon,
.avatar {
  width: 44px;
  height: 44px;
}

.spot-card h3,
.friend-card h3,
.conversation h3,
.group-card h3,
.event-card h3,
.pro-event h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.spot-card p,
.friend-card p,
.conversation p,
.group-card p,
.event-card p,
.pro-event p,
.activity-item p {
  margin: 0;
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.pill.hot {
  color: var(--error);
  background: color-mix(in srgb, var(--error) 13%, transparent);
}

.pill.good {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 13%, transparent);
}

.pill.calm {
  color: var(--second);
  background: color-mix(in srgb, var(--second) 13%, transparent);
}

.map-view {
  min-height: calc(100vh - 146px);
}

.map-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
}

.map-filter-group {
  display: flex;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.map-filter-group .filter {
  flex: 0 0 auto;
}

.map-summary {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 900;
}

.map-panel {
  min-height: clamp(620px, calc(100vh - 190px), 780px);
  background: var(--bg-panel);
}

.map-canvas {
  background:
    radial-gradient(circle at 30% 28%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 26%),
    radial-gradient(circle at 74% 70%, color-mix(in srgb, var(--second) 12%, transparent), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--bg-card) 78%, white), var(--bg-panel));
}

.map-neighborhood,
.street,
.map-water,
.map-gridlines,
.map-markers {
  position: absolute;
}

.map-neighborhood {
  border: 1px solid color-mix(in srgb, var(--border-mid) 70%, transparent);
  background: color-mix(in srgb, var(--bg-card) 66%, transparent);
  opacity: 0.8;
}

.neighborhood-a {
  inset: 8% 55% 45% 7%;
  border-radius: 8px 28px 10px 36px;
  transform: rotate(-12deg);
}

.neighborhood-b {
  inset: 18% 10% 47% 56%;
  border-radius: 32px 8px 42px 14px;
  transform: rotate(11deg);
}

.neighborhood-c {
  inset: 56% 22% 10% 22%;
  border-radius: 36px 10px 8px 30px;
  transform: rotate(-5deg);
}

.street {
  height: 16px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 0 7%, color-mix(in srgb, var(--accent) 80%, white) 7% 63%, color-mix(in srgb, var(--second) 88%, white) 63% 100%);
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--bg-card) 80%, transparent);
}

.street-main {
  left: -8%;
  right: 10%;
  top: 43%;
  transform: rotate(-16deg);
}

.street-second {
  left: 18%;
  right: -11%;
  top: 62%;
  transform: rotate(29deg);
}

.street-third {
  left: 34%;
  right: 18%;
  top: 51%;
  transform: rotate(89deg);
  opacity: 0.78;
}

.map-water {
  left: -16%;
  right: 63%;
  bottom: -20%;
  height: 44%;
  border-radius: 50%;
  background: color-mix(in srgb, var(--second) 22%, transparent);
  filter: blur(1px);
}

.map-gridlines {
  inset: 0;
  opacity: 0.2;
  background:
    linear-gradient(90deg, transparent 0 24%, var(--border) 24% 24.4%, transparent 24.4% 100%),
    linear-gradient(0deg, transparent 0 31%, var(--border) 31% 31.4%, transparent 31.4% 100%);
  background-size: 180px 180px;
}

.map-markers {
  inset: 0;
  z-index: 2;
}

.map-marker {
  left: var(--x);
  top: var(--y);
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 3px solid color-mix(in srgb, var(--bg-card) 88%, white);
  border-radius: 28px 28px 28px 8px;
  color: white;
  background: var(--accent);
  transform: translate(-50%, -50%) rotate(-45deg);
  box-shadow: 0 16px 42px rgba(61, 40, 23, 0.22);
}

.map-marker span,
.map-marker strong {
  transform: rotate(45deg);
}

.map-marker span {
  font-size: 22px;
  line-height: 1;
}

.map-marker strong {
  margin-top: -7px;
  font-size: 11px;
}

.map-marker.hot {
  background: var(--error);
}

.map-marker.good {
  background: var(--accent);
}

.map-marker.calm {
  background: var(--second);
}

.map-marker.is-selected {
  width: 66px;
  height: 66px;
  border-color: white;
  box-shadow: 0 18px 52px rgba(181, 72, 47, 0.36), 0 0 0 10px color-mix(in srgb, var(--accent) 14%, transparent);
}

.map-sheet {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: grid;
  gap: 12px;
  max-width: 720px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-card) 94%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px rgba(61, 40, 23, 0.16);
}

.map-sheet-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.map-place-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  font-size: 25px;
}

.map-sheet-title span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.map-sheet-title h2 {
  margin: 2px 0;
  color: var(--text-primary);
  font-size: 24px;
}

.map-sheet-title p,
.map-description {
  margin: 0;
}

.map-pill-row,
.map-info-grid,
.map-quick-actions,
.map-feed-stats,
.map-metric {
  display: grid;
  gap: 10px;
}

.map-pill-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.map-pill-row span,
.map-info-grid span {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-elevated) 72%, transparent);
  font-size: 13px;
  font-weight: 800;
}

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

.map-metric div,
.map-feed-stats article {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.map-metric strong,
.map-feed-stats strong {
  display: block;
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
}

.map-metric span,
.map-feed-stats span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.map-gauge {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border-mid) 40%, transparent);
}

.map-gauge span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--second), var(--accent), var(--error));
}

.map-quick-actions {
  grid-template-columns: minmax(140px, 1fr) minmax(120px, auto) minmax(90px, auto);
}

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

.map-feed {
  max-height: clamp(620px, calc(100vh - 190px), 780px);
}

.map-feed-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 2px;
}

/* ===== Vraie carte Mapbox + marqueurs (parite app MAUI) ===== */
.mapbox-surface {
  position: absolute;
  inset: 0;
}

.mapboxgl-marker {
  z-index: 2;
}

.bar-marker {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bar-marker.active {
  z-index: 10;
  transform: scale(1.12);
}

.marker-card {
  position: relative;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.bar-marker.active .marker-card {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.marker-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 11px;
}

.marker-name {
  overflow: hidden;
  max-width: 120px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gauge-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.gauge-bar {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--bg-elevated);
}

.gauge-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s ease;
}

.gauge-count {
  min-width: 20px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}

.marker-stem {
  width: 1px;
  height: 7px;
  margin: 0 auto;
  background: color-mix(in srgb, var(--accent) 40%, transparent);
}

.marker-dot {
  width: 5px;
  height: 5px;
  margin: 0 auto;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 50%, transparent);
}

.bar-marker.active .marker-dot {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.user-location-marker {
  position: relative;
  width: 18px;
  height: 18px;
}

.user-location-dot {
  position: absolute;
  inset: 4px;
  border: 2px solid var(--bg-card);
  border-radius: 50%;
  background: #2b7dff;
  box-shadow: 0 0 0 1px rgba(43, 125, 255, 0.4);
}

.user-location-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(43, 125, 255, 0.35);
  animation: user-pulse 2.2s ease-out infinite;
}

@keyframes user-pulse {
  0% {
    opacity: 0.8;
    transform: scale(0.6);
  }

  100% {
    opacity: 0;
    transform: scale(2.6);
  }
}

.map-live-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-card) 90%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
}

.map-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* ===== Fiche bar (bottom sheet) esthetique app ===== */
.map-sheet {
  max-height: min(72vh, 620px);
  overflow-y: auto;
}

.map-sheet[hidden] {
  display: none;
}

.sheet-handle-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.sheet-handle {
  grid-column: 2;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 40%, transparent);
  cursor: pointer;
}

.sheet-close-btn {
  grid-column: 3;
  justify-self: end;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 800;
}

.verified-check {
  color: var(--accent);
}

.sheet-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.badge-pill {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 800;
}

.badge-pill.success {
  color: var(--success);
}

.badge-pill.accent {
  color: var(--accent);
  background: var(--bg-card);
}

.sheet-gauge-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--bg-elevated);
}

.sheet-gauge-total strong {
  display: block;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.sheet-gauge-total span {
  color: var(--text-muted);
  font-size: 10px;
}

.sheet-gauge-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}

.sheet-gauge-label span {
  color: var(--text-secondary);
}

.sheet-gauge-label strong {
  color: var(--accent);
}

.checkin-btn {
  height: 52px;
  border: 1px solid var(--border-mid);
  border-radius: 18px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 800;
}

.checkin-btn.is-checked {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

.map-info-grid.vertical {
  grid-template-columns: 1fr;
}

.map-info-grid.vertical span,
.map-info-grid.vertical a {
  display: block;
  color: var(--text-primary);
}

.sheet-mini-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-action-btn {
  display: grid;
  place-items: center;
  gap: 2px;
  height: 48px;
  border-radius: 18px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
}

.mini-action-btn span {
  font-size: 16px;
}

.mini-action-btn.is-disabled {
  color: var(--text-muted);
  opacity: 0.6;
}

.sheet-about {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-card);
}

.sheet-about h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.sheet-about p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.sheet-cta-btn {
  height: 54px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(90deg, var(--accent), var(--second));
  color: var(--bg-deep);
  font-size: 15px;
  font-weight: 800;
}

.spot-card.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-card));
}

.spot-card .pill {
  margin-left: auto;
}

.event-hero {
  min-height: 330px;
  padding: 24px;
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, transparent), transparent 55%),
    var(--bg-card);
  box-shadow: var(--shadow);
}

.event-hero h2 {
  max-width: 680px;
  font-size: 38px;
}

.avatar-row {
  display: flex;
  margin: 22px 0;
}

.avatar-row span {
  width: 38px;
  height: 38px;
  margin-right: -8px;
  border: 2px solid var(--bg-card);
  font-size: 12px;
}

.filters {
  display: flex;
  gap: 10px;
  padding: 18px 0;
  overflow-x: auto;
}

.filter {
  padding: 0 16px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  background: var(--bg-card);
  white-space: nowrap;
}

.filter.is-active {
  color: var(--bg-deep);
  border-color: transparent;
  background: var(--accent);
}

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

.panel,
.profile-card,
.auth-card,
.confirmation-card {
  padding: 20px;
}

.messages-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  min-height: 680px;
}

.conversation-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
}

.conversation-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 8px;
}

.conversation-tools h2 {
  margin: 0;
}

.conversation-tabs,
.notification-filters,
.quick-replies {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.conversation-tabs .filter,
.notification-filters .filter,
.quick-replies .filter {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.conversation-scroll {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.conversation {
  border-color: transparent;
  box-shadow: none;
}

.conversation.is-active {
  border-color: var(--border-mid);
  background: var(--bg-elevated);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.chat-title,
.conversation-copy {
  min-width: 0;
}

.chat-head h2,
.chat-head p {
  margin: 0;
}

.chat-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.chat-actions .icon-button,
.conversation-tools .icon-button {
  width: 42px;
  min-height: 42px;
}

.chat-stream {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  overflow: auto;
}

.bubble {
  display: grid;
  gap: 4px;
  max-width: 72%;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-elevated);
}

.bubble.me {
  align-self: flex-end;
  color: var(--bg-deep);
  background: var(--accent);
}

.bubble small {
  color: color-mix(in srgb, currentColor 62%, transparent);
  font-size: 11px;
  font-weight: 800;
}

.quick-replies {
  padding: 0 14px 12px;
}

.conversation-copy p,
.conversation-copy h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
}

.conversation-meta strong {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--bg-deep);
  background: var(--accent);
  font-size: 12px;
}

.notification-item {
  display: grid;
  gap: 12px;
  cursor: pointer;
}

.notifications-page {
  display: grid;
  gap: 14px;
  max-width: 980px;
  margin: 0 auto;
}

.notifications-header,
.notifications-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.notifications-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px;
}

.notifications-header .icon-button {
  width: 44px;
  min-height: 44px;
  font-size: 28px;
}

.notifications-header h2,
.notifications-header p {
  margin: 0;
}

.notifications-header p {
  font-size: 13px;
}

.notifications-header strong {
  display: inline-block;
  margin-top: 4px;
  color: var(--error);
  font-size: 12px;
}

.notifications-actions {
  display: flex;
  gap: 8px;
}

.notifications-panel {
  padding: 14px;
}

.notification-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.notification-toolbar .notification-filters {
  justify-content: flex-end;
}

.notification-toolbar h2 {
  margin: 0;
}

.notification-item.is-unread {
  border-color: var(--border-mid);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-card));
}

.notification-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.notification-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-elevated);
  font-size: 18px;
}

.notification-main h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.notification-main small {
  display: block;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.notification-dot {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  background: transparent;
}

.notification-item.is-unread .notification-dot {
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 15%, transparent);
}

.notification-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 70px 18px;
  color: var(--text-secondary);
  text-align: center;
}

.notification-empty div {
  font-size: 42px;
}

.notification-empty h3,
.notification-empty p {
  margin: 0;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--border-mid);
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 800;
  text-align: center;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--border);
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  background: var(--bg-elevated);
}

textarea {
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.form-panel,
.auth-grid {
  max-width: 980px;
  margin: 0 auto;
}

.form-grid,
.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-panel {
  display: grid;
  gap: 14px;
}

.profile-card {
  text-align: center;
}

.profile-avatar {
  width: 92px;
  height: 92px;
  margin: 0 auto 14px;
  font-size: 28px;
}

.stats-row {
  justify-content: center;
  flex-wrap: wrap;
  margin: 18px 0;
}

.stats-row span,
.metric-grid span {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.stats-row strong,
.metric-grid strong {
  display: block;
  font-size: 22px;
}

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.pro-extra {
  margin-top: 18px;
}

.chart-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 10px;
  height: 180px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.chart-strip span {
  display: block;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--second));
}

.chart-strip span:nth-child(1) { height: 34%; }
.chart-strip span:nth-child(2) { height: 58%; }
.chart-strip span:nth-child(3) { height: 44%; }
.chart-strip span:nth-child(4) { height: 70%; }
.chart-strip span:nth-child(5) { height: 62%; }
.chart-strip span:nth-child(6) { height: 86%; }

.qr-panel {
  display: grid;
  place-items: center;
  text-align: center;
}

.qr-box {
  display: grid;
  place-items: center;
  width: 180px;
  aspect-ratio: 1;
  border: 12px solid var(--text-primary);
  border-radius: 8px;
  color: var(--text-primary);
  background:
    linear-gradient(90deg, var(--text-primary) 12px, transparent 12px) 18px 18px / 42px 42px,
    linear-gradient(var(--text-primary) 12px, transparent 12px) 18px 18px / 42px 42px,
    var(--bg-card);
  font-weight: 900;
}

.auth-layout,
.confirmation-card {
  display: grid;
  place-items: center;
  min-height: 620px;
}

.auth-card {
  display: grid;
  gap: 12px;
  width: min(100%, 430px);
}

.auth-scene {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1fr);
  gap: 22px;
  align-items: stretch;
  max-width: 1180px;
  min-height: calc(100vh - 56px);
  margin: 0 auto;
}

.auth-visual,
.auth-stack .auth-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-visual {
  position: relative;
  display: grid;
  align-content: start;
  gap: 18px;
  overflow: hidden;
  padding: 28px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 52%),
    linear-gradient(320deg, color-mix(in srgb, var(--second) 20%, transparent), transparent 48%),
    var(--bg-card);
}

.auth-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  font-size: 28px;
  font-weight: 900;
}

.auth-logo-row img {
  border-radius: 12px;
}

.auth-visual h2 {
  max-width: 520px;
  margin: 0;
  font-size: 42px;
  line-height: 1.03;
}

.auth-visual p {
  max-width: 460px;
  margin-bottom: 0;
}

.auth-mini-map {
  position: relative;
  min-height: 280px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(35deg, transparent 48%, color-mix(in srgb, var(--border) 60%, transparent) 49%, transparent 51%),
    linear-gradient(145deg, transparent 48%, color-mix(in srgb, var(--border) 55%, transparent) 49%, transparent 51%),
    var(--bg-panel);
}

.auth-mini-map::before,
.auth-mini-map::after {
  content: "";
  position: absolute;
  border: 1px solid var(--border);
  border-radius: 42% 58% 50% 50%;
}

.auth-mini-map::before {
  inset: 18px 90px 74px 28px;
  transform: rotate(-13deg);
}

.auth-mini-map::after {
  inset: 88px 26px 30px 140px;
  transform: rotate(18deg);
}

.mini-pin {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 24px 24px 24px 6px;
  color: white;
  background: var(--accent);
  transform: rotate(-45deg);
  box-shadow: 0 14px 34px rgba(181, 72, 47, 0.24);
}

.mini-pin::first-letter {
  transform: rotate(45deg);
}

.pin-one {
  left: 48%;
  top: 24%;
  background: var(--error);
}

.pin-two {
  left: 22%;
  top: 56%;
}

.pin-three {
  right: 18%;
  top: 58%;
  background: var(--second);
}

.mini-card {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  backdrop-filter: blur(12px);
}

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

.mini-card small {
  margin-top: 4px;
  color: var(--text-secondary);
}

.auth-proof {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.auth-proof span {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-elevated) 86%, transparent);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.auth-proof strong {
  display: block;
  color: var(--text-primary);
  font-size: 22px;
}

.auth-stack {
  display: grid;
  gap: 16px;
  align-content: center;
}

.auth-stack .auth-card {
  width: 100%;
  padding: 22px;
  background: color-mix(in srgb, var(--bg-card) 96%, transparent);
}

.auth-card-primary {
  min-height: 0;
}

.auth-card-secondary {
  align-content: start;
}

.auth-subtitle {
  margin: -4px 0 6px;
  font-size: 14px;
}

.auth-link {
  justify-self: center;
  min-height: 34px;
}

.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  background: var(--bg-card);
  font-weight: 900;
}

.google-button span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #ffffff;
  background: #4285f4;
  font-size: 14px;
  font-weight: 900;
}

.auth-switch-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg-card) 82%, transparent);
  font-weight: 800;
}

.register-scene .auth-visual {
  min-height: 520px;
}

.confirmation-card {
  text-align: center;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  border-radius: 50%;
  color: white;
  background: var(--success);
  font-size: 34px;
  font-weight: 900;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--success);
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  min-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: 180ms ease;
}

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

.mobile-nav {
  display: none;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: 76px;
  }

  .side-nav {
    position: static;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .tabs {
    display: none;
  }

  .side-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 184px;
  }

  .workspace {
    padding: 18px;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 68px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
  }

  .mobile-tab {
    display: grid;
    place-items: center;
    gap: 2px;
    font-size: 19px;
  }

  .mobile-tab span {
    font-size: 11px;
    font-weight: 800;
  }
}

@media (max-width: 880px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .notifications-header,
  .notification-toolbar {
    align-items: stretch;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .notifications-actions,
  .notification-toolbar {
    display: grid;
  }

  .notifications-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .map-layout,
  .split-layout,
  .profile-layout,
  .pro-layout,
  .bar-detail,
  .messages-layout,
  .auth-scene {
    grid-template-columns: 1fr;
  }

  .map-panel {
    min-height: 680px;
  }

  .map-commandbar {
    align-items: stretch;
    flex-direction: column;
  }

  .map-summary {
    align-self: flex-start;
  }

  .map-feed {
    max-height: none;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .auth-scene {
    min-height: auto;
  }

  .auth-visual {
    padding: 22px;
  }

  .auth-visual h2 {
    font-size: 32px;
  }

  .auth-mini-map {
    min-height: 220px;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 14px;
  }

  .brand {
    font-size: 22px;
  }

  .side-actions {
    grid-template-columns: 42px 118px;
    width: 170px;
  }

  h1 {
    font-size: 25px;
  }

  .event-hero h2 {
    font-size: 29px;
  }

  .row-actions,
  .topbar-actions,
  .composer {
    grid-template-columns: 1fr;
  }

  .row-actions {
    display: grid;
  }

  .bottom-card,
  .map-sheet {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .map-panel {
    min-height: 760px;
  }

  .map-sheet {
    padding: 14px;
  }

  .map-sheet-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .map-sheet-header .pill {
    grid-column: 1 / -1;
    justify-self: flex-start;
  }

  .map-pill-row,
  .map-info-grid,
  .map-quick-actions,
  .map-metric,
  .map-feed-stats {
    grid-template-columns: 1fr;
  }

  .map-marker {
    width: 50px;
    height: 50px;
  }

  .map-marker.is-selected {
    width: 58px;
    height: 58px;
  }

  .auth-proof,
  .auth-card-secondary .form-grid {
    grid-template-columns: 1fr;
  }

  .auth-stack .auth-card {
    padding: 18px;
  }
}
