/* portal.css — chrome for every portal page.
 *
 * book.css styles the chapter itself; this styles everything around it — the bar, the
 * shelf, the sign-in and devices pages. Split so the reading surface can be reworked
 * without touching the account pages, and vice versa.
 *
 * The palette is the site's (website/style.css), minus the scanline overlay and the
 * three radial gradients: fine for a landing page, punishing across a long chapter.
 */
:root {
  --bg:      #0a0612;
  --bg-2:    #120a24;
  --panel:   #16102b;
  --panel-2: #1d1538;
  --ink:     #f3edff;
  --muted:   #a89cc8;
  --line:    rgba(255, 255, 255, 0.08);

  --magenta: #ff3ea5;
  --cyan:    #2ff3ff;
  --yellow:  #ffd23f;
  --violet:  #9d4edd;
  --green:   #45f57a;

  --sans: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg), var(--bg-2)) fixed;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* ---- top bar ------------------------------------------------------------ */

.reader-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 24px;
  background: rgba(10, 6, 18, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.reader-bar .brand { color: var(--ink); text-decoration: none; font-weight: 700; }
.bar-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.bar-links a { color: var(--muted); text-decoration: none; }
.bar-links a:hover { color: var(--cyan); }
.bar-links .who { color: var(--muted); font-size: 13px; }
.bar-links .cta {
  color: var(--ink);
  border: 1px solid rgba(47, 243, 255, 0.45);
  border-radius: 7px;
  padding: 6px 13px;
  font-weight: 600;
}
form.inline { display: inline; margin: 0; }
form.inline button {
  font: 600 13px/1 var(--sans);
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 11px;
  cursor: pointer;
}
form.inline button:hover { color: var(--ink); border-color: rgba(255, 62, 165, 0.5); }

/* ---- generic page ------------------------------------------------------- */

.pad { max-width: 1000px; margin: 0 auto; padding: 44px 24px 90px; }
.pad.narrow { max-width: 620px; }
.pad h1, .shelf h1 { font-size: 32px; margin: 0 0 10px; letter-spacing: -0.4px; }
.sub { color: var(--muted); margin: 0 0 28px; line-height: 1.6; }
.sub a, .fine a { color: var(--cyan); }
.fine { color: var(--muted); font-size: 13px; line-height: 1.6; }

.ok, .bad {
  padding: 12px 16px;
  border-radius: 9px;
  margin: 0 0 22px;
  font-size: 14.5px;
}
.ok  { background: rgba(69, 245, 122, 0.09); border: 1px solid rgba(69, 245, 122, 0.35); color: #b6ffcd; }
.bad { background: rgba(255, 62, 165, 0.09); border: 1px solid rgba(255, 62, 165, 0.35); color: #ffc3e0; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  margin: 0 0 20px;
}
.card label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 7px; }
.card input[type=email], .card input[type=text] {
  width: 100%;
  font: 400 16px/1.4 var(--sans);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  margin: 0 0 16px;
}
.card input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.card button {
  font: 700 14.5px/1 var(--sans);
  color: #0a0612;
  background: var(--cyan);
  border: 0;
  border-radius: 8px;
  padding: 12px 20px;
  cursor: pointer;
}
.card button:hover { background: #7df8ff; }

/* The honeypot must be reachable by nobody and invisible to everybody — display:none
 * is what bots look for, so it is moved off-screen instead. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- the shelf ---------------------------------------------------------- */

.shelf { max-width: 1000px; margin: 0 auto; padding: 44px 24px 90px; }
.shelf details {
  border: 1px solid var(--line);
  border-radius: 11px;
  margin: 0 0 10px;
  background: var(--panel);
  overflow: hidden;
}
.shelf summary { cursor: pointer; padding: 14px 17px; font-weight: 700; }
.shelf summary::marker { color: var(--violet); }
.shelf summary:hover { background: var(--panel-2); }
.shelf ol { margin: 0; padding: 4px 18px 16px 42px; }
.shelf li { margin: 6px 0; }
.shelf a { color: var(--cyan); text-decoration: none; }
.shelf a:hover { text-decoration: underline; }
.shelf .n { color: var(--muted); font-size: 12.5px; margin-left: 9px; font-weight: 400; }
.shelf .owned {
  font: 700 10px/1 var(--sans);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid rgba(69, 245, 122, 0.4);
  border-radius: 999px;
  padding: 4px 9px;
  margin-left: 9px;
}

/* ---- devices ------------------------------------------------------------ */

.devices { list-style: none; margin: 0; padding: 0; }
.devices li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  margin: 0 0 10px;
}
.devices li > div:first-child { flex: 1; min-width: 0; }
.pill {
  font: 700 10px/1 var(--sans);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid rgba(47, 243, 255, 0.4);
  border-radius: 999px;
  padding: 4px 9px;
  margin-left: 8px;
}

/* ---- logs: downloads, and anything else that is a list of events --------- */

.log { width: 100%; border-collapse: collapse; margin: 0 0 18px; }
.log th {
  font: 700 10px/1 var(--sans);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0 12px 8px 0;
}
.log td {
  padding: 9px 12px 9px 0;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
/* The path is the wide column and the only one that can overflow; the rest stay put. */
.log td code { word-break: break-all; }
.log td:not(:first-child) { white-space: nowrap; width: 1%; }

/* The withdrawal agreement. Wide hit area, because a checkbox that is hard to tick is
 * a checkbox people tick by accident. */
.agree {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  margin: 0 0 14px;
  cursor: pointer;
}
.agree input { margin-top: 3px; flex: none; }


/* ---- the forum ----------------------------------------------------------- *
 *
 * The reading surface stays flat and quiet on purpose — the note at the top of this
 * file explains why the site's scanlines and radial washes are not on a chapter. The
 * forum is not a chapter. It is a browsing surface like the landing page, so it wears
 * the same clothes: the pixel typeface for kickers and headings, panels that are a
 * gradient rather than a flat fill, an accent stripe that lights on hover, and the
 * scanline overlay — all switched on by `body.arcade`, and reaching nothing else.
 */

/* html carries its own background, so body's does NOT propagate to the canvas — it
 * paints inside body's box and hides the layers below. The first version of this was
 * invisible for exactly that reason: the wash only showed in the strip BELOW the
 * content, which read as a seam across the page. */
body.arcade { background: none; }

body.arcade::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(circle at 20% 0%, rgba(157,78,221,0.22), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(47,243,255,0.12), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(255,62,165,0.15), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
/* Lighter than the landing page's. A forum is read, not only looked at. */
body.arcade::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 1px,
    transparent 1px, transparent 3px);
  opacity: 0.5;
}

.forum .kicker {
  font-family: var(--pixel);
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--cyan);
  display: block; margin-bottom: 14px;
}
.forum h1 {
  font-family: var(--pixel);
  font-size: clamp(17px, 3vw, 26px);
  line-height: 1.35;
  color: #fff;
  text-shadow: 2px 2px 0 var(--violet), 0 0 30px rgba(157,78,221,0.45);
  margin: 0 0 12px;
}
.forum h2 {
  font-family: var(--pixel);
  font-size: 13px; letter-spacing: 1px;
  color: #fff;
  margin: 34px 0 12px;
}
.fhead {
  display: flex; align-items: flex-start; gap: 22px;
  margin: 0 0 26px; flex-wrap: wrap;
}
.fhead > div:first-child { flex: 1; min-width: 240px; }
.fhead .sub { margin: 0; }
.crumbs { font-family: var(--pixel); font-size: 9px; letter-spacing: 1px; color: var(--muted); }
.crumbs a { color: var(--cyan); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* The site's primary button, verbatim, so the two cannot drift apart. */
.btn-primary {
  display: inline-block;
  font: 700 14px/1 var(--sans);
  text-decoration: none;
  color: #fff;
  padding: 13px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--magenta), var(--violet));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 8px 30px rgba(255,62,165,0.32);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2), 0 12px 38px rgba(255,62,165,0.48);
}

/* ---- the badge ----------------------------------------------------------- *
 * An initial in a colour derived from the name. Not an uploaded avatar: image upload
 * is a whole security surface — decoding, resizing, storage, and someone's idea of a
 * funny picture — for something a forum only needs in order to answer "is this the
 * same person as three posts up".
 */
.ava {
  flex: none;
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  font: 700 15px/1 var(--sans);
  color: #0a0612;
  background: linear-gradient(135deg, var(--a), rgba(255,255,255,0.85));
  box-shadow: 0 0 14px -2px var(--a), inset 0 0 0 1px rgba(255,255,255,0.25);
  vertical-align: middle;
}

/* The numbers strip. Four facts in pixel type, which is the site's voice, and enough
 * furniture that a young board reads as new rather than as abandoned. */
.fstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 0 0 30px;
}
.fstats > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(157,78,221,0.10), rgba(255,62,165,0.05));
  padding: 15px 17px;
}
.fstats b {
  display: block;
  font-family: var(--pixel);
  font-size: 16px;
  color: #fff;
  text-shadow: 0 0 18px rgba(47,243,255,0.5);
  margin-bottom: 8px;
  overflow: hidden; text-overflow: ellipsis;
}
.fstats span { font-size: 12px; color: var(--muted); letter-spacing: .4px; }
.fstats .wide { grid-column: span 2; }
@media (max-width: 620px) { .fstats .wide { grid-column: span 1; } }

/* The board's two-letter glyph — a cabinet marquee in miniature, in the board's own
 * accent, so the index scans as a row of machines rather than a list of links. */
.board-glyph {
  flex: none;
  display: grid; place-items: center;
  width: 54px; height: 54px;
  border-radius: 12px;
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--accent, var(--magenta));
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.30) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.25));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 22px -8px var(--accent, var(--magenta));
  text-shadow: 0 0 12px var(--accent, var(--magenta));
}
.board-meta { margin-top: 7px; opacity: .8; }

/* ---- the forum table ----------------------------------------------------- *
 *
 * A forum is a table and always has been: a column of names, a column of counts, a
 * column of "when did anything last happen". Cards floating one under another lose
 * that — nothing lines up, so nothing can be compared down a column, and the eye has
 * to re-find the numbers on every row.
 *
 * So: ONE bordered container with a header strip and divided rows. Grid rather than
 * <table>, because the first cell holds a glyph, a title, tags and a blurb, and a
 * table cell full of that is a fight; grid gives the column alignment without the
 * markup. `.board-grid` and `.thread-grid` define the columns, and the header uses
 * the same class as its rows, which is what keeps them lined up.
 */

.ftable {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  overflow: hidden;
  margin: 0 0 26px;
  box-shadow: 0 18px 46px rgba(0,0,0,0.35);
}

.ftable-head {
  font-family: var(--pixel);
  font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--cyan);
  background: linear-gradient(180deg, rgba(157,78,221,0.22), rgba(157,78,221,0.06));
  border-bottom: 1px solid var(--line);
  padding: 13px 18px;
}
/* The count columns read as headings for numbers, so they centre with them. */
.ftable-head > span:not(:first-child) { text-align: center; }
.ftable-head > span:last-child { text-align: right; }

.board-grid  { display: grid; grid-template-columns: 1fr 84px 84px 150px; gap: 16px; align-items: center; }
.thread-grid { display: grid; grid-template-columns: 1fr 84px 170px;      gap: 16px; align-items: center; }

.frow {
  position: relative;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background .13s ease;
}
.frow:last-child { border-bottom: 0; }
.frow:hover { background: rgba(255,255,255,0.035); }

/* The accent stripe lives on the row, not on a card, so a board is identifiable at a
 * glance without breaking the block into pieces. */
a.frow::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent, var(--magenta));
  box-shadow: 0 0 14px var(--accent, var(--magenta));
}
.frow.pinned { background: rgba(255,210,63,0.05); }
.frow.gone { opacity: 0.5; }

.frow-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.frow-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.frow-t > b { font-size: 16px; }
.frow-t .fine { line-height: 1.45; }
.frow-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.frow-title a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15.5px; }
.frow-title a:hover { color: var(--cyan); }
.frow-t > a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15.5px; }
.frow-t > a:hover { color: var(--cyan); }

.frow-n {
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--accent, var(--cyan));
  text-align: center;
}
.frow-last { text-align: right; line-height: 1.5; }
.frow-last .by { display: block; }

.frow-empty { padding: 34px 20px; text-align: center; }
.frow-empty p { margin: 0 0 12px; }

/* Below the counts the columns stop being useful and start being clutter. */
@media (max-width: 760px) {
  .board-grid  { grid-template-columns: 1fr 60px; }
  .thread-grid { grid-template-columns: 1fr 60px; }
  .board-grid > :nth-child(3), .board-grid > :nth-child(4),
  .thread-grid > :nth-child(3) { display: none; }
}

/* ---- posts --------------------------------------------------------------- */

.post {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  padding: 18px 20px;
  margin: 0 0 14px;
  overflow: hidden;
}
.post::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: rgba(157,78,221,0.55);
}
.post > header { display: flex; align-items: center; gap: 11px; margin: 0 0 14px; }
.post > header b { font-size: 15px; }
.post > header a { color: var(--muted); text-decoration: none; }
.post-body { line-height: 1.65; }
.post-body p { margin: 0 0 12px; }
.post-body p:last-child { margin-bottom: 0; }
.post-body code {
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 13.5px;
}
/* Code blocks scroll inside the post. A long line in someone's paste must not widen
 * the page for every reader of the thread. */
.post-body pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px 15px;
  overflow-x: auto;
  margin: 0 0 12px;
}
.post-body pre code { background: none; border: 0; padding: 0; }
.post-body .quote {
  display: block;
  border-left: 3px solid var(--violet);
  padding-left: 11px;
  color: var(--muted);
}
.post-body a { color: var(--cyan); }

/* Your own messages lean the other way and take the cyan edge. In a conversation
 * between exactly two people, that is the only cue needed. */
.post.dm { margin-right: 40px; }
.post.dm.mine { margin-left: 40px; margin-right: 0; }
.post.dm.mine::before { background: rgba(47,243,255,0.6); }

.who-link { color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(157,78,221,.5); }
.who-link:hover { color: var(--cyan); border-color: var(--cyan); }
.who-plain { color: var(--muted); }
.sig {
  margin-top: 14px; padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px;
}
.sig a { color: var(--muted); }
.profile-head { align-items: center; }
.profile-head .ava { width: 60px; height: 60px; border-radius: 14px; font-size: 24px; }
ul.plain { list-style: none; margin: 0 0 22px; padding: 0; }
ul.plain li { padding: 12px 0; border-top: 1px solid var(--line); }
ul.plain a { color: var(--cyan); text-decoration: none; }
ul.plain a:hover { text-decoration: underline; }
.excerpt { margin-top: 4px; opacity: 0.75; }
.log tr.unread td a { font-weight: 700; }
.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan); margin-right: 7px; vertical-align: middle;
  box-shadow: 0 0 10px var(--cyan);
}

/* ---- forum forms: composing, reporting, moderating ----------------------- */

.composer textarea, .composer input[type=text] {
  width: 100%;
  font: 400 15px/1.55 var(--sans);
  color: var(--ink);
  background: rgba(0,0,0,0.32);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  margin: 0 0 6px;
}
.composer textarea:focus, .composer input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
/* Monospace, because most of what gets pasted into a forum attached to an engine book
 * is code. */
.composer textarea {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 13.5px;
  resize: vertical;
}
.composer .fine { margin: 0 0 14px; }
.composer select {
  font: 400 14px/1 var(--sans); color: var(--ink); background: rgba(0,0,0,0.32);
  border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; margin: 0 0 12px;
}
.composer button {
  font: 700 14px/1 var(--sans);
  color: #fff;
  background: linear-gradient(135deg, var(--magenta), var(--violet));
  border: 0;
  border-radius: 11px;
  padding: 13px 20px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 8px 26px rgba(255,62,165,0.28);
  transition: transform .12s ease, box-shadow .12s ease;
}
.composer button:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,255,255,0.2), 0 12px 34px rgba(255,62,165,0.45); }
.post .composer { margin-top: 4px; }

/* A disabled submit has to LOOK unavailable, or the page reads as broken rather than
 * as waiting for something. */
.card button:disabled, .composer button:disabled {
  background: var(--panel-2);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.card button:disabled:hover, .composer button:disabled:hover {
  background: var(--panel-2); transform: none; box-shadow: none;
}

/* Post actions sit right, quiet, and appear only on posts you may act on. A delete
 * button styled like a button invites the accident. */
.post-acts { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.post-acts a, .post-acts button {
  font: 500 12.5px/1 var(--sans);
  color: var(--muted);
  background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none;
}
.post-acts a:hover, .post-acts button:hover { color: var(--magenta); }

/* The report form hides inside a disclosure, so the control is one word until it is
 * wanted. A text box sitting open under every post invites use. */
.reportbox summary { cursor: pointer; color: var(--muted); font-size: 12.5px; list-style: none; }
.reportbox summary::-webkit-details-marker { display: none; }
.reportbox summary:hover { color: var(--magenta); }
.reportbox form { display: flex; gap: 7px; margin-top: 8px; }
.reportbox input[type=text] {
  font: 400 13px/1.4 var(--sans);
  color: var(--ink);
  background: rgba(0,0,0,0.32);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  min-width: 230px;
}
.reportbox button {
  font: 600 12.5px/1 var(--sans);
  color: var(--ink); background: none;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer;
}

/* Moderator controls are yellow and dashed everywhere they appear, so it is never a
 * surprise which buttons act on other people's writing. */
.modbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  border: 1px dashed rgba(255,210,63,.35);
  border-radius: 11px;
  padding: 11px 14px;
  margin: 0 0 18px;
}
.modbar button {
  font: 600 12.5px/1 var(--sans);
  color: var(--yellow); background: none;
  border: 1px solid rgba(255,210,63,.35); border-radius: 8px;
  padding: 8px 12px; cursor: pointer;
}
.modbar button:hover { background: rgba(255,210,63,.1); }

/* The moderation queue. Deliberately plain — a queue is a place to make decisions
 * quickly, not a dashboard. */
.report .reason { margin: 9px 0 11px; font-style: italic; }
.report .quoted {
  border-left: 3px solid var(--line);
  padding-left: 14px;
  max-height: 240px;
  overflow: auto;
}
.report .acts { display: flex; align-items: center; gap: 14px; margin-top: 15px; flex-wrap: wrap; }
.report .acts form { display: flex; gap: 8px; margin-left: auto; }
.report .acts button {
  font: 600 13px/1 var(--sans);
  color: var(--ink); background: none;
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; cursor: pointer;
}
.report .acts button:hover { border-color: rgba(255,62,165,.5); }

.inline-check {
  display: inline-flex !important; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--muted); margin: 0 !important;
}
.rowform select {
  font: 400 13px/1 var(--sans); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px;
}

/* A board someone cannot open yet. Gold rather than red — it is an invitation, not
 * an error. */
.locked-board { border-color: rgba(255,210,63,0.3); }
.tag.gold-tag { color: var(--yellow); border-color: rgba(255,210,63,.45); }

/* ---- reactions ----------------------------------------------------------- *
 * Positive only, so there is no "down" state to design — a reaction is either given
 * or not, and the given one lights up in the site's cyan.
 */
.reacts { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.react {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 13px/1 var(--sans);
  color: var(--muted);
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  cursor: pointer;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.react:hover { color: var(--ink); border-color: rgba(47,243,255,0.45); }
.react.on {
  color: var(--cyan);
  border-color: rgba(47,243,255,0.55);
  background: rgba(47,243,255,0.10);
  box-shadow: 0 0 14px -4px var(--cyan);
}
/* A reaction nobody has given yet is offered, not advertised. */
.react.zero { opacity: 0.42; }
.react.zero:hover { opacity: 1; }
.react.static { cursor: default; }
.react.static:hover { color: var(--muted); border-color: var(--line); }
.profile-reacts { margin: 0 0 20px; }

/* ---- pricing ------------------------------------------------------------ */

.tiers { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tier {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 22px;
  display: flex;
  flex-direction: column;
}
.tier.featured { border-color: rgba(47, 243, 255, 0.45); }
.tier h2 { font-size: 19px; margin: 0 0 4px; }
.tier .price { font-size: 30px; font-weight: 900; margin: 8px 0 14px; }
.tier ul { margin: 0 0 20px; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.tier .buy {
  margin-top: auto;
  display: block;
  text-align: center;
  font-weight: 700;
  text-decoration: none;
  color: #0a0612;
  background: var(--cyan);
  border-radius: 8px;
  padding: 12px;
}
.tier:not(.featured) .buy { background: transparent; color: var(--ink); border: 1px solid var(--line); }

/* ---- footer ------------------------------------------------------------- */

.portal-foot {
  border-top: 1px solid var(--line);
  padding: 26px 24px 50px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.portal-foot a { color: var(--muted); }

@media (max-width: 720px) {
  .reader-bar { padding: 10px 14px; gap: 10px; }
  .bar-links { gap: 11px; }
  .bar-links .who { display: none; }
  .pad, .shelf { padding: 30px 16px 70px; }
}

/* ---- ads (free tier only) ------------------------------------------------ */

/* Members never receive this markup at all, so there is nothing to un-hide and no
 * third-party request made on their behalf. */
.ad {
  display: block;
  max-width: 96ch;
  margin: 22px auto 0;
  min-height: 90px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad-placeholder { color: var(--muted); font-size: 13px; letter-spacing: 0.3px; }
.ad-placeholder a { color: var(--cyan); }

.tier-note.subtle {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 13.5px;
}
.tier-note.subtle a { color: var(--cyan); font-weight: 600; }

.shelf .members {
  font: 700 10px/1 var(--sans);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--yellow);
  border: 1px solid rgba(255, 210, 63, 0.4);
  border-radius: 999px;
  padding: 4px 9px;
  margin-left: 9px;
}

/* ---- showcase (members-only volumes) ------------------------------------- */

.showcase .kicker {
  font: 700 11px/1 var(--sans);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 12px;
}
.showcase .tagline { font-size: 19px; color: var(--ink); margin: 0 0 18px; line-height: 1.5; }
.showcase-video { margin: 0 0 26px; }
.video-link {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  color: #0a0612;
  background: var(--yellow);
  border-radius: 9px;
  padding: 12px 20px;
}
.shots { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin: 0 0 26px; }
.shots figure { margin: 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--panel); }
.shots img { display: block; width: 100%; height: auto; }
.shots figcaption { padding: 10px 13px; font-size: 13px; color: var(--muted); }
.showcase-points { margin: 0 0 30px; padding-left: 20px; color: #ded6f2; line-height: 1.8; }
.showcase-cta { border-top: 1px solid var(--line); padding-top: 22px; }
.showcase-cta .buy {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  color: #0a0612;
  background: var(--cyan);
  border-radius: 9px;
  padding: 12px 22px;
  margin: 6px 0 14px;
}

/* A members-only volume on the shelf is a link to its pitch, not a collapsed list. */
.shelf .volume {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 17px;
  border: 1px solid rgba(255, 210, 63, 0.3);
  border-radius: 11px;
  background: var(--panel);
  margin: 0 0 10px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.shelf .volume:hover { background: var(--panel-2); border-color: rgba(255, 210, 63, 0.55); }

.tier .price .per { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 2px; }

.convert {
  margin: 30px 0 0;
  padding: 22px 24px;
  border: 1px solid rgba(69, 245, 122, 0.3);
  background: rgba(69, 245, 122, 0.06);
  border-radius: 12px;
}
.convert h2 { font-size: 18px; margin: 0 0 8px; }
.convert p { color: #ded6f2; margin: 0 0 8px; line-height: 1.65; }
.convert .fine { color: var(--muted); }

/* A button-shaped link, wherever it appears. It was only ever styled inside .tier and
 * .showcase-cta, so the simulator's buttons rendered as bare blue links. */
.buy {
  display: inline-block;
  text-align: center;
  font-weight: 700;
  text-decoration: none;
  color: #0a0612;
  background: var(--cyan);
  border-radius: 8px;
  padding: 11px 18px;
}
.buy:hover { background: #7df8ff; }

/* ---- dev simulator bar --------------------------------------------------- */

/* Loud on purpose. A simulated tier that looks like production is how you end up
 * debugging a bug that was never there. */
.devbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 7px 24px;
  background: repeating-linear-gradient(-45deg, #2a1c00 0 12px, #221700 12px 24px);
  border-bottom: 1px solid rgba(255, 210, 63, 0.4);
  color: var(--yellow);
  font: 600 12px/1.4 var(--sans);
  position: sticky;
  top: 0;
  z-index: 30;
}
.devbar b { letter-spacing: 1px; }
.devbar-links { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.devbar-links a {
  color: var(--yellow);
  text-decoration: none;
  border: 1px solid rgba(255, 210, 63, 0.35);
  border-radius: 6px;
  padding: 3px 9px;
}
.devbar-links a:hover { background: rgba(255, 210, 63, 0.15); color: #fff; }

/* ---- admin --------------------------------------------------------------- */

.admin .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.admin .stats div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 14px 15px;
}
.admin .stats b { display: block; font-size: 22px; font-weight: 900; }
.admin .stats span { font-size: 12px; color: var(--muted); }
.admin h2 { font-size: 19px; margin: 30px 0 12px; }
.admin .acct h3 { margin: 0 0 4px; font-size: 17px; }
.admin table { width: 100%; border-collapse: collapse; margin: 14px 0 0; font-size: 14px; }
.admin table th {
  text-align: left; vertical-align: top; width: 130px;
  color: var(--muted); font-weight: 600; padding: 7px 10px 7px 0;
}
.admin table td { padding: 7px 0; vertical-align: top; }
.admin .stale { color: var(--magenta); }
.admin .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 0; }
.admin .actions input[type=text] {
  font: 400 13px/1.4 var(--sans); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; margin: 0;
}
.admin .actions button {
  font: 700 13px/1 var(--sans); color: #0a0612; background: var(--cyan);
  border: 0; border-radius: 7px; padding: 9px 14px; cursor: pointer;
}
.admin .actions button.danger { background: transparent; color: var(--magenta); border: 1px solid rgba(255,62,165,.5); }
.admin .actions button.danger:hover { background: rgba(255,62,165,.12); }
.admin table.audit th, .admin table.audit td { padding: 5px 12px 5px 0; width: auto; }

/* ---- house promotion ----------------------------------------------------- */

.ad-house {
  padding: 14px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.ad-house b { color: var(--ink); }
.ad-house a { color: var(--cyan); font-weight: 600; text-decoration: none; white-space: nowrap; }
.ad-house a:hover { text-decoration: underline; }

/* The periodic nudge. Corner card, never a modal: it must not cover the text or take
 * the keyboard, because interrupting someone mid-paragraph is how you get dismissed
 * permanently instead of read. */
.promo-card {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: min(340px, calc(100vw - 40px));
  padding: 20px 22px 22px;
  background: var(--panel);
  border: 1px solid rgba(47, 243, 255, 0.35);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.promo-card.is-on { opacity: 1; transform: none; pointer-events: auto; }
.promo-card h3 { margin: 0 0 8px; font-size: 17px; }
.promo-card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.promo-card .buy { padding: 10px 16px; font-size: 14px; }
.promo-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}
.promo-close:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .promo-card { transition: none; }
}
@media (max-width: 560px) {
  .promo-card { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

/* ---- the sign-in wall ---------------------------------------------------- */

.wall .kicker {
  font: 700 11px/1 var(--sans);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 12px;
}
.wall-points { list-style: none; margin: 0 0 20px; padding: 0; }
.wall-points li {
  padding: 0 0 0 26px;
  margin: 0 0 10px;
  position: relative;
  color: #ded6f2;
  font-size: 14.5px;
  line-height: 1.6;
}
.wall-points li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--cyan);
}
.wall-points b { color: var(--ink); }

.card label.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: #ded6f2;
  margin: -6px 0 16px;
  cursor: pointer;
}
.card label.check input { width: auto; margin: 0; }

/* The admin link only exists for admins, so it is allowed to look different. */
.bar-links .admin-link {
  color: var(--yellow);
  border: 1px solid rgba(255, 210, 63, 0.4);
  border-radius: 7px;
  padding: 5px 11px;
  font-weight: 600;
}
.bar-links .admin-link:hover { background: rgba(255, 210, 63, 0.12); color: #fff; }

/* ---- admin: health, feeds, announce -------------------------------------- */

.admin .stats b.warn { color: var(--magenta); }
.admin .stats b.good { color: var(--green); }
.admin .stats.health div { border-color: rgba(157, 78, 221, 0.28); }

.admin .cols { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.admin .feed div { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.admin .feed div:last-child { border-bottom: 0; }
.admin .feed a { color: var(--cyan); text-decoration: none; }
.admin .feed a:hover { text-decoration: underline; }
.admin .feed .when { float: right; color: var(--muted); font-size: 12.5px; }
.admin .tag, .forum .tag {
  font: 600 10.5px/1 var(--sans);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  margin-left: 6px;
  color: var(--muted);
}
.admin .tag.admin-tag, .forum .tag.admin-tag { color: var(--yellow); border-color: rgba(255,210,63,.4); }
.admin .tag.warn-tag, .forum .tag.warn-tag { color: var(--magenta); border-color: rgba(255,62,165,.4); }
.admin .pill.list { color: var(--green); border-color: rgba(69,245,122,.4); }

/* Destructive actions sit apart, behind a typed confirmation, so nothing there is one
 * stray click from happening. */
.admin .danger-zone {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.admin .rowform {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.admin .rowform button {
  font: 600 12px/1 var(--sans);
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
  cursor: pointer;
}
.admin .rowform button:hover { color: var(--ink); border-color: rgba(255,62,165,.5); }

.admin textarea {
  width: 100%;
  font: 400 14px/1.6 ui-monospace, Consolas, monospace;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  margin: 0 0 16px;
  resize: vertical;
}
.mailprev { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 16px; overflow: hidden; }
.mailprev-h { padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.mailprev pre { margin: 0; padding: 14px; white-space: pre-wrap; font: 400 13.5px/1.6 var(--sans); color: #ded6f2; }
.mailprev .fine { padding: 0 14px 12px; }

/* ---- admin: the account list --------------------------------------------- */

.admin .searchbar { display: flex; gap: 10px; align-items: center; padding: 14px 16px; }
.admin .searchbar input[type=text] { flex: 1; margin: 0; }
.admin .searchbar button { white-space: nowrap; }

.admin table.accounts { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin table.accounts th {
  text-align: left;
  width: auto;
  font: 700 11px/1 var(--sans);
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--line);
}
.admin table.accounts td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin table.accounts tr:last-child td { border-bottom: 0; }
.admin table.accounts tr.open td { background: rgba(47, 243, 255, 0.06); }
.admin table.accounts a { color: var(--cyan); text-decoration: none; }
.admin table.accounts a:hover { text-decoration: underline; }

/* Tier at a glance — the column you scan down, so it carries the colour. */
.tier-free     { color: var(--muted); }
.tier-member   { color: var(--cyan); font-weight: 600; }
.tier-lifetime { color: var(--green); font-weight: 700; }
.tier-lapsed   { color: var(--magenta); }

.admin .pager, .forum .pager { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 0; }
.admin .pager a, .forum .pager a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 13px;
}
.admin .pager a.on, .forum .pager a.on { color: #0a0612; background: var(--cyan); border-color: var(--cyan); font-weight: 700; }
.admin .pager a:hover:not(.on), .forum .pager a:hover:not(.on) { color: var(--ink); }

/* ---- chapter source bundle ----------------------------------------------- */

.bundle-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  max-width: 96ch;
  margin: 18px auto 0;
  padding: 12px 18px;
  border: 1px solid rgba(69, 245, 122, 0.35);
  background: rgba(69, 245, 122, 0.07);
  border-radius: 10px;
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
  font-size: 14.5px;
}
.bundle-link:hover { background: rgba(69, 245, 122, 0.14); }
.bundle-link span { color: var(--muted); font-weight: 400; font-size: 13px; }
.bundle-link.locked {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 400;
}
.bundle-link.locked a { color: var(--cyan); font-weight: 600; }

/* ---- chapter comments ------------------------------------------------------ */

.comments { margin-top: 36px; border-top: 1px solid var(--line); padding-top: 18px; }
.comments h2 { margin-top: 0; }
.comments .composer { margin-top: 14px; }

/* ---- book search ---------------------------------------------------------- */

.shelf-search { display: flex; gap: 8px; margin: 0 0 22px; max-width: 520px; }
.shelf-search input { flex: 1; }
.search-results .result { border-top: 1px solid var(--line); padding: 14px 0 10px; }
.search-results .result-head { font-weight: 600; }
.search-results mark {
  background: rgba(69, 245, 122, 0.22);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

/* ---- forum post image attachments ---------------------------------------- */

.post-imgs { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.post-imgs a { display: block; max-width: 320px; }
.post-imgs img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
}
