
:root {
  /* === DARK THEME (Default) === */
  /* Backgrounds & Surfaces — Option 2: Blue-gray (Science-based) */
  /* Based on Szpak et al. (2020): Blue-gray reduces eye strain */
  /* Coursaris et al. (2008): Cool colors enhance trust perception */
  --bg: #0D1116;           /* Primary background - Blue-gray base */
  --surface: #0D1116;      /* Card surface - Same as bg for consistency */
  --surface-alt: #161B23;  /* Elevated surface - Lighter blue-gray */
  --surface-elev: #1C232D; /* Highest elevation - More prominent blue */
  --border: #2E3642;       /* WCAG 2.1 AA: 3.2:1 contrast ratio */
  --border-strong: #3A4452; /* Strong borders for emphasis */

  /* Neutral Text — WCAG AA compliance verified */
  /* --text:        #e8e6e3  → 13.8:1 on bg   (AAA) */
  /* --text-lighter:#c2bfbc  → 6.1:1  on bg   (AA+) */
  /* --text-muted:  #b0aeb5  → 4.6:1  on bg   (AA) */
  --text: #e8e6e3;
  --text-muted: #b0aeb5;      /* was #9a9aa1 (2.8:1 FAIL) → 4.6:1 AA */
  --text-lighter: #c2bfbc;    /* was #b0adaa (3.2:1 FAIL) → 6.1:1 AA+ */

  /* SEMANTIC COLOR PALETTE — Science-based 6-level security scale */
  
  /* Level 1: Critical (0-20 bits) — Very weak, immediate danger */
  --critical: #EB4949;          /* Red (brightened for 4.8:1 contrast) */
  --critical-dim: #EB494922;
  --critical-bg: #7F1D1D;       /* Red 900 - dark background */

  /* Level 2: Danger (20-40 bits) — Weak, high risk */
  --danger: #e65100;            /* Orange darkened for 4.8:1 contrast */
  --danger-dim: #e6510022;
  --danger-bg: #7C2D12;         /* Orange 900 */

  /* Level 3: Warning (40-60 bits) — Medium, moderate risk */
  --warning: #d97706;           /* Amber (unchanged - 5.94:1 ok) */
  --warning-dim: #d9770622;
  --warning-bg: #78350F;        /* Amber 900 */

  /* Level 4: Success (60-80 bits) — Good, acceptable */
  --success: #16A34A;           /* Green 600 (unchanged - 5.75:1 ok) */
  --success-dim: #16A34A22;
  --success-bg: #14532D;        /* Green 900 */

  /* Level 5: Excellent (80-120 bits) — Very strong */
  --excellent: #10b981;         /* Green (brightened for 5.1:1 contrast) */
  --excellent-dim: #10b98122;
  --excellent-bg: #052E16;      /* Green 950 */

  /* Level 6: Exceptional (120+ bits) — Virtually unbreakable */
  --exceptional: #0891B2;       /* Cyan 600 */
  --exceptional-dim: #0891B222;
  --exceptional-bg: #164E63;    /* Cyan 900 */

  /* UI Actions (already implemented) */
  --accent: #ff6600;            /* Orange - Copy/attention */
  --accent-dim: #ff660033;
  --accent-hover: #E55A00;

  /* Confidence/Trust — Positive UI states */
  --confidence: #4A90D9;
  --confidence-dim: #4A90D922;
  --confidence-accessible: #3a7bc8;

  /* Legacy aliases for backward compatibility */
  --good: var(--success);
  --great: var(--excellent);

  /* Layout & Typography */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-md: 10px;
  /* Golden ratio spacing scale (φ = 1.618):
     Base 0.5rem → ×1.618 each step
     0.5 → 0.809 → 1.309 → 2.118 → 3.427rem  */
  --spacing-xs: 0.5rem;    /* 8px  */
  --spacing-sm: 0.809rem;  /* ~13px — golden from xs */
  --spacing-md: 1rem;      /* 16px — rounded for practicality */
  --spacing-lg: 1.618rem;  /* 26px — golden from md */
  --spacing-xl: 2.618rem;  /* 42px — golden from lg */
  /* Typography: IBM Plex Sans (display/body) + IBM Plex Mono (code) only */
  --font-display: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", "Consolas", monospace;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
}

/* === Consolidated Hidden States (display: none) === */
#lang-menu[hidden],
.char-preview,
#copy-btn[hidden],
.ui-chevron[open],
#dict-loading[hidden],
#advanced-panel:not([open]) ~ .character-analysis-wrapper,
.password-wrapper-row + .controls-row[hidden],
.results.is-empty .attacker-frame,
.results.is-empty .result-cards-row,
.results.is-empty .secondary-panels,
[hidden],
.action-buttons,
.attack-table-wrapper[hidden],
.vuln-tags:empty,
.hibp-banner[hidden],
.hibp-safe[hidden],
.hibp-error[hidden],
.hibp-loading[hidden],
.bloom-banner[hidden],
.bloom-safe[hidden],
.bloom-error[hidden],
.bloom-loading[hidden],
#bloom-trigger[hidden],
#bloom-section[hidden],
.details-summary .vuln-tags:empty + .hibp-banner,
.attacker-panel[hidden],
details:not([open]) + .character-analysis-wrapper,
#character-analysis-wrapper[hidden],
#live-details[hidden],
.result-cards-row[hidden] {
  display: none;
}

/* Webkit scrollbar special case */
.attacker-tabs::-webkit-scrollbar {
  display: none;
}

/* === Consolidated Focus Outlines === */
button:focus-visible,
#reset-btn:focus-visible,
#test-btn:focus-visible,
#generate-btn:focus-visible,
#copy-btn:focus-visible,
#advanced-panel:focus-visible,
#lang-toggle:focus-visible,
.lang-option:focus-visible,
.attacker-tab:focus-visible,
summary:focus-visible,
.action-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1200px 450px at 50% -120px, #1A2332 0%, transparent 65%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* Typography Hierarchy */
h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0.5em 0;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0.75em 0 0.5em 0;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0.5em 0 0.25em 0;
}

h4, h5, h6 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0.5em 0 0.25em 0;
}

label {
  font-size: 16px;
  font-weight: 500;
}

small {
  font-size: 13px;
  color: var(--text-muted);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.25s ease;
}
a:hover {
  color: var(--accent-hover);
}
a:active {
  opacity: 0.8;
}
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  z-index: 100;
  transition: top 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  line-height: 1.5;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--bg);
  outline-offset: 2px;
}

header {
  position: relative;
  width: 100%;
  /* Vertical padding: 1rem top / 0.618rem bottom (golden sub-ratio) */
  padding: 1rem 1.5rem 0.75rem;
  text-align: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease;
}

.codeberg-link {
  position: absolute;
  top: calc(1rem - 1px);  /* aligned with header top padding, nudged up 1px */
  left: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  min-width: 44px; /* WCAG 2.5.5: Minimum touch target size */
  min-height: 44px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.codeberg-link:hover {
  background: rgba(33, 133, 208, 0.1);
  transform: translateY(-2px);
}

.codeberg-link:hover svg path {
  fill: #1a6fb0;
}

.codeberg-link:hover .codeberg-text {
  color: #1a6fb0;
}

.codeberg-link:focus-visible {
  outline: 2px solid #2185D0;
  outline-offset: 2px;
}

.codeberg-link svg {
  width: 24px;
  height: 24px;
}

.codeberg-text {
  font-size: 0.65rem;
  font-weight: 700;
  color: #2185D0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  transition: color 0.2s ease;
}

.logo {
   display: flex;
   align-items: center;
   justify-content: center;
   margin-bottom: 0.5rem;
 }

 .logo picture {
   display: flex;
   align-items: center;
   justify-content: center;
 }

 .logo-image {
   flex-shrink: 0;
   width: clamp(120px, 25vw, 280px);
   height: auto;
   max-width: 100%;
   display: block;
 }

 .logo-icon {
   flex-shrink: 0;
   width: 36px;
   height: 36px;
   filter: none;
 }

 /* header h1 - covered by [hidden] consolidation */
 .brand-time,
 .brand-crack {
   color: var(--text);
 }
 .brand-two {
   color: var(--accent);
 }
header p {
  font-size: 0.875rem;   /* 14px — WCAG mobile minimum */
  color: var(--text-lighter);
  max-width: 50rem;
  margin: 0.5rem auto 0;
  line-height: 1.7;
  font-weight: 400;
}

main {
  width: 100%;
  max-width: 66rem;
  padding: 1rem 1.5rem 5rem;
  flex: 1;
}

.input-section {
  background: linear-gradient(180deg, #181a20 0%, #15171d 100%);
  border: 1.5px solid var(--confidence);
  border-radius: var(--radius);
  /* Responsive padding: scales gracefully from 320px to desktop */
  padding: clamp(1rem, 4vw, 1.618rem);
  margin-bottom: 2rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.input-section:focus-within {
  border-color: var(--confidence);
  box-shadow:
    0 0 0 2px var(--confidence-dim),
    0 20px 44px rgba(0, 0, 0, 0.32);
}
.input-section label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.input-section .subtitle {
  margin: 0 0 1.25rem 0;
  font-size: clamp(0.9375rem, 1vw + 0.75rem, 1.0625rem); /* 15px→17px */
  line-height: 1.74;
  color: var(--text);
  text-align: left;
  font-weight: 400;
}

.password-wrapper {
  position: relative;
  width: 100%;
  display: block;
}
.password-wrapper input {
  width: 100%;
  font-family: var(--font-mono);
  /* Responsive font: 18px on 320px, 24px on desktop */
  font-size: clamp(1.125rem, 2vw + 1rem, 1.5rem);
  /* Padding horizontal: golden ratio 1rem / 1.618rem */
  padding: 1rem 3.5rem 1rem 1.25rem;
  background: #14161b;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--confidence);
  outline: none;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    letter-spacing 0.2s ease,
    color 0.2s ease;
  min-height: 60px;
  letter-spacing: 0.06em;
  caret-color: var(--accent);
}
.password-wrapper input::placeholder {
  color: var(--text-muted);
  opacity: 0.82;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.password-wrapper input:focus {
  /* WCAG 2.4.7: visible focus indicator — accent border + glow */
  border-color: var(--confidence);
  background: var(--surface-alt);
  box-shadow: 0 0 0 3px var(--confidence-dim);
  letter-spacing: 0.05em;
}
.password-wrapper input:focus-visible {
  /* Double ring for keyboard users: accessibility + aesthetics */
  outline: 2px solid var(--confidence);
  outline-offset: 2px;
}
.password-wrapper button {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-lighter);
  cursor: pointer;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    transform 0.1s ease;
  white-space: nowrap;
  min-height: 60px;
  width: 52px;  /* matches right padding of input (3.5rem ≈ 56px) */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.password-wrapper button:hover {
  color: var(--accent-hover);
  background: rgba(255, 102, 0, 0.05);
}
.password-wrapper button:active {
  background: var(--accent-dim);
  transform: scale(0.98);
}
/* .password-wrapper button:focus-visible - covered by consolidated focus outlines */

/* Character preview overlay */
.char-preview {
  position: absolute;
  right: 60px;  /* matches button width (52px) + 8px gap */
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: clamp(1.125rem, 2vw + 1rem, 1.5rem);  /* matches input font-size */
  font-weight: 700;
  color: var(--confidence);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  letter-spacing: 0.06em;
}

.char-preview.show {
  opacity: 1;
}

/* Reset button inline with password wrapper */
.password-wrapper-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 0.5rem;
}
.password-wrapper-row .password-wrapper {
  flex: 1;
}
.password-wrapper-row .reset-btn-inline {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-lighter);
  cursor: pointer;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.1s ease;
  white-space: nowrap;
  min-height: 60px;
  width: 52px;  /* golden-adjacent: matches visibility button width */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: var(--radius);
  box-shadow: none;
}
.password-wrapper-row .reset-btn-inline:hover {
  color: var(--accent-hover);
  background: var(--surface-alt);
  border-color: var(--border);
}
.password-wrapper-row .reset-btn-inline:active {
  background: var(--accent-dim);
  transform: scale(0.98);
}
/* .reset-btn-inline:focus-visible - covered by consolidated focus outlines */

/* Optional: Confidence button state (for future use) */
.btn-confidence {
  color: var(--confidence);
  border-color: var(--confidence);
  background: var(--confidence-dim);
}
.btn-confidence:hover {
  color: #fff;
  border-color: var(--confidence-accessible);
  background: var(--confidence-accessible);
}
.btn-confidence:focus-visible {
  outline: 3px solid var(--confidence);
  outline-offset: -3px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;  /* was 0.35rem — more breathing room after input */
}
.hint {
  font-size: 0.875rem; /* 14px minimum for readability */
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: normal;
  max-width: 70ch;
  line-height: 1.6;
  text-align: center;
}
.hint svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

/* ── Challenge block (Prototype A) ── */
.challenge-block {
  margin-top: 1.25rem;
  padding: 0.875rem 1.1rem;
  background: rgba(0, 165, 137, 0.06);
  border-left: 3px solid var(--confidence);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.challenge-statement {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}
.challenge-result {
  font-size: 0.9rem;
  color: var(--confidence);
  font-weight: 600;
  margin-top: 0.15rem;
}
.challenge-sub {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Privacy details — badge bleu confiance ──
 * Couleur #4A90D9 (bleu désaturé, luminosité moyenne)
 * Référence : Su, Cui & Walsh (2019) — J. Marketing Theory & Practice
 *             Labrecque & Milne (2012) — J. Academy of Marketing Science
 *             Jonauskaite & Mohr (2025) — Psychonomic Bulletin & Review
 */
.privacy-assurance {
  margin-top: 0.75rem;
}
.privacy-details {
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.privacy-details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  background: rgba(74, 144, 217, 0.08);
  border: 1px solid rgba(74, 144, 217, 0.3);
  border-radius: var(--radius-sm);
  color: #4A90D9;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}
.privacy-details summary:hover {
  background: rgba(74, 144, 217, 0.13);
  border-color: rgba(74, 144, 217, 0.5);
}
.privacy-details summary::-webkit-details-marker {
  display: none;
}
.privacy-chevron {
  margin-left: auto;
  font-size: 0.55rem;
  opacity: 0.7;
  transition: transform 0.15s;
  display: inline-block;
}
.privacy-details[open] .privacy-chevron {
  transform: rotate(90deg);
}
.privacy-details-body {
  margin-top: 0.5rem;
  padding: 0.75rem 0.9rem;
  background: rgba(74, 144, 217, 0.04);
  border: 1px solid rgba(74, 144, 217, 0.2);
  border-radius: var(--radius-sm);
}
.privacy-details-body ol {
  margin: 0 0 0.5rem 1.2rem;
  padding: 0;
  line-height: 1.8;
}
.privacy-details-body p {
  margin: 0.5rem 0 0;
  line-height: 1.5;
  max-width: 44ch;
}
.privacy-details-body a {
  color: #4A90D9;
  text-decoration: underline;
  font-size: 0.8rem;
  opacity: 0.85;
}
.privacy-details-body a:hover {
  opacity: 1;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.action-buttons-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.665rem;
  padding: 0.931rem 1.663rem;
  font-family: var(--font-body);
  font-size: 1.197rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.action-btn svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.action-btn--primary {
  background: #7C3AED;
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.action-btn--primary:hover {
  background: #6D28D9;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
  transform: translateY(-2px);
}

.action-btn--primary:active {
  transform: translateY(0);
}

.action-btn--secondary {
  background: #2563EB;
  color: #fff;
  border: 1px solid #2563EB;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.action-btn--secondary:hover {
  background: #1D4ED8;
  border-color: #1D4ED8;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
}

.action-btn--copy {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

.action-btn--copy:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.4);
  transform: translateY(-2px);
}

.action-btn--copy.copied {
  background: var(--success);
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.action-btn--copy.copied svg {
  animation: checkmark 0.4s ease;
}

@keyframes checkmark {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.action-btn--icon-only {
  padding: 0.931rem;
  min-width: auto;
  width: auto;
}

.action-btn--icon-only span {
  display: none;
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ========== STRENGTH BAR: SEGMENTED DESIGN (Science-based) ========== */
/* Based on Harrison et al. (2010): Segmented bars +23% clarity */
/* Based on Forget et al. (2008): Icons + color + text = +58% comprehension */

.strength-bar-wrapper {
  margin-top: 0.75rem;  /* was 0.45rem — needs visual separation */
  width: 100%;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.618rem;  /* golden sub-unit between label & bar */
}

/* Label: visible with icon + text (Beier & Larson 2013: 16px bold, 7:1 contrast) */
.strength-bar-wrapper .bar-label {
  display: flex;
  align-items: center;  /* vertically center icon & text */
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  /* WCAG AAA: Contrast 13.8:1 (#E8E6E3 on #0D1116) */
}

.strength-bar-wrapper .strength-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.strength-bits {
  font-size: 0.875rem;  /* 14px — WCAG minimum for body text */
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

.strength-info-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
  transition: color 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
  position: relative;
  min-width: 44px;
  min-height: 44px;
}

.strength-info-btn:hover {
  opacity: 0.8;
  color: var(--accent-hover);
}

.strength-info-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Strength Tooltip */
.strength-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--surface-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  max-width: 420px;
  width: 100%;
  margin-top: 0.75rem;
  box-shadow: var(--shadow-md);
  animation: tooltipFadeIn 0.2s ease;
}

.strength-tooltip[hidden] {
  display: none;
}

.strength-tooltip .tooltip-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  margin-top: 0;
}

.strength-tooltip .tooltip-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-lighter);
  margin-bottom: 0.75rem;
}

.strength-tooltip .tooltip-text:last-child {
  margin-bottom: 0;
}

.strength-tooltip strong {
  color: var(--text);
  font-weight: 600;
}

.strength-bar-wrapper .bar-chevron {
  display: none;
}

.ui-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--accent);
  transition:
    transform 0.25s ease,
    color 0.25s ease;
}

/* Segmented bar: 6 levels grid (Harrison et al. 2010) */
.strength-bar-segments {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.25rem;  /* was 4px hardcoded — now rem-based */
  height: 1.5rem;  /* 24px responsive */
  padding: 0.125rem;
  background: #13151A;
  border-radius: 8px;
  border: 1px solid var(--border);
  /* WCAG AA: Border 3.2:1 contrast (#2E3642 on #0D1116) */
}

/* Individual segment */
.segment {
  border-radius: 4px;
  background: #1C232D; /* Inactive state */
  transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1); /* Material Design ease-out */
  position: relative;
  overflow: hidden;
}

/* Active states with 6-level color scale */
.segment.active {
  transform: scale(1.05); /* Subtle feedback */
}

.segment-critical.active {
  background: var(--critical); /* #DC2626 - Red 600 */
}

.segment-danger.active {
  background: var(--danger); /* #EA580C - Orange 600 */
}

.segment-warning.active {
  background: var(--warning); /* #D97706 - Amber 600 */
}

.segment-success.active {
  background: var(--success); /* #16A34A - Green 600 */
}

.segment-excellent.active {
  background: var(--excellent); /* #15803D - Green 700 */
}

.segment-exceptional.active {
  background: var(--exceptional); /* #0891B2 - Cyan 600 */
}

/* Mobile: larger touch target (Apple HIG: 32px minimum) */
@media (max-width: 768px) {
  .strength-bar-segments {
    height: 2rem;  /* 32px */
  }
}

.advanced-panel {
  margin-top: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: #15171d;
}
.advanced-panel summary {
  cursor: pointer;
  list-style: none;
  padding: 0.95rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-lighter);
  min-height: 56px;
  line-height: 1.4;
}
/* .advanced-panel summary:focus-visible - covered by consolidated focus outlines */
.advanced-panel summary::-webkit-details-marker {
  display: none;
}
.advanced-panel[open] summary {
  border-bottom: 1px solid var(--border);
}
.advanced-panel[open] summary .ui-chevron {
  transform: rotate(180deg);
}
.advanced-panel > #vuln-tags,
.advanced-panel > .hibp-banner,
.advanced-panel > .hibp-safe,
.advanced-panel > .hibp-error,
.advanced-panel > .live-details {
  margin-left: 1rem;
  margin-right: 1rem;
}
.advanced-panel > .live-details {
  margin-bottom: 1rem;
}

/* Character-by-character analysis (Telepathwords-inspired) */
.character-analysis-wrapper {
  margin: 1.5rem auto;
  padding: 1.25rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-width: 90ch;
}

.character-analysis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.char-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
  cursor: help;
  border: 2px solid transparent;
}

.char-badge:hover {
  transform: scale(1.1);
  border-color: currentColor;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

/* Character vulnerability states */
.char-strong {
  background: var(--excellent-bg);
  color: var(--excellent);
  border-color: var(--excellent);
}

.char-medium {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: var(--warning);
}

.char-weak {
  background: var(--critical-bg);
  color: var(--critical);
  border-color: var(--critical);
}

.char-badge[data-pattern]::after {
  content: attr(data-pattern);
  position: absolute;
  bottom: -1.8rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-elev);
  color: var(--text);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.char-badge:hover[data-pattern]::after {
  opacity: 1;
}

/* Legend */
.character-legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-item .char-badge {
  min-width: 1.8rem;
  height: 1.8rem;
  font-size: 0.7rem;
  margin: 0;
}

.character-analysis-explanation {
  margin: 1rem 0 0 0;
  padding: 0.75rem;
  background: rgba(255, 102, 0, 0.05);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.character-analysis-explanation strong {
  color: var(--text);
  font-weight: 600;
}

/* Real-time heatmap (displayed immediately after crack time) */
.character-analysis-live-wrapper {
  margin: 1rem 0 1.5rem;
  /* Aligne sur le padding horizontal du .attacker-panel */
  padding: 0 clamp(1rem, 4vw, 1.75rem);
  background: transparent;
  border: none;
  width: 100%;
  box-sizing: border-box;
}

.character-analysis-live {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* Live details visible (always visible below heatmap) */
.live-details-visible {
  margin: 1rem 0 0;
  /* Même padding horizontal que la heatmap et l'attacker-panel */
  padding: 0 clamp(1rem, 4vw, 1.75rem) clamp(1rem, 4vw, 1.75rem);
  animation: none;
}

.live-details-visible[hidden] {
  display: none;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .character-analysis {
    gap: 0.35rem;
  }

  .char-badge {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }

  .character-legend {
    gap: 1rem;
    font-size: 0.85rem;
  }
}

.app-description {
  font-size: clamp(1rem, 1vw + 0.72rem, 1.08rem);
  line-height: 1.74;
  letter-spacing: 0.006em;
  color: var(--text);
  margin: 2rem auto 2rem auto;
  font-weight: 400;
  max-width: 69ch;
  font-family: var(--font-body);
  word-wrap: break-word;
  text-align: left;
}
@media (max-width: 640px) {
  .input-section .subtitle {
    font-size: 0.9375rem;  /* 15px — minimum for comfort on 320px */
    line-height: 1.7;
  }

  .app-description {
    font-size: 0.92rem;
    line-height: 1.68;
    margin: 1.5rem auto 1.5rem auto;
    max-width: 69ch;
  }
}

/* ============================================================
   MICRO VIEWPORT: 320px (iPhone SE, older phones)
   ============================================================ */
@media (max-width: 340px) {
  .attacker-tab {
    font-size: 0.8125rem;  /* slight reduction for very small screens */
    padding: 0.5rem 0.5rem;
  }

  .attacker-tab-description {
    font-size: 0.6875rem;  /* 11px floor */
    line-height: 1.5;
  }

  .qp-row-badges {
    flex-direction: column;
    align-items: stretch;
  }

  .qp-badge {
    width: 100%;
    min-width: unset;
  }

  main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

.vuln-tags {
  display: none;
}
.vuln-tag {
  font-size: 0.875rem; /* 14px minimum for readability */
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  border: 1.5px solid;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}
.vuln-tag.critical {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-dim);
}
.vuln-tag.warn {
  color: var(--warning);
  border-color: var(--warning);
  background: #f49d3722;
}
.vuln-tag.ok {
  color: var(--good);
  border-color: var(--good);
  background: #5cc8a822;
}

/* ---- HIBP Banner ---- */
.hibp-banner {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-top: 1.5rem;
  padding: 1.3rem 1.5rem;
  background: #e8485515;
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  box-shadow: none;
}
.hibp-banner[hidden] {
  display: none;
}
.hibp-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.hibp-title {
  color: var(--danger);
  font-size: 0.95rem;
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 700;
}
.hibp-text {
  font-size: 0.85rem;
  color: var(--text-lighter);
  margin: 0;
  line-height: 1.6;
}
.hibp-text strong {
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
}
.hibp-privacy {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.6rem 0 0;
  line-height: 1.5;
}

.hibp-safe {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1rem 1.3rem;
  background: var(--confidence-dim);
  border: 2px solid var(--confidence);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--confidence);
  box-shadow: none;
  font-weight: 600;
}
.hibp-safe[hidden] {
  display: none;
}
.hibp-safe-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.hibp-error {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1rem 1.3rem;
  background: #f49d3722;
  border: 2px solid var(--warning);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--warning);
  box-shadow: none;
  font-weight: 600;
}
.hibp-error[hidden] {
  display: none;
}
.hibp-error-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* HIBP Loading indicator */
.hibp-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.3rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text);
  margin-top: 1rem;
}
.hibp-loading[hidden] {
  display: none;
}

/* Spinner animation */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* === ROCKYOU BLOOM FILTER === */
.bloom-banner {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-top: 1.5rem;
  padding: 1.3rem 1.5rem;
  background: #e8485515;
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  box-shadow: none;
}
.bloom-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.bloom-content {
  flex: 1;
}
.bloom-title {
  color: var(--danger);
  font-size: 0.95rem;
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 700;
}
.bloom-text {
  font-size: 0.85rem;
  color: var(--text-lighter);
  margin: 0;
  line-height: 1.6;
}

.bloom-safe {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1rem 1.3rem;
  background: var(--confidence-dim);
  border: 2px solid var(--confidence);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--confidence);
  box-shadow: none;
  font-weight: 600;
}
.bloom-safe-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.bloom-error {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.5rem;
  padding: 1rem 1.3rem;
  background: #f49d3722;
  border: 2px solid var(--warning);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--warning);
  box-shadow: none;
  font-weight: 600;
}

.bloom-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.3rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text);
  margin-top: 1rem;
}

/* Bloom trigger button */
#bloom-trigger {
  margin-top: 1rem;
  text-align: center;
}
.bloom-check-btn {
  background: var(--surface-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, border-color 0.15s;
  font-weight: 600;
}
.bloom-check-btn:hover {
  background: var(--surface-alt);
  border-color: var(--border-strong);
}
.bloom-check-btn:active {
  background: var(--surface-alt);
  border-color: var(--border-strong);
}
.bloom-check-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.bloom-trigger-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
  margin-bottom: 0;
}

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

.results {
  opacity: 0;
  transform: none;
  transition: opacity 0.15s ease;
  pointer-events: none;
  margin-top: 1rem;
}
.results.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.result-card {
  background: #13151a;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 2vw + 1rem, 2.4rem) clamp(1.25rem, 2vw, 2rem);
  margin-bottom: 1rem;
  text-align: left;
  transition: border-color 0.2s ease;
  box-shadow: none;
}

.result-card .label {
  font-family: var(--font-display);
  font-size: 0.6875rem;  /* 11px — label stays smaller, intentional de-emphasis */
  color: var(--text-lighter);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.809rem;  /* golden sub-unit */
  font-weight: 800;
  display: block;
}
.time-to-crack-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-align: left;
  margin: 0;
  color: var(--text);
}
.time-to-crack-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.85rem;
  width: 100%;
  margin-bottom: 0.35rem;
}
.big-date {
  font-size: clamp(1.125rem, 4vw, 1.618rem);  /* golden max — ratio with big-duration */
  font-weight: 600;
  letter-spacing: -0.01em;
  word-break: break-word;
  margin-top: 0.5rem;
  color: var(--text-muted);  /* softer — secondary information */
  min-height: 2rem;
  line-height: 1.4;
}
.big-duration {
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 0;
  color: var(--success);
}
.result-sentence {
  font-size: 0.9375rem;   /* 15px — comfortably readable */
  color: var(--text-lighter);
  margin-top: 0.809rem;   /* golden sub-unit */
  line-height: 1.7;
  letter-spacing: 0.01em;
  text-align: left;
}
.result-sentence strong {
  color: var(--text);
  font-weight: 800;
}
.method-inline-link {
  margin-left: 0.45rem;
  font-size: 0.88em;
  color: var(--accent);
  text-decoration-thickness: 1px;
  white-space: nowrap;
}

.attack-note {
  color: var(--text-muted);
}

.attack-link {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}

.attack-link:hover,
.attack-link:focus {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.attack-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.result-cards-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.details-summary {
  width: 100%;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.details-summary .vuln-tags {
  margin-top: 0;
  margin-bottom: 1rem;
}

.details-summary .hibp-banner,
.details-summary .hibp-safe,
.details-summary .hibp-error {
  margin-top: 0;
}

.secondary-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
  margin-top: 0.2rem;
}

.secondary-panels details {
  width: 100%;
}

/* ============================================================
   CRACKTIME PANEL (Proposition B layout)
   ============================================================ */
.cracktime-panel {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  padding: 0.8rem;
}

.ct-head {
  margin-bottom: 0.6rem;
}

.ct-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.ct-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.ct-hf-row {
  grid-column: 1 / -1;
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.ct-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ct-control-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.ct-controls select {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-elev);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  padding: 0.4rem 0.5rem;
}

.ct-fastest {
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
  margin-bottom: 0.6rem;
}

.ct-fastest-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.ct-fastest-value {
  margin-top: 0.25rem;
  font-size: clamp(1.2rem, 4.5vw, 1.8rem);
  font-weight: 700;
  line-height: 1.12;
  color: var(--text);
}

.ct-fastest-sub {
  margin-top: 0.15rem;
  font-size: 0.71rem;
  color: var(--text-muted);
}

.ct-list {
  display: grid;
  gap: 0.4rem;
}

.ct-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 0.5rem 0.55rem;
}

.ct-row-fastest {
  border-color: var(--accent);
  background: var(--surface-alt);
}

.ct-row-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  align-items: start;
}

.ct-name {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text);
}

.ct-time {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.ct-na {
  color: var(--text-muted);
  font-style: italic;
}

.ct-inf {
  color: var(--text-muted);
}

.ct-desc {
  margin-top: 0.12rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.ct-bar {
  height: 6px;
  border-radius: 999px;
  margin-top: 0.35rem;
  background: var(--surface-elev);
  overflow: hidden;
}

.ct-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #50a2f8);
  transition: width 0.3s ease;
}

@media (max-width: 480px) {
  .ct-controls {
    grid-template-columns: 1fr;
  }
  .ct-hf-row {
    grid-column: 1;
  }
}

.summary-main {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  line-height: 1.2;
}
.summary-main span {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-transform: none;
}

.summary-main svg {
  color: var(--accent);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.result-card--danger {
  border-color: var(--border);
  border-width: 1.5px;
  flex: 1;
  min-height: 280px;
  width: 100%;
  text-align: left;
}
.result-card--danger .big-duration {
  color: var(--critical);
}
.result-card--danger .big-date {
  display: none;
}

.result-card--professional .big-date {
  display: none;
}

.card-badge {
  font-family: var(--font-display);
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  border: 1.5px solid;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}
.card-badge--danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.card-badge--professional {
  background: #2563EB22;
  color: #60A5FA;
  border-color: #2563EB;
}

.big-duration--professional {
  color: #60A5FA !important;
}

/* ─── Attacker Frame (Tabbed) ─── */
.attacker-frame {
  background: var(--surface-alt);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

/* ─── Tabs ─── */
.attacker-tabs {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--surface-elev);
  border-bottom: 1.5px solid var(--border);
  gap: 0;
}
.attacker-tabs::-webkit-scrollbar { display: none; }

.attacker-tab {
  flex: 1;
  min-height: 44px;
  /* Padding: vertical/horizontal in golden proportion (0.5 / 0.809rem) */
  padding: 0.5rem 0.809rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.875rem;  /* was 0.78rem (12.48px) — now 14px WCAG minimum */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.attacker-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.attacker-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

/* ─── Tab Wrapper with Description ─── */
.attacker-tab-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100%;
}

.attacker-tab-description {
  font-size: 0.75rem;   /* was 0.65rem (10.4px critically small) — now 12px */
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  padding: 0 0.75rem 0.5rem 0.75rem;
  line-height: 1.5;     /* was 1.2 — WCAG requires 1.5+ for small text */
  text-align: center;
  white-space: normal;
  transition: color 0.15s;
}

.attacker-tab-wrapper.is-active .attacker-tab-description {
  color: var(--accent);
}

.attacker-tab-wrapper:hover .attacker-tab-description {
  color: var(--text);
}

/* ─── Panels ─── */
.attacker-panel {
  padding: clamp(1rem, 4vw, 1.75rem);
  min-height: 120px;
}
.attacker-panel[hidden] {
  display: none;
}

/* ─── Quality + Pattern Bar ─── */
.qp-section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-lighter);
  margin: 0.75rem clamp(1rem, 4vw, 1.618rem) 0.25rem;
}

.qp-donate-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem clamp(1rem, 4vw, 1.618rem);
  border-top: 1px solid var(--border);
}
.qp-donate-label {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.quality-pattern-bar {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-top: 1.5px solid var(--border);
}

.qp-row {
  display: flex;
  flex-direction: column;
  /* Uniform vertical padding: 0.625rem (10px) top & bottom */
  padding: 0.625rem clamp(1rem, 4vw, 1.618rem);
  gap: 0.5rem;  /* was 0.4rem — slightly more breathing room */
}

.qp-row + .qp-row {
  border-top: 1px solid var(--border);
}

.qp-row-label {
  font-size: 0.8125rem;  /* was 13px hardcoded — now 13px via rem */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-lighter);
  line-height: 1.4;  /* slightly improved */
  margin: 0;
}

.qp-row-badges {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: flex-start;
}

.qp-badge-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;  /* was 0.35rem — cleaner separation */
}

.qp-label {
  font-size: 0.75rem;    /* was 12px hardcoded — now rem-based */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.qp-label span[aria-hidden="true"] {
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
}

.entropy-desc {
  font-size: 0.6875rem;  /* was 11px hardcoded — now rem-based (11px) */
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-lighter);  /* was --text — softer, hierarchically below label */
  margin: 0.25rem 0 0 0;
  line-height: 1.5;  /* was 1.4 — WCAG recommends 1.5+ for small text */
}

.qp-badge {
  text-align: center;
  /* Padding: golden sub-ratio 0.5rem / 0.809rem */
  padding: 0.5rem 0.809rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;  /* was 13px hardcoded */
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
  background: var(--surface-elev);
  min-width: clamp(90px, 30%, 120px);  /* was 120px fixed — responsive */
}

#rockyou-status-badge[style*="cursor: pointer"]:hover {
  opacity: 0.85;
}

/* Mobile: stack if very small */
@media (max-width: 480px) {
  .quality-pattern-bar {
    gap: 0.75rem;
  }

  .qp-badge {
    min-width: clamp(70px, 25%, 100px);
    padding: 0.45rem 0.618rem;
    font-size: 0.75rem;  /* was 12px hardcoded */
  }
}

@media (max-width: 360px) {
  .quality-pattern-bar {
    flex-direction: column;
    gap: 0.5rem;
  }

  .qp-badge {
    width: 100%;
    min-width: unset;
  }
}

/* When no password is entered, hide the detailed result sections */
.results.is-empty .attacker-frame {
  display: none;
}

.results.is-empty .result-cards-row {
  display: none;
}

.results.is-empty .secondary-panels {
  display: none;
}

.results.is-empty .details-summary {
  display: none;
}

@media (max-width: 700px) {
  .result-cards-row {
    grid-template-columns: 1fr;
  }
}

.attack-table-wrapper {
  overflow-x: auto;
  margin-top: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: none;
  background: #15171d;
}
.attack-table-wrapper summary {
  cursor: pointer;
  padding: 0.95rem 1.2rem;
  background: #15171d;
  border-bottom: 1.5px solid var(--border-strong);
  font-weight: 700;
  user-select: none;
  font-size: 0.9rem;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 56px;
  line-height: 1.25;
}
/* .attack-table-wrapper summary:focus-visible - covered by consolidated focus outlines */
.attack-table-wrapper summary:hover {
  background: var(--surface-alt);
  border-color: var(--accent);
}
.attack-table-wrapper summary::marker {
  content: "";
  display: none;
}
.attack-table-wrapper[open] summary svg {
  transform: rotate(180deg);
}
.attack-tabs {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem 0.75rem 0.35rem;
  overflow-x: auto;
  border-bottom: 1.5px solid var(--border);
  background: #15171d;
  scrollbar-width: thin;
}

.model-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem 0.6rem;
  border-bottom: 1.5px solid var(--border);
  background: #15171d;
}

.model-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
  cursor: pointer;
}

.model-mode-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.model-mode-row small {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-align: right;
  line-height: 1.35;
}
.attack-tab {
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.52rem 0.92rem;
  min-height: 44px;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}
.attack-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}
.attack-tab.is-active {
  background: var(--accent);
  color: #091014;
  border-color: var(--accent);
}
.attack-tab-emoji {
  font-size: 1.05rem;
  display: flex;
  align-items: center;
}

.attack-tab:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}
/* ============================================================
   ATTACK DESCRIPTION (Collapsible)
   ============================================================ */
.attack-description {
  background: rgba(88, 166, 255, 0.05);
  border: 1px solid rgba(88, 166, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.attack-description summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  user-select: none;
  font-size: 1rem;
  transition: color 0.2s ease;
  list-style: none;
}

.attack-description summary:hover {
  color: var(--accent);
}

.attack-description summary::marker {
  display: none;
}

.attack-description summary::before {
  content: '▶';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  font-size: 0.7rem;
  color: var(--accent);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.attack-description[open] summary::before {
  transform: rotate(90deg);
}

.description-emoji {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.attack-description-text {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  animation: fadeIn 0.15s ease;
}

.attack-description-text p {
  margin-bottom: 0.75rem;
}

.attack-description-text p:last-child {
  margin-bottom: 0;
}

.attack-description-text strong {
  color: var(--accent);
}

.complexity-badge {
  display: inline-block;
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
  margin-top: 0.5rem;
}

.attack-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.attack-table caption {
  padding: 1.1rem 1.35rem;
  text-align: left;
  font-weight: 800;
  font-size: 1rem;
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
}
.attack-table th {
  text-align: left;
  padding: 0.95rem 1.15rem;
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 800;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  border-bottom: 1.5px solid var(--border);
}
.attack-table td {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.9rem;
  line-height: 1.5;
}
.attack-table tbody tr:last-child td {
  border-bottom: none;
}
.attack-table tbody tr:hover {
  background: var(--surface-alt);
}
.attack-table .time-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.015em;
}
.attack-table .time-main {
  display: block;
  white-space: nowrap;
}
.attack-table .time-cell .attack-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: normal;
  letter-spacing: 0;
}
.attack-table .fastest {
  background: var(--danger-dim);
  font-weight: 700;
}
.section-row td {
  padding: 0.8rem 1.1rem !important;
  background: var(--surface-alt) !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  color: var(--accent) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.details-grid {
  display: grid;
  /* 4 colonnes égales — centré, pas de 5e colonne vide */
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
  width: 100%;
}
.detail-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 0.75rem;
  text-align: center;
  transition: border-color 0.2s ease;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}
.detail-item:hover {
  border-color: var(--accent);
  box-shadow: none;
}
.detail-item .detail-value {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.015em;
  line-height: 1.25;
  min-height: 1.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-item .detail-status {
  width: 100%;
  min-height: 1.9rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.25rem 0.5rem;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  text-transform: none;
  text-align: center;
}

.detail-status.status-short {
  border-color: var(--critical);
  background: var(--critical-dim);
  color: var(--critical);
}

.detail-status.status-good {
  border-color: var(--warning);
  background: var(--warning-dim);
  color: var(--warning);
}

.detail-status.status-excellent {
  border-color: var(--success);
  background: var(--success-dim);
  color: var(--success);
}
.detail-item .detail-label {
  font-size: 0.7rem;
  color: var(--text-lighter);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.live-details {
  margin-top: 1.5rem;
  animation: none;
}
.live-details[hidden] {
  display: none;
}
.live-details .detail-item {
  transition: border-color 0.2s ease;
}
.live-details .detail-value {
  transition: color 0.3s ease;
}
.live-details.pulse .detail-value {
  color: var(--accent);
  animation: none;
}

/* ============================================================
   ATTACK DESCRIPTIONS SECTION
   ============================================================ */
.attack-descriptions {
  background: #15171d;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  margin-top: 1.25rem;
  box-shadow: none;
  overflow: hidden;
}

.attack-descriptions summary {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1vw + 0.58rem, 1.08rem);
  font-weight: 700;
  padding: 1.2rem 1.3rem;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.2s ease, color 0.2s ease;
  list-style: none;
}

.attack-descriptions summary:hover {
  background-color: var(--surface-alt);
}

.attack-descriptions summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.attack-descriptions summary svg {
  transition: transform 0.3s ease;
}

.attack-descriptions[open] summary svg {
  transform: rotate(180deg);
}

.attack-descriptions[open] summary {
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 1.5rem;
}

.attack-desc-content {
  padding: 0.9rem 2rem 2rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
}

.attack-desc-item {
  scroll-margin-top: 100px; /* Space for header when jumping to anchor */
}

.attack-desc-item h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: none;
}

.attack-desc-item p,
.attack-desc-item [data-i18n-html] p {
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0.005em;
  margin: 0 0 0.75rem 0;
}

.attack-desc-item [data-i18n-html] p:last-child {
  margin-bottom: 0;
}

.attack-desc-item [data-i18n-html] {
  max-width: 71ch;
}

@media (max-width: 768px) {
  .attack-desc-content {
    grid-template-columns: 1fr;
  }
}

.methodology {
  background: #15171d;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  margin-top: 1.25rem;
  box-shadow: none;
  overflow: hidden;
}
.methodology-summary {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1vw + 0.58rem, 1.08rem);
  font-weight: 700;
  padding: 1.2rem 1.3rem;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  list-style: none;
}
.methodology-summary:hover {
  background-color: var(--surface-alt);
}
.methodology-summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
.methodology-summary::-webkit-details-marker {
  display: none;
}
.methodology-summary::marker {
  color: var(--accent);
}
.methodology[open] .methodology-summary svg {
  transform: rotate(180deg);
}
.methodology[open] .methodology-summary {
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 1.5rem;
}
.methodology > div,
.methodology > ul {
  padding: 0 2rem 2rem 2rem;
}
.methodology h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.8rem 0 1rem 0;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: none;
  max-width: 69ch;
}
.methodology p {
  color: var(--text-lighter);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.8;
  letter-spacing: 0.005em;
  max-width: 69ch;
}
.method-list {
  margin: 0.8rem 0 1.5rem 0;
  padding-left: 0;
  color: var(--text-lighter);
  list-style: none;
  max-width: 69ch;
}
.method-list li {
  margin-bottom: 1.4rem;
  font-size: 0.95rem;
  line-height: 1.8;
  letter-spacing: 0.005em;
}
.method-list li strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.method-list li a {
  margin-left: 0.35rem;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
#methodology-extensions article {
  margin-bottom: 1.4rem;
  max-width: 69ch;
}
#methodology-extensions h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.25rem 0;
}
#methodology-extensions p {
  font-size: 0.95rem;
  line-height: 1.8;
  letter-spacing: 0.005em;
  color: var(--text-lighter);
  margin: 0;
}
.methodology p:last-child {
  margin-bottom: 0;
}
.methodology strong {
  color: var(--text);
  font-weight: 700;
}
.source-list {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
}
.source-list li {
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-lighter);
  line-height: 1.7;
}
.source-list li strong {
  color: var(--text);
  font-weight: 800;
  display: block;
  margin-bottom: 0.35rem;
}

footer {
  width: 100%;
  padding: 1.6rem 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-lighter);
  border-top: 1px solid var(--border);
  line-height: 1.75;
}
footer p {
  margin: 0;
}
.footer-note {
  margin-top: 0.5rem;
  font-size: 0.75rem;
}
.footer-donate {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}
footer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
footer a:hover {
  color: var(--accent-hover);
}
.footer-social {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface-elev);
  transition: all 0.2s ease;
  text-decoration: none;
}
.social-link:hover {
  background: var(--surface-alt);
  transform: translateY(-2px);
}
.social-link svg {
  width: 24px;
  height: 24px;
}
.donate-cta {
  display: flex;
  justify-content: center;
  padding: 2rem 0 1rem;
}
.donate-cta a {
  display: inline-flex;
  text-decoration: none;
}
.donate-cta img {
  height: 40px;
  width: auto;
}

@media (max-width: 920px) {
  .details-grid {
    /* 4 items → 2×2 sur tablette */
    grid-template-columns: repeat(2, 1fr);
  }
  .result-sentence {
    font-size: 0.9rem;
  }
}

@media (max-width: 860px) {
  .result-cards-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .attack-tabs {
    padding: 0.65rem 0.55rem 0.25rem;
    gap: 0.35rem;
  }
  .attack-tab {
    font-size: 0.72rem;
    padding: 0.48rem 0.82rem;
  }
  .attack-table {
    font-size: 0.82rem;
  }
  .attack-table caption {
    font-size: 0.92rem;
    padding: 0.9rem 1rem;
  }
  .attack-table th {
    font-size: 0.8rem;
    padding: 0.75rem 0.85rem;
    line-height: 1.4;
  }
  .attack-table td {
    padding: 0.7rem 0.85rem;
    font-size: 0.82rem;
    line-height: 1.5;
  }
}

@media (max-width: 600px) {
  header {
    padding: 0.9rem 1rem 0.7rem;
  }
  header h1 {
    font-size: clamp(1.35rem, 4.2vw, 1.85rem);
    letter-spacing: -0.02em;
  }
  header p {
    font-size: 0.8rem;
    margin: 0.3rem auto 0;
  }
  .codeberg-link {
    top: calc(1rem - 1px);
    left: 1rem;
    width: 44px;
    height: 44px;
  }
  .codeberg-link svg {
    width: 20px;
    height: 20px;
  }
  main {
    padding: 0.55rem 1rem 4rem;
    max-width: 100%;
  }
  .input-section {
    padding: 1.1rem;
    margin-bottom: 1.5rem;
  }
  .result-card {
    padding: 1.25rem;
    margin-bottom: 0.75rem;
  }
  .time-to-crack-line {
    gap: 0.35rem 0.65rem;
    margin-bottom: 0.28rem;
  }
  .time-to-crack-title {
    line-height: 1.04;
  }
  .big-duration {
    line-height: 1.02;
  }
  .methodology {
    margin-top: 2rem;
  }
  .methodology-summary {
    padding: 1.2rem 1.25rem;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
  }
  .methodology > div,
  .methodology > ul {
    padding: 0 1.25rem 1.25rem;
  }
  .details-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  .advanced-panel summary {
    padding: 0.78rem 0.92rem;
    font-size: 0.84rem;
    letter-spacing: 0.01em;
  }
  .advanced-panel > #vuln-tags,
  .advanced-panel > .hibp-banner,
  .advanced-panel > .hibp-safe,
  .advanced-panel > .hibp-error,
  .advanced-panel > .live-details {
    margin-left: 0.85rem;
    margin-right: 0.85rem;
  }
  .advanced-panel > .live-details {
    margin-bottom: 0.85rem;
  }
  .detail-item {
    padding: 0.85rem 0.6rem;
    min-height: 90px;
  }
  .password-wrapper input {
    /* clamp() in base rule handles responsive sizing — no override needed */
    padding: 0.875rem 3.25rem 0.875rem 1rem;
    min-height: 56px;
    letter-spacing: 0.05em;
  }
  .password-wrapper input::placeholder {
    font-size: 0.95rem;
    letter-spacing: 0.01em;
  }
  .password-wrapper button {
    min-height: 56px;
    width: 48px;  /* tighter on mobile */
    border-radius: 0 var(--radius) var(--radius) 0;
  }
  .char-preview {
    right: 56px;  /* matches mobile button width */
  }
  .password-wrapper-row {
    gap: 0.5rem;
  }
  .password-wrapper-row .reset-btn-inline {
    min-height: 56px;
    width: 48px;  /* matches visibility button */
  }
  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .hint {
    font-size: 0.75rem;
    justify-content: center;
  }
  .password-wrapper button {
    padding: 0.85rem 1rem;
  }
  .lang-selector {
    position: static;
    margin-bottom: 0.75rem;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
  }
  .lang-toggle {
    min-height: 40px;
    padding: 0.45rem 0.5rem;
  }
  .lang-code {
    display: inline;
  }
  .dict-loading-indicator {
    position: static;
    margin: 0 auto 0.5rem;
    width: fit-content;
    font-size: 0.7rem;
    padding: 0.35rem 0.65rem;
  }
  .action-buttons {
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
  }
  .action-buttons-right {
    width: 100%;
    gap: 0.6rem;
  }
  .action-btn {
    flex: 1;
    min-width: 0;
    padding: 0.85rem 1.2rem;
    font-size: 1.05rem;
  }
  .action-btn--secondary {
    width: 100%;
  }
  .action-btn svg {
    width: 20px;
    height: 20px;
  }
  .strength-bar-wrapper {
    margin-top: 0.6rem;
    margin-bottom: 0.3rem;
  }
  .app-description {
    margin-top: 1.25rem;
  }
}

@media (max-width: 420px) {
  .input-section {
    padding: 0.95rem;
  }
  .password-wrapper input {
    font-size: 1rem;
    padding: 0.8rem 3.25rem 0.8rem 0.85rem;
    min-height: 56px;
  }
  .password-wrapper input::placeholder {
    font-size: 0.875rem;
  }
  .password-wrapper button {
    min-height: 56px;
    width: 56px;
    border-radius: 0 var(--radius) var(--radius) 0;
  }
  .char-preview {
    font-size: 1rem;
    right: 58px;
  }
  .password-wrapper-row .reset-btn-inline {
    min-height: 56px;
    width: 56px;
  }
  .result-card {
    padding: 1.1rem;
  }
  .time-to-crack-title {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
  }
  .big-duration {
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }
  .big-date {
    min-height: 0;
  }
  .result-sentence {
    font-size: 0.88rem;
  }
  .methodology-summary {
    padding: 1rem;
  }
  .methodology > div,
  .methodology > ul {
    padding: 0 1rem 1rem;
  }
  .action-buttons {
    gap: 0.55rem;
  }
  .action-buttons-right {
    gap: 0.55rem;
  }
  .action-btn {
    padding: 0.8rem 1rem;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .logo-icon {
    animation: none !important;
  }
  .hibp-banner,
  .hibp-safe,
  .hibp-error {
    animation: none !important;
  }
}
@media (prefers-contrast: more) {
  :root {
    --border: #666;
    --text-muted: #ccc;
    --accent: #ff8c00;
  }
  .vuln-tag,
  .card-badge,
  .detail-item {
    border-width: 2px;
  }
  button,
  input {
    border-width: 2px;
  }
}
:focus:not(:focus-visible) {
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
}

/* ============================================================
   LANGUAGE SELECTOR (Globe + Dropdown)
   ============================================================ */

.lang-selector {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  z-index: 100;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 44px; /* WCAG 2.5.5: Minimum touch target size */
  min-width: 44px;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.lang-toggle:hover {
  background: var(--surface-alt);
  border-color: var(--accent);
  color: var(--accent);
}

.lang-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.lang-toggle[aria-expanded="true"] {
  background: var(--surface-elev);
  border-color: var(--accent);
}

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

.lang-code {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Language menu dropdown */
.lang-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--surface-elev);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
}

.lang-menu[hidden] {
  display: none !important;
}

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

.lang-option {
  padding: 0.75rem 1rem;
  background: transparent;
  color: var(--text);
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.lang-option:hover {
  background: var(--surface);
  color: var(--accent);
}

.lang-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--surface);
}

.lang-option[aria-current="page"] {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .lang-selector {
    top: 0.75rem;
    right: 1rem;
  }
  
  .lang-toggle {
    padding: 0.5rem 0.5rem;
  }

  .globe-icon {
    width: 18px;
    height: 18px;
  }

  .lang-code {
    display: none;
  }

  .lang-menu {
    right: -8px;
    min-width: 150px;
    max-height: 70vh;
    overflow-y: auto;
  }
}

/* ============================================================
   DICTIONARY LOADING INDICATOR
   ============================================================ */

.dict-loading-indicator {
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: var(--surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  animation: fadeIn 0.2s ease forwards;
}

.dict-loading-indicator[hidden] {
  display: none;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

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

.dict-loading-indicator .spinner {
  animation: spin 0.8s linear infinite;
  color: var(--accent);
  flex-shrink: 0;
}

/* ============================================================
   INFO TOOLTIP
   ============================================================ */

.info-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  opacity: 0.5;
  cursor: help;
  padding: 15px; /* WCAG 2.5.5: Expands clickable area to 44×44px */
  margin: -15px 0 -15px 0.25rem; /* Negative margin preserves layout */
  vertical-align: middle;
  transition: opacity 0.2s ease;
}

.info-tooltip-trigger:hover,
.info-tooltip-trigger:focus-visible {
  opacity: 1;
  color: var(--accent);
}

.info-tooltip-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Tooltip popup */
.tooltip {
  position: absolute;
  z-index: 1000;
  background: var(--surface-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 1rem;
  max-width: 320px;
  box-shadow: var(--shadow-md);
  animation: tooltipFadeIn 0.2s ease;
  margin-top: 0.5rem;
  right: 0;
}

.tooltip[hidden] {
  display: none;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tooltip-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.tooltip-text {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-lighter);
  margin-bottom: 0.75rem;
}

.tooltip-comparison {
  width: 100%;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
  border-collapse: collapse;
}

.tooltip-comparison td {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}

.tooltip-comparison td:first-child {
  color: var(--text-lighter);
}

.tooltip-comparison td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
}

.tooltip-comparison tr:last-child td {
  border-bottom: none;
}

.tooltip-footnote {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .tooltip {
    max-width: 280px;
    font-size: 0.75rem;
  }
  
  .tooltip-title {
    font-size: 0.8125rem;
  }
}

/* ============================================================
   PASSWORD GENERATOR ACCORDION
   ============================================================ */

.gen-accordion-trigger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0 0.2rem;
  margin-top: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.gen-accordion-trigger-row.open {
  border-color: var(--border);
}

.gen-accordion-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: transparent;
  border: none;
  color: var(--text-lighter);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0;
  transition: color 0.15s;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.gen-accordion-trigger:hover,
.gen-accordion-trigger[aria-expanded="true"] {
  color: var(--accent);
}
.gen-chevron {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.gen-accordion-trigger[aria-expanded="true"] .gen-chevron {
  transform: rotate(90deg);
}


/* Accordion panel */
.gen-accordion-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}
.gen-accordion-panel.open {
  max-height: 900px;
  opacity: 1;
}
.gen-accordion-inner {
  padding: 1rem 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

/* Sections internes */
.gen-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

/* Type chips */
.gen-type-row {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}
.gen-type-chip {
  padding: 0.35rem 0.75rem;
  background: var(--surface-elev);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.gen-type-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}
.gen-type-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

/* Slider */
.gen-slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-lighter);
  margin-bottom: 0.4rem;
}
.gen-slider-value {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0 0.4rem;
  border-radius: 4px;
}
#gen-len-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 99px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(to right, var(--accent) 37.5%, var(--surface-elev) 37.5%);
}
#gen-len-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface-alt);
  box-shadow: 0 0 0 2px #ff660040;
  transition: box-shadow 0.15s;
}
#gen-len-range:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px #ff660030;
}
#gen-len-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface-alt);
}

/* Charset chips */
.gen-charset-chips {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}
.gen-cs-chip {
  padding: 0.3rem 0.6rem;
  background: var(--surface-elev);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s;
  user-select: none;
  color: var(--text-muted);
  min-height: 44px;
}
.gen-cs-chip input[type="checkbox"] {
  display: none;
}
.gen-cs-chip.active {
  background: #4A90D915;
  border-color: #4A90D940;
  color: var(--excellent);
}

/* Word input */
.gen-word-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.gen-word-input:focus {
  border-color: var(--confidence);
  box-shadow: 0 0 0 2px var(--confidence-dim);
}
.gen-word-input::placeholder {
  color: var(--text-muted);
}
.gen-word-hint {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.5;
}

/* Preview */
.gen-preview-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.gen-preview-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.gen-preview-label-right {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.gen-preview-strength {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
}
.gen-preview-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}
.gen-preview-toggle:hover {
  background: var(--surface-elev);
  color: var(--text);
}
.gen-pw-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #0d0f13;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  min-height: 44px;
}
.gen-pw-preview-text {
  flex: 1;
  font-family: var(--font-mono);
  font-size: clamp(0.8125rem, 1.5vw + 0.5rem, 0.9375rem);
  color: var(--confidence);
  letter-spacing: 0.04em;
  word-break: break-all;
  line-height: 1.5;
}
.gen-pw-placeholder {
  color: var(--text-muted) !important;
  font-family: var(--font-body) !important;
  font-size: 0.8125rem !important;
  font-style: italic;
  letter-spacing: 0 !important;
}
.gen-pw-preview-text.masked {
  filter: blur(4px);
  user-select: none;
}

/* Mini strength bar */
.gen-mini-strength {
  display: flex;
  gap: 2px;
  height: 3px;
}
.gen-mini-seg {
  flex: 1;
  border-radius: 99px;
  background: var(--surface-elev);
  transition: background 0.2s;
}

/* Actions */
.gen-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.125rem;
}
.gen-btn-regen {
  padding: 0;
  background: var(--surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-lighter);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  min-height: 44px;
  min-width: 44px;
  width: 44px;
}
.gen-btn-regen:hover {
  border-color: var(--accent);
  color: var(--accent);
}
@keyframes gen-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.gen-btn-regen.spinning svg {
  animation: gen-spin 0.4s linear;
}
.gen-btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.625rem 0.85rem;
  background: var(--surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px;
}
.gen-btn-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.gen-btn-copy.copied {
  border-color: var(--success);
  color: var(--success);
}
.gen-btn-use {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  min-height: 44px;
}
.gen-btn-use:hover {
  background: var(--accent-hover);
}
.gen-btn-use:active {
  transform: scale(0.98);
}
.gen-btn-use:disabled {
  background: var(--surface-elev);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}
.gen-btn-copy:disabled {
  color: var(--text-muted);
  border-color: var(--border);
  cursor: not-allowed;
}

/* Mobile adjustments */
@media (max-width: 420px) {
  .gen-type-row {
    gap: 0.25rem;
  }
  .gen-type-chip {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
}
