.consultation-tools{grid-template-columns:repeat(3,minmax(0,1fr))}
/* AI consultation: prioritized evidence in chat + supplemental right panel */
.app-shell.chat-related{grid-template-columns:minmax(180px,var(--left-width)) 10px minmax(0,1fr) 10px minmax(300px,var(--right-width));width:100%;min-width:0}
.app-shell.chat-related .main{border-radius:0}
.app-shell.chat-related .right{display:block;background:rgba(248,252,253,.96)}
.app-shell.chat-related.right-collapsed{grid-template-columns:minmax(180px,var(--left-width)) 10px minmax(0,1fr) 10px 0}
.app-shell.chat-related.right-collapsed .right{display:none}
.app-shell.chat-related.right-collapsed .chat-evidence-more-note{display:none}
.app-shell.chat-related.right-collapsed .chat-evidence-mobile-more{display:block}
.chat-evidence-group{width:min(680px,calc(100% - 44px));margin:2px 0 26px 44px;padding:15px;border:1px solid #dce7eb;border-radius:18px;background:linear-gradient(180deg,#fff,#fbfefe);box-shadow:0 12px 34px rgb(16 24 40 / 7%)}
.chat-evidence-group.is-loading,.chat-evidence-group.is-empty{background:#fbfdfe}
.chat-evidence-group.is-empty>p{margin:10px 0 0;color:#667085;line-height:1.65}
.chat-evidence-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:11px}
.chat-evidence-title>div{display:flex;align-items:center;gap:8px}
.chat-evidence-title b{color:#254653}
.chat-evidence-title>small{padding:4px 8px;border:1px solid #a7dfdf;border-radius:999px;background:#effcfc;color:#0b8291;font-weight:800;white-space:nowrap}
.chat-evidence-bookmark{width:10px;height:15px;background:#10a8b7;clip-path:polygon(0 0,100% 0,100% 100%,50% 72%,0 100%)}
.chat-evidence-list,.related-evidence-list,.chat-evidence-mobile-more>div{display:grid;gap:9px}
.consultation-evidence-card{position:relative;display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:12px;align-items:start;padding:12px;border:1px solid #dfe7ea;border-radius:14px;background:#fff;box-shadow:0 4px 12px rgb(16 24 40 / 3%)}
.consultation-evidence-card:hover{border-color:#a7dfe3;box-shadow:0 8px 20px rgb(16 24 40 / 7%)}
.consultation-evidence-icon{width:42px;height:42px;display:grid;place-items:center;border:1px solid #d7edf0;border-radius:11px;background:#eef9fb;color:#07889a;font-weight:900}
.consultation-evidence-icon::before{content:'K'}
.consultation-evidence-icon[data-evidence-type=document]::before,.consultation-evidence-icon[data-evidence-type=storage]::before{content:'D'}
.consultation-evidence-icon[data-evidence-type=meeting_minutes]::before{content:'M'}
.consultation-evidence-icon[data-evidence-type=slack_channel_overview]::before{content:'S'}
.consultation-evidence-icon[data-evidence-type=employee]::before{content:'P'}
.consultation-evidence-icon[data-evidence-type=knowledge_candidate]::before{content:'K'}
.consultation-evidence-icon[data-evidence-type=meeting_minutes]{background:#fff7e8;border-color:#f4dfb4;color:#be7600}
.consultation-evidence-icon[data-evidence-type=slack_channel_overview]{background:#f4f0ff;border-color:#ded4fb;color:#7054c7}
.consultation-evidence-icon[data-evidence-type=employee]{background:#eef5ff;border-color:#d7e6fb;color:#287fba}
.consultation-evidence-copy{min-width:0;display:grid;gap:3px}
.consultation-evidence-copy>span{width:max-content;max-width:100%;padding:2px 6px;border-radius:6px;background:#eaf8ff;color:#1683bd;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.consultation-evidence-copy>b{line-height:1.45;color:#172b36;overflow-wrap:anywhere}
.consultation-evidence-copy>p{display:-webkit-box;margin:1px 0 0;color:#526571;line-height:1.55;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.consultation-evidence-copy>small{margin-top:2px;color:#8a9aa4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.consultation-evidence-card>strong{align-self:center;padding:3px 6px;border-radius:999px;background:#effbf7;color:#168562;}
.consultation-evidence-open{grid-column:2/-1;justify-self:end;display:flex;align-items:center;gap:6px;margin-top:-2px;padding:2px 0!important;border:0!important;background:transparent!important;color:#07889a!important;font-weight:800!important}
.consultation-evidence-open span{line-height:1}
.chat-evidence-more-note{margin:10px 2px 0;color:#667085;text-align:right}
.chat-evidence-mobile-more{display:none;margin-top:10px;border-top:1px solid #e7eef0;padding-top:10px}
.chat-evidence-mobile-more>summary{cursor:pointer;color:#087e91;font-weight:800}
.chat-evidence-mobile-more>div{margin-top:9px}
.related-panel{box-sizing:border-box;width:100%;height:100%;min-height:0;display:flex;flex-direction:column;overflow:auto;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
.related-panel-head{margin:0 0 14px;flex:0 0 auto}
.related-panel-head h2{margin:0;color:#172b36;}
.related-panel-head p{margin:5px 0 0;color:#667a86;line-height:1.55}
.related-panel-head-copy{min-width:0}
.related-panel-head-copy .speech{margin:6px 0 0;padding:10px 12px;line-height:1.6;overflow-wrap:anywhere}
.related-panel-head-copy>small{display:block;margin-top:8px;color:#667a86;line-height:1.5}
.related-panel-status{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:12px 3px 9px}
.related-panel-status span{color:#36515d;font-weight:800}
.related-panel-status small{padding:3px 7px;border-radius:999px;background:#edf7fa;color:#1683a0;}
.related-evidence-list{flex:none}
.consultation-evidence-card.compact{grid-template-columns:36px minmax(0,1fr) auto;padding:10px;gap:9px;border-radius:13px}
.consultation-evidence-card.compact .consultation-evidence-icon{width:34px;height:34px;border-radius:9px;}
.related-empty{padding:22px 14px;border:1px dashed #cbdfe3;border-radius:15px;background:#fff;text-align:center}
.related-empty b{color:#34515d;}
.related-empty p{margin:7px 0 0;color:#748690;line-height:1.6}
.related-loading{display:grid;place-items:center;gap:7px;padding:20px;border:1px dashed #cbdfe3;border-radius:14px;background:#fff;text-align:center}
.related-loading p{margin:0;color:#667a86;}
.related-diagnostics{margin-top:12px;padding:12px;border:1px solid #eee0bd;border-radius:14px;background:#fffbf1}
.related-diagnostics h3{margin:0;color:#896312;letter-spacing:0}
.related-diagnostics ul{margin:7px 0 0;padding-left:17px}
.related-diagnostics li{color:#755f2e;line-height:1.55}
.related-diagnostics details{margin-top:8px;color:#896312}
.related-diagnostics summary{cursor:pointer;font-weight:800}
.related-panel-foot{margin-top:auto;padding:16px 7px 6px;color:#819099;line-height:1.6;text-align:center}
@media(max-width:1100px){
 .chat-evidence-more-note{display:none}
 .chat-evidence-mobile-more{display:block}
}
@media(max-width:900px){
 .chat-evidence-group{width:calc(100% - 44px);margin-left:44px;padding:12px}
 .consultation-evidence-card{grid-template-columns:38px minmax(0,1fr);gap:9px}
 .consultation-evidence-card .consultation-evidence-icon{width:36px;height:36px}
}

/* AI consultation prompt debug */
.app-shell.chat-related .main,.app-shell.chat-related .chat-workspace,.app-shell.chat-related .conversation,.app-shell.chat-related .msg,.app-shell.chat-related .bubble{min-width:0}
.prompt-debug-panel{width:100%;max-width:100%;min-width:0;margin-top:12px;border:1px solid #dbe5e9;border-radius:13px;background:#fbfcfd;overflow:hidden;color:#263b45}
.prompt-debug-panel>summary{display:flex;align-items:center;gap:8px;width:100%;max-width:100%;min-width:0;min-height:38px;padding:8px 11px;cursor:pointer;list-style:none;color:#5e7079;user-select:none}
.prompt-debug-panel>summary::-webkit-details-marker,.prompt-debug-module>summary::-webkit-details-marker{display:none}
.prompt-debug-panel>summary::after{content:'›';margin-left:auto;line-height:1;transform:rotate(90deg);transition:transform 0.24s ease}
.prompt-debug-panel[open]>summary::after{transform:rotate(-90deg)}
.prompt-debug-panel>summary>b{color:#314a55;}
.prompt-debug-panel>summary>small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.prompt-debug-summary-icon{display:grid;place-items:center;flex:0 0 auto;width:26px;height:22px;border-radius:7px;background:#edf4ff;color:#3174d6;font-weight:800}
.prompt-debug-body{width:100%;max-width:100%;min-width:0;border-top:1px solid #e3eaed;padding:11px;background:#fff;overflow:hidden}
.prompt-debug-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;max-width:100%;min-width:0}
.prompt-debug-head>div:first-child{display:grid;gap:2px;min-width:0}
.prompt-debug-head strong{color:#17313c;font:inherit;}
.prompt-debug-head span{color:#798b94;overflow-wrap:anywhere}
.prompt-debug-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px}
.prompt-debug-actions button{min-height:25px;padding:3px 8px;border:1px solid #dce5e9;border-radius:7px;background:#fff;color:#526872;font-weight:700}
.prompt-debug-actions button:hover{border-color:#96cbd2;background:#f3fbfc;color:#087e91}
.prompt-debug-context{display:flex;align-items:baseline;gap:7px;margin-top:10px}
.prompt-debug-context b{color:#17313c;}
.prompt-debug-context span{color:#84949b;}
.prompt-debug-bar{display:flex;height:7px;margin-top:7px;border-radius:999px;background:#edf1f3;overflow:hidden}
.prompt-debug-bar i{display:block;min-width:2px}
.prompt-debug-bar .blue{background:#3478f6}.prompt-debug-bar .green{background:#27a866}.prompt-debug-bar .orange{background:#d86d13}.prompt-debug-bar .purple{background:#a52ac5}.prompt-debug-bar .cyan{background:#16a4b8}.prompt-debug-bar .rose{background:#d95579}
.prompt-debug-chips{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0 10px}
.prompt-debug-chip{display:inline-flex;align-items:center;gap:4px;padding:3px 7px;border:1px solid #dce5e9;border-radius:999px;background:#fff;color:#536b75;}
.prompt-debug-chip>i,.prompt-debug-module>summary span>i{width:7px;height:7px;border-radius:999px;background:currentColor}
.prompt-debug-chip>b{font-weight:800}
.prompt-debug-chip.blue,.prompt-debug-module.blue{color:#3478f6}.prompt-debug-chip.green,.prompt-debug-module.green{color:#21935a}.prompt-debug-chip.orange,.prompt-debug-module.orange{color:#c65e0c}.prompt-debug-chip.purple,.prompt-debug-module.purple{color:#9825b6}.prompt-debug-chip.cyan,.prompt-debug-module.cyan{color:#128b9b}.prompt-debug-chip.rose,.prompt-debug-module.rose{color:#c9476b}
.prompt-debug-modules{display:grid;gap:6px;max-width:100%;min-width:0}
.prompt-debug-module{width:100%;max-width:100%;min-width:0;border:1px solid #e1e8eb;border-left:3px solid currentColor;border-radius:9px;background:#fff;overflow:hidden}
.prompt-debug-module>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;max-width:100%;min-width:0;padding:8px 9px;cursor:pointer;list-style:none;background:#f9fbfc}
.prompt-debug-module>summary span{display:flex;align-items:center;gap:6px;flex:1 1 auto;min-width:0}
.prompt-debug-module>summary b{min-width:0;color:#2b444f;overflow-wrap:anywhere}
.prompt-debug-module>summary small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#819199;}
.prompt-debug-module>summary em{flex:none;color:#84949b;font-style:normal}
.prompt-debug-module>pre{display:block;width:100%;max-width:100%;min-width:0;max-height:340px;margin:0;padding:10px 11px;border-top:1px solid #e8edef;background:#fff;color:#263b45;font:inherit;white-space:pre-wrap;overflow:auto;overflow-wrap:anywhere;word-break:break-word}
@media(max-width:760px){
 .prompt-debug-panel>summary{align-items:flex-start;flex-wrap:wrap}
 .prompt-debug-panel>summary>small{width:calc(100% - 42px);margin-left:34px}
 .prompt-debug-head{display:grid}
 .prompt-debug-actions{justify-content:flex-start}
 .prompt-debug-module>summary small{display:none}
}


/* Related knowledge detail modal: mirrors the personalization motion */
.consultation-evidence-dialog{width:min(720px,calc(var(--workspace-viewport-width,100vw) - 32px));max-height:min(820px,calc(var(--workspace-viewport-height,100vh) - 32px));padding:0;border:0;border-radius:24px;background:transparent;box-shadow:0 30px 100px rgba(20,32,51,.25)}
.consultation-evidence-dialog::backdrop{background:rgba(15,27,43,.48);backdrop-filter:blur(5px)}
.consultation-evidence-dialog[open]{animation:user-preference-dialog-in 0.24s ease-out both}
.consultation-evidence-dialog[open]::backdrop{animation:user-preference-backdrop-in 0.27s ease-out both}
.consultation-evidence-dialog[open] .consultation-evidence-dialog-card{animation:user-preference-card-in 0.33s cubic-bezier(.2,.8,.2,1) both}
.consultation-evidence-dialog[open].closing{animation:user-preference-dialog-out 0.3s ease-in both}
.consultation-evidence-dialog[open].closing::backdrop{animation:user-preference-backdrop-out 0.3s ease-in both}
.consultation-evidence-dialog[open].closing .consultation-evidence-dialog-card{animation:user-preference-card-out 0.3s ease-in both}
.consultation-evidence-dialog-card{display:flex;max-height:min(820px,calc(var(--workspace-viewport-height,100vh) - 32px));flex-direction:column;overflow:hidden;border:1px solid rgba(255,255,255,.7);border-radius:24px;background:#f7fafb}
.consultation-evidence-dialog-card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:22px 24px;background:linear-gradient(125deg,#fff,#effbf7)}
.consultation-evidence-dialog-card>header span{display:inline-block;padding:4px 8px;border-radius:999px;background:#e6f8f6;color:#087e91;font-weight:900}
.consultation-evidence-dialog-card>header h2{margin:7px 0 5px;color:#172b36;line-height:1.4}
.consultation-evidence-dialog-card>header p{margin:0;color:#667085;}
.consultation-evidence-dialog-card>header button{flex:0 0 auto;width:36px;height:36px;padding:0;border:1px solid #dce5e9;border-radius:50%;background:#fff;color:#667789;}
.consultation-evidence-dialog-body{display:grid;gap:14px;overflow:auto;padding:18px 22px}
.consultation-evidence-dialog-body>section,.consultation-evidence-dialog-body>dl{margin:0;padding:17px;border:1px solid #dfe7ea;border-radius:18px;background:#fff}
.consultation-evidence-dialog-body>section>b{color:#263b45;}
.consultation-evidence-dialog-body>section>p{margin:8px 0 0;color:#526571;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}
.consultation-evidence-dialog-body dl{display:grid;gap:9px}
.consultation-evidence-dialog-body dl>div{display:grid;grid-template-columns:90px minmax(0,1fr);gap:12px}
.consultation-evidence-dialog-body dt{color:#7a8b95;font-weight:800}
.consultation-evidence-dialog-body dd{margin:0;color:#334b56;overflow-wrap:anywhere}
.consultation-evidence-dialog-card>footer{display:flex;justify-content:flex-end;padding:14px 22px;border-top:1px solid #dfe7ea;background:#fff}
.consultation-evidence-dialog-card>footer button{min-width:96px;padding:8px 14px;border:1px solid #b9dfe4;border-radius:11px;background:#fff;color:#087e91;font-weight:800}
@media(max-width:640px){.consultation-evidence-dialog{width:calc(var(--workspace-viewport-width,100vw) - 20px);max-height:calc(var(--workspace-viewport-height,100vh) - 20px)}.consultation-evidence-dialog-card{max-height:calc(var(--workspace-viewport-height,100vh) - 20px)}.consultation-evidence-dialog-card>header{padding:18px}.consultation-evidence-dialog-body{padding:14px}.consultation-evidence-dialog-body dl>div{grid-template-columns:1fr;gap:3px}}
@media(prefers-reduced-motion:reduce){.consultation-evidence-dialog[open],.consultation-evidence-dialog[open]::backdrop,.consultation-evidence-dialog[open] .consultation-evidence-dialog-card,.consultation-evidence-dialog[open].closing,.consultation-evidence-dialog[open].closing::backdrop,.consultation-evidence-dialog[open].closing .consultation-evidence-dialog-card{animation:none}}

.consultation-evidence-loading-state{display:grid;place-items:center;align-content:center;gap:16px;min-height:200px;padding:24px;color:#526571}
.consultation-evidence-loading-state p{margin:0}
.consultation-evidence-spinner{width:32px;height:32px;border:3px solid #dcece8;border-top-color:#079b8b;border-radius:50%;animation:evidence-detail-spin 1.35s linear infinite}
@keyframes evidence-detail-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.consultation-evidence-spinner{animation:none}}
.consultation-evidence-detail-section{margin-top:14px;padding-top:13px;border-top:1px solid #e5ecef}
.consultation-evidence-detail-section strong{color:#29434f;}
.consultation-evidence-detail-section ul{display:grid;gap:6px;margin:8px 0 0;padding-left:18px}
.consultation-evidence-detail-section li{color:#526571;line-height:1.65;overflow-wrap:anywhere}
.consultation-evidence-detail-error{display:block;margin-top:10px;padding:8px 10px;border-radius:9px;background:#fff7ed;color:#a45110;}
.consultation-evidence-note-open{padding:0;border:0;background:transparent;color:#087e91;font:inherit;font-weight:800;text-align:left;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.consultation-evidence-detail-section li small{display:block;margin-top:2px;color:#7a8b95;line-height:1.5}
.consultation-evidence-note-preview{margin-top:14px;padding-top:13px;border-top:1px solid #e5ecef}
.consultation-evidence-note-preview b{color:#29434f;}
.consultation-evidence-note-preview p{margin:8px 0 0;color:#526571;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}


.source-file-link{display:inline-flex;align-items:center;gap:5px;width:max-content;padding:6px 9px;border:1px solid #b9dfe4;border-radius:9px;background:#f4fcfd;color:#087e91;font:inherit;font-weight:800;text-decoration:none;cursor:pointer}
.source-file-link:hover{background:#e5f7f9;border-color:#76c6d0}
.source-file-link.is-primary{padding:10px 14px;background:#087e91;color:#fff;border-color:#087e91}
.consultation-evidence-actions{display:flex;flex-direction:column;align-items:flex-end;gap:7px;min-width:118px}
.source-file-list{display:grid;gap:8px;margin-top:16px;padding-top:14px;border-top:1px solid #e5ecef}
.source-file-list>b{color:#29434f;}
.source-file-list>div{display:flex;flex-wrap:wrap;gap:7px}
.knowledge-search-result-actions{display:flex;flex-direction:column;align-items:flex-end;gap:7px}
.interview-material-chip .source-file-link{margin-left:auto;white-space:nowrap}
.storage-file-dialog{width:min(900px,calc(var(--workspace-viewport-width,100vw) - 32px));max-width:none;padding:0;border:0;border-radius:18px;background:transparent;box-shadow:0 24px 80px rgba(28,57,67,.25)}
.storage-file-dialog::backdrop{background:rgba(17,42,50,.48)}
.storage-file-dialog-card{display:flex;flex-direction:column;max-height:calc(var(--workspace-viewport-height,100vh) - 48px);overflow:hidden;border:1px solid #dce9ec;border-radius:18px;background:#f8fbfc}
.storage-file-dialog-card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px 22px;border-bottom:1px solid #dce9ec;background:#fff}
.storage-file-dialog-card>header span{color:#087e91;font-weight:800}
.storage-file-dialog-card>header h2{margin:4px 0 0;color:#29434f;overflow-wrap:anywhere}
.storage-file-dialog-card>header button{width:32px;height:32px;border:0;border-radius:10px;background:#edf5f6;color:#49606b;cursor:pointer}
.storage-file-dialog-body{display:grid;place-items:center;min-height:180px;padding:18px;overflow:auto;color:#526571}
.storage-file-dialog-body>p{max-width:520px;line-height:1.7;text-align:center}.storage-file-dialog-body .markdown-loading{width:100%;box-sizing:border-box}
.storage-file-preview-image{display:block;max-width:100%;max-height:calc(var(--workspace-viewport-height,100vh) - 190px);object-fit:contain;border-radius:10px}
.storage-file-preview-video{display:block;width:min(100%,820px);max-height:calc(var(--workspace-viewport-height,100vh) - 190px);border-radius:10px;background:#10252c}
.storage-file-preview-pdf{width:100%;height:min(calc(var(--workspace-viewport-height,100vh) * 0.72),760px);border:0;border-radius:10px;background:#fff}
.storage-file-preview-download{display:grid;place-items:center;gap:10px;padding:42px 20px;text-align:center}
.storage-file-preview-download h3{margin:0;color:#29434f}
.storage-file-preview-download p{margin:0;max-width:480px;line-height:1.7}
.storage-file-preview-error{color:#a45110}
.storage-file-dialog-card>footer{display:flex;justify-content:flex-end;padding:13px 22px;border-top:1px solid #dce9ec;background:#fff}
.storage-file-dialog-card>footer button{padding:8px 14px;border:1px solid #b9dfe4;border-radius:10px;background:#fff;color:#087e91;font-weight:800;cursor:pointer}
@media(max-width:640px){.consultation-evidence-actions,.knowledge-search-result-actions{align-items:stretch;width:100%}.storage-file-dialog{width:calc(var(--workspace-viewport-width,100vw) - 18px)}.storage-file-dialog-card{max-height:calc(var(--workspace-viewport-height,100vh) - 18px)}.storage-file-dialog-card>header,.storage-file-dialog-card>footer{padding-left:15px;padding-right:15px}.storage-file-dialog-body{padding:10px}.storage-file-preview-pdf{height:calc(var(--workspace-viewport-height,100vh) * 0.7)}}

.channel-card .document-list-select{display:grid;width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}
.channel-card .document-list-select b,.channel-card .document-list-select span,.channel-card .document-list-select small{display:block}
.channel-card .document-list-select b{margin-bottom:4px}
.channel-card .document-list-select span{margin-bottom:4px}
.channel-card .document-list-select small{overflow-wrap:anywhere}
.channel-card>.source-file-link{margin-top:9px}

/* Responsive related-information shelf. */
.chat-evidence-group{width:min(980px,calc(100% - 48px));margin:2px auto 26px;padding:12px 0;border:0;border-radius:0;background:transparent;box-shadow:none}
.consultation-evidence-card{box-shadow:none}
@media(max-width:1100px){
  .app-shell.chat-related{grid-template-columns:minmax(180px,var(--left-width)) 10px minmax(0,1fr);width:100%;min-width:0}
  .app-shell.chat-related .right-resizer,.app-shell.chat-related .right{display:none}
}
@media(max-width:920px){
  .app-shell.chat-related{display:block;padding:0}
  .app-shell.chat-related .sidebar,.app-shell.chat-related .left-resizer{display:none}
  .app-shell.chat-related .main{height:var(--workspace-viewport-height,100vh);border-radius:0}
}

/* Follow-up: keep related information fluid with the chat canvas. */
.chat-evidence-group{width:min(1200px,calc(100% - 32px));margin-left:auto;margin-right:auto}

/* Keep the answer area primary: evidence is one compact, user-controlled disclosure. */
.chat-evidence-collapsible{padding:10px 12px;border:1px solid #dce7eb;border-radius:14px;background:linear-gradient(180deg,#fff,#fbfefe)}
.chat-evidence-collapsible>summary{margin:0;cursor:pointer;list-style:none}
.chat-evidence-collapsible>summary::-webkit-details-marker{display:none}
.chat-evidence-collapsible>summary::after{content:'展開';display:inline-flex;align-items:center;justify-content:center;min-width:44px;padding:4px 7px;border:1px solid #c7e5e5;border-radius:999px;color:#087e91;background:#f4fcfc;font-weight:800}
.chat-evidence-collapsible[open]>summary::after{content:'折りたたむ'}
.chat-evidence-collapsible[open]>.chat-evidence-list{margin-top:11px}

/* AI consultation: public general references, kept separate from internal knowledge. */
.consultation-general-references{margin:14px 0 0;padding:13px 14px;border:1px solid #c9e7e8;border-radius:15px;background:linear-gradient(180deg,#f7ffff,#fff)}
.consultation-general-references>header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.consultation-general-references>header>div{display:flex;align-items:flex-start;gap:8px;min-width:0}
.consultation-general-references>header>div>span{line-height:1.2}
.consultation-general-references>header b{display:block;color:#1d4e5b;}
.consultation-general-references>header small{display:block;margin-top:3px;color:#66818a;line-height:1.45}
.consultation-general-references>header>strong{flex:0 0 auto;padding:3px 7px;border-radius:999px;background:#e8f8f7;color:#087e91;}
.consultation-general-references-policy{margin:9px 0 0;color:#6c8088;line-height:1.55}
.consultation-general-reference-list{display:grid;gap:8px;margin-top:10px}
.consultation-general-reference-card{padding:10px 11px;border:1px solid #dcecef;border-radius:12px;background:#fff}
.consultation-general-reference-card-head{display:flex;align-items:flex-start;gap:8px}
.consultation-general-reference-card-head>span{line-height:1.3}
.consultation-general-reference-card-head b{display:block;color:#284b56;line-height:1.45;overflow-wrap:anywhere}
.consultation-general-reference-card-head small{display:block;margin-top:2px;color:#16839a;}
.consultation-general-reference-card>p{margin:7px 0 0;color:#526571;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}
.consultation-general-reference-sources{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}
.consultation-general-reference-sources a{display:inline-flex;max-width:100%;padding:4px 7px;border:1px solid #b9dfe4;border-radius:7px;background:#f4fcfd;color:#087e91;font-weight:800;text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.consultation-general-reference-sources a:hover{background:#e5f7f9}
.consultation-general-reference-meta{display:block;margin-top:7px;color:#8a9aa4;}
.consultation-general-reference-card.compact{padding:9px}
.consultation-general-reference-card.compact>p{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
@media(max-width:640px){.consultation-general-references{margin-top:11px;padding:11px}.consultation-general-references>header{gap:7px}.consultation-general-reference-sources a{max-width:100%}}

/* AI consultation: visible public-web information marker and material attachments. */
.consultation-general-reference-empty{margin:9px 0 0;padding:8px 10px;border-top:1px solid #e4eff0;color:#71848c;line-height:1.55}
.consultation-composer-tools{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.consultation-composer-tools small{color:#78909a;}
.consultation-attach{display:grid;place-items:center;width:30px;height:30px;padding:0;border:1px solid #b9dfe4;border-radius:9px;background:#f4fcfd;color:#087e91;cursor:pointer}
.consultation-attach:hover{background:#e5f7f9;border-color:#76c6d0}
.consultation-attach:disabled{cursor:wait;opacity:.65}
.consultation-materials{margin:0 0 9px;padding:10px 11px;border:1px solid #dcecef;border-radius:12px;background:#fbffff}
.consultation-materials>header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.consultation-materials>header>div{display:grid;gap:2px}
.consultation-materials>header b{color:#29434f;}
.consultation-materials>header small{color:#71848c;line-height:1.45}
.consultation-materials>header>strong,.consultation-materials>header>span{padding:3px 7px;border-radius:999px;background:#e8f8f7;color:#087e91;white-space:nowrap}
.consultation-material-analysis{margin-top:8px}
.consultation-material-list{display:grid;gap:6px;margin-top:8px}
.consultation-material-chip{display:flex;align-items:center;gap:7px;padding:7px 8px;border-bottom:1px solid #e5eff0}
.consultation-material-chip:last-child{border-bottom:0}
.consultation-material-chip>span{display:grid;place-items:center;width:22px;height:22px;border-radius:7px;background:#eaf8f6;color:#168562;font-weight:900}
.consultation-material-chip.failed>span{background:#fff1ed;color:#b34d2c}
.consultation-material-chip>div{display:grid;gap:2px;min-width:0;flex:1}
.consultation-material-chip b{color:#29434f;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.consultation-material-chip small{color:#7b8c94;}
.consultation-material-chip .source-file-link{flex:0 0 auto;padding:4px 6px;}
.consultation-material-chip>button{width:22px;height:22px;padding:0;border:0;border-radius:6px;background:transparent;color:#78909a;cursor:pointer}
.consultation-material-chip>button:hover{background:#fff0ed;color:#b34d2c}
.consultation-material-chip>[data-open-library-material]{width:auto;height:auto;flex:0 0 auto;max-width:45%;padding:6px 8px;border:1px solid #c9dedb;background:#fff;color:#27524b;white-space:normal;overflow-wrap:anywhere}
.consultation-material-message{margin:8px 0 0;color:#168562;}
.consultation-material-message.error{color:#b34d2c}
@media(max-width:640px){.consultation-materials{padding:9px}.consultation-material-chip .source-file-link{display:none}}

.chat-answer-references .chat-evidence-group{width:100%;max-width:none;margin:0;padding:0;border:1px solid #dce8e7;border-radius:14px;background:#fff;box-shadow:none;box-sizing:border-box}
.chat-answer-references .chat-evidence-title{padding:14px;gap:10px;flex-wrap:wrap}
.chat-answer-references .chat-evidence-list{display:grid;gap:10px;padding:0 14px 14px;max-height:none;overflow:visible}
.chat-answer-references .consultation-evidence-card{grid-template-columns:28px minmax(0,1fr);padding:12px;gap:8px;border:1px solid #e3eceb;box-shadow:none;background:#fafcfb}
.chat-answer-references .consultation-evidence-icon{width:26px;height:26px}
.chat-answer-references .consultation-evidence-card>strong{display:none}
.chat-answer-references .consultation-evidence-copy>b{display:block;overflow:visible;overflow-wrap:anywhere}
.chat-answer-references .consultation-evidence-copy>small{display:none}
.chat-answer-references .consultation-evidence-reason{margin-top:8px;color:#496d69}
.chat-answer-references .consultation-evidence-reason b{color:#215c54}
.chat-answer-references .consultation-evidence-actions{grid-column:2;flex-wrap:wrap}
.chat-answer-references .chat-evidence-more-note{padding:0 14px 12px;margin:0;text-align:left}

.chat-evidence-collapsible>.chat-evidence-title{justify-content:flex-start;gap:8px}
.chat-evidence-collapsible>.chat-evidence-title>div{flex:1 1 auto;min-width:0}
.chat-evidence-collapsible>.chat-evidence-title>small{margin-left:auto;flex:0 0 auto}
.chat-evidence-collapsible>.chat-evidence-title::after{flex:0 0 auto;margin-left:0}

.consultation-material-list{grid-template-columns:repeat(auto-fit,minmax(min(290px,100%),1fr));gap:10px;max-height:260px;overflow:auto;padding:2px}
.consultation-material-chip,.consultation-material-chip:last-child{display:grid;grid-template-columns:52px minmax(0,1fr) auto;align-items:start;gap:12px;padding:14px;border:1px solid #cee2df;border-radius:14px;background:#fff;box-shadow:0 3px 12px #234e4910}
.consultation-material-chip>.consultation-file-art{display:flex;flex-direction:column;gap:3px;width:50px;height:auto;padding:8px 0;border-radius:10px;background:#e7f4f2;color:#278673}.consultation-file-art svg{width:28px;height:34px}.consultation-material-chip>.consultation-file-art.is-pdf{background:#fff0ed;color:#cc5850}.consultation-material-chip>.consultation-file-art.is-office{background:#eaf2fc;color:#397cb6}.consultation-material-chip .consultation-file-copy>b{white-space:normal;overflow-wrap:anywhere}.consultation-material-chip .consultation-original-name{overflow-wrap:anywhere;line-height:1.5}.consultation-file-status{color:#15826e;line-height:1.5}.consultation-material-chip.failed .consultation-file-status{color:#ac4635}
.consultation-material-chip>.consultation-file-actions{display:flex;flex-direction:column;align-items:flex-end;gap:8px;flex:none}.consultation-file-actions button{padding:5px 8px;border:1px solid #c9dedb;border-radius:8px;background:#f6fbf9;color:#27524b;cursor:pointer}.consultation-file-actions [data-delete-consultation-material]{border:0;background:transparent;min-width:28px}.consultation-material-chip .source-file-link{display:inline-flex!important}
@media(max-width:600px){.consultation-material-chip{grid-template-columns:44px minmax(0,1fr)}.consultation-material-chip>.consultation-file-art{width:42px}.consultation-material-chip>.consultation-file-actions{grid-column:2;flex-direction:row;justify-content:space-between;align-items:center}}
.consultation-library-gallery{margin:12px 0}
.consultation-library-gallery>header{display:flex;align-items:center;gap:10px;margin-bottom:10px;color:#245567}
.consultation-library-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(200px,100%),1fr));gap:12px}
.consultation-library-card{min-width:0;border:1px solid #dce9ed;border-radius:14px;background:#fff;overflow:hidden}
.consultation-library-card>button{display:flex;flex-direction:column;gap:10px;width:100%;padding:10px;border:0;background:transparent;text-align:left;color:inherit;cursor:pointer}
.consultation-library-card>button:hover{background:#f1faf9}
.consultation-library-preview{display:block;position:relative;width:100%;aspect-ratio:4/3;overflow:hidden;border:1px solid #e1e9eb;border-radius:8px;background:#f4f7f8}
.consultation-library-preview img{width:100%;height:100%;object-fit:contain;background:white}
.consultation-library-preview img[hidden]{display:none}
.consultation-library-text-preview{display:flex;flex-direction:column;gap:10px;padding:14px;background:#fff;min-height:100%;line-height:1.5;overflow-wrap:anywhere}
.consultation-library-text-preview>span{color:#81929c}
.has-thumbnail .consultation-library-text-preview{display:none}
.consultation-library-extension{position:absolute;bottom:7px;right:7px;padding:3px 7px;border-radius:5px;background:#e7f5f5;color:#157f8b;font-weight:700}
.consultation-library-title{overflow-wrap:anywhere;line-height:1.5}
.consultation-library-open{color:#008aa0}
.consultation-library-card>p{margin:0;padding:0 10px 12px;color:#627783;line-height:1.6;overflow-wrap:anywhere}

.chat-workspace .msg.ai .msg-content>.bubble{background:#fff}
.chat-workspace .msg.user .msg-content>.bubble{background:#dcf4da}

.consultation-library-gallery>.chat-evidence-title{display:flex;align-items:center;margin:0;padding:12px 14px;color:var(--workspace-ink);background:var(--workspace-subtle)}
.consultation-library-gallery>.consultation-library-grid{padding:14px}
.consultation-library-gallery:not([open])>.consultation-library-grid{display:none}
/* 2026-11-03：回答の下の「関連情報」は、その他のアクションと同じく文字だけの見出しにし、押すと開く */
.chat-answer-references-fold{margin:6px 0 0}
.chat-answer-references-fold>summary{display:inline-flex;align-items:center;gap:6px;padding:4px 0;color:#6b7f8c;cursor:pointer;list-style:none}
.chat-answer-references-fold>summary::-webkit-details-marker{display:none}
.chat-answer-references-fold>summary::before{content:"▸";transition:transform .15s ease}
.chat-answer-references-fold[open]>summary::before{transform:rotate(90deg)}
.chat-answer-references-fold>.chat-answer-references{margin-top:6px}
@media(prefers-reduced-motion:reduce){.chat-answer-references-fold>summary::before{transition:none}}
/* ダークモード：関連情報の枠とカードを暗い面にする（白い枠が浮かないように） */
html[data-ui-design=dark] .chat-answer-references-fold>summary{color:#a9bac4}
html[data-ui-design=dark] .chat-answer-references .chat-evidence-group{background:#1c2529;border-color:#334349;color:#dbe5ea}
html[data-ui-design=dark] .chat-answer-references .consultation-evidence-card{background:#222d32;border-color:#334349;color:#dbe5ea}
html[data-ui-design=dark] .chat-answer-references .consultation-evidence-reason{color:#a9c2be}
html[data-ui-design=dark] .chat-answer-references .consultation-evidence-reason b{color:#cfe3df}
html[data-ui-design=dark] .chat-answer-references .interview-general-references{background:#1c2529;border-color:#334349;color:#dbe5ea}
html[data-ui-design=dark] .chat-answer-references .interview-general-references>summary>span{background:#24343a}
html[data-ui-design=dark] .chat-answer-references .general-reference-panel{background:#1c2529;border-top-color:#334349}
html[data-ui-design=dark] .chat-answer-references .chat-evidence-title,html[data-ui-design=dark] .chat-answer-references .chat-evidence-title b,html[data-ui-design=dark] .chat-answer-references .interview-general-references>summary b{color:#9fd6cf}
/* 関連情報が0件のときの文も、見出しと同じ左右の余白にそろえる */
.chat-answer-references .chat-evidence-group>p{margin:0;padding:0 14px 14px}
.ai-chat-screen .chat-answer-references-fold>summary{color:var(--chat-mono-muted,#6b6b6b)}
