/* Plexicus Partner Portal — stylesheet.
 * Design tokens and component recipes follow the Plexicus platform UI:
 * 108px icon rail, 80px header with the page title in violet, #f8fafc
 * content, white cards with 1px #e5e7eb borders, radius 8/6, pill badges. */

:root {
  --plx-accent: #8220ff;
  --plx-accent-dark: #6e1ecf;
  --plx-accent-tint: #f4f2ff;
  --plx-ink: #111827;
  --plx-ink-2: #0c063a;
  --plx-body: #374151;
  --plx-muted: #6b7280;
  --plx-muted-2: #9ca3af;
  --plx-border: #e5e7eb;
  --plx-border-soft: #eef0f3;
  --plx-row: #f6f7f9;
  --plx-bg: #f8fafc;
  --plx-surface: #ffffff;
  --plx-radius: 8px;
  --plx-radius-sm: 6px;
  --plx-success: #10b981;          /* brand kit signal green */
  --plx-danger: #e11d48;           /* brand kit signal red */
  --plx-warning: #92400e;
  --sidebar-width: 108px;
  --header-height: 80px;
}

/* ---------- reset + base (standalone: this is the only stylesheet) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.55; -webkit-font-smoothing: antialiased; background: var(--plx-bg); color: var(--plx-ink);
}
h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; margin: 0; }
p { margin: 0 0 1em; }
a { text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: #fff; padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 12px; }
.i { color: inherit; }
[hidden] { display: none !important; }

/* ---------- base ---------- */
#app { min-height: 100vh; color: var(--plx-ink); font-size: 13.5px; }
#app a { color: var(--plx-accent); }
#app a:hover { color: var(--plx-accent-dark); text-decoration: none; }
#app h1, #app h2, #app h3 { letter-spacing: -0.01em; }
#app :focus-visible { outline: 2px solid var(--plx-accent); outline-offset: 2px; }
.mono { font-family: "SF Mono", Monaco, Consolas, monospace; font-size: 12px; }
.muted { color: var(--plx-muted); }
.sub { font-size: 11.5px; color: var(--plx-muted); margin-top: 2px; font-weight: 400; }
.fine { font-size: 12px; color: var(--plx-muted); margin: 12px 0 0; }
.right { text-align: right; }
.section-kicker {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--plx-muted-2);
}

/* platform scrollbars: always visible, purple thumb (main.css) */
html::-webkit-scrollbar, .frame-main::-webkit-scrollbar, .tbl-wrap::-webkit-scrollbar { width: 12px; height: 10px; }
html::-webkit-scrollbar-track, .frame-main::-webkit-scrollbar-track, .tbl-wrap::-webkit-scrollbar-track { background: #e5e7eb; }
html::-webkit-scrollbar-thumb, .frame-main::-webkit-scrollbar-thumb, .tbl-wrap::-webkit-scrollbar-thumb {
  background: #8220ff; border-radius: 6px; border: 2px solid #e5e7eb;
}

/* ---------- demo ribbon ---------- */
.demo-ribbon {
  background: var(--plx-ink-2); color: #cfc6f5; text-align: center;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 12px; position: relative; z-index: 70;
}

/* ---------- frame: rail | header + main ---------- */
.frame { display: flex; min-height: calc(100vh - 25px); }

.rail {
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  background: var(--plx-surface);
  border-right: 1px solid var(--plx-border);
  position: sticky; top: 0; height: 100vh; align-self: flex-start;
  display: flex; flex-direction: column;
  z-index: 50;
}
.rail-brand {
  height: var(--header-height); flex: 0 0 var(--header-height);
  display: flex; align-items: center; justify-content: center;
  background: var(--plx-accent);
  color: #fff !important;
  font-weight: 700; font-size: 13px; letter-spacing: 0.02em; white-space: nowrap;
}
.rail-brand .i { color: #fff; }
.rail-brand img { width: 100%; max-width: 84px; height: auto; }
.rail-main { flex: 1; overflow-y: auto; scrollbar-width: none; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.rail-main::-webkit-scrollbar { display: none; }
.rail-foot { padding: 6px 8px 10px; border-top: 1px solid #f0f0f0; display: flex; flex-direction: column; gap: 0; }
.rail-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 8px 2px; min-height: 52px;
  color: var(--plx-muted) !important;
  border-radius: var(--plx-radius-sm);
  transition: background 0.12s ease, color 0.12s ease;
}
.rail-item:hover { background: #f3f4f6; color: var(--plx-ink) !important; }
.rail-item.on { background: var(--plx-accent-tint); color: var(--plx-accent) !important; }
.rail-label { font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap; letter-spacing: -0.02em; }
.rail-foot .rail-item { min-height: 44px; padding: 6px 2px; }
.rail-foot .rail-item .ico { width: 20px; height: 20px; }
/* short screens: tighten the rail so all items fit without a scrollbar */
@media (max-height: 760px) {
  .rail-item { min-height: 46px; padding: 6px 2px; }
  .rail-item .ico { width: 21px; height: 21px; }
  .rail-foot .rail-item { min-height: 40px; }
}

.frame-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* header: white, 80px, purple page title, avatar chip on the right */
.topbar {
  height: var(--header-height); flex: 0 0 var(--header-height);
  background: var(--plx-surface); border-bottom: 1px solid var(--plx-border);
  display: flex; align-items: center; gap: 14px; padding: 0 28px;
  position: sticky; top: 0; z-index: 40;
}
.topbar-title {
  font-size: 25.5px; font-weight: 600; color: var(--plx-accent);
  margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar .spacer { flex: 1; }
.tier-chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border-radius: 9999px; background: var(--plx-accent-tint); border: 1px solid #e5d5ff;
  color: var(--plx-accent); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.userchip { position: relative; }
.userchip summary {
  list-style: none; display: flex; align-items: center; gap: 10px;
  padding: 3px 12px 3px 4px; border-radius: 9999px; cursor: pointer;
}
.userchip summary::-webkit-details-marker { display: none; }
.userchip summary:hover, .userchip[open] summary { background: var(--plx-row); }
.avatar {
  width: 32px; height: 32px; border-radius: 9999px; flex: 0 0 auto;
  background: var(--plx-accent-tint); color: var(--plx-accent);
  font-size: 13px; font-weight: 700; display: grid; place-items: center;
}
.who { display: flex; flex-direction: column; line-height: 1.25; }
.who b { font-size: 12.5px; font-weight: 600; color: var(--plx-ink); }
.who .who-e { font-size: 11px; color: var(--plx-muted); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 260px;
  background: #fff; border: 1px solid var(--plx-border); border-radius: var(--plx-radius);
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.14); padding: 6px; z-index: 80;
}
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--plx-border-soft); margin-bottom: 6px; display: flex; flex-direction: column; }
.menu-head b { font-size: 13px; }
.menu-head span { font-size: 11.5px; color: var(--plx-muted); }
.menu a, .menu button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; font-size: 13px;
  color: var(--plx-body) !important; background: none; border: 0; border-radius: var(--plx-radius-sm);
  font-family: inherit; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--plx-row); color: var(--plx-ink) !important; }

.main { padding: 26px 28px 64px; max-width: 1180px; width: 100%; }

/* ---------- page header row ---------- */
/* #app scope beats the hub's .page-head band (style.css) */
#app .page-head {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
  padding: 0; background: none; border: 0;
}
.page-head > :first-child { flex: 1 1 420px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-sub { color: var(--plx-muted); font-size: 13.5px; margin: 0 0 18px; max-width: 78ch; }
.page-head .page-sub { margin-bottom: 0; }
.crumbs { font-size: 12px; color: var(--plx-muted); margin-bottom: 10px; }
.h-lesson { font-size: 20px; font-weight: 700; color: var(--plx-ink); margin: 0 0 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 18px; white-space: nowrap;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; border-radius: var(--plx-radius-sm);
  cursor: pointer; transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn-primary { background: var(--plx-accent); border-color: var(--plx-accent); color: #fff !important; }
.btn-primary:hover { background: var(--plx-accent-dark); border-color: var(--plx-accent-dark); }
.btn-outline, .btn-ghost-dark { background: #fff; color: var(--plx-body) !important; border-color: var(--plx-border); }
.btn-outline:hover, .btn-ghost-dark:hover { background: var(--plx-row); color: var(--plx-ink) !important; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:disabled:hover { background: #fff; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---------- stats ---------- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 0 0 18px; }
.stat {
  display: block; background: var(--plx-surface); border: 1px solid var(--plx-border);
  border-radius: var(--plx-radius); padding: 16px 18px; color: inherit !important;
}
a.stat-link { transition: border-color 0.12s ease; }
a.stat-link:hover { border-color: #cdb4ff; }
.stat .label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--plx-muted-2); }
.stat .value { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; color: var(--plx-ink); line-height: 1.15; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--plx-muted); }
.stat .value-sm { font-size: 19px; }
.stat.accent .value { color: var(--plx-accent); }
.stat-note { font-size: 11.5px; color: var(--plx-muted); margin-top: 6px; }

.bar { height: 6px; background: var(--plx-border); border-radius: 9999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--plx-accent); border-radius: 9999px; }
.bar-flush { border-radius: 0; height: 3px; }
.bar-flush > i { border-radius: 0; }

/* ---------- panels ---------- */
.panel {
  background: var(--plx-surface); border: 1px solid var(--plx-border);
  border-radius: var(--plx-radius); margin-bottom: 18px; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 18px; border-bottom: 1px solid var(--plx-border-soft);
}
.panel-head h2 { font-size: 14px; font-weight: 700; margin: 0; color: var(--plx-ink); }
.panel-head .right { margin-left: auto; font-size: 12.5px; color: var(--plx-muted); }
.panel-head a.right { font-weight: 600; }
.panel-head > .chip:last-child { margin-left: auto; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }
.panel-tabbed { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); margin-bottom: 18px; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 > .course-card { margin-bottom: 0; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 9px 24px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--plx-muted); }
.kv dd { margin: 0; font-weight: 500; color: var(--plx-ink); }

/* ---------- badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; padding: 2px 10px; line-height: 1.5;
  border-radius: 9999px; border: 1px solid var(--plx-border); color: var(--plx-muted); background: #fff;
  text-transform: none; letter-spacing: 0;
}
.chip-solid { color: var(--plx-accent); border-color: #e5d5ff; background: var(--plx-accent-tint); }
.chip-ink { color: #fff; border-color: var(--plx-accent); background: var(--plx-accent); }
.chip-success { color: var(--plx-success); border-color: #bbf7d0; background: #f0fdf4; }
.chip-warning { color: var(--plx-warning); border-color: #fde68a; background: #fffbeb; }

/* ---------- callout ---------- */
.callout {
  background: #fff; border: 1px solid var(--plx-border); border-left: 3px solid var(--plx-accent);
  border-radius: var(--plx-radius-sm); padding: 12px 16px; font-size: 13px; margin: 0 0 18px; color: var(--plx-body);
}
.callout strong:first-child {
  display: block; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.4px;
  font-weight: 700; color: var(--plx-accent); margin-bottom: 4px;
}
.callout p { margin: 0; }

/* ---------- empty state ---------- */
.empty-state { padding: 28px 18px; text-align: center; color: var(--plx-muted); }
.empty-state .es-title { font-weight: 700; color: var(--plx-ink); font-size: 14px; margin-bottom: 4px; }
.empty-state p { margin: 0 0 12px; font-size: 13px; }

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 22px; border: 1px solid var(--plx-border); border-bottom: 1px solid var(--plx-border);
  background: #fff; padding: 0 18px; border-radius: var(--plx-radius) var(--plx-radius) 0 0;
  overflow-x: auto;
}
.tab {
  padding: 12px 2px; font-size: 13px; font-weight: 600; color: var(--plx-muted) !important;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--plx-ink) !important; }
.tab.on { color: var(--plx-ink) !important; border-bottom-color: var(--plx-accent); }
.tab-n {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 9999px;
  background: var(--plx-row); color: var(--plx-muted); font-size: 11px; text-align: center;
}
.tab.on .tab-n { background: var(--plx-accent-tint); color: var(--plx-accent); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; margin: 0; }
.tbl th {
  background: #f9fafb; font-size: 10.5px; font-weight: 700; color: var(--plx-muted-2);
  text-transform: uppercase; letter-spacing: 0.4px; text-align: left;
  padding: 10px 14px; border: 0; border-bottom: 1px solid var(--plx-border); white-space: nowrap;
}
.tbl td {
  font-size: 12.5px; color: var(--plx-ink); padding: 12px 14px;
  border: 0; border-bottom: 1px solid var(--plx-row); vertical-align: middle; text-align: left;
}
/* ids and ISO dates never wrap mid-token; free text keeps a readable width
 * and the table scrolls sideways on narrow screens instead of crushing it */
.tbl td.mono, .tbl td.nowrap { white-space: nowrap; }
.tbl td:last-child:not(.right):not(.num) { min-width: 190px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #f9fafb; }
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.total td { font-weight: 700; background: #f9fafb; border-top: 1px solid var(--plx-border); }
.tbl tr.rowlink { cursor: pointer; }
.tbl tr.sel td { background: var(--plx-accent-tint); }

.contact { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.contact > div { display: flex; flex-direction: column; gap: 2px; }
.contact b { font-size: 14px; }
.contact span { font-size: 12.5px; color: var(--plx-muted); }

/* ---------- continue card ---------- */
.continue {
  display: grid; grid-template-columns: 1fr; background: #fff; border: 1px solid var(--plx-border);
  border-radius: var(--plx-radius); overflow: hidden; margin-bottom: 18px;
}
@media (min-width: 760px) { .continue { grid-template-columns: 280px 1fr; } }
.continue .thumb { position: relative; min-height: 160px; background: var(--plx-ink-2); }
.continue .thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; z-index: 1; }
.continue .thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--plx-muted-2); font-size: 12px; }
.continue .body { padding: 20px 22px; }
.continue .k { font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--plx-accent); }
.continue h3 { margin: 6px 0 4px; font-size: 17px; font-weight: 700; color: var(--plx-ink); }
.continue p { color: var(--plx-muted); font-size: 13px; margin: 0 0 14px; }

/* ---------- learn ---------- */
.stage-block { margin-bottom: 10px; }
.stage-bar { display: flex; align-items: center; gap: 14px; padding: 16px 2px 10px; flex-wrap: wrap; }
.stage-bar .n {
  width: 34px; height: 34px; border-radius: var(--plx-radius-sm); background: var(--plx-accent);
  color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto;
}
.stage-bar h2 { font-size: 15.5px; font-weight: 700; margin: 0; color: var(--plx-ink); }
.stage-bar .sub { font-size: 12.5px; }
.stage-bar .stage-done { margin-left: auto; }
.lesson-row {
  display: flex; align-items: center; gap: 14px; padding: 11px 16px; margin-bottom: 6px;
  background: #fff; border: 1px solid var(--plx-border); border-radius: var(--plx-radius); color: inherit !important;
}
.lesson-row:hover { border-color: #cdb4ff; }
.lesson-row .id { font-weight: 700; color: var(--plx-accent); min-width: 34px; font-variant-numeric: tabular-nums; }
.lesson-row .t { flex: 1; font-size: 13.5px; font-weight: 500; color: var(--plx-ink); }
.lesson-row .m { font-size: 12px; color: var(--plx-muted); }
.lesson-row .check {
  width: 22px; height: 22px; border-radius: 9999px; border: 2px solid var(--plx-border);
  display: grid; place-items: center; color: transparent; flex: 0 0 auto;
}
.lesson-row.done .check { background: var(--plx-accent); border-color: var(--plx-accent); color: #fff; }

.player { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .player { grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr); } }
/* A big screen gives the room to the content that needs it: the lesson video
   takes the width, the steps keep a readable column. */
@media (min-width: 1500px) {
  .main { max-width: 1680px; }
  .player { grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; }
}
.video-frame { position: relative; background: var(--plx-ink-2); border-radius: var(--plx-radius); overflow: hidden; }
.video-frame .ribbon {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  background: rgba(12, 6, 58, 0.92); color: #cfc6f5;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 6px 12px;
}
.video-frame video { width: 100%; display: block; aspect-ratio: 16 / 9; background: #000; }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding: 11px 0 11px 40px; border-bottom: 1px dashed var(--plx-border); font-size: 13.5px; }
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 10px; width: 26px; height: 26px;
  border-radius: var(--plx-radius-sm); background: var(--plx-accent-tint); color: var(--plx-accent);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
}
.pager { display: flex; justify-content: space-between; gap: 10px; }

/* ---------- certification ---------- */
.course-card { background: #fff; border: 1px solid var(--plx-border); border-radius: var(--plx-radius); display: flex; flex-direction: column; }
.course-card .cc-head { padding: 18px 20px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.course-card .cc-head h3 { flex: 1 0 100%; margin: 8px 0 2px; font-size: 16px; font-weight: 700; color: var(--plx-ink); }
.course-card .cc-head h3 .muted { font-weight: 500; }
.cc-format { flex: 1 0 100%; font-size: 12px; color: var(--plx-muted); }
.course-card .cc-body { padding: 10px 20px 0; color: var(--plx-muted); font-size: 13px; flex: 1; }
.course-card .cc-foot { padding: 16px 20px 18px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cc-state { font-size: 12px; color: var(--plx-muted); }
.cc-state b { color: var(--plx-ink); }

/* ---------- resources ---------- */
.res-group { margin-bottom: 22px; }
.res-group .section-kicker { margin-bottom: 10px; }
.res-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.res-card {
  display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--plx-border);
  border-radius: var(--plx-radius); padding: 16px; color: inherit !important; transition: border-color 0.12s ease;
}
.res-card:hover { border-color: #cdb4ff; }
.res-top { display: flex; justify-content: space-between; align-items: center; color: var(--plx-muted-2); }
.res-kind { font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--plx-accent); }
.res-card b { font-size: 13.5px; color: var(--plx-ink); }
.res-card span:last-child { font-size: 12.5px; color: var(--plx-muted); }
.ticks { list-style: none; padding: 0; margin: 8px 0 0; }
.ticks li { position: relative; padding-left: 22px; margin-bottom: 6px; font-size: 12.5px; color: var(--plx-body); }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 5px; width: 9px; height: 5px;
  border-left: 2px solid var(--plx-accent); border-bottom: 2px solid var(--plx-accent); transform: rotate(-45deg);
}

/* ---------- exam ---------- */
.exam-top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff;
  border: 1px solid var(--plx-border); border-radius: var(--plx-radius); padding: 12px 16px; margin-bottom: 16px;
}
.exam-top .t { font-weight: 700; font-size: 14px; }
.exam-top .timer {
  margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px;
  background: var(--plx-accent-tint); border: 1px solid #e5d5ff; color: var(--plx-accent);
  padding: 4px 14px; border-radius: var(--plx-radius-sm);
}
.exam-top .timer.low { background: var(--plx-accent); border-color: var(--plx-accent); color: #fff; }
.exam-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 920px) { .exam-grid { grid-template-columns: 1fr 240px; } }
.qcard { background: #fff; border: 1px solid var(--plx-border); border-radius: var(--plx-radius); padding: 22px; }
.qcard .qmeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.qcard .qmeta .qn { font-weight: 700; color: var(--plx-accent); }
.qcard .qprompt { font-size: 16px; font-weight: 600; line-height: 1.45; margin-bottom: 18px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--plx-border); border-radius: var(--plx-radius-sm); cursor: pointer; font-size: 13.5px; background: #fff;
}
.opt:hover { border-color: #cdb4ff; }
.opt input { margin-top: 2px; accent-color: var(--plx-accent); width: 16px; height: 16px; flex: 0 0 auto; }
.opt.sel { border-color: var(--plx-accent); background: var(--plx-accent-tint); }
.opt .oi { font-weight: 700; color: var(--plx-accent); min-width: 16px; }
.order-list { list-style: none; margin: 0; padding: 0; }
.order-list li {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 8px;
  border: 1px solid var(--plx-border); border-radius: var(--plx-radius-sm); background: #fff; font-size: 13.5px;
}
.order-list li .pos { width: 24px; height: 24px; border-radius: var(--plx-radius-sm); background: var(--plx-accent-tint); color: var(--plx-accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.order-list li .txt { flex: 1; }
.order-list li button { border: 1px solid var(--plx-border); background: #fff; cursor: pointer; width: 30px; height: 30px; border-radius: var(--plx-radius-sm); }
.order-list li button:hover { border-color: var(--plx-accent); color: var(--plx-accent); }
.exam-nav { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.palette { background: #fff; border: 1px solid var(--plx-border); border-radius: var(--plx-radius); padding: 16px; align-self: start; }
.palette h4 { font-size: 10.5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--plx-muted-2); margin: 0 0 12px; }
.palette .cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 6px; }
.palette .cells a {
  display: grid; place-items: center; height: 34px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--plx-border); border-radius: var(--plx-radius-sm); color: var(--plx-ink) !important; background: #fff;
}
.palette .cells a.cur { background: var(--plx-accent); border-color: var(--plx-accent); color: #fff !important; }
.palette .cells a.ans { background: var(--plx-accent-tint); border-color: #e5d5ff; color: var(--plx-accent) !important; }
.result-banner { padding: 22px 24px; color: #fff; margin-bottom: 16px; border-radius: var(--plx-radius); }
.result-banner.pass { background: var(--plx-accent); }
.result-banner.fail { background: var(--plx-ink-2); }
.result-banner h2 { color: #fff; margin: 0 0 6px; font-size: 21px; }
.result-banner p { margin: 0; color: rgba(255, 255, 255, 0.85); }
.review-q { background: #fff; border: 1px solid var(--plx-border); border-radius: var(--plx-radius); padding: 16px 18px; margin-bottom: 10px; }
.review-q .rq-head { display: flex; gap: 12px; align-items: center; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.review-q .rq-head .ok { color: var(--plx-success); }
.review-q .rq-head .no { background: var(--plx-ink); color: #fff; padding: 1px 8px; border-radius: 9999px; }
.review-q .rq-p { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.review-q .rq-a { font-size: 13px; color: var(--plx-muted); }
.review-q .rq-a b { color: var(--plx-ink); }
.review-q .expl { font-size: 12.5px; background: var(--plx-accent-tint); border-left: 3px solid var(--plx-accent); padding: 9px 13px; margin-top: 10px; border-radius: 0 var(--plx-radius-sm) var(--plx-radius-sm) 0; }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.45); z-index: 90;
  display: none; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow-y: auto;
}
.modal-back.open { display: flex; }
.modal { background: #fff; border: 1px solid var(--plx-border); border-radius: var(--plx-radius); width: 100%; max-width: 480px; box-shadow: 0 18px 48px rgba(17, 24, 39, 0.14); }
.modal .m-head { padding: 14px 20px; border-bottom: 1px solid var(--plx-border-soft); font-weight: 700; font-size: 16px; display: flex; align-items: center; }
.modal .m-head .x { margin-left: auto; width: 32px; height: 32px; border: 0; background: transparent; border-radius: var(--plx-radius-sm); color: var(--plx-muted-2); cursor: pointer; font-size: 15px; }
.modal .m-head .x:hover { background: var(--plx-row); color: var(--plx-ink); }
.modal .m-body { padding: 20px; }
.modal .m-foot { display: flex; gap: 10px; padding-top: 6px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-error { color: var(--plx-danger); font-size: 12.5px; min-height: 18px; margin: -4px 0 8px; }

/* ---------- forms ---------- */
#app .field { margin-bottom: 14px; }
#app .field label { display: block; font-size: 12px; font-weight: 600; color: var(--plx-body); margin-bottom: 6px; }
#app .field .hint { display: block; font-size: 11.5px; color: var(--plx-muted); margin-top: 4px; }
#app .field input, #app .field select, #app .field textarea {
  width: 100%; height: 38px; padding: 0 12px; font-family: inherit; font-size: 13.5px; color: var(--plx-ink);
  background: #fff; border: 1px solid var(--plx-border); border-radius: var(--plx-radius-sm); outline: none;
}
#app .field textarea { height: 96px; padding: 10px 12px; resize: vertical; }
#app .field input:focus, #app .field select:focus, #app .field textarea:focus { border-color: var(--plx-accent); outline: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 120; max-width: 360px;
  background: var(--plx-ink); color: #fff; font-size: 13px; font-weight: 500;
  padding: 12px 16px; border-radius: var(--plx-radius); box-shadow: 0 18px 48px rgba(17, 24, 39, 0.24);
  opacity: 0; transform: translateY(8px); transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: flex-end;
  background:
    radial-gradient(95% 120% at 30% 48%, rgba(151, 63, 255, 0.78) 0%, rgba(88, 23, 165, 0.72) 34%, rgba(12, 2, 24, 0.98) 62%),
    linear-gradient(90deg, #eee8f5 0%, #7d35f2 36%, #130520 58%, #090111 100%);
}
.login-col {
  width: 100%; max-width: 560px; min-height: 100vh; margin-right: 4vw;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px;
}
.login-brand { display: block; height: 30px; width: auto; margin: 0 auto; }
.login-tag { color: #fff; font-size: 16px; font-weight: 500; margin: 8px 0 26px; text-align: center; text-shadow: 0 2px 14px rgba(40, 0, 90, 0.3); }
.login-card {
  width: 100%; max-width: 400px; background: #fff; padding: 32px;
  box-shadow: 0 30px 60px -18px rgba(50, 8, 110, 0.55);
}
.login-card h1 { margin: 0 0 22px; font-size: 28px; font-weight: 800; text-align: center; color: var(--plx-ink); letter-spacing: -0.02em; }
.login-foot { text-align: center; font-size: 12.5px; margin: 14px 0 0; color: var(--plx-body); }
@media (max-width: 900px) { .login-wrap { justify-content: center; } .login-col { margin: 0; } }

/* ---------- responsive: rail becomes a bottom tab bar ---------- */
@media (max-width: 860px) {
  .frame { flex-direction: column; }
  .rail {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; width: 100%; height: 64px;
    flex-direction: row; border-right: 0; border-top: 1px solid var(--plx-border);
  }
  .rail-brand, .rail-foot { display: none; }
  .rail-main { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 4px; gap: 2px; }
  .rail-item { flex: 1 1 0; min-width: 0; min-height: 0; padding: 8px 2px; }
  .rail-item .ico { width: 20px; height: 20px; }
  .rail-label { font-size: 10px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .topbar { height: 60px; flex-basis: 60px; padding: 0 14px; }
  .topbar-title { font-size: 20px; }
  .who, .tier-chip { display: none; }
  .userchip summary { padding: 2px; }
  .main { padding: 18px 14px 96px; }
  .grid-2 { grid-template-columns: 1fr; }
}
/* Narrow phones: the tab labels are shortened by the label itself, the bar
   keeps every destination reachable without a horizontal scroll. */
@media (max-width: 420px) {
  .rail-label { font-size: 9.5px; letter-spacing: -0.03em; }
  .rail-item { padding: 8px 1px; }
  .main { padding: 16px 12px 96px; }
}

/* ---------- boot / loading ---------- */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--plx-muted); }
.spinner { width: 20px; height: 20px; border-radius: 9999px; border: 2px solid var(--plx-border); border-top-color: var(--plx-accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.demo-ribbon button {
  margin-left: 10px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35);
  border-radius: 9999px; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 10px; cursor: pointer;
}
.demo-ribbon button:hover { background: rgba(255,255,255,.12); }
a.tier-chip:hover { border-color: var(--plx-accent); }
.toast-error { background: var(--plx-danger); }
.qimg { max-height: 260px; border: 1px solid var(--plx-border); border-radius: var(--plx-radius-sm); margin: -6px 0 16px; }
.res-card.soon { cursor: default; }
.res-card.soon:hover { border-color: var(--plx-border); }

/* ---------- revenue tier bar ---------- */
.tierbar .tb-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.tierbar .tb-arr { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--plx-ink); line-height: 1.1; margin-top: 4px; }
.tb-labels { position: relative; height: 34px; }
.tb-lab {
  position: absolute; bottom: 4px; display: flex; flex-direction: column; padding: 0 8px; overflow: hidden;
}
.tb-seg-name { font-size: 11.5px; font-weight: 700; color: var(--plx-muted); white-space: nowrap; line-height: 1.2; }
.tb-seg-rate { font-size: 11px; color: var(--plx-muted-2); line-height: 1.2; }
.tb-lab.cur .tb-seg-name { color: var(--plx-accent); }
.tb-lab.cur .tb-seg-rate { color: var(--plx-accent); }
.tb-track {
  position: relative; height: 18px; border-radius: 9999px; background: var(--plx-row);
  margin: 0 0 30px; overflow: visible;
}
.tb-seg {
  position: absolute; top: 0; bottom: 0; border-right: 2px solid #fff; z-index: 2; pointer-events: none;
}
.tb-seg:last-child { border-right: 0; }
.tb-seg.cur::after {
  content: ""; position: absolute; inset: -4px 0; border: 2px solid var(--plx-ink); border-radius: 4px;
}
.tb-fill {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 1;
  background: linear-gradient(90deg, #a265ff 0%, var(--plx-accent) 100%);
  border-radius: 9999px 0 0 9999px; transition: width .6s ease;
}
.tb-pin { position: absolute; top: -6px; bottom: -6px; width: 0; border-left: 2px solid var(--plx-ink); z-index: 3; }
/* the value badge sits in the gap between the tier labels and the track */
.tb-pin span { display: none; }
.tb-mark { position: absolute; bottom: -24px; transform: translateX(-50%); z-index: 3; }
.tb-mark span { font-size: 11px; font-weight: 600; color: var(--plx-muted); white-space: nowrap; }
.tb-msg { font-size: 14px; margin: 0; color: var(--plx-body); }
.tb-msg b { color: var(--plx-ink); }
.tierbar .fine { margin-top: 8px; }
@media (max-width: 600px) {
  .tb-lab { padding: 0 4px; }
  .tb-seg-name { font-size: 10.5px; }
}

/* ---------- certification seats ---------- */
.seats { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.seats > div { display: flex; flex-direction: column; gap: 2px; }
.seat-count { font-size: 15px; }
.seat-count b { font-size: 20px; }
.seats .muted { font-size: 12.5px; }
