/* Word Frequency & Keyword Density Counter — content styles.
   Prefix: --wf-  /  .wf-

   Reference point: a ranked, numbered table of top words IS the result —
   not a single hero metric. The 3-metric row (total/unique/ratio) is
   secondary context above it. Distinguishes itself from this cluster's
   other text-input tool (flesch-kincaid-readability-analyzer, which uses
   a serif textarea and violet neutrals with a single hero score) by
   using a plain sans textarea, warm-neutral palette, and a ranked list
   as the centerpiece instead of a hero figure.

   THIS FILE STYLES THE CONTENT AREA ONLY. Chrome is owned by chrome.css. */

:root {
  --wf-surface: #ffffff;
  --wf-panel:   #f6f5f2;
  --wf-line:    #e2ded4;
  --wf-text:    #1a1712;
  --wf-muted:   #6c6558;
  --wf-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.wf-wrap {
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Input panel ─────────────────────────────────────────────────────────── */

.wf-panel {
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--wf-line);
  border-radius: 2px;
  background: var(--wf-surface);
}

.wf-input-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--wf-muted);
}

.wf-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.875rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--wf-text);
  background: var(--wf-surface);
  border: 1px solid var(--wf-line);
  border-radius: 2px;
  resize: vertical;
}

.wf-textarea:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -1px;
}

.wf-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--wf-line);
}

.wf-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--wf-text);
  cursor: pointer;
}

.wf-checkbox input {
  accent-color: var(--tf-accent);
  width: 1rem;
  height: 1rem;
}

.wf-minlen {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--wf-muted);
}

.wf-minlen input {
  width: 3.5rem;
  box-sizing: border-box;
  padding: 0.375rem 0.5rem;
  font-family: var(--wf-mono);
  font-size: 0.8125rem;
  color: var(--wf-text);
  background: var(--wf-surface);
  border: 1px solid var(--wf-line);
  border-radius: 2px;
}

/* ── Primary action button ──────────────────────────────────────────────── */

.wf-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--tf-accent-ink);
  background: var(--tf-accent);
  border: 1px solid var(--tf-accent);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.wf-btn:hover  { background: var(--tf-accent-hover);  border-color: var(--tf-accent-hover); }
.wf-btn:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); }

.wf-btn:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

/* ── Metric row ──────────────────────────────────────────────────────────── */

.wf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 30rem) {
  .wf-grid { grid-template-columns: 1fr; }
}

.wf-metric {
  padding: 1rem 0.75rem;
  border: 1px solid var(--wf-line);
  border-radius: 2px;
  background: var(--wf-panel);
  text-align: center;
}

.wf-metric-label {
  margin: 0 0 0.375rem;
  font-size: 0.75rem;
  color: var(--wf-muted);
}

.wf-metric-value {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--tf-accent);
}

/* ── Ranked word table (the centerpiece) ─────────────────────────────────── */

.wf-table {
  display: grid;
  border: 1px solid var(--wf-line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.wf-row {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 0.9fr;
  gap: 0.5rem;
  padding: 0.5625rem 1rem;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--wf-line);
  background: var(--wf-surface);
}

.wf-row:last-child { border-bottom: none; }

.wf-row-head {
  background: var(--wf-panel);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wf-muted);
}

.wf-word-cell {
  font-family: var(--wf-mono);
  color: var(--wf-text);
  font-weight: 600;
}

.wf-empty {
  grid-template-columns: 1fr;
  color: var(--wf-muted);
  font-style: italic;
}

.wf-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--wf-muted);
}

/* ── Ad slots ───────────────────────────────────────────────────────────── */

.wf-ad {
  min-height: 280px;
  margin: 2rem auto 0;
  max-width: 40rem;
  padding-inline: 1.5rem;
}

@media (max-width: 26rem) {
  .wf-wrap,
  .wf-ad { padding-inline: 1rem; }
  .wf-panel { padding: 1.25rem; }
  .wf-row { grid-template-columns: 1.3fr 0.6fr 0.8fr; font-size: 0.8125rem; }
}

/* 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"] {
  --wf-surface: var(--tf-surface);
  --wf-panel: var(--tf-surface);
  --wf-line: var(--tf-rule);
  --wf-text: var(--tf-ink);
  --wf-muted: var(--tf-ink-soft);
}
