:root {
      --bg: #f8fafc;
      --card-bg: #ffffff;
      --card-sub: #f1f5f9;
      --border: #e2e8f0;
      --text: #334155;
      --heading: #0f172a;
      --muted: #64748b;
      --primary: #0d9488;
      --accent: #7e22ce;
      --emerald: #059669;
      --amber: #d97706;
      --sky: #0284c7;
      --grid-dot: rgba(13, 148, 136, 0.08);
      --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
      --highlight-color: rgba(13, 148, 136, 0.25);
    }

    html.dark {
      --bg: #020617;
      --card-bg: #0f172a;
      --card-sub: #090d16;
      --border: #1e293b;
      --text: #cbd5e1;
      --heading: #f8fafc;
      --muted: #94a3b8;
      --primary: #2dd4bf;
      --accent: #c084fc;
      --emerald: #34d399;
      --amber: #fbbf24;
      --sky: #38bdf8;
      --grid-dot: rgba(45, 212, 191, 0.08);
      --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
      --highlight-color: rgba(45, 212, 191, 0.25);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      min-height: 100vh;
      background-color: var(--bg);
      color: var(--text);
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      line-height: 1.6;
      transition: background-color 0.25s ease, color 0.25s ease;
      -webkit-font-smoothing: antialiased;
    }

    .font-mono { font-family: 'JetBrains Mono', monospace; }
    .max-w-7xl { max-width: 80rem; margin: 0 auto; padding: 0 1.25rem; }
    .max-w-4xl { max-width: 56rem; margin: 0 auto; padding: 0 1.25rem; }

    .grid-bg {
      background-image: radial-gradient(var(--grid-dot) 1.5px, transparent 1.5px);
      background-size: 24px 24px;
    }
    .card-shadow { box-shadow: var(--card-shadow); }

    /* Scrollbars */
    ::-webkit-scrollbar { width: 7px; height: 7px; }
    ::-webkit-scrollbar-track { background: var(--bg); }
    ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--primary); }

    /* Header & Navigation */
    header {
      position: sticky; top: 0; z-index: 50;
      backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
      background: rgba(255, 255, 255, 0.85);
      border-bottom: 1px solid var(--border);
    }
    html.dark header { background: rgba(2, 6, 23, 0.85); }
    .header-inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; }

    .brand-link { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
    .brand-icon {
      width: 2.5rem; height: 2.5rem; border-radius: 0.75rem;
      background: linear-gradient(135deg, #0d9488, #059669);
      display: flex; align-items: center; justify-content: center;
      color: #fff; box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
      transition: transform 0.2s;
    }
    .brand-link:hover .brand-icon { transform: scale(1.05); }

    .nav-links { display: flex; align-items: center; gap: 1.5rem; font-size: 0.875rem; font-weight: 500; }
    .nav-links a { color: var(--text); text-decoration: none; transition: color 0.2s; }
    .nav-links a:hover { color: var(--primary); }

    .btn-icon {
      padding: 0.5rem; border-radius: 0.625rem;
      background: var(--card-sub); border: 1px solid var(--border);
      color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
      transition: color 0.2s, border-color 0.2s;
    }
    .btn-icon:hover { color: var(--primary); border-color: var(--primary); }

    /* Hero layout */
    .hero-container {
      display: flex; flex-direction: column; gap: 3rem;
      padding: 4rem 0; align-items: center;
    }
    @media (min-width: 1024px) {
      .hero-container { flex-direction: row; justify-content: space-between; align-items: stretch; }
    }

    .badge {
      display: inline-flex; align-items: center; gap: 0.5rem;
      padding: 0.375rem 0.875rem; border-radius: 9999px;
      font-size: 0.75rem; font-weight: 500;
      background: rgba(13, 148, 136, 0.1); border: 1px solid rgba(13, 148, 136, 0.25);
      color: var(--primary);
    }

    .qth-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }
    @media (min-width: 640px) { .qth-grid { grid-template-columns: 1fr 1fr; } }

    .qth-card {
      background: var(--card-bg); border: 1px solid var(--border);
      border-radius: 0.75rem; padding: 1rem;
    }

    .btn-primary {
      display: inline-flex; align-items: center; gap: 0.5rem;
      padding: 0.75rem 1.5rem; border-radius: 0.75rem;
      background: var(--primary); color: #020617; font-weight: 700;
      text-decoration: none; font-size: 0.875rem;
      transition: transform 0.15s, opacity 0.15s;
    }
    .btn-primary:hover { transform: translateY(-2px); opacity: 0.95; }

    .btn-secondary {
      display: inline-flex; align-items: center; gap: 0.5rem;
      padding: 0.75rem 1.5rem; border-radius: 0.75rem;
      background: var(--card-bg); border: 1px solid var(--border);
      color: var(--heading); font-weight: 600; text-decoration: none; font-size: 0.875rem;
      transition: background-color 0.2s, border-color 0.2s;
    }
    .btn-secondary:hover { border-color: var(--primary); }

    .cluster-card {
      background: var(--card-bg); border: 1px solid var(--border);
      border-radius: 1rem; padding: 1.5rem; width: 100%; max-width: 440px;
      display: flex; flex-direction: column; gap: 1rem;
    }

    .telnet-row {
      display: flex; align-items: center; justify-content: space-between;
      background: var(--card-bg); border: 1px solid var(--border);
      padding: 0.625rem 0.75rem; border-radius: 0.5rem;
      font-size: 0.78rem; color: var(--primary); cursor: pointer;
      transition: border-color 0.2s;
    }
    .telnet-row:hover { border-color: var(--primary); }

    /* Spots Table Styles */
    .spots-table-container {
      background: var(--card-bg); border: 1px solid var(--border);
      border-radius: 1rem; overflow: hidden;
    }
    .spots-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; text-align: left; }
    .spots-table th {
      padding: 0.75rem 1rem; background: var(--card-sub);
      color: var(--muted); font-weight: 600; text-transform: uppercase;
      border-bottom: 1px solid var(--border); letter-spacing: 0.05em;
    }
    .spots-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
    .spots-table tr:last-child td { border-bottom: none; }
    .spots-table tbody tr:hover { background: rgba(13, 148, 136, 0.04); }

    /* Подсветка новых записей спотов */
    @keyframes spot-highlight {
      0% {
        background-color: var(--highlight-color);
      }
      100% {
        background-color: transparent;
      }
    }
    .new-spot-flash {
      animation: spot-highlight 3s ease-out forwards;
    }

    .svg-icon { width: 1rem; height: 1rem; fill: currentColor; display: inline-block; vertical-align: middle; }

    /* Mobile Controls */
    #mobile-menu {
      border-bottom: 1px solid var(--border);
      background: var(--card-bg);
      padding: 1rem; display: none; flex-direction: column; gap: 0.75rem;
    }
    #mobile-menu.open { display: flex; }
    @media (min-width: 1024px) {
      .mobile-only { display: none !important; }
      .desktop-only { display: flex !important; }
    }
    @media (max-width: 1023px) { .desktop-only { display: none !important; } }

/* DX spot table rows */
.spot-freq { font-weight: 700; color: var(--primary); }
.spot-dx { font-weight: 800; }
.spot-dx a { color: var(--heading); text-decoration: none; }
.spot-comment { color: var(--muted); font-family: sans-serif; font-size: 0.75rem; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-de { color: var(--muted); }
.spot-time { text-align: right; font-weight: 600; }

.qso-widget {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.qso-widget h2 {
  margin-bottom: 0.75rem;
  color: var(--heading, #0f172a);
}

#qso-status {
  margin-bottom: 0.75rem;
  color: var(--muted, #64748b);
  font-size: 0.875rem;
}

.qso-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.75rem;
}

.qso-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg, #ffffff);
}

.qso-table th,
.qso-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  text-align: left;
  white-space: nowrap;
}

.qso-table th {
  color: var(--muted, #64748b);
  font-size: 0.8rem;
}

.qso-table tbody tr:last-child td {
  border-bottom: none;
}

.qso-table .qso-call,
.qso-table .qso-band,
.qso-table .qso-mode {
  font-family: "JetBrains Mono", monospace;
}

.qso-table .qso-call {
  color: var(--heading, #0f172a);
  font-weight: 700;
}

.qso-table .qso-band {
  color: var(--primary, #0d9488);
  font-weight: 700;
}

.qso-table .qso-mode {
  color: var(--accent, #7e22ce);
}
