@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

body {
  min-height: 100vh;
}

body.client-layout {
  isolation: isolate;
  position: relative;
}

#test-view {
  box-sizing: border-box;
  margin: 24px auto;
  max-width: 1320px;
  padding: 0 12px 24px;
  width: 100%;
}

#test-view,
#test-view button,
#test-view input,
#test-view select,
#test-view textarea {
  font-family: "Poppins", sans-serif;
}

.tests-init__question-strip {
  align-items: center;
  background: #fff;
  border-radius: 16px;
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 24px;
}

.tests-init__question-strip-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.tests-init__question-batches {
  align-items: center;
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: thin;
}

.question-batch-btn {
  align-items: center;
  background: #f6f4f2;
  border: 1px solid #dedede;
  border-radius: 999px;
  color: #2a2a2a;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  height: 30px;
  justify-content: center;
  line-height: 1;
  padding: 0 12px;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.question-batch-btn.is-active {
  background: #3559b8;
  border-color: #3559b8;
  color: #fff;
}

.question-batch-btn--jump {
  background: #fff;
  border-style: dashed;
  margin-left: 4px;
}

.question-batch-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

#question-numbers {
  align-items: center;
  display: flex;
  gap: 20px;
  min-width: 0;
  overflow-x: auto;
  padding: 8px 0;
  width: 100%;
  scrollbar-width: thin;
}

#question-numbers::-webkit-scrollbar {
  height: 6px;
}

#question-numbers::-webkit-scrollbar-thumb {
  background: #dedede;
  border-radius: 8px;
}

.question-number {
  align-items: center;
  background: #f5f3f1;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #000;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 40px;
  font-size: 14px;
  font-weight: 400;
  height: 40px;
  justify-content: center;
  line-height: 24px;
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.question-number + .question-number::before {
  border-top: 1px solid #dedede;
  content: "";
  left: -14px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
}

.question-number.current {
  background: #fff;
  border-color: #dedede;
  /* Strong current indicator drawn inside to avoid overflow clipping */
  box-shadow: inset 0 0 0 2px #000;
}

.question-number.correct,
.question-number.incorrect {
  color: transparent;
  font-size: 0;
}

.question-number.correct {
  background: #48b525;
  border-color: #48b525;
}

.question-number.correct::after {
  color: #fff;
  content: "✓";
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.question-number.incorrect {
  background: #fa5e2f;
  border-color: #fa5e2f;
}

.question-number.incorrect::after {
  color: #fff;
  content: "✕";
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}

.question-number.answered {
  background: #ffe4b7;
  border-color: #ffe4b7;
}

.tests-init__question-strip-close {
  flex-shrink: 0;
}

.tests-init__icon-button,
.tests-init__icon-button:link,
.tests-init__icon-button:visited {
  align-items: center;
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 12px;
  color: #000;
  display: inline-flex;
  font-size: 18px;
  height: 40px;
  justify-content: center;
  line-height: 1;
  text-decoration: none;
  width: 40px;
}

.tests-init__icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.answers-sync-status {
  font-size: 13px;
  line-height: 16px;
  margin: 0 0 12px;
  display: none !important; /* Hide per-answer loader/status completely */
}

.answers-sync-status.is-pending {
  color: #8a6d3b;
}

.answers-sync-status.is-synced {
  color: #2e7d32;
}

.answers-sync-status.is-offline {
  color: #b71c1c;
}

.tests-init__card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
}

#question-header {
  align-items: flex-start;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.tests-init__question-head-main {
  flex: 1;
  min-width: 0;
}

#question-text {
  color: #000;
  font-family: "Inter", "Poppins", Helvetica, Arial, sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
  margin: 0;
  /* Reserve space for two lines to prevent layout jump */
  min-height: 48px;
}

#question-title {
  color: #9f9f9f;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  margin: 10px 0 0;
}

#progress-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

#question-counter,
#test-progress-text {
  color: #9f9f9f;
  font-size: 13px;
  line-height: 16px;
}

#progress-info {
  display: none;
}

.tests-init__question-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

#theory-btn,
#translate-btn {
  -webkit-appearance: none;
  align-items: center;
  appearance: none;
  background: #f5f3f1;
  border: 1px solid #dedede;
  border-radius: 12px;
  color: #000;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 400;
  gap: 8px;
  justify-content: center;
  line-height: 20px;
  min-height: 44px;
  min-width: 0;
  padding: 10px 16px;
  white-space: nowrap;
}

#theory-btn {
  min-width: 126px;
}

#theory-btn.is-on {
  background: #eef0f3; /* neutral light */
  border-color: #bfc8d6; /* neutral border */
  color: #2b2f36; /* neutral text */
}

#theory-btn.is-on::after {
  content: "";
  display: block;
  flex: 0 0 auto;
  height: 8px;
  width: 8px;
  background: #6b7280; /* neutral dot */
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(107, 114, 128, 0.25);
}

#translate-btn {
  display: none;
  min-width: 138px;
  justify-content: flex-start;
  overflow: visible;
  position: relative;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

#translate-btn .translate-btn__lock {
  display: none;
  font-size: 14px;
  line-height: 1;
  margin-left: auto;
}

#translate-btn.is-locked {
  background: #f5f3f1;
  border-color: #dedede;
  box-shadow: none;
  color: #2b2f36;
}

#translate-btn.is-locked .translate-btn__icon {
  opacity: 0.6;
}

#translate-btn.is-locked .translate-btn__lock {
  display: inline-flex;
}

#translate-btn.is-locked .translate-btn__ripple {
  display: none;
}

#translate-btn.is-locked:active {
  animation: none;
  background: #efeeec;
  border-color: #d1d1d1;
  box-shadow: none;
  transform: none;
}

#translate-btn.is-locked:active .translate-btn__icon {
  left: 14px;
  transform: translateY(-50%);
}

#translate-btn.is-locked:active .translate-btn__label {
  max-width: 220px;
  opacity: 1;
  transform: none;
}

#translate-btn.is-pressed,
#translate-btn:active {
  background: linear-gradient(180deg, #d2ecff 0%, #9ed3ff 100%);
  border-color: #78bdf5;
  box-shadow: 0 8px 18px rgba(56, 149, 228, 0.25);
  transform: translateY(1px);
}

#translate-btn .translate-btn__icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18'/%3E%3Cpath d='M12 3c2.6 2.45 4 5.7 4 9s-1.4 6.55-4 9c-2.6-2.45-4-5.7-4-9s1.4-6.55 4-9Z'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 22px 22px;
  display: block;
  height: 22px;
  left: 14px;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: left 240ms cubic-bezier(0.21, 0.72, 0.24, 1), transform 240ms cubic-bezier(0.21, 0.72, 0.24, 1);
  width: 22px;
  z-index: 3;
}

#translate-btn .translate-btn__label {
  display: inline-block;
  margin-left: 30px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 180ms ease, transform 220ms ease, max-width 220ms ease;
  white-space: nowrap;
}

#translate-btn .translate-btn__ripple {
  border: 2px solid rgba(85, 174, 249, 0.58);
  border-radius: 999px;
  height: 22px;
  left: 25px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  width: 22px;
  z-index: 1;
}

#translate-btn.is-pressed,
#translate-btn:active {
  animation: translate-btn-hold-pulse 0.95s ease-in-out infinite alternate;
}

#translate-btn.is-pressed .translate-btn__icon,
#translate-btn:active .translate-btn__icon {
  left: 50%;
  transform: translate(-50%, -50%) scale(1.08);
}

#translate-btn.is-pressed .translate-btn__label,
#translate-btn:active .translate-btn__label {
  max-width: 0;
  opacity: 0;
  transform: translateX(10px) scaleX(0.82);
}

#translate-btn.is-pressed .translate-btn__ripple,
#translate-btn:active .translate-btn__ripple {
  animation: translate-btn-wave 1.18s cubic-bezier(0.18, 0.72, 0.22, 1) infinite;
  left: 50%;
}

#translate-btn.is-pressed .translate-btn__ripple--two,
#translate-btn:active .translate-btn__ripple--two {
  animation-delay: 0.38s;
}

@keyframes translate-btn-hold-pulse {
  0% {
    box-shadow: 0 8px 18px rgba(56, 149, 228, 0.2), 0 0 0 0 rgba(85, 174, 249, 0.15);
  }

  100% {
    box-shadow: 0 12px 22px rgba(56, 149, 228, 0.32), 0 0 0 6px rgba(85, 174, 249, 0);
  }
}

@keyframes translate-btn-wave {
  0% {
    opacity: 0.64;
    transform: translate(-50%, -50%) scale(0.7);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(3.4);
  }
}

#theory-btn::before {
  content: "";
  display: block;
  flex: 0 0 auto;
  height: 22px;
  min-width: 22px;
  width: 22px;
}

#theory-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Crect x='2.25' y='2.25' width='6.5' height='15.5' rx='1.75' stroke='%23000000' stroke-width='1.5'/%3E%3Crect x='8.5' y='2.25' width='9.25' height='15.5' rx='1.75' stroke='%23000000' stroke-width='1.5'/%3E%3Cline x1='8.5' y1='3.5' x2='8.5' y2='16.5' stroke='%23000000' stroke-width='1.5'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 22px 22px;
  transform: translateY(0.5px);
}

#progress-bar-container {
  background: #f5f3f1;
  border-radius: 999px;
  height: 4px;
  margin: 20px 0;
  overflow: hidden;
}

#progress-bar {
  background: #48b525;
  height: 100%;
  transition: width 0.25s ease;
  width: 0%;
}

.tests-init__content {
  display: flex;
  gap: 24px;
}

.tests-init__media-column {
  flex: 0 0 48%;
  max-width: 612px;
}

#question-image {
  aspect-ratio: 612 / 343;
  background: #f5f3f1;
  border: 1px solid #dedede;
  border-radius: 12px;
  display: none;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  width: 100%;
}

#answer-hint-slot:empty {
  display: none;
}

.answer-hint {
  border: 1px solid #dedede;
  border-radius: 12px;
  color: #1f1f1f;
  display: none;
  font-family: "Inter", "Poppins", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
  margin-top: 16px;
  padding: 16px;
}

.answer-hint.visible {
  display: block;
  animation: answer-hint-reveal 240ms ease-out both;
}

.answer-hint.visible.correct {
  background: rgba(72, 181, 37, 0.12);
  border-color: #48b525;
  color: #1f6d0d;
}

.answer-hint.visible.incorrect {
  background: rgba(250, 94, 47, 0.12);
  border-color: #fa5e2f;
  color: #8a371f;
}

#explanation-container {
  background: #f5f3f1;
  border: 1px solid #dedede;
  border-radius: 12px;
  color: #1f1f1f;
  margin-top: 16px;
  padding: 16px;
}

#explanation-container h4 {
  color: #000;
  font-family: "Inter", "Poppins", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 16px;
  margin: 0 0 8px;
}

#explanation-content {
  font-family: "Inter", "Poppins", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
}

.tests-init__answers-column {
  flex: 1;
  min-width: 0;
}

.tests-init__answers-title {
  color: #000;
  font-family: "Inter", "Poppins", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 16px;
  margin: 0 0 12px;
}

#answers-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.answer-option {
  align-items: center;
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 12px;
  box-sizing: border-box;
  cursor: pointer;
  column-gap: 20px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  min-height: 84px;
  padding: 18px 20px;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
  will-change: transform;
  width: 100%;
}

.answer-option:hover {
  background: rgba(245, 243, 241, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(20, 26, 45, 0.05);
}

.answer-number {
  align-self: center;
  align-items: center;
  background: #f5f3f1;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #000;
  display: inline-flex;
  flex: 0 0 40px;
  font-size: 14px;
  height: 40px;
  justify-content: center;
  line-height: 24px;
  width: 40px;
}

.answer-text {
  color: #000;
  display: block;
  font-family: "Inter", "Poppins", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 17px;
  margin: 0;
}

.answer-option.selected {
  background: rgba(60, 135, 255, 0.08);
  border-color: #3c87ff;
}

.answer-option.correct {
  background: rgba(72, 181, 37, 0.08);
  border-color: #48b525;
}

.answer-option.correct .answer-number {
  background: #48b525;
  color: #fff;
}

.answer-option.answer-option--feedback {
  animation: answer-option-press 220ms cubic-bezier(0.2, 0.85, 0.24, 1) both;
}

.answer-option.answer-option--feedback-correct {
  box-shadow: 0 0 0 2px rgba(72, 181, 37, 0.18), 0 10px 24px rgba(72, 181, 37, 0.12);
}

.answer-option.answer-option--feedback-incorrect {
  box-shadow: 0 0 0 2px rgba(250, 94, 47, 0.16), 0 10px 24px rgba(250, 94, 47, 0.1);
}

.answer-option.answer-option--reveal-correct {
  animation: answer-option-reveal-correct 260ms ease-out both;
}

.answer-option.incorrect {
  background: rgba(250, 94, 47, 0.08);
  border-color: #fa5e2f;
}

.answer-option.incorrect .answer-number {
  background: #fa5e2f;
  color: #fff;
}

.answer-number.correct-mark {
  background: #48b525;
  border-color: #48b525;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  animation: answer-number-check-in 220ms cubic-bezier(0.18, 0.8, 0.24, 1);
}

#navigation-buttons {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.tests-init__nav-btn,
#prev-btn,
#next-btn,
#finish-btn {
  align-items: center;
  border-radius: 12px;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 500;
  justify-content: center;
  line-height: 16px;
  min-height: 44px;
  padding: 12px 16px;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.14s ease;
  width: 200px;
}

.tests-init__nav-btn:active {
  transform: translateY(1px);
}

.tests-init__nav-btn--secondary {
  background: #fff;
  border: 1px solid #dedede;
  color: #1f1f1f;
}

.tests-init__nav-btn--neutral {
  background: #f5f3f1;
  border: 1px solid #dedede;
  color: #2b2f36;
}

.tests-init__nav-btn--primary {
  background: #3559b8;
  border: 1px solid #3559b8;
  box-shadow: 0 10px 22px rgba(53, 89, 184, 0.22);
  color: #fff;
}

.tests-init__nav-btn--primary:hover {
  background: #2f4fa6;
  border-color: #2f4fa6;
}

#prev-btn,
#next-btn {
  gap: 8px;
}

#prev-btn::before,
#next-btn::after {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

#prev-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 5.5 8 12l6.5 6.5'/%3E%3Cline x1='8.5' y1='12' x2='20' y2='12'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
}

#next-btn::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 5.5 16 12l-6.5 6.5'/%3E%3Cline x1='4' y1='12' x2='15.5' y2='12'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
}

#next-btn.tests-init__nav-btn--primary::after {
  filter: invert(1);
}

#next-btn.tests-init__nav-btn--finish::after {
  display: none;
}

#next-btn {
  margin-left: auto;
}

#finish-btn {
  display: none !important;
}

.tests-init__nav-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

#loading-state {
  box-sizing: border-box;
  color: #000;
  margin: 24px auto;
  max-width: 1320px;
  padding: 0 12px 24px;
  width: 100%;
}

.tests-init-skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tests-init-skeleton [data-bone] {
  animation: tests-init-skeleton-shimmer 1.35s linear infinite;
  background: linear-gradient(90deg, #ece9e7 22%, #f6f4f3 50%, #ece9e7 78%);
  background-size: 300% 100%;
  border-radius: 12px;
  display: block;
}

.tests-init-skeleton__question-strip {
  align-items: center;
  background: #fff;
  border-radius: 16px;
  display: flex;
  gap: 16px;
  padding: 16px 24px;
}

.tests-init-skeleton__chips {
  display: flex;
  flex: 1;
  gap: 20px;
  min-width: 0;
}

.tests-init-skeleton__chip {
  flex: 0 0 40px;
  height: 40px;
}

.tests-init-skeleton__icon {
  flex: 0 0 40px;
  height: 40px;
  width: 40px;
}

.tests-init-skeleton__card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
}

.tests-init-skeleton__header {
  align-items: flex-start;
  display: flex;
  gap: 24px;
}

.tests-init-skeleton__title-block {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
}

.tests-init-skeleton__line {
  height: 18px;
}

.tests-init-skeleton__line--lg {
  max-width: 740px;
  width: 82%;
}

.tests-init-skeleton__line--md {
  max-width: 460px;
  width: 45%;
}

.tests-init-skeleton__header-actions {
  display: flex;
  gap: 10px;
}

.tests-init-skeleton__action {
  height: 44px;
  width: 132px;
}

.tests-init-skeleton__action--icon {
  width: 40px;
}

.tests-init-skeleton__divider {
  height: 2px;
  margin: 20px 0;
  width: 100%;
}

.tests-init-skeleton__content {
  display: flex;
  gap: 24px;
}

.tests-init-skeleton__image {
  aspect-ratio: 612 / 343;
  flex: 0 0 48%;
  max-width: 612px;
  width: 100%;
}

.tests-init-skeleton__answers-column {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
}

.tests-init-skeleton__answer {
  height: 84px;
  width: 100%;
}

.tests-init-skeleton__nav-row {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.tests-init-skeleton__nav-btn {
  height: 44px;
  width: 200px;
}

.tests-init-skeleton__nav-row .tests-init-skeleton__nav-btn:last-child {
  margin-left: auto;
}

.tests-init-skeleton__sr {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

#error-state {
  box-sizing: border-box;
  color: #000;
  margin: 40px auto;
  max-width: 1320px;
  padding: 0 12px;
}

@keyframes tests-init-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

@keyframes answer-option-press {
  0% {
    transform: scale(0.994);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes answer-option-reveal-correct {
  0% {
    box-shadow: 0 0 0 0 rgba(72, 181, 37, 0);
    border-color: #dedede;
  }

  100% {
    box-shadow: 0 0 0 2px rgba(72, 181, 37, 0.14);
    border-color: rgba(72, 181, 37, 0.52);
  }
}

@keyframes answer-number-check-in {
  0% {
    transform: scale(0.82);
    opacity: 0.7;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes answer-hint-reveal {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

#error-state a {
  color: #000;
}

#test-view.correct-bg,
#test-view.incorrect-bg {
  background: transparent;
}

@media (max-width: 1200px) {
  #test-view {
    padding: 0 12px 16px;
  }

  #loading-state {
    padding: 0 12px 16px;
  }

  .tests-init__content {
    flex-direction: column;
  }

  .tests-init-skeleton__content {
    flex-direction: column;
  }

  .tests-init__media-column {
    flex: 1;
    max-width: none;
  }

  .tests-init-skeleton__image {
    flex: 1;
    max-width: none;
  }

  #question-image {
    max-height: 420px;
  }
}

@media (max-width: 900px) {
  .tests-init__question-strip,
  .tests-init__card {
    border-radius: 12px;
    padding: 16px;
  }

  .tests-init__question-batches {
    gap: 6px;
  }

  .question-batch-btn {
    height: 28px;
    padding: 0 10px;
  }

  #question-header {
    flex-wrap: wrap;
    gap: 14px;
  }

  .tests-init-skeleton__question-strip,
  .tests-init-skeleton__card {
    border-radius: 12px;
    padding: 16px;
  }

  .tests-init-skeleton__header {
    flex-wrap: wrap;
    gap: 14px;
  }

  .tests-init-skeleton__title-block {
    flex-basis: calc(100% - 54px);
  }

  .tests-init-skeleton__header-actions {
    width: 100%;
  }

  .tests-init-skeleton__action {
    width: 100%;
  }

  .tests-init__question-actions {
    width: 100%;
  }

  #theory-btn,
  #translate-btn {
    flex: 1;
  }

  #test-view.has-translate-btn {
    padding-bottom: calc(126px + env(safe-area-inset-bottom));
  }

  #translate-btn {
    align-items: center;
    background: rgba(132, 146, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 999px;
    bottom: calc(22px + env(safe-area-inset-bottom));
    box-shadow: 0 12px 34px rgba(47, 34, 173, 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    color: #10273e;
    display: inline-flex;
    font-size: 14px;
    gap: 8px;
    height: 62px;
    justify-content: flex-start;
    left: 50%;
    min-height: 62px;
    min-width: 164px;
    padding: 0 18px;
    position: fixed;
    transform: translateX(-50%);
    width: 164px;
    z-index: 50;
  }

  #translate-btn.is-locked,
  #translate-btn.is-locked:active,
  #translate-btn.is-locked.is-pressed {
    animation: none;
    background: rgba(245, 243, 241, 0.98);
    border: 1px solid #dedede;
    box-shadow: 0 10px 24px rgba(17, 17, 17, 0.18);
    color: #2b2f36;
    transform: translateX(-50%);
  }

  #translate-btn.is-locked::after,
  #translate-btn.is-locked:active::after,
  #translate-btn.is-locked.is-pressed::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(232, 232, 232, 0.5));
    border-color: rgba(255, 255, 255, 0.4);
    inset: 8px;
  }

  #translate-btn.is-locked .translate-btn__ripple {
    display: none;
  }

  #translate-btn.is-locked .translate-btn__label,
  #translate-btn.is-locked:active .translate-btn__label,
  #translate-btn.is-locked.is-pressed .translate-btn__label {
    max-width: 120px;
    opacity: 1;
    transform: none;
  }

  #translate-btn.is-locked .translate-btn__icon,
  #translate-btn.is-locked:active .translate-btn__icon,
  #translate-btn.is-locked.is-pressed .translate-btn__icon {
    left: 18px;
    transform: translateY(-50%);
  }

  #translate-btn .translate-btn__icon {
    background-size: 24px 24px;
    left: 18px;
    height: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
  }

  #translate-btn .translate-btn__label {
    margin-left: 34px;
  }

  #translate-btn .translate-btn__ripple {
    border-color: rgba(166, 225, 255, 0.76);
    height: 24px;
    left: 30px;
    width: 24px;
  }

  #translate-btn::after {
    background: linear-gradient(180deg, rgba(173, 185, 255, 0.44), rgba(126, 136, 255, 0.5));
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    content: "";
    inset: 8px;
    position: absolute;
    z-index: -1;
  }

  #translate-btn.is-pressed,
  #translate-btn:active {
    animation: translate-btn-hold-pulse 0.95s ease-in-out infinite alternate;
    background: rgba(109, 189, 255, 0.42);
    border-color: rgba(219, 243, 255, 0.86);
    box-shadow: 0 8px 20px rgba(45, 151, 234, 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.28);
    transform: translateX(-50%) scale(0.97);
  }

  #translate-btn.is-pressed .translate-btn__icon,
  #translate-btn:active .translate-btn__icon {
    left: 50%;
    transform: translate(-50%, -50%) scale(1.1);
  }

  #translate-btn.is-pressed .translate-btn__label,
  #translate-btn:active .translate-btn__label {
    max-width: 0;
    opacity: 0;
    transform: translateX(10px) scaleX(0.8);
  }

  #translate-btn.is-pressed .translate-btn__ripple,
  #translate-btn:active .translate-btn__ripple {
    animation: translate-btn-wave 1.18s cubic-bezier(0.18, 0.72, 0.22, 1) infinite;
    left: 50%;
  }

  #translate-btn.is-pressed .translate-btn__ripple--two,
  #translate-btn:active .translate-btn__ripple--two {
    animation-delay: 0.38s;
  }

  #translate-btn.is-pressed::after,
  #translate-btn:active::after {
    inset: 10px;
  }

  #navigation-buttons {
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e4e6eb;
    border-radius: 14px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-top: 16px;
    padding: 8px;
    position: sticky;
    z-index: 45;
  }

  #test-view.has-translate-btn #navigation-buttons {
    bottom: calc(102px + env(safe-area-inset-bottom));
  }

  .tests-init-skeleton__nav-row {
    flex-wrap: wrap;
  }

  #prev-btn,
  #next-btn {
    width: 100%;
  }

  .tests-init-skeleton__nav-btn {
    width: 100%;
  }

  #next-btn {
    margin-left: 0;
  }

  .tests-init-skeleton__nav-row .tests-init-skeleton__nav-btn:last-child {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  #question-text {
    font-size: 18px;
    line-height: 22px;
    /* Keep two-line height on small screens as well */
    min-height: 44px;
  }

  .answer-option {
    column-gap: 12px;
    grid-template-columns: 40px minmax(0, 1fr);
    min-height: auto;
    padding: 14px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .answer-option,
  .answer-option:hover,
  .answer-option.answer-option--feedback,
  .answer-option.answer-option--reveal-correct,
  .answer-number.correct-mark,
  .answer-hint.visible {
    animation: none !important;
    box-shadow: none !important;
    transform: none !important;
    transition: border-color 0.01ms linear, background-color 0.01ms linear !important;
  }
}


