:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --border: #e2e8f0;
  --accent: #3b82f6;
  --accent2: #1d4ed8;
  --text: #1e293b;
  --muted: #334155;
  --danger: #ef4444;
  --mono: 'Space Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}


  
  .ace-editor  { height:300px}


.controls {
  display: flex;
  align-items: center;
  gap: 16px; 
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius:10px;
  user-select: none;
  justify-content: space-between;
  flex-wrap: wrap;
}

.mode-group, .indent-toggle {
  display: flex;
  background: var(--surface);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.mode-btn, .indent-btn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.2s ease;
}

.mode-btn:hover, .indent-btn:hover {
  color: var(--text);
}

.mode-btn.active, .indent-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.indent-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.indent-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  opacity: 0.8;
}

.actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn1 {
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-primary1 {
  background: var(--accent);
  color: #fff;
}

.btn-primary1:hover {
  filter: brightness(1.1);
}

.btn-ghost {
  background: white;
  color: var(--muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--muted);
}

@media (max-width: 768px) {
  .controls {
    justify-content: center;
  }
  
  .actions {
    margin-left: 0;
    width: 100%;
    justify-content: center;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 4px;
  }
  
  .mode-group, .indent-group {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .mode-btn, .indent-btn {
    padding: 8px 10px;
    font-size: 10px;
    flex: 1;
    text-align: center;
  }
  
  .indent-label {
    display: none;
  }

  .btn1 {
    flex: 1;
    text-align: center;
  }
}

  .options-row { display: flex; align-items: center; gap: 12px; margin-top:10px; padding: 6px 20px; background: var(--bg); min-height: 34px; flex-wrap: wrap; border: 1px solid var(--bs-border-color); border-radius:10px;}
  .option-pill { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; padding: 3px 10px 3px 5px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); transition: border-color 0.15s, color 0.15s; animation: pill-in 0.18s ease; }
  .option-pill:hover { border-color: var(--muted); color: var(--text); }
  .option-pill.on { border-color: var(--accent2); color: var(--accent2); }
  @keyframes pill-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
  .toggle-track { width: 26px; height: 14px; background: var(--border); border-radius: 7px; position: relative; transition: background 0.15s; flex-shrink: 0; }
  .option-pill.on .toggle-track { background: var(--accent2); }
  .toggle-thumb { width: 10px; height: 10px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: transform 0.15s; }
  .option-pill.on .toggle-thumb { transform: translateX(12px); }
  .option-note { font-family: var(--sans); font-size: 11px; color: var(--muted); font-style: italic; opacity: 0; transition: opacity 0.25s; pointer-events: none; }
  .option-note.visible { opacity: 1; }
  
  #outputMode { text-transform: capitalize; }

  .editor-wrap { flex: 1; overflow: hidden; position: relative; }

  .statusbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 16px; background: var(--surface); border-top: 1px solid var(--border); font-family: var(--mono); font-size: 10px; color: var(--muted); flex-shrink: 0; }
  .status-ok { color: var(--accent); }
  .status-err { color: var(--danger); }
  .error-banner { display: none; padding: 8px 16px; background: rgba(255,107,107,0.1); border-top: 1px solid rgba(255,107,107,0.3); font-family: var(--mono); font-size: 11px; color: var(--danger); flex-shrink: 0; }
  .error-banner.visible { display: block; }

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95em;
}
.comparison-table th {
  background: #4a90d9;
  color: #fff;
  padding: 10px 14px;
  text-align: left;
}
.comparison-table th:first-child {
  width:100px;
}
.comparison-table td {
  padding: 9px 14px;
  border-bottom: 1px solid #e0e0e0;
}
.comparison-table tr:nth-child(even) td {
  background: #f5f8fd;
}
.comparison-table code {
  background: #e8f0fb;
  padding: 2px 6px;
  border-radius: 3px;
}

/* --- FAQ --- */
.faq-section {
  margin: 2em 0;
}
.faq-item {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 1em;
  overflow: hidden;
}
.faq-item summary {
  padding: 1em 1.2em;
  font-weight: bold;
  cursor: pointer;
  background: #f8f9fa;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: '+ ';
  color: #4a90d9;
  font-weight: bold;
}
.faq-item[open] summary::before {
  content: '− ';
}
.faq-item p {
  padding: 1em 1.2em;
  margin: 0;
  border-top: 1px solid #e0e0e0;
}
.faq-item code {
  background: #e8f0fb;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.92em;
}