/* PipingInspector certification app — loaded alongside course.css. */

:root {
  --ink: #1c1917;
  --muted: #57534e;
  --faint: #78716c;
  --line: #e7e5e4;
  --paper: #faf9f7;
  --card: #fff;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --sidebar: #1c1917;
}

body { margin: 0; background: var(--paper); color: var(--ink); }

/* ---------------------------------------------------------------- app chrome */

.appbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.75rem 1.25rem;
  background: var(--sidebar); color: #f5f5f4;
}
.appbar__brand { display: flex; align-items: baseline; gap: 0.5rem; color: inherit; text-decoration: none; }
.appbar__brand strong { font-size: 1.02rem; }
.appbar__brand span { color: #a8a29e; font-size: 0.82rem; }
.appbar__nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.appbar__nav a { color: #e7e5e4; text-decoration: none; font-size: 0.9rem; }
.appbar__nav a:hover { color: #fff; text-decoration: underline; }
.appbar__logout { margin: 0; }
.appbar__logout button {
  background: none; border: 1px solid #57534e; color: #e7e5e4;
  padding: 0.3rem 0.7rem; border-radius: 5px; font: inherit; font-size: 0.85rem; cursor: pointer;
}
.appbar__logout button:hover { border-color: #a8a29e; color: #fff; }

.appmain { min-height: 60vh; }
.appfoot {
  border-top: 1px solid var(--line); margin-top: 3rem;
  padding: 1.25rem; color: var(--faint); font-size: 0.82rem; line-height: 1.6;
}
.appfoot p { max-width: 52rem; margin: 0 auto; }

.wrap { max-width: 56rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.is-centred .appmain { display: flex; align-items: flex-start; justify-content: center; padding: 3rem 1.25rem; }

h1 { font-size: 1.7rem; margin: 0 0 0.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 0 0 0.7rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hint { color: var(--faint); font-size: 0.82rem; margin: 0.3rem 0 0; }
.crumbs { font-size: 0.85rem; color: var(--faint); margin-bottom: 1rem; }
.crumbs a { color: inherit; }

/* ---------------------------------------------------------------- panels */

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 1.35rem 1.4rem; margin: 1.25rem 0;
}
.panel--narrow { max-width: 25rem; width: 100%; }
.panel--quiet { background: #f5f5f4; }
.panel--alert { border-left: 4px solid var(--teal); background: #f0fdfa; }
.panel p { color: var(--muted); max-width: 44rem; line-height: 1.65; }

/* ---------------------------------------------------------------- forms */

.form { display: grid; gap: 0.35rem; margin: 1rem 0 0; }
.form label { font-weight: 600; font-size: 0.88rem; margin-top: 0.6rem; }
.form input[type=text], .form input[type=email], .form input[type=password], .form select {
  padding: 0.55rem 0.65rem; border: 1px solid #d6d3d1; border-radius: 6px;
  font: inherit; background: #fff; max-width: 100%;
}
.form input:focus, .form select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.form--inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; }
.form--inline label { margin: 0; width: 100%; }

.btn {
  display: inline-block; padding: 0.55rem 1rem; border-radius: 6px;
  border: 1px solid #d6d3d1; background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: #a8a29e; }
.btn--primary { background: var(--teal); border-color: var(--teal); color: #fff; margin-top: 1rem; }
.btn--primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn--small { padding: 0.3rem 0.6rem; font-size: 0.82rem; font-weight: 500; }

.checks { border: 1px solid var(--line); border-radius: 6px; padding: 0.8rem 0.9rem; margin: 1rem 0 0; }
.checks legend { font-weight: 600; font-size: 0.88rem; padding: 0 0.3rem; }
.check { display: flex; gap: 0.5rem; align-items: baseline; margin: 0.35rem 0; font-weight: 400; }
.check em { color: var(--faint); font-style: normal; font-size: 0.85rem; }

.flash { padding: 0.65rem 0.85rem; border-radius: 6px; margin: 0.9rem 0; font-size: 0.9rem; }
.flash--error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.flash--ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.flash--warn  { background: #fffbeb; border: 1px solid #fde68a; color: #854d0e; }

/* ---------------------------------------------------------------- cards */

.cardlist { list-style: none; margin: 1.25rem 0; padding: 0; display: grid; gap: 0.85rem; }

/* Catalogue shelf heading: Foundation Courses / Exam Preparation / Interview
   Preparation. Only shown when a learner owns things from more than one. */
.shelf-head {
  margin: 1.75rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted, #6b7280);
}
.shelf-head:first-of-type { margin-top: 0.5rem; }
.card__link {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1.1rem 1.2rem;
}
.card__link:hover { border-color: var(--teal); }
.card__eyebrow { margin: 0 0 0.25rem; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--teal); }
.card__title { margin: 0 0 0.5rem; font-size: 1.1rem; }
.card__meta { margin: 0 0 0.4rem; color: var(--muted); font-size: 0.87rem; }
.card__cert { margin: 0.4rem 0 0; color: var(--good); font-weight: 600; font-size: 0.87rem; }
.card__expiry { margin: 0.35rem 0 0; color: var(--faint); font-size: 0.83rem; }
.card__expiry--soon { color: var(--warn); font-weight: 600; }

.bar { height: 6px; border-radius: 99px; background: #e7e5e4; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--teal); }
.bar--wide { margin: 0.6rem 0 0.8rem; }

/* ---------------------------------------------------------------- module list */

.modlist { list-style: none; margin: 1.25rem 0; padding: 0; display: grid; gap: 0.5rem; }
.mod__link {
  display: grid; gap: 0.2rem; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: 0.85rem 1rem;
}
.mod__link:hover { border-color: var(--teal); }
.mod__n { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--teal); }
.mod__title { font-size: 1rem; }

.tag {
  display: inline-block; font-size: 0.76rem; padding: 0.14rem 0.45rem;
  border-radius: 99px; background: #f5f5f4; border: 1px solid var(--line); color: var(--muted);
}
.tag--pass { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.tag--try  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.tag--new  { background: #fff; }

.cert-issued { color: var(--good); font-weight: 600; }

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

.admintable { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.admintable th, .admintable td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.admintable th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; padding: 0 0 0 0.2rem; }
.cred { border-collapse: collapse; margin: 0.6rem 0; font-size: 0.9rem; }
.cred th { text-align: left; padding: 0.3rem 0.9rem 0.3rem 0; color: var(--faint); font-weight: 600; white-space: nowrap; }
.pw { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.04em; background: #fff; padding: 0.15rem 0.45rem; border-radius: 4px; border: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }

/* ---------------------------------------------------------------- gated pages */

.gatebar {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding: 0.5rem 1rem; background: var(--sidebar); color: #e7e5e4; font-size: 0.85rem;
}
.gatebar a { color: #fff; text-decoration: none; }
.gatebar a:hover { text-decoration: underline; }
.gatebar__who { margin-left: auto; color: #a8a29e; }

.gatemark {
  padding: 1rem 1.25rem; text-align: center;
  color: var(--faint); font-size: 0.76rem; border-top: 1px solid var(--line);
}

.gate-exam {
  border: 1px solid var(--line); border-left: 4px solid var(--teal);
  background: #f0fdfa; border-radius: 6px; padding: 1rem 1.2rem; margin: 1rem 0;
}
.gate-exam p { margin: 0 0 0.6rem; }
.gate-exam p:last-child { margin: 0; }

@media (max-width: 640px) {
  .wrap { padding: 1.5rem 1rem 2.5rem; }
  .appbar { padding: 0.65rem 1rem; }
  .appbar__nav { gap: 0.75rem; width: 100%; margin-left: 0; }
  .gatebar__who { display: none; }
}

/* ---------------------------------------------------------------- exam */

.exam__list { list-style: none; margin: 1.25rem 0; padding: 0; display: grid; gap: 0.85rem; counter-reset: none; }
.exam__q fieldset {
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  padding: 1rem 1.15rem; margin: 0;
}
.exam__q legend { display: flex; gap: 0.6rem; align-items: baseline; font-weight: 600; padding: 0 0.3rem; line-height: 1.45; }
.exam__n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.5rem; height: 1.5rem; border-radius: 99px;
  background: var(--teal); color: #fff; font-size: 0.78rem; flex-shrink: 0;
}
.exam__opt {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.5rem 0.6rem; margin-top: 0.3rem;
  border: 1px solid transparent; border-radius: 6px; cursor: pointer; line-height: 1.5;
}
.exam__opt:hover { background: #f5f5f4; border-color: var(--line); }
.exam__opt input { margin-top: 0.25rem; flex-shrink: 0; }
.exam__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 1.5rem 0; }
.exam__actions .btn--primary { margin-top: 0; }

/* ---------------------------------------------------------------- review */

.panel--pass { border-left: 4px solid var(--good); background: #f0fdf4; }
.panel--fail { border-left: 4px solid var(--warn); background: #fffbeb; }
.bigscore { font-size: 2rem; font-weight: 800; margin: 0.2rem 0; color: var(--ink); }
.section-head { margin: 2rem 0 0.8rem; font-size: 1.1rem; }

.review { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.review__q {
  border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 8px; background: var(--card); padding: 1rem 1.15rem;
}
.review__q.is-right { border-left-color: var(--good); }
.review__q.is-wrong { border-left-color: var(--bad); }
.review__text { font-weight: 600; margin: 0 0 0.6rem; line-height: 1.5; }
.review__opts { list-style: none; margin: 0 0 0.6rem; padding: 0; display: grid; gap: 0.25rem; }
.review__opts li { padding: 0.4rem 0.6rem; border-radius: 5px; border: 1px solid transparent; line-height: 1.5; }
.opt--right { background: #f0fdf4; border-color: #bbf7d0; }
.opt--picked { background: #fef2f2; border-color: #fecaca; }
.mark { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; color: var(--good); margin-left: 0.4rem; }
.mark--bad { color: var(--bad); }
.review__note { margin: 0 0 0.4rem; font-size: 0.85rem; color: var(--warn); }
.review__why { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.6; border-top: 1px dashed var(--line); padding-top: 0.55rem; }

.attempts { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.9rem; }
.attempts li { margin-bottom: 0.3rem; }
.pager { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.5rem 0; }

/* ---------------------------------------------------------------- certificate */

/*
 * Two layouts share this block.
 *
 *   .certdoc        typographic fallback. Used until an artwork template is
 *                   supplied, and as the safety net if the file ever goes
 *                   missing, so a certificate never fails to render.
 *   .certdoc--art   the supplied design as a background image, with the fields
 *                   positioned over it. Offsets and sizes are percentages of
 *                   the sheet, so they track the artwork identically on a
 *                   phone, on a desktop and on paper.
 *
 * Only four values are ever printed on the face: holder, course, percentage
 * and date. The reference line in the bottom corner is deliberately small and
 * grey -- it reads as a document reference, and it is the only thing that
 * makes verify.php usable by whoever is handed the certificate.
 */

.wrap--cert { max-width: 46rem; }

.certdoc {
  position: relative;
  background: #fff; border: 1px solid #d6d3d1; border-radius: 4px;
  padding: 3rem 2.5rem 2.2rem; text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.certdoc__issuer { margin: 0; font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 700; color: var(--teal); }
.certdoc__kind { margin: 0.4rem 0 2rem; font-size: 1.5rem; font-weight: 300; letter-spacing: 0.04em; }
.certdoc__lead { margin: 0; color: var(--faint); font-size: 0.88rem; }
.certdoc__name { margin: 0.5rem 0 1.4rem; font-size: 2rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.certdoc__course { margin: 0.5rem 0 1.6rem; font-size: 1.2rem; font-weight: 600; line-height: 1.4; color: var(--teal-dark); }
.certdoc__pct { margin: 0; font-size: 2.4rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.certdoc__date { margin: 1.4rem 0 0; font-size: 1rem; }

/* The reference line. Small, grey, and never styled as a heading. */
.certdoc__ref {
  margin: 2.4rem 0 0; font-size: 0.7rem; line-height: 1.5;
  letter-spacing: 0.04em; color: #9a9893;
}

.certdoc__disclaim {
  margin: 1.6rem 0 0; padding-top: 1rem; border-top: 1px dashed var(--line);
  font-size: 0.74rem; line-height: 1.6; color: var(--faint); text-align: left;
}

/* ------------------------------------------------------- artwork variant */

/*
 * Great Vibes, self-hosted. A Google Fonts <link> would be blocked outright:
 * the app sends default-src 'self' and does not whitelist fonts.gstatic.com.
 * SIL Open Font Licence 1.1 -- see assets/fonts/OFL.txt.
 */
@font-face {
  font-family: 'Great Vibes';
  font-style: normal;
  font-weight: 400;
  font-display: block;        /* block, not swap: a script field must never
                                 flash in a fallback face and reflow */
  src: url('../fonts/great-vibes.woff2') format('woff2');
}

/*
 * Field positions are percentages of the sheet, measured off the template's
 * own rules rather than estimated:
 *
 *   name    rule at 44.77% of height, centred on 49.98% of width
 *   course  rule at 54.46%, centred on 52.00%
 *   percent rule at 59.54%, centred on 65.76%  (the short rule after "with")
 *   date    rule at 69.60%, centred on 51.52%
 *   number  to the right of the "Certificate No:" label, from 26.7%
 *
 * Each field is anchored by its BOTTOM edge to the rule, so the text sits on
 * the line and the script descenders fall across it, as handwriting would.
 * Sizes are in cqw -- percentages of the sheet's own width -- so the whole
 * thing scales identically on a phone, on a desktop and on paper.
 */
.certdoc--art {
  container-type: inline-size;
  width: 100%; padding: 0; border: 0; border-radius: 0;
  aspect-ratio: var(--sheet, 2475 / 3500);
  background-size: 100% 100%; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 2px 10px rgba(0,0,0,0.14);
  color: #1a1a1a;
}

/* The artwork already carries the heading, the lead-ins, the signature, the
   verification address and the disclaimer. The app draws the fields only. */
.certdoc--art .certdoc__issuer,
.certdoc--art .certdoc__kind,
.certdoc--art .certdoc__lead,
.certdoc--art .certdoc__disclaim { display: none; }

.certdoc--art .certdoc__name,
.certdoc--art .certdoc__course,
.certdoc--art .certdoc__pct,
.certdoc--art .certdoc__date {
  position: absolute; margin: 0; text-align: center; line-height: 1;
  transform: translate(-50%, -100%);
  font-family: 'Great Vibes', 'Segoe Script', cursive;
  font-weight: 400; color: #1a1a1a;
}
.certdoc--art .certdoc__name   { left: 49.98%; top: 44.77%; max-width: 70%; font-size: 8.0cqw; }
.certdoc--art .certdoc__course { left: 52.00%; top: 54.46%; max-width: 70%; font-size: 5.4cqw; }
.certdoc--art .certdoc__pct    { left: 65.76%; top: 59.54%; max-width: 36%; font-size: 6.0cqw; }
.certdoc--art .certdoc__date   { left: 51.52%; top: 69.60%; max-width: 70%; font-size: 5.0cqw; }

/* The number sits beside the printed label, in the label's own face -- it is
   a document reference, not part of the award. */
/* The number sits on the printed "Certificate No:" label's own baseline, not
   centred on it. The label's glyphs run from row 748 to a baseline at row 793
   of the 3500-row sheet; with line-height: 1 an Arial box carries its baseline
   0.8465em down, so the box bottom lands 0.154em below the baseline -- hence
   22.94% rather than the baseline's own 22.66%. The size is set from the
   label's 45px cap height (Arial caps are 0.716em) so the two match in weight
   as well as in position. */
.certdoc--art .certdoc__ref {
  position: absolute; left: 26.7%; top: 22.94%; transform: translateY(-100%);
  margin: 0; text-align: left; white-space: nowrap; line-height: 1;
  font-family: Arial, Helvetica, sans-serif; font-weight: 700;
  font-size: 2.55cqw; letter-spacing: 0.01em; color: #1a1a1a;
}

/* Long names and course titles are shrunk to fit by cert-fit.js, which sets
   this. Without JavaScript the declared size above applies and a very long
   title simply wraps -- it never overflows the sheet. */
.certdoc--art [style*="--fit"] { font-size: calc(var(--fit) * 1cqw); }

/* In artwork mode the disclaimer is printed on the sheet itself, so nothing
   is repeated below it. */
.certnote {
  margin: 1.4rem 0 0; font-size: 0.74rem; line-height: 1.6;
  color: var(--faint); text-align: left;
}

@media print {
  .appbar, .appfoot, .noprint, .crumbs { display: none !important; }
  body { background: #fff; }
  .wrap--cert { max-width: none; padding: 0; }
  .certdoc { border: 0; box-shadow: none; padding: 2rem 1rem; }

  /* The artwork fills the sheet edge to edge. Browsers drop background images
     from printouts by default, which would print the four fields on a blank
     page -- print-color-adjust is what stops that. */
  .certdoc--art {
    width: 100%; box-shadow: none;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .certnote { break-before: page; padding-top: 2rem; }
}

@page { size: A4 portrait; margin: 0; }

@media (max-width: 640px) {
  .certdoc { padding: 2rem 1.25rem; }
  .certdoc__name { font-size: 1.5rem; }
  .certdoc__pct { font-size: 2rem; }
}

.checks__head {
  margin: 0.9rem 0 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #6b7280);
}
.checks__head:first-child { margin-top: 0; }

/* Checkout order summary. A buyer should be able to see exactly what is being
   charged and for how long before any field asks for their name. */
.summary {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
}
.summary th,
.summary td {
  text-align: left;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line, #d8dee4);
  vertical-align: top;
}
.summary th {
  width: 7rem;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #667);
}
.summary tr:last-child th,
.summary tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------- admin, restructured
   The admin grew from one page to five. These are the parts that page split
   needed: the tab strip, the takings row, the readiness list and the settings
   form. Everything else reuses the panel/table/tag vocabulary above. */

.wrap--admin { max-width: 68rem; }

.admnav {
  display: flex; flex-wrap: wrap; gap: 0.25rem;
  margin: 0 0 1.5rem; border-bottom: 1px solid var(--line);
}
.admnav__tab {
  padding: 0.55rem 0.9rem; text-decoration: none; color: var(--muted);
  font-size: 0.92rem; font-weight: 600; border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap;
}
.admnav__tab:hover { color: var(--ink); }
.admnav__tab.is-on { color: var(--teal); border-bottom-color: var(--teal); }
.admnav__badge {
  display: inline-block; margin-left: 0.4rem; min-width: 1.1rem; text-align: center;
  font-size: 0.72rem; font-weight: 700; padding: 0.05rem 0.35rem; border-radius: 99px;
  background: var(--bad); color: #fff;
}

/* Takings. auto-fit rather than a fixed count, so four cards become two rows
   on a phone without a breakpoint having to say so. */
.stats {
  display: grid; gap: 0.75rem; margin: 0 0 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.15rem;
}
.stat__n { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; }
.stat__l { font-size: 0.78rem; color: var(--faint); }

.statuslist { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.status { display: grid; grid-template-columns: 0.6rem auto; gap: 0.1rem 0.6rem; align-items: start; }
.status__dot {
  width: 0.6rem; height: 0.6rem; border-radius: 99px; margin-top: 0.4rem;
  background: var(--faint);
}
.status--ok   .status__dot { background: var(--good); }
.status--warn .status__dot { background: var(--warn); }
.status--bad  .status__dot { background: var(--bad); }
.status__what { font-weight: 600; font-size: 0.92rem; }
.status__detail { grid-column: 2; font-size: 0.86rem; color: var(--muted); line-height: 1.5; }

.filterbar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  margin: 0 0 1rem;
}
.filterbar__search { flex: 1 1 16rem; }
.filterbar input[type=search], .filterbar select {
  width: 100%; padding: 0.45rem 0.6rem; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; background: #fff;
}
.filterbar select { width: auto; }
.filterbar__count { margin-left: auto; font-size: 0.82rem; color: var(--faint); }

.nowrap { white-space: nowrap; }
.row--flag { background: #fffbeb; }
.tag--bad { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.price-input { width: 7rem; padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }

/* Settings. Each field carries its own explanation, so the note is part of the
   control rather than an aside — the point of this page is that you can fill
   it in without going and looking something up. */
.form--settings { display: block; margin: 0; }
.setting { margin: 1.1rem 0 0; max-width: 34rem; }
.setting > label { display: block; font-weight: 600; font-size: 0.88rem; margin: 0 0 0.3rem; }
.setting input[type=text], .setting input[type=email],
.setting input[type=password], .setting input[type=number], .setting select {
  width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; background: #fff;
}
.setting input:focus, .setting select:focus {
  outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal);
}
.setting__note { font-size: 0.82rem; color: var(--faint); line-height: 1.5; margin: 0.35rem 0 0; }
.setting--switch { padding: 0.6rem 0 0; }
.check--inline { display: inline-flex; gap: 0.35rem; align-items: center; font-weight: 400; }
.settings-save {
  position: sticky; bottom: 0; background: var(--paper);
  padding: 0.75rem 0 1rem; margin: -0.5rem 0 1.5rem;
  border-top: 1px solid var(--line);
}
.settings-save .btn--primary { margin-top: 0; }

.transcript {
  background: #1c1917; color: #e7e5e4; padding: 0.8rem 1rem; border-radius: 6px;
  font-size: 0.78rem; line-height: 1.5; overflow-x: auto; margin: 0.6rem 0 0;
  white-space: pre-wrap; word-break: break-word;
}

/* Present for screen readers, absent on screen — used where a control's own
   text makes a visible label redundant but an unlabelled field would not be
   announced at all. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
