
/* UG-MERGE-20261020-01: lift the owning stacking context while the modal drawer is open.
 * A child z-index alone cannot rise above the sibling fixed subpage header. */
.phone #appMain.chat-view:has(.chat-mentor-thread-sidebar) { z-index: 20; }

/* UG-FE-20261015-D01: 推荐是路由提示，不与导师回答重复做卡片。 */
.mentor-handoff{align-self:flex-start;width:min(440px,100%);padding:4px 2px;color:#567295;font-size:13px;line-height:1.6;overflow-wrap:anywhere;}
.message-author{display:block;margin-bottom:6px;font-size:12px;color:var(--muted);}
.theme-dark .mentor-handoff{color:#b4cdff;}
.phone #appMain.chat-view>.chat-workspace{max-width:none;margin:0;width:100%;height:100%;position:relative;display:grid;grid-template-columns:minmax(0,1fr);min-height:0;}
.chat-workspace .conversation-screen{min-width:0;padding:0;margin:0;}.chat-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 0 12px;border-bottom:1px solid var(--line);}.chat-toolbar strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.chat-toolbar button{display:flex;align-items:center;gap:5px;background:none;border:0;padding:7px 0;font:inherit;font-size:12px;color:#416ba9;cursor:pointer;white-space:nowrap;}.chat-empty{margin:auto;text-align:center;color:var(--muted);}.chat-empty h2{font-size:20px;font-weight:500;}.chat-workspace .waterfall-stream{display:flex;flex-direction:column;gap:12px;min-height:80px;padding:18px 0;}.chat-workspace .message{flex-shrink:0;margin:0;}.chat-workspace .message.user{align-self:flex-end;}.chat-workspace .message.mentor{align-self:flex-start;}.chat-workspace .chat-task-action{font-size:13px;min-height:40px;padding:9px;margin:8px 0;}.chat-workspace .chat-compose{min-height:50px;margin-top:10px;}.chat-workspace .chat-compose input{min-width:0;}
.chat-history{display:none;min-height:0;background:#f5f8fd;border:1px solid var(--line);border-radius:20px;padding:18px;}.chat-history-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;}.chat-history-heading h2{font-size:16px;margin:0;}.chat-history-close{border:0;background:none;font-size:24px;color:var(--ink);cursor:pointer;}.chat-history>.primary{font-size:14px;min-height:44px;padding:10px;margin:16px 0 12px;}.chat-history>input{width:100%;min-height:42px;border:1px solid var(--line);border-radius:12px;padding:10px;font:inherit;background:#fff;}.chat-history-list{flex:1;min-height:0;overflow:auto;margin-top:14px;}.chat-history-item{padding:10px;border:1px solid transparent;border-radius:14px;margin:5px 0;}.chat-history-item.selected{background:#e7effe;border-color:#b6cafa;}.chat-history-item .record-open{padding:0;}.chat-history-item strong{font-size:14px;overflow-wrap:anywhere;}.chat-history-item small{font-size:11px;}.chat-history-item details{padding:0;border:0;background:none;margin:8px 0 0;}.chat-history-item summary{font-size:11px;color:var(--muted);cursor:pointer;}.history-delete{background:none;border:0;font:inherit;font-size:12px;color:#456da9;cursor:pointer;padding:8px 0;}.chat-history-backdrop{position:absolute;inset:0;border:0;background:rgba(28,48,77,.2);backdrop-filter:blur(2px);z-index:4;cursor:pointer;}.history-open .chat-history{display:flex;flex-direction:column;position:absolute;left:0;top:0;bottom:0;z-index:5;width:min(300px,90%);box-shadow:12px 0 32px #24456724;}
@media(min-width:850px){.phone #appMain.chat-view>.chat-workspace{grid-template-columns:250px minmax(0,1fr);gap:24px;}.chat-history{display:flex;flex-direction:column;}.chat-history-close,.chat-history-backdrop,.chat-toolbar .chat-history-toggle{display:none;}.history-open .chat-history{position:static;width:auto;box-shadow:none;}.chat-toolbar strong{font-size:15px;}}
.theme-dark .chat-history{background:#1d2d41;}.theme-dark .chat-history-item.selected{background:#263c65;border-color:#405e92;}.theme-dark .chat-toolbar button,.theme-dark .history-delete{color:#b4cdff;}

.chat-workspace .message.execution-card{display:flex;flex-direction:column;align-items:stretch;width:min(440px,100%);max-width:100%;padding:18px;background:linear-gradient(145deg,#fff,#f3f7ff);border:1px solid #d5e3fc;border-radius:20px;box-shadow:none;color:#29466e;white-space:normal;}.chat-workspace .execution-card-context{margin:0 0 14px;font-size:14px;font-weight:400;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;}.execution-card-goal{display:block;padding-top:14px;border-top:1px solid #e0e9fa;font-size:16px;line-height:1.65;font-weight:600;white-space:pre-wrap;overflow-wrap:anywhere;}.chat-workspace .execution-card-button{align-self:stretch;min-height:44px;width:100%;max-width:100%;box-shadow:none;padding:10px 28px;margin:16px 0 0;border-radius:12px;font-size:14px;}.theme-dark .chat-workspace .message.execution-card{background:linear-gradient(145deg,#203047,#263b5a);border-color:#405a82;color:#e5efff;}.theme-dark .execution-card-goal{border-top-color:#405a82;}

/* One conversation surface for ordinary messages and execution suggestions. */
.chat-workspace .message{padding:16px 18px;border-radius:20px;border:1px solid #dce6f4;box-shadow:none;font-size:15px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;}.chat-workspace .message.mentor{width:min(440px,100%);max-width:100%;background:#fff;color:#29466e;}.chat-workspace .message.user{background:#e9f1ff;color:#29466e;max-width:min(440px,88%);}.chat-workspace .message.execution-card{padding:16px 18px;background:#fff;border-color:#dce6f4;white-space:normal;}.chat-workspace .execution-card-context{font-size:15px;line-height:1.65;color:inherit;}.chat-workspace .chat-compose input{min-height:48px;border:1px solid #dce6f4;border-radius:16px;background:#fff;box-shadow:none;color:#29466e;font-size:15px;}.chat-workspace .chat-compose button{min-height:48px;border-radius:16px;box-shadow:none;}.theme-dark .chat-workspace .message.mentor{background:#203047;border-color:#405a82;color:#e5efff;}.theme-dark .chat-workspace .message.user{background:#293f64;border-color:#405a82;color:#e5efff;}.theme-dark .chat-workspace .chat-compose input{background:#203047;border-color:#405a82;color:#e5efff;}

.phone #appMain.chat-view>.chat-only{display:block;grid-template-columns:none;}.phone #appMain>.chat-history-screen{display:flex;flex-direction:column;max-width:780px;width:100%;height:100%;min-height:0;margin:0 auto;border:0;padding:0;background:none;border-radius:0;box-shadow:none;}.chat-history-screen>.primary{margin:0 0 14px;}.chat-history-screen .chat-history-list{margin-top:14px;}.chat-only .chat-toolbar{justify-content:center;padding-bottom:10px;}.chat-only .chat-compose{margin-top:10px;}

/* UG-MERGE-20261020-01 — group saved conversations by mentor; keep the existing chat canvas. */
.chat-mentor-history-group{margin:10px 0 18px;padding:4px 0 8px;border-bottom:1px solid rgba(139,160,190,.25);}
.chat-mentor-history-heading{display:flex;align-items:center;gap:12px;width:100%;min-height:58px;padding:8px 10px;border:0;border-radius:14px;background:rgba(227,237,252,.62);color:#29466e;text-align:left;font:inherit;cursor:pointer;}
.chat-mentor-history-heading>img{width:40px;height:40px;flex:0 0 40px;border-radius:50%;object-fit:cover;background:#dce8fa;}
.chat-mentor-history-heading-copy{display:grid;gap:3px;flex:1;min-width:0;}
.chat-mentor-history-heading-copy strong{font-size:15px;overflow-wrap:anywhere;}
.chat-mentor-history-heading-copy small{color:#7386a2;font-size:11px;}
.chat-mentor-history-chevron{width:24px;text-align:center;color:#5475b2;font-size:20px;}
.chat-mentor-history-items{padding:4px 0 0 16px;border-left:2px solid #d3e0f4;margin:5px 0 0 19px;}
.chat-mentor-history-items .chat-history-item{display:flex;align-items:center;gap:6px;padding:8px 10px;border:0;border-radius:12px;margin:3px 0;}
.chat-mentor-history-items .record-open{flex:1;min-width:0;padding:4px 0;text-align:left;}
.chat-mentor-history-items .record-open strong{display:block;color:#304768;font-size:14px;}
.chat-mentor-history-items .record-open small{display:block;margin-top:4px;color:#7d8da5;font-size:11px;}
.chat-mentor-history-items details{flex:0 0 auto;margin:0;}

/* UG-MERGE-20261020-01 — a single task/history drawer, outside the isolated mentor backdrop. */
.chat-workspace.chat-only{animation:none;}
.chat-thread-toolbar{display:flex;justify-content:flex-end;flex:0 0 auto;width:100%;max-width:1040px;margin:0 auto;padding:10px 24px 0;}
.conversation-thread-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:8px 12px;border:1px solid #ccdff5;border-radius:13px;background:rgba(247,251,255,.9);color:#416ba9;font:inherit;font-size:13px;cursor:pointer;}
.conversation-thread-toggle svg{flex:0 0 auto;}
.conversation-thread-toggle:hover,.conversation-thread-toggle[aria-expanded=true]{background:#dce8ff;color:#315cc6;}
.conversation-thread-toggle:focus-visible,.chat-mentor-history-heading:focus-visible,.conversation-thread-item:focus-visible,.chat-thread-sidebar-close:focus-visible{outline:3px solid #7199df;outline-offset:3px;}
.chat-thread-backdrop{position:fixed;z-index:1000;inset:0;border:0;background:#10213b55;backdrop-filter:blur(2px);cursor:pointer;}
.chat-mentor-thread-sidebar{position:fixed;z-index:1001;inset:0 0 0 auto;display:flex;flex-direction:column;width:min(340px,88vw);height:100dvh;padding:calc(16px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));border:0;border-radius:0;background:rgba(246,249,255,.98);box-shadow:-12px 0 36px #112b4b30;}
.chat-thread-sidebar-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 2px 14px;border-bottom:1px solid #dce7f8;}
.chat-thread-sidebar-heading>div{display:grid;gap:3px;min-width:0;}
.chat-thread-sidebar-heading strong{font-size:16px;color:#29466e;overflow-wrap:anywhere;}
.chat-thread-sidebar-heading small{font-size:12px;color:#7185a3;}
.chat-thread-sidebar-close{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;border:0;border-radius:50%;background:#e9f0fb;color:#426596;font-size:23px;line-height:1;cursor:pointer;}
.chat-mentor-thread-history{display:grid;align-content:start;gap:18px;min-height:0;overflow:auto;overscroll-behavior:contain;flex:1;margin:12px 0 0;padding:2px 2px 12px;}
.conversation-thread-section{display:grid;gap:7px;min-width:0;}
.conversation-thread-section>h3{margin:0;padding:0 4px 3px;color:#6d82a2;font-size:12px;font-weight:650;}
.conversation-thread-item{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-height:48px;padding:10px 12px;border:0;border-radius:10px;background:#eaf1fc;color:#304768;text-align:left;font:inherit;cursor:pointer;}
.conversation-thread-item>span{min-width:0;font-size:12px;line-height:1.5;overflow-wrap:anywhere;}
.conversation-thread-item small{flex:0 0 auto;color:#6d82a2;font-size:10px;}
.conversation-thread-item:hover{background:#dce8ff;}
.conversation-thread-item.current{background:#dce8ff;box-shadow:inset 3px 0 #5279d6;}
.conversation-thread-empty{margin:0;padding:10px 4px;color:#8494ab;font-size:12px;}

.theme-dark .chat-mentor-history-group{border-color:#40516a;}
.theme-dark .chat-mentor-history-heading{background:#25374f;color:#e5efff;}
.theme-dark .chat-mentor-history-heading>img{background:#304765;}
.theme-dark .chat-mentor-history-heading-copy small,.theme-dark .chat-mentor-history-items .record-open small{color:#a8bada;}
.theme-dark .chat-mentor-history-items{border-color:#405a82;}
.theme-dark .chat-mentor-history-items .chat-history-item.selected{background:#263c65;}
.theme-dark .chat-mentor-history-items .record-open strong{color:#e5efff;}
.theme-dark .conversation-thread-toggle{background:#26384f;border-color:#405a82;color:#b4cdff;}
.theme-dark .conversation-thread-toggle:hover,.theme-dark .conversation-thread-toggle[aria-expanded=true]{background:#263c65;color:#e5efff;}
.theme-dark .chat-thread-backdrop{background:#02091688;}
.theme-dark .chat-mentor-thread-sidebar{background:rgba(24,38,57,.99);box-shadow:-12px 0 36px #0006;}
.theme-dark .chat-thread-sidebar-heading{border-color:#405a82;}
.theme-dark .chat-thread-sidebar-heading strong{color:#e5efff;}
.theme-dark .chat-thread-sidebar-heading small,.theme-dark .conversation-thread-section>h3,.theme-dark .conversation-thread-empty,.theme-dark .conversation-thread-item small{color:#a8bada;}
.theme-dark .chat-thread-sidebar-close{background:#26384f;color:#d9e7ff;}
.theme-dark .conversation-thread-item{background:#26384f;color:#e5efff;}
.theme-dark .conversation-thread-item.current{background:#30486b;}
@media(max-width:600px){.chat-thread-toolbar{padding:8px 16px 0;}.chat-mentor-history-items{padding-left:8px;margin-left:12px;}.chat-mentor-history-items .chat-history-item{padding-inline:8px;}}
