:root {
  --cl-primary: #7c2d12;
  --cl-primary-hover: #651e0a;
  --cl-bg-card: #ffffff;
  --cl-border: #e2e8f0;
  --cl-text-main: #0f172a;
  --cl-text-muted: #64748b;
  --cl-pill-bg: #f1f5f9;
  --cl-pill-hover: #e2e8f0;
  --cl-result-bg: #f8fafc;
}

.cl-tool-container {
  max-width: 900px;
  margin: 0 auto 3rem auto;
  font-family: inherit;
  color: var(--cl-text-main);
}

.cl-editor-card {
  background: var(--cl-bg-card);
  border: 1px solid var(--cl-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.cl-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(--cl-border);
}

.cl-presets-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--cl-text-muted);
}

.cl-pill-btn {
  background: var(--cl-pill-bg);
  border: 1px solid var(--cl-border);
  color: var(--cl-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;
}

.cl-pill-btn:hover {
  background: var(--cl-pill-hover);
  border-color: var(--cl-primary);
}

.cl-form-heading {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 1.25rem 0 0.75rem 0;
  color: var(--cl-primary);
  border-bottom: 1px solid var(--cl-border);
  padding-bottom: 0.35rem;
}

.cl-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .cl-grid-2 {
    grid-template-columns: 1fr;
  }
}

.cl-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .cl-grid-3 {
    grid-template-columns: 1fr;
  }
}

.cl-field {
  margin-bottom: 1rem;
}

.cl-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--cl-text-main);
}

.cl-req {
  color: #dc2626;
}

.cl-field input,
.cl-field textarea,
.cl-field select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--cl-border);
  border-radius: 8px;
  background: var(--cl-bg-card);
  color: var(--cl-text-main);
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
}

.cl-field input:focus,
.cl-field textarea:focus,
.cl-field select:focus {
  outline: none;
  border-color: var(--cl-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.cl-action-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.cl-primary-btn {
  flex: 2;
  background: var(--cl-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;
}

.cl-primary-btn:hover {
  background: var(--cl-primary-hover);
}

.cl-secondary-btn {
  background: var(--cl-pill-bg);
  color: var(--cl-text-main);
  border: 1px solid var(--cl-border);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.cl-results-card {
  background: var(--cl-result-bg);
  border: 1px solid var(--cl-border);
  border-radius: 12px;
  padding: 1.75rem;
}

.cl-preview-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.cl-preview-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--cl-text-main);
}

.cl-print-pill {
  background: var(--cl-primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* Formal Sheet Paper Styling */
.cl-sheet {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3rem 2.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.cl-sheet-sender {
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #0f172a;
  padding-bottom: 0.75rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cl-sheet-sender strong {
  font-size: 1.25rem;
  color: #0f172a;
}

.cl-sheet-sender span {
  font-size: 0.85rem;
  color: #64748b;
}

.cl-sheet-date {
  margin-bottom: 1.25rem;
  color: #475569;
}

.cl-sheet-recipient {
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.cl-sheet-salutation {
  font-weight: 700;
  margin-bottom: 1rem;
}

.cl-sheet-body {
  white-space: pre-wrap;
  margin-bottom: 1.75rem;
}

.cl-sheet-signoff {
  line-height: 1.4;
}

.cl-tip-box {
  background: var(--cl-bg-card);
  border: 1px solid var(--cl-border);
  border-radius: 8px;
  padding: 1.25rem;
}

.cl-tip-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--cl-primary);
}

.cl-tip-box p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--cl-text-muted);
  line-height: 1.5;
}

/* Native Print Stylesheet */
@media print {
  body * {
    visibility: hidden;
  }
  .cl-sheet,
  .cl-sheet * {
    visibility: visible;
  }
  .cl-sheet {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0.75in;
    border: none;
    box-shadow: none;
  }
}

.cl-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"] {
  --cl-primary: #cf7759;
  --cl-primary-hover: #cf7359;
  --cl-bg-card: var(--tf-surface);
  --cl-border: var(--tf-surface);
  --cl-text-main: var(--tf-ink);
  --cl-text-muted: var(--tf-ink-faint);
  --cl-pill-bg: var(--tf-surface);
  --cl-pill-hover: var(--tf-surface);
  --cl-result-bg: var(--tf-surface);
}
