/* ===== Funnel dashboard =====
 *
 * Deliberately plainer than the app. This page exists to be read quickly and
 * acted on; anything decorative here competes with the numbers.
 */

.an-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.an-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.an-top h1 { font-size: 1.5rem; letter-spacing: 0.01em; }

.an-range { font-size: 0.85rem; color: var(--muted); }
.an-range select {
  font: inherit;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
}

.an-status { font-size: 0.85rem; color: var(--muted); margin: 8px 0 20px; }
.an-status.is-error { color: #a33; }

.an-h2 {
  font-size: 1.05rem;
  margin: 34px 0 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.an-note { font-size: 0.8rem; color: var(--muted); margin: 8px 0 14px; }

/* ---- The four steps ----
 * A row of cards rather than a funnel graphic: a tapering shape encodes the
 * same one number twice and makes small differences unreadable at the narrow
 * end, which is exactly where the interesting ones are.
 */
.an-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.an-step {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.an-step-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.an-step-value { font-size: 1.7rem; font-weight: 600; line-height: 1.15; margin-top: 2px; }

.an-step-rate {
  font-size: 0.8rem;
  color: var(--gold-dark);
  font-weight: 600;
}

.an-step-sub { font-size: 0.74rem; color: var(--muted); margin-top: 4px; }

/* ---- Economics strip ---- */
.an-economics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  background: rgba(201, 165, 74, 0.10);
  border: 1px solid rgba(201, 165, 74, 0.35);
  border-radius: 10px;
}

.an-fig-label { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.an-fig-value { font-size: 1.15rem; font-weight: 600; }
.an-fig-value.is-negative { color: #a33; }

/* Amber, not red. A cold rate over half or a refund rate over 5% is a number
   worth walking towards, not an error — red here would cry wolf on a page
   that already uses red for money going the wrong way. */
.an-fig-value.is-warn { color: #a06a12; }
.an-fig-sub { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }

/* ---- The banner ----
 * Deliberately loud, and deliberately at the very top. TESTING_PRICES makes
 * every margin figure on the page fiction, and a footnote under the numbers
 * would be read after the damage.
 */
.an-banner {
  margin: 0 0 18px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #7a3d06;
  background: rgba(214, 138, 20, 0.14);
  border: 1px solid rgba(214, 138, 20, 0.5);
}

/* ---- At a glance ----
 * Same card shape as the funnel steps, so the eye reads it as the same kind of
 * thing, but tighter: this is six figures to scan, not four to follow.
 */
.an-glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.an-glance > div {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}

.an-glance .an-fig-value { font-size: 1.5rem; line-height: 1.2; margin-top: 2px; }

/* ---- Jump bar ----
 * The page is long enough that landing at the top and scrolling to find the
 * credit ledger is a real cost. Plain links, no JavaScript, no scroll spy —
 * anchors already do this correctly including the back button.
 */
.an-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.an-jump a {
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.an-jump a:hover { color: var(--gold-dark); border-color: var(--gold-dark); }

/* Anchors sit under the sticky header without this: the heading you jumped to
   ends up hidden behind it, which reads as the link having gone to the wrong
   place. */
.an-h2[id] { scroll-margin-top: 76px; }

/* The two halves of the page — people, then machine. A heavier rule is the
   cheapest way to say "a different kind of thing starts here". */
.an-h2-major {
  margin-top: 48px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold-dark);
  font-size: 1.15rem;
}

/* ---- Tables ---- */
.an-table-wrap { overflow-x: auto; }

.an-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.an-table th,
.an-table td { padding: 8px 12px; text-align: right; white-space: nowrap; }
.an-table th:first-child,
.an-table td:first-child { text-align: left; }

.an-table thead th {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.an-table tbody tr + tr td { border-top: 1px solid var(--line); }
.an-table tbody tr:hover { background: rgba(201, 165, 74, 0.07); }

.an-empty { padding: 18px; font-size: 0.85rem; color: var(--muted); }

/* ===== The four fates =====
 *
 * Bars, not a pie. The comparison that matters is between two specific cells
 * — "never came back" against "came back and still got nothing" — and angles
 * are the hardest thing there is to compare by eye.
 */
.an-fates {
  display: grid;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}

.an-fate-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.an-fate-label { font-size: 0.85rem; }
.an-fate-n { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.an-fate-pct { color: var(--muted); font-weight: 400; }

.an-fate-bar {
  height: 8px;
  margin: 5px 0 3px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.an-fate-bar span {
  display: block;
  height: 100%;
  background: var(--muted);
  border-radius: 4px;
}

/* Colour carries the diagnosis, not decoration: red is the cell that says the
   product failed someone who came back wanting it. */
.an-fate--cameBackStuck .an-fate-bar span { background: #b4483f; }
.an-fate--vanished .an-fate-bar span { background: #c08a3e; }
.an-fate--engaged .an-fate-bar span { background: #5a8a55; }

.an-fate-fix { font-size: 0.75rem; color: var(--muted); }

/* ===== Post-offer retention ===== */
.an-after {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}

/* Two of these stack, so the second needs air between them. */
.an-after + .an-after { margin-top: 12px; }

.an-after-head {
  display: grid;
  gap: 2px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.an-after-head strong { font-size: 0.95rem; }
.an-after-head .an-step-sub { margin-top: 0; max-width: 78ch; }

.an-wins {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

/* Only when a tab breakdown follows does the row need a rule under it. */
.an-wins:has(+ .an-after-tabs) {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.an-win .an-fig-value { font-size: 1.5rem; line-height: 1.2; }

.an-after-tabs { display: grid; gap: 10px; }
.an-after-tabs .an-fate-bar span { background: var(--gold-dark); }

/* ===== Who signed up =====
 *
 * The contacts table, added 17 September 2026. The table itself reuses
 * .an-table; only the two actions and the two flags are new.
 */
.an-contacts-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.an-btn {
  padding: 7px 14px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dark, #241f16);
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid rgba(201, 165, 74, 0.55);
  border-radius: 6px;
  cursor: pointer;
}

.an-btn:hover { border-color: var(--gold, #c9a54a); }

.an-btn:focus-visible {
  outline: 2px solid var(--gold-dark, #a9822f);
  outline-offset: 2px;
}

.an-contacts-count { font-size: 0.8rem; color: var(--muted); }

/*
 * ===== THE TWO CELLS WORTH LOOKING AT =====
 *
 * "Never" in Last seen, and 0 in Credits left. Those are the rows that are
 * actionable — somebody who signed up and never came back, and somebody who
 * spent everything and is still here. A table where nothing stands out is a
 * table that has to be read in full every time.
 *
 * COLOUR IS NOT THE ONLY SIGNAL. Both cells already say what they are in
 * words ("Never", "0"), so this only makes them easier to find, and a reader
 * who cannot distinguish the colour loses nothing.
 */
.an-flag { color: #a4442f; font-weight: 600; }

/* An address nobody ever confirmed. Deliberately NOT .an-flag: red means
   "act on this", and the right action for an unconfirmed address is nothing
   at all. Greyed so it reads as absent rather than as a problem. */
.an-muted { color: #8a8578; font-style: italic; }

/* ==========================================================================
 * TABS
 * ======================================================================== */

/*
 * ===== WRITTEN TWICE, AND THE FIRST ONE WAS DARK =====
 *
 * The first version of everything below used rgba(255,255,255,...) borders and
 * a near-black input background. It was written by reading nothing and
 * assuming a dark dashboard. The dashboard is light — cream, gold rules, dark
 * ink — so the boxes came out as grey slabs on a pale page.
 *
 * Caught by opening the page rather than by reading the CSS, which is the only
 * way this kind of mistake ever gets caught. Everything here now uses the
 * same variables as the tables and buttons above: --line, --ink, --muted,
 * --white, --gold.
 */

.an-tabs {
  display: flex;
  gap: 4px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 28px 0;
}

.an-tab {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.an-tab:hover { color: var(--ink); }

/*
 * The selected tab is the one joined to the page: same background as the
 * content beneath it, with a gold edge. Colour is not the only signal —
 * aria-selected is set alongside, so it is announced as well as shown.
 */
.an-tab.is-on {
  color: var(--ink);
  background: rgba(255, 253, 249, 0.9);
  border-color: rgba(201, 165, 74, 0.55);
}

.an-tab:focus-visible {
  outline: 2px solid var(--gold-dark, #a9822f);
  outline-offset: 2px;
}

/* ==========================================================================
 * THE WRITING AREA
 * ======================================================================== */

/*
 * Editor left, post list right. The list is the narrow column because it is
 * glanced at; the editor is the wide one because it is worked in.
 */
.blog-admin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 32px;
  align-items: start;
}

/* One column on anything narrow, with the editor first — the list is
   navigation, and navigation above the work pushes the work off screen. */
@media (max-width: 860px) {
  .blog-admin { grid-template-columns: minmax(0, 1fr); }
  .blog-side { order: 2; }
}

.blog-lab {
  display: block;
  margin: 20px 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.blog-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.blog-hint code {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(201, 165, 74, 0.16);
  font-size: 0.95em;
}

.blog-in {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
}

.blog-in:focus-visible {
  outline: 2px solid var(--gold-dark, #a9822f);
  outline-offset: 1px;
}

.blog-body {
  /*
   * Serif and a generous line height, because this box is re-read as much as
   * it is typed into and a 3,000-word draft in the interface font is hard
   * going. resize:vertical so a long post can be given more room.
   */
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 340px;
}

.blog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

/* Publish is the one that makes something public, so it is the one that looks
   like the primary action. */
.an-btn-go {
  background: var(--gold-dark, #a9822f);
  border-color: var(--gold-dark, #a9822f);
  color: #fffdf9;
}

/* Delete is the only irreversible button here and it sits beside the one
   pressed every day. It is allowed to look different. */
.an-btn-warn { border-color: rgba(163, 51, 51, 0.5); color: #a33; }

.blog-live { font-size: 0.82rem; color: var(--ink); }

.blog-msg { min-height: 1.2em; margin-top: 14px; font-size: 0.85rem; color: var(--muted); }
.blog-msg.is-ok { color: var(--ink); }
.blog-msg.is-bad { color: #a33; }

.blog-posts { list-style: none; margin: 0; padding: 0; }

.blog-post-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.blog-post-row.is-editing .blog-post-open { text-decoration: underline; font-weight: 600; }

.blog-post-open {
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.blog-post-empty { padding: 9px 0; font-size: 0.85rem; color: var(--muted); }

.blog-tag {
  flex: 0 0 auto;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* A live post is the one you can still take down by mistake. Worth seeing. */
.blog-tag-published {
  border-color: rgba(201, 165, 74, 0.7);
  color: var(--gold-dark, #a9822f);
}

/* ==========================================================================
 * THE COVER IMAGE
 * ======================================================================== */

.blog-file {
  display: block;
  font: inherit;
  font-size: 0.82rem;
  color: var(--ink);
}

.blog-file::file-selector-button {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  margin-right: 10px;
  border: 1px solid rgba(201, 165, 74, 0.55);
  border-radius: 6px;
  background: rgba(255, 253, 249, 0.9);
  color: var(--dark, #241f16);
  cursor: pointer;
}

/*
 * Preview left, the fields that describe it right — so the alt text is being
 * written next to the thing it describes rather than from memory further down
 * the page.
 */
.blog-cover-box {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.6);
}

@media (max-width: 700px) {
  .blog-cover-box { grid-template-columns: minmax(0, 1fr); }
}

.blog-cover-preview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  /* A checked ground, so a PNG with transparency reads as transparent rather
     than as white artwork that will look wrong on the page. */
  background:
    repeating-conic-gradient(rgba(0, 0, 0, 0.05) 0% 25%, transparent 0% 50%) 50% / 16px 16px;
}

.blog-cover-meta { margin: 0 0 10px; font-size: 0.78rem; color: var(--muted); }

.blog-lab-tight { margin-top: 0; }

.blog-cover-remove { margin-top: 10px; }

/* ==========================================================================
 * A PICTURE INSIDE THE POST
 * ======================================================================== */

.blog-inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
}

/*
 * The real input is hidden and the LABEL is the control. A bare file input
 * cannot be styled to match the other buttons, and a label with `for` is a
 * genuine accessible trigger rather than a div with a click handler.
 */
.blog-inline-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.blog-inline-btn { cursor: pointer; }

/* Keyboard focus lands on the hidden input, so the ring has to be drawn on
   the label that stands in for it. */
.blog-inline-file:focus-visible + .blog-hint,
.blog-inline-file:focus-visible ~ .blog-inline-btn,
.blog-inline-row:focus-within .blog-inline-btn {
  outline: 2px solid var(--gold-dark, #a9822f);
  outline-offset: 2px;
}

/* ==========================================================================
 * EMPLOYER CHALLENGE STATEMENTS
 * ======================================================================== */

/*
 * Cards, not a table. A statement is a paragraph and so are the two answers
 * under it — in a table each is a cell that either wraps to six lines and
 * wrecks the row heights, or gets truncated, and truncating the thing somebody
 * wrote for us defeats the point of asking.
 */
.an-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}

.an-challenges {
  display: grid;
  gap: 14px;
  /* A readable measure. Statements run to a paragraph and full-width text on a
     wide monitor is the one thing that makes prose harder to read, not easier. */
  max-width: 760px;
}

.an-challenge {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.7);
}

.an-challenge-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 2px;
  font-size: 0.95rem;
}

.an-challenge-when { font-size: 0.78rem; color: var(--muted); }

.an-challenge-mail {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--ink);
}

.an-challenge-statement {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

/*
 * The optional answers are set apart rather than run on. They are a different
 * question, and a wall of three paragraphs with no separation reads as one
 * long answer to the first of them.
 */
.an-challenge-label {
  margin: 14px 0 2px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.an-challenge-extra {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  /* Preserved, because somebody may have typed a list with line breaks in it
     and joining those into one paragraph loses the shape they gave it. */
  white-space: pre-wrap;
}

/*
 * SCOPED, because .an-empty already exists further up this file with its own
 * padding and size. Redefining it globally would have quietly restyled every
 * other empty state on the page — the sort of change that is invisible in a
 * diff and obvious on screen weeks later.
 */
.an-challenges .an-empty { padding: 0; margin: 0; font-size: 0.88rem; }

/* ==========================================================================
   OPENING A CHALLENGE, AND FORWARDING AN ANSWER
   ========================================================================== */

.an-challenge-gate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  font-size: 12px;
}

.an-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--an-dark, #222);
}

.an-toggle input { cursor: pointer; }

.an-challenge-gate-status { color: #a33; }

/* One answer. A row rather than a card, because the card is the challenge and
   the answers belong inside it. */
.an-submission {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 5px;
  font-size: 12px;
}

.an-submission-file { font-weight: 600; }

.an-submission-note {
  /* The candidate's own line. Takes the free space and wraps rather than
     pushing the Forward button off the row. */
  flex: 1 1 180px;
  min-width: 0;
  color: #555;
  font-style: italic;
  overflow-wrap: anywhere;
}

/* An email address is long and must not stretch the row. */
.an-submission button { overflow-wrap: anywhere; text-align: left; }

.an-submission-status { color: #a33; overflow-wrap: anywhere; }

.an-submission-sent {
  color: #3a7d3a;
  font-weight: 600;
}

/* ==========================================================================
   THE MAILING LIST

   One line per subscriber. Not a table: there are three short fields and a
   table's header, borders and cell padding would take more room than the data.
   ========================================================================== */

.an-subscribers {
  margin: 0 0 28px;
  /* Long lists are common and this is not the point of the page. Scrolls in
     place rather than pushing the funnel below the fold. */
  max-height: 340px;
  overflow-y: auto;
}

.an-subscriber {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  padding: 7px 10px;
  font-size: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.an-subscriber-when {
  /* Fixed so the addresses line up down the column and can be read as a list
     rather than as ragged prose. */
  flex: 0 0 84px;
  color: var(--muted);
}

.an-subscriber-mail {
  flex: 1 1 220px;
  min-width: 0;
  font-weight: 600;
  /* An address has no spaces, so without this one long one widens the whole
     scroller and every row gets a horizontal scrollbar. */
  overflow-wrap: anywhere;
}

.an-subscriber-src {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Left the list. Kept visible rather than filtered out, because the record of a
   withdrawal is the thing that proves it was honoured. */
.an-subscriber.is-gone {
  opacity: 0.5;
}

.an-subscriber.is-gone .an-subscriber-mail {
  text-decoration: line-through;
}
