/* Keep article text and appointment controls inside their own card. */
body #mainApp #content .cand-list{min-width:0;max-width:100%;width:100%;box-sizing:border-box}
body #mainApp #content .cand-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:start;min-width:0;max-width:100%;width:100%;box-sizing:border-box}
body #mainApp #content .cand-row>.cand-det{min-width:0!important;max-width:100%;width:100%;box-sizing:border-box}
body #mainApp #content .cand-row>.cand-act{width:auto!important;min-width:0;max-width:100%;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;box-sizing:border-box}
body #mainApp #content .cand-title{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere;min-width:0;max-width:100%;line-height:1.5}
body #mainApp #content .cand-row>.cand-act>button{max-width:100%;white-space:normal!important}
@media(max-width:700px){body #mainApp #content .cand-row{grid-template-columns:minmax(0,1fr);gap:10px}body #mainApp #content .cand-row>.cand-act{justify-self:end}}

/* Separate progress, blockers and task actions without enlarging typography. */
body #mainApp #content .cc-line .cl-now{padding-top:14px!important}
body #mainApp #content .cc-line .cl-result{margin:8px 0 12px!important;line-height:1.5}
body #mainApp #content .cc-line .cl-hold,body #mainApp #content .cc-line .qstep-warn{margin:0 0 12px!important;padding:10px 12px!important;line-height:1.5}
body #mainApp #content .cc-line .cl-items{margin:0!important;display:grid!important;gap:8px!important}
body #mainApp #content .cc-line .cl-partner{margin-top:16px!important;padding-top:12px!important}
body #mainApp #content .cc-line .cl-now-head{gap:8px!important}
body #mainApp #content .cl-step .cl-history-open{border:0;background:transparent;color:var(--accent-text,var(--accent));font:inherit;font-size:12px;text-decoration:underline;cursor:pointer;padding:4px 0;margin-left:8px}
body #mainApp #content .cl-history{padding:14px;margin:12px 0;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);min-width:0}
body #mainApp #content .cl-history-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
body #mainApp #content .cl-history p{margin:10px 0;line-height:1.5}
body #mainApp #content .cl-history-docs{display:grid;gap:8px}
body #mainApp #content .cl-history-docs>div{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;padding:10px;border:1px solid var(--border);border-radius:8px}

/* Case sections and stage controls use filled surfaces, never decorative frames. */
body #mainApp #content :is(.cc-fold,.cc-fold>summary,.cc-line,.cl-steps,.cl-step,.cl-num,.cl-now,.cl-hold,.cl-partner,.workspace-case-stage,.workspace-case-stage>summary,.workspace-stage-promise,.workspace-stage-promise>summary){border:0!important;box-shadow:none!important}
body #mainApp #content .cl-step{background:var(--surface-2)!important}
body #mainApp #content .cl-step.is-now{background:color-mix(in srgb,var(--accent) 16%,var(--surface-2))!important}
body #mainApp #content .cl-step.is-now .cl-num{background:var(--accent)!important;color:var(--on-accent,#202020)!important}
body #mainApp #content .cc-fold{background:var(--surface)!important}
body #mainApp #content .cl-step.is-done .cl-num .crm-ui-icon{width:14px;height:14px}

body #mainApp #content :is(details,fieldset,.chart-card,.rw-new-task,.role-assignment-form,.role-task-list,.role-task,.cc-fold,.cf-stage,.cf-body,.sw-panel,.cl-step,.cl-num){border:0!important}
body #mainApp #content :is(.cl-step,.cl-step.is-now,.cl-num,.rw-new-task,.cc-fold){box-shadow:none!important}
body #mainApp #content .rw-new-task{background:var(--surface-2)!important}

/* A missing attachment is a compact status; the professional result is the writing area. */
body #mainApp #content .role-assignment-card{align-items:start!important}
body #mainApp #content .role-assignment-card>input[type=checkbox]{align-self:start!important;margin-top:4px!important}
body #mainApp #content .role-assignment-meta>:is(.task-file,.task-result,.file-text-raw){grid-column:1/-1!important;min-width:0!important;max-width:100%;box-sizing:border-box}
body #mainApp #content .role-assignment-meta>.task-file{display:flex!important;align-items:center!important;align-self:start!important;flex-wrap:wrap;gap:8px!important;height:auto!important;min-height:0!important;padding:10px 12px!important;margin:0!important;border:0!important;border-radius:8px!important;background:var(--surface-2)!important;line-height:1.5!important}
body #mainApp #content .role-assignment-meta>.task-result{padding:14px!important;margin:0!important;border:0!important;border-radius:10px!important;background:var(--surface)!important}
body #mainApp #content .task-result>label{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:7px!important;margin:0!important}
body #mainApp #content .task-result>label>.task-result-need{color:var(--text)!important;font-size:13px!important;font-weight:600!important;line-height:1.4!important}
body #mainApp #content .task-result textarea{display:block!important;width:100%!important;box-sizing:border-box!important;min-height:108px!important;height:auto!important;padding:12px!important;margin:2px 0 0!important;border:0!important;border-radius:8px!important;background:var(--surface-2)!important;color:var(--text)!important;font-size:13px!important;line-height:1.5!important;resize:vertical!important}
body #mainApp #content .task-result textarea::placeholder{color:var(--muted)!important;opacity:1}
body #mainApp #content .task-result-act{display:flex;align-items:center;flex-wrap:wrap;gap:10px!important;margin-top:12px!important}
body #mainApp #content .task-result-why{margin-top:12px!important;max-width:105ch;line-height:1.5!important}
@media(max-width:860px){body #mainApp #content .task-result textarea{font-size:16px!important}}

/* Receipt of a document does not mean its professional review is complete. */
body #mainApp #content .role-assignment-card.done:has(.task-result.is-waiting){opacity:1!important}
body #mainApp #content .role-assignment-meta>.task-result.is-waiting{background:color-mix(in srgb,var(--accent) 12%,var(--surface))!important;border:0!important;box-shadow:none!important}
body #mainApp #content .task-result.is-waiting>label>.task-result-need{color:var(--accent-text,var(--accent))!important}
body #mainApp #content .task-result.is-waiting textarea{opacity:1!important;background:var(--surface-2)!important;color:var(--text)!important;cursor:text!important}
body #mainApp #content .task-result.is-waiting textarea::placeholder{color:var(--text-secondary)!important;opacity:1!important}
body #mainApp #content .task-result.is-waiting textarea:focus-visible{outline:0!important;box-shadow:inset 0 -2px 0 var(--accent)!important}

/* Every document block spans the task grid; OCR lines wrap without losing content. */
body #mainApp #content .role-assignment-meta>:is(.file-text,.exam-ai-draft){grid-column:1/-1!important;min-width:0!important;max-width:100%!important;width:100%;box-sizing:border-box}
body #mainApp #content .file-text :is(details,summary,.file-text-page,.file-text-raw,.modal-hint,.ai-facts,.ai-fact,.ai-fact-cite){min-width:0!important;max-width:100%!important;box-sizing:border-box;overflow-wrap:anywhere!important;word-break:break-word!important}
body #mainApp #content .file-text :is(.file-text-raw,pre){white-space:pre-wrap!important;overflow-wrap:anywhere!important;word-break:break-word!important;max-width:100%!important;min-width:0!important}
body #mainApp #content .file-text button{max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere}

body #mainApp #content .act-blockers{padding:14px;margin:12px 0;background:var(--surface-2);border-radius:var(--mobile-inner-radius,12px);line-height:1.5;min-width:0;overflow-wrap:anywhere}
body #mainApp #content .act-blockers p{margin:0 0 8px}
body #mainApp #content .act-blockers ul{margin:8px 0;padding-inline-start:20px}
body #mainApp #content .act-blockers .modal-controls{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}

/* Case tabs and guide modes share one non-wrapping mobile strip, including legacy markup. */
@media(max-width:860px){
body.ios-preview-active #mainApp #content :is(.cc-tabs,.med-guide-wrap>.mode-tabs){display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;height:auto!important;gap:4px!important;padding:4px!important;margin:14px 0 12px!important;border:0!important;border-radius:999px!important;background:var(--ios-group)!important;-webkit-overflow-scrolling:touch;scrollbar-width:none}
body.ios-preview-active #mainApp #content :is(.cc-tabs,.med-guide-wrap>.mode-tabs)::-webkit-scrollbar{display:none}
body.ios-preview-active #mainApp #content :is(.cc-tabs,.med-guide-wrap>.mode-tabs)>.mini-btn{flex:0 0 auto!important;width:auto!important;min-width:0!important;white-space:nowrap!important;min-height:40px!important;height:auto!important;padding:8px 12px!important;font-size:12px!important;line-height:1.35!important;border-radius:999px!important;margin:0!important}
}
