/* ── Reset & base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --surface2:    #22263a;
  --border:      #2e3352;
  --accent:      #6c63ff;
  --accent-glow: #6c63ff44;
  --accent2:     #a78bfa;
  --success:     #22c55e;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --text:        #e2e8f0;
  --text-muted:  #64748b;
  --text-dim:    #94a3b8;
  --radius:      12px;
  --radius-sm:   8px;
  --transition:  .2s ease;
}

/* ── Modo claro ────────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #f1f5f9;
  --surface:     #ffffff;
  --surface2:    #f8fafc;
  --border:      #e2e8f0;
  --accent:      #6c63ff;
  --accent-glow: #6c63ff22;
  --accent2:     #7c3aed;
  --success:     #16a34a;
  --warning:     #d97706;
  --danger:      #dc2626;
  --text:        #0f172a;
  --text-muted:  #94a3b8;
  --text-dim:    #475569;
}

[data-theme="light"] h1 {
  background: linear-gradient(135deg, #1e1b4b 40%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .password-output::before {
  background: linear-gradient(90deg, #ede9fe 0%, transparent 60%);
}

[data-theme="light"] .toggle-card:has(input:checked) {
  background: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 100%);
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 4rem;
  line-height: 1.5;
}

/* ── Layout ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Header ────────────────────────────────────────────── */
header {
  text-align: center;
  padding: 2rem 0 1rem;
  position: relative;
}

.btn-theme {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.btn-theme svg { width: 18px; height: 18px; }
.btn-theme:hover { border-color: var(--accent); color: var(--accent2); }

.header-btns {
  position: absolute;
  top: 1.5rem;
  right: 0;
  display: flex;
  gap: .5rem;
  align-items: center;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 18px;
  margin-bottom: 1rem;
  box-shadow: 0 8px 32px var(--accent-glow);
}

.logo svg {
  width: 32px;
  height: 32px;
  color: #fff;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 40%, var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.5px;
}

.subtitle {
  color: var(--text-muted);
  font-size: .9rem;
  margin-top: .25rem;
}

/* ── Password output ───────────────────────────────────── */
.password-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1rem 1rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.password-output::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent-glow) 0%, transparent 60%);
  pointer-events: none;
}

.password-display {
  flex: 1;
  min-width: 0;
}

#passwordText {
  font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  font-size: 1.05rem;
  word-break: break-all;
  color: var(--text);
  display: block;
}

#passwordText.placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-family: inherit;
}

.output-actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}

.btn-icon {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.btn-icon svg { width: 18px; height: 18px; }

.btn-icon:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

.btn-icon.copied {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

/* ── Strength indicator ────────────────────────────────── */
.strength-section {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.strength-bar {
  flex: 1;
  height: 6px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  transition: width .4s ease, background .4s ease;
}

.strength-label {
  font-size: .8rem;
  font-weight: 600;
  min-width: 80px;
  text-align: right;
  color: var(--text-muted);
  transition: color .3s;
}

/* strength states */
.strength-fill.s1 { width: 20%; background: var(--danger); }
.strength-fill.s2 { width: 40%; background: #f97316; }
.strength-fill.s3 { width: 60%; background: var(--warning); }
.strength-fill.s4 { width: 80%; background: #84cc16; }
.strength-fill.s5 { width: 100%; background: var(--success); }

.strength-label.s1 { color: var(--danger); }
.strength-label.s2 { color: #f97316; }
.strength-label.s3 { color: var(--warning); }
.strength-label.s4 { color: #84cc16; }
.strength-label.s5 { color: var(--success); }

/* ── Settings card ─────────────────────────────────────── */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.setting-group { display: flex; flex-direction: column; gap: .75rem; }

.setting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-header label,
.group-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.setting-value {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent2);
  background: var(--surface2);
  padding: .2rem .6rem;
  border-radius: 6px;
  min-width: 40px;
  text-align: center;
}

/* ── Range slider ──────────────────────────────────────── */
.range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--surface2);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 4px var(--accent-glow);
  cursor: pointer;
  transition: transform var(--transition);
}

.range-input::-webkit-slider-thumb:hover { transform: scale(1.2); }

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--text-muted);
}

/* ── Toggle cards ──────────────────────────────────────── */
.toggles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.toggle-card {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .875rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.toggle-card input[type="checkbox"] { display: none; }

.toggle-card:hover { border-color: var(--accent); }

.toggle-card:has(input:checked) {
  border-color: var(--accent);
  background: linear-gradient(135deg, #1e1b4b 0%, #1a1d27 100%);
}

.toggle-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.toggle-sample {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent2);
}

.toggle-name {
  font-size: .8rem;
  color: var(--text-dim);
}

.toggle-switch {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 99px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--transition);
}

.toggle-card:has(input:checked) .toggle-switch {
  background: var(--accent);
}

.toggle-card:has(input:checked) .toggle-switch::after {
  transform: translateX(16px);
  background: #fff;
}

/* ── Advanced options ──────────────────────────────────── */
.advanced-options { display: flex; flex-direction: column; gap: .625rem; }

.option-row {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .75rem 1rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.option-row:hover { border-color: var(--accent); }

.option-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.option-text { display: flex; flex-direction: column; gap: .1rem; }
.option-name { font-size: .875rem; font-weight: 500; }
.option-desc { font-size: .75rem; color: var(--text-muted); }

/* ── Text input ────────────────────────────────────────── */
.text-input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: monospace;
  font-size: .875rem;
  padding: .625rem .875rem;
  outline: none;
  transition: border-color var(--transition);
}

.text-input:focus { border-color: var(--accent); }
.text-input.small { width: 80px; text-align: center; }

/* ── Generate button ───────────────────────────────────── */
.btn-generate {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  letter-spacing: .025em;
  transition: all var(--transition);
  box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-generate svg { width: 20px; height: 20px; }

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-generate:active { transform: translateY(0); }

/* ── Secondary button ──────────────────────────────────── */
.btn-secondary {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  padding: .5rem 1rem;
  transition: all var(--transition);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent2);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .8rem;
  padding: .25rem .5rem;
  border-radius: 4px;
  transition: color var(--transition);
}

.btn-text:hover { color: var(--danger); }

/* ── Bulk section ──────────────────────────────────────── */
.bulk-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.bulk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: background var(--transition);
  user-select: none;
}

.bulk-header:hover { background: var(--surface2); }

.bulk-arrow {
  width: 18px;
  height: 18px;
  transition: transform var(--transition);
}

.bulk-header.open .bulk-arrow { transform: rotate(180deg); }

.bulk-body {
  display: none;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-direction: column;
  gap: .875rem;
}

.bulk-body.open { display: flex; }

.bulk-controls {
  display: flex;
  align-items: flex-end;
  gap: .75rem;
}

.bulk-count-wrap {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.bulk-count-wrap label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.bulk-output {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .875rem;
  font-family: monospace;
  font-size: .8rem;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.bulk-item {
  color: var(--text-dim);
  padding: .25rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bulk-item:last-child { border-bottom: none; }

.bulk-item span { word-break: break-all; }

.bulk-item-num {
  color: var(--text-muted);
  font-size: .7rem;
  min-width: 28px;
  flex-shrink: 0;
}

/* ── History ───────────────────────────────────────────── */
.history-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.history-table-wrap {
  overflow-x: auto;
  max-height: 340px;
  overflow-y: auto;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
  padding: 2rem;
}

/* ── History table ─────────────────────────────────────── */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

.history-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface2);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .7rem;
  padding: .625rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.history-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.history-table tbody tr:last-child { border-bottom: none; }
.history-table tbody tr:hover { background: var(--surface2); }

.history-table td {
  padding: .625rem .75rem;
  vertical-align: middle;
}

/* column: # */
.col-num {
  color: var(--text-muted);
  width: 32px;
  text-align: center;
  font-family: monospace;
}

/* column: nombre */
.col-label { min-width: 110px; max-width: 160px; }

.label-cell {
  position: relative;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.label-text {
  flex: 1;
  color: var(--accent2);
  font-weight: 500;
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 4px;
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
  transition: border-color var(--transition);
}

.label-text:hover {
  border-color: var(--border);
  background: var(--surface2);
}

.label-text.empty {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
}

.label-input {
  display: none;
  flex: 1;
  background: var(--surface2);
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  color: var(--text);
  font-size: .8rem;
  padding: .2rem .4rem;
  outline: none;
  min-width: 0;
  max-width: 130px;
}

.label-input.active { display: block; }
.label-text.hidden { display: none; }

/* column: contraseña */
.col-pass { min-width: 140px; }

.pass-text {
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: .78rem;
  color: var(--text);
  word-break: break-all;
  cursor: pointer;
  display: block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pass-text:hover { color: var(--accent2); }

/* column: fecha */
.col-date {
  min-width: 115px;
  white-space: nowrap;
  color: var(--text-muted);
}

/* column: acciones */
.col-actions { width: 124px; }

.row-actions {
  display: flex;
  gap: .25rem;
  opacity: 0;
  transition: opacity var(--transition);
}

tr:hover .row-actions,
tr:has(.btn-row.fav.active) .row-actions { opacity: 1; }

.btn-row {
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition), background var(--transition);
  color: var(--text-muted);
}

.btn-row svg { width: 14px; height: 14px; }
.btn-row.copy:hover  { color: var(--accent2); background: var(--surface2); }
.btn-row.delete:hover { color: var(--danger); background: var(--surface2); }

/* ── QR Modal ──────────────────────────────────────────── */
.qr-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.qr-overlay.open { display: flex; }

.qr-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 340px;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: qrIn .2s ease;
}

@keyframes qrIn {
  from { opacity: 0; transform: scale(.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.qr-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.25rem .75rem;
}

.qr-dialog-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.qr-dialog-label {
  font-size: .8rem;
  color: var(--accent2);
  margin-top: .15rem;
  min-height: 1em;
}

.qr-canvas-wrap {
  display: flex;
  justify-content: center;
  padding: .75rem 1.25rem;
  background: #fff;
  margin: 0 1.25rem;
  border-radius: var(--radius-sm);
}

#qrCanvas canvas,
#qrCanvas img {
  display: block;
  width: 220px !important;
  height: 220px !important;
}

.qr-pass-text {
  font-family: monospace;
  font-size: .7rem;
  color: var(--text-muted);
  text-align: center;
  padding: .625rem 1.25rem 0;
  word-break: break-all;
}

.qr-dialog-footer {
  display: flex;
  justify-content: center;
  padding: 1rem 1.25rem 1.25rem;
}

/* QR button in history rows */
.btn-row.qr:hover { color: var(--accent2); background: var(--surface2); }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .875rem;
  font-weight: 500;
  padding: .625rem 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: all .3s ease;
  white-space: nowrap;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Crack time ────────────────────────────────────────── */
.crack-section {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  padding: 0 .1rem;
}
.crack-key { color: var(--text-muted); }
.crack-val { color: var(--text-dim); font-weight: 600; }

/* ── Mode tabs ─────────────────────────────────────────── */
.mode-tabs {
  display: flex;
  gap: .375rem;
}

.mode-tab {
  flex: 1;
  padding: .5rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  transition: all var(--transition);
  user-select: none;
}

.mode-tab:hover { border-color: var(--accent); color: var(--accent2); }

.mode-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.mode-hint {
  font-size: .8rem;
  color: var(--text-muted);
  font-style: italic;
  display: none;
}
.mode-hint.visible { display: block; }

/* ── PIN setting row ───────────────────────────────────── */
.pin-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* ── History search ────────────────────────────────────── */
.history-search-wrap {
  padding: .625rem 1rem;
  border-bottom: 1px solid var(--border);
}

.search-input {
  font-family: inherit;
  font-size: .85rem;
}

/* ── History header actions ────────────────────────────── */
.history-header-actions {
  display: flex;
  gap: .25rem;
  align-items: center;
}

/* ── Favorites ─────────────────────────────────────────── */
.btn-row.fav { color: var(--text-muted); }
.btn-row.fav.active { color: #f59e0b; }
.btn-row.fav:hover { color: #f59e0b; background: var(--surface2); }

/* ── PIN Overlay ───────────────────────────────────────── */
.pin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(8px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pin-overlay.open { display: flex; }

.pin-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
  animation: qrIn .2s ease;
}

.pin-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 16px;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.pin-logo svg { width: 26px; height: 26px; color: #fff; }

.pin-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .25rem;
}

.pin-subtitle {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.pin-dots {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: .75rem;
}

.pin-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all .15s ease;
}

.pin-dots span.filled {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.15);
}

.pin-error {
  font-size: .8rem;
  color: var(--danger);
  min-height: 1.2em;
  margin-bottom: .875rem;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .625rem;
  margin-bottom: .5rem;
}

.pin-key {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  padding: .875rem;
  transition: all .15s ease;
  user-select: none;
}

.pin-key:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pin-key:active { transform: scale(.95); }

.pin-clear {
  background: none;
  border-color: transparent;
  color: var(--text-muted);
  font-size: 1.3rem;
}

.pin-clear:hover {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
}

.pin-ok {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pin-ok:hover {
  background: var(--accent2);
  border-color: var(--accent2);
}

/* ── Folder hint ───────────────────────────────────────── */
.folder-hint {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: .25rem;
}

.folder-hint strong { color: var(--accent2); }

/* ── Presets ───────────────────────────────────────────── */
.presets-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.preset-btn {
  flex: 1;
  min-width: 70px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  padding: .5rem .625rem;
  transition: all var(--transition);
  user-select: none;
  white-space: nowrap;
}

.preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent2);
  background: var(--accent-glow);
}

.preset-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 400px) {
  .toggles-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.4rem; }
  #passwordText { font-size: .9rem; }
}
