:root {
  --bg: #080705;
  --panel: rgba(10, 10, 9, 0.9);
  --panel-soft: rgba(23, 21, 18, 0.82);
  --line: rgba(246, 189, 56, 0.36);
  --line-strong: rgba(255, 214, 108, 0.72);
  --gold: #f6bd38;
  --gold-bright: #ffd86b;
  --gold-dark: #a56607;
  --cream: #fff4cf;
  --text: #f7f1e5;
  --muted: #bdb6a9;
  --rose: #f4a7c9;
  --green: #54d59f;
  --red: #ff7979;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.48);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(246, 189, 56, 0.22), transparent 30rem),
    radial-gradient(circle at 90% 20%, rgba(244, 167, 201, 0.14), transparent 28rem),
    linear-gradient(145deg, #040302, #12100d 52%, #040302);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 28px;
  background:
    linear-gradient(145deg, #040302, #14100a 58%, #040302);
  color: var(--cream);
  text-align: center;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.boot-screen img {
  width: min(128px, 32vw);
  aspect-ratio: 1;
  border-radius: 18px;
  box-shadow: 0 0 34px rgba(246, 189, 56, 0.34);
}

.boot-screen strong {
  color: var(--gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 9vw, 4.2rem);
  line-height: 1;
  text-transform: uppercase;
}

.boot-screen span {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

body.app-ready .boot-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body:not(.app-ready) .app {
  opacity: 0;
}

.action-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  grid-template: 1fr / 1fr;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 140ms ease;
}

.action-loader.is-visible {
  opacity: 1;
}

.action-loader::before {
  content: "";
  position: absolute;
  width: min(180px, 42vw);
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 216, 107, 0.38);
  box-shadow: 0 0 28px rgba(246, 189, 56, 0.24);
}

.action-loader-ring {
  grid-area: 1 / 1;
  position: relative;
  width: 92px;
  aspect-ratio: 1;
  border-radius: 999px;
  border: 8px solid rgba(255, 244, 207, 0.22);
  border-top-color: var(--gold-bright);
  animation: action-loader-spin 740ms linear infinite;
}

.action-loader span {
  grid-area: 1 / 1;
  position: relative;
  z-index: 1;
  color: var(--gold-bright);
  font-size: clamp(0.68rem, 2.4vw, 0.92rem);
  font-weight: 1000;
  text-transform: uppercase;
  text-shadow: 0 1px 9px rgba(0, 0, 0, 0.9);
}

.lective-loading-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

@keyframes action-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

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

button {
  cursor: pointer;
  overflow: visible;
  transition: transform 150ms ease, filter 150ms ease, border-color 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 216, 107, 0.18);
}

[data-action],
[role="button"],
a,
label {
  touch-action: manipulation;
}

button:active {
  filter: brightness(1.08);
}

.button-press-shake {
  animation: button-press-shake 280ms ease both;
  transform-origin: center;
}

@keyframes button-press-shake {
  0% {
    transform: translateX(0) scale(1);
  }
  18% {
    transform: translateX(-3px) scale(0.985);
  }
  36% {
    transform: translateX(3px) scale(1.01);
  }
  54% {
    transform: translateX(-2px) scale(1);
  }
  72% {
    transform: translateX(2px) scale(1);
  }
  100% {
    transform: translateX(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .button-press-shake {
    animation: none;
  }
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  filter: saturate(0.55);
}

button[aria-busy="true"],
.is-loading {
  pointer-events: none;
  position: relative;
}

button[aria-busy="true"]::after,
.is-loading::after {
  content: "";
  width: 1em;
  height: 1em;
  margin-left: 0.5em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -0.15em;
  animation: spin 820ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.app {
  min-height: 100svh;
}

.app > * {
  animation: none;
}

.screen {
  min-height: 100svh;
  padding: 24px;
}

.shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.login-screen {
  display: grid;
  place-items: center;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(320px, 1.05fr);
  gap: 22px;
  width: min(1120px, 100%);
}

.login-art,
.home-hero,
.stage,
.certificate-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-art {
  min-height: 720px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.82)),
    url("assets/login.jpg") center / cover;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.login-art-copy {
  width: 100%;
  padding: 28px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.82));
}

.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;
}

.login-template {
  position: relative;
  width: min(calc((100dvh - 16px) * 0.5367), calc(100vw - 16px), 520px);
  aspect-ratio: 863 / 1608;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-template-image,
.certificate-template-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-template-form {
  position: absolute;
  inset: 0;
}

.login-template-form::after {
  content: "";
  position: absolute;
  left: 3%;
  right: 3%;
  top: 62.5%;
  bottom: 1%;
  border-radius: 10px;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 229, 137, 0.32), transparent 12%),
    linear-gradient(110deg, transparent 0%, rgba(255, 225, 128, 0.2) 45%, transparent 62%);
  mix-blend-mode: screen;
  opacity: 0.72;
  animation: loginLowerShine 2.8s ease-in-out infinite;
  z-index: 1;
}

.login-star-hit,
.login-template-input,
.login-template-submit,
.login-template-submit-reserve,
.login-template-update,
.login-service-badge,
.login-renew-button,
.login-lective-button,
.login-competition-button,
.login-search-button,
.login-renew-message,
.login-top-readers,
.login-mute-button,
.login-footnote,
.login-baby-course-button {
  position: absolute;
  border-radius: 8px;
  z-index: 2;
}

.login-star-hit,
.login-template-submit,
.login-template-submit-reserve,
.login-template-update {
  border: 0;
  background: transparent;
}

.login-button-label {
  width: 100%;
  max-width: 100%;
  display: block;
  text-align: center;
  line-height: inherit;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
}

.login-star-hit.is-lit {
  outline: 2px solid rgba(255, 216, 107, 0.68);
  outline-offset: -2px;
  box-shadow:
    0 0 20px rgba(255, 216, 107, 0.68),
    0 0 36px rgba(246, 189, 56, 0.34),
    inset 0 0 20px rgba(255, 216, 107, 0.28);
  animation: selectedStarShine 1.8s ease-in-out infinite;
}

.login-star-hit.is-lit::before {
  content: "\2605";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffd86b;
  font-size: clamp(1.7rem, 9.5vw, 3.8rem);
  line-height: 1;
  text-shadow:
    0 0 10px #fff4cf,
    0 0 22px rgba(255, 216, 107, 0.95),
    0 0 42px rgba(246, 189, 56, 0.65);
  pointer-events: none;
}

.login-star-hit.is-selected {
  outline-color: rgba(255, 244, 207, 0.96);
  box-shadow:
    0 0 30px rgba(255, 244, 207, 0.96),
    0 0 56px rgba(246, 189, 56, 0.62),
    inset 0 0 28px rgba(255, 216, 107, 0.48);
}

.login-star-hit.is-selected::before {
  font-size: clamp(2.1rem, 11vw, 4.4rem);
  color: #fff4cf;
}

.login-star-hit {
  z-index: 3;
}

.login-star-1 { left: 6.1%; top: 63.65%; width: 16.4%; height: 7.9%; }
.login-star-2 { left: 24.8%; top: 63.65%; width: 16.4%; height: 7.9%; }
.login-star-3 { left: 42.55%; top: 63.65%; width: 16.4%; height: 7.9%; }
.login-star-4 { left: 60.25%; top: 63.65%; width: 16.4%; height: 7.9%; }
.login-star-5 { left: 78.0%; top: 63.65%; width: 16.4%; height: 7.9%; }

.login-service-badge {
  left: 34.5%;
  top: 1.25%;
  width: 19.5%;
  max-width: none;
  height: 4.35%;
  padding: 0 3px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 1px solid rgba(255, 216, 107, 0.46);
  background: rgba(0, 0, 0, 0.72);
  color: var(--service-tone, #fff4cf);
  font-size: clamp(0.5rem, 1.28vw, 0.66rem);
  font-weight: 900;
  line-height: 0.98;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-wrap: balance;
  box-shadow: 0 0 18px var(--service-tone-soft, rgba(246, 189, 56, 0.22));
}

.login-lective-button {
  left: 5%;
  top: 1.25%;
  width: 28%;
  height: 4.35%;
  min-width: 0;
  min-height: 0;
  padding: 0 3px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 1px solid rgba(255, 216, 107, 0.78);
  background: rgba(0, 0, 0, 0.74);
  color: #fff;
  font-size: clamp(0.48rem, 1.2vw, 0.64rem);
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-wrap: balance;
  box-shadow: 0 0 18px var(--service-tone-soft, rgba(246, 189, 56, 0.22));
}

.login-star-hit:active {
  animation: starTapShake 180ms ease;
  transform-origin: center;
}

@keyframes starTapShake {
  20% {
    transform: translateX(-2px) rotate(-2deg);
  }

  45% {
    transform: translateX(2px) rotate(2deg);
  }

  70% {
    transform: translateX(-1px) rotate(-1deg);
  }
}

.login-competition-button {
  right: 5%;
  top: 1.25%;
  width: 27%;
  height: 4.35%;
  min-width: 0;
  min-height: 0;
  padding: 0 4px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 1px solid rgba(255, 216, 107, 0.78);
  background: linear-gradient(180deg, rgba(255, 216, 107, 0.98), rgba(184, 112, 6, 0.94));
  color: #050403;
  font-size: clamp(0.46rem, 1.32vw, 0.68rem);
  font-weight: 1000;
  line-height: 0.98;
  text-transform: uppercase;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-wrap: balance;
  box-shadow: 0 0 20px var(--service-tone-soft, rgba(246, 189, 56, 0.36));
}

.login-competition-button:disabled {
  opacity: 1;
  filter: none;
  background: linear-gradient(180deg, rgba(255, 216, 107, 1), rgba(184, 112, 6, 0.98));
  box-shadow:
    0 0 18px var(--service-tone-soft, rgba(246, 189, 56, 0.36)),
    inset 0 0 14px rgba(255, 244, 207, 0.22);
}

.login-renew-button {
  right: 4.2%;
  top: 58.45%;
  width: 23.6%;
  height: 4.1%;
  min-width: 0;
  min-height: 0;
  padding: 0 1px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  z-index: 4;
  border: 1px solid rgba(255, 216, 107, 0.88);
  background: linear-gradient(180deg, rgba(255, 216, 107, 0.98), rgba(184, 112, 6, 0.94));
  color: #171006;
  font-size: clamp(1.05rem, 5.2vw, 1.7rem);
  font-weight: 1000;
  line-height: 0.82;
  text-transform: uppercase;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-wrap: balance;
  transform-origin: center;
  box-shadow:
    0 0 18px rgba(255, 216, 107, 0.42),
    inset 0 0 14px rgba(255, 244, 207, 0.34);
  animation: renewButtonBreath var(--renew-breath-duration, 1.65s) ease-in-out infinite;
}

.login-renew-button .login-button-label {
  line-height: 0.82;
  white-space: nowrap;
  transform: scaleX(0.88);
  transform-origin: center;
}

.login-search-button {
  left: 55.3%;
  top: 1.25%;
  width: 11.3%;
  height: 4.35%;
  min-width: 0;
  min-height: 0;
  padding: 0 4px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  z-index: 4;
  border: 1px solid rgba(255, 244, 207, 0.88);
  background: rgba(0, 0, 0, 0.78);
  color: #fff4cf;
  font-size: clamp(0.38rem, 1vw, 0.54rem);
  font-weight: 1000;
  line-height: 0.98;
  text-transform: uppercase;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-wrap: balance;
  box-shadow:
    0 0 18px rgba(255, 216, 107, 0.34),
    inset 0 0 14px rgba(255, 244, 207, 0.12);
}

.login-renew-button:disabled {
  opacity: 0.68;
  animation: none;
}

.login-renew-message {
  left: 5%;
  right: 5%;
  top: 72.15%;
  padding: 6px 10px;
  border: 1px solid rgba(255, 216, 107, 0.34);
  background: rgba(0, 0, 0, 0.74);
  color: #fff4cf;
  font-size: clamp(0.6rem, 2.4vw, 0.88rem);
  font-weight: 900;
  text-align: center;
}

.login-update-install-button {
  min-width: 0;
  min-height: 0;
  cursor: pointer;
  border-color: rgba(255, 244, 207, 0.88);
  background: linear-gradient(180deg, rgba(255, 231, 140, 0.98), rgba(196, 121, 8, 0.96));
  color: #171006;
  font-size: clamp(0.58rem, 2.25vw, 0.9rem);
  font-weight: 1000;
  line-height: 1.05;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow:
    0 0 22px rgba(255, 216, 107, 0.54),
    inset 0 0 14px rgba(255, 244, 207, 0.32);
  animation: renewButtonBreath 1.25s ease-in-out infinite;
}

.login-top-readers {
  left: 3.1%;
  right: 3.1%;
  top: 5.75%;
  height: 9.15%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.1%;
  padding: 0.8%;
  border: 1px solid rgba(255, 216, 107, 0.46);
  background: rgba(0, 0, 0, 0.88);
  box-shadow:
    0 0 20px rgba(246, 189, 56, 0.22),
    inset 0 0 18px rgba(255, 216, 107, 0.08);
}

.login-reader-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 32% 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  column-gap: 5%;
  padding: 4% 5% 4% 10%;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, rgba(28, 22, 12, 0.96), rgba(5, 5, 5, 0.96));
  color: #fff4cf;
  overflow: hidden;
}

.login-reader-rank {
  position: absolute;
  left: 2%;
  top: 3%;
  width: 21%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe48a, #b87509);
  color: #171006;
  font-size: clamp(0.44rem, 1.8vw, 0.7rem);
  font-weight: 1000;
}

.login-reader-avatar {
  grid-row: 1 / span 2;
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 216, 107, 0.72);
  background: radial-gradient(circle at 35% 30%, rgba(255, 216, 107, 0.4), rgba(34, 20, 8, 0.98));
  color: #fff4cf;
  font-size: clamp(0.44rem, 1.9vw, 0.74rem);
  font-weight: 1000;
}

.login-reader-name,
.login-reader-score {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.login-reader-name {
  color: #fffaf0;
  font-size: clamp(0.42rem, 1.78vw, 0.72rem);
  font-weight: 950;
}

.login-reader-score {
  color: #ffd86b;
  font-size: clamp(0.42rem, 1.75vw, 0.68rem);
  font-weight: 1000;
}

.login-reader-card.is-empty {
  opacity: 0.74;
}

.login-baby-course-button {
  left: 4.2%;
  top: 58.45%;
  width: 23.6%;
  height: 4.1%;
  min-width: 0;
  min-height: 0;
  padding: 0 4px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  z-index: 4;
  border: 1px solid rgba(255, 216, 107, 0.82);
  background: linear-gradient(180deg, rgba(255, 216, 107, 0.95), rgba(190, 119, 8, 0.92));
  color: #171006;
  font-size: clamp(0.46rem, 1.35vw, 0.68rem);
  font-weight: 1000;
  line-height: 0.98;
  text-transform: uppercase;
  white-space: normal;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-wrap: balance;
  box-shadow:
    0 0 18px rgba(255, 216, 107, 0.44),
    inset 0 0 16px rgba(255, 244, 207, 0.35);
}

.login-baby-course-button.is-selected {
  border-color: #fff4cf;
  filter: brightness(1.14);
  box-shadow:
    0 0 24px rgba(255, 244, 207, 0.78),
    0 0 42px rgba(246, 189, 56, 0.58),
    inset 0 0 18px rgba(255, 244, 207, 0.52);
}

.login-template-input {
  left: 3.35%;
  width: 93.3%;
  height: 5.5%;
  padding: 0 7% 0 13%;
  border: 0;
  outline: 0;
  background: rgba(0, 0, 0, 0.86);
  color: #f7f1e5;
  font-size: clamp(0.8rem, 3.4vw, 1.35rem);
  font-weight: 700;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 244, 207, 0.12);
}

.login-template-input::placeholder {
  color: rgba(230, 230, 230, 0.68);
  opacity: 1;
}

.login-template-input:focus {
  background: rgba(0, 0, 0, 0.92);
  box-shadow:
    0 0 0 2px rgba(255, 216, 107, 0.42) inset,
    0 0 20px rgba(246, 189, 56, 0.3);
}

.login-template-input:not(:placeholder-shown) {
  background: rgba(0, 0, 0, 0.92);
}

.login-name-input {
  top: 76.55%;
}

.login-password-input {
  top: 83.35%;
}

.login-mute-button {
  left: 3.35%;
  top: 88.78%;
  width: 8.1%;
  height: 3.65%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  z-index: 5;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #ffd86b;
  line-height: 1;
  overflow: visible;
  box-shadow: none;
}

.login-mute-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.login-mute-button.is-muted {
  filter: grayscale(0.2) brightness(0.78);
}

.login-mute-button.is-muted::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 48%;
  height: 2px;
  background: #ff6363;
  transform: rotate(-38deg);
  box-shadow: 0 0 4px rgba(255, 99, 99, 0.7);
}

.login-footnote {
  left: 12%;
  right: 3.35%;
  top: 88.9%;
  min-height: 3.15%;
  padding: 2px 7px;
  border: 1px solid rgba(255, 216, 107, 0.42);
  background: rgba(0, 0, 0, 0.7);
  color: #fff4cf;
  font-size: clamp(0.36rem, 1.45vw, 0.54rem);
  font-weight: 800;
  line-height: 1.04;
  text-align: center;
  text-transform: none;
  box-shadow: 0 0 14px rgba(246, 189, 56, 0.22);
}

.login-footnote strong {
  color: #ffd86b;
}

.login-profile-link {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
}

.login-template-submit {
  left: 22.05%;
  top: 93.35%;
  width: 55.95%;
  height: 5.55%;
  color: #171104;
  font-size: clamp(16px, 4.6vw, 29px);
  font-weight: 900;
  text-transform: uppercase;
  box-shadow:
    0 0 18px rgba(255, 216, 107, 0.42),
    inset 0 0 20px rgba(255, 244, 207, 0.3);
  animation: loginButtonShine 2.2s ease-in-out infinite;
}

.login-template-submit-reserve {
  left: 3.35%;
  top: 93.35%;
  width: 18.7%;
  height: 5.55%;
  pointer-events: none;
}

.login-template-version {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 0 3px;
  color: rgba(23, 17, 4, 0.88);
  font-size: clamp(0.5rem, 1.8vw, 0.72rem);
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 244, 207, 0.28);
  white-space: nowrap;
  overflow: hidden;
}

.login-template-update {
  left: 78%;
  top: 93.35%;
  width: 18.65%;
  height: 5.55%;
  color: #171104;
  font-size: clamp(10px, 2.5vw, 16px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.login-template-update:disabled {
  opacity: 0.55;
}

.login-template-submit:disabled {
  opacity: 0.45;
  animation: none;
}

.login-template-error {
  position: absolute;
  left: 3.35%;
  right: 3.35%;
  top: 72.15%;
  z-index: 2;
  min-height: 3.15%;
  display: grid;
  place-items: center;
  padding: 2px 8px;
  border: 1px solid rgba(255, 99, 99, 0.48);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.88);
  color: #ffd3d3;
  font-size: clamp(0.5rem, 1.8vw, 0.72rem);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  overflow: hidden;
  text-wrap: balance;
}

@keyframes selectedStarShine {
  0%, 100% {
    filter: brightness(1);
    box-shadow:
      0 0 22px rgba(255, 216, 107, 0.74),
      0 0 42px rgba(246, 189, 56, 0.42),
      inset 0 0 20px rgba(255, 216, 107, 0.28);
  }
  50% {
    filter: brightness(1.18);
    box-shadow:
      0 0 34px rgba(255, 244, 207, 0.95),
      0 0 62px rgba(246, 189, 56, 0.68),
      inset 0 0 30px rgba(255, 216, 107, 0.52);
  }
}

@keyframes loginButtonShine {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}

@keyframes loginLowerShine {
  0%, 100% {
    opacity: 0.48;
    transform: translateX(-1%);
  }
  50% {
    opacity: 0.78;
    transform: translateX(1%);
  }
}

@keyframes renewButtonBreath {
  0%, 100% {
    filter: brightness(1);
    transform: scale(1);
    box-shadow:
      0 0 18px rgba(255, 216, 107, 0.42),
      inset 0 0 14px rgba(255, 244, 207, 0.34);
  }
  50% {
    filter: brightness(1.2);
    transform: scale(1.045);
    box-shadow:
      0 0 26px rgba(255, 244, 207, 0.82),
      0 0 46px rgba(246, 189, 56, 0.56),
      inset 0 0 18px rgba(255, 244, 207, 0.48);
  }
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
}

.kicker {
  margin: 0 0 5px;
  color: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
h3,
.serif {
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(2.3rem, 7vw, 5rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.login-art-copy p {
  max-width: 34rem;
  margin: 18px 0 0;
  color: rgba(255, 244, 207, 0.85);
  font-size: 1.03rem;
  line-height: 1.6;
}

.login-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-panel {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-error {
  padding: 10px 12px;
  border: 1px solid rgba(255, 121, 121, 0.48);
  border-radius: 8px;
  background: rgba(255, 121, 121, 0.1);
  color: #ffd7d7;
  font-size: 0.9rem;
  font-weight: 800;
}

.renewal-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 10px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.78);
}

.renewal-dialog {
  width: min(500px, 100%);
  max-height: calc(100dvh - 20px);
  overflow: auto;
  padding: clamp(12px, 3vw, 18px);
  border: 1px solid rgba(255, 216, 107, 0.58);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(246, 189, 56, 0.2), transparent 14rem),
    #080705;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.68);
}

.renewal-close-button {
  min-height: 38px;
}

.renewal-helper,
.renewal-dialog-message {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.renewal-helper strong {
  color: var(--gold-bright);
  font-size: 1.02rem;
}

.renewal-mtn-payment {
  margin: 10px 0 12px;
  padding: 10px;
  border: 2px solid #f1c400;
  border-radius: 8px;
  background: #ffe45c;
  color: #0047b3;
  box-shadow: 0 0 16px rgba(255, 228, 92, 0.22);
}

.renewal-mtn-payment .renewal-helper {
  margin: 0 0 6px;
  color: #0047b3;
  font-size: 0.9rem;
  line-height: 1.28;
}

.renewal-mtn-payment .renewal-helper strong,
.renewal-mtn-payment .renewal-breathing-text {
  color: #0047b3;
}

.renewal-logo-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid rgba(255, 216, 107, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.renewal-logo-row img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.renewal-logo-row strong,
.renewal-logo-row span {
  display: block;
}

.renewal-token-rate {
  margin: 8px 0 12px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 216, 107, 0.48);
  border-radius: 8px;
  background: rgba(255, 216, 107, 0.1);
  color: var(--gold-bright);
  font-size: clamp(1rem, 4.5vw, 1.35rem);
  font-weight: 1000;
  text-align: center;
}

.renewal-menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.renewal-path-button {
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 2px solid rgba(255, 216, 107, 0.56);
  border-radius: 8px;
  font-size: clamp(0.92rem, 4.2vw, 1.12rem);
  font-weight: 1000;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 0 22px rgba(255, 216, 107, 0.16);
}

.renewal-free-button,
.renewal-free-guide {
  background: linear-gradient(145deg, rgba(255, 216, 107, 0.22), rgba(9, 8, 5, 0.96));
  color: var(--gold-bright);
}

.renewal-path-mtn,
.renewal-guide-mtn {
  background: #ffe45c;
  color: #0047b3;
}

.renewal-path-airtel,
.renewal-guide-airtel {
  background: #c90000;
  color: #fff;
  border-color: #ff4d4d;
}

.renewal-guide,
.renewal-out-panel,
.renewal-token-panel {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(255, 216, 107, 0.44);
  border-radius: 8px;
}

.renewal-guide h3 {
  margin: 0 0 8px;
  color: inherit;
  font-size: clamp(1.05rem, 5vw, 1.45rem);
  line-height: 1.15;
}

.renewal-back-button,
.renewal-old-payment-button {
  width: 100%;
  margin-bottom: 10px;
}

.renewal-step-list {
  display: grid;
  gap: 7px;
}

.renewal-step-list > div {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: start;
  padding: 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  font-weight: 800;
}

.renewal-step-list > div span {
  overflow-wrap: anywhere;
}

.renewal-compact-field {
  margin-top: 0;
}

.renewal-reference-box {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
}

.renewal-reference-box span {
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.renewal-reference-box strong {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--gold-bright);
  font-size: clamp(1.25rem, 7vw, 2rem);
  font-weight: 1000;
  overflow-wrap: anywhere;
}

.renewal-warning {
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: #fff7d6;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
}

.renewal-return-note {
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.25;
}

.renewal-sms-note {
  margin: 8px 0;
  padding: 8px 9px;
  border: 1px solid rgba(67, 207, 124, 0.5);
  border-radius: 8px;
  background: rgba(67, 207, 124, 0.12);
  color: #e8ffe8;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.25;
}

.renewal-start-button {
  width: 100%;
  margin-top: 10px;
}

.renewal-token-panel,
.renewal-out-panel {
  background: rgba(255, 255, 255, 0.035);
}

.renewal-footnote {
  margin: 12px 0 0;
  color: var(--cream);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}

.renewal-breathing-text {
  color: #0047b3;
  font-weight: 1000;
  animation: renewalTextBreath 2.4s ease-in-out infinite;
}

.renewal-device-code-wrap {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
}

.renewal-device-code {
  margin: 0;
  padding: 14px 12px;
  border: 1px solid rgba(255, 216, 107, 0.58);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.48);
  color: var(--gold-bright);
  font-size: clamp(1.9rem, 8vw, 3rem);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
}

.renewal-copy-code-button {
  min-height: 38px;
  font-size: 0.88rem;
}

.renewal-code-char {
  display: inline-block;
  min-width: 0.7em;
  animation: renewalCodeBounce 2.2s ease-in-out infinite;
}

.renewal-code-char-2 { animation-delay: 0.12s; }
.renewal-code-char-3 { animation-delay: 0.24s; }
.renewal-code-char-4 { animation-delay: 0.36s; }
.renewal-code-char-5 { animation-delay: 0.48s; }
.renewal-code-char-6 { animation-delay: 0.6s; }

.renewal-other-methods {
  font-size: 0.84rem;
}

.renewal-airtel-merchant {
  margin: 10px 0 0;
  padding: 10px;
  border: 2px solid #ff4d4d;
  border-radius: 8px;
  background: #c90000;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 1000;
  line-height: 1.3;
  text-align: center;
}

.renewal-dialog .primary-button {
  width: 100%;
  min-height: 44px;
}

.renewal-dialog-message {
  min-height: 1.4em;
  color: var(--gold-bright);
  font-weight: 900;
}

.renewal-field {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.renewal-field span {
  color: var(--cream);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.renewal-field input,
.renewal-field select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(255, 216, 107, 0.42);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1rem;
}

.renewal-field [data-renewal-token] {
  min-height: 58px;
  font-size: 1.55rem;
  font-weight: 1000;
  letter-spacing: 0;
  text-align: center;
}

@keyframes renewalTextBreath {
  0%, 100% { color: var(--gold-bright); text-shadow: 0 0 0 rgba(255, 216, 107, 0); }
  50% { color: #fff4c4; text-shadow: 0 0 18px rgba(255, 216, 107, 0.62); }
}

@keyframes renewalCodeBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.renewal-field select option,
.input-wrap select option,
.competition-card select option {
  background: #070604;
  color: var(--cream);
}

.renewal-field input:focus,
.renewal-field select:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(246, 189, 56, 0.18);
}

.competition-screen {
  min-height: 100svh;
  padding: 18px;
  display: grid;
  place-items: start center;
}

.competition-host-panel {
  width: min(920px, 100%);
  padding: clamp(16px, 4vw, 28px);
  border: 1px solid rgba(255, 216, 107, 0.42);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(246, 189, 56, 0.2), transparent 18rem),
    rgba(7, 6, 4, 0.94);
  box-shadow: var(--shadow);
}

.competition-status-card,
.competition-link-box,
.competition-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 244, 207, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.competition-status-card {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.competition-status-card strong {
  color: var(--rose);
  font-size: 1.1rem;
  text-transform: uppercase;
}

.competition-status-card.is-live strong {
  color: var(--green);
}

.competition-link-box {
  display: grid;
  gap: 8px;
}

.competition-link-box span {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.competition-link-box strong {
  overflow-wrap: anywhere;
  color: var(--gold-bright);
  font-size: clamp(1.2rem, 4vw, 2rem);
}

.competition-qr-wrap {
  margin-top: 14px;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.competition-qr {
  width: min(220px, 68vw);
  aspect-ratio: 1;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 216, 107, 0.36),
    0 16px 42px rgba(0, 0, 0, 0.42);
}

.competition-qr-wrap span,
.competition-qr-empty {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
}

.competition-qr-empty {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed rgba(255, 216, 107, 0.36);
  border-radius: 8px;
}

.competition-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.competition-back-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-actions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.competition-mode-grid,
.competition-level-grid,
.competition-certificate-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.competition-mode-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid rgba(255, 216, 107, 0.42);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--text);
  display: grid;
  align-content: center;
  gap: 8px;
  text-align: left;
}

.competition-mode-card.is-selected {
  border-color: rgba(255, 244, 207, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 216, 107, 0.22), rgba(0, 0, 0, 0.52)),
    rgba(0, 0, 0, 0.42);
  box-shadow:
    0 0 0 2px rgba(255, 216, 107, 0.38),
    0 0 24px rgba(255, 216, 107, 0.34),
    inset 0 0 18px rgba(255, 244, 207, 0.14);
}

.competition-mode-card.is-selected strong {
  color: #fff4cf;
  text-shadow: 0 0 12px rgba(255, 216, 107, 0.55);
}

.competition-mode-card strong {
  color: var(--gold-bright);
  font-size: clamp(1.25rem, 4vw, 1.8rem);
  text-transform: uppercase;
}

.competition-mode-card span,
.small-note {
  color: var(--muted);
  line-height: 1.4;
}

.competition-source-row,
.answer-join-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.competition-timer-setting {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 216, 107, 0.34);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(76px, 110px) auto;
  gap: 10px;
  align-items: center;
}

.competition-timer-setting span {
  color: var(--cream);
  font-weight: 1000;
  text-transform: uppercase;
}

.competition-timer-setting strong {
  color: var(--gold-bright);
  white-space: nowrap;
}

.competition-timer-setting input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 216, 107, 0.55);
  border-radius: 8px;
  background: #070604;
  color: var(--gold-bright);
  font-size: 1.1rem;
  font-weight: 1000;
  text-align: center;
}

.answer-join-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ghost-button.is-selected,
.compact-level.is-selected {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  box-shadow: 0 0 22px rgba(246, 189, 56, 0.22);
}

.compact-level {
  min-height: 84px;
}

.competition-certificate-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.competition-certificate-card {
  padding: 10px;
  border: 1px solid rgba(255, 216, 107, 0.48);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.46);
  display: grid;
  gap: 8px;
  text-align: center;
}

.competition-certificate-template-image {
  width: 100%;
  max-height: min(78vh, 760px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.competition-certificate-card strong {
  color: var(--gold-bright);
  font-size: 1.25rem;
}

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

.competition-certificate-actions .primary-button {
  min-height: 42px;
  padding-inline: 8px;
  font-size: 0.78rem;
}

.lective-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgba(255, 216, 107, 0.45);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--text);
  padding: 12px;
  line-height: 1.35;
}

.lective-voice-field {
  min-width: 0;
}

.lective-voice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 8px;
  align-items: stretch;
}

.lective-voice-row input,
.lective-voice-row textarea {
  min-width: 0;
}

.lective-voice-button {
  width: 46px;
  min-width: 46px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: #fff;
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.lective-voice-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.lective-voice-button.is-listening {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(84, 213, 159, 0.34), 0 0 20px rgba(84, 213, 159, 0.36);
}

.lective-voice-status {
  display: block;
}

.lective-plus-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.lective-folder-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lective-saved-row {
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.4fr) auto auto;
}

.small-button {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.86rem;
}

.lective-plus-button {
  width: 64px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 216, 107, 0.78);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 216, 107, 0.98), rgba(184, 112, 6, 0.94));
  color: #050403;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  font-weight: 1000;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(246, 189, 56, 0.24);
}

.lective-plus-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.elective-class-list {
  display: grid;
  gap: 14px;
}

.elective-class-grid,
.elective-subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.elective-class-card,
.elective-subject-card {
  min-height: 76px;
  padding: 10px;
  gap: 4px;
}

.elective-class-card strong,
.elective-subject-card strong {
  font-size: clamp(0.98rem, 2.2vw, 1.28rem);
}

.elective-class-card span,
.elective-subject-card span {
  font-size: 0.82rem;
}

.elective-subject-card.is-complete {
  border-color: rgba(84, 213, 159, 0.7);
  box-shadow: 0 0 18px rgba(84, 213, 159, 0.22);
}

.elective-subject-card em {
  color: var(--gold-bright);
  font-style: normal;
  font-weight: 900;
}

.school-badge-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 216, 107, 0.34);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
}

.school-badge-preview img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 216, 107, 0.72);
}

.school-badge-preview span {
  color: var(--cream);
  font-weight: 900;
}

.elective-combination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: 10px;
}

.elective-combination-option {
  min-height: 76px;
  padding: 12px;
  border: 1px solid rgba(255, 216, 107, 0.36);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
}

.elective-combination-option input {
  width: 22px;
  height: 22px;
  accent-color: var(--gold-bright);
}

.elective-combination-option span {
  color: var(--cream);
  font-size: 1rem;
  font-weight: 900;
}

.elective-combination-option em {
  grid-column: 2;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.elective-combination-option.is-disabled {
  opacity: 0.52;
}

.company-profile-screen {
  min-height: 100svh;
  padding: 18px;
}

.company-profile-panel {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 216, 107, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 216, 107, 0.08), transparent 210px),
    rgba(7, 6, 4, 0.9);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.company-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 12px;
}

.company-member-card {
  min-height: 124px;
  padding: 12px;
  border: 1px solid rgba(255, 216, 107, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.company-member-card img,
.company-member-initials {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2px solid rgba(255, 216, 107, 0.62);
  object-fit: cover;
  background: #161006;
}

.company-member-initials {
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  font-weight: 900;
  font-size: 1.15rem;
}

.company-member-card strong {
  display: block;
  color: var(--cream);
  font-size: 1rem;
  line-height: 1.2;
}

.company-member-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.company-funders-title {
  display: grid;
  grid-template-columns: minmax(20px, 1fr) auto minmax(20px, 1fr);
  gap: 12px;
  align-items: center;
}

.company-funders-title span {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 216, 107, 0.66), transparent);
}

.company-funders-title h3 {
  margin: 0;
  color: var(--gold-bright);
  font-size: clamp(1.8rem, 7vw, 4rem);
  letter-spacing: 0.08em;
  text-shadow: 0 0 24px rgba(246, 189, 56, 0.42);
}

.company-funder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 10px;
}

.company-funder-box {
  min-height: 104px;
  padding: 10px;
  border: 1px solid rgba(255, 244, 207, 0.22);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  display: grid;
  align-content: start;
  gap: 5px;
}

.company-funder-box.is-filled {
  border-color: rgba(255, 216, 107, 0.52);
  background: linear-gradient(180deg, rgba(246, 189, 56, 0.12), rgba(0, 0, 0, 0.28));
}

.company-funder-box span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #261600;
  font-weight: 900;
}

.company-funder-box strong {
  color: var(--cream);
  font-size: 0.92rem;
  line-height: 1.2;
}

.company-funder-box em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.74rem;
  line-height: 1.25;
}

.lective-mini-progress {
  margin-top: 8px;
  color: var(--muted);
}

.lective-side-buttons .lective-mini-progress {
  display: none;
}

.lective-correction-card {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 216, 107, 0.52);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.48);
  box-shadow: 0 0 14px rgba(246, 189, 56, 0.12);
  display: grid;
  gap: 8px;
}

.lective-correction-card p {
  margin: 0;
  color: var(--gold-bright);
  font-size: clamp(0.95rem, 2.35vw, 1.12rem);
  font-weight: 900;
  line-height: 1.3;
}

.elective-partition {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.elective-partition::before,
.elective-partition::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 216, 107, 0.62), transparent);
}

.search-screen textarea {
  width: 100%;
  resize: vertical;
  min-height: 108px;
  border: 1px solid rgba(255, 216, 107, 0.45);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--text);
  padding: 12px;
  line-height: 1.35;
}

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

.search-scope-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 216, 107, 0.36);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.32);
  color: var(--text);
  font-weight: 900;
}

.search-scope-option.is-selected {
  border-color: rgba(255, 244, 207, 0.88);
  background: rgba(246, 189, 56, 0.18);
  color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(246, 189, 56, 0.22);
}

.search-scope-option input {
  accent-color: var(--gold-bright);
}

.search-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.search-confirm-card .search-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.search-confirm-query {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 216, 107, 0.3);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.search-confirm-query span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.search-confirm-query strong {
  color: var(--gold-bright);
  overflow-wrap: anywhere;
}

.search-result-list {
  display: grid;
  gap: 10px;
}

.search-result-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 216, 107, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.36);
}

.search-result-item h3 {
  margin: 0;
  color: var(--gold-bright);
  font-size: 1rem;
}

.search-result-item p {
  margin: 0;
}

.search-result-item > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.competition-live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
}

.competition-live-grid-compact {
  grid-template-columns: minmax(0, 1fr);
}

.competition-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.detail-button {
  min-width: 112px;
}

.competition-detail-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 216, 107, 0.32);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.competition-card {
  position: relative;
}

.competition-dot-rail {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 7px;
  max-height: min(60svh, 420px);
  overflow: hidden;
  pointer-events: none;
}

.competition-dot {
  width: 12px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--dot-color, var(--gold-bright));
  box-shadow:
    0 0 0 1px rgba(255, 244, 207, 0.42),
    0 0 12px rgba(255, 216, 107, 0.48);
}

.competition-dot.is-active {
  width: 16px;
  box-shadow:
    0 0 0 2px rgba(255, 244, 207, 0.82),
    0 0 18px rgba(255, 216, 107, 0.72);
}

.competition-focus-name {
  max-width: calc(100% - 42px);
  margin: 0 0 8px;
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 8vw, 4.8rem);
  font-weight: 1000;
  line-height: 0.98;
  overflow-wrap: anywhere;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.64),
    0 0 24px rgba(246, 189, 56, 0.26);
}

.competition-card h3 {
  margin: 0;
  color: var(--gold-bright);
}

.competition-reference {
  display: inline-block;
  margin: 12px 0 8px;
  padding: 5px 10px;
  background: #111;
  color: var(--gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 900;
}

.competition-question {
  margin: 10px 0;
  color: var(--cream);
  font-size: clamp(1.18rem, 3.4vw, 1.58rem);
  line-height: 1.35;
  white-space: pre-line;
}

.competition-question-only {
  min-height: clamp(132px, 24svh, 250px);
  max-height: min(42svh, 360px);
  padding: 22px 18px;
  border: 1px solid rgba(255, 216, 107, 0.36);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  display: grid;
  place-items: center;
  overflow: auto;
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 7.8vw, 4.45rem);
  font-weight: 900;
  line-height: 1.08;
  text-align: center;
  overflow-wrap: anywhere;
}

.competition-countdown {
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.competition-countdown-ring {
  width: 88px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(var(--gold-bright) calc(var(--timer-angle, 360deg)), rgba(255, 244, 207, 0.16) 0),
    rgba(0, 0, 0, 0.42);
  display: grid;
  place-items: center;
  box-shadow: 0 0 26px rgba(246, 189, 56, 0.24);
  position: relative;
  animation: timerTick 220ms ease;
  transform-origin: center;
}

.competition-countdown-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #070604;
}

.competition-countdown-ring strong {
  position: relative;
  z-index: 1;
  color: var(--gold-bright);
  font-size: 1.1rem;
}

.competition-countdown.is-warning {
  color: #ffd7d7;
  animation: none;
}

.competition-countdown.is-warning .competition-countdown-ring {
  background:
    conic-gradient(var(--red) calc(var(--timer-angle, 360deg)), rgba(255, 244, 207, 0.16) 0),
    rgba(0, 0, 0, 0.42);
  box-shadow: 0 0 30px rgba(255, 121, 121, 0.34);
}

@keyframes timerTick {
  45% {
    transform: scale(1.035);
  }
}

@keyframes warningPulse {
  50% {
    transform: scale(1.02);
  }
}

.competition-question,
.competition-options,
.competition-answer-list,
.competition-answer-option,
.competition-answer-list .primary-button {
  animation: none !important;
}

.competition-reading-passages {
  display: grid;
  gap: 18px;
  margin: 12px 0;
}

.competition-story-paragraph {
  padding: 14px;
  border: 1px solid rgba(255, 244, 207, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.competition-story-paragraph p {
  margin: 0;
  color: var(--cream);
  font-size: clamp(1rem, 2.7vw, 1.22rem);
  line-height: 1.55;
}

.competition-story-paragraph + .competition-story-paragraph {
  margin-top: 10px;
}

.competition-story-title {
  margin-bottom: 10px !important;
  color: var(--gold-bright) !important;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
}

.competition-handoff {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 18px;
  border: 1px solid rgba(255, 216, 107, 0.42);
  border-radius: 8px;
  background: rgba(246, 189, 56, 0.1);
  text-align: center;
}

.competition-handoff strong {
  color: var(--gold-bright);
  font-size: clamp(1.25rem, 4vw, 1.8rem);
}

.competition-handoff span {
  color: var(--cream);
  font-weight: 800;
}

.competition-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.competition-dashboard span {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 244, 207, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.competition-dashboard strong {
  display: block;
  color: var(--gold-bright);
  font-size: 1.35rem;
}

.competition-options,
.competition-player-list {
  display: grid;
  gap: 8px;
}

.competition-player-list-stable {
  min-height: 121px;
}

.competition-answer-list {
  grid-template-columns: 1fr;
}

.competition-answer-option,
.competition-answer-list .primary-button {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  justify-content: start;
  text-align: left;
  white-space: normal;
  line-height: 1.2;
  font-size: clamp(1.35rem, 4.4vw, 2.45rem);
}

.competition-answer-option strong,
.competition-answer-list .primary-button strong {
  min-width: 2.2rem;
  color: #261600;
}

.competition-answer-option.is-selected {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, #d89716, #a96305);
  color: #fff7df;
}

.competition-answer-option.is-correct {
  border-color: rgba(84, 213, 159, 0.86);
  background: linear-gradient(180deg, rgba(84, 213, 159, 0.24), rgba(12, 70, 45, 0.82));
  color: var(--cream);
  box-shadow:
    0 0 0 2px rgba(84, 213, 159, 0.22) inset,
    0 0 20px rgba(84, 213, 159, 0.18);
}

.competition-answer-option.is-wrong {
  border-color: rgba(255, 121, 121, 0.86);
  box-shadow: 0 0 0 2px rgba(255, 121, 121, 0.16) inset;
}

.competition-answer-option.is-wrong-option:not(.is-selected) {
  opacity: 0.86;
}

.competition-answer-option.is-correct .answer-mark {
  color: var(--green);
  font-size: 3.6em;
  line-height: 0.55;
  overflow: visible;
  transform: translateX(10%) scale(1.12);
  text-shadow: 0 0 12px rgba(84, 213, 159, 0.78);
}

.competition-answer-option.is-wrong-option .answer-mark {
  color: var(--red);
  text-shadow: 0 0 10px rgba(255, 121, 121, 0.45);
}

.competition-options span,
.competition-player-row {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 244, 207, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}

.competition-options span {
  font-size: clamp(1.25rem, 3.8vw, 2.2rem);
  line-height: 1.18;
  font-weight: 900;
}

.competition-options strong {
  color: var(--gold-bright);
}

.competition-player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.competition-player-row strong {
  overflow: hidden;
  color: var(--cream);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competition-full-note {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 121, 121, 0.48);
  border-radius: 8px;
  background: rgba(255, 121, 121, 0.1);
  color: #ffd7d7;
  font-weight: 900;
}

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

.section-head h2,
.panel h2,
.stage h2 {
  margin: 0;
  color: var(--gold-bright);
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.leader-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.leader-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 244, 207, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.leader-rank,
.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.leader-rank {
  width: 34px;
  height: 34px;
  color: #2e1900;
  background: linear-gradient(180deg, #fff3a4, #c77708);
}

.avatar {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  color: var(--cream);
  background: linear-gradient(135deg, rgba(246, 189, 56, 0.28), rgba(244, 167, 201, 0.18));
}

.leader-name,
.leader-points {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-name {
  font-weight: 800;
}

.leader-points {
  color: var(--gold-bright);
  font-weight: 800;
}

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

.level-choice,
.level-tile {
  border: 1px solid rgba(255, 244, 207, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.level-choice {
  min-height: 112px;
  padding: 10px 8px;
  display: grid;
  place-items: center;
  gap: 4px;
}

.level-choice:hover,
.level-tile:hover,
.nav-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.level-choice.is-selected,
.level-tile.is-current {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(246, 189, 56, 0.18), rgba(246, 189, 56, 0.05));
  box-shadow: 0 0 0 2px rgba(246, 189, 56, 0.18) inset;
}

.star {
  color: var(--gold);
  font-size: 2.2rem;
  line-height: 1;
  text-shadow: 0 0 16px rgba(246, 189, 56, 0.4);
}

.level-choice span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.input-wrap {
  display: grid;
  gap: 7px;
}

.input-wrap label,
.input-wrap > span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.input-wrap input,
.input-wrap select {
  width: 100%;
  min-height: 54px;
  padding: 0 15px;
  border: 1px solid rgba(255, 244, 207, 0.24);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(246, 189, 56, 0.18);
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 50px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.primary-button {
  border: 1px solid rgba(255, 230, 137, 0.7);
  color: #261600;
  background: linear-gradient(180deg, #ffe68a, #d38a09 55%, #a86305);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46), 0 12px 30px rgba(211, 138, 9, 0.24);
}

.competition-complete-button {
  border-width: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 0 0 3px rgba(255, 219, 99, 0.18),
    0 14px 32px rgba(255, 184, 42, 0.34);
}

.ghost-button,
.danger-button {
  border: 1px solid rgba(255, 244, 207, 0.28);
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.danger-button {
  border-color: rgba(255, 121, 121, 0.42);
  color: #ffd7d7;
}

.small-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.app-frame {
  min-height: 100svh;
  padding: 20px 20px 94px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  width: min(1120px, 100%);
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 6, 4, 0.9);
  backdrop-filter: blur(14px);
}

.app-back-button {
  min-height: 38px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.86rem;
  line-height: 1;
}

.app-back-button span:first-child {
  font-size: 1.25rem;
  line-height: 0.8;
}

.topbar-back {
  min-width: 76px;
}

.user-chip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  font-weight: 900;
}

.user-chip span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 244, 207, 0.2);
  border-radius: 999px;
  color: var(--rose);
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.88rem, 2.4vw, 1.12rem);
  font-weight: 900;
}

.course-progress-panel {
  width: min(1120px, 100%);
  margin: -6px auto 16px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(255, 216, 107, 0.28);
  border-radius: 8px;
  background: rgba(7, 6, 4, 0.9);
  box-shadow: 0 0 22px rgba(246, 189, 56, 0.12);
}

.course-progress-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: clamp(0.78rem, 2.2vw, 0.98rem);
  font-weight: 800;
  text-transform: uppercase;
}

.course-progress-row span {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 244, 207, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.course-progress-row strong {
  color: var(--gold-bright);
  font-size: 1.04em;
}

.course-progress-track {
  position: relative;
  height: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 244, 207, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.course-progress-fill,
.course-progress-answer-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.course-progress-fill {
  background: linear-gradient(90deg, rgba(255, 216, 107, 0.35), rgba(255, 216, 107, 0.95));
  box-shadow: 0 0 18px rgba(246, 189, 56, 0.45);
}

.course-progress-answer-fill {
  background: linear-gradient(90deg, rgba(255, 244, 207, 0.62), rgba(255, 255, 255, 0.92));
  opacity: 0.72;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 18px;
}

.home-hero {
  min-height: 460px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.72)),
    url("assets/icon.png") center 34% / min(76%, 520px) no-repeat,
    #040302;
  display: flex;
  align-items: flex-end;
  padding: 28px;
}

.home-hero h1 {
  font-size: clamp(2.8rem, 8vw, 6.6rem);
}

.home-hero p {
  max-width: 34rem;
  color: rgba(255, 244, 207, 0.84);
  line-height: 1.55;
}

.panel {
  padding: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  padding: 14px;
  border: 1px solid rgba(255, 244, 207, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.stat strong {
  display: block;
  color: var(--gold-bright);
  font-size: 1.55rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.level-tile {
  min-height: 178px;
  padding: 14px;
  text-align: left;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.level-tile:disabled {
  cursor: default;
  opacity: 0.72;
}

.level-tile.is-completed {
  border-color: rgba(255, 216, 107, 0.42);
  background: linear-gradient(180deg, rgba(246, 189, 56, 0.16), rgba(9, 8, 6, 0.74));
}

.level-tile strong {
  display: block;
  color: var(--cream);
  font-size: 1.1rem;
}

.level-tile small {
  color: var(--muted);
}

.stars-line {
  color: var(--gold);
  font-size: 1.2rem;
  min-height: 1.5rem;
}

.score-line {
  color: var(--rose);
  font-weight: 800;
}

.stage {
  width: min(860px, 100%);
  margin: 0 auto;
  min-height: calc(100svh - 154px);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.reading-stage {
  width: min(1400px, calc(100vw - 28px));
  max-width: none;
  border: 2px solid rgba(255, 244, 207, 0.92);
  border-radius: 0;
  background:
    radial-gradient(circle at 50% -8%, rgba(246, 189, 56, 0.24), transparent 18rem),
    linear-gradient(180deg, #080705, #050403 54%, #100c06);
}

.reading-stage .stage-inner {
  padding: clamp(14px, 3.4vw, 28px) clamp(22px, 5vw, 42px) clamp(10px, 2.2vw, 18px);
}

.quiz-stage {
  background:
    radial-gradient(circle at 50% 0%, rgba(246, 189, 56, 0.22), transparent 15rem),
    linear-gradient(180deg, #080705, #040403 58%, #100b05);
}

.stage-inner {
  padding: clamp(20px, 5vw, 44px);
}

.reference {
  width: fit-content;
  margin: 0 auto;
  padding: 7px 18px;
  color: var(--gold-bright);
  background: #111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 5.5vw, 2.2rem);
  line-height: 1.06;
  text-align: center;
  box-shadow: 0 0 28px rgba(246, 189, 56, 0.16);
}

.story-title {
  margin: 0 auto 22px;
  max-width: 42rem;
  color: var(--gold-bright);
  text-align: center;
  font-size: clamp(1.1rem, 3.5vw, 1.6rem);
  line-height: 1.35;
}

.reading-toolbar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 14px;
}

.zoom-button {
  min-width: 56px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 216, 107, 0.45);
  border-radius: 8px;
  background: rgba(9, 8, 6, 0.78);
  color: var(--gold-bright);
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 0 18px rgba(246, 189, 56, 0.16);
}

.zoom-button:active {
  box-shadow: inset 0 0 18px rgba(255, 216, 107, 0.28);
}

.zoom-value {
  min-width: 74px;
  color: var(--cream);
}

.reading-card {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  max-height: min(62svh, 720px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  padding: clamp(14px, 3vw, 26px) clamp(16px, 3.2vw, 30px) clamp(24px, 5vw, 48px);
  border: 0;
  border-radius: 0 0 10px 10px;
  background: #fffdf7;
  color: #111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 3.7vw, 2.1rem);
  line-height: 1.45;
}

.reading-passage {
  display: block;
  width: 100%;
  min-width: 100%;
  max-width: none;
  text-align: justify;
  text-align-last: justify;
  hyphens: auto;
}

.reading-actions,
.quiz-actions,
.certificate-actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.reading-actions-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(4, auto);
  gap: 6px;
  align-items: stretch;
}

.reading-actions-bottom .primary-button {
  min-height: 50px;
  padding: 9px 12px;
  font-size: 0.94rem;
}

.reading-actions-bottom .zoom-button {
  min-width: 40px;
  min-height: 28px;
  padding: 3px 7px;
  font-size: 0.82rem;
}

.saved-certificates-button {
  order: 99;
  justify-self: end;
  align-self: center;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 28px;
  padding: 4px 8px;
  border-color: rgba(255, 215, 105, 0.7);
  color: var(--gold-bright);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.edit-text-button {
  order: 98;
  justify-self: end;
  align-self: center;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  border-color: rgba(255, 216, 107, 0.92);
  background: linear-gradient(180deg, rgba(246, 189, 56, 0.24), rgba(121, 75, 8, 0.58));
  color: var(--gold-bright);
  font-size: 0.7rem;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 0 16px rgba(246, 189, 56, 0.24);
}

.competition-actions .saved-certificates-button,
.competition-certificate-actions .saved-certificates-button {
  grid-column: -2 / -1;
  justify-self: end;
}

.reading-actions-bottom .saved-certificates-button {
  grid-column: auto;
  justify-self: stretch;
}

.competition-certificate-actions .saved-certificates-button {
  grid-column: 1 / -1;
}

.quiz-question {
  margin: 28px auto 22px;
  max-width: 46rem;
  color: var(--text);
  font-size: clamp(2.05rem, 6vw, 4rem);
  line-height: 1.1;
  text-align: center;
  overflow-wrap: anywhere;
}

.timer-wrap {
  display: grid;
  place-items: center;
  gap: 10px;
}

.timer-ring {
  --timer-angle: 360deg;
  width: clamp(118px, 30vw, 170px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--gold) var(--timer-angle), rgba(255, 255, 255, 0.12) 0deg);
  display: grid;
  place-items: center;
  box-shadow: 0 0 28px rgba(246, 189, 56, 0.2);
}

.timer-ring::before {
  content: "";
  width: calc(100% - 18px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.82);
  position: absolute;
}

.timer-ring {
  position: relative;
}

.timer-ring strong {
  position: relative;
  color: var(--gold);
  font-size: clamp(1.75rem, 6vw, 2.8rem);
}

.timer-wrap .quiz-timer-encouragement {
  width: 100%;
  max-width: 18rem;
  margin: 0;
  padding: 9px 10px;
  font-size: clamp(0.86rem, 2.8vw, 1rem);
  line-height: 1.25;
}

.lective-timer-wrap {
  margin: 14px 0 4px;
}

.lective-timer-ring {
  width: clamp(92px, 22vw, 126px);
}

.lective-timer-ring strong {
  font-size: clamp(1.24rem, 4vw, 1.9rem);
}

.answers {
  display: grid;
  gap: 14px;
}

.answer-button {
  width: 100%;
  min-height: 82px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  display: grid;
  grid-template-columns: 58px 1fr 46px;
  gap: 14px;
  align-items: center;
  text-align: left;
  font-size: clamp(1.32rem, 4.4vw, 2.35rem);
}

.answer-button.is-selected {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, #d89716, #a96305);
  color: #fff7df;
}

.answer-button.is-correct {
  border-color: rgba(84, 213, 159, 0.86);
  background: linear-gradient(180deg, rgba(84, 213, 159, 0.22), rgba(12, 70, 45, 0.78));
  box-shadow:
    0 0 0 2px rgba(84, 213, 159, 0.22) inset,
    0 0 20px rgba(84, 213, 159, 0.18);
}

.answer-button.is-wrong {
  border-color: rgba(255, 121, 121, 0.86);
  box-shadow: 0 0 0 2px rgba(255, 121, 121, 0.16) inset;
}

.answer-button.is-wrong-option:not(.is-selected) {
  opacity: 0.86;
}

.answer-letter {
  font-weight: 900;
}

.answer-mark {
  min-width: 28px;
  color: var(--cream);
  font-size: 1.28em;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.answer-button.is-correct .answer-mark {
  color: var(--green);
  font-size: 3.6em;
  line-height: 0.55;
  overflow: visible;
  transform: translateX(10%) scale(1.12);
  text-shadow: 0 0 12px rgba(84, 213, 159, 0.78);
}

.answer-button.is-wrong-option .answer-mark {
  color: var(--red);
  text-shadow: 0 0 10px rgba(255, 121, 121, 0.45);
}

.result-banner {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 244, 207, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
  font-weight: 800;
}

.result-banner.good {
  color: var(--green);
}

.result-banner.bad {
  color: var(--red);
}

.app-toast {
  width: min(1120px, 100%);
  margin: -6px auto 14px;
  padding: 12px 14px;
  border: 1px solid rgba(84, 213, 159, 0.36);
  border-radius: 8px;
  background: rgba(21, 70, 48, 0.36);
  color: #c9ffe7;
  text-align: center;
  font-weight: 900;
  box-shadow: 0 0 22px rgba(84, 213, 159, 0.12);
}

.resume-callout,
.encouragement-line {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 216, 107, 0.28);
  border-radius: 8px;
  background: rgba(255, 216, 107, 0.08);
  color: var(--cream);
  font-weight: 800;
  line-height: 1.4;
}

.encouragement-line {
  max-width: 42rem;
  margin-inline: auto;
  text-align: center;
}

.learning-summary {
  margin: 14px 0 0;
  display: grid;
  gap: 8px;
}

.learning-summary .table-row {
  margin: 0;
  grid-template-columns: minmax(0, 1fr) auto;
}

.learning-summary .table-row span:last-child {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.86rem;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 10;
  width: min(760px, calc(100% - 28px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 4, 3, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.nav-button {
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  gap: 2px;
}

.nav-icon {
  color: var(--gold);
  font-size: 1.3rem;
  line-height: 1;
}

.nav-label {
  font-size: 0.78rem;
  font-weight: 800;
}

.lective-main-grid,
.lective-content-pane,
.lective-feedback,
.lective-flow-actions,
.lective-side-buttons {
  display: contents;
}

@media (min-width: 721px) and (min-height: 761px) {
  .app-route-lective-study {
    height: 100dvh;
    min-height: 0;
    padding: 8px 14px 36px;
    overflow: hidden;
  }

  .app-route-lective-study .topbar {
    margin-bottom: 8px;
    padding: 6px;
    gap: 8px;
  }

  .app-route-lective-study .app-back-button,
  .app-route-lective-study .status-pill {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 0.78rem;
  }

  .app-route-lective-study .avatar {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .app-route-lective-study .user-chip {
    gap: 7px;
    font-size: 0.9rem;
  }

  .lective-study-stage {
    width: min(1240px, calc(100vw - 28px));
    height: calc(100svh - 154px);
    min-height: 520px;
    overflow: hidden;
  }

  .lective-study-stage .stage-inner {
    height: 100%;
    min-height: 0;
    padding: 10px 16px 10px;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    gap: 8px;
  }

  .lective-study-stage .course-progress-panel {
    width: 100%;
    margin: 0 auto;
    padding: 4px 7px 5px;
  }

  .lective-study-stage .course-progress-row {
    gap: 5px;
    margin-bottom: 3px;
    font-size: 0.58rem;
    line-height: 1.05;
  }

  .lective-study-stage .course-progress-row span {
    min-height: 20px;
    padding: 2px 4px;
    gap: 4px;
  }

  .lective-study-stage .course-progress-track {
    height: 6px;
  }

  .lective-study-stage .lective-main-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(220px, 3fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px 14px;
    align-items: stretch;
  }

  .lective-study-stage .lective-content-pane {
    grid-column: 1;
    grid-row: 1 / 3;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 7px;
  }

  .lective-study-stage .lective-content-pane.is-wrong {
    grid-template-rows: auto minmax(120px, 0.68fr) minmax(190px, 1.12fr) auto;
  }

  .lective-study-stage .lective-timer-wrap {
    grid-column: 2;
    grid-row: 1;
    place-items: center;
    margin: 0;
    min-height: 118px;
    padding: 10px;
    border: 1px solid rgba(255, 216, 107, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
  }

  .lective-study-stage .lective-timer-ring {
    width: clamp(86px, 13vh, 116px);
  }

  .lective-study-stage .lective-timer-ring::before {
    width: calc(100% - 14px);
  }

  .lective-study-stage .lective-timer-ring strong {
    font-size: clamp(1.25rem, 2.4vh, 1.9rem);
  }

  .lective-study-stage .quiz-question {
    grid-column: 1;
    grid-row: auto;
    align-self: stretch;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 16px 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 216, 107, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    font-size: clamp(2rem, 3.15vw, 3.7rem);
    line-height: 1.04;
    display: grid;
    place-items: center;
    min-height: clamp(110px, 20vh, 185px);
  }

  .lective-study-stage .answers {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
    display: grid;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 10px;
    overflow: visible;
    align-content: start;
    padding: 1px 4px 4px;
  }

  .lective-study-stage .answer-button {
    min-height: 0;
    height: 100%;
    padding: 13px 16px;
    grid-template-columns: 58px minmax(0, 1fr) 46px;
    gap: 12px;
    font-size: clamp(1.38rem, 2.12vw, 2.38rem);
    line-height: 1.08;
  }

  .lective-study-stage .lective-feedback {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
    max-height: 122px;
    display: grid;
    gap: 6px;
    overflow: hidden;
  }

  .lective-study-stage .lective-content-pane.is-wrong .lective-feedback {
    max-height: none;
  }

  .lective-study-stage .lective-flow-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 38px;
  }

  .lective-study-stage .lective-flow-actions .primary-button {
    min-width: min(320px, 100%);
    min-height: 38px;
    padding: 7px 16px;
    font-size: 0.86rem;
  }

  .lective-study-stage .result-banner,
  .lective-study-stage .encouragement-line,
  .lective-study-stage .lective-correction-card {
    margin: 0;
    padding: 8px 10px;
    font-size: 0.92rem;
  }

  .lective-study-stage .lective-correction-card p {
    margin-bottom: 0;
    font-size: 0.86rem;
    line-height: 1.22;
  }

  .lective-study-stage .quiz-actions {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    margin-top: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 216, 107, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
  }

  .lective-study-stage .lective-side-buttons .lective-progress-panel {
    width: 100%;
    margin: 0;
    padding: 8px;
    box-shadow: none;
  }

  .lective-study-stage .lective-side-buttons .course-progress-row {
    grid-template-columns: 1fr;
    gap: 5px;
    margin-bottom: 5px;
    font-size: 0.68rem;
  }

  .lective-study-stage .lective-side-buttons .course-progress-row span {
    min-height: 28px;
    justify-content: space-between;
    padding: 5px 7px;
  }

  .lective-study-stage .quiz-actions .primary-button,
  .lective-study-stage .quiz-actions .ghost-button {
    width: 100%;
    min-height: 46px;
    padding: 9px 12px;
    font-size: 0.84rem;
  }

  .lective-study-stage .quiz-actions .saved-certificates-button {
    justify-self: stretch;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.64rem;
  }
}

.certificate-screen {
  background:
    radial-gradient(circle at 50% 0%, rgba(246, 189, 56, 0.24), transparent 28rem),
    radial-gradient(circle at 8% 90%, rgba(244, 167, 201, 0.12), transparent 18rem),
    linear-gradient(145deg, #030201, #0f0b06 58%, #050403);
}

.certificate-template-shell {
  width: min(calc((100dvh - 96px) * 0.5367), calc(100vw - 16px), 520px);
  aspect-ratio: 863 / 1608;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.certificate-template-actions {
  width: min(calc((100dvh - 96px) * 0.5367), calc(100vw - 16px), 520px);
  margin: 8px auto 0;
}

.certificate-card {
  position: relative;
  overflow: hidden;
  width: min(760px, 100%);
  min-height: 880px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 56px);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 216, 107, 0.2), transparent 15rem),
    linear-gradient(180deg, rgba(13, 10, 6, 0.98), rgba(2, 2, 2, 0.98));
  display: grid;
  place-items: center;
  text-align: center;
}

.certificate-card::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(255, 216, 107, 0.64);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(246, 189, 56, 0.28),
    inset 0 0 40px rgba(246, 189, 56, 0.08);
  pointer-events: none;
}

.certificate-card::after {
  content: "";
  position: absolute;
  inset: 42px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 216, 107, 0.38), transparent) top / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(255, 216, 107, 0.38), transparent) bottom / 100% 1px no-repeat;
  pointer-events: none;
}

.certificate-content {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  padding: clamp(22px, 4vw, 36px);
  border-radius: 8px;
  background: rgba(2, 2, 2, 0.5);
  border: 1px solid rgba(255, 216, 107, 0.22);
  backdrop-filter: blur(2px);
}

.cert-badge {
  width: clamp(72px, 18vw, 112px);
  height: clamp(72px, 18vw, 112px);
  object-fit: cover;
  border: 1px solid rgba(255, 216, 107, 0.52);
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(246, 189, 56, 0.22);
  margin-bottom: 12px;
}

.certificate-content h2 {
  margin: 0 0 10px;
  color: var(--gold-bright);
  font-size: clamp(2rem, 7vw, 3.9rem);
  line-height: 1;
  text-transform: uppercase;
}

.cert-name {
  margin: 22px 0 12px;
  color: var(--gold-bright);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 7vw, 4rem);
  font-style: italic;
}

.cert-line {
  margin: 10px 0;
  color: var(--text);
  font-size: clamp(1rem, 3vw, 1.35rem);
  line-height: 1.45;
}

.cert-level {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 6vw, 3.3rem);
  font-weight: 900;
}

.cert-stars {
  margin: 6px 0 12px;
  color: var(--gold-bright);
  font-size: clamp(1.7rem, 5vw, 2.8rem);
  letter-spacing: 0.12em;
  text-shadow: 0 0 18px rgba(246, 189, 56, 0.22);
}

.cert-score {
  color: var(--gold-bright);
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 900;
}

.table-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 244, 207, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.table-row strong,
.table-row span {
  min-width: 0;
}

.empty-state {
  padding: 34px 16px;
  color: var(--muted);
  text-align: center;
}

.saved-certificates-panel .small-note {
  margin-top: 10px;
}

.saved-certificate-folder-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
  gap: 14px;
  margin-top: 18px;
}

.saved-certificate-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.saved-certificate-list-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 244, 207, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
}

.saved-certificate-list-item.is-selected {
  border-color: rgba(255, 215, 105, 0.82);
  background: rgba(255, 215, 105, 0.1);
}

.saved-certificate-number {
  width: 36px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe889, #c88715);
  color: #141007;
  font-weight: 900;
}

.saved-certificate-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 215, 105, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.saved-certificate-preview-box {
  display: grid;
  gap: 8px;
}

.saved-certificate-preview-box img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border-radius: 6px;
  background: #050505;
}

.saved-certificate-preview-box span {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.saved-certificate-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.saved-certificate-meta strong,
.saved-certificate-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.saved-certificate-meta span {
  color: var(--muted);
  font-size: 0.92rem;
}

.saved-certificate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.saved-certificate-actions button {
  min-height: 44px;
  padding: 9px 10px;
  font-size: 0.9rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.85fr);
  gap: 14px;
}

.settings-grid .panel:last-child {
  grid-column: 1 / -1;
}

.settings-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.settings-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(110px, 0.55fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(255, 244, 207, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.settings-row strong {
  color: var(--gold-bright);
  text-transform: uppercase;
}

.settings-row span {
  min-width: 0;
  color: var(--cream);
  overflow-wrap: anywhere;
}

.file-button {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.diagnostic-box {
  min-height: 120px;
  max-height: 280px;
  margin: 12px 0 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(255, 244, 207, 0.14);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  color: var(--muted);
  white-space: pre-wrap;
}

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

.help-card {
  padding: 16px;
  border: 1px solid rgba(255, 244, 207, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.help-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold-bright);
  font-size: 1.05rem;
  text-transform: uppercase;
}

.help-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.revision-list .revision-row {
  grid-template-columns: minmax(0, 1fr);
}

.revision-row span {
  color: var(--muted);
}

@media (max-width: 900px) {
  .login-layout,
  .home-grid,
  .settings-grid,
  .help-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid .panel:last-child {
    grid-column: auto;
  }

  .login-art {
    min-height: 420px;
  }

  .level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leader-strip,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .saved-certificate-folder-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .screen {
    padding: 12px;
  }

  .app-frame {
    padding: 10px 10px 92px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topbar .status-pill:nth-of-type(2) {
    grid-column: 1 / -1;
  }

  .topbar .status-pill:last-child {
    grid-column: 1 / -1;
  }

  .topbar-back {
    min-width: 58px;
    padding-inline: 8px;
  }

  .course-progress-row {
    grid-template-columns: 1fr;
  }

  .level-picker {
    grid-template-columns: repeat(3, 1fr);
  }

  .level-choice {
    min-height: 92px;
  }

  .level-grid {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: 360px;
    padding: 18px;
  }

  .stage-inner {
    padding: 18px;
  }

  .reading-card {
    max-height: 46svh;
  }

  .answer-button {
    grid-template-columns: 36px 1fr 22px;
    gap: 8px;
    min-height: 62px;
  }

  .bottom-nav {
    bottom: 8px;
    width: calc(100% - 16px);
  }

  .nav-button {
    min-height: 54px;
  }

  .nav-label {
    font-size: 0.68rem;
  }

  .certificate-card {
    min-height: 760px;
  }
}

@media (max-width: 720px), (max-height: 760px) {
  body {
    overflow-x: hidden;
  }

  .screen {
    padding: max(6px, env(safe-area-inset-top)) 8px max(6px, env(safe-area-inset-bottom));
  }

  .login-screen {
    height: 100dvh;
    display: grid;
    place-items: start center;
    overflow: hidden;
  }

  .login-template {
    width: min(calc((100dvh - 12px) * 0.5367), calc(100vw - 16px));
    max-width: none;
  }

  .login-layout {
    width: 100%;
    max-height: calc(100dvh - 12px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
  }

  .login-art {
    min-height: clamp(78px, 16dvh, 110px);
    max-height: 110px;
    flex: 0 0 auto;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.86)),
      url("assets/login.jpg") center 18% / cover;
  }

  .login-art-copy,
  .login-panel {
    padding: 10px;
  }

  .brand-lockup {
    gap: 8px;
  }

  .brand-lockup img {
    width: 46px;
    height: 46px;
  }

  h1 {
    font-size: clamp(1.42rem, 8.8vw, 2.15rem);
  }

  .login-art-copy p,
  .small-note {
    display: none;
  }

  .login-panel {
    gap: 8px;
    flex: 0 0 auto;
    min-height: 0;
    overflow: hidden;
  }

  .login-leaders,
  .login-leaders-head {
    display: none;
  }

  .section-head h2,
  .panel h2,
  .stage h2 {
    font-size: 1.08rem;
  }

  .leader-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .leader-card {
    padding: 6px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px;
  }

  .leader-rank {
    width: 24px;
    height: 24px;
    font-size: 0.78rem;
  }

  .leader-name,
  .leader-points {
    display: block;
    font-size: 0.72rem;
  }

  .level-picker {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .level-choice {
    min-height: 62px;
    padding: 5px 2px;
  }

  .star {
    font-size: 0.92rem;
  }

  .level-choice strong {
    font-size: 0.72rem;
  }

  .level-choice span:last-child {
    font-size: 0.5rem;
  }

  .form-grid {
    gap: 7px;
  }

  .input-wrap {
    gap: 4px;
  }

  .input-wrap label {
    font-size: 0.76rem;
  }

  .input-wrap input,
  .primary-button,
  .ghost-button,
  .danger-button {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 0.78rem;
  }

  .login-error {
    padding: 7px 8px;
    font-size: 0.74rem;
  }

  .renewal-dialog-backdrop {
    padding: 5px;
    place-items: end center;
  }

  .renewal-dialog {
    max-height: calc(100dvh - 10px);
    padding: 9px;
  }

  .renewal-logo-row {
    grid-template-columns: 52px 1fr;
    gap: 10px;
    margin: 8px 0 10px;
    padding: 8px;
  }

  .renewal-logo-row img {
    width: 52px;
    height: 52px;
  }

  .renewal-mtn-payment,
  .renewal-airtel-merchant,
  .renewal-guide,
  .renewal-out-panel,
  .renewal-token-panel {
    padding: 7px;
  }

  .renewal-mtn-payment .renewal-helper,
  .renewal-airtel-merchant,
  .renewal-warning,
  .renewal-footnote {
    font-size: 0.8rem;
    line-height: 1.22;
  }

  .renewal-device-code {
    padding: 7px 6px;
    font-size: clamp(1.45rem, 8.5vw, 2.15rem);
  }

  .renewal-path-button {
    min-height: 50px;
    padding: 8px;
    font-size: 0.78rem;
  }

  .renewal-step-list > div {
    grid-template-columns: 24px 1fr;
    gap: 6px;
    padding: 6px;
  }

  .renewal-reference-box strong {
    min-height: 34px;
    font-size: 1.05rem;
  }

  .renewal-field {
    margin-top: 8px;
  }

  .renewal-field input,
  .renewal-field select {
    min-height: 40px;
    font-size: 0.84rem;
  }

  .search-scope-options {
    grid-template-columns: 1fr;
  }

  .competition-screen {
    padding: 8px;
  }

  .competition-host-panel {
    padding: 12px;
  }

  .competition-actions,
  .competition-live-grid,
  .competition-mode-grid,
  .competition-level-grid,
  .competition-source-row,
  .lective-answer-grid,
  .lective-folder-row,
  .lective-saved-row,
  .competition-dashboard {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .answer-join-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .competition-timer-setting {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .competition-countdown {
    justify-content: center;
  }

  .competition-header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .competition-header-actions .ghost-button {
    flex: 1 1 0;
  }

  .competition-focus-name {
    font-size: clamp(2rem, 12vw, 3.65rem);
  }

  .competition-dot-rail {
    right: 8px;
    gap: 5px;
  }

  .competition-dot {
    width: 10px;
  }

  .competition-dot.is-active {
    width: 14px;
  }

  .competition-player-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .settings-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .app-toast,
  .resume-callout,
  .encouragement-line {
    font-size: 0.86rem;
  }

  .app-frame {
    min-height: 100dvh;
    padding: 6px 6px calc(62px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 5px;
    margin-bottom: 6px;
    padding: 5px;
  }

  .topbar .status-pill:nth-of-type(2) {
    grid-column: auto;
  }

  .user-chip {
    gap: 6px;
    font-size: 0.78rem;
  }

  .avatar {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
  }

  .status-pill {
    min-height: 28px;
    padding: 3px 6px;
    border-radius: 8px;
    font-size: 0.66rem;
    white-space: nowrap;
  }

  .course-progress-panel {
    margin: 0 auto 6px;
    padding: 6px;
  }

  .course-progress-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 5px;
    font-size: 0.55rem;
  }

  .course-progress-row span {
    min-height: 32px;
    padding: 4px 2px;
    flex-direction: column;
    gap: 1px;
  }

  .course-progress-track {
    height: 9px;
  }

  .stage {
    width: 100%;
    height: calc(100dvh - 176px - env(safe-area-inset-bottom));
    min-height: 0;
    overflow: hidden;
  }

  .app-route-reading .stage {
    height: calc(100dvh - 206px - env(safe-area-inset-bottom));
  }

  .app-route-quiz .stage {
    height: calc(100dvh - 206px - env(safe-area-inset-bottom));
  }

  .stage-inner {
    height: 100%;
    min-height: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
  }

  .reading-stage .stage-inner {
    padding: 18px 22px 6px;
  }

  .reference {
    margin-bottom: 4px;
    font-size: clamp(1.5rem, 7vw, 2.35rem);
  }

  .story-title {
    margin-bottom: 8px;
    font-size: 0.96rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .reading-card {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
    padding: 10px 16px 14px;
    font-size: clamp(1rem, 4.6vw, 1.35rem);
    line-height: 1.38;
    background: #fffdf5;
  }

  .reading-actions,
  .quiz-actions,
  .certificate-actions {
    margin-top: 8px;
    gap: 6px;
  }

  .reading-actions > button,
  .quiz-actions > button,
  .certificate-actions > button {
    flex: 1 1 auto;
  }

  .reading-actions > .saved-certificates-button,
  .quiz-actions > .saved-certificates-button,
  .certificate-actions > .saved-certificates-button {
    flex: 0 0 auto;
    min-height: 24px;
    padding: 4px 7px;
    font-size: 0.56rem;
  }

  .reading-actions-bottom .saved-certificates-button,
  .competition-actions .saved-certificates-button,
  .competition-certificate-actions .saved-certificates-button {
    width: auto;
    min-height: 24px;
    padding: 4px 7px;
    font-size: 0.56rem;
  }

  .reading-actions-bottom {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    align-items: center;
    margin-top: 6px;
  }

  .app-route-reading .reading-actions-bottom .primary-button[data-action="begin-quiz"] {
    grid-column: 1 / -1;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 0.78rem;
    line-height: 1.08;
  }

  .app-route-reading .reading-actions-bottom .saved-certificates-button,
  .app-route-reading .reading-actions-bottom .edit-text-button,
  .app-route-reading .reading-actions-bottom .zoom-button {
    grid-column: auto;
    justify-self: stretch;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: 24px;
    padding: 2px 4px;
    border-radius: 7px;
    line-height: 1;
  }

  .app-route-reading .reading-actions-bottom .saved-certificates-button {
    font-size: 0.5rem;
  }

  .app-route-reading .reading-actions-bottom .edit-text-button {
    font-size: 0.48rem;
  }

  .app-route-reading .reading-actions-bottom .zoom-button {
    font-size: 0.7rem;
  }

  .app-route-quiz .quiz-actions {
    margin-top: 4px;
    justify-content: flex-end;
  }

  .app-route-quiz .quiz-actions .saved-certificates-button {
    display: none;
  }

  .app-route-quiz .quiz-actions .edit-text-button {
    flex: 0 0 auto;
    min-height: 22px;
    width: auto;
    padding: 2px 6px;
    font-size: 0.52rem;
    line-height: 1;
  }

  .timer-ring {
    width: clamp(72px, 22vw, 96px);
  }

  .timer-ring::before {
    width: calc(100% - 12px);
  }

  .timer-ring strong {
    font-size: 1.35rem;
  }

  .quiz-question {
    margin: 8px auto;
    max-height: 6.2em;
    overflow: auto;
    font-size: clamp(1.5rem, 7.2vw, 2.45rem);
    line-height: 1.08;
  }

  .competition-question-only {
    min-height: clamp(126px, 25svh, 220px);
    max-height: min(42svh, 300px);
    padding: 18px 14px;
    font-size: clamp(2rem, 9.5vw, 3.5rem);
    line-height: 1.08;
  }

  .answers {
    flex: 1 1 auto;
    min-height: 0;
    gap: 7px;
    overflow: auto;
    align-content: start;
  }

  .answer-button {
    min-height: 56px;
    padding: 8px 10px;
    grid-template-columns: 32px 1fr 26px;
    gap: 7px;
    font-size: clamp(1.05rem, 4.6vw, 1.38rem);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
  }

  .answer-button > span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .competition-answer-option,
  .competition-answer-list .primary-button {
    min-height: 62px;
    grid-template-columns: 34px minmax(0, 1fr) 30px;
    font-size: clamp(1.08rem, 4.9vw, 1.5rem);
  }

  .edit-text-button {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 0.62rem;
  }

  .result-banner {
    margin-top: 8px;
    padding: 8px;
    font-size: 0.82rem;
  }

  .bottom-nav {
    bottom: 4px;
    width: calc(100% - 10px);
    padding: 4px;
    gap: 3px;
  }

  .nav-button {
    min-height: 46px;
    gap: 0;
  }

  .nav-icon {
    font-size: 1.05rem;
  }

  .nav-label {
    font-size: 0.58rem;
  }

  .home-grid {
    gap: 8px;
  }

  .home-hero {
    min-height: 240px;
    padding: 14px;
  }

  .home-hero p {
    font-size: 0.88rem;
  }

  .panel {
    padding: 12px;
  }

  .level-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .level-tile {
    min-height: 96px;
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .certificate-screen {
    padding: 8px;
  }

  .certificate-card {
    min-height: calc(100dvh - 16px);
    padding: 12px;
  }

  .certificate-content {
    padding: 14px;
  }

  .certificate-content h2 {
    font-size: clamp(1.45rem, 8vw, 2.45rem);
  }

  .cert-name {
    margin: 12px 0 6px;
    font-size: clamp(1.7rem, 9vw, 2.8rem);
  }

  .cert-line {
    margin: 6px 0;
    font-size: 0.9rem;
  }

  .cert-level {
    font-size: clamp(1.8rem, 9vw, 2.8rem);
  }

  .cert-stars {
    margin: 4px 0 8px;
    font-size: clamp(1.35rem, 7vw, 2rem);
  }

  .cert-score {
    font-size: clamp(2rem, 10vw, 3rem);
  }
}

@media (min-width: 900px) {
  .app-route-lective-study {
    height: 100dvh;
    min-height: 0;
    padding: 8px 14px 36px;
    overflow: hidden;
  }

  .app-route-lective-study .topbar {
    position: sticky;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    width: min(1120px, 100%);
    margin: 0 auto 8px;
    padding: 6px;
  }

  .app-route-lective-study .app-back-button,
  .app-route-lective-study .status-pill {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 0.78rem;
  }

  .app-route-lective-study .avatar {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .app-route-lective-study .user-chip {
    gap: 7px;
    font-size: 0.9rem;
  }

  .lective-study-stage {
    width: min(1240px, calc(100vw - 28px));
    height: calc(100dvh - 128px);
    min-height: 0;
    overflow: hidden;
  }

  .lective-study-stage .stage-inner {
    height: 100%;
    min-height: 0;
    padding: 10px 16px;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    gap: 8px;
  }

  .lective-study-stage .course-progress-panel {
    width: 100%;
    margin: 0 auto;
    padding: 4px 7px 5px;
  }

  .lective-study-stage .course-progress-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 3px;
    font-size: 0.58rem;
    line-height: 1.05;
  }

  .lective-study-stage .course-progress-row span {
    min-height: 20px;
    padding: 2px 4px;
    flex-direction: row;
    gap: 4px;
  }

  .lective-study-stage .course-progress-track {
    height: 6px;
  }

  .lective-study-stage .lective-main-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(220px, 3fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px 14px;
    align-items: stretch;
  }

  .lective-study-stage .lective-content-pane {
    grid-column: 1;
    grid-row: 1 / 3;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 7px;
  }

  .lective-study-stage .lective-content-pane.is-wrong {
    grid-template-rows: auto minmax(120px, 0.68fr) minmax(190px, 1.12fr) auto;
  }

  .lective-study-stage .lective-timer-wrap {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    place-items: center;
    margin: 0;
    min-height: clamp(86px, 18dvh, 122px);
    padding: 10px;
    border: 1px solid rgba(255, 216, 107, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
  }

  .lective-study-stage .lective-timer-ring {
    width: clamp(70px, 14dvh, 116px);
  }

  .lective-study-stage .lective-timer-ring::before {
    width: calc(100% - 14px);
  }

  .lective-study-stage .lective-timer-ring strong {
    font-size: clamp(1.1rem, 2.5dvh, 1.9rem);
  }

  .lective-study-stage .quiz-question {
    grid-column: auto;
    grid-row: auto;
    align-self: stretch;
    max-width: none;
    max-height: none;
    min-height: clamp(104px, 20dvh, 184px);
    margin: 0;
    padding: 16px 18px;
    overflow: auto;
    border: 1px solid rgba(255, 216, 107, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--gold-bright);
    font-size: clamp(2rem, 3.15vw, 3.7rem);
    line-height: 1.04;
    display: grid;
    place-items: center;
  }

  .lective-study-stage .answers {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
    display: grid;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    align-content: start;
    padding: 1px 4px 4px;
  }

  .lective-study-stage .answer-button {
    min-height: 0;
    height: 100%;
    padding: 10px 16px;
    grid-template-columns: 58px minmax(0, 1fr) 46px;
    gap: 12px;
    font-size: clamp(1.38rem, 2.12vw, 2.38rem);
    line-height: 1.08;
  }

  .lective-study-stage .lective-feedback {
    grid-column: auto;
    grid-row: auto;
    min-height: 0;
    max-height: clamp(58px, 15dvh, 108px);
    display: grid;
    gap: 6px;
    overflow: auto;
  }

  .lective-study-stage .lective-content-pane.is-wrong .lective-feedback {
    max-height: none;
  }

  .lective-study-stage .result-banner,
  .lective-study-stage .encouragement-line,
  .lective-study-stage .lective-correction-card {
    margin: 0;
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .lective-study-stage .lective-correction-card p {
    margin-bottom: 0;
    font-size: 0.84rem;
    line-height: 1.2;
  }

  .lective-study-stage .lective-flow-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 36px;
  }

  .lective-study-stage .lective-flow-actions .primary-button {
    min-width: min(320px, 100%);
    min-height: 36px;
    padding: 7px 16px;
    font-size: 0.84rem;
  }

  .lective-study-stage .quiz-actions {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    margin-top: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(255, 216, 107, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
  }

  .lective-study-stage .lective-side-buttons .lective-progress-panel {
    width: 100%;
    margin: 0;
    padding: 8px;
    box-shadow: none;
  }

  .lective-study-stage .lective-side-buttons .course-progress-row {
    grid-template-columns: 1fr;
    gap: 5px;
    margin-bottom: 5px;
    font-size: 0.68rem;
  }

  .lective-study-stage .lective-side-buttons .course-progress-row span {
    min-height: 28px;
    justify-content: space-between;
    padding: 5px 7px;
  }

  .lective-study-stage .quiz-actions .primary-button,
  .lective-study-stage .quiz-actions .ghost-button {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .lective-study-stage .quiz-actions .saved-certificates-button {
    justify-self: stretch;
    min-height: 36px;
    padding: 8px 10px;
    font-size: 0.62rem;
  }

  .app-route-lective-study .bottom-nav {
    bottom: 4px;
    width: min(760px, calc(100% - 10px));
    padding: 4px;
    gap: 3px;
  }

  .app-route-lective-study .nav-button {
    min-height: 46px;
    gap: 0;
  }
}

@media (min-width: 900px) {
  .app-route-reading,
  .app-route-quiz {
    height: 100dvh;
    min-height: 0;
    padding: 8px 14px 36px;
    overflow: hidden;
  }

  .app-route-reading .topbar,
  .app-route-quiz .topbar {
    width: min(1120px, 100%);
    margin: 0 auto 8px;
    padding: 6px;
    gap: 8px;
  }

  .app-route-reading .app-back-button,
  .app-route-quiz .app-back-button,
  .app-route-reading .status-pill,
  .app-route-quiz .status-pill {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 0.78rem;
  }

  .app-route-reading .course-progress-panel,
  .app-route-quiz .course-progress-panel {
    width: min(1120px, 100%);
    margin: 0 auto 6px;
    padding: 5px 7px;
  }

  .app-route-reading .course-progress-row,
  .app-route-quiz .course-progress-row {
    gap: 5px;
    margin-bottom: 3px;
    font-size: 0.62rem;
    line-height: 1.05;
  }

  .app-route-reading .course-progress-row span,
  .app-route-quiz .course-progress-row span {
    min-height: 22px;
    padding: 2px 5px;
  }

  .app-route-reading .course-progress-track,
  .app-route-quiz .course-progress-track {
    height: 6px;
  }

  .app-route-reading .stage,
  .app-route-quiz .stage {
    width: min(1240px, calc(100vw - 28px));
    height: calc(100dvh - 128px);
    min-height: 0;
    overflow: hidden;
  }

  .app-route-reading .stage-inner,
  .app-route-quiz .stage-inner {
    height: 100%;
    min-height: 0;
    padding: 10px 16px;
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(230px, 3fr);
    gap: 10px 14px;
    align-items: stretch;
  }

  .app-route-reading .stage-inner {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .app-route-reading .reading-card {
    grid-column: 1;
    grid-row: 1 / 3;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px 28px 26px;
    line-height: 1.32;
  }

  .app-route-reading .reference {
    margin-bottom: 8px;
    font-size: clamp(1.8rem, 2.8vw, 3.35rem);
  }

  .app-route-reading .reading-actions-bottom {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-content: start;
    border: 1px solid rgba(255, 216, 107, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
  }

  .app-route-reading .reading-actions-bottom > button {
    width: 100%;
    min-height: 44px;
  }

  .app-route-reading .reading-actions-bottom .primary-button[data-action="begin-quiz"] {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 0.78rem;
    line-height: 1.08;
  }

  .app-route-reading .reading-actions-bottom .saved-certificates-button,
  .app-route-reading .reading-actions-bottom .edit-text-button,
  .app-route-reading .reading-actions-bottom .zoom-button {
    min-height: 22px;
    padding: 2px 5px;
    font-size: 0.52rem;
    line-height: 1;
  }

  .app-route-reading .reading-actions-bottom .zoom-button {
    font-size: 0.68rem;
  }

  .app-route-reading .encouragement-line {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    align-self: end;
  }

  .app-route-quiz .stage-inner {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }

  .app-route-quiz .timer-wrap {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    min-height: 112px;
    padding: 10px;
    border: 1px solid rgba(255, 216, 107, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
  }

  .app-route-quiz .timer-ring {
    width: clamp(76px, 14dvh, 118px);
  }

  .app-route-quiz .timer-ring strong {
    font-size: clamp(1.15rem, 2.4dvh, 1.9rem);
  }

  .app-route-quiz .quiz-question {
    grid-column: 1;
    grid-row: 1;
    max-width: none;
    min-height: clamp(126px, 22dvh, 210px);
    margin: 0;
    padding: 18px 20px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 216, 107, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    font-size: clamp(2.35rem, 3.8vw, 4.85rem);
    line-height: 1.04;
    overflow: hidden;
  }

  .app-route-quiz .answers {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    display: grid;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 10px;
    overflow: visible;
  }

  .app-route-quiz .answer-button {
    min-height: 0;
    height: 100%;
    padding: 12px 18px;
    grid-template-columns: 62px minmax(0, 1fr) 48px;
    font-size: clamp(1.55rem, 2.55vw, 3.05rem);
    line-height: 1.08;
  }

  .app-route-quiz .result-banner {
    grid-column: 1;
    grid-row: 3;
    margin: 0;
  }

  .app-route-quiz .timer-wrap .quiz-timer-encouragement {
    margin: 0;
    max-width: none;
    font-size: clamp(0.86rem, 1.25vw, 1.05rem);
    line-height: 1.25;
  }

  .app-route-quiz .quiz-actions {
    grid-column: 2;
    grid-row: 2 / 5;
    margin: 0;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-content: start;
    border: 1px solid rgba(255, 216, 107, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
  }

  .app-route-quiz .quiz-actions > button {
    width: 100%;
    min-height: 44px;
  }

  .competition-screen {
    min-height: 100dvh;
    padding: 8px 14px 72px;
    overflow: hidden;
  }

  .competition-host-panel {
    width: min(1240px, calc(100vw - 28px));
    max-height: calc(100dvh - 16px);
    margin: 0 auto;
    overflow: auto;
  }

  .competition-live-card.is-quiz {
    height: calc(100dvh - 132px);
    min-height: 0;
    max-height: calc(100dvh - 132px);
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(230px, 3fr);
    grid-template-rows: minmax(142px, 0.65fr) minmax(0, 1.35fr) minmax(36px, 60px);
    gap: 10px 14px;
    align-items: stretch;
  }

  .competition-live-card.is-quiz .competition-focus-name {
    grid-column: 2;
    grid-row: 2;
    max-width: none;
    margin: 0;
    padding: 10px;
    align-self: start;
    border: 1px solid rgba(255, 216, 107, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    font-size: clamp(2.3rem, 3.6vw, 4.8rem);
  }

  .competition-live-card.is-quiz .competition-countdown {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    padding: 10px;
    justify-content: center;
    align-self: stretch;
    border: 1px solid rgba(255, 216, 107, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
  }

  .competition-live-card.is-quiz .competition-countdown-ring {
    width: clamp(78px, 14dvh, 116px);
  }

  .competition-live-card.is-quiz .competition-question-only {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    max-height: none;
    height: 100%;
    margin: 0;
    padding: 18px 20px;
    font-size: clamp(2.45rem, 3.8vw, 5rem);
    line-height: 1.03;
    overflow: hidden;
  }

  .competition-live-card.is-quiz .competition-options {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    display: grid;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 10px;
    overflow: visible;
  }

  .competition-live-card.is-quiz .competition-options span,
  .competition-live-card.is-quiz .competition-answer-option {
    min-height: 0;
    height: 100%;
    font-size: clamp(1.65rem, 2.55vw, 3.05rem);
    line-height: 1.08;
  }

  .competition-live-card.is-quiz .competition-answer-option {
    grid-template-columns: 62px minmax(0, 1fr) 48px;
    padding: 12px 18px;
  }

  .competition-live-card.is-quiz .result-banner {
    grid-column: 1;
    grid-row: 3;
    margin: 0;
  }

  .competition-live-card.is-quiz .compact-actions,
  .competition-live-card.is-quiz > .competition-actions {
    grid-column: 2;
    grid-row: 3;
    margin: 0;
    padding: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-content: start;
    overflow: auto;
    border: 1px solid rgba(255, 216, 107, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
  }

  .competition-live-card.is-quiz .compact-actions > button,
  .competition-live-card.is-quiz > .competition-actions > button {
    width: 100%;
    min-height: 42px;
  }

  .competition-live-card.is-quiz > .small-note {
    grid-column: 2;
    grid-row: 4;
    align-self: end;
  }

  .competition-live-card.is-quiz .edit-text-button,
  .app-route-reading .edit-text-button,
  .app-route-quiz .edit-text-button,
  .lective-study-stage .edit-text-button {
    justify-self: end;
    width: auto;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.7rem;
  }
}

@media (min-width: 900px) and (max-height: 720px) {
  .lective-study-stage .lective-content-pane {
    gap: 4px;
  }

  .lective-study-stage .lective-content-pane.is-wrong {
    grid-template-rows: auto minmax(116px, 0.72fr) minmax(160px, 1fr) auto;
  }

  .lective-study-stage .course-progress-panel {
    padding: 3px 6px 4px;
  }

  .lective-study-stage .course-progress-row {
    margin-bottom: 2px;
  }

  .lective-study-stage .course-progress-row span {
    min-height: 18px;
    padding: 1px 4px;
  }

  .lective-study-stage .lective-mini-progress {
    display: none;
  }

  .lective-study-stage .course-progress-track {
    height: 5px;
  }

  .lective-study-stage .lective-feedback {
    max-height: 160px;
  }

  .lective-study-stage .lective-flow-actions,
  .lective-study-stage .lective-flow-actions .primary-button {
    min-height: 34px;
  }
}

@media (min-width: 900px) {
  .primary-button,
  .ghost-button,
  .danger-button,
  .login-button-label,
  .login-template-update,
  .login-renew-button,
  .login-lective-button,
  .login-competition-button,
  .login-search-button,
  .renewal-path-button,
  .renewal-start-button,
  .competition-actions button,
  .compact-actions button {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.08;
  }

  .login-template-submit,
  .login-template-update,
  .login-renew-button {
    display: grid;
    place-items: center;
    text-align: center;
  }

  .login-template-submit {
    font-size: clamp(1rem, 2.2vw, 1.8rem);
  }

  .login-template-update {
    font-size: clamp(0.68rem, 1.2vw, 1rem);
  }

  .login-renew-button {
    font-size: clamp(0.9rem, 1.8vw, 1.55rem);
  }

  .app-route-quiz .quiz-question,
  .competition-live-card.is-quiz .competition-question-only {
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .app-route-quiz .answer-button,
  .lective-study-stage .answer-button,
  .competition-live-card.is-quiz .competition-answer-option {
    align-items: center;
    overflow: hidden;
  }

  .app-route-quiz .answer-button span:not(.answer-mark),
  .lective-study-stage .answer-button span:not(.answer-mark),
  .competition-live-card.is-quiz .competition-answer-option span:not(.answer-mark) {
    min-width: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 420px) and (max-height: 700px) {
  .login-layout {
    gap: 4px;
  }

  .login-art {
    min-height: 70px;
    max-height: 78px;
  }

  .login-art-copy,
  .login-panel {
    padding: 7px;
  }

  .brand-lockup img {
    width: 34px;
    height: 34px;
  }

  h1 {
    font-size: clamp(1.22rem, 8vw, 1.75rem);
  }

  .kicker {
    font-size: 0.58rem;
  }

  .section-head h2,
  .panel h2,
  .stage h2 {
    font-size: 0.94rem;
  }

  .level-picker {
    gap: 3px;
  }

  .level-choice {
    min-height: 52px;
    padding: 3px 1px;
  }

  .star {
    font-size: 0.76rem;
  }

  .level-choice strong {
    font-size: 0.62rem;
  }

  .level-choice span:last-child {
    font-size: 0.44rem;
  }

  .form-grid {
    gap: 5px;
  }

  .input-wrap {
    gap: 2px;
  }

  .input-wrap label {
    font-size: 0.68rem;
  }

  .input-wrap input,
  .primary-button,
  .ghost-button,
  .danger-button {
    min-height: 34px;
    font-size: 0.72rem;
  }
}

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

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .bottom-nav,
  .certificate-actions {
    display: none !important;
  }

  .screen,
  .app-frame {
    padding: 0;
  }

  .certificate-card {
    width: 100%;
    min-height: 100vh;
    box-shadow: none;
  }
}
