/* The platform shell changes presentation; existing tools and data remain independent. */
:root {
  --bg: #0c0d14;
  --panel: #15151f;
  --line: #ffffff12;
  --muted: #a6a5b9;
  --weak: #ccc9dc;
  --accent: #c5b1ff;
  --primary: #9e7ff0;
}
body { background: #0c0d14; color: #efedf7; }
button { transition: background .18s ease, border-color .18s ease, color .18s ease; }
.platform-frame { display: flex; height: 100dvh; min-width: 0; }
.platform-sidebar { width: 254px; flex: none; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #b6a2d22a transparent; padding: 32px 18px 22px; border-right: 1px solid #ffffff0d; background: #101017; }
.platform-sidebar > * { flex-shrink: 0; }
.nav-short { display: none; }
.platform-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.platform-brand img { flex: none; border-radius: 13px; box-shadow: 0 0 28px #a583f510; }
.platform-brand h1 { font-size: 21px; font-weight: 600; line-height: 1.5; margin: 0; letter-spacing: -.5px; white-space: nowrap; }
.platform-brand > div > span { font-size: 12px; color: #9791aa; letter-spacing: .16em; display: block; line-height: 1.8; }
.platform-new-chat { display: flex; align-items: center; gap: 10px; margin: 35px 6px 32px; padding: 12px 14px; min-height: 48px; border: 1px solid #d5c8ff30; border-radius: 11px; background: #d6c8fa; color: #2b1c44; font-size: 16px; font-weight: 600; box-shadow: 0 4px 20px #a286f00b; }
.platform-new-chat:hover { background: #e2d8fc; border-color: #e8deff; }
.platform-new-chat svg { width: 19px; height: 19px; }
.new-chat-mark { margin-left: auto; font-size: 20px; color: #684c8a; }
.platform-sidebar svg, .entry-icon svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.platform-nav { display: flex; flex-direction: column; gap: 6px; }
.platform-nav-label { font-size: 13px; color: #827d94; padding: 0 16px 11px; }
.platform-nav-item { position: relative; display: flex; align-items: center; gap: 13px; width: 100%; min-height: 49px; padding: 12px 16px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; font-size: 16px; color: #aaa6ba; }
.platform-nav-item svg { width: 21px; height: 21px; color: #9690a6; }
.platform-nav-item:hover { background: #ffffff05; border-color: #ffffff0c; color: #e1daef; }
.platform-nav-item.is-current { background: linear-gradient(100deg,#a17be21c,#a17be20c); border-color: #b391ed1a; color: #d6c3ff; }
.platform-nav-item.is-current svg { color: #c4a5fb; }
.platform-nav-item i { margin-left: auto; height: 5px; width: 5px; border-radius: 50%; background: #c7a8fd; box-shadow: 0 0 8px #c7a8fd70; }
.platform-nav-item b { font-size: 13px; font-weight: 400; margin-left: auto; min-width: 22px; padding: 0 4px; line-height: 22px; text-align: center; color: #aaa0bf; background: #ffffff06; border: 1px solid #ffffff09; border-radius: 5px; }
.platform-settings { margin-top: 19px; }
.platform-sidebar-bottom { display: flex; align-items: center; gap: 11px; margin: auto 6px 0; padding: 20px 2px 0; border-top: 1px solid #ffffff0b; }
.workspace-avatar { display: grid; place-items: center; width: 37px; height: 37px; flex: none; background: #bca1f615; border: 1px solid #cdb4fa20; border-radius: 50%; color: #cfb8f2; font-size: 15px; }
.platform-sidebar-bottom strong { display: block; font-size: 14px; font-weight: 500; color: #d0c8de; }
.platform-sidebar-bottom span { display: block; font-size: 12px; line-height: 1.8; color: #9890a7; }
.chat-view { flex: 1; min-width: 0; display: flex; flex-direction: column; width: auto; max-width: none; height: 100%; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: radial-gradient(ellipse at 55% 28%,#54407013,transparent 55%),#0c0d14; }
.platform-topbar { display: flex; align-items: center; justify-content: space-between; flex: none; gap: 16px; min-height: 82px; padding: 18px 40px; border-bottom: 1px solid #ffffff0c; }
.workspace-breadcrumb { display: flex; align-items: center; gap: 14px; font-size: 14px; color: #9790a6; }
.workspace-breadcrumb > span:nth-child(2) { color: #655e75; }
.workspace-breadcrumb strong { font-size: 15px; font-weight: 500; color: #d8d2e3; }
.chat-shell { width: 100%; max-width: 952px; margin: 0 auto; padding: 22px 38px 20px; height: auto; flex: 1; min-height: 0; }
#configNotice { order: 0; }
#resourceChatContext { order: 1; }
#agentWorkflowPanel { order: 3; }
#agentMessages { order: 3; padding: 0 0 12px; }
.guided-entry { order: 4; gap: 14px; margin: 12px 0 18px; }
#agentPromptRow { order: 5; }
#attachmentTray { order: 6; }
#pendingBar { order: 7; }
#agentChatForm { order: 8; }
.welcome { max-width: none; min-height: 100%; margin: 0; padding: 24px 0 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.welcome-signature { padding: 8px; border: 1px solid #c9b5ff1d; border-radius: 24px; background: linear-gradient(140deg,#c8b0ff0f,#987add03); box-shadow: 0 0 65px #a779ed10; }
.welcome-signature img { display: block; width: 54px; height: 54px; border-radius: 16px; }
.welcome .eyebrow { margin: 22px 0 13px; color: #a89aba; font-size: 12px; font-weight: 500; letter-spacing: .19em; }
.welcome h2 { font-size: clamp(32px,3.3vw,44px); font-weight: 500; letter-spacing: -1.3px; line-height: 1.5; margin: 0 0 17px; color: #f0edf8; }
.welcome h2 span { color: #c4b0ec; background: linear-gradient(100deg,#e1d4ff,#b39ad9 82%); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.welcome p { max-width: none; font-size: 17px; line-height: 1.85; color: #a29aaf; }
.entry-card, #agentWorkflowToggle.entry-card { min-height: 102px; padding: 20px; display: flex; gap: 16px; align-items: center; border: 1px solid #b5a2d529; background: linear-gradient(115deg,#39304460,#24212f60); box-shadow: inset 0 1px 0 #ffffff04; border-radius: 15px; }
.entry-card.directory-entry { border-color: #a8a2d025; background: linear-gradient(115deg,#2a293d70,#20202d60); }
.entry-card:hover, #agentWorkflowToggle.entry-card:hover { border-color: #c6ace766; background: linear-gradient(115deg,#4a36585c,#30263f80); }
.entry-card .entry-icon { display: grid; place-items: center; width: 44px; height: 46px; border: 1px solid #cbb0f11b; border-radius: 12px; color: #d0b5f1; background: #af85e411; }
.entry-icon svg { width: 24px; height: 24px; }
.entry-card.directory-entry .entry-icon { color: #c4bcf4; background: #9a91ed12; border-color: #b3aaf021; }
.entry-card strong { font-size: 20px; line-height: 1.5; color: #ede5fa; font-weight: 500; }
.entry-card small { font-size: 14px; color: #b1a6c1; margin-top: 5px; }
.entry-card .entry-arrow { color: #9d89b5; font-size: 22px; }
.prompt-row { justify-content: center; gap: 9px; margin: 0 0 17px; flex-wrap: wrap; }
.prompt-row button { min-height: 40px; border: 1px solid #ffffff0b; border-radius: 8px; background: #ffffff02; color: #aaa1b7; font-size: 16px; padding: 7px 10px; }
.prompt-row button:hover { border-color: #c2a3ee42; color: #d8c6f0; background: #c2a3ee09; }
.chat-input { padding: 13px 15px 12px; gap: 8px; border: 1px solid #c4adde30; border-radius: 18px; background: linear-gradient(125deg,#23202d,#1b1924); box-shadow: 0 12px 60px #00000012,inset 0 1px 0 #e3d4ff08; transition: border-color .2s,box-shadow .2s; }
.chat-input:focus-within { border-color: #c1a1f36b; box-shadow: 0 0 0 3px #bd96ed06,0 12px 60px #00000012; }
.chat-input textarea { font-size: 18px; min-height: 69px; padding: 5px 4px 8px; line-height: 1.75; }
.chat-input textarea::placeholder { color: #a69bad; }
.channel-select { border: 1px solid #b8a5d020; border-radius: 8px; padding: 0 9px; background: #11101845; gap: 7px; }
.channel-dot { width: 5px; height: 5px; background: #c6abe9; }
.channel-select select { min-height: 36px; font-size: 15px; padding: 4px 2px; color: #d0c3df; }
.composer-actions { gap: 8px; }
.icon-button { color: #b1a3c1; }
.composer-actions .primary { min-height: 42px; padding: 8px 18px; background: #c6afea; color: #2c1b43; border-color: #e1c9ff33; font-size: 16px; font-weight: 500; border-radius: 10px; }
.composer-actions .primary:hover { background: #d6c1f4; }
.composer-footnote { font-size: 14px; margin: 13px 0 0; color: #9890a5; }
.has-conversation .guided-entry, .workflow-editing .guided-entry { order: 2; margin: 0 0 16px; }
.has-conversation .entry-card, .has-conversation #agentWorkflowToggle.entry-card, .workflow-editing .entry-card, .workflow-editing #agentWorkflowToggle.entry-card { min-height: 59px; padding: 10px 16px; gap: 11px; border-radius: 11px; }
.has-conversation .entry-card strong, .workflow-editing .entry-card strong { font-size: 16px; }
.has-conversation .entry-card small, .workflow-editing .entry-card small { display: none; }
.has-conversation .entry-card .entry-icon, .workflow-editing .entry-card .entry-icon { width: 31px; height: 31px; border-radius: 8px; }
.has-conversation .entry-icon svg, .workflow-editing .entry-icon svg { width: 19px; height: 19px; }
.msg { border-color: #baaad019; background: #ae91c707; margin-block: 20px; padding: 21px; border-radius: 3px 16px 16px; }
.msg.user { background: #3b2e4e80; border-color: #c6a5ec1d; border-radius: 16px 3px 16px 16px; padding: 13px 18px; }
.msg-label { color: #c4a8e6; }
.message-actions button { border-color: #d2b5ef23; color: #cbbbd8; }
.agent-workflow-panel { background: #17131e; border-color: #c1a9df25; border-radius: 15px; }
.agent-workflow-toolbar { background: #1c1726; }
@media (min-width: 1600px) { .platform-sidebar { width: 276px; padding-inline: 24px; } .chat-shell { max-width: 1010px; } .welcome h2 { font-size: 48px; } }
@media (max-width: 1100px) and (min-width: 801px) {
  .platform-sidebar { width: 224px; padding-inline: 12px; }
  .platform-brand { gap: 8px; padding-inline: 4px; }
  .platform-brand img { width: 38px; height: 38px; }
  .platform-brand h1 { font-size: 19px; }
  .platform-brand > div > span { font-size: 12px; }
  .platform-topbar { padding-inline: 28px; }
  .chat-shell { padding-inline: 28px; }
  .entry-card, #agentWorkflowToggle.entry-card { padding: 15px; gap: 11px; }
  .entry-card .entry-arrow { display: none; }
  .entry-card .entry-icon { width: 36px; height: 40px; }
}
@media (max-width: 800px) {
  .platform-frame { flex-direction: column; }
  .platform-sidebar { display: grid; grid-template-columns: 1fr auto; width: 100%; padding: calc(13px + env(safe-area-inset-top)) 16px 0; border-right: 0; border-bottom: 1px solid #ffffff0e; gap: 11px 8px; }
  .platform-brand { padding: 0; gap: 10px; }
  .platform-brand img { width: 36px; height: 36px; border-radius: 11px; }
  .platform-brand h1 { font-size: 22px; }
  .platform-brand > div > span { display: none; }
  .platform-new-chat { min-height: 40px; margin: 0; padding: 7px 10px; background: #d6c8fa0c; color: #d0b9ee; border-color: #cdb0f526; border-radius: 9px; }
  .platform-new-chat > span { display: none; }
  .platform-new-chat svg { width: 21px; height: 21px; }
  .platform-nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 3px; padding-bottom: 9px; }
  .platform-nav-label, .platform-sidebar-bottom, .platform-nav-item i, .platform-nav-item b { display: none; }
  .platform-nav-item .nav-full { display: none; }
  .platform-nav-item .nav-short { display: inline; }
  .platform-nav-item { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 7px 2px; min-height: 58px; text-align: center; border-radius: 9px; font-size: 16px; line-height: 1.4; white-space: nowrap; }
  .platform-nav-item svg { width: 19px; height: 19px; }
  .platform-settings { margin: 0; }
  .platform-topbar { min-height: 44px; padding: 9px 20px; gap: 8px; }
  .workspace-breadcrumb { gap: 8px; }
  .workspace-breadcrumb > span { display: none; }
  .workspace-breadcrumb strong { font-size: 14px; }
  .chat-shell { max-width: 740px; padding: 9px 20px calc(10px + env(safe-area-inset-bottom)); }
  .welcome { padding: 16px 0 12px; }
  .welcome-signature { padding: 6px; border-radius: 20px; }
  .welcome-signature img { width: 40px; height: 40px; border-radius: 12px; }
  .welcome .eyebrow { margin: 15px 0 10px; font-size: 12px; letter-spacing: .16em; }
  .welcome h2 { font-size: clamp(27px,5vw,36px); letter-spacing: -.8px; line-height: 1.5; margin-bottom: 11px; }
  .welcome p { font-size: 16px; max-width: 340px; }
  .guided-entry { gap: 10px; margin: 9px 0 12px; }
  .entry-card, #agentWorkflowToggle.entry-card { min-height: 86px; padding: 13px; gap: 10px; }
  .entry-card strong { font-size: 18px; }
  .entry-card small { margin-top: 4px; font-size: 14px; line-height: 1.6; }
  .entry-card .entry-arrow { display: none; }
  .entry-card .entry-icon { width: 36px; height: 40px; }
  .prompt-row { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #b6a2d22a transparent; margin-bottom: 11px; gap: 7px; }
  .prompt-row button { flex: none; white-space: nowrap; min-height: 40px; font-size: 16px; padding: 6px 9px; }
  .chat-input { padding: 10px 11px; gap: 6px; border-radius: 15px; }
  .chat-input textarea { min-height: 65px; font-size: 18px; padding: 3px 2px 7px; }
  .composer-footnote { margin-top: 9px; font-size: 14px; }
  .has-conversation .guided-entry, .workflow-editing .guided-entry { margin-bottom: 9px; }
}
@media (max-width: 520px) {
  .chat-shell { padding-inline: 16px; }
  .entry-card, #agentWorkflowToggle.entry-card { display: block; min-height: 91px; padding: 12px 13px; }
  .entry-card .entry-icon { display: none; }
  .entry-card strong { font-size: 18px; }
  .welcome p { max-width: 300px; }
  .has-conversation .entry-card, .has-conversation #agentWorkflowToggle.entry-card, .workflow-editing .entry-card, .workflow-editing #agentWorkflowToggle.entry-card { display: flex; padding: 9px 12px; min-height: 48px; gap: 9px; }
  .has-conversation .entry-card .entry-icon, .workflow-editing .entry-card .entry-icon { display: grid; width: 26px; height: 26px; }
  .msg { padding: 15px; }
  .composer-actions { gap: 4px; }
  .composer-actions .primary { padding-inline: 13px; }
}
@media (max-height: 780px) {
  .welcome-signature { display: none; }
  .welcome .eyebrow { margin-top: 3px; }
  .welcome { padding-top: 9px; }
  .welcome h2 { font-size: 32px; margin-bottom: 10px; }
  .guided-entry { margin-block: 8px 11px; }
}
@media (max-height: 680px) and (max-width: 800px) {
  .platform-sidebar { padding-top: 8px; gap: 5px; }
  .platform-nav-item { min-height: 48px; padding-block: 4px; }
  .platform-topbar { min-height: 35px; padding-block: 5px; }
  .welcome .eyebrow { display: none; }
  .welcome h2 { font-size: 27px; }
  .welcome p { font-size: 16px; }
  .entry-card, #agentWorkflowToggle.entry-card { min-height: 72px; padding-block: 8px; }
  .entry-card small { font-size: 14px; }
  .prompt-row { max-height: 46px; flex: none; }
  .chat-input textarea { min-height: 54px; max-height: 90px; }
  .composer-footnote { display: none; }
}
@media (max-height: 600px) and (min-width: 801px) {
  .platform-sidebar { padding-top: 18px; padding-bottom: 15px; }
  .platform-new-chat { margin-block: 22px; }
  .platform-sidebar-bottom { padding-top: 14px; }
  .platform-topbar { min-height: 56px; padding-block: 10px; }
  .chat-shell { padding-block: 10px; }
  .guided-entry { margin-block: 8px 10px; }
  .entry-card, #agentWorkflowToggle.entry-card { min-height: 48px; padding: 8px 14px; }
  .entry-card .entry-icon { width: 30px; height: 30px; border-radius: 8px; }
  .entry-card .entry-icon svg { width: 19px; height: 19px; }
  .entry-card strong { font-size: 16px; }
  .entry-card small, .welcome .eyebrow, .welcome p, .composer-footnote { display: none; }
  .welcome { padding-block: 4px; }
  .welcome h2 { font-size: 28px; line-height: 1.4; margin: 0; }
  .prompt-row { margin-bottom: 10px; }
  .chat-input { padding: 9px 12px; }
  .chat-input textarea { min-height: 50px; max-height: 80px; }
}
@media (max-height: 560px) and (max-width: 800px) {
  .platform-sidebar { padding-top: 5px; gap: 4px; }
  .platform-nav { padding-bottom: 5px; }
  .platform-nav-item { min-height: 34px; }
  .platform-nav-item svg { display: none; }
  .platform-topbar { min-height: 30px; }
  .welcome p { display: none; }
  .welcome h2 { font-size: 25px; line-height: 1.4; margin: 0; }
  .entry-card, #agentWorkflowToggle.entry-card { min-height: 44px; padding-block: 8px; }
  .entry-card small { display: none; }
  .guided-entry { margin-block: 6px 8px; }
  .chat-input textarea { min-height: 45px; max-height: 60px; }
}
.platform-menu-toggle { display: none; }
@media (max-width: 800px) {
  .platform-sidebar { grid-template-columns: minmax(0,1fr) auto auto; align-items: center; padding-bottom: 12px; gap: 8px; }
  .platform-nav { display: none; }
  .platform-topbar { display: none; }
  .workspace-breadcrumb { display: none; }
  .platform-menu-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 10px; border: 1px solid #cbb0ef24; border-radius: 8px; background: #c1a3ee08; color: #d7c5ef; font-size: 16px; }
  .platform-menu-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
  .platform-menu-toggle[aria-expanded="true"] { border-color: #cfadff60; background: #b995ec17; }
  .platform-menu-open .platform-nav { display: flex; flex-direction: column; position: fixed; z-index: 30; top: var(--menu-top); left: var(--menu-left); width: min(236px,calc(100vw - 40px)); max-height: calc(100dvh - var(--menu-top) - 16px); overflow-y: auto; padding: 8px; gap: 3px; border: 1px solid #c4a3ed36; border-radius: 13px; background: #1b1723; box-shadow: 0 16px 50px #0008; }
  .platform-nav .platform-nav-item { display: flex; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 10px 12px; text-align: left; font-size: 16px; }
  .platform-nav .platform-nav-item svg { display: block; width: 20px; height: 20px; }
  .platform-nav .platform-nav-item .nav-full { display: inline; }
  .platform-nav .platform-nav-item .nav-short { display: none; }
  .platform-nav .platform-nav-item b { display: block; }
}
@media (max-width: 380px) {
  .platform-sidebar { padding-inline: 12px; }
  .platform-brand { gap: 8px; }
  .platform-brand h1 { font-size: 20px; }
  .platform-brand img { width: 32px; height: 32px; }
  .platform-menu-toggle > span { display: none; }
}
@media (prefers-reduced-motion: reduce) { button, .chat-input { transition: none; } }
