:root {
  color-scheme: dark;
  --background: #0b101b;
  --surface: #131c2b;
  --surface-inset: #0c1422;
  --surface-raised: #192537;
  --border: #2a374b;
  --text: #f2f6fc;
  --muted: #b0bed2;
  --subtle: #91a2bc;
  --mint: #8eebc4;
  --mint-hover: #aff6d7;
  --ink: #102820;
  --radius: 1.25rem;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 1;
  inset: 0.5rem auto auto 0.5rem;
  background: var(--mint);
  color: var(--ink);
  padding: 0.6rem 0.8rem;
  border-radius: 0.4rem;
}

.shell { width: min(100% - 3rem, 69rem); margin-inline: auto; }

.site-header {
  border-bottom: 1px solid #202d3f;
  background: #0e1522;
}

.header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  min-height: 4.625rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: fit-content;
  border-radius: 0.3rem;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.brand-accent { color: var(--mint); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.site-nav a {
  padding: 0.6rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 0.6rem;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 550;
}

.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a[aria-current="page"] {
  color: var(--mint);
  border-color: #294337;
  background: #172a28;
}

.hero {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.75rem, 4vw, 2.75rem);
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.15rem, 5.5vw, 4rem);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -0.062em;
  text-wrap: balance;
}

.hero h1 span { color: var(--mint); }
.hero p {
  max-width: 41rem;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  text-wrap: pretty;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 18.25rem);
  align-items: start;
  gap: 1.5rem;
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.generator {
  padding: clamp(1rem, 3.4vw, 2rem);
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 18%);
}

.generator-header, .strength-line, .length-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.65rem;
}

.generator h2 {
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.privacy {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid #2c493f;
  border-radius: 2rem;
  color: var(--mint);
  background: #172a29;
  font-size: 0.8125rem;
  font-weight: 600;
}

.result {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.125rem;
  padding: 0.45rem;
  border: 1px solid #34465e;
  border-radius: 0.85rem;
  background: var(--surface-inset);
}

.result:focus-within { border-color: var(--mint); }
#password {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.45rem 0.25rem 0.45rem 0.65rem;
  border: 0;
  border-radius: 0.35rem;
  background: transparent;
  color: var(--text);
  field-sizing: content;
  overflow-wrap: anywhere;
  resize: none;
  outline-offset: -2px;
  font: 600 clamp(1rem, 2.5vw, 1.4rem) / 1.4 ui-monospace, Consolas, "Liberation Mono", monospace;
}

#password::placeholder { color: var(--subtle); font-size: 1rem; }

.copy-button, .generate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  border-radius: 0.65rem;
  font-weight: 700;
}

.copy-button {
  padding: 0.5rem 0.85rem;
  border: 1px solid #354860;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 0.9375rem;
}

.copy-button:hover:not(:disabled) { background: #24354a; border-color: #618097; }

.strength {
  --strength-color: var(--mint);
  margin-top: 0.875rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.strength[data-level="1"] { --strength-color: #ff929f; }
.strength[data-level="2"] { --strength-color: #ffbc83; }
.strength[data-level="3"] { --strength-color: #f0d67c; }
#strength-value { color: var(--strength-color); font-weight: 650; }
.strength[data-level="0"] #strength-value { color: var(--muted); }
.strength-bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.3rem; margin-top: 0.45rem; }
.strength-bars span { height: 0.25rem; border-radius: 1rem; background: var(--border); }
.strength[data-level="1"] .strength-bars span:nth-child(-n+1),
.strength[data-level="2"] .strength-bars span:nth-child(-n+2),
.strength[data-level="3"] .strength-bars span:nth-child(-n+3),
.strength[data-level="4"] .strength-bars span:nth-child(-n+4),
.strength[data-level="5"] .strength-bars span { background: var(--strength-color); }

.settings { margin-top: 1.25rem; padding-top: 1.15rem; border-top: 1px solid var(--border); }
.length-header, .groups legend, .separator-field label { font-weight: 650; }
#length-value {
  padding: 0.22rem 0.6rem;
  border-radius: 0.45rem;
  color: var(--mint);
  background: #1b3430;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

#length {
  appearance: none;
  display: block;
  width: 100%;
  height: 1.75rem;
  margin: 0.25rem 0 0;
  border: 0;
  border-radius: 0.3rem;
  background: transparent;
  cursor: pointer;
}

#length::-webkit-slider-runnable-track {
  height: 0.375rem;
  border-radius: 1rem;
  background: linear-gradient(to right, var(--mint) var(--range-fill, 0%), #334359 var(--range-fill, 0%));
}

#length::-moz-range-track { height: 0.375rem; border-radius: 1rem; background: #334359; }
#length::-moz-range-progress { height: 0.375rem; border-radius: 1rem; background: var(--mint); }

#length::-webkit-slider-thumb {
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: -0.375rem;
  border: 2px solid #183d33;
  border-radius: 50%;
  background: var(--mint);
}

#length::-moz-range-thumb {
  box-sizing: border-box;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid #183d33;
  border-radius: 50%;
  background: var(--mint);
}

.range-limits {
  display: flex;
  justify-content: space-between;
  color: var(--subtle);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.groups { min-width: 0; margin: 0.9rem 0 0; padding: 0; border: 0; }
.groups legend { margin-bottom: 0.5rem; padding: 0; }
.groups-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.option {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--surface-inset);
  color: var(--text);
  font-size: 0.9375rem;
  cursor: pointer;
}

.option:hover { border-color: #5c748d; }
.option:has(input:focus-visible) { outline: 2px solid var(--mint); outline-offset: 2px; }
.option small { margin-left: 0.2rem; color: var(--subtle); font-size: 0.8125rem; white-space: nowrap; }
.option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.switch {
  flex: 0 0 2rem;
  height: 1.125rem;
  padding: 0.125rem;
  border-radius: 2rem;
  background: #43536a;
  pointer-events: none;
}

.switch::before {
  content: "";
  display: block;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: #d3e0ed;
}

.option input:checked + .switch { background: var(--mint); }
.option input:checked + .switch::before { transform: translateX(0.875rem); background: #18362c; }

.separator-field { display: grid; gap: 0.45rem; margin-top: 0.9rem; }
.separator-field select {
  appearance: none;
  min-height: 2.75rem;
  width: min(100%, 16rem);
  padding: 0.45rem 2.35rem 0.45rem 0.75rem;
  border: 1px solid #41536c;
  border-radius: 0.6rem;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 1.0625rem center / 0.3125rem 0.3125rem no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 0.75rem center / 0.3125rem 0.3125rem no-repeat,
    var(--surface-inset);
  color: var(--text);
}

.generate-button {
  width: 100%;
  min-height: 3rem;
  margin-top: 1.15rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid transparent;
  background: var(--mint);
  color: var(--ink);
}

.generate-button:hover:not(:disabled) { background: var(--mint-hover); }
.copy-button:disabled, .generate-button:disabled { opacity: 0.5; }
.feedback { min-height: 1.4em; margin-top: 0.375rem; color: var(--mint); font-size: 0.875rem; }
.feedback[data-error] { color: #ffb0b9; }

.sidebar { display: grid; gap: 1.25rem; }
.ad-slot {
  display: grid;
  place-items: center;
  height: 250px;
  border: 1px dashed #3a4a61;
  border-radius: var(--radius);
  background: #101826;
  color: var(--subtle);
}

.ad-slot span { font-size: 0.75rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase; }
.ad-slot--wide { height: 100px; margin-block: 1.5rem clamp(2.5rem, 7vw, 4.25rem); }

.tip { padding: 1.25rem; }
.tip-icon {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  margin-bottom: 0.65rem;
  border-radius: 0.6rem;
  color: var(--mint);
  background: #1d3934;
}

.tip h2 { font-size: 1.05rem; line-height: 1.35; }
.tip p { margin-top: 0.4rem; color: var(--muted); }

.reading { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); padding-bottom: 3.75rem; }
.reading--stacked { grid-template-columns: minmax(0, 1fr); }
.reading h2 { margin-bottom: 0.75rem; font-size: clamp(1.4rem, 3vw, 1.75rem); line-height: 1.2; letter-spacing: -0.03em; }
.reading p, .reading ul { color: var(--muted); }
.reading--stacked p, .reading--stacked ul { max-width: 75ch; }
.reading p + p { margin-top: 0.75rem; }
.reading ul { margin: 0; padding-inline-start: 1.5rem; }
.reading li + li { margin-top: 0.75rem; }
.reading li::marker { color: var(--mint); }

.reading-table { margin-block: 1rem 0.75rem; overflow-x: auto; }
.reading-table table {
  width: 100%;
  min-width: 42rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  text-align: start;
}
.reading-table th, .reading-table td {
  padding: 0.75rem 0.875rem;
  text-align: start;
  vertical-align: top;
}
.reading-table th { font-weight: 650; }
.reading-table thead { background: var(--surface-raised); }
.reading-table tbody tr { border-top: 1px solid var(--border); }
.reading-table tbody td { color: var(--muted); }
.reading-note { font-size: 0.875rem; }

.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 0.2rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  margin: -0.25rem 0.25rem 0 0;
  border: solid var(--mint);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.faq details[open] summary::after { margin-top: 0.25rem; transform: rotate(225deg); }
.faq details p { padding: 0 0.2rem 0.9rem; }
.site-footer { border-top: 1px solid #202d3f; background: #0e1522; }
.footer-inner p { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.875rem; }
.footer-inner p .icon { color: var(--mint); }

.icon { position: relative; display: inline-block; flex: none; color: inherit; }
.icon--brand, .icon--lock { color: var(--mint); }
.icon--brand { width: 2.1rem; height: 2.1rem; border: 1px solid #35594e; border-radius: 0.65rem; background: #1a3430; }
.icon--lock { width: 0.875rem; height: 0.875rem; }
.icon--brand::before, .icon--lock::before,
.icon--brand::after, .icon--lock::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); border: 1.5px solid currentColor; }
.icon--brand::before, .icon--lock::before { bottom: 48%; width: 0.42rem; height: 0.43rem; border-radius: 0.28rem 0.28rem 0 0; }
.icon--brand::after, .icon--lock::after { top: 47%; width: 0.7rem; height: 0.5rem; border-radius: 0.12rem; }
.icon--brand::after { background: #1a3430; }
.icon--lock::after { height: 0.43rem; }
.icon--copy { width: 1rem; height: 1rem; }
.icon--copy::before, .icon--copy::after { content: ""; position: absolute; width: 0.64rem; height: 0.72rem; border: 1.5px solid currentColor; border-radius: 0.16rem; }
.icon--copy::before { top: 0; right: 0; }
.icon--copy::after { bottom: 0; left: 0; background: var(--surface-raised); }
.copy-button:hover .icon--copy::after { background: #24354a; }
.icon--refresh { width: 0.95rem; height: 0.95rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.icon--refresh::after { content: ""; position: absolute; top: -0.08rem; right: -0.13rem; border: solid currentColor; border-width: 0 2px 2px 0; width: 0.38rem; height: 0.38rem; }

@media (max-width: 52rem) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 43rem) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { align-items: flex-start; flex-direction: column; gap: 0.65rem; padding-block: 0.8rem 0.55rem; }
  .site-nav { gap: 0.25rem; }
  .site-nav a { padding: 0.45rem 0.425rem; font-size: 0.875rem; }
  .reading { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 31rem) {
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .option small { display: none; }
  .copy-button { padding-inline: 0.55rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 0.65rem; padding-block: 1rem; }
}

@media (max-width: 23rem) {
  .site-nav { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 22rem) {
  .groups-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (forced-colors: active) {
  .switch, .switch::before, .strength-bars span { border: 1px solid ButtonText; }
  .option input:checked + .switch { background: Highlight; }
  #length { appearance: auto; }
}
