:root {
  --bg: #ffffff;
  --surface: #fcfcfc;
  --surface-2: #f2f2f2;
  --ink: #5c6b73;
  --ink-soft: #3c4757;
  --muted: #657386;
  --line: #d3dae2;
  --line-strong: #b6c1cd;
  --digit: #0582ca;
  --symbol: #ff595e;
  --upper: #181a1d;
  --lower: #495867;
  --ok: #60d394;
  --warn: #f9844a;
  --bad: #ff595e;
  --focus: #0f52c9;
  --radius: 10px;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #181a1d;
    --surface: #1b1f22;
    --surface-2: #262a30;
    --ink: #cad3de;
    --ink-soft: #c2ccd8;
    --muted: #8d9aab;
    --line: #2c343f;
    --line-strong: #3c4653;
    --digit: #6fa8ff;
    --symbol: #ff6b6b;
    --upper: #f2f6fa;
    --lower: #b7c3d2;
    --ok: #4fc08d;
    --warn: #f4a261;
    --bad: #ff6b6b;
    --focus: #6fa8ff;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #181a1d;
  --surface: #1b1f22;
  --surface-2: #262a30;
  --ink: #cad3de;
  --ink-soft: #c2ccd8;
  --muted: #8d9aab;
  --line: #2c343f;
  --line-strong: #3c4653;
  --digit: #6fa8ff;
  --symbol: #ff6b6b;
  --upper: #f2f6fa;
  --lower: #b7c3d2;
  --ok: #4fc08d;
  --warn: #f4a261;
  --bad: #ff6b6b;
  --focus: #6fa8ff;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box
}

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
  -webkit-text-size-adjust: 100%
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.wrap {
  max-width: 52rem;
  margin: 0 auto;
  padding: 28px 18px 64px
}

/* Kopfzeile */
header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  margin-bottom: 22px
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0
}

.note {
  color: var(--muted);
  font-size: .875rem;
  margin: 0
}

.theme-btn {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  padding: 0;
  line-height: 1;
  cursor: pointer;
}

.theme-btn i {
  font-size: 20px;
  line-height: 1;
}

.theme-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink-soft)
}

/* Ausgabe */
.output {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.pw-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 18px;
  border-bottom: 1px solid var(--line);
}

.pw-row:last-child {
  border-bottom: 0
}

.pw-row:nth-child(even) {
  background: var(--surface-2)
}

.pw {
  flex: 1;
  min-width: 0;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 500;
  font-size: clamp(1rem, .9rem + .7vw, 1.3rem);
  line-height: 1.45;
  letter-spacing: .02em;
  word-break: break-all;
  cursor: text;
  -webkit-user-select: all;
  user-select: all;
}

.pw .n {
  color: var(--digit);
  font-weight: 700
}

.pw .s {
  color: var(--symbol);
  font-weight: 700
}

.pw .u {
  color: var(--upper)
}

.pw .l {
  color: var(--lower)
}

.pw .gap {
  margin-right: .42em
}

.empty {
  padding: 22px 18px;
  color: var(--bad);
  font-size: .9375rem
}

/* Buttons */
button {
  font: inherit
}

.copy {
  flex: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: .8125rem;
  cursor: pointer;
  min-width: 6.2rem;
}

.copy:hover {
  border-color: var(--ink-soft);
  color: var(--ink)
}

.copy.done {
  border-color: var(--ok);
  color: var(--ok)
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 26px;
  align-items: center
}

.primary {
  background: var(--ink);
  color: var(--surface);
  border: 1px solid var(--ink);
  border-radius: 8px;
  padding: 11px 20px;
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
}

.primary:hover {
  opacity: .88
}

.ghost {
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  border-radius: 8px;
  padding: 11px 16px;
  font-size: .9375rem;
  cursor: pointer;
}

.ghost:hover {
  border-color: var(--ink-soft);
  color: var(--ink)
}

.ghost.done {
  border-color: var(--ok);
  color: var(--ok)
}

/* Stärke */
.strength {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 2px 0;
  flex-wrap: wrap
}

.bar {
  flex: 1;
  min-width: 140px;
  height: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--bad);
  transition: width .25s ease, background .25s ease
}

.strength .label {
  font-size: .875rem;
  font-weight: 500
}

.strength .bits {
  font-size: .8125rem;
  color: var(--muted)
}

/* Legende */
.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 10px 2px 0;
  font-size: .8125rem;
  color: var(--muted);
}

.legend b {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  margin-right: 5px;
}

.legend .n b {
  color: var(--digit)
}

.legend .s b {
  color: var(--symbol)
}

.legend .a b {
  color: var(--upper)
}

/* Einstellungen */
section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-top: 26px;
}

h2 {
  font-size: .9375rem;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--ink)
}

.sliders {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr
}

@media (min-width:620px) {
  .sliders {
    grid-template-columns: 2fr 1fr
  }
}

.field label {
  display: block;
  font-size: .875rem;
  color: var(--ink-soft);
  margin-bottom: 8px
}

.field .row {
  display: flex;
  align-items: center;
  gap: 12px
}

input[type=range] {
  flex: 1;
  min-width: 0;
  accent-color: var(--digit);
  height: 24px
}

input[type=number] {
  width: 4.5rem;
  flex: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  padding: 7px 4px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0
}

.checks {
  display: grid;
  gap: 12px 22px;
  grid-template-columns: 1fr
}

@media (min-width:620px) {
  .checks {
    grid-template-columns: 1fr 1fr
  }
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  padding: 2px
}

.check input {
  accent-color: var(--digit);
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
  cursor: pointer
}

.check .txt {
  font-size: .9375rem;
  color: var(--ink)
}

.check .hint {
  display: block;
  font-size: .8125rem;
  color: var(--muted);
  margin-top: 2px;
}

.check .hint code {
  font-family: "JetBrains Mono", monospace;
  font-size: .8125rem
}

.check.off .txt {
  color: var(--muted)
}

footer {
  margin-top: 24px;
  font-size: .8125rem;
  color: var(--muted);
  text-align: center
}

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

@media (prefers-reduced-motion:reduce) {
  * {
    transition: none !important;
    animation: none !important
  }
}