/* Base – no scrollbars inside iframe */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tool-body {
  background: radial-gradient(circle at top, #e5f0ff 0, #f7f7ff 40%, #f3f5ff 100%);
}

/* Shell + card (similar to other tools) */
.tool-shell {
  max-width: 1120px;
  margin: 16px auto 24px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #e8f2ff, #fff7eb);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
}

.tool-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 22px 22px 26px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

/* Header */
.tool-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.tool-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
}

.tool-card-icon-text {
  color: #ffffff;
  font-weight: 700;
  font-size: 20px;
}

.tool-card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #201a3b;
}

.tool-card-caption {
  margin: 4px 0 0;
  font-size: 14px;
  color: #6b7280;
}

.tool-main {
  padding-top: 10px;
}

/* Two-column layout */
.rng-columns {
  display: flex;
  gap: 32px;
}

.rng-left {
  flex: 1.2;
}

.rng-right {
  flex: 1;
  background: #fafaff;
  padding: 18px 20px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

/* Controls grid */
.rng-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin-bottom: 16px;
}

.rng-field {
  display: flex;
  flex-direction: column;
}

.rng-field label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.rng-field input[type="number"] {
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rng-field input[type="number"]:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
}

.rng-hint {
  margin-top: 3px;
  font-size: 11px;
  color: #9ca3af;
}

/* Checkbox */
.rng-checkbox-field {
  grid-column: span 2;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #374151;
}

.checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
}

/* Buttons */
.rng-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.btn-primary {
  display: inline-block;
  padding: 10px 26px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background-image: linear-gradient(135deg, #6366f1, #ec4899);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 25px rgba(79, 70, 229, 0.4);
  filter: brightness(1.03);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 7px 14px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  padding: 9px 18px;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #4b5563;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn-secondary:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* Error text */
.rng-error {
  min-height: 18px;
  font-size: 13px;
  color: #b91c1c;
  margin: 4px 0 0;
}

/* Right side titles */
.rng-section-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #4b5563;
}

/* BIG result bubble */
.rng-result-display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: 120px;
}

.rng-badge {
  padding: 16px 26px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #4338ca;
  font-size: 38px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.25);
}

.rng-empty {
  font-size: 16px;
  color: #9ca3af;
}

/* History */
.rng-history {
  margin-top: 18px;
}

.rng-history-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  max-height: 150px;
  overflow-y: auto;
}

.rng-history-item {
  font-size: 13px;
  color: #4b5563;
  padding: 4px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.rng-history-item span {
  font-weight: 600;
}

/* Scrollbar styling for history only */
.rng-history-list::-webkit-scrollbar {
  width: 6px;
}

.rng-history-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

/* Responsive */
@media (max-width: 768px) {
  .tool-shell {
    margin: 8px;
    padding: 16px;
    border-radius: 18px;
  }

  .tool-card {
    padding: 18px 14px 20px;
  }

  .rng-columns {
    flex-direction: column;
  }

  .rng-right {
    margin-top: 14px;
  }

  .rng-controls {
    grid-template-columns: 1fr;
  }

  .rng-checkbox-field {
    grid-column: span 1;
  }

  .rng-result-display {
    justify-content: flex-start;
  }
}
