/* ==========================================================================
   YourAnalystAI — shared stylesheet
   --------------------------------------------------------------------------
   Light SaaS dashboard aesthetic: white and slate surfaces, one blue accent,
   cyan for secondary signals, generous whitespace and hairline borders.

   Every class name used by the HTML pages AND by the JS tools is preserved,
   so the redesign cannot break a tool. No external libraries, no build step.
   ========================================================================== */

:root {
  /* --- surfaces --- */
  --white:    #FFFFFF;
  --g50:      #F8FAFC;
  --g100:     #F1F5F9;
  --g200:     #E2E8F0;
  --g300:     #CBD5E1;

  /* --- type --- */
  --g400:     #94A3B8;
  --muted:    #5A6B7D;   /* darkened to clear WCAG AA on --g100 */
  --g600:     #475569;
  --g700:     #334155;
  --g800:     #1E293B;
  --navy:     #0B1220;
  --navy-2:   #111C31;

  /* --- accents --- */
  --blue:     #3B82F6;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-50:  #EFF6FF;
  --cyan:     #06B6D4;
  --cyan-700: #0E7490;
  --cyan-50:  #ECFEFF;
  --violet:   #8B5CF6;

  /* --- semantic --- */
  --green:     #10B981;
  --green-50:  #ECFDF5;
  --green-700: #047857;
  --amber:     #F59E0B;
  --amber-50:  #FFFBEB;
  --amber-700: #B45309;
  --danger:    #DC2626;
  --danger-50: #FEF2F2;
  --danger-700:#B91C1C;
  --info:      #3B82F6;
  --info-50:   #EFF6FF;

  /* --- geometry --- */
  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;

  /* --- depth: light UI needs soft, low-opacity shadows --- */
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow:    0 1px 3px rgba(15,23,42,.07), 0 6px 16px rgba(15,23,42,.06);
  --shadow-lg: 0 2px 6px rgba(15,23,42,.07), 0 20px 44px rgba(15,23,42,.11);

  --tabbar-h: 60px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--g800);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; }
a { color: var(--blue-600); }
a:hover { color: var(--blue-700); }
p a, li a, td a, .copy a, .lead-text a, .section-sub a { text-decoration: underline; text-underline-offset: 2px; }
::selection { background: var(--blue-600); color: #fff; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
main.container { padding-top: 26px; padding-bottom: 60px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--g200);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 58px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -.3px; }
.brand svg { width: 26px; height: 26px; color: var(--blue-600); flex: none; }
.brand .brand-sub {
  display: block; font-size: 10px; font-weight: 600; color: var(--muted);
  letter-spacing: .09em; text-transform: uppercase;
}

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  color: var(--g700); text-decoration: none; padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--g100); color: var(--navy); }
.nav-links a.active { color: var(--blue-600); background: var(--blue-50); font-weight: 600; }

.nav-toggle {
  display: none; background: #fff; border: 1px solid var(--g200); color: var(--g700);
  border-radius: 9px; padding: 8px 13px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  min-height: 40px;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
.skip-link {
  position: fixed !important; top: -70px !important; left: 12px; z-index: 10000;
  display: inline-block; opacity: 0; pointer-events: none;
  padding: 11px 18px; background: var(--blue-600); color: #fff !important;
  border-radius: 10px; font-size: 14px; font-weight: 700; text-decoration: none;
  transition: top .15s ease, opacity .15s ease;
}
.skip-link:focus, .skip-link:focus-visible {
  top: 12px !important; opacity: 1; pointer-events: auto;
  outline: 3px solid var(--navy); outline-offset: 2px;
}
#main:focus { outline: none; }

a:focus-visible, button:focus-visible, .btn:focus-visible,
summary:focus-visible, .input:focus-visible, .app-tab:focus-visible {
  outline: 2px solid var(--blue-600); outline-offset: 2px; border-radius: 7px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
section[id] { scroll-margin-top: 78px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  background: var(--g50);
  border-bottom: 1px solid var(--g200);
  padding: 34px 0 36px;
}
.hero h1 {
  font-size: clamp(1.8rem, 4.4vw, 2.6rem); margin: 0 0 12px; line-height: 1.12;
  letter-spacing: -.03em; font-weight: 800; color: var(--navy); max-width: 20ch;
}
.hero h1 .accent { color: var(--blue); }
.hero p.lead { font-size: clamp(1rem, 2vw, 1.1rem); color: var(--g600); max-width: 62ch; margin: 0 0 22px; }
.hero .cta-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 22px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; background: #fff;
  border: 1px solid var(--g200); border-radius: 999px; padding: 5px 12px;
  font-size: 11.5px; font-weight: 600; color: var(--g600);
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
}

/* Live IP readout */
.ip-widget {
  background: #fff; border: 1px solid var(--g200); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; max-width: 760px;
}
.ip-widget .ip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 18px; }
.ip-widget .ip-item label {
  display: block; font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 3px;
}
.ip-widget .ip-item .val { font-weight: 700; font-size: 16px; word-break: break-word; font-family: var(--mono); letter-spacing: -.02em; color: var(--navy); }
.ip-widget .loading { color: var(--muted); font-size: 14px; }

/* ---------- Two-column hero (homepage) ---------- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 44px; align-items: start; }

.analyze-bar {
  background: #fff; border: 1px solid var(--g200); border-radius: 12px;
  padding: 6px 6px 6px 14px; display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow); margin-top: 20px; max-width: 470px;
}
.analyze-bar .lead { color: var(--g400); flex: none; display: flex; }
.analyze-bar .lead svg { width: 17px; height: 17px; }
.analyze-bar .fld {
  flex: 1; min-width: 0; font-size: 14px; color: var(--g800);
  background: transparent; border: 0; outline: none; padding: 8px 0; font-family: var(--font);
}
.analyze-bar .fld::placeholder { color: var(--g400); }
.analyze-bar:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.16); }
.analyze-bar .go {
  display: inline-flex; align-items: center; gap: 8px; background: var(--blue-600);
  color: #fff; font-size: 13.5px; font-weight: 600; padding: 11px 18px;
  border-radius: 9px; flex: none; text-decoration: none;
  box-shadow: 0 3px 10px rgba(37,99,235,.28);
}
.analyze-bar .go svg { width: 15px; height: 15px; }

.mini-badges { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.mini-badge { display: flex; align-items: flex-start; gap: 8px; }
.mini-badge .ic {
  width: 26px; height: 26px; border-radius: 8px; background: var(--blue-50);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.mini-badge .ic svg { width: 14px; height: 14px; color: var(--blue-600); }
.mini-badge .tx b { display: block; font-size: 12px; font-weight: 700; color: var(--g800); line-height: 1.25; }
.mini-badge .tx s { display: block; font-size: 11px; color: var(--muted); text-decoration: none; line-height: 1.35; }

.hero-browse { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-size: 13.5px; font-weight: 600; color: var(--blue-600); text-decoration: none; }
.hero-browse svg { width: 14px; height: 14px; }
.hero-browse:hover { color: var(--blue-700); text-decoration: underline; }

/* Dashboard panel */
.hero-panel {
  background: #fff; border: 1px solid var(--g200); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  border-bottom: 1px solid var(--g100); flex-wrap: wrap;
}
.panel-head .u { font-size: 14px; font-weight: 700; color: var(--navy); font-family: var(--mono); }
.panel-head .sp { flex: 1; }
.panel-live {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  color: var(--green-700); background: var(--green-50);
  border: 1px solid rgba(16,185,129,.25); padding: 3px 10px; border-radius: 999px; font-weight: 600;
}
.panel-live .d { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--g100); border-bottom: 1px solid var(--g100); }
.stat { background: #fff; padding: 13px 14px; min-width: 0; }
.stat .lab {
  font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.stat .lab i { width: 6px; height: 6px; border-radius: 2px; background: var(--blue); display: block; flex: none; }
.stat .val { font-size: 20px; font-weight: 700; color: var(--navy); letter-spacing: -.6px; line-height: 1.15; word-break: break-word; }
.stat .val u { text-decoration: none; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat .tag { font-size: 10.5px; font-weight: 600; margin-top: 4px; display: inline-block; }
.tag.good { color: var(--green-700); }
.tag.warn { color: var(--amber-700); }
.tag.info { color: var(--blue-600); }

.panel-note {
  display: flex; align-items: center; gap: 9px; padding: 11px 18px;
  background: var(--g50); border-top: 1px solid var(--g100); font-size: 11.5px; color: var(--muted);
}
.panel-note .src {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--g700);
  background: #fff; border: 1px solid var(--g200); border-radius: 999px;
  padding: 3px 9px; font-weight: 500;
}
.panel-note .src .led { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }
.panel-note .sp { flex: 1; }

/* The IP readout sits inside the hero panel, so it loses its own chrome. */
.hero-panel .ip-widget {
  border: 0; border-bottom: 1px solid var(--g100); border-radius: 0;
  box-shadow: none; padding: 16px 18px; max-width: none; background: #fff;
}
.hero-panel .ip-widget .ip-grid { grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 14px 16px; }
.hero-panel .ip-widget .ip-item .val { font-size: 15.5px; }

/* ==========================================================================
   Section headings
   ========================================================================== */
h2.section-title { font-size: clamp(1.3rem, 2.8vw, 1.6rem); margin: 0 0 8px; letter-spacing: -.02em; font-weight: 700; color: var(--navy); }
p.section-sub { color: var(--muted); margin: 0 0 22px; max-width: 76ch; }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: #fff; border: 1px solid var(--g200); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px;
}
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; }

.tool-card {
  position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--g200); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px;
  display: flex; flex-direction: column; gap: 9px;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s, border-color .18s;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--g300); }
.tool-card .tc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tool-icon {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  background: var(--blue-50); color: var(--blue-600);
  display: flex; align-items: center; justify-content: center;
}
.tool-icon svg { width: 21px; height: 21px; }
.tool-card h3 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.tool-card p { margin: 0; font-size: 13.5px; color: var(--muted); flex: 1; }
.tool-card .btn { align-self: flex-start; margin-top: 4px; }

.tool-card .status-avail {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--green-700); background: var(--green-50);
  border: 1px solid rgba(16,185,129,.25);
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.tool-card .status-soon {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); background: var(--g100); padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}

.chip {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--blue-700);
  background: var(--blue-50); border: 1px solid #D6E4FD; padding: 3px 10px;
  border-radius: 999px; white-space: nowrap; margin-right: 6px;
}
.tool-cat { margin-top: 34px; }
.tool-cat > h2 { font-size: 1.2rem; margin: 0 0 5px; letter-spacing: -.015em; color: var(--navy); }
.tool-cat > p { color: var(--muted); margin: 0 0 16px; font-size: 14px; max-width: 74ch; }

/* ---------- Tool launcher ---------- */
.tool-launcher { margin-top: 6px; }
.launch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.launch-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--g200); border-radius: 12px;
  padding: 12px 14px; text-decoration: none; color: var(--g800);
  transition: border-color .15s, background .15s, transform .15s;
}
.launch-item:hover { border-color: var(--blue); background: var(--blue-50); color: var(--navy); transform: translateY(-2px); }
.launch-item .tool-icon { width: 36px; height: 36px; border-radius: 10px; }
.launch-item .tool-icon svg { width: 18px; height: 18px; }
.launch-item .l-name { font-size: 14px; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; }
.launch-item .l-cat {
  display: block; font-size: 10px; text-transform: uppercase;
  letter-spacing: .11em; color: var(--muted); margin-top: 2px; font-weight: 600;
}

/* ==========================================================================
   Guides / articles
   ========================================================================== */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(284px, 1fr)); gap: 16px; }
.guide-card {
  background: #fff; border: 1px solid var(--g200); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px; display: flex; flex-direction: column; gap: 8px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--g300); }
.guide-card h3 { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 700; }
.guide-card h3 a { color: var(--navy); text-decoration: none; }
.guide-card h3 a:hover { color: var(--blue-600); }
.guide-card p { margin: 0; font-size: 13.5px; color: var(--muted); flex: 1; }
.guide-card .post-meta { font-size: 12px; color: var(--muted); }

.article { max-width: 800px; }
.article h2 { font-size: 1.35rem; margin: 32px 0 10px; letter-spacing: -.02em; font-weight: 700; color: var(--navy); }
.article h3 { font-size: 1.05rem; margin: 22px 0 6px; font-weight: 700; color: var(--g800); }
.article p, .article li { font-size: 15px; color: var(--g600); }
.article ul, .article ol { padding-left: 22px; margin: 8px 0; }
.article li { margin-bottom: 7px; }
.article blockquote {
  margin: 16px 0; padding: 12px 18px; border-left: 3px solid var(--blue);
  background: var(--blue-50); border-radius: 0 10px 10px 0; color: var(--g600); font-size: 14.5px;
}
.post-meta { font-size: 12.5px; color: var(--muted); margin: 6px 0 20px; display: flex; gap: 14px; flex-wrap: wrap; }

.related-box {
  border: 1px solid var(--g200); border-radius: var(--radius); background: var(--g50);
  padding: 18px 20px; margin-top: 30px;
}
.related-box h2 { font-size: 1.05rem; margin: 0 0 10px; color: var(--navy); }
.related-box ul { margin: 0; padding-left: 20px; }
.related-box li { margin-bottom: 6px; font-size: 14px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  /* --blue (#3B82F6) is only 3.67:1 against white, below WCAG AA for button
     text, so filled buttons use --blue-600 (5.17:1). #3B82F6 is kept for
     icons, bars and other non-text accents. */
  background: var(--blue-600); color: #fff; border: 1px solid var(--blue-600);
  padding: 10px 18px; border-radius: 10px; font-size: 14.5px; font-weight: 600;
  letter-spacing: -.01em; cursor: pointer; text-decoration: none;
  transition: background .15s, box-shadow .18s, transform .12s;
  min-height: 44px;
}
.btn:hover { background: var(--blue-700); border-color: var(--blue-700); color: #fff; box-shadow: 0 6px 18px rgba(37,99,235,.24); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

.btn-secondary { background: #fff; color: var(--g700); border-color: var(--g200); }
.btn-secondary:hover { background: var(--g50); color: var(--navy); border-color: var(--g300); box-shadow: var(--shadow-sm); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-700); border-color: var(--danger-700); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; min-height: 38px; }
.btn-lg { padding: 13px 26px; font-size: 15.5px; border-radius: 11px; min-height: 52px; }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 7px; font-size: 14px; color: var(--g800); }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: block; }
.input {
  width: 100%; padding: 12px 14px; font-size: 16px; /* 16px prevents iOS zoom-on-focus */
  border: 1px solid var(--g200); border-radius: 11px;
  background: #fff; color: var(--g800); font-family: var(--mono);
  min-height: 48px;
}
.input::placeholder { color: var(--g400); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.16); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { flex: 1; min-width: 240px; margin-bottom: 0; }

/* ==========================================================================
   Results
   ========================================================================== */
.result-box { margin-top: 22px; display: none; }
.result-box.show { display: block; animation: rise .26s cubic-bezier(.2,.7,.3,1); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.source-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
  color: var(--cyan-700); background: var(--cyan-50);
  border: 1px solid #BFEAFA;
  padding: 4px 11px; border-radius: 999px; margin: 3px 0 5px; white-space: normal;
}
.source-tag svg { width: 13px; height: 13px; flex: none; }

.notice {
  border: 1px solid #D8E5FD; border-left: 3px solid var(--info);
  background: var(--info-50);
  border-radius: 10px; padding: 12px 15px; font-size: 13.5px; margin: 13px 0; color: var(--g700);
}
.notice.warn   { border-color: #FDE9B8; border-left-color: var(--amber); background: var(--amber-50); }
.notice.danger { border-color: #FBCFCF; border-left-color: var(--danger); background: var(--danger-50); }
.notice.ok     { border-color: #B9EFD9; border-left-color: var(--green); background: var(--green-50); }
.notice.small  { font-size: 12.5px; padding: 10px 13px; }
.notice .n-title { font-weight: 700; display: block; margin-bottom: 3px; color: var(--g800); }

.error-msg {
  border: 1px solid #FBCFCF; background: var(--danger-50); color: var(--danger-700);
  padding: 11px 15px; border-radius: 10px; margin: 13px 0; font-size: 13.5px;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; margin: 15px 0; border: 1px solid var(--g200); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; background: #fff; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--g100); vertical-align: top; }
th { background: var(--g50); font-weight: 600; white-space: nowrap; color: var(--g700); font-size: 12px; letter-spacing: .03em; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--g50); }
/* `break-word` (not `anywhere`) keeps a cell's intrinsic width, so the table
   gives columns sensible space instead of squeezing "example.com" to one
   character per line; very long values still wrap when they must. */
td.mono, th.mono { font-family: var(--mono); font-size: 12.5px; overflow-wrap: break-word; word-break: normal; }
.table-wrap table { min-width: 560px; }

/* ==========================================================================
   Pills
   ========================================================================== */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent;
}
.pill.pass      { color: var(--green-700); background: var(--green-50); border-color: #B9EFD9; }
.pill.warn      { color: var(--amber-700); background: var(--amber-50); border-color: #FDE9B8; }
.pill.attention { color: var(--danger-700); background: var(--danger-50); border-color: #FBCFCF; }
.pill.info      { color: var(--blue-600); background: var(--blue-50); border-color: #D6E4FD; }
.pill.neutral   { color: var(--muted); background: var(--g100); border-color: var(--g200); }

/* ==========================================================================
   Metrics
   ========================================================================== */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.metric {
  background: #fff; border: 1px solid var(--g200); border-radius: var(--radius-sm);
  padding: 14px 15px; text-align: center; box-shadow: var(--shadow-sm);
}
.metric .m-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 5px; font-weight: 700; }
.metric .m-value { font-size: 23px; font-weight: 700; color: var(--navy); line-height: 1.15; font-family: var(--mono); letter-spacing: -.03em; }
.metric .m-unit { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.metric .m-sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.speed-big {
  font-size: clamp(2.2rem, 7vw, 3.3rem); font-weight: 800; line-height: 1;
  color: var(--blue); display: block; margin: 10px 0 4px;
  font-family: var(--mono); letter-spacing: -.04em;
}
.speed-unit { font-size: 1rem; color: var(--muted); font-weight: 600; }

/* ==========================================================================
   Progress
   ========================================================================== */
.progress { height: 8px; background: var(--g100); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress > div { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .18s linear; }
.progress-label { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.progress-label b { color: var(--g800); }

/* ==========================================================================
   Code
   ========================================================================== */
kbd { font-family: var(--mono); font-size: 12.5px; background: var(--g100); border: 1px solid var(--g200); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--g800); }
code { font-family: var(--mono); font-size: .9em; background: var(--g50); border: 1px solid var(--g200); border-radius: 5px; padding: 1px 5px; color: var(--cyan-700); }

/* ==========================================================================
   Content sections
   ========================================================================== */
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
@media (max-width: 860px) { .content-grid { grid-template-columns: 1fr; } }
.content-block {
  background: #fff; border: 1px solid var(--g200); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.content-block h3 { margin: 0 0 10px; font-size: 1.05rem; font-weight: 700; color: var(--navy); }
/* Legal sections use h2 for a correct document outline; styled identically. */
.content-block > h2 { margin: 0 0 10px; font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.content-block h4 { margin: 16px 0 5px; font-size: .98rem; font-weight: 700; color: var(--g800); }
.content-block p, .content-block li { font-size: 14px; color: var(--g600); }
.content-block ul { margin: 6px 0 0; padding-left: 20px; }
.content-block li { margin-bottom: 5px; }

dl.terms { margin: 0; }
dl.terms dt { font-weight: 700; margin-top: 12px; font-size: 14px; color: var(--g800); }
dl.terms dd { margin: 3px 0 0; font-size: 13.5px; color: var(--g600); }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq details { border: 1px solid var(--g200); border-radius: var(--radius-sm); background: #fff; margin-bottom: 10px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 13px 16px; font-weight: 600; font-size: 14px; list-style-position: outside; color: var(--g800); }
.faq summary:hover { color: var(--blue-600); }
.faq summary::-webkit-details-marker { color: var(--blue); }
.faq .faq-body { padding: 0 16px 14px; font-size: 13.5px; color: var(--g600); }

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb { font-size: 12.5px; color: var(--muted); margin: 0 0 16px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue-600); text-decoration: underline; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--navy); color: #8FA1B8; font-size: 13.5px; padding: 32px 0 26px; margin-top: 24px; }
.site-footer .fgrid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 26px; }
@media (max-width: 860px) { .site-footer .fgrid { grid-template-columns: 1fr; } }
.site-footer h2 { color: #fff; margin: 0 0 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.site-footer a { color: #A9BAD1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .copy a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 7px; }
.site-footer .copy { border-top: 1px solid rgba(255,255,255,.10); margin-top: 24px; padding-top: 16px; font-size: 12.5px; }
.site-footer p { color: #8FA1B8; }

/* ==========================================================================
   Utilities
   ========================================================================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 12.5px; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.lead-text { font-size: 1.02rem; color: var(--g600); max-width: 84ch; }

.check-list { list-style: none; padding: 0; margin: 8px 0; }
.check-list li { padding-left: 26px; position: relative; margin-bottom: 8px; font-size: 14px; color: var(--g600); }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--green-50); border: 1px solid rgba(16,185,129,.45);
}
.check-list li:has(> .ck)::before { display: none; }

/* Result blocks */
.result-section { margin-top: 22px; }
.result-section > h3 { font-size: .98rem; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--g200); font-weight: 700; color: var(--g800); }

.score-ring {
  width: 120px; height: 120px; border-radius: 50%; margin: 8px auto;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  color: #fff; font-weight: 800; font-size: 29px; line-height: 1.1;
  font-family: var(--mono); letter-spacing: -.04em;
  background: conic-gradient(var(--blue) 0turn, var(--cyan) .5turn, var(--violet) 1turn);
  box-shadow: 0 0 0 6px var(--g100), 0 14px 34px rgba(15,23,42,.16);
}
.score-ring small { font-size: 11px; font-weight: 600; opacity: .92; letter-spacing: .08em; text-transform: uppercase; }
.band-table td:first-child { white-space: nowrap; font-weight: 600; }

.log-line { font-family: var(--mono); font-size: 12.5px; padding: 4px 0; color: var(--g600); display: flex; gap: 8px; align-items: baseline; }
.log-line .t { color: var(--muted); width: 88px; flex: none; font-size: 11.5px; }
.log-line .m-bad { color: var(--danger-700); font-weight: 600; }
.log-line .m-ok { color: var(--green-700); font-weight: 600; }

/* Speed test UI */
.speed-stage { margin-top: 8px; }
.stage-list { margin-top: 12px; }
.stage-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--g200); font-size: 13.5px; }
.stage-item:last-child { border-bottom: none; }
.stage-item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--g200); flex: none; border: 1px solid var(--g300); }
.stage-item.done .dot { background: var(--green); border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.16); }
.stage-item.active .dot { background: var(--amber); border-color: var(--amber); animation: pulse 1s infinite; }
.stage-item.failed .dot { background: var(--danger); border-color: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }
.stage-item .s-name { font-weight: 600; width: 140px; flex: none; }
.stage-item .s-value { color: var(--muted); font-size: 12.5px; font-family: var(--mono); }

/* ==========================================================================
   Install chip
   ========================================================================== */
.install-chip {
  display: none; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 20px; padding: 11px 13px;
  background: #fff; border: 1px solid var(--g200); border-radius: 12px; max-width: 720px;
  box-shadow: var(--shadow-sm);
}
.install-chip.is-ready { display: flex; }
.install-chip .ic-text { flex: 1; min-width: 200px; font-size: 13px; color: var(--g600); }
.install-chip .ic-x {
  background: none; border: 0; color: var(--muted); font-size: 21px; line-height: 1;
  cursor: pointer; padding: 6px 8px; min-width: 40px; min-height: 40px; border-radius: 8px;
}
.install-chip .ic-x:hover { color: var(--g800); background: var(--g100); }

/* ==========================================================================
   App shell — bottom tab bar (mobile) + standalone
   ========================================================================== */
.app-tabbar { display: none; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; width: 100%; flex-direction: column; padding-bottom: 12px; }
  .nav-links.open { display: flex; }
  .nav-wrap { flex-wrap: wrap; row-gap: 10px; }
  .brand { font-size: 16px; gap: 9px; }
  .brand svg { width: 23px; height: 23px; }
  .brand .brand-sub { font-size: 9px; letter-spacing: .06em; }
  .nav-links a { padding: 11px 12px; min-height: 44px; display: flex; align-items: center; }

  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero { padding: 26px 0 28px; }
  .analyze-bar { max-width: none; flex-wrap: wrap; }
  .analyze-bar .go { width: 100%; justify-content: center; }
  .mini-badges { gap: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .tool-grid { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .article p, .article li { font-size: 16px; }
  .content-block p, .content-block li { font-size: 15px; }
  .breadcrumb { line-height: 1.9; }
  .stage-item { flex-wrap: wrap; row-gap: 2px; }
  .stage-item .s-name { width: 100%; }
  .stage-item .s-value { width: 100%; padding-left: 22px; }

  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  main.container { padding-bottom: 30px; }

  .app-tabbar {
    display: flex; position: fixed; z-index: 70; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255,255,255,.94);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid var(--g200);
  }
  .app-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; text-decoration: none; color: var(--muted);
    font-size: 10.5px; font-weight: 650;
    -webkit-tap-highlight-color: transparent; min-height: 50px;
  }
  .app-tab svg { width: 21px; height: 21px; stroke-width: 1.8; }
  .app-tab.active { color: var(--blue-600); }
}
@media (min-width: 821px) { .app-tabbar { display: none !important; } }

@media (max-width: 400px) {
  .brand .brand-sub { display: none; }
  .nav-toggle { padding: 8px 11px; }
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  .site-header { padding-top: env(safe-area-inset-top, 0px); background: rgba(255,255,255,.97); }
  .nav-wrap { min-height: 52px; }
  body { overscroll-behavior: none; }
}

@media (pointer: coarse) {
  .btn-sm { min-height: 42px; }
  .faq summary { padding: 15px; }
  .check-list li::before { top: 9px; }
}

@media print {
  .site-header, .app-tabbar, .hero, .ip-widget, .site-footer { display: none !important; }
  body { background: #fff; color: #000; }
  .content-block, .article { border: 1px solid #ccc; }
}