/* Scope the approved dashboard theme to the first authenticated screen. */
body:has(#rooms-view:not(.hidden)){--ink:#2c2037;--muted:#776681;--line:#ded3e5;--paper:#f5f1f8;background:var(--paper);color:var(--ink);font-family:Meet Arabic,Tahoma,Arial,sans-serif}
body:has(#rooms-view:not(.hidden))>.topbar{height:80px;padding:0 clamp(24px,5vw,80px);background:#492a58;border:0;position:relative;isolation:isolate;overflow:hidden;gap:16px}
body:has(#rooms-view:not(.hidden))>.topbar::before,body:has(#rooms-view:not(.hidden))>.topbar::after{content:"";position:absolute;pointer-events:none;width:380px;height:380px;border:1px solid #aa8bb47a;border-radius:50%;right:-20px;top:-260px;z-index:-1}
body:has(#rooms-view:not(.hidden))>.topbar::after{width:320px;height:320px;right:200px;top:-170px}
body:has(#rooms-view:not(.hidden))>.topbar .brand{font:600 27px/1.2 Arial,sans-serif;letter-spacing:-.6px;color:#fff;gap:12px}
body:has(#rooms-view:not(.hidden))>.topbar .brand-mark{height:44px;width:44px;border-radius:11px;background:#fff;color:#492a58;font:700 38px/1 Arial,sans-serif;padding-bottom:8px}
body:has(#rooms-view:not(.hidden))>.topbar .brand-mark>span{color:#492a58;right:6px;top:0;font-size:16px}
body:has(#rooms-view:not(.hidden))>.topbar .top-label{display:none}
body:has(#rooms-view:not(.hidden))>.topbar #logout{margin-inline-start:auto;color:#fff;font:400 16px/1.7 Meet Arabic,Tahoma,Arial,sans-serif;padding:10px 0}
body:has(#rooms-view:not(.hidden))>main{width:calc(100% - clamp(40px,12vw,160px));max-width:1280px;padding:28px 0 32px;min-height:calc(100svh - 80px)}
body:has(#rooms-view:not(.hidden))>footer{display:none}
#rooms-view .dashboard-welcome{margin:0 0 6px;color:#693d7f;font-size:18px;font-weight:600;line-height:1.7;overflow-wrap:anywhere}
#rooms-view .dashboard-heading{margin:0 0 24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
#rooms-view .dashboard-heading h1{font-size:36px;font-weight:600;line-height:1.5;margin:0;letter-spacing:normal}
.dashboard-icon{width:22px;height:22px;flex:0 0 22px;vertical-align:middle}
.dashboard-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:10px;font-size:13px;font-weight:600;line-height:1.6;color:#65556e;background:#eee8f2;white-space:nowrap}
.dashboard-badge .dashboard-icon{width:18px;height:18px;flex-basis:18px}
.dashboard-badge[data-tone=ready]{color:#137365;background:#def1ec}
.dashboard-badge[data-tone=pending]{color:#8c5a1c;background:#faecd7}
#rooms-view .training-banner{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:18px 24px;margin:0 0 20px;background:#fff;border:1px solid #cbb6d7;border-radius:12px;min-height:96px}
#rooms-view .training-copy{display:flex;align-items:center;gap:16px;min-width:0}
#rooms-view .training-icon{display:grid;place-items:center;width:52px;height:52px;flex:0 0 52px;border-radius:12px;background:#eee5f4;color:#693d7f}
#rooms-view .training-icon svg{width:30px;height:30px}
#rooms-view .training-banner h2{font-size:23px;font-weight:600;line-height:1.5;margin:0 0 3px;letter-spacing:normal}
#rooms-view .training-banner p{font-size:14px;line-height:1.7;margin:0;color:var(--muted)}
#rooms-view .training-actions{display:flex;align-items:center;gap:24px;flex-shrink:0}
#rooms-view .training-counts{display:flex;flex-direction:column;gap:3px;color:var(--muted);font-size:13px;line-height:1.6}
#rooms-view #training-attempt-count{font-size:11px}
#rooms-view .training-link{display:inline-flex;align-items:center;justify-content:center;min-height:46px;min-width:148px;flex-shrink:0;padding:8px 20px;border:1.5px solid #693d7f;background:#fff;color:#693d7f;border-radius:9px;text-decoration:none;font-size:17px;font-weight:600;margin:0;width:auto}
#rooms-view .room-group-tabs{display:flex;flex-wrap:nowrap;gap:6px;margin:0 0 22px;border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:thin;padding:0;min-width:0}
#rooms-view .room-group-tab{flex:0 0 auto;border:0;border-bottom:3px solid transparent;border-radius:9px 9px 0 0;background:transparent;font-size:16px;font-weight:400;padding:10px 22px 12px;white-space:nowrap;max-width:none;color:var(--muted);overflow-wrap:normal}
#rooms-view .room-group-tab[aria-selected=true]{background:#e7d7ef;color:#693d7f;border-bottom-color:#693d7f;font-weight:600}
#rooms-view .room-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
#rooms-view .room-card{display:flex;flex-direction:column;min-width:0;max-width:none;min-height:244px;padding:22px;border:1px solid var(--line);border-radius:12px;background:#fff;gap:16px}
#rooms-view .room-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
#rooms-view .room-title{display:flex;align-items:center;gap:12px;min-width:0}
#rooms-view .room-icon{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border-radius:10px;background:#eee5f4;color:#693d7f}
#rooms-view .room-icon svg{width:26px;height:26px}
#rooms-view .room-card h2{font-size:23px;line-height:1.55;font-weight:600;letter-spacing:normal;margin:0;overflow-wrap:anywhere}
#rooms-view .room-heading .dashboard-badge{font-size:12px;padding:5px 9px;margin-top:3px}
html[dir=rtl] #rooms-view .room-card .metadata{display:flex;flex-wrap:wrap;gap:12px 24px;margin:0;color:var(--muted);font-size:15px;line-height:1.6}
#rooms-view .room-meta{display:inline-flex;align-items:center;gap:8px}
#rooms-view .room-meta+.room-meta{border-inline-start:1px solid var(--line);padding-inline-start:22px}
#rooms-view .room-attempt-info{border:0;padding:0;margin:0;color:var(--muted);font-size:14px}
#rooms-view .room-attempt-info p{margin:0 0 4px;font-size:14px;line-height:1.6}
#rooms-view .room-attempt-info p:last-child{margin-bottom:0}
#rooms-view .room-description{font-size:13px;color:var(--muted);line-height:1.7}
#rooms-view .room-description summary{cursor:pointer;width:fit-content;color:#693d7f}
#rooms-view .room-description p{margin:8px 0 0;font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere}
#rooms-view .primary{background:#693d7f;color:#fff;min-height:48px;border-radius:9px;font-size:17px;font-weight:600;line-height:1.6;margin-top:auto;padding:10px 16px}
#rooms-view .primary:hover:enabled{background:#57316c;transform:none}
#rooms-view .primary:disabled{background:#e1dae8;color:#776b7e;opacity:1}
#rooms-view #room-group-empty{font-size:15px;border-color:var(--line);border-radius:12px;padding:22px;margin:0}
#rooms-view #room-error{font-size:13px;line-height:1.7;margin:12px 0 0}
#rooms-view #room-error:empty{display:none}
#rooms-view .student-history{margin:24px 0 0;padding:0;border:0}
#rooms-view .student-history>h2{font-size:28px;line-height:1.5;font-weight:600;margin:0 0 14px;letter-spacing:normal}
#rooms-view .attempt-list{overflow:hidden;border:1px solid var(--line);border-radius:12px;background:#fff}
#rooms-view .attempt-card{display:grid;grid-template-columns:minmax(180px,1.7fr) minmax(110px,1fr) minmax(115px,auto) minmax(60px,.5fr) auto;gap:14px;align-items:center;padding:15px 22px}
#rooms-view .attempt-card+.attempt-card{border-top:1px solid var(--line)}
#rooms-view .history-title{min-width:0}
#rooms-view .history-title h3{font-size:17px;line-height:1.6;font-weight:600;margin:0;overflow-wrap:anywhere}
#rooms-view .history-date{font-size:11px;color:var(--muted);line-height:1.6;margin:3px 0 0}
#rooms-view .history-recording{display:flex;align-items:center;gap:7px;font-size:13px;line-height:1.6;margin:0;color:var(--muted);min-width:0}
#rooms-view .history-recording svg{width:20px;height:20px;flex-basis:20px}
#rooms-view .history-status{justify-self:start;font-size:12px;padding:5px 9px}
#rooms-view .attempt-result{font-size:16px;font-weight:600;font-variant-numeric:tabular-nums;text-align:center;margin:0;white-space:nowrap}
#rooms-view .attempt-review{display:inline-flex;align-items:center;justify-content:center;min-height:40px;min-width:130px;padding:5px 16px;margin:0;border:1.5px solid #693d7f;border-radius:8px;background:#fff;color:#693d7f;text-decoration:none;font-size:14px;font-weight:600;line-height:1.6;white-space:nowrap}
#rooms-view .history-resume-note{font-size:12px;line-height:1.6;color:var(--muted);margin:0;max-width:130px}
#rooms-view .history-empty,#rooms-view .attempt-list>.error{padding:20px 22px;margin:0;font-size:14px;color:var(--muted)}
#rooms-view .attempt-list>.error{color:#a72f48}
#rooms-view .dashboard-tip{display:flex;justify-content:center;align-items:flex-start;gap:8px;font-size:14px;line-height:1.7;color:var(--muted);margin:20px 0 0}
#rooms-view .dashboard-tip svg{width:20px;height:20px;flex-basis:20px;margin-top:2px}
#rooms-view :is(button,a,summary):focus-visible{outline:3px solid #8e64a1;outline-offset:3px}
@media(max-width:1000px){
  #rooms-view .training-actions{gap:14px}
  #rooms-view .training-counts{font-size:12px}
  #rooms-view .training-link{min-width:125px;font-size:16px}
  #rooms-view .room-heading{flex-wrap:wrap}
  #rooms-view .room-title{width:100%}
  #rooms-view .attempt-card{grid-template-columns:minmax(145px,1.6fr) minmax(90px,1fr) auto auto auto;gap:10px;padding:14px}
  #rooms-view .history-recording{font-size:12px}
  #rooms-view .attempt-review{min-width:110px;padding-inline:10px}
}
@media(max-width:700px){
  body:has(#rooms-view:not(.hidden))>.topbar{height:72px;padding:0 20px}
  body:has(#rooms-view:not(.hidden))>.topbar .brand{font-size:22px;gap:9px}
  body:has(#rooms-view:not(.hidden))>.topbar .brand-mark{width:36px;height:36px;font-size:32px;border-radius:9px;padding-bottom:7px}
  body:has(#rooms-view:not(.hidden))>.topbar .brand-mark>span{font-size:14px;right:5px;top:-1px}
  body:has(#rooms-view:not(.hidden))>.topbar #logout{font-size:13px}
  body:has(#rooms-view:not(.hidden))>main{width:calc(100% - 40px);padding:22px 0 28px;min-height:calc(100svh - 72px)}
  #rooms-view .dashboard-heading{gap:10px;margin-bottom:20px}
  #rooms-view .dashboard-welcome{font-size:16px}
  #rooms-view .dashboard-heading h1{font-size:29px}
  #rooms-view #controller-status{font-size:11px;padding:5px 8px;gap:3px}
  #rooms-view .training-banner{display:flex;flex-direction:column;align-items:stretch;padding:16px;gap:16px}
  #rooms-view .training-copy{gap:12px}
  #rooms-view .training-icon{width:44px;height:44px;flex-basis:44px}
  #rooms-view .training-icon svg{width:26px;height:26px}
  #rooms-view .training-banner h2{font-size:21px}
  #rooms-view .training-banner p{font-size:13px}
  #rooms-view .training-actions{justify-content:space-between;gap:10px}
  #rooms-view .training-link{min-width:126px;min-height:44px;font-size:16px;padding:8px 14px}
  #rooms-view .room-group-tabs{margin-bottom:18px}
  #rooms-view .room-group-tab{font-size:14px;padding:10px 15px}
  #rooms-view .room-grid{grid-template-columns:minmax(0,1fr);gap:16px}
  #rooms-view .room-card{padding:18px;gap:14px;min-height:232px}
  #rooms-view .room-heading{gap:10px}
  #rooms-view .room-card h2{font-size:22px}
  #rooms-view .room-icon{width:40px;height:40px;flex-basis:40px}
  #rooms-view .room-heading .dashboard-badge{margin-top:0}
  #rooms-view .room-title{width:auto}
  #rooms-view .room-card .primary{font-size:17px}
  #rooms-view .student-history>h2{font-size:25px}
  #rooms-view .attempt-card{grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:16px}
  #rooms-view .history-title{grid-column:1/-1}
  #rooms-view .history-title h3{font-size:18px}
  #rooms-view .history-recording{grid-column:1;grid-row:2}
  #rooms-view .history-status{grid-column:2;grid-row:2;justify-self:end}
  #rooms-view .attempt-result{grid-column:1;grid-row:3;text-align:start;justify-self:start}
  #rooms-view .attempt-review,#rooms-view .history-resume-note{grid-column:2;grid-row:3;justify-self:end}
  #rooms-view .attempt-review{font-size:14px;min-width:120px;min-height:40px}
  #rooms-view .dashboard-tip{font-size:12px;justify-content:flex-start;margin-top:18px}
}

#rooms-view .attempt-group{display:grid;gap:0;margin-bottom:18px}#rooms-view .attempt-group>.attempt-card{margin-bottom:0;border-color:#c9b2d6}#rooms-view .last-valid-label{color:var(--action,#744486);font-size:13px;font-weight:600;margin:7px 0 0}#rooms-view .previous-attempts{border:1px solid #ded3e5;border-top:0;border-radius:0 0 12px 12px;background:#fcf9fd;padding:16px}#rooms-view .previous-attempts>summary{cursor:pointer;color:#684078;font-size:14px;font-weight:600}#rooms-view .previous-attempts[open]>summary{margin-bottom:16px}#rooms-view .previous-attempts .attempt-card{background:white;margin:10px 0}#rooms-view .attempt-recovery{grid-column:1/-1}.recovery-message{font-size:13px;line-height:1.8;margin:8px 0}.recovery-button{margin-top:8px}.attempt-review-page #attempt-recovery:empty{display:none}
