/* HTTP Headers Parser & Security Auditor — content styles.
   Prefix: --hdr-  /  .hdr-

   Reference point: a security-scan readout — a parsed-headers table
   plus a checklist audit, each item explicitly labelled present/missing
   with a plain-English reason it matters. Eighth distinct developer-
   cluster layout this build loop: table + checklist, not a card grid,
   canvas, split pane, three-card anatomy, highlighted editor, results
   table alone, or prose+table+list.

   THIS FILE STYLES THE CONTENT AREA ONLY. Chrome is owned by chrome.css. */

:root {
  --hdr-surface: #ffffff;
  --hdr-panel:   #f5f6f6;
  --hdr-line:    #dbdfe0;
  --hdr-text:    #14181a;
  --hdr-muted:   #5d6668;
  --hdr-good:    #1c7a4c;
  --hdr-bad:     #b3261e;
  --hdr-mono:    ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

.hdr-wrap {
  width: 100%;
  max-width: 50rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Input ───────────────────────────────────────────────────────────────── */

.hdr-input-panel {
  margin-bottom: 1rem;
}

.hdr-input-panel label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--hdr-muted);
}

.hdr-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 9rem;
  padding: 0.75rem 0.875rem;
  font-family: var(--hdr-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--hdr-text);
  background: var(--hdr-surface);
  border: 1px solid var(--hdr-line);
  border-radius: 2px;
  resize: vertical;
}

.hdr-textarea:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -1px;
}

.hdr-error {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--hdr-bad);
}

.hdr-presets {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.hdr-preset-lbl {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hdr-muted);
}

.hdr-chip {
  padding: 0.3125rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--hdr-text);
  background: var(--hdr-panel);
  border: 1px solid var(--hdr-line);
  border-radius: 2px;
  cursor: pointer;
}

.hdr-chip:hover {
  border-color: var(--tf-accent);
  color: var(--tf-accent);
}

/* ── Primary action button ──────────────────────────────────────────────── */

.hdr-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;
}

.hdr-btn:hover  { background: var(--tf-accent-hover);  border-color: var(--tf-accent-hover); }
.hdr-btn:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); }

.hdr-btn:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

/* ── Panels ──────────────────────────────────────────────────────────────── */

.hdr-panel {
  margin-bottom: 1.25rem;
}

.hdr-panel-title {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hdr-muted);
}

.hdr-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hdr-line);
  border-radius: 2px;
}

.hdr-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--hdr-surface);
}

.hdr-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hdr-muted);
  background: var(--hdr-panel);
  border-bottom: 1px solid var(--hdr-line);
}

.hdr-table td {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--hdr-line);
  vertical-align: top;
}

.hdr-table tbody tr:last-child td { border-bottom: none; }

.hdr-name-cell {
  font-weight: 700;
  color: var(--hdr-text);
  white-space: nowrap;
}

.hdr-value-cell {
  font-family: var(--hdr-mono);
  color: var(--hdr-muted);
  word-break: break-word;
}

/* ── Audit checklist ─────────────────────────────────────────────────────── */

.hdr-audit-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hdr-summary {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--tf-accent);
}

.hdr-audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.625rem;
}

.hdr-audit-item {
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--hdr-line);
  border-left: 3px solid var(--hdr-line);
  border-radius: 2px;
  background: var(--hdr-surface);
}

.hdr-audit-item--present { border-left-color: var(--hdr-good); }
.hdr-audit-item--missing { border-left-color: var(--hdr-bad); }

.hdr-audit-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.375rem;
}

.hdr-audit-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

.hdr-audit-item--present .hdr-audit-badge {
  color: var(--hdr-good);
  background: rgba(28, 122, 76, 0.12);
}

.hdr-audit-item--missing .hdr-audit-badge {
  color: var(--hdr-bad);
  background: rgba(179, 38, 30, 0.1);
}

.hdr-audit-name {
  font-weight: 700;
  color: var(--hdr-text);
  font-size: 0.875rem;
}

.hdr-audit-why {
  margin: 0 0 0.375rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--hdr-muted);
}

.hdr-audit-value {
  display: block;
  font-family: var(--hdr-mono);
  font-size: 0.75rem;
  color: var(--hdr-text);
  background: var(--hdr-panel);
  padding: 0.375rem 0.5rem;
  border-radius: 1px;
  word-break: break-word;
}

/* ── Ad slots ───────────────────────────────────────────────────────────── */

.hdr-ad {
  min-height: 280px;
  margin: 2rem auto 0;
  max-width: 50rem;
  padding-inline: 1.5rem;
}

@media (max-width: 26rem) {
  .hdr-wrap,
  .hdr-ad { padding-inline: 1rem; }
}

/* 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"] {
  --hdr-surface: var(--tf-surface);
  --hdr-panel: var(--tf-surface);
  --hdr-line: var(--tf-rule);
  --hdr-text: var(--tf-ink);
  --hdr-muted: var(--tf-ink-soft);
  --hdr-good: #5fd099;
  --hdr-bad: #da8581;
}
