/* Self-hosted Be Vietnam Pro (Vietnamese + Latin-Ext + Latin) */
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-400-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-500-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-600-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-600-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-700-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/be-vietnam-pro-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --primary: #135688;
  --primary-hover: #1b68a1;
  --primary-deep: #0d3e66;
  --primary-soft: rgba(19, 86, 136, 0.08);
  --primary-soft-strong: rgba(19, 86, 136, 0.14);
  --canvas: #f7f8f9;
  --surface: #ffffff;
  --well: #f0f3f7;
  --well-hover: #e3eaf2;
  --ink: #1b2430;
  --secondary-ink: #1f4868;
  --muted: #4b5e73;
  --subtle: #506478;
  --line: rgba(18, 52, 86, 0.11);
  --hot: #c2342e;
  --emerald: #077453;
  --amber: #a85808;
  --violet: #523da8;
  --shadow-block: 0 2px 8px rgba(17, 24, 34, 0.055);
  --shadow-hover: 0 8px 22px rgba(17, 24, 34, 0.1);
  --shadow-float: 0 12px 32px rgba(17, 24, 34, 0.16);
  --radius-block: 12px;
  --radius-card: 12px;
  --radius-control: 9px;
  --header-h: 56px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  font-size: 14.5px;
  scroll-behavior: smooth;
  scrollbar-color: #b7c6d6 #eef2f6;
  scrollbar-width: thin;
}

body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--canvas);
  caret-color: var(--primary);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background-color: var(--primary);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 9px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #eef2f6;
}
::-webkit-scrollbar-thumb {
  background: #b7c6d6;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #8fa5bc;
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--subtle);
  opacity: 1;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

img {
  max-width: 100%;
  display: block;
}

svg.brand-svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: none;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  border-radius: var(--radius-control);
}
.skip-link:focus {
  top: 10px;
}

/* ==========================================================================
   Ambient Hero Bleed (Mapstudy Homepage Crown)
   ========================================================================== */
.portal-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

.hero-bleed {
  position: absolute;
  inset: 0 0 auto 0;
  height: 360px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-bleed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(42px) saturate(1.12);
  transform: scale(1.12);
  opacity: 0.42;
}

.hero-bleed-wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(229, 239, 252, 0.78) 0%,
    rgba(241, 246, 252, 0.9) 62%,
    #f7f8f9 100%
  );
}

.portal-shell.is-subpage .hero-bleed {
  display: none;
}

/* ==========================================================================
   Fixed 56px Frosted Header
   ========================================================================== */
.ms-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 90;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(21, 94, 148, 0.08);
}

.ms-header-spacer {
  height: var(--header-h);
  flex-shrink: 0;
}

.ms-header-inner {
  max-width: 1580px;
  height: 100%;
  margin-inline: auto;
  padding-inline: 18px;
  display: grid;
  grid-template-columns: minmax(250px, 26%) 1fr minmax(250px, 26%);
  align-items: center;
  gap: 12px;
}

.ms-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.icon-btn.mobile-menu-btn,
.icon-btn.mobile-tools-btn {
  display: none;
}

.portal-shell.is-subpage .icon-btn.mobile-menu-btn {
  display: inline-flex;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-ink);
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.icon-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.ms-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ms-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(17, 24, 34, 0.1);
}

.ms-brand-text {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary-deep);
  white-space: nowrap;
}
.ms-brand-text strong {
  color: var(--primary);
}

.ms-search-trigger {
  flex: 1;
  max-width: 245px;
  min-width: 140px;
  height: 38px;
  padding-inline: 12px;
  border-radius: 11px;
  background: rgba(21, 94, 148, 0.075);
  color: var(--subtle);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: background-color 160ms var(--ease-out);
}
.ms-search-trigger:hover {
  background: rgba(21, 94, 148, 0.12);
  color: var(--secondary-ink);
}
.ms-search-trigger svg {
  width: 17px;
  height: 17px;
}
.ms-search-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}
.ms-search-trigger kbd {
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--secondary-ink);
}

/* Center 5 Icon Tabs (Mapstudy Signature) */
.ms-center-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 6px;
}

.ms-center-tab {
  position: relative;
  height: 46px;
  min-width: 68px;
  padding-inline: 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6c7a89;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.ms-center-tab svg {
  width: 23px;
  height: 23px;
}
.ms-center-tab:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.ms-center-tab[aria-current="page"] {
  color: var(--primary);
}
.ms-center-tab[aria-current="page"] svg {
  stroke-width: 2.25;
  fill: rgba(21, 94, 148, 0.13);
}
.ms-center-tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -5px;
  height: 3px;
  border-radius: 999px;
  background: var(--primary);
}

/* Header Right Actions (Course Activation + Student Auth) */
.ms-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.ms-activate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding-inline: 12px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.ms-activate-btn svg {
  width: 17px;
  height: 17px;
}
.ms-activate-btn:hover,
.ms-activate-btn[aria-current="page"] {
  background: var(--primary-soft-strong);
  color: var(--primary-deep);
}

.ms-header-divider {
  width: 1.5px;
  height: 20px;
  background: rgba(19, 86, 136, 0.18);
}

.ms-auth-slot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ms-register-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--secondary-ink);
  padding: 6px 9px;
  border-radius: 8px;
  white-space: nowrap;
}
.ms-register-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.ms-login-btn {
  height: 37px;
  padding-inline: 16px;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.89rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(17, 24, 34, 0.16);
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.ms-login-btn:hover {
  background: var(--primary-hover);
}

.ms-user-pill {
  height: 37px;
  padding: 3px 12px 3px 5px;
  border-radius: 999px;
  background: var(--well);
  color: var(--secondary-ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.87rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 150ms var(--ease-out);
}
.ms-user-pill:hover {
  background: var(--well-hover);
}
.ms-user-avatar {
  width: 29px;
  height: 29px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.poster-art-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
}
.poster-art-badge svg.course-illust {
  width: 22px;
  height: 22px;
  stroke: none;
}

/* Personal Profile Form Grid */
.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.profile-field span {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--secondary-ink);
  margin-bottom: 6px;
}
@media (max-width: 720px) {
  .profile-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.code-input-big {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  height: 48px;
  text-align: center;
}

.unlocked-pill {
  padding: 3px 8px;
  border-radius: 6px;
  background: #065f44;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
}

/* ==========================================================================
   3-Column Portal Body & Subpage Shell
   ========================================================================== */
.ms-body {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1580px;
  margin-inline: auto;
  padding: 18px 18px 48px;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr) 332px;
  gap: 36px;
  align-items: start;
}

.portal-shell.is-subpage .ms-body {
  max-width: 1380px;
  grid-template-columns: minmax(0, 1fr);
  padding-top: 20px;
}

.portal-shell.is-subpage .ms-right-rail {
  display: none;
}

/* Left Sticky Navigation Rail */
.ms-left-rail {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 28px);
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 72px;
}

.drawer-mobile-head {
  display: none;
}

.portal-shell.is-subpage .ms-left-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 292px;
  max-height: none;
  z-index: 120;
  padding: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-float);
  transform: translateX(-104%);
  transition: transform 220ms var(--ease-out);
}

.portal-shell.is-subpage .drawer-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.portal-shell.drawer-open .ms-left-rail {
  transform: translateX(0);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(15, 32, 54, 0.38);
  backdrop-filter: blur(2px);
}

/* Student Account Box + Soft Duotone Navigation Badges */
.rail-student-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow-block);
}

.rail-account-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 8px;
  border-radius: 9px;
  text-align: left;
  transition: background-color 150ms var(--ease-out);
}
.rail-account-row:hover {
  background: var(--well);
}
.rail-account-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.rail-account-copy strong {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--secondary-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-account-copy small {
  font-size: 0.77rem;
  color: var(--muted);
}

.rail-student-subnav {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-subitem {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--muted);
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.rail-subitem:hover {
  background: var(--well);
  color: var(--primary);
}
.rail-subitem[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-subicon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--well);
  color: var(--secondary-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-subicon svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
}
.rail-subitem[aria-current="page"] .nav-subicon {
  background: rgba(19, 86, 136, 0.14);
  color: var(--primary);
}

.nav-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 150ms var(--ease-out);
}
.nav-icon-badge svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.95;
}
.rail-item:hover .nav-icon-badge {
  transform: scale(1.04);
}

.badge-soft-blue {
  background: #e3effb;
  color: #135688;
}
.badge-soft-emerald {
  background: #e0f5ed;
  color: #077453;
}
.badge-soft-rose {
  background: #fde8e7;
  color: #bf302a;
}
.badge-soft-amber {
  background: #fef0de;
  color: #a35406;
}
.badge-soft-violet {
  background: #ece7fc;
  color: #5038ab;
}
.badge-soft-cyan {
  background: #dff3f8;
  color: #0b6985;
}

.rail-divider {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 10px 8px;
}

.rail-menu,
.rail-links-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rail-group-title {
  margin: 4px 12px 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--secondary-ink);
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.rail-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.rail-item[aria-current="page"] {
  background: var(--primary-soft-strong);
  color: var(--primary);
  font-weight: 600;
}

.app-tile {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(17, 24, 34, 0.08);
}

.rail-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}
.rail-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.tone-navy { background: #135688; }
.tone-blue { background: #1964a3; }
.tone-crimson { background: #c43831; }
.tone-amber { background: #b56109; }
.tone-emerald { background: #087452; }
.tone-cyan { background: #0c6f8c; }
.tone-violet { background: #583eb5; }
.tone-indigo { background: #2c52b5; }

.rail-badge {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}
.rail-badge svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}
.badge-fb { background: #145dbf; font-size: 1.05rem; }
.badge-yt { background: #c42020; }
.badge-club { background: #087452; }
.badge-nova { background: #135688; }

/* Right Sticky Sidebar */
.ms-right-rail {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   Shared Surface Blocks & Headings (.main-block)
   ========================================================================== */
@keyframes surfaceSettle {
  from {
    transform: translateY(8px);
    filter: blur(2px);
  }
  to {
    transform: translateY(0);
    filter: blur(0);
  }
}

.main-block {
  background: var(--surface);
  border-radius: var(--radius-block);
  box-shadow: var(--shadow-block);
  padding: 20px 22px;
  animation: surfaceSettle 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ms-center-col {
  min-width: 0;
}

.feed-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.block-title-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.block-accent-dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.block-accent-dot svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.1;
}

.accent-hot { background: rgba(201, 56, 50, 0.11); color: var(--hot); }
.accent-primary { background: rgba(21, 94, 148, 0.11); color: var(--primary); }
.accent-emerald { background: rgba(8, 127, 91, 0.11); color: var(--emerald); }
.accent-violet { background: rgba(85, 64, 175, 0.11); color: var(--violet); }
.accent-indigo { background: rgba(54, 94, 201, 0.11); color: #2d5ec4; }

.block-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--secondary-ink);
}
.block-title.title-hot { color: var(--hot); }
.block-title.title-emerald { color: var(--emerald); }
.block-title.title-indigo { color: #2d5ec4; }
.block-title.title-violet { color: var(--violet); }

.block-more-link {
  font-size: 0.88rem;
  font-style: italic;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.block-more-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ==========================================================================
   Homepage Mode Switcher (Trang chủ | Cộng đồng)
   ========================================================================== */
.home-mode-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: var(--surface);
  border-radius: var(--radius-block);
  box-shadow: var(--shadow-block);
  gap: 4px;
}

.mode-tab-btn {
  height: 40px;
  border-radius: 9px;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--muted);
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out);
}
.mode-tab-btn:hover {
  color: var(--primary);
}
.mode-tab-btn.is-active {
  background: var(--primary);
  color: #ffffff;
}

/* ==========================================================================
   Homepage Hero Banner Carousel (Collision-Free Split Stage)
   ========================================================================== */
.hero-carousel {
  position: relative;
  border-radius: var(--radius-block);
  overflow: hidden;
  box-shadow: var(--shadow-block);
  background: #0b2e50;
  min-height: 238px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms var(--ease-out);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.95fr);
  background: #0b2e50;
}
.hero-slide.is-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

.hero-slide-art-b2 {
  background: #0d355c;
}
.hero-slide-art-labs {
  background: #0b3d38;
}

.hero-slide-content {
  position: relative;
  z-index: 2;
  padding: 26px 24px 34px 28px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
}

.hero-slide-copy {
  max-width: 46ch;
}

.hero-slide-copy h1,
.hero-slide-copy h2 {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 1.85vw, 1.56rem);
  font-weight: 700;
  line-height: 1.26;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero-slide-copy p {
  margin: 0;
  font-size: 0.89rem;
  line-height: 1.5;
  color: #e3effb;
}

.hero-slide-stage {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dcebf9;
}

.hero-slide-stage::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 54px;
  z-index: 1;
  background: linear-gradient(90deg, #0b2e50 0%, rgba(11, 46, 80, 0) 100%);
  pointer-events: none;
}

.hero-slide-art-b2 .hero-slide-stage {
  background: #12487a;
}
.hero-slide-art-b2 .hero-slide-stage::before {
  background: linear-gradient(90deg, #0d355c 0%, rgba(13, 53, 92, 0) 100%);
}
.hero-slide-art-labs .hero-slide-stage {
  background: #0f5950;
}
.hero-slide-art-labs .hero-slide-stage::before {
  background: linear-gradient(90deg, #0b3d38 0%, rgba(11, 61, 56, 0) 100%);
}

.hero-slide-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-stage-diagram {
  width: 84%;
  max-width: 250px;
  height: auto;
  stroke: none;
}

.hero-slide-cta {
  height: 40px;
  padding-inline: 18px;
  border-radius: 10px;
  background: #ffffff;
  color: var(--primary-deep);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(17, 24, 34, 0.22);
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.hero-slide-cta:hover {
  background: #f0f6fc;
  transform: translateY(-1px);
}

.hero-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(12, 35, 60, 0.42);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.hero-carousel:hover .hero-nav-arrow,
.hero-carousel:focus-within .hero-nav-arrow {
  opacity: 1;
}
.hero-nav-arrow:hover {
  background: rgba(12, 35, 60, 0.72);
}
.hero-nav-prev { left: 12px; }
.hero-nav-next { right: 12px; }

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 7px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  transition: width 180ms var(--ease-out), background-color 180ms var(--ease-out);
}
.hero-dot.is-active {
  width: 22px;
  background: #ffffff;
}

/* Mobile-only Quick Strip (matches Mapstudy mobile layout) */
.mobile-quick-strip {
  display: none;
}

/* ==========================================================================
   5-Skill Illustrated Cards (Clean Light-Tinted Modern EdTech Style)
   ========================================================================== */
.portrait-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(118px, 1fr));
  gap: 13px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}

.skill-portrait-card {
  position: relative;
  scroll-snap-align: start;
  border-radius: var(--radius-card);
  overflow: hidden;
  padding: 14px 12px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: center;
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.skill-portrait-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.portrait-reading { background: #eaf3fc; color: #12456e; }
.portrait-listening { background: #fdeceb; color: #8c221d; }
.portrait-writing { background: #e3f6ef; color: #06593f; }
.portrait-speaking { background: #eeeafc; color: #3d288c; }
.portrait-grammar { background: #fef2e2; color: #7c4005; }

.portrait-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portrait-part-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.portrait-emblem {
  width: 62px;
  height: 62px;
  margin-block: 4px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(17, 24, 34, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.portrait-emblem svg.skill-illust {
  width: 38px;
  height: 38px;
  stroke: none;
}

.portrait-bottom {
  width: 100%;
}
.portrait-bottom strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}
.portrait-bottom span {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
}

/* ==========================================================================
   Course Card Grids & Square Graphic Posters (Mapstudy Signature)
   ========================================================================== */
.ms-course-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.ms-course-grid.cols-5-home {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.ms-course-grid.cols-5-home .ms-course-poster {
  padding: 10px;
}
.ms-course-grid.cols-5-home .poster-tag,
.ms-course-grid.cols-5-home .poster-code {
  font-size: 0.64rem;
  padding: 2px 6px;
}
.ms-course-grid.cols-5-home .poster-center {
  padding-block: 3px;
}
.ms-course-grid.cols-5-home .poster-center strong {
  font-size: 0.86rem;
  line-height: 1.18;
}
.ms-course-grid.cols-5-home .poster-center span {
  margin-top: 2px;
  font-size: 0.68rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ms-course-grid.cols-5-home .poster-foot {
  font-size: 0.66rem;
  padding-top: 4px;
}

.ms-course-grid.cols-5 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 1320px) {
  .ms-course-grid.cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.ms-course-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-card);
  transition: transform 180ms var(--ease-out);
}
.ms-course-card:hover {
  transform: translateY(-3px);
}

.ms-course-poster {
  position: relative;
  min-height: 174px;
  width: 100%;
  border-radius: var(--radius-card);
  overflow: hidden;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(17, 24, 34, 0.1);
}

.ms-course-poster::after {
  content: "NOVA";
  position: absolute;
  right: -6px;
  bottom: -10px;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.poster-b1 { background: linear-gradient(145deg, #145487 0%, #0b3052 100%); }
.poster-b2 { background: linear-gradient(145deg, #1844a3 0%, #0d245c 100%); }
.poster-bandc { background: linear-gradient(145deg, #5233ab 0%, #26155e 100%); }
.poster-hot { background: linear-gradient(145deg, #a62b25 0%, #5e1318 100%); }
.poster-emerald { background: linear-gradient(145deg, #096e4f 0%, #053b2c 100%); }
.poster-amber { background: linear-gradient(145deg, #914d08 0%, #4f2804 100%); }
.poster-cyan { background: linear-gradient(145deg, #0c6987 0%, #08384d 100%); }
.poster-violet { background: linear-gradient(145deg, #4b35a8 0%, #24175e 100%); }

.poster-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.poster-art-medallion {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(10, 22, 38, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.poster-art-medallion svg.course-illust {
  width: 34px;
  height: 34px;
  stroke: none;
}

.poster-tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(8, 18, 32, 0.52);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

.poster-code {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(235, 245, 255, 0.88);
  font-variant-numeric: tabular-nums;
}

.poster-center {
  position: relative;
  z-index: 1;
  margin-block: auto;
  padding-block: 6px;
}
.poster-center strong {
  display: block;
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
}
.poster-center span {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: rgba(235, 245, 255, 0.88);
}

.poster-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(240, 248, 255, 0.92);
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-variant-numeric: tabular-nums;
}

.ms-course-title {
  margin: 10px 0 5px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--secondary-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ms-course-card:hover .ms-course-title {
  color: var(--primary);
}

.ms-course-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}
.ms-course-author svg {
  width: 15px;
  height: 15px;
  fill: var(--primary);
  stroke: none;
}

/* ==========================================================================
   Right Rail Widgets: 5-Skill Hub, Activate CTA, Consultation Form, News
   ========================================================================== */
.rail-skill-hub {
  padding: 18px;
}

.hub-summary-box {
  padding: 12px 13px;
  border-radius: 10px;
  background: var(--well);
  margin-bottom: 12px;
}

.hub-summary-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 0.84rem;
}
.hub-summary-top strong {
  color: var(--primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.hub-summary-top span {
  color: var(--muted);
}

.svg-meter {
  display: block;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
}

.hub-skill-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-skill-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 9px;
  transition: background-color 150ms var(--ease-out);
}
.hub-skill-row:hover {
  background: var(--well);
}

.hub-skill-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}
.hub-skill-icon svg {
  width: 16px;
  height: 16px;
}

.hub-skill-info strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}
.hub-skill-info small {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
}

.hub-skill-pct {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.hub-skill-pct svg {
  width: 14px;
  height: 14px;
}

.rail-activate-btn {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-block);
  background: var(--primary);
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: var(--shadow-block);
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.rail-activate-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Fanpage Consultation & Registration Card (Replaces Old Form) */
.rail-fb-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.fb-card-header {
  display: flex;
  align-items: center;
  gap: 11px;
}
.fb-card-header img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--well);
  padding: 3px;
}
.fb-card-header h2 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--secondary-ink);
  line-height: 1.28;
}
.fb-card-header span {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.fb-card-points {
  margin: 0;
  padding: 11px 13px;
  list-style: none;
  background: var(--well);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.84rem;
  color: var(--ink);
}
.fb-card-points li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.fb-card-points svg {
  width: 16px;
  height: 16px;
  color: var(--emerald);
  margin-top: 2px;
}

.btn-fb-official {
  width: 100%;
  min-height: 44px;
  padding: 9px 14px;
  border-radius: 10px;
  background: #145dbf;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.btn-fb-official svg.brand-svg {
  width: 20px;
  height: 20px;
}
.btn-fb-official:hover {
  background: #0f4ea3;
  transform: translateY(-1px);
}

.btn-zalo-official {
  width: 100%;
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--well);
  color: var(--secondary-ink);
  font-size: 0.89rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background-color 160ms var(--ease-out);
}
.btn-zalo-official .app-tile {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  box-shadow: none;
}
.btn-zalo-official:hover {
  background: var(--well-hover);
}

.fb-card-sublinks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  font-size: 0.79rem;
  color: var(--muted);
}
.fb-card-sublinks a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--secondary-ink);
}
.fb-card-sublinks a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Guide Tables & External Resource Callouts */
.guide-table-wrap {
  overflow-x: auto;
  margin: 14px 0;
  border-radius: 10px;
  background: var(--well);
  padding: 4px;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.guide-table th,
.guide-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.guide-table tr:last-child td {
  border-bottom: 0;
}
.guide-table th {
  font-weight: 700;
  color: var(--secondary-ink);
}

.ext-resource-bar {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--well);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.ext-resource-bar strong {
  display: block;
  font-size: 0.92rem;
  color: var(--secondary-ink);
}
.ext-resource-bar small {
  font-size: 0.8rem;
  color: var(--muted);
}

.ms-input-wrap {
  position: relative;
  display: block;
}

.ms-input,
.ms-select,
.ms-textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--well);
  color: var(--ink);
  font-size: 0.89rem;
  padding: 10px 12px;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
.ms-input,
.ms-select {
  height: 41px;
}
.ms-textarea {
  min-height: 78px;
  resize: vertical;
}
.ms-input:focus,
.ms-select:focus,
.ms-textarea:focus {
  background: #ffffff;
  border-color: var(--primary);
  outline: none;
}

.consult-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.consult-note {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Right Rail News List */
.rail-news-card {
  padding: 18px;
}

.rail-news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rail-news-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.rail-news-thumb {
  width: 64px;
  height: 64px;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.rail-news-thumb svg {
  width: 18px;
  height: 18px;
  margin-bottom: 2px;
}

.rail-news-body strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--secondary-ink);
}
.rail-news-item:hover .rail-news-body strong {
  color: var(--primary);
}

.rail-news-date {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rail-news-date svg {
  width: 13px;
  height: 13px;
}

/* ==========================================================================
   Buttons & Reusable Controls
   ========================================================================== */
.btn-primary {
  height: 41px;
  padding-inline: 18px;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background-color 160ms var(--ease-out);
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-subtle {
  height: 41px;
  padding-inline: 16px;
  border-radius: var(--radius-control);
  background: var(--well);
  color: var(--secondary-ink);
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background-color 160ms var(--ease-out);
}
.btn-subtle:hover {
  background: var(--well-hover);
}

.btn-sm {
  height: 35px;
  padding-inline: 13px;
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-block {
  width: 100%;
}

.link-btn {
  color: var(--primary);
  font-weight: 600;
  padding: 2px 4px;
}
.link-btn:hover {
  text-decoration: underline;
}

.pill-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.pill-chip.chip-emerald { background: rgba(8, 127, 91, 0.12); color: var(--emerald); }
.pill-chip.chip-hot { background: rgba(201, 56, 50, 0.12); color: var(--hot); }
.pill-chip.chip-amber { background: rgba(184, 98, 10, 0.13); color: var(--amber); }

/* ==========================================================================
   Community Feed Tab (Homepage Switcher -> Cộng đồng)
   ========================================================================== */
.community-composer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.composer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.composer-input {
  flex: 1;
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.post-author strong {
  display: block;
  font-size: 0.94rem;
  color: var(--ink);
}
.post-author small {
  color: var(--muted);
  font-size: 0.79rem;
}

.post-body h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  color: var(--secondary-ink);
}
.post-body p {
  margin: 0;
  color: var(--ink);
  max-width: 68ch;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   Subpage Breadcrumbs & Mapstudy-Modeled Subpage Shells
   ========================================================================== */
.ms-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--primary);
}
.ms-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary);
}
.ms-breadcrumb a:hover {
  text-decoration: underline;
}
.ms-breadcrumb span.sep {
  color: var(--muted);
}
.ms-breadcrumb span.current {
  color: var(--muted);
}

/* 1. Courses Catalog (/courses — 2-Col Mapstudy Layout) */
.catalog-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.catalog-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.catalog-sidebar h2 {
  margin: 0 0 4px;
  font-size: 1.08rem;
  color: var(--secondary-ink);
}

.cat-card-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-card);
  background: var(--well);
  text-align: left;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.cat-card-mark {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cat-card-copy strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--secondary-ink);
}
.cat-card-copy small {
  font-size: 0.78rem;
  color: var(--muted);
}
.cat-card-btn:hover,
.cat-card-btn.is-active {
  background: var(--primary);
  color: #ffffff;
}
.cat-card-btn:hover .cat-card-mark,
.cat-card-btn.is-active .cat-card-mark {
  background: #ffffff;
  color: var(--primary);
}
.cat-card-btn:hover .cat-card-copy strong,
.cat-card-btn.is-active .cat-card-copy strong,
.cat-card-btn:hover .cat-card-copy small,
.cat-card-btn.is-active .cat-card-copy small {
  color: #ffffff;
}

.catalog-main-head h1 {
  margin: 0 0 14px;
  font-size: 1.45rem;
  color: var(--secondary-ink);
  letter-spacing: -0.02em;
}

.cohort-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 16px;
}

.cohort-pill {
  height: 38px;
  padding-inline: 15px;
  border-radius: 999px;
  background: var(--well);
  color: var(--secondary-ink);
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.cohort-pill:hover {
  background: var(--well-hover);
}
.cohort-pill.is-active {
  background: var(--primary);
  color: #ffffff;
}

.subject-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.subject-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.subject-tab {
  position: relative;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}
.subject-tab:hover {
  color: var(--primary);
  background: var(--primary-soft);
}
.subject-tab.is-active {
  color: var(--primary);
}
.subject-tab.is-active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -11px;
  height: 2.5px;
  background: var(--primary);
  border-radius: 999px;
}

.inline-filter-search {
  width: 240px;
}

/* 2. Course Detail (/course/<slug> — 3-Col Mapstudy Detail) */
.course-detail-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.detail-nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.detail-nav-btn {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 9px;
  font-weight: 600;
  color: var(--muted);
}
.detail-nav-btn.is-active,
.detail-nav-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.syllabus-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.syllabus-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 10px;
  background: var(--well);
}
.syllabus-item strong {
  display: block;
  font-size: 0.93rem;
  color: var(--ink);
}
.syllabus-item small {
  color: var(--muted);
  font-size: 0.81rem;
}

/* 3. Online Exams (/mocks — 2-Col Filter + Exam List) */
.mocks-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.filter-group {
  margin-top: 16px;
}
.filter-group h3 {
  margin: 0 0 9px;
  font-size: 0.92rem;
  color: var(--secondary-ink);
}

.filter-pill-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.exam-list-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.exam-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
}
.exam-row-main h3 {
  margin: 8px 0 5px;
  font-size: 1.06rem;
  color: var(--secondary-ink);
}
.exam-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.83rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* 4. Documents Library (/materials — 2-Col Asymmetric PDF Grid + Folder Shelf) */
.materials-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 30px;
  align-items: start;
}

.pdf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pdf-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 13px;
  padding: 15px;
  border-radius: var(--radius-card);
  background: var(--well);
  align-items: start;
  text-align: left;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.pdf-card:hover {
  background: var(--well-hover);
  transform: translateY(-1px);
}

.pdf-badge {
  width: 52px;
  height: 60px;
  border-radius: 10px;
  background: rgba(201, 56, 50, 0.11);
  color: var(--hot);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
}
.pdf-badge.badge-book {
  background: rgba(8, 127, 91, 0.12);
  color: var(--emerald);
}

.pdf-card-body h3 {
  margin: 0 0 7px;
  font-size: 0.95rem;
  line-height: 1.38;
  color: var(--secondary-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pdf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.pdf-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.folder-stack {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.folder-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius-card);
  background: var(--well);
  text-align: left;
  transition: background-color 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.folder-card:hover {
  background: var(--well-hover);
  transform: translateY(-1px);
}
.folder-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.folder-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.folder-card strong {
  display: block;
  font-size: 0.92rem;
  color: var(--secondary-ink);
}
.folder-card small {
  font-size: 0.79rem;
  color: var(--muted);
}

/* 5. Interactive Skill Practice Rooms & Timed Exam */
.room-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 22px;
  align-items: start;
}

.passage-prose {
  max-width: 68ch;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink);
}
.passage-prose p {
  margin: 0 0 14px;
}

.choice-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 16px 0;
  padding: 0;
  border: 0;
}

.choice-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--well);
  cursor: pointer;
  transition: background-color 150ms var(--ease-out);
}
.choice-option:hover {
  background: var(--well-hover);
}
.choice-option input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.feedback-banner {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 500;
}
.feedback-banner.is-good {
  background: rgba(8, 127, 91, 0.12);
  color: #065f44;
}
.feedback-banner.is-warn {
  background: rgba(184, 98, 10, 0.13);
  color: #8c4806;
}

.audio-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 11px;
  background: var(--well);
  margin: 14px 0;
}

.audio-play-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.question-num-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.q-num-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--well);
  font-weight: 700;
  color: var(--secondary-ink);
  font-variant-numeric: tabular-nums;
}
.q-num-btn.is-answered {
  background: var(--primary-soft-strong);
  color: var(--primary);
}
.q-num-btn.is-current {
  background: var(--primary);
  color: #ffffff;
}

.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-tile {
  padding: 16px 18px;
}
.stat-tile strong {
  display: block;
  font-size: 1.5rem;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.stat-tile span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ==========================================================================
   Full-Width Primary Blue 4-Column Footer (Mapstudy Signature)
   ========================================================================== */
.ms-footer {
  position: relative;
  z-index: 1;
  background: var(--primary);
  color: #ffffff;
  margin-top: auto;
}

.ms-footer-inner {
  max-width: 1540px;
  margin-inline: auto;
  padding: 40px 22px 32px;
  display: grid;
  grid-template-columns: minmax(270px, 28%) minmax(0, 1fr);
  gap: 36px;
}

.ms-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.ms-footer-logo img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: #ffffff;
  padding: 3px;
}
.ms-footer-logo strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.ms-footer-logo span {
  font-size: 0.82rem;
  color: #d6e8f8;
}

.ms-footer-desc {
  margin: 0 0 14px;
  font-size: 0.88rem;
  color: #d9eaf9;
  max-width: 42ch;
}

.ms-footer-contact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.86rem;
  color: #e4f0fb;
}
.ms-footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.ms-footer-contact a {
  color: #e8f2fc;
}
.ms-footer-contact a:hover {
  color: #ffffff;
  text-decoration: underline;
}
.ms-footer-contact svg {
  width: 17px;
  height: 17px;
  margin-top: 2px;
}

.ms-footer-apps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.footer-app-link {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  overflow: hidden;
  display: inline-flex;
  box-shadow: 0 2px 6px rgba(8, 22, 38, 0.25);
  transition: transform 150ms var(--ease-out);
}
.footer-app-link:hover {
  transform: translateY(-2px) scale(1.04);
}

.ms-footer-col a.footer-fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: #ffffff;
  color: var(--primary-deep);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.ms-footer-col a.footer-fb-btn svg {
  width: 17px;
  height: 17px;
}
.ms-footer-col a.footer-fb-btn:hover {
  background: #eef6fd;
  color: var(--primary-deep);
  transform: translateY(-1px);
  text-decoration: none;
}

.ms-footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.ms-footer-col h2 {
  margin: 0 0 14px;
  font-size: 1.02rem;
  font-weight: 700;
  color: #ffffff;
}

.ms-footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.89rem;
}
.ms-footer-col a {
  color: #dcebf9;
}
.ms-footer-col a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.ms-footer-socials {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}
.ms-footer-socials a {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.ms-footer-socials a:hover {
  background: rgba(255, 255, 255, 0.28);
}

.ms-newsletter {
  margin-top: 16px;
}
.ms-newsletter label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: #e6f2fc;
}
.ms-newsletter-box {
  display: flex;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 9px;
  overflow: hidden;
  background: rgba(11, 52, 86, 0.35);
}
.ms-newsletter-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding-inline: 12px;
  color: #ffffff;
  font-size: 0.86rem;
}
.ms-newsletter-box input::placeholder {
  color: #cbe0f4;
}
.ms-newsletter-box input:focus {
  outline: none;
}
.ms-newsletter-box button {
  width: 44px;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
}
.ms-newsletter-box button:hover {
  background: rgba(255, 255, 255, 0.26);
}

.ms-footer-note {
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: #d9eaf9;
}

.ms-footer-trust {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(8, 34, 58, 0.28);
}
.trust-seal {
  padding: 6px 9px;
  border-radius: 7px;
  background: #ffffff;
  color: var(--primary-deep);
  font-size: 0.74rem;
  font-weight: 700;
}
.ms-footer-trust strong {
  display: block;
  font-size: 0.88rem;
}
.ms-footer-trust div span {
  font-size: 0.77rem;
  color: #eaf4fd;
}

.ms-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 18px 20px;
  text-align: center;
  font-size: 0.85rem;
  color: #dcebf9;
}
.ms-footer-bottom p {
  margin: 0;
}

/* ==========================================================================
   Floating Study Tools Widget & Modals & Toast
   ========================================================================== */
.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 14px;
}

.study-tools-dock {
  position: fixed;
  left: 20px;
  right: auto;
  bottom: 22px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.study-tools-fab {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: #1463b0;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(17, 24, 34, 0.24);
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.study-tools-fab:hover {
  background: var(--primary);
  transform: scale(1.05);
}
.study-tools-fab svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: none;
}

.study-tools-panel {
  width: min(350px, calc(100vw - 32px));
  background: #ffffff;
  border-radius: 14px;
  box-shadow: var(--shadow-float);
  padding: 16px;
}

.tools-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.tools-panel-head h2 {
  margin: 0;
  font-size: 0.98rem;
  color: var(--secondary-ink);
}

.tools-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  border-radius: 9px;
  background: var(--well);
  margin-bottom: 12px;
}
.tools-tabs button {
  padding: 6px 4px;
  border-radius: 7px;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--muted);
}
.tools-tabs button.is-active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(17, 24, 34, 0.08);
}

.tools-body textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--well);
  padding: 10px;
  font-size: 0.86rem;
  resize: vertical;
}
.tools-body textarea:focus {
  background: #ffffff;
  border-color: var(--primary);
  outline: none;
}

.tools-word-stats {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tools-word-stats strong {
  color: var(--primary);
}

.tools-timer-display {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  padding: 8px 0;
}

.tools-preset-row,
.tools-action-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}
.tools-preset-row button {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--well);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}
.tools-preset-row button.is-active {
  background: var(--primary-soft-strong);
  color: var(--primary);
}

.tools-cefr-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.83rem;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(12, 31, 52, 0.44);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.ms-modal {
  width: min(560px, 100%);
  background: #ffffff;
  border-radius: 14px;
  box-shadow: var(--shadow-float);
  padding: 20px 22px;
}
.auth-modal {
  width: min(440px, 100%);
}

.ms-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ms-modal-head h2 {
  margin: 0;
  font-size: 1.14rem;
  color: var(--secondary-ink);
}

.ms-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding-inline: 14px;
  border-radius: 10px;
  background: var(--well);
}
.ms-search-input-wrap input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 0.95rem;
}

.search-results-list {
  margin-top: 14px;
  max-height: 330px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-hit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--canvas);
}
.search-hit:hover {
  background: var(--primary-soft);
}
.search-hit strong {
  display: block;
  font-size: 0.91rem;
  color: var(--secondary-ink);
}
.search-hit small {
  font-size: 0.78rem;
  color: var(--muted);
}

.auth-brand-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--well);
  margin-bottom: 14px;
}
.auth-brand-banner img {
  border-radius: 9px;
}
.auth-brand-banner strong {
  display: block;
  font-size: 0.92rem;
  color: var(--secondary-ink);
}
.auth-brand-banner span {
  font-size: 0.79rem;
  color: var(--muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.auth-form label span {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--secondary-ink);
  margin-bottom: 5px;
}
.auth-form input {
  width: 100%;
  height: 41px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--well);
  padding-inline: 12px;
}
.auth-form input:focus {
  background: #ffffff;
  border-color: var(--primary);
  outline: none;
}

.auth-switch-note {
  margin: 4px 0 0;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.btn-google-oauth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 41px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
.btn-google-oauth:hover {
  background: var(--well);
  border-color: rgba(18, 52, 86, 0.22);
}
.btn-google-oauth:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.btn-google-oauth[aria-disabled="true"],
.btn-google-oauth.is-disabled,
.btn-google-oauth:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  background: var(--well);
}
.btn-google-oauth svg {
  flex-shrink: 0;
}

.auth-google-note {
  margin: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--well);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  text-align: center;
}

/* Toast */
.ms-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  z-index: 180;
  padding: 11px 18px;
  border-radius: 10px;
  background: #102a45;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.ms-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 404 Page */
.not-found-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.not-found-card {
  max-width: 500px;
  text-align: center;
  padding: 36px 28px;
}
.not-found-card img {
  margin-inline: auto;
  border-radius: 14px;
}
.not-found-card h1 {
  margin: 18px 0 8px;
  font-size: 1.4rem;
  color: var(--secondary-ink);
}
.not-found-card p {
  margin: 0 0 20px;
  color: var(--muted);
}
.not-found-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* Mobile Bottom Navigation Bar */
.ms-bottom-nav {
  display: none;
}

/* ==========================================================================
   Phase 2: 5-Skill Real-Exam Labs, 48h Forecast, Full Simulator & Admin UI
   ========================================================================== */
.nav-icon-badge.badge-soft-coral {
  background: rgba(194, 52, 46, 0.11);
  color: var(--hot);
}

.footer-admin-link {
  color: #ffffff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-admin-link:hover {
  opacity: 0.9;
}

.rate-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rate-row.is-fire {
  background: rgba(194, 52, 46, 0.11);
  color: #b42318;
}
.rate-row.is-star {
  background: rgba(168, 88, 8, 0.13);
  color: #8f4900;
}
.rate-row strong {
  margin-left: 4px;
}
.rate-svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  stroke: none;
}

/* Homepage 48h Forecast Strip */
.forecast-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.forecast-home-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--well);
  transition: background-color 150ms var(--ease-out);
}
.forecast-home-item .pill-chip {
  white-space: nowrap;
  flex-shrink: 0;
}
.forecast-home-item:hover {
  background: var(--well-hover);
}
.forecast-home-main strong {
  display: block;
  font-size: 0.9rem;
  color: var(--secondary-ink);
  margin-bottom: 2px;
}
.forecast-home-main small {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Shared Skill Lab Controls & Flat Well Containers (Zero Nested Shadows) */
.lab-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.lab-toolbar-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.topic-banner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--well);
}
.topic-banner-bar h2 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  color: var(--secondary-ink);
}

.sub-pane-title {
  margin: 4px 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--secondary-ink);
}

.block-sub {
  display: block;
  margin-top: 3px;
  font-size: 0.8rem;
  color: var(--muted);
}

.well-item-card {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--well);
  border: 1px solid transparent;
}
.well-item-card.is-correct {
  border-color: rgba(7, 116, 83, 0.45);
  background: rgba(7, 116, 83, 0.06);
}
.well-item-card.is-wrong {
  border-color: rgba(194, 52, 46, 0.45);
  background: rgba(194, 52, 46, 0.05);
}

.input-surface {
  background: #ffffff;
  border: 1px solid var(--line);
}

.well-q-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.inline-options-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.choice-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--ink);
}
.choice-pill.is-picked {
  border-color: var(--primary);
  background: rgba(19, 86, 136, 0.06);
  color: var(--primary-deep);
  font-weight: 600;
}

.intro-anchor-box {
  padding: 13px 16px;
  border-radius: 9px;
  background: #eaf0f6;
  border: 1px solid rgba(19, 86, 136, 0.18);
}
.intro-anchor-box > strong {
  display: block;
  font-size: 0.9rem;
  color: var(--secondary-ink);
  margin-bottom: 4px;
}
.intro-anchor-box p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink);
}

.pre-wrap {
  white-space: pre-line;
}

/* Reading Part 2 & 3 Drag / Reorder Cards */
.reorder-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.reorder-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--well);
  border: 1px solid var(--line);
  cursor: grab;
}
.reorder-card.is-correct {
  border-color: rgba(7, 116, 83, 0.5);
  background: rgba(7, 116, 83, 0.06);
}
.reorder-card.is-wrong {
  border-color: rgba(194, 52, 46, 0.5);
  background: rgba(194, 52, 46, 0.05);
}

.reorder-pos {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.reorder-text {
  margin: 0;
  font-size: 0.91rem;
  line-height: 1.5;
  color: var(--ink);
}

.reorder-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-step-btn {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--secondary-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-step-btn:hover:not(:disabled) {
  background: var(--primary);
  color: #ffffff;
}
.icon-step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.icon-step-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* Reading Part 4 & Vocab Matching Rows */
.split-reading-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 18px;
  align-items: start;
}

.match-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--line);
}
.match-row-card.is-correct {
  border-color: var(--emerald);
}
.match-row-card.is-wrong {
  border-color: var(--hot);
}

.match-row-prompt {
  flex: 1;
  min-width: 0;
}
.match-row-prompt strong {
  display: block;
  font-size: 0.89rem;
  color: var(--ink);
}

.select-compact {
  width: auto;
  min-width: 175px;
  max-width: 240px;
}

.ans-reveal {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #b42318;
}

.ans-inline-note {
  margin-top: 8px;
  font-size: 0.84rem;
  font-weight: 600;
}
.ans-inline-note.is-ok {
  color: var(--emerald);
}
.ans-inline-note.is-fix {
  color: #b42318;
}

.explain-note {
  margin: 8px 0 0;
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--secondary-ink);
}

.p5-select-bar {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.bank-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.bank-word-chip {
  padding: 4px 10px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink);
}

.gv-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.writing-box-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.writing-box-field .pill-chip {
  align-self: flex-start;
}
.writing-box-field strong {
  font-size: 0.9rem;
  color: var(--secondary-ink);
}

/* Speaking Scene & Browser Recorder */
.scene-frame-box {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 13px 15px;
  border-radius: 10px;
  background: var(--well);
}
.scene-illust-svg {
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.scene-frame-box p {
  margin: 4px 0 0;
  font-size: 0.87rem;
  color: var(--muted);
}

.recorded-audio-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.recorded-audio-row audio {
  height: 36px;
  flex: 1;
  min-width: 200px;
}

.btn-recording {
  background: #b42318;
  color: #ffffff;
}
.btn-recording:hover {
  background: #911b12;
}

/* Forecast & Ranking Cards */
.ranking-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ranking-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.ranking-card h3 {
  margin: 0;
  font-size: 0.97rem;
  color: var(--secondary-ink);
}

.ranking-card-top,
.ranking-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.top3-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* Realistic Full-Exam Chrome (#/exam) */
.sim-exam-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sim-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  border: 1px solid var(--line);
}

.sim-topbar-left strong {
  display: block;
  font-size: 0.96rem;
  color: var(--secondary-ink);
  margin-bottom: 6px;
}

.sim-seq-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sim-seq-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--well);
  color: var(--muted);
}
.sim-seq-pill.is-active {
  background: #281c5e;
  color: #ffffff;
}
.sim-seq-pill.is-done {
  background: rgba(7, 116, 83, 0.13);
  color: var(--emerald);
}

.sim-clock-box {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sim-clock-box strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1.1;
  color: var(--ink);
}
.sim-clock-box span {
  font-size: 0.78rem;
  color: var(--muted);
}

.sim-subhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.sim-subhead h1 {
  margin: 0 0 6px;
  font-size: 1.24rem;
  color: var(--ink);
}

.is-flagged {
  background: rgba(168, 88, 8, 0.14);
  color: #8f4900;
}

.exam-writing-card {
  padding: 18px;
  border-radius: 12px;
  background: var(--well);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.exam-writing-card h3 {
  margin: 0;
  font-size: 1.03rem;
  color: var(--ink);
}
.exam-writing-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.q-Step-badge {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(168, 88, 8, 0.14);
  color: #8f4900;
  font-weight: 700;
  font-size: 0.83rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.exam-wc-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.exam-wc-footer strong {
  font-size: 1.1rem;
  color: #944b00;
}

.sim-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.btn-exam-next {
  height: 41px;
  padding-inline: 20px;
  border-radius: var(--radius-control);
  background: #281c5e;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-exam-next:hover {
  background: #38287f;
}

/* Admin Gate & Code Duration Grid */
.admin-gate-wrap {
  max-width: 540px;
  margin: 18px auto;
}

.admin-code-gen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-gen-submit-slot {
  display: flex;
  align-items: flex-end;
}

/* ==========================================================================
   Responsive Breakpoints (Desktop -> Laptop -> Tablet -> Mobile)
   ========================================================================== */
@media (max-width: 1260px) {
  .ms-body {
    grid-template-columns: 236px minmax(0, 1fr) 300px;
    gap: 20px;
  }
  .ms-course-grid,
  .ms-course-grid.cols-5-home {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .icon-btn.mobile-menu-btn {
    display: inline-flex;
  }
  .ms-search-trigger kbd {
    display: none;
  }
  .ms-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .ms-left-rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-height: none;
    z-index: 120;
    padding: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-float);
    transform: translateX(-104%);
    transition: transform 220ms var(--ease-out);
  }
  .drawer-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  .portal-shell.drawer-open .ms-left-rail {
    transform: translateX(0);
  }
  .ms-right-rail {
    position: static;
    max-height: none;
  }
  .mobile-quick-strip {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .mobile-quick-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .mobile-quick-tile {
    background: #ffffff;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-block);
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--secondary-ink);
  }
  .catalog-shell,
  .course-detail-shell,
  .mocks-shell,
  .materials-shell,
  .room-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .catalog-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .catalog-sidebar h2 {
    grid-column: 1 / -1;
  }
  .ms-footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .ms-header-inner {
    grid-template-columns: 1fr auto;
    padding-inline: 10px;
    gap: 6px;
  }
  .ms-header-left,
  .ms-header-right {
    gap: 6px;
  }
  .icon-btn.mobile-tools-btn {
    display: inline-flex;
  }
  .ms-brand-mark {
    width: 32px;
    height: 32px;
  }
  .ms-brand-text {
    font-size: 0.88rem;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
  }
  .ms-center-nav,
  .ms-activate-btn span,
  .ms-header-divider,
  .ms-register-link {
    display: none;
  }
  .ms-activate-btn {
    width: 34px;
    height: 34px;
    padding-inline: 0;
    justify-content: center;
  }
  .ms-login-btn {
    height: 34px;
    padding-inline: 11px;
    font-size: 0.81rem;
  }
  .ms-user-pill {
    height: 34px;
    padding-right: 9px;
    font-size: 0.8rem;
  }
  .ms-search-trigger {
    flex: 0 0 34px;
    max-width: 34px;
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding-inline: 0;
    justify-content: center;
  }
  .ms-search-trigger span {
    display: none;
  }
  .block-head {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .block-title {
    font-size: 0.98rem;
  }
  .portrait-strip {
    grid-template-columns: repeat(5, 134px);
  }
  .ms-course-grid,
  .ms-course-grid.cols-5-home {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .poster-art-medallion {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  .poster-art-medallion svg.course-illust {
    width: 26px;
    height: 26px;
  }
  .poster-tag {
    font-size: 0.61rem;
    padding: 3px 6px;
  }
  .pdf-grid,
  .stats-grid-4,
  .ms-footer-grid,
  .forecast-home-grid,
  .lab-toolbar-grid,
  .split-reading-grid,
  .gv-two-col,
  .admin-code-gen-grid,
  .ranking-grid,
  .top3-spotlight-grid,
  .inline-options-3,
  .scene-frame-box {
    grid-template-columns: minmax(0, 1fr);
  }
  .match-row-card {
    flex-direction: column;
    align-items: stretch;
  }
  .select-compact {
    width: 100%;
    max-width: none;
  }
  .catalog-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-slide {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-slide-stage {
    order: -1;
    height: 118px;
  }
  .hero-slide-stage::before {
    display: none;
  }
  .hero-slide-content {
    padding: 16px 18px 28px;
  }
  .ms-footer {
    padding-bottom: 62px;
  }
  .study-tools-dock {
    left: 12px;
    right: 12px;
    bottom: 70px;
    align-items: stretch;
  }
  .study-tools-fab {
    display: none;
  }
  .study-tools-panel {
    width: 100%;
  }
  .ms-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    z-index: 92;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }
  .ms-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
  }
  .ms-bottom-item svg {
    width: 20px;
    height: 20px;
  }
  .ms-bottom-item[aria-current="page"] {
    color: var(--primary);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ==========================================================================
   Phase 2026.12 — Practice Workstation, Leaderboard & British Council Exam UI
   ========================================================================== */

/* 1. Practice Workstation Toolbar & Freemium Gate */
.prac-workstation-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--well);
  border: 1px solid var(--line);
}

.prac-ws-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.prac-mode-seg {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--line);
  gap: 3px;
}

.prac-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--secondary-ink);
  background: transparent;
  border: 0;
  transition: background 0.16s ease, color 0.16s ease;
}
.prac-seg-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.prac-seg-btn:hover {
  background: var(--well);
}
.prac-seg-btn.is-active {
  background: var(--primary);
  color: #ffffff;
}

.prac-ws-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.prac-switch-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary-ink);
}
.prac-switch-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: background 0.16s ease;
}
.prac-switch-pill.is-on {
  border-color: var(--emerald);
  background: rgba(15, 118, 110, 0.08);
  color: var(--emerald);
}
.prac-switch-pill.is-on .prac-switch-dot {
  background: var(--emerald);
}

.prac-timer-cluster {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.prac-timer-cluster svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
}

.prac-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary-ink);
}
.prac-tool-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.prac-tool-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.prac-tool-btn.is-active {
  background: rgba(19, 86, 136, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}
.prac-tool-btn.is-bookmarked {
  background: rgba(217, 119, 6, 0.12);
  border-color: #d97706;
  color: #b45309;
}

.prac-note-drawer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px dashed var(--line-strong, #cbd5e1);
}

.vip-gate-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef5fc 100%);
  border: 1px solid rgba(19, 86, 136, 0.24);
}
.vip-gate-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vip-gate-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.vip-gate-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vip-gate-body h3 {
  margin: 0;
  font-size: 1.04rem;
  color: var(--ink);
}
.vip-gate-body p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--secondary-ink);
}

/* 2. Upgraded Skill Lab Components (Inline Email Cloze, Paragraph Cards, Notice, Dictation, Audio Upload) */
.email-cloze-card {
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  overflow: hidden;
}
.email-cloze-head {
  padding: 12px 16px;
  background: var(--well);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}
.email-cloze-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.email-cloze-foot {
  padding: 10px 16px 14px;
  border-top: 1px dashed var(--line);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--secondary-ink);
}
.email-cloze-line {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--well);
  border: 1px solid transparent;
}
.email-cloze-line.is-correct {
  border-color: var(--emerald);
  background: rgba(15, 118, 110, 0.06);
}
.email-cloze-line.is-wrong {
  border-color: var(--hot);
  background: rgba(180, 35, 24, 0.05);
}
.cloze-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
}
.cloze-sentence {
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--ink);
}
.inline-gap-select {
  width: auto;
  min-width: 126px;
  height: 34px;
  margin: 0 4px;
  padding: 2px 10px;
  vertical-align: middle;
  line-height: 1.2;
  border-radius: 7px;
  border: 1.5px solid var(--primary);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
}
.inline-gap-select.is-ok {
  border-color: var(--emerald);
  color: var(--emerald);
}
.inline-gap-select.is-bad {
  border-color: var(--hot);
  color: var(--hot);
}

.exam-para-card {
  padding: 14px 16px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.exam-para-card.is-correct {
  border-color: var(--emerald);
}
.exam-para-card.is-wrong {
  border-color: var(--hot);
}
.para-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.para-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(19, 86, 136, 0.1);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}
.para-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.para-heading-picker {
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bank-word-chip.is-used {
  opacity: 0.48;
  text-decoration: line-through;
  background: var(--well);
}

.email-notice-frame {
  border-radius: 10px;
  border: 1px solid rgba(19, 86, 136, 0.25);
  background: #f8fafd;
  overflow: hidden;
}
.email-notice-head {
  padding: 10px 14px;
  background: rgba(19, 86, 136, 0.08);
  border-bottom: 1px solid rgba(19, 86, 136, 0.16);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}
.email-notice-head svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.email-notice-frame p {
  margin: 0;
  padding: 12px 14px;
}

.dictation-mini-box {
  margin-top: 8px;
  padding: 12px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-upload-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary-ink);
  cursor: pointer;
}
.file-upload-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.file-upload-pill input[type="file"] {
  display: none;
}

/* 3. Student Community Leaderboard (#/leaderboard & Home Strip) */
.lb-mini-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 15px;
  border-radius: 10px;
  background: var(--well);
  border: 1px solid var(--line);
}

.lb-hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 20px;
  align-items: center;
  padding: 24px 26px;
  border-radius: 14px;
  background: linear-gradient(125deg, #0d5242 0%, #11595e 52%, #135688 100%);
  color: #ffffff;
}
.lb-hero-copy h1 {
  margin: 0 0 8px;
  font-size: 1.38rem;
  line-height: 1.3;
  color: #ffffff;
}
.lb-hero-copy p {
  margin: 0 0 12px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.9);
}
.lb-hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
}
.lb-hero-art svg {
  width: 112px;
  height: 112px;
  display: block;
  margin-left: auto;
}

.lb-podium-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.lb-podium-card {
  position: relative;
  padding: 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
}
.lb-podium-card.is-gold {
  background: linear-gradient(180deg, #fffdf4 0%, #ffffff 100%);
  border-color: #e5b842;
  box-shadow: 0 6px 18px rgba(217, 155, 22, 0.12);
}
.lb-podium-card.is-silver {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-color: #94a3b8;
}
.lb-podium-card.is-bronze {
  background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
  border-color: #d9915b;
}
.lb-podium-rank-num {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.55rem;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.1);
  font-variant-numeric: tabular-nums;
}
.lb-podium-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lb-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.lb-podium-card.is-gold .lb-avatar {
  background: #c88a12;
}
.lb-podium-card.is-silver .lb-avatar {
  background: #475569;
}
.lb-podium-card.is-bronze .lb-avatar {
  background: #b45309;
}
.lb-podium-head h3 {
  margin: 0 0 3px;
  font-size: 0.98rem;
  color: var(--ink);
}
.lb-podium-tag {
  display: inline-block;
  margin-bottom: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--well);
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--secondary-ink);
}
.lb-podium-head small {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}
.lb-podium-stats {
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.lb-podium-stats strong {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.lb-podium-stats span {
  font-size: 0.8rem;
  color: var(--secondary-ink);
}

.lb-my-card {
  padding: 14px 18px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.08) 0%, rgba(19, 86, 136, 0.08) 100%);
  border: 1px solid rgba(15, 118, 110, 0.28);
}
.lb-my-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.lb-my-main strong {
  font-size: 0.93rem;
  color: var(--ink);
}
.lb-my-main p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--secondary-ink);
}
.lb-row-me {
  background: rgba(15, 118, 110, 0.07);
}

/* 4. Full-Viewport British Council Computer Exam Workstation (#/exam) */
.portal-shell.is-exam-immersive .ms-header,
.portal-shell.is-exam-immersive .ms-header-spacer,
.portal-shell.is-exam-immersive .ms-left-rail,
.portal-shell.is-exam-immersive .ms-right-rail,
.portal-shell.is-exam-immersive .ms-footer,
.portal-shell.is-exam-immersive .ms-bottom-nav,
.portal-shell.is-exam-immersive .hero-bleed,
.portal-shell.is-exam-immersive .study-tools-dock,
body.is-exam-immersive .study-tools-dock {
  display: none !important;
}

.portal-shell.is-exam-immersive .ms-body {
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
}

.portal-shell.is-exam-immersive .ms-center-col {
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
}

.bc-exam-viewport {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f3f4f8;
  color: #1c2432;
  font-size: 1rem;
}
.bc-exam-viewport.exam-font-sm {
  font-size: 0.92rem;
}
.bc-exam-viewport.exam-font-lg {
  font-size: 1.1rem;
}
.bc-exam-viewport.exam-font-lg .passage-prose,
.bc-exam-viewport.exam-font-lg .bc-gap-line,
.bc-exam-viewport.exam-font-lg .reorder-text {
  font-size: 1.08rem;
  line-height: 1.75;
}

.bc-exam-viewport.exam-theme-paper {
  background: #f4efe4;
  color: #26221b;
}
.bc-exam-viewport.exam-theme-paper .bc-card,
.bc-exam-viewport.exam-theme-paper .bc-para-box,
.bc-exam-viewport.exam-theme-paper .bc-instructions-card,
.bc-exam-viewport.exam-theme-paper .bc-subbar {
  background: #fbf8f1;
  border-color: #e2dac9;
}

.bc-exam-viewport.exam-theme-dark {
  background: #121620;
  color: #e6ecf5;
}
.bc-exam-viewport.exam-theme-dark .bc-subbar,
.bc-exam-viewport.exam-theme-dark .bc-bottombar,
.bc-exam-viewport.exam-theme-dark .bc-card,
.bc-exam-viewport.exam-theme-dark .bc-para-box,
.bc-exam-viewport.exam-theme-dark .bc-instructions-card,
.bc-exam-viewport.exam-theme-dark .well-item-card,
.bc-exam-viewport.exam-theme-dark .match-row-card,
.bc-exam-viewport.exam-theme-dark .reorder-card,
.bc-exam-viewport.exam-theme-dark .exam-writing-card,
.bc-exam-viewport.exam-theme-dark .bc-drawer,
.bc-exam-viewport.exam-theme-dark .bc-popover,
.bc-exam-viewport.exam-theme-dark .bc-modal-card,
.bc-exam-viewport.exam-theme-dark .bc-pause-card {
  background: #1b2130;
  border-color: #2e374d;
  color: #e6ecf5;
}
.bc-exam-viewport.exam-theme-dark .bc-part-h1,
.bc-exam-viewport.exam-theme-dark .bc-card-title,
.bc-exam-viewport.exam-theme-dark .bc-q-title,
.bc-exam-viewport.exam-theme-dark .bc-longread-title,
.bc-exam-viewport.exam-theme-dark .passage-prose,
.bc-exam-viewport.exam-theme-dark .reorder-text,
.bc-exam-viewport.exam-theme-dark .match-row-prompt strong {
  color: #f1f5f9;
}
.bc-exam-viewport.exam-theme-dark .ms-input,
.bc-exam-viewport.exam-theme-dark .ms-textarea,
.bc-exam-viewport.exam-theme-dark .ms-select,
.bc-exam-viewport.exam-theme-dark .bc-inline-select {
  background: #111622;
  border-color: #3b4661;
  color: #f8fafc;
}

/* Top Deep Indigo British Council Bar */
.bc-topbar {
  background: #241157;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: sticky;
  top: 0;
  z-index: 94;
}
.bc-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.bc-top-left,
.bc-top-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.bc-top-titles {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bc-top-skill {
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.bc-top-part {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.bc-seq-pills {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.bc-seq-pill {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
}
.bc-seq-pill.is-active {
  background: #ffffff;
  color: #241157;
  font-weight: 800;
}
.bc-seq-pill.is-done {
  background: rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
}

.bc-exam-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.76rem;
  font-weight: 700;
  color: #e9d5ff;
}

.bc-top-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  gap: 2px;
}
.bc-seg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 700;
}
.bc-seg-item svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.bc-seg-item.is-active {
  background: #ffffff;
  color: #241157;
}

.bc-exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
}
.bc-exit-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}
.bc-exit-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* Exam Sub-bar (Part Heading + Bookmark + Pause + Timer) */
.bc-subbar {
  background: #ffffff;
  border-bottom: 1px solid #dfe4ee;
}
.bc-subbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.bc-part-h1 {
  margin: 0 0 3px;
  font-size: 1.22rem;
  font-weight: 800;
  color: #1e1646;
}
.bc-sub-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.bc-skill-tag {
  padding: 2px 8px;
  border-radius: 5px;
  background: #efeafc;
  color: #3b1d82;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.bc-ans-count {
  font-size: 0.82rem;
  color: var(--muted);
}

.bc-sub-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bc-bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid #d4dae6;
  background: #ffffff;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
}
.bc-bookmark-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.bc-bookmark-btn.is-flagged {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}
.bc-pause-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #d4dae6;
  background: #ffffff;
  color: #241157;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bc-pause-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.bc-timer-card {
  min-width: 128px;
  padding: 6px 12px;
  border-radius: 9px;
  background: #f7f5fc;
  border: 1px solid #dfd8f5;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bc-timer-card strong {
  font-size: 1.02rem;
  font-weight: 800;
  color: #241157;
  font-variant-numeric: tabular-nums;
}
.bc-timer-card span {
  font-size: 0.71rem;
  color: #64748b;
}
.bc-timer-meter {
  width: 100%;
  height: 4px;
  display: block;
  margin-top: 2px;
}

/* Main Exam Canvas & Cards */
.bc-canvas {
  flex: 1;
  width: 100%;
}
.bc-canvas-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 96px;
}
.bc-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bc-card {
  padding: 20px 22px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #dfe4ee;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}
.bc-card-title {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.45;
  color: #1e293b;
}
.bc-q-title {
  font-size: 0.96rem;
  color: #1e293b;
}

.bc-instructions-card {
  max-width: 780px;
  margin: 18px auto;
  padding: 28px 32px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #dfe4ee;
  box-shadow: 0 8px 24px rgba(36, 17, 87, 0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bc-instructions-card h2 {
  margin: 0;
  font-size: 1.32rem;
  color: #241157;
}
.bc-inst-sub {
  font-size: 0.95rem;
  color: #4c1d95;
}
.bc-inst-prose {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bc-inst-prose p {
  margin: 0;
  line-height: 1.6;
  color: #334155;
}
.bc-device-check-box {
  padding: 14px 16px;
  border-radius: 10px;
  background: #f6f4fc;
  border: 1px solid #ddd6fe;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bc-inst-cta {
  margin: 6px 0 0;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  color: #241157;
}

.bc-btn-purple {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 0;
  background: #2b1463;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
}
.bc-btn-purple:hover {
  background: #3b1d82;
}
.bc-btn-purple svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.bc-audio-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f7f5fc;
  border: 1px solid #e0d9f6;
}
.bc-audio-box strong {
  display: block;
  font-size: 0.94rem;
  color: #1e1646;
}
.bc-audio-box small {
  font-size: 0.82rem;
  color: #64748b;
}
.bc-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 8px;
  border: 0;
  background: #2b1463;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
}
.bc-audio-btn:hover {
  background: #3c1e87;
}
.bc-audio-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.bc-gapfill-card {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bc-mail-salute,
.bc-mail-signoff {
  margin: 0;
  font-weight: 700;
  color: #1e293b;
}
.bc-gap-lines {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bc-gap-line {
  margin: 0;
  line-height: 1.85;
  font-size: 0.97rem;
}
.bc-inline-select {
  width: auto;
  min-width: 124px;
  height: 34px;
  margin: 0 5px;
  padding: 2px 10px;
  vertical-align: middle;
  line-height: 1.2;
  border-radius: 7px;
  border: 1.5px solid #3b1d82;
  background: #fbfaff;
  color: #241157;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.bc-scroll-pane {
  max-height: 70vh;
  overflow-y: auto;
}

.bc-longread-title {
  margin: 0;
  font-size: 1.24rem;
  color: #1e1646;
}
.bc-para-box {
  padding: 18px 20px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #dfe4ee;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bc-para-box.is-selected {
  border-color: #6d28d9;
}
.bc-para-footer {
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bc-para-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #3b1d82;
}

.bc-received-email {
  border-radius: 10px;
  border: 1px solid #d8d0f2;
  background: #faf9fe;
  overflow: hidden;
}
.bc-received-head {
  padding: 10px 14px;
  background: #efeafc;
  border-bottom: 1px solid #d8d0f2;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #241157;
}
.bc-received-head svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.bc-received-head strong {
  display: block;
  font-size: 0.88rem;
}
.bc-received-head small {
  font-size: 0.76rem;
  color: #5b21b6;
}
.bc-received-body {
  padding: 14px 16px;
  font-size: 0.93rem;
  line-height: 1.65;
}

/* Sticky Bottom Exam Bar */
.bc-bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  background: #ffffff;
  border-top: 1px solid #d8dee9;
  box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.05);
}
.bc-bottombar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bc-bot-left,
.bc-bot-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bc-icon-square {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #d4dae6;
  background: #ffffff;
  color: #241157;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bc-icon-square:hover {
  background: #f5f3ff;
  border-color: #6d28d9;
}
.bc-icon-square svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.bc-outline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid #d4dae6;
  background: #ffffff;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
}
.bc-outline-pill svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.bc-outline-pill.is-on {
  background: #ecfdf5;
  border-color: var(--emerald);
  color: var(--emerald);
}

.bc-btn-prev,
.bc-btn-next {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 700;
}
.bc-btn-prev {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
}
.bc-btn-prev:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.bc-btn-next {
  border: 0;
  background: #2b1463;
  color: #ffffff;
}
.bc-btn-next:hover {
  background: #3c1e87;
}
.bc-btn-prev svg,
.bc-btn-next svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* Exam Drawers, Popovers & Confirmation Modals */
.bc-overlay {
  position: fixed;
  inset: 0;
  z-index: 96;
  background: rgba(15, 23, 42, 0.36);
}
.bc-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(360px, 90vw);
  z-index: 97;
  padding: 20px;
  background: #ffffff;
  border-right: 1px solid #dfe4ee;
  box-shadow: 12px 0 32px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.bc-drawer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bc-drawer-item {
  width: 100%;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bc-drawer-item.is-current {
  border-color: #2b1463;
  background: #f3effd;
  color: #241157;
}

.bc-popover {
  position: fixed;
  left: 20px;
  bottom: 74px;
  width: min(340px, calc(100vw - 40px));
  z-index: 98;
  padding: 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d4dae6;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bc-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 99;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bc-modal-card {
  width: min(480px, 100%);
  padding: 22px 24px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #dfe4ee;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.2);
}
.bc-modal-card h3 {
  margin: 0;
  font-size: 1.08rem;
  color: #1e1646;
}

.bc-pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 96;
  padding: 20px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Shared Admin RBAC & Owner Console Classes (SPEC §4.4 & DESIGN.md)
   ========================================================================== */
.admin-identity-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--well);
}

.admin-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-self-pass-box {
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--well);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.perm-check-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--well);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out);
}
.perm-check-card:hover {
  background: var(--well-hover);
}
.perm-check-card:has(input:checked),
.perm-check-card.is-checked {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.perm-check-card input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.perm-check-card strong {
  display: block;
  font-size: 0.88rem;
  color: var(--ink);
}
.perm-check-card small {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.status-pill-locked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(194, 52, 46, 0.12);
  color: #991b1b;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-pill-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(7, 116, 83, 0.12);
  color: #065f46;
  font-size: 0.78rem;
  font-weight: 700;
}

.owner-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(82, 61, 168, 0.11);
  color: var(--violet);
  font-size: 0.78rem;
  font-weight: 700;
}

.owner-setup-box {
  padding: 18px 20px;
  border-radius: 12px;
  background: var(--well);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.owner-setup-box code {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--primary-deep);
  font-size: 0.83rem;
}

.owner-audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.btn-danger-subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(194, 52, 46, 0.25);
  background: rgba(194, 52, 46, 0.08);
  color: #991b1b;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
.btn-danger-subtle:hover {
  background: rgba(194, 52, 46, 0.15);
  border-color: rgba(194, 52, 46, 0.42);
}
.btn-danger-subtle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-danger-subtle:focus-visible {
  outline: 2px solid var(--hot);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  .perm-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.review-row-wrong {
  border-left: 3px solid var(--hot);
  background: rgba(180, 35, 24, 0.03);
}

/* Responsive Adjustments for Leaderboard & Exam Workstation */
@media (max-width: 900px) {
  .lb-hero-banner {
    grid-template-columns: 1fr;
  }
  .lb-hero-art {
    display: none;
  }
  .lb-podium-grid,
  .split-reading-grid,
  .gv-two-col {
    grid-template-columns: 1fr;
  }
  .bc-seq-pills {
    display: none;
  }
  .bc-outline-pill span {
    display: none;
  }
  .bc-canvas-inner {
    padding: 16px 12px 92px;
  }
  .bc-instructions-card {
    padding: 20px 18px;
  }
}

@media print {
  .ms-header,
  .ms-left-rail,
  .ms-right-rail,
  .ms-footer,
  .ms-bottom-nav,
  .study-tools-dock,
  .bc-topbar,
  .bc-bottombar,
  .post-actions,
  .cohort-pills {
    display: none !important;
  }
  .ms-body,
  .ms-center-col {
    display: block !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}
