:root {
  --orange: #ff7a00;
  --orange2: #ff3d2e;
  --green: #18c984;
  --bg: #020712;
  --panel: rgba(255,255,255,.08);
  --line: rgba(255,255,255,.14);
  --text: #ffffff;
  --muted: #b8c6d9;
  --shadow: 0 36px 120px rgba(0,0,0,.45);
}

.live-page {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 20%, rgba(255,122,0,.22), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(24,201,132,.16), transparent 24%),
    linear-gradient(180deg, #020712, #071322 55%, #020712);
  font-family: Inter, system-ui, Segoe UI, Arial, sans-serif;
}

.live-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px 42px;
  background: rgba(2,7,18,.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.live-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
  font-weight: 1000;
  letter-spacing: 4px;
}

.live-brand img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.live-topbar nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.live-topbar nav a {
  color: #dce8f8;
  text-decoration: none;
  font-weight: 900;
}

.live-hero {
  max-width: 1420px;
  margin: auto;
  min-height: 720px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 46px;
  align-items: center;
  padding: 76px 52px;
  position: relative;
}

.live-hero:before {
  content: "";
  position: absolute;
  inset: 36px;
  border-radius: 54px;
  background:
    linear-gradient(120deg, rgba(2,7,18,.15), rgba(2,7,18,.88)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=2400&q=85") center/cover;
  z-index: -1;
  box-shadow: var(--shadow);
}

.live-pill {
  display: inline-flex;
  padding: 11px 15px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  border: 1px solid var(--line);
  font-weight: 1000;
  color: #edf6ff;
  margin-bottom: 24px;
}

.live-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(58px, 7vw, 108px);
  line-height: .86;
  letter-spacing: -5px;
}

.live-hero p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 20px;
  font-weight: 800;
}

.live-code-card,
.live-preview-card,
.live-panel,
.live-status-bar {
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.live-code-card {
  max-width: 620px;
  padding: 22px;
  margin-top: 32px;
}

.live-code-card label {
  display: block;
  margin-bottom: 10px;
  color: white;
  font-weight: 1000;
}

.live-code-row {
  display: flex;
  gap: 12px;
}

.live-code-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(3,7,18,.72);
  color: white;
  font: inherit;
  font-weight: 900;
  text-transform: uppercase;
}

.live-code-row button,
.live-secondary-btn {
  border: 0;
  border-radius: 999px;
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--orange), var(--orange2));
  color: #140b05;
  font: inherit;
  font-weight: 1000;
  cursor: pointer;
  text-decoration: none;
}

.live-code-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
}

.live-preview-card {
  padding: 28px;
  max-width: 460px;
}

.live-preview-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-preview-head em {
  margin-left: auto;
  color: var(--orange);
  font-style: normal;
  font-weight: 1000;
}

.live-dot {
  width: 13px;
  height: 13px;
  display: inline-block;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(24,201,132,.14);
}

.live-preview-map {
  position: relative;
  height: 340px;
  margin: 22px 0;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(135deg, rgba(24,201,132,.22), rgba(56,189,248,.18));
  background-size: 42px 42px, 42px 42px, auto;
}

.live-route {
  position: absolute;
  left: 80px;
  top: 58px;
  width: 240px;
  height: 230px;
  border: 7px solid var(--orange);
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-25deg);
}

.live-user-dot {
  position: absolute;
  left: 210px;
  top: 170px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #38bdf8;
  border: 4px solid white;
  box-shadow: 0 0 0 18px rgba(56,189,248,.2);
}

.live-preview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.live-preview-stats div {
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.08);
  text-align: center;
}

.live-preview-stats strong {
  color: var(--orange);
  font-size: 22px;
}

.live-preview-stats span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.live-viewer {
  max-width: 1420px;
  margin: 0 auto 100px;
  padding: 0 52px;
}

.hidden {
  display: none !important;
}

.live-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
  margin-bottom: 18px;
}

.live-status-bar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.live-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
}

.live-map {
  height: 620px;
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #0b1420;
}

.live-panel {
  padding: 24px;
}

.live-panel h2 {
  margin: 0 0 18px;
}

.live-stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.live-stat span {
  color: var(--muted);
  font-weight: 800;
}

.live-stat strong {
  text-align: right;
}

.live-alert {
  margin-top: 18px;
  border-radius: 20px;
  padding: 18px;
  background: rgba(239,68,68,.18);
  border: 1px solid rgba(239,68,68,.45);
  color: #fecaca;
  font-weight: 1000;
  text-align: center;
}

@media (max-width: 980px) {
  .live-hero,
  .live-grid {
    grid-template-columns: 1fr;
  }

  .live-topbar {
    padding: 14px 18px;
  }

  .live-topbar nav {
    display: none;
  }

  .live-hero,
  .live-viewer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .live-code-row {
    flex-direction: column;
  }

  .live-map {
    height: 480px;
  }
}

.live-dot.danger { background: #ef4444; box-shadow: 0 0 0 8px rgba(239,68,68,.18); }



.live-map-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.live-layer-select {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 900;
}

.live-layer-select span {
  font-size: 13px;
}

.live-layer-select select {
  border: 0;
  outline: 0;
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(3,7,18,.82);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 720px) {
  .live-map-actions {
    width: 100%;
    justify-content: stretch;
  }

  .live-layer-select,
  .live-secondary-btn {
    width: 100%;
    justify-content: center;
  }

  .live-layer-select select {
    flex: 1;
  }
}

/* TERRAVA RESPONSIVE LIVE V3 */
* { box-sizing: border-box; }

@media (max-width: 820px) {
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .live-hero,
  .live-result,
  .live-code-card,
  .live-preview-card,
  .live-preview-map,
  .live-preview-stats {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .live-hero {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
    padding: 24px 16px !important;
  }

  .live-hero h1 {
    font-size: clamp(34px, 10vw, 50px) !important;
    line-height: 1 !important;
  }

  .live-hero p {
    font-size: 17px !important;
    line-height: 1.45 !important;
  }

  .live-code-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  .live-code-row input,
  .live-code-row button {
    width: 100% !important;
    min-height: 50px !important;
  }

  .live-preview-stats {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  #liveMap,
  .map,
  .leaflet-container {
    width: 100% !important;
    height: 420px !important;
    min-height: 420px !important;
    border-radius: 24px !important;
    overflow: hidden !important;
  }
}

@media (max-width: 430px) {
  .live-hero {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  #liveMap,
  .map,
  .leaflet-container {
    height: 380px !important;
    min-height: 380px !important;
  }
}

/* TERRAVA LIVE RESULT MOBILE FIX V4 */
@media (max-width: 820px) {
  .site-header {
    padding: 14px 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    overflow: hidden !important;
  }

  .brand img {
    width: 54px !important;
    height: 54px !important;
  }

  .brand b {
    font-size: 24px !important;
    letter-spacing: 8px !important;
  }

  .mobile-menu,
  .menu-toggle {
    width: 86px !important;
    min-width: 86px !important;
    height: 58px !important;
  }

  .live-hero {
    padding: 28px 22px !important;
    display: block !important;
  }

  .live-hero h1 {
    font-size: 44px !important;
    line-height: 0.98 !important;
    letter-spacing: -1.5px !important;
  }

  .live-hero p {
    font-size: 20px !important;
    line-height: 1.45 !important;
  }

  .live-code-card,
  .live-result,
  .live-card,
  .live-user-card,
  .live-info-card {
    width: calc(100vw - 36px) !important;
    max-width: calc(100vw - 36px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 24px !important;
    border-radius: 28px !important;
    overflow: hidden !important;
  }

  .live-result-head,
  .live-share-head,
  .live-status-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }

  .live-result-head select,
  .live-result-head button,
  .live-share-head select,
  .live-share-head button,
  .live-status-card select,
  .live-status-card button {
    position: static !important;
    width: 100% !important;
    min-height: 52px !important;
    margin: 0 !important;
    transform: none !important;
  }

  .maps-btn,
  .open-map,
  #openMapsBtn,
  #openMapBtn {
    position: static !important;
    width: 100% !important;
    margin-top: 10px !important;
    transform: none !important;
  }

  #map,
  #liveMap,
  .map,
  .leaflet-container {
    width: calc(100vw - 36px) !important;
    max-width: calc(100vw - 36px) !important;
    height: 440px !important;
    min-height: 440px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    border-radius: 28px !important;
    overflow: hidden !important;
  }

  .live-info,
  .info-card,
  .info-grid {
    width: calc(100vw - 36px) !important;
    max-width: calc(100vw - 36px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .info-row,
  .live-info-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    text-align: left !important;
  }

  .info-row strong,
  .live-info-row strong {
    text-align: left !important;
    word-break: break-word !important;
  }
}

@media (max-width: 430px) {
  .brand b {
    font-size: 21px !important;
    letter-spacing: 6px !important;
  }

  .live-hero h1 {
    font-size: 38px !important;
  }

  .live-hero p {
    font-size: 18px !important;
  }

  #map,
  #liveMap,
  .map,
  .leaflet-container {
    height: 390px !important;
    min-height: 390px !important;
  }
}

/* TERRAVA LIVE REAL MOBILE FIX V5 */
@media (max-width: 820px) {
  .topbar {
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    padding:14px 16px !important;
    height:auto !important;
    gap:10px !important;
    overflow:hidden !important;
  }

  .brand {
    min-width:0 !important;
    flex:1 !important;
  }

  .brand img {
    width:54px !important;
    height:54px !important;
    object-fit:contain !important;
  }

  .brand span {
    font-size:22px !important;
    letter-spacing:7px !important;
    white-space:nowrap !important;
  }

  .mobile-menu {
    width:82px !important;
    min-width:82px !important;
    height:56px !important;
    padding:0 !important;
  }

  .live-hero {
    display:flex !important;
    flex-direction:column !important;
    padding:26px 22px !important;
    gap:18px !important;
  }

  .live-hero h1 {
    font-size:40px !important;
    line-height:1 !important;
    letter-spacing:-1.4px !important;
  }

  .live-hero p {
    font-size:18px !important;
    line-height:1.42 !important;
  }

  .live-preview-card {
    display:none !important;
  }

  .live-code-card,
  .live-viewer,
  .live-status-bar,
  .live-panel {
    width:calc(100vw - 36px) !important;
    max-width:calc(100vw - 36px) !important;
    margin-left:auto !important;
    margin-right:auto !important;
  }

  .live-status-bar {
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:16px !important;
    padding:22px !important;
  }

  .live-status-bar > div:last-child {
    display:flex !important;
    flex-direction:column !important;
    gap:12px !important;
    width:100% !important;
  }

  #liveMapLayer,
  #liveGoogleMaps {
    position:static !important;
    width:100% !important;
    min-height:52px !important;
    margin:0 !important;
    transform:none !important;
    text-align:center !important;
  }

  .live-grid {
    display:flex !important;
    flex-direction:column !important;
    gap:18px !important;
    width:100% !important;
  }

  .live-map,
  #liveMap {
    width:calc(100vw - 36px) !important;
    max-width:calc(100vw - 36px) !important;
    height:390px !important;
    min-height:390px !important;
    margin-left:auto !important;
    margin-right:auto !important;
    border-radius:28px !important;
    overflow:hidden !important;
  }

  .live-panel {
    padding:24px !important;
    border-radius:28px !important;
  }

  .live-panel h2 {
    font-size:38px !important;
  }

  .live-stat {
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:5px !important;
  }

  .live-stat strong {
    text-align:left !important;
    word-break:break-word !important;
  }
}

@media (max-width:430px) {
  .brand span {
    font-size:19px !important;
    letter-spacing:5px !important;
  }

  .live-hero h1 {
    font-size:36px !important;
  }
}

/* TERRAVA LIVE MOBILE CENTER FIX V6 */
@media (max-width: 820px) {
  .live-page,
  .live-shell,
  .live-main,
  .live-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }

  .live-hero {
    width: calc(100vw - 36px) !important;
    max-width: calc(100vw - 36px) !important;
    margin: 0 auto 18px auto !important;
    padding: 26px 22px !important;
    box-sizing: border-box !important;
  }

  .live-hero-copy,
  .live-hero-text,
  .live-hero-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
  }

  .live-code-card,
  .live-viewer,
  .live-status-bar,
  .live-map,
  #liveMap,
  .live-panel {
    width: calc(100vw - 36px) !important;
    max-width: calc(100vw - 36px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }
}

/* TERRAVA LIVE MOBILE CLEAN V7 */
@media (max-width:820px){
  body{overflow-x:hidden!important}

  .topbar{
    justify-content:center!important;
    padding:14px 12px!important;
  }

  .topbar .brand{
    flex:none!important;
    justify-content:center!important;
    width:100%!important;
    max-width:100%!important;
    transform:none!important;
  }

  .topbar .brand img{
    width:48px!important;
    height:48px!important;
  }

  .topbar .brand span{
    font-size:22px!important;
    letter-spacing:8px!important;
  }

  .topbar .mobile-menu{
    display:none!important;
  }

  .nav{display:none!important}

  .live-hero{
    width:100%!important;
    max-width:100%!important;
    margin:0 auto!important;
    padding:24px 14px!important;
    align-items:center!important;
  }

  .live-hero > div:first-child,
  .live-code-card,
  .live-status-bar,
  .live-map,
  #liveMap,
  .live-panel{
    width:calc(100vw - 44px)!important;
    max-width:calc(100vw - 44px)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  .live-hero h1{
    font-size:34px!important;
    line-height:1.02!important;
  }

  .live-hero p{
    font-size:17px!important;
    line-height:1.42!important;
  }

  .live-pill{
    max-width:100%!important;
  }
}
