/* Shared app shell for touch devices. Desktop deliberately keeps the original site design. */
.ivt-app-dock {
  display: none;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body {
  --ivt-app-bg: #edf3f9;
  --ivt-app-surface: #ffffff;
  --ivt-app-ink: #102a43;
  --ivt-app-muted: #60758a;
  --ivt-app-blue: #1565f5;
  --ivt-app-navy: #071d3d;
  --ivt-app-aqua: #2dd4bf;
  --ivt-app-yellow: #ffd447;
  --ivt-app-coral: #ff8066;
  --ivt-app-shadow: 0 18px 44px rgba(7, 29, 61, 0.13);
  color: var(--ivt-app-ink);
  background:
    radial-gradient(circle at 4% 16%, rgba(21, 101, 245, 0.08), transparent 17rem),
    radial-gradient(circle at 96% 72%, rgba(45, 212, 191, 0.1), transparent 19rem),
    var(--ivt-app-bg);
  font-family: "Trebuchet MS", "Aptos", sans-serif;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body :where(h1, h2, h3, h4, strong, button, input, select, .button) {
  font-family: inherit;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .site-header {
  border: 0;
  color: #fff;
  background: rgba(7, 29, 61, 0.96);
  box-shadow: 0 8px 28px rgba(7, 29, 61, 0.2);
  backdrop-filter: blur(20px);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .navbar {
  width: calc(100% - 1.25rem);
  min-height: 3.8rem;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .navbar-brand {
  color: #fff;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .navbar-logo {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .navbar-toggle {
  width: 44px;
  height: 44px;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .navbar-toggle span {
  background: #fff;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .navbar-panel {
  color: var(--ivt-app-ink);
  font-family: inherit;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .ivt-app-dock {
  z-index: 48;
  border: 1px solid rgba(16, 42, 67, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 50px rgba(7, 29, 61, 0.2);
  backdrop-filter: blur(20px);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .ivt-app-dock a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 52px;
  color: #74879a;
  font-size: 0.69rem;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-decoration: none;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .ivt-app-dock a[aria-current="page"] {
  color: var(--ivt-app-blue);
  background: #eaf2ff;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .ivt-app-dock svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .page-shell {
  max-width: none;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .study-hero {
  overflow: hidden;
  border: 0;
  color: #fff;
  background:
    radial-gradient(circle at 92% 8%, rgba(45, 212, 191, 0.35), transparent 14rem),
    radial-gradient(circle at 10% 90%, rgba(21, 101, 245, 0.8), transparent 18rem),
    linear-gradient(145deg, #071d3d 0%, #0a3978 58%, #1565f5 100%);
  box-shadow: 0 24px 55px rgba(7, 29, 61, 0.26);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .study-hero :where(h1, h2) {
  color: #fff;
  text-wrap: balance;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .study-hero .eyebrow {
  color: #8be8dc;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .study-hero .study-hero-copy > p:not(.eyebrow),
:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .study-hero .study-hero-copy > ul {
  color: rgba(255, 255, 255, 0.8);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .study-hero > :not(.study-hero-copy) {
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .study-hero > :not(.study-hero-copy) :where(h2, h3, strong) {
  color: #fff;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .study-hero > :not(.study-hero-copy) p:not(.eyebrow) {
  color: rgba(255, 255, 255, 0.78);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .study-hero .button-primary {
  color: var(--ivt-app-navy);
  background: var(--ivt-app-yellow);
  box-shadow: 0 12px 28px rgba(255, 212, 71, 0.2);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .study-hero .button-secondary {
  border-color: rgba(255, 255, 255, 0.26);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .content-section {
  border: 1px solid rgba(16, 42, 67, 0.06);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--ivt-app-shadow);
  backdrop-filter: blur(18px);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .content-section:nth-of-type(3n + 2) {
  background:
    radial-gradient(circle at 100% 0, rgba(45, 212, 191, 0.11), transparent 15rem),
    rgba(255, 255, 255, 0.94);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) :where(.feature-card, .exam-launch-card, .worked-example, .stat-card, details) {
  border-color: rgba(16, 42, 67, 0.1);
  border-radius: 22px;
  background: var(--ivt-app-surface);
  box-shadow: 0 10px 28px rgba(16, 42, 67, 0.08);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .eyebrow {
  color: var(--ivt-app-blue);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) :where(.button, button, input, select, summary, [role="button"]) {
  min-block-size: 48px;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .button-primary {
  color: #fff;
  background: var(--ivt-app-blue);
  box-shadow: 0 10px 24px rgba(21, 101, 245, 0.2);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body:not([data-page="home"]) .button-secondary {
  border-color: rgba(16, 42, 67, 0.12);
  background: #fff;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .site-footer {
  border: 0;
  color: var(--ivt-app-muted);
  background: transparent;
  box-shadow: none;
  font-family: inherit;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"]) body .info-dialog {
  border: 0;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(7, 29, 61, 0.3);
}

/* Pages whose first screen is generated or has a non-standard shell. */
:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="stats"] .stats-intro-section,
:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="grammar-guide"] .grammar-guide .guide-panel:first-child,
:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="perfect-workshop"] .perfect-workshop .hero {
  border: 0;
  color: #fff;
  background:
    radial-gradient(circle at 92% 8%, rgba(45, 212, 191, 0.32), transparent 14rem),
    radial-gradient(circle at 8% 94%, rgba(21, 101, 245, 0.74), transparent 18rem),
    linear-gradient(145deg, #071d3d, #0b438f);
  box-shadow: 0 24px 55px rgba(7, 29, 61, 0.25);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="stats"] .stats-intro-section :where(h1, h2, h3),
:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="grammar-guide"] .grammar-guide .guide-panel:first-child :where(h1, h2, h3),
:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="perfect-workshop"] .perfect-workshop .hero :where(h1, h2, h3) {
  color: #fff;
  text-wrap: balance;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="grammar-guide"] .grammar-guide .guide-panel,
:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="perfect-workshop"] .perfect-workshop section {
  border-color: rgba(16, 42, 67, 0.07);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--ivt-app-shadow);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="perfect-workshop"] .perfect-workshop .hero :where(p, .quiet) {
  color: rgba(255, 255, 255, 0.8);
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="perfect-workshop"] .perfect-workshop .hero .eyebrow,
:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="grammar-guide"] .grammar-guide .guide-panel:first-child .guide-kicker {
  color: #8be8dc;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="grammar-guide"] .grammar-guide .guide-panel:first-child .guide-links {
  flex-wrap: nowrap;
  max-width: 100%;
  padding: 0.2rem 0 0.4rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="grammar-guide"] .grammar-guide .guide-panel:first-child .guide-links::-webkit-scrollbar {
  display: none;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="grammar-guide"] .grammar-guide .guide-panel:first-child .guide-links a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
  text-decoration: none;
}

:where(html[data-ivt-device="mobile"], html[data-ivt-device="tablet"])
  body[data-page="falling-game"] .prototype-shell {
  width: min(100% - 1rem, 1180px);
  margin-inline: auto;
}

html[data-ivt-device="mobile"] body {
  padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
}

html[data-ivt-device="mobile"] body .ivt-app-dock {
  position: fixed;
  right: 0.5rem;
  bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px));
  left: 0.5rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.2rem;
  padding: 0.35rem;
  border-radius: 24px;
}

html[data-ivt-device="mobile"] body .ivt-app-dock a {
  flex-direction: column;
  gap: 0.22rem;
  border-radius: 18px;
}

html[data-ivt-device="mobile"] body .ivt-app-dock span {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

html[data-ivt-device="mobile"] body:not([data-page="home"]) .page-shell {
  width: 100%;
  padding: 0 0 1.5rem;
}

html[data-ivt-device="mobile"] body:not([data-page="home"]) .study-hero {
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0;
  padding: 1.4rem 1rem 1.25rem;
  border-radius: 0 0 36px 36px;
}

html[data-ivt-device="mobile"] body:not([data-page="home"]) .study-hero h1 {
  max-width: 14ch;
  font-size: clamp(2.05rem, 10.4vw, 2.85rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

html[data-ivt-device="mobile"] body:not([data-page="home"]) .study-hero > :not(.study-hero-copy) {
  min-height: 0;
  padding: 1rem;
  border-radius: 22px;
}

html[data-ivt-device="mobile"] body:not([data-page="home"]) .hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

html[data-ivt-device="mobile"] body:not([data-page="home"]) .hero-actions .button {
  min-width: 0;
  min-height: 52px;
  padding-inline: 0.65rem;
  border-radius: 18px;
  font-size: 0.88rem;
  line-height: 1.15;
  text-align: center;
}

html[data-ivt-device="mobile"] body:not([data-page="home"]) .content-section {
  width: calc(100% - 1rem);
  margin: 1rem auto 0;
  padding: 1.2rem 0.85rem;
  border-radius: 28px;
}

html[data-ivt-device="mobile"] body:not([data-page="home"]) .section-heading h2 {
  font-size: clamp(1.7rem, 7.8vw, 2.2rem);
  line-height: 1.05;
  text-wrap: balance;
}

html[data-ivt-device="mobile"] body:not([data-page="home"]) :where(.feature-grid, .two-col-grid) {
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

html[data-ivt-device="mobile"] body:not([data-page="home"]) .exam-modal {
  align-items: end;
  padding: 0.5rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
}

html[data-ivt-device="mobile"] body:not([data-page="home"]) .exam-modal-dialog {
  width: 100%;
  max-height: calc(var(--ivt-viewport-height, 100dvh) - 0.85rem);
  border: 0;
  border-radius: 28px 28px 20px 20px;
  box-shadow: 0 -20px 70px rgba(7, 29, 61, 0.3);
}

html[data-ivt-device="mobile"] body .site-footer {
  display: grid;
  width: calc(100% - 1rem);
  margin: 1rem auto 0;
  padding: 1rem 0.5rem 0.5rem;
  text-align: center;
}

html[data-ivt-device="mobile"] body .site-footer nav {
  justify-content: center;
}

html[data-ivt-device="mobile"] body[data-page="grammar-guide"] .grammar-guide,
html[data-ivt-device="mobile"] body[data-page="perfect-workshop"] .perfect-workshop {
  padding: 0 0.5rem 1.5rem;
}

html[data-ivt-device="mobile"] body[data-page="falling-game"] .prototype-shell {
  height: calc(var(--ivt-viewport-height, 100dvh) - 65px - 5.75rem - env(safe-area-inset-bottom, 0px));
  min-height: 0;
}

html[data-ivt-device="mobile"] body[data-page="grammar-guide"] .grammar-guide .guide-panel:first-child,
html[data-ivt-device="mobile"] body[data-page="perfect-workshop"] .perfect-workshop .hero {
  margin-inline: -0.5rem;
  padding: 1.4rem 1rem 1.25rem;
  border-radius: 0 0 36px 36px;
}

html[data-ivt-device="mobile"] body[data-page="grammar-guide"] .grammar-guide .guide-panel:not(:first-child),
html[data-ivt-device="mobile"] body[data-page="perfect-workshop"] .perfect-workshop section:not(.hero) {
  padding: 1.2rem 0.9rem;
  border-radius: 26px;
}

html[data-ivt-device="mobile"] body[data-page="grammar-guide"] .grammar-guide h1,
html[data-ivt-device="mobile"] body[data-page="perfect-workshop"] .perfect-workshop .hero h1 {
  font-size: clamp(2.05rem, 10.4vw, 2.85rem);
  line-height: 0.98;
}

html[data-ivt-device="tablet"] body {
  padding-left: 6.2rem;
}

html[data-ivt-device="tablet"] body .site-header {
  width: calc(100% + 6.2rem);
  margin-left: -6.2rem;
}

html[data-ivt-device="tablet"] body .ivt-app-dock {
  position: fixed;
  top: 5rem;
  bottom: 0.85rem;
  left: 0.7rem;
  display: flex;
  width: 5rem;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 26px;
}

html[data-ivt-device="tablet"] body .ivt-app-dock a {
  min-height: 4rem;
  flex-direction: column;
  gap: 0.28rem;
  border-radius: 20px;
}

html[data-ivt-device="tablet"] body .ivt-app-dock a:last-child {
  margin-top: auto;
}

html[data-ivt-device="tablet"] body .ivt-app-dock span {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

html[data-ivt-device="tablet"] body:not([data-page="home"]) .page-shell {
  width: min(100% - 1.5rem, 1080px);
  padding: 1rem 0 2rem;
}

html[data-ivt-device="tablet"] body:not([data-page="home"]) .study-hero {
  grid-template-columns: minmax(0, 1.2fr) minmax(230px, 0.8fr);
  gap: 1rem;
  padding: 1.55rem;
  border-radius: 32px;
}

html[data-ivt-device="tablet"] body:not([data-page="home"]) .study-hero h1 {
  font-size: clamp(2.55rem, 5.9vw, 4.2rem);
}

html[data-ivt-device="tablet"] body:not([data-page="home"]) .content-section {
  margin-top: 1.2rem;
  padding: 1.45rem;
  border-radius: 30px;
}

html[data-ivt-device="tablet"] body .site-footer {
  width: min(100% - 1.5rem, 1080px);
}

@media (orientation: landscape) and (max-height: 520px) {
  html[data-ivt-device="mobile"] body .ivt-app-dock {
    right: 0.4rem;
    bottom: 0.3rem;
    left: 0.4rem;
  }

  html[data-ivt-device="mobile"] body .ivt-app-dock a {
    min-height: 46px;
  }

  html[data-ivt-device="mobile"] body .ivt-app-dock span {
    font-size: 0.62rem;
  }
}

