:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: rgba(12, 16, 27, 0.9);
  --panel-solid: #101522;
  --line: rgba(148, 163, 184, 0.17);
  --muted: #8d99ad;
  --text: #f6f8fc;
  --amber: #f59e0b;
  --orange: #f97316;
  --red: #ef4444;
  --green: #22c55e;
  --violet: #a855f7;
  --cyan: #22d3ee;
  --safe-top: max(12px, env(safe-area-inset-top));
  --safe-right: max(12px, env(safe-area-inset-right));
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
  --safe-left: max(12px, env(safe-area-inset-left));
}

* { box-sizing: border-box; }

html, body, #app, #map {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }

#app {
  position: relative;
  min-height: 100dvh;
  background: var(--bg);
}

#map {
  position: absolute;
  inset: 0;
  background: #090c13;
}

.leaflet-container { background: #090c13; }
.leaflet-control-attribution { display: none; }
.leaflet-tile-pane { filter: brightness(.72) saturate(.72) contrast(1.1); }

.top-shell {
  position: fixed;
  z-index: 1100;
  top: var(--safe-top);
  left: var(--safe-left);
  width: min(440px, calc(100vw - var(--safe-left) - var(--safe-right)));
  pointer-events: none;
}

.brand-row,
.status-row,
.filters { pointer-events: auto; }

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(10, 14, 23, .82);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: none;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 780;
  letter-spacing: -.01em;
}

.brand-mark {
  position: relative;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(168, 85, 247, .5);
  border-radius: 50%;
  box-shadow: inset 0 0 14px rgba(168, 85, 247, .16), 0 0 13px rgba(168, 85, 247, .16);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark i {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.brand-mark::before { inset: 5px; border: 1px solid rgba(168, 85, 247, .5); }
.brand-mark::after { width: 4px; height: 4px; left: 10px; top: 10px; background: #d8b4fe; box-shadow: 0 0 8px #a855f7; }
.brand-mark i { width: 2px; height: 2px; background: var(--amber); }
.brand-mark i:nth-child(1) { left: 4px; top: 7px; }
.brand-mark i:nth-child(2) { right: 4px; bottom: 6px; }
.brand-mark i:nth-child(3) { right: 6px; top: 4px; }

.connection {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 999px;
  background: rgba(148, 163, 184, .07);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.connection-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
}

.connection[data-state="live"] { color: #bbf7d0; border-color: rgba(34, 197, 94, .22); }
.connection[data-state="live"] .connection-dot { background: var(--green); box-shadow: 0 0 9px rgba(34, 197, 94, .9); }
.connection[data-state="offline"] { color: #fecaca; border-color: rgba(239, 68, 68, .28); background: rgba(127, 29, 29, .16); }
.connection[data-state="offline"] .connection-dot { background: var(--red); box-shadow: 0 0 9px rgba(239, 68, 68, .7); }
.connection[data-state="demo"] { color: #e9d5ff; border-color: rgba(168, 85, 247, .3); }
.connection[data-state="demo"] .connection-dot { background: var(--violet); box-shadow: 0 0 9px rgba(168, 85, 247, .8); }

.status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 0;
}

.status-card,
.updated-card {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 14, 23, .84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
}

.status-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.status-card-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.status-card-icon img {
  display: block;
  width: 28px;
  height: 28px;
  filter: brightness(0) saturate(100%) invert(55%) sepia(97%) saturate(1826%) hue-rotate(349deg) brightness(103%) contrast(95%) drop-shadow(0 0 5px rgba(249, 115, 22, .72));
}

.status-card b,
.status-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-card b { font-size: 14px; }
.status-card small { margin-top: 2px; color: #b6c0d1; font-size: 11px; }
.chevron { color: #8c98ac; font-size: 23px; text-align: right; }

.updated-card {
  display: grid;
  min-width: 106px;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 5px;
  padding: 6px 7px 6px 10px;
}

.updated-copy { min-width: 0; }
.updated-copy small, .updated-copy b { display: block; white-space: nowrap; }
.updated-copy small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.updated-copy b { margin-top: 3px; font-size: 12px; }

.batch-clock {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fb7185;
}

.batch-clock svg {
  position: absolute;
  inset: 0;
  width: 30px;
  height: 30px;
  overflow: visible;
  transform: rotate(-90deg);
}

.batch-clock circle { fill: none; stroke-width: 2.3; }
.batch-clock-bg { stroke: rgba(239, 68, 68, .18); }
.batch-clock-progress {
  stroke: #ef4444;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 0 3px rgba(239, 68, 68, .65));
  transition: stroke-dashoffset .35s linear;
}

.batch-clock > b {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fb7185;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  line-height: 1;
}

.filters {
  display: flex;
  gap: 7px;
  margin-top: 8px;
  padding-bottom: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar { display: none; }

.filter-chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 14, 23, .82);
  color: #b8c2d2;
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.filter-chip span { margin-left: 4px; color: #768399; font-size: 11px; }
.filter-chip.active { border-color: rgba(245, 158, 11, .48); background: rgba(120, 66, 8, .35); color: #ffdfa1; }
.filter-chip.active span { color: #fbbf24; }

.filter-chip.is-updated,
.summary-metric.is-updated {
  animation: mini-count-pop 680ms cubic-bezier(.16,.86,.25,1.2) both;
}

.updated-card.is-fresh {
  animation: mini-fresh-pulse 1.1s ease-out both;
}

.preview-label {
  position: fixed;
  z-index: 1090;
  top: calc(var(--safe-top) + 2px);
  right: var(--safe-right);
  padding: 5px 8px;
  border: 1px solid rgba(168, 85, 247, .2);
  border-radius: 7px;
  background: rgba(15, 17, 26, .6);
  color: rgba(216, 180, 254, .6);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
}

.map-actions {
  position: fixed;
  z-index: 1050;
  right: var(--safe-right);
  top: 50%;
  display: grid;
  gap: 8px;
  transform: translateY(-50%);
}

.map-actions button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(10, 14, 23, .86);
  color: #d5deeb;
  box-shadow: 0 8px 25px rgba(0, 0, 0, .28);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
}

.map-actions svg { width: 20px; height: 20px; fill: currentColor; }

.profile-card {
  position: fixed;
  z-index: 1150;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 106px);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto 42px 12px;
  align-items: center;
  gap: 11px;
  width: min(560px, calc(100vw - var(--safe-left) - var(--safe-right)));
  min-height: 70px;
  padding: 10px 13px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 20px;
  background: linear-gradient(105deg, rgba(10, 14, 24, .96), rgba(12, 17, 29, .91));
  color: var(--text);
  box-shadow: 0 16px 46px rgba(0, 0, 0, .5), inset 0 1px rgba(255, 255, 255, .025);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transform: translateX(-50%);
  transition: opacity .2s ease, transform .22s ease, border-color .2s ease;
  cursor: pointer;
  text-align: left;
}

.profile-card:hover,
.profile-card:focus-visible { border-color: rgba(245, 158, 11, .46); outline: 0; }

.map-sheet-open .profile-card {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
}
.profile-open .profile-card {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
}

.profile-identicon {
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid rgba(168, 85, 247, .42);
  border-radius: 50%;
  background: #0c101b;
  box-shadow: 0 0 18px rgba(168, 85, 247, .2);
}

.profile-identicon svg { display: block; width: 100%; height: 100%; }
.profile-identicon--compact { width: 48px; height: 48px; }
.profile-identicon--large { width: 64px; height: 64px; }

.profile-card__identity,
.profile-card__points { min-width: 0; }
.profile-card__identity b,
.profile-card__identity small,
.profile-card__points b,
.profile-card__points small { display: block; }
.profile-card__identity > b {
  overflow: hidden;
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-card__identity small {
  width: max-content;
  margin-top: 5px;
  padding: 3px 7px;
  border: 1px solid rgba(168, 85, 247, .34);
  border-radius: 999px;
  background: rgba(104, 46, 151, .18);
  color: #a855f7;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
}
.profile-card__points {
  padding-left: 12px;
  border-left: 1px solid rgba(148, 163, 184, .17);
  text-align: center;
}
.profile-card__points b { font-size: 19px; line-height: 1; }
.profile-card__points small { margin-top: 4px; color: #8f9aaf; font-size: 10px; }
.profile-card__rank { color: #b7c0d0; font-size: 13px; white-space: nowrap; }
.profile-card__rank small,
.profile-card__rank b { display: block; }
.profile-card__rank small { color: #7f8ba0; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.profile-card__rank b { margin-top: 3px; color: #f5f7fb; font-size: 13px; }
.profile-card__trophy {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(245, 158, 11, .54);
  border-radius: 12px;
  color: #f59e0b;
  font-size: 20px;
}
.profile-card__trophy svg { width: 21px; height: 21px; fill: currentColor; }
.profile-card__chevron { color: #8f9bae; font-size: 24px; }

.profile-overlay {
  position: fixed;
  z-index: 1700;
  inset: 0;
  pointer-events: none;
  visibility: hidden;
}
.profile-overlay[data-open="true"] { pointer-events: auto; visibility: visible; }
.profile-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 5, 10, .64);
  opacity: 0;
  transition: opacity .24s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.profile-overlay[data-open="true"] .profile-backdrop { opacity: 1; }
.profile-dialog {
  position: absolute;
  left: 50%;
  bottom: var(--safe-bottom);
  width: min(620px, calc(100vw - var(--safe-left) - var(--safe-right)));
  max-height: min(82dvh, 690px);
  overflow-y: auto;
  padding: 25px 16px 16px;
  border: 1px solid rgba(148, 163, 184, .23);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(13, 18, 30, .985), rgba(7, 11, 19, .985));
  box-shadow: 0 22px 80px rgba(0, 0, 0, .68);
  opacity: 0;
  transform: translate(-50%, 35px);
  transition: opacity .22s ease, transform .28s cubic-bezier(.2, .8, .2, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, .25) transparent;
  isolation: isolate;
}
.profile-overlay[data-open="true"] .profile-dialog { opacity: 1; transform: translate(-50%, 0); }
.profile-dialog__handle {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .34);
  transform: translateX(-50%);
}
.profile-dialog__header {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 38px;
  gap: 13px;
  align-items: center;
}
.profile-dialog__identity { min-width: 0; }
.profile-dialog__identity small {
  display: block;
  color: #8d99ad;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .11em;
}
.profile-dialog__identity h2 {
  overflow: hidden;
  margin: 4px 0 3px;
  font-size: 21px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-dialog__identity > span { color: #a7b1c2; font-size: 12px; }
.profile-dialog__identity > span b { color: #a855f7; }
.profile-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 12px;
  background: rgba(148, 163, 184, .07);
  color: #aab5c7;
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 16px;
  background: rgba(148, 163, 184, .045);
}
.profile-stats > div { padding: 13px 8px; text-align: center; }
.profile-stats > div + div { border-left: 1px solid rgba(148, 163, 184, .13); }
.profile-stats small { display: block; color: #7f8ba0; font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.profile-stats b { display: block; margin-top: 5px; color: #f8fafc; font-size: 18px; }
.profile-stats > div:first-child b { color: #fbbf24; }
.profile-progress {
  margin-top: 13px;
  padding: 13px;
  border-radius: 15px;
  background: rgba(148, 163, 184, .05);
}
.profile-progress > span { display: flex; justify-content: space-between; color: #cbd3df; font-size: 11px; }
.profile-progress small { color: #8f9aaf; }
.profile-progress > i {
  display: block;
  height: 5px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, .14);
}
.profile-progress > i > b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b, #fb7185 56%, #a855f7);
  box-shadow: 0 0 10px rgba(168, 85, 247, .45);
  transition: width .4s ease;
}
.profile-nickname-form {
  margin-top: 13px;
  padding: 13px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 15px;
}
.profile-nickname-form label { display: block; margin-bottom: 8px; color: #aeb8c8; font-size: 11px; font-weight: 750; }
.profile-nickname-form > span { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.profile-nickname-form input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, .19);
  border-radius: 11px;
  outline: 0;
  background: rgba(2, 6, 12, .62);
  color: #f8fafc;
  font-size: 14px;
}
.profile-nickname-form input:focus { border-color: rgba(168, 85, 247, .56); }
.profile-nickname-form button {
  padding: 0 14px;
  border: 1px solid rgba(168, 85, 247, .48);
  border-radius: 11px;
  background: rgba(168, 85, 247, .18);
  color: #f8fafc;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.profile-nickname-form > small { display: block; margin-top: 8px; color: #6f7c91; font-size: 10px; line-height: 1.35; }
.profile-nickname-status[data-state="loading"] { color: #94a3b8; }
.profile-nickname-status[data-state="success"] { color: #22c55e; }
.profile-nickname-status[data-state="error"] { color: #fb7185; }
.profile-nickname-form input[aria-invalid="true"] { border-color: rgba(251, 113, 133, .72); }

.game-preview {
  margin-top: 13px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 15px;
  background: rgba(148, 163, 184, .035);
}
.game-preview > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.game-preview > header span,
.game-preview > header b,
.game-preview > header small { display: block; }
.game-preview > header b { color: #f8fafc; font-size: 10px; letter-spacing: .1em; }
.game-preview > header small { margin-top: 3px; color: #7f8ba0; font-size: 9px; }
.game-preview > header button {
  padding: 6px 9px;
  border: 1px solid rgba(34, 211, 238, .32);
  border-radius: 9px;
  background: rgba(34, 211, 238, .08);
  color: #22d3ee;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
}
.game-preview > header button:disabled { opacity: .48; cursor: wait; }
.game-preview__items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.game-preview__items article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--game-color) 35%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--game-color) 7%, transparent);
}
.game-preview__items img { width: 34px; height: 34px; object-fit: contain; }
.game-preview__items span,
.game-preview__items b,
.game-preview__items small { display: block; min-width: 0; }
.game-preview__items b { overflow: hidden; color: #f8fafc; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.game-preview__items small { margin-top: 3px; color: var(--game-color); font-size: 8px; line-height: 1.25; }

.game-point-marker { border: 0; background: transparent; }
.game-point {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--game-size);
  height: var(--game-size);
  cursor: pointer;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .58));
  animation: game-point-float 2.8s ease-in-out infinite;
}
.game-point > i {
  position: absolute;
  inset: 5%;
  border: 2px solid var(--game-color);
  border-radius: 50%;
  background: color-mix(in srgb, var(--game-color) 8%, rgba(7, 10, 17, .84));
  box-shadow: 0 0 14px color-mix(in srgb, var(--game-color) 46%, transparent);
  animation: game-point-pulse 2.2s ease-out infinite;
}
.game-point img {
  position: relative;
  z-index: 1;
  width: var(--game-art-size) !important;
  height: var(--game-art-size) !important;
  max-width: var(--game-art-size) !important;
  max-height: var(--game-art-size) !important;
  object-fit: contain;
}
.game-point > b {
  position: absolute;
  z-index: 2;
  right: -4px;
  bottom: -2px;
  min-width: 23px;
  padding: 3px 5px;
  border: 1px solid var(--game-color);
  border-radius: 999px;
  background: #080b12;
  color: #f8fafc;
  font-size: 9px;
  line-height: 1;
  text-align: center;
}
.game-point--oil { animation-delay: -.7s; }
.game-point--berries { animation-delay: -1.4s; }
.game-point.is-claiming { opacity: .55; pointer-events: none; animation-duration: .6s; }

.game-point-toast {
  position: fixed;
  z-index: 2200;
  top: max(112px, calc(env(safe-area-inset-top) + 74px));
  left: 50%;
  display: grid;
  grid-template-columns: 42px auto;
  align-items: center;
  gap: 9px;
  min-width: 154px;
  padding: 8px 13px 8px 9px;
  border: 1px solid var(--game-color);
  border-radius: 15px;
  background: rgba(8, 11, 18, .96);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .5), 0 0 22px color-mix(in srgb, var(--game-color) 24%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px) scale(.94);
  transition: opacity .2s ease, transform .25s ease;
}
.game-point-toast.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
.game-point-toast img { width: 42px; height: 42px; object-fit: contain; }
.game-point-toast span,
.game-point-toast small,
.game-point-toast b { display: block; }
.game-point-toast small { color: var(--game-color); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.game-point-toast b { margin-top: 3px; color: #f8fafc; font-size: 14px; }

@keyframes game-point-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes game-point-pulse {
  0% { opacity: .9; transform: scale(.86); }
  65%, 100% { opacity: 0; transform: scale(1.35); }
}
.profile-leaderboard {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  margin-top: 13px;
  padding: 9px 12px;
  border: 1px solid rgba(245, 158, 11, .25);
  border-radius: 15px;
  background: rgba(245, 158, 11, .07);
  color: #f8fafc;
  text-align: left;
  cursor: pointer;
}
.profile-leaderboard > span:first-child { display: grid; place-items: center; color: #f59e0b; }
.profile-leaderboard > span:first-child svg { width: 23px; height: 23px; fill: currentColor; }
.profile-leaderboard b,
.profile-leaderboard small { display: block; }
.profile-leaderboard b { font-size: 13px; }
.profile-leaderboard small { margin-top: 3px; color: #939fb1; font-size: 10px; }
.profile-leaderboard > span:last-child { color: #8d99ad; font-size: 22px; }
.profile-preview-note {
  margin: 11px 2px 0;
  color: #69768b;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

.leaderboard-panel {
  position: absolute;
  z-index: 8;
  inset: 0;
  min-height: 100%;
  overflow-y: auto;
  padding: 24px 16px 16px;
  border-radius: inherit;
  background: linear-gradient(155deg, #0d121e, #070b13);
}
.leaderboard-header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}
.leaderboard-header > button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 12px;
  background: rgba(148, 163, 184, .07);
  color: #f8fafc;
  cursor: pointer;
  font-size: 29px;
  line-height: 1;
}
.leaderboard-header small,
.leaderboard-header h3 { display: block; margin: 0; }
.leaderboard-header small { color: #94a3b8; font-size: 9px; font-weight: 850; letter-spacing: .11em; }
.leaderboard-header h3 { margin-top: 3px; color: #f8fafc; font-size: 21px; }
.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 16px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 13px;
  background: rgba(148, 163, 184, .04);
}
.leaderboard-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}
.leaderboard-tabs button.active {
  background: rgba(245, 158, 11, .14);
  color: #f59e0b;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .32);
}
.leaderboard-rows { margin-top: 12px; }
.leaderboard-row {
  display: grid;
  grid-template-columns: 27px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, .11);
}
.leaderboard-row.is-me {
  border: 1px solid rgba(34, 211, 238, .28);
  border-radius: 13px;
  background: rgba(34, 211, 238, .06);
}
.leaderboard-position { color: #94a3b8; font-size: 13px; text-align: center; }
.leaderboard-row:nth-child(1) .leaderboard-position { color: #facc15; }
.leaderboard-row:nth-child(2) .leaderboard-position { color: #94a3b8; }
.leaderboard-row:nth-child(3) .leaderboard-position { color: #f59e0b; }
.leaderboard-avatar {
  display: block;
  overflow: hidden;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}
.leaderboard-avatar svg { display: block; width: 100%; height: 100%; }
.leaderboard-name,
.leaderboard-name b,
.leaderboard-name small,
.leaderboard-row > strong,
.leaderboard-row > strong small { display: block; min-width: 0; }
.leaderboard-name b {
  overflow: hidden;
  color: #f8fafc;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard-name small { margin-top: 3px; color: #7f8ba0; font-size: 9px; }
.leaderboard-row > strong { color: #f59e0b; font-size: 13px; text-align: right; }
.leaderboard-row > strong small { margin-top: 2px; color: #7f8ba0; font-size: 8px; font-weight: 700; }
.leaderboard-empty {
  margin: 26px 0;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}
.leaderboard-current {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 13px;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, .25);
  border-radius: 14px;
  background: rgba(168, 85, 247, .06);
}
.leaderboard-current > span { padding: 11px; text-align: center; }
.leaderboard-current > span + span { border-left: 1px solid rgba(168, 85, 247, .18); }
.leaderboard-current small,
.leaderboard-current b { display: block; }
.leaderboard-current small { color: #94a3b8; font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.leaderboard-current b { margin-top: 4px; color: #f8fafc; font-size: 14px; }

.bottom-sheet {
  position: fixed;
  z-index: 1200;
  left: 50%;
  bottom: var(--safe-bottom);
  width: min(620px, calc(100vw - var(--safe-left) - var(--safe-right)));
  max-height: min(68dvh, 620px);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 22px;
  background: rgba(10, 14, 23, .93);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .48);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transform: translateX(-50%);
  transition: max-height .28s ease, border-radius .28s ease;
}

.sheet-summary {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 82px;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 13px;
  padding: 19px 16px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.drag-handle {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 34px;
  height: 4px;
  border-radius: 99px;
  background: rgba(148, 163, 184, .35);
  transform: translateX(-50%);
}

.summary-copy { min-width: 0; }
.summary-copy small,
.summary-copy strong,
.summary-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-copy small { color: #8793a8; font-size: 9px; font-weight: 800; letter-spacing: .11em; }
.summary-copy strong { margin-top: 4px; font-size: 16px; line-height: 1.2; }
.summary-copy span { margin-top: 4px; color: #97a3b7; font-size: 12px; }

.summary-metric { display: flex; align-items: baseline; gap: 5px; }
.summary-metric b { color: #fbbf24; font-size: 27px; line-height: 1; }
.summary-metric small { color: #9aa5b8; font-size: 11px; }
.sheet-chevron { color: #8c98ac; transform: rotate(0); transition: transform .25s ease; }

.sheet-expanded {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .3s ease, opacity .2s ease;
}

.bottom-sheet[data-open="true"] .sheet-expanded { max-height: calc(min(68dvh, 620px) - 82px); opacity: 1; }
.bottom-sheet[data-open="true"] .sheet-chevron { transform: rotate(180deg); }

.sheet-tabs {
  display: flex;
  gap: 4px;
  padding: 0 12px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, .13);
}

.sheet-tab {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8895aa;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.sheet-tab.active { background: rgba(148, 163, 184, .1); color: #f8fafc; }

.sheet-content {
  max-height: calc(min(68dvh, 620px) - 142px);
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, .3) transparent;
}

.section-label {
  margin: 5px 4px 8px;
  color: #818da1;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.target-row,
.alert-row,
.about-card,
.empty-card,
.target-detail {
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 14px;
  background: rgba(148, 163, 184, .055);
}

.target-row {
  display: grid;
  width: 100%;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 10px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.target-row:last-child { margin-bottom: 0; }
.type-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(245, 158, 11, .1); }
.type-icon img { width: 24px; height: 24px; }
.type-icon.drone img { filter: brightness(0) saturate(100%) invert(69%) sepia(83%) saturate(1350%) hue-rotate(355deg); }
.type-icon.recon img { filter: brightness(0) saturate(100%) invert(75%) sepia(95%) saturate(1060%) hue-rotate(2deg); }
.type-icon.missile { background: rgba(239, 68, 68, .1); }
.type-icon.missile img { filter: brightness(0) saturate(100%) invert(41%) sepia(84%) saturate(2470%) hue-rotate(336deg); }
.type-icon.ballistic { background: rgba(168, 85, 247, .1); }
.type-icon.ballistic img { filter: brightness(0) saturate(100%) invert(53%) sepia(99%) saturate(2590%) hue-rotate(246deg); }
.type-icon.kab { background: rgba(251, 113, 133, .1); }
.type-icon.kab img { filter: brightness(0) saturate(100%) invert(63%) sepia(55%) saturate(1850%) hue-rotate(305deg); }
.type-icon.aviation { background: rgba(56, 189, 248, .1); }
.type-icon.aviation img { filter: brightness(0) saturate(100%) invert(71%) sepia(80%) saturate(1450%) hue-rotate(166deg); }
.type-icon.unknown { background: rgba(148, 163, 184, .1); }
.type-icon.unknown img { filter: brightness(0) saturate(100%) invert(72%) sepia(13%) saturate(450%) hue-rotate(176deg); }
.type-icon.hypersonic { background: rgba(34, 211, 238, .1); }
.type-icon.hypersonic img { filter: brightness(0) saturate(100%) invert(79%) sepia(86%) saturate(1440%) hue-rotate(145deg); }

.target-copy { min-width: 0; }
.target-copy b, .target-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-copy b { font-size: 14px; }
.target-copy span { margin-top: 4px; color: #9ba6b9; font-size: 12px; }
.target-age { color: #7f8b9f; font-size: 11px; }

.alert-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  margin-bottom: 7px;
  padding: 11px 12px;
}

.alert-row:last-child { margin-bottom: 0; }
.alert-row-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 8px rgba(249, 115, 22, .65); }
.alert-row.partial .alert-row-dot { background: #fbbf24; box-shadow: none; }
.alert-row-copy { min-width: 0; }
.alert-row b { display: block; font-size: 13px; }
.alert-row small { display: block; margin-top: 3px; color: #8f9aae; font-size: 11px; }
.alert-row .alert-row-districts {
  margin-top: 6px;
  color: #c3ccda;
  font-size: 11px;
  line-height: 1.45;
}
.alert-row-districts span { color: #fbbf24; font-weight: 800; }
.alert-row .alert-row-time { margin-top: 5px; }
.alert-row-status { margin-top: 1px; color: #fbbf24; font-size: 10px; font-weight: 800; text-transform: uppercase; }

.about-card,
.empty-card,
.target-detail { padding: 14px; }
.about-card + .about-card { margin-top: 8px; }
.about-card h3, .target-detail h3 { margin: 0 0 7px; font-size: 14px; }
.about-card p, .target-detail p, .empty-card { margin: 0; color: #a6b0c1; font-size: 13px; line-height: 1.5; }

.detail-head { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 11px; align-items: center; }
.detail-head .type-icon { width: 48px; height: 48px; }
.detail-head h3 { font-size: 17px; margin: 0; }
.detail-head p { margin-top: 3px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.detail-cell { padding: 10px; border-radius: 11px; background: rgba(148, 163, 184, .065); }
.detail-cell small { display: block; color: #7e8a9e; font-size: 10px; text-transform: uppercase; }
.detail-cell b { display: block; margin-top: 4px; font-size: 13px; }
.detail-note { margin-top: 11px !important; padding-top: 11px; border-top: 1px solid rgba(148, 163, 184, .12); }

.custom-target-marker {
  background: transparent;
  border: 0;
  transition: transform .62s cubic-bezier(.22,.8,.22,1);
}
.target-marker {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.target-marker.is-new::before,
.target-marker.is-new::after {
  position: absolute;
  z-index: -1;
  width: 34px;
  height: 34px;
  border: 2px solid var(--marker-color);
  border-radius: 50%;
  content: "";
  opacity: 0;
  transform: scale(.42);
  animation: mini-target-arrival 2.25s ease-out both;
}

.target-marker.is-new::after { animation-delay: .3s; }

.target-marker img {
  width: 31px;
  height: 31px;
  filter: var(--marker-filter);
  transform-origin: center;
}

.operational-marker-host {
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
}

.operational-marker {
  --op-color: #ef4444;
  --op-filter: brightness(0) saturate(100%) invert(42%) sepia(97%) saturate(3116%) hue-rotate(337deg) brightness(99%);
  position: relative;
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  isolation: isolate;
}

.operational-marker--strategic_aviation {
  --op-color: #38bdf8;
  --op-filter: brightness(0) saturate(100%) invert(72%) sepia(93%) saturate(1884%) hue-rotate(166deg) brightness(101%);
}

.operational-marker__ring {
  position: absolute;
  z-index: -2;
  width: 64px;
  height: 64px;
  border: 2px solid var(--op-color);
  border-radius: 50%;
  opacity: 0;
  animation: operational-map-ring 2.8s ease-out infinite;
}

.operational-marker__ring--two { animation-delay: 1.15s; }

.operational-marker__icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 0;
  background: transparent;
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--op-color) 72%, transparent));
  animation: operational-map-breathe 1.85s ease-in-out infinite;
}

.operational-marker__icon img {
  width: 64px;
  height: 64px;
  filter: var(--op-filter) drop-shadow(0 0 10px var(--op-color));
}

.operational-marker__label {
  position: absolute;
  top: 101px;
  left: 50%;
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: 210px;
  padding: 4px 7px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: white;
  text-align: center;
  transform: translateX(-50%);
}

.operational-marker__label b {
  color: color-mix(in srgb, var(--op-color) 78%, white);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .055em;
  line-height: 1.15;
  text-shadow: 0 2px 5px #000, 0 0 10px #000;
}

.operational-marker__label small {
  overflow: hidden;
  color: #c5cfdd;
  font-size: 9px;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-shadow: 0 2px 5px #000, 0 0 9px #000;
  white-space: nowrap;
}

@keyframes operational-map-ring {
  0% { opacity: 0; transform: scale(.58); }
  15% { opacity: .9; }
  100% { opacity: 0; transform: scale(1.9); }
}

@keyframes operational-map-breathe {
  0%, 100% { transform: scale(.97); filter: brightness(.98); }
  50% { transform: scale(1.04); filter: brightness(1.22); }
}

.marker-cluster-custom { background: transparent !important; }
.cluster-circle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  color: white;
  box-shadow: 0 0 15px rgba(239, 68, 68, .6);
  font-size: 14px;
  font-weight: 700;
}

.cluster-circle.is-new::before,
.cluster-circle.is-new::after {
  position: absolute;
  z-index: -1;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(245, 158, 11, .92);
  border-radius: 50%;
  content: "";
  opacity: 0;
  transform: scale(.44);
  animation: mini-target-arrival 2.25s ease-out both;
}

.cluster-circle.is-new::after { animation-delay: .3s; }

.leaflet-interactive.mini-alert-pulse {
  animation: mini-alert-pulse 2.4s ease-out both;
}

@keyframes mini-target-arrival {
  0% { opacity: 0; transform: scale(.42); }
  17% { opacity: .92; }
  100% { opacity: 0; transform: scale(2.1); }
}

@keyframes mini-count-pop {
  0% { filter: brightness(1); transform: scale(1); }
  38% { filter: brightness(1.45); transform: scale(1.12); }
  100% { filter: brightness(1); transform: scale(1); }
}

@keyframes mini-fresh-pulse {
  0% { box-shadow: 0 0 0 rgba(34, 211, 238, 0); }
  25% { box-shadow: 0 0 0 1px rgba(34, 211, 238, .72), 0 0 18px rgba(34, 211, 238, .28); }
  100% { box-shadow: 0 0 0 rgba(34, 211, 238, 0); }
}

@keyframes mini-alert-pulse {
  0%, 100% { filter: brightness(1); }
  22% { filter: brightness(1.85) drop-shadow(0 0 7px rgba(251, 191, 36, .72)); }
  55% { filter: brightness(1.04); }
  76% { filter: brightness(1.38) drop-shadow(0 0 4px rgba(251, 191, 36, .42)); }
}

.cluster-circle.cluster-circle--pie {
  position: relative;
  width: 42px;
  height: 42px;
  overflow: visible;
  border: 0;
  background: none;
  box-shadow: none;
  isolation: isolate;
}

.cluster-circle__glow,
.cluster-circle__face {
  position: absolute;
  border-radius: 50%;
  background: var(--cluster-pie);
}

.cluster-circle__glow {
  inset: -3px;
  z-index: -2;
  opacity: .42;
  filter: blur(8px);
}

.cluster-circle__face {
  inset: 1px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .12),
    inset 0 0 10px rgba(255, 255, 255, .08);
}

.cluster-circle--pie b {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #17202e, #070a10 72%);
  color: #fff;
  box-shadow:
    0 2px 7px rgba(0, 0, 0, .75),
    inset 0 0 7px rgba(255, 255, 255, .04);
  font-size: 12px;
  line-height: 1;
  text-shadow: 0 1px 2px #000;
}

@media (max-width: 720px) {
  .top-shell { right: var(--safe-right); width: auto; }
  .preview-label { display: none; }
  .brand-row { margin-right: 0; }
  .updated-card { min-width: 106px; }
  .map-actions { top: 54%; }
  .bottom-sheet { border-radius: 20px; }
  .operational-marker { transform: scale(.82); }
  .operational-marker__label { max-width: 165px; }
  .operational-marker--ballistic .operational-marker__label,
  .operational-marker--strategic_aviation .operational-marker__label { left: 50%; }
}

@media (max-width: 430px) {
  .profile-card {
    grid-template-columns: 42px minmax(0, 1fr) auto auto 36px 10px;
    gap: 8px;
    min-height: 64px;
    padding: 8px 10px;
    border-radius: 18px;
  }
  .profile-identicon--compact { width: 42px; height: 42px; }
  .profile-card__identity > b { font-size: 14px; }
  .profile-card__points { padding-left: 9px; }
  .profile-card__points b { font-size: 17px; }
  .profile-card__rank { font-size: 11px; }
  .profile-card__trophy { width: 34px; height: 34px; }
  .profile-stats { grid-template-columns: 1fr 1fr; }
  .profile-stats > div:nth-child(3) { border-left: 0; border-top: 1px solid rgba(148, 163, 184, .13); }
  .profile-stats > div:nth-child(4) { border-top: 1px solid rgba(148, 163, 184, .13); }
}

@media (min-width: 721px) {
  .top-shell { top: 20px; left: 20px; }
  .bottom-sheet { left: auto; right: 20px; bottom: 20px; width: 420px; transform: none; }
  .map-actions { right: 20px; top: 50%; }
  .profile-card { left: 20px; bottom: 20px; width: 440px; transform: none; }
  .map-sheet-open .profile-card { transform: translateY(12px); }
  .profile-open .profile-card { transform: translateY(12px); }
}

@media (max-height: 690px) {
  .status-row { grid-template-columns: minmax(0, 1fr) auto; }
  .updated-card { display: grid; }
  .filters { margin-top: 6px; }
  .bottom-sheet { max-height: 72dvh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Unified dock v1: compact status rail and one lower control surface. */
.unified-dock-preview .top-shell {
  width: min(560px, calc(100vw - var(--safe-left) - var(--safe-right)));
}

.unified-dock-preview .status-row {
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 14px;
  background: rgba(8, 12, 20, .9);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .26);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.unified-dock-preview .status-card,
.unified-dock-preview .updated-card {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.unified-dock-preview .status-card {
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 7px;
  padding: 6px 9px;
}

.unified-dock-preview .status-card-icon,
.unified-dock-preview .status-card-icon img {
  width: 25px;
  height: 25px;
}

.unified-dock-preview .status-card b { font-size: 13px; }
.unified-dock-preview .status-card small { font-size: 10px; }
.unified-dock-preview .status-card .chevron { display: none; }

.unified-dock-preview .updated-card {
  min-width: 130px;
  padding: 5px 7px 5px 11px;
  border-left: 1px solid rgba(148, 163, 184, .16);
}

.unified-dock-preview .bottom-sheet {
  width: min(560px, calc(100vw - var(--safe-left) - var(--safe-right)));
  max-height: min(72dvh, 660px);
  padding: 7px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(8, 12, 21, .97), rgba(12, 17, 28, .94));
}

.unified-dock-preview .bottom-sheet > .filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 12px;
  background: rgba(5, 9, 16, .46);
}

.unified-dock-preview .bottom-sheet > .filters .filter-chip {
  min-width: 0;
  min-height: 35px;
  padding: 0 5px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid rgba(148, 163, 184, .14);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #aab4c5;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unified-dock-preview .bottom-sheet > .filters .filter-chip:last-child { border-right: 0; }
.unified-dock-preview .bottom-sheet > .filters .filter-chip span { font-size: 10px; }
.unified-dock-preview .bottom-sheet > .filters .filter-chip.active {
  background: linear-gradient(180deg, rgba(129, 70, 8, .5), rgba(91, 49, 6, .34));
  color: #ffdda0;
}

.unified-dock-preview .sheet-summary {
  min-height: 61px;
  margin-top: 7px;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 12px;
  background: rgba(8, 12, 21, .64);
}

.unified-dock-preview .drag-handle { display: none; }
.unified-dock-preview .summary-copy small { font-size: 8px; }
.unified-dock-preview .summary-copy strong { margin-top: 3px; font-size: 13px; }
.unified-dock-preview .summary-copy span { margin-top: 3px; font-size: 10.5px; }
.unified-dock-preview .summary-metric b { font-size: 25px; }
.unified-dock-preview .summary-metric small { font-size: 10px; }
.unified-dock-preview .sheet-chevron { font-size: 14px; }

.unified-dock-preview .bottom-sheet > .profile-card {
  position: relative;
  z-index: 1;
  left: auto;
  bottom: auto;
  width: 100%;
  min-height: 57px;
  margin-top: 7px;
  padding: 7px 10px;
  grid-template-columns: 40px minmax(0, 1fr) auto auto 34px 9px;
  gap: 8px;
  border-color: rgba(148, 163, 184, .18);
  border-radius: 12px;
  background: rgba(8, 12, 21, .7);
  box-shadow: none;
  transform: none;
}

.unified-dock-preview .bottom-sheet > .profile-card[hidden] { display: none; }
.unified-dock-preview .profile-identicon--compact { width: 40px; height: 40px; }
.unified-dock-preview .profile-card__identity > b { font-size: 13px; }
.unified-dock-preview .profile-card__identity small { margin-top: 3px; font-size: 8px; }
.unified-dock-preview .profile-card__points { padding-left: 9px; }
.unified-dock-preview .profile-card__points b { font-size: 17px; }
.unified-dock-preview .profile-card__points small { margin-top: 2px; font-size: 9px; }
.unified-dock-preview .profile-card__rank {
  min-width: 42px;
  padding-left: 8px;
  border-left: 1px solid rgba(148, 163, 184, .17);
  text-align: center;
}
.unified-dock-preview .profile-card__rank small { font-size: 7px; }
.unified-dock-preview .profile-card__rank b { margin-top: 2px; font-size: 12px; }
.unified-dock-preview .profile-card__trophy { width: 32px; height: 32px; border-radius: 10px; }
.unified-dock-preview .profile-card__trophy svg { width: 18px; height: 18px; }
.unified-dock-preview .profile-card__chevron { font-size: 19px; }

.unified-dock-preview.map-sheet-open .bottom-sheet > .filters,
.unified-dock-preview.map-sheet-open .bottom-sheet > .profile-card,
.unified-dock-preview.profile-open .bottom-sheet > .profile-card {
  display: none;
}

.unified-dock-preview .bottom-sheet[data-open="true"] .sheet-summary { margin-top: 0; }
.unified-dock-preview .bottom-sheet[data-open="true"] .sheet-expanded {
  max-height: calc(min(72dvh, 660px) - 70px);
}

@media (min-width: 721px) {
  .unified-dock-preview .bottom-sheet {
    left: auto;
    right: 20px;
    bottom: 20px;
    width: 440px;
    transform: none;
  }
}

@media (max-width: 430px) {
  .unified-dock-preview .bottom-sheet > .profile-card {
    grid-template-columns: 38px minmax(0, 1fr) auto auto 32px 9px;
    min-height: 55px;
    padding: 7px 8px;
  }
  .unified-dock-preview .profile-identicon--compact { width: 38px; height: 38px; }
  .unified-dock-preview .profile-card__identity > b { font-size: 12px; }
  .unified-dock-preview .profile-card__rank { min-width: 39px; padding-left: 6px; }
  .unified-dock-preview .profile-card__rank b { font-size: 11px; }
  .unified-dock-preview .profile-card__trophy { width: 30px; height: 30px; }
}

/* Direct browser view: keep the controls on one left-hand rail. */
@media (min-width: 721px) {
  .web-viewer {
    --web-panel-left: max(20px, env(safe-area-inset-left));
    --web-panel-width: clamp(320px, 30vw, 440px);
    --web-sheet-height: min(72dvh, calc(100dvh - 152px), 660px);
  }

  .web-viewer .top-shell {
    left: var(--web-panel-left);
    right: auto;
    width: var(--web-panel-width);
  }

  .web-viewer .bottom-sheet {
    left: var(--web-panel-left);
    right: auto;
    bottom: max(20px, env(safe-area-inset-bottom));
    width: var(--web-panel-width);
    max-height: var(--web-sheet-height);
    transform: none;
  }

  .web-viewer .bottom-sheet[data-open="true"] .sheet-expanded {
    max-height: calc(var(--web-sheet-height) - 70px);
  }

  .web-viewer .map-actions {
    left: var(--web-panel-left);
    right: auto;
    top: 80px;
    display: flex;
    transform: none;
  }

  .web-viewer .profile-dialog {
    left: var(--web-panel-left);
    bottom: max(20px, env(safe-area-inset-bottom));
    width: min(520px, calc(100vw - 40px));
    transform: translateY(35px);
  }

  .web-viewer .profile-overlay[data-open="true"] .profile-dialog {
    transform: translateY(0);
  }
}
