/* Colour Format Converter - Content Area Styles */
:root {
  --cfc-bg: #ffffff;
  --cfc-surface: #f8fafc;
  --cfc-card: #ffffff;
  --cfc-border: #e2e8f0;
  --cfc-line: #cbd5e1;
  --cfc-ink: #0f172a;
  --cfc-ink-soft: #475569;
  --cfc-ink-faint: #94a3b8;
  --cfc-primary: var(--tf-accent, #0284c7);
  --cfc-primary-hover: #0369a1;
  --cfc-green: #15803d;
  --cfc-warn: #b45309;
  --cfc-red: #b91c1c;
  --cfc-radius: 2px;
}

.cfc-main {
  width: 100%;
  color: var(--cfc-ink);
}

.cfc-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Controls bar */
.cfc-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--cfc-surface);
  border: 1px solid var(--cfc-line);
  border-radius: var(--cfc-radius);
}

.cfc-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cfc-control-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cfc-ink-soft);
}

/* 2-column Grid */
.cfc-editor-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 860px) {
  .cfc-editor-grid {
    grid-template-columns: 1fr;
  }
}

/* Panels */
.cfc-panel {
  background: var(--cfc-card);
  border: 1px solid var(--cfc-line);
  border-radius: var(--cfc-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.cfc-form-panel,
.cfc-preview-panel,
.cfc-results-panel {
  position: relative;
}

.cfc-panel-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--cfc-ink);
}

.cfc-ad {
  overflow: hidden;
  min-height: 280px;
}

/* Swatch Display */
.cfc-picker-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.cfc-native-picker {
  -webkit-appearance: none;
  border: 1px solid var(--cfc-line);
  border-radius: var(--cfc-radius);
  width: 54px;
  height: 54px;
  cursor: pointer;
  padding: 0;
  background: none;
}

.cfc-native-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.cfc-native-picker::-webkit-color-swatch {
  border: none;
  border-radius: var(--cfc-radius);
}

.cfc-swatch-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--cfc-radius);
  border: 1px solid var(--cfc-line);
  padding: 10px;
  transition: background-color 0.15s ease;
}

.cfc-swatch-label {
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--cfc-radius);
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Inputs */
.cfc-grid {
  display: grid;
  gap: 12px;
}

.cfc-grid-2 {
  grid-template-columns: 1fr 1fr;
}

.cfc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cfc-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cfc-ink);
}

.cfc-input,
.cfc-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--cfc-ink);
  background: var(--cfc-card);
  border: 1px solid var(--cfc-line);
  border-radius: var(--cfc-radius);
  font-family: inherit;
  box-sizing: border-box;
}

.cfc-code-font {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
}

.cfc-input:focus,
.cfc-select:focus {
  outline: 2px solid var(--cfc-primary);
  border-color: var(--cfc-primary);
}

/* Harmonies Box */
.cfc-harmony-box {
  padding: 14px;
  background: var(--cfc-surface);
  border: 1px solid var(--cfc-line);
  border-radius: var(--cfc-radius);
}

.cfc-harmony-title {
  font-size: 0.8125rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: var(--cfc-ink);
}

.cfc-harmony-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 0.8125rem;
}

.cfc-harmony-label {
  width: 110px;
  font-weight: 600;
  color: var(--cfc-ink-soft);
}

.cfc-mini-swatch {
  width: 22px;
  height: 22px;
  border-radius: var(--cfc-radius);
  border: 1px solid var(--cfc-line);
}

.cfc-mini-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--cfc-ink);
  font-size: 0.75rem;
}

/* Results Rows */
.cfc-results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cfc-format-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: var(--cfc-surface);
  border: 1px solid var(--cfc-line);
  border-radius: var(--cfc-radius);
}

.cfc-format-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cfc-ink-soft);
}

.cfc-format-val-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cfc-format-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  color: var(--cfc-ink);
  word-break: break-all;
}

.cfc-copy-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  padding: 2px 4px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.cfc-copy-icon-btn:hover {
  opacity: 1;
}

/* WCAG Box */
.cfc-wcag-card {
  padding: 14px;
  background: var(--cfc-surface);
  border: 1px solid var(--cfc-line);
  border-radius: var(--cfc-radius);
}

.cfc-wcag-title {
  font-size: 0.8125rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: var(--cfc-ink);
}

.cfc-wcag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cfc-wcag-pill {
  padding: 10px;
  border-radius: var(--cfc-radius);
  border: 1px solid var(--cfc-line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cfc-wcag-name {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
}

.cfc-wcag-score {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cfc-wcag-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: var(--cfc-radius);
  width: fit-content;
}

.cfc-badge-pass {
  background: #dcfce7;
  color: #15803d;
}

.cfc-badge-warn {
  background: #fef3c7;
  color: #b45309;
}

.cfc-badge-fail {
  background: #fee2e2;
  color: #b91c1c;
}

/* Callout */
.cfc-callout {
  padding: 14px;
  background: var(--cfc-surface);
  border-left: 3px solid var(--cfc-primary);
  border-radius: 0 var(--cfc-radius) var(--cfc-radius) 0;
}

.cfc-callout-title {
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--cfc-ink);
}

.cfc-callout-text {
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0;
  color: var(--cfc-ink-soft);
}

/* Action Bar */
.cfc-action-bar {
  margin-top: 20px;
}

.cfc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--cfc-radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease;
  background: var(--cfc-primary);
  color: #ffffff;
}

.cfc-btn:hover {
  background: var(--cfc-primary-hover);
}

.cfc-btn-primary {
  background: var(--cfc-primary);
  color: #ffffff;
}

.cfc-btn-primary:hover {
  background: var(--cfc-primary-hover);
}

.cfc-btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.cfc-btn-secondary {
  background: var(--cfc-surface);
  color: var(--cfc-ink);
  border-color: var(--cfc-line);
}

.cfc-btn-secondary:hover {
  background: var(--cfc-card);
  border-color: var(--cfc-ink);
}

/* Hero Summary */
.cfc-summary-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.cfc-hero-card {
  padding: 20px;
  border: 1px solid var(--cfc-line);
  border-radius: var(--cfc-radius);
  background: var(--cfc-surface);
}

.cfc-hero-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cfc-ink-soft);
  margin-bottom: 6px;
}

.cfc-hero-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--cfc-primary);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.cfc-hero-sub {
  font-size: 0.8125rem;
  color: var(--cfc-ink-soft);
}

/* Stat Grid */
.cfc-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.cfc-stat-grid {
  margin-top: 16px;
}

.cfc-stat-box {
  padding: 14px;
  background: var(--cfc-card);
  border: 1px solid var(--cfc-line);
  border-radius: var(--cfc-radius);
}

.cfc-stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cfc-ink-soft);
  margin-bottom: 4px;
}

.cfc-stat-num {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cfc-ink);
  font-variant-numeric: tabular-nums;
}

.cfc-stat-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--cfc-ink-soft);
  margin-top: 2px;
}

@media (max-width: 640px) {
  .cfc-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .cfc-control-group {
    justify-content: space-between;
  }
}

/* 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"] {
  --cfc-bg: var(--tf-surface);
  --cfc-surface: var(--tf-surface);
  --cfc-card: var(--tf-surface);
  --cfc-border: var(--tf-surface);
  --cfc-line: #98abc3;
  --cfc-ink: var(--tf-ink);
  --cfc-ink-soft: var(--tf-ink-soft);
  --cfc-ink-faint: var(--tf-ink-faint);
  --cfc-primary-hover: #69aed4;
  --cfc-green: #5ed089;
  --cfc-warn: #d9a57d;
  --cfc-red: #da8181;
}
