:root {
  --b64-primary: #0284c7;
  --b64-primary-hover: #0369a1;
  --b64-bg-card: #ffffff;
  --b64-border: #e2e8f0;
  --b64-text-main: #0f172a;
  --b64-text-muted: #64748b;
  --b64-pill-bg: #f1f5f9;
  --b64-pill-hover: #e2e8f0;
  --b64-result-bg: #f8fafc;
  --b64-output-bg: #ffffff;
  --b64-output-color: #0369a1;
  --b64-banner-err-bg: #fee2e2;
  --b64-banner-err-text: #991b1b;
}

.b64-tool-container {
  max-width: 860px;
  margin: 0 auto 3rem auto;
  font-family: inherit;
  color: var(--b64-text-main);
}

.b64-card {
  background: var(--b64-bg-card);
  border: 1px solid var(--b64-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.b64-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--b64-border);
}

.b64-mode-group {
  display: flex;
  gap: 0.35rem;
}

.b64-tab-btn {
  background: var(--b64-pill-bg);
  border: 1px solid var(--b64-border);
  color: var(--b64-text-muted);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.b64-tab-btn.b64-tab-active {
  background: var(--b64-primary);
  border-color: var(--b64-primary);
  color: #ffffff;
}

.b64-options-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.b64-check-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.825rem;
  cursor: pointer;
  color: var(--b64-text-main);
}

.b64-presets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.b64-presets-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--b64-text-muted);
}

.b64-pill-btn {
  background: var(--b64-pill-bg);
  border: 1px solid var(--b64-border);
  color: var(--b64-text-main);
  border-radius: 9999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.b64-pill-btn:hover {
  background: var(--b64-pill-hover);
  border-color: var(--b64-primary);
}

.b64-input-section {
  margin-bottom: 1.25rem;
}

.b64-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.b64-pane-header label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--b64-text-main);
}

.b64-stat-badge {
  font-size: 0.75rem;
  color: var(--b64-text-muted);
}

#b64InputText,
.b64-output-box {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--b64-border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  resize: vertical;
  box-sizing: border-box;
}

#b64InputText {
  background: var(--b64-bg-card);
  color: var(--b64-text-main);
}

#b64InputText:focus {
  outline: none;
  border-color: var(--b64-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.b64-output-box {
  background: var(--b64-output-bg);
  color: var(--b64-output-color);
  font-weight: 600;
}

.b64-action-row {
  display: flex;
  gap: 0.75rem;
}

.b64-primary-btn {
  flex: 2;
  background: var(--b64-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.b64-primary-btn:hover {
  background: var(--b64-primary-hover);
}

.b64-secondary-btn,
.b64-tertiary-btn {
  background: var(--b64-pill-bg);
  color: var(--b64-text-main);
  border: 1px solid var(--b64-border);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.b64-secondary-btn:hover,
.b64-tertiary-btn:hover {
  background: var(--b64-pill-hover);
}

.b64-results-card {
  background: var(--b64-result-bg);
  border: 1px solid var(--b64-border);
  border-radius: 12px;
  padding: 1.75rem;
}

.b64-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.b64-output-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--b64-text-muted);
}

.b64-copy-btn {
  background: var(--b64-primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.b64-copy-btn:hover {
  background: var(--b64-primary-hover);
}

.b64-status-banner {
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  background: var(--b64-banner-err-bg);
  color: var(--b64-banner-err-text);
}

.b64-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid var(--b64-border);
}

@media (max-width: 640px) {
  .b64-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.b64-metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.b64-metric-label {
  font-size: 0.75rem;
  color: var(--b64-text-muted);
}

.b64-metric-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--b64-text-main);
}

.b64-ad {
  overflow: hidden;
  min-height: 280px;
}
/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --b64-primary: #81bcda;
  --b64-primary-hover: #69aed4;
  --b64-bg-card: var(--tf-surface);
  --b64-border: var(--tf-surface);
  --b64-text-main: var(--tf-ink);
  --b64-text-muted: var(--tf-ink-faint);
  --b64-pill-bg: var(--tf-surface);
  --b64-pill-hover: var(--tf-surface);
  --b64-result-bg: var(--tf-surface);
  --b64-output-bg: var(--tf-surface);
  --b64-output-color: #69aed4;
  --b64-banner-err-bg: var(--tf-surface);
  --b64-banner-err-text: #d77676;
}
