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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(96, 120, 255, 0.12), transparent 28%),
    radial-gradient(circle at bottom right, rgba(95, 125, 255, 0.08), transparent 28%),
    #080a13;
  color: #e0e0e0;
  display: flex;
  align-items: stretch;
}

/* ---- Layout ---- */
.container {
  display: grid;
  grid-template-columns: 300px 1fr;
  width: 100%;
  height: 100vh;
}

/* ---- Sidebar ---- */
.panel {
  background: rgba(12, 16, 34, 0.98);
  border-right: 1px solid rgba(70, 80, 150, 0.18);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.panel-header {
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(71, 88, 197, 0.2);
  background: linear-gradient(180deg, rgba(30, 37, 74, 0.98), rgba(11, 14, 30, 0.98));
  flex-shrink: 0;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-logo {
  width: 96px;
  height: auto;
  min-width: 96px;
  border-radius: 18px;
  padding: 8px;
  filter: drop-shadow(0 0 18px rgba(95, 125, 255, 0.35));
}

.brand-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8ea0ff;
  margin-bottom: 4px;
}

.panel-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  margin: 0;
}

.tool-tagline {
  margin: 6px 0 0;
  font-size: 12px;
  color: #b5bfff;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}

.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }

/* ---- Section title ---- */
.section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #444;
  margin-bottom: 8px;
}

/* ---- Range ---- */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-wrap input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #1e2340;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #5f7dff;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(95, 125, 255, 0.5);
}

.range-wrap input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #5f7dff;
  cursor: pointer;
  border: none;
}

.range-val {
  font-size: 13px;
  font-weight: 600;
  color: #8ea0ff;
  font-family: monospace;
  min-width: 28px;
  text-align: right;
}

/* ---- Row / toggle ---- */
.toggles { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; }
.row label:first-child { flex: 1; font-size: 12px; color: #888; }

.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  transition: background .2s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: #444;
  border-radius: 50%;
  transition: transform .2s, background .2s;
}
.toggle input:checked + .slider { background: rgba(95, 125, 255, 0.25); border-color: #5f7dff; }
.toggle input:checked + .slider::before { transform: translate(16px, -50%); background: #5f7dff; }

/* ---- Option hint ---- */
.option-hint {
  margin-top: 7px;
  font-size: 11px;
  color: #3a3a4a;
}

/* ---- Divider ---- */
hr { border: none; border-top: 1px solid #1c1c1c; }

/* ---- Generate button ---- */
.btn-generate {
  width: 100%;
  padding: 11px;
  background: #5f7dff;
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 0 16px rgba(95, 125, 255, 0.25);
}
.btn-generate:hover { background: #7090ff; box-shadow: 0 0 24px rgba(95, 125, 255, 0.4); }
.btn-generate:active { background: #4a66e0; }

/* ---- Output side ---- */
.output-side {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---- Primary section ---- */
.primary-section {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(70, 80, 150, 0.12);
}

.primary-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(70, 80, 150, 0.1);
  background: rgba(10, 13, 28, 0.6);
  gap: 10px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.io-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #444;
}

.password-display-wrap {
  padding: 28px 28px 18px;
  min-height: 88px;
  display: flex;
  align-items: center;
}

.password-display {
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 20px;
  letter-spacing: 2px;
  color: #c8d8ff;
  word-break: break-all;
  line-height: 1.7;
  flex: 1;
}

.password-display.empty {
  color: #2a2a3a;
  font-size: 14px;
  letter-spacing: 0;
  font-family: inherit;
}

/* ---- Strength ---- */
.strength-section {
  padding: 0 28px 18px;
}

.strength-bar-track {
  height: 4px;
  background: #1e2340;
  border-radius: 4px;
  overflow: hidden;
}

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

/* ---- Strength badge ---- */
.strength-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.strength-none      { background: rgba(100,100,120,0.2); color: #555; border: 1px solid #222; }
.strength-weak      { background: rgba(255,80,80,0.12); color: #ff6060; border: 1px solid rgba(255,80,80,0.25); }
.strength-fair      { background: rgba(255,165,0,0.12); color: #ffaa40; border: 1px solid rgba(255,165,0,0.25); }
.strength-strong    { background: rgba(0,200,120,0.12); color: #00c878; border: 1px solid rgba(0,200,120,0.25); }
.strength-very-strong { background: rgba(95,125,255,0.15); color: #8ea0ff; border: 1px solid rgba(95,125,255,0.3); }

.output-meta {
  font-size: 11px;
  color: #444;
  font-family: monospace;
}

/* ---- Action buttons ---- */
.action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(95,125,255,0.1);
  color: #8ea0ff;
  border: 1px solid rgba(95,125,255,0.2);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.action-btn:hover { background: rgba(95,125,255,0.2); color: #fff; }
.action-btn.copied { color: #00c878; border-color: rgba(0,200,120,0.3); background: rgba(0,200,120,0.08); }

/* ---- Batch section ---- */
.batch-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.batch-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(70, 80, 150, 0.1);
  background: rgba(10, 13, 28, 0.6);
}

.batch-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: #1e1e1e transparent;
}
.batch-list::-webkit-scrollbar { width: 6px; }
.batch-list::-webkit-scrollbar-track { background: transparent; }
.batch-list::-webkit-scrollbar-thumb { background: #1e1e1e; border-radius: 4px; }

.batch-hint {
  padding: 24px 0;
  color: #2a2a3a;
  font-size: 12px;
}

.batch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(10, 13, 28, 0.4);
  border: 1px solid rgba(70, 80, 150, 0.08);
  transition: background .15s, border-color .15s;
}
.batch-item:hover {
  background: rgba(15, 20, 40, 0.6);
  border-color: rgba(95, 125, 255, 0.15);
}

.batch-num {
  font-size: 10px;
  color: #333;
  font-family: monospace;
  min-width: 20px;
}

.batch-pw {
  flex: 1;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  color: #a0b0d0;
  letter-spacing: 1px;
  word-break: break-all;
}

.batch-copy {
  background: transparent;
  border: none;
  color: #2a2a3a;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color .15s;
  flex-shrink: 0;
}
.batch-copy:hover { color: #8ea0ff; }
.batch-copy.copied { color: #00c878; }

/* ---- Mobile ---- */
@media (max-width: 700px) {
  html, body { overflow: auto; height: auto; }

  .container {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .panel { height: auto; overflow: visible; border-right: none; border-bottom: 1px solid rgba(70,80,150,0.18); }
  .panel-body { overflow: visible; }

  .output-side { height: auto; }
  .primary-section { flex-shrink: unset; }
  .batch-section { flex: unset; min-height: 200px; }
}
