.password-layout{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(340px,1fr));
  gap:24px;
  margin-bottom:28px;
}

.card{
  background:var(--dark-gray);
  border:1px solid var(--light-gray);
  border-radius:18px;
  padding:24px;
  min-height:100%;
}

.card h3{
  font-family:'Fredoka',sans-serif;
  color:var(--gold);
  font-size:1.3em;
  margin-bottom:14px;
}

.controls-card .input-group{
  margin-bottom:18px;
}

.controls-card label span{
  font-family:'Fredoka',sans-serif;
  color:var(--cream);
}

#lengthLabel{
  font-size:1.2em;
  color:var(--mint);
  margin-left:8px;
}

input[type="range"]{
  width:100%;
  accent-color:var(--gold);
  cursor:pointer;
}

.toggle-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
  margin:18px 0 22px;
}

.toggle-pill{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--light-gray);
  border-radius:999px;
  padding:10px 16px;
  background:var(--medium-gray);
  color:var(--cream);
  font-family:'Fredoka',sans-serif;
  cursor:pointer;
  transition:all .2s ease;
}

.toggle-pill:hover{
  border-color:var(--gold);
  color:var(--gold);
}

.toggle-pill input{
  accent-color:var(--gold);
}

.inputs{
  margin-top:4px;
}

.inputs .input-group{
  flex:1 1 45%;
}

.button-row{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}

.results-card .results-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.result-display{
  margin-top:16px;
  border:1px dashed var(--light-gray);
  border-radius:14px;
  min-height:190px;
  padding:16px;
  font-family:'JetBrains Mono',monospace;
  background:#141414;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.result-display p{
  opacity:.75;
}

.password-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.password-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-radius:10px;
  background:rgba(255,255,255,.04);
}

.password-text{
  word-break:break-all;
  flex:1;
}

.password-meta{
  font-size:.9em;
  color:rgba(255,255,255,.6);
  white-space:nowrap;
}

.history{
  margin-top:32px;
  border:1px solid var(--light-gray);
  border-radius:18px;
  padding:24px;
  background:#111;
}

.history-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.history-list{
  margin-top:18px;
  border:1px dashed var(--light-gray);
  border-radius:14px;
  padding:18px;
  max-height:360px;
  overflow:auto;
}

.history-entry{
  border:1px solid rgba(251,139,36,.45);
  border-radius:14px;
  padding:16px;
  margin-bottom:14px;
  background:#151515;
}

.history-entry h4{
  font-family:'Fredoka',sans-serif;
  color:var(--gold);
  margin-bottom:6px;
  display:flex;
  justify-content:space-between;
  gap:10px;
}

.history-entry ul{
  list-style:none;
  padding:0;
  margin:0 0 10px;
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  font-size:.95em;
  opacity:.85;
}

.history-passwords{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.history-passwords code{
  background:rgba(255,255,255,.06);
  border-radius:8px;
  padding:6px 10px;
  font-family:'JetBrains Mono',monospace;
  font-size:.9em;
}

.history-list p{
  margin:0;
  opacity:.7;
}

.hint{
  margin-top:6px;
  font-size:.9em;
  opacity:.7;
}

.btn:disabled{
  opacity:.6;
  cursor:not-allowed;
}

@media(max-width:640px){
  .result-display{min-height:160px}
  .password-row{flex-direction:column;align-items:flex-start}
  .password-meta{white-space:normal}
}
