/* Sonnet Skills · member platform
 *
 * The wireframes' own language, which is not the Shelf's. The Shelf is paper,
 * serif and a single quiet red, and it suits a book you sit with. This is the
 * platform around the books — progress, unlocks, a trial with a clock on it —
 * and it is drawn flat, boxed and loud: white ground, black rule, one red that
 * only ever means "this is the thing to do next".
 *
 * Both are deliberate and they do not blend. A screen belongs to one or the
 * other; a page that is half paper and half box reads as an accident.
 *
 * Inter Tight, the public site's face, for everything structural and for the
 * small labels; Newsreader for prose that is meant to be read rather than
 * scanned. JetBrains Mono only where a code has to be copied exactly.
 */

/* Every root the tokens have to reach. `.mb-read` is a separate one because
   the reader wears its own class over the Shelf's markup rather than sitting
   inside a .mb page, and a var() that resolves nowhere fails silently — which
   is exactly how it fails: no error, no colour, and a black label on a black
   button. */
.mb, .mb-read {
  /* Ink and ground. Only two, on purpose: a grey border is a border that is
     apologising for being there. */
  --ink: #000000;
  --ground: #FFFFFF;
  --hush: #F4F4F4;          /* a filled cell, a disabled control */
  --quiet: #6B6B6B;         /* secondary text, and nothing else */
  --rule: #000000;
  --rule-soft: #DCDCDC;     /* where a full black line would be too much */

  /* One red. It marks what to do next and what is live; never decoration. */
  --red: #D71914;
  --red-ink: #B21410;       /* the same red, legible on white at small sizes */
  --green: #0B7A3B;         /* finished, and only finished */

  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: Newsreader, Georgia, serif;

  --bar: 56px;              /* the bottom tab bar on a phone */
  --rail: 236px;            /* the sidebar on a desktop */

  color: var(--ink);
  background: var(--ground);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---- the words ---------------------------------------------------------- */
/* Headings are heavy and tight, in sentence case, as on the public site. */
.mb h1, .mb h2, .mb h3 { margin: 0; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.mb h1 { font-size: clamp(30px, 7vw, 44px); }
.mb h2 { font-size: clamp(20px, 4vw, 26px); }
.mb h3 { font-size: 15px; letter-spacing: -0.01em; }
.mb p { margin: 0 0 12px; }
.mb a { color: inherit; text-decoration: none; }

/* A section label: mono, spaced, small. It names a region without competing
   with the heading inside it. */
.mb-label {
  font: 500 10px/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--quiet); margin: 0 0 8px;
}
.mb-label.is-red { color: var(--red-ink); }
.mb-rule { height: 3px; background: var(--red); margin: 10px 0 20px; }
.mb-quiet { color: var(--quiet); }
/* Prose meant to be read rather than scanned. Specific enough to beat the
   uppercase on .mb h1/h2/h3, which it is almost always sitting on. */
.mb .mb-serif, .mb h1.mb-serif, .mb h2.mb-serif, .mb h3.mb-serif {
  font-family: var(--serif); text-transform: none; letter-spacing: -0.005em; font-weight: 500;
}

/* ---- the shell ---------------------------------------------------------- */
.mb-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }

/* Desktop: black bar across the top, wordmark, search, bell, avatar. On a
   phone neither it nor the sidebar exists — the tab bar is the navigation,
   and the same markup serves both rather than being rendered twice. */
.mb-top { display: none; }
.mb-rail { display: none; }
.mb-body { display: block; }
.mb-main { padding: 22px 16px calc(var(--bar) + 28px); max-width: 1180px; }

/* Mobile: the page owns the screen and the tabs sit on the glass. */
.mb-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--ground); border-top: 1px solid var(--rule-soft); padding-bottom: env(safe-area-inset-bottom, 0);
}
.mb-tab {
  display: grid; place-items: center; min-height: var(--bar); padding: 6px 4px;
  font: 600 12px/1.2 var(--sans);
  color: var(--quiet);
}
.mb-tab[aria-current="page"] { color: var(--red); }
.mb-tab:hover { color: var(--ink); }
.mb-tab[aria-current="page"]:hover { color: var(--red); }

/* The phone's own header: name on the left, notifications on the right. */
.mb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.mb-head p { color: var(--quiet); margin: 6px 0 0; max-width: 46ch; }

.mb-bell {
  position: relative; display: grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid var(--rule); flex: none;
}
.mb-bell b {
  position: absolute; top: -8px; right: -8px; min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center; background: var(--red); color: #fff;
  font: 700 10px/1 var(--sans); border-radius: 10px;
}

/* ---- the stat strip ----------------------------------------------------- */
/* One box per thing the member owns or is owed. Two rows of three on a phone,
   six across on a desktop; the border collapses so it reads as one object. */
.mb-stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--rule); }
.mb-stat { padding: 12px 10px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; }
.mb-stat:nth-child(3n) { border-right: 0; }
.mb-stat:nth-last-child(-n+3) { border-bottom: 0; }
.mb-stat b { display: block; font: 900 21px/1.1 var(--sans); letter-spacing: -0.03em; text-transform: uppercase; }
.mb-stat span { display: block; margin-top: 3px; font: 500 9px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--quiet); }
.mb-stat.is-on b { color: var(--red-ink); }
.mb-stat.is-off b { color: var(--quiet); }

/* ---- cards -------------------------------------------------------------- */
.mb-card { border: 1px solid var(--rule); padding: 14px; background: var(--ground); display: block; }
.mb-card + .mb-card { margin-top: 10px; }
a.mb-card:hover { background: var(--hush); }
.mb-grid { display: grid; gap: 10px; }
.mb-grid.two { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.mb-grid.three { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* Continue-where-you-left-off: kicker, title, then how far. */
.mb-kicker { font: 500 9.5px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--quiet); }
.mb-card h3 { margin: 6px 0 0; }
.mb-meta { margin-top: 8px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font: 500 10px/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--quiet); }

/* A progress line, not a progress bar: 3px, square, red for in-flight and
   green for done, because "finished" should not look like "62% finished". */
.mb-track { height: 3px; background: var(--rule-soft); margin-top: 10px; }
.mb-track i { display: block; height: 100%; background: var(--red); }
.mb-track.is-done i { background: var(--green); }

/* ---- the one thing to do next ------------------------------------------- */
/* The only solid red on the page, and there is never more than one. */
.mb-next { background: var(--red); color: #fff; padding: 18px 16px; }
.mb-next .mb-label { color: rgba(255,255,255,.78); }
.mb-next h2 { color: #fff; }
.mb-next p { margin: 10px 0 0; color: rgba(255,255,255,.92); }
.mb-next .mb-btn { margin-top: 14px; background: #fff; color: var(--red-ink); border-color: #fff; }
.mb-next .mb-btn:hover { background: #fff; color: var(--ink); }

/* ---- buttons ------------------------------------------------------------ */
/*
 * `.mb a { color: inherit }` is (0,1,1) and beat `.mb-btn` at (0,1,0), so
 * every link styled as a solid button drew black text on a black ground — a
 * label nobody could read. The anchor is named here so the button wins.
 */
.mb-btn, .mb a.mb-btn, .mb-read a.mb-btn {
  display: inline-block; padding: 13px 20px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--ground); text-align: center;
  font: 600 14px/1.2 var(--sans); cursor: pointer;
}
.mb-btn:hover, .mb a.mb-btn:hover, .mb-read a.mb-btn:hover { background: var(--ground); color: var(--ink); }
.mb-btn.wide { display: block; width: 100%; }
.mb-btn.ghost, .mb a.mb-btn.ghost { background: var(--ground); color: var(--ink); }
.mb-btn.ghost:hover, .mb a.mb-btn.ghost:hover { background: var(--ink); color: var(--ground); }
.mb-btn[disabled] { background: var(--hush); color: var(--quiet); border-color: var(--rule-soft); cursor: default; }

/* A chip states a fact — unlocked, active, available. It is not a button and
   must not look like one. */
.mb-chip {
  display: inline-block; padding: 4px 8px; background: var(--ink); color: var(--ground);
  font: 500 9.5px/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
}
.mb-chip.is-open { background: var(--ground); color: var(--red-ink); border: 1px solid var(--red); }
.mb-chip.is-done { background: var(--green); }
.mb-chip.is-off { background: var(--hush); color: var(--quiet); }

/* ---- sections ----------------------------------------------------------- */
.mb-section { margin-top: 26px; }
.mb-section > .mb-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mb-section > .mb-label a { color: var(--red-ink); }

.mb-empty { border: 1px dashed var(--rule-soft); padding: 22px 16px; text-align: center; color: var(--quiet); }

/* ---- desktop ------------------------------------------------------------ */
@media (min-width: 900px) {
  .mb-shell { grid-template-rows: auto 1fr; }
  .mb-tabs { display: none; }

  .mb-top {
    display: flex; align-items: center; gap: 18px;
    background: var(--ground); color: var(--ink); padding: 12px 20px; border-bottom: 1px solid var(--rule-soft);
    position: sticky; top: 0; z-index: 40;
  }
  .mb-wordmark { display: inline-flex; align-items: center; font: 800 19px/1 var(--sans); letter-spacing: -0.02em; white-space: nowrap; color: var(--ink); text-decoration: none; }
  .mb-search {
    flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px;
    background: var(--hush); border: 1px solid var(--rule-soft); color: var(--quiet); padding: 9px 12px; border-radius: 8px;
    font: 400 14px/1.2 var(--sans); text-align: left;
  }
  .mb-search:hover { border-color: var(--ink); color: var(--ink); }
  .mb-search kbd { margin-left: auto; font: 500 11px/1 var(--sans); color: var(--quiet); }
  .mb-top .mb-bell { border-color: var(--rule-soft); width: 38px; height: 38px; margin-left: auto; }
  .mb-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--ground); font: 700 13px/1 var(--sans); flex: none; }

  .mb-body { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); align-items: start; }
  .mb-rail { display: block; position: sticky; top: 63px; border-right: 1px solid var(--rule); min-height: calc(100vh - 63px); padding: 14px 0; }
  .mb-rail a {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 11px 18px; font: 500 14px/1.2 var(--sans);
  }
  .mb-rail a:hover { background: var(--hush); }
  .mb-rail a[aria-current="page"] { background: var(--red); color: #fff; font-weight: 600; }
  .mb-rail em { font: 500 10px/1 var(--mono); letter-spacing: 0.08em; font-style: normal; color: var(--quiet); text-transform: uppercase; }
  .mb-rail a[aria-current="page"] em { color: rgba(255,255,255,.85); }

  .mb-main { padding: 26px 28px 60px; }
  .mb-stats { grid-template-columns: repeat(6, 1fr); }
  .mb-stat:nth-child(3n) { border-right: 1px solid var(--rule); }
  .mb-stat:nth-child(6n) { border-right: 0; }
  .mb-stat:nth-last-child(-n+3) { border-bottom: 1px solid var(--rule); }
  .mb-stat:nth-last-child(-n+6) { border-bottom: 0; }
  .mb-head .mb-bell { display: none; }   /* the top bar has it */

  /* The home's two columns: what you were doing, and the one thing to do. */
  .mb-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
}

@media (prefers-reduced-motion: no-preference) {
  .mb-track i { transition: width .4s cubic-bezier(.2,.7,.3,1); }
}

/* ---- My Library ---------------------------------------------------------- */
.mb-count { text-align: right; flex: none; }
.mb-count b { display: block; font: 900 30px/1 var(--sans); letter-spacing: -0.03em; color: var(--red-ink); }
.mb-count span { font: 500 9px/1.3 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--quiet); }

.mb-input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--rule); background: var(--ground);
  font: 400 15px/1.3 var(--sans); color: var(--ink);
}
.mb-input::placeholder { color: var(--quiet); }
.mb-input:focus { outline: 2px solid var(--red); outline-offset: -2px; }
.mb-input::-webkit-search-cancel-button { display: none; }

/* Filters scroll sideways on a phone rather than wrapping to two rows — the
   wireframe cuts the last one off on purpose, which tells you there are more. */
.mb-filters { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.mb-filters::-webkit-scrollbar { display: none; }
.mb-filter {
  flex: none; padding: 8px 14px; border: 1px solid var(--rule); background: var(--ground);
  font: 500 13px/1.2 var(--sans); color: var(--ink); white-space: nowrap; cursor: pointer;
}
.mb-filter:hover { background: var(--hush); }
.mb-filter[aria-pressed="true"] { background: var(--ink); color: var(--ground); }

/* One row per book: cover, where you are, one tap back in. */
.mb-list { margin-top: 16px; display: grid; gap: 10px; }
.mb-row { display: flex; gap: 12px; border: 1px solid var(--rule); padding: 12px; align-items: stretch; }
.mb-row:hover { background: var(--hush); }
/* A book cover is the thing somebody recognises their book by, and at 58px it
   was a stamp — a 1024x1536 image shown at a sixteenth of its width, too small
   to read a title off. It is the largest thing in the row now, which is the
   right way round for a shelf. */
.mb-cover {
  flex: none; width: 92px; aspect-ratio: 2 / 3;
  border: 1px solid var(--rule-soft); background: var(--hush);
  overflow: hidden; align-self: flex-start;
}
.mb-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mb-cover.is-blank { height: auto; }
.mb-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mb-row .mb-kicker { display: flex; gap: 8px; align-items: baseline; }
.mb-row .mb-kicker b { font-weight: 500; color: var(--quiet); }
.mb-row .mb-kicker em { font-style: normal; letter-spacing: 0.14em; }
.mb-row .mb-kicker em.is-red { color: var(--red-ink); }
.mb-row .mb-kicker em.is-done { color: var(--green); }
.mb-row-title { font: 700 15px/1.25 var(--sans); letter-spacing: -0.01em; margin-top: 4px; }
.mb-row-sub { font-size: 13px; color: var(--quiet); margin-top: 2px; }
.mb-row .mb-track { margin-top: auto; }
.mb-row .mb-meta { margin-top: 6px; }

/* ---- the panels under the books ------------------------------------------ */
.mb-panels { margin-top: 30px; display: grid; gap: 12px; }
.mb-panel { border: 1px solid var(--rule); padding: 18px 16px; }
.mb-panel h2 { margin: 6px 0 8px; }
.mb-panel .mb-quiet { margin: 0 0 14px; max-width: 62ch; }
.mb-panel .mb-btn { display: inline-block; }
.mb-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mb-facts > div { border: 1px solid var(--rule-soft); padding: 10px 12px; }
.mb-facts span { display: block; font: 500 9px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--quiet); }
.mb-facts b { display: block; font: 600 14px/1.35 var(--sans); margin-top: 3px; overflow-wrap: anywhere; }

.mb-error { margin: 10px 0 0; color: var(--red-ink); font-size: 13.5px; }
.mb-fine { margin: 10px 0 0; font-size: 12.5px; color: var(--quiet); }
.mb-fine a { text-decoration: underline; text-underline-offset: 2px; }
.mb-notice { border: 1px solid var(--red); padding: 14px 16px; margin-bottom: 16px; }
.mb-notice p { margin: 0 0 10px; }

@media (min-width: 900px) {
  .mb-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mb-panels { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); align-items: start; }
  .mb-cover { width: 116px; }
}

/* ---- the ebook reader (wireframes 06 and 07) ----------------------------- */
/*
 * A restyle, not a rewrite. The reader already has the shape the wireframes
 * draw — a chapter rail, a top bar, a page — and six hundred lines behind it
 * doing search, narration, "ask the book" and worksheets. Rebuilding that to
 * change its colours would be trading four working features for a paint job,
 * so this dresses the markup that is already there and touches none of it.
 *
 * Everything is scoped under .mb-read so the Shelf's own rules, which are less
 * specific, lose without being deleted — the page-image viewer still uses them.
 */
/*
 * The Shelf paints the page cream from `html:has(.bk-main), … body`, which is
 * more specific than `body.mb-read` — so this matches its shape to beat it on
 * order rather than climbing into !important.
 *
 * The literal white is deliberate: <html> is outside every root the tokens are
 * declared on, so var(--ground) would resolve to nothing here and fail the
 * silent way custom properties fail.
 */
html:has(.mb-read), html:has(.mb-read) body { background: #FFFFFF; }
/* The course page is painted by a rule of its own shape, so it needs naming
   too rather than inheriting the one above by luck. */
html:has(.cs-main), html:has(.cs-main) body { background: #FFFFFF; }
.mb-read, body.mb-read { background: var(--ground); color: var(--ink); font-family: var(--sans); }
.mb-read .rd-main, .mb-read .rd-cream, .mb-read .viewer-main { background: var(--ground); }

/* The black bar: back to the library, where you are, and the tools. */
.mb-read .rd-topbar {
  background: var(--ink); color: var(--ground); border: 0;
  padding: 0 14px; min-height: 48px; gap: 14px; align-items: center;
}
.mb-read .rd-back, .mb-read .rd-toggle { color: var(--ground); font: 700 12px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; }
.mb-read .rd-back:hover, .mb-read .rd-toggle:hover { color: var(--red); }
.mb-read .rd-topbar-title {
  font: 500 11px/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: #9A9A9A;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mb-read .rd-sizer { border: 1px solid #2E2E2E; }
.mb-read .rd-sizer button { color: var(--ground); background: none; }
.mb-read .rd-sizer button:hover { background: #1C1C1C; }

/* The progress line under the bar is the wireframe's red rule. */
.mb-read .viewer-line { height: 3px; background: #DCDCDC; }
.mb-read .viewer-line span { background: var(--red); }

/* Chapters down the side: numbered, ticked when read, red where you are. */
.mb-read .rd-side { background: var(--ground); border-right: 1px solid var(--rule); }
.mb-read .rd-brand { border-bottom: 1px solid var(--rule); padding: 14px; }
.mb-read .rd-brand-mark { background: var(--red); color: transparent; border-radius: 0; width: 26px; height: 26px; }
.mb-read .rd-brand-title { font: 700 14px/1.2 var(--sans); letter-spacing: -0.01em; color: var(--ink); }
.mb-read .rd-brand-sub { font: 500 9px/1.3 var(--mono); letter-spacing: 0.16em; color: var(--quiet); }
.mb-read .rd-search-label { font: 500 9px/1.3 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--quiet); }
.mb-read .rd-search-input { border: 1px solid var(--rule); border-radius: 0; background: var(--ground); font-family: var(--sans); }
.mb-read .rd-search-input:focus { outline: 2px solid var(--red); outline-offset: -2px; }

.mb-read .rd-nav-item {
  border-radius: 0; border-left: 3px solid transparent; padding: 10px 12px;
  font: 500 13.5px/1.3 var(--sans); color: var(--ink);
}
.mb-read .rd-nav-item:hover { background: var(--hush); }
.mb-read .rd-nav-item[aria-current="true"] { background: var(--red); color: #fff; border-left-color: var(--ink); font-weight: 700; }
.mb-read .rd-nav-item[aria-current="true"] .rd-nav-meta { color: rgba(255,255,255,.85); }
.mb-read .rd-nav-meta { font: 500 9.5px/1 var(--mono); letter-spacing: 0.08em; color: var(--quiet); }

.mb-read .rd-tool, .mb-read .rd-link { border-radius: 0; font-family: var(--sans); color: var(--ink); }
.mb-read .rd-tool { border: 1px solid var(--rule); }
.mb-read .rd-tool:hover { background: var(--ink); color: var(--ground); }
.mb-read .rd-foot { border-top: 1px solid var(--rule); }

/* The page itself. Prose stays generous — this is the one screen somebody
   reads for twenty minutes, and the wireframe sets it in sans at a size the
   Shelf would call large. */
.mb-read .rd-page { background: var(--ground); }
.mb-read .bk-kicker { font: 500 10px/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--quiet); }
.mb-read .bk-title {
  font: 900 clamp(28px, 5.5vw, 46px)/1.02 var(--sans); letter-spacing: -0.035em;
  text-transform: uppercase; color: var(--ink); margin: 10px 0 0;
}
.mb-read .bk-title::after { content: ""; display: block; height: 3px; background: var(--red); margin-top: 16px; }
.mb-read .bk-body { font-family: var(--sans); font-size: 17px; line-height: 1.65; color: var(--ink); }
.mb-read .bk-body h2, .mb-read .bk-body h3 { font-family: var(--sans); font-weight: 800; letter-spacing: -0.02em; text-transform: none; }
/* A pulled quote gets the wireframe's red edge rather than italics. */
.mb-read .bk-body blockquote {
  border-left: 3px solid var(--red); padding-left: 16px; margin: 20px 0;
  font-size: 19px; line-height: 1.5; font-style: normal; color: var(--ink);
}
.mb-read .bk-body a { color: var(--red-ink); text-decoration: underline; text-underline-offset: 2px; }

/* Previous / next, squared off and quiet. */
.mb-read .viewer-controls { background: var(--ground); border-top: 1px solid var(--rule); }
.mb-read .viewer-controls .btn { border-radius: 0; font-family: var(--sans); }
.mb-read .bk-progress { font: 500 10px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--quiet); }

/* Narration and Ask keep their behaviour and lose their curves. */
.mb-read .bk-player, .mb-read .bk-ask-card { border-radius: 0; border: 1px solid var(--rule); background: var(--ground); }
.mb-read .bk-player-bar span { background: var(--red); }
.mb-read .bk-ask-chips button, .mb-read .bk-ask-form input, .mb-read .bk-ask-form button { border-radius: 0; font-family: var(--sans); }
/* The Shelf's .viewer-nav sets its own colour and beats a single class, which
   left Next as black text on a black button — a label nobody could read. */
.mb-read .btn-primary, .mb-read .btn-dark,
.mb-read .viewer-controls .btn-dark, .mb-read .viewer-controls .btn-primary {
  background: var(--ink); color: var(--ground); border: 1px solid var(--ink); border-radius: 0;
}
.mb-read .btn-primary:hover, .mb-read .btn-dark:hover,
.mb-read .viewer-controls .btn-dark:hover, .mb-read .viewer-controls .btn-primary:hover {
  background: var(--ground); color: var(--ink);
}
.mb-read .btn-secondary, .mb-read .viewer-controls .btn-secondary {
  border-radius: 0; border: 1px solid var(--rule); color: var(--ink); background: var(--ground);
}
.mb-read .viewer-controls .btn-secondary:hover { background: var(--hush); }

/* The Shelf tints a few surfaces inside the reader cream as well. Named here
   rather than chased one at a time later. */
.mb-read .rd-shell,
.mb-read .rd-foot,
.mb-read .rd-tool,
.mb-read .viewer-message,
.mb-read input,
.mb-read textarea,
.mb-read select { background: var(--ground); }
.mb-read .rd-tool:hover { background: var(--ink); color: var(--ground); }
.mb-read input, .mb-read textarea, .mb-read select { border-radius: 0; font-family: var(--sans); color: var(--ink); }

/* ---- the course player (wireframe 09) ------------------------------------ */
/*
 * The wireframe puts the video first and the title under it, which is the
 * order somebody uses the screen in: press play, then read what it was about.
 * The markup has the title first — right for a page that is mostly words — so
 * the order is changed here rather than in the template, and a screen reader
 * still meets the heading before the player.
 */
.mb-read [data-view="ready"] { display: flex; flex-direction: column; }
.mb-read [data-lesson-kicker] { order: 1; }
.mb-read .cs-video { order: 2; margin: 12px 0 18px; }
.mb-read .cs-watch { order: 3; }
.mb-read [data-lesson-title] { order: 4; }
.mb-read [data-lesson-summary] { order: 5; }
.mb-read [data-lesson-body] { order: 6; }
.mb-read .cs-actions { order: 7; }

/* The player sits in black, edge to edge of the column, 16:9. */
.mb-read .cs-video { background: #000; border: 1px solid var(--rule); }
.mb-read .cs-video video, .mb-read .cs-video iframe {
  display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; background: #000;
}
/* The chapter title has a red rule under it in the ebook; here the video is
   already the break, so the title carries it only when there is no video. */
.mb-read .cs-main [data-lesson-title]::after { display: none; }
.mb-read .cs-main [data-lesson-title] { font-size: clamp(22px, 4vw, 32px); margin: 0; }
.mb-read .cs-summary {
  order: 5; margin: 10px 0 0; font-size: 16px; line-height: 1.55; color: var(--quiet); max-width: 62ch;
}

/* "Key takeaways": the lesson's own paragraphs, ruled apart the way the
   wireframe rules them, so a three-line list reads as three things. */
.mb-read .cs-main [data-lesson-body] { margin-top: 20px; }
.mb-read .cs-main [data-lesson-body] p {
  border-top: 1px solid var(--rule-soft); padding: 12px 0 0; margin: 0 0 12px;
  font-size: 16px; line-height: 1.55;
}
.mb-read .cs-main [data-lesson-body] p:first-child { border-top: 0; padding-top: 0; }

/* The Shelf rules a cream line above these. The wireframe has none, and a
   cream line on white is a smudge rather than a divider. */
.mb-read .cs-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; border-top: 0; padding-top: 0; }
.mb-read .cs-actions .btn { flex: 1 1 190px; padding: 14px 18px; }

/* Lessons down the side: ticked, numbered, current in red. */
.mb-read .cs-module {
  margin: 16px 0 6px; padding: 0 12px;
  font: 500 9px/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--quiet);
}
.mb-read .cs-nav-item { gap: 10px; }
.mb-read .cs-tick {
  flex: none; width: 20px; height: 20px; display: grid; place-items: center;
  border: 1px solid var(--rule-soft); border-radius: 0; background: var(--ground);
  font: 600 10px/1 var(--sans); color: var(--quiet);
}
.mb-read .cs-tick.is-done { background: var(--green); border-color: var(--green); color: #fff; }
.mb-read .cs-nav-item[aria-current="true"] .cs-tick { border-color: #fff; color: #fff; background: transparent; }
.mb-read .cs-nav-item[aria-current="true"] .cs-tick.is-done { background: var(--green); border-color: var(--green); }
.mb-read .cs-progress {
  font: 500 10px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--quiet); margin: 0;
}

/* ---- the course, given its own room -------------------------------------- */
/* Not a book row. It is the only thing in the library with modules, a run time
   and a place you stopped mid-video, and as one row among six books it read as
   a seventh book. */
.mb-course { display: grid; gap: 4px; border: 1px solid var(--rule); padding: 18px 16px; background: var(--ground); }
.mb-course:hover { background: var(--hush); }
.mb-course-tag { font: 500 9.5px/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--red-ink); }
.mb-course-title { font: 900 clamp(20px, 3.4vw, 28px)/1.05 var(--sans); letter-spacing: -0.03em; text-transform: uppercase; margin-top: 4px; }
.mb-course-sub { font-size: 13.5px; color: var(--quiet); max-width: 56ch; }
.mb-course-stats { display: flex; gap: 0; margin-top: 12px; border: 1px solid var(--rule); }
.mb-course-stats > span { flex: 1; padding: 9px 11px; border-right: 1px solid var(--rule); min-width: 0; }
.mb-course-stats > span:last-child { border-right: 0; }
.mb-course-stats b { display: block; font: 900 18px/1.1 var(--sans); letter-spacing: -0.03em; text-transform: uppercase; }
.mb-course-stats em { display: block; margin-top: 2px; font: 500 9px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--quiet); font-style: normal; }
.mb-course .mb-track { margin-top: 12px; }
.mb-course-go { margin-top: 10px; font: 600 14px/1.2 var(--sans); color: var(--red-ink); display: flex; gap: 8px; align-items: center; }
.mb-course-go i { font-style: normal; }

/* ---- the course overview (wireframe 08) ---------------------------------- */
.mb-read .cs-board { max-width: 780px; }
.mb-read .cs-board-kicker { font: 500 10px/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--quiet); margin: 0; }
.mb-read .cs-board-title {
  font: 900 clamp(26px, 5vw, 42px)/1.03 var(--sans); letter-spacing: -0.035em;
  text-transform: uppercase; margin: 8px 0 0;
}
.mb-read .cs-board-rule { height: 3px; background: var(--red); margin: 14px 0 18px; }
.mb-read .cs-board-label { font: 500 9.5px/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--quiet); margin: 26px 0 8px; }

.mb-read .cs-stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--rule); }
.mb-read .cs-stat { padding: 13px 12px; border-right: 1px solid var(--rule); min-width: 0; }
.mb-read .cs-stat:last-child { border-right: 0; }
.mb-read .cs-stat b { display: block; font: 900 24px/1.05 var(--sans); letter-spacing: -0.03em; }
.mb-read .cs-stat span { display: block; margin-top: 3px; font: 500 9px/1.3 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--quiet); }

/* The way in: one black bar, and only ever one. */
.mb-read .cs-resume {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
  margin-top: 12px; padding: 16px 18px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--ground);
  font: 600 15px/1.25 var(--sans); text-align: left; cursor: pointer;
}
.mb-read .cs-resume:hover { background: var(--ground); color: var(--ink); }
.mb-read .cs-resume i { font-style: normal; font-size: 20px; line-height: 1; }

.mb-read .cs-modules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mb-read .cs-module-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px; border: 1px solid var(--rule); background: var(--ground);
  text-align: left; cursor: pointer;
}
.mb-read .cs-module-card:hover { background: var(--hush); }
.mb-read .cs-module-n { flex: none; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; color: var(--red-ink); }
.mb-read .cs-module-body { flex: 1; min-width: 0; }
.mb-read .cs-module-name { display: block; font: 700 15px/1.25 var(--sans); letter-spacing: -0.01em; }
.mb-read .cs-module-meta { display: block; margin-top: 3px; font-size: 12.5px; color: var(--quiet); }
.mb-read .cs-module-mark {
  flex: none; min-width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--rule-soft); font: 600 11px/1 var(--sans); color: var(--quiet); padding: 0 5px;
}
/* Finished is green, where you are is red, and everything else is a box. */
.mb-read .cs-module-card.is-done .cs-module-mark { background: var(--green); border-color: var(--green); color: #fff; font-size: 13px; }
.mb-read .cs-module-card.is-current { background: var(--red); border-color: var(--red); color: #fff; }
.mb-read .cs-module-card.is-current .cs-module-n,
.mb-read .cs-module-card.is-current .cs-module-meta { color: rgba(255,255,255,.88); }
.mb-read .cs-module-card.is-current .cs-module-mark { border-color: rgba(255,255,255,.7); color: #fff; font-size: 16px; }
.mb-read .cs-module-card.is-current:hover { background: var(--red-ink); }

/* Back out of a lesson to the grouped view. */
.mb-read .cs-up {
  order: 0; align-self: flex-start; margin-bottom: 10px; padding: 6px 0; background: none; border: 0;
  font: 500 10px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--quiet); cursor: pointer;
}
.mb-read .cs-up:hover { color: var(--red-ink); }

/* ---- AI Weekly (wireframes 10 and 11) ------------------------------------ */
.nl-status { text-align: right; flex: none; display: grid; gap: 2px; }
.nl-status > span { font: 500 9.5px/1.4 var(--mono); letter-spacing: 0.13em; text-transform: uppercase; color: var(--quiet); }
.nl-live, .nl-dead { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.nl-live { color: var(--green) !important; }
.nl-live i, .nl-dead i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: block; }
.nl-dead i { background: var(--quiet); }

/* The newest issue: the one black block, and there is only one. */
.nl-latest { background: var(--ink); color: var(--ground); padding: 18px 16px; }
.nl-latest-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0;
  font: 500 9.5px/1.4 var(--mono); letter-spacing: 0.13em; text-transform: uppercase; color: #9A9A9A; }
.nl-latest-top b { background: var(--red); color: #fff; padding: 3px 7px; font-weight: 500; }
.nl-latest-top em { margin-left: auto; font-style: normal; }
.nl-latest-title { font-size: clamp(22px, 4vw, 30px); line-height: 1.2; color: var(--ground); margin: 12px 0 0; font-weight: 500; }
.nl-latest-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.nl-latest-go .mb-btn { background: var(--ground); color: var(--ink); border-color: var(--ground); }
.nl-latest-go .mb-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }
.nl-latest-go span { font: 500 9.5px/1.4 var(--mono); letter-spacing: 0.13em; text-transform: uppercase; color: #9A9A9A; }

.nl-list { display: grid; }
.nl-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 14px 2px; border: 0; border-top: 1px solid var(--rule-soft); background: none; cursor: pointer; }
.nl-row:first-child { border-top: 0; }
.nl-row:hover { background: var(--hush); }
.nl-row-n { flex: none; font: 500 10px/1.6 var(--mono); letter-spacing: 0.08em; color: var(--red-ink); }
.nl-row-body { flex: 1; min-width: 0; }
.nl-row-title { display: block; font-size: 17px; line-height: 1.3; font-weight: 500; }
.nl-row-meta { display: block; margin-top: 3px; font: 500 9.5px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--quiet); }
.nl-read, .nl-unread { flex: none; font: 500 9.5px/1.6 var(--mono); letter-spacing: 0.13em; text-transform: uppercase; }
.nl-read { color: var(--green); }
.nl-unread { color: var(--red-ink); }

/* Reading one. */
.nl-up { padding: 6px 0; background: none; border: 0; cursor: pointer;
  font: 500 10px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--quiet); }
.nl-up:hover { color: var(--red-ink); }
.nl-title { font-size: clamp(26px, 5vw, 40px); line-height: 1.15; font-weight: 500; margin: 0; }
.nl-meta { margin: 8px 0 18px; font: 500 9.5px/1.4 var(--mono); letter-spacing: 0.13em; text-transform: uppercase; color: var(--quiet); }
/* The issue is the email that was sent, framed rather than poured into the
   page: it carries an email client's tables and inline styles, and those would
   fight every rule here. */
.nl-frame { width: 100%; min-height: 70vh; border: 1px solid var(--rule); background: var(--ground); display: block; }

/* ---- Account (wireframes 25–27) ------------------------------------------ */
.ac-orders { display: grid; gap: 10px; }
.ac-order { border: 1px solid var(--rule); padding: 14px; }
.ac-order-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0;
  font: 500 10px/1.4 var(--mono); letter-spacing: 0.08em; color: var(--quiet); }
.ac-order-top em { font-style: normal; letter-spacing: 0.13em; text-transform: uppercase; }
.ac-order-top em.is-paid { color: var(--green); }
.ac-order-top em.is-open { color: var(--red-ink); }
.ac-order-what { margin: 8px 0 12px; font: 700 15px/1.3 var(--sans); letter-spacing: -0.01em; }
.ac-order-what span { font-weight: 400; color: var(--quiet); }
.ac-order .mb-facts { margin-bottom: 0; }
.mb .mono, .mb-read .mono { font-family: var(--mono); }

/* ---- the diagnostic (wireframes 16–19) ----------------------------------- */
.mb .dg-wrap, .mb-read .dg-wrap { max-width: 640px; margin: 0 auto; padding: 26px 16px 70px; }
.dg-tag { display: inline-block; background: var(--ink); color: var(--ground); padding: 3px 7px; margin-right: 8px; letter-spacing: 0.12em; }
.dg-title {
  font: 900 clamp(28px, 6vw, 44px)/1.03 var(--sans); letter-spacing: -0.035em;
  text-transform: uppercase; margin: 8px 0 0; color: var(--ink);
}
.dg-title span { color: var(--red); }
.dg-lede { font-size: 17px; line-height: 1.5; color: var(--ink); margin: 0 0 24px; max-width: 46ch; }

/* How it goes: four steps, the one you are on in red. */
.dg-steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; }
.dg-steps li { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--rule); border-top-width: 0; }
.dg-steps li:first-child { border-top-width: 1px; }
.dg-steps b { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--rule); font: 600 12px/1 var(--sans); }
.dg-steps span { display: grid; }
.dg-steps strong { font: 700 15px/1.25 var(--sans); letter-spacing: -0.01em; }
.dg-steps em { font-style: normal; font-size: 12.5px; color: var(--quiet); margin-top: 2px; }
.dg-steps li.is-now { background: var(--red); border-color: var(--red); color: #fff; }
.dg-steps li.is-now b { border-color: rgba(255,255,255,.7); }
.dg-steps li.is-now em { color: rgba(255,255,255,.88); }

/* The form, the slots and the confirmation, squared off. */
.mb .dg-wrap h1, .mb-read .dg-wrap h1 { font: 900 clamp(24px, 5vw, 36px)/1.05 var(--sans); letter-spacing: -0.03em; text-transform: uppercase; }
.mb .dg-form, .mb-read .dg-form { display: grid; gap: 18px; margin-top: 20px; }
.mb .dg-wrap .field-label, .mb-read .dg-wrap .field-label {
  font: 700 14px/1.3 var(--sans); color: var(--ink); text-transform: none; letter-spacing: 0;
}
.mb .dg-wrap input, .mb .dg-wrap textarea, .mb .dg-wrap select,
.mb-read .dg-wrap input, .mb-read .dg-wrap textarea, .mb-read .dg-wrap select {
  border: 1px solid var(--rule); border-radius: 0; background: var(--ground);
  font: 400 15px/1.45 var(--sans); color: var(--ink); padding: 12px 13px; width: 100%;
}
.mb .dg-wrap input:focus, .mb .dg-wrap textarea:focus { outline: 2px solid var(--red); outline-offset: -2px; }

/* Multiple choice as chips, the way the wireframe draws them. */
.mb .dg-checks, .mb-read .dg-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.mb .dg-check, .mb-read .dg-check {
  display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--rule); border-radius: 0;
  padding: 9px 14px; font: 500 13.5px/1.2 var(--sans); cursor: pointer; background: var(--ground);
}
.mb .dg-check:hover { background: var(--hush); }
.mb .dg-check input, .mb-read .dg-check input { position: absolute; opacity: 0; width: 0; height: 0; padding: 0; }
.mb .dg-check:has(input:checked) { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.mb .dg-check:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }

.mb .dg-slots, .mb-read .dg-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 18px; }
.mb .dg-slot, .mb-read .dg-slot {
  padding: 14px 12px; border: 1px solid var(--rule); border-radius: 0; background: var(--ground);
  font: 500 14px/1.2 var(--sans); color: var(--ink); cursor: pointer;
}
.mb .dg-slot:hover, .mb-read .dg-slot:hover { background: var(--ink); color: var(--ground); }

.mb .dg-wrap .btn, .mb-read .dg-wrap .btn {
  border-radius: 0; font-family: var(--sans); font-weight: 600; padding: 14px 22px;
}
.mb .dg-wrap .btn-primary, .mb-read .dg-wrap .btn-primary { background: var(--ink); color: var(--ground); border: 1px solid var(--ink); }
.mb .dg-wrap .btn-primary:hover { background: var(--ground); color: var(--ink); }
.mb .dg-wrap .btn-secondary { background: var(--ground); color: var(--ink); border: 1px solid var(--rule); }
.mb .dg-wrap .badge, .mb-read .dg-wrap .badge {
  border-radius: 0; font: 500 9.5px/1.3 var(--mono); letter-spacing: 0.13em; text-transform: uppercase;
}
.mb .dg-wrap .badge-success { background: var(--green); color: #fff; }
.mb .dg-wrap .form-error { color: var(--red-ink); font-size: 13.5px; }

/* The Shelf paints a soft glow behind its pages with body::before, and wraps
   them in the marketing site's dark header. Neither belongs on a member
   screen: this design has no light source and its own navigation. */
/* Three of them: a glow on the body, a noise texture over it, and another
   glow behind the auth card. Specificity has to clear the body's own class. */
body.mb::before, body.mb::after,
body.mb-read::before, body.mb-read::after,
.mb .auth-main::before, .mb-read .auth-main::before,
.mb .site-header::after, .mb-read .site-header::after { display: none !important; content: none !important; }
.mb-read > header, .mb > header, body.mb-read > header {
  background: var(--ink); border-bottom: 0; box-shadow: none;
}
.mb-read > header a, .mb > header a { color: var(--ground); }
.mb-read > header a:hover, .mb > header a:hover { color: var(--red); }
.mb-read .nav-link, .mb .nav-link {
  font: 500 10px/1.2 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
}

/* A lesson's own front. Nothing is asked of the host until this is pressed. */
.mb-read .cs-frame { position: relative; background: #000; aspect-ratio: 16 / 9; display: block; }
.mb-read .cs-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.mb-read .cs-play {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; cursor: pointer;
  display: grid; place-content: center; justify-items: center; gap: 10px; color: #fff; padding: 20px;
}
.mb-read .cs-play:hover .cs-play-mark { background: var(--red-ink); transform: scale(1.04); }
.mb-read .cs-play-mark {
  width: 66px; height: 66px; display: grid; place-items: center; background: var(--red);
  color: #fff; font-size: 22px; line-height: 1; padding-left: 4px; transition: transform .15s, background .15s;
}
.mb-read .cs-play-word { font: 500 9.5px/1.3 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: #9A9A9A; }
.mb-read .cs-play-name { font: 700 16px/1.25 var(--sans); letter-spacing: -0.01em; text-align: center; max-width: 30ch; }

/* ---- the referral code --------------------------------------------------- */
.code-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin: 4px 0 16px; }
.code-value {
  flex: 1 1 220px; min-width: 0; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink); background: var(--hush); padding: 14px 16px;
  font: 600 22px/1.2 var(--mono); letter-spacing: 0.1em; color: var(--ink);
  user-select: all; overflow-wrap: anywhere;
}
.code-copy { flex: 0 0 auto; min-width: 110px; }
.code-steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink); }
.code-steps li::marker { color: var(--red-ink); font-weight: 700; }

/* ---- /welcome: the three questions after signup --------------------------- */
/* One question per screen, answers that advance themselves, and nothing that
   needs a keyboard until the optional step. The target is forty seconds. */
.wl { max-width: 620px; margin: 0 auto; padding: 28px 16px 64px; }
.wl-card { border: 1px solid var(--rule); background: var(--ground); padding: 22px 18px 26px; }
.wl-head h1 { font-size: clamp(22px, 5vw, 30px); line-height: 1.12; letter-spacing: -0.02em; margin: 6px 0 0; }
.wl-step { animation: wl-in .18s ease both; }
@keyframes wl-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .wl-step { animation: none; } }

.wl-dots { display: flex; gap: 6px; margin-bottom: 18px; }
.wl-dots i { height: 3px; flex: 1; background: var(--rule); }
.wl-dots i.is-now, .wl-dots i.is-done { background: var(--red); }
.wl-dots i.is-done { opacity: .45; }

.wl-field { display: block; margin-top: 20px; }
.wl-field > .mb-label { display: block; margin-bottom: 8px; }
.wl-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--quiet); }

.wl-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.wl-choice {
  border: 1px solid var(--rule); background: var(--ground); color: var(--ink);
  padding: 9px 13px; font: inherit; font-size: 14px; cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.wl-choice:hover { border-color: var(--ink); }
.wl-choice.is-on { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.wl-choices.is-tight .wl-choice { padding: 7px 11px; font-size: 13px; }

.wl-form { display: grid; gap: 2px; }
.wl-input {
  width: 100%; border: 1px solid var(--rule); background: var(--ground); color: var(--ink);
  padding: 10px 12px; font: inherit; font-size: 15px;
}
.wl-input:focus { outline: 2px solid var(--red); outline-offset: -2px; }
.wl-optional { margin: 0 0 4px; font-size: 13px; color: var(--quiet); }
/* Any button that follows an answer needs air, not only the one after a
   <form>. Without this the Continue on the first step sits flush against the
   last input and reads as part of it. */
.wl-form + .mb-btn,
.wl-field + .mb-btn,
.wl-choices + .mb-btn,
.wl-optional + .mb-btn { margin-top: 20px; }
.wl-skip {
  display: block; width: 100%; margin-top: 10px; padding: 10px;
  border: 0; background: none; color: var(--quiet); font: inherit; font-size: 14px; cursor: pointer;
}
.wl-skip:hover { color: var(--ink); text-decoration: underline; }
.wl-error { margin-top: 14px; font-size: 14px; color: var(--red-ink); }
.wl-done { text-align: center; padding: 12px 0 4px; }
.wl-done .mb-rule { margin-inline: auto; width: 56px; }
.wl-textarea { min-height: 112px; resize: vertical; line-height: 1.5; }

/* Member resources (/resources) */
.rs-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rs-card { border: 1px solid var(--rule); background: var(--ground); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.rs-title { margin: 2px 0 0; font-size: 21px; line-height: 1.2; }
.rs-desc { margin: 0; }
.rs-meta { margin: 0; font-size: 12px; color: var(--quiet); }
.rs-actions { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 10px; flex-wrap: wrap; }
.rs-link { font-size: 14px; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.nl-resources { margin-bottom: 18px; }

/* ---- the 500 AI Agents (/agents) ------------------------------------------ */
.ag-topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--ground); color: var(--ink); border-bottom: 1px solid var(--rule-soft); font: 800 19px/1 var(--sans); letter-spacing: -0.02em; }
.ag-topbar a { color: inherit; text-decoration: none; }
.ag-topbar a:last-child { font: 600 13px/1 var(--sans); letter-spacing: 0; }
.ag-public { max-width: 1040px; margin: 0 auto; padding: 22px 16px 60px; }
.ag-downloads { margin: 0 0 16px; border: 1px solid var(--rule); padding: 12px 14px; }
.ag-downloads summary { cursor: pointer; font: 600 14px/1.3 var(--sans); }
.ag-files { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 12px; }
.ag-select { flex: none; padding: 8px 10px; border: 1px solid var(--rule); background: var(--ground); font: 500 13px/1.2 var(--sans); color: var(--ink); }
.ag-count { margin: 14px 0 0; font-size: 13px; }
.ag-list { margin-top: 10px; display: grid; gap: 8px; }
.ag-row { display: flex; gap: 12px; border: 1px solid var(--rule); padding: 12px; }
.ag-row:hover { background: var(--hush); }
.ag-row-id { flex: none; width: 66px; font: 600 11px/1.6 var(--mono); color: var(--red-ink); letter-spacing: 0.06em; }
.ag-row-body { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.ag-row-title { font: 700 15px/1.25 var(--sans); letter-spacing: -0.01em; }
.ag-saved { font-style: normal; color: var(--red); margin-left: 6px; }
.ag-row-sub { font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.ag-row-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--quiet); margin-top: 3px; }
.ag-pill { display: inline-block; padding: 3px 8px; border: 1px solid var(--rule-soft); font: 500 11px/1.3 var(--sans); color: var(--ink); background: var(--ground); }
.ag-pill.is-red { border-color: var(--red); color: var(--red-ink); }
.ag-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ag-title { margin-top: 6px; }
.ag-promise { font: 400 18px/1.45 var(--serif); margin: 10px 0 0; max-width: 62ch; }
.ag-sec { margin-top: 18px; }
.ag-sec > p:not(.mb-label) { max-width: 62ch; }
.ag-sec .mb-label { margin-bottom: 6px; }
.ag-cols { display: grid; gap: 4px 28px; }
.ag-bullets { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.ag-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 10px; }
.ag-steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; }
.ag-steps li::before { content: counter(step); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 700 12px/1 var(--sans); }
.ag-steps li.is-human::before { background: var(--red); }
.ag-steps b { font: 600 14px/1.35 var(--sans); }
.ag-steps span { font-size: 13px; color: var(--quiet); }
.ag-h2 { margin-top: 34px; }
.ag-nums { display: grid; gap: 10px; margin-top: 14px; }
.ag-num { border: 1px solid var(--rule); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.ag-num b { font: 900 24px/1.15 var(--sans); letter-spacing: -0.02em; }
.ag-num-line { font: 600 13.5px/1.35 var(--sans); }
.ag-num-extra { font: 600 13.5px/1.35 var(--sans); color: var(--red-ink); }
.ag-num small { font-size: 12px; color: var(--quiet); line-height: 1.45; margin-top: 4px; }
.ag-why { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.ag-why b { display: block; font: 600 14px/1.35 var(--sans); }
.ag-why span { font-size: 13.5px; }
.ag-bands { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.ag-bands span { padding: 4px 8px; font: 600 11px/1.2 var(--sans); background: var(--hush); color: var(--quiet); }
.ag-bands span.is-fit { background: var(--ink); color: #fff; }
.ag-who { border-left: 3px solid var(--red); padding: 2px 0 2px 10px; margin-bottom: 10px; }
.ag-who p { margin: 2px 0; font-size: 13.5px; }
.ag-who small { font-size: 11.5px; color: var(--quiet); }
.ag-cta { margin-top: 30px; }
.ag-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.ag-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 30px; }
.ag-pager .mb-card + .mb-card { margin-top: 0; }
@media (min-width: 900px) {
  .ag-cols { grid-template-columns: 1fr 1fr; }
  .ag-cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ag-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ag-list { grid-template-columns: 1fr; }
}

/* ---- "Get this agent built" (/build) and My calls (/calls) ------------------ */
.bd-agent { margin-bottom: 18px; }
.bd-form, .cl-body .wl-form { max-width: 620px; display: grid; gap: 14px; }
.wl-field .mb-label { display: block; margin-bottom: 6px; }
.cl-cards { margin-top: 6px; }
.cl-card.is-booked { border-color: var(--red); }
.cl-body { margin-top: 6px; }
.cl-body .mb-btn { margin-top: 4px; }
.cl-slots { margin-top: 14px; display: grid; gap: 12px; }
.cl-day b { display: block; font: 600 13px/1.3 var(--sans); margin-bottom: 6px; }
.cl-times { display: flex; flex-wrap: wrap; gap: 6px; }
/* Choices built from real radio and checkbox inputs (the calls questions): the
   input stays for keyboards and screen readers, the chip shows its state. */
.wl-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wl-choice:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.wl-choice:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
.cl-card.is-wide { grid-column: 1 / -1; }
/* The audit opt-in at the end of profile setup: one clear tick box. */
.wl-optin { display: flex; gap: 12px; align-items: center; border: 1px solid var(--rule); padding: 14px 16px; margin: 18px 0 12px; font: 600 15px/1.35 var(--sans); cursor: pointer; }
.wl-optin input { width: 20px; height: 20px; accent-color: var(--red); flex: none; }
.wl-step .cl-times { margin-top: 8px; }

/* ---- the agent library: filters, "Runs in NexPMX", the "Start here" guide ---- */
/* The shell's one column could grow to fit a row of filter buttons that is meant
   to scroll sideways, which pushed the whole page wider than a phone. */
.mb-shell { grid-template-columns: minmax(0, 1fr); }
.ag-select.is-set { border-color: var(--ink); background: var(--ink); color: var(--ground); }
/* Four dropdowns: two by two on a phone, one row on a wider screen. */
.ag-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
.ag-selects .ag-select { width: 100%; min-width: 0; }
@media (min-width: 900px) { .ag-selects { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ag-pill.is-nexpmx { border-color: var(--green); color: var(--green); font-weight: 600; }
.ag-nexpmx { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 13.5px; }
.ag-nexpmx a { font-weight: 600; text-decoration: underline; }
.ag-guide-link { margin: 0 0 14px; }
.ag-guide-link h3 { font-size: 15px; }
.gd { max-width: 760px; }
.gd-steps { gap: 10px; }
.gd-bands { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 12px; }
.gd-bands .ag-num b { font-size: 18px; }
.gd-vol { margin-top: 22px; }
.gd-vol .mb-label { margin-bottom: 8px; }
.gd-agent { display: flex; gap: 12px; border: 1px solid var(--rule-soft); padding: 12px; }
.gd-agent + .gd-agent { border-top: 0; }
a.gd-agent:hover { background: var(--hush); }
.gd-print-only { display: none; }

/* The guide prints as a short PDF: no app chrome, no buttons, nothing split mid-agent. */
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  html, body { background: #fff !important; }
  .mb-top, .mb-rail, .mb-tabs, .ag-topbar, .skip-link, .ag-noprint, .mb-btn, button { display: none !important; }
  .mb-shell, .mb-body, .mb-main, .ag-public { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .gd { max-width: none; font-size: 11pt; }
  .gd h1 { font-size: 22pt; }
  .gd .ag-h2 { margin-top: 18px; font-size: 14pt; break-after: avoid; }
  .gd .ag-promise { font-size: 12pt; }
  .gd-agent, .gd-bands .ag-num, .gd-steps li { break-inside: avoid; }
  .gd-agent { padding: 8px 10px; }
  .gd-agent .ag-row-sub { font-size: 10pt; }
  .gd-vol { break-inside: auto; margin-top: 14px; }
  .gd-vol .mb-label { break-after: avoid; }
  .gd-print-only { display: block; font: 600 11pt/1.3 var(--mono); }
  .ag-cta { border: 1px solid #000; padding: 12px; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* The logo mark, as on the public site: a black tile with the red square. */
.mb-wordmark::before, .ag-topbar a:first-child::before {
  content: ""; display: inline-block; flex: none; width: 26px; height: 26px; margin-right: 10px; border-radius: 7px; vertical-align: middle;
  background: linear-gradient(var(--red), var(--red)) right 5px bottom 5px / 7px 7px no-repeat, var(--ink);
}
