.course-toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:24px 0}.course-toolbar select,.course-form input,.course-form textarea,.course-form select,.course-chat-row select{font:inherit;padding:10px 12px;border:1px solid var(--border-color,#7776);border-radius:10px;background:var(--card-bg,#fff);color:inherit;max-width:100%}.course-form{display:grid;gap:16px}.course-form label{display:grid;gap:6px}.course-form textarea{min-height:120px;resize:vertical}.course-dialog{width:min(560px,calc(100% - 32px));max-height:85dvh;overflow:auto;border:1px solid #7776;border-radius:20px;padding:24px;color:inherit;background:#fff}.course-dialog::backdrop{background:#0009}.course-dialog header{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px}.course-dialog h2{margin:0}.course-dialog button{cursor:pointer}.course-chat-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,220px);gap:16px;align-items:center;padding:16px 0;border-bottom:1px solid #7774}.course-chat-row a{color:inherit;overflow-wrap:anywhere}.course-chat-row select{width:100%}.research-list{display:grid;gap:12px}.research-list a{display:block;padding:18px;border:1px solid #7775;border-radius:14px;color:inherit;text-decoration:none}.research-list small{display:block;margin-top:8px;opacity:.7}.course-error{color:#b62e37}.research-shell{padding:20px clamp(16px,3vw,48px);max-width:1800px;margin:auto}.research-heading{display:flex;gap:16px;justify-content:space-between;align-items:start;flex-wrap:wrap}.research-heading h1{font-size:clamp(24px,3vw,38px);overflow-wrap:anywhere}.research-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(350px,.9fr);gap:24px;align-items:start}.research-document{min-width:0;line-height:1.7;background:#fff;border:1px solid #7774;border-radius:18px;padding:clamp(18px,3vw,40px);overflow-wrap:anywhere;max-height:78dvh;overflow:auto}.research-document pre{overflow:auto}.research-document img{max-width:100%}.research-document table{border-collapse:collapse}.research-document th,.research-document td{border:1px solid #7775;padding:8px}.research-document a{color:#6651c8}.research-chat{width:100%;height:78dvh;border:1px solid #7775;border-radius:18px}.research-question{padding:16px;border:1px solid #7775;border-radius:14px;margin:12px 0;display:grid;gap:10px}.research-question legend{padding:0 8px}.research-question label{display:flex;gap:8px;align-items:start}.research-question textarea{font:inherit;width:100%;min-height:80px;padding:10px;box-sizing:border-box;border-radius:10px;background:transparent;color:inherit}.research-status{padding:16px 0;min-height:1.5em}.research-actions{display:flex;gap:12px;flex-wrap:wrap}.research-sources{overflow-wrap:anywhere}.research-countdown{font-variant-numeric:tabular-nums}html[data-theme="dark"] .course-dialog,html[data-theme="dark"] .research-document,html[data-theme="dark"] .course-toolbar select,html[data-theme="dark"] .course-form input,html[data-theme="dark"] .course-form textarea,html[data-theme="dark"] .course-form select,html[data-theme="dark"] .course-chat-row select{background:#20202d;color:#f0eff8}body.dark-mode .course-dialog,body.dark-mode .research-document{background:#20202d;color:#f0eff8}@media(max-width:850px){.research-layout{grid-template-columns:1fr}.research-document{max-height:none}.research-chat{height:75dvh}.course-chat-row{grid-template-columns:1fr}.research-heading h1{margin-bottom:0}}
.research-shell [hidden],.course-dialog [hidden],#research-questions[hidden]{display:none!important}
.research-document h1{font-size:clamp(26px,2.8vw,40px);line-height:1.2;margin:0 0 24px;letter-spacing:-.02em}
.research-document h2{font-size:24px;line-height:1.3;margin:28px 0 12px}
.research-document h3{font-size:20px;line-height:1.4}

/* Research is a reading workspace, not a second full tutor page. */
.research-shell{--research-surface:#fff;--research-soft:#f4f2fb;--research-line:#dedce9;--research-muted:#626071;--research-accent:#5140ad;width:100%;max-width:1920px;box-sizing:border-box;padding:24px clamp(16px,3vw,48px) 32px}
.research-back{display:inline-flex;align-items:center;min-height:44px;color:var(--research-muted);font-size:.9rem;text-underline-offset:4px}
.research-heading{align-items:center;gap:20px;margin:8px 0 20px;flex-wrap:nowrap}
.research-title-group{min-width:0;flex:1}
.research-eyebrow{display:flex;align-items:center;gap:12px;margin:0 0 8px;color:var(--research-muted);font-size:.8rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
#research-depth:not(:empty){background:var(--research-soft);border:1px solid var(--research-line);border-radius:6px;padding:3px 8px;letter-spacing:0;text-transform:none}
.research-heading h1{font-family:inherit;font-size:clamp(24px,2.5vw,34px);line-height:1.25;letter-spacing:-.03em;margin:0;max-width:40ch}
.research-actions{gap:8px;flex-shrink:0}
.research-shell .button{min-height:44px;font-family:inherit;font-size:.875rem;white-space:normal;line-height:1.3}
.research-shell .button-secondary{background:var(--research-surface);color:inherit;border:1px solid var(--research-line);box-shadow:none}
.research-status-bar{display:flex;align-items:center;gap:12px;padding:14px 18px;margin-bottom:20px;background:var(--research-soft);border:1px solid var(--research-line);border-radius:12px}
.research-phase{flex-shrink:0;font-size:.8rem;font-weight:700;color:var(--research-accent)}
.research-status-bar .research-status{margin:0;padding:0;font-size:.9rem;line-height:1.5;min-height:0;overflow-wrap:anywhere}
.research-status-bar[data-state="failed"]{border-color:#b95059}
#research-notification-status:empty,#research-answer-error:empty{display:none}
#research-notification-status{margin:0 0 16px;font-size:.9rem}
.research-layout{grid-template-columns:minmax(0,1.15fr) minmax(360px,1fr);align-items:stretch;gap:20px}
.research-panel{min-width:0;overflow:hidden;background:var(--research-surface);border:1px solid var(--research-line);border-radius:16px;display:flex;flex-direction:column;height:clamp(480px,calc(100dvh - 350px),1000px)}
.research-shell[data-ready="false"] .research-panel{height:auto;min-height:380px}
.research-panel-heading{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;padding:16px 20px;border-bottom:1px solid var(--research-line);min-height:58px;box-sizing:border-box}
.research-panel-heading h2{font-family:inherit;font-size:1rem;letter-spacing:0;margin:0;line-height:1.5}
.research-panel-heading span{font-size:.75rem;color:var(--research-muted)}
.research-report-scroll{flex:1;overflow:auto;min-height:0;scrollbar-gutter:stable}
.research-panel .research-document{background:transparent;border:0;border-radius:0;padding:clamp(20px,2.6vw,40px);max-height:none;overflow:visible}
.research-document>:first-child{margin-top:0}
.research-document h1{font-family:inherit;font-size:clamp(24px,2.2vw,32px)}
.research-document h2{font-family:inherit;font-size:1.35rem}
.research-document h3{font-family:inherit;font-size:1.15rem}
.research-document :is(pre,table,.katex-display){max-width:100%;overflow-x:auto}
.research-document table{display:block;width:fit-content}
.research-document a,.research-sources a{color:var(--research-accent);text-underline-offset:3px}
.research-sources{padding:20px clamp(20px,2.6vw,40px);border-top:1px solid var(--research-line)}
.research-sources h2{font-family:inherit;font-size:1rem;font-weight:700;line-height:1.5;margin:0 0 12px}
.research-sources ul{padding-left:20px;margin:0;display:grid;gap:8px}
.research-sources li{font-size:.9rem;line-height:1.5}
.research-panel .research-chat{display:block;flex:1;min-height:0;height:100%;border:0;border-radius:0;background:var(--research-surface)}
.research-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;flex:1;padding:32px 16px;min-height:240px;box-sizing:border-box}
.research-empty-symbol{font-size:2rem;color:var(--research-accent);background:var(--research-soft);border-radius:16px;width:56px;height:56px;display:grid;place-items:center;margin-bottom:18px}
.research-empty :is(h2,h3){font-family:inherit;font-size:1.15rem;margin:0 0 12px;letter-spacing:0}
.research-empty p{color:var(--research-muted);font-size:.95rem;line-height:1.65;max-width:40ch;margin:0}
#research-questions{background:var(--research-surface);border:1px solid var(--research-line);border-radius:16px;padding:24px;margin:0 0 24px;max-width:900px}
.research-question-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.research-question-heading h2{font-family:inherit;font-size:1.25rem;margin:0}
.research-countdown{font-size:.8rem;background:var(--research-soft);padding:6px 10px;border-radius:8px}
#research-questions>p{font-size:.9rem;color:var(--research-muted);margin:12px 0 20px}
.research-question{min-width:0;border-color:var(--research-line);padding:16px;margin:16px 0}
.research-question legend{font-weight:600;overflow-wrap:anywhere}
.research-question label{min-height:44px;align-items:center;cursor:pointer}
.research-question label:has(textarea){display:grid;align-items:start;cursor:default}
.research-question input{accent-color:var(--research-accent);width:18px;height:18px;flex-shrink:0}
.research-question textarea{border:1px solid var(--research-line);min-height:100px;resize:vertical}
.research-view-switch{display:none}
.research-shell :is(button,a,textarea,input,[tabindex]):focus-visible{outline:3px solid var(--research-accent);outline-offset:3px}
html[data-theme="dark"] .research-shell{--research-surface:#20202d;--research-soft:#292638;--research-line:#464256;--research-muted:#c1bdce;--research-accent:#b6a7ff}
@media(max-width:1050px){.research-heading{flex-wrap:wrap}.research-actions{flex-shrink:1}.research-layout{grid-template-columns:minmax(0,1fr) minmax(340px,1fr)}}
@media(max-width:850px){
  .research-shell{padding-top:12px}.research-layout{grid-template-columns:minmax(0,1fr)}
  .research-heading{margin-top:4px}.research-title-group{flex-basis:100%}.research-heading h1{font-size:1.5rem}.research-status-bar{align-items:flex-start;flex-wrap:wrap}
  .research-view-switch{display:flex;gap:4px;padding:4px;margin:0 0 16px;border:1px solid var(--research-line);background:var(--research-soft);border-radius:12px}
  .research-view-switch button{font-family:inherit;font-size:.9rem;font-weight:600;line-height:1.4;flex:1;min-height:44px;border:0;border-radius:8px;padding:10px;color:inherit;background:transparent;cursor:pointer}
  .research-view-switch button[aria-pressed="true"]{background:var(--research-surface);box-shadow:0 1px 4px #0001}
  .research-view-switch button:disabled{color:var(--research-muted);cursor:not-allowed}
  .research-shell[data-view="report"] #research-discussion-panel,.research-shell[data-view="discussion"] #research-report-panel{display:none}
  .research-panel{height:auto;min-height:380px}.research-report-scroll{overflow:visible}
  #research-discussion-panel{height:80dvh;min-height:500px}.research-panel-heading{padding:14px 16px}
  #research-questions{padding:18px}.research-question{padding:12px}.research-empty{padding:24px 0}
}
.course-dialog header>[data-close-dialog]{width:44px;height:44px;flex-shrink:0;border:1px solid #7775;border-radius:10px;background:transparent;color:inherit;font-size:24px}
.course-dialog .research-eyebrow{font-size:.7rem;margin-bottom:8px}
.course-dialog h2{font-family:inherit;font-size:1.5rem;letter-spacing:-.02em}
.course-form>p:empty{display:none}
#research-depth-help{margin:0;font-size:.875rem;line-height:1.5}
.research-setup-note{border:1px solid #7774;border-radius:12px;padding:16px;font-size:.875rem;line-height:1.6}
.research-setup-note p{margin:8px 0 0}
.course-dialog .button{font-family:inherit;min-height:44px}
