/* Shared learning workspace palette, with one aligned reading and composing column. */
.toc-product #chat-input:focus-visible{outline:none}
.chat-thinking{margin:0 0 14px;border:1px solid var(--line,#e2e7eb);border-radius:8px;background:#f8faf9;color:var(--muted,#606b78);min-width:0}
.chat-thinking>summary{display:flex;align-items:center;gap:8px;min-height:44px;padding:8px 12px;list-style:none;cursor:pointer;font-size:12px}.chat-thinking>summary::-webkit-details-marker{display:none}.chat-thinking>summary:before{content:'›';font-size:18px;line-height:1}.chat-thinking[open]>summary:before{transform:rotate(90deg)}
.chat-thinking-content{white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;overflow:auto;overscroll-behavior:contain;padding:0 12px 12px;font-size:13px;line-height:1.7;outline-offset:-3px}
#chat-view .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.chat-history-open .chat-heading>[data-chat="new"]{display:none}
.chat-mobile-entry{display:none!important}
@media(max-width:999px){.chat-mobile-entry{display:inline-flex!important}.is-chat-view .chat-mobile-entry{display:none!important}}
.is-chat-view main.wrap{padding:18px 24px 24px}
.chat-layout{--chat-width:1100px;position:relative;display:grid;grid-template-columns:minmax(0,1fr);height:calc(100dvh - 104px);min-height:320px;background:white;border:1px solid var(--line,#e2e7eb);border-radius:12px;overflow:hidden;color:var(--ink,#202b36)}
.chat-main{display:flex;flex-direction:column;min-width:0;min-height:0}
.chat-heading{display:flex;gap:12px;align-items:center;padding:10px 20px;border-bottom:1px solid var(--line,#e2e7eb);min-height:68px;flex:none}
.chat-heading-title{flex:1;min-width:0}.chat-heading h1{font-size:16px;font-weight:650;line-height:1.4;margin:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.chat-heading p{font-size:12px;color:var(--muted,#606b78);margin:3px 0 0}
.toc-product .chat-icon-button{width:44px;height:44px;min-height:44px;display:inline-flex;justify-content:center;align-items:center;padding:10px;border:0;background:transparent;flex:none}.chat-icon-button:hover{background:var(--soft,#eaf5ee)}.chat-icon-button .px-icon{width:20px;height:20px}
.chat-menu{position:relative;flex:none}.chat-menu summary{width:44px;height:44px;display:grid;place-items:center;cursor:pointer;list-style:none;border-radius:8px}.chat-menu summary::-webkit-details-marker{display:none}.chat-menu summary:hover{background:var(--soft,#eaf5ee)}.chat-menu>div{position:absolute;right:0;top:48px;z-index:4;min-width:160px;padding:6px;background:white;border:1px solid var(--line,#e2e7eb);border-radius:10px;box-shadow:0 8px 28px #202b3614}.chat-menu button{display:block;width:100%;text-align:left;background:none;border:0;min-height:44px}.chat-menu button:last-child{color:#a13939}
.chat-reading{position:relative;display:flex;min-height:0;flex:1}.chat-log{flex:1;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:28px max(24px,calc((100% - var(--chat-width))/2));min-width:0;outline-offset:-4px}
.chat-turn{margin:0 auto 32px;width:100%;max-width:var(--chat-width)}.chat-message{min-width:0}.chat-user{display:flex;justify-content:flex-end;margin:0 0 22px}.chat-user-content{max-width:85%;padding:12px 18px;background:#f0f5f2;border-radius:14px 14px 3px 14px}.chat-user-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.75}.chat-context-caption{display:block;font-size:11px;color:var(--green,#177653);margin-top:7px}
.chat-assistant{display:grid;grid-template-columns:28px minmax(0,1fr);gap:12px}.chat-speaker{width:28px;height:28px;display:grid;place-items:center;color:var(--green,#177653);background:var(--soft,#eaf5ee);border-radius:8px}.chat-speaker .px-icon{width:18px;height:18px}.chat-response{min-width:0}.chat-answer:empty{display:none}.chat-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.85}
.chat-markdown{font-size:15px;line-height:1.85;overflow-wrap:anywhere;color:var(--ink,#202b36)}.chat-markdown>:first-child{margin-top:0}.chat-markdown>:last-child{margin-bottom:0}.chat-markdown p{margin:0 0 14px}.chat-markdown h1,.chat-markdown h2,.chat-markdown h3,.chat-markdown h4{margin:22px 0 10px;line-height:1.5;font-weight:650}.chat-markdown h1{font-size:21px}.chat-markdown h2{font-size:19px}.chat-markdown h3{font-size:17px}.chat-markdown ul,.chat-markdown ol{padding-left:24px;margin:10px 0 16px}.chat-markdown li{margin:4px 0}.chat-markdown blockquote{margin:12px 0;padding:3px 16px;border-left:3px solid #a8cab6;color:var(--muted,#606b78)}.chat-markdown table{display:block;max-width:100%;overflow:auto;border-collapse:collapse;margin:14px 0}.chat-markdown th,.chat-markdown td{padding:8px 12px;border:1px solid var(--line,#e2e7eb);text-align:left;white-space:normal}.chat-markdown th{background:#f5f7f8}.chat-markdown :not(pre)>code{padding:2px 5px;background:#f1f3f4;border-radius:4px;font-size:.9em;color:#32644c}.chat-markdown pre{max-width:100%;overflow:auto;background:#f7f9fa;border:1px solid var(--line,#e2e7eb);border-radius:9px;padding:0;margin:14px 0;font-size:13px;line-height:1.7}.chat-markdown pre code{display:block;padding:14px 16px;background:transparent;white-space:pre;overflow-wrap:normal}.chat-code-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:3px 9px 3px 16px;border-bottom:1px solid var(--line,#e2e7eb);font-size:12px;color:var(--muted,#606b78)}.chat-code-toolbar button{display:flex;align-items:center;gap:5px;background:none;border:0;min-height:38px;padding:6px}.chat-code-toolbar .px-icon{width:15px;height:15px}.chat-markdown .katex-display{overflow-x:auto;overflow-y:hidden;padding:6px 0;max-width:100%}.chat-markdown .katex{font-size:1.1em}
.chat-empty{max-width:800px;margin:clamp(25px,8vh,110px) auto 24px}.chat-emblem{display:grid;place-items:center;background:var(--soft,#eaf5ee);color:var(--green,#177653);width:48px;height:48px;border-radius:14px;margin-bottom:24px}.chat-emblem .px-icon{width:26px;height:26px}.chat-welcome-kicker{font-size:12px;color:var(--green,#177653);letter-spacing:.04em}.chat-empty h2{font-size:clamp(26px,2.2vw,36px);line-height:1.4;margin:8px 0 12px;letter-spacing:-.025em}.chat-empty>p:last-of-type{font-size:14px;line-height:1.8;color:var(--muted,#606b78);max-width:55ch}.chat-starters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:30px}.chat-starters button{text-align:left;border:1px solid var(--line,#e2e7eb);background:white;border-radius:10px;padding:16px;min-height:92px}.chat-starters button:hover{border-color:#9bbfac;background:#f8fbf9}.chat-starters strong{font-size:14px;font-weight:600;display:block}.chat-starters span{display:block;font-size:12px;color:var(--muted,#606b78);margin-top:6px}
.chat-compose{flex:none;padding:8px 24px 12px;background:white}.chat-compose-inner{width:100%;max-width:var(--chat-width);margin:auto}.chat-compose form{display:flex;flex-direction:column;border:1px solid #cfdcd4;border-radius:12px;padding:12px 12px 9px;box-shadow:0 2px 8px #202b3605}.chat-compose form:focus-within{border-color:var(--green,#177653);box-shadow:0 0 0 2px #1776530b}.chat-compose textarea{width:100%;border:0!important;box-shadow:none!important;background:transparent;resize:none;min-height:48px;max-height:180px;padding:0 3px;line-height:1.65;font-size:14px;outline:none}.chat-compose-tools{display:flex;align-items:center;gap:8px;margin-top:5px}.chat-compose-tools>div{display:flex;align-items:center;gap:4px;flex:1;min-width:0}.toc-product .chat-input-tool{display:flex;align-items:center;gap:6px;min-height:44px;background:none;border:0;padding:8px;font-size:12px;color:var(--muted,#606b78)}.chat-input-tool .px-icon{width:17px;height:17px}.toc-product #chat-send{width:44px;min-width:44px;height:44px;min-height:44px;display:grid;place-items:center;padding:10px;border-radius:9px}#chat-send .px-icon{width:20px;height:20px}.chat-stop{display:flex;align-items:center;gap:6px;min-height:44px}.chat-stop .px-icon{width:14px;height:14px}.chat-compose-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:11px;color:var(--muted,#606b78);padding:5px 3px 0}.chat-pricing-details{position:relative}.chat-pricing-details summary{cursor:pointer;list-style:none;padding:6px 0}.chat-pricing-details summary::-webkit-details-marker{display:none}.chat-pricing-details[open] p{position:absolute;bottom:30px;left:0;z-index:3;width:min(380px,calc(100vw - 60px));background:white;border:1px solid var(--line,#e2e7eb);border-radius:9px;padding:14px;box-shadow:0 8px 25px #202b3614;line-height:1.8;font-size:12px}.chat-keyboard-hint{white-space:nowrap}
.chat-selected{display:flex;align-items:center;margin:0 0 7px;gap:3px}.chat-context-chip{display:flex;align-items:center;gap:6px;max-width:calc(100% - 44px);background:var(--soft,#eaf5ee);color:var(--green,#177653);border:0;min-height:34px;border-radius:6px;padding:5px 9px;font-size:12px}.chat-context-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-context-chip .px-icon{width:15px;height:15px;flex:none}.chat-selected>.chat-icon-button{width:34px;height:34px;min-height:34px;padding:6px}.chat-connection{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;padding:8px 10px;margin-bottom:6px;background:#fff8e9;border:1px solid #f2e7c9;border-radius:8px}.chat-connection button{flex:none;font-size:12px;min-height:38px}#chat-error:empty{display:none}#chat-error{font-size:12px;padding:7px 2px 0;margin:0}
.chat-resource{display:flex;align-items:center;gap:12px;justify-content:space-between;padding:10px 12px;background:#f8faf9;border:1px solid var(--line,#e2e7eb);border-radius:9px;min-width:0;overflow-wrap:anywhere}.chat-resource>.chat-resource-copy{flex:1;min-width:0}.chat-resource span,.chat-resource small{display:block;font-size:11px;color:var(--muted,#606b78);line-height:1.6}.chat-resource strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:14px;line-height:1.5;margin:3px 0;font-weight:600}.chat-resource p{margin:5px 0;font-size:13px;line-height:1.6}.chat-resource button,.chat-resource a{flex:none;font-size:12px;min-height:44px}.chat-resource>.chat-resource-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:none}.chat-resource-actions button{white-space:nowrap}.chat-resource-actions a{display:inline-flex;align-items:center;padding:6px 8px;color:var(--green,#177653);text-decoration:none}.chat-resource-actions a:hover{text-decoration:underline}.chat-resources{display:grid;gap:8px;margin-top:15px}.chat-resources:empty{display:none}.chat-result-item{min-width:0}
.chat-paper-resource{padding:10px 12px;gap:10px}.chat-paper-resource>.chat-resource-copy{flex:1;min-width:0}.chat-paper-resource strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;line-height:1.5;margin:0 0 3px}.chat-paper-resource .chat-resource-copy>span{overflow-wrap:anywhere;line-height:1.5}
.toc-product .chat-result-preview{margin:0;min-height:44px;background:none;border:0;color:var(--green,#177653);font-size:12px;padding:8px 10px}
@media(max-width:520px){.chat-resource{align-items:stretch;flex-direction:column;gap:6px}.toc-product .chat-resource-actions button,.chat-resource-actions a{min-height:44px}}
.chat-action{border:1px solid #bfd6c7;border-radius:10px;margin:14px 0 4px;padding:16px;background:#fcfefc;min-width:0;overflow-wrap:anywhere}.chat-action header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.chat-action header strong{font-size:14px;min-width:0}.chat-action header span{color:var(--green,#177653);font-size:12px;white-space:nowrap}.chat-action p{font-size:13px;line-height:1.7;margin:9px 0}.chat-action-subject{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.chat-action dl{display:flex;flex-wrap:wrap;gap:18px;font-size:12px}.chat-action dl>div{display:flex;gap:7px}.chat-action dt{color:var(--muted,#606b78)}.chat-action dd{margin:0;min-width:0}.chat-action summary{font-size:12px;cursor:pointer;min-height:44px;align-content:center}.chat-detail-body{max-height:min(240px,40dvh);overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;font-size:13px;line-height:1.7;overflow-wrap:anywhere;margin:0;padding:8px 10px;background:#f4f7f5;border-radius:6px;outline-offset:-3px}.chat-action ul.chat-detail-body,.chat-selected-questions{padding-left:28px}.chat-detail-body li+li{margin-top:6px}.chat-action footer{display:flex;align-items:center;gap:8px;margin-top:12px;font-size:12px;flex-wrap:wrap}.chat-action footer button{min-height:44px}.chat-action-status{color:var(--muted,#606b78);font-size:12px}.chat-action[data-status="confirmed"] .chat-action-status{color:var(--green,#177653)}.chat-action[data-status="cancelled"],.chat-action[data-status="expired"]{border-color:var(--line,#e2e7eb);background:#fafbfa}.chat-action[data-status="cancelled"] header span,.chat-action[data-status="expired"] header span{color:var(--muted,#606b78)}.chat-action[data-status="expired"] .chat-action-status{color:#8a5718}.chat-action-controls{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;min-width:0;flex:1}.chat-action-error:empty{display:none}.chat-action .chat-action-error{font-size:12px;margin:8px 0 0}.chat-job-result{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0;width:100%;font-size:12px}.chat-job-result>a{margin-left:auto;display:inline-flex;align-items:center;min-height:44px;color:var(--green,#177653)}.chat-job-result>button{margin-left:auto}.chat-job-status[data-status="failed"]{color:#a13939}.chat-job-status[data-status="needs_review"],.chat-job-status[data-status="unknown"]{color:#8a5718}.chat-action .chat-job-error,.chat-action .chat-job-help{flex-basis:100%;margin:0;font-size:12px;line-height:1.6}.chat-job-error{max-height:120px;overflow:auto;overscroll-behavior:contain}.chat-job-help{color:var(--muted,#606b78)}.chat-billing{font-size:11px;color:var(--muted,#606b78);margin:10px 0 0}.chat-billing summary{cursor:pointer;min-height:28px;display:flex;align-items:center}.chat-billing summary:after{content:'⌄';margin-left:6px}.chat-billing p{line-height:1.8;background:#f8faf9;padding:10px;border-radius:6px}.chat-message-tools{display:flex;align-items:center;gap:3px;margin-top:2px}.toc-product .chat-message-tools button{font-size:11px;min-height:36px;background:none;border:0;color:var(--muted,#606b78);padding:6px 8px}.chat-message-tools .px-icon{width:14px;height:14px}
.chat-activity{margin:6px 0 12px;color:var(--muted,#606b78);font-size:12px;min-width:0}.chat-activity summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:7px;list-style:none}.chat-activity summary::-webkit-details-marker{display:none}.chat-activity summary:before{content:'›';font-size:17px;flex:none}.chat-activity[open] summary:before{transform:rotate(90deg)}.chat-activity ol{list-style:none;margin:6px 0;padding:0 3px;max-height:min(240px,40dvh);overflow:auto;overscroll-behavior:contain;outline-offset:-3px}.chat-activity li{display:flex;align-items:center;gap:8px;min-height:32px;padding:3px 0}.chat-step-label{min-width:0;overflow-wrap:anywhere;line-height:1.6}.chat-activity small{margin-left:auto;font-size:11px;flex:none}.chat-step-mark{display:grid;place-items:center;width:18px;height:18px;flex:none;border-radius:50%;background:#edf2ef;color:var(--green,#177653);font-size:11px}.chat-activity .failed .chat-step-mark{color:#a13939}.chat-activity .cancelled .chat-step-mark{color:var(--muted,#606b78)}.chat-activity .running .chat-step-mark{animation:chat-pulse 1.2s infinite}.chat-pending{display:flex;align-items:center;gap:9px;font-size:12px;color:var(--muted,#606b78);padding:6px 0}.chat-pending time{margin-left:3px;font-variant-numeric:tabular-nums;font-size:11px;flex:none}.chat-dots{display:flex;gap:3px;flex:none}.chat-dots i{width:4px;height:4px;background:var(--green,#177653);border-radius:50%;animation:chat-pulse 1.2s infinite}.chat-dots i:nth-child(2){animation-delay:.15s}.chat-dots i:nth-child(3){animation-delay:.3s}@keyframes chat-pulse{50%{opacity:.3}}.chat-stopped{font-size:12px;color:var(--muted,#606b78)}#chat-new-content{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);box-shadow:0 3px 18px #202b3617;font-size:12px;z-index:2}#chat-older{display:block;margin:0 auto 20px;font-size:12px;min-height:38px}
.chat-history{background:#f8faf9;border-right:1px solid var(--line,#e2e7eb);padding:14px;overflow-y:auto;min-width:0;min-height:0}.chat-history-heading{display:flex;justify-content:space-between;align-items:center;font-size:14px}.chat-new-thread{display:flex;justify-content:center;gap:8px;width:100%;margin:12px 0;min-height:44px}.chat-new-thread .px-icon{width:17px;height:17px}#chat-history-search{font-size:12px;width:100%;min-height:40px}.chat-history-group{font-size:11px;color:var(--muted,#606b78);margin:18px 8px 8px}.chat-thread{display:flex;align-items:center;gap:5px;justify-content:space-between;width:100%;text-align:left;background:transparent;border:0;border-radius:7px;padding:10px;min-height:44px;font-size:12px}.chat-thread span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-thread small{font-size:10px;color:var(--green,#177653);flex:none}.chat-thread:hover,.chat-thread.active{background:var(--soft,#eaf5ee);color:var(--green,#177653)}.chat-history-open .chat-layout{grid-template-columns:250px minmax(0,1fr)}#chat-history-error{font-size:12px;color:#a13939}
.chat-preview{min-width:0;min-height:0;border-left:1px solid var(--line,#e2e7eb);background:#fafcfb;display:flex;flex-direction:column}.chat-preview header{display:flex;align-items:center;justify-content:space-between;padding:11px 16px;border-bottom:1px solid var(--line,#e2e7eb);min-height:68px;font-size:13px}#chat-preview-content{padding:20px;overflow:auto;flex:1;min-height:0;font-size:13px;overflow-wrap:anywhere}.chat-preview-source{font-size:11px;color:var(--muted,#606b78)}.chat-preview-source,.chat-preview-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.chat-preview h2{font-size:17px;margin:10px 0 16px}.chat-preview h3{font-size:13px;margin:0 0 8px}.chat-preview-answer{margin-top:20px;padding-top:16px;border-top:1px solid var(--line,#e2e7eb)}.chat-preview .chat-markdown{font-size:13px}.chat-preview-options{list-style:none;margin:12px 0;padding:0}.chat-preview-options li{margin:8px 0;line-height:1.7}.chat-preview-open .chat-layout{grid-template-columns:minmax(0,1fr) minmax(300px,360px)}.chat-history-open.chat-preview-open .chat-layout{grid-template-columns:230px minmax(0,1fr) minmax(280px,340px)}
.toc-product .chat-context-dialog{max-width:600px;width:calc(100% - 32px);padding:22px}.chat-context-dialog header,#chat-rename-dialog header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.chat-context-dialog header,.chat-context-tabs,#chat-context-search{flex:none}.chat-context-dialog h2,#chat-rename-dialog h2{font-size:18px;margin:0}.chat-context-tabs{display:flex;gap:8px;margin:6px 0 14px}.chat-context-tabs button{border:0;background:#f3f6f4;min-height:44px;font-size:13px}.chat-context-tabs button[aria-pressed=true]{background:var(--soft,#eaf5ee);color:var(--green,#177653)}#chat-context-search{width:100%;font-size:13px;min-height:44px}#chat-context-results{max-height:min(48dvh,440px);min-height:0;overflow:auto;overscroll-behavior:contain;margin-top:12px}.chat-context-option{display:flex;align-items:center;border-bottom:1px solid var(--line,#e2e7eb);gap:10px}.chat-context-option>button{min-width:0;flex:1;text-align:left;border:0;background:none;padding:12px 4px;min-height:54px}.chat-context-option strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;font-size:13px;line-height:1.6}.chat-context-option span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;font-size:11px;color:var(--muted,#606b78);margin-top:5px;line-height:1.6}.chat-context-option label{flex:none;width:68px;font-size:10px;color:var(--muted,#606b78)}.chat-context-option input{width:100%;font-size:12px;margin-top:3px}.chat-drop-active .chat-compose form{outline:2px dashed var(--green,#177653);background:#f2faf5}#chat-rename-dialog{width:min(440px,calc(100% - 32px));padding:22px}#chat-rename-dialog input{width:100%;margin:8px 0}#chat-rename-dialog footer{display:flex;justify-content:flex-end;margin-top:14px}
.chat-layout [hidden],.chat-compose [hidden],.chat-history[hidden],.chat-preview[hidden]{display:none!important}
@media(min-width:2000px){.chat-layout{--chat-width:1320px}.chat-log{padding-top:36px}.chat-preview-open .chat-layout{grid-template-columns:minmax(0,1fr) 440px}.chat-history-open.chat-preview-open .chat-layout{grid-template-columns:250px minmax(0,1fr) 400px}}
@media(max-width:1100px){.is-chat-view main.wrap{padding:12px 16px 16px}.chat-layout{height:calc(100dvh - 96px)}.chat-history-open .chat-layout,.chat-preview-open .chat-layout,.chat-history-open.chat-preview-open .chat-layout{grid-template-columns:minmax(0,1fr)}.chat-history{position:absolute;inset:0 auto 0 0;width:min(320px,calc(100% - 40px));z-index:6;box-shadow:8px 0 30px #202b361a}.chat-history-backdrop{position:absolute;inset:0;background:#202b3640;z-index:5}.chat-preview{position:absolute;inset:0 0 0 auto;width:min(420px,100%);z-index:5;box-shadow:-6px 0 28px #202b361a}.chat-log{padding:24px}.chat-compose{padding:8px 24px 12px}}
@media(max-width:700px){.is-chat-view main.wrap{padding:0!important}.chat-layout{border:0;border-radius:0;height:calc(100dvh - 118px);min-height:260px}.chat-heading{padding:6px 10px;gap:5px;min-height:58px}.chat-heading h1{font-size:14px}.chat-heading p{font-size:10px;line-height:1.5}.chat-log{padding:20px 16px}.chat-compose{padding:5px 12px 8px}.chat-compose textarea{font-size:16px;min-height:45px}.chat-compose form{padding:10px 9px 6px}.chat-compose-footer{font-size:10px}.chat-keyboard-hint{display:none}.chat-turn{margin-bottom:24px}.chat-assistant{grid-template-columns:22px minmax(0,1fr);gap:8px}.chat-speaker{width:22px;height:22px;border-radius:6px}.chat-speaker .px-icon{width:15px;height:15px}.chat-user-content{max-width:90%;padding:10px 13px}.chat-markdown{font-size:14px;line-height:1.8}.chat-empty{margin:25px auto 10px}.chat-emblem{width:40px;height:40px;margin-bottom:18px}.chat-empty h2{font-size:26px}.chat-empty>p:last-of-type{font-size:12px}.chat-starters{grid-template-columns:1fr;gap:8px;margin-top:22px}.chat-starters button{min-height:64px;padding:12px 14px;display:flex;align-items:center;justify-content:space-between;gap:8px}.chat-starters strong{font-size:12px}.chat-starters span{font-size:10px;margin-top:0}.chat-resource{padding:10px 12px;flex-wrap:wrap;gap:7px}.chat-resource>div{flex:1 1 140px}.chat-resource button,.chat-resource a{font-size:11px;min-height:40px}.chat-action{padding:12px}.chat-action header{flex-wrap:wrap;gap:5px}.chat-action dl{gap:10px}.chat-pending{font-size:11px;gap:6px}.chat-preview header{min-height:58px}.toc-product .chat-context-dialog{padding:16px}.chat-stop{font-size:11px;padding:7px}.chat-pricing-details[open] p{width:calc(100vw - 38px)}}
@media(max-height:600px){.chat-heading{min-height:50px;padding-top:3px;padding-bottom:3px}.chat-heading p{display:none}.chat-layout{min-height:230px}.chat-empty{margin:10px auto}.chat-starters{margin-top:12px}.chat-compose textarea{min-height:35px;max-height:110px}.chat-compose-footer{padding-top:0}.chat-log{padding-top:16px;padding-bottom:16px}}
@media(prefers-reduced-motion:reduce){.chat-dots i,.chat-activity .running .chat-step-mark{animation:none}#chat-view *{scroll-behavior:auto!important;transition:none!important}}

/* Keep secondary actions usable on touch screens. */
.toc-product .chat-message-tools button,.chat-code-toolbar button,.chat-result-preview{min-height:44px}.chat-selected>.chat-icon-button{width:44px;height:44px;min-height:44px}.chat-context-chip{min-height:44px}

/* Tool results stay secondary to the explanation, including on small screens. */
.chat-result-group{min-width:0;border:1px solid var(--line,#e2e7eb);border-radius:9px;background:#f8faf9}
.chat-result-group>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;padding:8px 12px;font-size:12px;font-weight:500;cursor:pointer;list-style:none}
.chat-result-group>summary::-webkit-details-marker{display:none}
.chat-result-group>summary:hover{background:var(--soft,#eaf5ee);border-radius:8px}
.chat-result-group>summary:focus-visible,.chat-result-list:focus-visible{outline:2px solid var(--green,#177653);outline-offset:2px}
.chat-wrong-toggle{display:flex;align-items:center;gap:5px;flex:none;font-size:11px;font-weight:400;color:var(--muted,#606b78)}
.chat-wrong-toggle .px-icon{width:14px;height:14px}
.chat-wrong-collapse,.chat-result-group[open] .chat-wrong-expand{display:none}
.chat-result-group[open] .chat-wrong-collapse{display:inline}
.chat-result-group[open] .chat-wrong-toggle .px-icon{transform:rotate(90deg)}
.chat-result-list{box-sizing:border-box;list-style:none;margin:0;padding:0;max-height:min(360px,45dvh);overflow:auto;overscroll-behavior-y:contain;scrollbar-gutter:stable;border-top:1px solid var(--line,#e2e7eb)}
.chat-result-list>li{margin:0;padding:0}
.chat-result-list>li+li{border-top:1px solid var(--line,#e2e7eb)}
.chat-resource-list .chat-resource{border:0;border-radius:0;background:transparent}
.chat-wrong-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;margin:0;padding:8px 12px;min-width:0}
.chat-wrong-copy{min-width:0}
.chat-wrong-copy>span{font-size:11px;color:var(--muted,#606b78)}
.chat-wrong-copy>p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere;margin:3px 0 0;font-size:13px;line-height:1.5}
.chat-wrong-actions{display:flex;align-items:center;gap:4px}
.toc-product .chat-wrong-actions button{min-height:44px;min-width:44px;padding:6px 8px;background:none;border:0;font-size:12px;white-space:nowrap;color:var(--green,#177653)}
.toc-product .chat-wrong-actions button:hover{background:var(--soft,#eaf5ee)}

/* One conversation moves between the full page and this floating region. */
#chat-float-launcher{position:fixed;right:24px;bottom:24px;z-index:40;display:flex;align-items:center;gap:8px;border-radius:28px;min-height:48px;padding:12px 18px;box-shadow:0 5px 24px #202b3633}
#chat-float-launcher[hidden],#chat-floating[hidden]{display:none!important}
.chat-float-only{display:none!important}
#chat-floating{position:fixed;right:20px;width:min(440px,calc(100vw - 24px));z-index:60;border-radius:14px;box-shadow:0 12px 54px #202b3638;background:#fff;isolation:isolate}
#chat-floating #chat-view{height:100%;margin:0}
#chat-floating .chat-layout{height:100%;min-height:0!important;grid-template-columns:minmax(0,1fr)!important;border-radius:14px;overflow:hidden}
#chat-floating .chat-float-only{display:inline-flex!important}
#chat-floating .chat-heading{padding:6px 10px;min-height:56px;gap:4px}
#chat-floating .chat-heading h1{font-size:15px}
#chat-floating .chat-heading p{font-size:10px}
#chat-floating .chat-heading-title{min-width:0;cursor:move;touch-action:none;user-select:none;flex:1;align-content:center;min-height:44px}
#chat-float-launcher{touch-action:none;user-select:none;cursor:grab}
#chat-float-launcher:active{cursor:grabbing}
#chat-floating .chat-heading .chat-menu{display:none}
.chat-note-prompt{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-top:14px;padding:10px 12px;background:var(--soft,#eaf5ee);border-radius:8px;font-size:12px}
.chat-note-prompt button{min-height:44px;color:var(--green,#177653)}
#chat-floating .chat-log{padding:16px}
#chat-floating .chat-compose{padding:6px 12px 10px}
#chat-floating .chat-compose textarea{font-size:16px;min-height:44px}
#chat-floating .chat-keyboard-hint{display:none}
#chat-floating .chat-empty{margin:8px auto}
#chat-floating .chat-emblem{width:32px;height:32px;margin-bottom:8px}
#chat-floating .chat-empty h2{font-size:21px}
#chat-floating .chat-empty>p{font-size:12px}
#chat-floating .chat-starters{grid-template-columns:1fr;gap:6px;margin-top:14px}
#chat-floating .chat-starters button{min-height:52px;padding:8px 12px}
#chat-floating .chat-starters span{font-size:11px}
#chat-floating .chat-history{position:absolute;inset:0 auto 0 0;width:min(320px,calc(100% - 40px));z-index:6;box-shadow:8px 0 30px #202b361a}
#chat-floating .chat-history-backdrop{position:absolute;inset:0;background:#202b3640;z-index:5}
#chat-floating .chat-preview{position:absolute;inset:0;width:100%;z-index:5}
#chat-floating .chat-pricing-details[open] p{width:min(340px,calc(100vw - 60px))}
@media(max-width:999px){#chat-float-launcher{right:16px;bottom:calc(86px + env(safe-area-inset-bottom))}}
@media(max-width:500px){#chat-floating{right:12px}#chat-float-launcher span{display:none}#chat-float-launcher{width:48px;padding:12px;justify-content:center}}
/* During practice the launcher sits above the sticky submit bar instead of covering it. */
.is-exam-view #chat-float-launcher{bottom:96px}
@media(max-width:760px){.is-exam-view #chat-float-launcher{bottom:calc(176px + env(safe-area-inset-bottom))}}

/* Leave room for the launcher below the final page controls. */
.toc-workspace:not(.is-chat-view) main.wrap{padding-bottom:96px}
@media(max-width:999px){.toc-workspace:not(.is-chat-view) main.wrap{padding-bottom:calc(160px + env(safe-area-inset-bottom))}}
