/* ── TOKENS ── */
:root {
  --primary: #1F4690; --primary-hover: #183a78; --primary-soft: rgba(31,70,144,.08); --on-primary: #fff;
  --accent: #e8a000; --accent-hover: #d19200;
  --surface: #fff; --surface-dim: #f9fafb; --surface-container: #f3f4f6; --surface-container-high: #e5e7eb;
  --on-surface: #111827; --on-surface-muted: #4b5563; --on-surface-faint: #6b7280;
  --outline: #e5e7eb; --outline-faint: #f3f4f6;
  --success: #16a34a; --success-soft: rgba(22,163,74,.1); --error: #dc2626; --error-soft: rgba(220,38,38,.08); --warning: #d97706; --warning-soft: rgba(217,119,6,.1);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif; --mono: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius: 10px; --radius-lg: 14px; --radius-sm: 6px; --radius-full: 9999px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06); --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.06); --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --transition: 150ms cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif; }
html { scroll-behavior: smooth; }

/* Balanced base font size (15px) — scales every rem-based size down ~6% for a comfortable, readable page without being too big or too small. */
html { font-size: 15px; }
body { font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif; background: var(--surface-dim); color: var(--on-surface); min-height: 100vh; -webkit-font-smoothing: antialiased; font-size: 1rem; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── NAVBAR ── */
.navbar { background: var(--surface); z-index: 1000; border-bottom: 1px solid var(--outline); }
.navbar-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 64px; }
.logo { display: flex; align-items: center; }
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; margin-left: auto; }
.nav-links a { color: var(--on-surface-muted); font-size: 0.875rem; font-weight: 500; transition: all var(--transition); padding: 8px 10px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; gap: 6px; }
.nav-links a:hover { background: var(--surface-container); color: var(--on-surface); }
.nav-links .nav-icon { width: 15px; height: 15px; flex-shrink: 0; color: var(--primary); transition: color var(--transition); }
.nav-links a:hover .nav-icon { color: var(--primary-hover); }

/* Always-visible action area (BMC + theme toggle + hamburger). Sits outside .nav-links — no gap between items. */
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: 10px; flex-shrink: 0; }

/* Buy me a coffee button — soft cream pill with coffee cup icon, matching the reference */
.btn-bmc { padding: 8px 16px 8px 12px; background: #FCEFD4; color: #5C3A0E; border: 1px solid #E8C98C; border-radius: var(--radius-full); display: inline-flex; align-items: center; gap: 7px; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition); text-decoration: none; line-height: 1; }
.btn-bmc:hover { background: #F8E3B4; border-color: #D4A867; color: #4A2D08; transform: translateY(-1px); box-shadow: 0 2px 6px rgba(92,58,14,.15); }
.btn-bmc .bmc-icon { color: #7A4A14; flex-shrink: 0; width: 16px; height: 16px; }
.btn-bmc span { line-height: 1; }

.hamburger { display: none !important; background: var(--surface); border: 1px solid var(--outline); cursor: pointer; padding: 7px; color: var(--on-surface); border-radius: 8px; transition: background var(--transition), border-color var(--transition); }
.hamburger:hover { background: var(--surface-container); border-color: var(--surface-container-high); }
.hamburger svg { display: block; width: 22px; height: 22px; }

/* Theme toggle — rounded square with light border, matching the reference */
.theme-toggle { background: var(--surface); border: 1px solid var(--outline); cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; color: var(--on-surface-muted); border-radius: 8px; transition: background var(--transition), border-color var(--transition), color var(--transition); width: 38px; height: 38px; line-height: 0; flex-shrink: 0; }
.theme-toggle:hover { background: var(--surface-container); border-color: var(--surface-container-high); color: var(--on-surface); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ── HERO ── */
.hero { background: #1F4690; padding: 56px 24px 72px; text-align: center; position: relative; overflow: hidden; }
.hero h1 { color: #fff; font-size: 2rem; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.02em; line-height: 1.2; }
.hero h1 span { background: linear-gradient(135deg, #5b9cff, #93bbff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { color: rgba(255,255,255,0.85); font-size: 1rem; margin-bottom: 28px; font-weight: 400; }
.search-box { max-width: 680px; margin: 0 auto; position: relative; z-index: 10; }
.search-form { display: flex; background: #fff; border-radius: var(--radius-lg); overflow: hidden; align-items: stretch; box-shadow: var(--shadow-md); transition: box-shadow var(--transition); }
.search-form input[type="text"] { flex: 1; border: none; outline: none; padding: 16px 24px; font-family: var(--font); font-size: 1rem; color: #111827; min-width: 0; background: #fff; }
.search-form input::placeholder { color: #9ca3af; }
.search-form select { border: none; border-left: 1px solid #e5e7eb; outline: none; padding: 16px 40px 16px 16px; font-family: var(--font); font-size: 1rem; font-weight: 500; color: #1F4690; background: #f9fafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center; cursor: pointer; min-width: 90px; -webkit-appearance: none; appearance: none; }
.search-form select option { background: #fff; color: #111827; }
.search-form button { background: #e8a000; color: #000; border: none; padding: 16px 32px; font-family: var(--font); font-size: 1rem; font-weight: 600; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.search-form button:hover { background: #d19200; }
.search-form button:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── PERMALINK ── */
.permalink-bar { padding: 0; }
.permalink-inner { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius); padding: 16px; }
.permalink-inner strong { font-size: 0.85rem; font-weight: 700; color: var(--on-surface); display: block; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.permalink-input-wrap { display: flex; gap: 8px; align-items: center; }
.permalink-input { flex: 1; background: var(--surface-dim); border: 1px solid var(--outline); border-radius: var(--radius-sm); padding: 10px 14px; font-family: var(--mono); font-size: 0.875rem; color: var(--on-surface-muted); outline: none; min-width: 0; }
.permalink-input:focus { border-color: var(--primary); }
.permalink-btn { flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--surface-container); border: 1px solid var(--outline); border-radius: var(--radius-sm); cursor: pointer; color: var(--on-surface-muted); transition: all var(--transition); }
.permalink-btn:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

/* ── LAYOUT ── */
.main-content { max-width: 1280px; margin: 32px auto 0; padding: 0 24px; display: flex; gap: 24px; align-items: flex-start; }
.results-section { flex: 0 0 560px; width: 560px; max-width: 560px; display: flex; flex-direction: column; overflow: hidden; }
.map-section { flex: 1 1 0%; min-width: 0; display: flex; flex-direction: column; position: sticky; top: 24px; align-self: flex-start; gap: 16px; }

/* ── SIDEBAR CARDS ── */
.dns-info-box { background: var(--surface); border-radius: var(--radius); padding: 24px; border: 1px solid var(--outline); }
.dns-info-box h2 { font-size: 1.0625rem; font-weight: 600; color: var(--on-surface); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.dns-info-box h2::before { content: ''; width: 4px; height: 17px; background: var(--primary); border-radius: 2px; flex-shrink: 0; }
.dns-info-box p { font-size: 0.9375rem; color: var(--on-surface-muted); line-height: 1.6; margin-bottom: 8px; }
.dns-info-box .note { font-size: 0.8125rem; color: var(--on-surface-muted); margin-bottom: 0; padding: 12px; background: var(--surface-container); border-radius: var(--radius-sm); margin-top: 12px; }
.dns-info-box .note strong { color: var(--on-surface); font-weight: 600; }
.ssl-ad { border-radius: var(--radius); background: var(--surface); padding: 16px; display: flex; align-items: center; gap: 16px; border: 1px solid var(--outline); transition: box-shadow var(--transition); }
.ssl-ad:hover { box-shadow: var(--shadow); }
.ssl-ad-icon { flex-shrink: 0; width: 44px; height: 44px; background: var(--surface-container); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.ssl-ad-content { flex: 1; }
.ssl-ad-content strong { font-size: 1rem; color: var(--on-surface); display: block; font-weight: 600; margin-bottom: 2px;}
.ssl-ad-content span { font-size: 0.875rem; color: var(--on-surface-muted); line-height: 1.4; }
.ssl-ad-badge { font-size: 0.75rem; color: var(--success); background: var(--success-soft); padding: 2px 6px; border-radius: 4px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-left: 8px; vertical-align: middle; }
.ssl-ad-btn { flex-shrink: 0; background: var(--on-surface); color: var(--surface); padding: 8px 18px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 600; transition: all var(--transition); white-space: nowrap; }
.ssl-ad-btn:hover { background: #374151; box-shadow: var(--shadow); }
.coffee-banner { border-radius: var(--radius); background: var(--surface); padding: 16px; display: flex; align-items: center; gap: 16px; border: 1px solid var(--outline); }
.coffee-icon { flex-shrink: 0; width: 44px; height: 44px; background: #fff8e1; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.coffee-text { flex: 1; min-width: 0; }
.coffee-text strong { font-size: 1rem; color: var(--on-surface); display: block; font-weight: 600; margin-bottom: 2px;}
.coffee-text span { font-size: 0.875rem; color: var(--on-surface-muted); line-height: 1.4; }
.coffee-btn { flex-shrink: 0; }
.coffee-btn img { height: 40px; border-radius: 6px; display: block; }

/* ── STATS BAR ── */
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius); overflow: visible; }
.stat-card { padding: 16px 12px; text-align: center; border-right: 1px solid var(--outline-faint); }
.stat-card:last-child { border-right: none; }
.stat-card .stat-num { font-size: 1.5rem; font-weight: 700; color: var(--primary); letter-spacing: -0.02em; line-height: 1.2; }
.stat-card .stat-num.green { color: var(--success); }
.stat-card .stat-num.red { color: var(--error); }
.stat-card .stat-num.orange { color: var(--warning); }
.stat-card .stat-label { font-size: 0.75rem; color: var(--on-surface-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* ── MAP ── */
.map-container { border-radius: var(--radius); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; border: 1px solid var(--outline); }
#map { width: 100%; height: 500px; z-index: 1; }
.map-legend { display: flex; justify-content: center; gap: 24px; padding: 14px 0; background: var(--surface); flex-wrap: wrap; border-top: 1px solid var(--outline); }
.map-legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 500; color: var(--on-surface-muted); }
.ad-slot { border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--outline); min-height: 100px; }
.ad-slot-inner { display: flex; align-items: center; justify-content: center; min-height: 100px; padding: 16px; }
.ad-slot-label { font-size: 0.75rem; color: var(--on-surface-faint); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; }

/* ── LEAFLET ── */
.leaflet-popup-content-wrapper { border-radius: var(--radius) !important; font-family: var(--font) !important; box-shadow: var(--shadow-lg) !important; border: 1px solid var(--outline) !important; }
.leaflet-popup-content { margin: 12px 16px !important; font-size: 14px !important; line-height: 1.6 !important; }
.popup-loc { font-weight: 600; color: var(--on-surface); font-size: 14px; }
.popup-prov { color: var(--on-surface-muted); font-size: 12px; }
.popup-res { font-weight: 500; font-family: var(--mono); font-size: 14px; margin-top: 4px; }
.popup-time { font-size: 11px; color: var(--on-surface-faint); margin-top: 2px; }

/* ── TABLE ── */
.results-table-wrap { background: var(--surface); border-radius: var(--radius); overflow-x: auto; flex: 1; display: flex; flex-direction: column; max-width: 100%; border: 1px solid var(--outline); }
.results-table { width: 100%; border-collapse: collapse; table-layout: fixed; max-width: 100%; }
.results-table thead th { background: var(--surface-dim); padding: 14px 20px; text-align: left; font-size: 0.85rem; font-weight: 600; color: var(--on-surface-faint); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--outline); }
.results-table thead th:nth-child(1) { width: 40%; }
.results-table thead th:nth-child(2) { width: 45%; }
.results-table thead th:nth-child(3) { width: 15%; text-align: center; }
.results-table tbody tr { border-bottom: 1px solid var(--outline-faint); transition: background var(--transition); cursor: pointer; }
.results-table tbody tr:hover { background: var(--primary-soft); }
.results-table tbody tr:last-child { border-bottom: none; }
.results-table td { padding: 14px 20px; font-size: 0.9375rem; vertical-align: middle; }
.results-table td:nth-child(2) { word-break: break-all; }
.results-table td.status-cell { text-align: center; }
.server-info { display: flex; align-items: center; gap: 12px; }
.server-flag { width: 24px; height: 16px; border-radius: 2px; object-fit: cover; flex-shrink: 0; }
.server-name { font-weight: 500; color: var(--on-surface); font-size: 0.9375rem; }
.server-provider { font-size: 0.85rem; color: var(--on-surface-muted); }
.server-dns-ip { font-size: 0.85rem; color: var(--on-surface-faint); font-family: var(--mono); }
.result-value { font-family: var(--mono); font-size: 0.9375rem; color: var(--on-surface); font-weight: 500; display: block; line-height: 1.5; word-break: break-all; }
.result-value.pending { color: var(--on-surface-faint); font-weight: 400; }
.result-value.error-val { color: var(--error); }
.status-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-full); }
.status-icon.success { background: var(--success-soft); color: var(--success); }
.status-icon.fail { background: var(--error-soft); color: var(--error); }
.status-icon.pending { background: var(--surface-container); color: var(--on-surface-faint); }
.status-icon.loading { background: var(--primary-soft); color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--primary); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.query-time { font-size: 0.75rem; color: var(--on-surface-faint); display: block; margin-top: 2px; }

/* ── INFO CARDS ── */
.info-section { max-width: 1280px; margin: 40px auto 0; padding: 0 24px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.info-card { background: var(--surface); border-radius: var(--radius); padding: 28px; border: 1px solid var(--outline); transition: all var(--transition); }
.info-card:hover { box-shadow: var(--shadow-md); border-color: var(--surface-container-high); transform: translateY(-2px); }
.info-card h3 { font-size: 1.0625rem; font-weight: 600; color: var(--on-surface); margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.info-icon { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); border-radius: var(--radius-sm); flex-shrink: 0; color: var(--primary); }
.info-icon svg { width: 19px; height: 19px; }
.info-card p { font-size: 0.9rem; color: var(--on-surface-muted); line-height: 1.65; }

/* ── CONTENT SPLIT + FAQ ── */
.content-split { max-width: 1280px; margin: 40px auto 0; padding: 0 24px; }
.content-split-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.content-left .dns-info-box h2 { font-size: 1.1875rem; }
.content-left .dns-info-box p { font-size: 0.9375rem; line-height: 1.75; }
.content-right .faq-title { font-size: 1.375rem; font-weight: 700; color: var(--on-surface); margin-bottom: 20px; text-align: left; letter-spacing: -0.01em; }
.faq-item { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--outline); margin-bottom: 12px; overflow: hidden; transition: border-color var(--transition); }
.faq-item:hover { border-color: var(--surface-container-high); }
.faq-q { padding: 14px 18px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 0.9375rem; font-weight: 500; color: var(--on-surface); transition: background var(--transition); }
.faq-q:hover { background: var(--surface-dim); }
.faq-q svg { color: var(--on-surface-faint); transition: transform .25s ease; flex-shrink: 0; width: 18px; height: 18px;}
.faq-q.open svg { transform: rotate(180deg); }
.faq-a { padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s ease; }
.faq-a.open { padding: 0 18px 14px; max-height: 600px; }
.faq-a p { font-size: 0.875rem; color: var(--on-surface-muted); line-height: 1.7; }

/* ── GUIDE ── */
.guide-section.info-section { margin-top: 32px; margin-bottom: 56px; }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.guide-grid .dns-info-box h2 { font-size: 1.1875rem; }
.guide-grid .dns-info-box h3 { font-size: 1.0625rem; font-weight: 600; color: var(--on-surface); margin: 18px 0 6px; }
.guide-grid .dns-info-box p { font-size: 0.9375rem; line-height: 1.7; }

/* ── FOOTER ── */
.footer { background: var(--surface); border-top: 1px solid var(--outline); }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 48px 24px 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand { margin-bottom: 16px; color: var(--on-surface-muted); }
.footer-desc { font-size: 0.9375rem; color: var(--on-surface-muted); line-height: 1.65; margin-bottom: 20px; }
.footer-social { display: flex; gap: 12px; }
.footer-social a { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--surface-container); color: var(--on-surface-muted); transition: all var(--transition); }
.footer-social a:hover { background: var(--primary-soft); color: var(--primary); }
.footer-col h4 { font-size: 0.875rem; font-weight: 700; color: var(--on-surface); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a { font-size: 0.9375rem; color: var(--on-surface-muted); transition: color var(--transition); }
.footer-col ul a:hover { color: var(--primary); }
.footer-bottom { margin-top: 40px; padding: 24px 0; border-top: 1px solid var(--outline); text-align: center; }
.footer-bottom p { font-size: 0.875rem; color: var(--on-surface-faint); }

/* ── PAGES ── */
.page-content { max-width: 1280px; margin: 0 auto; padding: 56px 24px 80px; }
.page-container { max-width: 780px; margin: 0 auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 48px 56px; }
.page-container.wide { max-width: 900px; }
.page-container h1 { font-size: 1.75rem; font-weight: 700; color: #111827; margin-bottom: 12px; letter-spacing: -0.02em; }
.page-meta { font-size: 0.8125rem; color: #9ca3af; margin-bottom: 32px; }
.page-container h2 { font-size: 1.3125rem; font-weight: 600; color: #111827; margin: 36px 0 14px; padding-top: 14px; }
.page-container h3 { font-size: 1.125rem; font-weight: 600; color: #111827; margin: 22px 0 10px; }
.page-container p { font-size: 0.9375rem; color: #4b5563; line-height: 1.75; margin-bottom: 14px; }
.page-container a { color: #1F4690; text-decoration: underline; text-underline-offset: 2px; }
.page-container a:hover { color: #183a78; }

/* ── CONTACT ── */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; margin-top: 32px; }
.contact-form-wrap h2, .contact-info-wrap h2 { font-size: 1.25rem; font-weight: 600; color: #111827; margin: 0 0 24px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.9375rem; font-weight: 600; color: #111827; margin-bottom: 8px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; color: #111827; font-family: var(--font); font-size: 1rem; outline: none; transition: border-color 150ms ease; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #1F4690; box-shadow: 0 0 0 2px rgba(31,70,144,.1); }
.form-group textarea { resize: vertical; min-height: 140px; }
.contact-submit { background: #1F4690; color: #fff; border: none; padding: 14px 32px; border-radius: 6px; font-family: var(--font); font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 150ms ease; }
.contact-submit:hover { background: #183a78; }
.contact-info-card { display: flex; align-items: flex-start; gap: 16px; padding: 20px; border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 16px; background: #fff; }
.contact-info-card:hover { border-color: #d1d5db; }
.contact-info-icon { flex-shrink: 0; width: 48px; height: 48px; background: rgba(31,70,144,.08); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #1F4690; }
.contact-info-icon svg { width: 24px; height: 24px; }
.contact-info-card strong { font-size: 1rem; color: #111827; display: block; margin-bottom: 4px; }
.contact-info-card p { font-size: 0.9375rem; color: #6b7280; margin: 0; line-height: 1.5; }
.contact-info-card a { color: #1F4690; text-decoration: none; }
.contact-info-card a:hover { text-decoration: underline; }

/* ═══ DARK MODE ═══ */
body.dark { --primary: #5b9cff; --primary-hover: #7db4ff; --primary-soft: rgba(91,156,255,.1); --on-primary: #0a1e40; --accent: #fbbf24; --accent-hover: #f59e0b; --surface: #111827; --surface-dim: #0b0f19; --surface-container: #1f2937; --surface-container-high: #374151; --on-surface: #f3f4f6; --on-surface-muted: #9ca3af; --on-surface-faint: #6b7280; --outline: #374151; --outline-faint: #1f2937; --success: #4ade80; --success-soft: rgba(74,222,128,.1); --error: #f87171; --error-soft: rgba(248,113,113,.1); --warning: #fbbf24; --warning-soft: rgba(251,191,36,.1); --shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3); --shadow-md: 0 4px 6px -1px rgba(0,0,0,.4), 0 2px 4px -2px rgba(0,0,0,.3); --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.5), 0 4px 6px -4px rgba(0,0,0,.3); }
body.dark .navbar .logo svg path[fill="#111"] { fill: var(--on-surface); }
body.dark .nav-links .nav-icon { color: var(--primary); }
body.dark .nav-links a:hover .nav-icon { color: var(--primary-hover); }
body.dark .hero { background: #0a1c3e; }
body.dark .hero h1 span { background: linear-gradient(135deg, #6aabff, #a3ccff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
body.dark .hero p { color: rgba(255,255,255,.7); }
body.dark .search-form { background: #162544; box-shadow: none; border: 1px solid rgba(255,255,255,.08); }
body.dark .search-form:focus-within { box-shadow: none; border-color: rgba(91,156,255,.3); }
body.dark .search-form input[type="text"] { color: #f3f4f6; background: transparent; }
body.dark .search-form input::placeholder { color: rgba(255,255,255,.4); }
body.dark .search-form select { background: rgba(255,255,255,.05); color: #6aabff; border-color: rgba(255,255,255,.08); }
body.dark .search-form select option { background: #111827; color: #f3f4f6; }
body.dark .search-form button { background: var(--accent); color: #000; }
body.dark .search-form button:hover { background: var(--accent-hover); }
body.dark .leaflet-popup-content-wrapper { background: var(--surface-container) !important; color: var(--on-surface) !important; border-color: var(--outline) !important; }
body.dark .leaflet-popup-tip { background: var(--surface-container) !important; }
body.dark .popup-loc { color: var(--primary); }
body.dark .ssl-ad-btn { background: var(--on-surface); color: var(--surface-dim); }
body.dark .ssl-ad-btn:hover { background: #d1d5db; }
body.dark .coffee-icon { background: rgba(251,191,36,.1); }
body.dark .hamburger { color: var(--on-surface); background: var(--surface); border-color: var(--outline); }
body.dark .hamburger:hover { background: var(--surface-container); }
body.dark .theme-toggle { background: var(--surface); border-color: var(--outline); color: var(--on-surface-muted); }
body.dark .theme-toggle:hover { background: var(--surface-container); border-color: var(--surface-container-high); color: var(--on-surface); }
body.dark .btn-bmc { background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.3); color: #fbbf24; }
body.dark .btn-bmc:hover { background: rgba(251,191,36,.2); border-color: rgba(251,191,36,.5); color: #fcd34d; }
body.dark .btn-bmc .bmc-icon { color: #fbbf24; }
body.dark .nav-links.open { background: var(--surface); border-color: var(--outline); }
body.dark .page-container { background: #111827; border-color: #374151; }
body.dark .page-container h1, body.dark .page-container h2, body.dark .page-container h3 { color: #f3f4f6; }
body.dark .page-container p { color: #d1d5db; }
body.dark .page-container a { color: #7db4ff; }
body.dark .page-meta { color: #9ca3af; }
body.dark .form-group label { color: #f3f4f6; }
body.dark .form-group input, body.dark .form-group select, body.dark .form-group textarea { background: #1f2937; border-color: #374151; color: #f3f4f6; }
body.dark .contact-info-card { background: #1f2937; border-color: #374151; }
body.dark .contact-info-card strong { color: #f3f4f6; }
body.dark .contact-info-card p { color: #9ca3af; }
body.dark .contact-info-icon { background: rgba(91,156,255,.1); color: #7db4ff; }
body.dark .contact-form-wrap h2, body.dark .contact-info-wrap h2 { color: #f3f4f6; }

/* ═══ RESPONSIVE ═══ */
@media(max-width: 1024px) {
  .main-content { flex-direction: column; }
  .results-section { flex: none; width: 100%; max-width: 100%; order: 1; } /* Results FIRST on mobile/tablet */
  .map-section { width: 100%; order: 2; position: static; max-height: none; } /* Map BELOW results */
  #map { height: 400px; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .content-split-inner, .guide-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hamburger { display: flex !important; align-items: center; justify-content: center; }
  .nav-actions { margin-left: auto; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--outline); flex-direction: column; padding: 12px; gap: 4px; box-shadow: var(--shadow-lg); z-index: 999; margin-left: 0; align-items: stretch; }
  .nav-links.open { display: flex !important; }
  .nav-links li { width: 100%; }
  .nav-links a { padding: 12px 16px; font-size: 0.9375rem; width: 100%; display: flex; align-items: center; gap: 10px; border-radius: var(--radius-sm); }
  .nav-links .nav-icon { width: 17px; height: 17px; }
}

@media(max-width: 768px) {
  .navbar-inner { height: 60px; position: relative; }
  .nav-links { top: 60px; }
  .btn-bmc span { display: none; }
  .btn-bmc { padding: 7px 10px; gap: 0; }
  .hero { padding: 44px 16px 52px; }
  .hero h1 { font-size: 1.625rem; }
  .hero p { font-size: 0.9375rem; margin-bottom: 22px; }
  .search-form { flex-direction: column; border-radius: var(--radius); }
  .search-form input[type="text"] { border-bottom: 1px solid #e5e7eb; padding: 14px 20px; font-size: 1rem; }
  .search-form select { border-left: none; border-bottom: 1px solid #e5e7eb; padding: 14px 40px 14px 20px; font-size: 1rem; min-width: 100%; background-color: #f9fafb; border-radius: 0; color: #1F4690; }
  .search-form button { border-radius: 0 0 var(--radius) var(--radius); padding: 14px 20px; }
  
  /* Ensured minimum sizes on mobile */
  .stat-card .stat-num { font-size: 1.25rem; }
  .stat-card .stat-label { font-size: 0.75rem; } 
  .stat-card { padding: 12px 8px; }
  .main-content { padding: 0 16px; gap: 20px; margin-top: 24px; }
  #map { height: 320px; }
  
  .results-table td, .results-table th { padding: 12px 14px; font-size: 0.875rem; }
  .results-table thead th:nth-child(1) { width: 35%; }
  .results-table thead th:nth-child(2) { width: 42%; }
  .results-table thead th:nth-child(3) { width: 23%; }
  .server-name { font-size: 0.9375rem; }
  .server-provider { font-size: 0.8rem; }
  .server-dns-ip { font-size: 0.8rem; }
  .result-value { font-size: 0.875rem; }
  .server-flag { width: 20px; height: 14px; }
  
  .info-section { padding: 0 16px; margin-top: 32px; }
  .info-grid { grid-template-columns: 1fr; }
  .info-card { padding: 24px; }
  .content-split { padding: 0 16px; margin-top: 32px; }
  .guide-section.info-section { margin-top: 24px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-inner { padding: 40px 24px 0; }
  .footer-col { margin-bottom: 16px; }
  .page-content { padding: 32px 16px 56px; }
  .page-container { padding: 32px 24px; }
}

@media(max-width: 480px) {
  .hero h1 { font-size: 1.4375rem; }
  .hero p { font-size: 0.875rem; }
  .hero { padding: 30px 16px 44px; }
  .navbar-inner { padding: 0 16px; }
  .main-content { padding: 0 16px; }
  .info-section, .content-split { padding: 0 16px; }
  #map { height: 280px; }
  .dns-info-box { padding: 20px; }
  .dns-info-box h2 { font-size: 1rem; }
  .dns-info-box p { font-size: 0.9375rem; }
  .stat-card .stat-num { font-size: 1.125rem; }
  .stat-card { padding: 12px 6px; }
  
  /* Retained legibility for tables */
  .results-table td, .results-table th { padding: 10px 12px; font-size: 0.85rem; }
  .results-table thead th:nth-child(1) { width: 35%; }
  .results-table thead th:nth-child(2) { width: 40%; }
  .results-table thead th:nth-child(3) { width: 25%; }
  .server-info { gap: 8px; }
  .footer-inner { padding: 32px 16px 0; }
  .page-container { padding: 24px 20px; }
  .guide-grid .dns-info-box h3 { font-size: 0.9375rem; }
  .guide-grid .dns-info-box p { font-size: 0.875rem; }
  .ssl-ad { padding: 12px; gap: 12px; }
  .ssl-ad-icon { width: 36px; height: 36px; }
  .ssl-ad-content strong { font-size: 0.9375rem; }
  .ssl-ad-content span { font-size: 0.85rem; }
  .ssl-ad-btn { padding: 6px 14px; font-size: 0.85rem; }
  .coffee-banner { padding: 12px; gap: 12px; }
  .coffee-icon { width: 36px; height: 36px; font-size: 1.2rem; }
  .coffee-text strong { font-size: 0.9375rem; }
  .coffee-text span { font-size: 0.85rem; }
}