:root {
  /* === DARK THEME (Default) === */
  /* Backgrounds & Surfaces */
  --bg: #161619;
  --surface: #161619;
  --surface-alt: #1d1f24;
  --surface-elev: #20232a;
  --border: #2a2a30;
  --border-strong: #383944;

  /* Neutral Text */
  --text: #e8e6e3;
  --text-muted: #9a9aa1;
  --text-lighter: #b0adaa;

  /* SEMANTIC COLOR PALETTE — Phase 1 Redesign */

  /* Critical/Danger — Weak passwords, breaches */
  --critical: #ff5a5a;
  --critical-dim: #ff5a5a22;

  /* Warning — Medium concern, suspicious patterns */
  --warning: #ffb84d;
  --warning-dim: #ffb84d22;

  /* Success/Safe — Strong password, good attributes */
  --success: #2ecc71;
  --success-dim: #2ecc7122;

  /* Info/Accent — Primary action, highlights, UI chrome */
  --accent: #ff6600;
  --accent-dim: #ff660033;
  --accent-hover: #ff7f1a;

  /* Excellent/Exceptional — Passwords beyond strong */
  --excellent: #00d4ff;
  --excellent-dim: #00d4ff22;

  /* Confidence/Trust — Positive states, security, safe password */
  --confidence: #00c9a7;
  --confidence-dim: #00c9a722;

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

  /* Layout & Typography */
  --radius: 12px;
  --radius-sm: 8px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --font-display: "Outfit", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono:
    "B612 Mono", "SF Mono", "Monaco", "Inconsolata", "Fira Code", 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);
}

*,
*::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, #1f2330 0%, transparent 65%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

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.8rem;
}

.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%;
  padding: 1.05rem 1.5rem 0.9rem;
  text-align: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease;
}

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

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

header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 5.2vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.12;
  margin: 0.3rem 0;
}
.brand-time,
.brand-crack {
  color: var(--text);
}
.brand-two {
  color: var(--accent);
}
header p {
  font-size: 0.83rem;
  color: var(--text-lighter);
  max-width: 50rem;
  margin: 0.6rem 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);
  padding: 1.6rem;
  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;
}

.password-wrapper {
  display: flex;
  border-radius: var(--radius);
  overflow: visible;
  box-shadow: none;
  gap: 0;
  position: relative;
}
.password-wrapper input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 1.52rem;
  padding: 1.05rem 1.25rem;
  background: #14161b;
  border: 2px solid var(--border);
  border-right: none;
  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: 62px;
  letter-spacing: 0.08em;
  caret-color: var(--accent);
}
.password-wrapper input::placeholder {
  color: var(--text-muted);
  opacity: 0.82;
  letter-spacing: 0.02em;
}
.password-wrapper input:focus {
  border-color: var(--border);
  background: var(--surface-alt);
  box-shadow: none;
  letter-spacing: 0.05em;
}
.password-wrapper input:focus-visible {
  outline: none;
}
.password-wrapper button {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0;
  background: var(--surface);
  border: 2px solid var(--border);
  border-left: none;
  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: 62px;
  width: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.password-wrapper button:hover {
  color: var(--accent-hover);
  background: var(--surface-alt);
  border-color: var(--border);
}
.password-wrapper button:active {
  background: var(--accent-dim);
  transform: scale(0.98);
}
.password-wrapper button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

/* 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: 62px;
  width: 62px;
  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);
}
.password-wrapper-row .reset-btn-inline:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

/* Optional: Confidence button state (for future use) */
.btn-confidence {
  color: var(--confidence);
  border-color: var(--confidence);
  background: var(--confidence-dim);
}
.btn-confidence:hover {
  color: var(--confidence);
  border-color: var(--confidence);
  background: var(--confidence);
}
.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: flex-start;
  margin-top: 0.35rem;
}
.hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: normal;
  max-width: 70ch;
}
.hint svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.strength-bar-wrapper {
  margin-top: 0.45rem;
  width: 100%;
}
.strength-bar-wrapper .bar-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.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;
}
.strength-bar-track {
  height: 14px;
  background: #13151a;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: none;
  border: 1px solid var(--border-strong);
}
.strength-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 20px;
  transition:
    width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.4s ease;
  background: var(--border);
}

.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.25;
}
.advanced-panel summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
.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;
}

.app-description {
  font-size: clamp(1rem, 1vw + 0.72rem, 1.08rem);
  line-height: 1.74;
  letter-spacing: 0.006em;
  color: var(--text);
  margin: 0 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) {
  .app-description {
    font-size: 0.92rem;
    line-height: 1.68;
    margin: 0 auto 1.5rem auto;
    max-width: 69ch;
  }
}

.vuln-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.vuln-tag {
  font-size: 0.7rem;
  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;
  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;
}

.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: center;
  transition: border-color 0.2s ease;
  box-shadow: none;
}

.result-card .label {
  font-family: var(--font-display);
  font-size: 0.76rem;
  color: var(--text-lighter);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  margin-bottom: 1rem;
  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.1rem, 4vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  word-break: break-word;
  margin-top: 0.5rem;
  color: var(--text-lighter);
  min-height: 56px;
  line-height: 1.25;
}
.big-duration {
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-top: 0;
  color: var(--success);
}
.result-sentence {
  font-size: 0.95rem;
  color: var(--text-lighter);
  margin-top: 0.9rem;
  line-height: 1.7;
  letter-spacing: 0.2px;
  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);
}

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

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

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

.summary-main {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  line-height: 1.2;
}
.summary-main span {
  font-size: 0.94rem;
  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--safe {
  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--safe {
  background: #5cc8a822;
  color: var(--good);
  border-color: var(--good);
}

.big-duration--safe {
  color: var(--good) !important;
}

.results.is-empty .result-card {
  border-color: var(--border);
}
.results.is-empty .card-badge,
.results.is-empty .result-card .label,
.results.is-empty .result-sentence,
.results.is-empty .big-date {
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}
.results.is-empty .big-duration {
  color: var(--text-muted) !important;
}
.results.is-empty .secondary-panels {
  opacity: 0.55;
}
.results.is-empty .secondary-panels details {
  pointer-events: 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 {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
.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-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;
}
.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;
  white-space: nowrap;
  letter-spacing: -0.015em;
}
.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;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
  width: auto;
}
.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;
}

.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: 0.9rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.methodology p {
  color: var(--text-lighter);
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
  line-height: 1.75;
}
.method-list {
  margin: 0.4rem 0 1rem 1.2rem;
  padding-left: 1.1rem;
  color: var(--text-lighter);
}
.method-list li {
  margin-bottom: 0.7rem;
  font-size: 0.92rem;
  line-height: 1.7;
}
.method-list li a {
  margin-left: 0.35rem;
  font-size: 0.84rem;
}
.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 a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
footer a:hover {
  color: var(--accent-hover);
}

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

@media (max-width: 600px) {
  header {
    padding: 0.9rem 1.5rem 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;
  }
  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-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  .password-wrapper-row .password-wrapper {
    width: 100%;
  }
  .password-wrapper-row .reset-btn-inline {
    width: 62px;
    align-self: flex-end;
  }
  .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-switch {
    top: 0.75rem;
    right: 1rem;
  }
  .lang-switch button {
    min-height: 40px;
    padding: 0.45rem 0.72rem;
  }
}
@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);
}

.lang-switch {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  display: flex;
  gap: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--border);
  font-size: 0.75rem;
  box-shadow: none;
}
.lang-switch button {
  font-family: var(--font-body);
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  min-height: 36px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.lang-switch button.active {
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
}
.lang-switch button:hover:not(.active) {
  background: var(--surface-alt);
  color: var(--accent);
}
.lang-switch button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
