* { box-sizing: border-box; }

/* ══════════════════
   LAYOUT
══════════════════ */
#main-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.bt-right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bt-examples-outer { display: none; }
.bt-examples-inner { display: block; }

.bt-input-section,
.bt-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.bt-section-title,
.bt-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: default;
}

label.bt-section-title svg,
.bt-section-title svg { stroke: #6366f1; flex-shrink: 0; }

/* ══════════════════
   MODE TOGGLE
══════════════════ */
.bt-mode-toggle {
  display: flex;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 14px;
}

.bt-mode-btn {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: #64748b;
  transition: all 0.18s;
  white-space: nowrap;
}

.bt-mode-btn.active {
  background: #ffffff;
  color: #4338ca;
  box-shadow: 0 1px 4px rgba(99,102,241,0.15);
}

/* ══════════════════
   INPUT
══════════════════ */
.bt-input-wrap {
  position: relative;
  margin-bottom: 14px;
}

.bt-textarea {
  width: 100%;
  resize: none;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.92rem;
  outline: none;
  font-family: 'Courier New', monospace;
  color: #1e293b;
  background: #ffffff;
  line-height: 1.7;
  transition: border-color 0.18s;
  min-height: 140px;
}

.bt-textarea:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}

.bt-clear-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s;
}

.bt-clear-btn:hover { background: #e2e8f0; color: #ef4444; }

/* ══════════════════
   FIELD GROUP
══════════════════ */
.bt-field-group { margin-bottom: 16px; }

.bt-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* ══════════════════
   SEPARATOR
══════════════════ */
.bt-sep-options {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.bt-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;
}

.bt-sep-btn:hover { background: #ede9fe; border-color: #a5b4fc; color: #4338ca; }
.bt-sep-btn.active { background: #ede9fe; border-color: #6366f1; color: #4338ca; }

/* ══════════════════
   CONVERT BTN
══════════════════ */
.bt-convert-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;
}

.bt-convert-btn:hover { opacity: 0.88; transform: scale(1.02); }
.bt-convert-btn:active { transform: scale(0.98); }

/* ══════════════════
   OUTPUT
══════════════════ */
.bt-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bt-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;
}

.bt-copy-btn:hover { opacity: 0.85; }
.bt-copy-btn.copied { background: linear-gradient(135deg, #22c55e, #16a34a); }

.bt-result-wrap { margin-bottom: 14px; }

.bt-output-textarea {
  width: 100%;
  min-height: 160px;
  resize: none;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.90rem;
  font-family: 'Courier New', monospace;
  color: #1e293b;
  background: #f8faff;
  outline: none;
  line-height: 1.8;
  font-weight: 600;
  letter-spacing: 0.04em;
  word-break: break-all;
}

/* ── Stats ── */
.bt-stats-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.bt-stat-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
}

/* ══════════════════
   EXAMPLES
══════════════════ */
.bt-examples-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bt-example-btn {
  background: #f8f9ff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #4338ca;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Courier New', monospace;
}

.bt-example-btn:hover {
  background: #ede9fe;
  border-color: #a5b4fc;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99,102,241,0.12);
}

/* ══════════════════
   DARK MODE
══════════════════ */
body.dark-mode .bt-input-section,
body.dark-mode .bt-output-section { background: #0f172a; border-color: #1e293b; }

body.dark-mode label.bt-section-title,
body.dark-mode .bt-section-title { color: #e2e8f0; }

body.dark-mode label.bt-section-title svg,
body.dark-mode .bt-section-title svg { stroke: #a5b4fc; }

body.dark-mode .bt-mode-toggle { background: #1e293b; }
body.dark-mode .bt-mode-btn { color: #475569; }
body.dark-mode .bt-mode-btn.active { background: #1e1b4b; color: #a5b4fc; }

body.dark-mode .bt-textarea {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode .bt-textarea:focus { border-color: #818cf8; }

body.dark-mode .bt-clear-btn {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

body.dark-mode .bt-label { color: #475569; }

body.dark-mode .bt-sep-btn { background: #1e1b4b; border-color: #312e81; color: #94a3b8; }
body.dark-mode .bt-sep-btn.active { background: #312e81; color: #a5b4fc; border-color: #6366f1; }
body.dark-mode .bt-sep-btn:hover { background: #2e1b6b; color: #a5b4fc; }

body.dark-mode .bt-output-textarea { background: #1e293b; border-color: #334155; color: #e2e8f0; }

body.dark-mode .bt-stat-chip { background: #1e293b; border-color: #334155; color: #94a3b8; }

body.dark-mode .bt-example-btn { background: #1e1b4b; border-color: #312e81; color: #a5b4fc; }
body.dark-mode .bt-example-btn:hover { background: #2e1b6b; border-color: #6366f1; }

/* ══════════════════
   RESPONSIVE
══════════════════ */
@media (max-width: 768px) {
  #main-section { grid-template-columns: 1fr; }
  .bt-examples-inner { display: none !important; }
  .bt-examples-outer { display: block; }
}