/* ==========================================================================
   BM303HONG - MOBILE-FIRST & SENIOR-FRIENDLY CSS
   Dioptimalkan untuk Android & iOS dengan Skala Tulisan & Kontras Tinggi
   ========================================================================== */

/* 1. VARIABEL & TEMA */
:root {
  /* Skala Font Dinamis */
  --font-base: 16px;
  --font-title: 1.35rem;
  --font-subtitle: 0.95rem;
  --font-digit: 1.6rem;
  --font-badge-result: 1.5rem;

  /* Sizing & Tap Targets */
  --btn-min-height: 48px;
  --digit-btn-h: 56px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 18px;

  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Skala Teks: Besar (A+) */
[data-scale="large"] {
  --font-base: 18.5px;
  --font-title: 1.55rem;
  --font-subtitle: 1.05rem;
  --font-digit: 1.85rem;
  --font-badge-result: 1.75rem;
  --btn-min-height: 52px;
  --digit-btn-h: 62px;
}

/* Skala Teks: Ekstra Besar (A++) */
[data-scale="xlarge"] {
  --font-base: 21.5px;
  --font-title: 1.75rem;
  --font-subtitle: 1.2rem;
  --font-digit: 2.1rem;
  --font-badge-result: 2rem;
  --btn-min-height: 58px;
  --digit-btn-h: 70px;
}

/* TEMA GELAP (DEFAULT - KONTRAS TINGGI, NYAMAN DI MATA) */
[data-theme="dark"] {
  --bg-body: #0a0f1d;
  --bg-card: #131c2e;
  --bg-card-subtle: #1c273e;
  --bg-header: #0d1527;
  --bg-input: #0b1220;
  --bg-display: #080d19;

  --border-subtle: #243450;
  --border-strong: #3b5078;
  --border-focus: #f59e0b;

  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --color-primary: #f59e0b;        /* Kuning Emas Cerah */
  --color-primary-hover: #d97706;
  --color-primary-text: #0b1120;

  --color-secondary: #0284c7;      /* Biru Modern */
  --color-secondary-hover: #0369a1;

  --color-accent: #10b981;         /* Hijau */
  --color-danger: #ef4444;         /* Merah */

  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 16px rgba(245, 158, 11, 0.35);
}

/* TEMA TERANG (HIGH CONTRAST LIGHT) */
[data-theme="light"] {
  --bg-body: #edf2f7;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --bg-header: #ffffff;
  --bg-input: #ffffff;
  --bg-display: #f1f5f9;

  --border-subtle: #cbd5e1;
  --border-strong: #94a3b8;
  --border-focus: #b45309;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-inverse: #ffffff;

  --color-primary: #d97706;
  --color-primary-hover: #b45309;
  --color-primary-text: #ffffff;

  --color-secondary: #0369a1;
  --color-secondary-hover: #075985;

  --color-accent: #059669;
  --color-danger: #dc2626;

  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 12px rgba(217, 119, 6, 0.25);
}

/* 2. BASE & RESET */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: var(--font-base);
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.45;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom, 1rem);
}

/* 3. HEADER (KOMPAK & RAPI DI HP) */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-header);
  border-bottom: 2px solid var(--border-subtle);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  padding: 0.5rem 0.75rem;
}

.header-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b1120;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.scale-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  padding: 0.2rem 0.4rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-subtle);
}

.scale-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.scale-buttons {
  display: flex;
  gap: 0.2rem;
}

.btn-scale {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  min-width: 28px;
  transition: var(--transition-fast);
}

.btn-scale.active {
  background: var(--color-primary);
  color: var(--color-primary-text);
  border-color: var(--color-primary);
}

.header-bottom-row {
  display: flex;
  justify-content: flex-end;
}

.header-toggles {
  display: flex;
  width: 100%;
  gap: 0.4rem;
}

.btn-toggle {
  flex: 1;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.5rem;
  border-radius: var(--border-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-toggle:active {
  background: var(--bg-card-subtle);
}

/* 4. STICKY STEP NAV (MOBILE PILLS) */
.sticky-step-nav {
  position: sticky;
  top: 75px;
  z-index: 90;
  background: var(--bg-body);
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.step-nav-container {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  max-width: 900px;
  margin: 0 auto;
}

.step-nav-container::-webkit-scrollbar {
  display: none;
}

.step-nav-pill {
  flex: 1;
  min-width: fit-content;
  text-align: center;
  padding: 0.35rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.step-nav-pill:hover, .step-nav-pill.active {
  background: var(--color-secondary);
  color: #ffffff;
  border-color: var(--color-secondary);
}

/* 5. MAIN CONTAINER & CARDS */
.main-container {
  width: 100%;
  max-width: 900px;
  margin: 0.6rem auto;
  padding: 0 0.65rem 2rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 0.85rem;
  box-shadow: var(--shadow-card);
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1.5px solid var(--border-subtle);
}

.step-badge {
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: var(--color-primary-text);
  font-size: 1.15rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.step-title {
  font-size: var(--font-title);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.15;
}

.step-desc {
  font-size: var(--font-subtitle);
  color: var(--text-muted);
  margin-top: 0.15rem;
  font-weight: 600;
}

/* 6. LANGKAH 1: DIGIT SELECTOR (KEYPAD HP BESAR) */
.digits-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.digit-btn {
  height: var(--digit-btn-h);
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  border: 2px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--font-digit);
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  user-select: none;
}

.digit-btn:active {
  transform: scale(0.92);
}

.digit-btn.selected {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b1120;
  border-color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
}

/* Presets (3 Kolom Seimbang di HP) */
.preset-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.btn-preset {
  min-height: 40px;
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.2rem;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-preset:active {
  background: var(--bg-body);
}

.btn-preset-clear {
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.35);
}

/* Custom Input (No Horizontal Overflow) */
.custom-input-box {
  margin-bottom: 0.75rem;
}

.input-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.input-wrapper {
  display: flex;
  width: 100%;
  gap: 0.4rem;
}

.input-wrapper input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 44px;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  padding: 0.4rem 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.input-wrapper input:focus {
  border-color: var(--border-focus);
}

.btn-apply {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 1rem;
  background: var(--color-secondary);
  color: #fff;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

/* Selected Digits Display Box */
.selected-digits-display {
  background: var(--bg-display);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--border-radius-md);
  padding: 0.65rem 0.75rem;
}

.display-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.display-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.display-count {
  background: var(--color-primary);
  color: var(--color-primary-text);
  font-weight: 900;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  white-space: nowrap;
}

.display-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-height: 40px;
}

.digit-chip {
  width: clamp(34px, 8vw, 42px);
  height: clamp(34px, 8vw, 42px);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b1120;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #fbbf24;
}

.empty-hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
}

/* 7. LANGKAH 2: PENGATURAN BBFS */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.setting-block {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.setting-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.35rem;
}

.checkbox-group, .radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.custom-checkbox, .custom-radio {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input, .custom-radio input {
  position: absolute;
  opacity: 0;
}

.checkbox-box, .radio-box {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.radio-box {
  border-radius: 50%;
}

.custom-checkbox input:checked ~ .checkbox-box {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.custom-checkbox input:checked ~ .checkbox-box::after {
  content: '✔';
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--color-primary-text);
}

.custom-radio input:checked ~ .radio-box {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.custom-radio input:checked ~ .radio-box::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary-text);
}

.checkbox-info, .radio-info {
  display: flex;
  flex-direction: column;
}

.checkbox-title, .radio-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
}

.checkbox-subtitle, .radio-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.custom-select {
  width: 100%;
  min-height: 44px;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  padding: 0.4rem 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

/* 8. ACTION BUTTONS BESAR */
.action-section {
  display: flex;
  width: 100%;
}

.btn-primary-large, .btn-secondary-large {
  width: 100%;
  min-height: 52px;
  border-radius: var(--border-radius-md);
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  box-shadow: var(--shadow-card);
  transition: var(--transition-fast);
}

.btn-primary-large {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b1120;
  border: 2px solid #fbbf24;
}

.btn-primary-large:active {
  transform: scale(0.98);
}

.btn-secondary-large {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: 2px solid #38bdf8;
}

.btn-icon-large {
  font-size: 1.3rem;
}

/* 9. LANGKAH 3: SPLITTER CONTROLS */
.splitter-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.splitter-item {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 0.75rem;
}

.group-count-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.btn-group-count {
  flex: 1 1 65px;
  min-height: 38px;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  padding: 0.3rem 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-group-count.active {
  background: var(--color-primary);
  color: var(--color-primary-text);
  border-color: var(--color-primary);
  font-weight: 900;
}

.custom-group-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  padding: 0.4rem;
  max-width: 240px;
  margin: 0 auto;
}

.btn-counter {
  width: 42px;
  height: 42px;
  background: var(--color-secondary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.5rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.counter-display {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
}

/* 10. LANGKAH 4: HASIL BBFS & KARTU GRUP */
.notice-box {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--color-primary);
  border-left-width: 5px;
  border-radius: var(--border-radius-sm);
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.75rem;
}

.notice-box[hidden] {
  display: none;
}

.notice-list {
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.notice-list li {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-main);
}

.global-summary-box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.summary-item {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  padding: 0.55rem;
  text-align: center;
}

.summary-item.highlight {
  border-color: var(--color-primary);
  background: rgba(245, 158, 11, 0.12);
}

.sum-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sum-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-main);
}

.summary-item.highlight .sum-value {
  color: var(--color-primary);
}

.global-actions-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.btn-action-primary, .btn-action-secondary, .btn-action-danger {
  min-height: 44px;
  padding: 0.4rem 0.6rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1.5px solid transparent;
  text-align: center;
}

.btn-action-primary {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.btn-action-secondary {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-action-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.35);
}

/* Groups Container */
.groups-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.empty-state-card {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--bg-card-subtle);
  border: 2px dashed var(--border-strong);
  border-radius: var(--border-radius-md);
}


.empty-state-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.empty-state-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* KARTU GRUP INDIVIDUAL (SUPER JELAS) */
.group-card {
  background: var(--bg-card);
  border: 2px solid var(--border-strong);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.group-card-header {
  background: var(--bg-card-subtle);
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1.5px solid var(--border-subtle);
}

.group-title-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.group-letter-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b1120;
  font-size: 1.15rem;
  font-weight: 900;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.group-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.group-count-badge {
  background: var(--bg-body);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.55rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.group-card-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* KOTAK HASIL UTAMA HASIL = [ 1, 2, 5, 6, 8 ] */
.group-result-box {
  background: var(--bg-display);
  border: 2px solid var(--color-primary);
  border-radius: var(--border-radius-sm);
  padding: 0.75rem;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.12);
}

.group-result-header {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.group-result-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--font-badge-result);
  font-weight: 900;
  color: #f59e0b;
  letter-spacing: 1px;
  word-break: break-word;
}

/* FREKUENSI KEMUNCULAN */
.frequency-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.frequency-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.frequency-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.freq-badge {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.freq-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.freq-digit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.freq-count {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--color-primary);
  font-family: 'JetBrains Mono', monospace;
}

.freq-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-body);
  border-radius: 3px;
  overflow: hidden;
}

.freq-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #f59e0b);
  border-radius: 3px;
}

/* DAFTAR ANGKA (dirender hanya saat dibuka) */
.group-numbers-section {
  background: var(--bg-display);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.group-numbers-toggle {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  min-height: 44px;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  list-style: none;
  user-select: none;
}

.group-numbers-toggle::-webkit-details-marker {
  display: none;
}

.group-numbers-section[open] .group-numbers-toggle {
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
}

.summary-icon {
  font-size: 0.7rem;
  transition: transform var(--transition-fast);
}

details[open] > summary .summary-icon {
  transform: rotate(180deg);
}

.group-numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  gap: 0.35rem;
  max-height: 180px;
  overflow-y: auto;
  padding: 0.5rem;
}

.btn-show-more {
  grid-column: 1 / -1;
  flex: 1 0 100%;
  min-height: 40px;
  margin-top: 0.25rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-card-subtle);
  color: var(--color-primary);
  border: 1.5px dashed var(--color-primary);
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.group-num-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.15rem;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 5px;
  color: var(--text-main);
}

.group-card-footer {
  padding: 0.65rem 0.85rem;
  background: var(--bg-card-subtle);
  border-top: 1px solid var(--border-subtle);
}

.btn-group-copy {
  width: 100%;
  min-height: 44px;
  padding: 0.4rem;
  background: var(--color-primary);
  color: var(--color-primary-text);
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

/* 11. ACCORDION RAW BBFS */
.raw-results-accordion {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  margin-top: 0.75rem;
  overflow: hidden;
}

.accordion-summary {
  padding: 0.75rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-content {
  padding: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-display);
}

.raw-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.raw-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.raw-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-height: 180px;
  overflow-y: auto;
}

/* 12. FOOTER & TOAST */
.app-footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1.5px solid var(--border-subtle);
  padding: 1.5rem 0.75rem;
  text-align: center;
}

.footer-brand {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: 0.2rem;
}

.footer-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.toast-notification {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #f8fafc;
  border: 2px solid #10b981;
  padding: 0.75rem 1.25rem;
  border-radius: var(--border-radius-md);
  font-size: 0.98rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Peringatan / kegagalan: merah, jelas berbeda dari notifikasi sukses */
.toast-notification.error {
  border-color: #ef4444;
  color: #fecaca;
}

/* 13. TABLET & DESKTOP ENHANCEMENTS */
@media (min-width: 600px) {
  .digits-selector {
    grid-template-columns: repeat(10, 1fr);
  }
  .preset-buttons {
    grid-template-columns: repeat(6, 1fr);
  }
  .frequency-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  .global-summary-box {
    grid-template-columns: repeat(4, 1fr);
  }
  .global-actions-bar {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 768px) {
  .main-container {
    padding: 0 1.5rem 3rem 1.5rem;
    gap: 1.25rem;
  }
  .card {
    padding: 1.25rem;
  }
  .settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .btn-group-copy {
    width: auto;
  }
  .group-card-footer {
    display: flex;
    justify-content: flex-end;
  }
}
