/* Coach: full-height chat, collapsible chat sidebar (max 5), usage meter, Bizly / Obsidian switch. */
#appShell #coach.view.active{display:block}
#appShell .coach-app{--side:270px;position:relative;display:grid;grid-template-columns:var(--side) minmax(0,1fr);height:calc(100dvh - 150px);min-height:520px;border:1px solid rgba(255,255,255,.08);border-radius:22px;overflow:hidden;background:rgba(6,12,26,.55);transition:grid-template-columns .35s cubic-bezier(.2,.8,.2,1)}
#appShell .coach-app.side-closed{grid-template-columns:0 minmax(0,1fr)}
#appShell .coach-side{display:flex;flex-direction:column;min-width:0;overflow:hidden;border-right:1px solid rgba(255,255,255,.07);background:rgba(4,9,20,.7)}
#appShell .coach-app.side-closed .coach-side{border-right:0}
#appShell .coach-side-head{display:flex;gap:8px;padding:14px 12px 10px}
#appShell .coach-new{flex:1;display:flex;align-items:center;gap:8px;min-height:40px;padding:0 14px;border:1px solid rgba(255,255,255,.12);border-radius:12px;background:rgba(255,255,255,.04);color:#e8eef6;font:600 14px Inter,system-ui,sans-serif;cursor:pointer;white-space:nowrap;transition:background .2s,border-color .2s}
#appShell .coach-new:hover{background:rgba(90,192,191,.12);border-color:rgba(90,192,191,.5)}
#appShell .coach-icon-btn{display:grid;place-items:center;flex:none;width:40px;height:40px;border:0;border-radius:12px;background:none;color:#a9b6c8;cursor:pointer;transition:background .2s,color .2s}
#appShell .coach-icon-btn:hover{background:rgba(255,255,255,.07);color:#fff}
#appShell .coach-icon-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7}
#appShell .coach-side-label{display:flex;justify-content:space-between;padding:10px 16px 6px;font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:#7f8ea6}
#appShell .coach-side-label b{font-weight:700;color:#a9b6c8}
#appShell .chats-full .coach-side-label b{color:#ffc66d}
#appShell .coach-chat-list{list-style:none;margin:0;padding:0 8px;overflow-y:auto;flex:1;min-height:0}
#appShell .coach-chat{position:relative;display:flex;align-items:center;margin:2px 0;border-radius:12px;transition:background .2s}
#appShell .coach-chat:hover{background:rgba(255,255,255,.05)}
#appShell .coach-chat.is-active{background:rgba(90,192,191,.13)}
#appShell .coach-chat-open{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;padding:10px 6px 10px 12px;border:0;background:none;color:#dfe7f1;text-align:left;cursor:pointer}
#appShell .coach-chat-open span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:500}
#appShell .coach-chat-open span.is-untitled{color:#93a2b8;font-style:italic}
#appShell .coach-chat-open small{font-size:11.5px;color:#7f8ea6}
#appShell .coach-chat-del{flex:none;display:grid;place-items:center;width:32px;height:32px;margin-right:6px;border:0;border-radius:9px;background:none;color:#7f8ea6;opacity:0;cursor:pointer;transition:opacity .2s,background .2s,color .2s}
#appShell .coach-chat:hover .coach-chat-del,#appShell .coach-chat-del:focus-visible,#appShell .chats-full .coach-chat-del{opacity:1}
#appShell .coach-chat-del:hover{background:rgba(255,143,126,.14);color:#ff8f7e}
#appShell .coach-chat-del svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#appShell .coach-limit-note{margin:6px 12px;padding:10px 12px;border-radius:12px;background:rgba(255,198,109,.08);border:1px solid rgba(255,198,109,.3);color:#efdcb6;font-size:12.5px;line-height:1.45}
#appShell .coach-limit-note.shake{animation:coachShake .4s}
@keyframes coachShake{25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
#appShell .coach-usage{margin-top:auto;padding:14px 14px 16px;border-top:1px solid rgba(255,255,255,.07);display:grid;gap:11px}
#appShell .coach-usage:empty{display:none}
#appShell .coach-usage-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
#appShell .coach-usage-head b{font-size:13px;color:#e8eef6}
#appShell .coach-usage-head small{font-size:11px;color:#7f8ea6}
#appShell .coach-usage-top{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:#a9b6c8;margin-bottom:5px}
#appShell .coach-usage-top b{font-weight:600;color:#dfe7f1;font-variant-numeric:tabular-nums}
#appShell .coach-usage-track{height:5px;border-radius:9px;background:rgba(255,255,255,.08);overflow:hidden}
#appShell .coach-usage-track i{display:block;height:100%;border-radius:inherit;background:#5ac0bf;transition:width .6s cubic-bezier(.2,.8,.2,1)}
#appShell .coach-usage-track i.is-high{background:#ffc66d}
#appShell .coach-usage-up{min-height:36px;border:1px solid rgba(90,192,191,.45);border-radius:10px;background:rgba(90,192,191,.1);color:#bff1ef;font:600 13px Inter,system-ui,sans-serif;cursor:pointer}

#appShell .coach-main{display:flex;flex-direction:column;min-width:0;min-height:0}
#appShell .coach-top{display:flex;align-items:center;gap:8px;min-height:58px;padding:8px 14px;border-bottom:1px solid rgba(255,255,255,.06)}
#appShell #coachSideOpen{display:none}
#appShell .side-closed #coachSideOpen{display:grid}
#appShell .coach-switch{position:relative}
#appShell .coach-switch-btn{display:flex;align-items:center;gap:6px;min-height:40px;padding:0 12px;border:0;border-radius:12px;background:none;color:#f2f5fa;font:700 20px 'Space Grotesk',Inter,sans-serif;letter-spacing:-.02em;cursor:pointer;transition:background .2s}
#appShell .coach-switch-btn:hover,#appShell .coach-switch-btn[aria-expanded=true]{background:rgba(255,255,255,.06)}
#appShell .coach-switch-btn svg{width:18px;height:18px;fill:none;stroke:#93a2b8;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#appShell .coach-switch-menu{position:absolute;top:calc(100% + 8px);left:0;z-index:20;width:300px;padding:6px;border:1px solid rgba(255,255,255,.1);border-radius:18px;background:rgba(17,22,34,.97);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);box-shadow:0 30px 60px -20px rgba(0,0,0,.8);animation:coachMenu .22s cubic-bezier(.2,.8,.2,1)}
#appShell .coach-switch-menu[hidden]{display:none}
@keyframes coachMenu{from{opacity:0;transform:translateY(-6px) scale(.97)}to{opacity:1;transform:none}}
#appShell .coach-switch-menu button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:12px 14px;border:0;border-radius:12px;background:none;color:#e8eef6;text-align:left;cursor:pointer}
#appShell .coach-switch-menu button:hover{background:rgba(255,255,255,.06)}
#appShell .coach-switch-menu b{display:block;font-size:16px;font-weight:600}
#appShell .coach-switch-menu small{display:block;margin-top:2px;font-size:13px;color:#93a2b8}
#appShell .coach-switch-menu i{font-style:normal;color:#e8eef6;opacity:0}
#appShell .coach-switch-menu [aria-checked=true] i{opacity:1}
#appShell .coach-chat-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#93a2b8;font-size:14px}
#appShell .coach-online{flex:none}

/* The chat itself fills the rest of the screen. */
#appShell #coachChatPane.coach-pane{flex:1;display:flex;flex-direction:column;min-height:0;margin:0;border:0;border-radius:0;background:none;box-shadow:none;padding:0}
#appShell #coachChatPane .chat-log{flex:1;min-height:0;max-height:none;height:auto;overflow-y:auto;padding:22px max(18px,calc((100% - 820px)/2));scroll-behavior:auto}
#appShell #coachChatPane .chat-input{margin:0 auto 18px;width:min(820px,calc(100% - 32px))}

#appShell .coach-pane[hidden]{display:none!important}
/* The chat is not a hover card: no lift, glow or border change. */
#appShell #coachChatPane.card,#appShell #coachChatPane.card:hover{transform:none!important;box-shadow:none!important;border-color:transparent!important;transition:none}
/* Under the input: images info + AI disclaimer on one line */
#appShell #coachChatPane .coach-foot{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 18px;width:min(820px,calc(100% - 32px));margin:-8px auto 14px}
#appShell #coachChatPane .coach-foot .attachment-notice{margin:0}
#appShell #coachChatPane .coach-disclaimer{margin:0;font-size:12.5px;color:#7f8ea6}
/* Obsidian view */
#appShell .coach-memory{flex:1;display:grid;grid-template-columns:250px minmax(0,1fr);min-height:0;background:#1f232b}
#appShell .coach-memory[hidden]{display:none}
#appShell .memory-tree{overflow-y:auto;padding:16px 10px;border-right:1px solid rgba(255,255,255,.07);background:#1a1d24}
#appShell .memory-tree-head{padding:4px 10px 12px;font-size:12px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:#9aa5b5}
#appShell .memory-tree summary{display:flex;align-items:center;gap:10px;padding:7px 10px;border-radius:9px;color:#d5dbe4;font-size:14px;cursor:pointer;list-style:none}
#appShell .memory-tree summary::-webkit-details-marker{display:none}
#appShell .memory-tree summary::before{content:'›';display:inline-block;width:10px;color:#7f8ea6;transition:transform .2s}
#appShell .memory-tree details[open]>summary::before{transform:rotate(90deg)}
#appShell .memory-tree summary:hover{background:rgba(255,255,255,.05)}
#appShell .memory-tree summary i{width:8px;height:8px;border-radius:50%;flex:none}
#appShell .memory-tree summary span{flex:1}
#appShell .memory-tree summary small{color:#7f8ea6;font-size:11.5px}
#appShell .memory-tree ul{list-style:none;margin:0 0 6px;padding:0 0 0 30px}
#appShell .memory-tree li button{display:block;width:100%;padding:5px 8px;border:0;border-radius:7px;background:none;color:#aeb8c6;font-size:13px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}
#appShell .memory-tree li button:hover{background:rgba(255,255,255,.05);color:#fff}
#appShell .memory-tree-meta{margin:14px 10px 0;font-size:11.5px;color:#7f8ea6}
#appShell .memory-stage{position:relative;min-width:0;min-height:0}
#appShell #memoryCanvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}
#appShell .memory-empty{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);max-width:340px;text-align:center;color:#aeb8c6;pointer-events:none}
#appShell .memory-empty b{display:block;color:#f2f5fa;font-size:17px;margin-bottom:6px}
#appShell .memory-empty p{margin:0;font-size:14px;line-height:1.5}
#appShell .memory-note{position:absolute;right:16px;top:16px;width:min(320px,calc(100% - 32px));max-height:calc(100% - 90px);overflow:auto;padding:16px 18px;border:1px solid rgba(255,255,255,.1);border-radius:16px;background:rgba(26,29,36,.95);box-shadow:0 20px 50px -20px rgba(0,0,0,.8);animation:coachMenu .22s ease}
#appShell .memory-note-type{font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase}
#appShell .memory-note h4{margin:6px 30px 8px 0;color:#f2f5fa;font-size:17px}
#appShell .memory-note p{margin:0 0 10px;color:#c5ccd6;font-size:14px;line-height:1.5}
#appShell .memory-note-links{display:flex;flex-wrap:wrap;gap:6px}
#appShell .memory-note-links button{padding:5px 10px;border:1px solid rgba(255,255,255,.12);border-radius:99px;background:none;color:#cfd6e0;font-size:12.5px;cursor:pointer}
#appShell .memory-note-links button:hover{border-color:#5ac0bf;color:#fff}
#appShell .memory-note-close{position:absolute;top:10px;right:10px;width:30px;height:30px;border:0;border-radius:8px;background:none;color:#9aa5b5;font-size:20px;cursor:pointer}
#appShell .memory-refresh{position:absolute;left:16px;bottom:16px;min-height:38px;padding:0 14px;border:1px solid rgba(255,255,255,.14);border-radius:12px;background:rgba(26,29,36,.9);color:#dfe5ee;font:600 13px Inter,system-ui,sans-serif;cursor:pointer}
#appShell .memory-refresh:hover{border-color:#5ac0bf}

@media(max-width:860px){
 #appShell .coach-app{grid-template-columns:minmax(0,1fr);height:calc(100dvh - 130px)}
 #appShell .coach-side{position:absolute;inset:0 auto 0 0;z-index:15;width:min(300px,86%);transform:translateX(0);transition:transform .3s cubic-bezier(.2,.8,.2,1);box-shadow:20px 0 50px rgba(0,0,0,.5)}
 #appShell .coach-app.side-closed .coach-side{transform:translateX(-105%);box-shadow:none}
 #appShell .coach-app.side-closed{grid-template-columns:minmax(0,1fr)}
 #appShell .coach-memory{grid-template-columns:1fr}
 #appShell .memory-tree{display:none}
 #appShell .coach-chat-title{display:none}
 #appShell .coach-chat-del{opacity:1}
}
@media(prefers-reduced-motion:reduce){#appShell .coach-app,#appShell .coach-side,#appShell .coach-switch-menu,#appShell .memory-note{transition:none;animation:none}}

#appShell .coach-chat-edit{opacity:.85;font-size:19px}
/* Full-size coach (2026-11-21): the chat fills the whole workspace area, wider reading column. */
#appShell .content:has(> #coach.view.active){padding:12px 16px 14px;max-width:none}
#appShell #coach .coach-app{height:calc(100dvh - 96px);min-height:440px;border-radius:18px}
#appShell #coachChatPane .chat-log{padding:28px max(22px,calc((100% - 1120px)/2))}
#appShell #coachChatPane .chat-input,#appShell #coachChatPane .coach-foot{width:min(1120px,calc(100% - 44px))}
#appShell #coachChatPane .chat-log .msg{font-size:16px;line-height:1.65;max-width:min(88%,980px)}
#appShell #coachChatPane .chat-input input,#appShell #coachChatPane .chat-input textarea{min-height:54px;font-size:16px}
@media(max-width:900px){
 #appShell .content:has(> #coach.view.active){padding:8px 8px 10px}
 #appShell #coach .coach-app{height:calc(var(--bizlee-viewport-height,1dvh)*100 - 82px);min-height:360px;border-radius:16px}
 #appShell #coachChatPane .chat-log{padding:18px 14px}
 #appShell #coachChatPane .chat-input,#appShell #coachChatPane .coach-foot{width:calc(100% - 24px)}
 #appShell #coachChatPane .chat-log .msg{font-size:15.5px;max-width:92%}
}

/* Project View, FUI look: black stage, hairline frame with corner brackets, scanlines, mono type */
#appShell .coach-memory{background:#000;font-family:"JetBrains Mono","Cascadia Mono",Consolas,monospace}
#appShell .memory-tree{background:#03050a;border-right:1px solid rgba(207,230,255,.1)}
#appShell .memory-tree-head{font-family:inherit;letter-spacing:.3em;color:#f2f4f6;display:flex;align-items:center;gap:10px}
#appShell .memory-tree-head::before{content:"";width:12px;height:1px;background:#ff5b1f}
#appShell .memory-tree summary{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:#cfe6ff;border-radius:0;border-top:1px solid rgba(207,230,255,.08)}
#appShell .memory-tree summary i{border-radius:0;width:7px;height:7px}
#appShell .memory-tree li button{font-family:inherit;font-size:12px;color:rgba(242,244,246,.62);border-radius:0}
#appShell .memory-tree li button:hover{color:#fff;background:rgba(94,240,240,.06)}
#appShell .memory-tree-meta{font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:rgba(242,244,246,.34)}
#appShell .memory-stage{background:radial-gradient(ellipse at 50% 55%,rgba(94,240,240,.05),transparent 60%),#000;overflow:hidden}
#appShell .memory-stage::before{content:"";position:absolute;inset:10px;pointer-events:none;border:1px solid rgba(242,244,246,.06);
 background:linear-gradient(rgba(242,244,246,.6),rgba(242,244,246,.6)) left top/18px 1px,linear-gradient(rgba(242,244,246,.6),rgba(242,244,246,.6)) left top/1px 18px,
 linear-gradient(rgba(242,244,246,.6),rgba(242,244,246,.6)) right top/18px 1px,linear-gradient(rgba(242,244,246,.6),rgba(242,244,246,.6)) right top/1px 18px,
 linear-gradient(rgba(242,244,246,.6),rgba(242,244,246,.6)) left bottom/18px 1px,linear-gradient(rgba(242,244,246,.6),rgba(242,244,246,.6)) left bottom/1px 18px,
 linear-gradient(rgba(242,244,246,.6),rgba(242,244,246,.6)) right bottom/18px 1px,linear-gradient(rgba(242,244,246,.6),rgba(242,244,246,.6)) right bottom/1px 18px;background-repeat:no-repeat}
#appShell .memory-stage::after{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(0deg,rgba(255,255,255,.022) 0 1px,transparent 1px 3px);box-shadow:inset 0 0 160px rgba(0,0,0,.9)}
#appShell .memory-note{z-index:2;border-radius:0;border:1px solid rgba(207,230,255,.18);border-top:2px solid #ff5b1f;background:rgba(0,0,0,.88);font-family:"JetBrains Mono",Consolas,monospace}
#appShell .memory-note h4{text-transform:uppercase;letter-spacing:.06em;font-size:15px}
#appShell .memory-note-links button{border-radius:0;font-family:inherit;font-size:11px;letter-spacing:.06em}
#appShell .memory-refresh{z-index:2;border-radius:0;border:1px solid rgba(207,230,255,.25);background:rgba(0,0,0,.7);font:500 11px "JetBrains Mono",Consolas,monospace;letter-spacing:.18em;text-transform:uppercase}
#appShell .memory-refresh:hover{border-color:#5ef0f0;color:#fff}
#appShell .memory-empty{z-index:2;font-family:"JetBrains Mono",Consolas,monospace}
