/* Layout adapters for the authenticated, API-backed portal. */
html,body{margin:0;min-height:100%;background:var(--ip-bg);color:var(--ip-ink);font-family:system-ui,-apple-system,'Segoe UI',sans-serif}
[hidden]{display:none!important}*{box-sizing:border-box}.portal-live{min-height:100dvh}
.portal-content{display:flex;flex-direction:column;gap:20px;min-width:0}
.portal-live h2{font-size:20px;margin:0}.portal-live h3{font-size:17px;margin:0 0 6px}.portal-live p{margin:8px 0}.portal-live small{display:block;color:var(--ip-ink-3);font-size:13px}
.portal-live .ip-panel__body{min-width:0}.portal-live .ip-btn{font-family:inherit;white-space:normal;text-align:center}
.portal-live .ip-form{gap:16px}.portal-live .ip-field{min-width:0}.portal-live input,.portal-live select,.portal-live textarea{font:inherit}
.portal-live input[readonly]{background:var(--ip-surface-2);color:var(--ip-ink-3)}
.portal-navicon{width:24px;text-align:center;font-size:23px;flex:none}.portal-live .ip-account .ip-btn{background:transparent;color:#fff;border-color:#ffffff40}
.portal-actions,.portal-pager{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.portal-pager{justify-content:center}
.portal-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px}
.portal-password-form{padding-top:16px}.portal-check{display:flex;gap:10px;align-items:flex-start;padding:12px;border:1px solid var(--ip-line);border-radius:10px;background:var(--ip-surface-2)}
.portal-check input{width:20px;height:20px;flex:none;margin:0}
.portal-test{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px 0;border-bottom:1px solid var(--ip-line)}.portal-test:first-child{padding-top:0}.portal-test:last-child{border:0;padding-bottom:0}.portal-test>div:first-child{min-width:0}.portal-test h3,.portal-contact dd{overflow-wrap:anywhere}
.portal-test__action{flex:0 0 140px;text-align:center}.portal-test__action .ip-btn{width:100%;min-height:48px}.portal-test__action small{margin-top:8px}
.portal-empty{padding:20px 0;color:var(--ip-ink-3)}.portal-product-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:20px}.portal-price{font-size:26px;font-weight:700}
.portal-filters{display:flex;gap:8px;flex-wrap:wrap}.portal-search{display:flex;gap:12px;align-items:end}.portal-search .ip-field{flex:1}.portal-search .ip-btn{min-height:44px}
.portal-table-wrap{overflow-x:auto;max-width:100%}.portal-table{width:100%;border-collapse:collapse;font-size:14px}.portal-table th{text-align:left;color:var(--ip-ink-3);font-weight:500;background:var(--ip-surface-2)}.portal-table td,.portal-table th{padding:12px;border-bottom:1px solid var(--ip-line);vertical-align:middle}.portal-table .ip-btn{white-space:nowrap}.portal-table td:first-child{max-width:240px;overflow-wrap:anywhere}
.portal-contact{display:grid;grid-template-columns:120px minmax(0,1fr);gap:12px;margin:0 0 24px}.portal-contact dt{color:var(--ip-ink-3)}.portal-contact dd{margin:0}
.portal-review-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:stretch}.portal-essay{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7}.portal-essay-edit{min-height:440px;resize:vertical;margin-top:12px}.portal-review{display:flex;flex-direction:column;gap:16px;min-width:0}.portal-savebar{position:sticky;bottom:0;background:#fff;border-top:1px solid var(--ip-line);padding:14px 18px;display:flex;justify-content:space-between;align-items:center;gap:16px;z-index:2;box-shadow:0 -4px 18px #0b163808}
.portal-scores{display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:10px}.portal-scores .ip-score{padding:14px}.portal-scores .ip-score__value{font-size:28px}
.portal-answer-filter{padding:14px}.portal-answer-table td,.portal-answer-table th{padding:8px 12px}.portal-answer-table td{overflow-wrap:anywhere}.portal-answer-table td:first-child{width:40px}.portal-answer-table td:last-child{width:70px;text-align:center}.portal-correct{color:var(--ip-green-700);font-weight:bold}.portal-incorrect{color:var(--ip-red-700);font-weight:bold}
.portal-payment{display:grid;grid-template-columns:320px 1fr;gap:24px;align-items:start}.portal-payment img{max-width:100%;height:auto;border-radius:14px}
.portal-guide{padding-left:22px;display:grid;gap:14px}.portal-guide p{color:var(--ip-ink-3)}
.portal-live .ip-badge--danger{background:var(--ip-red-50);color:var(--ip-red-700);border-color:var(--ip-red-200)}
.portal-live .ip-tabs{flex-wrap:wrap}.portal-live #notice{overflow-wrap:anywhere}.portal-live .ip-auth-form>.ip-panel{margin-top:10px}
.portal-live{font-family:system-ui,-apple-system,'Segoe UI',sans-serif}.portal-live .ip-shell{min-height:100dvh}
.portal-live .ip-badge{display:inline-flex;align-items:center;gap:5px;border-radius:30px;padding:3px 9px;border:1px solid var(--ip-line);font-size:12px;font-weight:600;background:var(--ip-surface-2);color:var(--ip-ink-3)}
.portal-live .ip-badge--success{background:var(--ip-green-50);color:var(--ip-green-700);border-color:var(--ip-green-200)}.portal-live .ip-badge--warn{background:var(--ip-orange-50);color:var(--ip-orange-700);border-color:var(--ip-orange-100)}
.portal-live .portal-guide{padding-left:22px}
.portal-assessment .ip-shell{height:100dvh;overflow:hidden}.portal-assessment .ip-main{display:flex;min-height:0;overflow:hidden}.portal-assessment .ip-page{flex:1;min-height:0;width:100%}.portal-assessment .portal-content{flex:1;min-height:0}.portal-assessment .portal-review{flex:1;min-height:0;overflow:hidden}.portal-assessment #review-body{flex:1;min-height:0;overflow:auto}.portal-assessment .portal-savebar{position:static;flex-shrink:0}
@media(min-width:1024px){.portal-live .ip-side{position:sticky;top:0;height:100dvh;overflow-y:auto}.portal-live .ip-main{min-height:100dvh}}
@media(max-width:900px){.portal-payment{grid-template-columns:1fr}.portal-payment img{margin:auto}.portal-table td,.portal-table th{padding:10px 8px}.portal-review-grid{grid-template-columns:1fr}.portal-essay-edit{min-height:280px}}
@media(max-width:639px){.portal-content{gap:16px}.portal-fields{grid-template-columns:1fr}.portal-filters{display:grid;grid-template-columns:1fr 1fr}.portal-filters .ip-btn{min-height:44px;padding:8px;font-size:13px}.portal-test{gap:12px;padding:14px 0}.portal-test__action{flex-basis:100px}.portal-test h3{font-size:15px}.portal-test p{font-size:13px}.portal-test .ip-badge{white-space:normal;font-size:12px}.portal-test__action .ip-btn{font-size:13px;padding:10px 6px}.portal-savebar{bottom:66px;flex-wrap:wrap;padding:12px}.portal-savebar .ip-btn{flex:1}.portal-scores{grid-template-columns:repeat(3,minmax(0,1fr))}.portal-scores .ip-score__value{font-size:24px}.portal-table{font-size:13px}.portal-answer-table{table-layout:fixed}.portal-answer-table td,.portal-answer-table th{padding:8px 6px}.portal-answer-table th{font-size:11px}.portal-answer-table th:last-child{width:50px}.portal-answer-table th:first-child{width:30px}.portal-live .ip-account__actions>.ip-btn{min-width:40px}.portal-live .ip-auth-intro{text-align:center}}
@media(max-width:639px){.portal-table:not(.portal-answer-table) thead{display:none}.portal-table:not(.portal-answer-table) tbody{display:block}.portal-table:not(.portal-answer-table) tr{display:grid;grid-template-columns:minmax(0,1fr) 90px;gap:6px 12px;padding:12px 0;border-bottom:1px solid var(--ip-line)}.portal-table:not(.portal-answer-table) td{grid-column:1;padding:0;border:0;max-width:none}.portal-table:not(.portal-answer-table) td:last-child{grid-column:2;grid-row:1/5;align-self:center}.portal-table:not(.portal-answer-table) td:last-child .ip-btn{width:100%;padding:8px}.portal-assessment .ip-nav{display:none}.portal-assessment .ip-shell{grid-template-rows:auto minmax(0,1fr)}.portal-assessment .ip-main{padding-bottom:12px}}

/* Student overview: compact sections, independently scrollable long desktop lists. */
.portal-dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:stretch}
.portal-dashboard-group{overflow:hidden;display:flex;flex-direction:column;height:clamp(220px,calc((100dvh - 220px)/2),400px)}
.portal-dashboard-group .ip-panel__head{padding:12px 18px;flex-shrink:0}
.portal-dashboard-group h2{font-size:17px;line-height:1.4}
.portal-group-count{display:inline-block;margin-left:6px;color:var(--ip-ink-3);font-size:14px;font-weight:500}
.portal-dashboard-group .ip-panel__body{padding:14px 18px;flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable}
.portal-dashboard-group .ip-panel__body:focus-visible{outline:2px solid var(--ip-blue-600);outline-offset:-3px}
.portal-dashboard-group .portal-empty{padding:4px 0;margin:0;font-size:14px}
.portal-dashboard-group .portal-test{gap:12px;padding:14px 0}
.portal-dashboard-group .portal-test:first-child{padding-top:0}
.portal-dashboard-group .portal-test:last-child{padding-bottom:0}
.portal-dashboard-group .portal-test h3{font-size:16px}
.portal-dashboard-group .portal-test p{font-size:14px;margin:5px 0}
.portal-dashboard-group .portal-test__action{flex-basis:116px}
.portal-dashboard-group .portal-test__action .ip-btn{min-height:42px;padding:9px 10px;font-size:14px}
@container ip-main (max-width:740px){
 .portal-dashboard-grid{grid-template-columns:1fr;gap:16px}
 .portal-dashboard-group{height:auto}
 .portal-dashboard-group .ip-panel__body{flex:auto;max-height:none;overflow:visible;scrollbar-gutter:auto}
}

.portal-dashboard .portal-content{gap:14px}
.portal-dashboard .portal-content>.ip-row .ip-btn{min-height:36px;padding:7px 14px;font-size:14px;line-height:20px}
@media(pointer:coarse){.portal-dashboard .portal-content>.ip-row .ip-btn{min-height:44px}}
