/* Shared workspace layout. Content stays in normal page flow at every size. */
:root { --ink:#202e36; --muted:#596974; --paper:#f5f5f0; --line:#dfe3df; --green-700:#236554; --green-900:#194b40; --green-100:#e5efe9; --shadow:none; }
body { background:var(--paper); color:var(--ink); font-size:16px; line-height:1.6; }
button,input,textarea,select { font-family:inherit; }
button,a,input,textarea,select,summary { -webkit-tap-highlight-color:transparent; }
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible { outline:3px solid #967020; outline-offset:3px; }
button { touch-action:manipulation; }
h1,h2,h3,p,small { overflow-wrap:anywhere; }
.shell { grid-template-columns:224px minmax(0,1fr); }
.app-sidebar { background:#eef0ea; border-right:1px solid #d9dfd7; padding:28px 16px 20px; }
.brand { margin:0 8px 35px; font-size:19px; letter-spacing:-.06em; }
.brand-mark { background:#214d40; color:#fff; }
.primary-nav { gap:5px; margin-bottom:36px; }
.view-link { min-height:46px; padding:11px 12px; border-radius:8px; font-size:14px; color:#53635b; }
.view-link span { font-size:inherit; }
.view-link .view-icon { font-size:19px; flex:none; }
.view-link.active { background:#fff; color:#193d31; box-shadow:0 1px 3px #152e1610; }
.view-link.active::after { content:''; width:5px; height:5px; margin-left:auto; background:#28755b; border-radius:50%; }
.side-label,.eyebrow,.breadcrumb { color:#576b60; font-size:11px; font-weight:750; letter-spacing:.12em; }
.course { padding:10px 9px; min-width:0; }
.course > span:last-child { min-width:0; }
.course strong { font-size:14px; white-space:normal; }
.course small { color:#617269; font-size:12px; }
.course.active { background:#dce6dc; }
.sidebar-button { min-height:44px; font-size:13px; }
.sidebar-button:hover { color:#194b40; background:#e0e7df; }
.side-footer { border-top:1px solid #d9dfd7; margin-top:28px; padding-top:16px; }
.signed-in { color:#53635b; font-size:12px; }
.sign-out { min-height:44px; }
.mobile-course-bar { display:none; }
main { width:min(1160px,calc(100% - 80px)); min-width:0; padding:28px 0 64px; }
.workspace-caption { display:flex; align-items:center; gap:14px; border-bottom:1px solid var(--line); padding-bottom:18px; margin-bottom:30px; font-size:12px; color:#62746a; }
.workspace-caption > span:first-child { letter-spacing:.14em; font-size:10px; }
.workspace-caption > span:last-child::before { content:'/'; margin-right:14px; color:#9ca89e; }
.topline { gap:24px; margin-bottom:24px; }
.topline > div:first-child { min-width:0; }
h1 { font:500 clamp(32px,3.4vw,46px)/1.1 Georgia,serif; letter-spacing:-.045em; margin:10px 0 12px; color:#233c32; }
.subtitle { max-width:650px; color:#596b61; font-size:16px; line-height:1.55; }
.exam-chip { background:transparent; border:0; border-left:1px solid #d3dbd2; border-radius:0; min-width:120px; padding:4px 0 4px 22px; }
.exam-chip span { font-size:10px; color:#5e7065; }
.exam-chip strong { font-size:20px; }
.course-summary { font-size:13px; color:#52675c; gap:12px 24px; margin:0 0 28px; }
.overview-grid { display:grid; grid-template-columns:minmax(0,1fr) 280px; align-items:start; gap:20px; }
.panel { min-width:0; padding:26px; border:1px solid var(--line); border-radius:14px; box-shadow:none; background:#fff; }
.panel-head { flex-wrap:wrap; align-items:center; margin-bottom:24px; gap:16px; }
.panel-head > div:first-child { min-width:0; }
.panel-head h2 { font:650 22px/1.25 ui-sans-serif,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; letter-spacing:-.035em; color:#223a30; }
.panel-head .muted { color:#596b61; font-size:14px; max-width:580px; }
.focus-panel { grid-column:1; grid-row:1; display:block; padding:32px; background:#e9eee2; border-color:#d6dfce; position:relative; }
.focus-panel > div:first-child { min-width:0; }
.focus-panel h2 { max-width:660px; font:500 clamp(25px,2.3vw,34px)/1.2 Georgia,serif; margin:19px 0 14px; letter-spacing:-.035em; color:#243e2f; }
.focus-panel p { max-width:64ch; font-size:16px; color:#4a6052; line-height:1.65; }
.recommendation-signal { color:#4a6554; font-size:12px; font-weight:500; margin-top:9px; }
.recommendation-signal::before { color:#376146; background:#d9e5cf; }
.focus-actions { flex-wrap:wrap; gap:12px; margin-top:24px; }
.primary,.secondary { min-height:44px; padding:11px 16px; font-size:14px; border-radius:8px; }
.primary:hover { transform:none; }
.focus-actions .secondary { background:transparent; border-color:#b3c3ac; color:#2b4c36; }
.focus-side { display:flex; flex-direction:row; align-items:center; gap:20px; border-left:0; border-top:1px solid #cdd8c4; margin:28px 0 0; padding:18px 0 0; }
.focus-side > div { flex:1; min-width:0; }
.focus-side .eyebrow { font-size:10px; }
.focus-side strong { display:inline; font:650 18px/1.4 ui-sans-serif,sans-serif; }
.focus-side p { display:inline; font-size:12px; margin-left:6px; }
.focus-progress { margin:0; }
.focus-progress .progress-track { background:#cfdbc7; }
.refresh-recommendation { color:#31543c; font-size:12px; min-height:44px; margin-top:4px; }
.recommendation-details { margin-top:16px; }
summary { cursor:pointer; color:#355848; font-size:14px; min-height:44px; padding:10px 0; }
.focus-reason { font-size:14px !important; padding:8px 0; }
.overview-stats { grid-column:2; grid-row:1; display:flex; flex-direction:column; padding:24px; background:#fff; gap:0; }
.overview-stats > .eyebrow { margin-bottom:14px; }
.overview-stat { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:17px 0; border-bottom:1px solid var(--line); }
.overview-stat:last-child { border:0; padding-bottom:0; }
.overview-stat span { color:#5b6b61; font-size:13px; margin:0; }
.overview-stat strong { font:600 18px/1.4 ui-sans-serif,sans-serif; }
.study-tools { grid-column:1; grid-row:2; display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.study-tool { display:flex; align-items:center; gap:12px; min-width:0; padding:20px; border:1px solid var(--line); border-radius:12px; background:#fff; color:#254536; text-align:left; cursor:pointer; }
.study-tool:hover { border-color:#6e927b; background:#f9fbf5; }
.study-tool > span:nth-child(2) { flex:1; min-width:0; }
.study-tool strong { display:block; font-size:15px; font-weight:650; }
.study-tool small { display:block; color:#596b61; font-size:12px; margin-top:4px; }
.tool-icon { font-size:22px; }
.updates-panel { grid-column:1/-1; grid-row:3; background:transparent; border:0; border-top:1px solid var(--line); border-radius:0; padding:24px 0 0; }
.updates-panel .panel-head { margin-bottom:16px; }
.activity-feed { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:30px; }
.activity-feed > .empty-state { grid-column:1/-1; padding:16px 0; text-align:left; background:transparent; border:0; }
.activity-copy span { color:#617269; font-size:13px; overflow-wrap:anywhere; }
.activity-copy strong { font-size:14px; }
.activity-item { padding:14px 0; border-color:#e0e5dc; }
.workspace,.workspace:not(.tutor-view) { display:grid; grid-template-columns:minmax(0,1fr); }
.workspace .stack { min-width:0; gap:20px; }
.exam-prep,.practice { margin-top:0; }
.module-card { grid-template-columns:38px minmax(0,1fr) auto; padding:22px 0; border:0; border-top:1px solid var(--line); border-radius:0; gap:16px; }
.module-card:hover { box-shadow:none; border-color:#b6c8bb; }
.module-number { background:#f0f2eb; color:#466347; font-size:13px; }
.module-content h3 { font:650 18px/1.35 ui-sans-serif,sans-serif; letter-spacing:-.02em; }
.module-content p { font-size:15px; max-width:70ch; }
.concept { font-size:12px; border-radius:5px; background:#edf2e8; }
.module-meta { font-size:12px; color:#657269; overflow-wrap:anywhere; }
.module-actions { gap:2px; }
.module-actions button { min-height:44px; }
.complete-toggle { font-size:12px; }
.roadmap-progress { flex:0 1 230px; }
.secondary-detail > summary { border-top:1px solid var(--line); }
.concept-map { margin-top:14px; background:#f7f9f3; }
.concept-map-node { min-height:44px; font-size:13px; padding:7px 10px; }
.concept-map-module { font:600 16px/1.4 ui-sans-serif,sans-serif; }
.study-plan { margin-top:16px; }
.plan-session-title strong { white-space:normal; font:600 16px/1.4 ui-sans-serif,sans-serif; }
.plan-session p,.prep-empty p,.plan-tasks label { font-size:15px; }
.plan-session button { min-height:44px; }
.library-details > summary { font-size:13px; min-height:44px; }
.material-toolbar { margin-bottom:16px; }
.material { padding:22px 0; }
.material-name { font-size:16px; overflow-wrap:anywhere; }
.material small { white-space:normal; font-size:14px; color:#5a6c61; }
.material-actions { gap:14px; flex-wrap:wrap; }
.material-actions a,.material-actions button { display:inline-flex; align-items:center; min-height:44px; font-size:14px; }
.material .visual-status:empty { display:none; }
.material .visual-status { white-space:normal; }
.visual-page-form:not([hidden]) { grid-column:1/-1; display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin-left:38px; }
.visual-page-form label { display:flex; align-items:center; gap:8px; color:#425a4d; font-size:14px; }
.visual-page-form input { width:78px; min-height:44px; padding:8px; }
.drawer { padding:24px; border:1px solid #d4e0d4; border-radius:12px; background:#f4f7ee; }
input,select,textarea { min-width:0; font-size:16px; border-color:#cad4cb; }
label { font-size:12px; color:#53685b; }
.quiz-controls { grid-template-columns:minmax(0,1fr) minmax(0,1.6fr) 110px; background:#f0f3eb; border-radius:12px; padding:22px; margin-bottom:24px; }
.quiz-controls > div { min-width:0; }
.quiz-card { padding:24px; background:#fff; border-color:#d7dfd5; }
.panel.practice,.panel.exam-prep { background:#fff; border-color:var(--line); }
.practice-start { margin:0 0 24px; }
.quiz-choice { min-height:48px; font-size:16px; }
.quiz-answer { font-size:16px; }
.quiz-card .reveal { min-height:44px; }
.quiz-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:18px; }
.quiz-actions > button { min-height:44px; max-width:100%; padding:10px 14px; border:1px solid #c7d7cc; border-radius:8px; background:#fff; color:#245f49; font-size:15px; font-weight:700; line-height:1.3; white-space:normal; }
.quiz-actions > button:hover:not(:disabled) { border-color:#397960; background:#f0f7f1; }
.quiz-actions .save-review { margin:0; }
.quiz-actions .save-review:disabled { color:#537263; background:#f0f5ef; }
.handwritten-upload { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:10px 0 4px; }
.handwritten-upload .secondary { min-height:44px; max-width:100%; white-space:normal; }
.handwritten-upload span,.upload-help { color:#53685b; font-size:13px; line-height:1.45; }
.upload-help { margin:4px 0 16px; max-width:68ch; }
.empty-state { color:#5d7061; border-color:#d5ded1; font-size:15px; }
.workspace.tutor-view .panel.tutor { padding:0; border:1px solid #d5ddd2; background:#fff; height:auto; min-height:0; max-height:none; overflow:visible; }
.panel.tutor > .panel-head { margin:0; padding:22px 26px; border-bottom:1px solid var(--line); }
.tutor-layout { grid-template-columns:230px minmax(0,1fr); gap:0; }
.conversation-sidebar { padding:20px 14px; border:0; background:#f0f3ec; border-radius:0 0 0 14px; }
.conversation-sidebar-head { display:block; margin:0 0 14px; }
.conversation-sidebar-head .secondary { margin-top:12px; width:100%; min-height:44px; font-size:14px; }
#chat-history > summary { font-size:13px; }
.conversation-list { gap:10px; }
.conversation-item { display:block; overflow:visible; font-size:14px; color:#52675b; min-height:44px; }
.conversation-item.active { background:#dfeadd; color:#1e5139; }
.conversation-delete { width:36px; height:44px; color:#627467; margin:0; }
.conversation-row.confirming { gap:8px; padding:10px; }
.conversation-row.confirming .conversation-item { min-height:0; padding:4px 5px; color:#305c46; font-size:13px; font-weight:700; }
.conversation-delete-confirm { display:grid; gap:8px; padding:0; font-size:13px; }
.conversation-delete-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.conversation-confirm-delete,.conversation-cancel-delete { width:100%; min-height:44px; font-size:12px; line-height:1.2; padding:9px 6px; white-space:normal; }
.tutor-main { padding:24px; gap:14px; }
.mode-row { gap:8px; margin:0; }
.mode-row button { min-height:44px; font-size:14px; }
.mode-row #refresh-prompts { margin-left:auto; }
.suggestion-disclosure { border-bottom:1px solid var(--line); padding-bottom:5px; }
.tutor-map-disclosure { border-bottom:1px solid var(--line); padding:0 0 10px; }
.tutor-map-disclosure > summary { cursor:pointer; color:#285f49; font-size:14px; font-weight:700; line-height:1.4; padding:8px 0; }
.tutor-map-disclosure > p { margin:4px 0 12px; color:#5c6e61; font-size:14px; }
.tutor-map-disclosure .concept-map { margin-top:8px; }
.quick-prompts { margin:8px 0 14px; }
.quick-prompt { font-size:15px; padding:12px; background:#f4f7ee; }
.workspace.tutor-view .conversation-thread { min-height:230px; padding:0; gap:24px; background:transparent; border:0; border-radius:0; max-height:none; overflow:visible; }
.chat-message { max-width:92%; overflow-wrap:anywhere; }
.chat-bubble { font-size:16px; line-height:1.75; padding:16px 18px; }
.chat-message.assistant { max-width:100%; }
.chat-message.assistant .chat-bubble { border:0; padding:4px 0; background:transparent; }
.chat-role,.chat-sources { color:#596d61; font-size:12px; }
.chat-empty { padding:32px 12px; }
.chat-empty strong { font:500 28px/1.2 Georgia,serif; color:#2d4b37; }
.chat-empty span { max-width:40ch; font-size:15px; margin-top:12px; color:#596c60; }
#ask-form { margin:0; }
.composer { background:#f8faf5; border:1px solid #bbcbbb; padding:10px; align-items:end; }
.composer:focus-within { outline:2px solid #36654d; outline-offset:2px; }
.composer textarea { min-height:90px; background:transparent; }
.composer .ask-button { min-width:74px; min-height:44px; align-self:end; padding:12px; }
.answer-actions { gap:12px; margin-top:16px; align-items:center; }
.answer-actions button { min-height:44px; padding:10px 16px; font-size:14px; line-height:1.3; white-space:normal; }
.tutor-head-actions .eyebrow { font-size:11px; }
.toast { bottom:24px; }
@media (max-width:1150px) {
  main { width:calc(100% - 48px); }
  .overview-grid { grid-template-columns:minmax(0,1fr); }
  .overview-stats { grid-column:1; grid-row:2; flex-direction:row; flex-wrap:wrap; gap:16px 28px; }
  .overview-stats > .eyebrow { width:100%; margin:0; }
  .overview-stat { flex:1; padding:0; border:0; }
  .study-tools { grid-row:3; }
  .updates-panel { grid-row:4; }
  .tutor-layout { grid-template-columns:185px minmax(0,1fr); }
  .tutor-main { padding:20px; }
}
@media (max-width:800px) {
  .shell { display:block; }
  .app-sidebar { position:static; height:auto; padding:16px 20px; border-right:0; border-bottom:1px solid var(--line); overflow:visible; }
  .brand { margin:0 0 14px; font-size:18px; }
  .brand-mark { width:30px; height:30px; }
  .mobile-course-bar { display:flex; gap:10px; }
  #mobile-course { background:#fff; min-height:44px; flex:1; }
  #mobile-settings { min-width:44px; }
  .app-sidebar .side-label,.app-sidebar #course-list,.app-sidebar > .sidebar-button { display:none; }
  .app-sidebar.mobile-menu-open > .sidebar-button { display:inline-block; width:auto; margin:12px 8px 0 0; }
  .side-footer { position:absolute; right:20px; top:9px; margin:0; padding:0; border:0; }
  .signed-in { display:none; }
  .primary-nav { position:fixed; z-index:20; bottom:0; left:0; right:0; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); background:#fcfdf9; border-top:1px solid #cdd8c9; margin:0; padding:7px 8px calc(7px + env(safe-area-inset-bottom)); gap:3px; }
  .view-link { min-width:0; min-height:56px; flex-direction:column; gap:3px; justify-content:center; align-items:center; padding:5px 2px; font-size:12px; white-space:normal; }
  .view-link .view-icon { display:block; width:auto; font-size:19px; line-height:1; }
  .view-link.active { background:#e6eedf; box-shadow:none; }
  .view-link.active::after { display:none; }
  .nav-label-desktop { display:none; }
  .nav-label-mobile { display:inline !important; }
  main { width:calc(100% - 36px); padding:22px 0 108px; }
  .workspace-caption { display:none; }
  .topline { display:block; }
  .exam-chip { display:none; }
  h1 { font-size:36px; }
  .subtitle { font-size:16px; }
  .course-summary { gap:6px 14px; margin-bottom:20px; }
  .focus-panel { padding:24px; }
  .focus-panel h2 { font-size:29px; }
  .focus-side { margin-top:22px; gap:16px; }
  .focus-side p { display:block; margin-left:0; }
  .overview-stats { padding:20px; }
  .overview-stat { flex-basis:100%; }
  .study-tools { grid-template-columns:1fr; }
  .activity-feed { grid-template-columns:1fr; }
  .panel { padding:20px; }
  .panel-head { flex-wrap:wrap; gap:14px; }
  .panel-head h2 { font-size:21px; }
  .module-card { grid-template-columns:32px minmax(0,1fr); gap:12px; padding:20px 0; }
  .module-actions { grid-column:2; display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; }
  .material { grid-template-columns:1fr; gap:4px; }
  .material-actions { margin-left:38px; }
  .quiz-controls { grid-template-columns:minmax(0,1fr) 90px; padding:16px; gap:18px 12px; }
  .quiz-controls > div:nth-child(2) { grid-row:2; grid-column:1/-1; }
  .quiz-controls > div:nth-child(3) { grid-row:1; grid-column:2; }
  .concept-map-branches { grid-template-columns:1fr; }
  .concept-map-branches::before,.concept-map-branch::before { display:none; }
  .tutor-layout { grid-template-columns:minmax(0,1fr); }
  .conversation-sidebar { order:0; padding:16px 18px; border-radius:0; border-bottom:1px solid var(--line); }
  .conversation-sidebar-head { display:flex; align-items:center; margin:0; }
  .conversation-sidebar-head .secondary { margin:0; width:auto; }
  .conversation-list { display:grid; overflow:visible; }
  .conversation-row { width:auto; }
  .conversation-item { width:100%; }
  .tutor-main { padding:18px; }
  .panel.tutor > .panel-head { display:none; }
  .workspace.tutor-view .tutor-layout { min-height:0; }
  .workspace.tutor-view .conversation-thread { min-height:120px; }
  .chat-empty { padding:16px 0; }
  .chat-empty strong { font-size:24px; }
  .chat-empty span { font-size:14px; }
  .mode-row #refresh-prompts { margin-left:0; }
  .chat-message { max-width:100%; }
  .chat-bubble { padding:14px; }
  .composer { grid-template-columns:minmax(0,1fr); }
  .composer .ask-button { justify-self:end; min-width:88px; }
  .composer textarea { min-height:86px; resize:vertical; }
  .drawer { padding:16px; }
  .drawer-actions { flex-wrap:wrap; }
  .toast { bottom:90px; }
}
@media (max-width:600px) {
  .answer-actions { flex-direction:column; align-items:stretch; }
  .answer-actions button { width:100%; }
}
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } *,*::before,*::after { animation:none !important; transition:none !important; } }
