/* ==========================================================================
   PSSSBtyping.com · Blue & Gold Punjab Specialist Portal
   100% Free Forever · Mobile-First 100dvh Exam Hall + Quiz13 CBT UX
   ========================================================================== */

:root {
  --primary: #1e3d72;
  --primary-light: #2c5aa0;
  --primary-hover: #17305c;
  --primary-soft: #eaf1fb;
  --primary-border: #c7d7f0;
  --gold: #d4af37;
  --gold-soft: #fdf6df;
  --gold-dark: #9c7914;
  --bg-app: #f4f6fa;
  --bg-surface: #ffffff;
  --bg-subtle: #edf2f8;
  --text-main: #13213c;
  --text-muted: #4a5a75;
  --border-light: #dbe3ef;
  --border-strong: #b8c7dc;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #047857;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #92400e;
  --shadow-sm: 0 1px 3px rgba(19, 33, 60, 0.08);
  --shadow-md: 0 6px 20px rgba(19, 33, 60, 0.1);
  --shadow-lg: 0 14px 36px rgba(19, 33, 60, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --font-sans: "Inter", "Noto Sans Gurmukhi", system-ui, -apple-system, sans-serif;
  --font-pa: "Noto Sans Gurmukhi", "Raavi", "Inter", sans-serif;
  --transition: all 0.16s ease;
}

[data-theme="dark"] {
  --primary: #3b6ec2;
  --primary-light: #4d83db;
  --primary-hover: #2d5aa5;
  --primary-soft: rgba(59, 110, 194, 0.2);
  --primary-border: rgba(96, 165, 250, 0.35);
  --gold: #e5c14f;
  --gold-soft: rgba(212, 175, 55, 0.14);
  --gold-dark: #f3d778;
  --bg-app: #0c1424;
  --bg-surface: #131f36;
  --bg-subtle: #1a2a47;
  --text-main: #edf2fc;
  --text-muted: #9eb0ce;
  --border-light: #243658;
  --border-strong: #364f7d;
  --success-bg: rgba(16, 185, 129, 0.15);
  --success-border: rgba(52, 211, 153, 0.35);
  --success-text: #6ee7b7;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-border: rgba(248, 113, 113, 0.35);
  --danger-text: #fca5a5;
  --warn-bg: rgba(245, 158, 11, 0.15);
  --warn-border: rgba(251, 191, 36, 0.35);
  --warn-text: #fcd34d;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  max-width: 100%;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

.psssb-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  min-width: 0;
}

.psssb-main-pad { padding-top: 1.25rem; padding-bottom: 2.5rem; }

/* ---------------- Page Shell & AdSense Sidebars / Banners ---------------- */
.psssb-page-shell {
  width: 100%;
  display: block;
}
.psssb-ad-sidebar,
.psssb-ad-left,
.psssb-ad-right {
  display: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.psssb-ad-banner,
.psssb-ad-bottom-wrap {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  min-height: 0 !important;
  padding: 0 !important;
}
.psssb-ad-banner {
  position: relative;
  margin: 0.5rem auto;
  text-align: center;
  overflow: hidden;
}
.psssb-ad-banner::before,
.psssb-ad-sticky::before {
  content: none !important;
  display: none !important;
}
.psssb-ad-banner ins,
.psssb-ad-sticky ins {
  display: block;
  width: 100%;
  min-height: 1px;
  background: transparent !important;
  border: none !important;
}
ins.adsbygoogle[data-ad-status="unfilled"] {
  display: none !important;
}
.psssb-ad-banner:has(ins[data-ad-status="unfilled"]),
.psssb-ad-bottom-wrap:has(ins[data-ad-status="unfilled"]),
.psssb-ad-sticky:has(ins[data-ad-status="unfilled"]) {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.psssb-ad-banner:has(ins:empty) {
  margin: 0 !important;
}
body.psssb-scorecard-open .psssb-post-workspace-ad {
  display: none !important;
}
.psssb-ad-bottom-wrap {
  padding-bottom: 0.5rem;
}

@media (min-width: 1340px) {
  .psssb-page-shell {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
    max-width: 1640px;
    margin: 0 auto;
    padding: 0 12px;
  }
  .psssb-ad-sidebar {
    display: block;
    width: 160px;
    flex: 0 0 160px;
    padding-top: 0.85rem !important;
  }
  .psssb-ad-sticky {
    position: sticky;
    top: 72px;
    width: 100%;
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible;
  }
  .psssb-page-shell > #psssb-main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 1200px;
  }
}

@media (min-width: 1520px) {
  .psssb-ad-sidebar {
    width: 200px;
    flex: 0 0 200px;
  }
}

/* ---------------- Header ---------------- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 95;
  background: linear-gradient(90deg, #162e59 0%, #1e3d72 58%, #244a8a 100%);
  border-bottom: 2px solid var(--gold);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.psssb-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0.52rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-width: 0;
}

.psssb-brand-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.psssb-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  flex-shrink: 0;
}

.psssb-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}
.psssb-brand:hover { text-decoration: none; opacity: 0.95; }

.psssb-brand-logo {
  border-radius: 7px;
  border: 1.5px solid var(--gold);
  background: #fff;
  flex-shrink: 0;
}

.psssb-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.psssb-brand-text strong {
  font-size: 0.96rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.psssb-brand-text small {
  font-size: 0.68rem;
  color: #f3d778;
  font-weight: 600;
  white-space: nowrap;
}

.psssb-nav {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  flex-wrap: wrap;
}
.psssb-nav a {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.34rem 0.52rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: var(--transition);
}
.psssb-nav a:hover {
  background: rgba(212, 175, 55, 0.2);
  color: #fff;
  text-decoration: none;
}

.psssb-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.psssb-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.psssb-icon-btn:hover { background: rgba(255, 255, 255, 0.22); }

/* ---------------- Hero & Mission Strip ---------------- */
.psssb-hero {
  background: linear-gradient(135deg, #162e59 0%, #1e3d72 55%, #2c5aa0 100%);
  color: #fff;
  padding: 2rem 0 1.85rem;
  border-bottom: 3px solid var(--gold);
}
.psssb-hero-compact { padding: 1.05rem 0 1rem; }
.psssb-hero-home { padding: 1rem 0 1.15rem; }
.psssb-hero-typing { padding: 0.45rem 0 0.52rem; }
.psssb-hero-typing-bar {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}
.psssb-hero-typing-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.psssb-hero-mini-btn {
  margin-left: auto;
  padding: 0.2rem 0.62rem;
  font-size: 0.74rem;
}
.psssb-hero-typing .psssb-hero-title {
  margin: 0.16rem 0 0;
  font-size: clamp(1.08rem, 1.9vw, 1.4rem);
  line-height: 1.22;
}
.psssb-hero-typing .psssb-hero-lead {
  margin: 0;
  font-size: 0.79rem;
  line-height: 1.35;
  max-width: 100%;
  opacity: 0.9;
}
body[data-kind="typing"] .psssb-main-pad,
body[data-kind="lesson"] .psssb-main-pad {
  padding-top: 0.55rem;
  padding-bottom: 1.75rem;
}

/* ---------------- Quick-Start Launch Card ---------------- */
.psssb-quickstart-card {
  margin-top: 0.75rem;
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.05rem;
  box-shadow: var(--shadow-lg);
}
.psssb-qs-grid {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}
.psssb-qs-row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.72rem 1.35rem;
}
.psssb-qs-row-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.72rem 1rem;
}
.psssb-qs-group {
  min-width: 0;
}
.psssb-qs-group.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.psssb-qs-label {
  display: block;
  font-size: 0.71rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.32rem;
}
.psssb-qs-pills {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}
.psssb-qs-pill {
  padding: 0.38rem 0.72rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-app);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}
.psssb-qs-pill:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}
[data-theme="dark"] .psssb-qs-pill:hover { color: #93c5fd; }
.psssb-qs-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(30, 61, 114, 0.25);
}
.psssb-qs-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0;
}
.psssb-qs-cta {
  font-size: 0.94rem;
  padding: 0.66rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}
.psssb-quickstart-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.55rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.psssb-qs-arrow {
  color: var(--gold-dark);
  font-weight: 800;
}

.psssb-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.26rem 0.72rem;
  border-radius: var(--radius-full);
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.55);
  color: #fde68a;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  max-width: 100%;
}

.psssb-hero-title {
  margin: 0.65rem 0 0.45rem;
  font-size: clamp(1.38rem, 2.8vw, 2.15rem);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.psssb-hero-lead {
  margin: 0 0 0.9rem;
  font-size: 0.96rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 820px;
}

.psssb-mission-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.45);
  font-size: 0.82rem;
  color: #f8fafc;
}

.psssb-mission-strip-light {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  margin: 0.65rem 0;
}

.psssb-mission-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.58rem;
  border-radius: var(--radius-full);
  background: var(--gold);
  color: #13213c;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.psssb-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

/* ---------------- Buttons & Cards ---------------- */
.psssb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.58rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.25;
}
.psssb-btn:hover { text-decoration: none; transform: translateY(-1px); }
.psssb-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.psssb-btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.psssb-btn-primary:hover { background: var(--primary-hover); color: #fff; }

.psssb-btn-gold { background: var(--gold); color: #13213c; border-color: var(--gold); }
.psssb-btn-gold:hover { background: #e2be47; color: #13213c; }

.psssb-btn-outline {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-strong);
}
.psssb-btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }

.psssb-btn-outline-light {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.psssb-btn-outline-light:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }

.psssb-btn-danger { background: var(--danger-text); color: #fff; border-color: var(--danger-text); }
.psssb-btn-success { background: var(--success-text); color: #fff; border-color: var(--success-text); }

.psssb-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.psssb-card-link {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--text-main);
  transition: var(--transition);
}
.psssb-card-link:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.psssb-mini-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: var(--transition);
}
.psssb-mini-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.psssb-mini-card h3 { margin: 0.15rem 0; font-size: 0.98rem; color: var(--primary); }
[data-theme="dark"] .psssb-mini-card h3 { color: #93c5fd; }
.psssb-mini-card p { margin: 0; font-size: 0.83rem; color: var(--text-muted); }

.psssb-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 0.16rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
}
[data-theme="dark"] .psssb-tag { color: #bfdbfe; }

.psssb-link-cta {
  margin-top: auto;
  padding-top: 0.3rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-light);
}

.psssb-section { margin-top: 1.75rem; }
.psssb-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.psssb-section-head h2 { margin: 0; font-size: 1.22rem; }
.psssb-section-head p { margin: 0; font-size: 0.88rem; color: var(--text-muted); }

.psssb-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}
.psssb-seo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.psssb-highlight-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-left: 5px solid var(--gold);
  background: linear-gradient(135deg, var(--bg-surface), var(--gold-soft));
}
.psssb-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.psssb-punjabi-note {
  font-family: var(--font-pa);
  font-size: 0.96rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  border-left: 4px solid var(--gold);
}
.psssb-spec-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.8rem; }
.psssb-spec-pill {
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-size: 0.78rem;
  font-weight: 700;
}
.psssb-faq-item { padding: 0.6rem 0; border-top: 1px solid var(--border-light); }
.psssb-faq-item h3 { margin: 0 0 0.25rem; font-size: 0.94rem; }
.psssb-faq-item p { margin: 0; font-size: 0.86rem; color: var(--text-muted); }

/* ---------------- Typing Setup & Exam Hall ---------------- */
.psssb-setup-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.7rem;
  align-items: end;
}
.psssb-field label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.26rem;
}
.psssb-field select,
.psssb-field input,
.psssb-field textarea {
  width: 100%;
  padding: 0.52rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-app);
  color: var(--text-main);
  font-size: 0.88rem;
}

.psssb-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
.psssb-mode-tab {
  padding: 0.45rem 0.82rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.psssb-mode-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.psssb-telemetry {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}
.psssb-stat-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.48rem 0.65rem;
  text-align: center;
}
.psssb-stat-box small {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.psssb-stat-box strong {
  font-size: 1.15rem;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .psssb-stat-box strong { color: #93c5fd; }

/* ---------------- Single-Screen Typing Workspace ---------------- */
.psssb-ws-card {
  padding: 0.65rem 0.85rem;
  border-top: 3px solid var(--primary);
}
.psssb-ws-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.48rem;
  margin-bottom: 0.48rem;
  border-bottom: 1px solid var(--border-light);
  min-height: 40px;
}
.psssb-ws-controls-left {
  display: flex;
  align-items: center;
  gap: 0.36rem;
  flex-wrap: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.psssb-ws-controls-right {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  flex-shrink: 0;
}
.psssb-ws-select {
  height: 32px;
  padding: 0 0.42rem;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-app);
  color: var(--text-main);
  font-size: 0.77rem;
  font-weight: 600;
  min-width: 0;
  max-width: 195px;
  cursor: pointer;
}
.psssb-ws-select-lang {
  max-width: 118px;
}
.psssb-ws-select-passage {
  max-width: 148px;
}
.psssb-ws-select-mode {
  max-width: 195px;
}
.psssb-ws-select-time {
  max-width: 80px;
}
.psssb-ws-fontsize {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
}
.psssb-ws-mini-btn {
  height: 30px;
  padding: 0 0.48rem;
  border: 0;
  background: var(--bg-app);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}
.psssb-ws-mini-btn + .psssb-ws-mini-btn {
  border-left: 1px solid var(--border-strong);
}
.psssb-ws-mini-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.psssb-ws-timer {
  display: inline-flex;
  align-items: center;
  color: #dc2626;
  font-weight: 800;
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 0.22rem 0.5rem;
  border-radius: 7px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
}
[data-theme="dark"] .psssb-ws-timer {
  color: #fca5a5;
}
.psssb-ws-seg-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}
.psssb-ws-submit-btn {
  height: 32px;
  padding: 0 0.75rem;
  border-radius: 7px;
  border: 0;
  background: #16a34a;
  color: #fff;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.psssb-ws-submit-btn:hover {
  background: #15803d;
}
.psssb-ws-passage {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.62rem 0.88rem;
  height: 154px;
  overflow-y: auto;
  line-height: 1.75;
  user-select: none;
  word-wrap: break-word;
  color: var(--text-main);
  margin-bottom: 0.42rem;
}
[data-theme="dark"] .psssb-ws-passage {
  background: var(--bg-app);
  border-color: var(--border-strong);
}
.psssb-ws-passage[data-lang="pa"] {
  font-family: var(--font-pa);
}
.psssb-ws-seg-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.34rem;
  min-height: 28px;
}
.psssb-ws-seg-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}
.psssb-ws-seg-btn {
  height: 28px;
  padding: 0 0.65rem;
  border-radius: 7px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: var(--transition);
}
.psssb-ws-seg-btn:hover:not(:disabled) {
  background: var(--primary-hover);
}
.psssb-ws-seg-btn:disabled {
  background: var(--bg-subtle);
  border-color: var(--border-light);
  color: var(--text-muted);
  opacity: 0.6;
  cursor: not-allowed;
}
.psssb-ws-seg-btn[hidden] {
  display: none !important;
}
.psssb-ws-seg-mini {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}
.psssb-ws-free-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.48rem;
  border-radius: var(--radius-full);
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  font-size: 0.69rem;
  font-weight: 800;
  white-space: nowrap;
}
.psssb-chunk-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.22rem;
  max-width: 100%;
}
.psssb-chunk-dots[hidden] {
  display: none !important;
}
.psssb-chunk-dot {
  width: 21px;
  height: 21px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.psssb-chunk-dot.done {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}
.psssb-chunk-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.45);
}
.psssb-chunk-progress {
  width: 100%;
  height: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.psssb-chunk-progress[hidden] { display: none !important; }
.psssb-chunk-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-light), var(--gold));
  transition: width 0.16s ease;
}
.psssb-ws-textarea {
  width: 100%;
  height: 148px;
  padding: 0.62rem 0.88rem;
  border-radius: 10px;
  border: 2px solid #cbd5e1;
  background: var(--bg-surface);
  color: var(--text-main);
  line-height: 1.75;
  resize: vertical;
  outline: none;
  transition: var(--transition);
}
[data-theme="dark"] .psssb-ws-textarea {
  border-color: var(--border-strong);
}
.psssb-ws-textarea[data-lang="pa"] {
  font-family: var(--font-pa);
}
.psssb-ws-textarea:focus,
.psssb-ws-textarea.psssb-input-focus-ring {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}
.psssb-ws-bottom {
  margin-top: 0.44rem;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}
.psssb-ws-stats-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  padding: 0.32rem 0.62rem;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-size: 0.77rem;
  color: var(--text-muted);
}
.psssb-ws-stats-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
}
.psssb-ws-stats-items strong {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .psssb-ws-stats-items strong {
  color: #93c5fd;
}
.psssb-ws-edit-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
}
.psssb-ws-select-sm {
  height: 25px;
  padding: 0 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.73rem;
  font-weight: 600;
}
.psssb-ws-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.38rem;
}
.psssb-ws-btn {
  height: 30px;
  padding: 0 0.68rem;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  white-space: nowrap;
  transition: var(--transition);
}
.psssb-ws-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}
.psssb-ws-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.psssb-ws-btn-submit {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.psssb-ws-btn-submit:hover {
  background: #15803d;
  color: #fff;
}
.psssb-ws-academy-ticker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.65rem;
  padding: 0.28rem 0.62rem;
  border-radius: 7px;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  font-size: 0.75rem;
  color: var(--text-main);
}
.psssb-ws-academy-name {
  font-weight: 800;
  color: var(--primary);
}
.psssb-ws-shortcuts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.psssb-kbd {
  display: inline-block;
  padding: 0.05rem 0.32rem;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  font-family: monospace;
  font-size: 0.69rem;
  font-weight: 700;
  color: var(--text-main);
}
.psssb-ws-edit-msg {
  font-weight: 700;
  color: var(--warn-text);
}
.psssb-scorecard-table td:first-child {
  font-weight: 700;
  width: 40%;
  background: var(--bg-subtle);
}

.psssb-capslock-warn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  font-size: 0.72rem;
  font-weight: 700;
}
.psssb-capslock-warn[hidden] { display: none !important; }

.w-ok { color: var(--success-text); font-weight: 600; }
.w-err { color: var(--danger-text); text-decoration: underline wavy; font-weight: 700; }
.w-cur {
  background: #dbeafe;
  color: #1e40af;
  border-bottom: 2.5px solid #2563eb;
  padding: 0.04rem 0.26rem;
  border-radius: 5px;
  font-weight: 800;
}
[data-theme="dark"] .w-cur {
  background: rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
  border-bottom-color: #60a5fa;
}

.psssb-input-area.psssb-input-focus-ring {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25), 0 0 18px rgba(212, 175, 55, 0.28) !important;
}

/* Guided Lessons Visual Roadmap & Next-Key Banner */
.psssb-lesson-stage {
  padding: 0.85rem 1rem;
}
.psssb-lesson-stage .psssb-passage-box {
  max-height: 86px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.48rem;
}
.psssb-lesson-stage .psssb-input-area {
  min-height: 62px;
  height: 66px;
  padding: 0.5rem 0.85rem;
}
.psssb-lesson-stage .psssb-vkb {
  margin-top: 0.5rem;
  padding: 0.5rem;
}
.psssb-next-char-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.44rem 0.78rem;
  margin-bottom: 0.48rem;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
}
.psssb-next-char-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.psssb-next-char-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.psssb-lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.psssb-lesson-card {
  text-align: left;
  width: 100%;
  background: var(--bg-app);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--text-main);
  transition: var(--transition);
}
.psssb-lesson-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.psssb-lesson-card.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(30, 61, 114, 0.16);
}
.psssb-lesson-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.psssb-lesson-start-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.52rem;
  border-radius: var(--radius-full);
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}
.psssb-lesson-card.active .psssb-lesson-start-pill {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.psssb-lesson-preview {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.psssb-input-area {
  width: 100%;
  min-height: 120px;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--primary-light);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 1.08rem;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}
.psssb-input-area[data-lang="pa"] {
  font-family: var(--font-pa);
  font-size: 1.2rem;
}
.psssb-input-area:focus {
  box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.2);
}

.psssb-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* Virtual Keyboard for Lessons & Punjabi Raavi */
.psssb-vkb {
  margin-top: 0.85rem;
  padding: 0.65rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  overflow-x: auto;
}
.psssb-vkb-row {
  display: flex;
  gap: 0.28rem;
  justify-content: center;
  margin-bottom: 0.28rem;
}
.psssb-vkb-key {
  min-width: 38px;
  padding: 0.28rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  text-align: center;
  font-size: 0.74rem;
  line-height: 1.15;
}
.psssb-vkb-key.active-key {
  background: var(--gold);
  color: #13213c;
  border-color: var(--gold-dark);
  font-weight: 800;
  transform: scale(1.06);
}
.psssb-vkb-key small { display: block; font-size: 0.62rem; color: var(--text-muted); }

/* ---------------- Pinned 100dvh Exam Hall ---------------- */
body.in-exam-hall {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.in-exam-hall .psssb-hero,
body.in-exam-hall .psssb-footer,
body.in-exam-hall .psssb-section,
body.in-exam-hall .psssb-seo-grid,
body.in-exam-hall .psssb-highlight-card,
body.in-exam-hall .psssb-ad-banner,
body.in-exam-hall .psssb-ad-bottom-wrap {
  display: none !important;
}
body.in-exam-hall .psssb-page-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 1340px) {
  body.in-exam-hall .psssb-page-shell {
    flex-direction: row;
    align-items: stretch;
  }
  body.in-exam-hall .psssb-ad-sidebar {
    padding-top: 0.6rem;
    overflow-y: auto;
  }
  body.in-exam-hall .psssb-ad-sticky {
    top: 0.6rem;
  }
}
body.in-exam-hall #psssb-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
body.in-exam-hall .psssb-main-pad {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  min-height: 0;
}
body.in-exam-hall .psssb-exam-card,
body.in-exam-hall .psssb-ws-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.in-exam-hall .psssb-ws-passage {
  flex: 1 1 0;
  height: auto;
  min-height: 120px;
  max-height: 320px;
}
body.in-exam-hall .psssb-ws-textarea {
  flex: 1 1 0;
  height: auto;
  min-height: 120px;
}

/* ---------------- CBT Hub (Quiz13 Mobile-Grade UX) ---------------- */
.cbt-cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}
.cbt-cat-pill {
  padding: 0.42rem 0.78rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.cbt-cat-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.cbt-shell {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 0.9rem;
  align-items: start;
}
.cbt-topbar {
  height: 48px;
  padding: 0 0.75rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.cbt-topbar-title {
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.cbt-timer-pill {
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--gold);
  color: #13213c;
  font-weight: 800;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.cbt-sec-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.cbt-sec-tab {
  padding: 0.4rem 0.72rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.cbt-sec-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.cbt-opt-btn {
  width: 100%;
  text-align: left;
  padding: 0.68rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-light);
  background: var(--bg-app);
  color: var(--text-main);
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
  transition: var(--transition);
}
.cbt-opt-btn:hover { border-color: var(--primary-light); }
.cbt-opt-btn.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}
.cbt-opt-badge {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}
.cbt-opt-btn.selected .cbt-opt-badge {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.cbt-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.38rem;
}
.cbt-q-dot {
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.cbt-q-dot.st-ans { background: #16a34a; color: #fff; border-color: #15803d; }
.cbt-q-dot.st-mark { background: #7c3aed; color: #fff; border-color: #6d28d9; }
.cbt-q-dot.st-ansmark { background: #0d9488; color: #fff; border-color: #0f766e; }
.cbt-q-dot.st-notans { background: #dc2626; color: #fff; border-color: #b91c1c; }
.cbt-q-dot.st-current { outline: 2.5px solid var(--gold); outline-offset: 1px; }

.cbt-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  font-size: 0.74rem;
  margin-bottom: 0.75rem;
}
.cbt-legend-item { display: flex; align-items: center; gap: 0.35rem; }
.cbt-legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

.cbt-thumb-bar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.85rem;
}
.cbt-thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: space-between;
}
.cbt-palette-drawer-btn { display: none; }

.cbt-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(12, 20, 36, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cbt-sheet-backdrop[hidden] { display: none !important; }
.cbt-palette-sheet {
  width: 100%;
  max-width: 540px;
  max-height: 78dvh;
  overflow-y: auto;
  background: var(--bg-surface);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  padding: 1rem;
  box-shadow: var(--shadow-lg);
}

.cbt-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: rgba(12, 20, 36, 0.64);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cbt-modal-backdrop[hidden] { display: none !important; }
.cbt-modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
}

/* CPT Excel Table */
.cpt-table-wrap { overflow-x: auto; margin: 0.8rem 0; }
.cpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.cpt-table th, .cpt-table td {
  border: 1px solid var(--border-strong);
  padding: 0.42rem 0.55rem;
  text-align: left;
}
.cpt-table th { background: var(--primary); color: #fff; }
.cpt-cell-input {
  width: 100%;
  min-width: 90px;
  padding: 0.32rem 0.45rem;
  border: 1px solid var(--primary-light);
  border-radius: 4px;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: monospace;
}

/* ---------------- Footer ---------------- */
.psssb-footer {
  background: #101e38;
  color: #d6e0f0;
  padding: 2rem 0 1.4rem;
  border-top: 3px solid var(--gold);
}
.psssb-footer-mission {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.4);
  font-size: 0.83rem;
  margin-bottom: 1.35rem;
}
.psssb-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
}
.psssb-footer-grid h3 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  color: #f3d778;
}
.psssb-footer-grid ul { list-style: none; margin: 0; padding: 0; }
.psssb-footer-grid li { margin-bottom: 0.34rem; font-size: 0.82rem; }
.psssb-footer-grid a { color: #cbd5e1; }
.psssb-footer-grid a:hover { color: #fff; }
.psssb-footer-bottom {
  margin-top: 1.3rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

/* ---------------- Responsive Rules ---------------- */
@media (max-width: 1024px) {
  .psssb-ws-topbar {
    flex-wrap: wrap;
  }
  .psssb-ws-controls-left {
    flex-wrap: wrap;
  }
}

@media (max-width: 960px) {
  .psssb-nav-toggle { display: inline-flex; }
  .psssb-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #162e59;
    border-bottom: 2px solid var(--gold);
    padding: 0.65rem 0.9rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    box-shadow: var(--shadow-lg);
  }
  .psssb-nav.open { display: flex; }
  .psssb-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cbt-shell { grid-template-columns: 1fr; }
  .cbt-desktop-palette { display: none; }
  .cbt-palette-drawer-btn { display: inline-flex; }
  .psssb-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .psssb-header-inner { padding: 0.44rem 0.65rem; gap: 0.35rem; }
  .psssb-brand-text small { display: none; }
  .psssb-brand-text strong { font-size: 0.88rem; }
  .psssb-quickstart-card { padding: 0.8rem; }
  .psssb-qs-cta, .psssb-qs-secondary { width: 100%; }
  .psssb-grid-3, .psssb-seo-grid, .psssb-split-grid, .psssb-footer-grid {
    grid-template-columns: 1fr;
  }
  .psssb-ws-card { padding: 0.55rem 0.6rem; }
  .psssb-ws-topbar { flex-wrap: wrap; gap: 0.38rem; }
  .psssb-ws-controls-left { width: 100%; flex-wrap: wrap; }
  .psssb-ws-select { flex: 1 1 44%; max-width: none; }
  .psssb-ws-controls-right { width: 100%; justify-content: space-between; }
  .psssb-ws-passage { height: 136px; padding: 0.55rem 0.68rem; }
  .psssb-ws-textarea { height: 120px; padding: 0.55rem 0.68rem; }
  .psssb-ws-seg-nav { flex-wrap: wrap; gap: 0.34rem; }
  .psssb-ws-seg-center { display: contents; }
  #psssb-prev-chunk { order: 1; }
  .psssb-ws-free-pill { order: 2; margin: 0 auto; }
  #psssb-nonchunk-status { order: 2; }
  #psssb-next-chunk { order: 3; }
  #psssb-chunk-dots { order: 4; flex-basis: 100%; margin-top: 0.1rem; }
  .psssb-ws-actions { gap: 0.32rem; }
  .psssb-ws-btn { flex: 1 1 auto; justify-content: center; }
  .psssb-vkb { padding: 0.35rem 0.22rem; overflow-x: hidden; }
  .psssb-vkb-row { gap: 2px; }
  .psssb-vkb-key { min-width: 0; flex: 1 1 0; padding: 0.18rem 0.05rem; font-size: 0.62rem; }
  .psssb-vkb-key small { font-size: 0.5rem; }
  .psssb-passage-box { font-size: 1rem; padding: 0.75rem; max-height: 175px; }
  .psssb-input-area { min-height: 96px; font-size: 1rem; }
  .cbt-thumb-bar {
    position: sticky;
    bottom: 0;
    background: var(--bg-surface);
    padding: 0.5rem;
    border-top: 1px solid var(--border-light);
    margin: 0.65rem -0.5rem -0.5rem;
    z-index: 25;
  }
}

@media (max-height: 500px) {
  body.in-exam-hall .top-header { display: none; }
  body.in-exam-hall .psssb-telemetry { grid-template-columns: repeat(4, 1fr); margin-bottom: 0.4rem; }
  body.in-exam-hall .psssb-stat-box { padding: 0.25rem 0.4rem; }
  body.in-exam-hall .psssb-passage-box,
  body.in-exam-hall .psssb-ws-passage { max-height: 110px; min-height: 84px; font-size: 0.95rem; margin-bottom: 0.35rem; }
  body.in-exam-hall .psssb-input-area,
  body.in-exam-hall .psssb-ws-textarea { min-height: 68px; }
}

/* ---------------- Raavi Typing Guide & Alt Codes ---------------- */
.psssb-raavi-sandbox-card {
  border-top: 4px solid var(--gold);
}
.psssb-raavi-subtext {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.psssb-raavi-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-bottom: 0.75rem;
}
.psssb-raavi-sandbox-box {
  min-height: 92px;
  font-size: 1.45rem;
  line-height: 1.65;
}
.psssb-raavi-sandbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.65rem;
}
.psssb-raavi-readout {
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-word;
}
.psssb-raavi-out-glyph {
  font-family: var(--font-pa);
  font-size: 1.18rem;
  color: var(--primary);
}
[data-theme="dark"] .psssb-raavi-out-glyph {
  color: var(--gold);
}
.psssb-raavi-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

/* 47-Key Visual Raavi InScript Keyboard (scales cleanly down to 360px) */
.psssb-raavi-kb {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  padding: 0.7rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 100%;
}
.psssb-raavi-kb-row {
  display: flex;
  gap: 0.34rem;
  width: 100%;
}
.psssb-kb-row-1 { padding-left: 14px; }
.psssb-kb-row-2 { padding-left: 26px; }
.psssb-kb-row-3 { padding-left: 40px; }

.psssb-raavi-key {
  flex: 1 1 0;
  min-width: 0;
  height: 62px;
  padding: 3px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.psssb-raavi-key:hover {
  border-color: var(--primary-light);
  background: var(--primary-soft);
}
.psssb-raavi-key.is-selected {
  border-color: var(--gold);
  background: var(--gold-soft);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.38);
}
.psssb-rk-shift {
  position: absolute;
  top: 3px;
  left: 5px;
  font-family: var(--font-pa);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-dark);
  line-height: 1;
}
.psssb-rk-norm {
  font-family: var(--font-pa);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-top: 4px;
}
[data-theme="dark"] .psssb-rk-norm {
  color: #93c5fd;
}
.psssb-rk-en {
  position: absolute;
  bottom: 2px;
  right: 5px;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
}
.psssb-rk-ac-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.psssb-kb-inspector {
  margin-top: 0.85rem;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  font-size: 0.88rem;
}
.psssb-kb-insp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.psssb-kb-insp-cell {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.psssb-kb-insp-val {
  font-size: 0.82rem;
  color: var(--text-main);
  word-break: break-word;
}
.psssb-kb-insp-val strong {
  font-family: var(--font-pa);
  font-size: 1.35rem;
  color: var(--primary);
  margin-right: 0.3rem;
}
[data-theme="dark"] .psssb-kb-insp-val strong {
  color: var(--gold);
}
.psssb-insp-copy {
  align-self: flex-start;
  padding: 0.28rem 0.65rem;
  font-size: 0.76rem;
}

/* Searchable Master Table & Tricky Words Table */
.psssb-raavi-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.psssb-raavi-search-input {
  padding: 0.48rem 0.8rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-app);
  color: var(--text-main);
  font-size: 0.88rem;
  min-width: 240px;
  max-width: 100%;
}
.psssb-raavi-search-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.18);
}

.psssb-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.psssb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.psssb-table th,
.psssb-table td {
  padding: 0.52rem 0.68rem;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: middle;
}
.psssb-table thead th {
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.psssb-table tbody tr:hover {
  background: var(--primary-soft);
}
.psssb-table code {
  background: var(--bg-subtle);
  padding: 0.14rem 0.38rem;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px solid var(--border-light);
  white-space: nowrap;
}
.psssb-raavi-char-cell {
  text-align: center !important;
  width: 78px;
}
.psssb-raavi-glyph-btn {
  min-width: 44px;
  min-height: 38px;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--primary);
  font-family: var(--font-pa);
  font-size: 1.32rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}
[data-theme="dark"] .psssb-raavi-glyph-btn {
  color: var(--gold);
}
.psssb-raavi-glyph-btn:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}
.psssb-raavi-glyph-btn.is-copied {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}
.psssb-raavi-note-muted {
  color: var(--text-muted);
  font-size: 0.81rem;
}
.psssb-raavi-word-cell {
  font-family: var(--font-pa);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}
[data-theme="dark"] .psssb-raavi-word-cell {
  color: #93c5fd;
}
.psssb-try-word-btn {
  padding: 0.28rem 0.62rem;
  font-size: 0.76rem;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .psssb-kb-insp-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .psssb-wrap { padding: 0 0.65rem; }
  .psssb-card { padding: 0.85rem 0.72rem; }
  .psssb-raavi-kb { padding: 0.38rem 0.25rem; gap: 0.22rem; }
  .psssb-raavi-kb-row { gap: 2px; }
  .psssb-kb-row-1, .psssb-kb-row-2, .psssb-kb-row-3 { padding-left: 0; }
  .psssb-raavi-key { height: 46px; padding: 1px; border-radius: 5px; }
  .psssb-rk-shift { top: 2px; left: 2px; font-size: 0.54rem; }
  .psssb-rk-norm { font-size: 0.88rem; margin-top: 5px; }
  .psssb-rk-en { bottom: 1px; right: 2px; font-size: 0.5rem; }
  .psssb-rk-ac-dot { top: 2px; right: 2px; width: 4px; height: 4px; }
  .psssb-raavi-search-wrap, .psssb-raavi-search-input { width: 100%; min-width: 0; }
  .psssb-raavi-sandbox-box { font-size: 1.2rem; }
}

/* ---------------- @media print Diagonal Watermark ---------------- */
@media print {
  .top-header, .psssb-footer, .psssb-hero-actions, .psssb-no-print, #gt-inst-banner,
  .psssb-ad-sidebar, .psssb-ad-banner, .psssb-ad-bottom-wrap, ins.adsbygoogle, ins.psssb-ad-pending {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
    position: relative;
  }
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='340' height='220' viewBox='0 0 340 220'><text x='170' y='110' text-anchor='middle' fill='rgba(30,61,114,0.11)' font-family='Arial,sans-serif' font-size='16' font-weight='700' transform='rotate(-26 170 110)'>PSSSBtyping.com · 100% Free Forever</text></svg>");
    background-repeat: repeat;
  }
}
