:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-soft: #0b1220;
  --panel: rgba(16, 27, 45, 0.88);
  --panel-strong: #101c30;
  --panel-muted: #0e1829;
  --line: rgba(163, 183, 210, 0.17);
  --line-bright: rgba(94, 234, 212, 0.4);
  --text: #edf5ff;
  --muted: #9aabc0;
  --faint: #6e819b;
  --cyan: #5eead4;
  --cyan-deep: #1fb9a9;
  --lime: #bef264;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 90% -10%, rgba(34, 211, 238, 0.13), transparent 33rem),
    radial-gradient(circle at -10% 35%, rgba(132, 204, 22, 0.09), transparent 30rem),
    linear-gradient(150deg, #070b14 0%, #0a111f 52%, #08131d 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(190, 242, 100, 0.85);
  outline-offset: 3px;
}

.page-shell {
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: 32px 0 24px;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(94, 234, 212, 0.46);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(94, 234, 212, 0.18), rgba(16, 28, 48, 0.86));
  box-shadow: inset 0 1px rgba(255,255,255,0.12), 0 10px 28px rgba(0, 0, 0, 0.2);
}

.brand-lock,
.brand-lock::before,
.brand-lock::after {
  position: absolute;
  display: block;
}

.brand-lock {
  top: 20px;
  left: 14px;
  width: 20px;
  height: 16px;
  border: 2px solid var(--cyan);
  border-radius: 4px;
}

.brand-lock::before {
  top: -13px;
  left: 3px;
  width: 10px;
  height: 13px;
  border: 2px solid var(--cyan);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  content: "";
}

.brand-lock::after {
  top: 4px;
  left: 7px;
  width: 3px;
  height: 7px;
  border-radius: 4px;
  background: var(--lime);
  content: "";
}

.eyebrow,
.section-kicker {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.3;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 2px;
  color: var(--text);
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

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

.icon-button {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--cyan);
  background: rgba(14, 24, 41, 0.88);
  font-weight: 800;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  border-color: var(--line-bright);
  color: var(--lime);
  transform: translateY(-1px);
}

.privacy-strip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: 14px;
  background: rgba(13, 50, 54, 0.26);
}

.privacy-icon {
  display: grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(190, 242, 100, 0.5);
  border-radius: 8px;
  color: var(--lime);
  font-size: 1.1rem;
}

.privacy-strip strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 0.86rem;
}

.privacy-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.generator-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(16, 28, 48, 0.92), rgba(10, 18, 32, 0.94));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 10, 19, 0.3);
}

.mode-tab {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  padding: 12px 10px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.98rem;
  font-weight: 800;
}

.mode-tab small {
  color: var(--faint);
  font-size: 0.75rem;
  font-weight: 600;
}

.mode-tab::after {
  position: absolute;
  right: 17%;
  bottom: -1px;
  left: 17%;
  height: 3px;
  border-radius: 4px 4px 0 0;
  background: transparent;
  content: "";
}

.mode-tab.is-active {
  color: var(--text);
}

.mode-tab.is-active small {
  color: var(--cyan);
}

.mode-tab.is-active::after {
  background: var(--cyan);
  box-shadow: 0 0 18px rgba(94, 234, 212, 0.5);
}

.output-panel,
.settings-panel {
  padding: 28px clamp(18px, 4vw, 40px);
}

.output-heading-row,
.panel-heading,
.batch-heading,
.field-label-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.output-heading-row {
  margin-bottom: 14px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h2 span,
h3 span,
label span,
legend span {
  color: var(--muted);
  font-size: 0.84em;
  font-weight: 600;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(190, 242, 100, 0.22);
  border-radius: 999px;
  color: var(--lime);
  background: rgba(132, 204, 22, 0.08);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px rgba(190, 242, 100, 0.8);
}

.result-box {
  min-height: 94px;
  padding: 22px 20px;
  border: 1px solid rgba(94, 234, 212, 0.27);
  border-radius: 15px;
  background:
    linear-gradient(120deg, rgba(94, 234, 212, 0.06), transparent 45%),
    #07121e;
}

.primary-result {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(1.05rem, 3.4vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.55;
  word-break: break-word;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #041214;
  background: var(--cyan);
  box-shadow: 0 8px 22px rgba(94, 234, 212, 0.15);
}

.button-primary:hover {
  background: #8bf5e4;
}

.button-secondary,
.button-quiet {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.button-secondary:hover,
.button-quiet:hover {
  border-color: var(--line-bright);
  background: rgba(94, 234, 212, 0.08);
}

.button-generate {
  width: 100%;
  margin-top: 22px;
  min-height: 52px;
  border-color: rgba(190, 242, 100, 0.42);
  color: #10170a;
  background: linear-gradient(115deg, var(--lime), #86efac);
  box-shadow: 0 10px 28px rgba(190, 242, 100, 0.12);
  font-size: 0.95rem;
}

.button-generate:hover {
  border-color: rgba(224, 255, 180, 0.8);
  background: linear-gradient(115deg, #d9ff91, #9bf5b7);
}

.button-generate b {
  margin-left: auto;
  font-size: 1.2rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 16px;
}

.metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.metric-label small {
  display: block;
  color: var(--faint);
  font-size: 0.9em;
  font-weight: 600;
}

.metric strong {
  display: block;
  margin: 5px 0 1px;
  color: var(--lime);
  font-size: 1rem;
}

.metric strong.weak {
  color: var(--danger);
}

.metric strong.fair {
  color: var(--warning);
}

.metric strong.strong {
  color: var(--cyan);
}

.metric strong.very-strong {
  color: var(--lime);
}

.metric-note {
  display: block;
  color: var(--faint);
  font-size: 0.67rem;
  line-height: 1.3;
}

.batch-area {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.batch-heading {
  align-items: center;
  margin-bottom: 10px;
}

.batch-heading h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.button-quiet {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.74rem;
}

.result-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 28px;
}

.result-list li {
  padding-left: 5px;
}

.result-list li::marker {
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-row code {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}

.result-row .copy-item {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 0.7rem;
  font-weight: 800;
}

.result-row .copy-item:hover {
  border-color: var(--line-bright);
  color: var(--cyan);
}

.settings-divider {
  height: 1px;
  margin: 0 clamp(18px, 4vw, 40px);
  background: var(--line);
}

.settings-panel[hidden] {
  display: none;
}

.panel-heading {
  align-items: flex-start;
  margin-bottom: 24px;
}

.panel-index {
  color: var(--faint);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.8rem;
}

.field-block {
  margin-bottom: 21px;
}

.field-block > label,
.field-label-row label,
.character-fieldset legend {
  display: block;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
}

.field-label-row {
  align-items: center;
}

output {
  display: inline-grid;
  min-width: 46px;
  min-height: 31px;
  place-items: center;
  border: 1px solid rgba(94, 234, 212, 0.34);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(94, 234, 212, 0.08);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 800;
}

input[type="range"] {
  display: block;
  width: 100%;
  height: 8px;
  margin: 14px 0 4px;
  border-radius: 100px;
  accent-color: var(--cyan);
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
}

.help-text {
  margin: 6px 0 0;
  color: var(--faint);
  font-size: 0.74rem;
  line-height: 1.45;
}

.character-fieldset {
  min-width: 0;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.character-fieldset legend {
  padding: 0;
}

.toggle-grid,
.passphrase-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.toggle-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.toggle-card:hover {
  border-color: rgba(94, 234, 212, 0.35);
  background: rgba(94, 234, 212, 0.045);
}

.toggle-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0.01;
}

.toggle-check {
  position: relative;
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  border: 1px solid #55708c;
  border-radius: 6px;
  background: #0a1423;
  transition: border-color 160ms ease, background 160ms ease;
}

.toggle-check::after {
  position: absolute;
  top: 3px;
  left: 6px;
  width: 6px;
  height: 11px;
  border: solid #07120e;
  border-width: 0 2px 2px 0;
  content: "";
  opacity: 0;
  transform: rotate(45deg);
}

.toggle-card input:checked + .toggle-check {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.1);
}

.toggle-card input:checked + .toggle-check::after {
  opacity: 1;
}

.toggle-copy {
  display: block;
  min-width: 0;
}

.toggle-copy strong,
.toggle-copy small {
  display: block;
}

.toggle-copy strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toggle-copy small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 0.7rem;
  line-height: 1.25;
}

.advanced-options {
  margin: 4px 0 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 11, 20, 0.24);
}

.advanced-options summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
  list-style: none;
}

.advanced-options summary::-webkit-details-marker {
  display: none;
}

.summary-arrow {
  color: var(--cyan);
  font-size: 1.1rem;
  transition: transform 160ms ease;
}

.advanced-options[open] .summary-arrow {
  transform: rotate(180deg);
}

.advanced-content {
  padding: 2px 13px 4px;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

select,
.text-input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background-color: #0b1728;
}

select {
  cursor: pointer;
}

.text-input::placeholder {
  color: #61758f;
}

.compact-toggle {
  align-self: start;
  min-height: 72px;
}

.compact-toggle .toggle-copy small {
  line-height: 1.3;
}

.custom-separator-field {
  margin-top: 16px;
}

.passphrase-options {
  margin: 2px 0 16px;
}

.word-list-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(94, 234, 212, 0.16);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(94, 234, 212, 0.035);
  font-size: 0.75rem;
  line-height: 1.45;
}

.word-list-note strong {
  color: var(--cyan);
}

.list-icon {
  color: var(--lime);
  font-size: 1rem;
  line-height: 1.3;
}

.error-message {
  margin: 0 clamp(18px, 4vw, 40px) 24px;
  padding: 11px 13px;
  border: 1px solid rgba(251, 113, 133, 0.45);
  border-radius: 11px;
  color: #fecdd3;
  background: rgba(127, 29, 47, 0.22);
  font-size: 0.82rem;
  line-height: 1.45;
}

.error-message[hidden] {
  display: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 4px 0;
  color: var(--faint);
  font-size: 0.72rem;
}

.access-counter {
  white-space: nowrap;
}

dialog {
  width: min(100% - 28px, 580px);
  padding: 0;
  border: 1px solid rgba(94, 234, 212, 0.25);
  border-radius: 20px;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.58);
}

dialog::backdrop {
  background: rgba(3, 7, 14, 0.8);
  backdrop-filter: blur(5px);
}

.dialog-card {
  padding: 25px;
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.dialog-close {
  flex-basis: 36px;
  width: 36px;
  height: 36px;
  color: var(--muted);
}

.info-copy h3 {
  margin: 0 0 7px;
  color: var(--cyan);
  font-size: 0.92rem;
}

.info-copy p {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.info-copy hr {
  margin: 20px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.dialog-dismiss {
  width: 100%;
  margin-top: 6px;
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 22px, 980px);
    padding-top: 22px;
  }

  .site-header {
    margin-bottom: 18px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .brand-lock {
    top: 17px;
    left: 12px;
    transform: scale(0.88);
    transform-origin: top left;
  }

  .privacy-strip p {
    font-size: 0.7rem;
  }

  .output-panel,
  .settings-panel {
    padding: 22px 15px;
  }

  .settings-divider {
    margin: 0 15px;
  }

  .mode-tab {
    min-height: 54px;
    padding-inline: 6px;
    font-size: 0.9rem;
  }

  .mode-tab small {
    font-size: 0.68rem;
  }

  .secure-badge {
    display: none;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .metric {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 12px;
    align-items: center;
  }

  .metric-note {
    grid-column: 1 / -1;
  }

  .metric strong {
    margin: 0;
    text-align: right;
  }

  .two-column {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .two-column > .field-block {
    margin-bottom: 17px;
  }

  .compact-toggle {
    margin-bottom: 17px;
  }

  .site-footer {
    flex-direction: column;
    gap: 4px;
    padding-top: 15px;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    display: none;
  }

  .privacy-strip {
    padding: 12px;
  }

  .result-actions .button {
    flex: 1 1 145px;
  }

  .toggle-grid,
  .passphrase-options {
    gap: 7px;
  }

  .toggle-card {
    gap: 7px;
    padding: 10px 8px;
  }

  .toggle-copy strong {
    font-size: 0.76rem;
  }

  .toggle-copy small {
    font-size: 0.65rem;
  }

  .batch-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
