/* ============================================================
   StampReady — Production Stylesheet
   NCEES-inspired white theme · Navy/Blue primary · Orange accent
   ============================================================ */

/* --- 1. CSS Variables ---------------------------------------- */
:root {
  --bg: #f4f6f9;
  --s1: #ffffff;
  --s2: #f0f2f5;
  --s3: #e8ecf0;
  --bd: rgba(0,0,0,0.08);
  --bd2: rgba(0,0,0,0.16);
  --tx: #0f1c2a;
  --mu: #6b7f96;
  --dim: #c8d4e0;
  --ac: #cc0000;
  --ac2: #dd1111;
  --acb: rgba(204,0,0,0.10);
  --bl: #2175c4;
  --gr: #1d944a;
  --ye: #a07c10;
  --re: #c0212e;
  --pu: #6d3ec4;
  --fn: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  --fm: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  --r: 6px;
  --r2: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 6px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
}

/* --- 2. Reset ------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--fn);
  font-size: 13px;
  line-height: 1.55;
  color: var(--tx);
  background: var(--bg);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-size: inherit; font-weight: inherit; }
a { color: var(--bl); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }

/* --- 3. Scrollbars ------------------------------------------- */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--mu); }
* { scrollbar-width: thin; scrollbar-color: var(--dim) transparent; }

/* --- 4. Layout ----------------------------------------------- */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- 5. Nav -------------------------------------------------- */
.nav {
  background: var(--s1);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--bd);
}
.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-center {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* --- 6. Nav Brand -------------------------------------------- */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--tx);
  cursor: pointer;
  white-space: nowrap;
}
.nav-brand img,
.nav-brand svg {
  width: 28px;
  height: 28px;
}
.nav-brand span {
  letter-spacing: -0.3px;
}

/* --- 6b. Mobile Menu Button ---------------------------------- */
#mob-menu-btn {
  display: inline-block !important;
}

/* --- 7. Nav Tabs --------------------------------------------- */
.nav-tab {
  display: none; /* Hidden on mobile — shown via hamburger menu */
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  height: 48px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mu);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.nav-tab:hover {
  color: var(--tx);
}
.nav-tab.on {
  color: var(--ac);
  border-bottom-color: var(--ac);
}

/* --- 8. Buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--fn);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.97); }

.btn-p {
  background: var(--ac);
  color: #fff;
  border-color: var(--ac);
}
.btn-p:hover { background: var(--ac2); border-color: var(--ac2); }

.btn-o {
  background: transparent;
  color: var(--ac);
  border-color: var(--ac);
}
.btn-o:hover { background: var(--acb); }

.btn-g {
  background: transparent;
  color: var(--mu);
  border-color: transparent;
}
.btn-g:hover { background: var(--s2); color: var(--tx); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 4px; }

.btn:disabled, .btn.disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

/* --- 9. Panels ----------------------------------------------- */
.panel { display: none; flex-direction: column; flex: 1; }
.panel.on { display: flex; }
.page {
  padding: 14px 10px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* --- 10. Cards ----------------------------------------------- */
.card {
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: var(--r2);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
  box-shadow: var(--shadow);
  border-color: var(--bd2);
}

/* --- 11. Section Labels -------------------------------------- */
.sec-lbl {
  font-family: var(--fm);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--mu);
  margin-bottom: 12px;
}

/* --- 12. Tags ------------------------------------------------ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  line-height: 1.5;
  white-space: nowrap;
}
.tag-pe { background: rgba(33,117,196,0.10); color: var(--bl); }
.tag-nurse { background: rgba(109,62,196,0.10); color: var(--pu); }
.tag-it { background: var(--acb); color: var(--ac); }
.tag-free { background: rgba(29,148,74,0.10); color: var(--gr); }
.tag-ref { background: rgba(109,62,196,0.10); color: var(--pu); }
.tag-abet { background: rgba(33,117,196,0.10); color: var(--bl); }
.tag-paid { background: var(--acb); color: var(--ac); }

/* --- 13. Pills ----------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  line-height: 1.4;
}
.pill-ok { background: rgba(29,148,74,0.10); color: var(--gr); }
.pill-warn { background: rgba(160,124,16,0.10); color: var(--ye); }
.pill-err { background: var(--acb); color: var(--ac); }
.pill-info { background: rgba(33,117,196,0.10); color: var(--bl); }

/* --- 14. Form Inputs ----------------------------------------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  font-family: var(--fn);
  font-size: 13px;
  color: var(--tx);
  background: var(--s1);
  border: 1px solid var(--bd2);
  border-radius: var(--r);
  padding: 8px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 3px var(--acb);
}
input::placeholder, textarea::placeholder {
  color: var(--dim);
}
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }

/* --- 15. Grids ----------------------------------------------- */
.g2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.g3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* --- 16. Tables ---------------------------------------------- */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--mu);
  background: var(--s2);
  border-bottom: 1px solid var(--bd2);
}
.tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--bd);
}
.tbl tr:hover td {
  background: var(--s2);
}

/* --- 17. Toasts ---------------------------------------------- */
#toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  font-size: 13px;
  min-width: 280px;
  max-width: 400px;
  border-left: 4px solid var(--mu);
  animation: toastIn 0.3s ease forwards;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.out { animation: toastOut 0.25s ease forwards; }
.toast-ok { border-left-color: var(--gr); }
.toast-err { border-left-color: var(--re); }
.toast-warn { border-left-color: var(--ye); }
.toast-info { border-left-color: var(--bl); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* --- 18. Modals ---------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.40);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  padding: 20px;
}
.mbox {
  background: var(--s1);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  border-radius: var(--r2);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  padding: 24px;
  animation: slideUp 0.25s ease;
  position: relative;
}
.mhdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.mtitle {
  font-size: 16px;
  font-weight: 700;
  color: var(--tx);
  line-height: 1.3;
}
.mclose {
  background: none;
  border: 1px solid var(--bd);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  color: var(--mu);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.mclose:hover { background: var(--s2); }
.mbody { margin-bottom: 16px; }
.mfoot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--bd);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* --- 19. Auth Screen ----------------------------------------- */
#auth {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background: linear-gradient(135deg, #1a2a42 0%, #0f1c2a 60%, #162236 100%);
}
.acard {
  background: var(--s1);
  border-radius: var(--r2);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 20px 16px;
  margin: 8px;
}
.acard h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}
.acard p {
  color: var(--mu);
  font-size: 13px;
  margin-bottom: 20px;
}
.atabs {
  display: flex;
  border-bottom: 1px solid var(--bd);
  margin-bottom: 20px;
}
.atab {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--mu);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.atab.on {
  color: var(--ac);
  border-bottom-color: var(--ac);
}
.role-g {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.role-g label {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: 2px solid var(--bd);
  border-radius: var(--r);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--mu);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  text-align: center;
}
.role-g label:hover { border-color: var(--bd2); }
.role-g input { display: none; }
.role-g input:checked + label,
.role-g label.on {
  border-color: var(--ac);
  color: var(--ac);
  background: var(--acb);
}
.demo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--bd);
  font-size: 12px;
  color: var(--mu);
}

/* --- 20. Marketplace ----------------------------------------- */
.mkt-head {
  padding: 28px 0 16px;
}
.mkt-h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 4px;
}
.mkt-h2 {
  font-size: 14px;
  color: var(--mu);
  font-weight: 400;
}
.vert-row {
  display: flex;
  gap: 24px;
  margin: 16px 0;
}
.vert-row .vstat {
  display: flex;
  flex-direction: column;
}
.vert-row .vstat-n {
  font-size: 22px;
  font-weight: 700;
  color: var(--tx);
}
.vert-row .vstat-l {
  font-size: 11px;
  color: var(--mu);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fbar {
  position: sticky;
  top: 52px;
  z-index: 50;
  background: var(--s1);
  border-bottom: 1px solid var(--bd);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid var(--bd2);
  background: var(--s1);
  color: var(--mu);
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--ac); color: var(--ac); }
.chip.on {
  background: var(--ac);
  color: #fff;
  border-color: var(--ac);
}
.mkt-src {
  flex: 1;
  min-width: 180px;
  padding: 7px 12px 7px 32px;
  font-size: 13px;
  border: 1px solid var(--bd2);
  border-radius: 20px;
  background: var(--s2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%236b7f96' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") 10px center no-repeat;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.mkt-src:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 3px var(--acb);
}

/* --- 21. NCEES-Style Marketplace Cards ----------------------- */
.ncees-card {
  display: flex;
  align-items: stretch;
  height: 148px;
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: var(--r2);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}
.ncees-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--bd2);
}
.ncees-cover {
  width: 100px;
  min-width: 100px;
  background: var(--s2);
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--bd);
}
.ncees-cover svg {
  width: 48px;
  height: 48px;
  color: var(--dim);
}
.ncees-info {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.ncees-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--tx);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ncees-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--ac);
}
.ncees-price .ncees-was {
  font-size: 12px;
  font-weight: 400;
  color: var(--mu);
  text-decoration: line-through;
  margin-left: 6px;
}
.ncees-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  background: var(--ac);
  color: #fff;
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  transition: background 0.15s;
}
.ncees-cta:hover { background: var(--ac2); }
.ncees-free { color: var(--gr); font-size: 13px; font-weight: 700; }
.ncees-pub { color: var(--bl); font-size: 11px; font-weight: 600; }
.ncees-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 7px; border-top: 1px solid var(--bd); margin-top: auto; }
.ncees-seller { font-size: 10px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncees-q { font-size: 10px; color: var(--mu); margin-bottom: 6px; }

/* --- 22. Listing Cards --------------------------------------- */
.lcard {
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: var(--r2);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}
.lcard:hover {
  box-shadow: var(--shadow);
  border-color: var(--bd2);
}
.ltitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--tx);
  margin-bottom: 6px;
  line-height: 1.35;
}
.lmeta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--mu);
  margin-bottom: 10px;
}
.lstats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--mu);
  margin-bottom: 12px;
}
.lstats span { display: inline-flex; align-items: center; gap: 3px; }
.lprice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.price {
  font-size: 18px;
  font-weight: 700;
  color: var(--ac);
}
.seller {
  font-size: 12px;
  color: var(--mu);
}
.stars {
  color: var(--ye);
  font-size: 12px;
  letter-spacing: 1px;
}
.price-free { color: var(--gr); }
.vdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.vname { color: var(--tx); font-weight: 500; }
.vcnt { font-family: var(--fm); font-size: 10px; color: var(--mu); }

/* --- 23. Simulator ------------------------------------------- */
#sim {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.stop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 16px;
  background: #0f1c2a;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.stimer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 4px;
  font-family: var(--fm);
  font-size: 13px;
  font-weight: 600;
  background: rgba(33,117,196,0.15);
  color: var(--bl);
}
.stimer.warn { background: rgba(160,124,16,0.15); color: var(--ye); }
.stimer.danger { background: rgba(192,33,46,0.15); color: var(--re); animation: pulse 1s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.sprog {
  height: 3px;
  background: var(--s3);
  flex-shrink: 0;
}
.sprog-fill {
  height: 100%;
  background: var(--ac);
  transition: width 0.3s ease;
  border-radius: 0 3px 3px 0;
}
.ssplit {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}
.spane {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--bd);
}
.spane:last-child { border-right: none; }
.phdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--bd);
  background: var(--s1);
  flex-shrink: 0;
}
.plbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--mu);
}
.pbody {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: var(--s1);
}

/* --- 24. Pane Tabs (mobile) ---------------------------------- */
#ptabs {
  display: flex;
  background: var(--s1);
  border-bottom: 1px solid var(--bd);
}
.ptab {
  flex: 1;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--mu);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.ptab.on { color: var(--ac); border-bottom-color: var(--ac); }

/* --- 25. Question Display ------------------------------------ */
.qmeta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--mu);
}
.qtag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.qtext {
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 20px;
  color: var(--tx);
}
.opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--bd);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 14px;
  line-height: 1.5;
}
.opt:hover { border-color: var(--bd2); background: var(--s2); }
.opt.sel { border-color: var(--bl); background: rgba(33,117,196,0.06); }
.opt.cor { border-color: var(--gr); background: rgba(29,148,74,0.10); }
.opt.inc { border-color: #dc3545; background: rgba(220,53,69,0.08); }
.opt.rev { border-color: var(--gr); background: rgba(29,148,74,0.06); }
.oltr {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--s2);
  color: var(--mu);
  border: 2px solid var(--bd2);
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.opt.sel .oltr { background: var(--bl); color: #fff; border-color: var(--bl); }
.opt.cor .oltr { background: var(--gr); color: #fff; border-color: var(--gr); }
.opt.inc .oltr { background: #dc3545; color: #fff; border-color: #dc3545; }
.fb {
  display: none;
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--r);
  font-size: 13px;
  line-height: 1.6;
}
.fb.show { display: block; }
.fb.ok {
  background: rgba(29,148,74,0.08);
  border: 1px solid rgba(29,148,74,0.2);
  color: var(--gr);
}
.fb.wr {
  background: var(--acb);
  border: 1px solid rgba(224,92,46,0.2);
  color: var(--ac);
}
.flag-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--mu);
  background: none;
  border: 1px solid var(--bd2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.flag-btn:hover { color: var(--ye); border-color: var(--ye); }
.flag-btn.on { color: var(--ye); border-color: var(--ye); background: rgba(160,124,16,0.08); }

/* --- 26. Reference Panel ------------------------------------- */
.rtabs {
  display: flex;
  border-bottom: 1px solid var(--bd);
  background: var(--s2);
  flex-shrink: 0;
}
.rtab {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mu);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.rtab:hover { color: var(--tx); }
.rtab.on { color: var(--ac); border-bottom-color: var(--ac); }
.rsearch {
  padding: 10px 16px;
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0;
}
.rsearch input {
  width: 100%;
  padding: 7px 12px;
  font-size: 12px;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  background: var(--s2);
}
.rcontent {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}
.rcontent h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  margin: 16px 0 8px;
}
.rcontent h4:first-child { margin-top: 0; }
.rform {
  background: var(--s2);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 12px 16px;
  font-family: var(--fm);
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 12px;
  overflow-x: auto;
}
.rtbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 12px;
}
.rtbl th {
  text-align: left;
  padding: 6px 10px;
  background: var(--s3);
  font-weight: 600;
  border-bottom: 1px solid var(--bd2);
}
.rtbl td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--bd);
}

/* --- 27. Calculator ------------------------------------------ */
#calc {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cshell {
  background: #07101a;
  border-top: 1px solid #1e3550;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.cclose {
  background: none;
  border: none;
  color: #3a6080;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  min-width: 30px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cclose:hover { color: #fff; }
.ctop {
  background: #040c14;
  padding: 9px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e3550;
  border-radius: 16px 16px 0 0;
}
.cbrand { font-size: 10px; color: #3a6080; letter-spacing: .1em; text-transform: uppercase; font-family: var(--fm); }
.cmodes { display: flex; gap: 4px; }
.cmode { font-size: 10px; padding: 3px 8px; border-radius: 3px; cursor: pointer; color: #3a6080; border: 1px solid transparent; font-family: var(--fm); }
.cmode.on { background: rgba(59,143,212,.15); color: var(--bl); border-color: rgba(59,143,212,.3); }
.cdisp {
  background: #030a10;
  padding: 10px 14px;
  border-bottom: 1px solid #1e3550;
}
.cexpr {
  font-size: 11px;
  color: #2e5575;
  min-height: 15px;
  text-align: right;
  font-family: var(--fm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmain {
  font-size: 28px;
  color: #7dd3fc;
  text-align: right;
  min-height: 38px;
  word-break: break-all;
  line-height: 1.2;
  font-family: var(--fm);
  margin-top: 3px;
}
.cmem { font-size: 10px; color: #1e4060; text-align: right; min-height: 14px; font-family: var(--fm); }
.cangle { font-size: 9px; color: #2e5575; text-align: left; font-family: var(--fm); margin-top: 3px; }
.cbtns {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.cb {
  height: 44px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-family: var(--fm);
  font-size: 12px;
  font-weight: 500;
  transition: background .1s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  line-height: 1.2;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}
.cb:active { filter: brightness(1.3); }
.cb2lbl {
  font-size: 8px;
  color: var(--ye);
  position: absolute;
  top: 3px;
  left: 0;
  right: 0;
  text-align: center;
  opacity: .7;
}
.cb-n { background: #162638; color: #c8dff0; }
.cb-o { background: #1a3350; color: #7dd3fc; }
.cb-f { background: #102030; color: #93c5fd; }
.cb-c { background: #0a1820; color: #5a8aaa; }
.cb-e { background: #c94e28; color: #fff; }
.cb-2 { background: #5a4a08; color: var(--ye); }
.cb-m { background: #102030; color: #86efac; }
.cuconv { padding: 8px 14px; border-top: 1px solid #1e3550; }
.ucrow { display: flex; gap: 7px; align-items: center; margin-bottom: 7px; }
.ucin {
  background: #030a10; border: 1px solid #1e3550; border-radius: 4px;
  padding: 6px 8px; font-size: 14px; color: #7dd3fc; font-family: var(--fm);
  width: 90px; -webkit-appearance: none;
}
.ucsel {
  background: #030a10; border: 1px solid #1e3550; border-radius: 4px;
  padding: 6px 8px; font-size: 12px; color: #93c5fd; flex: 1;
  -webkit-appearance: none;
}
.ucres {
  background: #030a10; border: 1px solid rgba(59,143,212,.2); border-radius: 4px;
  padding: 6px 8px; font-size: 13px; color: #7dd3fc; font-family: var(--fm);
  min-width: 80px;
}
.chist {
  background: #030a10; border-top: 1px solid #1e3550;
  max-height: 72px; overflow-y: auto; padding: 5px 12px;
}
.chi {
  font-size: 10px; color: #2e5575; padding: 2px 0;
  display: flex; justify-content: space-between;
  font-family: var(--fm); cursor: pointer;
}
.chi:hover { color: #4e7595; }

/* --- 28. Results --------------------------------------------- */
#res {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  background: rgba(0,0,0,0.5);
}
.rcard {
  background: var(--s1);
  border-radius: var(--r2);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 16px;
  margin: 10px;
  text-align: center;
}
.rpct {
  font-size: 48px;
  font-weight: 800;
  color: var(--tx);
  line-height: 1;
  margin-bottom: 4px;
}
.rsub {
  font-size: 14px;
  color: var(--mu);
  margin-bottom: 24px;
}
.rstats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.rs {
  padding: 14px 8px;
  background: var(--s2);
  border-radius: var(--r);
  text-align: center;
}
.rs-n {
  font-size: 22px;
  font-weight: 700;
  color: var(--tx);
}
.rs-l {
  font-size: 11px;
  color: var(--mu);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 2px;
}
.trow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
}
.tname {
  width: 120px;
  text-align: left;
  font-weight: 500;
  color: var(--tx);
  flex-shrink: 0;
}
.tbg {
  flex: 1;
  height: 8px;
  background: var(--s3);
  border-radius: 4px;
  overflow: hidden;
}
.tfill {
  height: 100%;
  border-radius: 4px;
  background: var(--ac);
  transition: width 0.5s ease;
}
.tscore {
  width: 40px;
  text-align: right;
  font-weight: 700;
  font-size: 13px;
  color: var(--tx);
  flex-shrink: 0;
}
.ract {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}
.rbtn {
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.rbtn-p { background: var(--ac); color: #fff; }
.rbtn-p:hover { background: var(--ac2); }
.rbtn-s { background: var(--s2); color: var(--tx); }
.rbtn-s:hover { background: var(--s3); }

/* --- 29. Seller ---------------------------------------------- */
.vblock {
  background: var(--s1);
  border: 1px solid var(--bd);
  border-left: 4px solid var(--pu);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 16px;
}
.co {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid var(--bd);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 8px;
}
.co:hover { border-color: var(--bd2); }
.co.on { border-color: var(--pu); background: rgba(109,62,196,0.06); }
.rprev {
  background: var(--s2);
  border-radius: var(--r);
  padding: 20px;
  margin-top: 16px;
}
.rrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--bd);
}
.rrow:last-child { border-bottom: none; }
.rrow .tot {
  font-weight: 700;
  font-size: 16px;
  color: var(--gr);
}

/* --- 30. Admin ----------------------------------------------- */
.agrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.astat {
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.astat-n {
  font-size: 26px;
  font-weight: 800;
  color: var(--tx);
}
.astat-l {
  font-size: 12px;
  color: var(--mu);
  margin-top: 2px;
}
.chart {
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 20px;
  margin-bottom: 16px;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
}
.chart-bar {
  flex: 1;
  background: var(--bl);
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
  min-height: 4px;
}
.chart-bar:hover { opacity: 0.8; }
.fpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  margin-bottom: 6px;
  font-size: 13px;
}
.logbox {
  background: #0f1c2a;
  color: #4ecdc4;
  font-family: var(--fm);
  font-size: 12px;
  line-height: 1.7;
  border-radius: var(--r);
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
}
.logbox .log-line {
  padding: 1px 0;
}
.logbox .log-ts { color: #5a6a7e; }
.logbox .log-warn { color: var(--ye); }
.logbox .log-err { color: var(--re); }

/* --- 31. Checklist ------------------------------------------- */
.cl-section {
  margin-bottom: 24px;
}
.cl-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 10px;
}
.cl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  margin-bottom: 6px;
  background: var(--s1);
  transition: opacity 0.2s, background 0.2s;
}
.cl-item.done {
  opacity: 0.55;
  background: var(--s2);
}
.cl-item.done .cl-name {
  text-decoration: line-through;
}
.cl-check {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 4px;
  border: 2px solid var(--bd2);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: var(--s1);
  transition: background 0.15s, border-color 0.15s;
  margin-top: 1px;
}
.cl-check:checked {
  background: var(--ac);
  border-color: var(--ac);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px;
}
.cl-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--tx);
  line-height: 1.4;
}
.cl-detail {
  font-size: 12px;
  color: var(--mu);
  margin-top: 2px;
}
.cl-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.cl-tag.p1 { background: rgba(192,33,46,0.10); color: var(--re); }
.cl-tag.p2 { background: var(--acb); color: var(--ac); }
.cl-tag.p3 { background: rgba(33,117,196,0.10); color: var(--bl); }

/* --- 32. Profile --------------------------------------------- */
.avatar-pick {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.avatar-pick .av {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--bd);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--s2);
  font-size: 20px;
}
.avatar-pick .av:hover { border-color: var(--bd2); }
.avatar-pick .av.on { border-color: var(--ac); }
.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.plan-card {
  background: var(--s1);
  border: 2px solid var(--bd);
  border-radius: var(--r2);
  padding: 24px 20px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.plan-card:hover { border-color: var(--bd2); box-shadow: var(--shadow); }
.plan-card.on { border-color: var(--ac); }
.plan-card h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.plan-card .plan-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--ac);
  margin-bottom: 8px;
}
.plan-card .plan-price span {
  font-size: 13px;
  font-weight: 400;
  color: var(--mu);
}
.plan-card ul {
  text-align: left;
  font-size: 13px;
  color: var(--mu);
}
.plan-card li {
  padding: 4px 0;
}
.plan-card li::before {
  content: '✓ ';
  color: var(--gr);
  font-weight: 700;
}

/* ═══ MOBILE BOTTOM TAB BAR ═══ */
.mob-tabs {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--s1);
  border-top: 1px solid var(--bd);
  z-index: 99;
  padding: 4px 0 max(4px, env(safe-area-inset-bottom));
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mob-tabs::-webkit-scrollbar { display: none; }
.mob-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  font-size: 9px;
  font-weight: 500;
  color: var(--mu);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}
.mob-tab.on { color: var(--ac); }
.mob-tab-icon { font-size: 18px; }

/* Add bottom padding to content so it's not hidden behind tab bar */
.content { padding-bottom: 70px; }

@media (min-width: 768px) {
  .mob-tabs { display: none; }
  .content { padding-bottom: 0; }
}

/* ═══ MOBILE-FIRST RESPONSIVE BREAKPOINTS ═══ */
/* Base = 320px (iPhone SE, smallest phone) */
/* Everything above is an enhancement */

/* Mobile base: tables scroll, search full-width, single column */
table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.spane:first-child { display: none; }
.spane.on { display: flex; }
.fbar { flex-wrap: wrap; gap: 4px; top: 48px; padding: 8px 10px; }
.mkt-src { min-width: 100%; margin-bottom: 4px; }
.tname { width: 80px; font-size: 11px; }
.ncees-card { height: auto; }
.ncees-cover { width: 70px; min-width: 70px; }
#cookie-banner { flex-direction: column !important; gap: 8px !important; text-align: center !important; }
#support-chat { width: calc(100vw - 24px) !important; right: 12px !important; bottom: 70px !important; max-height: 70vh !important; }
#av-menu { right: -10px !important; min-width: 200px !important; }
.ract { flex-wrap: wrap; }

/* ── 480px: Larger phones / iPhone landscape ── */
@media (min-width: 480px) {
  body { font-size: 14px; }
  .page { padding: 16px 14px; }
  .card { padding: 16px; }
  .acard { padding: 24px 20px; margin: 12px; }
  .tname { width: 100px; font-size: 12px; }
  .ncees-cover { width: 90px; min-width: 90px; }
  .agrid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Landscape phone: side-by-side simulator ── */
@media (min-width: 568px) and (orientation: landscape) {
  .ssplit { grid-template-columns: 55fr 45fr; }
  .spane:first-child { display: flex; }
  #ptabs { display: none; }
  .mob-tabs { display: none; }
}

/* ── 768px: Tablet / iPad ── */
@media (min-width: 768px) {
  .nav { height: 52px; padding: 0 20px; }
  .nav-tab { display: inline-flex; } /* Show nav tabs */
  #mob-menu-btn { display: none !important; } /* Hide hamburger on desktop */
  #mob-menu-btn { display: none !important; } /* Hide hamburger on desktop */
  .fbar { top: 52px; padding: 10px 20px; }
  .mkt-src { min-width: 180px; }
  .page { padding: 20px 18px; }
  .card { padding: 18px; }
  .g2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .g3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .acard { padding: 28px 24px; }
  .rcard { padding: 28px 24px; }
  .rpct { font-size: 56px; }
  .ncees-card { height: 148px; }
  .ncees-cover { width: 100px; min-width: 100px; }
  .agrid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .tname { width: 120px; font-size: 13px; }
  table { display: table; overflow-x: visible; }
  #support-chat { width: 360px !important; right: 20px !important; max-height: 500px !important; }
  #cookie-banner { flex-direction: row !important; }
  #av-menu { right: 0 !important; min-width: 220px !important; }
  .mastery-disc { width: 140px; font-size: 12px; }
}

/* ── 1024px: Laptop ── */
@media (min-width: 1024px) {
  .page { padding: 24px 20px; }
  .card { padding: 20px; }
  .g3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .g2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .ssplit { grid-template-columns: 55fr 45fr; } /* Split simulator view */
  .spane:first-child { display: flex; } /* Show both panes */
  #ptabs { display: none; } /* Hide pane tabs on desktop */
  .rcard { padding: 32px; }
  .rpct { font-size: 60px; }
  .acard { padding: 32px 28px; }
}

/* ── 1280px: Desktop ── */
@media (min-width: 1280px) {
  .page { max-width: 1200px; }
  .g3 { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .mbox { max-width: 560px; }
}

/* --- 34. Reference Permissibility Highlights ----------------- */
.perm-ok {
  box-shadow: 0 0 0 2px rgba(29,148,74,0.25), 0 0 12px rgba(29,148,74,0.15);
  border-color: var(--gr);
}
.perm-no {
  box-shadow: 0 0 0 2px rgba(192,33,46,0.25), 0 0 12px rgba(192,33,46,0.15);
  border-color: var(--re);
}

/* --- Utility Classes ----------------------------------------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-mu { color: var(--mu); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══ CONTENT PROTECTION ═══ */
.q-protected { -webkit-user-select: none; user-select: none; position: relative; }
.q-protected::after {
  content: 'Licensed to ' attr(data-user) ' · StampReady';
  position: absolute; bottom: 4px; right: 8px;
  font-family: var(--fm); font-size: 8px; color: rgba(0,0,0,0.06);
  pointer-events: none; letter-spacing: .03em;
}
.ref-protected { -webkit-user-select: none; user-select: none; }
.ref-watermark {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-35deg);
  font-size: 48px; font-weight: 900; color: rgba(0,0,0,0.025);
  pointer-events: none; z-index: 1; white-space: nowrap; letter-spacing: 8px;
  font-family: var(--fm);
}
@media print { body * { display: none !important; } body::after { content: 'Printing disabled — StampReady content is licensed per-user.'; display: block; padding: 40px; font-size: 18px; text-align: center; color: #333; } }

/* ═══ ACCESSIBILITY ═══ */
/* Focus visible indicator — WCAG 2.4.7 */
:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 2px;
}
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(204,0,0,0.15);
}
/* Skip to content link — WCAG 2.4.1 */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--ac);
  color: #fff;
  padding: 8px 16px;
  z-index: 10000;
  font-size: 14px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}
/* Ensure minimum contrast on muted text */
.sec-lbl, .qmeta span { color: #555 !important; }
/* High contrast mode support */
@media (forced-colors: active) {
  .btn, .chip, .pill, .tag { border: 1px solid ButtonText; }
  .opt.cor, .opt.inc { border: 2px solid ButtonText; }
}
/* Reduced motion preference — WCAG 2.3.3 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .toast { animation: none !important; }
}

/* ═══ DIAGNOSTIC & STUDY HUB ═══ */

/* Mastery Heatmap */
.mastery-grid { display: flex; flex-direction: column; gap: 6px; }
.mastery-row { display: flex; align-items: stretch; gap: 4px; }
.mastery-disc {
  width: 140px; flex-shrink: 0; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  background: var(--s2); border-radius: var(--r); color: var(--tx);
}
.mastery-cell {
  flex: 1; min-width: 60px; padding: 6px 4px; border-radius: var(--r);
  text-align: center; font-family: var(--fm); font-size: 10px; font-weight: 600;
  color: #fff; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.mastery-cell:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.mastery-cell .mc-name { font-size: 8px; opacity: 0.85; font-weight: 400; }
/* Mastery heatmap: mobile base is compact */
.mastery-disc { width: 90px; font-size: 10px; }
.mastery-cell { min-width: 36px; font-size: 9px; }

/* Confidence Slider */
.conf-slider { display: flex; gap: 4px; margin-top: 12px; justify-content: center; }
.conf-btn {
  padding: 8px 12px; border: 1.5px solid var(--bd); border-radius: var(--r);
  background: var(--s1); cursor: pointer; font-size: 11px; color: var(--mu);
  transition: all 0.15s; min-width: 60px; text-align: center;
}
.conf-btn:hover { border-color: var(--ac); color: var(--ac); }
.conf-btn.on { background: var(--ac); color: #fff; border-color: var(--ac); }

/* Readiness Score */
.readiness-big {
  font-size: 64px; font-weight: 900; text-align: center; line-height: 1;
  margin: 20px 0 8px; font-family: var(--fm);
}
.readiness-label {
  text-align: center; font-size: 14px; color: var(--mu); margin-bottom: 20px;
}

/* Discipline Score Cards */
.disc-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 16px 0; }
.disc-card {
  background: var(--s1); border: 1px solid var(--bd); border-radius: var(--r2);
  padding: 14px; text-align: center;
}
.disc-card-name { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.disc-card-score { font-size: 28px; font-weight: 800; font-family: var(--fm); }
.disc-card-detail { font-size: 10px; color: var(--mu); margin-top: 4px; }

/* Study Plan */
.sp-step { background: var(--s1); border: 1px solid var(--bd); border-radius: var(--r2); padding: 20px; margin-bottom: 12px; }
.sp-step h4 { margin: 0 0 12px; font-size: 14px; color: var(--tx); }
.sp-styles { display: flex; gap: 6px; flex-wrap: wrap; }
.sp-style {
  padding: 10px 16px; border: 1.5px solid var(--bd); border-radius: var(--r);
  background: var(--s1); cursor: pointer; font-size: 12px; font-weight: 500;
  transition: all 0.15s;
}
.sp-style:hover { border-color: var(--ac); }
.sp-style.on { background: var(--ac); color: #fff; border-color: var(--ac); }

.sp-day-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--bd); background: var(--s1); cursor: pointer; font-size: 11px; font-weight: 600; transition: all 0.15s; }
.sp-day-btn.on { background: var(--ac); color: #fff; border-color: var(--ac); }

/* Week Cards */
.week-card { background: var(--s1); border: 1px solid var(--bd); border-radius: var(--r2); padding: 16px; margin-bottom: 10px; }
.week-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.week-title { font-size: 14px; font-weight: 700; }
.week-phase { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.phase-foundation { background: rgba(59,143,212,.1); color: var(--bl); }
.phase-building { background: rgba(201,155,32,.1); color: var(--ye); }
.phase-final { background: rgba(46,168,79,.1); color: var(--gr); }

.task-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--bd2); font-size: 12px;
}
.task-row:last-child { border-bottom: none; }
.task-check { width: 20px; height: 20px; border: 1.5px solid var(--bd); border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; }
.task-check.done { background: var(--gr); border-color: var(--gr); color: #fff; font-size: 12px; }
.task-mode {
  font-size: 9px; padding: 2px 6px; border-radius: 3px; font-weight: 600; letter-spacing: 0.5px;
  flex-shrink: 0;
}
.mode-practice { background: rgba(204,0,0,.1); color: var(--ac); }
.mode-flashcard { background: rgba(139,92,246,.1); color: var(--pu); }
.mode-reference { background: rgba(59,143,212,.1); color: var(--bl); }
.mode-exam { background: rgba(46,168,79,.1); color: var(--gr); }

/* Flashcards */
.fc-container { display: flex; flex-direction: column; align-items: center; padding: 20px 0; }
.fc-progress { font-size: 12px; color: var(--mu); margin-bottom: 16px; font-family: var(--fm); }
.fc-card {
  width: 100%; max-width: 420px; min-height: 240px; background: var(--s1);
  border: 2px solid var(--bd); border-radius: var(--r2); padding: 32px 24px;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; user-select: none;
}
.fc-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.fc-discipline { font-size: 11px; color: var(--mu); margin-bottom: 4px; }
.fc-subtopic { font-size: 10px; color: var(--mu); margin-bottom: 16px; font-family: var(--fm); letter-spacing: 1px; text-transform: uppercase; }
.fc-term { font-size: 22px; font-weight: 700; color: var(--tx); line-height: 1.3; }
.fc-hint { font-size: 11px; color: var(--dim); margin-top: 20px; }
.fc-formula { font-size: 18px; font-weight: 600; color: var(--ac); margin-bottom: 12px; font-family: var(--fm); }
.fc-definition { font-size: 13px; color: var(--tx); line-height: 1.6; margin-bottom: 12px; }
.fc-ref { font-size: 11px; color: var(--bl); background: rgba(59,143,212,.06); padding: 6px 10px; border-radius: var(--r); }

.fc-actions { display: flex; gap: 8px; margin-top: 20px; width: 100%; max-width: 420px; }
.fc-btn {
  flex: 1; padding: 12px 8px; border: 1.5px solid var(--bd); border-radius: var(--r);
  background: var(--s1); cursor: pointer; font-size: 12px; font-weight: 600;
  transition: all 0.15s; text-align: center;
}
.fc-dont { color: var(--re); } .fc-dont:hover { background: rgba(220,53,69,.08); border-color: var(--re); }
.fc-review { color: var(--ye); } .fc-review:hover { background: rgba(201,155,32,.08); border-color: var(--ye); }
.fc-got { color: var(--gr); } .fc-got:hover { background: rgba(46,168,79,.08); border-color: var(--gr); }

/* Milestone badge */
.milestone-card {
  background: linear-gradient(135deg, rgba(139,92,246,.06), rgba(59,143,212,.06));
  border: 1.5px solid rgba(139,92,246,.2); border-radius: var(--r2); padding: 16px;
  margin: 12px 0; text-align: center;
}
.milestone-card h4 { color: var(--pu); font-size: 13px; margin: 0 0 6px; }

/* Predicted outcome badges */
.outcome-badge {
  display: inline-block; padding: 4px 12px; border-radius: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
}
.outcome-pass { background: rgba(46,168,79,.1); color: var(--gr); }
.outcome-risk { background: rgba(201,155,32,.1); color: var(--ye); }
.outcome-behind { background: rgba(220,53,69,.1); color: var(--re); }

/* ═══ AVATAR DROPDOWN ═══ */
.av-menu-items { padding: 4px 0; }
.av-item {
  padding: 10px 16px; font-size: 13px; color: var(--tx); cursor: pointer;
  display: flex; align-items: center; gap: 8px; transition: background 0.1s;
}
.av-item:hover { background: var(--s2); }

/* ═══ SIMULATOR NAV BUBBLES ═══ */
.snav-bubble {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bl); color: #fff; border: none;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(33,117,196,0.3);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  flex-shrink: 0;
}
@media (orientation: landscape) and (max-height: 500px) {
  .snav-bubble { width: 30px; height: 30px; font-size: 12px; }
  .sbot { padding: 4px 12px; }
}

/* Simulator nav: arrows in bottom corners */
.sbot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--s1);
  border-top: 1px solid var(--bd);
  position: relative;
}
.sbot .snav-bubble:first-child {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 50;
}
.sbot .snav-next {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
}
.sbot .qdots {
  flex: 1;
  text-align: center;
  overflow-x: auto;
}
.snav-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(33,117,196,0.4);
}
.snav-bubble:active { transform: scale(0.95); }
.snav-next { background: var(--ac); box-shadow: 0 2px 8px rgba(204,0,0,0.3); }
.snav-next:hover { box-shadow: 0 4px 16px rgba(204,0,0,0.4); }

/* Hide feedback bubble during exams */
#sim[style*="flex"] ~ #feedback-btn,
#sim[style*="flex"] ~ #support-chat {
  display: none !important;
}

/* ═══ LOADING STATES ═══ */
.sr-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; color: var(--mu); gap: 12px;
}
.sr-spinner {
  width: 32px; height: 32px; border: 3px solid var(--bd);
  border-top-color: var(--ac); border-radius: 50%;
  animation: sr-spin 0.8s linear infinite;
}
@keyframes sr-spin { to { transform: rotate(360deg); } }
.sr-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; color: var(--mu); text-align: center; gap: 8px;
}
.sr-empty-icon { font-size: 36px; opacity: 0.5; }
.sr-empty-text { font-size: 13px; font-weight: 600; }
.sr-empty-sub { font-size: 11px; }
.sr-error {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px 20px; color: var(--re); text-align: center; gap: 8px;
  background: rgba(220,38,38,0.05); border-radius: var(--r2); border: 1px solid rgba(220,38,38,0.15);
}
.sr-error-icon { font-size: 28px; }
.sr-error-text { font-size: 12px; }

/* Skeleton loading placeholder */
.sr-skeleton {
  background: linear-gradient(90deg, var(--s2) 25%, var(--bd) 50%, var(--s2) 75%);
  background-size: 200% 100%;
  animation: sr-shimmer 1.5s infinite;
  border-radius: var(--r);
  height: 16px;
}
@keyframes sr-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ═══ GETHIRED ═══ */
#panel-gethired .card { transition: transform 0.15s, box-shadow 0.15s; }
#panel-gethired .card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
#panel-gethired table th { white-space: nowrap; }
#panel-gethired table td { vertical-align: middle; }

/* ═══ LANGUAGE SELECTOR (footer visibility fix) ═══ */
#lang-selector select {
  background: var(--s1);
  border: 1px solid var(--bd);
  border-radius: var(--r);
  padding: 4px 8px;
  font-size: 11px;
  color: var(--tx);
  cursor: pointer;
  min-width: 100px;
}
#lang-selector select:focus {
  outline: 2px solid var(--bl);
  outline-offset: 1px;
}

/* ═══ HOVER EFFECTS — Interactive Elements ═══ */
/* Footer social links */
div[style*="border-top"] a[href*="x.com"],
div[style*="border-top"] a[href*="instagram"],
div[style*="border-top"] a[href*="tiktok"],
div[style*="border-top"] a[href*="linkedin"],
div[style*="border-top"] a[href*="youtube"],
div[style*="border-top"] a[href*="github"] {
  transition: transform 0.15s, opacity 0.15s;
  display: inline-block;
}
div[style*="border-top"] a[href*="x.com"]:hover,
div[style*="border-top"] a[href*="instagram"]:hover,
div[style*="border-top"] a[href*="tiktok"]:hover,
div[style*="border-top"] a[href*="linkedin"]:hover,
div[style*="border-top"] a[href*="youtube"]:hover,
div[style*="border-top"] a[href*="github"]:hover {
  transform: scale(1.25);
  opacity: 0.8;
}

/* Footer legal links */
a[onclick*="showLegal"] {
  transition: color 0.15s !important;
}
a[onclick*="showLegal"]:hover {
  color: var(--ac) !important;
  text-decoration: underline !important;
}

/* Chips / filter buttons */
.chip {
  transition: all 0.15s ease;
}
.chip:hover:not(.on) {
  background: var(--s2);
  color: var(--tx);
  transform: translateY(-1px);
}

/* Nav tabs enhanced hover */
.nav-tab:hover {
  color: var(--tx);
  background: rgba(0,0,0,0.03);
}

/* Cards with cursor pointer (clickable) */
.card[onclick],
.card[style*="cursor:pointer"] {
  cursor: pointer;
}
.card[onclick]:hover,
.card[style*="cursor:pointer"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--ac);
}

/* Buttons — lift on hover */
.btn-p:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(204,0,0,0.3);
}
.btn-o:hover {
  transform: translateY(-1px);
}

/* Avatar dropdown items */
.av-item {
  transition: background 0.1s, padding-left 0.15s;
}
.av-item:hover {
  background: var(--s2);
  padding-left: 20px;
}

/* Demo buttons on auth screen */
.demo-row .btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ═══ AUTH FEATURES (hidden on mobile, shown on tablet+) ═══ */
.auth-features { display: none; }
@media (min-width: 768px) {
  .auth-features { display: flex !important; }
}
