/* Password styles, copied from the original site. Every selector is scoped to
   .tool-password and IDs carry the "pw-" prefix so this sheet only affects this tool. */

.tool-password .panel {
  pointer-events: auto;
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.tool-password .tabs {
  display: flex;
  margin: 1rem 0 1.25rem;
  border-bottom: 1px solid rgba(84, 129, 193, 0.4);
}

.tool-password .tab {
  flex: 1 1 0;
  position: relative;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 0.55rem 0.75rem 0.7rem;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.tool-password .tab:hover {
  color: #fff;
  background: rgba(84, 129, 193, 0.18);
}

.tool-password .tab[aria-selected="true"] {
  color: #fff;
}

.tool-password .tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--atp-blue);
}

.tool-password .tab:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
  border-radius: 6px;
}

.tool-password .length-row {
  display: grid;
  grid-template-columns: auto 1fr 5.5rem;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 0.85rem;
  margin: 0 0 1rem;
}

.tool-password .length-row label {
  font-weight: 600;
  font-size: 0.95rem;
}

.tool-password .length-row .hint {
  grid-column: 2 / 4;
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.tool-password input[type="number"] {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font-family: var(--mono);
  font-size: 1.05rem;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.tool-password input[type="number"]:focus {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(84, 129, 193, 0.6);
}

.tool-password input[type="range"] {
  --fill: 3.2%;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.tool-password input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--atp-blue) var(--fill), rgba(0, 0, 0, 0.45) var(--fill));
  border: 1px solid var(--line);
}

.tool-password input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
}

.tool-password input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--atp-blue);
}

.tool-password input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--atp-blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.tool-password input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--atp-blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.tool-password input[type="range"]:focus {
  outline: none;
}

.tool-password input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px #fff;
}

.tool-password input[type="range"]:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px #fff;
}

.tool-password h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tool-password .intro {
  margin: 0 0 1.25rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.4;
}

.tool-password .pw-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.5rem;
  padding: 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.tool-password .pw-output {
  font-family: var(--mono);
  font-size: clamp(1.2rem, 5vw, 1.65rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}

.tool-password .pw-output.long {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-align: left;
  width: 100%;
}

.tool-password .pw-output.empty {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  color: rgba(185, 201, 223, 0.6);
  word-break: normal;
  user-select: none;
  -webkit-user-select: none;
}

.tool-password .pw-output.fresh {
  animation: fresh 0.35s ease-out;
}

@keyframes fresh {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.tool-password .actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}

.tool-password .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: rgba(84, 129, 193, 0.25);
  border: 1px solid var(--atp-blue);
  border-radius: 6px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tool-password .btn:hover:not(:disabled) {
  background: rgba(84, 129, 193, 0.45);
}

.tool-password .btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.tool-password .btn-primary {
  flex: 1 1 auto;
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
  background: var(--atp-blue);
}

.tool-password .btn-primary:hover:not(:disabled) {
  background: #6a94d0;
}

.tool-password .btn-copy {
  flex: 0 0 auto;
  min-width: 7.5rem;
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
}

.tool-password .btn-copy .icon-check {
  display: none;
}

.tool-password .btn-copy.copied {
  border-color: var(--ok); color: var(--ok);
}

.tool-password .btn-copy.copied .icon-copy {
  display: none;
}

.tool-password .btn-copy.copied .icon-check {
  display: inline;
}

.tool-password .btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tool-password .status {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
  min-height: 1.2em;
}

@media (max-width: 480px) {
  .tool-password .panel {
    padding: 1.25rem 1.1rem;
  }

  .tool-password .tab {
    font-size: 0.98rem;
  }

  .tool-password .length-row {
    grid-template-columns: auto 1fr 4.75rem; column-gap: 0.6rem;
  }

  .tool-password h1 {
    font-size: 1.45rem;
  }

  .tool-password .btn-copy {
    min-width: 6.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-password .btn,
  .tool-password .tab {
    transition: none;
  }

  .tool-password .pw-output.fresh {
    animation: none;
  }
}
