  * { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --bg-deep: #0a0612;
    --bg-mid: #14101f;
    --bg-card: #1a1528;
    --gold: #f4c430;
    --gold-dim: #b8911f;
    --corona: #fff4d6;
    --text: #e8e4d8;
    --text-dim: #8a8294;
    --accent: #d4654a;
    --line: rgba(244, 196, 48, 0.2);
  }

  html, body {
    background: var(--bg-deep);
    color: var(--text);
    font-family: Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
  }

  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
      radial-gradient(1px 1px at 10% 20%, white, transparent),
      radial-gradient(1px 1px at 80% 30%, white, transparent),
      radial-gradient(1px 1px at 30% 70%, white, transparent),
      radial-gradient(2px 2px at 50% 50%, rgba(255,255,255,0.5), transparent),
      radial-gradient(1px 1px at 70% 80%, white, transparent),
      radial-gradient(1px 1px at 15% 90%, white, transparent),
      radial-gradient(1px 1px at 90% 10%, white, transparent),
      radial-gradient(1px 1px at 45% 15%, rgba(255,255,255,0.7), transparent),
      radial-gradient(1px 1px at 25% 45%, white, transparent),
      radial-gradient(1px 1px at 65% 60%, rgba(255,255,255,0.6), transparent);
    background-size: 100% 100%;
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
  }

  header {
    position: relative;
    padding: 0.75rem 2rem;
    z-index: 2;
    border-bottom: 1px solid var(--line);
  }

  .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  .header-left { flex: 1; min-width: 0; }

  .eyebrow {
    font-family: Arial, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.3rem;
  }

  h1 {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  h1 em {
    font-style: italic;
    font-weight: 700;
    color: var(--gold);
  }

  .lang-switcher {
    display: flex;
    gap: 0.3rem;
    flex-shrink: 0;
  }

  .lang-btn {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text-dim);
    padding: 0.3rem 0.55rem;
    font-family: Arial, sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.2s;
    cursor: pointer;
  }

  .lang-btn:hover,
  .lang-btn.active {
    border-color: var(--gold-dim);
    color: var(--gold);
  }

  .countdown-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    flex-shrink: 0;
  }

  .cd-label-top {
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
  }

  .countdown {
    display: flex;
    align-items: baseline;
    gap: 0.15rem;
  }

  .cd-unit {
    display: flex;
    align-items: baseline;
    gap: 0.1rem;
  }

  .cd-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
    min-width: 2ch;
    text-align: right;
    line-height: 1;
  }

  .cd-lbl {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    text-transform: uppercase;
  }

  .cd-sep {
    color: var(--gold-dim);
    font-size: 1.3rem;
    font-weight: 300;
    padding: 0 0.1rem;
    line-height: 1;
  }

  .cd-passed {
    font-size: 0.85rem;
    color: var(--gold);
    font-style: italic;
  }

  .map-actions {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
  }

  .header-btn {
    background: transparent;
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    padding: 0.5rem 1.1rem;
    font-family: Arial, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
  }
  .header-btn:hover {
    background: var(--gold);
    color: var(--bg-deep);
  }

  main {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 2rem;
  }

  @media (max-width: 1000px) {
    main { grid-template-columns: 1fr; }
  }

  @media (max-width: 680px) {
    header { padding: 0.6rem 1rem; }

    .header-top {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.35rem;
    }

    .lang-switcher {
      order: -1;
      align-self: flex-end;
    }

    .header-left {
      text-align: center;
      width: 100%;
    }

    .countdown-block {
      flex-direction: row;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      border-top: 1px solid var(--line);
      padding-top: 0.45rem;
      width: 100%;
    }

    .cd-label-top { display: none; }
    .cd-num { font-size: 1.15rem; }
    .cd-lbl { font-size: 0.55rem; }

    h1 { font-size: clamp(1rem, 5.5vw, 1.4rem); white-space: normal; }
    .eyebrow { font-size: 0.6rem; letter-spacing: 0.2em; }

    main { padding: 0.75rem; gap: 1rem; }
    .left-col { gap: 1rem; }
    #map { height: 320px; }
    .info-grid { grid-template-columns: 1fr; }
    .info-cell, .info-cell.full { border-right: none; }
    .info-cell:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
    .info-cell:last-child { border-bottom: none; }
    .panel-header { padding: 0.75rem 1rem; }
    .phases, .timeline { padding: 0.75rem 1rem; }
    .city-search { padding: 0.75rem 1rem; }
    .city-msg { padding: 0 1rem 0.5rem; }
    .legend { padding: 0.75rem 1rem; gap: 0.75rem; }
    .warning { margin: 0.75rem; }
    footer { padding: 1.5rem 1rem; }
  }

  .panel {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
  }

  .left-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-self: start;
  }

  .city-search {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1.5rem;
    align-items: center;
    flex-wrap: wrap;
  }

  .city-input {
    flex: 1;
    min-width: 160px;
    background: var(--bg-deep);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 0.45rem 0.75rem;
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    outline: none;
    border-radius: 2px;
  }
  .city-input::placeholder { color: var(--text-dim); }
  .city-input:focus { border-color: var(--gold-dim); }

  .city-msg {
    padding: 0 1.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    min-height: 1.2em;
  }
  .city-msg.error { color: var(--accent); }

  .panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }

  .panel-title {
    font-family: Arial, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
  }

  .panel-num {
    font-family: Arial, sans-serif;
    font-size: 0.7rem;
    color: var(--text-dim);
  }

  #map {
    height: 600px;
    width: 100%;
    background: #0a0612;
  }

  .leaflet-container {
    background: #0a0612 !important;
    font-family: Arial, sans-serif;
  }
  .leaflet-tile {
    filter: brightness(0.85) contrast(0.9) saturate(0.5);
  }
  .leaflet-control-attribution {
    background: rgba(10, 6, 18, 0.8) !important;
    color: var(--text-dim) !important;
    font-size: 10px !important;
  }
  .leaflet-control-attribution a { color: var(--gold-dim) !important; }
  .leaflet-control-zoom a {
    background: var(--bg-card) !important;
    color: var(--gold) !important;
    border-color: var(--line) !important;
  }
  .leaflet-popup-content-wrapper {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--gold-dim);
    border-radius: 2px;
    font-family: Arial, sans-serif;
  }
  .leaflet-popup-tip {
    background: var(--bg-card);
    border: 1px solid var(--gold-dim);
  }
  .leaflet-popup-content { margin: 12px 16px; font-size: 1rem; }
  .leaflet-popup-content strong {
    color: var(--gold);
    font-family: Arial, sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
  }

  .legend {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--text-dim);
    font-family: Arial, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
  }

  .legend-item { display: flex; align-items: center; gap: 0.5rem; }
  .legend-swatch { width: 24px; height: 12px; border-radius: 2px; }

  .sun-stage {
    aspect-ratio: 1;
    width: 100%;
    background: linear-gradient(180deg,
      #ff8a3d 0%, #d4654a 30%, #6b3a4f 60%, #2a1f3d 90%, #0a0612 100%);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    transition: background 0.4s;
  }

  .horizon {
    position: absolute;
    bottom: 12%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--text-dim), transparent);
    opacity: 0.4;
  }

  .horizon-label {
    position: absolute;
    bottom: calc(12% + 8px);
    right: 1rem;
    font-family: Arial, sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    text-transform: uppercase;
  }

  .azimuth-label {
    position: absolute;
    bottom: 4%;
    left: 0;
    right: 0;
    font-family: Arial, sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    text-transform: uppercase;
    text-align: center;
  }

  .sun-container {
    position: absolute;
    width: 50%;
    aspect-ratio: 1;
    transition: left 0.3s ease, bottom 0.3s ease;
  }

  .sun-disc {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, #fff8e0 0%, #ffd84d 40%, #ffa620 80%, #ff7820 100%);
    box-shadow: 0 0 60px rgba(255, 200, 80, 0.6), 0 0 120px rgba(255, 160, 50, 0.3);
  }

  .corona {
    position: absolute;
    inset: -25%;
    border-radius: 50%;
    background: radial-gradient(circle,
      transparent 48%,
      rgba(255, 244, 214, 0.25) 52%,
      rgba(255, 244, 214, 0.08) 70%,
      transparent 85%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
  }

  .moon-disc {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #2a2530, #0a0612);
    box-shadow: inset -8px -8px 20px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
  }

  .below-horizon-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 6, 18, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-style: italic;
    font-size: 1.05rem;
    text-align: center;
    padding: 2rem;
    z-index: 10;
  }
  .below-horizon-overlay.show { display: flex; }

  .timeline { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); }

  .timeline-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
  }

  .timeline-time {
    font-family: Arial, sans-serif;
    color: var(--gold);
    font-size: 1.4rem;
    letter-spacing: 0.05em;
  }

  .timeline-controls { display: flex; gap: 0.5rem; align-items: center; }

  .play-btn, .step-btn {
    background: transparent;
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .play-btn:hover, .step-btn:hover {
    background: var(--gold);
    color: var(--bg-deep);
  }

  input[type="range"].time-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(244, 196, 48, 0.15);
    outline: none;
    border-radius: 2px;
    cursor: pointer;
  }

  input[type="range"].time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 12px var(--gold);
  }
  input[type="range"].time-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--gold);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 12px var(--gold);
  }

  .timeline-marks {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-family: Arial, sans-serif;
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
  }

  .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--line);
  }

  .info-cell {
    padding: 1.1rem 1.5rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .info-cell:nth-child(2n) { border-right: none; }
  .info-cell:nth-last-child(-n+2) { border-bottom: none; }
  .info-cell.full { grid-column: 1/-1; border-right: none; }

  .info-label {
    font-family: Arial, sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
  }

  .info-value {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1;
  }

  .info-value em {
    font-size: 0.7rem;
    font-style: normal;
    color: var(--text-dim);
    font-family: Arial, sans-serif;
    letter-spacing: 0.1em;
    margin-left: 0.3rem;
  }

  .info-value.gold { color: var(--gold); }

  .phases { padding: 1.25rem 1.5rem; }

  .phase-row {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 0.55rem 0;
    border-bottom: 1px dotted var(--line);
    align-items: baseline;
  }
  .phase-row:last-child { border-bottom: none; }

  .phase-row.current .phase-name { color: var(--gold); }
  .phase-row.current .phase-time { color: var(--gold); font-weight: 500; }

  .phase-name { font-size: 1rem; color: var(--text); }
  .phase-time {
    font-family: Arial, sans-serif;
    font-size: 0.85rem;
    color: var(--text);
    letter-spacing: 0.05em;
  }

  .eclipse-explainer {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 0;
  }

  .eclipse-explainer h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
  }

  .eclipse-explainer p {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.7;
    text-align: justify;
    margin-bottom: 0.75rem;
  }

  .eclipse-explainer p:last-child { margin-bottom: 0; }

  .eclipse-explainer strong { color: var(--text); font-weight: 600; }

  footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem 2rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    border-top: none;
    margin-top: 2rem;
    line-height: 1.6;
  }

  footer a { color: var(--gold-dim); text-decoration: none; }
  footer a:hover { color: var(--gold); }

  .footer-viccaria {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    letter-spacing: 0.03em;
  }
  .footer-viccaria a { color: var(--gold); font-weight: 600; }

  .warning {
    background: rgba(212, 101, 74, 0.1);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    margin: 1rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.5;
  }

  .warning strong {
    color: var(--accent);
    font-family: Arial, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.4rem;
  }

  .pin-marker {
    width: 14px;
    height: 14px;
    background: var(--gold);
    border: 2px solid var(--bg-deep);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--gold), 0 0 0 4px rgba(244, 196, 48, 0.2);
  }

  .compass {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(10, 6, 18, 0.5);
    backdrop-filter: blur(4px);
    color: var(--gold-dim);
    font-family: Arial, sans-serif;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    z-index: 5;
  }
  .compass-label {
    position: absolute;
    color: var(--gold-dim);
    transform: translate(-50%, -50%);
  }
  .compass-label.n { top: 6px; left: 50%; }
  .compass-label.s { bottom: -6px; left: 50%; top: auto; transform: translate(-50%, 0); }
  .compass-label.e { right: -2px; top: 50%; transform: translate(0, -50%); }
  .compass-label.w { left: 8px; top: 50%; transform: translate(-50%, -50%); }

  .amazon-banner { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: .4rem 1rem; background: #ff9900; width: 100%; margin-top: 20px; }
  .amazon-banner:first-of-type { margin-top: 0; }
  .amazon-banner a { color: #111; font-weight: 600; text-decoration: none; font-size: 1.05rem; text-align: center; }
  .amazon-banner a:hover { text-decoration: underline; }
  a[rel~="sponsored"] { font-weight: 700; color: #fff; }
  .amazon-banner a[rel~="sponsored"] { color: #111; }
  .iso-label { display: inline; font-size: inherit; letter-spacing: 0; }
  .legend-swatch-band { background: #1a1530; border: 1px solid #f4c430; }
  .legend-swatch-sel { background: #f4c430; border-radius: 50%; }
  .legend-swatch-cities { background: #8a8294; border-radius: 50%; }
  .legend-swatch-night { background: rgba(0,0,32,0.45); border: 1px dashed rgba(80,120,220,0.6); }
  .panel-mb { margin-bottom: 2rem; }
  .footer-note { font-size: 0.75rem; }
  .info-value-place { font-size: 1.05rem; }
  .phase-name-max { color: var(--gold); }
  .phase-name-sunset { color: var(--text-dim); font-style: italic; }
  .phase-time-sunset { color: var(--text-dim); }
