:root {
  color-scheme: dark;
  --background: #0d1117; --surface: #161b22; --surface-raised: #1f2630;
  --text: #f0f3f6; --muted: #9da7b3; --border: #343c47;
  --accent: #72e1b7; --accent-text: #09251c; --danger: #ffb86b; --focus: #9fe8cf;
  --radius: 0.75rem; --radius-small: 0.45rem; --shadow: 0 1.25rem 3.5rem #00000040;
}
@media (prefers-color-scheme: light) {
  :root { color-scheme: light; --background: #f4f7f6; --surface: #ffffff; --surface-raised: #edf2f0; --text: #17211e; --muted: #5d6965; --border: #cbd5d1; --accent: #08795a; --accent-text: #ffffff; --danger: #9a4b00; --focus: #075f47; --shadow: 0 1.25rem 3.5rem #18382d1a; }
}
* { box-sizing: border-box; }
body { min-width: 0; min-height: 100vh; margin: 0; padding: 2rem 1rem 1.5rem; display: flex; flex-direction: column; background: var(--background); color: var(--text); font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
main { width: min(100%, 640px); margin: auto; }
header { margin-bottom: 1.5rem; }
header p, .intro p, .guide, footer { color: var(--muted); }
header p { margin: 0.2rem 0 0; }
.brand { color: var(--text); font-size: 1rem; font-weight: 700; text-decoration: none; }
.card { padding: clamp(1rem, 4vw, 2rem); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.intro { display: flex; gap: 1rem; align-items: start; justify-content: space-between; }
h1 { margin: 0; font-size: clamp(1.35rem, 5vw, 1.75rem); line-height: 1.25; }
.intro p { margin: 0.4rem 0 1.5rem; }
button, input { font: inherit; }
button { min-height: 2.75rem; padding: 0.6rem 1rem; border: 0; border-radius: var(--radius-small); background: var(--accent); color: var(--accent-text); font-size: 14px; font-weight: 700; cursor: pointer; }
button.secondary { border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); }
button:disabled { cursor: not-allowed; opacity: 0.55; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; padding: 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--surface-raised); }
#password { min-width: 0; overflow-wrap: anywhere; color: var(--text); font: 700 clamp(1.25rem, 5vw, 1.75rem)/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; user-select: all; }
.metrics { display: flex; gap: 0.5rem 1rem; justify-content: space-between; flex-wrap: wrap; margin: 0.75rem 0; color: var(--muted); font-size: 14px; }
.metrics p { margin: 0; }
.metrics strong { color: var(--text); }
.warning, .error { margin: 0.75rem 0; color: var(--danger); font-weight: 650; }
form { margin-top: 1.5rem; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 0.65rem; font-size: 14px; font-weight: 700; }
.length-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; }
.length-control legend { grid-column: 1 / -1; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-bounds { display: flex; justify-content: space-between; margin: -0.35rem 0 1.25rem; font-size: 12px; color: var(--muted); }
.length-value { display: inline-flex; align-items: center; gap: 0.4rem; }
.unit { color: var(--muted); font-size: 12px; }
input[type="number"] { width: 100%; padding: 0.55rem; border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--surface-raised); color: var(--text); font-size: 14px; }
.checks { display: grid; gap: 0.6rem; margin-top: 1.5rem; }
.checks label, .exclude { display: flex; gap: 0.6rem; align-items: center; font-size: 14px; }
.checks span { color: var(--muted); }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--accent); }
.exclude { margin-top: 1rem; }
.guide { margin: 1.25rem 0 0; font-size: 14px; }
.guide p { margin: 0.6rem 0 0; }
footer { width: min(100%, 640px); margin: 1.5rem auto 0; text-align: center; font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none; }
@media (max-width: 480px) { body { padding-inline: 0.75rem; } .intro { display: block; } .intro .secondary { margin-bottom: 1rem; } .result { grid-template-columns: minmax(0, 1fr); } .result button { width: 100%; } }
