/* Comfort University Training Records. Tokens and components carried over
   from the clickable demo the design was approved on. */
/* Layout: one working column, tabbed admin views; record detail slides in from the right; headset sim is a dark visor beside a live API log */
:root {
  --bg: #f2f4f6;
  --surface: #ffffff;
  --surface-2: #e9edf1;
  --line: #d3dae1;
  --fg: #16202a;
  --muted: #596673;
  --accent: #a95a28;
  --accent-fg: #ffffff;
  --accent-soft: #f5e6db;
  --good: #1d7449;
  --good-soft: #dcf0e4;
  --warn: #8a5d00;
  --warn-soft: #faefd0;
  --info: #1d5c99;
  --info-soft: #dfeaf7;
  --bad: #b0261e;
  --bad-soft: #fbe2df;
  --neutral-soft: #e4e9ee;
  --plate: #dde3e8;
  --plate-edge: #97a4af;
  --scrim: rgba(12, 18, 24, 0.45);
  --visor-bg: #0c1318;
  --visor-panel: #141e25;
  --visor-fg: #e6eef4;
  --visor-muted: #8d9eab;
  --visor-rim: #28333b;
  --visor-line: #26333d;
  --font-display:
    "Barlow Semi Condensed", "Barlow", system-ui, -apple-system, "Segoe UI",
    sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:
    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141a;
    --surface: #151e27;
    --surface-2: #1c2832;
    --line: #2a3945;
    --fg: #e5ecf2;
    --muted: #93a2af;
    --accent: #dc8a52;
    --accent-fg: #1b0f07;
    --accent-soft: #3a2516;
    --good: #5ec890;
    --good-soft: #143224;
    --warn: #e2b444;
    --warn-soft: #382d0f;
    --info: #7cb4ec;
    --info-soft: #14283b;
    --bad: #f2827a;
    --bad-soft: #3b1917;
    --neutral-soft: #23303b;
    --plate: #24313c;
    --plate-edge: #4f606e;
    --scrim: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e141a;
  --surface: #151e27;
  --surface-2: #1c2832;
  --line: #2a3945;
  --fg: #e5ecf2;
  --muted: #93a2af;
  --accent: #dc8a52;
  --accent-fg: #1b0f07;
  --accent-soft: #3a2516;
  --good: #5ec890;
  --good-soft: #143224;
  --warn: #e2b444;
  --warn-soft: #382d0f;
  --info: #7cb4ec;
  --info-soft: #14283b;
  --bad: #f2827a;
  --bad-soft: #3b1917;
  --neutral-soft: #23303b;
  --plate: #24313c;
  --plate-edge: #4f606e;
  --scrim: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
}
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 12px 64px;
}
@media (min-width: 720px) {
  .wrap {
    padding-inline: 24px;
  }
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  text-wrap: balance;
  letter-spacing: 0.005em;
}
h1 {
  font-size: 1.65rem;
  line-height: 1.1;
}
h2 {
  font-size: 1.25rem;
}
h3 {
  font-size: 1.05rem;
  font-weight: 600;
}
p {
  margin: 0;
}
.muted {
  color: var(--muted);
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.84rem;
}
/* Completion codes get copied, not read: small, quiet, and one click selects the whole code */
td.ccode {
  font-size: 0.72rem;
  color: var(--muted);
  user-select: all;
  white-space: nowrap;
}
.lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
select,
input,
textarea {
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  min-width: 0;
  max-width: 100%;
}
textarea {
  resize: vertical;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--muted);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.btn.primary:hover {
  filter: brightness(1.06);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
.btn.small {
  padding: 4px 10px;
  font-size: 0.85rem;
}
.btn.link {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 0;
  font-weight: 600;
}

header.top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding-block: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.brandlogo img {
  display: block;
  height: 52px;
  width: auto;
}
.sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}
.role {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tab {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 14px 8px;
  font: inherit;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab[aria-selected="true"] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}
.view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.between {
  justify-content: space-between;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.grid-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.st-Assigned {
  background: var(--neutral-soft);
  color: var(--muted);
}
.st-Signedin {
  background: var(--warn-soft);
  color: var(--warn);
}
.st-InProgress {
  background: var(--info-soft);
  color: var(--info);
}
.st-Complete {
  background: var(--good-soft);
  color: var(--good);
}
.tg-new {
  background: var(--info-soft);
  color: var(--info);
}
.tg-existing,
.tg-assigned {
  background: var(--neutral-soft);
  color: var(--muted);
}
.tg-certified {
  background: var(--good-soft);
  color: var(--good);
}
.tg-dup,
.tg-inbatch {
  background: var(--warn-soft);
  color: var(--warn);
}
.tg-fix {
  background: var(--bad-soft);
  color: var(--bad);
}

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: var(--fg);
}
.count .n {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.count[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.records table {
  min-width: 820px;
}
/* Column headers stay in view while the rows scroll. A sideways-scrolling wrapper would trap the sticky
   headers inside it, so on screens wide enough to hold the table the wrapper lets the page scroll. */
@media (min-width: 900px) {
  .records .tablewrap {
    overflow: visible;
  }
  .records thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 1px 0 var(--line);
  }
  .records thead th:first-child {
    border-top-left-radius: 8px;
  }
  .records thead th:last-child {
    border-top-right-radius: 8px;
  }
}
th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
/* Records rows line up with the top of the name */
.records tbody td {
  vertical-align: top;
}
.records th,
.records td {
  padding-inline: 6px;
}
.records td.who span {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* One line per cell, so OpCo, service point and dates don't wrap; the table scrolls sideways if it must */
.records tbody td:not(.who) {
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.records tbody tr {
  cursor: pointer;
}
.records tbody tr:hover {
  background: var(--surface-2);
}
.who b {
  font-weight: 600;
  display: block;
}
.who span {
  color: var(--muted);
  font-size: 0.85rem;
}
.mods {
  display: flex;
  gap: 3px;
}
.mod {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  border: 1px solid var(--line);
  flex: none;
}
.mod.done {
  background: var(--good);
  border-color: var(--good);
}
.mod.skipped {
  background: repeating-linear-gradient(
    135deg,
    var(--muted) 0 2px,
    transparent 2px 5px
  );
  border: 1.5px dashed var(--muted);
}
/* Modules read in chunks of three: OR M0 M1 | M2 M3 M4 | M5 M6 M7. */
.mods .gap {
  margin-left: 9px;
}
.thsort {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  text-transform: inherit;
  letter-spacing: inherit;
  font-weight: inherit;
  color: inherit;
}
.thsort:hover,
.thsort.on {
  color: var(--fg);
}
.thsort:focus-visible {
  outline: 2px solid var(--accent, currentColor);
  outline-offset: 2px;
}
.namesort {
  display: inline-flex;
  gap: 10px;
  margin-left: 8px;
  font-weight: 500;
}
.thsort .arr {
  font-size: 0.6rem;
  min-width: 0.7em;
}
/* Name on the left, "x of 9" at the column's right edge so the counts line up down the list */
.who b.nm {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
}
.who b .pcount {
  font-style: normal;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mods.mlabels {
  margin-top: 4px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.mods.mlabels span.req {
  font-weight: 800;
  color: var(--fg);
}
.mods.mlabels span {
  width: 15px;
  flex: none;
  text-align: center;
  font-size: 0.6rem;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.82rem;
  color: var(--muted);
  align-items: center;
}
.legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.plate {
  position: relative;
  background-color: var(--plate);
  border: 1px solid var(--plate-edge);
  border-radius: 4px;
  padding: 14px 22px;
  font-family: var(--font-mono);
  background-image:
    radial-gradient(
      circle at 9px 9px,
      var(--plate-edge) 2.4px,
      transparent 3px
    ),
    radial-gradient(
      circle at calc(100% - 9px) 9px,
      var(--plate-edge) 2.4px,
      transparent 3px
    ),
    radial-gradient(
      circle at 9px calc(100% - 9px),
      var(--plate-edge) 2.4px,
      transparent 3px
    ),
    radial-gradient(
      circle at calc(100% - 9px) calc(100% - 9px),
      var(--plate-edge) 2.4px,
      transparent 3px
    );
}
.plate .k {
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.plate .code {
  font-size: 1.12rem;
  letter-spacing: 0.07em;
  font-weight: 500;
  overflow-wrap: anywhere;
  color: var(--fg);
}
.plate dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 14px;
  margin: 10px 0 0;
  font-size: 0.78rem;
}
.plate dt {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.66rem;
  align-self: center;
}
.plate dd {
  margin: 0;
  overflow-wrap: anywhere;
}
/* Certificate logos (Comfort supplies the artwork; these are placeholders) */
.plate .logos {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.plate .logo {
  border: 1px dashed var(--plate-edge);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
/* Comfort University's logo (added 30 Oct); FIX 365 is still a placeholder */
.plate img.logo {
  height: 44px;
  width: auto;
  padding: 0;
  border: 0;
}
.news {
  border-left: 3px solid var(--accent);
  padding: 6px 12px;
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
}
.points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.splist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.spitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}
.spname {
  min-width: 9em;
  padding-left: 4px;
}
.hcount {
  display: inline-block;
  min-width: 3rem;
  margin-right: 8px;
  text-align: center;
  color: var(--muted);
}
.spcount {
  min-width: 3rem;
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.splist.retired .spname {
  color: var(--muted);
}
.retiredhead {
  margin: 10px 0 2px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.opcos td {
  vertical-align: top;
}
.opcos tfoot td {
  border-top: 2px solid var(--line);
  border-bottom: 0;
}
.chipbtn {
  all: unset;
  cursor: pointer;
  margin-left: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: underline;
  color: var(--muted);
}
.chipbtn:hover,
.chipbtn:focus-visible {
  color: var(--fg);
}
.spedit {
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.selcell {
  width: 34px;
  padding-right: 0;
}
.bulkbar {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 4px 2px;
  font-size: 0.9rem;
}
.overdue {
  color: var(--warn);
  font-weight: 600;
}
#hovertip {
  position: fixed;
  z-index: 200;
  max-width: 340px;
  padding: 8px 12px;
  border-radius: 8px;
  font: 500 14px/1.4 var(--font-body, system-ui, sans-serif);
  background: var(--fg);
  color: var(--bg);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
#hovertip[hidden] {
  display: none;
}
/* Floats at the bottom right once you've scrolled down a screen */
.totop {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  padding: 8px 14px;
  font: 600 13px/1 var(--font-body, sans-serif);
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.totop[hidden] {
  display: none;
}
.toastundo {
  all: unset;
  cursor: pointer;
  margin-left: 14px;
  font-weight: 700;
  text-decoration: underline;
}

.scrim {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: flex;
  justify-content: flex-end;
  z-index: 30;
}
.scrim.center {
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.drawer {
  background: var(--surface);
  width: min(470px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 18px
    calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: 1px solid var(--line);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: min(780px, 100%);
  max-height: 92%;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.kv {
  display: grid;
  grid-template-columns: minmax(110px, auto) 1fr;
  gap: 6px 14px;
  font-size: 0.92rem;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.modlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.modlist li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.92rem;
}
.modlist li:last-child {
  border-bottom: 0;
}
.modlist .id {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  width: 24px;
}
.mk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 0.7rem/1 var(--font-body, sans-serif);
  font-style: normal;
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--muted);
}
.mk.done {
  color: #fff;
}
.mkkey {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.mkkey span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.modlist .state {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--muted);
}
.log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.86rem;
}
.log li {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}
.log .t {
  color: var(--muted);
  font-size: 0.78rem;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.seg button {
  font: inherit;
  border: 0;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 14px;
  cursor: pointer;
  font-weight: 600;
}
.seg button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--fg);
}
.seg button + button {
  border-left: 1px solid var(--line);
}
.out {
  width: 100%;
  min-height: 280px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  white-space: pre;
  overflow: auto;
  background: var(--surface-2);
}
.note {
  font-size: 0.85rem;
  color: var(--muted);
}
.msg {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.92rem;
}
.msg.ok {
  background: var(--good-soft);
  color: var(--good);
}
.msg.err {
  background: var(--bad-soft);
  color: var(--bad);
}
.msg.warn {
  background: var(--warn-soft);
  color: var(--warn);
  margin-top: 12px;
}
.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.msg.info {
  background: var(--info-soft);
  color: var(--info);
}

.preview td input {
  width: 100%;
  min-width: 120px;
}
.preview table {
  min-width: 780px;
}
.preview td.why {
  font-size: 0.84rem;
  color: var(--muted);
}
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.slip {
  border: 1px dashed var(--plate-edge);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
}
.slip .pin {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  letter-spacing: 0.2em;
}
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
}

.visor {
  background: var(--visor-bg);
  color: var(--visor-fg);
  border: 7px solid var(--visor-rim);
  border-radius: 22px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 420px;
}
.visor .vm {
  color: var(--visor-muted);
}
.visor input {
  background: var(--visor-panel);
  color: var(--visor-fg);
  border-color: var(--visor-line);
}
.visor .btn {
  background: var(--visor-panel);
  color: var(--visor-fg);
  border-color: var(--visor-line);
}
.visor .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.visor .vpanel {
  background: var(--visor-panel);
  border: 1px solid var(--visor-line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.visor .modlist li {
  border-bottom-color: var(--visor-line);
}
.visor .modlist .id,
.visor .modlist .state {
  color: var(--visor-muted);
}
.visor .seg {
  border-color: var(--visor-line);
}
.visor .seg button {
  background: var(--visor-panel);
  color: var(--visor-muted);
}
.visor .seg button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-fg);
}
.visor .seg button + button {
  border-left-color: var(--visor-line);
}
.chip {
  font: inherit;
  font-size: 0.82rem;
  border: 1px solid var(--visor-line);
  background: var(--visor-panel);
  color: var(--visor-fg);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
}
.pinin {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  letter-spacing: 0.35em;
  width: 11ch;
  text-align: center;
}
.visor .plate {
  background-color: #d9dfe4;
  border-color: #8e9ba6;
  color: #16202a;
  background-image:
    radial-gradient(circle at 9px 9px, #8e9ba6 2.4px, transparent 3px),
    radial-gradient(
      circle at calc(100% - 9px) 9px,
      #8e9ba6 2.4px,
      transparent 3px
    ),
    radial-gradient(
      circle at 9px calc(100% - 9px),
      #8e9ba6 2.4px,
      transparent 3px
    ),
    radial-gradient(
      circle at calc(100% - 9px) calc(100% - 9px),
      #8e9ba6 2.4px,
      transparent 3px
    );
}
.visor .plate .k {
  color: #56636e;
}
.visor .plate .code {
  color: #16202a;
}
.qr {
  background: #ffffff;
  padding: 8px;
  border-radius: 6px;
  width: max-content;
  max-width: 100%;
}
.qr img,
.qr canvas {
  display: block;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--fg);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.92rem;
  z-index: 50;
  max-width: calc(100% - 32px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.techhead {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
}
@media (prefers-reduced-motion: no-preference) {
  .drawer {
    animation: slide 0.18s ease-out;
  }
  @keyframes slide {
    from {
      transform: translateX(24px);
      opacity: 0.6;
    }
    to {
      transform: none;
      opacity: 1;
    }
  }
}

/* ---------- added for the live system ---------- */
[hidden] {
  display: none !important;
}
.who-am-i {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.plainpage {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 16px 64px;
  display: grid;
  gap: 14px;
}
.plainpage .brandlogo img {
  height: 72px;
  width: auto;
}
.plainpage .big {
  font-size: 1.1rem;
}
.plainpage .code {
  font-size: 1.1rem;
  letter-spacing: 0.06em;
}
body {
  margin: 0;
}
.tokenbox {
  border: 1px dashed var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  user-select: all;
}
.danger {
  color: var(--bad);
}
table.simple td,
table.simple th {
  vertical-align: top;
}
.stack {
  display: grid;
  gap: 10px;
}

/* ---------- courses, getting started, help ---------- */
.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;
}
.coursepick {
  font: inherit;
  font-size: 0.85rem;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  max-width: 260px;
}
tr.hl td {
  background: var(--accent-soft);
}
#guide:empty {
  display: none;
}
#guide {
  margin: 0 0 14px;
}
.guide {
  border-left: 4px solid var(--accent);
}
.guide.intro {
  background: var(--accent-soft);
}
.guide h2 .muted {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
}
.guidesteps {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.guidesteps li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
}
.guidesteps .tick {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  line-height: 1;
}
.guidesteps li.done .tick {
  background: var(--good);
  border-color: var(--good);
  color: var(--surface);
}
.guidesteps li.done b {
  color: var(--muted);
  font-weight: 500;
}
.guidesteps li.next .tick {
  border-color: var(--accent);
}
.guidesteps li.next .note {
  margin: 4px 0 8px;
}
.helpdrawer .card + .card {
  margin-top: 12px;
}
.helplinks {
  margin: 4px 0 12px;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}
.helpdrawer textarea {
  font: inherit;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg);
  resize: vertical;
}
.askout:not(:empty) {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--info-soft);
}
.askout p {
  margin: 0 0 8px;
}
.askout p:last-child,
.askout ul:last-child {
  margin-bottom: 0;
}
.askout ul {
  margin: 0 0 8px;
  padding-left: 18px;
}

/* The help pages: a nav beside the article on wide screens. */
body.plain .plainpage:has(.helppage) {
  max-width: 980px;
}
.helppage {
  display: grid;
  gap: 20px;
}
@media (min-width: 820px) {
  .helppage {
    grid-template-columns: 230px 1fr;
    align-items: start;
  }
  .helpnav {
    position: sticky;
    top: 16px;
  }
}
.helpnav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.helpnav a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.92rem;
}
.helpnav a:hover {
  background: var(--surface-2);
}
.helpnav a[aria-current="page"] {
  background: var(--accent-soft);
  font-weight: 600;
}
.helpbody {
  min-width: 0;
  line-height: 1.55;
}
.helpbody h1 {
  margin-top: 0;
}
.helpbody table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.helpbody th,
.helpbody td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.helpbody code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 1px 4px;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
.helpback {
  margin-top: 28px;
}
.helpbody h2 {
  margin: 1.6em 0 0.4em;
}
.helpbody p,
.helpbody ul,
.helpbody ol {
  margin: 0 0 0.8em;
}

/* Module checkboxes for live sign-off */
.modpick {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.modpick label {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
ol.steps {
  margin: 0 0 10px;
  padding-left: 1.3em;
}
ol.steps li {
  margin: 4px 0;
}

/* Test data */
.tg-test {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px dashed currentColor;
}
.testcard {
  border-style: dashed;
}
ul.bullets {
  margin: 0;
  padding-left: 1.2em;
}
ul.bullets li {
  margin: 4px 0;
}
