.pw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr);
  gap: 32px;
  align-items: start;
}

.pw-output {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 16px;
}

.pw-output .btn-primary {
  justify-self: start;
}

.pw-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pw-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.pw-text {
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 3.4vw, 1.6rem);
  line-height: 1.35;
  overflow-wrap: anywhere;
  user-select: all;
}

.c-digit {
  color: var(--accent);
}

.c-symbol {
  color: var(--danger);
}

.strength {
  display: grid;
  gap: 8px;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--danger);
  transition: width 200ms ease;
}

.meter span[data-level="3"] {
  background: #c99a2e;
}

.meter span[data-level="4"],
.meter span[data-level="5"] {
  background: var(--accent);
}

.strength-text {
  margin: 0;
  color: var(--muted);
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.form-error:empty {
  display: none;
}

.pw-options {
  display: grid;
  gap: 22px;
}

.pw-options .seg {
  width: 100%;
}

.length-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.length-number {
  width: 88px;
  min-height: 40px;
  text-align: center;
}

.group {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: 0;
}

.group[hidden],
.group [hidden] {
  display: none;
}

.group legend {
  margin-bottom: 6px;
  padding: 0;
}

.sample {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.indent {
  margin: 2px 0 0 30px;
}

.advanced {
  border-top: 1px solid var(--rule);
}

.advanced summary {
  padding: 14px 0 4px;
  font-weight: 700;
  cursor: pointer;
}

.advanced[open] {
  display: grid;
  gap: 16px;
}

.advanced [hidden] {
  display: none;
}

@media (max-width: 820px) {
  .pw-layout {
    grid-template-columns: 1fr;
  }

  .pw-output {
    position: static;
  }
}

@media (max-width: 420px) {
  .pw-item {
    grid-template-columns: 1fr;
  }

  .pw-item .btn {
    width: 100%;
  }
}
