/* =========================================================================
   1-A Services Training — visual system
   Tokens and component vocabulary per design/brand.md. Keep the names: the
   screen maps and content refer to kickers, callouts, chips, and role tags.
   ========================================================================= */

:root {
  --blue: #004aad;
  --blue-dark: #003c8a;
  --blue-pale: #eef3fb;
  --red: #b42318;            /* danger: wrong answers, hard rules, warnings */
  --red-pale: #fbeae9;
  --brand-red: #ff1616;      /* identity: the logo's red, wordmarks only */
  --green: #1a7f37;
  --green-pale: #e9f7ee;
  --amber: #8a6100;
  --amber-pale: #fff8e6;
  --ink: #1a1a1a;
  --muted: #5a6472;
  --line: #d9dee6;
  --bg: #f4f6f9;
  --surface: #fff;

  --font: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 6px 20px rgba(16, 24, 40, 0.06);
  --maxw: 820px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* The app is a fixed-height shell: the stage is the only scroll container, so
   a screen that is slightly too tall scrolls its own content instead of the
   whole page. Keeps "one screen at a time" true at any viewport height. */
body { overflow: hidden; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
p { margin: 0 0 .85em; }
ul, ol { margin: 0 0 .85em; padding-left: 1.35em; }
li { margin-bottom: .35em; }
strong { font-weight: 700; }
a { color: var(--blue); }

/* ---------------------------------------------------------------- app shell */

#app { height: 100%; display: flex; flex-direction: column; min-height: 0; }

.topbar {
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  flex: 0 0 auto;
}

.brandchip {
  background: #fff;
  border-radius: 6px;
  padding: 4px 9px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  font-size: 15px;
}
.brandchip .b { color: var(--blue); }
.brandchip .r { color: var(--brand-red); }

.topbar .spacer { flex: 1 1 auto; }

.topbar-title {
  font-size: 14px;
  opacity: .92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iconbtn {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  border-radius: 6px;
  padding: 5px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.iconbtn:hover { background: rgba(255, 255, 255, .22); }

/* progress rail under the topbar */
.rail { flex: 0 0 auto; background: #dbe3ee; height: 5px; }
.rail > i { display: block; height: 100%; background: var(--blue); width: 0; transition: width .3s ease; }

.railmeta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.railmeta .spacer { flex: 1 1 auto; }

/* ------------------------------------------------------------------- stage */

.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.screen {
  width: 100%;
  max-width: var(--maxw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.kicker {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.screen h1 { font-size: 1.6rem; color: var(--blue); }
.screen h2 { font-size: 1.25rem; color: var(--blue); }
.screen h3 { font-size: 1.05rem; color: var(--blue-dark); }

.timechip {
  display: inline-block;
  background: var(--blue-pale);
  color: var(--blue-dark);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.lede { font-size: 1.08rem; }

/* story screens get room to breathe */
.screen.is-story h1 { font-size: 1.75rem; }
.screen.is-story .body { font-size: 1.1rem; }

/* --------------------------------------------------------------- callouts */

.callout {
  border-left: 4px solid var(--blue);
  background: var(--blue-pale);
  border-radius: 0 8px 8px 0;
  padding: 12px 15px;
  margin: 0 0 .9em;
}
.callout .ct {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--blue-dark);
  margin-bottom: 3px;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

.callout.red { border-left-color: var(--red); background: var(--red-pale); }
.callout.red .ct { color: #c40d0d; }
.callout.green { border-left-color: var(--green); background: var(--green-pale); }
.callout.green .ct { color: var(--green); }
.callout.amber { border-left-color: #d99c00; background: var(--amber-pale); }
.callout.amber .ct { color: var(--amber); }

/* ----------------------------------------------------------------- tables */

.tablewrap { overflow-x: auto; overflow-y: auto; max-height: 46vh; margin-bottom: .9em; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
thead th {
  background: var(--blue);
  color: #fff;
  text-align: left;
  padding: 9px 12px;
  font-weight: 600;
  position: sticky;
  top: 0;
}
tbody td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:nth-child(even) { background: #fafbfd; }
tbody tr.revealed { animation: fade .2s ease; }
tbody tr.hidden-row { display: none; }

.takeaway { font-size: 14px; color: var(--muted); font-style: italic; }

/* ---------------------------------------------------------------- buttons */

.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  border: 2px solid transparent;
  background: var(--blue);
  color: #fff;
  transition: background .15s ease;
}
.btn:hover:not(:disabled) { background: var(--blue-dark); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn.ghost:hover:not(:disabled) { background: var(--blue-pale); }
.btn.warn { background: var(--red); }
.btn.warn:hover:not(:disabled) { background: #d40f0f; }
.btn.sm { padding: 6px 12px; font-size: 14px; }

.navbar {
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 16px;
}
.navbar .spacer { flex: 1 1 auto; }
.navhint { font-size: 13px; color: var(--muted); }

/* -------------------------------------------------------------- exercises */

.ex { margin-bottom: .9em; }
.ex-prompt { font-weight: 600; margin-bottom: .6em; }

.opt {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  margin-bottom: 8px;
  cursor: pointer;
}
.opt:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-pale); }
.opt.sel { border-color: var(--blue); background: var(--blue-pale); }
.opt.right { border-color: var(--green); background: var(--green-pale); }
.opt.wrong { border-color: var(--red); background: var(--red-pale); }
.opt:disabled { cursor: default; }
.opt .tag { float: right; font-size: 12.5px; font-weight: 700; }
.opt.right .tag { color: var(--green); }
.opt.wrong .tag { color: var(--red); }

.feedback { border-radius: 8px; padding: 11px 14px; margin: 10px 0; font-size: 15px; }
.feedback.ok { background: var(--green-pale); border-left: 4px solid var(--green); }
.feedback.no { background: var(--amber-pale); border-left: 4px solid #d99c00; }

/* drag/sort exercises */
.sorter { display: grid; gap: 12px; }
.bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.bin { border: 2px dashed var(--line); border-radius: 8px; padding: 8px; min-height: 60px; }
.bin h4 { font-size: 13px; margin: 0 0 6px; color: var(--blue-dark); text-transform: uppercase; letter-spacing: .05em; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  margin-bottom: 6px;
}

/* hotspot exercises */
.hotwrap { position: relative; display: inline-block; max-width: 100%; }
.hotwrap img {
  display: block;
  max-height: 46vh;
  max-width: min(286px, 72vw);
  width: auto;
  height: auto;
  border-radius: 14px;
}
.hot {
  position: absolute;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.hot:hover { border-color: rgba(0, 74, 173, .5); background: rgba(0, 74, 173, .12); }
.hot.right { border-color: var(--green); background: rgba(26, 127, 55, .22); }
.hot.wrong { border-color: var(--red); background: rgba(255, 22, 22, .18); }

/* ------------------------------------------------------------- role chips */

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: .7em; }
.chip {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 10px;
}
.chip.tech { background: #e3edfb; color: var(--blue-dark); }
.chip.helper { background: #f3e8fb; color: #6b21a8; }
.chip.both { background: #eceff3; color: var(--muted); }

/* --------------------------------------------------------------- phone frame */

/* Screenshots are the core content of a Module 2 screen, so they must fit the
   viewport rather than push the page into scrolling. Height-constrained, with
   tap-to-enlarge for anyone who wants to read the small print. */
.phone {
  margin: 0 auto .6em;
  display: block;
  width: fit-content;
  max-width: 100%;
  border: 8px solid #1f2937;
  border-radius: 26px;
  overflow: hidden;
  background: #1f2937;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
.phone img {
  display: block;
  max-height: 44vh;
  max-width: min(272px, 70vw);
  width: auto;
  height: auto;
}
.phone::after {
  content: "tap to enlarge";
  display: block;
  background: #1f2937;
  color: rgba(255, 255, 255, .75);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  padding: 3px 0 1px;
}

/* full-screen viewer */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 14, 22, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: zoom-out;
  overflow: auto;
}
.lightbox img {
  max-width: min(420px, 96vw);
  width: 100%;
  height: auto;
  border-radius: 14px;
}
.lightbox .close {
  position: fixed;
  top: 12px;
  right: 14px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .4);
  color: #fff;
  border-radius: 8px;
  padding: 7px 13px;
  font: inherit;
  cursor: pointer;
}
.caption { text-align: center; font-size: 13.5px; color: var(--muted); margin-bottom: .8em; }

/* ------------------------------------------------------------------ video */

.videobox {
  position: relative;
  padding-top: 56.25%;
  max-height: 40vh;
  max-width: calc(40vh / 0.5625);
  margin: 0 auto .6em;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.videobox iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ------------------------------------------------------------------- home */

.home { width: 100%; max-width: 900px; }
.modcards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.modcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.modcard h3 { font-size: 1.15rem; margin-bottom: 4px; }
.modcard .sub { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.modcard .grow { flex: 1 1 auto; }
.bar { height: 8px; background: #e6ebf2; border-radius: 999px; overflow: hidden; margin: 10px 0 6px; }
.bar > i { display: block; height: 100%; background: var(--blue); width: 0; }
.modcard.locked { opacity: .72; }

.office {
  margin-top: 26px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #fbfcfe;
}
.office h4 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.office .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------- menu */

.menu-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 40; }
.menu {
  position: fixed;
  z-index: 41;
  top: 0; left: 0; bottom: 0;
  width: min(330px, 84vw);
  background: var(--surface);
  box-shadow: 2px 0 24px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
}
.menu header { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.menu header .spacer { flex: 1 1 auto; }
.menu ol { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.menu li { margin: 0; }
.menu button {
  width: 100%;
  text-align: left;
  font: inherit;
  background: none;
  border: 0;
  border-radius: 8px;
  padding: 9px 11px;
  cursor: pointer;
  display: flex;
  gap: 9px;
  align-items: baseline;
}
.menu button:hover:not(:disabled) { background: var(--blue-pale); }
.menu button:disabled { color: #9aa3b0; cursor: not-allowed; }
.menu button.cur { background: var(--blue-pale); font-weight: 700; }
.menu .st { font-size: 12px; width: 1.1em; flex: 0 0 auto; }
.menu .tm { margin-left: auto; font-size: 12px; color: var(--muted); }

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

.field { margin-bottom: .9em; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.field input[type="text"], .field input[type="time"], .field select, .field textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); }

/* ---------------------------------------------------------------- records */

.record { background: #fff; color: #000; padding: 26px 30px; }
.record .rechead { display: flex; align-items: flex-start; gap: 14px; border-bottom: 3px solid var(--blue); padding-bottom: 10px; margin-bottom: 14px; }
.record .rechead .spacer { flex: 1 1 auto; }
.record .rectitle { text-align: right; }
.record .rectitle b { display: block; color: var(--blue); font-size: 1.05rem; }
.record .rectitle span { font-size: 12px; color: var(--muted); }
.record .co { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.record dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; margin: 0 0 14px; }
.record dt { font-weight: 700; }
.record dd { margin: 0; }
.record table { font-size: 13.5px; }
.record .badge { display: inline-block; border-radius: 6px; padding: 3px 10px; font-weight: 700; font-size: 13px; }
.record .badge.pass { background: var(--green-pale); color: var(--green); border: 1px solid var(--green); }
.record .sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 20px; }
.record .sig { border-top: 1px solid #000; padding-top: 4px; font-size: 12.5px; }
.record .attest { font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fafbfd; }
.record .foot { margin-top: 14px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }

/* --------------------------------------------------------------- utility */

.small { font-size: 13px; }
.mut { color: var(--muted); }
.center { text-align: center; }
.mb0 { margin-bottom: 0; }
.mt1 { margin-top: 1em; }
.hidden { display: none !important; }
.err { color: #c40d0d; font-size: 14px; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 640px) {
  /* The chapter name is already on the rail line below; showing a truncated
     copy of it in the top bar just crowds out the buttons. */
  .topbar-title { display: none; }
  .topbar { gap: 8px; padding: 9px 12px; }
  .brandchip { font-size: 13.5px; padding: 3px 7px; }
  .railmeta { font-size: 12px; padding: 6px 12px; }
  .screen { padding: 18px 16px; border-radius: 8px; }
  .screen h1 { font-size: 1.35rem; }
  .stage { padding: 14px 10px 8px; }
  .record { padding: 16px; }
  .record .sigs { grid-template-columns: 1fr; }
  .navbar { padding: 12px 0 20px; }
}

/* ------------------------------------------------------------------ print */

@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  #app { height: auto; display: block; }
  .shellrow { display: block; }
  .sidebar { display: none !important; }
  .topbar, .rail, .railmeta, .navbar, .menu, .menu-backdrop, .noprint { display: none !important; }
  .stage { padding: 0; overflow: visible; display: block; }
  .screen {
    border: 0;
    box-shadow: none;
    padding: 0;
    max-width: none;
    animation: none;
  }
  /* The record carries its own header; the screen's title and kicker are app
     chrome and must not print. */
  .recordhost > h1,
  .recordhost > .kicker,
  .recordhost > .timechip { display: none !important; }

  /* One letter page: tighten type and forbid breaks inside the blocks that
     have to stay together. */
  .record { padding: 0; font-size: 11.5px; line-height: 1.35; }
  .record h3 { font-size: 12.5px; margin: 8px 0 3px; }
  .record dl { gap: 1px 12px; font-size: 11.5px; margin-bottom: 8px; }
  .record table { font-size: 10.5px; }
  .record tbody td, .record thead th { padding: 3px 8px; }
  .record .tablewrap { max-height: none !important; overflow: visible !important; border: 0; }
  .record .attest { font-size: 10.5px; padding: 6px 8px; }
  .record .foot { font-size: 9.5px; margin-top: 8px; padding-top: 5px; }
  .record .sigs { margin-top: 12px; gap: 18px; }
  .record .rechead { padding-bottom: 6px; margin-bottom: 8px; }
  .record .co { font-size: 10px; line-height: 1.3; }
  .record p { margin-bottom: .45em; }
  .record table, .record .attest, .record .sigs, .record .foot { page-break-inside: avoid; }
  .record .rechead { border-bottom: 3px solid #000; }
  .record .rectitle b { color: #000; }
  thead th { background: #e8e8e8 !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .record .badge.pass { border: 1px solid #000; color: #000; }
  a { text-decoration: none; color: #000; }
  @page { margin: 0.5in; }
}

/* =========================================================================
   V2 THEME — the approved redesign (navy shell, real logo, Barlow display).
   Overrides the base system above; new components live here too.
   ========================================================================= */

:root {
  --navy: #052a5e;
  --navy-line: #2c4f8c;
  --font-display: 'Barlow Semi Condensed', Calibri, 'Arial Narrow', sans-serif;
  --card-radius: 14px;
}

body { font-family: Calibri, Carlito, 'Segoe UI', Arial, sans-serif; }

.screen h1, .screen h2, .home h1, .adminwrap h1, .loginbox h1, .modcard h3, .stattile .statnum {
  font-family: var(--font-display);
}
.screen h1 { font-size: 1.8rem; }

.bootwait { padding: 60px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------- topbar v2 */
.topbar { background: var(--navy); height: 60px; padding: 0 24px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brandlogo {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: #fff; border-radius: 999px; flex: 0 0 auto;
}
.brandlogo img { width: 34px; height: 34px; border-radius: 999px; display: block; }
.brandword {
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  letter-spacing: .04em; color: #fff; white-space: nowrap;
}
.branddiv { width: 1px; height: 16px; background: var(--navy-line); }
.brandctx {
  font-size: 14px; color: #9fb6dd; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.officechip {
  border: 1.5px solid #ff5a5a; color: #ffb3b3; border-radius: 6px;
  padding: 2px 9px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
}
.userchip {
  display: flex; align-items: center; gap: 8px; background: #0d3a78;
  border: 1px solid #2c5498; border-radius: 999px; padding: 4px 13px 4px 5px;
}
.userdot {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 999px; background: var(--brand-red);
  color: #fff; font-size: 11px; font-weight: 700;
}
.username { color: #dbe6f7; font-size: 13.5px; white-space: nowrap; }
.signout {
  background: none; border: 0; color: #7f9bc9; font: inherit; font-size: 13px;
  cursor: pointer; padding: 4px 2px;
}
.signout:hover { color: #dbe6f7; }
.reviewchip {
  background: var(--red-pale); color: #c40d0d; border: 1px solid #ffc9c9;
  border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700;
  letter-spacing: .06em;
}

/* --------------------------------------------------------- module shell */
.shellrow { flex: 1 1 auto; display: flex; min-height: 0; }
.sidebar {
  width: 292px; flex: 0 0 auto; background: var(--surface);
  border-right: 1px solid var(--line); overflow-y: auto; padding: 16px 12px;
}
.sidehead { padding: 2px 12px 10px; }
.sidelabel { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; color: #8b98ab; }
.sidebar ol { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0; }
.sidebar button {
  width: 100%; text-align: left; font: inherit; background: none; border: 0;
  border-radius: 8px; padding: 8px 12px; cursor: pointer;
  display: flex; gap: 10px; align-items: baseline; color: var(--muted); font-size: 13.5px;
}
.sidebar button:hover:not(:disabled) { background: var(--blue-pale); }
.sidebar button:disabled { color: #aab4c2; cursor: default; }
.sidebar button.cur { background: var(--blue-pale); color: var(--blue); font-weight: 700; }
.sidebar .st { width: 1.1em; flex: 0 0 auto; font-size: 12px; }
.sidebar .st.done { color: var(--green); }
.sidebar .st.now { color: var(--blue); font-size: 9px; }
.sidebar .st.lock { color: #c3cbd6; }
.sidebar .ct-title { flex: 1 1 auto; min-width: 0; }
.sidebar .tm { margin-left: auto; font-size: 11.5px; color: #aab4c2; flex: 0 0 auto; }
.sidebar .glossrow { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.menu .st.done { color: var(--green); }
.menu .st.now { color: var(--blue); font-size: 9px; }
.menu .ct-title { flex: 1 1 auto; }

.showsm { display: none; }
@media (max-width: 1079px) {
  .sidebar { display: none; }
  .showsm { display: inline-block; }
  .username { display: none; }
  .brandctx, .branddiv { display: none; }
}

/* --------------------------------------------------------------- home v2 */
.homegreet { font-size: 2rem; color: var(--ink); }
.homesub { margin-top: -4px; }
.modcard { border-radius: var(--card-radius); padding: 26px 28px; gap: 4px; }
.modhead { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.modnum {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; background: var(--blue-pale);
  color: var(--blue); font-family: var(--font-display); font-weight: 700; font-size: 18px;
}
.statchip { border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 700; }
.statchip.good { background: var(--green-pale); color: var(--green); }
.statchip.blue { background: var(--blue-pale); color: var(--blue); }
.statchip.dim { background: #eceff3; color: var(--muted); }
.modcard h3 { font-size: 1.35rem; }
.homefoot {
  margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px;
  display: flex; align-items: center; gap: 10px;
}
.adminlink {
  background: none; border: 0; font: inherit; font-size: 13.5px; font-weight: 700;
  color: var(--blue); cursor: pointer; padding: 0;
}
.adminlink:hover { color: var(--blue-dark); }

/* -------------------------------------------------------------- login v2 */
.loginwrap { display: flex; min-height: 100%; flex: 1 1 auto; }
.loginside {
  width: min(500px, 42vw); background: var(--navy); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 48px 32px; flex: 0 0 auto;
}
.loginlogo {
  display: flex; align-items: center; justify-content: center;
  width: 132px; height: 132px; background: #fff; border-radius: 999px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.loginlogo img { width: 116px; height: 116px; border-radius: 999px; }
.loginbrand { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: .05em; }
.loginrule { width: 56px; height: 4px; background: var(--brand-red); border-radius: 999px; }
.logintag { font-size: 16px; color: #9fb6dd; }
.loginfoot { margin-top: 80px; font-size: 12.5px; color: #56719f; text-align: center; line-height: 1.6; }
.loginmain { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; background: #f6f8fb; padding: 24px; }
.loginbox { width: min(400px, 100%); display: flex; flex-direction: column; gap: 10px; }
.loginbox h1 { font-size: 1.9rem; margin: 0; }
.logincard {
  display: flex; flex-direction: column; gap: 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--card-radius); padding: 26px;
  box-shadow: var(--shadow); margin-top: 8px;
}
.logincard .field { margin-bottom: 0; }
.logincard input {
  width: 100%; font: inherit; padding: 11px 14px;
  border: 1.5px solid #ccd6e6; border-radius: 9px; background: #fff; color: var(--ink);
}
.logincard input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px #dbe7f8; }
.logincard label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 5px; color: #3c4a5e; }
.btn.wide { width: 100%; padding: 12px; }
@media (max-width: 760px) { .loginside { display: none; } }

/* -------------------------------------------------------------- admin v2 */
.adminstage { align-items: stretch; }
.adminwrap { width: 100%; max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.adminhead { display: flex; align-items: center; gap: 16px; }
.adminhead h1 { font-size: 1.8rem; margin: 0; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--card-radius); padding: 20px 22px; box-shadow: var(--shadow);
}
.card h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 6px; }
.card input {
  width: 100%; font: inherit; padding: 9px 12px; margin-bottom: 8px;
  border: 1.5px solid #ccd6e6; border-radius: 8px;
}
.card input:focus { outline: none; border-color: var(--blue); }
.addform { display: grid; grid-template-columns: 1.2fr 1.4fr 1.4fr auto; gap: 10px; align-items: start; }
.addform input { margin-bottom: 0; }
.addform .err { grid-column: 1 / -1; }
.statgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stattile {
  display: flex; flex-direction: column; gap: 2px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px;
}
.statnum { font-size: 26px; font-weight: 700; color: var(--ink); }
.statnum.good { color: var(--green); }
.admingrid { display: grid; grid-template-columns: 2.2fr 1fr; gap: 20px; align-items: start; }
.admincol { display: flex; flex-direction: column; gap: 16px; }
.techtable { padding: 0; overflow: hidden; }
.trow {
  display: grid; grid-template-columns: 1.5fr 1fr 0.9fr 0.9fr 1.5fr;
  gap: 8px; align-items: center; padding: 12px 20px; border-top: 1px solid #eef1f6;
}
.trow.thead {
  background: var(--navy); border-top: 0; padding: 10px 20px;
}
.trow.thead span { font-size: 12px; font-weight: 700; color: #fff; }
.tname { font-size: 14.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.rolechip {
  border: 1px solid #ffb3b3; color: #c40d0d; border-radius: 5px;
  padding: 1px 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
}
.cell { font-size: 13px; }
.cell.good { color: var(--green); font-weight: 700; }
.cell.blue { color: var(--blue); font-weight: 700; }
.cell.dim { color: var(--muted); }
.right { text-align: right; }
.acts { display: flex; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.alink {
  background: none; border: 0; font: inherit; font-size: 12.5px; font-weight: 700;
  color: var(--blue); cursor: pointer; padding: 3px 6px; border-radius: 6px;
}
.alink:hover { background: var(--blue-pale); }
.alink.danger { color: #c40d0d; }
.alink.danger:hover { background: var(--red-pale); }
.notecard { background: var(--blue-pale); border-color: #c8d9f2; }
@media (max-width: 980px) {
  .admingrid { grid-template-columns: 1fr; }
  .addform { grid-template-columns: 1fr; }
  .statgrid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------- quiz v2 */
.opt.qopt { display: flex; align-items: center; gap: 14px; }
.qletter {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 999px; flex: 0 0 auto;
  border: 1.5px solid #ccd6e6; color: var(--muted); font-size: 13px; font-weight: 700;
}
.opt.qopt.sel { border-color: var(--blue); background: var(--blue-pale); box-shadow: 0 0 0 3px #dbe7f8; }
.opt.qopt.sel .qletter, .opt.qopt.right .qletter { border-color: var(--blue); background: var(--blue); color: #fff; }
.opt.qopt.right .qletter { background: var(--green); border-color: var(--green); }
.opt.qopt.wrong .qletter { background: var(--red); border-color: var(--red); color: #fff; }
.qtext { flex: 1 1 auto; }

/* =========================================================================
   PUNCH-LIST PASS — contrast, focus, phone header, new components.
   ========================================================================= */

/* A-01: answered options must stay readable. Disabled ≠ invisible. */
.opt:disabled { color: var(--ink); opacity: 1; }
.opt:disabled:not(.right):not(.wrong):not(.sel) { opacity: .62; }

/* A-02: keyboard focus is visible everywhere; mouse users see no change. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* A-05: answered rows keep their alignment — the tag pins right in flex. */
.opt { display: flex; align-items: center; gap: 10px; text-align: left; }
.opt .tag { float: none; margin-left: auto; flex: 0 0 auto; }

/* h4 = promoted label headings (C-07) */
.screen h4 {
  font-family: var(--font-display);
  font-size: .95rem; color: var(--blue-dark);
  letter-spacing: .02em; margin: 1.1em 0 .35em;
}
.screen h4:first-child { margin-top: 0; }

/* checklist (packet screen) */
.ticklist { display: flex; flex-direction: column; gap: 10px; margin-bottom: .9em; }
.tickrow {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 13px 16px;
  background: var(--surface);
}
.tickrow.done { border-color: var(--green); background: var(--green-pale); }
.tickbox {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: 0 0 auto; margin-top: 1px;
  border: 2px solid #ccd6e6; border-radius: 7px; background: #fff;
  color: transparent; cursor: pointer;
}
.tickrow.done .tickbox { background: var(--green); border-color: var(--green); color: #fff; }
.ticklabel { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.ticknote { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.tickrow.done .ticknote { color: #3d6b4c; }

/* drawer footer (Sign out lives here on phones) */
.menufoot {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid var(--line); padding: 10px 14px;
}

/* P-01: the phone header can never paint outside itself */
.brand { min-width: 0; overflow: hidden; }
@media (max-width: 639px) {
  .brandword { display: none; }
  .signout { display: none; }          /* it lives in the Contents drawer */
  .userchip { padding: 4px 5px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .reviewchip { display: none; }
  .metatime { display: none; }
  /* P-02: hotspot targets get the full column on the device they teach */
  .hotwrap img { max-width: min(420px, 92vw); max-height: none; }
  .phone img { max-width: min(340px, 86vw); max-height: none; }
}

/* =========================================================================
   PASS 2–4 — video questions, real meter, screen treatments, certificate.
   ========================================================================= */

/* video gate questions */
.vquiz { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }

/* the occurrence meter is a meter now (A-06) */
.omtrack {
  position: relative; height: 14px; border-radius: 999px;
  background: #e6ebf3; overflow: visible; margin: 8px 0 6px;
}
.omfill {
  height: 100%; border-radius: 999px; background: var(--red);
  transition: width .4s ease; min-width: 0;
}
.omtick {
  position: absolute; top: -3px; width: 2px; height: 20px;
  background: #8b98ab; border-radius: 2px;
}

/* V-05: screens with different jobs look different */
.screen.is-title {
  background: linear-gradient(180deg, #f7fafd 0%, #ffffff 46%);
  border-top: 4px solid var(--blue);
}
.screen.is-title h1 { font-size: 2.1rem; }
.screen.is-story {
  background: #f8f9fc;
  border-left: 4px solid var(--blue);
}
.screen.is-checkpoint { border-top: 4px solid var(--red); }

/* rendered app banners (the "Banners you may see" screen shows, not tells) */
.demo-banners { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.demo-banner {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  border-radius: 10px; padding: 11px 15px; font-size: 14px;
}
.demo-banner strong { font-weight: 700; }
.demo-banner span { font-size: 12.5px; opacity: .85; }
.demo-banner.red { background: #fdecea; border: 1.5px solid #e5484d; color: #93231c; }
.demo-banner.amber { background: #fff6e0; border: 1.5px solid #d9a514; color: #7a5a00; }
.demo-banner.gold { background: #f8f1df; border: 1.5px solid #b8962e; color: #6d5717; }

/* sidebar progress (V-06) */
.sidehead { display: flex; align-items: baseline; }
.sidepct { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--blue); }
.sideprog { padding: 0 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.sideprog .bar { height: 6px; background: #e6ebf3; border-radius: 999px; overflow: hidden; margin-bottom: 5px; }
.sideprog .bar i { display: block; height: 100%; background: var(--blue); }

/* -------------------------------------------------------------- certificate */
.cert {
  border: 3px double var(--navy);
  border-radius: 6px;
  padding: 44px 40px 30px;
  text-align: center;
  background:
    linear-gradient(0deg, rgba(5, 42, 94, 0.03), rgba(5, 42, 94, 0.03)),
    #fffdf8;
}
.certlogo img { width: 74px; height: 74px; border-radius: 999px; }
.certco { font-size: 13px; color: var(--muted); margin-top: 8px; }
.certkicker {
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase; color: var(--blue-dark);
  margin: 20px 0 14px;
}
.certname {
  font-family: var(--font-display); font-size: 40px; font-weight: 700;
  color: var(--ink); border-bottom: 1.5px solid var(--line);
  display: inline-block; padding: 0 34px 8px; margin-bottom: 12px;
}
.certline { font-size: 14px; color: var(--muted); }
.certcourse {
  font-family: var(--font-display); font-size: 24px; font-weight: 600;
  color: var(--navy); margin: 6px 0 10px;
}
.certdetail { font-size: 14px; color: var(--ink); }
.certsigs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
  margin: 44px 40px 18px;
}
.certsig span { font-size: 12px; color: var(--muted); }
.certsigline { border-bottom: 1px solid #333; height: 34px; margin-bottom: 5px; }
.certcode { font-size: 11px; color: var(--muted); letter-spacing: .05em; }

@media print {
  .cert { border-color: #000; }
  .certkicker, .certcourse { color: #000; }
}
