/* =====================================================================
   WHOLEAKME — style.css
   Loaded by includes/header.php on every page that uses it.
   (index.php also uses landing.css; login / register / verify-email
   also use login.css.)

   CONTENTS
   1.  Theme & base
   2.  Shared components   (buttons, cards, badges, forms, messages)
   3.  App layout          (sidebar, topbar, main area)  — all signed-in pages
   4.  Dashboard           — dashboard.php
   5.  Exposure Scanner    — scanner.php
   6.  Scan Result         — scan_detail.php, scan_process.php
   7.  Scan History        — scans.php            (uses shared table + badges)
   8.  Threat Detections   — threats.php
   9.  Notifications       — notifications.php
   10. Reports             — reports.php, report_view.php
   11. Profile             — profile.php
   12. Download Extension  — download_extension.php
   13. Login / MFA pages   — login.php, mfa-setup.php
   14. Page transition     — assets/page-transition.js (every page)
   15. Print
   16. App atmosphere      — moving background, glass panels, page polish
                             and the Download Extension page
===================================================================== */

/* =====================================================================
   1. THEME & BASE
===================================================================== */

:root {
  --bg: #050b14;
  --card: #0b1422;
  --text: #edf5ff;
  --muted: #8190a6;
  --line: rgba(148, 171, 201, 0.14);
  --primary: #55e1bd;
  --primary2: #6da8ff;
  --low: #55e1bd;
  --medium: #ffb65c;
  --high: #ff647c;
  --critical: #ff647c;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--primary);
  text-decoration: none;
}

.hidden {
  display: none;
}

/* =====================================================================
   2. SHARED COMPONENTS
===================================================================== */

/* ---------- text ---------- */

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: #55e1bd;
}

.muted {
  color: var(--muted);
  margin: 6px 0;
}

/* ---------- buttons ---------- */

/* one text size for every button: an <a class="btn"> would otherwise take the page's text
   size and a <button class="btn"> the browser's default, so two buttons side by side differed */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn.small {
  font-size: 14px;
}

.primary {
  background: var(--primary);
  color: #0b1422;
}

.ghost {
  background: #0e1929;
  color: var(--text);
}

.small {
  padding: 8px 12px;
}

.large {
  width: 100%;
  margin-top: 14px;
  padding: 14px;
}

/* ---------- cards & panels ---------- */

.panel,
.scanner-card,
.auth-card,
.info-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
  margin-bottom: 20px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

/* "View all" / "Open": keep on one line next to the heading on narrow screens */
.panel-head > a {
  flex: none;
  white-space: nowrap;
}

.panel h3 {
  margin: 0;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.three-col p {
  color: var(--muted);
  line-height: 1.5;
}

.empty {
  padding: 35px;
  text-align: center;
  color: var(--muted);
}

/* ---------- tables ---------- */

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

/* ---------- risk badges (Low / Medium / High / Critical) ---------- */

.badge {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.low {
  background: rgba(85, 225, 189, 0.1);
  color: #55e1bd;
}

.medium {
  background: rgba(255, 182, 92, 0.1);
  color: #ffb65c;
}

.high {
  background: rgba(255, 100, 124, 0.1);
  color: #ff647c;
}

.critical {
  background: rgba(255, 100, 124, 0.1);
  color: #ff647c;
}

/* ---------- score number (scan result, history, reports) ---------- */

.score {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  color: #8af1d6;
  margin: 10px 0;
}

/* ---------- risk ring (dashboard + scan result) ---------- */

.risk-ring {
  --ring-color: #55e1bd;
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.risk-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 10;
}

.ring-progress {
  fill: none;
  stroke: var(--ring-color);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.73; /* 2 × π × 52 */
  stroke-dashoffset: 326.73; /* empty until JS fills it */
  filter: drop-shadow(0 0 6px var(--ring-color));
}

.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1.1;
}

.ring-center b {
  font-size: 30px;
  color: var(--ring-color);
}

.ring-center small {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #8190a6;
}

.ring-center span {
  margin-top: 4px;
  font-size: 11px;
  color: var(--ring-color);
}

/* ---------- form fields ---------- */

.big-input,
input,
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(148, 171, 201, 0.18);
  border-radius: 10px;
  font: inherit;
  color: #edf5ff;
  background: #0b1422;
}

.big-input {
  font-size: 16px;
}

/* ---------- messages ---------- */

.alert {
  padding: 12px;
  border-radius: 10px;
  margin: 10px 0;
}

.alert.error {
  background: rgba(255, 100, 124, 0.1);
  color: #ff647c;
  border: 1px solid rgba(255, 100, 124, 0.25);
}

.danger {
  background: rgba(255, 100, 124, 0.1);
  color: #ff647c;
}

.success {
  background: rgba(85, 225, 189, 0.1);
  color: #55e1bd;
}

/* =====================================================================
   3. APP LAYOUT — sidebar, topbar, main area (all signed-in pages)
===================================================================== */

/* ---------- sidebar ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 245px;
  background: #06101c;
  color: #edf5ff;
  padding: 22px 15px;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #bccfea;
  font-size: 20px;
  font-weight: 800;
  padding: 6px 8px 30px;
}

.sidebar-top .brand {
  padding: 6px 8px;
  white-space: nowrap;
}

.logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #318dff);
  color: #fff;
  display: grid;
  place-items: center;
}

.sidebar nav {
  display: grid;
  gap: 7px;
}

.sidebar nav a,
.sidebar-bottom a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #8190a6;
  padding: 11px 12px;
  border-radius: 9px;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}

.sidebar nav a:hover,
.sidebar-bottom a:hover {
  background: #0e1929;
  color: #c7d2e3;
}

.sidebar nav a.active {
  background: rgba(85, 225, 189, 0.1);
  color: var(--primary);
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.nav-icon,
.sidebar-toggle svg,
.sidebar-collapse svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- open / close buttons ---------- */

.sidebar-collapse,
.sidebar-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1422;
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s;
}

.sidebar-collapse:hover,
.sidebar-toggle:hover {
  color: var(--primary);
  background: #0e1929;
}

.sidebar-collapse svg {
  transition: transform 0.25s;
}

/* the hamburger only shows on phone / tablet */
.sidebar-toggle {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

/* animations switch on after first paint (set by sidebar.js) */
.sidebar-ready .sidebar {
  transition:
    width 0.25s ease,
    transform 0.28s ease;
}

.sidebar-ready .main {
  transition: margin-left 0.25s ease;
}

/* ---------- main area & topbar ---------- */

.main {
  margin-left: 245px;
  padding: 30px 40px 60px;
  max-width: 1600px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  color: var(--muted);
  margin: 6px 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0e1929;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
}

/* ---------- desktop: collapsed icon rail ---------- */

@media (min-width: 1001px) {
  .sidebar-collapsed .sidebar {
    width: 76px;
  }

  .sidebar-collapsed .main {
    margin-left: 76px;
  }

  .sidebar-collapsed .brand-text,
  .sidebar-collapsed .nav-label {
    display: none;
  }

  .sidebar-collapsed .sidebar-top {
    flex-direction: column;
  }

  .sidebar-collapsed .sidebar nav a,
  .sidebar-collapsed .sidebar-bottom a {
    justify-content: center;
    padding: 11px 0;
  }

  .sidebar-collapsed .sidebar-bottom {
    padding: 12px 0;
  }

  .sidebar-collapsed .sidebar-collapse svg {
    transform: rotate(180deg);
  }
}

/* ---------- phone / tablet: slide-in menu ---------- */

@media (max-width: 1000px) {
  .sidebar {
    width: 270px;
    height: 100%;
    transform: translateX(-105%);
    box-shadow: var(--shadow);
  }

  .sidebar-open .sidebar {
    transform: none;
  }

  .sidebar-toggle {
    display: grid;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(2, 6, 12, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }

  .sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    margin: 0;
    padding: 22px;
  }
}

@media (max-width: 650px) {
  .main {
    padding: 18px;
  }

  /* two rows: menu button + actions on top, the page title across the full width below */
  .topbar {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "menu actions"
      "title title";
    align-items: center;
    gap: 16px 10px;
    margin-bottom: 20px;
  }

  .topbar-title {
    display: contents;
  }

  .topbar .sidebar-toggle {
    grid-area: menu;
  }

  .topbar-title > div {
    grid-area: title;
    min-width: 0;
  }

  .topbar-right {
    grid-area: actions;
    justify-content: flex-end;
    gap: 8px;
  }

  .topbar h1 {
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  /* the same sentence on every page, the avatar already shows who is signed in,
     and the extension only runs on desktop browsers */
  .topbar p,
  #headerUserName,
  .ext-chip {
    display: none;
  }

  /* a side note next to a panel heading moves under it ("View all" links stay beside) */
  .panel-head {
    flex-wrap: wrap;
  }

  .panel-head > small {
    flex-basis: 100%;
  }

  .three-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1000px) and (min-width: 651px) {
  .three-col {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =====================================================================
   4. DASHBOARD — dashboard.php
===================================================================== */

/* ---------- loading ---------- */

.dash-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 20px;
  color: var(--muted);
}

.dash-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(85, 225, 189, 0.18);
  border-top-color: var(--primary);
  animation: tx-spin 0.9s linear infinite;
}

.dash {
  animation: dash-in 0.45s ease both;
}

@keyframes dash-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- hero: risk gauge ---------- */

.dash-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 28px 32px;
  margin-bottom: 20px;
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 12% 50%,
      rgba(85, 225, 189, 0.1),
      transparent 45%
    ),
    linear-gradient(120deg, #0b1422, #0e2531);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.dash-hero .risk-ring {
  width: 150px;
  height: 150px;
}

.dash-hero-text h2 {
  margin: 10px 0 8px;
}

.dash-hero-text p {
  margin: 0 0 18px;
  color: #c7d2e3;
  line-height: 1.6;
  max-width: 560px;
}

.risk-pill {
  --tone: var(--low);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  color: var(--tone);
}

.risk-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--tone) 20%, transparent);
}

.risk-scale {
  max-width: 460px;
}

.risk-scale-bar {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  height: 8px;
}

.risk-scale-bar .seg {
  border-radius: 4px;
  opacity: 0.55;
}

.risk-scale-bar .seg.low {
  background: var(--low);
}
.risk-scale-bar .seg.medium {
  background: var(--medium);
}
.risk-scale-bar .seg.high {
  background: var(--high);
}
.risk-scale-bar .seg.critical {
  background: var(--critical);
  opacity: 0.85;
}

.risk-scale-marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #edf5ff;
  border: 4px solid #0b1422;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(237, 245, 255, 0.4);
  transition: left 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.risk-scale-marker[hidden] {
  display: none;
}

.risk-scale-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.dash-cta {
  gap: 8px;
  padding: 13px 20px;
  white-space: nowrap;
}

.dash-cta svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

/* ---------- at a glance cards ---------- */

.glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.glance-card {
  --tone: var(--low);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--tone);
  box-shadow: var(--shadow);
  color: var(--text);
  transition:
    transform 0.15s,
    border-color 0.15s;
}

.glance-card:hover {
  transform: translateY(-2px);
}

.glance-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 12px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 12%, transparent);
}

.glance-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.glance-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.glance-title {
  font-size: 13px;
  color: var(--muted);
}

.glance-state {
  font-size: 18px;
}

.glance-card small {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- panel grid ---------- */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.dash-grid .panel {
  margin-bottom: 0;
  min-width: 0;
}

.dash-grid .panel-head {
  align-items: flex-start;
}

.dash-grid .span-2 {
  grid-column: span 2;
}

.panel-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.chart-box {
  position: relative;
}

/* ---------- chart: risk over time ---------- */

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: rgba(148, 171, 201, 0.12);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-dot {
  stroke: var(--card);
  stroke-width: 2;
  pointer-events: none;
}

.chart-hit {
  fill: transparent;
  cursor: pointer;
  outline: none;
}

.chart-hit:focus-visible {
  stroke: var(--text);
  stroke-width: 1.5;
}

.chart-zone-label,
.chart-axis-label {
  fill: var(--muted);
  font-size: 12px;
}

/* ---------- chart: risk level mix (donut) ---------- */

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.donut-chart {
  position: relative;
  width: 170px;
  height: 170px;
}

.donut {
  width: 100%;
  height: 100%;
}

.donut-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
}

.donut-seg {
  cursor: pointer;
  outline: none;
  transition: opacity 0.15s;
}

.donut:hover .donut-seg:not(:hover) {
  opacity: 0.45;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}

.donut-center b {
  font-size: 30px;
}

.donut-center span {
  font-size: 12px;
  color: var(--muted);
}

.chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  min-width: 120px;
}

.chart-legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.chart-legend li.is-zero {
  opacity: 0.4;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* ---------- chart: scans by type (bars) ---------- */

.bars {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  display: grid;
  gap: 16px;
}

.bars li {
  display: grid;
  grid-template-columns: 78px 1fr 28px;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  outline: none;
  cursor: default;
}

.bar-label {
  color: #c7d2e3;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bar-fill.is-in {
  width: var(--w);
}

.bar-value {
  text-align: right;
  color: var(--muted);
  font-weight: 600;
}

.bars li:hover .bar-label,
.bars li:focus-visible .bar-label {
  color: var(--text);
}

/* ---------- recent scans list ---------- */

.scan-list,
.alert-list,
.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.scan-list li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 120px 84px;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.scan-list li:last-child {
  border-bottom: 0;
}

.scan-type-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(109, 168, 255, 0.1);
  color: var(--primary2);
}

.scan-type-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scan-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.scan-main b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-main small {
  color: var(--muted);
}

.scan-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.scan-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.scan-list .badge {
  justify-self: end;
}

/* ---------- what to do next ---------- */

.todo-list li a,
.todo-list li div {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  line-height: 1.45;
  font-size: 14px;
}

.todo-list li:last-child a,
.todo-list li:last-child div {
  border-bottom: 0;
}

.todo-list li a:hover {
  color: var(--primary);
}

.todo-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}

.todo-icon.low {
  background: rgba(85, 225, 189, 0.12);
  color: var(--low);
}
.todo-icon.medium {
  background: rgba(255, 182, 92, 0.12);
  color: var(--medium);
}
.todo-icon.high {
  background: rgba(255, 100, 124, 0.12);
  color: var(--high);
}

.todo-arrow {
  color: var(--muted);
}

/* ---------- latest alerts ---------- */

.alert-list li {
  display: grid;
  grid-template-columns: 10px 1fr;
  align-items: start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.alert-list li:last-child {
  border-bottom: 0;
}

.alert-list li span {
  display: grid;
  gap: 3px;
  font-size: 14px;
}

.alert-list small {
  color: var(--muted);
}

.alert-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(85, 225, 189, 0.6);
}

.alert-list li.is-read {
  opacity: 0.6;
}

.alert-list li.is-read .alert-dot {
  background: var(--muted);
  box-shadow: none;
}

/* ---------- empty states ---------- */

.empty-small {
  padding: 30px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.empty-cta {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 26px 12px;
  color: var(--muted);
  text-align: center;
}

.empty-cta p {
  margin: 0;
}

/* ---------- chart tooltip ---------- */

.chart-tip {
  position: fixed;
  z-index: 100;
  display: grid;
  gap: 2px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #0e1929;
  border: 1px solid rgba(148, 171, 201, 0.22);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  pointer-events: none;
  white-space: nowrap;
}

.chart-tip[hidden] {
  display: none;
}

.chart-tip span,
.chart-tip small {
  color: var(--muted);
}

/* ---------- dashboard responsive ---------- */

@media (max-width: 1200px) {
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-grid .span-2 {
    grid-column: 1 / -1;
  }

  .dash-hero {
    grid-template-columns: auto 1fr;
  }

  .dash-cta {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 800px) {
  .glance,
  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 24px 20px;
  }

  .dash-hero-text p,
  .risk-scale {
    margin-left: auto;
    margin-right: auto;
  }

  .dash-cta {
    justify-self: center;
  }

  .scan-list li {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .scan-meter {
    display: none;
  }
}

/* =====================================================================
   5. EXPOSURE SCANNER — scanner.php
===================================================================== */

.scanner-card {
  padding: 38px;
  max-width: 900px;
  margin: 0 auto 22px;
}

.scanner-card h2 {
  font-size: 30px;
  margin: 8px 0;
}

.scan-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 24px 0;
}

.scan-options input {
  display: none;
}

.scan-options span {
  display: block;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
}

.scan-options input:checked + span {
  border-color: var(--primary);
  background: rgba(85, 225, 189, 0.08);
  color: var(--primary);
  font-weight: 700;
}

.target-field {
  position: relative;
}

.target-field .big-input {
  padding-right: 80px;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(85, 225, 189, 0.1);
  color: #55e1bd;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.toggle-password:hover {
  background: rgba(85, 225, 189, 0.18);
}

.toggle-password[hidden] {
  display: none;
}

@media (max-width: 1000px) {
  .scan-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .scan-options {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   6. SCAN RESULT — scan_detail.php, scan_process.php
===================================================================== */

.result-hero {
  background: linear-gradient(120deg, #0b1422, #0e2531);
  font-size: 18px;
  color: #8af1d6;
  border-radius: 18px;
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.result-hero h2 {
  margin: 8px 0;
  font-size: 28px;
}

.finding {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.finding h3 {
  margin: 10px 0 7px;
}

.finding p {
  color: var(--muted);
  line-height: 1.5;
}

.recommend {
  background: #0e1929;
  border-radius: 12px;
  padding: 15px;
}

@media (max-width: 650px) {
  .result-hero {
    align-items: flex-start;
    gap: 20px;
  }

  .finding {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   7. SCAN HISTORY — scans.php
===================================================================== */

/* ---------- one card per scan type ---------- */

.type-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.type-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.15s,
    background 0.15s;
}

.type-card:hover {
  transform: translateY(-2px);
  border-color: rgba(109, 168, 255, 0.35);
}

.type-card.is-active {
  border-color: var(--primary);
  background: linear-gradient(
    140deg,
    rgba(85, 225, 189, 0.08),
    var(--card) 60%
  );
}

.type-card-icon,
.group-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(109, 168, 255, 0.1);
  color: var(--primary2);
}

.type-card.is-active .type-card-icon {
  background: rgba(85, 225, 189, 0.12);
  color: var(--primary);
}

.type-card-icon svg,
.group-icon svg,
.history-search svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.type-card-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.type-card-label {
  font-size: 13px;
  color: var(--muted);
}

.type-card-body strong {
  font-size: 26px;
  line-height: 1.1;
}

.type-card-latest {
  font-size: 12px;
  color: var(--muted);
}

.type-card-latest .badge {
  padding: 2px 7px;
  font-size: 11px;
}

/* ---------- toolbar: tabs, search, sort ---------- */

.history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: #08101c;
  border: 1px solid var(--line);
}

.type-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.type-tab:hover {
  color: var(--text);
}

.type-tab.is-active {
  background: rgba(85, 225, 189, 0.12);
  color: var(--primary);
}

.type-tab-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  text-align: center;
}

.history-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.history-search {
  position: relative;
  display: flex;
  align-items: center;
}

.history-search svg {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

.history-search input {
  width: 200px;
  padding: 9px 12px 9px 36px;
  font-size: 14px;
}

.history-sort {
  padding: 9px 12px;
  border: 1px solid rgba(148, 171, 201, 0.18);
  border-radius: 10px;
  background: #0b1422;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

/* ---------- groups ---------- */

.history-group {
  padding: 20px 0 6px;
  border-bottom: 1px solid var(--line);
}

.history-group:last-child {
  border-bottom: 0;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.group-head h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 17px;
}

.group-head p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.group-count {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.group-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 6px 0 14px 56px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 171, 201, 0.2);
  color: var(--muted);
  font-size: 14px;
}

.group-empty.is-center {
  justify-content: center;
  margin: 24px 0 8px;
}

.group-more {
  margin: 0 0 14px 56px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.group-more:hover {
  text-decoration: underline;
}

/* ---------- scan rows ---------- */

.history-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 84px 60px;
  align-items: center;
  gap: 16px;
  margin-left: 42px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text);
  transition: background 0.15s;
}

.history-row:hover {
  background: #0e1929;
}

.history-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.history-main b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-main small,
.history-risk small {
  color: var(--muted);
  font-size: 12px;
}

.history-status {
  color: var(--medium);
}

.history-risk {
  display: grid;
  gap: 5px;
}

.history-risk .scan-meter {
  display: block;
}

.meter-low {
  background: var(--low);
}
.meter-medium {
  background: var(--medium);
}
.meter-high {
  background: var(--high);
}
.meter-critical {
  background: var(--critical);
}

.history-row .badge {
  justify-self: start;
}

.history-view {
  justify-self: end;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

/* ---------- scan history responsive ---------- */

@media (max-width: 1200px) {
  .type-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  .type-tabs {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .type-tab {
    flex-shrink: 0;
  }

  .history-tools,
  .history-search,
  .history-search input {
    width: 100%;
  }

  .history-sort {
    flex: 1;
  }

  .history-row {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-left: 0;
    padding: 12px 6px;
  }

  .history-risk,
  .history-view {
    display: none;
  }

  .group-empty,
  .group-more {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .type-cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .type-card {
    flex-direction: column;
    gap: 10px;
    padding: 14px;
  }

  .type-card-latest {
    display: none;
  }
}

/* =====================================================================
   8. THREAT DETECTIONS — threats.php
===================================================================== */

.threat-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.threat-card {
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 14px;
}

.threat-card h3 {
  margin: 12px 0 6px;
}

.threat-card p {
  color: var(--muted);
}

@media (max-width: 1000px) {
  .threat-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .threat-list {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   9. NOTIFICATIONS — notifications.php
===================================================================== */

.notification {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #0e1929;
}

.notification.read {
  opacity: 0.65;
}

.notification small {
  color: var(--muted);
}

/* =====================================================================
   10. REPORTS — reports.php, report_view.php
===================================================================== */

.recommendations {
  padding-left: 20px;
  margin: 0;
}

.recommendations li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

/* ---------- report page ---------- */

.report {
  max-width: 980px;
  margin: 0 auto;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- cover ---------- */

.rp-cover {
  padding: 30px 40px 32px;
  background:
    radial-gradient(
      circle at 85% 0%,
      rgba(109, 168, 255, 0.16),
      transparent 45%
    ),
    radial-gradient(
      circle at 0% 100%,
      rgba(85, 225, 189, 0.14),
      transparent 45%
    ),
    linear-gradient(120deg, #0b1422, #0e2531);
  border-bottom: 1px solid var(--line);
}

.rp-cover-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.rp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #bccfea;
}

.rp-brand .logo {
  width: 32px;
  height: 32px;
}

.rp-actions {
  display: flex;
  gap: 8px;
}

.rp-cover h2 {
  margin: 10px 0 8px;
  font-size: 32px;
  line-height: 1.15;
}

.rp-lead {
  margin: 0 0 24px;
  color: #c7d2e3;
  line-height: 1.6;
}

.rp-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rp-meta li {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(5, 11, 20, 0.45);
  border: 1px solid var(--line);
  min-width: 0;
}

.rp-meta small {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.rp-meta b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

/* ---------- sections ---------- */

.rp-section {
  padding: 32px 40px;
  border-bottom: 1px solid var(--line);
}

.rp-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.rp-head h3 {
  margin: 2px 0 4px;
  font-size: 20px;
}

.rp-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.rp-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(85, 225, 189, 0.12);
  color: var(--primary);
  font-weight: 800;
}

/* ---------- 1. score ---------- */

.rp-score {
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 24px;
  border-radius: 16px;
  background: #0e1929;
  border: 1px solid var(--line);
}

.rp-score .risk-ring {
  width: 160px;
  height: 160px;
}

.rp-score-text {
  flex: 1;
  min-width: 0;
}

.rp-score-text .risk-pill {
  font-size: 26px;
  font-weight: 800;
}

.rp-score-text > p {
  margin: 10px 0 18px;
  color: #c7d2e3;
  line-height: 1.6;
}

.rp-formula {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.rp-formula b {
  color: var(--text);
}

.rp-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.rp-fact {
  --tone: var(--low);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: #0e1929;
  border: 1px solid var(--line);
  border-top: 3px solid var(--tone);
}

.rp-fact-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 12%, transparent);
}

.rp-fact-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rp-fact b {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.rp-fact small {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 2. charts ---------- */

.rp-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.rp-card {
  margin: 0;
  padding: 20px;
  border-radius: 16px;
  background: #0e1929;
  border: 1px solid var(--line);
}

.rp-card figcaption {
  display: grid;
  gap: 3px;
  margin-bottom: 18px;
}

.rp-card figcaption span {
  color: var(--muted);
  font-size: 13px;
}

.rp-bars {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
}

.rp-bars li {
  display: grid;
  grid-template-columns: 82px 1fr 112px;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.rp-bar-label {
  display: grid;
  gap: 1px;
}

.rp-bar-label small {
  color: var(--muted);
  font-size: 11px;
}

.rp-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.rp-bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rp-bar-fill.is-in {
  width: var(--w);
}

.rp-bar-value {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-weight: 700;
}

.rp-bar-value .badge {
  padding: 3px 7px;
  font-size: 11px;
}

.rp-bars li.is-empty {
  color: var(--muted);
}

.rp-bars li.is-empty .rp-bar-value {
  font-weight: 400;
  font-size: 12px;
}

/* ---------- 3. findings ---------- */

.rp-findings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.rp-finding {
  --tone: var(--low);
  padding: 18px;
  border-radius: 14px;
  background: #0e1929;
  border: 1px solid var(--line);
  border-left: 4px solid var(--tone);
}

.rp-finding-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rp-finding-target {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.rp-finding h4 {
  margin: 12px 0 6px;
  font-size: 16px;
}

.rp-finding p {
  margin: 0 0 12px;
  color: #c7d2e3;
  font-size: 14px;
  line-height: 1.55;
}

.rp-advice {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(85, 225, 189, 0.07);
  font-size: 13px;
  line-height: 1.5;
}

.rp-advice b {
  color: var(--primary);
}

.rp-good {
  padding: 18px;
  border-radius: 14px;
  background: rgba(85, 225, 189, 0.08);
  color: var(--primary);
  font-weight: 600;
}

.rp-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 4. actions ---------- */

.rp-actions-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rp-action {
  --tone: var(--low);
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #0e1929;
  border: 1px solid var(--line);
}

.rp-action.is-medium {
  --tone: var(--medium);
}
.rp-action.is-high {
  --tone: var(--high);
}

.rp-action-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tone) 15%, transparent);
  color: var(--tone);
  font-weight: 800;
}

.rp-action-body {
  line-height: 1.5;
}

.rp-action-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 12%, transparent);
  color: var(--tone);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

/* ---------- 5. scans table ---------- */

.rp-table td {
  vertical-align: middle;
}

.rp-target {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-mini-meter {
  display: inline-block;
  width: 60px;
  height: 6px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.rp-mini-meter span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

/* ---------- 6. how to read ---------- */

.rp-legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.rp-legend-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 12px;
  border-top: 3px solid currentColor;
}

.rp-legend-item small {
  color: var(--muted);
  font-size: 12px;
}

.rp-legend-item p {
  margin: 6px 0 0;
  color: #c7d2e3;
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- footer ---------- */

.rp-footer {
  padding: 22px 40px 28px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.rp-footer p {
  margin: 0 0 6px;
}

/* ---------- report responsive ---------- */

@media (max-width: 900px) {
  .rp-meta,
  .rp-facts,
  .rp-legend {
    grid-template-columns: 1fr 1fr;
  }

  .rp-charts,
  .rp-findings {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .rp-cover,
  .rp-section {
    padding: 24px 20px;
  }

  .rp-footer {
    padding: 20px;
  }

  .rp-cover h2 {
    font-size: 24px;
  }

  .rp-score {
    flex-direction: column;
    text-align: center;
  }

  .rp-score .risk-scale {
    margin: 0 auto;
  }

  .rp-action {
    grid-template-columns: 32px 1fr;
  }

  .rp-action-tag {
    grid-column: 2;
    justify-self: start;
  }

  .rp-bars li {
    grid-template-columns: 74px 1fr;
  }

  .rp-bar-value {
    grid-column: 2;
    justify-content: flex-start;
  }
}

/* =====================================================================
   11. PROFILE — profile.php
===================================================================== */

.form-panel {
  max-width: 800px;
}

.profile-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 20px;
}

.profile-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.full-name-field {
  grid-column: 1 / -1;
}

.profile-form label:last-of-type {
  grid-column: 1/-1;
}

.profile-form button {
  width: max-content;
}

/* ---------- profile picture ---------- */

.profile-picture-section {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.profile-picture-wrapper {
  width: 140px;
  height: 140px;
}

.profile-picture,
.default-profile-picture {
  width: 140px;
  height: 140px;
  border-radius: 50%;
}

.profile-picture {
  object-fit: cover;
  border: 4px solid #55e1bd;
}

.default-profile-picture {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #55e1bd, #6da8ff);
  color: #edf5ff;
  font-size: 50px;
  font-weight: bold;
  border: 4px solid #55e1bd;
}

/* ---------- upload area ---------- */

.picture-upload-area {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 5px;
}

.picture-upload-area input[type="file"] {
  display: none;
}

.upload-picture-btn {
  display: inline-block;
  padding: 10px 16px;
  background: rgba(85, 225, 189, 0.1);
  color: #55e1bd;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

.upload-picture-btn:hover {
  background: rgba(85, 225, 189, 0.16);
}

.selected-file-name {
  font-size: 13px;
  color: #8190a6;
}

@media (max-width: 650px) {
  .profile-form {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   12. DOWNLOAD EXTENSION — download_extension.php
   (moved to section 16 at the bottom of this file)
===================================================================== */

/* =====================================================================
   13. LOGIN / MFA PAGES — login.php, mfa-setup.php
===================================================================== */

.public-main {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 20% 10%,
      rgba(53, 145, 184, 0.11),
      transparent 30%
    ),
    #050b14;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  max-width: 1150px;
  margin: auto;
  gap: 70px;
  padding: 40px;
}

.auth-hero h2 {
  font-size: 48px;
  line-height: 1.05;
  margin: 12px 0;
}

.auth-hero p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.feature-mini {
  display: grid;
  gap: 10px;
  margin-top: 25px;
}

.auth-card {
  padding: 34px;
}

.auth-card h2 {
  margin-top: 0;
}

.auth-card input {
  margin-top: 6px;
  margin-bottom: 16px;
}

.auth-card label {
  margin: 15px 0;
}

.auth-card .btn {
  width: 100%;
  margin-top: 5px;
}

/* ---------- google sign-in ---------- */

.google-account-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin: 16px 0;
}

.google-account-divider::before,
.google-account-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid #334155;
}

.google-account-divider span {
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}

.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

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

  .auth-hero h2 {
    font-size: 38px;
  }
}

@media (max-width: 650px) {
  .auth-wrap {
    padding: 24px;
  }

  .auth-hero h2 {
    font-size: 34px;
  }
}

/* =====================================================================
   14. PAGE TRANSITION — assets/page-transition.js (every page)
===================================================================== */

@property --tx-r {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

/* covers the new page until the overlay is built */
html.tx-in::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #050b14;
}

.tx-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  background:
    radial-gradient(
      circle at 50% 50%,
      rgba(85, 225, 189, 0.12),
      transparent 40%
    ),
    #050b14;
  clip-path: circle(0px at var(--x, 50%) var(--y, 50%));
  transition: clip-path 0.3s cubic-bezier(0.7, 0, 0.2, 1);
}

.tx-overlay.is-covering {
  clip-path: circle(150vmax at var(--x, 50%) var(--y, 50%));
}

.tx-overlay.is-covered {
  clip-path: none;
  transition: none;
}

/* a hole opens in the middle and widens until the page is uncovered */
.tx-overlay.is-revealing {
  -webkit-mask: radial-gradient(
    circle at 50% 50%,
    transparent var(--tx-r),
    #000 calc(var(--tx-r) + 1px)
  );
  mask: radial-gradient(
    circle at 50% 50%,
    transparent var(--tx-r),
    #000 calc(var(--tx-r) + 1px)
  );
  animation: tx-reveal 0.35s cubic-bezier(0.7, 0, 0.2, 1) forwards;
}

@keyframes tx-reveal {
  to {
    --tx-r: 150vmax;
  }
}

.tx-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity 0.2s 0.1s,
    transform 0.3s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.is-covering .tx-core,
.is-covered .tx-core {
  opacity: 1;
  transform: none;
}

.is-covered .tx-core {
  transition: none;
}

.is-revealing .tx-core,
.is-revealing .tx-label {
  opacity: 0;
  transform: scale(1.3);
  transition:
    opacity 0.3s,
    transform 0.4s;
}

.tx-ring {
  position: absolute;
  inset: 0;
  fill: none;
  stroke-width: 2;
  animation: tx-spin 1.2s linear infinite;
}

.tx-ring circle {
  stroke: rgba(85, 225, 189, 0.15);
}

.tx-ring .tx-arc {
  stroke: #55e1bd;
  stroke-linecap: round;
  stroke-dasharray: 0.28 0.72;
  filter: drop-shadow(0 0 6px rgba(85, 225, 189, 0.9));
}

@keyframes tx-spin {
  to {
    transform: rotate(360deg);
  }
}

.tx-print {
  width: 30px;
  height: 50px;
  fill: #55e1bd;
  filter: drop-shadow(0 0 14px rgba(85, 225, 189, 0.7));
  animation: tx-pulse 1s ease-in-out infinite alternate;
}

@keyframes tx-pulse {
  to {
    opacity: 0.55;
    transform: scale(0.92);
  }
}

.tx-label {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #8190a6;
  opacity: 0;
  transition: opacity 0.35s 0.4s;
}

.is-covering .tx-label,
.is-covered .tx-label {
  opacity: 1;
}

.tx-label::after {
  content: "";
  animation: tx-dots 1.2s steps(4) infinite;
}

@keyframes tx-dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
}

/* =====================================================================
   15. PRINT & ACCESSIBILITY
===================================================================== */

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  /* keep the risk colours when printing / saving as PDF */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: #fff;
  }

  .sidebar,
  .sidebar-backdrop,
  .topbar,
  .app-bg,
  .no-print {
    display: none !important;
  }

  .main {
    margin: 0 !important;
    padding: 0;
    max-width: none;
  }

  /* report turns into a clean white "paper" version */
  .report {
    --card: #ffffff;
    --text: #0b1422;
    --muted: #5b6b80;
    --line: #dbe3ee;
    max-width: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    color: #0b1422;
  }

  .rp-cover {
    background: #f1f6fb;
    border-radius: 12px;
    border: 1px solid #dbe3ee;
  }

  .rp-brand,
  .rp-lead,
  .rp-score-text > p,
  .rp-finding p,
  .rp-legend-item p {
    color: #33445a;
  }

  .rp-meta li,
  .rp-score,
  .rp-fact,
  .rp-card,
  .rp-finding,
  .rp-action {
    background: #f7fafd;
    border-color: #dbe3ee;
  }

  .rp-meta li {
    background: #fff;
  }

  .ring-track,
  .donut-track {
    stroke: #e5ebf2;
  }

  .ring-progress {
    filter: none;
  }

  .rp-bar-track,
  .rp-mini-meter {
    background: #e5ebf2;
  }

  .risk-scale-marker {
    border-color: #fff;
    background: #0b1422;
  }

  /* darker greens so text stays readable on white */
  .low,
  .rp-advice b,
  .rp-good,
  .rp-num {
    color: #12916f;
  }

  .eyebrow {
    color: #12916f;
  }

  .rp-section {
    padding: 22px 6px;
  }

  .rp-head {
    break-after: avoid;
  }

  /* keep the wide layout on paper */
  .rp-meta,
  .rp-facts,
  .rp-legend {
    grid-template-columns: repeat(4, 1fr);
  }

  .rp-charts,
  .rp-findings {
    grid-template-columns: 1fr 1fr;
  }

  .rp-score {
    flex-direction: row;
    text-align: left;
  }

  .rp-finding,
  .rp-action,
  .rp-card,
  .rp-fact,
  tr {
    break-inside: avoid;
  }

  .rp-bar-fill {
    width: var(--w) !important;
    transition: none;
  }
}

/* people who turn off animations in their system settings */
@media (prefers-reduced-motion: reduce) {
  .dash,
  .bar-fill,
  .rp-bar-fill,
  .risk-scale-marker,
  .sidebar-ready .sidebar,
  .sidebar-ready .main {
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================================
   16. APP ATMOSPHERE — every signed-in page
   Moving background (same family as index.php), see-through panels,
   small motion details, and the Download Extension page.
===================================================================== */

:root {
  --glass: rgba(11, 20, 34, 0.76);
  --glass-2: rgba(14, 25, 41, 0.6);
  --accent-2: #4ea8ff;
  --font-mono: Consolas, ui-monospace, "SFMono-Regular", monospace;
}

@property --wlm-spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes wlmSpin {
  to {
    --wlm-spin: 360deg;
  }
}

/* ---------- background layer ---------- */

.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* faint grid, strongest in the middle of the screen */
.app-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 171, 201, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 171, 201, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(
    ellipse at 60% 40%,
    #000 15%,
    transparent 75%
  );
  mask-image: radial-gradient(ellipse at 60% 40%, #000 15%, transparent 75%);
}

.app-bg canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

.app-orb {
  position: absolute;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.26;
  animation: appOrb 20s ease-in-out infinite alternate;
}

.app-orb.orb-a {
  top: -140px;
  left: 30%;
  background: #1d6f8f;
}

.app-orb.orb-b {
  bottom: -180px;
  right: 8%;
  background: #1b7a63;
  animation-delay: -10s;
}

@keyframes appOrb {
  to {
    transform: translate(-70px, 50px) scale(1.15);
  }
}

/* radar in the top-right corner — blips light up as the sweep passes */
.app-radar {
  position: absolute;
  top: -230px;
  right: -230px;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  opacity: 0.6;
  background:
    repeating-radial-gradient(
      circle,
      transparent 0 61px,
      rgba(85, 225, 189, 0.1) 61px 62px
    ),
    linear-gradient(
      transparent calc(50% - 0.5px),
      rgba(85, 225, 189, 0.08) 0 calc(50% + 0.5px),
      transparent 0
    ),
    linear-gradient(
      90deg,
      transparent calc(50% - 0.5px),
      rgba(85, 225, 189, 0.08) 0 calc(50% + 0.5px),
      transparent 0
    );
  -webkit-mask-image: radial-gradient(circle, #000 35%, transparent 70%);
  mask-image: radial-gradient(circle, #000 35%, transparent 70%);
}

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0 280deg,
    rgba(85, 225, 189, 0.16) 350deg,
    rgba(85, 225, 189, 0.45) 360deg
  );
  animation: tx-spin 9s linear infinite;
}

.blip {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px;
  border-radius: 50%;
  background: #55e1bd;
  box-shadow: 0 0 12px #55e1bd;
  opacity: 0;
  transform: rotate(calc(var(--a) * 1deg)) translateX(var(--r));
  animation: blip 9s linear infinite;
  /* fire when the sweep reaches this blip's angle */
  animation-delay: calc((var(--a) + 90) * 9s / 360);
}

@keyframes blip {
  0% {
    opacity: 1;
  }
  30%,
  100% {
    opacity: 0;
  }
}

/* footprints that walk across the screen (placed by app-fx.js) */
.app-trail {
  position: absolute;
  inset: 0;
}

.fp-print {
  position: absolute;
  width: 12px;
  height: 20px;
  margin: -10px 0 0 -6px;
  fill: #55e1bd;
  opacity: 0;
  transform: rotate(var(--rot));
  filter: drop-shadow(0 0 6px rgba(85, 225, 189, 0.6));
  animation: fpStep 6.5s ease-out forwards;
}

@keyframes fpStep {
  0% {
    opacity: 0;
    transform: rotate(var(--rot)) scale(0.6);
  }
  8% {
    opacity: 0.5;
    transform: rotate(var(--rot)) scale(1);
  }
  60% {
    opacity: 0.22;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--rot)) scale(1);
  }
}

/* ---------- layout sits above the background ---------- */

.main {
  position: relative;
  z-index: 1;
}

.sidebar {
  background: rgba(6, 16, 28, 0.88);
  border-right: 1px solid var(--line);
}

.brand-text {
  letter-spacing: -0.2px;
}

.topbar h1 {
  font-weight: 700;
  letter-spacing: -0.4px;
}

.topbar-crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  color: #5f7894;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #55e1bd;
  box-shadow: 0 0 0 0 rgba(85, 225, 189, 0.6);
  animation: livePulse 2s ease-out infinite;
}

@keyframes livePulse {
  70% {
    box-shadow: 0 0 0 7px rgba(85, 225, 189, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(85, 225, 189, 0);
  }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ext-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(85, 225, 189, 0.28);
  background: rgba(85, 225, 189, 0.07);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.ext-chip[hidden] {
  display: none;
}

.ext-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.avatar {
  border: 1px solid rgba(85, 225, 189, 0.3);
}

@media (max-width: 650px) {
  .ext-chip {
    font-size: 0;
    gap: 0;
    padding: 9px;
  }
}

/* ---------- see-through surfaces ---------- */

.panel,
.scanner-card,
.info-panel,
.glance-card,
.type-card {
  background-color: var(--glass);
}

.dash-hero {
  background:
    radial-gradient(
      circle at 12% 50%,
      rgba(85, 225, 189, 0.12),
      transparent 45%
    ),
    linear-gradient(120deg, rgba(11, 20, 34, 0.85), rgba(14, 37, 49, 0.75));
}

.panel,
.scanner-card,
.dash-hero,
.ext-hero {
  position: relative;
  isolation: isolate;
}

/* soft light that follows the cursor (position set by app-fx.js) */
.panel::before,
.scanner-card::before,
.ext-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    460px circle at var(--mx, 50%) var(--my, -300px),
    rgba(85, 225, 189, 0.07),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.35s;
}

.panel:hover::before,
.scanner-card:hover::before,
.ext-hero:hover::before {
  opacity: 1;
}

/* thin highlight along the top edge of each panel */
.panel::after,
.dash-hero::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 28px;
  right: 28px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(85, 225, 189, 0.35),
    transparent
  );
}

/* moving light around the border on hover — same as the index cards */
.glance-card,
.type-card,
.threat-card,
.ext-card,
.scanner-card {
  position: relative;
}

.glance-card::after,
.type-card::after,
.threat-card::after,
.ext-card::after,
.scanner-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: conic-gradient(
    from var(--wlm-spin),
    transparent 0 55%,
    rgba(85, 225, 189, 0.9) 70%,
    rgba(78, 168, 255, 0.9) 82%,
    transparent 95%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
}

.glance-card:hover::after,
.type-card:hover::after,
.threat-card:hover::after,
.ext-card:hover::after {
  opacity: 1;
  animation: wlmSpin 6s linear infinite;
}

/* the scanner card is always lit, like the trace box on the landing page */
.scanner-card::after {
  opacity: 0.75;
  animation: wlmSpin 7s linear infinite;
}

.scanner-card {
  box-shadow:
    var(--shadow),
    0 0 70px -30px rgba(85, 225, 189, 0.45);
}

/* fade-up when a panel scrolls into view (class added by app-fx.js) */
.fx-reveal:not(.is-in) {
  opacity: 0;
}

.fx-reveal.is-in {
  animation: fxUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0s) backwards;
}

@keyframes fxUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ---------- empty + loading states get a small pulsing radar ---------- */

.main .empty::before {
  content: "";
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 1px solid rgba(85, 225, 189, 0.35);
  background: radial-gradient(circle, #55e1bd 0 3px, transparent 4px);
  animation: emptyPing 2.4s ease-out infinite;
}

@keyframes emptyPing {
  0% {
    box-shadow:
      0 0 0 0 rgba(85, 225, 189, 0.25),
      0 0 0 0 rgba(85, 225, 189, 0.12);
  }
  100% {
    box-shadow:
      0 0 0 14px rgba(85, 225, 189, 0),
      0 0 0 28px rgba(85, 225, 189, 0);
  }
}

.empty-link {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
}

/* buttons don't pick up the page font by themselves */
.btn,
button,
select {
  font-family: inherit;
}

/* ---------- scanner ---------- */

.info-panel h3 {
  margin-bottom: 18px;
}

.scanner-card h2 {
  letter-spacing: -0.5px;
}

.scanner-card > p {
  color: #b5c3d6;
  line-height: 1.6;
}

.scan-options span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: rgba(14, 25, 41, 0.6);
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}

.scan-options span:hover {
  border-color: rgba(109, 168, 255, 0.4);
}

.scan-options svg,
.three-col svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.big-input:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(85, 225, 189, 0.6);
  box-shadow: 0 0 0 3px rgba(85, 225, 189, 0.12);
}

/* a beam sweeps the card while a scan is running */
.scan-beam {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 70px;
  border-radius: 16px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(85, 225, 189, 0.12) 85%,
    rgba(85, 225, 189, 0.6) 100%
  );
  animation: beam 1.4s ease-in-out infinite alternate;
}

.scanner-card:has(#scanBtn:disabled) .scan-beam {
  display: block;
}

@keyframes beam {
  to {
    top: calc(100% - 70px);
  }
}

#scanBtn {
  gap: 10px;
}

#scanBtn:disabled {
  cursor: progress;
  opacity: 0.85;
}

#scanBtn:disabled::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(11, 20, 34, 0.25);
  border-top-color: #0b1422;
  animation: tx-spin 0.8s linear infinite;
}

.three-col b {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}

.three-col svg {
  color: var(--primary);
}

/* ---------- threats & notifications ---------- */

.threat-card {
  background: var(--glass-2);
  transition: transform 0.2s;
}

.threat-card:hover {
  transform: translateY(-2px);
}

.notification {
  background: var(--glass-2);
  border-radius: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  transition: border-color 0.15s;
}

.notification:not(.read) {
  border-left: 2px solid var(--primary);
  background:
    linear-gradient(90deg, rgba(85, 225, 189, 0.07), transparent 45%),
    var(--glass-2);
}

.notification:hover {
  border-color: rgba(109, 168, 255, 0.35);
}

/* sites checked by the browser extension (threats.php) */
.site-history {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 90px 80px;
  align-items: center;
  gap: 16px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
}

.site-row:last-child {
  border-bottom: 0;
}

.site-host {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.site-host b,
.site-host small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-host small,
.site-reasons,
.site-time {
  font-size: 12px;
  color: var(--muted);
}

.site-time {
  font-family: var(--font-mono);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .site-row {
    grid-template-columns: 1fr auto;
  }

  .site-reasons,
  .site-time {
    grid-column: 1 / -1;
  }
}

/* ---------- profile: slow orbit around the picture ---------- */

.profile-picture-wrapper {
  position: relative;
}

.profile-picture-wrapper::before,
.profile-picture-wrapper::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.profile-picture-wrapper::before {
  inset: -9px;
  background: conic-gradient(
    transparent 0 60%,
    #55e1bd 82%,
    #4ea8ff 94%,
    transparent
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 2px),
    #000 calc(100% - 1.5px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 2px),
    #000 calc(100% - 1.5px)
  );
  animation: tx-spin 6s linear infinite;
}

.profile-picture-wrapper::after {
  inset: -20px;
  border: 1px dashed rgba(85, 225, 189, 0.18);
  animation: tx-spin 40s linear infinite reverse;
}

.profile-picture,
.default-profile-picture {
  border-width: 3px;
}

/* ---------- download extension page ---------- */

.ext-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 40px;
  padding: 38px 40px;
  margin-bottom: 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(
      circle at 85% 30%,
      rgba(78, 168, 255, 0.1),
      transparent 45%
    ),
    linear-gradient(120deg, rgba(11, 20, 34, 0.86), rgba(14, 37, 49, 0.74));
  box-shadow: var(--shadow);
}

.ext-hero h2 {
  margin: 10px 0 12px;
  font-size: 34px;
  line-height: 1.12;
  letter-spacing: -0.6px;
}

.ext-hero p {
  margin: 0;
  color: #b5c3d6;
  line-height: 1.7;
  max-width: 520px;
}

.ext-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 18px;
}

.ext-actions .btn {
  gap: 9px;
  padding: 12px 18px;
}

.ext-actions svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ext-status span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
}

.ext-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5f7894;
}

.ext-status .is-linked {
  display: none;
  color: var(--primary);
}

.ext-status .is-linked i {
  background: var(--primary);
  animation: livePulse 2s ease-out infinite;
}

html[data-ext="linked"] .ext-status .is-linked {
  display: inline-flex;
}

html[data-ext="linked"] .ext-status .is-missing {
  display: none;
}

.ext-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.ext-meta li {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: #a9b8cc;
}

/* mock browser window with the popup open */
.ext-mock {
  position: relative;
  padding: 10px 0 30px;
}

.mock-browser {
  position: relative;
  border-radius: 14px;
  border: 1px solid rgba(148, 171, 201, 0.2);
  background: #08111e;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
  animation: mockFloat 7s ease-in-out infinite alternate;
}

@keyframes mockFloat {
  to {
    transform: translateY(-8px);
  }
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.mock-bar > i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1f3048;
}

.mock-url {
  flex: 1;
  margin-left: 8px;
  padding: 5px 10px;
  border-radius: 7px;
  background: #0e1a2b;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #ff8a9c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), #318dff);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.mock-icon b {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #ff647c;
  font-size: 9px;
}

.mock-page {
  display: grid;
  gap: 10px;
  padding: 26px 22px 120px;
}

.mock-page span {
  height: 9px;
  border-radius: 5px;
  background: rgba(148, 171, 201, 0.08);
}

.mock-page span.short {
  width: 55%;
}

.mock-popup {
  position: absolute;
  top: 46px;
  right: 10px;
  width: 250px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(85, 225, 189, 0.25);
  background: #0b1422;
  box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.9);
  font-size: 12px;
}

.mock-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mock-head .logo {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
}

.mock-head em {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  color: var(--primary);
}

.mock-risk {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 100, 124, 0.07);
}

.mock-risk svg {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}

.mock-risk circle {
  fill: none;
  stroke-width: 4;
}

.mock-risk div {
  display: grid;
}

.mock-risk small {
  font-size: 9px;
  letter-spacing: 1.3px;
  color: var(--muted);
}

.mock-risk strong {
  color: #ff647c;
  font-size: 14px;
}

.mock-risk span {
  color: var(--muted);
  font-size: 11px;
}

.mock-popup ul {
  display: grid;
  gap: 5px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  color: #b5c3d6;
}

.mock-popup li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: #ffb65c;
  vertical-align: middle;
}

.mock-search {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: #5f7894;
}

/* what it does */
.ext-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.ext-card {
  padding: 22px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow);
}

.ext-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--primary);
  background: rgba(85, 225, 189, 0.1);
}

.ext-card-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ext-card h3 {
  margin: 16px 0 6px;
  font-size: 17px;
}

.ext-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

/* install steps */
.ext-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.ext-steps li {
  position: relative;
  padding: 18px;
  border-radius: 14px;
  background: var(--glass-2);
  border: 1px solid var(--line);
  counter-increment: step;
}

.ext-steps li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--primary);
}

.ext-steps h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.ext-steps p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.ext-steps code,
.ext-privacy code {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(85, 225, 189, 0.08);
  color: #8af1d6;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* how syncing works: a packet travels along the line */
.ext-flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.ext-flow::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 12.5%;
  right: 12.5%;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(85, 225, 189, 0.4),
    rgba(78, 168, 255, 0.4)
  );
}

.ext-flow::after {
  content: "";
  position: absolute;
  top: 19px;
  left: 12.5%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #55e1bd;
  box-shadow: 0 0 12px #55e1bd;
  animation: packet 5s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

@keyframes packet {
  0% {
    left: 12.5%;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    left: 87.5%;
    opacity: 0;
  }
}

.ext-flow li {
  position: relative;
  text-align: center;
}

.ext-flow .node {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 1px solid rgba(85, 225, 189, 0.35);
  background: #08111e;
  color: var(--primary);
}

.ext-flow .node svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ext-flow b {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.ext-flow small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  padding: 0 6px;
}

.ext-privacy {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ext-privacy li {
  padding-left: 14px;
  border-left: 2px solid rgba(85, 225, 189, 0.35);
}

.ext-privacy b {
  display: block;
  margin-bottom: 5px;
}

.ext-privacy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .ext-hero {
    grid-template-columns: 1fr;
  }

  .ext-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .ext-hero {
    padding: 26px 22px;
  }

  .ext-hero h2 {
    font-size: 27px;
  }

  .ext-cards,
  .ext-steps,
  .ext-privacy {
    grid-template-columns: 1fr;
  }

  .ext-flow {
    grid-template-columns: 1fr 1fr;
    row-gap: 24px;
  }

  .ext-flow::before,
  .ext-flow::after {
    display: none;
  }

  .mock-popup {
    width: 210px;
  }

  .app-radar {
    opacity: 0.35;
  }
}

/* ---------- people who turn off animations ---------- */

@media (prefers-reduced-motion: reduce) {
  .app-orb,
  .radar-sweep,
  .blip,
  .live-dot,
  .mock-browser,
  .ext-flow::after,
  .main .empty::before,
  .scanner-card::after,
  .profile-picture-wrapper::before,
  .profile-picture-wrapper::after {
    animation: none !important;
  }

  .blip,
  .ext-flow::after {
    display: none;
  }
}

/* ---------- unread count on the sidebar "Notifications" link ---------- */
/* (added by assets/notification-badge.js) */

.sidebar nav a {
  position: relative;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ff647c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 3px rgba(255, 100, 124, 0.18);
  animation: badgePop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes badgePop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
}

/* collapsed sidebar: just a small dot on the bell icon */
@media (min-width: 1001px) {
  .sidebar-collapsed .nav-badge {
    position: absolute;
    top: 7px;
    right: 18px;
    min-width: 0;
    width: 9px;
    height: 9px;
    padding: 0;
    font-size: 0;
  }
}

.site-row .badge {
  justify-self: start;
}

/* ---------- shared states used by Personal Scan, OSINT Lookup and scan results ---------- */

/* a check that did not run: grey, never green */
.badge.incomplete,
.badge.info {
  background: rgba(129, 144, 166, 0.14);
  color: var(--muted);
}

.alert.success {
  background: rgba(85, 225, 189, 0.1);
  color: #55e1bd;
  border: 1px solid rgba(85, 225, 189, 0.25);
}

/* old demo results (local rules, not breach data) */
.alert.notice {
  background: rgba(255, 182, 92, 0.1);
  color: #ffb65c;
  border: 1px solid rgba(255, 182, 92, 0.25);
  line-height: 1.5;
}

.alert.notice a {
  color: inherit;
  font-weight: 700;
}

/* ---------- dashboard: full-width panel + "new breaches" feed ---------- */

.dash-grid .span-3 {
  grid-column: 1 / -1;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-item {
  border: 1px solid var(--line, rgba(148, 171, 201, 0.14));
  border-radius: 12px;
  overflow: hidden;
}

.news-head {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.news-head:hover,
.news-head:focus-visible {
  background: color-mix(in srgb, var(--primary, #55e1bd) 7%, transparent);
}

/* logos are wide and transparent: a small white tile keeps any shape readable */
.news-logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.news-logo img,
.news-logo svg {
  max-width: 32px;
  max-height: 32px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.news-logo svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #0b1422;
  stroke-width: 1.8;
}

.news-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.news-text b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-text small,
.news-more {
  color: var(--muted, #8190a6);
  font-size: 12px;
}

.news-detail {
  padding: 0 12px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.news-classes {
  color: var(--muted, #8190a6);
}

/* report legend with the five Safety Score bands */
.rp-legend.rp-legend-5 {
  grid-template-columns: repeat(5, 1fr);
}

.report[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .rp-legend.rp-legend-5 {
    grid-template-columns: 1fr 1fr;
  }
}

/* the WhoLeakMe logo image (round; replaces the old letter / footprint mark) */
img.logo-img,
.login-brand img.logo-mark,
.nav-logo img.logo-mark {
  display: block;
  padding: 0;
  border-radius: 50%;
  background: none;
  object-fit: cover;
  box-shadow: 0 6px 20px -8px rgba(85, 225, 189, 0.6);
}

/* two-step setup page (mfa-setup.php): the "done" step, the back link, the steps' spacing */
.mfa-done {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.mfa-done[hidden] {
  display: none;
}

.mfa-back {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

#mfaStart:not([hidden]),
#mfaSetupForm:not([hidden]) {
  display: grid;
  gap: 10px;
  margin: 10px 0 14px;
}

/* phones: the setup card first, the explanation after it */
@media (max-width: 650px) {
  .mfa-page {
    gap: 28px;
    padding: 18px;
    align-items: start;
  }

  .mfa-page .auth-card {
    order: -1;
    padding: 24px 20px;
  }

  .mfa-page .auth-hero h2 {
    font-size: 26px;
  }
}

/* notifications.php: red dot = not seen yet; lookups run from the extension are tagged */
.notification-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.notif-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--high);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--high) 22%, transparent);
}

.notif-source {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.notification .view-result-btn {
  justify-self: start;
  margin-top: 4px;
}
