/* GEO by Hygaar — enterprise design system.
   RankinLLM-class: white elevated cards, dark refined header, Inter type,
   thicker donut gauges with the score centered inside, stronger typographic
   scale. Every original class name is preserved so no template breaks. */
:root {
  /* Surfaces */
  --bg: #f4f5f8;
  --bg-soft: #eceef3;
  --card: #ffffff;
  --header: #0f1623;
  --header-ink: #e8eaf0;
  --header-muted: #8b93a7;

  /* Ink */
  --ink: #14161c;
  --ink-soft: #3c4252;
  --muted: #6b7280;

  /* Lines */
  --line: #e6e8ee;
  --line-soft: #eef0f5;

  /* Status */
  --green: #16a34a;       --green-bg: #ecfdf3;
  --amber: #d97706;       --amber-bg: #fffbeb;
  --red:   #dc2626;       --red-bg:   #fef2f2;
  --blue:  #2563eb;       --blue-bg:  #eff6ff;

  /* Brand */
  --purple: #7c3aed;      --purple-dark: #6d28d9;
  --purple-soft: #f3e8ff;

  /* Shape & depth */
  --radius: 16px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 10px 28px rgba(16, 24, 40, 0.08), 0 4px 10px rgba(16, 24, 40, 0.05);

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-num: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility; }
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-dark); }

.container { max-width: 1280px; margin: 0 auto; padding: 28px; }

/* ---------- Dark refined header ---------- */
.topbar { background: var(--header); color: var(--header-ink);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 16px 28px; display: flex; align-items: center; gap: 22px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04); }
.topbar .logo { font-weight: 800; font-size: 18px; letter-spacing: -0.01em;
  color: #fff; display: flex; align-items: center; gap: 9px; }
.topbar .logo .logo-mark { display: block; flex-shrink: 0; }
.topbar .logo span { color: #a855f7; font-weight: 600; }
.topbar .steps { display: flex; gap: 10px; font-size: 13px; color: var(--header-muted);
  font-weight: 500; }
.topbar .steps b { color: #fff; font-weight: 700; }

/* ---------- Primary nav tabs (Audit | AttributeIQ) ---------- */
.navtabs { display: flex; gap: 6px; align-items: center; }
.navtab { display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600;
  color: var(--header-muted); text-decoration: none;
  border: 1px solid transparent; transition: all .15s ease;
  position: relative; }
.navtab svg { opacity: .8; }
.navtab:hover { color: #fff; background: rgba(255,255,255,0.07); }
.navtab.active { color: #fff; background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.14); }
.navtab-sub { font-size: 10.5px; font-weight: 500; color: var(--header-muted);
  margin-left: 2px; opacity: .8; }
.navtab.active .navtab-sub { color: rgba(255,255,255,0.7); }
.navtab-impact { color: #d8c8ff; }
.navtab-impact:hover { color: #fff; background: rgba(168,139,250,0.18); }
.navtab-impact.active { color: #fff; background: rgba(168,139,250,0.24);
  border-color: rgba(168,139,250,0.45); }
.navtab-flag { font-size: 9px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 1px 6px; border-radius: 999px;
  background: var(--purple); color: #fff; margin-left: 3px; }
@media (max-width: 720px) {
  .navtab-sub { display: none; }
  .navtab { padding: 7px 10px; }
}
.topbar .right { margin-left: auto; font-size: 13px; color: var(--header-muted); }
.topbar .right form { display: inline; }
.topbar .btn.secondary { background: rgba(255,255,255,0.08); color: var(--header-ink);
  border: 1px solid rgba(255,255,255,0.12); }
.topbar .btn.secondary:hover { background: rgba(255,255,255,0.14); }

/* ---------- Cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-main { grid-template-columns: 2fr 1fr; align-items: start; }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4, .grid-main { grid-template-columns: 1fr; } }

/* ---------- Typography ---------- */
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; color: var(--ink); }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 14px; color: var(--ink); }
h3 { font-size: 15px; font-weight: 700; margin: 0 0 10px; color: var(--ink-soft); }
.muted { color: var(--muted); font-size: 13.5px; }
.section-label { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin: 6px 0 12px; font-weight: 700; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; background: var(--purple); color: #fff; border: 0;
  padding: 11px 22px; border-radius: 10px; font-weight: 600; cursor: pointer;
  font-size: 14px; font-family: var(--font);
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.25), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease; }
.btn:hover { background: var(--purple-dark); color: #fff;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35), inset 0 1px 0 rgba(255,255,255,0.15); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--bg-soft); border-color: #d6d9e2; box-shadow: var(--shadow-sm); }

/* ---------- Badges & chips ---------- */
.badge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em;
  padding: 4px 9px; border-radius: 6px; text-transform: uppercase; vertical-align: middle; }
.badge.high { background: var(--red-bg); color: var(--red); }
.badge.medium { background: var(--amber-bg); color: var(--amber); }
.badge.low { background: var(--blue-bg); color: var(--blue); }
.badge.win { background: var(--green-bg); color: var(--green); }
.badge.impact { background: var(--purple-soft); color: var(--purple); }

.chip { display: inline-block; font-size: 12.5px; padding: 5px 12px; border-radius: 999px;
  margin: 0 7px 7px 0; border: 1px solid var(--line); font-weight: 500;
  background: var(--bg-soft); color: var(--ink-soft); }
.chip.bad { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.chip.warn { background: var(--amber-bg); color: var(--amber); border-color: #fde68a; }
.chip.good { background: var(--green-bg); color: var(--green); border-color: #bbf7d0; }
.chip.info { background: var(--blue-bg); color: var(--blue); border-color: #bfdbfe; }

/* ---------- Donut gauges (thicker, number centered) ---------- */
.donuts { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.donut { text-align: center; padding: 6px 12px; display: flex; flex-direction: column;
  align-items: center; gap: 14px; }
.donut-ring { position: relative; display: inline-flex; align-items: center;
  justify-content: center; width: 180px; height: 180px; }
.donut-ring svg { transform: rotate(-90deg); display: block; }
.donut .num { position: absolute; font-size: 44px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.donut .num .suffix { font-size: 18px; font-weight: 700; color: var(--muted);
  vertical-align: top; margin-left: 2px; }
.donut .lbl { font-size: 13.5px; color: var(--muted); font-weight: 500; max-width: 180px; }
.donut .lbl b { color: var(--ink-soft); font-weight: 700; display: block; margin-bottom: 2px; }
.delta-chip { background: var(--purple-soft); color: var(--purple-dark); font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid #e9d5ff;
  box-shadow: var(--shadow-sm); font-variant-numeric: tabular-nums; }

/* ---------- Breakdown bars ---------- */
.bar-row { display: flex; align-items: center; gap: 14px; margin: 12px 0; font-size: 14px; }
.bar-row .name { width: 260px; font-weight: 600; color: var(--ink-soft); }
.bar-row .name .chip { margin-left: 6px; }
.bar-row .track { flex: 1; height: 14px; background: var(--line-soft); border-radius: 8px;
  overflow: hidden; box-shadow: inset 0 1px 1px rgba(16,24,40,0.04); }
.bar-row .fill { height: 100%; border-radius: 8px; transition: width 0.4s ease; }
.bar-row .pts { width: 64px; text-align: right; color: var(--muted); font-weight: 600;
  font-variant-numeric: tabular-nums; font-size: 14px; }
.fill.g { background: linear-gradient(90deg, #16a34a, #22c55e); }
.fill.a { background: linear-gradient(90deg, #d97706, #f59e0b); }
.fill.r { background: linear-gradient(90deg, #dc2626, #ef4444); }

/* ---------- Diagnosis + signals ---------- */
.diag p { margin: 8px 0; font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); }
.diag b { font-weight: 700; color: var(--ink); }
.signal { border-radius: 14px; padding: 16px 16px; font-size: 14px;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.signal b { display: block; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.signal .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px;
  vertical-align: middle; }
.signal.good { background: var(--green-bg); border-color: #bbf7d0; }       .signal.good .dot { background: var(--green); }
.signal.warn { background: var(--amber-bg); border-color: #fde68a; }       .signal.warn .dot { background: var(--amber); }
.signal.bad { background: var(--red-bg); border-color: #fecaca; }          .signal.bad .dot { background: var(--red); }

/* ---------- Tables ---------- */
table.geo { width: 100%; border-collapse: collapse; font-size: 14px; }
table.geo th { text-align: left; color: var(--muted); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 11px 12px; border-bottom: 1px solid var(--line);
  font-weight: 700; background: var(--bg-soft); }
table.geo td { padding: 12px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.geo tr:hover td { background: #fafbfc; }
td.attr-ok { color: var(--green); font-weight: 700; }
td.attr-missing { color: var(--red); font-weight: 700; }
td.attr-inconsistent { color: var(--amber); font-weight: 700; }
td.attr-filled_from_image { color: var(--blue); font-weight: 700; }

/* ---------- Check rows ---------- */
details.check { border-bottom: 1px solid var(--line-soft); padding: 10px 2px; }
details.check summary { cursor: pointer; display: flex; gap: 12px; align-items: center;
  list-style: none; font-size: 14px; font-weight: 500; }
details.check summary::-webkit-details-marker { display: none; }
details.check summary:hover { color: var(--ink); }
.status-ic { width: 22px; height: 22px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; color: #fff; flex: 0 0 22px;
  box-shadow: 0 1px 2px rgba(16,24,40,0.08); }
.status-ic.pass { background: var(--green); } .status-ic.fail { background: var(--red); }
.status-ic.partial { background: var(--amber); } .status-ic.na { background: #9ca3af; }
.evidence { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin: 10px 0 6px; font-size: 13px; overflow-x: auto; }
.evidence pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 12.5px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; color: var(--ink-soft); }
.evidence p { margin: 0 0 8px; }

/* ---------- Attack vectors ---------- */
.vector { border-radius: 14px; padding: 16px; margin-bottom: 14px; font-size: 13.5px;
  border: 1px solid var(--line); }
.vector.high { background: var(--red-bg); border-color: #fecaca; }
.vector.medium { background: var(--amber-bg); border-color: #fde68a; }
.vector.low { background: var(--blue-bg); border-color: #bfdbfe; }
.vector .line { margin: 5px 0; line-height: 1.55; }
.vector .k { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; color: var(--muted);
  margin-right: 8px; }

/* ---------- Counters ---------- */
.counters { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.counter { flex: 1; min-width: 140px; text-align: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 18px 14px;
  box-shadow: var(--shadow-sm); }
.counter .n { font-size: 30px; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.1; }
.counter .l { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Forms ---------- */
input, select, textarea { width: 100%; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; font-family: var(--font); background: #fff;
  color: var(--ink); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12); }
label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display: block; margin: 14px 0 6px; }
::placeholder { color: #b0b5c0; opacity: 1; }

/* ---------- Progress ---------- */
.progress-wrap { text-align: center; padding: 80px 20px; }
.spinner { width: 48px; height: 48px; border: 4px solid var(--line); border-top-color: var(--purple);
  border-radius: 50%; margin: 0 auto 22px; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage-list { display: inline-block; text-align: left; font-size: 14px; color: var(--muted); }
.stage-list .on { color: var(--ink); font-weight: 700; }

.scrape-fail { text-align: center; color: var(--muted); padding: 28px;
  border: 1px dashed var(--line); border-radius: 14px; font-size: 14px; background: var(--bg-soft); }

/* ---------- Dialogs ---------- */
dialog { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px;
  max-width: 440px; box-shadow: var(--shadow-lg); font-family: var(--font); }
dialog::backdrop { background: rgba(15, 22, 35, 0.45); backdrop-filter: blur(2px); }
dialog h2 { font-size: 18px; }

/* ---------- Footer (Hygaar product link) ---------- */
.geo-footer { max-width: 1280px; margin: 8px auto 40px; padding: 20px 28px 0;
  border-top: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: 13px; }

@media print {
  .topbar, .no-print { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid var(--line); break-inside: avoid; }
}