/* ─────────────────────────────────────────────────────────────────────────────
   livefeed.css — Veritiliz Reports (livefeed.veritiliz.com)

   ONE STYLESHEET FOR EVERY PAGE, including the report pages the API renders
   (realitycheck: api/templates/reports/). Those link here by absolute URL, so
   a class renamed here must be renamed there.

   COPIED, NOT LINKED, FROM www.veritiliz.com/style.css: the palette, body,
   TOP BAR AND MENU, header and brand-lockup rules. A change on www cannot
   break this site — the cost is that a change to the bar, the logo, the
   palette, the page column or the 769px / 480px breakpoints has to be made
   in both repos. Everything below "Reports components" is this site's own.

   Tone: a trust product, not a feed. One restrained accent for things you can
   act on, no red anywhere (www reserves it for a risk finding, and a report is
   not a verdict), nothing that pulses, counts or competes for attention.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --bg-color:       #080d14;
  --surface-color:  #0f1721;
  --surface-raised: #17212e;
  --text-primary:   #e8eff7;
  --text-secondary: #93a6bc;
  --text-muted:     #5d7186;
  --heading-color:  #f4f8fc;
  --accent-color:   #4fd1e8;
  --accent-hover:   #7be2f5;
  --accent-glow:    rgba(79, 209, 232, 0.12);
  --border-color:   #1b2734;
  --border-light:   #26364a;
  --brand-tint:     #33b19c;
  /* Text on an accent-filled button. www uses --heading-color there, which on
     the dark theme is near-white on light cyan — about 1.6:1. Dark ink on the
     cyan and white on the light theme's teal both clear 4.5:1. */
  --on-accent:      #04121a;
  --font-display:   -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease:           cubic-bezier(0.22, 1, 0.36, 1);
}
[data-theme="light"] {
  --bg-color:       #f4f7fb;
  --surface-color:  #ffffff;
  --surface-raised: #edf2f8;
  --text-primary:   #0d141d;
  --text-secondary: #4a5b6e;
  --text-muted:     #7a8ca0;
  --heading-color:  #060b12;
  --accent-color:   #0e7c93;
  --accent-hover:   #0a6377;
  --accent-glow:    rgba(14, 124, 147, 0.10);
  --border-color:   #dce5ef;
  --border-light:   #c3d2e2;
  --brand-tint:     #238073;
  --on-accent:      #ffffff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* www's pages scroll and short pages here may not; where scrollbars take up
   room (Windows) that would sit this column half a scrollbar to the right of
   www's, and the bar would jump sideways on every switch between them. */
html { scrollbar-gutter: stable; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.05rem;
  line-height: 1.9;
  letter-spacing: 0.01em;
  background-color: var(--bg-color);
  color: var(--text-primary);
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (max-width: 480px) {
  body { padding: 0 1.2rem; }
}

a { color: var(--accent-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--accent-hover); }
@media (hover: none) {
  a:active, button:not(:disabled):active { opacity: 0.7; }
}

h1, h2, h3 { font-family: var(--font-display); color: var(--heading-color); }

/* ── Top bar (www) ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  min-height: 3.1rem;
}
@media (min-width: 769px) {
  .topbar {
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 0 0.5rem;
  }
}
.topbar-link {
  display: block;
  text-align: center;
  padding: 0.85rem 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-link:hover { color: var(--heading-color); }
.topbar-link:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: -4px;
  border-radius: 6px;
}
.topbar-sep {
  color: var(--text-muted);
  font-weight: 300;
  font-size: 1.15rem;
  line-height: 1;
  user-select: none;
}

/* ── Masthead and logo (www Learn pages) ───────────────────────────────────── */
.masthead {
  padding: 4.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 3.5rem;
  text-align: center;
}
.wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--heading-color);
  font-size: clamp(3.1rem, 13vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 700;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.brand-link:hover { color: inherit; }
@media (hover: hover) {
  .brand-link:hover { opacity: 0.88; }
}
.brand-link:active { opacity: 0.75; }
.brand-link:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 6px; border-radius: 8px; }
/* Two files, not one recoloured: the outline differs per theme, the check
   does not. Sized in em, so it scales with the wordmark. */
.brand-link::before {
  content: '';
  display: inline-block;
  flex-shrink: 0;
  width: 0.95em;
  height: 0.98em;
  margin-right: 0.24em;
  background-image: url("/shield-on-dark.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
[data-theme="light"] .brand-link::before { background-image: url("/shield-on-light.png"); }
.hero-brand__tint { color: var(--brand-tint); font-style: normal; }

/* ═════════════════════════════════════════════════════════════════════════════
   Reports components — this site's own
   ═════════════════════════════════════════════════════════════════════════════ */

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--surface-color);
  border: 1px solid var(--accent-color);
  border-radius: 6px;
}
.skip-link:focus { left: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Inner pages carry the logo smaller, with the section name beside it. */
.masthead--compact { padding: 2.2rem 0 1.4rem; margin-bottom: 2rem; }
.masthead--compact .wordmark { font-size: clamp(2rem, 8vw, 2.6rem); }
.masthead-section {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.masthead-section a { color: var(--text-secondary); }
.masthead-section a:hover { color: var(--heading-color); }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-color);
  line-height: 1.4;
}

main { display: block; }

/* ── Feed page intro ───────────────────────────────────────────────────────── */
.intro { text-align: center; max-width: 46rem; margin: -1.5rem auto 2.5rem; }
.intro h1 {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.6rem 0 0.8rem;
}
.intro p { color: var(--text-secondary); }

/* ── Cards, buttons ────────────────────────────────────────────────────────── */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.6rem 1.7rem;
}
@media (max-width: 480px) { .card { padding: 1.3rem 1.1rem; } }

.share-card { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; margin-bottom: 3rem; }
.share-card > div { flex: 1 1 18rem; }
.share-card h2 { font-size: 1.35rem; line-height: 1.3; margin-bottom: 0.3rem; }
.share-card p { color: var(--text-secondary); line-height: 1.6; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.9rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.2px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 3px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent-color); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: transparent; color: var(--accent-color); border-color: var(--border-light); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent-color); color: var(--accent-hover); }
.btn-quiet { background: transparent; color: var(--text-secondary); border-color: transparent; padding-left: 0.6rem; padding-right: 0.6rem; }
.btn-quiet:hover:not(:disabled) { color: var(--heading-color); }

/* ── Section headings ──────────────────────────────────────────────────────── */
.section-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.3rem 1rem; margin-bottom: 0.4rem;
}
.section-head h2 { font-size: 1.35rem; }
.section-note { color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; }

/* ── Filters ───────────────────────────────────────────────────────────────── */
.filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.2rem 0 1.4rem;
}
@media (max-width: 860px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .filters .field--search { grid-column: 1 / -1; } }
@media (max-width: 480px) { .filters { grid-template-columns: minmax(0, 1fr); } }
.filters-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin: -0.6rem 0 1.2rem; font-size: 0.88rem; color: var(--text-muted); }

/* ── Form fields (www's .trauma-form, as classes) ──────────────────────────── */
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field > label, .field > .label, fieldset > legend {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--heading-color);
  line-height: 1.4;
}
.field-optional { font-weight: 400; color: var(--text-muted); letter-spacing: 0; }
.field-hint { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
input[type="text"], input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface-color);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
                    linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 55%, calc(100% - 0.8rem) 55%;
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
  background-repeat: no-repeat;
}
select option { color: var(--text-primary); background: var(--surface-color); }
textarea { min-height: 12rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
[aria-invalid="true"] { border-color: var(--brand-tint); box-shadow: 0 0 0 3px var(--accent-glow); }
.field-error { font-size: 0.88rem; color: var(--heading-color); line-height: 1.5; }
.field-error::before { content: '→ '; color: var(--accent-color); }
fieldset { border: none; min-width: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.choice-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 0.9rem; min-height: 2.6rem;
  border: 1px solid var(--border-light); border-radius: 8px;
  background: var(--surface-color); cursor: pointer; line-height: 1.3; font-size: 0.95rem;
}
.choice:has(input:checked) { border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-glow); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.choice input { accent-color: var(--accent-color); width: 1.05rem; height: 1.05rem; margin: 0; }

/* ── Report cards (feed) ───────────────────────────────────────────────────── */
.report-list { list-style: none; display: grid; gap: 1rem; }
.report-card {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem 1.4rem 1.2rem;
  line-height: 1.6;
  transition: border-color 0.2s ease;
}
.report-card:hover, .report-card:focus-within { border-color: var(--border-light); }
.report-card h3 { font-size: 1.12rem; line-height: 1.35; margin: 0.2rem 0 0.45rem; }
.report-card h3 a { color: var(--heading-color); }
/* The whole card is the link target, without nesting interactive content. */
.report-card h3 a::after { content: ''; position: absolute; inset: 0; border-radius: 10px; }
.report-card h3 a:focus-visible { outline: none; }
.report-card h3 a:focus-visible::after { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.card-meta { font-size: 0.85rem; color: var(--text-secondary); }
.card-meta > span + span::before { content: '·'; margin: 0 0.45rem; color: var(--text-muted); }
.card-excerpt { color: var(--text-primary); margin-bottom: 0.7rem; overflow-wrap: anywhere; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; font-size: 0.85rem; color: var(--text-muted); }
.card-foot .chips { margin: 0; }
.view-link { margin-left: auto; font-weight: 600; color: var(--accent-color); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 0; }
.chip {
  display: inline-block;
  font-size: 0.8rem;
  line-height: 1.4;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--surface-color);
}

/* A removed personal detail, shown in place of the [PLACEHOLDER]. */
.redacted {
  display: inline-block;
  font-size: 0.78em;
  line-height: 1.35;
  padding: 0.05rem 0.45rem;
  border: 1px dashed var(--border-light);
  border-radius: 6px;
  color: var(--text-muted);
  white-space: nowrap;
  vertical-align: 0.05em;
}

.feed-more { display: flex; justify-content: center; margin: 1.6rem 0 0.5rem; }
.feed-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-secondary); line-height: 1.6; }
.feed-state h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.feed-state .btn { margin-top: 1rem; }
.skeleton { height: 8.5rem; border-radius: 10px; background: var(--surface-raised); border: 1px solid var(--border-color); opacity: 0.6; }

/* ── Notices ───────────────────────────────────────────────────────────────── */
.notice {
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent-color);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  background: var(--surface-color);
  line-height: 1.6;
  font-size: 0.93rem;
  color: var(--text-secondary);
}
.notice p + p { margin-top: 0.5rem; }
.notice strong, .notice-title { color: var(--heading-color); }
.notice-title { font-size: 1rem; margin-bottom: 0.35rem; }

/* ── Submit flow ───────────────────────────────────────────────────────────── */
.narrow { max-width: 46rem; margin: 0 auto; }
.page-title { font-size: clamp(1.7rem, 5vw, 2.3rem); line-height: 1.2; letter-spacing: -0.02em; margin: 0.4rem 0 0.6rem; }
.page-lead { color: var(--text-secondary); margin-bottom: 1.4rem; }
.steps { list-style: none; display: flex; gap: 0.4rem; margin-bottom: 1.2rem; font-size: 0.82rem; color: var(--text-muted); }
.steps li { flex: 1; border-top: 3px solid var(--border-light); padding-top: 0.35rem; line-height: 1.3; }
.steps li[aria-current="step"] { border-top-color: var(--accent-color); color: var(--heading-color); font-weight: 600; }
.steps li.done { border-top-color: var(--brand-tint); }
.form-stack { display: flex; flex-direction: column; gap: 1.5rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
@media (max-width: 600px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.loss-detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0.8rem; }
.counter { font-size: 0.82rem; color: var(--text-muted); text-align: right; }
.counter.is-over { color: var(--heading-color); font-weight: 600; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.form-status { font-size: 0.93rem; line-height: 1.55; color: var(--heading-color); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.preview { margin: 1.2rem 0 1.4rem; }
.preview .report-title { font-size: 1.5rem; }
.consent {
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  background: var(--accent-glow);
  line-height: 1.6;
  font-size: 0.95rem;
}
.consent strong { color: var(--heading-color); }
.removed-list { margin: 0.3rem 0 0 1.1rem; }

.done { text-align: center; padding: 1rem 0 2rem; }
.done h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); margin-bottom: 0.5rem; }
.done .cta-actions { justify-content: center; }

/* ── Report page ───────────────────────────────────────────────────────────── */
.report-main { max-width: 46rem; margin: 0 auto 3rem; }
.breadcrumb { font-size: 0.9rem; margin-bottom: 1rem; }
.report-title { font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.2; letter-spacing: -0.02em; margin: 0.35rem 0 0.4rem; }
.report-summary { color: var(--text-secondary); font-size: 0.95rem; }
.report-section { margin-top: 2.2rem; }
.report-section h2 { font-size: 1.15rem; margin-bottom: 0.15rem; }
.report-section .section-note { margin-bottom: 0.8rem; }
.narrative { overflow-wrap: anywhere; }
.narrative p + p { margin-top: 0.9rem; }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.1rem 1.5rem; margin-top: 0.6rem; }
@media (max-width: 480px) { .details { grid-template-columns: minmax(0, 1fr); } }
.details > div { padding: 0.55rem 0; border-bottom: 1px solid var(--border-color); line-height: 1.45; }
.details dt { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.details dd { color: var(--heading-color); }
.report .notice { margin-top: 2.2rem; }

.cta-card {
  margin-top: 2.5rem;
  background: var(--surface-raised);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.6rem 1.7rem;
}
.cta-card h2 { font-size: 1.25rem; margin-bottom: 0.3rem; }
.cta-card p { color: var(--text-secondary); line-height: 1.6; margin-bottom: 1rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
@media (max-width: 480px) { .cta-card { padding: 1.3rem 1.1rem; } .cta-actions .btn { width: 100%; } }

.empty-state { text-align: center; padding: 1rem 0 3rem; }
.empty-state h1 { font-size: 1.7rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-secondary); margin-bottom: 1rem; }

/* Spacing utilities — the CSP allows no inline style="" attributes. */
.mt-sm { margin-top: 0.4rem; }
.mt-md { margin-top: 1.1rem; }
.mt-lg { margin-top: 1.5rem; }
.text-left { text-align: left; }

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 4rem;
  padding: 1.8rem 0 2.4rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.4rem; margin-top: 0.7rem; }
.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--heading-color); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
