:root {
  --cx-primary: #0284c7;
  --cx-primary-hover: #0369a1;
  --cx-bg-card: #ffffff;
  --cx-border: #e2e8f0;
  --cx-text-main: #0f172a;
  --cx-text-muted: #64748b;
  --cx-pill-bg: #f1f5f9;
  --cx-pill-hover: #e2e8f0;
  --cx-result-bg: #f8fafc;
  --cx-hl-bg: #ecfdf5;
  --cx-hl-border: #a7f3d0;
  --cx-hl-text: #065f46;
}

.cx-tool-container {
  max-width: 900px;
  margin: 0 auto 3rem auto;
  font-family: inherit;
  color: var(--cx-text-main);
}

.cx-editor-card {
  background: var(--cx-bg-card);
  border: 1px solid var(--cx-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.cx-presets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--cx-border);
}

.cx-presets-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--cx-text-muted);
}

.cx-pill-btn {
  background: var(--cx-pill-bg);
  border: 1px solid var(--cx-border);
  color: var(--cx-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;
}

.cx-pill-btn:hover {
  background: var(--cx-pill-hover);
  border-color: var(--cx-primary);
}

.cx-grid-main {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr auto 1.5fr;
  align-items: end;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
  .cx-grid-main {
    grid-template-columns: 1fr;
  }
}

.cx-swap-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 0.2rem;
}

.cx-swap-btn {
  background: var(--cx-pill-bg);
  border: 1px solid var(--cx-border);
  color: var(--cx-text-main);
  border-radius: 8px;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.cx-swap-btn:hover {
  background: var(--cx-primary);
  color: #ffffff;
}

.cx-grid-2 {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
  .cx-grid-2 {
    grid-template-columns: 1fr;
  }
}

.cx-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--cx-text-main);
}

.cx-req {
  color: #dc2626;
}

.cx-field input,
.cx-field select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--cx-border);
  border-radius: 8px;
  background: var(--cx-bg-card);
  color: var(--cx-text-main);
  font-size: 0.95rem;
  box-sizing: border-box;
}

.cx-field input:focus,
.cx-field select:focus {
  outline: none;
  border-color: var(--cx-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.cx-status-text {
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  color: var(--cx-text-muted);
  background: var(--cx-pill-bg);
  border: 1px solid var(--cx-border);
  border-radius: 8px;
}

.cx-action-row {
  display: flex;
  gap: 0.75rem;
}

.cx-primary-btn {
  flex: 2;
  background: var(--cx-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;
}

.cx-primary-btn:hover {
  background: var(--cx-primary-hover);
}

.cx-secondary-btn {
  background: var(--cx-pill-bg);
  color: var(--cx-text-main);
  border: 1px solid var(--cx-border);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.cx-results-card {
  background: var(--cx-result-bg);
  border: 1px solid var(--cx-border);
  border-radius: 12px;
  padding: 1.75rem;
}

.cx-highlight-box {
  background: var(--cx-hl-bg);
  border: 1px solid var(--cx-hl-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.cx-hl-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cx-hl-text);
  margin-bottom: 0.25rem;
  display: block;
}

.cx-hl-val {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--cx-hl-text);
  margin-bottom: 0.25rem;
}

.cx-hl-sub {
  font-size: 0.85rem;
  color: var(--cx-hl-text);
}

.cx-specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .cx-specs-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .cx-specs-grid {
    grid-template-columns: 1fr;
  }
}

.cx-spec-item {
  background: var(--cx-bg-card);
  border: 1px solid var(--cx-border);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cx-spec-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cx-text-muted);
}

.cx-spec-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--cx-text-main);
}

.cx-spec-sub {
  font-size: 0.75rem;
  color: var(--cx-text-muted);
}

.cx-table-card {
  background: var(--cx-bg-card);
  border: 1px solid var(--cx-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.cx-sub-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 0 0.85rem 0;
  color: var(--cx-text-main);
}

.cx-table-wrap {
  overflow-x: auto;
}

.cx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.cx-table th,
.cx-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--cx-border);
}

.cx-table th {
  background: var(--cx-pill-bg);
  font-weight: 700;
  color: var(--cx-text-muted);
}

.cx-tip-box {
  background: var(--cx-bg-card);
  border: 1px solid var(--cx-border);
  border-radius: 8px;
  padding: 1.25rem;
}

.cx-tip-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--cx-primary);
}

.cx-tip-box p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--cx-text-muted);
  line-height: 1.5;
}

.cx-ad {
  overflow: hidden;
  min-height: 280px;
  margin: 32px 0;
  text-align: center;
}
/* 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"] {
  --cx-primary: #81bcda;
  --cx-primary-hover: #69aed4;
  --cx-bg-card: var(--tf-surface);
  --cx-border: var(--tf-surface);
  --cx-text-main: var(--tf-ink);
  --cx-text-muted: var(--tf-ink-faint);
  --cx-pill-bg: var(--tf-surface);
  --cx-pill-hover: var(--tf-surface);
  --cx-result-bg: var(--tf-surface);
  --cx-hl-bg: var(--tf-surface);
  --cx-hl-border: #81dab1;
  --cx-hl-text: #59cfae;
}
