* { box-sizing: border-box; }

/* ══════════════════
   LAYOUT
══════════════════ */
#main-section {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.rng-right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rng-presets-outer { display: none; }
.rng-presets-inner { display: block; }

.rng-control-section,
.rng-output-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(99,102,241,0.07);
  display: flex;
  flex-direction: column;
}

/* ══════════════════
   SECTION TITLE
══════════════════ */
label.rng-section-title,
.rng-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 18px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: default;
}

label.rng-section-title svg,
.rng-section-title svg { stroke: #6366f1; flex-shrink: 0; }

/* ══════════════════
   MIN / MAX ROW
══════════════════ */
.rng-minmax-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 18px;
}

.rng-minmax-row .rng-field-group { flex: 1; margin: 0; }

.rng-divider-icon {
  font-size: 1.1rem;
  color: #94a3b8;
  font-weight: 700;
  padding-bottom: 10px;
  flex-shrink: 0;
}

.rng-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
}

.rng-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  outline: none;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.18s;
  -moz-appearance: textfield;
}

.rng-input::-webkit-outer-spin-button,
.rng-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.rng-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}

/* ══════════════════
   COUNT
══════════════════ */
.rng-count-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.18s;
  max-width: 180px;
}

.rng-count-wrap:focus-within { border-color: #818cf8; }

.rng-count-btn {
  width: 40px;
  height: 40px;
  background: #f8f9ff;
  border: none;
  font-size: 1.2rem;
  color: #6366f1;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.rng-count-btn:hover { background: #e0e7ff; }

.rng-count-input {
  flex: 1;
  border: none;
  outline: none;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  background: transparent;
  font-family: inherit;
  -moz-appearance: textfield;
}

.rng-count-input::-webkit-outer-spin-button,
.rng-count-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ══════════════════
   OPTIONS
══════════════════ */
.rng-options { display: flex; flex-direction: column; gap: 9px; }

.rng-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.87rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.rng-checkbox-label input[type="checkbox"] { display: none; }

.rng-checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #c7d2fe;
  border-radius: 5px;
  background: #f8f9ff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.rng-checkbox-label input:checked + .rng-checkmark {
  background: #6366f1;
  border-color: #6366f1;
}

.rng-checkbox-label input:checked + .rng-checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

/* ══════════════════
   SEPARATOR
══════════════════ */
.rng-sep-options {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.rng-sep-btn {
  background: #f8f9ff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.80rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.rng-sep-btn:hover { background: #ede9fe; border-color: #a5b4fc; color: #4338ca; }
.rng-sep-btn.active { background: #ede9fe; border-color: #6366f1; color: #4338ca; }

/* ══════════════════
   GENERATE BTN
══════════════════ */
.rng-generate-btn {
  width: 100%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.18s, transform 0.15s;
  margin-top: auto;
}

.rng-generate-btn:hover { opacity: 0.88; transform: scale(1.02); }
.rng-generate-btn:active { transform: scale(0.98); }

/* ══════════════════
   OUTPUT SECTION
══════════════════ */
.rng-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.rng-output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rng-icon-btn {
  width: 34px;
  height: 34px;
  border: 1.5px solid #e0e7ff;
  border-radius: 8px;
  background: #fff;
  color: #6366f1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.rng-icon-btn:hover { background: #ede9fe; border-color: #a5b4fc; }

.rng-copy-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.18s;
}

.rng-copy-btn:hover { opacity: 0.85; }
.rng-copy-btn.copied { background: linear-gradient(135deg, #22c55e, #16a34a); }

/* ── Big Single Number ── */
.rng-single-display {
  background: linear-gradient(135deg, #f8f9ff, #ede9fe33);
  border: 2px solid #c7d2fe;
  border-radius: 14px;
  padding: 32px 20px;
  text-align: center;
  margin-bottom: 14px;
  transition: all 0.3s;
}

.rng-big-number {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  color: #6366f1;
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
  transition: all 0.25s ease;
  letter-spacing: -0.02em;
}

.rng-big-number.animate {
  transform: scale(1.15);
  color: #8b5cf6;
}

.rng-range-label {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 600;
}

/* ── Multi Output ── */
.rng-output-textarea {
  width: 100%;
  min-height: 140px;
  resize: none;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: 'Courier New', monospace;
  color: #1e293b;
  background: #f8faff;
  outline: none;
  line-height: 1.7;
  margin-bottom: 14px;
  font-weight: 600;
}

/* ── Stats ── */
.rng-stats-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.rng-stat-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
}

/* ══════════════════
   PRESETS
══════════════════ */
.rng-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rng-preset-btn {
  background: #f8f9ff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4338ca;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.rng-preset-btn:hover {
  background: #ede9fe;
  border-color: #a5b4fc;
  box-shadow: 0 2px 8px rgba(99,102,241,0.12);
  transform: translateY(-1px);
}

/* ══════════════════
   DARK MODE
══════════════════ */
body.dark-mode .rng-control-section,
body.dark-mode .rng-output-section { background: #0f172a; border-color: #1e293b; }

body.dark-mode label.rng-section-title,
body.dark-mode .rng-section-title { color: #e2e8f0; }

body.dark-mode label.rng-section-title svg,
body.dark-mode .rng-section-title svg { stroke: #a5b4fc; }

body.dark-mode .rng-label { color: #475569; }

body.dark-mode .rng-input,
body.dark-mode .rng-count-input { color: #e2e8f0; }

body.dark-mode .rng-input { background: #1e293b; border-color: #334155; }
body.dark-mode .rng-input:focus { border-color: #818cf8; }

body.dark-mode .rng-count-wrap { background: #1e293b; border-color: #334155; }
body.dark-mode .rng-count-btn { background: #1e1b4b; color: #a5b4fc; }
body.dark-mode .rng-count-btn:hover { background: #312e81; }
body.dark-mode .rng-count-input { background: transparent; }

body.dark-mode .rng-checkbox-label { color: #94a3b8; }
body.dark-mode .rng-checkmark { background: #1e1b4b; border-color: #312e81; }

body.dark-mode .rng-sep-btn { background: #1e1b4b; border-color: #312e81; color: #94a3b8; }
body.dark-mode .rng-sep-btn.active { background: #312e81; color: #a5b4fc; border-color: #6366f1; }
body.dark-mode .rng-sep-btn:hover { background: #2e1b6b; color: #a5b4fc; }

body.dark-mode .rng-single-display { background: #1e1b4b; border-color: #312e81; }
body.dark-mode .rng-big-number { color: #a5b4fc; }
body.dark-mode .rng-range-label { color: #475569; }

body.dark-mode .rng-output-textarea { background: #1e293b; border-color: #334155; color: #e2e8f0; }

body.dark-mode .rng-icon-btn { background: #1e293b; border-color: #312e81; color: #a5b4fc; }
body.dark-mode .rng-icon-btn:hover { background: #2e1b6b; }

body.dark-mode .rng-stat-chip { background: #1e293b; border-color: #334155; color: #94a3b8; }

body.dark-mode .rng-preset-btn { background: #1e1b4b; border-color: #312e81; color: #a5b4fc; }
body.dark-mode .rng-preset-btn:hover { background: #2e1b6b; border-color: #6366f1; }

/* ══════════════════
   RESPONSIVE
══════════════════ */
@media (max-width: 768px) {
  #main-section { grid-template-columns: 1fr; }
  .rng-presets-inner { display: none !important; }
  .rng-presets-outer { display: block; }
  .rng-big-number { font-size: 3.5rem; }
}