*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2e3345;
  --text: #e8eaed;
  --muted: #9aa0b0;
  --accent: #6c63ff;
  --accent-hover: #5a52e0;
  --radius-card: 10px;
  --radius-input: 6px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
header {
  text-align: center;
  padding: 48px 0 32px;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

header p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

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

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 {
  font-size: 1.15rem;
  margin-bottom: 16px;
}

/* Password display */
.password-display {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 1.2rem;
  word-break: break-all;
  min-height: 56px;
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  color: var(--text);
  line-height: 1.5;
}

.password-display.multi {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font-size: 1rem;
}

.password-display.multi .pw-line {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

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

.password-display.multi .copy-line-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--muted);
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.2s, border-color 0.2s;
}

.password-display.multi .copy-line-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Buttons */
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-input);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  flex: 1;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

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

.btn-copy {
  background: var(--accent);
  color: #fff;
  padding: 14px 32px;
  font-size: 1rem;
  width: 100%;
  margin-top: 8px;
}

.btn-copy:hover {
  background: var(--accent-hover);
}

.btn-copy.copied {
  background: #2ea043;
}

/* Form controls */
.control-group {
  margin-bottom: 16px;
}

.control-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

.slider-row input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.slider-value {
  min-width: 36px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
}

.toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.toggle-item input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.toggle-item input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="text"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--accent);
}

select {
  cursor: pointer;
}

/* Strength meter */
.strength-meter {
  margin: 16px 0;
}

.strength-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

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

.strength-label {
  margin-top: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.strength-details {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.strength-detail {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--muted);
}

.strength-detail .value {
  color: var(--text);
  font-weight: 500;
}

.strength-warning {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--radius-input);
  color: #ff6b6b;
  font-size: 0.88rem;
}

/* Separator options */
.separator-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sep-btn {
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

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

.sep-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

/* Internal links */
.internal-links {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  margin: 32px 0;
}

.internal-links h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--muted);
}

.internal-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.internal-links-grid a {
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 0.88rem;
  transition: border-color 0.2s;
}

.internal-links-grid a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

/* Footer */
footer {
  text-align: center;
  padding: 32px 0;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* FAQ section */
.faq-section {
  margin-top: 32px;
}

.faq-section h2 {
  font-size: 1.25rem;
  margin-bottom: 16px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 12px;
}

.faq-item h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--accent);
}

.faq-item p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 600px) {
  header {
    padding: 32px 0 20px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .card {
    padding: 16px;
  }

  .toggle-grid {
    grid-template-columns: 1fr;
  }

  .password-display {
    font-size: 1rem;
    padding: 12px 14px;
  }

  .tab-btn {
    font-size: 0.78rem;
    padding: 8px 10px;
  }

  .btn-row {
    flex-direction: column;
  }

  .btn-row .btn {
    width: 100%;
  }
}
