/* ───── ALL STYLES SCOPED TO #b64 ───── */
#b64 {
  margin: 0;
  font-family: inherit;
  color: #1f2937;
}

#b64 *, #b64 *::before, #b64 *::after {
  box-sizing: border-box;
}

#b64 .b64-subtitle {
  text-align: center;
  font-size: 16.5px;
  line-height: 1.65;
  color: #4b5563;
  margin: 0 auto 28px;
  max-width: 46rem;
}

#b64 .b64-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

#b64 .b64-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

#b64 .b64-tab {
  background: transparent;
  border: none;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  border-radius: 7px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}

#b64 .b64-tab:hover {
  color: #1e293b;
}

#b64 .b64-tab.is-active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

#b64 .b64-opts {
  display: flex;
  align-items: center;
}

#b64 .b64-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

#b64 .b64-check-label input {
  accent-color: #2563eb;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

#b64 .b64-actions-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

#b64 .b64-actions-right {
  display: flex;
  gap: 8px;
}

#b64 .b64-btn-ghost {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}

#b64 .b64-btn-ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

#b64 .b64-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (min-width: 860px) {
  #b64 .b64-grid {
    grid-template-columns: 1fr 1fr;
  }
}

#b64 .b64-panel {
  display: flex;
  flex-direction: column;
}

#b64 .b64-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#b64 .b64-panel-title {
  font-weight: 700;
  font-size: 14px;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: .05em;
}

#b64 .b64-chip {
  font-size: 12px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 500;
}

#b64 .b64-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: #0f172a;
  background: #ffffff;
  resize: vertical;
  min-height: 220px;
  transition: border-color .15s, box-shadow .15s;
}

#b64 .b64-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

#b64 .b64-output {
  background: #f8fafc;
}

#b64 .b64-msg-row {
  margin-bottom: 20px;
}

#b64 .b64-err {
  margin: 0;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
}

#b64 .b64-hidden {
  display: none !important;
}

#b64 .b64-card-wrap {
  margin-bottom: 24px;
}

#b64 .b64-card-bg {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 24px;
}

#b64 .b64-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  #b64 .b64-stats-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

#b64 .b64-cell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
}

#b64 .b64-label {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}

#b64 .b64-val {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

#b64 .b64-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

#b64 .b64-button {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  font-family: inherit;
}

#b64 .b64-button:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
}

#b64 .b64-button:disabled,
#b64 .b64-btn-ghost:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

#b64 .b64-button.b64-copied {
  background: #16a34a;
}

#b64 .b64-foot {
  text-align: center;
  font-size: 14.5px;
  line-height: 1.6;
  color: #64748b;
  margin: 0 auto;
  max-width: 52rem;
}
