/* ==========================================================================
   SHOKKER: ON THE MAP — UNIVERSAL LIVING HOLOGRAPHIC OBSIDIAN SURVEY PLATE
   Zero generic oval pills · Zero 2x2 rounded SaaS boxes · 100% readable
   Scales cleanly to any county via [data-county-code] / COUNTY_SPINE_CONFIG
   ========================================================================== */

:root {
  --otm-holo-shift: 22deg;
  --otm-holo-x: 50%;
  --otm-holo-y: 32%;
  --otm-compass-deg: 0deg;
  --otm-tilt-x: 0deg;
  --otm-tilt-y: 0deg;
}

/* Outer Right Column & Holographic Plate Shell */
.right-col {
  perspective: 1400px;
}

#right-drawer.otm-holo-drawer {
  padding: 0 !important;
  gap: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: calc(100dvh - 102px);
  transform-style: preserve-3d;
  transform: rotateX(var(--otm-tilt-x)) rotateY(var(--otm-tilt-y));
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

#right-drawer.otm-holo-drawer.is-resting {
  transform: none;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Foil Rarity Palettes (Standard Silver-Topo / Showcase & Founding Gold Prism / Community Heart-Gold) */
#right-drawer.otm-holo-drawer[data-holo-rarity="silver"] {
  --foil-1: #5A6B7C;
  --foil-2: #DCE7F2;
  --foil-3: #7DD3FC;
  --foil-4: #C4B5FD;
  --holo-accent: #9ECAE8;
  --holo-accent-soft: rgba(158, 202, 232, 0.14);
  --holo-accent-ink: #0C1216;
  --holo-spine-border: rgba(158, 202, 232, 0.36);
}

#right-drawer.otm-holo-drawer[data-holo-rarity="gold"] {
  --foil-1: #9E7324;
  --foil-2: #F7DF92;
  --foil-3: #5EEAD4;
  --foil-4: #F59E0B;
  --holo-accent: #EBC365;
  --holo-accent-soft: rgba(235, 195, 101, 0.15);
  --holo-accent-ink: #0E1311;
  --holo-spine-border: rgba(235, 195, 101, 0.44);
}

#right-drawer.otm-holo-drawer[data-holo-rarity="community"] {
  --foil-1: #2F855A;
  --foil-2: #86EFAC;
  --foil-3: #FDE68A;
  --foil-4: #5EEAD4;
  --holo-accent: #7CE8AE;
  --holo-accent-soft: rgba(124, 232, 174, 0.14);
  --holo-accent-ink: #0A1510;
  --holo-spine-border: rgba(124, 232, 174, 0.40);
}

/* 45-degree chamfered holographic metallic rim */
.otm-holo-rim {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100dvh - 96px);
  padding: 2px;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  background: linear-gradient(
    calc(118deg + var(--otm-holo-shift)),
    rgba(255, 255, 255, 0.18) 0%,
    var(--foil-1) 18%,
    var(--foil-2) 37%,
    var(--foil-3) 51%,
    var(--foil-4) 68%,
    rgba(255, 255, 255, 0.88) 79%,
    var(--foil-1) 100%
  );
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.62));
}

@keyframes otmHoloRimPulse {
  0% { filter: drop-shadow(0 0 0 rgba(235, 195, 101, 0.9)) drop-shadow(0 24px 44px rgba(0, 0, 0, 0.62)); }
  45% { filter: drop-shadow(0 0 18px rgba(235, 195, 101, 0.85)) drop-shadow(0 24px 44px rgba(0, 0, 0, 0.62)); }
  100% { filter: drop-shadow(0 0 0 rgba(235, 195, 101, 0)) drop-shadow(0 24px 44px rgba(0, 0, 0, 0.62)); }
}

#right-drawer.otm-holo-drawer.pulse-active .otm-holo-rim {
  animation: otmHoloRimPulse 0.65s ease-out;
}

/* Inner calm obsidian reading plate */
.otm-holo-shell {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100dvh - 100px);
  background: #101413;
  color: #F4F1EA;
  clip-path: polygon(0 0, calc(100% - 20.5px) 0, 100% 20.5px, 100% 100%, 14.5px 100%, 0 calc(100% - 14.5px));
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
}

/* Subtle pointer-tracked ambient light glint (kept ultra-calm so text stays 100% crisp) */
.otm-holo-glint {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(
    circle 240px at var(--otm-holo-x) var(--otm-holo-y),
    rgba(255, 255, 255, 0.085),
    rgba(125, 211, 252, 0.035) 38%,
    rgba(246, 220, 140, 0.025) 56%,
    transparent 76%
  );
  mix-blend-mode: screen;
}

/* LEFT COUNTY COORDINATE SPINE (Fixed while content scrolls!) */
.otm-holo-spine {
  width: 26px;
  flex: 0 0 26px;
  background: linear-gradient(180deg, #172721 0%, #0D1613 100%);
  border-right: 1px solid var(--holo-spine-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 18px;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.otm-holo-spine::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    calc(155deg + var(--otm-holo-shift)),
    transparent 14%,
    rgba(246, 220, 140, 0.22) 38%,
    rgba(94, 234, 212, 0.24) 50%,
    rgba(255, 190, 120, 0.20) 62%,
    transparent 85%
  );
  pointer-events: none;
}

.otm-live-compass {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--holo-accent);
  background: rgba(0, 0, 0, 0.42);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
}

.otm-live-compass-needle {
  width: 2px;
  height: 12px;
  background: linear-gradient(180deg, #FF5A36 0% 50%, #ECE9E2 50% 100%);
  transform: rotate(var(--otm-compass-deg));
  transition: transform 0.08s linear;
}

.otm-spine-code {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.20em;
  color: rgba(244, 241, 234, 0.86);
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 2;
}

.otm-spine-ticks {
  width: 12px;
  height: 52px;
  background: repeating-linear-gradient(180deg, var(--holo-accent) 0 1px, transparent 1px 6px);
  opacity: 0.65;
  z-index: 2;
}

/* Main scrollable interior column */
.otm-holo-scroll {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  scrollbar-width: thin;
  scrollbar-color: rgba(235, 195, 101, 0.45) rgba(16, 20, 19, 0.9);
}

.otm-holo-scroll::-webkit-scrollbar { width: 5px; }
.otm-holo-scroll::-webkit-scrollbar-track { background: #0E1211; }
.otm-holo-scroll::-webkit-scrollbar-thumb { background: rgba(235, 195, 101, 0.42); }

/* Etched Holographic Topographic Header */
#right-drawer.otm-holo-drawer .drawer-head {
  position: relative;
  padding: 13px 12px 11px;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  background: linear-gradient(180deg, rgba(23, 39, 33, 0.52), rgba(16, 20, 19, 0));
  border-bottom: 1px solid rgba(244, 241, 234, 0.11);
  overflow: hidden;
  flex-shrink: 0;
}

.otm-holo-topo-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.34;
  background: linear-gradient(
    calc(115deg + var(--otm-holo-shift)),
    var(--foil-1),
    var(--foil-2),
    var(--foil-3),
    var(--foil-4)
  );
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='120' viewBox='0 0 260 120'%3E%3Cg fill='none' stroke='black' stroke-width='1.3'%3E%3Cpath d='M-10 24 Q 65 2 135 28 T 275 18'/%3E%3Cpath d='M-10 46 Q 75 18 145 48 T 275 42'/%3E%3Cpath d='M-10 70 Q 80 42 155 72 T 275 66'/%3E%3Cpath d='M-10 96 Q 88 68 162 96 T 275 92'/%3E%3C/g%3E%3C/svg%3E") right center / 260px 120px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='120' viewBox='0 0 260 120'%3E%3Cg fill='none' stroke='black' stroke-width='1.3'%3E%3Cpath d='M-10 24 Q 65 2 135 28 T 275 18'/%3E%3Cpath d='M-10 46 Q 75 18 145 48 T 275 42'/%3E%3Cpath d='M-10 70 Q 80 42 155 72 T 275 66'/%3E%3Cpath d='M-10 96 Q 88 68 162 96 T 275 92'/%3E%3C/g%3E%3C/svg%3E") right center / 260px 120px no-repeat;
}

.otm-head-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
  flex: 1;
}

.otm-head-right {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
}

/* Kill generic rounded pills — crisp architectural kicker bars instead! */
#right-drawer.otm-holo-drawer .pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

#right-drawer.otm-holo-drawer .pill-tag {
  border-radius: 0 !important;
  padding: 2px 7px !important;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: 0.11em !important;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.045) !important;
  border: none !important;
  border-left: 2px solid var(--holo-accent) !important;
  color: #D7DFDA !important;
}

#right-drawer.otm-holo-drawer .pill-tag.gold {
  background: var(--holo-accent-soft) !important;
  color: var(--holo-accent) !important;
}

#right-drawer.otm-holo-drawer .card-title {
  font-size: 20.5px !important;
  font-weight: 700 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.12 !important;
  color: #FAF7F0 !important;
  margin: 0 !important;
}

#right-drawer.otm-holo-drawer .card-addr {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px !important;
  color: #93A09A !important;
  margin-top: 4px !important;
  line-height: 1.35;
}

/* Circular Holographic County Seal */
.otm-holo-seal {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(
    calc(45deg + var(--otm-holo-shift) * 1.4),
    var(--foil-1),
    var(--foil-2),
    var(--foil-3),
    var(--foil-4),
    #FFFFFF
  );
  transform: rotate(-8deg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.42);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.otm-holo-seal-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #101413;
  border: 1px dashed var(--holo-accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 5.8px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0.03em;
  color: var(--holo-accent);
  text-transform: uppercase;
}

#right-drawer.otm-holo-drawer #drawer-close {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  padding: 0 !important;
  margin-top: 6px !important;
  border-radius: 0 !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(244, 241, 234, 0.22) !important;
  color: #ECE9E2 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  display: inline-grid !important;
  place-items: center !important;
}

#right-drawer.otm-holo-drawer #drawer-close:hover {
  border-color: var(--holo-accent) !important;
  color: var(--holo-accent) !important;
}

/* Live Telemetry Strip (Live Weather + Real-Time Map Bearing) */
.otm-live-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.028);
  border-bottom: 1px solid rgba(244, 241, 234, 0.10);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8E9B95;
  flex-shrink: 0;
}

.otm-live-wx {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.otm-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2BE089;
  box-shadow: 0 0 8px #2BE089;
  flex-shrink: 0;
  animation: otmLivePulse 2.4s ease-in-out infinite;
}

@keyframes otmLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.otm-live-hdg {
  color: var(--holo-accent);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Full-bleed crisp photo with subtle specular sweep */
#right-drawer.otm-holo-drawer .card-photo {
  width: 100% !important;
  height: 174px !important;
  object-fit: cover;
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 1px solid var(--holo-spine-border) !important;
  flex-shrink: 0;
}

/* Drawer Body (100% of existing content & buttons preserved, zero box-in-box!) */
#right-drawer.otm-holo-drawer #drawer-body {
  padding: 10px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #D7DFDA;
  font-size: 12px;
  line-height: 1.48;
}

/* Property Card Architectural Refinements (keeps ALL data, kills redundant title/box clutter) */
#right-drawer.otm-holo-drawer .pc-editorial-root {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#right-drawer.otm-holo-drawer .pc-summary-plate {
  background: rgba(255, 255, 255, 0.025) !important;
  border: none !important;
  border-bottom: 1px solid rgba(244, 241, 234, 0.10) !important;
  border-radius: 0 !important;
  padding: 8px 0 11px !important;
}

/* Hide ONLY redundant duplicate address header inside pc-summary-plate (already in #drawer-title!) */
#right-drawer.otm-holo-drawer .pc-summary-plate > .metric-label,
#right-drawer.otm-holo-drawer .pc-summary-plate > #pc-summary-title,
#right-drawer.otm-holo-drawer .pc-summary-plate > #pc-summary-sub {
  display: none !important;
}

#right-drawer.otm-holo-drawer .pc-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

#right-drawer.otm-holo-drawer .pc-access-tag {
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  border-left: 2px solid var(--holo-accent) !important;
  padding: 2px 0 2px 8px !important;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  color: #DCE3DF !important;
}

/* Physical Mechanical Hardware Detent Switch for GIS Lot Lines */
#right-drawer.otm-holo-drawer .pc-lot-lines-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 0 !important;
  padding: 5px 10px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--holo-accent) !important;
  color: var(--holo-accent) !important;
  font-family: 'JetBrains Mono', ui-monospace, monospace !important;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase;
  cursor: pointer;
}

#right-drawer.otm-holo-drawer .pc-lot-lines-btn::after {
  content: "";
  display: inline-block;
  width: 22px;
  height: 11px;
  border: 1px solid currentColor;
  background: linear-gradient(90deg, transparent 0 46%, currentColor 46% 100%);
  transition: background 0.16s ease;
}

#right-drawer.otm-holo-drawer .pc-lot-lines-btn:not(.is-active) {
  border-color: rgba(244, 241, 234, 0.28) !important;
  color: #93A09A !important;
}

#right-drawer.otm-holo-drawer .pc-lot-lines-btn:not(.is-active)::after {
  background: linear-gradient(90deg, #64748B 0 46%, transparent 46% 100%);
}

/* Open Hairline Blueprint Table for Metrics (Zero 2x2 rounded SaaS boxes!) */
#right-drawer.otm-holo-drawer .metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 !important;
  border-top: 1px solid rgba(244, 241, 234, 0.12);
  border-bottom: 1px solid rgba(244, 241, 234, 0.12);
}

#right-drawer.otm-holo-drawer .metric-grid > .metric-box {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 11px 10px 11px 2px !important;
  border-bottom: 1px solid rgba(244, 241, 234, 0.10) !important;
}

#right-drawer.otm-holo-drawer .metric-grid > .metric-box:nth-child(odd) {
  border-right: 1px solid rgba(244, 241, 234, 0.10) !important;
  padding-right: 10px !important;
}

#right-drawer.otm-holo-drawer .metric-grid > .metric-box:nth-child(even) {
  padding-left: 11px !important;
}

#right-drawer.otm-holo-drawer .metric-grid > .metric-box:nth-last-child(-n+2) {
  border-bottom: none !important;
}

#right-drawer.otm-holo-drawer .metric-box:not(.metric-grid > .metric-box) {
  background: rgba(255, 255, 255, 0.028) !important;
  border: none !important;
  border-left: 2px solid rgba(244, 241, 234, 0.18) !important;
  border-radius: 0 !important;
  padding: 9px 11px !important;
}

#right-drawer.otm-holo-drawer .metric-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 8.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  color: #8A9791 !important;
}

#right-drawer.otm-holo-drawer .metric-val {
  font-size: 16.5px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: #FAF7F0 !important;
  margin-top: 3px !important;
}

#right-drawer.otm-holo-drawer .metric-sub {
  font-size: 10.5px !important;
  color: #A9B5AF !important;
  margin-top: 3px !important;
  line-height: 1.35;
}

/* Living Elevation Ridge Sparkline SVG */
.otm-ridge-spark {
  width: 100%;
  height: 28px;
  display: block;
  margin-top: 6px;
}

.otm-ridge-dot {
  animation: otmLivePulse 1.9s ease-in-out infinite;
  transform-origin: center;
}

/* Clickable Route Rows & Feeder School Ledger */
#right-drawer.otm-holo-drawer .pc-school-list {
  display: flex;
  flex-direction: column;
  gap: 0 !important;
  margin-top: 7px;
  border-top: 1px solid rgba(244, 241, 234, 0.10);
}

#right-drawer.otm-holo-drawer .pc-school-row {
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid rgba(244, 241, 234, 0.08) !important;
  padding: 8px 4px !important;
  transition: padding-left 0.14s ease, background 0.14s ease;
}

#right-drawer.otm-holo-drawer .pc-school-row:hover {
  background: rgba(255, 255, 255, 0.04) !important;
  padding-left: 8px !important;
}

#right-drawer.otm-holo-drawer .pc-school-row-lvl {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 8.5px !important;
  letter-spacing: 0.1em;
  color: var(--holo-accent) !important;
}

/* Crisp Architectural Action Buttons (zero rounded bubbles!) */
#right-drawer.otm-holo-drawer .card-actions {
  gap: 6px !important;
}

#right-drawer.otm-holo-drawer .card-actions button,
#right-drawer.otm-holo-drawer .card-actions a,
#right-drawer.otm-holo-drawer .btn-sm:not(#drawer-close) {
  border-radius: 0 !important;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.045) !important;
  border: 1px solid rgba(244, 241, 234, 0.15) !important;
  color: #ECE9E2 !important;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

#right-drawer.otm-holo-drawer .card-actions button:hover,
#right-drawer.otm-holo-drawer .btn-sm:not(#drawer-close):hover {
  border-color: var(--holo-accent) !important;
  background: var(--holo-accent-soft) !important;
  color: #FFFFFF !important;
}

#right-drawer.otm-holo-drawer .btn-primary,
#right-drawer.otm-holo-drawer button.primary {
  background: var(--holo-accent) !important;
  color: var(--holo-accent-ink) !important;
  border-color: var(--holo-accent) !important;
}

@media (max-width: 900px) {
  #right-drawer.otm-holo-drawer {
    width: 100%;
    max-width: 100%;
    transform: none !important;
  }
  .otm-holo-spine {
    width: 24px;
    flex: 0 0 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #right-drawer.otm-holo-drawer {
    transform: none !important;
    transition: none !important;
  }
  .otm-live-dot,
  .otm-ridge-dot {
    animation: none !important;
  }
}
