/* A quiet, flat workspace using the existing teal palette. */
body[data-account-state]{background:#f7faf9}
body[data-account-state] .page{background:#f7faf9}
body[data-account-state] .page>header{background:var(--surface);backdrop-filter:none;-webkit-backdrop-filter:none;border-bottom:1px solid var(--line);box-shadow:none}
body[data-account-state] .page>main>.hero{background:transparent;border:0;box-shadow:none;padding:12px 0 20px;min-height:0;margin-bottom:12px}
.hero:before,.hero:after,.hero-right{display:none}
.hero h1{font-size:clamp(23px,3vw,30px);letter-spacing:-.6px}
.hero .eyebrow{display:none}
.source-panel,.chat-composer,.result-card,.assessment-section,.query-message,.past-query,.past-response{background:var(--surface);box-shadow:none;border:1px solid var(--line);border-radius:10px}
.source-top,.query-message,.past-query{background:var(--paper)}
.sidebar{background:var(--surface);box-shadow:none}
.sidebar .brand{padding:20px 18px 24px}
.sidebar .nav-item{border-radius:7px;margin-bottom:3px}
.sidebar .nav-item.active{background:var(--paper);color:var(--deep)}
.logo,.assistant-symbol{background:var(--deep)}
.result-card,.assistant-message{box-shadow:none}
.results-heading{gap:12px}
body .response-progress{background:var(--surface);border:1px solid var(--line);box-shadow:none}
.site-footer{background:var(--surface);border-top:1px solid var(--line);font-size:11px}
.attachment-card{position:relative}
.remove-file{position:absolute;z-index:2;top:3px;right:3px;display:grid;place-items:center;width:28px;height:28px;padding:6px;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--muted);touch-action:manipulation}
.remove-file svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.remove-file:hover{color:#b42318;border-color:#fda29b}
.remove-file:focus-visible{outline:2px solid var(--deep);outline-offset:2px}
.attachment-card .doc-chip{padding-top:24px}
.attachment-actions{justify-content:center;margin-top:4px}
.attachment-actions button{border:0;background:transparent;padding:4px 8px;font-size:11px}
[data-theme=dark] body[data-account-state],[data-theme=dark] body[data-account-state] .page{background:#10252a}
@media(max-width:600px){
 .remove-file{width:36px;height:36px;top:0;right:0}
 .attachment-card .doc-chip{padding-top:32px}
 body[data-account-state] .page>main>.hero{padding:8px 0 14px}
 .top-account .account-signin,.top-account .account-signup{border-radius:6px}
}

body[data-account-state] .page>main{max-width:1080px}
body[data-account-state] .page>main>.hero{display:none}
.chat-composer>.section-heading{justify-content:flex-end;margin:0 0 12px}
.chat-composer>.section-heading>div{display:none}
.chat-composer #sample{padding:6px 10px;font-size:12px}
.method-note{background:transparent;border:0;padding:0;color:var(--muted);font-size:12px;line-height:1.7}
.method-note>summary{cursor:pointer;padding:10px 0}
.method-note>div{padding:0 0 14px}
.chat-composer #interpret{display:none}


/* Page-wide results with a floating request composer. */
body[data-account-state] .page>main{width:100%;max-width:none;margin:0;box-sizing:border-box;padding-bottom:calc(var(--composer-height,100px) + 40px)}
body[data-account-state]:not(.conversation-active) .page>main{min-height:calc(100dvh - 140px)}
body.conversation-active[data-account-state] .page .chat-composer{
 position:fixed;z-index:45;left:calc(var(--workspace-sidebar-width) + 16px);right:16px;bottom:24px;
 width:auto;max-width:980px;margin:0 auto;padding:10px 12px;
 border:1px solid var(--line);border-radius:16px;background:var(--surface);
 box-shadow:0 6px 26px #163c3b18;box-sizing:border-box;
}
body.conversation-active[data-account-state] .chat-composer>.composer-heading,
body.conversation-active[data-account-state] .chat-composer>.section-heading,
body.conversation-active[data-account-state] .chat-composer #audit-workflow,
body.conversation-active[data-account-state] .chat-composer .input-meta,
body.conversation-active[data-account-state] .chat-composer .input-guide,
body.conversation-active[data-account-state] .chat-composer .editor-bottom,
body.conversation-active[data-account-state] .chat-composer .formats,
body.conversation-active[data-account-state] .chat-composer #newtext,
body.conversation-active[data-account-state] .chat-composer #composer-options,
body.conversation-active[data-account-state] .chat-composer .source-actions>span,
body.conversation-active[data-account-state] .chat-composer #run>span,
body.conversation-active[data-account-state] .chat-composer .upload-button-text{display:none}
body.conversation-active[data-account-state] .chat-composer .source-panel{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:6px;border:0;background:transparent;padding:0;overflow:visible;box-shadow:none}
body.conversation-active[data-account-state] .chat-composer .source-top{grid-column:1;grid-row:2;padding:0;border:0;background:transparent;align-self:end}
body.conversation-active[data-account-state] .chat-composer .source-tabs{display:flex}
body.conversation-active[data-account-state] .chat-composer .input-layout{display:block;grid-column:2;grid-row:2;min-width:0}
body.conversation-active[data-account-state] .chat-composer .editor-side{display:block}
body.conversation-active[data-account-state] .chat-composer #input{box-sizing:border-box;display:block;width:100%;height:44px;min-height:44px;max-height:120px;padding:10px 2px;margin:0;border:0;font-size:16px;line-height:24px;resize:none;background:transparent}
body.conversation-active[data-account-state] .chat-composer .source-actions{display:flex;grid-column:3;grid-row:2;padding:0;border:0;align-self:end;justify-content:center}
body.conversation-active[data-account-state] .chat-composer #run,body.conversation-active[data-account-state] .chat-composer #upload-trigger{position:static;width:44px;height:44px;min-height:44px;padding:10px;display:grid;place-items:center;border-radius:10px}
body.conversation-active[data-account-state] .chat-composer #documents{grid-column:1/-1;grid-row:1;display:flex;flex-direction:column;gap:4px;max-height:136px;overflow:auto;padding:0 0 6px;margin:0}
body.conversation-active[data-account-state] .chat-composer #documents.hidden{display:none}
.attachment-row{position:relative;display:flex;align-items:center;gap:6px;min-width:0;width:100%;border-bottom:1px solid var(--line);padding:2px 0}
body .attachment-row .doc-chip{display:flex;flex-direction:row;align-items:center;gap:8px;flex:1;min-width:0;width:auto;max-width:none;border:0;background:transparent;padding:4px;text-align:left}
body .attachment-row .attachment-name{text-align:left;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
body .attachment-row .attachment-icon{width:28px;height:32px;flex:none;background:var(--paper);gap:0}
body .attachment-row .attachment-icon svg{width:17px;height:17px}
body .attachment-row .attachment-icon b{display:none}
body .attachment-row .remove-file{position:static;flex:none;width:36px;height:36px;border:0;background:transparent}
body.conversation-active[data-account-state] .chat-composer #file-status{grid-column:1/-1;grid-row:3;max-height:44px;overflow:auto;padding:4px 0;font-size:11px}
body.conversation-active[data-account-state] .chat-composer #upload-progress{grid-column:1/-1;grid-row:4;margin:0;padding:6px 0;border:0}
body.conversation-active[data-account-state] .chat-composer #cancel-upload{grid-column:1/-1;grid-row:5;margin:0}
body.conversation-active[data-account-state] #chat-thread{padding-bottom:calc(var(--composer-height,100px) + 28px);scroll-padding-bottom:calc(var(--composer-height,100px) + 28px)}
@media(max-width:600px){
 body.conversation-active[data-account-state] .page .chat-composer{left:calc(var(--workspace-sidebar-width) + 8px);right:8px;padding:8px;border-radius:12px}
 body.conversation-active[data-account-state] .chat-composer .source-panel{grid-template-columns:40px minmax(0,1fr) 40px;gap:2px}
 body.conversation-active[data-account-state] .chat-composer #run,body.conversation-active[data-account-state] .chat-composer #upload-trigger{width:40px}
 body.conversation-active[data-account-state] .chat-composer #documents{max-height:112px}
}

body.conversation-active[data-account-state] .page>main{padding-bottom:12px}

/* A new conversation starts with the complete form in the workspace center. */
body[data-account-state]:not(.conversation-active) .page>main{display:flex;flex-direction:column;justify-content:center;min-height:calc(100dvh - 140px);padding:28px 24px}
body[data-account-state]:not(.conversation-active) .chat-composer{position:relative;inset:auto!important;width:100%;max-width:980px;margin:auto;padding:24px;box-sizing:border-box}
body[data-account-state]:not(.conversation-active) .chat-composer>.composer-heading{display:block;margin-bottom:20px}
body[data-account-state]:not(.conversation-active) .chat-composer>.section-heading{display:flex}
body[data-account-state]:not(.conversation-active) .chat-composer #input{height:180px;min-height:180px;max-height:360px;resize:vertical}
body[data-account-state]:not(.conversation-active) .chat-composer #documents{display:flex;flex-direction:column;gap:4px}
body[data-account-state]:not(.conversation-active) .chat-composer #documents.hidden{display:none}
@media(max-width:600px){
 body[data-account-state]:not(.conversation-active) .page>main{padding:16px 12px}
 body[data-account-state]:not(.conversation-active) .chat-composer{padding:16px}
 body[data-account-state]:not(.conversation-active) .chat-composer #input{min-height:160px}
}


/* Response motion follows the system accessibility preference. */
@media (prefers-reduced-motion: no-preference) {
 .response-progress:not(.hidden) .response-thinking i {
  animation: response-dot-pulse 1.2s ease-in-out infinite;
 }
 .response-progress:not(.hidden) .response-thinking i:nth-child(2) {animation-delay: .15s}
 .response-progress:not(.hidden) .response-thinking i:nth-child(3) {animation-delay: .3s}
 .response-draft-body::after {content: "";display: none}
 .is-typing .response-draft-body::after {
  display: inline-block;width: 2px;height: 1em;background: currentColor;
  animation: response-cursor-blink .85s step-end infinite;
 }
 .response-block-enter {animation: response-block-in .25s ease-out var(--response-delay, 0ms) both}
}
@keyframes response-dot-pulse {
 0%, 65%, 100% {opacity: .4;transform: translateY(0) scale(.8)}
 30% {opacity: 1;transform: translateY(-5px) scale(1.15)}
}
@keyframes response-cursor-blink {50% {opacity: 0}}
@keyframes response-block-in {
 from {opacity: 0;transform: translateY(4px)}
 to {opacity: 1;transform: translateY(0)}
}

.chat-composer>.section-heading{gap:8px;flex-wrap:wrap}
.review-engine-button{position:relative;display:inline-flex;align-items:center}
.review-engine-button select{
 appearance:none;padding:6px 27px 6px 10px;border:1px solid var(--line);
 border-radius:8px;background:var(--surface);color:inherit;font:inherit;font-size:12px;cursor:pointer
}
.review-engine-button svg{
 position:absolute;right:8px;width:14px;height:14px;pointer-events:none;
 fill:none;stroke:currentColor;stroke-width:1.5
}
#audit-workflow-fields>p{font-size:12px;color:var(--muted);margin:8px 0}
.audit-stage-list .automatic-audit-stage{
 display:grid;grid-template-columns:24px minmax(0,1fr);gap:10px;
 border:0;border-bottom:1px solid var(--line);border-radius:0;padding:12px 0;margin:0;background:transparent
}
.audit-stage-list .automatic-audit-stage:last-child{border-bottom:0}
.audit-stage-list .automatic-audit-stage p{margin:4px 0}
.audit-stage-mark{display:grid;place-items:center;width:24px;height:24px;border-radius:50%}
.audit-stage-mark svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.stage-complete{background:#dcfce7;color:#166534}
.stage-pending{background:var(--paper);color:var(--muted)}

body:not([data-account-state="signed-in"]) .review-engine-button{display:none}

.authorship-heading{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap}
.authorship-heading h3{margin:0}
.authorship-status{padding:4px 9px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:12px;font-weight:600}
.authorship-status.has-indicators{color:#92400e;background:#fef3c7;border-color:#fde68a}
.authorship-card>p{margin:10px 0 0;overflow-wrap:anywhere}
.correction-file{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;padding:10px 0;border-top:1px solid var(--line)}
.correction-file>details{flex-basis:100%;font-size:13px}
.correction-file>p{margin:0;font-size:12px}
/* Shared spacing and surfaces for the response, including its streaming state. */
#assistant-reply {
 --reply-gap: 16px;
 --reply-inset: 16px;
 --reply-radius: 10px;
 padding: var(--reply-inset);
 border-radius: var(--reply-radius);
 background: var(--surface);
 border-color: var(--line);
}
#assistant-reply:not(.hidden),
#assistant-reply #response-content:not(.hidden),
#assistant-reply #results {
 display: grid;
 gap: var(--reply-gap);
 min-width: 0;
}
#assistant-reply > *,
#assistant-reply #response-content > *,
#assistant-reply #results > * {
 margin: 0;
 min-width: 0;
}
#assistant-reply #results > :is(.result-card,.assessment-section,.review-validation),
#assistant-reply > :is(#response-draft,#response-progress) {
 padding: var(--reply-inset);
 border: 1px solid var(--line);
 border-radius: var(--reply-radius);
 background: var(--surface);
 box-shadow: none;
}
#assistant-reply :is(.result-card,.assessment-section,.review-validation) > :first-child {margin-top: 0}
#assistant-reply :is(.result-card,.assessment-section,.review-validation) > :last-child {margin-bottom: 0}
#assistant-reply :is(.result-card,.assessment-section,.review-validation) :is(h2,h3) {
 margin: 0 0 8px;
 font-size: 16px;
 line-height: 1.35;
}
#assistant-reply .authorship-heading h3 {margin: 0}
#assistant-reply .authorship-card > p {margin-top: 8px}
#assistant-reply .ai-structured-report {display: grid;gap: 8px;min-width: 0}
#assistant-reply .ai-structured-report > * {margin: 0}
#assistant-reply .ai-structured-report > h4 {margin-top: 8px;line-height: 1.4}
#assistant-reply .ai-structured-report > :first-child {margin-top: 0}
#assistant-reply .assessment-table {max-width: 100%;overflow-x: auto}
#assistant-reply :is(.results-heading,.export-controls,.chat-response-actions,.response-progress-heading) {
 gap: 8px;
 flex-wrap: wrap;
}
#assistant-reply .chat-response-actions {padding: 0}
#assistant-reply .correction-file {padding: 8px 0}
@media (max-width: 600px) {
 #assistant-reply {--reply-gap: 12px;--reply-inset: 12px}
}
.corrected-export:not(.hidden){display:inline-flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0}
#corrected-source{max-width:14rem}
#corrected-export-status:empty{display:none}
#corrected-export-status{flex-basis:100%;font-size:12px;color:var(--muted)}
