/*
 * Resahost — Hosting Diagnostics
 * Design system derived from Resappi ERP (Resaco Design System)
 * Dark mode default, light mode via [data-theme="light"]
 */

/* ─── Google Fonts — Plus Jakarta Sans ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ─── Design tokens — Dark mode (default) ───────────────────────────────────── */
:root {
  /* Brand colors — from Resappi ERP Design System */
  --deep-data-green: #22283E;
  --deep-data-green-alt: #223B3E;
  --signal-zest: #D1F460;
  --insight-blue: #A2DCE8;
  --conversion-lavender: #C69EFF;

  /* Dark mode surface tokens */
  --bg: #0d0f1a;
  --bg-card: #14172a;
  --bg-hover: #1c2038;
  --bg-input: #1a1d30;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: var(--insight-blue);

  /* Text */
  --text: #e8e8f0;
  --text-muted: #8a8fa8;
  --text-on-dark: #FFFFFF;

  /* Semantic status colors */
  --critical: #ef4444;
  --critical-bg: rgba(239, 68, 68, 0.12);
  --high: #f97316;
  --high-bg: rgba(249, 115, 22, 0.12);
  --medium: #eab308;
  --medium-bg: rgba(234, 179, 8, 0.12);
  --low: #3b82f6;
  --low-bg: rgba(59, 130, 246, 0.12);
  --safe: #10b981;
  --safe-bg: rgba(16, 185, 129, 0.12);

  /* Accent */
  --accent: var(--signal-zest);
  --accent-fg: var(--deep-data-green);

  /* Layout */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --container-max: 960px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.25);

  /* Typography */
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Z-index scale */
  --z-base: 1;
  --z-header: 50;
  --z-theme-toggle: 100;
  --z-modal-backdrop: 900;
  --z-modal: 1000;
  --z-toast: 2000;

  /* Header background (with transparency) */
  --header-bg: rgba(13, 15, 26, 0.92);

  /* Card hover border */
  --card-hover-border: rgba(255, 255, 255, 0.14);

  /* Logout btn hover */
  --logout-hover-border: rgba(255, 255, 255, 0.2);
}

/* ─── Light mode tokens ──────────────────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg: #f8f9fc;
  --bg-card: #ffffff;
  --bg-hover: #f0f2f8;
  --bg-input: #ffffff;
  --border: #dfe3ec;
  --border-focus: #3b82f6;

  --text: #14172a;
  --text-muted: #5b6072;
  --text-on-dark: #14172a;

  /* Signal zest slightly darker for contrast on light bg */
  --signal-zest: #84cc16;
  --accent: var(--signal-zest);
  --accent-fg: #ffffff;

  /* Keep status colors — they work on both themes */
  --critical-bg: rgba(239, 68, 68, 0.08);
  --high-bg: rgba(249, 115, 22, 0.08);
  --medium-bg: rgba(234, 179, 8, 0.08);
  --low-bg: rgba(59, 130, 246, 0.08);
  --safe-bg: rgba(16, 185, 129, 0.08);

  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);

  --header-bg: rgba(248, 249, 252, 0.95);
  --card-hover-border: #c8cede;
  --logout-hover-border: #a0a8be;
}

/* ─── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Layout helpers ────────────────────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Theme toggle button ───────────────────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: var(--z-theme-toggle);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 1.05rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  line-height: 1;
  padding: 0;
  font-family: inherit;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--card-hover-border);
  color: var(--text);
}

/* ─── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: var(--header-bg);
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.logo-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--signal-zest);
  letter-spacing: -0.5px;
}

.logo-tagline {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ─── Main ──────────────────────────────────────────────────────────────────── */
.site-main {
  flex: 1;
  padding: 56px 0 80px;
}

/* ─── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 48px;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.8px;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

/* ─── Analyze form ──────────────────────────────────────────────────────────── */
.analyze-form {
  max-width: 640px;
  margin: 0 auto;
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.url-input {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  /* outline: none removed — keyboard focus ring handled by :focus-visible in A11Y block */
}

.url-input::placeholder {
  color: var(--text-muted);
}

.url-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.submit-btn {
  padding: 14px 28px;
  background: var(--signal-zest);
  color: var(--accent-fg);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  min-width: 120px;
  justify-content: center;
}

.submit-btn:hover:not(:disabled) {
  background: #b8e010;
}

:root[data-theme="light"] .submit-btn:hover:not(:disabled) {
  background: #76bb13;
}

.submit-btn:active:not(:disabled) {
  opacity: 0.9;
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-text {
  display: block;
}

/* Button spinner (hidden by default) */
.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(34, 40, 62, 0.3);
  border-top-color: var(--deep-data-green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.submit-btn.loading .btn-spinner {
  display: block;
}

.submit-btn.loading .btn-text {
  display: none;
}

.input-error {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--critical);
  min-height: 20px;
  text-align: left;
}

/* ─── Loading area ──────────────────────────────────────────────────────────── */
.loading-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 64px 0;
}

.spinner-large {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--signal-zest);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── Error card ────────────────────────────────────────────────────────────── */
.error-area {
  animation: fade-in 0.2s ease;
}

.error-card {
  background: var(--critical-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.error-title {
  color: var(--critical);
  font-size: 0.95rem;
  font-weight: 600;
}

.error-message {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── Results area ──────────────────────────────────────────────────────────── */
.results-area {
  animation: fade-in 0.2s ease;
}

/* ─── Results action buttons ────────────────────────────────────────────────── */
.results-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
  min-width: 110px;
  justify-content: center;
}

.action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.action-btn-pdf {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
}

.action-btn-pdf:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--card-hover-border);
}

.action-btn-share {
  background: var(--signal-zest);
  border: 1px solid transparent;
  color: var(--accent-fg);
}

.action-btn-share:hover:not(:disabled) {
  opacity: 0.88;
}

.action-btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
  opacity: 0.6;
}

.action-btn.loading .action-btn-text {
  display: none;
}

.action-btn.loading .action-btn-spinner {
  display: block;
}

/* ─── Risk Badge ────────────────────────────────────────────────────────────── */
.risk-badge {
  width: 100%;
  min-height: 140px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  padding: 32px 24px;
  position: relative;
  overflow: hidden;
}

/* Risk level color classes */
.risk-badge.risk-critical {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, rgba(239, 68, 68, 0.08) 100%);
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.08);
}

.risk-badge.risk-high {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18) 0%, rgba(249, 115, 22, 0.08) 100%);
  border: 1px solid rgba(249, 115, 22, 0.35);
  box-shadow: 0 0 40px rgba(249, 115, 22, 0.08);
}

.risk-badge.risk-medium {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.18) 0%, rgba(234, 179, 8, 0.08) 100%);
  border: 1px solid rgba(234, 179, 8, 0.35);
  box-shadow: 0 0 40px rgba(234, 179, 8, 0.08);
}

.risk-badge.risk-low {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(59, 130, 246, 0.08) 100%);
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.08);
}

.risk-badge.risk-safe {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.08);
}

.risk-badge-inner {
  text-align: center;
}

.risk-level-text {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.risk-badge.risk-critical .risk-level-text { color: var(--critical); }
.risk-badge.risk-high     .risk-level-text { color: var(--high); }
.risk-badge.risk-medium   .risk-level-text { color: var(--medium); }
.risk-badge.risk-low      .risk-level-text { color: var(--low); }
.risk-badge.risk-safe     .risk-level-text { color: var(--safe); }

.risk-summary {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.6;
}

/* ─── Cards grid ────────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 20px;
}

.card-attacker,
.card-diagnostics {
  grid-column: 1 / -1;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: var(--card-hover-border);
}

.card-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ─── Issues list ───────────────────────────────────────────────────────────── */
.issues-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.issue-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.issue-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.issue-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.issue-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.issue-detail {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding-left: 2px;
}

/* ─── Severity badges ───────────────────────────────────────────────────────── */
.severity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.severity-critical {
  background: var(--critical-bg);
  color: var(--critical);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.severity-high {
  background: var(--high-bg);
  color: var(--high);
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.severity-medium {
  background: var(--medium-bg);
  color: var(--medium);
  border: 1px solid rgba(234, 179, 8, 0.25);
}

.severity-low {
  background: var(--low-bg);
  color: var(--low);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.severity-info {
  background: rgba(162, 220, 232, 0.1);
  color: var(--insight-blue);
  border: 1px solid rgba(162, 220, 232, 0.2);
}

/* ─── Recommendations list ──────────────────────────────────────────────────── */
.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 0;
  list-style: none;
  counter-reset: rec-counter;
}

.rec-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  counter-increment: rec-counter;
}

.rec-item::before {
  content: counter(rec-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: rgba(209, 244, 96, 0.12);
  border: 1px solid rgba(209, 244, 96, 0.25);
  color: var(--signal-zest);
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 2px;
}

:root[data-theme="light"] .rec-item::before {
  background: rgba(132, 204, 22, 0.12);
  border-color: rgba(132, 204, 22, 0.3);
}

.rec-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ─── Attacker impact card ──────────────────────────────────────────────────── */
.attacker-worst-case {
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  background: var(--critical-bg);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.attacker-worst-case-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--critical);
  margin-bottom: 6px;
  display: block;
}

.attacker-worst-case-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 8px;
}

.attacker-likelihood {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 10px;
  border-radius: 999px;
}

.likelihood-low    { background: var(--low-bg);    color: var(--low);    border: 1px solid rgba(59,130,246,0.25); }
.likelihood-medium { background: var(--medium-bg); color: var(--medium); border: 1px solid rgba(234,179,8,0.25); }
.likelihood-high   { background: var(--critical-bg); color: var(--critical); border: 1px solid rgba(239,68,68,0.25); }

.attacker-scenarios {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.scenario-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

:root[data-theme="light"] .scenario-card {
  background: var(--bg-hover);
}

.scenario-vector {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--conversion-lavender);
}

:root[data-theme="light"] .scenario-vector {
  color: #7c3aed;
}

.scenario-access {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  background: rgba(198, 158, 255, 0.12);
  color: var(--conversion-lavender);
  border: 1px solid rgba(198, 158, 255, 0.2);
  border-radius: 999px;
  width: fit-content;
}

:root[data-theme="light"] .scenario-access {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.2);
}

.scenario-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scenario-row-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.scenario-row-value {
  font-size: 0.83rem;
  color: var(--text);
  line-height: 1.45;
}

/* ─── Diagnostics / details ─────────────────────────────────────────────────── */
.diagnostics-details {
  width: 100%;
}

.diagnostics-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
  transition: color 0.15s ease;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.diagnostics-summary::-webkit-details-marker {
  display: none;
}

.diagnostics-summary::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  margin-right: 2px;
}

details[open] .diagnostics-summary::before {
  transform: rotate(45deg);
}

.diagnostics-summary:hover {
  color: var(--text);
}

details[open] .diagnostics-summary {
  color: var(--text);
  margin-bottom: 20px;
}

.diagnostics-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 24px;
  align-items: start;
}

.diagnostics-dl dt {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding-top: 2px;
}

.diagnostics-dl dd {
  font-size: 0.88rem;
  color: var(--text);
  font-family: 'Monaco', 'Consolas', monospace;
  word-break: break-word;
}

.diag-missing {
  color: var(--text-muted);
  font-style: italic;
}

.diag-warn {
  color: var(--medium);
}

.diag-ok {
  color: var(--safe);
}

.diag-bad {
  color: var(--critical);
}

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
}

.footer-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.02em;
}

/* ─── Share modal ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in 0.15s ease;
}

:root[data-theme="light"] .modal-overlay {
  background: rgba(20, 23, 42, 0.45);
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

:root[data-theme="light"] .modal-box {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.modal-label {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.modal-url-row {
  display: flex;
  gap: 8px;
}

.modal-url-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.82rem;
  padding: 10px 14px;
  /* outline: none removed — keyboard focus ring handled by :focus-visible in A11Y block */
}

.modal-copy-btn {
  padding: 10px 16px;
  background: var(--signal-zest);
  color: var(--accent-fg);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.modal-copy-btn:hover {
  opacity: 0.85;
}

.modal-copy-btn.copied {
  background: var(--safe);
  color: #fff;
}

.modal-expires {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-close-btn {
  align-self: flex-end;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.83rem;
  font-weight: 500;
  padding: 8px 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.modal-close-btn:hover {
  border-color: var(--card-hover-border);
  color: var(--text);
}

/* ─── Shared report view ────────────────────────────────────────────────────── */
#shared-view {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.shared-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.shared-header .container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shared-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--medium-bg);
  color: var(--medium);
  border: 1px solid rgba(234, 179, 8, 0.25);
}

.shared-footer-note {
  margin-top: 32px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
}

/* ─── Animations ────────────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* ─── [hidden] utility ──────────────────────────────────────────────────────── */
[hidden] {
  display: none !important;
}

/* ─── Auth views ─────────────────────────────────────────────────────────────── */

/* Login view — full-page centered layout */
#login-view,
#callback-view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: var(--z-base);
}

/* App view fills remaining space */
#app-view {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.login-outer,
.callback-outer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 24px;
}

/* Login card */
.login-container {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 40px 40px;
  box-shadow: var(--shadow-card), 0 0 80px rgba(209, 244, 96, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fade-in 0.25s ease;
}

/* Logo block inside login card */
.login-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 36px;
}

.login-logo-name {
  font-size: 2rem;
  font-weight: 800;
  color: var(--signal-zest);
  letter-spacing: -0.8px;
  line-height: 1;
}

.login-logo-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Login headings */
.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 10px;
}

.login-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 300px;
}

/* Primary CTA button */
.login-btn {
  width: 100%;
  padding: 15px 24px;
  background: var(--signal-zest);
  color: var(--accent-fg);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
}

.login-btn:hover {
  opacity: 0.88;
}

.login-btn:active {
  opacity: 0.8;
}

.login-btn:focus-visible {
  outline: 2px solid var(--signal-zest);
  outline-offset: 3px;
}

/* Hint text under login button */
.login-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.75;
  letter-spacing: 0.01em;
}

/* ─── Callback / spinner view ────────────────────────────────────────────────── */
.callback-outer {
  gap: 20px;
}

.callback-spinner {
  width: 52px;
  height: 52px;
  border: 3px solid var(--border);
  border-top-color: var(--signal-zest);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.callback-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.callback-error {
  font-size: 0.88rem;
  color: var(--critical);
  text-align: center;
  max-width: 360px;
  line-height: 1.5;
}

.callback-retry {
  font-size: 0.85rem;
  color: var(--insight-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.callback-retry:hover {
  opacity: 0.75;
}

/* ─── User bar (shown in app-view) ──────────────────────────────────────────── */
.user-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.user-bar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.user-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.logout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.logout-btn:hover {
  border-color: var(--logout-hover-border);
  color: var(--text);
}

/* ─── Session expired inline message ────────────────────────────────────────── */
.session-expired-msg {
  background: var(--medium-bg);
  border: 1px solid rgba(234, 179, 8, 0.3);
  border-radius: var(--radius-md);
  color: var(--medium);
  font-size: 0.85rem;
  padding: 12px 16px;
  margin-bottom: 24px;
  text-align: center;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero-title {
    font-size: 1.75rem;
  }

  .input-row {
    flex-direction: column;
  }

  .submit-btn {
    width: 100%;
  }

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

  .card-attacker,
  .card-diagnostics {
    grid-column: 1;
  }

  .risk-level-text {
    font-size: 2.2rem;
  }

  .logo {
    flex-direction: column;
    gap: 2px;
  }

  .results-actions {
    justify-content: stretch;
  }

  .action-btn {
    flex: 1;
  }

  .attacker-scenarios {
    grid-template-columns: 1fr;
  }
}

/* ─── PageSpeed toggle ──────────────────────────────────────────────────────── */
.pagespeed-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.pagespeed-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.pagespeed-toggle:hover {
  color: var(--text);
}

/* ─── Resaco fix plan card ──────────────────────────────────────────────────── */
.card-fix-plan {
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, var(--bg-card) 0%, color-mix(in srgb, var(--accent) 6%, var(--bg-card)) 100%);
}
.fix-plan-intro {
  color: var(--text-muted);
  margin: 0 0 16px 0;
  font-size: 0.95rem;
}
.fix-plan-actions {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}
.fix-action {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.fix-action-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.fix-action-num {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.fix-action-title {
  font-weight: 600;
  color: var(--text);
}
.fix-action-what {
  color: var(--text-muted);
  margin: 4px 0 8px 38px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.fix-action-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: 38px;
}
.fix-action-time,
.fix-action-tier {
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text-muted);
}
.fix-action-tier {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
  font-weight: 600;
}
.fix-plan-target,
.fix-plan-ongoing {
  background: var(--bg);
  border-left: 3px solid var(--safe, #10b981);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.fix-plan-ongoing {
  border-left-color: var(--low, #3b82f6);
}
.fix-plan-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.fix-plan-target-text,
.fix-plan-ongoing-text {
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}
.fix-plan-total {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}
.fix-plan-cta {
  margin: 16px 0 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.92rem;
}
.fix-plan-cta a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.fix-plan-cta a:hover {
  text-decoration: underline;
}

/* ─── Traffic light meter ───────────────────────────────────────────────────── */
.traffic-light {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px 0;
}
.tl-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  min-height: 40px;
}
.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 30%, transparent);
}
.tl-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tl-value {
  color: var(--text);
  font-weight: 600;
}
.tl-green  { border-color: color-mix(in srgb, #10b981 40%, var(--border)); color: #10b981; }
.tl-green .tl-dot { background: #10b981; }
.tl-yellow { border-color: color-mix(in srgb, #eab308 40%, var(--border)); color: #eab308; }
.tl-yellow .tl-dot { background: #eab308; }
.tl-red    { border-color: color-mix(in srgb, #ef4444 40%, var(--border)); color: #ef4444; }
.tl-red .tl-dot { background: #ef4444; }
.tl-unknown { color: var(--text-muted); }
.tl-unknown .tl-dot { background: var(--text-muted); opacity: 0.5; }

/* ─── Layout/Typography/Responsive polish (A2) ──────────────────────────────── */

/* Reduced motion — vaimentaa kaikki animaatiot */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Content-jumping prevention — varaa tila async-alueille */
.loading-area {
  min-height: 240px;
}

.results-area {
  min-height: 400px;
}

.error-area {
  min-height: 80px;
}

/* Prose max-width — rajoittaa rivipituuden 65–75ch korttipohjaisessa sisällössä */
.card .error-message,
.fix-plan-intro,
.fix-plan-cta,
.fix-plan-target-text,
.fix-plan-ongoing-text,
.fix-action-what,
.loading-text,
.hero-subtitle {
  max-width: 70ch;
}

/* 1440px desktop breakpoint — container max-width kasvaa */
@media (min-width: 1440px) {
  .container {
    max-width: 1280px;
  }
}

/* 375px mobile breakpoint — varmistaa ei horizontal scrollia kapealla viewportilla */
@media (max-width: 375px) {
  .container {
    padding: 0 16px;
  }

  .hero-title {
    font-size: 1.55rem;
  }

  .login-container {
    padding: 36px 24px 28px;
  }

  .modal-box {
    padding: 24px 20px;
  }

  .url-input,
  .submit-btn {
    font-size: 1rem;
  }
}

/* 768px tablet breakpoint — kaksipalstainen grid aktivoituu */
@media (min-width: 768px) and (max-width: 1023px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1024px breakpoint — varmistaa leveän layoutin tasaus */
@media (min-width: 1024px) {
  .site-main {
    padding: 64px 0 96px;
  }
}

/* ─── Accessibility — A11Y fixes (Agent A3) ─────────────────────────────────── */

/*
 * Visually hidden — readable by screen readers, invisible on screen.
 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/*
 * Skip link — hidden off-screen until keyboard focused.
 */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  background: var(--bg-card);
  color: var(--text);
  border: 2px solid var(--border-focus);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  text-decoration: none;
  white-space: nowrap;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 8px;
  left: 8px;
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/*
 * Global focus-visible ring.
 * Removes default outline for pointer/touch interaction;
 * shows a clear 2px ring for keyboard navigation.
 */
*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* url-input already uses border+box-shadow for focus — keep that, add outline on top */
.url-input:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

/* Buttons with rounded pill shapes need matching border-radius on focus ring */
.login-btn:focus-visible,
.submit-btn:focus-visible {
  border-radius: var(--radius-md);
}

.modal-copy-btn:focus-visible,
.modal-close-btn:focus-visible {
  border-radius: var(--radius-md);
}

.logout-btn:focus-visible {
  border-radius: var(--radius-sm);
}

.theme-toggle:focus-visible {
  border-radius: var(--radius-md);
}

/*
 * Touch target sizes — minimum 44×44 px for all interactive elements.
 */

/* theme-toggle: was 36×36, expand to 44×44 */
.theme-toggle {
  min-width: 44px;
  min-height: 44px;
}

/* logout-btn: was ~26px tall (4px+4px padding + 16px font), lift to 44px */
.logout-btn {
  min-height: 44px;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* action-btn (PDF, Share): was ~36px, lift to 44px */
.action-btn {
  min-height: 44px;
}

/* modal-copy-btn and modal-close-btn: lift to 44px */
.modal-copy-btn,
.modal-close-btn {
  min-height: 44px;
}

/* submit-btn already has 14px+14px = 28px padding + ~19px font = 47px — OK, no change */

/* login-btn already has 15px+15px = 30px padding + ~19px font = 49px — OK, no change */

/* ─── Progress timeline ─────────────────────────────────────────────────────── */
.progress-timeline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  list-style: none;
  margin: 0 auto 24px auto;
  padding: 0;
  max-width: 720px;
  position: relative;
  gap: 4px;
}
.progress-timeline::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 12px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.progress-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.progress-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: inline-block;
  transition: background-color 200ms ease, border-color 200ms ease;
  position: relative;
}
.progress-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  transition: color 200ms ease;
}
.progress-step.active .progress-dot {
  border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
  animation: progress-pulse 1.2s ease-in-out infinite;
}
.progress-step.active .progress-label {
  color: var(--text);
  font-weight: 600;
}
.progress-step.done .progress-dot {
  background: var(--accent);
  border-color: var(--accent);
}
.progress-step.done .progress-dot::after {
  content: "";
  position: absolute;
  left: 6px; top: 2px;
  width: 6px; height: 12px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.progress-step.done .progress-label { color: var(--text-muted); }
@keyframes progress-pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
  50%      { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 10%, transparent); }
}
@media (max-width: 640px) {
  .progress-label { font-size: 0.68rem; }
  .progress-dot { width: 20px; height: 20px; }
  .progress-timeline::before { top: 10px; }
}

/* ─── My analyses log ──────────────────────────────────────────────────────── */
.my-analyses {
  margin-top: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
}
.my-analyses-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.my-analyses-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}
.link-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
  min-height: 32px;
}
.link-btn:hover { color: var(--accent); }
.my-analyses-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.analysis-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.9rem;
}
.analysis-row .risk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.risk-pill.risk-critical { background: color-mix(in srgb, #ef4444 15%, transparent); color: #ef4444; }
.risk-pill.risk-high     { background: color-mix(in srgb, #f97316 15%, transparent); color: #f97316; }
.risk-pill.risk-medium   { background: color-mix(in srgb, #eab308 15%, transparent); color: #eab308; }
.risk-pill.risk-low      { background: color-mix(in srgb, #3b82f6 15%, transparent); color: #3b82f6; }
.risk-pill.risk-safe     { background: color-mix(in srgb, #10b981 15%, transparent); color: #10b981; }
.risk-pill.risk-unknown  { background: var(--bg-hover); color: var(--text-muted); }
.analysis-row .analysis-url {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.analysis-row .analysis-date {
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}
.analysis-row .analysis-open {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}
.analysis-row .analysis-open:hover { text-decoration: underline; }
.my-analyses-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 16px 0;
}

/* ─── Target state + Ongoing protection (separate cards) ────────────────────── */
.card-target-state {
  border-left: 4px solid var(--safe, #10b981);
  background: linear-gradient(180deg, var(--bg-card) 0%, color-mix(in srgb, #10b981 5%, var(--bg-card)) 100%);
}
.card-ongoing {
  border-left: 4px solid var(--low, #3b82f6);
  background: linear-gradient(180deg, var(--bg-card) 0%, color-mix(in srgb, #3b82f6 5%, var(--bg-card)) 100%);
}
.target-state-text,
.ongoing-text {
  color: var(--text);
  margin: 8px 0 0 0;
  line-height: 1.55;
  max-width: 70ch;
}
.target-state-total {
  margin: 12px 0 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}
.target-state-total[hidden] { display: none; }

/* ─── Report TOC ─────────────────────────────────────────────────────────────── */
.report-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 24px 0;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.toc-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  padding-right: 4px;
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.toc-item { margin: 0; }
.toc-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 150ms ease, color 150ms ease;
  min-height: 28px;
}
.toc-link::before {
  content: "→ ";
  opacity: 0.5;
  margin-right: 4px;
}
.toc-link:hover,
.toc-link:focus-visible {
  background: color-mix(in srgb, var(--accent) 15%, var(--bg-hover));
  color: var(--accent);
}
.toc-target-flash {
  animation: toc-flash 900ms ease;
}
@keyframes toc-flash {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
  30%  { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .toc-target-flash { animation: none; }
}
html { scroll-behavior: smooth; }
/* Offset scroll anchors if fixed header covers them */
.cards-grid > .card { scroll-margin-top: 20px; }
@media (max-width: 640px) {
  .analysis-row {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 6px 10px;
  }
  .analysis-row .analysis-date,
  .analysis-row .analysis-open { grid-column: 1 / -1; justify-self: start; }
}

/* ─── Email Security card ───────────────────────────────────────────────────── */
.card-email-security { border-top: 3px solid #a855f7; }
.em-risk-pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.em-risk-green  { background: rgba(16,185,129,0.15); color: #10b981; }
.em-risk-yellow { background: rgba(234,179,8,0.15);  color: #eab308; }
.em-risk-red    { background: rgba(239,68,68,0.15);  color: #ef4444; }
.em-risk-unknown{ background: rgba(156,163,175,0.15);color: #9ca3af; }
.em-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin-bottom: 10px; }
.em-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.em-td-label { font-weight: 700; width: 70px; color: #a855f7; }
.em-td-detail { color: var(--text-muted); font-size: 0.8rem; word-break: break-all; }
.em-status-ok   { color: #10b981; font-weight: 600; }
.em-status-bad  { color: #ef4444; font-weight: 600; }
.em-status-warn { color: #eab308; font-weight: 600; }
.em-issues-list { list-style: none; padding: 0; margin-top: 6px; }
.em-issue { font-size: 0.82rem; color: var(--text-muted); padding: 3px 0 3px 14px; position: relative; }
.em-issue::before { content: '·'; position: absolute; left: 4px; color: #a855f7; }

/* ─── WHOIS / Domain card ───────────────────────────────────────────────────── */
.card-whois { border-top: 3px solid #fb923c; }
.whois-expiry-big { display: flex; align-items: baseline; gap: 4px; margin-bottom: 12px; }
.whois-days-num { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.whois-days-label { font-size: 0.85rem; color: var(--text-muted); }
.whois-days-green  .whois-days-num { color: #10b981; }
.whois-days-yellow .whois-days-num { color: #eab308; }
.whois-days-red    .whois-days-num { color: #ef4444; }
.whois-days-unknown .whois-days-num { color: #9ca3af; }
.whois-dl { display: grid; grid-template-columns: 100px 1fr; gap: 4px 12px; font-size: 0.875rem; }
.whois-dt { font-weight: 600; color: var(--text-muted); }
.whois-dd { color: var(--text); }

/* ─── Cookie Audit card ─────────────────────────────────────────────────────── */
.card-cookie { border-top: 3px solid #06b6d4; }
.cookie-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cookie-count { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.cookie-risk-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.cookie-risk-green  { background: rgba(16,185,129,0.15); color: #10b981; }
.cookie-risk-yellow { background: rgba(234,179,8,0.15);  color: #eab308; }
.cookie-risk-red    { background: rgba(239,68,68,0.15);  color: #ef4444; }
.cookie-risk-unknown{ background: rgba(156,163,175,0.15);color: #9ca3af; }

/* ─── Pricing card ──────────────────────────────────────────────────────────── */
.card-pricing { border-top: 3px solid #D1F460; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 640px) { .pricing-grid { grid-template-columns: 1fr 1fr; } }
.pricing-cell { display: flex; flex-direction: column; gap: 4px; }
.pricing-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.pricing-amount { font-size: 1.8rem; font-weight: 800; color: #D1F460; line-height: 1.1; }
.pricing-monthly { font-size: 1.4rem; }
.pricing-package {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(209,244,96,0.15);
  color: #D1F460;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 2px;
}
.pricing-explanation { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; margin-top: 4px; }

/* Light mode overrides for new cards */
[data-theme="light"] .em-risk-green  { background: rgba(16,185,129,0.12); }
[data-theme="light"] .em-risk-yellow { background: rgba(234,179,8,0.12); }
[data-theme="light"] .em-risk-red    { background: rgba(239,68,68,0.12); }
[data-theme="light"] .pricing-amount { color: #5a7a00; }
[data-theme="light"] .pricing-monthly { color: #5a7a00; }
[data-theme="light"] .pricing-package { background: rgba(90,122,0,0.1); color: #5a7a00; }
