/* State visibility is a functional invariant, not a decorative override. */
.view:not(.active), .view[hidden] { display:none!important; }
@layer legacy {
/* Desktop workspace; mobile retains the existing single-column portal. */
.view:not(.active), .view[hidden] { display:none; }
.history-controls { display:flex; flex-wrap:wrap; align-items:center; gap:16px; padding:16px; }
.history-controls label { flex:1 1 200px; font-size:13px; color:var(--ink-mute); }
.history-controls select { margin-bottom:0; font-size:14px; }
.history-note { padding:0 16px 16px; color:var(--ink-mute); font-size:13px; line-height:1.6; }
.history-row { display:flex; align-items:center; gap:16px; padding:18px 16px; border-top:1px solid var(--line); flex-wrap:wrap; }
.history-row>div { flex:1 1 220px; min-width:0; }
.history-row strong { overflow-wrap:anywhere; }
.history-row p { margin:6px 0 0; font-size:12px; color:var(--ink-mute); }
.submit-confirmation { grid-column:1/-1; padding:20px; border:1px solid var(--brand); background:var(--surface); border-radius:12px; margin:12px 0; }
.submit-confirmation[hidden] { display:none; }
.submit-confirmation h3 { margin:0 0 10px; }
.submit-confirmation p { line-height:1.6; margin-bottom:16px; }
.submit-confirmation button { margin:4px 8px 4px 0; min-height:44px; }
.submit-confirmation .submit-review-actions{display:flex;flex-wrap:wrap;gap:12px;padding:16px 0;margin:0 0 16px;border-top:1px solid var(--line,#dce3ec);border-bottom:1px solid var(--line,#dce3ec)}
.submit-confirmation .submit-review-actions button{margin:0;background:#fff;color:var(--ink,#172c43);border:1px solid #b9c7d5;border-radius:8px;padding:10px 14px;min-height:44px}
.submit-confirmation .submit-review-actions button:disabled{opacity:.55;cursor:not-allowed}
.submit-confirmation .submit-review-actions button:focus-visible{outline:3px solid var(--brand);outline-offset:3px}
@media(max-width:600px){.submit-confirmation .submit-review-actions{display:grid;grid-template-columns:minmax(0,1fr)}.submit-confirmation .submit-review-actions button{width:100%;text-align:left}}
#study-tools, #exam-recovery { min-width:0; margin:0 0 24px; }
.student-workspace { display:grid; grid-template-columns:minmax(0,1fr); gap:24px; padding:0 20px; }
.student-workspace-main, .student-workspace-study { min-width:0; }
.student-workspace-main>.figma-section-row { margin-top:0; }
.student-workspace-main>.section-title { margin:28px 0 14px; }
.student-workspace-study .figma-practice-card { flex-direction:column; align-items:stretch; }
.student-workspace-study .figma-practice-button { min-height:44px; }
#view-dashboard.figma-student-dashboard { box-sizing:border-box; }
#study-tools .figma-practice-card { margin-top:0; margin-bottom:16px; }
#study-tools ul { color:var(--ink); padding-left:20px; line-height:1.6; }
#study-tools .figma-practice-card { background:var(--surface); border:1px solid var(--line); }
#study-tools .figma-practice-card h3 { color:var(--ink); }
#study-tools .figma-practice-card p { color:var(--ink-mute); line-height:1.6; }
#exam-save-status { margin:12px 0 20px; padding:12px 16px; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:10px; font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
.topic-practice-select { width:100%; padding:12px; margin:12px 0; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--ink); font:inherit; min-width:0; }
#study-tools button:disabled { opacity:.5; cursor:not-allowed; }
#study-tools button:focus-visible, .topic-practice-select:focus-visible { outline:3px solid var(--brand); outline-offset:3px; }
#study-tools .figma-practice-card>div { min-width:0; width:100%; }
@media(min-width:1000px) {
  #view-dashboard.figma-student-dashboard { width:100%; max-width:1480px; margin:0 auto; padding:32px clamp(24px,3vw,48px) 56px; }
  #view-dashboard.active { display:block; }
  #view-dashboard>.figma-student-heading { padding:0 0 24px; background:transparent; margin:0 0 24px; }
  #view-dashboard>.figma-student-stats { padding:0 0 28px; gap:20px; }
  .student-workspace { grid-template-columns:minmax(0,1fr) minmax(300px,340px); align-items:start; gap:28px; padding:0; }
  #study-tools .figma-practice-card { flex-direction:column; align-items:stretch; padding:24px; }
  #view-dashboard .card-table { overflow-x:auto; }
  #view-login .login-wrap { margin:0 auto; max-width:1280px; min-height:calc(100dvh - 112px); padding:24px; align-items:center; grid-template-columns:minmax(0,1fr) minmax(380px,480px); gap:64px; }
  #view-login .portal-welcome { padding-top:0; }
  #view-results { margin:0 auto; max-width:1100px; padding:32px clamp(24px,3vw,48px); }
}
@media(max-width:599px) {
  #study-tools, #exam-recovery { margin-left:0; margin-right:0; }
  #study-tools .figma-practice-button, #exam-recovery .figma-practice-button { width:100%; min-height:44px; white-space:normal; }
  #view-dashboard .card-table { overflow-x:auto; }
}
}
.student-pin-help{margin-top:16px;border-top:1px solid #dce3ec;padding-top:8px;text-align:left}
.student-pin-help summary{cursor:pointer;min-height:44px;align-content:center;color:#2854aa;font-size:15px;font-weight:600}
.student-pin-help p{font-size:14px;line-height:1.7;color:#52647a;margin:8px 0}
.student-pin-help a{display:inline-flex;align-items:center;min-height:44px;color:#2854aa;font-size:14px;line-height:1.6;text-underline-offset:3px}
.student-pin-help :is(summary,a):focus-visible{outline:3px solid #4678dc;outline-offset:3px}
