.empty-strip {
    min-height: 0;
    padding-block: 26px;
}

.empty-strip .coming-card {
    min-height: 76px;
    width: 100%;
    border: 2px dashed #d9e4e2;
    border-radius: 18px;
    background: #fff;
}

.answer-actions {
    padding-left: 230px;
    direction: ltr;
}

.rail-stage.locked {
    color: #8a969d;
    cursor: not-allowed;
}

@media (max-width: 760px) {
    .answer-actions {
        padding: 13px 14px 13px 104px;
    }
}

/* Modern catalog and compact, viewport-conscious question workspace. */
.learning-body,.learning-activity-body{background:#f7f5f1}.course-catalog{width:min(1200px,calc(100% - 40px))}.catalog-mark{background:#059669;box-shadow:0 12px 28px rgba(5,150,105,.2)}.grade-emblem{background:#0e1b35;color:#6ee7b7;box-shadow:0 8px 0 #dfe4df}.chapter-strip{gap:20px;padding:34px 24px 26px;border:1px solid #e5e5df;background:rgba(255,255,255,.55)}.chapter-card{min-height:285px;border:1px solid #e5e5df;border-radius:20px;box-shadow:0 7px 0 #e5e7e4}.chapter-illustration{height:135px}.chapter-illustration b{width:86px;height:86px;border-width:2px;border-radius:27px}.chapter-card-coming{position:relative;filter:saturate(.35);opacity:.62;cursor:not-allowed}.chapter-card-coming:hover{transform:none;border-color:#e0e4e1;box-shadow:0 7px 0 #e5e7e4}.coming-badge{position:absolute;top:14px;left:14px;z-index:3;padding:4px 9px;border-radius:999px;background:#eef1ef;color:#718078;font-size:.68rem;font-weight:900}.path-page{width:min(1200px,calc(100% - 40px));grid-template-columns:340px minmax(0,1fr);gap:38px;padding:42px 0 80px}.path-summary{padding:28px;border:1px solid #e5e5df;border-radius:22px;box-shadow:0 8px 0 #e5e7e4}.path-icon{width:82px;height:82px;margin:28px 0 20px;font-size:2.7rem}.stage-map>header{border-width:2px;border-radius:20px;box-shadow:0 6px 0 color-mix(in srgb,var(--chapter-accent) 35%,white)}

/* Brilliant-inspired shelves: heading outside, one compact snap-scrolling rail. */
.grade-shelf{margin-bottom:54px;opacity:0;transform:translateY(28px);transition:opacity .55s ease var(--reveal-delay,0ms),transform .65s cubic-bezier(.22,1,.36,1) var(--reveal-delay,0ms)}.grade-shelf.is-visible{opacity:1;transform:none}.grade-shelf>header{margin:0 10px 18px;padding:0;background:transparent}.chapter-carousel{position:relative;padding:12px;border:1px solid #e5e5df;border-radius:24px;background:rgba(255,255,255,.78);box-shadow:0 14px 38px rgba(14,27,53,.055)}.chapter-strip{display:flex!important;grid-template-columns:none!important;gap:14px;padding:14px 42px 20px;border:0;background:transparent;overflow-x:auto;overscroll-behavior-inline:contain;scroll-behavior:smooth;scroll-snap-type:inline mandatory;scroll-padding-inline:42px;scrollbar-width:none}.chapter-strip::-webkit-scrollbar{display:none}.chapter-card{width:218px;min-width:218px;min-height:224px;padding:12px 14px 15px;border-radius:17px;scroll-snap-align:start;scroll-snap-stop:always;box-shadow:0 5px 0 #e5e7e4}.chapter-illustration{height:102px}.chapter-illustration b{width:68px;height:68px;border-radius:20px;font-size:2.2rem}.chapter-card h3{margin:2px 0 10px;font-size:.94rem;line-height:1.55}.chapter-scroll{position:absolute;top:50%;z-index:4;display:grid;width:38px;height:38px;place-items:center;border:1px solid #cfe1dc;border-radius:50%;background:#fff;color:#047857;font:800 1.55rem/1 inherit;box-shadow:0 8px 20px rgba(14,27,53,.12);cursor:pointer;transform:translateY(-50%);transition:.18s}.chapter-scroll:hover{background:#ecfdf5;transform:translateY(-50%) scale(1.06)}.chapter-scroll:disabled{opacity:.25;cursor:default}.chapter-scroll-next{right:10px}.chapter-scroll-prev{left:10px}.catalog-score span{height:6px;margin-top:9px;overflow:hidden;border-radius:99px;background:#e6ebe8}.catalog-score span i{display:block;height:100%;border-radius:inherit;background:#059669}
@media(max-width:700px){.course-catalog{width:100%}.grade-shelf{margin:0 0 46px}.grade-shelf>header{margin:0 18px 16px}.chapter-carousel{margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important}.chapter-strip{gap:12px;padding:4px 18px 14px!important;border:0!important;border-radius:0!important;background:none!important;scroll-padding-inline:18px}.chapter-card{width:min(72vw,246px);min-width:min(72vw,246px);min-height:222px;padding:11px 13px 14px;border-radius:17px;box-shadow:0 4px 0 #e5e7e4}.chapter-illustration{height:94px}.chapter-illustration b{width:62px;height:62px;border-radius:18px;font-size:2rem}.chapter-card h3{margin-bottom:8px;font-size:.9rem}.chapter-scroll{display:none}}
@media(max-width:700px){.chapter-card{opacity:.72;transform:scale(.96);transition:opacity .24s ease,transform .24s ease,border-color .24s ease,box-shadow .24s ease}.chapter-card.is-active{opacity:1;transform:scale(1);border-color:var(--chapter-accent);box-shadow:0 5px 0 color-mix(in srgb,var(--chapter-accent) 30%,#e5e7e4),0 10px 24px rgba(14,27,53,.1)}.chapter-card-coming.is-active{opacity:.72;filter:saturate(.55)}.chapter-card-coming.is-active:hover{transform:scale(1)}}
.catalog-mark{overflow:hidden;background:#0e1b35}.catalog-mark img{display:block;width:74%;height:74%;object-fit:contain}
@media(max-width:700px){.chapter-strip{padding-inline:calc((100% - min(72vw,246px))/2)!important;scroll-padding-inline:calc((100% - min(72vw,246px))/2)}.chapter-card{scroll-snap-align:center}}
.question-tutor>summary>span:first-child{overflow:hidden;background:#0e1b35}.question-tutor>summary>span:first-child img{width:82%;height:82%;object-fit:contain}
@media(prefers-reduced-motion:reduce){.grade-shelf{opacity:1;transform:none;transition:none}}
.activity-shell{height:calc(100dvh - 66px);min-height:620px;grid-template:58px minmax(0,1fr)/240px minmax(0,1fr);overflow:hidden}.activity-top{height:58px;padding-inline:24px}.lesson-rail{min-height:0;padding:12px 14px;overflow-y:auto}.streak-card{padding:10px 12px}.streak-card span{font-size:1.8rem}.lesson-rail h2{margin:15px 8px 8px}.rail-stage{min-height:48px;padding:6px 9px;font-size:.82rem}.rail-stage i{width:32px;height:32px}.rail-stage:not(:last-of-type):after{right:25px;top:38px;height:23px}.xp-note{margin-top:18px;padding:12px}.question-card{min-height:0;margin:12px;padding:18px 24px;overflow-y:auto;border-color:#e5e5df;border-radius:20px;box-shadow:0 10px 30px rgba(14,27,53,.06)}.question-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.question-kind{padding:7px 12px;border-radius:999px;background:#ecfdf5;color:#047857;font-size:.72rem;font-weight:900}.question-context{padding:7px 12px;font-size:.72rem}.question-card h1{margin:8px 0 0}.question-prompt{margin:5px auto 10px;font-size:clamp(1.05rem,1.7vw,1.45rem);line-height:1.65}.professor{position:absolute;top:14px;left:24px;height:auto;opacity:.12;pointer-events:none}.professor>span{display:none}.professor-face{width:64px;height:64px;border-radius:22px;font-size:2.7rem;filter:none}.question-source-image{margin:7px auto 10px}.question-source-image img{max-height:190px;padding:6px;border-radius:13px}.choices{gap:7px}.choice{min-height:46px;padding:6px 13px;border-width:1px;border-radius:12px;font-size:.86rem}.choice i{width:23px;height:23px;border-width:2px}.choice:has(input:checked) i{border-width:6px}.written-answer{gap:6px;margin:10px 0}.written-answer textarea{min-height:88px;padding:11px 13px;border-width:1px;border-radius:12px;line-height:1.7}.answer-actions{margin-top:10px;padding-left:0}.hint-button,.check-button{min-height:45px;border-width:1px;border-radius:12px}.check-button{box-shadow:0 5px 0 color-mix(in srgb,var(--chapter-accent) 65%,#074)}.hint-text,.feedback{margin-top:10px;padding:11px 13px}.feedback h2{display:flex;align-items:center;justify-content:space-between;gap:10px}.ai-score{padding:4px 8px;border-radius:999px;background:#fff;color:#047857;font-size:.68rem}.ai-evaluation{padding:9px 11px;border-radius:10px;background:#fff}.reference-answer summary{cursor:pointer;font-weight:850}.reference-answer p{margin-top:7px}.question-tutor{margin-top:12px;padding-top:12px;border-top:1px solid #dfe7e2}.question-tutor header{display:flex;align-items:center;gap:9px}.question-tutor header>span{display:grid;width:32px;height:32px;place-items:center;border-radius:10px;background:#ecfdf5;color:#059669}.question-tutor header div{display:grid}.question-tutor header small{color:#758078}.question-tutor-messages{display:grid;gap:6px;max-height:150px;margin-top:9px;overflow-y:auto}.question-tutor-messages p{width:fit-content;max-width:88%;margin:0;padding:8px 10px;border-radius:11px;background:#fff;line-height:1.7}.question-tutor-messages .user{margin-right:auto;background:#059669;color:#fff}.question-tutor-messages .assistant{border:1px solid #e0e6e2}.question-tutor-messages .waiting{color:#7a867f}.question-tutor form{display:flex;gap:7px;margin-top:9px}.question-tutor input{min-width:0;min-height:41px;flex:1;padding:8px 11px;border:1px solid #dce3df;border-radius:11px;outline:0}.question-tutor input:focus{border-color:#059669;box-shadow:0 0 0 3px rgba(5,150,105,.1)}.question-tutor button{padding:7px 14px;border:0;border-radius:11px;background:#0e1b35;color:#fff;font:inherit;font-weight:800}
.question-tutor{padding:0;border:1px solid #d8e7e1;border-radius:14px;background:#f8fffc;overflow:hidden}.question-tutor>summary{display:grid;min-height:58px;grid-template-columns:36px 1fr auto;align-items:center;gap:10px;padding:10px 12px;list-style:none;cursor:pointer}.question-tutor>summary::-webkit-details-marker{display:none}.question-tutor>summary>span:first-child{display:grid;width:34px;height:34px;place-items:center;border-radius:10px;background:#dffbef;color:#059669}.question-tutor>summary>span:nth-child(2){display:grid}.question-tutor>summary small{color:#728078}.question-tutor>summary i{color:#047857;font-size:.72rem;font-style:normal;font-weight:850}.question-tutor[open]>summary{border-bottom:1px solid #dfe9e5}.question-tutor-body{padding:0 12px 12px}.question-tutor button:disabled,.question-tutor input:disabled{opacity:.55;cursor:not-allowed}
@media(max-height:760px) and (min-width:761px){.streak-card{display:none}.professor{display:none}.question-source-image img{max-height:135px}.question-prompt{font-size:1.05rem}.choice{min-height:42px}.question-card{padding-block:13px}}
@media(max-width:760px){.activity-shell{height:auto;min-height:calc(100dvh - 62px);overflow:visible}.question-card{overflow:visible}.question-heading{align-items:flex-start}.chapter-card{min-height:270px}.chapter-illustration{height:125px}.answer-actions{padding-left:104px}}

/* A winding, connected chapter path with individual stage stops. */
.stage-road{position:relative;width:min(640px,100%);margin:34px auto 0;display:flex;flex-direction:column;gap:24px}
.stage-road:before{display:none}
.stage-road .stage-connection{position:absolute;inset:0;width:100%;height:100%;z-index:0;overflow:visible;pointer-events:none}
.stage-node,.stage-node:nth-of-type(even){position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:8px;width:40%;min-width:0;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;text-align:center;transition:transform .2s ease}
.stage-node:nth-of-type(4n+1){margin-inline-start:0}
.stage-node:nth-of-type(4n+2),.stage-node:nth-of-type(4n+4){margin-inline-start:30%}
.stage-node:nth-of-type(4n+3){margin-inline-start:60%}
.stage-node.current:hover,.stage-node.completed:hover{transform:translateY(-4px);box-shadow:none}
.node-orbit{position:relative;width:90px;min-width:90px;height:86px;display:grid;place-items:center;border:0;border-radius:50%;background:color-mix(in srgb,var(--chapter-accent) 12%,white);box-shadow:none}
.node-orbit:before,.node-orbit:after{display:none}
.node-orbit span{width:68px;height:68px;display:grid;place-items:center;border-radius:25px;background:var(--chapter-accent);color:#fff;font-size:2rem;line-height:1;box-shadow:0 7px 0 color-mix(in srgb,var(--chapter-accent) 65%,#27384c),0 12px 22px color-mix(in srgb,var(--chapter-accent) 18%,transparent);transform:rotate(-5deg);transition:transform .2s ease,box-shadow .2s ease}
.stage-node.current:hover .node-orbit span,.stage-node.completed:hover .node-orbit span{transform:rotate(0) scale(1.08)}
.node-orbit svg{width:27px;height:27px}
.stage-label{position:relative;z-index:2;min-width:0;width:min(210px,50vw);padding:5px 4px;border:0;border-radius:12px;background:#fff;box-shadow:none}
.stage-label small{display:block;color:#73808c;font-size:.72rem;line-height:1.45}
.stage-label h3{margin:4px 0 8px;color:#162340;font-size:1.02rem;line-height:1.4}
.stage-label a{display:inline-flex;min-height:38px;align-items:center;justify-content:center;padding:7px 16px;border-radius:12px;box-shadow:0 4px 0 color-mix(in srgb,var(--chapter-accent) 70%,#27384c);transition:transform .18s,box-shadow .18s}
.stage-label a:hover{transform:translateY(-2px);box-shadow:0 6px 0 color-mix(in srgb,var(--chapter-accent) 70%,#27384c)}
.stage-label a:active{transform:translateY(2px);box-shadow:0 2px 0 color-mix(in srgb,var(--chapter-accent) 70%,#27384c)}
.stage-node.locked{filter:none;opacity:1;box-shadow:none;background:none}
.stage-node.locked .stage-label{opacity:.65}
.stage-node.locked .node-orbit{background:#f0f2f3}
.stage-node.locked .node-orbit span{background:#c8d0d7;color:#66717e;box-shadow:0 6px 0 #aeb8c1,0 10px 18px rgba(22,35,64,.09)}
@media(max-width:760px){.stage-road{width:100%;margin-top:24px;gap:20px}.stage-node,.stage-node:nth-of-type(even){width:44%}.stage-node:nth-of-type(4n+2),.stage-node:nth-of-type(4n+4){margin-inline-start:28%}.stage-node:nth-of-type(4n+3){margin-inline-start:56%}.node-orbit{width:76px;min-width:76px;height:74px}.node-orbit span{width:58px;height:58px;border-radius:22px;font-size:1.65rem}.stage-label small{font-size:.65rem}.stage-label h3{font-size:.87rem}.stage-label a{min-height:35px;padding:6px 11px;font-size:.78rem}}
@media(prefers-reduced-motion:reduce){.stage-node,.node-orbit span,.stage-label a{transition:none}}

/* Course-colored milestones without heavy action boxes. */
.stage-map>header{border:1px solid color-mix(in srgb,var(--chapter-accent) 38%,#e4e8e6);background:#fff;box-shadow:0 5px 0 color-mix(in srgb,var(--chapter-accent) 12%,#e8ebe8)}
.stage-node .node-orbit{background:color-mix(in srgb,var(--chapter-accent) 9%,#fff)}
.stage-node .node-orbit span{width:66px;height:66px;border:2px solid color-mix(in srgb,var(--chapter-accent) 45%,#fff);border-radius:22px;background:#fff;color:var(--chapter-accent);box-shadow:0 5px 0 color-mix(in srgb,var(--chapter-accent) 18%,#dce3df),0 10px 18px #15254212}
.stage-node .node-orbit svg{width:30px;height:30px}
.stage-node.completed .node-orbit span{border-color:var(--chapter-accent);background:var(--chapter-accent);color:#fff}
.stage-node.locked .node-orbit span{border-color:#dbe2df;background:#f5f7f6;color:#88938e;box-shadow:0 4px 0 #e0e5e2}
.stage-node .stage-label{width:min(220px,52vw);padding:11px 14px;border:1px solid #e5e9e5;border-radius:17px;background:#fff;box-shadow:0 4px 0 #e8ebe8}
.stage-node.current .stage-label{border-color:color-mix(in srgb,var(--chapter-accent) 35%,#e5e9e5)}
.stage-node .stage-label h3{margin:5px 0 10px;font-size:1rem;line-height:1.55}
.stage-node .stage-label a{min-height:39px;padding:7px 14px;border:1.5px solid var(--chapter-accent);border-radius:11px;background:#fff;color:var(--chapter-accent);font-size:.86rem;line-height:1.5;box-shadow:none}
.stage-node .stage-label a:hover{background:var(--chapter-accent);color:#fff;transform:translateY(-2px);box-shadow:0 4px 0 color-mix(in srgb,var(--chapter-accent) 32%,#cdd8d2)}
.stage-node .stage-label a:active{transform:translateY(0);box-shadow:none}
.stage-node .stage-label a:focus-visible{outline:3px solid var(--chapter-accent);outline-offset:3px}
@media(max-width:760px){.stage-node .node-orbit span{width:58px;height:58px;border-radius:20px}.stage-node .node-orbit svg{width:26px;height:26px}.stage-node .stage-label{width:min(220px,51vw);padding:9px 10px}.stage-node .stage-label h3{font-size:.88rem}.stage-node .stage-label a{font-size:.78rem}}

.question-source-image {
    display: flex;
    justify-content: center;
    max-width: 760px;
    margin: 12px auto 22px;
}

.question-source-image img {
    display: block;
    max-width: 100%;
    max-height: 340px;
    object-fit: contain;
    padding: 10px;
    border: 1px solid #dce5ec;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(14, 27, 53, .08);
}

.written-answer {
    display: grid;
    gap: 9px;
    margin: 18px 0;
    text-align: right;
}

.written-answer > span {
    color: #233657;
    font-weight: 800;
}

.written-answer textarea {
    width: 100%;
    min-height: 145px;
    resize: vertical;
    padding: 16px 18px;
    border: 2px solid #dbe4ec;
    border-radius: 16px;
    outline: 0;
    background: #fff;
    color: #132746;
    font: inherit;
    line-height: 1.9;
}

.written-answer textarea:focus {
    border-color: var(--chapter-accent);
    box-shadow: 0 0 0 4px rgba(0, 189, 145, .12);
}

.written-answer textarea[readonly] {
    background: #f7faf9;
    color: #40526b;
}

.feedback.reference {
    border-color: #9ce4d1;
    background: #effcf8;
}

.feedback.reference h2 {
    color: #087a5c;
}

@media (max-width: 760px) {
    .question-source-image img { max-height: 260px; }
    .written-answer textarea { min-height: 125px; }
}

/* Keep the activity compact: these final rules intentionally override the
   older source-image and written-answer fallbacks above. */
.learning-activity-body .question-source-image {
    margin: 7px auto 10px;
}

.learning-activity-body .question-source-image img {
    max-height: 190px;
    padding: 6px;
    border-radius: 13px;
}

.learning-activity-body .written-answer {
    gap: 6px;
    margin: 10px 0;
}

.learning-activity-body .written-answer textarea {
    min-height: 88px;
    padding: 11px 13px;
    border-width: 1px;
    border-radius: 12px;
    line-height: 1.7;
}

@media (max-height: 760px) and (min-width: 761px) {
    .learning-activity-body .question-source-image img { max-height: 135px; }
}

@media (max-width: 760px) {
    .learning-activity-body .question-source-image img { max-height: 210px; }
    .learning-activity-body .written-answer textarea { min-height: 100px; }
}
