.pwgen {
  max-width: 520px;
  margin: 0 auto;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}


/* --- Mode switcher (tab-style radio group) --- */
.mode-switch {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 4px;
}
.mode-switch input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.mode-switch label {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #666;
}
.mode-switch input[type="radio"]:checked + label {
  background: #2563eb;
  color: #fff;
}
.mode-switch input[type="radio"]:focus-visible + label {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.pwgen-field { margin-bottom: 1rem; }
.pwgen-field label { display: block; margin-bottom: 0.4rem; font-weight: 600; }
.pwgen-field input[type="range"] { width: 100%; }
.pwgen-field select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
}

.pwgen-options {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.pwgen-options legend { font-weight: 600; padding: 0 0.4rem; }
.pwgen-options label {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0; font-size: 0.95rem;
}

.pwgen-actions { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.pwgen-actions button {
  flex: 1; padding: 0.65rem 1rem; border: none; border-radius: 8px;
  background: #2563eb; color: #fff; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s ease;
}
.pwgen-actions button:hover { background: #1d4ed8; }
.pwgen-actions button:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

.pwgen-output {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 1.15rem;
  word-break: break-all;
  background: #f4f4f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  cursor: text;
  user-select: all;
}
.pwgen-output.placeholder { color: #888; font-style: italic; font-family: inherit; }

.entropy-bar {
  background: #e5e7eb; border-radius: 999px; height: 8px;
  overflow: hidden; margin-bottom: 0.4rem;
}
.entropy-fill {
  height: 100%; width: 0%; border-radius: 999px;
  transition: width 0.25s ease, background-color 0.25s ease;
}
.entropy-fill[data-strength="weak"] { background: #dc2626; }
.entropy-fill[data-strength="moderate"] { background: #d97706; }
.entropy-fill[data-strength="strong"] { background: #16a34a; }

.entropy-label { font-size: 0.85rem; color: #555; margin: 0 0 0.2rem; }

.status-msg { font-size: 0.85rem; min-height: 1.2em; margin-bottom: 1rem; }
.status-msg.status-ok { color: #16a34a; }
.status-msg.status-warn { color: #d97706; }
.status-msg.status-err { color: #dc2626; }

/* --- Dark mode --- */



@media (prefers-reduced-motion: reduce) {
  .entropy-fill, .pwgen-actions button { transition: none; }
}

.pwgen-field-note {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
  line-height: 1.4;
}
.pwgen-field textarea {
  width: 100%;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.9rem;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  resize: vertical;
}
.pwgen-key-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}
.pwgen-key-row button {
  padding: 0.4rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
}