@import url('https://fonts.googleapis.com/css2?family=Onest:wght@100..900&display=swap');

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'JetBrains Mono';
    src: url('/fonts/JetBrainsMono-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

:root {
    --question-bg: #f6f7f8;
    --question-surface: #ffffff;
    --question-surface-soft: #f7f8fa;
    --question-text: #2d3035;
    --question-muted: #707884;
    --question-line: #e5e8ec;
    --question-line-strong: #d8dde4;
    --question-blue: #3b82f6;
    --question-blue-dark: #2563eb;
    --question-code: #f3f4f6;
    --question-danger: #dc2626;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.question-page {
    font-family: 'Onest', Arial, sans-serif;
    background: var(--question-bg);
    color: var(--question-text);
    overflow: hidden;
}

button,
textarea,
a {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

.question-workspace {
    width: min(100%, 98rem);
    height: 100dvh;
    margin: 0 auto;
    padding: 4.75rem 1.5rem 1.25rem;

    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(24rem, 0.9fr);
    gap: 1rem;

    background: var(--question-bg);
}

.question-panel {
    min-width: 0;
    min-height: 0;
    overflow: hidden;

    display: flex;
    flex-direction: column;

    background: var(--question-surface);
    border: 1px solid var(--question-line);
    border-radius: 14px;
}

.question-panel__header {
    flex: 0 0 auto;
    padding: 1.35rem 1.5rem 1.15rem;
    border-bottom: 1px solid var(--question-line);
}

.assistant-header {
    flex: 0 0 auto;
    padding: 1.25rem 1.35rem 0.72rem;
    border-bottom: 1px solid var(--question-line);
}

.question-prompt-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-prompt-heading {
    min-width: 0;
}


.question-name,
.assistant-header h2 {
    margin: 0;
    color: var(--question-text);
    font-weight: 550;
    letter-spacing: -0.02em;
}

.question-name {
    font-size: clamp(1.25rem, 1.6vw, 1.6rem);
    line-height: 1.25;
}

.question-number {
    color: var(--question-muted);
    font-weight: 500;
}

.assistant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.assistant-header h2 {
    font-size: 1.28rem;
    line-height: 1.25;
}

.question-meta {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.question-meta__row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.question-meta__label {
    flex: 0 0 auto;
    color: var(--question-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.question-meta__chips {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.question-meta__chips::-webkit-scrollbar {
    display: none;
}

.meta-tag {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;

    padding: 0.31rem 0.62rem;
    border-radius: 999px;
    background: var(--question-surface-soft);

    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.meta-tag span {
    color: inherit;
}

.chip__icon {
    width: 0.9rem;
    height: 0.9rem;
    display: block;
    object-fit: contain;
    flex: 0 0 auto;
}

.question-panel__scroll,
.solution-scroll,
.mentor-conversation {
    scrollbar-width: thin;
    scrollbar-color: #cfd4db transparent;
}

.question-panel__scroll::-webkit-scrollbar,
.solution-scroll::-webkit-scrollbar,
.mentor-conversation::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.question-panel__scroll::-webkit-scrollbar-thumb,
.solution-scroll::-webkit-scrollbar-thumb,
.mentor-conversation::-webkit-scrollbar-thumb {
    background: #cfd4db;
    border-radius: 999px;
}

.question-prompt-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 1.35rem 1.5rem 1.5rem;
}

.question-section-title {
    margin-bottom: 0.9rem;
    color: var(--question-text);
    font-size: 0.93rem;
    font-weight: 600;
}

.question-text,
.answer-text {
    color: var(--question-text);
    font-size: 1rem;
    font-weight: 450;
    line-height: 1.62;
}

.question-text > :first-child,
.answer-text > :first-child {
    margin-top: 0;
}

.question-text > :last-child,
.answer-text > :last-child {
    margin-bottom: 0;
}

.question-text h2 {
    /* Prompt subsections are H2 semantically; preserve the previous H3 rendering. */
    margin-block-start: 1em;
    margin-block-end: 1em;
    font-size: 1.17em;
    font-weight: bold;
}

.question-text p,
.answer-text p {
    margin: 0 0 1rem;
    color: inherit;
}

.question-text ul,
.question-text ol,
.answer-text ul,
.answer-text ol {
    margin: 0 0 1rem;
    padding-left: 1.35rem;
}

.question-text li,
.answer-text li {
    margin-bottom: 0.5rem;
    color: inherit;
}

.question-text :not(pre) > code,
.answer-text :not(pre) > code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    padding: 0.1rem 0.32rem;
    border-radius: 6px;
    background: var(--question-code);
}

.question-panel__footer {
    flex: 0 0 auto;
}

.question-actions {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;

    padding: 0.9rem 1.15rem;
    border-top: 1px solid var(--question-line);
}

.nav-btn,
.progress-toggle {
    min-height: 2.55rem;
    border: 1px solid var(--question-line);
    border-radius: 10px;
    background: var(--question-surface);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;

    padding: 0.58rem 0.82rem;
    color: var(--question-text);
    text-decoration: none;
    cursor: pointer;
    user-select: none;

    transition: border-color 160ms ease, background-color 160ms ease;
}

.nav-btn:hover,
.progress-toggle:hover:not(:disabled) {
    background: var(--question-surface-soft);
    border-color: var(--question-line-strong);
}

.nav-btn__text,
.progress-toggle__text {
    white-space: nowrap;
    color: inherit;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-btn--prev {
    justify-self: start;
}

.nav-btn--next {
    justify-self: end;
}

.progress-toggle {
    justify-self: center;
}

.question-action-spacer:first-of-type {
    grid-column: 1;
}

.question-action-spacer:last-of-type {
    grid-column: 3;
}

.progress-toggle__state {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.progress-toggle__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
}

.progress-toggle__check {
    display: none;
    width: 15px;
    height: 15px;
    object-fit: contain;
}

.progress-toggle.is-completed .progress-toggle__dot {
    display: none;
}

.progress-toggle.is-completed .progress-toggle__check {
    display: block;
}

.complete-hint {
    position: absolute;
    left: 1.15rem;
    right: 1.15rem;
    bottom: 0.12rem;
    color: var(--question-danger);
    font-size: 0.72rem;
    text-align: center;
    pointer-events: none;
}

.nav-btn__icon {
    flex: 0 0 auto;
    color: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
}

.nav-btn--next.is-arrow-anim .nav-btn__icon {
    transform: translateX(8px);
    opacity: 0;
}

.nav-btn--prev.is-arrow-anim .nav-btn__icon {
    transform: translateX(-8px);
    opacity: 0;
}

.nav-btn.is-arrow-anim {
    pointer-events: none;
}

.question-mode-switch {
    flex: 0 0 auto;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem;

    padding: 0.2rem;
    border: 1px solid var(--question-line);
    border-radius: 10px;
    background: var(--question-surface-soft);
}

.question-mode-switch__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    min-width: 6.4rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    padding: 0.45rem 0.65rem;

    color: var(--question-muted);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.question-mode-switch__button.is-active {
    background: var(--question-surface);
    color: var(--question-text);
    box-shadow: 0 1px 3px rgba(31, 41, 55, 0.08);
}



.question-mode-switch__button::before {
    content: "";
    width: 1.28rem;
    height: 1.28rem;
    flex: 0 0 1.28rem;
    background-color: currentColor;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.question-mode-switch__button[data-question-mode="mentor"]::before {
    -webkit-mask-image: url('/images/icons/mentor-robot.svg');
    mask-image: url('/images/icons/mentor-robot.svg');
    transform: translateY(-1px);
}

.question-mode-switch__button[data-question-mode="solution"]::before {
    -webkit-mask-image: url('/images/icons/solution-document-check.svg');
    mask-image: url('/images/icons/solution-document-check.svg');
}

.question-mode-switch__button:focus-visible,
.nav-btn:focus-visible,
.progress-toggle:focus-visible,
.mentor-send-button:focus-visible,
.mentor-secondary-button:focus-visible,
.mentor-access-button:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.45);
    outline-offset: 2px;
}

.question-mode-panel {
    flex: 1 1 auto;
    min-height: 0;
}

.question-mode-panel[hidden] {
    display: none !important;
}

.question-mode-panel--mentor {
    display: flex;
    flex-direction: column;
}



.mentor-quick-actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.85rem 1.35rem 0;
}

.mentor-conversation {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 1.25rem 1.35rem;

    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.mentor-message {
    width: min(88%, 39rem);
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
}

.mentor-message--assistant {
    align-self: flex-start;
    background: var(--question-surface-soft);
    border: 1px solid var(--question-line);
}

.mentor-message--user {
    align-self: flex-end;
    background: #edf5ff;
    border: 1px solid #dbeafe;
}

.mentor-message__author {
    margin-bottom: 0.28rem;
    color: var(--question-muted);
    font-size: 0.73rem;
    font-weight: 600;
}

.mentor-message__content {
    color: var(--question-text);
    font-size: 0.91rem;
    font-weight: 450;
    line-height: 1.52;
    overflow-wrap: anywhere;
}

.mentor-message__content p {
    margin: 0 0 0.65rem;
    color: inherit;
}

.mentor-message__content p:last-child {
    margin-bottom: 0;
}

.mentor-message__content ul,
.mentor-message__content ol {
    margin: 0.45rem 0 0.65rem;
    padding-left: 1.3rem;
}

.mentor-message__content li {
    margin: 0.22rem 0;
    color: inherit;
}

.mentor-message__content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.84em;
}

.mentor-message__content :not(pre) > code {
    padding: 0.08rem 0.28rem;
    border-radius: 5px;
    background: rgba(127, 127, 127, 0.11);
}

.mentor-message__content pre {
    max-width: 100%;
    margin: 0.55rem 0 0.7rem;
    padding: 0.75rem 0.85rem;
    overflow-x: auto;

    border: 1px solid var(--question-line);
    border-radius: 9px;
    background: var(--question-code);

    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.48;
    white-space: pre;
}

.mentor-typing {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-width: 2.4rem;
}

.mentor-typing span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9ca3af;
    animation: mentor-dot 1.1s infinite ease-in-out;
}

.mentor-typing span:nth-child(2) {
    animation-delay: 0.14s;
}

.mentor-typing span:nth-child(3) {
    animation-delay: 0.28s;
}

@keyframes mentor-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-3px); opacity: 1; }
}

.mentor-composer {
    flex: 0 0 auto;
    padding: 0.9rem 1.15rem 1rem;
    border-top: 1px solid var(--question-line);
    background: var(--question-surface);
}

.mentor-composer textarea {
    width: 100%;
    min-height: 5.3rem;
    max-height: 9rem;
    resize: none;

    border: 1px solid var(--question-line-strong);
    border-radius: 11px;
    background: var(--question-surface);
    padding: 0.78rem 0.9rem;

    color: var(--question-text);
    caret-color: auto;
    font-size: 0.9rem;
    font-weight: 450;
    line-height: 1.45;

    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.mentor-composer textarea::placeholder {
    color: #9aa1ab;
}

.mentor-composer textarea:focus {
    border-color: #a9c7fb;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.mentor-composer__bottom {
    min-height: 2.45rem;
    margin-top: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.mentor-status {
    min-width: 0;
    color: var(--question-muted);
    font-size: 0.76rem;
    line-height: 1.25;
}

.mentor-status.is-error {
    color: var(--question-danger);
}

.mentor-send-button,
.mentor-secondary-button,
.mentor-access-button {
    min-height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;

    border-radius: 9px;
    padding: 0.55rem 0.85rem;

    font-size: 0.84rem;
    font-weight: 550;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.mentor-send-button {
    border: 1px solid #3b82f6;
    background: #3b82f6;
    color: #ffffff;
}

.mentor-send-button:hover:not(:disabled) {
    background: #2563eb;
}

.mentor-secondary-button {
    border: 1px solid var(--question-line);
    background: var(--question-surface);
    color: var(--question-text);
}

.mentor-secondary-button:hover:not(:disabled) {
    background: var(--question-surface-soft);
}

.mentor-send-button:disabled,
.mentor-secondary-button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.mentor-access-card {
    margin: auto 1.35rem 1.35rem;
    padding: 1rem;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    border: 1px solid var(--question-line);
    border-radius: 12px;
    background: var(--question-surface-soft);
}

.mentor-access-card strong,
.mentor-access-card span {
    display: block;
}

.mentor-access-card strong {
    margin-bottom: 0.18rem;
    color: var(--question-text);
    font-size: 0.88rem;
    font-weight: 600;
}

.mentor-access-card span {
    color: var(--question-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.mentor-access-button {
    flex: 0 0 auto;
    border: 1px solid #3b82f6;
    background: #3b82f6;
    color: #ffffff;
}

.mentor-access-button:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.mentor-access-button img {
    width: 0.9rem;
    height: 0.9rem;
}

.question-mode-panel--solution {
    display: flex;
    flex-direction: column;
}

.solution-scroll {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 1.35rem 1.5rem 1.6rem;
}

.question-solution-locked {
    position: relative;
    min-height: 100%;
}

.question-solution-preview {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    opacity: 0.43;
    filter: blur(1.2px);
    pointer-events: none;
    user-select: none;
}

.question-solution-preview__lines,
.question-solution-preview__code {
    display: flex;
    flex-direction: column;
    gap: 0.58rem;
}

.question-solution-preview__lines span {
    height: 0.62rem;
    border-radius: 999px;
    background: #dfe3e8;
}

.question-solution-preview__lines span:nth-child(1) { width: 96%; }
.question-solution-preview__lines span:nth-child(2) { width: 86%; }
.question-solution-preview__lines span:nth-child(3) { width: 91%; }
.question-solution-preview__lines span:nth-child(4) { width: 72%; }
.question-solution-preview__lines span:nth-child(5) { width: 82%; }
.question-solution-preview__lines--short span:nth-child(1) { width: 88%; }
.question-solution-preview__lines--short span:nth-child(2) { width: 77%; }
.question-solution-preview__lines--short span:nth-child(3) { width: 61%; }

.question-solution-preview__code {
    padding: 0.9rem;
    border-radius: 10px;
    background: var(--question-code);
}

.question-solution-preview__code span {
    height: 0.55rem;
    border-radius: 999px;
    background: #cfd5dc;
}

.question-solution-preview__code span:nth-child(1) { width: 54%; }
.question-solution-preview__code span:nth-child(2) { width: 79%; margin-left: 7%; }
.question-solution-preview__code span:nth-child(3) { width: 68%; margin-left: 7%; }
.question-solution-preview__code span:nth-child(4) { width: 44%; margin-left: 7%; }
.question-solution-preview__code span:nth-child(5) { width: 31%; }

.question-solution-lock-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    width: min(88%, 27.5rem);
    box-sizing: border-box;
    padding: 1.25rem;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;

    border: 1px solid var(--question-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 30px rgba(31, 41, 55, 0.08);
}

.question-solution-lock-card__title {
    display: flex;
    align-items: center;
    gap: 5px;
}

.question-solution-lock-card__title strong {
    color: var(--question-text);
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
}

.question-solution-lock-card__title img {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.question-solution-lock-card__description {
    margin: 0.55rem 0 0;
    color: var(--question-muted);
    font-size: 14px;
    line-height: 1.5;
}

.question-solution-lock-card__benefits {
    margin: 0.75rem 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
    list-style: none;
}

.question-solution-lock-card__benefits li {
    position: relative;
    padding-left: 22px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}

.question-solution-lock-card__benefits li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #3b82f6;
    font-weight: 760;
    line-height: 1.45;
}

.question-solution-lock-card a {
    align-self: center;
    margin-top: 1rem;
    padding: 0.62rem 1rem;
    border-radius: 9px;
    background: #3b82f6;
    border: 1px solid #3b82f6;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.question-solution-lock-card a:hover {
    background: #2563eb;
    border-color: #2563eb;
}

body.dark-theme {
    --question-bg: #111827;
    --question-surface: #1f2937;
    --question-surface-soft: #182231;
    --question-text: #e5e7eb;
    --question-muted: #9ca3af;
    --question-line: #374151;
    --question-line-strong: #4b5563;
    --question-code: #111827;
}

body.dark-theme .question-workspace {
    background: var(--question-bg);
}

body.dark-theme .question-panel {
    background: var(--question-surface);
    border-color: var(--question-line);
}

body.dark-theme .meta-tag {
    background: #111827;
    color: #e5e7eb;
}

body.dark-theme .mentor-message--user {
    background: #172b49;
    border-color: #24436c;
}

body.dark-theme .mentor-send-button {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

body.dark-theme .mentor-send-button:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
}

body.dark-theme .mentor-access-button {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

body.dark-theme .mentor-access-button:hover {
    background: #2563eb;
    border-color: #2563eb;
}

body.dark-theme .question-solution-lock-card a {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

body.dark-theme .question-solution-lock-card a:hover {
    background: #2563eb;
    border-color: #2563eb;
}

body.dark-theme .question-solution-lock-card {
    background: rgba(31, 41, 55, 0.97);
    border-color: #374151;
}

body.dark-theme .question-solution-lock-card__benefits li {
    color: #d1d5db;
}

body.dark-theme .question-solution-preview__lines span,
body.dark-theme .question-solution-preview__code span {
    background: #4b5563;
}

body.dark-theme .question-panel__scroll,
body.dark-theme .solution-scroll,
body.dark-theme .mentor-conversation {
    scrollbar-color: #4b5563 transparent;
}

@media (max-width: 1120px) {
    .question-workspace {
        padding-left: 1rem;
        padding-right: 1rem;
        gap: 0.8rem;
    }

    .question-panel__header,
    .assistant-header {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }

    .assistant-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.8rem;
    }

    .question-mode-switch {
        width: 100%;
    }

    .question-mode-switch__button {
        min-width: 0;
    }
}

@media (max-width: 820px) {
    body.question-page {
        overflow: auto;
    }

    .question-workspace {
        height: auto;
        min-height: 100dvh;
        grid-template-columns: 1fr;
        padding: 4.5rem 0.75rem 1rem;
    }

    .question-panel {
        min-height: min(42rem, calc(100dvh - 5.5rem));
    }

    .question-panel--assistant {
        min-height: min(46rem, calc(100dvh - 5.5rem));
    }

    .assistant-header {
        flex-direction: row;
        align-items: center;
    }

    .question-mode-switch {
        width: auto;
    }

    .question-mode-switch__button {
        min-width: 5.6rem;
    }
}

@media (max-width: 560px) {
    .question-workspace {
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 0;
        gap: 0.65rem;
    }

    .question-panel {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    .question-panel__header,
    .assistant-header,
    .question-prompt-scroll,
    .solution-scroll {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .assistant-header {
        align-items: stretch;
        flex-direction: column;
    }

    .question-mode-switch {
        width: 100%;
    }

    .question-meta__row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .question-meta__chips {
        width: 100%;
    }

    .question-actions {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .nav-btn,
    .progress-toggle {
        min-height: 2.35rem;
        padding: 0.5rem 0.62rem;
    }

    .nav-btn__text,
    .progress-toggle__text {
        font-size: 0.8rem;
    }

    .mentor-conversation {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .mentor-composer {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .mentor-composer__bottom {
        align-items: stretch;
        flex-direction: column;
    }

    .mentor-secondary-button {
        flex: 1 1 0;
    }

    .mentor-send-button {
        width: 100%;
    }

    .mentor-access-card {
        margin-left: 1rem;
        margin-right: 1rem;
        align-items: stretch;
        flex-direction: column;
    }

    .mentor-access-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-btn__icon,
    .mentor-typing span {
        animation: none !important;
        transition: none !important;
    }
}

.mentor-inline-link {
    color: var(--question-blue);
    font-weight: 550;
    text-decoration: none;
}

.mentor-inline-link:hover {
    color: var(--question-blue-dark);
    text-decoration: underline;
}

/* =========================================================
   QUESTION — STABLE ACTION COLUMNS + PAGE FOOTER
   2026-10-05
   ========================================================= */

/* Keep the first screen at 100dvh, but allow the regular site footer to be
   reached below it. Inner panel scrolling remains unchanged. */
body.question-page {
    overflow-x: hidden;
    overflow-y: auto;
}

/* Explicit columns keep two-button states aligned exactly like three-button
   states (e.g. Completed + Next on the first question). */
.question-actions > .nav-btn--prev {
    grid-column: 1;
}

.question-actions > .progress-toggle {
    grid-column: 2;
}

.question-actions > .nav-btn--next {
    grid-column: 3;
}

.question-actions > .question-action-spacer {
    display: none;
}

/* ===== Question mentor composer: icon send button inside input ===== */
.mentor-composer {
    padding: 0.9rem 1.15rem 1rem;
}

.mentor-composer__field {
    position: relative;
    border: 1px solid var(--question-line-strong);
    border-radius: 12px;
    background: var(--question-surface);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.mentor-composer__field:focus-within {
    border-color: #a9c7fb;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.mentor-composer textarea {
    display: block;
    width: 100%;
    min-height: 5.3rem;
    max-height: 10rem;
    resize: none;
    overflow-y: hidden;
    border: 0;
    border-radius: 12px;
    background: transparent;
    padding: 0.78rem 4rem 0.84rem 0.9rem;
    box-shadow: none;
}

.mentor-composer textarea:focus {
    border-color: transparent;
    box-shadow: none;
}

.mentor-status {
    display: block;
    margin-top: 0.55rem;
    min-height: 1rem;
}

.mentor-send-button {
    position: absolute;
    right: 0.7rem;
    bottom: 0.65rem;
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #3b82f6;
    background: #3b82f6;
    color: #ffffff;
}

.mentor-send-button:hover:not(:disabled) {
    background: #2563eb;
}

.mentor-send-button:disabled {
    opacity: 1;
    cursor: default;
}

.mentor-send-button svg {
    width: 18px;
    height: 18px;
    display: block;
}

body.dark-theme .mentor-composer__field {
    background: var(--question-surface);
}


/* ===== Mentor composer alignment correction: text above send button ===== */
.mentor-composer__field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.mentor-composer textarea {
    padding-right: 0.88rem;
    padding-bottom: 0.55rem;
}

.mentor-send-button {
    position: static;
    flex: 0 0 auto;
    align-self: flex-end;
    width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0.1rem 0.55rem 0.55rem 0;
}

.mentor-send-button svg {
    width: 18px;
    height: 18px;
}


/* ===== Mentor composer focus correction: one unified focus ring ===== */
.mentor-composer textarea:focus,
.mentor-composer textarea:focus-visible {
    outline: none !important;
    outline-offset: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* ===== Question mentor composer spacing correction ===== */
.mentor-composer {
    padding: 1.15rem;
}

.mentor-status:empty {
    display: none;
}

.mentor-status:not(:empty) {
    display: block;
    margin-top: 0.55rem;
    min-height: 0;
}

/* ===== Question mentor composer controls row ===== */
.mentor-composer textarea {
    padding-bottom: 0.45rem;
}

.mentor-composer__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0 0.55rem 0.55rem;
}

.mentor-composer__controls .mentor-quick-actions {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
}

.mentor-composer__controls .mentor-secondary-button {
    min-height: 34px;
    height: 34px;
    padding: 0 0.58rem;
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1;
    white-space: nowrap;
}

.mentor-composer__controls .mentor-send-button {
    position: static;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
}

.mentor-send-button[data-state="loading"] {
    background: #9ca3af;
    border-color: #9ca3af;
    color: #ffffff;
    opacity: 1;
}

.mentor-send-button[data-state="loading"]:hover {
    background: #9ca3af;
    border-color: #9ca3af;
}

body.dark-theme .mentor-send-button[data-state="loading"] {
    background: #6b7280;
    border-color: #6b7280;
}

body.dark-theme .mentor-send-button[data-state="loading"]:hover {
    background: #6b7280;
    border-color: #6b7280;
}

/* =========================================================
   QUESTION WORKSPACE — UNIFIED SERVICE SPACING + TITLE ALIGNMENT
   ---------------------------------------------------------
   Reference gap: the existing distance between the bottom edge
   of the assistant panel and the bottom edge of the mentor composer
   field. Keep all matching workspace insets on the same rhythm.
   ========================================================= */
body.question-page {
    --question-workspace-gap: 1.15rem;
    --question-prompt-x: 2rem;
    --question-heading-row-height: 2.8rem;
}

/* Keep the prompt title/meta/content on a roomier 32px horizontal grid,
   while the assistant panel keeps its existing service spacing. */
body.question-page .question-panel__header {
    padding: var(--question-workspace-gap) var(--question-prompt-x);
}

body.question-page .assistant-header {
    padding: var(--question-workspace-gap);
}

body.question-page .question-prompt-header {
    /* The title is vertically centered inside the 2.8rem heading row.
       Its line box is 1.6rem tall, leaving 0.6rem below it.
       0.55rem + 0.6rem = the same 1.15rem reference gap from
       the title line to the top edge of the first company/theme chip. */
    gap: calc(var(--question-workspace-gap) - 0.6rem);
}

body.question-page .question-prompt-heading {
    min-height: var(--question-heading-row-height);
    display: flex;
    align-items: center;
}

body.question-page .question-name,
body.question-page .assistant-header h2 {
    margin: 0;
    color: var(--question-text);
    font-size: 1.28rem;
    font-weight: 550;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

/* #1 is part of the title, not secondary metadata. */
body.question-page .question-number {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

/* With the redundant “Условие” label removed, the question text starts
   exactly one reference gap below the header divider. The footer uses
   the same outer inset. */
body.question-page .question-prompt-scroll {
    padding: var(--question-workspace-gap) var(--question-prompt-x);
}

body.question-page .question-actions {
    padding: var(--question-workspace-gap) var(--question-prompt-x);
}

body.question-page .question-prompt-scroll > .question-text:first-child {
    margin-top: 0;
}

body.question-page .mentor-conversation,
body.question-page .mentor-composer,
body.question-page .solution-scroll {
    padding: var(--question-workspace-gap);
}

body.question-page .mentor-access-card {
    margin-right: var(--question-workspace-gap);
    margin-bottom: var(--question-workspace-gap);
    margin-left: var(--question-workspace-gap);
}

@media (max-width: 1120px) {
    body.question-page {
        --question-prompt-x: 1.5rem;
    }
}

@media (max-width: 560px) {
    body.question-page {
        --question-prompt-x: 1rem;
    }
}


/* =========================================================
   QUESTIONS — SOLUTION TYPOGRAPHY FOLLOWS MENTOR DIALOGUE
   /questions intentionally keeps its slightly larger page scale.
   ========================================================= */
body.question-page .mentor-message__content,
body.question-page .answer-text {
    font-size: 0.91rem;
    font-weight: 450;
    line-height: 1.52;
    overflow-wrap: anywhere;
}

body.question-page .mentor-message__content p,
body.question-page .answer-text p {
    margin: 0 0 0.65rem;
}

body.question-page .mentor-message__content p:last-child,
body.question-page .answer-text p:last-child {
    margin-bottom: 0;
}

body.question-page .mentor-message__content ul,
body.question-page .mentor-message__content ol,
body.question-page .answer-text ul,
body.question-page .answer-text ol {
    margin: 0.45rem 0 0.65rem;
    padding-left: 1.3rem;
}

body.question-page .mentor-message__content li,
body.question-page .answer-text li {
    margin: 0.22rem 0;
}

body.question-page .mentor-message__content :not(pre) > code,
body.question-page .answer-text :not(pre) > code {
    padding: 0.08rem 0.28rem;
    border-radius: 5px;
    background: rgba(127, 127, 127, 0.11);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.84em;
}

body.question-page .mentor-message__content pre,
body.question-page .answer-text pre {
    max-width: 100%;
    margin: 0.55rem 0 0.7rem;
    padding: 0.75rem 0.85rem;
    overflow-x: auto;
    border: 1px solid var(--question-line);
    border-radius: 9px;
    background: var(--question-code);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.48;
    white-space: pre;
}
