/* Nurvi study app. Builds on the tokens and buttons in styles.css. */
.app-body{background:var(--soft);min-height:100vh}
html[data-theme=dark] .app-body{background:var(--bg)}
.shell{display:block;min-height:100vh;padding-left:248px}
.shell.bare{padding-left:0}
.k,.card .k,.sub,.app-body p{font-family:var(--sans)}
.row > div{min-width:0}
.row > div:not(.grid):not(.bar){flex:1 1 220px}

/* Left rail */
.rail{position:fixed;top:0;left:0;width:248px;height:100vh;overflow-y:auto;z-index:50;display:flex;flex-direction:column;gap:6px;padding:18px 14px calc(18px + env(safe-area-inset-bottom,0px)) max(14px,env(safe-area-inset-left,0px));background:var(--card);border-right:1px solid var(--line)}
.rail .brand{padding:4px 8px 16px;font-size:19px}
.brand-mark{width:30px;height:30px;border-radius:22%;display:block;object-fit:cover}
.rail .brand span{letter-spacing:-.03em}
.rail-nav{display:flex;flex-direction:column;gap:2px}
.rail-nav a{display:flex;align-items:center;gap:12px;padding:9px 10px;border-radius:12px;font-size:14.5px;color:var(--ink2);transition:background .15s,color .15s}
.rail-nav a:hover{background:var(--soft)}
.rail-nav a.on{background:var(--blue-soft);color:var(--blue-ink);font-weight:500}
.rail-nav svg,.rail-mini svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.rail-nav em{margin-left:auto;font-style:normal;font-size:12px;font-weight:600;background:var(--blue);color:#fff;border-radius:999px;padding:1px 8px}
.rail-foot{margin-top:auto;display:flex;flex-direction:column;gap:10px}
.rail-plan{display:block;border-radius:16px;padding:14px;background:var(--soft);font-size:13px;color:var(--muted);line-height:1.4}
.rail-plan b{display:block;color:var(--fg);font-size:14px;margin-bottom:2px}
.rail-plan .btn{margin-top:10px;width:100%}
.rail-plan.pro{background:var(--blue-soft)}
.rail-row{display:flex;gap:6px}
.rail-mini{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;color:var(--muted)}
.rail-mini:hover,.rail-mini.on{background:var(--soft);color:var(--fg)}

/* Main view */
.view{min-width:0;padding:32px max(20px,env(safe-area-inset-right,0px)) 80px 40px;outline:none}
.page{max-width:1040px;margin:0 auto;display:flex;flex-direction:column;gap:20px}
.page.narrow{max-width:760px}
.crumb{font-size:13.5px;color:var(--muted);display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.crumb a:hover{color:var(--fg)}
.h1{font-size:clamp(28px,3.4vw,38px);line-height:1.08;letter-spacing:-.035em;font-weight:500;margin:0;text-wrap:balance}
.sub{color:var(--muted);margin:6px 0 0;font-size:15.5px;max-width:62ch}
.card{background:var(--card);border-radius:22px;padding:22px;box-shadow:0 0 0 1px var(--line)}
.card h3{margin:0 0 4px;font-size:17px;font-weight:600;letter-spacing:-.01em}
.card .k{font-size:13px;color:var(--muted)}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.spacer{flex:1}
.muted{color:var(--muted)}
.small{font-size:13px}
.btn-blue{background:var(--blue);color:#fff}
.btn-blue:hover{filter:brightness(1.05)}
.btn[disabled]{opacity:.45;pointer-events:none}
.pill{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:500;padding:4px 10px;border-radius:999px;background:var(--soft2);color:var(--muted)}
.pill.blue{background:var(--blue-soft);color:var(--blue-ink)}
.pill.green{background:var(--green-soft);color:#12a150}
.pill.amber{background:var(--amber-soft);color:#b7791f}
html[data-theme=dark] .pill.green{color:#4ade80}
html[data-theme=dark] .pill.amber{color:#fbbf24}

/* Hero greeting */
.greet{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px;align-items:center;background:var(--card);border-radius:28px;padding:26px 28px 0;box-shadow:0 0 0 1px var(--line);overflow:hidden}
.greet-copy{padding-bottom:26px}
.greet .bubble{display:inline-block;margin-top:14px;background:var(--soft);border-radius:16px;padding:10px 14px;font-size:14.5px;color:var(--ink2)}
.greet-face{width:170px;height:190px;align-self:end;position:relative}
.greet-face::before{content:"";position:absolute;left:5px;right:5px;bottom:-40px;height:170px;border-radius:50%;background:radial-gradient(circle at 50% 30%,#dfe9ff 0%,#b9cffd 100%)}
html[data-theme=dark] .greet-face::before{background:radial-gradient(circle at 50% 28%,#2c3f70 0%,#151f3a 100%)}
.greet-face img{position:absolute;left:50%;bottom:-6px;width:175px;transform:translateX(-50%)}

/* Stats */
.stat{display:flex;flex-direction:column;gap:4px}
.stat b{font-size:30px;font-weight:500;letter-spacing:-.03em;font-variant-numeric:tabular-nums;line-height:1.1}
.stat b small{font-size:15px;color:var(--muted);font-weight:400}
.ringbox{display:flex;align-items:center;gap:18px}
.ring-sm{width:92px;height:92px;transform:rotate(-90deg);flex:none}
.ring-sm circle{fill:none;stroke-width:9}
.ring-sm .bg{stroke:var(--soft2)}
.ring-sm .fg{stroke:var(--blue);stroke-linecap:round;transition:stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1)}
.ring-label{position:relative}
.ring-label span{position:absolute;inset:0;display:grid;place-items:center;font-size:24px;font-weight:600;font-variant-numeric:tabular-nums}
.bar{height:8px;border-radius:99px;background:var(--soft2);overflow:hidden}
.bar i{display:block;height:100%;border-radius:inherit;background:var(--blue);transition:width .6s cubic-bezier(.2,.8,.2,1)}
.todo{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.todo a{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:var(--soft);font-size:14.5px;transition:transform .15s}
.todo a:hover{transform:translateX(2px)}
.todo a .ic{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:var(--card);color:var(--blue);flex:none;box-shadow:0 0 0 1px var(--line)}
.todo a .ic svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.todo a small{display:block;color:var(--muted);font-size:12.5px}
.todo a .go{margin-left:auto;color:var(--subtle)}

/* Program road */
.road-wrap{overflow-x:auto;padding:6px 4px 4px;scrollbar-width:thin}
.road{position:relative;min-width:900px;aspect-ratio:1100/230}
.road svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.road .r-edge{fill:none;stroke:var(--line2);stroke-width:30;stroke-linecap:round}
.road .r-base{fill:none;stroke:var(--soft);stroke-width:26;stroke-linecap:round}
.road .r-done{fill:none;stroke:var(--blue);stroke-width:26;stroke-linecap:round;opacity:.9}
.road .r-dash{fill:none;stroke:var(--line2);stroke-width:2.5;stroke-dasharray:10 12}
.stop{position:absolute;transform:translate(-50%,-50%);width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:var(--card);color:var(--muted);box-shadow:0 0 0 3px var(--line2),0 6px 14px -8px rgba(10,10,11,.35);transition:transform .15s;font-weight:600;font-size:14px}
.stop:hover{transform:translate(-50%,-50%) scale(1.08)}
.stop svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.stop.done{background:var(--blue);color:#fff;box-shadow:0 0 0 3px var(--card),0 6px 14px -8px rgba(37,99,235,.6)}
.stop.current{color:var(--blue);box-shadow:0 0 0 3px var(--blue),0 0 0 9px var(--blue-soft)}
.stop.goal{width:58px;height:58px;background:var(--fg);color:var(--bg)}
.stop-name{position:absolute;transform:translateX(-50%);font-size:12.5px;font-weight:500;color:var(--ink2);white-space:nowrap;text-align:center;line-height:1.2;pointer-events:none}
.stop-name small{display:block;font-size:11px;color:var(--subtle);font-weight:400}
.stop.face{width:62px;height:62px;padding:0;overflow:hidden;background:#dfe9ff}
.stop.face img{width:100%;height:100%;object-fit:cover;object-position:50% 10%}

/* Unit trail */
.trail-wrap{position:relative;max-width:620px;margin:0 auto;width:100%}
.trail-wrap svg.trail{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.trail .t-bg{fill:none;stroke:var(--line2);stroke-width:4;stroke-dasharray:2 10;stroke-linecap:round}
.trail .t-done{fill:none;stroke:var(--blue);stroke-width:4;stroke-linecap:round}
.pn{position:absolute;transform:translate(-50%,-50%);width:64px;height:64px;border-radius:50%;display:grid;place-items:center;transition:transform .15s}
.pn:hover{transform:translate(-50%,-50%) scale(1.06)}
.pn svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.pn.done{background:var(--blue);color:#fff;box-shadow:0 6px 0 #1d5fd8}
.pn.current{background:var(--blue);color:#fff;box-shadow:0 6px 0 #1d5fd8,0 0 0 9px var(--blue-soft);animation:pnPulse 2s ease-in-out infinite}
.pn.open{background:var(--card);color:var(--blue);box-shadow:0 6px 0 var(--line2),0 0 0 2px var(--blue-soft)}
.pn.locked{background:var(--soft2);color:var(--subtle);box-shadow:0 6px 0 var(--line2)}
.pn.pro{background:var(--amber-soft);color:#b7791f;box-shadow:0 6px 0 #f3d9a6}
html[data-theme=dark] .pn.pro{box-shadow:0 6px 0 rgba(245,158,11,.25);color:#fbbf24}
@keyframes pnPulse{50%{box-shadow:0 6px 0 #1d5fd8,0 0 0 15px var(--blue-soft)}}
.pn-start{position:absolute;transform:translate(-50%,-100%);background:var(--card);color:var(--blue-ink);font-size:12.5px;font-weight:600;padding:6px 11px;border-radius:10px;box-shadow:0 0 0 1px var(--line),0 6px 16px -8px rgba(10,10,11,.3);white-space:nowrap;pointer-events:none;animation:floaty 3s ease-in-out infinite}
.pn-label{position:absolute;transform:translateY(-50%);font-size:14px;line-height:1.25;width:200px;pointer-events:none}
.pn-label b{display:block;font-weight:600}
.pn-label small{color:var(--muted);font-size:12.5px}
.pn-label.l{text-align:right;transform:translate(-100%,-50%)}

/* Course cards */
.course-card{display:flex;flex-direction:column;gap:12px;transition:transform .15s,box-shadow .15s}
.course-card:hover{transform:translateY(-2px);box-shadow:0 0 0 1px var(--line2),0 14px 30px -18px rgba(10,10,11,.3)}
.ci{--c:var(--blue);width:40px;height:40px;border-radius:12px;display:grid;place-items:center;color:var(--c);background:color-mix(in srgb,var(--c) 14%,transparent);flex:none}
.ci svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ci.sm{width:28px;height:28px;border-radius:8px}
.ci.sm svg{width:15px;height:15px}

/* Tabs */
.tabbar{display:flex;gap:4px;padding:4px;border-radius:999px;background:var(--soft2);width:max-content;max-width:100%;overflow-x:auto}
.tabbar a,.tabbar button{padding:8px 16px;border-radius:999px;font-size:14px;color:var(--muted);font-weight:500;white-space:nowrap}
.tabbar .on{background:var(--card);color:var(--fg);box-shadow:0 1px 3px rgba(0,0,0,.08)}

/* Notes */
.notes{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;counter-reset:n}
.notes li{display:grid;grid-template-columns:30px 1fr;gap:12px;align-items:start;padding:14px 16px;border-radius:16px;background:var(--soft);font-size:15.5px;line-height:1.5;counter-increment:n}
.notes li::before{content:counter(n);width:26px;height:26px;border-radius:8px;background:var(--card);display:grid;place-items:center;font-size:12.5px;font-weight:600;color:var(--blue);box-shadow:0 0 0 1px var(--line)}

/* Flashcards */
.fcw{max-width:640px;margin:0 auto;width:100%;display:flex;flex-direction:column;gap:14px}
.fcx{background:var(--card);border-radius:24px;padding:30px 30px 26px;box-shadow:0 0 0 1px var(--line),0 20px 40px -26px rgba(10,10,11,.35);min-height:240px;display:flex;flex-direction:column}
.fcx .top{display:flex;justify-content:space-between;font-size:12.5px;color:var(--muted)}
.fcx .q{font-size:22px;line-height:1.3;letter-spacing:-.02em;font-weight:500;margin:18px 0 0;text-wrap:balance}
.fcx .a{margin:18px 0 0;padding-top:16px;border-top:1px dashed var(--line2);font-size:16px;color:var(--ink2);line-height:1.5}
.rates4{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.rates4 button{border-radius:14px;padding:10px 6px;font-size:14.5px;font-weight:600;background:var(--card);box-shadow:0 0 0 1px var(--line2);display:flex;flex-direction:column;align-items:center;gap:1px;transition:transform .12s}
.rates4 button:hover{transform:translateY(-1px)}
.rates4 small{font-size:11.5px;font-weight:400;color:var(--muted)}
.rates4 .again{color:var(--red)}.rates4 .hard{color:#d97706}.rates4 .good{color:#12a150}.rates4 .easy{color:var(--blue)}
.kbd{font-size:12px;color:var(--subtle);text-align:center}

/* Questions */
.qw{max-width:720px;margin:0 auto;width:100%;display:flex;flex-direction:column;gap:14px}
.qhead{display:flex;align-items:center;gap:12px;font-size:13.5px;color:var(--muted)}
.qprog{flex:1;height:6px;border-radius:99px;background:var(--soft2);overflow:hidden}
.qprog i{display:block;height:100%;background:var(--blue);border-radius:inherit;transition:width .3s}
.timer{font-variant-numeric:tabular-nums;font-weight:500;color:var(--fg)}
.qcard{background:var(--card);border-radius:24px;padding:26px;box-shadow:0 0 0 1px var(--line)}
.qstem{font-size:19px;line-height:1.4;letter-spacing:-.01em;font-weight:500;margin:10px 0 16px}
.qopt{display:flex;align-items:flex-start;gap:12px;width:100%;text-align:left;padding:13px 14px;margin-top:8px;border-radius:14px;background:var(--soft);font-size:15.5px;line-height:1.4;transition:box-shadow .15s,background .15s}
.qopt:hover{box-shadow:inset 0 0 0 1.5px var(--blue)}
.qopt .lt{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;flex:none;background:var(--card);font-size:12.5px;font-weight:600;color:var(--muted);box-shadow:0 0 0 1px var(--line)}
.qopt.sata .lt{border-radius:6px}
.qopt.sel{box-shadow:inset 0 0 0 1.5px var(--blue);background:var(--blue-soft)}
.qopt.sel .lt{background:var(--blue);color:#fff;box-shadow:none}
.qopt.right{box-shadow:inset 0 0 0 1.5px #12a150;background:var(--green-soft)}
.qopt.right .lt{background:#12a150;color:#fff;box-shadow:none}
.qopt.wrong{box-shadow:inset 0 0 0 1.5px var(--red);background:var(--red-soft)}
.qopt.wrong .lt{background:var(--red);color:#fff;box-shadow:none}
.qopt[disabled]{cursor:default}
.qopt[disabled]:hover{box-shadow:none}
.qopt.right[disabled]:hover{box-shadow:inset 0 0 0 1.5px #12a150}
.qopt.wrong[disabled]:hover{box-shadow:inset 0 0 0 1.5px var(--red)}
.rat{margin-top:16px;padding:16px;border-radius:16px;background:var(--soft);font-size:15px;line-height:1.5;color:var(--ink2)}
.rat b{display:block;margin-bottom:4px;color:var(--fg)}
.qfoot{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}

/* Results */
.score-big{font-size:64px;font-weight:500;letter-spacing:-.04em;line-height:1;font-variant-numeric:tabular-nums}
.cats{display:flex;flex-direction:column;gap:12px}
.cat-row{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) 46px;gap:14px;align-items:center;font-size:14px}
.cat-row b{text-align:right;font-variant-numeric:tabular-nums;font-weight:600}
.cat-row .bar i.low{background:var(--red)}
.cat-row .bar i.mid{background:#f59e0b}
.cat-row .bar i.none{background:transparent}

/* Builder chips */
.chips2{display:flex;flex-wrap:wrap;gap:8px}
.chips2 button{padding:8px 14px;border-radius:999px;font-size:14px;background:var(--soft);color:var(--ink2);transition:background .15s}
.chips2 button.on{background:var(--fg);color:var(--bg)}
.field{display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:500}
.field input,.field select{font:inherit;font-weight:400;font-size:15px;padding:11px 14px;border-radius:12px;border:1px solid var(--line2);background:var(--card);color:var(--fg)}
.field input:focus,.field select:focus{outline:2px solid var(--blue);outline-offset:0;border-color:transparent}

/* Paywall + plans */
.wall{display:grid;grid-template-columns:auto minmax(0,1fr);gap:24px;align-items:center;background:linear-gradient(135deg,var(--blue-soft),var(--card));border-radius:28px;padding:28px;box-shadow:0 0 0 1px var(--line)}
.wall img{width:130px;height:150px;object-fit:cover;object-position:50% 8%;border-radius:24px;background:#dfe9ff}
.plans4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.plan4{background:var(--card);border-radius:24px;padding:22px;display:flex;flex-direction:column;gap:10px;box-shadow:0 0 0 1px var(--line);position:relative}
.plan4.hot{box-shadow:0 0 0 2px var(--blue),0 20px 40px -24px rgba(37,99,235,.5)}
.plan4 .tag{position:absolute;top:-11px;left:20px;font-size:12px;font-weight:600;background:var(--blue);color:#fff;padding:3px 10px;border-radius:999px}
.plan4 .tag.alt{background:var(--fg);color:var(--bg)}
.plan4 h3{margin:0;font-size:17px}
.plan4 .price{display:flex;align-items:baseline;gap:6px}
.plan4 .price b{font-size:38px;font-weight:500;letter-spacing:-.03em}
.plan4 .price span{font-size:13.5px;color:var(--muted)}
.chk{list-style:none;padding:0;margin:16px 0 0;display:flex;flex-direction:column;gap:8px;font-size:14.5px;color:var(--ink2)}
.chk li,.plan4 li{display:flex;gap:8px}
.chk li::before,.plan4 li::before{content:"";flex:none;width:16px;height:16px;margin-top:2px;border-radius:50%;background:var(--blue-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23347af6' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center/10px no-repeat}
.plan4 ul{list-style:none;padding:0;margin:4px 0 0;display:flex;flex-direction:column;gap:8px;font-size:14px;color:var(--ink2)}
.plan4 li{display:flex;gap:8px}
.plan4 li::before{content:"";flex:none;width:16px;height:16px;margin-top:2px;border-radius:50%;background:var(--blue-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23347af6' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center/10px no-repeat}
.plan4 .btn{margin-top:auto}
.plan4 .per{font-size:12.5px;color:var(--muted)}
.notice{font-size:13.5px;padding:12px 14px;border-radius:14px;background:var(--amber-soft);color:var(--ink2)}

/* Library */
.lib-list{display:flex;flex-direction:column;gap:6px}
.lib-item{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:var(--soft);font-size:14.5px}
.lib-item small{color:var(--muted)}
.search{font:inherit;font-size:15px;width:100%;padding:12px 16px;border-radius:14px;border:1px solid var(--line2);background:var(--card);color:var(--fg)}
.hit{padding:14px 16px;border-radius:16px;background:var(--card);box-shadow:0 0 0 1px var(--line);font-size:14.5px}
.hit small{color:var(--muted);display:block;margin-bottom:4px}
mark{background:var(--blue-soft);color:inherit;border-radius:4px;padding:0 2px}

/* Onboarding */
.onb{max-width:520px;margin:6vh auto 0;display:flex;flex-direction:column;gap:18px}
.onb .face{width:120px;height:140px;object-fit:cover;object-position:50% 6%;border-radius:28px;background:#dfe9ff;align-self:center}
.confirm{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:14px;border-radius:14px;background:var(--red-soft)}

.app-toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom,0px));z-index:90}
.empty{text-align:center;padding:36px 20px;color:var(--muted)}
.empty img{width:110px;height:120px;object-fit:cover;object-position:50% 8%;border-radius:24px;margin:0 auto 14px;display:block;background:#dfe9ff}

/* Mobile */
@media (max-width:900px){
  .shell{padding-left:0}
  .rail{position:fixed;top:auto;bottom:0;left:0;right:0;width:auto;height:auto;overflow:visible;z-index:60;flex-direction:row;align-items:center;padding:6px max(8px,env(safe-area-inset-left,0px)) calc(6px + env(safe-area-inset-bottom,0px));border-right:0;border-top:1px solid var(--line)}
  .rail .brand,.rail-foot{display:none}
  .rail-nav{flex-direction:row;justify-content:space-around;width:100%}
  .rail-nav a{flex-direction:column;gap:3px;font-size:10.5px;padding:6px 4px;flex:1;text-align:center}
  .rail-nav a[data-nav="library"]{display:none}
  .rail-nav em{position:absolute;margin:-4px 0 0 18px;font-size:10px;padding:0 5px}
  .view{padding:20px max(16px,env(safe-area-inset-right,0px)) 110px max(16px,env(safe-area-inset-left,0px))}
  .g3,.g4,.plans4{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:620px){
  .g2,.g3,.g4,.plans4{grid-template-columns:1fr}
  .greet{grid-template-columns:1fr;padding:22px 20px 0}
  .greet-face{justify-self:center;height:150px;width:150px}
  .greet-face img{width:150px}
  .wall{grid-template-columns:1fr;text-align:center}
  .wall img{margin:0 auto}
  .rates4{grid-template-columns:repeat(2,1fr)}
  .pn-label{width:130px;font-size:13px}
  .qcard,.fcx{padding:20px}
  .qstem{font-size:17px}
  .cat-row{grid-template-columns:1fr 70px 40px}
}
@media (prefers-reduced-motion:reduce){.pn.current,.road-face,.pn-start{animation:none}}

/* Plan card fixes */
.plan4 .tag{font-family:var(--sans);text-transform:none;letter-spacing:0}
.plan4 .price{flex-wrap:wrap}
@media (max-width:1180px){.plans4{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:22px}}
@media (max-width:620px){.plans4{grid-template-columns:1fr}}

/* Lessons */
.lesson{padding:30px 34px}
.lesson .lead{font-size:18px;line-height:1.5;color:var(--ink2);margin:0 0 18px;max-width:64ch}
.toc{display:flex;flex-wrap:wrap;gap:6px;padding:14px;border-radius:16px;background:var(--soft);margin-bottom:8px}
.toc a{font-size:13px;padding:6px 11px;border-radius:999px;background:var(--card);color:var(--ink2);box-shadow:0 0 0 1px var(--line)}
.toc a:hover{color:var(--blue-ink)}
.sec{padding-top:22px;scroll-margin-top:20px}
.sec h3{font-size:20px;font-weight:600;letter-spacing:-.02em;margin:0 0 10px}
.sec p{font-size:16px;line-height:1.7;color:var(--ink2);margin:0 0 12px;max-width:68ch}
.sec ul{margin:4px 0 8px;padding:14px 18px 14px 34px;border-radius:14px;background:var(--soft);display:flex;flex-direction:column;gap:6px;font-size:15px;line-height:1.5;color:var(--ink2);max-width:68ch}
@media (max-width:620px){.lesson{padding:22px 18px}.sec p{font-size:15.5px}}

/* Case studies */
.case-list{display:flex;flex-direction:column;gap:6px}
.case-row{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:var(--soft);transition:transform .15s}
.case-row:hover{transform:translateX(2px)}
.case-row-t{flex:1;min-width:0}
.case-row-t b{display:block;font-size:14.5px;font-weight:600}
.case-row-t small{color:var(--muted);font-size:12.5px}
.case-page{max-width:1180px}
.steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}
.steps li{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:12px;background:var(--soft);font-size:12.5px;color:var(--muted);line-height:1.2}
.steps li span{width:22px;height:22px;border-radius:7px;display:grid;place-items:center;background:var(--card);font-weight:600;flex:none;box-shadow:0 0 0 1px var(--line)}
.steps li.on{background:var(--blue-soft);color:var(--blue-ink);font-weight:500}
.steps li.on span{background:var(--blue);color:#fff;box-shadow:none}
.steps li.done span{background:#12a150;color:#fff;box-shadow:none}
.case-grid{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);gap:16px;align-items:start}
.exhibit{position:sticky;top:20px;padding:0;overflow:hidden}
.ex-tabs{display:flex;gap:2px;padding:6px;background:var(--soft);border-bottom:1px solid var(--line);overflow-x:auto}
.ex-tabs button{padding:8px 12px;border-radius:10px;font-size:13.5px;color:var(--muted);white-space:nowrap}
.ex-tabs button.on{background:var(--card);color:var(--fg);font-weight:500;box-shadow:0 1px 2px rgba(0,0,0,.06)}
.ex-tabs em{font-style:normal;font-size:11px;background:var(--blue);color:#fff;border-radius:999px;padding:0 6px;margin-left:4px}
.ex-body{padding:16px 18px;max-height:62vh;overflow:auto}
.ex-notes{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:10px;font-size:14.5px;line-height:1.55;color:var(--ink2)}
.ex-notes li{padding-left:12px;border-left:2px solid var(--line2)}
.ex-notes .ex-update{border-left-color:var(--blue)}
.ex-notes .ex-update b{color:var(--blue-ink);font-weight:600;margin-right:4px}
.ex-scroll{overflow-x:auto}
.ex-table{width:100%;border-collapse:collapse;font-size:13.5px;font-variant-numeric:tabular-nums}
.ex-table th{text-align:left;font-weight:500;color:var(--muted);padding:8px 10px;border-bottom:1px solid var(--line2);white-space:nowrap}
.ex-table td{padding:8px 10px;border-bottom:1px solid var(--line)}
.ex-table tr.flag td{background:var(--amber-soft)}
.flag-h,.flag-l{font-size:11px;font-weight:700;padding:1px 6px;border-radius:6px;margin-left:4px}
.flag-h{background:var(--red-soft);color:var(--red)}
.flag-l{background:var(--blue-soft);color:var(--blue-ink)}
.case-update{margin-top:12px;padding:12px 14px;border-radius:14px;background:var(--blue-soft);font-size:14.5px;line-height:1.5}
.case-update b{display:block;font-size:12.5px;color:var(--blue-ink);margin-bottom:2px}
.hl{line-height:2.3;font-size:15.5px}
.hl-seg{display:inline;padding:4px 8px;border-radius:8px;background:var(--soft);font-size:15px;text-align:left;line-height:1.6;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.hl-seg:hover{box-shadow:inset 0 0 0 1.5px var(--blue)}
.hl-seg.sel{background:#fff3a8;color:#3a3200}
.hl-seg.right{background:var(--green-soft);box-shadow:inset 0 0 0 1.5px #12a150}
.hl-seg.wrong{background:var(--red-soft);box-shadow:inset 0 0 0 1.5px var(--red)}
.mx{width:100%;border-collapse:collapse;font-size:14.5px}
.mx th{font-size:13px;font-weight:600;color:var(--muted);padding:8px;text-align:center}
.mx td{padding:10px 8px;border-top:1px solid var(--line);text-align:center}
.mx td:first-child{text-align:left;line-height:1.4}
.mx-cell{width:24px;height:24px;border-radius:50%;box-shadow:inset 0 0 0 2px var(--line2);background:var(--card)}
.mx-cell:hover{box-shadow:inset 0 0 0 2px var(--blue)}
.mx-cell.sel{box-shadow:inset 0 0 0 7px var(--blue)}
.mx-cell.right{box-shadow:inset 0 0 0 7px #12a150}
.mx-cell.wrong{box-shadow:inset 0 0 0 7px var(--red)}
.cz-sentence{font-size:16.5px;line-height:2.4}
.cz{font:inherit;font-size:15px;padding:6px 10px;border-radius:10px;border:1px solid var(--line2);background:var(--card);color:var(--fg);max-width:100%}
.cz.right{border-color:#12a150;background:var(--green-soft)}
.cz.wrong{border-color:var(--red);background:var(--red-soft)}
.cz-fix{font-size:13px;color:#12a150;margin:0 6px;font-weight:500}
.bt{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.bt-col{display:flex;flex-direction:column;gap:6px}
.bt-h{font-size:13px;font-weight:600;text-align:center;padding:6px 0}
.bt-h small{display:block;font-weight:400;color:var(--muted);font-size:11.5px}
.bt-opt{padding:10px 12px;border-radius:12px;background:var(--soft);font-size:13.5px;line-height:1.35;text-align:left}
.bt-opt:hover{box-shadow:inset 0 0 0 1.5px var(--blue)}
.bt-opt.sel{background:var(--blue-soft);box-shadow:inset 0 0 0 1.5px var(--blue)}
.bt-opt.right{background:var(--green-soft);box-shadow:inset 0 0 0 1.5px #12a150}
.bt-opt.wrong{background:var(--red-soft);box-shadow:inset 0 0 0 1.5px var(--red)}
@media (max-width:1000px){.case-grid{grid-template-columns:1fr}.exhibit{position:static}.ex-body{max-height:none}.steps{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:620px){.bt{grid-template-columns:1fr}.steps{grid-template-columns:repeat(2,minmax(0,1fr))}}

.rail-signin{display:block;margin-top:10px;font-size:12.5px;color:var(--muted);cursor:pointer}

/* Account screens */
.auth-err{font-size:14px;padding:11px 14px;border-radius:12px;background:var(--red-soft);color:var(--red);line-height:1.4}
.auth-ok{font-size:14px;padding:11px 14px;border-radius:12px;background:var(--green-soft);color:#0e7d3f;line-height:1.4}
html[data-theme=dark] .auth-ok{color:#4ade80}
.gbtn{background:var(--card);color:var(--fg);box-shadow:0 0 0 1px var(--line2);gap:10px}
.gbtn:hover{background:var(--soft)}
.or{display:flex;align-items:center;gap:12px;font-size:12.5px;color:var(--subtle)}
.or::before,.or::after{content:"";flex:1;height:1px;background:var(--line2)}
