    :root {
      --bg: #0b1220;
      --panel: #121b2e;
      --line: #25334d;
      --text: #e8edf7;
      --dim: #8a96ab;
      --accent: #4fd1a5;
      --accent2: #ff9f5a;
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      height: 100%;
    }

    body {
      margin: 0;
      background: var(--bg);
      color: var(--text);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
      display: flex;
      justify-content: center;
      padding: 28px 16px 60px;
    }

    .wrap {
      width: 100%;
      max-width: 420px;
    }

    h1 {
      font-size: 19px;
      font-weight: 700;
      margin: 0 0 2px;
      letter-spacing: .2px;
    }

    .sub {
      color: var(--dim);
      font-size: 13px;
      margin: 0 0 18px;
    }

    .card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 16px;
      margin-bottom: 14px;
    }

    button {
      width: 100%;
      padding: 14px;
      border-radius: 11px;
      border: none;
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
    }

    #locBtn {
      background: var(--accent);
      color: #06251c;
    }

    #locBtn:active {
      opacity: .85;
    }

    .manual {
      display: flex;
      gap: 10px;
      margin-top: 12px;
    }

    .manual input {
      flex: 1;
      background: #0d1526;
      border: 1px solid var(--line);
      color: var(--text);
      border-radius: 9px;
      padding: 11px;
      font-size: 14px;
      width: 100%;
    }

    .manual button {
      background: transparent;
      border: 1px solid var(--line);
      color: var(--dim);
      font-size: 13px;
      font-weight: 500;
      padding: 11px 14px;
      width: auto;
      white-space: nowrap;
    }

    #status {
      font-size: 12.5px;
      color: var(--dim);
      margin-top: 10px;
      min-height: 16px;
    }

    .results {
      display: none;
    }

    .results-row {
      display: flex;
      gap: 10px;
    }

    .result {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 18px;
      margin-bottom: 14px;
      text-align: center;
    }

    .results-row .result {
      flex: 1;
      min-width: 0;
      padding: 14px 8px;
      margin-bottom: 0;
    }

    .result .label {
      font-size: 12.5px;
      color: var(--dim);
      text-transform: uppercase;
      letter-spacing: .6px;
      margin-bottom: 8px;
    }

    .results-row .result .label {
      font-size: 10.5px;
    }

    .result .big {
      font-size: 38px;
      font-weight: 800;
      line-height: 1;
      letter-spacing: -.5px;
    }

    .results-row .result .big {
      font-size: 26px;
    }

    .result .dir {
      font-size: 16px;
      font-weight: 600;
      margin-top: 6px;
      color: var(--accent);
    }

    .results-row .result .dir {
      font-size: 13px;
    }

    .result.el .dir {
      color: var(--accent2);
    }

    .sat-stats-row {
      display: flex;
      gap: 6px;
      margin-top: 6px;
    }

    .sat-stat {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
    }

    .sat-stat img {
      width: 54px;
      height: auto;
      border-radius: 8px;
      background: #f4f5f7;
      padding: 3px;
    }

    .sat-stat-label {
      font-size: 10.5px;
      color: var(--dim);
      letter-spacing: .3px;
    }

    .sat-stat-value {
      font-size: 17px;
      font-weight: 800;
    }

    /* ---------- Mapa / coordenadas manuales ---------- */
    #mapPanel,
    #mapPanel2 {
      display: none;
    }

    #siteMap,
    #siteMap2 {
      height: 210px;
      border-radius: 10px;
      overflow: hidden;
      margin-top: 12px;
      border: 1px solid var(--line);
      background: #0d1526;
    }

    .leaflet-container {
      background: #0d1526;
      font-family: inherit;
    }

    .note {
      font-size: 12px;
      color: var(--dim);
      text-align: center;
      margin-top: 4px;
      line-height: 1.5;
    }

    .compass-card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 16px;
      margin-bottom: 14px;
      text-align: center;
    }

    #markBtn {
      background: var(--accent2);
      color: #3a1c00;
    }

    #markBtn.marked {
      background: transparent;
      border: 1px solid var(--line);
      color: var(--dim);
    }

    .live-target {
      font-size: 12.5px;
      color: var(--dim);
      margin-top: 12px;
    }

    .live-target b {
      color: var(--text);
    }

    .live-big {
      font-size: 42px;
      font-weight: 800;
      margin: 10px 0 2px;
      letter-spacing: -.5px;
    }

    .bar-track {
      width: 100%;
      height: 14px;
      background: #0d1526;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      margin: 14px 0 10px;
    }

    .bar-fill {
      height: 100%;
      width: 0%;
      background: var(--accent2);
      transition: width .12s linear, background .2s ease;
    }

    .live-status {
      font-size: 15px;
      font-weight: 700;
      color: var(--dim);
      transition: color .15s ease;
      min-height: 20px;
    }

    .sensor-row {
      display: flex;
      align-items: center;
      gap: 9px;
      font-size: 13.5px;
      margin-bottom: 9px;
      color: var(--dim);
    }

    .sensor-row:last-of-type {
      margin-bottom: 0;
    }

    .sensor-dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: #3a4560;
      flex: 0 0 9px;
      transition: background .2s ease, box-shadow .2s ease;
    }

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

    .sensor-heading {
      text-align: center;
      margin-top: 14px;
      padding-top: 12px;
      border-top: 1px solid var(--line);
    }

    #noCompass {
      display: none;
      margin-top: 15px;
      padding: 14px;
      border-radius: 10px;
      background: #3b1d1d;
      color: #ffd6d6;
      font-size: 14px;
      text-align: left;
      line-height: 1.5;
    }

    /* ---------- Tabs ---------- */
    .tabs {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 8px;
      margin: 0 -16px 18px;
      padding: 10px 16px;
      position: sticky;
      top: 0;
      z-index: 20;
      background: var(--bg);
    }

    .tab-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      width: 100%;
      padding: 9px 3px;
      border-radius: 12px;
      border: 1.5px solid var(--line);
      background: var(--panel);
      color: var(--dim);
      font-size: 10px;
      font-weight: 700;
      white-space: normal;
      text-align: center;
      line-height: 1.2;
    }

    .tab-btn .tab-icon {
      font-size: 18px;
      line-height: 1;
    }

    .tab-btn.active {
      background: var(--accent);
      border-color: var(--accent);
      color: #06251c;
      box-shadow: 0 2px 10px rgba(79, 209, 165, .35);
    }

    .tab-panel {
      display: none;
    }

    .tab-panel.active {
      display: block;
    }

    .goto-btn {
      background: transparent;
      border: 1px solid var(--accent);
      color: var(--accent);
      margin-top: 4px;
    }

    /* ---------- Guías paso a paso ---------- */
    .step {
      display: flex;
      gap: 12px;
      margin-bottom: 18px;
    }

    .step:last-child {
      margin-bottom: 4px;
    }

    .step-num {
      flex: 0 0 26px;
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: var(--accent);
      color: #06251c;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 13px;
      margin-top: 1px;
    }

    .step-content h3 {
      margin: 0 0 4px;
      font-size: 14.5px;
      font-weight: 700;
    }

    .step-content p {
      margin: 0;
      font-size: 13px;
      color: var(--dim);
      line-height: 1.55;
    }

    .step-illustration {
      width: 100%;
      margin: 10px 0 4px;
      border-radius: 10px;
      overflow: hidden;
      background: #0d1526;
      border: 1px solid var(--line);
    }

    .step-illustration svg {
      display: block;
      width: 100%;
      height: auto;
    }

    .warn-box {
      background: #3b1d1d;
      color: #ffd6d6;
      font-size: 12.5px;
      padding: 12px 14px;
      border-radius: 10px;
      margin-top: 6px;
      margin-bottom: 14px;
      line-height: 1.55;
    }

    .code-box {
      background: #0d1526;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px 12px;
      font-family: "SFMono-Regular", Consolas, Menlo, monospace;
      font-size: 13.5px;
      color: var(--accent);
      margin: 8px 0 12px;
      word-break: break-all;
    }

    .tip-box {
      background: #122a22;
      color: #bdf5dd;
      font-size: 12.5px;
      padding: 12px 14px;
      border-radius: 10px;
      margin-top: 6px;
      margin-bottom: 14px;
      line-height: 1.55;
    }

    .section-title {
      font-size: 15px;
      font-weight: 700;
      margin: 0 0 12px;
    }

    .section-sub {
      font-size: 12.5px;
      color: var(--dim);
      margin: -8px 0 16px;
      line-height: 1.5;
    }

    /* ---------- Selección de modo ---------- */
    #modeSelect h1 {
      text-align: center;
    }

    #modeSelect .sub {
      text-align: center;
    }

    .mode-card {
      text-align: center;
      cursor: pointer;
      transition: border-color .15s ease, transform .1s ease;
    }

    .mode-card:active {
      transform: scale(.98);
    }

    .mode-card:hover {
      border-color: var(--accent);
    }

    .mode-icon {
      font-size: 34px;
      margin-bottom: 8px;
    }

    .mode-title {
      font-size: 16px;
      font-weight: 800;
      margin-bottom: 6px;
    }

    .mode-desc {
      font-size: 12.5px;
      color: var(--dim);
      line-height: 1.5;
    }

    /* ---------- Header con botón de volver (dentro de cada modo) ---------- */
    .app-header {
      margin-bottom: 4px;
    }

    .back-btn {
      width: auto;
      background: transparent;
      border: 1px solid var(--line);
      color: var(--dim);
      font-size: 12.5px;
      font-weight: 600;
      padding: 8px 12px;
      border-radius: 9px;
      margin-bottom: 14px;
    }

    /* ---------- Brújula normal (modo nueva antena) ---------- */
    .compass-wrap {
      display: flex;
      justify-content: center;
      margin: 4px 0 6px;
    }

    #compassSvg {
      width: 220px;
      height: 220px;
    }

    #compassDial {
      transition: transform .1s linear;
    }

    #satMarkerGroup {
      transition: transform .1s linear;
    }

    /* ---------- Inclinómetro: burbuja de nivel en 3D (2 ejes) ---------- */
    .bubble-wrap {
      display: flex;
      justify-content: center;
      margin: 4px 0 10px;
    }

    .bubble-svg {
      width: 220px;
      height: 220px;
    }

    .bubble-ball {
      transition: transform .12s linear;
    }

    .bubble-readout {
      display: flex;
      gap: 10px;
      margin-top: 12px;
    }

    .bubble-readout-item {
      flex: 1;
      text-align: center;
      background: #0d1526;
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 10px 6px;
    }

    .bubble-readout-item .label {
      font-size: 10.5px;
      color: var(--dim);
      text-transform: uppercase;
      letter-spacing: .5px;
      margin-bottom: 6px;
    }

    .bubble-readout-item .live-status {
      font-size: 17px;
      min-height: auto;
    }

    #setNorthBtn {
      width: 100%;
    }
