:root {
  --bg: #0f172a;
  --bg-soft: #111c33;
  --card: #17223a;
  --card-2: #1d2a46;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #38bdf8;
  --accent-2: #0ea5e9;
  --good: #22c55e;
  --bad: #ef4444;
  --warn: #f59e0b;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
  --radius: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  margin: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 32%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.11), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  touch-action: none;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

#app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
  overflow: hidden;
}

/* ОБЩАЯ ОБОЛОЧКА */

.app-shell {
  width: min(1150px, 100%);
  height: 100vh;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  max-height: var(--app-height, 100dvh);
  margin: 0 auto;
  padding: calc(12px + var(--safe-top)) 12px calc(10px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.app-center {
  align-items: center;
  justify-content: center;
}

.app-shell.home-shell {
  overflow-y: auto;
  touch-action: pan-y;
}

/* ШАПКА */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.logo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-size: clamp(22px, 3.6vw, 36px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn,
.back-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 800;
}

.icon-btn:hover,
.back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lang-toggle {
  --lang-toggle-size: 46px;
  min-width: auto;
  min-height: var(--lang-toggle-size);
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  border: 0;
  box-shadow: none;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-toggle-icon {
  width: auto;
  height: var(--lang-toggle-size);
  object-fit: contain;
  display: block;
}

.lang-toggle:hover {
  background: transparent;
  filter: brightness(1.06);
}

.studio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(33, 64, 112, 0.82), rgba(26, 46, 85, 0.88));
  border: 1px solid rgba(116, 163, 228, 0.26);
  color: #eff6ff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.studio-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(116, 163, 228, 0.42);
  background: linear-gradient(180deg, rgba(42, 76, 129, 0.92), rgba(28, 54, 96, 0.94));
}

/* ИНТРО */

.intro-shell {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: 0;
}

.intro-stage {
  width: 100%;
  height: 100%;
  margin: 0;
  display: block;
}

.intro-card {
  --intro-vertical-padding: 40px;
  --intro-button-height: 74px;
  position: relative;
  height: 100%;
  display: grid;
  align-items: center;
  padding: 0;
  background:
    radial-gradient(circle at 14% 14%, rgba(56, 189, 248, 0.18), transparent 24%),
    radial-gradient(circle at 82% 82%, rgba(34, 197, 94, 0.08), transparent 28%),
    linear-gradient(135deg, rgba(18, 34, 59, 0.94), rgba(14, 26, 48, 0.98)),
    var(--bg);
  overflow: hidden;
  border-radius: 0;
}

.intro-card::before {
  content: "";
  position: absolute;
  inset: auto auto -18% -10%;
  width: 32vw;
  min-width: 240px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.08);
  filter: blur(16px);
  pointer-events: none;
}

.intro-card::after {
  content: "";
  position: absolute;
  inset: -10% -8% auto auto;
  width: 28vw;
  min-width: 220px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.07);
  filter: blur(18px);
  pointer-events: none;
}

.intro-card-right {
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
}

.intro-card-left {
  grid-template-columns: minmax(0, 1.28fr) minmax(240px, 0.72fr);
}

.intro-copy,
.intro-asset-wrap {
  position: relative;
  z-index: 1;
}

.intro-visual-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  width: fit-content;
  max-width: 100%;
  min-height: calc(100dvh - (var(--intro-vertical-padding) * 2));
}

.intro-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  padding: clamp(36px, 5vw, 72px) clamp(56px, 7vw, 120px);
}

.intro-copy-right {
  align-items: flex-start;
  justify-self: start;
}

.intro-copy-left {
  align-items: flex-end;
  justify-self: end;
  padding-right: clamp(56px, 8vw, 150px);
}

.intro-next-btn {
  min-width: 0;
  min-height: var(--intro-button-height);
  width: 100%;
  padding: 0 34px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(111, 124, 167, 0.96), rgba(72, 86, 127, 0.96));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 950;
  letter-spacing: -0.03em;
  box-shadow:
    0 18px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.intro-next-btn:hover {
  transform: translateY(-2px) scale(1.015);
  background:
    linear-gradient(135deg, rgba(123, 137, 184, 1), rgba(84, 99, 147, 1));
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    0 24px 36px rgba(0, 0, 0, 0.24),
    0 0 0 4px rgba(56, 189, 248, 0.1);
}

.intro-next-btn:active {
  transform: translateY(0) scale(0.995);
}

.intro-asset-wrap {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: var(--intro-vertical-padding) 0;
  box-sizing: border-box;
  grid-column: 1 / -1;
}

.intro-asset-wrap-right {
  justify-content: center;
  padding-right: 0;
}

.intro-asset-wrap-left {
  justify-content: center;
  padding-left: 0;
}

.intro-asset {
  display: block;
  width: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform-origin: 18% 82%;
  user-select: none;
  pointer-events: none;
  opacity: 0;
}

.intro-asset-right {
  height: calc(100dvh - (var(--intro-vertical-padding) * 2) - var(--intro-button-height));
  margin: 0 auto;
  margin-bottom: 0;
  animation: introRevealRight 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.intro-asset-left {
  height: calc(100dvh - (var(--intro-vertical-padding) * 2) - var(--intro-button-height));
  margin: 0 auto;
  margin-bottom: 0;
  animation: introRevealLeft 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.intro-asset-delayed {
  animation-delay: 1000ms;
}

@keyframes introRevealRight {
  0% {
    opacity: 0;
    transform: translate(-8vw, 12vh) rotate(-16deg) scale(0.82);
    filter: blur(4px);
  }
  55% {
    opacity: 1;
    transform: translate(1.4vw, -1vh) rotate(3deg) scale(1.02);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(0) scale(1);
    filter: blur(0);
  }
}

@keyframes introRevealLeft {
  0% {
    opacity: 0;
    transform: translate(-9vw, 12vh) rotate(-14deg) scale(0.82);
    filter: blur(4px);
  }
  55% {
    opacity: 1;
    transform: translate(1vw, -0.8vh) rotate(2deg) scale(1.02);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(0) scale(1);
    filter: blur(0);
  }
}

/* ГЛАВНОЕ МЕНЮ */

.hero {
  flex: 0 0 auto;
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
  padding: clamp(18px, 3.6vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(34, 197, 94, 0.06)),
    rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -70px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.14);
  filter: blur(2px);
}

.hero h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 760px;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero p {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  max-width: 720px;
  color: #cbd5e1;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.5;
}

.mode-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  overflow: visible;
}

.mode-card {
  min-height: clamp(210px, 31vh, 315px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.03)),
    var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  overflow: visible;
}

.mode-card:hover {
  transform: translateY(-3px) scale(1.01);
  z-index: 5;
  border-color: rgba(56, 189, 248, 0.55);
  background:
    linear-gradient(180deg, rgba(56, 189, 248, 0.13), rgba(255, 255, 255, 0.03)),
    var(--card);
}

.mode-emoji {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(56, 189, 248, 0.13);
  font-size: 28px;
}

.mode-card h3 {
  margin: 0;
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.mode-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: clamp(12px, 1.1vw, 14px);
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.mode-count {
  color: #a8c1d8 !important;
}

.mode-start {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #e0f2fe;
  font-weight: 900;
  font-size: 14px;
}

.daily-hero {
  flex: 0 0 auto;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: clamp(18px, 2.6vw, 28px);
  align-items: stretch;
  margin-bottom: 16px;
  padding: 0 clamp(18px, 2.4vw, 26px);
  border-radius: 24px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background:
    radial-gradient(circle at 88% 16%, rgba(125, 211, 252, 0.18), transparent 15%),
    linear-gradient(120deg, rgba(20, 90, 128, 0.92), rgba(15, 43, 74, 0.96) 42%, rgba(14, 55, 64, 0.96)),
    var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.daily-hero::before {
  content: "";
  position: absolute;
  inset: auto -6% -24% auto;
  width: min(34vw, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(110, 231, 183, 0.12);
  filter: blur(30px);
  z-index: -1;
}

.daily-hero-copy {
  display: flex;
  align-items: center;
  align-self: center;
  padding-block: clamp(18px, 2.4vw, 28px);
  min-width: 0;
}

.daily-hero-text {
  max-width: 620px;
}

.daily-hero-progress-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.daily-hero h2 {
  margin: 0;
  font-size: clamp(30px, 4.1vw, 50px);
  line-height: 0.94;
  letter-spacing: -0.065em;
}

.week-progress {
  margin-top: 18px;
  width: min(100%, 560px);
}

.week-progress-head {
  color: #d8ecff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.week-progress-track {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.week-checkpoint {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.week-checkpoint-label {
  color: rgba(226, 232, 240, 0.9);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.week-checkpoint-box {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  max-width: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(16, 30, 55, 0.88);
  border: 1px solid rgba(125, 211, 252, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.week-checkpoint-icon {
  width: 58%;
  height: 58%;
  object-fit: contain;
  display: block;
}

.week-checkpoint.done .week-checkpoint-box {
  background: linear-gradient(180deg, #2fe36b, #14bf4d);
  border-color: rgba(208, 255, 220, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 18px rgba(20, 191, 77, 0.22);
}

.daily-start-btn {
  margin-top: 20px;
  min-height: 54px;
  min-width: 200px;
  padding: 0 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3f8cff, #2c5ddf);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.daily-start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 34px rgba(37, 99, 235, 0.34);
  filter: brightness(1.05);
}

.daily-hero-asset {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: end;
  min-height: 220px;
  align-self: end;
  overflow: hidden;
}

.daily-hero-asset img {
  position: static;
  display: block;
  width: min(100%, 400px);
  height: auto;
  max-height: 340px;
  object-fit: contain;
  object-position: right bottom;
}

.home-mode-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
  align-content: start;
  align-items: stretch;
}

.home-mode-card {
  min-height: 205px;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 16px;
  border-radius: 20px;
  border: 1px solid rgba(104, 137, 192, 0.2);
  background:
    linear-gradient(180deg, rgba(28, 48, 84, 0.94), rgba(20, 33, 58, 0.98)),
    var(--card);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  color: var(--text);
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.home-mode-card:hover {
  transform: translateY(-3px);
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

.home-mode-icon-wrap {
  flex-shrink: 0;
  width: clamp(60px, 5.4vw, 78px);
  height: clamp(60px, 5.4vw, 78px);
  display: grid;
  place-items: center;
}

.home-mode-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.18));
}

.home-mode-copy {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.home-mode-copy h3 {
  margin: 0;
  font-size: clamp(15px, 1.45vw, 20px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.home-mode-start {
  flex-shrink: 0;
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(31, 78, 133, 0.95), rgba(27, 61, 109, 0.98));
  color: #eff6ff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* ВЫБОР БИЛЕТА */

.panel {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
  padding: clamp(14px, 3vw, 22px);
  overflow: visible;
}

.panel.full-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.full-panel .panel-title,
.full-panel .ticket-pager {
  flex: 0 0 auto;
}

.panel-title {
  margin: 0 0 14px;
  font-size: clamp(22px, 4vw, 34px);
  letter-spacing: -0.05em;
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  justify-content: start;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
}

.ticket-pager {
  display: none;
}

.ticket-page-btn {
  min-width: 42px;
  min-height: 42px;
  font-size: 18px;
  font-weight: 900;
}

.ticket-page-status {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.1;
  font-weight: 800;
  text-align: center;
}

.ticket-btn {
  min-height: 88px;
  padding: 12px 10px;
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.ticket-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.ticket-btn.recent {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.11), rgba(255, 255, 255, 0.03)), var(--card);
  border-color: rgba(56, 189, 248, 0.5);
}

.ticket-btn-number {
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 950;
  line-height: 1;
}

.ticket-btn-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
  font-weight: 700;
}

/* КВИЗ */

.quiz-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: stretch;
  overflow: hidden;
}

.quiz-main,
.quiz-side {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
}

.quiz-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.quiz-head {
  flex: 0 0 auto;
  padding: clamp(10px, 1.5vw, 16px);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.09);
}

.quiz-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-mode {
  color: var(--accent);
  font-size: clamp(10px, 1vw, 13px);
  line-height: 1.1;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  overflow-wrap: anywhere;
}

.timer-pill {
  flex: 0 0 auto;
  min-width: 74px;
  min-height: 32px;
  padding: 0 12px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  font-size: clamp(13px, 1.2vw, 16px);
}

.timer-pill.danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fecaca;
}

.quiz-title {
  margin: 7px 0 0;
  font-size: clamp(17px, 2.5vw, 28px);
  letter-spacing: -0.04em;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.progress-wrap {
  margin-top: clamp(7px, 1.2vw, 12px);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: clamp(11px, 1vw, 13px);
  line-height: 1.1;
  margin-bottom: 7px;
}

.progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--good));
  transition: width 0.2s ease;
}

.question-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: clamp(10px, 1.5vw, 16px);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.question-image-wrap {
  display: none;
  margin-bottom: 10px;
  border-radius: 16px;
  overflow: hidden;
  background: transparent !important;
  border: 0 !important;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.question-image-wrap.visible {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: clamp(130px, 25vh, 300px);
  opacity: 1;
  transform: translateY(0);
}

.previewable-media {
  position: relative;
}

.previewable-media::after {
  content: attr(data-preview-hint);
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%) translateY(6px);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.question-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: clamp(130px, 25vh, 300px);
  object-fit: contain;
  background: transparent !important;
  border-radius: 14px;
}

.visual-card {
  display: none;
  margin: 0 auto 10px;
  width: min(260px, 100%);
  padding: 12px;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.visual-card.visible {
  flex: 0 0 auto;
  display: block;
  max-height: clamp(130px, 23vh, 250px);
  opacity: 1;
  transform: translateY(0);
}

.visual-card img {
  display: block;
  width: 100%;
  max-height: clamp(110px, 19vh, 220px);
  object-fit: contain;
}

.previewable-image {
  cursor: zoom-in;
}

@media (hover: hover) and (pointer: fine) {
  .previewable-media:hover::after,
  .previewable-media:focus-within::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.asset-image {
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.asset-image.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.question-text {
  flex: 0 0 auto;
  margin: 0 0 10px;
  font-size: clamp(16px, 2.25vw, 24px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  font-weight: 850;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  display: block;
  overflow: visible;
}

.answer-list {
  display: grid;
  gap: 7px;
  align-content: start;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.answer-list.mobile-answer-pruned {
  gap: 6px;
}

.answer-btn {
  position: relative;
  min-height: 39px;
  max-height: 74px;
  padding: 8px 10px 8px 44px;
  border-radius: 15px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  text-align: left;
  font-size: clamp(12px, 1.35vw, 15px);
  line-height: 1.18;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
  overflow: visible;
}

.answer-btn:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.004);
  border-color: rgba(56, 189, 248, 0.55);
  z-index: 2;
}

.answer-btn.pending {
  transform: scale(1.012);
  z-index: 3;
  border-color: rgba(56, 189, 248, 0.95);
  background: rgba(56, 189, 248, 0.19);
  box-shadow:
    0 0 0 2px rgba(56, 189, 248, 0.14),
    0 10px 22px rgba(0, 0, 0, 0.2);
}

.answer-index {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: #dbeafe;
  font-weight: 900;
  font-size: 12px;
}

.answer-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.answer-btn.correct {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.75);
}

.answer-btn.wrong {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.75);
}

.answer-btn.hidden-wrong {
  display: none;
}

.answer-btn.mobile-prune-out {
  overflow: hidden;
  pointer-events: none;
  animation: pruneAnswerOut 240ms ease forwards;
}

@keyframes pruneAnswerOut {
  from {
    opacity: 1;
    transform: scale(1);
    max-height: 74px;
    margin: 0;
    padding-top: 8px;
    padding-bottom: 8px;
    border-width: 1px;
  }
  to {
    opacity: 0;
    transform: scale(0.98);
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
  }
}

.exam-confirm-hint {
  flex: 0 0 auto;
  margin: 7px 0 0;
  color: #bae6fd;
  font-size: clamp(10px, 0.9vw, 12px);
  line-height: 1.15;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-box {
  display: none;
  flex: 0 0 auto;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
}

.result-box.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.24s ease, transform 0.24s ease, background 0.2s ease, border-color 0.2s ease;
}

.result-box.good {
  border-color: rgba(34, 197, 94, 0.55);
  background: rgba(34, 197, 94, 0.12);
}

.result-box.bad {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.12);
}

.result-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 950;
}

.result-text {
  margin: 0;
  color: #dbeafe;
  line-height: 1.25;
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: clamp(9px, 1.4vw, 14px);
  border-top: 1px solid var(--line);
  overflow: visible;
}

.quiz-actions-left,
.quiz-actions-center,
.quiz-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-actions-center {
  margin-left: auto;
}

.primary-btn,
.secondary-btn,
.danger-btn {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 14px;
  font-weight: 900;
  font-size: clamp(12px, 1.2vw, 15px);
  white-space: nowrap;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* САЙДБАР */

.quiz-side {
  flex: 1 1 auto;
  padding: 14px;
  overflow: visible;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  padding: 12px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.stat-value {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.mini-map {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-top: 14px;
}

.rail-map-wrap {
  margin-top: 14px;
}

.rail-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.rail-dot {
  flex: 0 0 52px;
  min-height: 42px;
}

.rail-arrow {
  flex: 0 0 44px;
  min-width: 44px;
  min-height: 42px;
  padding: 0;
  border-radius: 14px;
}

.mini-dot {
  min-height: 37px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 900;
}

.mini-dot.current {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}

.mini-dot.done {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
}

.mini-dot.good {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.48);
}

.mini-dot.bad {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.48);
}

.side-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ad-counter-inline {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(56, 189, 248, 0.08);
  color: #bae6fd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.ad-counter-inline-compact {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.ad-counter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
}

.ad-counter-chip-side {
  margin-bottom: 8px;
}

/* ФИНАЛ */

.finish-card {
  width: min(760px, 100%);
  max-height: 100%;
  margin: auto;
  padding: clamp(18px, 4vw, 34px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.13), rgba(255, 255, 255, 0.04)),
    var(--card);
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
}

.finish-card h2 {
  margin: 0;
  font-size: clamp(28px, 6vw, 52px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.finish-card p {
  margin: 14px auto 0;
  max-width: 560px;
  color: #cbd5e1;
  line-height: 1.45;
  font-size: clamp(13px, 1.4vw, 16px);
}

.finish-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.finish-review-btn {
  white-space: normal;
  text-align: center;
  line-height: 1.1;
  min-width: 0;
  max-width: min(220px, 100%);
  padding-top: 10px;
  padding-bottom: 10px;
}

.finish-reason {
  margin: 12px 0 0;
  font-weight: 900;
}

.good-text {
  color: #86efac;
}

.bad-text {
  color: #fecaca;
}

/* РАЗБОР ОШИБОК */

.review-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.review-card {
  width: min(860px, 100%);
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.review-body {
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
  overflow: hidden;
}

.review-answer,
.review-explanation {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.wrong-review {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
}

.correct-review {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
}

.review-label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: clamp(10px, 0.9vw, 12px);
  line-height: 1.1;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.review-text {
  color: var(--text);
  font-size: clamp(12px, 1.2vw, 15px);
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ПРОЧЕЕ */

.empty {
  padding: 18px;
  border-radius: 18px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  line-height: 1.45;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
}

.modal-backdrop.visible {
  display: grid;
}

.modal {
  width: min(460px, 100%);
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #111827;
  box-shadow: var(--shadow);
}

.ad-modal {
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(255, 255, 255, 0.04)),
    #111827;
}

.modal h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.modal p {
  margin: 10px 0 0;
  color: #cbd5e1;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.image-viewer-open {
  overflow: hidden;
}

.image-viewer-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: none;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(10px);
}

.image-viewer-backdrop.visible {
  display: block;
}

.image-viewer-shell {
  position: relative;
  width: 100%;
  height: 100%;
}

.image-viewer-close,
.image-viewer-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  font-size: 18px;
  font-weight: 900;
  backdrop-filter: blur(6px);
}

.image-viewer-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  font-size: 28px;
}

.image-viewer-toolbar {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
}

.image-viewer-stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
}

.image-viewer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
}

/* ПЛАНШЕТЫ */

@media (max-width: 1050px) {
  .intro-card-right,
  .intro-card-left {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .intro-copy {
    order: 2;
    padding: 0 18px 20px;
  }

  .intro-asset-wrap {
    order: 1;
    justify-content: center;
    align-items: center;
    padding-block: 40px;
  }

  .intro-asset {
    margin: 0;
  }

  .intro-copy-right,
  .intro-copy-left {
    align-items: center;
    justify-self: center;
  }

  .intro-asset-right,
  .intro-asset-left {
    height: calc(100dvh - (var(--intro-vertical-padding) * 2) - var(--intro-button-height));
    margin-bottom: 0;
  }

  .intro-asset-right {
    margin-right: 0;
  }

  .intro-asset-left {
    margin-left: 0;
  }

  .app-shell {
    width: min(920px, 100%);
    padding: calc(10px + var(--safe-top)) 10px calc(8px + var(--safe-bottom));
  }

  .daily-hero {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 320px);
    gap: 14px;
    padding: 0 14px;
  }

  .daily-hero-copy {
    order: 1;
    padding: 14px 0;
    align-self: center;
  }

  .daily-hero-asset {
    order: 2;
    min-height: 170px;
    justify-content: flex-end;
  }

  .daily-hero-asset img {
    width: min(100%, 300px);
    max-height: 250px;
    object-position: right bottom;
  }

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

  .home-mode-card {
    min-height: 188px;
    padding: 18px 11px;
  }

  .home-mode-icon-wrap {
    width: 58px;
    height: 58px;
  }

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

  .mode-card {
    min-height: clamp(155px, 22vh, 210px);
  }

  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .quiz-side {
    display: none;
  }

  .question-image-wrap.visible {
    max-height: clamp(110px, 22vh, 240px);
  }

  .question-image {
    max-height: clamp(110px, 22vh, 240px);
  }
}

/* МОБИЛКИ */

@media (max-width: 760px) {
  .intro-shell {
    padding: 0;
  }

  .intro-stage {
    gap: 0;
  }

  .intro-card {
    padding: 0;
    --intro-button-height: 58px;
  }

  .intro-next-btn {
    min-width: 0;
    min-height: var(--intro-button-height);
    padding: 0 24px;
    border-radius: 18px;
    font-size: clamp(20px, 6vw, 26px);
  }

  .intro-asset {
    max-width: none;
  }

  .intro-asset-right,
  .intro-asset-left {
    height: calc(100dvh - (var(--intro-vertical-padding) * 2) - var(--intro-button-height));
    margin-bottom: 0;
  }

  .intro-asset-right {
    margin-right: 0;
  }

  .intro-asset-left {
    margin-left: 0;
  }

  .app-shell {
    padding: calc(8px + var(--safe-top)) 8px calc(8px + var(--safe-bottom));
  }

  .topbar {
    margin-bottom: 8px;
    gap: 8px;
  }

  .brand {
    gap: 9px;
  }

  .logo {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    font-size: 19px;
  }

  .brand-title {
    font-size: clamp(19px, 5.4vw, 27px);
  }

  .brand-subtitle {
    display: none;
  }

  .back-btn {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .lang-toggle {
    --lang-toggle-size: 36px;
  }

  .studio-btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 12px;
  }

  .daily-hero {
    margin-bottom: 8px;
    padding: 0 11px;
    border-radius: 18px;
  }

  .daily-hero-copy {
    padding: 0 0 11px;
  }

  .daily-hero h2 {
    font-size: clamp(22px, 6vw, 30px);
  }

  .week-progress {
    margin-top: 11px;
    width: 100%;
  }

  .week-progress-head {
    font-size: 11px;
  }

  .week-progress-track {
    margin-top: 8px;
    gap: 6px;
  }

  .week-checkpoint {
    gap: 5px;
  }

  .week-checkpoint-label {
    font-size: 9.5px;
  }

  .week-checkpoint-box {
    max-width: 30px;
    border-radius: 8px;
  }

  .daily-start-btn {
    margin-top: 14px;
    min-width: 160px;
    min-height: 42px;
    border-radius: 14px;
    font-size: 14px;
  }

  .daily-hero-asset {
    min-height: 124px;
  }

  .daily-hero-asset img {
    width: min(100%, 230px);
    max-height: 190px;
  }

  .home-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .home-mode-card {
    min-height: 172px;
    padding: 12px 11px;
    gap: 9px;
    border-radius: 16px;
  }

  .home-mode-icon-wrap {
    width: 56px;
    height: 56px;
  }

  .home-mode-copy h3 {
    font-size: 14px;
    line-height: 1.04;
  }

  .home-mode-start {
    min-height: 34px;
    border-radius: 13px;
    font-size: 11px;
  }

  .hero {
    margin-bottom: 9px;
    padding: 14px;
    border-radius: 18px;
  }

  .hero h2 {
    font-size: clamp(22px, 6.8vw, 34px);
    line-height: 0.98;
  }

  .hero p {
    margin-top: 9px;
    font-size: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

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

  .mode-card {
    min-height: 0;
    height: auto;
    padding: 11px;
    gap: 8px;
    border-radius: 17px;
  }

  .mode-emoji {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    font-size: 20px;
  }

  .mode-card h3 {
    font-size: 17px;
  }

  .mode-card p {
    margin-top: 5px;
    font-size: 11.5px;
    line-height: 1.22;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .mode-start {
    min-height: 32px;
    font-size: 12px;
  }

  .ticket-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    justify-content: stretch;
    padding-bottom: max(88px, env(safe-area-inset-bottom, 0px));
  }

  .ticket-btn {
    min-height: 74px;
    border-radius: 12px;
    gap: 4px;
  }

  .ticket-btn-number {
    font-size: 22px;
  }

  .ticket-btn-meta {
    font-size: 10px;
  }

  .quiz-head {
    padding: 9px 10px;
  }

  .ad-counter-inline {
    margin-top: 8px;
    min-height: 28px;
    padding: 0 10px;
    font-size: 10.5px;
  }

  .quiz-mode {
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .timer-pill {
    min-width: 64px;
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
  }

  .quiz-title {
    margin-top: 5px;
    font-size: clamp(15px, 4.3vw, 19px);
    line-height: 1.05;
  }

  .progress-wrap {
    margin-top: 6px;
  }

  .progress-text {
    font-size: 10px;
    margin-bottom: 5px;
  }

  .progress {
    height: 7px;
  }

  .question-body {
    padding: 8px 10px;
  }

  .question-image-wrap.visible {
    max-height: 18vh;
  }

  .question-image {
    max-height: 18vh;
  }

  .visual-card.visible {
    max-height: 18vh;
    margin-bottom: 7px;
    padding: 8px;
  }

  .visual-card img {
    max-height: 15vh;
  }

  .question-text {
    margin-bottom: 8px;
    font-size: clamp(13px, 3.55vw, 16px);
    line-height: 1.08;
  }

  .answer-list {
    gap: 5px;
  }

  .answer-btn {
    min-height: 34px;
    max-height: 60px;
    padding: 6px 8px 6px 38px;
    border-radius: 13px;
    font-size: clamp(11px, 3vw, 13.5px);
    line-height: 1.12;
  }

  .answer-index {
    left: 9px;
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .answer-text {
    -webkit-line-clamp: 3;
  }

  .exam-confirm-hint {
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.08;
    -webkit-line-clamp: 2;
  }

  .result-box.visible {
    margin-top: 6px;
    padding: 8px 9px;
    border-radius: 13px;
  }

  .mobile-answer-pruned .answer-btn.mobile-prune-out {
    animation-duration: 220ms;
  }

  .result-title {
    font-size: 13px;
  }

  .result-text {
    font-size: 10.5px;
    line-height: 1.16;
  }

  .quiz-actions {
    padding: 8px 10px;
    gap: 6px;
  }

  .quiz-actions-left,
  .quiz-actions-center,
  .quiz-actions-right {
    width: 100%;
  }

  .quiz-actions-left,
  .quiz-actions-right {
    justify-content: space-between;
  }

  .quiz-actions-center {
    margin-left: 0;
    justify-content: center;
  }

  .primary-btn,
  .secondary-btn,
  .danger-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 35px;
    padding: 0 8px;
    border-radius: 11px;
    font-size: 11.5px;
  }

  .finish-card {
    padding: 16px;
    border-radius: 18px;
  }

  .finish-card h2 {
    font-size: 28px;
  }

  .finish-card p {
    font-size: 12.5px;
    line-height: 1.35;
  }

  .finish-actions {
    gap: 7px;
    margin-top: 14px;
  }

  .review-layout {
    place-items: stretch;
  }

  .review-card {
    width: 100%;
    height: 100%;
    border-radius: 18px;
  }

  .review-body {
    gap: 6px;
  }

  .review-answer,
  .review-explanation {
    padding: 7px 9px;
    border-radius: 12px;
  }

  .review-label {
    margin-bottom: 3px;
    font-size: 9px;
  }

  .review-text {
    font-size: 11.5px;
    line-height: 1.15;
    -webkit-line-clamp: 2;
  }

  .review-explanation .review-text {
    -webkit-line-clamp: 2;
  }
}

@media (max-height: 760px) {
  .app-shell {
    padding: calc(8px + var(--safe-top)) 8px calc(6px + var(--safe-bottom));
  }

  .topbar {
    gap: 8px;
    margin-bottom: 6px;
  }

  .brand {
    gap: 8px;
  }

  .logo {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .brand-title {
    font-size: clamp(18px, 3vw, 24px);
    line-height: 1;
  }

  .brand-subtitle {
    margin-top: 3px;
    font-size: 11px;
  }

  .back-btn,
  .icon-btn {
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }

  .lang-toggle {
    --lang-toggle-size: 36px;
  }

  .studio-btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 13px;
    font-size: 12px;
  }

  .daily-hero {
    gap: 8px;
    margin-bottom: 8px;
    padding-inline: 12px;
  }

  .daily-hero-copy {
    padding-block: 10px;
  }

  .daily-hero h2 {
    font-size: clamp(22px, 4vw, 30px);
  }

  .week-progress {
    margin-top: 10px;
  }

  .week-progress-track {
    gap: 5px;
  }

  .daily-start-btn {
    margin-top: 12px;
    min-height: 40px;
    min-width: 164px;
    font-size: 14px;
  }

  .daily-hero-asset {
    min-height: 124px;
  }

  .daily-hero-asset img {
    width: min(100%, 220px);
    max-height: 180px;
  }

  .home-mode-grid {
    gap: 8px;
  }

  .home-mode-card {
    min-height: 172px;
    padding: 11px 10px;
    gap: 7px;
    border-radius: 16px;
  }

  .home-mode-icon-wrap {
    width: 52px;
    height: 52px;
  }

  .home-mode-copy h3 {
    font-size: 13px;
  }

  .home-mode-start {
    min-height: 33px;
    font-size: 11px;
  }

  .ticket-grid {
    gap: 8px;
  }

  .ticket-btn {
    min-height: 72px;
    padding: 10px 8px;
  }

  .quiz-layout {
    gap: 10px;
  }

  .quiz-head {
    padding: 8px 10px;
  }

  .quiz-topline {
    gap: 8px;
  }

  .quiz-mode {
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .timer-pill {
    min-width: 62px;
    min-height: 27px;
    padding: 0 8px;
    font-size: 12px;
  }

  .quiz-title {
    margin-top: 4px;
    font-size: clamp(15px, 2.2vw, 20px);
    line-height: 1.02;
  }

  .progress-wrap {
    margin-top: 5px;
  }

  .progress-text {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .progress {
    height: 6px;
  }

  .question-body {
    padding: 8px 10px;
  }

  .question-image-wrap {
    margin-bottom: 7px;
  }

  .question-image-wrap.visible,
  .question-image {
    max-height: min(18vh, 150px);
  }

  .visual-card.visible {
    max-height: min(18vh, 150px);
    margin-bottom: 7px;
    padding: 8px;
  }

  .visual-card img {
    max-height: min(15vh, 126px);
  }

  .question-text {
    margin-bottom: 7px;
    font-size: clamp(13px, 1.85vw, 17px);
    line-height: 1.06;
  }

  .answer-list {
    gap: 5px;
  }

  .answer-btn {
    min-height: 33px;
    max-height: 54px;
    padding: 5px 8px 5px 36px;
    border-radius: 12px;
    font-size: clamp(11px, 1.3vw, 13px);
    line-height: 1.08;
  }

  .answer-index {
    left: 9px;
    width: 21px;
    height: 21px;
    font-size: 10px;
  }

  .answer-text {
    -webkit-line-clamp: 3;
  }

  .exam-confirm-hint {
    margin-top: 4px;
    font-size: 9.5px;
    line-height: 1.04;
    -webkit-line-clamp: 1;
  }

  .result-box.visible {
    margin-top: 6px;
    padding: 7px 9px;
  }

  .result-title {
    font-size: 13px;
  }

  .result-text {
    font-size: 10px;
    line-height: 1.14;
    -webkit-line-clamp: 2;
  }

  .quiz-actions {
    padding: 7px 10px;
    gap: 6px;
  }

  .primary-btn,
  .secondary-btn,
  .danger-btn {
    min-height: 33px;
    padding: 0 10px;
    border-radius: 11px;
    font-size: 11px;
  }

  .quiz-side {
    padding: 10px;
  }

  .stat-grid {
    gap: 8px;
  }

  .stat {
    padding: 9px;
    border-radius: 14px;
  }

  .stat-label,
  .side-note,
  .ad-counter-inline,
  .ad-counter-chip {
    font-size: 10px;
  }

  .stat-value {
    font-size: 19px;
  }

  .mini-map {
    gap: 5px;
    margin-top: 10px;
  }

  .mini-dot {
    min-height: 31px;
    border-radius: 10px;
    font-size: 12px;
  }
}

@media (max-height: 760px) and (min-width: 1051px) {
  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .quiz-side {
    display: none;
  }
}

@media (orientation: landscape) and (max-height: 820px) {
  .quiz-main {
    overflow: hidden;
  }

  .quiz-head {
    display: grid;
    grid-template-columns: minmax(160px, auto) minmax(0, 1fr) minmax(190px, 30%);
    align-items: center;
    gap: 8px 14px;
    padding: 7px 12px;
  }

  .quiz-topline {
    min-width: 0;
    gap: 8px;
  }

  .quiz-mode {
    min-width: 0;
    font-size: clamp(8px, 0.9vw, 11px);
    letter-spacing: 0.1em;
    white-space: normal;
  }

  .timer-pill {
    min-width: 66px;
    min-height: 28px;
    padding: 0 10px;
    font-size: clamp(11px, 1.1vw, 14px);
  }

  .quiz-title {
    min-width: 0;
    margin: 0;
    font-size: clamp(15px, 1.65vw, 21px);
    line-height: 1.04;
    letter-spacing: 0;
  }

  .progress-wrap {
    min-width: 0;
    margin-top: 0;
  }

  .progress-text {
    margin-bottom: 4px;
    font-size: clamp(9px, 0.95vw, 11px);
  }

  .progress {
    height: 6px;
  }

  .ad-counter-inline {
    grid-column: 1 / -1;
    margin-top: 0;
    min-height: 26px;
    padding: 0 10px;
    font-size: 10px;
  }

  .question-body {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "text"
      "answers"
      "hint"
      "result";
    gap: 8px 16px;
    padding: 8px 12px;
    align-content: start;
    overflow: hidden;
  }

  .question-body:has(.question-image-wrap.visible),
  .question-body:has(.visual-card.visible),
  .question-body.has-media {
    grid-template-columns: minmax(160px, 0.92fr) minmax(240px, 1.15fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "text text"
      "media answers"
      "hint hint"
      "result result";
  }

  .question-image-wrap,
  .visual-card {
    grid-area: media;
    margin: 0;
    min-width: 0;
    min-height: 0;
  }

  .question-image-wrap.visible,
  .visual-card.visible {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    align-self: start;
    justify-self: stretch;
    overflow: hidden;
  }

  .question-image-wrap.visible {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .question-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    margin-inline: auto;
    object-fit: contain;
  }

  .visual-card.visible {
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .visual-card img {
    width: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  .question-text {
    grid-area: text;
    margin: 0;
    font-size: clamp(14px, 1.8vw, 20px);
    line-height: 1.08;
    letter-spacing: 0;
    overflow: visible;
  }

  .answer-list {
    grid-area: answers;
    gap: 6px;
    align-self: start;
  }

  .answer-btn {
    min-height: 32px;
    max-height: 52px;
    padding: 5px 8px 5px 36px;
    border-radius: 12px;
    font-size: clamp(10.5px, 1.15vw, 13px);
    line-height: 1.08;
    overflow: hidden;
  }

  .answer-index {
    left: 9px;
    width: 21px;
    height: 21px;
    font-size: 10px;
  }

  .answer-text {
    -webkit-line-clamp: 2;
  }

  .exam-confirm-hint {
    grid-area: hint;
    margin: 0;
    font-size: clamp(9px, 0.95vw, 11px);
    line-height: 1.05;
    -webkit-line-clamp: 1;
  }

  .result-box.visible {
    grid-area: result;
    margin-top: 0;
    padding: 7px 10px;
  }

  .quiz-actions {
    flex: 0 0 auto;
    padding: 7px 12px;
    gap: 8px;
  }

  .primary-btn,
  .secondary-btn,
  .danger-btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: clamp(11px, 1.05vw, 13px);
  }
}

/* ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ */

@media (max-width: 420px), (max-height: 640px) {
  .intro-shell {
    padding: 0;
  }

  .intro-stage {
    gap: 0;
  }

  .intro-card {
    padding: 0;
    --intro-button-height: 52px;
  }

  .intro-copy {
    padding: 0 12px 14px;
  }

  .intro-next-btn {
    min-height: var(--intro-button-height);
    border-radius: 16px;
    font-size: clamp(18px, 5.8vw, 22px);
  }

  .ad-counter-inline {
    min-height: 26px;
    padding: 0 9px;
    font-size: 10px;
  }

  .intro-asset-right,
  .intro-asset-left {
    height: calc(100dvh - (var(--intro-vertical-padding) * 2) - var(--intro-button-height));
    margin-bottom: 0;
  }

  .intro-asset-right {
    margin-right: 0;
  }

  .intro-asset-left {
    margin-left: 0;
  }

  .app-shell {
    padding: calc(8px + var(--safe-top)) 8px calc(8px + var(--safe-bottom));
  }

  .topbar {
    gap: 8px;
    margin-bottom: 8px;
  }

  .brand {
    gap: 7px;
  }

  .logo {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .brand-title {
    font-size: clamp(16px, 4.6vw, 21px);
    line-height: 1;
  }

  .brand-subtitle {
    display: none;
  }

  .back-btn,
  .icon-btn {
    min-height: 30px;
    padding: 0 9px;
    font-size: 10.5px;
  }

  .lang-toggle {
    --lang-toggle-size: 30px;
  }

  .studio-btn {
    min-height: 30px;
    padding: 0 9px;
    border-radius: 12px;
    font-size: 10.5px;
  }

  .daily-hero {
    padding: 0 10px;
    margin-bottom: 8px;
    border-radius: 16px;
  }

  .daily-hero-copy {
    padding: 0 0 11px;
  }

  .daily-hero h2 {
    font-size: clamp(17px, 5.4vw, 22px);
    line-height: 0.98;
  }

  .week-progress {
    margin-top: 10px;
  }

  .week-progress-head {
    font-size: 9px;
  }

  .week-progress-track {
    gap: 3px;
  }

  .week-checkpoint-label {
    font-size: 7px;
  }

  .week-checkpoint-box {
    max-width: 20px;
    border-radius: 6px;
  }

  .daily-start-btn {
    margin-top: 12px;
    min-width: 132px;
    min-height: 34px;
    font-size: 11px;
  }

  .daily-hero-asset {
    min-height: 92px;
  }

  .daily-hero-asset img {
    width: min(100%, 150px);
    max-height: 120px;
  }

  .home-mode-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .home-mode-card {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 14px;
  }

  .home-mode-icon-wrap {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }

  .home-mode-copy h3 {
    font-size: 11px;
    text-align: left;
  }

  .home-mode-copy {
    flex: 1 1 auto;
    justify-content: center;
  }

  .home-mode-start {
    width: auto;
    min-width: 84px;
    min-height: 28px;
    padding: 0 10px;
    margin-left: auto;
    border-radius: 11px;
    font-size: 9.5px;
  }

  .hero {
    padding: 11px;
    margin-bottom: 7px;
  }

  .hero h2 {
    font-size: clamp(20px, 6vw, 28px);
  }

  .hero p {
    margin-top: 6px;
    font-size: 10.5px;
    line-height: 1.2;
    -webkit-line-clamp: 2;
  }

  .mode-grid {
    gap: 6px;
  }

  .mode-card {
    padding: 9px;
  }

  .mode-emoji {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }

  .mode-card h3 {
    font-size: 15px;
  }

  .mode-card p {
    font-size: 10.5px;
    line-height: 1.16;
  }

  .mode-start {
    min-height: 28px;
    font-size: 11px;
  }

  .quiz-head {
    padding: 8px 9px;
  }

  .quiz-mode {
    font-size: 7px;
  }

  .timer-pill {
    min-width: 54px;
    min-height: 24px;
    font-size: 10.5px;
  }

  .quiz-title {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.02;
  }

  .progress-wrap {
    margin-top: 6px;
  }

  .progress-text {
    margin-bottom: 4px;
    font-size: 8.5px;
  }

  .progress {
    height: 5px;
  }

  .question-body {
    padding: 8px 9px;
    gap: 8px;
  }

  .question-image-wrap.visible {
    max-height: min(24vh, 150px);
  }

  .question-image {
    max-height: min(24vh, 150px);
  }

  .question-text {
    font-size: 12px;
    line-height: 1.06;
    -webkit-line-clamp: 4;
  }

  .answer-list {
    gap: 5px;
  }

  .answer-btn {
    min-height: 33px;
    max-height: 54px;
    padding: 6px 8px 6px 34px;
    border-radius: 10px;
    font-size: 10px;
    line-height: 1.04;
  }

  .answer-index {
    left: 7px;
    width: 18px;
    height: 18px;
    font-size: 9px;
  }

  .answer-text {
    display: block;
    overflow: visible;
  }

  .exam-confirm-hint {
    margin-top: 3px;
    font-size: 8px;
    line-height: 1.02;
    -webkit-line-clamp: 1;
  }

  .quiz-actions {
    padding: 7px 9px;
    gap: 6px;
  }

  .primary-btn,
  .secondary-btn,
  .danger-btn {
    min-height: 34px;
    padding: 0 10px;
    font-size: 10px;
    border-radius: 9px;
  }

  .review-answer,
  .review-explanation {
    padding: 6px 7px;
  }

  .review-text {
    font-size: 10.5px;
    line-height: 1.1;
  }

  .review-card .question-image-wrap.visible {
    max-height: 14vh;
  }

  .review-card .question-image {
    max-height: 14vh;
  }

  .image-viewer-close,
  .image-viewer-tool {
    min-width: 42px;
    min-height: 42px;
    padding: 0 12px;
  }
}

@media (max-width: 520px) and (orientation: landscape), (max-height: 430px) {
  .app-shell {
    padding: calc(4px + var(--safe-top)) 5px calc(4px + var(--safe-bottom));
  }

  .topbar {
    margin-bottom: 4px;
    gap: 5px;
  }

  .logo {
    width: 26px;
    height: 26px;
    border-radius: 9px;
  }

  .brand-title {
    font-size: 15px;
  }

  .back-btn,
  .icon-btn,
  .studio-btn {
    min-height: 27px;
    padding: 0 8px;
    font-size: 9.5px;
    border-radius: 10px;
  }

  .lang-toggle {
    --lang-toggle-size: 27px;
  }

  .quiz-layout {
    gap: 6px;
  }

  .quiz-head {
    padding: 5px 6px;
  }

  .timer-pill {
    min-width: 50px;
    min-height: 22px;
    font-size: 9.5px;
  }

  .quiz-title {
    font-size: 12px;
  }

  .progress-text {
    font-size: 8px;
  }

  .question-body {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "text"
      "answers"
      "hint"
      "result";
    padding: 5px 6px;
    gap: 6px 10px;
    align-content: start;
    overflow: hidden;
  }

  .question-body:has(.question-image-wrap.visible),
  .question-body:has(.visual-card.visible),
  .question-body.has-media {
    grid-template-columns: minmax(120px, 0.9fr) minmax(180px, 1.2fr);
    grid-template-rows: auto auto auto auto;
    grid-template-areas:
      "text text"
      "media answers"
      "hint hint"
      "result result";
  }

  .question-image-wrap,
  .visual-card {
    grid-area: media;
    margin: 0;
    min-width: 0;
    min-height: 0;
    align-self: start;
    justify-self: stretch;
    width: 100%;
  }

  .question-image-wrap.visible,
  .visual-card.visible {
    height: auto;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  .question-image-wrap.visible {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .question-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  .visual-card.visible {
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .visual-card img {
    width: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  .question-text {
    grid-area: text;
    font-size: 10px;
    line-height: 0.98;
    margin: 0;
  }

  .answer-list {
    grid-area: answers;
    align-self: start;
    min-height: 0;
    align-items: center;
  }

  .answer-btn {
    min-height: 25px;
    max-height: none;
    padding: 3px 5px 3px 27px;
    font-size: 8.5px;
  }

  .answer-index {
    width: 16px;
    height: 16px;
    font-size: 8px;
  }

  .exam-confirm-hint,
  .side-note,
  .ad-counter-inline {
    font-size: 7.5px;
  }

  .exam-confirm-hint {
    grid-area: hint;
    margin-top: 0;
  }

  .result-box {
    grid-area: result;
  }

  .quiz-actions {
    margin-top: auto;
    padding: 4px 6px;
    gap: 3px;
  }

  .primary-btn,
  .secondary-btn,
  .danger-btn {
    min-height: 26px;
    font-size: 9px;
  }

  .daily-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 0 8px;
  }

  .daily-hero-copy {
    order: 1;
    padding: 8px 0;
  }

  .daily-hero-text {
    max-width: none;
  }

  .daily-hero h2 {
    font-size: 13px;
    line-height: 1.02;
    letter-spacing: -0.04em;
  }

  .week-progress {
    margin-top: 5px;
    width: 100%;
  }

  .week-progress-head {
    font-size: 8px;
  }

  .week-progress-track {
    margin-top: 4px;
    gap: 2px;
  }

  .week-checkpoint {
    gap: 2px;
  }

  .week-checkpoint-label {
    font-size: 6px;
  }

  .week-checkpoint-box {
    max-width: 14px;
    border-radius: 4px;
  }

  .daily-start-btn {
    margin-top: 6px;
    min-width: 100px;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 10px;
  }

  .daily-hero-asset {
    order: 2;
    min-height: 0;
    justify-content: flex-end;
    align-self: center;
  }

  .daily-hero-asset img {
    width: min(23vw, 108px);
    max-height: 96px;
    object-position: right center;
  }

  .home-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .home-mode-card {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 6px 7px;
    border-radius: 13px;
  }

  .home-mode-icon-wrap {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
  }

  .home-mode-copy {
    flex: 1 1 auto;
    justify-content: center;
  }

  .home-mode-copy h3 {
    font-size: 9px;
    line-height: 1.04;
    text-align: left;
  }

  .home-mode-start {
    width: auto;
    min-width: 66px;
    min-height: 24px;
    padding: 0 8px;
    margin-left: auto;
    border-radius: 9px;
    font-size: 8px;
    gap: 5px;
  }
}

@media (max-width: 420px) and (orientation: portrait) {
  .daily-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 0 8px;
  }

  .daily-hero-copy {
    padding: 8px 0;
  }

  .daily-hero h2 {
    font-size: 12px;
    line-height: 1.03;
    letter-spacing: -0.035em;
  }

  .week-progress {
    margin-top: 6px;
  }

  .week-progress-head {
    font-size: 8.5px;
  }

  .week-progress-track {
    margin-top: 5px;
    gap: 3px;
  }

  .week-checkpoint-label {
    font-size: 6.5px;
  }

  .week-checkpoint-box {
    max-width: 16px;
  }

  .daily-start-btn {
    margin-top: 7px;
    min-width: 96px;
    min-height: 27px;
    font-size: 10px;
  }

  .daily-hero-asset {
    min-height: 0;
    align-self: center;
    justify-content: flex-end;
  }

  .daily-hero-asset img {
    width: min(28vw, 88px);
    max-height: 98px;
    object-position: right center;
  }

  .home-mode-grid {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .home-mode-card {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    padding: 7px 8px;
  }

  .home-mode-icon-wrap {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }

  .home-mode-copy {
    flex: 1 1 auto;
  }

  .home-mode-copy h3 {
    font-size: 10px;
    line-height: 1.06;
    text-align: left;
  }

  .home-mode-start {
    width: auto;
    min-width: 74px;
    min-height: 26px;
    padding: 0 8px;
    margin-left: auto;
    font-size: 8.5px;
  }
}

@media (max-width: 1100px) and (min-width: 761px) and (min-height: 500px) {
  .daily-hero {
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 12px;
    padding: 0 14px;
  }

  .daily-hero-copy {
    order: 1;
    align-self: center;
    padding: 12px 0;
  }

  .daily-hero-text {
    max-width: none;
  }

  .daily-hero h2 {
    font-size: clamp(22px, 3.6vw, 34px);
    line-height: 0.98;
  }

  .week-progress {
    margin-top: 10px;
    width: min(100%, 500px);
  }

  .week-progress-head {
    font-size: 11px;
  }

  .week-progress-track {
    margin-top: 7px;
    gap: 6px;
  }

  .week-checkpoint-label {
    font-size: 9px;
  }

  .week-checkpoint-box {
    max-width: 28px;
    border-radius: 8px;
  }

  .daily-start-btn {
    margin-top: 12px;
    min-width: 168px;
    min-height: 40px;
    font-size: 14px;
  }

  .daily-hero-asset {
    order: 2;
    min-height: 0;
    align-self: end;
    justify-content: flex-end;
  }

  .daily-hero-asset img {
    width: min(100%, 190px);
    max-height: 180px;
    object-position: right bottom;
  }

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

  .home-mode-card {
    min-height: 190px;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 14px;
    border-radius: 18px;
    text-align: center;
  }

  .home-mode-card:hover {
    transform: translateY(-1px);
  }

  .home-mode-icon-wrap {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
  }

  .home-mode-copy {
    flex: 1 0 auto;
    justify-content: center;
  }

  .home-mode-copy h3 {
    font-size: 14px;
    line-height: 1.2;
    text-align: center;
  }

  .home-mode-start {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 0 14px;
    margin-left: 0;
    border-radius: 12px;
    font-size: 12px;
    gap: 8px;
  }
}

@media (max-width: 620px) and (min-height: 641px) {
  .daily-hero {
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 8px;
    padding: 0 10px;
    border-radius: 18px;
  }

  .daily-hero-copy {
    order: 1;
    padding: 10px 0;
    align-self: center;
  }

  .daily-hero-text {
    max-width: none;
  }

  .daily-hero h2 {
    font-size: 16px;
    line-height: 1.02;
    letter-spacing: -0.04em;
  }

  .week-progress {
    margin-top: 7px;
  }

  .week-progress-head {
    font-size: 9px;
  }

  .week-progress-track {
    margin-top: 5px;
    gap: 4px;
  }

  .week-checkpoint {
    gap: 4px;
  }

  .week-checkpoint-label {
    font-size: 7px;
  }

  .week-checkpoint-box {
    max-width: 18px;
    border-radius: 6px;
  }

  .daily-start-btn {
    margin-top: 8px;
    min-width: 116px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 11px;
  }

  .daily-hero-asset {
    order: 2;
    min-height: 0;
    align-self: center;
    justify-content: flex-end;
  }

  .daily-hero-asset img {
    width: min(100%, 98px);
    max-height: 132px;
    object-position: right center;
  }

  .home-mode-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .home-mode-card {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 16px;
    text-align: left;
  }

  .home-mode-card:hover {
    transform: translateY(-1px);
  }

  .home-mode-icon-wrap {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .home-mode-copy {
    flex: 1 1 auto;
    justify-content: center;
  }

  .home-mode-copy h3 {
    font-size: 12px;
    line-height: 1.08;
    text-align: left;
  }

  .home-mode-start {
    width: auto;
    min-width: 92px;
    min-height: 30px;
    padding: 0 12px;
    margin-left: auto;
    border-radius: 11px;
    font-size: 10px;
    gap: 6px;
  }
}

@media (min-width: 761px) and (max-height: 430px) {
  .daily-hero {
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 10px;
    padding: 0 12px;
    margin-bottom: 6px;
    border-radius: 18px;
  }

  .daily-hero-copy {
    order: 1;
    align-self: center;
    padding: 8px 0;
  }

  .daily-hero-text {
    max-width: none;
  }

  .daily-hero h2 {
    font-size: clamp(16px, 2.8vw, 22px);
    line-height: 1;
    letter-spacing: -0.045em;
  }

  .daily-hero-progress-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 10px;
  }

  .week-progress {
    margin-top: 6px;
    width: min(100%, 440px);
  }

  .week-progress-head {
    font-size: 9px;
  }

  .week-progress-track {
    margin-top: 4px;
    gap: 4px;
  }

  .week-checkpoint {
    gap: 3px;
  }

  .week-checkpoint-label {
    font-size: 7px;
  }

  .week-checkpoint-box {
    max-width: 18px;
    border-radius: 6px;
  }

  .daily-start-btn {
    margin-top: 0;
    min-width: 122px;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 11px;
    align-self: end;
    white-space: nowrap;
  }

  .daily-hero-asset {
    order: 2;
    min-height: 0;
    align-self: stretch;
    align-items: flex-end;
    justify-content: flex-end;
  }

  .daily-hero-asset img {
    width: min(100%, 138px);
    max-height: 122px;
    object-position: right bottom;
  }

  .home-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .home-mode-card {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 16px;
    text-align: left;
  }

  .home-mode-card:hover {
    transform: translateY(-1px);
  }

  .home-mode-icon-wrap {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }

  .home-mode-copy {
    flex: 1 1 auto;
    justify-content: center;
  }

  .home-mode-copy h3 {
    font-size: 11px;
    line-height: 1.06;
    text-align: left;
  }

  .home-mode-start {
    width: auto;
    min-width: 100px;
    min-height: 28px;
    padding: 0 10px;
    margin-left: auto;
    border-radius: 10px;
    font-size: 10px;
    gap: 6px;
  }
}

@media (min-width: 820px) and (max-width: 950px) and (max-height: 430px) {
  .daily-hero {
    grid-template-columns: minmax(0, 1fr) 162px;
  }

  .daily-hero-progress-row {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
  }

  .week-progress {
    width: min(100%, 470px);
  }

  .daily-hero-asset img {
    width: min(100%, 148px);
    max-height: 132px;
  }
}

@media (max-width: 760px) and (orientation: portrait) {
  .quiz-actions.utility-actions-hidden .quiz-actions-center {
    display: none;
  }

  .quiz-actions.utility-actions-hidden {
    padding-top: 0;
  }

  .intro-card-right,
  .intro-card-left {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .intro-asset-wrap {
    justify-content: center;
    align-items: center;
    padding-inline: 10px;
  }

  .intro-asset-right,
  .intro-asset-left {
    width: min(100%, calc((100vw - 20px) * 0.8));
    height: auto;
    max-width: calc((100vw - 20px) * 0.8);
    max-height: min(46vh, 416px);
    object-fit: contain;
  }

  .ticket-pager {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
  }

  .ticket-grid.ticket-grid-paged {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 8px;
  }

  .ticket-grid.ticket-grid-paged .ticket-btn {
    min-height: 60px;
    padding: 8px 6px;
    border-radius: 12px;
    gap: 3px;
  }

  .ticket-grid.ticket-grid-paged .ticket-btn-number {
    font-size: 20px;
  }

  .ticket-grid.ticket-grid-paged .ticket-btn-meta {
    font-size: 9px;
    line-height: 1.05;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .ticket-grid,
  .ticket-grid.ticket-grid-paged {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    justify-content: stretch;
    padding-bottom: max(56px, env(safe-area-inset-bottom, 0px));
  }

  .ticket-btn,
  .ticket-grid.ticket-grid-paged .ticket-btn {
    min-height: 58px;
  }
}

/* Keep home layout independent of the quiz's viewport-height breakpoints. */
html.home-active,
html.home-active body,
html.home-active #app {
  touch-action: pan-y;
}

.app-shell.home-shell {
  width: min(1150px, 100%);
  padding: calc(12px + var(--safe-top)) max(12px, env(safe-area-inset-right, 0px)) calc(16px + var(--safe-bottom)) max(12px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.home-shell .topbar {
  gap: 12px;
  margin-bottom: 12px;
}

.home-shell .brand-title {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}

.home-shell .brand-subtitle {
  white-space: normal;
}

.home-shell .daily-hero {
  flex: none;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: center;
  gap: 20px;
  padding: 20px;
  margin-bottom: 12px;
}

.home-shell .daily-hero-copy {
  order: 0;
  align-self: center;
  padding: 0;
}

.home-shell .daily-hero-text {
  width: 100%;
  max-width: none;
}

.home-shell .daily-hero h2 {
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.home-shell .daily-hero-progress-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.home-shell .week-progress {
  width: min(100%, 500px);
  margin-top: 14px;
}

.home-shell .week-progress-head {
  font-size: 13px;
}

.home-shell .week-progress-track {
  margin-top: 10px;
  gap: 6px;
}

.home-shell .week-checkpoint {
  gap: 5px;
}

.home-shell .week-checkpoint-label {
  font-size: 11px;
}

.home-shell .week-checkpoint-box {
  max-width: 34px;
  border-radius: 8px;
}

.home-shell .daily-start-btn {
  width: min(100%, 180px);
  min-width: 0;
  min-height: 44px;
  flex-shrink: 0;
  align-self: flex-start;
  margin: 0;
  padding: 10px 16px;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0;
  white-space: normal;
}

.home-shell .daily-hero-asset {
  order: 0;
  min-width: 0;
  min-height: 0;
  align-self: center;
  justify-content: center;
}

.home-shell .daily-hero-asset img {
  width: 100%;
  height: 230px;
  max-height: none;
  object-fit: contain;
  object-position: center;
}

.home-shell .home-mode-grid {
  flex: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 12px;
  align-items: stretch;
  align-content: start;
}

.home-shell .home-mode-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 64px minmax(44px, auto) 44px;
  align-items: center;
  justify-items: center;
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: 214px;
  height: auto;
  padding: 18px 14px;
  text-align: center;
}

.home-shell .home-mode-icon-wrap {
  width: 64px;
  height: 64px;
}

.home-shell .home-mode-copy {
  width: 100%;
  min-width: 0;
}

.home-shell .home-mode-copy h3 {
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.home-shell .home-mode-start {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  height: 100%;
  padding: 8px 10px;
  margin: 0;
  gap: 8px;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0;
}

@media (max-width: 1100px) {
  .home-shell .home-mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .home-shell .topbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .home-shell .brand {
    flex: 1 1 180px;
    gap: 8px;
  }

  .home-shell .brand-title {
    font-size: 20px;
  }

  .home-shell .brand-subtitle {
    display: none;
  }

  .home-shell .logo {
    width: 36px;
    height: 36px;
  }

  .home-shell .header-actions {
    max-width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .home-shell .lang-toggle {
    --lang-toggle-size: 36px;
  }

  .home-shell .studio-btn {
    min-height: 36px;
    font-size: 12px;
    white-space: normal;
  }

  .home-shell .daily-hero {
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 10px;
    padding: 16px 12px;
  }

  .home-shell .daily-hero h2 {
    font-size: 20px;
  }

  .home-shell .daily-hero-progress-row {
    gap: 12px;
  }

  .home-shell .week-progress {
    margin-top: 12px;
  }

  .home-shell .week-progress-track {
    gap: 4px;
    margin-top: 8px;
  }

  .home-shell .week-progress-head {
    font-size: 12px;
  }

  .home-shell .week-checkpoint-label {
    font-size: 10px;
  }

  .home-shell .week-checkpoint-box {
    max-width: 26px;
  }

  .home-shell .daily-hero-asset img {
    height: 140px;
  }

  .home-shell .home-mode-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .home-shell .home-mode-card {
    grid-template-columns: 40px minmax(0, 1fr) 88px;
    grid-template-rows: auto;
    justify-items: stretch;
    gap: 10px;
    min-height: 76px;
    padding: 12px;
    text-align: left;
  }

  .home-shell .home-mode-card:hover {
    transform: none;
  }

  .home-shell .home-mode-icon-wrap {
    width: 40px;
    height: 40px;
  }

  .home-shell .home-mode-copy h3 {
    font-size: 14px;
    text-align: left;
  }
}

@media (max-width: 1000px) and (orientation: landscape) {
  .app-shell.home-shell {
    padding-top: calc(8px + var(--safe-top));
    padding-bottom: calc(8px + var(--safe-bottom));
  }

  .home-shell .topbar {
    gap: 8px;
    margin-bottom: 8px;
  }

  .home-shell .brand-title {
    font-size: 20px;
  }

  .home-shell .brand-subtitle {
    display: none;
  }

  .home-shell .logo {
    width: 32px;
    height: 32px;
  }

  .home-shell .lang-toggle {
    --lang-toggle-size: 32px;
  }

  .home-shell .daily-hero {
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 8px;
  }

  .home-shell .daily-hero h2 {
    font-size: 20px;
  }

  .home-shell .daily-hero-progress-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    align-items: end;
    gap: 12px;
  }

  .home-shell .week-progress {
    margin-top: 8px;
  }

  .home-shell .week-progress-head {
    font-size: 12px;
  }

  .home-shell .week-progress-track {
    margin-top: 6px;
    gap: 4px;
  }

  .home-shell .week-checkpoint {
    gap: 4px;
  }

  .home-shell .week-checkpoint-label {
    font-size: 10px;
  }

  .home-shell .week-checkpoint-box {
    max-width: 24px;
  }

  .home-shell .daily-hero-asset img {
    height: 88px;
  }

  .home-shell .home-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .home-shell .home-mode-card {
    grid-template-columns: 32px minmax(0, 1fr) 80px;
    grid-template-rows: auto;
    justify-items: stretch;
    gap: 6px;
    min-height: 58px;
    padding: 6px;
    text-align: left;
  }

  .home-shell .home-mode-icon-wrap {
    width: 32px;
    height: 32px;
  }

  .home-shell .home-mode-copy h3 {
    font-size: 13px;
    text-align: left;
  }
}

/* Home mobile: content-sized mode cards, daily CTA that is not clipped. */
.app-shell.home-shell .daily-hero-copy,
.app-shell.home-shell .daily-hero-text,
.app-shell.home-shell .daily-hero-progress-row,
.app-shell.home-shell .week-progress {
  min-width: 0;
  max-width: 100%;
}

.app-shell.home-shell .home-mode-copy {
  min-width: 0;
}

.app-shell.home-shell .home-mode-copy h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 760px) and (orientation: portrait) {
  .app-shell.home-shell {
    padding: calc(8px + var(--safe-top)) 10px calc(10px + var(--safe-bottom));
  }

  .app-shell.home-shell .topbar {
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 8px;
  }

  .app-shell.home-shell .brand {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
  }

  .app-shell.home-shell .brand-title {
    font-size: 17px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-shell.home-shell .logo {
    width: 34px;
    height: 34px;
  }

  .app-shell.home-shell .header-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .app-shell.home-shell .lang-toggle {
    --lang-toggle-size: 32px;
  }

  .app-shell.home-shell .studio-btn {
    min-height: 32px;
    padding: 0 10px;
    font-size: 11px;
    white-space: nowrap;
  }

  .app-shell.home-shell .daily-hero {
    grid-template-columns: minmax(0, 1fr) minmax(118px, 36%);
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
    padding: 12px 10px 12px 12px;
    overflow: hidden;
  }

  .app-shell.home-shell .daily-hero-copy {
    padding: 0;
    align-self: center;
  }

  .app-shell.home-shell .daily-hero h2 {
    font-size: 16px;
    line-height: 1.18;
    letter-spacing: -0.03em;
  }

  .app-shell.home-shell .daily-hero-progress-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .app-shell.home-shell .week-progress {
    width: 100%;
    margin-top: 6px;
  }

  .app-shell.home-shell .week-progress-head {
    font-size: 11px;
  }

  .app-shell.home-shell .week-progress-track {
    margin-top: 6px;
    gap: 4px;
  }

  .app-shell.home-shell .week-checkpoint {
    gap: 3px;
  }

  .app-shell.home-shell .week-checkpoint-label {
    font-size: 9px;
  }

  .app-shell.home-shell .week-checkpoint-box {
    max-width: 22px;
    border-radius: 7px;
  }

  .app-shell.home-shell .daily-start-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 40px;
    height: auto;
    margin: 0;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.2;
    white-space: nowrap;
    align-self: stretch;
  }

  .app-shell.home-shell .daily-hero-asset {
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    justify-content: center;
    align-items: end;
    overflow: hidden;
  }

  .app-shell.home-shell .daily-hero-asset img {
    width: 100%;
    height: auto;
    max-height: 156px;
    object-fit: contain;
    object-position: bottom center;
  }

  .app-shell.home-shell .home-mode-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .app-shell.home-shell .home-mode-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-rows: auto;
    justify-items: stretch;
    align-items: center;
    gap: 8px;
    min-height: 0;
    height: auto;
    padding: 8px 8px 8px 10px;
    text-align: left;
  }

  .app-shell.home-shell .home-mode-card:hover {
    transform: none;
  }

  .app-shell.home-shell .home-mode-icon-wrap {
    width: 34px;
    height: 34px;
  }

  .app-shell.home-shell .home-mode-copy {
    width: auto;
  }

  .app-shell.home-shell .home-mode-copy h3 {
    font-size: 13px;
    line-height: 1.2;
    text-align: left;
  }

  .app-shell.home-shell .home-mode-start {
    width: auto;
    min-width: 0;
    min-height: 32px;
    height: auto;
    padding: 0 12px;
    margin: 0;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.1;
    white-space: nowrap;
  }
}

@media (max-width: 760px) and (orientation: portrait) and (max-height: 700px) {
  .app-shell.home-shell .daily-hero {
    padding: 10px 8px 10px 12px;
    margin-bottom: 6px;
  }

  .app-shell.home-shell .daily-hero h2 {
    font-size: 15px;
  }

  .app-shell.home-shell .daily-hero-progress-row {
    gap: 6px;
  }

  .app-shell.home-shell .week-progress {
    margin-top: 4px;
  }

  .app-shell.home-shell .daily-start-btn {
    min-height: 36px;
    font-size: 14px;
  }

  .app-shell.home-shell .daily-hero-asset img {
    max-height: 128px;
  }

  .app-shell.home-shell .home-mode-grid {
    gap: 5px;
  }

  .app-shell.home-shell .home-mode-card {
    gap: 7px;
    padding: 6px 7px 6px 8px;
  }

  .app-shell.home-shell .home-mode-icon-wrap {
    width: 30px;
    height: 30px;
  }

  .app-shell.home-shell .home-mode-copy h3 {
    font-size: 12.5px;
  }

  .app-shell.home-shell .home-mode-start {
    min-height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }
}

@media (max-width: 1100px) and (orientation: landscape) {
  .app-shell.home-shell {
    padding: calc(6px + var(--safe-top)) 10px calc(6px + var(--safe-bottom));
  }

  .app-shell.home-shell .topbar {
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 6px;
  }

  .app-shell.home-shell .brand-title {
    font-size: 16px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .app-shell.home-shell .brand-subtitle {
    display: none;
  }

  .app-shell.home-shell .logo {
    width: 30px;
    height: 30px;
  }

  .app-shell.home-shell .lang-toggle {
    --lang-toggle-size: 30px;
  }

  .app-shell.home-shell .studio-btn {
    min-height: 30px;
    padding: 0 10px;
    font-size: 11px;
    white-space: nowrap;
  }

  .app-shell.home-shell .daily-hero {
    grid-template-columns: minmax(0, 1fr) minmax(96px, 18%);
    align-items: stretch;
    gap: 10px;
    margin-bottom: 6px;
    padding: 8px 10px 8px 12px;
    overflow: hidden;
  }

  .app-shell.home-shell .daily-hero-copy {
    padding: 0;
    align-self: center;
  }

  .app-shell.home-shell .daily-hero h2 {
    font-size: 16px;
    line-height: 1.15;
  }

  .app-shell.home-shell .daily-hero-progress-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 10px;
    row-gap: 4px;
    width: 100%;
  }

  .app-shell.home-shell .week-progress {
    width: 100%;
    margin-top: 4px;
  }

  .app-shell.home-shell .week-progress-head {
    font-size: 11px;
  }

  .app-shell.home-shell .week-progress-track {
    margin-top: 4px;
    gap: 4px;
  }

  .app-shell.home-shell .week-checkpoint {
    gap: 3px;
  }

  .app-shell.home-shell .week-checkpoint-label {
    font-size: 9px;
  }

  .app-shell.home-shell .week-checkpoint-box {
    max-width: 22px;
  }

  .app-shell.home-shell .daily-start-btn {
    width: auto;
    min-width: 0;
    max-width: 100%;
    min-height: 36px;
    height: auto;
    margin: 0;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    justify-self: end;
    align-self: end;
  }

  .app-shell.home-shell .daily-hero-asset {
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    align-items: end;
    justify-content: center;
    overflow: hidden;
  }

  .app-shell.home-shell .daily-hero-asset img {
    width: 100%;
    height: auto;
    max-height: 96px;
    object-fit: contain;
    object-position: bottom center;
  }

  .app-shell.home-shell .home-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .app-shell.home-shell .home-mode-card {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-rows: auto;
    justify-items: stretch;
    align-items: center;
    gap: 8px;
    min-height: 0;
    height: auto;
    padding: 6px 8px;
    text-align: left;
  }

  .app-shell.home-shell .home-mode-card:hover {
    transform: none;
  }

  .app-shell.home-shell .home-mode-icon-wrap {
    width: 30px;
    height: 30px;
  }

  .app-shell.home-shell .home-mode-copy h3 {
    font-size: 12.5px;
    line-height: 1.18;
    text-align: left;
  }

  .app-shell.home-shell .home-mode-start {
    width: auto;
    min-width: 0;
    min-height: 30px;
    height: auto;
    padding: 0 10px;
    margin: 0;
    border-radius: 10px;
    font-size: 11px;
    white-space: nowrap;
  }
}

@media (max-width: 1100px) and (orientation: landscape) and (max-height: 380px) {
  .app-shell.home-shell .daily-hero {
    padding: 6px 8px 6px 10px;
    margin-bottom: 5px;
  }

  .app-shell.home-shell .daily-hero h2 {
    font-size: 14px;
  }

  .app-shell.home-shell .daily-start-btn {
    min-height: 32px;
    padding: 0 12px;
    font-size: 13px;
  }

  .app-shell.home-shell .daily-hero-asset img {
    max-height: 78px;
  }

  .app-shell.home-shell .home-mode-grid {
    gap: 5px;
  }

  .app-shell.home-shell .home-mode-card {
    padding: 5px 7px;
    gap: 6px;
  }

  .app-shell.home-shell .home-mode-icon-wrap {
    width: 26px;
    height: 26px;
  }

  .app-shell.home-shell .home-mode-copy h3 {
    font-size: 12px;
  }

  .app-shell.home-shell .home-mode-start {
    min-height: 26px;
    font-size: 10.5px;
  }
}
