/* Google SERP Title & Snippet Previewer — content styles.
   Prefix: --sp-  /  .sp-

   Reference point: a literal search-result-shaped preview card is the
   result — not a metric row or table, since the whole point is "does
   this look right when someone actually sees it". Third writing-cluster
   tool this loop; distinct from the other two (no textarea-as-hero, no
   ranked table) — three separate input fields feeding one mockup card.

   THIS FILE STYLES THE CONTENT AREA ONLY. Chrome is owned by chrome.css. */

:root {
  --sp-surface: #ffffff;
  --sp-panel:   #f6f6f4;
  --sp-line:    #e1e0da;
  --sp-text:    #17160f;
  --sp-muted:   #6a6a5c;
  --sp-good:    #1c7a4c;
  --sp-warn:    #9a6a10;
  --sp-serp-title: #1558d6;
  --sp-serp-url:   #1c5e3a;
  --sp-serp-desc:  #46443a;
}

.sp-wrap {
  width: 100%;
  max-width: 38rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

@keyframes sp-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.sp-spinner {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: sp-spin 0.7s linear infinite;
  vertical-align: -1px;
  margin-right: 0.35rem;
}

/* ── Input panel ─────────────────────────────────────────────────────────── */

.sp-panel {
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--sp-line);
  border-radius: 2px;
  background: var(--sp-surface);
}

.sp-field {
  margin-bottom: 1rem;
}

.sp-field:last-child { margin-bottom: 0; }

.sp-field label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sp-muted);
}

.sp-field input,
.sp-field textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 0.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--sp-text);
  background: var(--sp-surface);
  border: 1px solid var(--sp-line);
  border-radius: 2px;
  resize: vertical;
}

.sp-field input:focus-visible,
.sp-field textarea:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -1px;
}

.sp-meter {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--sp-muted);
}

.sp-status--ok { color: var(--sp-good); font-weight: 600; }
.sp-status--warn { color: var(--sp-warn); font-weight: 600; }

/* ── Primary action button ──────────────────────────────────────────────── */

.sp-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;
}

.sp-btn:hover  { background: var(--tf-accent-hover);  border-color: var(--tf-accent-hover); }
.sp-btn:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); }

.sp-btn:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

/* ── SERP mockup ─────────────────────────────────────────────────────────── */

.sp-results-label {
  margin: 0 0 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sp-muted);
}

.sp-serp {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--sp-line);
  border-radius: 2px;
  background: var(--sp-surface);
  font-family: Arial, Helvetica, sans-serif;
}

.sp-serp-url {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  color: var(--sp-serp-url);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-serp-title {
  margin: 0 0 0.375rem;
  font-size: 1.25rem;
  line-height: 1.3;
  color: var(--sp-serp-title);
}

.sp-serp-desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--sp-serp-desc);
}

.sp-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--sp-muted);
}

/* ── Ad slots ───────────────────────────────────────────────────────────── */

.sp-ad {
  min-height: 280px;
  margin: 2rem auto 0;
  max-width: 38rem;
  padding-inline: 1.5rem;
}

@media (max-width: 26rem) {
  .sp-wrap,
  .sp-ad { padding-inline: 1rem; }
  .sp-panel { padding: 1.25rem; }
  .sp-serp { padding: 1rem 1.125rem; }
  .sp-serp-title { font-size: 1.125rem; }
}

/* 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"] {
  --sp-surface: var(--tf-surface);
  --sp-panel: var(--tf-surface);
  --sp-line: var(--tf-rule);
  --sp-text: var(--tf-ink);
  --sp-muted: var(--tf-ink-soft);
  --sp-good: #5fd099;
  --sp-warn: #d5b16e;
  --sp-serp-title: #81a0da;
  --sp-serp-url: var(--tf-ink);
  --sp-serp-desc: var(--tf-ink-soft);
}
