/* ── 비밀번호 생성기 ── */
:root {
  --green:   #16a34a;
  --green2:  #15803d;
  --emerald: #10b981;
  --mint:    #ecfdf5;
  --mint2:   #d1fae5;
  --ink:     #1e293b;
  --muted:   #64748b;
  --line:    #e2e8f0;
  --bg:      #f8fafc;
  --radius:  14px;
  --radius2: 10px;
  --shadow:  0 2px 8px rgba(0,0,0,.06);

  /* 강도 색상 */
  --s0: #94a3b8;
  --s1: #ef4444;
  --s2: #f97316;
  --s3: #eab308;
  --s4: #22c55e;
  --s5: #16a34a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif; }

.wrap { max-width: 100%; padding: 0 0 60px; }

/* ── 헤더 ── */
.top { padding: 20px 0 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 48px; height: 48px; border-radius: var(--radius2);
  background: linear-gradient(135deg, #16a34a, #0d9488);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.brand h1 { font-size: 22px; font-weight: 700; }
.brand .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── 카드 ── */
.card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.card-title {
  font-size: 14px; font-weight: 700; color: var(--ink);
  margin-bottom: 16px; display: flex; align-items: center; gap: 7px;
}

/* ── 결과 비밀번호 표시 ── */
.pw-output {
  background: var(--mint); border: 1.5px solid var(--mint2);
  border-radius: var(--radius2); padding: 18px 16px;
  font-size: 22px; font-weight: 700;
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Courier New', monospace;
  letter-spacing: 0.04em; word-break: break-all;
  color: var(--ink); min-height: 64px;
  display: flex; align-items: center;
  transition: background .15s;
  margin-bottom: 10px;
}
.pw-output.copied { background: var(--mint2); }

/* ── 강도 표시 ── */
.strength-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.strength-bars {
  display: flex; gap: 4px; flex: 1;
}
.strength-bar {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--line); transition: background .3s;
}
.strength-label {
  font-size: 12px; font-weight: 700; min-width: 48px; text-align: right;
}
.entropy-hint { font-size: 11px; color: var(--muted); }

/* ── 액션 버튼 행 ── */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-gen {
  flex: 1; min-width: 120px; height: 44px;
  background: linear-gradient(135deg, var(--green), var(--emerald));
  border: none; border-radius: var(--radius2);
  color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: opacity .15s; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-gen:hover { opacity: .88; }

.btn-copy {
  height: 44px; padding: 0 18px;
  background: #fff; border: 1.5px solid var(--line);
  border-radius: var(--radius2); font-size: 14px; font-weight: 600;
  color: var(--ink); cursor: pointer; transition: all .15s;
}
.btn-copy:hover { border-color: var(--green); color: var(--green); }

.btn-history {
  height: 44px; padding: 0 14px;
  background: #fff; border: 1.5px solid var(--line);
  border-radius: var(--radius2); font-size: 13px;
  color: var(--muted); cursor: pointer; transition: all .15s;
}
.btn-history:hover { border-color: var(--muted); color: var(--ink); }

/* ── 설정 패널 ── */
.settings-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 540px) { .settings-grid { grid-template-columns: 1fr; } }

.setting-item label {
  display: block; font-size: 12px; color: var(--muted); font-weight: 600;
  margin-bottom: 6px;
}
.setting-item .val-disp {
  font-size: 13px; font-weight: 700; color: var(--green); margin-left: 6px;
}

/* 슬라이더 */
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--green) 0%, var(--green) var(--pct, 50%), var(--line) var(--pct, 50%));
  outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--green); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

/* 체크박스 그리드 */
.check-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  grid-column: 1 / -1;
}
.check-label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: var(--radius2); transition: all .15s;
  user-select: none;
}
.check-label:hover { border-color: var(--green); }
.check-label input[type=checkbox] { display: none; }
.check-label .ck-box {
  width: 18px; height: 18px; border-radius: 5px;
  border: 2px solid var(--line); background: #fff;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; transition: all .15s;
}
.check-label input:checked ~ .ck-box {
  background: var(--green); border-color: var(--green); color: #fff;
}
.check-label.active { border-color: var(--green); background: var(--mint); }
.check-label .ck-text { font-size: 13px; font-weight: 600; color: var(--ink); }
.check-label .ck-sub { font-size: 10px; color: var(--muted); margin-top: 1px; display: block; }

/* 제외 문자 입력 */
.excl-input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius2);
  font-size: 14px; font-family: monospace;
  color: var(--ink); background: #fff; outline: none;
  transition: border-color .15s;
}
.excl-input:focus { border-color: var(--green); }

/* 빠른 프리셋 */
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-btn {
  padding: 6px 14px; border-radius: 100px;
  border: 1.5px solid var(--line); background: #fff;
  font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: all .15s;
}
.preset-btn:hover { border-color: var(--green); color: var(--green); }
.preset-btn.active { background: var(--green); border-color: var(--green); color: #fff; }

/* ── 다중 생성 ── */
.multi-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 320px; overflow-y: auto;
}
.multi-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius2); gap: 10px;
}
.multi-item .mi-pw {
  font-family: 'JetBrains Mono', monospace; font-size: 14px;
  color: var(--ink); flex: 1; word-break: break-all;
}
.multi-item .mi-copy {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 9px; font-size: 11px; color: var(--muted);
  cursor: pointer; flex-shrink: 0; transition: all .15s;
}
.multi-item .mi-copy:hover { border-color: var(--green); color: var(--green); }

.multi-ctrl { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.multi-count {
  height: 36px; width: 64px; padding: 0 10px;
  border: 1.5px solid var(--line); border-radius: var(--radius2);
  font-size: 14px; text-align: center; outline: none;
}
.multi-count:focus { border-color: var(--green); }
.btn-multi {
  height: 36px; padding: 0 16px;
  background: var(--green); border: none; border-radius: var(--radius2);
  color: #fff; font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn-multi:hover { background: var(--green2); }
.btn-copy-all {
  height: 36px; padding: 0 14px;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius2);
  font-size: 13px; color: var(--ink); cursor: pointer; transition: all .15s;
}
.btn-copy-all:hover { border-color: var(--green); color: var(--green); }

/* ── 이력 패널 ── */
.history-panel {
  display: none; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.history-panel.show { display: block; }
.history-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.history-header h3 { font-size: 14px; font-weight: 700; }
.btn-clear-hist {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; color: var(--muted); cursor: pointer;
}
.btn-clear-hist:hover { border-color: #ef4444; color: #ef4444; }
.history-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.hist-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: 8px; background: var(--bg);
  font-family: monospace; font-size: 13px; gap: 8px;
}
.hist-item .hi-copy {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 13px; padding: 2px 6px; flex-shrink: 0;
}
.hist-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 16px; }

/* ── 탭 ── */
.tab-bar { display: flex; gap: 6px; margin-bottom: 16px; }
.tab-btn {
  padding: 8px 18px; border-radius: 100px;
  border: 1.5px solid var(--line); background: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--muted); transition: all .15s;
}
.tab-btn.active { background: var(--green); border-color: var(--green); color: #fff; }
.tab-btn:hover:not(.active) { border-color: var(--green); color: var(--green); }

/* ── 토스트 ── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: #1e293b; color: #fff; border-radius: 100px;
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .2s; z-index: 9999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 사용 안내 ── */
.guide-section {
  margin-top: 24px; background: rgba(246,248,255,.6);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.guide-section h2 { font-size: 15px; font-weight: 800; margin: 0 0 10px; color: var(--ink); }
.guide-section h2:not(:first-child) { margin-top: 18px; }
.guide-steps, .guide-features, .guide-usecase {
  margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.8;
}
.guide-steps li, .guide-features li, .guide-usecase li { margin-bottom: 4px; }
.guide-steps strong, .guide-features strong { color: var(--ink); }
.guide-privacy {
  margin-top: 16px; background: #ecfdf5; border: 1px solid rgba(22,163,74,.22);
  border-radius: 12px; padding: 12px 14px; font-size: 12px; color: #14532d; line-height: 1.55;
}
