/* THOTH Legal Workspace — scoped to this page only */
.lw-shell { --navy:#091B35; --library:#122945; --chat:#152E4C; --control:#304D70; --gold:#E8C477; --paper:#fff; --editor:#E9EDF3; background:var(--navy); color:#e9edf3; padding:14px; border-radius:20px; font: 15px/1.5 "Segoe UI",Arial,sans-serif; min-height:75vh; }
.lw-shell * {box-sizing:border-box;}
.lw-shell .lw-header {display:flex;align-items:center;gap:16px;padding:4px 0 16px;flex-wrap:wrap;}
.lw-shell .lw-header strong {font-size:1.65rem;font-weight:650;color:var(--gold);}
.lw-shell .lw-header span {margin-left:auto;font-size:.78rem;color:#aabbd0;}
.lw-shell a {color:#a9d3ff;overflow-wrap:anywhere;}
.lw-shell .lw-grid {display:grid;gap:14px;align-items:stretch;min-height:72vh;}
.lw-shell .templates-sidebar,.lw-shell .lw-chat,.lw-shell .lw-editor {min-width:0;min-height:0;border-radius:12px;padding:20px;display:flex;flex-direction:column;gap:12px;overflow:auto;max-height:calc(100dvh - 145px);}
.lw-shell .templates-sidebar {background:var(--library);color:#e9edf3;width:auto;position:static;}
.lw-shell .lw-chat {background:var(--chat);}
.lw-shell .lw-editor {background:var(--editor);color:var(--navy);}
.lw-shell h3 {font-size:1.12rem;font-weight:700;margin:0;color:var(--gold);}
.lw-shell .lw-editor h3 {color:var(--navy);}
.lw-shell button {font:inherit;font-size:.88rem;border:0;border-radius:6px;padding:8px 12px;background:var(--control);color:#fff;cursor:pointer;max-width:100%;white-space:normal;}
.lw-shell button:hover:not(:disabled) {filter:brightness(1.12);}
.lw-shell button:disabled {opacity:.5;cursor:not-allowed;}
.lw-shell :is(button,input,textarea,select,summary,[contenteditable]):focus-visible {outline:2px solid #B79A58;outline-offset:2px;}
.lw-shell .templates-sidebar-heading,.lw-shell .lw-editor-head,.lw-shell .lw-link {display:flex;align-items:center;gap:8px;justify-content:space-between;flex-wrap:wrap;}
.lw-shell .templates-sidebar-heading button,.lw-shell .lw-editor-head:first-child button {font-size:.72rem;padding:4px 7px;background:transparent;color:inherit;border:1px solid #8193aa;}
.lw-shell .templates-folder-tree {overflow:auto;min-height:80px;flex:0 1 auto;}
.lw-shell .templates-sidebar button {text-align:left;}
.lw-shell .templates-category-button,.lw-shell .templates-folder-node,.lw-shell .templates-sidebar-file-name {background:transparent;color:#e9edf3;}
.lw-shell .templates-sidebar-file-row {display:flex;align-items:center;gap:4px;}
.lw-shell .templates-sidebar-file-name {flex:1;min-width:0;overflow-wrap:anywhere;}
.lw-shell .templates-sidebar-file-name.is-selected {background:var(--gold);color:var(--navy);}
.lw-shell .templates-sidebar-footer {font-size:.7rem;overflow-wrap:anywhere;color:#aabbd0;}
.lw-shell .templates-sidebar .lw-new {margin-top:auto;background:#B79A58;color:var(--navy);font-weight:700;text-align:center;padding:12px;flex-shrink:0;}
.lw-shell .lw-scroll {flex:1 1 auto;overflow:auto;min-height:180px;}
.lw-shell .lw-message {background:#203D5E;border-radius:10px;padding:14px;margin-bottom:8px;overflow-wrap:anywhere;}
.lw-shell .lw-message strong {display:block;color:var(--gold);margin-bottom:5px;}
.lw-shell .lw-message small {display:block;color:#bdcde0;}
.lw-shell .lw-user {background:var(--control);margin-left:8%;}
.lw-shell .lw-assistant {margin-right:3%;}
.lw-shell .lw-compose {display:grid;gap:8px;border:1px solid #657D9B;border-radius:10px;background:#10253E;padding:12px;flex-shrink:0;margin-top:auto;}
.lw-shell input:not([type=checkbox]),.lw-shell textarea,.lw-shell select {width:100%;min-width:0;background:#10253E;color:#fff;border:1px solid #657D9B;border-radius:6px;padding:9px;font:inherit;}
.lw-shell input::placeholder,.lw-shell textarea::placeholder {color:#b3c3d6;opacity:1;}
.lw-shell .lw-link input {flex:1;}
.lw-shell .lw-compose textarea {border:0;resize:vertical;min-height:75px;}
.lw-shell .lw-compose > button:last-child {justify-self:end;color:var(--gold);background:transparent;font-weight:700;}
.lw-shell .lw-compose small,.lw-shell .lw-note {font-size:.78rem;}
.lw-shell .lw-note {color:#65758a;margin:0;border-bottom:1px solid #bcc8d6;padding-bottom:10px;}
.lw-shell .lw-editor button {background:var(--navy);}
.lw-shell .lw-editor :is(input:not([type=checkbox]),textarea,select) {background:white;color:var(--navy);border-color:#bcc8d6;}
.lw-shell .lw-editor :is(input,textarea)::placeholder {color:#65758a;}
.lw-shell .lw-editor .lw-message {background:#d5dde8;color:var(--navy);}
.lw-shell .lw-editor .lw-message strong,.lw-shell .lw-editor .lw-message small {color:var(--navy);}
.lw-shell .lw-paper {background:white;color:var(--navy);border:1px solid #ccd5e0;border-radius:7px;padding:28px;flex:1;min-height:420px;width:100%;font:16px/1.6 Georgia,serif;}
.lw-shell .lw-rich {flex:1 0 auto;min-height:440px;gap:8px;}
.lw-shell .lw-rich-tools {border-bottom:1px solid #bcc8d6;padding-bottom:8px;gap:3px;}
.lw-shell .lw-rich-tools button {background:transparent;color:var(--navy);padding:5px 7px;font-size:.76rem;border:1px solid #c6d0dd;}
.lw-shell .lw-rich-paper:empty:before {content:'Your legal draft\A\A Awaiting agreed drafting instructions from your conversation with THOTH.';display:block;text-align:center;white-space:pre-line;font:500 17px/1.6 "Segoe UI",Arial,sans-serif;color:var(--navy);padding:clamp(40px,12vh,140px) 8px 0;pointer-events:none;}
.lw-shell .lw-amend,.lw-shell .lw-saved {padding:10px;margin:0;flex-shrink:0;}
.lw-shell summary {cursor:pointer;font-weight:600;}
.lw-shell .lw-export {margin-top:auto;flex-wrap:nowrap;flex-shrink:0;}
.lw-shell .lw-export button {flex:1;padding:13px 8px;font-size:1rem;}
.lw-shell .lw-export button:first-child {background:#d5dde8;color:var(--navy);}
.lw-shell [role=alert],.lw-shell .templates-tree-error {color:#ffd2d2;}
.lw-shell .lw-editor [role=alert] {color:#9b2424;}
.lw-shell [hidden] {display:none!important;}
@media(max-width:1000px){.lw-shell .lw-grid{grid-template-columns:1fr!important}.lw-shell .lw-header span{margin-left:0}.lw-shell .templates-sidebar,.lw-shell .lw-chat,.lw-shell .lw-editor{max-height:none}.lw-shell .lw-paper{min-height:350px}.lw-shell .lw-scroll{max-height:55vh}}

/* 03.10B — approved screenshot refinements */
.lw-shell .lw-header {justify-content:space-between;flex-wrap:nowrap;padding:0 4px 12px;min-height:52px;}
.lw-shell .lw-brand {display:flex;align-items:center;gap:12px;min-width:0;}
.lw-shell .lw-brand img {width:38px;height:50px;object-fit:contain;flex:none;}
.lw-shell .lw-header strong {font-size:1.55rem;}
.lw-shell .lw-header > a {font-size:.85rem;flex-shrink:0;}
.lw-shell .lw-chat .lw-scroll-empty {flex:0 1 auto;min-height:0;max-height:40%;}
.lw-shell .lw-chat:has(.lw-scroll-empty) .lw-compose {margin-top:12px;}
.lw-shell .lw-compose {gap:6px;padding:10px;}
.lw-shell .lw-compose textarea {min-height:64px;max-height:120px;}
.lw-shell .lw-compose input[type=file] {padding:5px;}
@media(min-width:1001px){
.lw-shell {min-height:0;}
.lw-shell .lw-grid {min-height:0;height:max(420px,calc(100dvh - 205px));}
.lw-shell .templates-sidebar,.lw-shell .lw-chat,.lw-shell .lw-editor {max-height:none;height:100%;padding:16px;gap:8px;}
.lw-shell .lw-scroll {min-height:0;}
.lw-shell .lw-rich {flex:1 0 auto;min-height:200px;}
.lw-shell .lw-paper {min-height:200px;padding:20px;}
.lw-shell .lw-rich-paper:empty:before {padding:clamp(20px,7vh,75px) 8px 0;}
.lw-shell .lw-export {position:sticky;bottom:0;background:var(--editor);padding:6px 0 0;z-index:2;}
.lw-shell .templates-sidebar .lw-new {position:sticky;bottom:0;z-index:2;}
}
@media(max-width:600px){.lw-shell .lw-header{flex-wrap:wrap}.lw-shell .lw-header strong{font-size:1.2rem}}

/* 03.10C — keep conversation visible; evidence lives in library */
.lw-shell .lw-library-evidence {display:grid;gap:7px;flex-shrink:0;min-width:0;border-top:1px solid #304D70;padding-top:10px;}
.lw-shell .lw-library-evidence label {display:grid;gap:5px;font-weight:600;color:var(--gold);}
.lw-shell .lw-library-evidence small {font-size:.75rem;color:#bdcde0;}
.lw-shell .lw-library-evidence input[type=file] {padding:5px;font-size:.78rem;}
.lw-shell .lw-library-evidence .lw-link {flex-wrap:nowrap;}
.lw-shell .lw-library-evidence .lw-message {margin:0;padding:8px;font-size:.82rem;}
.lw-shell .lw-chat .lw-scroll,.lw-shell .lw-chat .lw-scroll-empty {flex:1 1 0;min-height:0;max-height:none;overflow-y:auto;}
.lw-shell .lw-chat:has(.lw-scroll-empty) .lw-compose,.lw-shell .lw-chat .lw-compose {margin-top:0;flex:0 0 auto;}
.lw-shell .lw-chat .lw-compose textarea {height:78px;min-height:60px;max-height:110px;resize:vertical;}
.lw-shell .lw-chat .lw-stage {flex:0 1 auto;max-height:30%;overflow:auto;}
.lw-shell .templates-folder-tree {flex:0 0 auto;max-height:35%;min-height:0;}
@media(min-width:1001px){.lw-shell .lw-chat {overflow:hidden;}.lw-shell .lw-chat > h3 {flex-shrink:0;}}
@media(max-width:1000px){.lw-shell .lw-chat .lw-scroll,.lw-shell .lw-chat .lw-scroll-empty {flex:0 1 auto;min-height:120px;max-height:55vh;}.lw-shell .templates-folder-tree{max-height:35vh;}}
