/* Shared student portal; encounter controls retain their own layout. */
:root{--portal-ink:#1f2433;--portal-muted:#555c6e;--portal-paper:#fffefb;--portal-soft:#f0efea;--portal-line:#dcd9d1;--portal-accent:#1a7560;--portal-gold:#e1b862}
[data-theme=night]{--portal-ink:#eceef5;--portal-muted:#b0b6c6;--portal-paper:#1c2029;--portal-soft:#262b37;--portal-line:#3a4152;--portal-accent:#8fd3b6;--portal-gold:#edc778}
.topbar .brand{appearance:none;border:0;background:transparent;cursor:pointer;color:var(--ink);padding:3px 7px 3px 0;text-align:left;border-radius:8px;flex:0 1 auto}.topbar .brand:hover .mark{color:var(--accent)}.topbar .brand .mark{font-size:21px;letter-spacing:-.7px;white-space:nowrap}.topbar .brand .sub{font-size:10px;max-width:260px;line-height:1.4}.topbar .brand-symbol{background:#185e4f;color:#fff4d8;border-radius:12px;display:inline-grid;place-items:center;width:38px;height:38px;box-shadow:0 3px 0 #1f243320;font-size:25px}.workspace-nav{display:flex;gap:3px;flex-wrap:wrap}.workspace-nav .btn{display:inline-flex;gap:6px;align-items:center;padding:9px 11px;color:var(--portal-muted);border-radius:9px;font-size:12px}.workspace-nav svg{width:17px;height:17px;flex:none}.workspace-nav .btn[aria-current=page]{background:var(--portal-soft);color:var(--portal-ink);box-shadow:inset 0 -2px 0 var(--portal-accent)}.workspace-nav .btn:hover{background:var(--portal-soft);color:var(--portal-ink)}
.portal-workspace{max-width:1260px;margin:0 auto;padding:32px 30px 80px;color:var(--portal-ink)}.portal-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}.portal-kicker{display:block;font-size:10px;font-weight:750;letter-spacing:.12em;text-transform:uppercase;color:var(--portal-muted)}.portal-heading h1{font-size:clamp(29px,3.3vw,42px);letter-spacing:-1.3px;margin:8px 0 10px;line-height:1.14;color:var(--portal-ink)}.portal-heading p{font-size:14px;color:var(--portal-muted);margin:0;max-width:680px}.portal-metrics{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--portal-line);border-radius:15px;background:var(--portal-paper);padding:19px 6px;margin-bottom:25px}.portal-metrics>div{display:grid;gap:6px;padding:0 22px;border-right:1px solid var(--portal-line)}.portal-metrics>div:last-child{border:0}.portal-metrics b{font-size:29px;font-weight:680;letter-spacing:-1px}.portal-metrics small{font-size:16px;color:var(--portal-muted)}.portal-metrics span{font-size:11px;color:var(--portal-muted)}.portal-dashboard{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:25px}.portal-main{display:grid;gap:30px}.portal-resume{border-radius:18px;padding:29px 33px;background:linear-gradient(110deg,#184e43,#27745f);color:#fcf9e8;position:relative;overflow:hidden}.portal-resume:after{content:'';pointer-events:none;position:absolute;width:220px;height:220px;border:1px solid #a3d4b330;border-radius:50%;right:-92px;top:-90px;box-shadow:0 0 0 33px #a3d4b312,0 0 0 68px #a3d4b309}.portal-resume .portal-kicker{color:#b5d5b9}.portal-resume h2{font-size:27px;line-height:1.2;letter-spacing:-.7px;margin:9px 0;color:inherit}.portal-resume p{color:#d6e9d8;max-width:520px;font-size:13px;line-height:1.6}.portal-primary{background:#f1cf84!important;color:#254035!important;border-color:#f1cf84!important;display:inline-flex;gap:24px;font-weight:750;margin-top:8px}.portal-primary:hover{background:#ffe0a0!important}.portal-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}.portal-section-heading h2{font-size:17px;margin:0;color:var(--portal-ink)}.portal-section-heading>span{font-size:10px;color:var(--portal-muted)}.portal-section-heading>svg{height:22px;width:22px;color:var(--portal-muted)}.portal-destinations{display:grid;grid-template-columns:1fr 1fr;gap:15px}.portal-destination{display:flex;align-items:flex-start;gap:13px;text-align:left;border:1px solid var(--portal-line);border-radius:15px;background:var(--portal-paper);padding:19px 16px;min-height:168px;color:var(--portal-ink);cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}.portal-destination:hover{transform:translateY(-2px);box-shadow:0 7px 17px #1f243310;border-color:var(--portal-accent)}.portal-tile-art{width:75px;flex:none;margin-left:-5px}.portal-tile-art svg{width:100%;height:auto}.portal-tile-copy{display:grid;gap:8px}.portal-tile-copy>b{font-size:15px;line-height:1.35}.portal-tile-copy>span{font-size:11px;color:var(--portal-muted);line-height:1.6}.portal-tile-copy>strong{font-size:11px;font-weight:650;color:var(--portal-accent);margin-top:4px}.portal-side{display:grid;gap:19px;align-content:start}.portal-side-card{border:1px solid var(--portal-line);border-radius:15px;background:var(--portal-paper);padding:20px}.portal-activity{display:flex;align-items:center;gap:10px;padding:15px 0;width:100%;border:0;border-bottom:1px solid var(--portal-line);background:transparent;text-align:left;color:var(--portal-ink);cursor:pointer}.portal-activity>span:nth-child(2){flex:1}.portal-activity b{display:block;font-size:12px}.portal-activity small{display:block;font-size:10px;color:var(--portal-muted);margin-top:5px;line-height:1.4}.portal-activity-icon{background:var(--portal-soft);border-radius:9px;padding:8px;display:grid}.portal-activity svg{width:19px;height:19px}.portal-side-card>.btn{margin:15px 0 0;padding-left:0;font-size:11px;color:var(--portal-accent)}.portal-empty{padding:20px 0;font-size:12px;line-height:1.7;color:var(--portal-muted)}.portal-routine{background:var(--portal-soft);border:1px solid var(--portal-line);border-radius:15px;padding:22px}.portal-routine h2{font-size:18px;line-height:1.3;margin:8px 0 18px;color:var(--portal-ink)}.portal-routine ol{padding-left:22px;margin:0}.portal-routine li{padding:0 0 13px 6px;font-size:12px;color:var(--portal-accent)}.portal-routine li:last-child{padding-bottom:0}.portal-routine li b{display:block;color:var(--portal-ink)}.portal-routine li span{display:block;font-size:11px;color:var(--portal-muted);margin-top:3px}.portal-settings{display:flex;align-items:center;gap:12px;background:var(--portal-paper);border:1px solid var(--portal-line);border-radius:13px;padding:16px;color:var(--portal-ink);text-align:left;cursor:pointer}.portal-settings>svg{width:26px;height:26px}.portal-settings>span:nth-child(2){flex:1}.portal-settings b{font-size:12px;display:block}.portal-settings small{font-size:10px;display:block;color:var(--portal-muted);margin-top:3px}.portal-progress-intro{display:flex;gap:15px;padding:20px;background:var(--portal-soft);border:1px solid var(--portal-line);border-radius:12px;margin-bottom:25px;font-size:13px}.portal-progress-intro span{color:var(--portal-muted)}.portal-reading{max-width:1040px}.portal-reading>.disclosure-body{border-radius:16px}.portal-loading{padding:60px 0;color:var(--portal-muted)}
/* Case libraries share the same taxonomy, artwork and readable card geometry. */
body[data-workspace=practice] .lobby-hero{margin-bottom:18px;padding:20px 0 12px!important}
body[data-workspace=practice] .lobby-hero h1{font-size:32px!important;margin-bottom:6px}
body[data-workspace=practice] .lobby-hero p{font-size:13px}
body[data-workspace=practice] .mode-card .m-ico{display:inline-block!important;font-size:20px;margin-bottom:8px}
body[data-workspace=practice] #stationGrid{max-height:none;overflow:visible;scroll-margin-top:110px;gap:12px;padding:4px;grid-template-columns:repeat(4,minmax(0,1fr))}
body[data-workspace=practice] #stationGrid[data-grouping=systems]{display:block}
body[data-workspace=practice] .card .station-head{top:var(--portal-header-height,64px)}
.station-system+.station-system,.case-library-system+.case-library-system{margin-top:25px}
.station-system[hidden],body[data-workspace=practice] .station-card[hidden]{display:none!important}
.case-system-heading{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:5px 14px;margin:0 0 10px;padding:0 0 8px;border-bottom:1px solid var(--line);color:var(--ink)}
.case-system-heading h2,.case-system-heading h3{margin:0;font-size:16px;line-height:1.4;font-weight:650;letter-spacing:0}
.system-count{font-size:12px;line-height:1.5;color:var(--ink-2);white-space:nowrap}
.station-system-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
body[data-workspace=practice] .station-card{display:grid;grid-template-columns:64px minmax(0,1fr);grid-template-rows:auto 1fr;align-items:start;gap:3px 10px;padding:14px!important;min-height:124px;min-width:0}
body[data-workspace=practice] .station-card .s-illustration{grid-column:1;grid-row:1/3;display:block;align-self:center;width:64px;height:64px;color:var(--ink)}
body[data-workspace=practice] .station-card .s-illustration svg{display:block;width:100%;height:100%}
body[data-workspace=practice] .station-card .station-no{grid-column:2;align-self:end;font-size:10px;margin:0}
body[data-workspace=practice] .station-card .s-open{grid-column:2;min-width:0}
body[data-workspace=practice] .station-card .s-title{font-size:13px;line-height:1.45;margin:0 0 5px;overflow-wrap:break-word}
body[data-workspace=practice] .station-card .s-meta,body[data-workspace=practice] .station-card .s-sealed{font-size:11px;line-height:1.45}
body[data-workspace=practice] .station-card .s-sealed{display:none}
.portal-families{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}
.portal-families[hidden]{display:none}
body[data-workspace=practice] #portalFamilies .portal-family{display:flex;align-items:center;gap:7px;border:1px solid var(--portal-line);border-radius:10px;background:var(--portal-paper);color:var(--portal-ink);padding:7px 10px;cursor:pointer;font-size:12px;min-height:44px}
body[data-workspace=practice] #portalFamilies .portal-family svg{width:28px;height:28px;flex:none}
body[data-workspace=practice] #portalFamilies .portal-family.selected{background:var(--portal-soft);border-color:var(--portal-accent);box-shadow:inset 0 0 0 1px var(--portal-accent)}
.portal-workspace button:focus-visible,.topbar .brand:focus-visible,.portal-family:focus-visible{outline:3px solid var(--portal-gold);outline-offset:3px}
.case-library-groups{display:block!important;margin-bottom:28px}
.system-case-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.case-library-groups .lesson-card{display:grid;grid-template-columns:64px minmax(0,1fr);align-content:start;gap:4px 13px;min-height:154px;padding:17px;color:var(--ink);border-color:var(--line);border-radius:14px}
.case-library-groups .case-card-art{grid-column:1;grid-row:1/4;width:64px;height:64px;align-self:center}
.case-library-groups .case-card-art svg{width:100%;height:100%;display:block}
.case-library-groups .lesson-card h2{grid-column:2;font-size:16px;line-height:1.4;margin:0}
.case-library-groups .lesson-card p{grid-column:2;font-size:13px;line-height:1.5;margin:6px 0 0}
.case-library-groups .lesson-foot{grid-column:2;display:flex;flex-wrap:wrap;gap:5px 10px;align-items:center;justify-content:space-between;font-size:11px;padding-top:9px;color:var(--ink-2)}
.case-library-groups .lesson-foot b{font-size:12px;color:var(--accent)}
.materials-library .library-tools select,.materials-library .library-tools input{min-height:44px}
@media(max-width:1120px){.station-system-cards{grid-template-columns:repeat(3,minmax(0,1fr))}.system-case-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.station-system-cards{grid-template-columns:repeat(2,minmax(0,1fr))}body[data-workspace=practice] .station-card{min-height:116px}}
@media(max-width:600px){.system-case-grid{grid-template-columns:1fr}.case-library-groups .lesson-card{min-height:120px}.station-system-cards{grid-template-columns:1fr}body[data-workspace=practice] #stationGrid[data-grouping=sealed]{grid-template-columns:repeat(2,minmax(0,1fr))}.case-system-heading h2,.case-system-heading h3{font-size:15px}}
@media(max-width:1120px){.topbar .brand .sub{display:none}.workspace-nav .btn{padding:8px}.portal-dashboard{grid-template-columns:minmax(0,1fr) 270px}.portal-destinations{grid-template-columns:1fr}.portal-destination{min-height:120px}.portal-tile-art{width:85px}body[data-workspace=practice] .station-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:800px){.portal-workspace{padding:23px 18px 60px}.portal-dashboard{grid-template-columns:1fr}.portal-side{grid-template-columns:1fr 1fr}.portal-settings{grid-column:1/-1}.portal-destinations{grid-template-columns:1fr 1fr}.portal-metrics{grid-template-columns:1fr 1fr;gap:20px}.portal-metrics>div:nth-child(2){border:0}.portal-heading h1{font-size:32px}.topbar .brand .mark{font-size:19px}.workspace-nav{order:5;width:100%;justify-content:center}.workspace-nav .btn{font-size:11px;padding:8px 10px}.portal-resume{padding:25px}body[data-workspace=practice] .station-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:530px){.portal-side,.portal-destinations{grid-template-columns:1fr}.portal-section-heading>span{display:none}.portal-resume h2{font-size:24px}.portal-destination{min-height:125px}.portal-workspace{padding:20px 12px 50px}.portal-progress-intro{display:grid}.workspace-nav .btn{padding:8px;font-size:10px;gap:4px}.workspace-nav svg{width:15px;height:15px}body[data-workspace=practice] .station-card{grid-template-columns:45px 1fr;padding:11px!important;gap:6px}body[data-workspace=practice] .station-card .s-illustration{width:45px;height:45px}}
@media(prefers-reduced-motion:reduce){.portal-destination{transition:none}.portal-destination:hover{transform:none}}@media print{.portal-workspace button,.workspace-nav{display:none}.portal-workspace{padding:0;color:#111}}

/* Two practice modes on Home: Chat CSE (green) and Scribbi (indigo). */
.portal-modes{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.portal-mode{position:relative;overflow:hidden;display:flex;flex-direction:column;gap:6px;border-radius:20px;padding:26px 28px 22px;min-height:292px;color:#fcf9e8;box-shadow:0 14px 34px #1f243318}
.portal-mode.is-chat{background:linear-gradient(115deg,#184e43,#2a7862)}
.portal-mode.is-scribbi{background:linear-gradient(115deg,#3b2fc0,#6c5cf2);box-shadow:0 14px 34px #28265f26}
[data-theme=night] .portal-mode.is-scribbi{background:linear-gradient(115deg,#2b2375,#4a3fb4)}
.portal-mode:after{content:'';pointer-events:none;position:absolute;width:210px;height:210px;border-radius:50%;right:-80px;top:-86px;border:1px solid #ffffff22;box-shadow:0 0 0 30px #ffffff0c,0 0 0 62px #ffffff07}
.portal-mode .portal-kicker{color:#cfe6d3}
.portal-mode.is-scribbi .portal-kicker{color:#d4d0ff}
.portal-mode h2{margin:6px 0 2px;font-size:28px;letter-spacing:-.8px;line-height:1.15;color:#fff;max-width:70%}
.portal-mode p{margin:0;font-size:13.5px;line-height:1.6;color:#eef0f6;max-width:78%}
.portal-mode.is-scribbi p{color:#e8e6ff}
.portal-mode-art{position:absolute;right:18px;top:18px;width:92px;height:92px;opacity:.95}
.portal-mode-art svg{width:100%;height:100%}
.portal-mode.is-chat .portal-mode-art{background:#ffffff14;border-radius:50%;padding:6px}
.portal-mode-mascot{width:104px;height:104px;right:14px;top:10px;filter:drop-shadow(0 12px 18px #0d083a55)}
.portal-mode-resume{font-size:12.5px!important;margin-top:8px!important;padding:8px 11px;border-radius:10px;background:#ffffff18;max-width:none!important}
.portal-mode-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:auto;padding-top:16px}
.portal-mode .portal-primary{margin-top:0}
.portal-scribbi{background:#fff!important;border-color:#fff!important;color:#2c1fb0!important;font-weight:750;display:inline-flex;gap:20px}
.portal-scribbi:hover{background:#f1efff!important}
.portal-mode-quiet{background:#ffffff1a!important;border-color:#ffffff40!important;color:#fff!important}
.portal-mode-quiet:hover{background:#ffffff2e!important}
.portal-mode-foot{font-size:11px;color:#ffffffb3;margin-top:10px}
.portal-mode button:focus-visible{outline:3px solid #ffe08a;outline-offset:3px}
@media(max-width:1120px){.portal-mode h2{font-size:25px}.portal-mode p{max-width:100%}.portal-mode-art{width:74px;height:74px}.portal-mode-mascot{width:84px;height:84px}}
@media(max-width:760px){.portal-modes{grid-template-columns:1fr}.portal-mode{min-height:0}.portal-mode h2{max-width:72%}}

/* Past attempts: patient, mode, time, status and score at a glance. */
.attempt-filter{display:flex;flex-wrap:wrap;gap:6px;margin:14px 0 6px}
.attempt-filter .btn{border:1px solid var(--portal-line);border-radius:999px;min-height:34px;padding:0 12px;color:var(--portal-muted)}
.attempt-filter .btn[aria-pressed=true]{background:var(--portal-soft);color:var(--portal-ink);border-color:var(--portal-accent)}
.attempt-count{display:inline-grid;place-items:center;min-width:20px;height:20px;border-radius:999px;background:var(--portal-soft);font-size:11px;margin-left:4px;padding:0 5px}
.attempt-list{display:grid;gap:8px;margin:8px 0 18px}
.hist-row.attempt-row{display:grid;grid-template-columns:48px minmax(0,1fr) auto auto;gap:6px 14px;align-items:center;padding:10px 12px;border:1px solid var(--portal-line);border-radius:14px;background:var(--portal-paper);border-bottom:1px solid var(--portal-line)}
.attempt-row[hidden]{display:none}
.attempt-row.is-open{border-color:var(--warn-line);background:linear-gradient(90deg,var(--warn-soft),var(--portal-paper) 45%)}
.attempt-art{width:48px;height:48px;display:block}
.attempt-art svg{width:100%;height:100%;display:block}
.attempt-main{display:grid;gap:3px;min-width:0}
.attempt-main b{font-size:14px;color:var(--portal-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.attempt-score{display:inline-flex;align-items:baseline;gap:1px;padding:5px 10px;border-radius:10px;background:var(--portal-soft);color:var(--portal-ink)}
.attempt-score b{font-size:17px}
.attempt-score small{font-size:11px;color:var(--portal-muted)}
@media(max-width:640px){.hist-row.attempt-row{grid-template-columns:40px minmax(0,1fr) auto;gap:6px 10px;padding:10px}.attempt-art{width:40px;height:40px;grid-row:1/3}.attempt-main{grid-column:2;grid-row:1/3}.attempt-main b{white-space:normal}.attempt-status{grid-column:3;grid-row:1;justify-self:end}.attempt-row>span:last-child{grid-column:3;grid-row:2;justify-self:end}.attempt-filter{gap:4px}.attempt-filter .btn{padding:0 9px}}
/* Phones: one scrollable row of destinations instead of two wrapped rows. */
@media(max-width:800px){.workspace-nav{flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding-bottom:2px}.workspace-nav[data-fade=right]{mask-image:linear-gradient(90deg,#000 86%,transparent)}.workspace-nav[data-fade=left]{mask-image:linear-gradient(270deg,#000 86%,transparent)}.workspace-nav[data-fade=both]{mask-image:linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent)}.workspace-nav::-webkit-scrollbar{display:none}.workspace-nav .btn{flex:none}}
@media(max-width:480px){.topbar .brand-light{display:inline}}
