*, *::before, *::after { box-sizing: border-box; }
:root {
  --deep-green: #0872a5;
  --pale-green: #eef4fa;
  --canvas: #f3f5fa;
  --ink: #17243b;
  --body-muted: #73839d;
  --line: #e1e7f0;
  --green: #008768;
  --red: #b45c50;
  --amber: #a9670b;
}
html, body { height: 100%; margin: 0; }
body { overflow: hidden; color: var(--ink); background: var(--canvas); font: 13px/1.55 Inter, -apple-system, BlinkMacSystemFont, sans-serif; }
button, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid #61a17b; outline-offset: 2px; }
[hidden], .welcome[hidden], .file-previews[hidden] { display: none !important; }

/* The console uses the same header and navigation system as the rest of the workspace. */
.header { position: relative; display: flex; align-items: center; justify-content: space-between; }
.header .menu-toggle { display: none; }
.header .workspace-brand { text-decoration: none; }
.header .header-center { margin-left: auto; }
.app { display: flex; min-height: 0; height: calc(100vh - 52px); height: calc(100dvh - 52px); }
.sidebar { width: 224px; flex: 0 0 224px; }
.sidebar .nav-item { text-decoration: none; }
.sidebar .navigation-scroll { flex: 0 1 auto; padding-bottom: 12px; }
.mobile-nav-close { display: none; }
.conversation-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 7px 10px 0; padding: 14px 12px 8px; border-top: 1px solid var(--line); color: #91a299; font-size: 8px; font-weight: 500; letter-spacing: 1.2px; white-space: nowrap; }
.btn-new-chat { display: grid; place-items: center; width: 26px; height: 26px; margin: -5px -4px -5px 0; border: 0; border-radius: 6px; background: transparent; color: #6e9980; font-size: 16px; }
.btn-new-chat:hover { background: #e7f1f8; color: var(--deep-green); }
.session-list { flex: 1; min-height: 55px; overflow-y: auto; padding: 0 10px 12px; scrollbar-width: thin; scrollbar-color: #d6e1db transparent; }
.session-item { display: block; width: 100%; min-width: 0; margin: 1px 0; padding: 8px 11px; border: 0; border-radius: 6px; background: transparent; color: #73839d; text-align: left; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-item:hover { background: #edf3ef; color: #355e49; }
.session-item.active { background: #e7f1f8; color: #0872a5; font-weight: 500; }
.sidebar-overlay { display: none; }

/* Open chat canvas, with restrained typography and controls. */
.chat-area { position: relative; display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(circle at 84% 8%, #f2f8f2 0, transparent 30%), var(--canvas); }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 96px; padding: 24px clamp(24px, 5vw, 72px) 16px; }
.chat-header-title { display: flex; flex-direction: column; gap: 3px; }
.page-overline { color: #7c8dab; font-size: 9px; font-weight: 600; letter-spacing: 1.45px; }
.chat-header h1 { margin: 0; color: #17243b; font-size: 23px; font-weight: 600; letter-spacing: -.55px; line-height: 1.3; }
.chat-header-actions { display: flex; align-items: center; gap: 12px; }
.status { display: inline-flex; align-items: center; gap: 7px; color: #6c917a; font-size: 11px; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #4eaa73; box-shadow: 0 0 0 3px #e1f3e7; }
.status-dot.offline { background: var(--red); box-shadow: 0 0 0 3px #fbe9e6; }
.status:has(.offline) { color: var(--red); }
.mobile-new { display: none; }
.messages { display: flex; flex: 1; flex-direction: column; gap: 22px; width: min(100%, 930px); min-height: 0; margin: 0 auto; padding: 14px 30px 30px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d6e1db transparent; }
.welcome { display: flex; flex: 1; flex-direction: column; align-items: flex-start; width: min(100%, 720px); min-height: 0; margin: 0 auto; padding: clamp(36px, 10vh, 108px) 0 30px; }
.welcome-eyebrow { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 13px; color: #0872a5; font-size: 10px; font-weight: 600; letter-spacing: 1.2px; }
.welcome-eyebrow i { font-size: 17px; }
.welcome h2 { margin: 0; color: #17243b; font-size: clamp(27px, 3vw, 38px); font-weight: 500; letter-spacing: -1.5px; line-height: 1.18; }
.welcome p { margin: 13px 0 0; color: #73839d; font-size: 14px; line-height: 1.6; }
.quick-actions-label { margin: clamp(34px, 6vh, 62px) 0 9px; color: #9aaba1; font-size: 9px; font-weight: 600; letter-spacing: 1.25px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; width: 100%; }
.quick-action { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px 4px; border: 0; border-bottom: 1px solid #e1e7f0; background: transparent; color: #375673; text-align: left; font-size: 13px; font-weight: 500; transition: color .15s, padding-left .15s, background .15s; }
.quick-action:hover { padding-left: 9px; color: #1b6440; background: #f4f9f4; }
.quick-action i:first-child { width: 19px; text-align: center; color: #0872a5; font-size: 18px; }
.quick-action i:last-child { margin-left: auto; color: #899bb3; font-size: 15px; }

.msg { display: flex; gap: 12px; max-width: 91%; animation: appear .18s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.msg.user { align-self: flex-start; }
.msg-avatar { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 9px; font-size: 15px; }
.msg.assistant .msg-avatar { color: #367d57; background: #e6f2e9; }
.msg.user .msg-avatar { color: #52678d; background: #e7ecf8; font-size: 11px; font-weight: 600; }
.msg-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.msg-bubble { padding: 1px 0; color: #273b55; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.user .msg-bubble { padding: 10px 14px; border: 1px solid #e0e7f4; border-radius: 3px 13px 13px 13px; color: #344b69; background: #eef2fb; }
.msg-bubble p { margin: 0 0 9px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble ul, .msg-bubble ol { margin: 6px 0 9px 21px; padding: 0; }
.msg-bubble li { margin: 3px 0; }
.msg-bubble code { padding: 1px 4px; border-radius: 4px; background: #e9f0e9; font-size: 12px; }
.msg-bubble pre { max-width: 100%; margin: 10px 0; padding: 13px; border-radius: 9px; color: #edf7ef; background: #1c3b2d; overflow-x: auto; }
.msg-bubble pre code { padding: 0; color: inherit; background: none; }
.msg-bubble table { width: 100%; margin: 9px 0; border-collapse: collapse; font-size: 12px; }
.msg-bubble th, .msg-bubble td { padding: 7px 9px; border: 1px solid #dae6dc; text-align: left; }
.msg-bubble th { background: #eef4fa; }
.msg-time { color: #a5b5aa; font-size: 10px; }
.msg.user .msg-time { text-align: left; }
.suggestion-group { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.suggestion-heading { color: #7c8dab; font-size: 9px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.suggestion-chip { max-width: 100%; padding: 7px 11px; border: 1px solid #dae5ef; border-radius: 8px; background: #edf4fa; color: #286389; text-align: left; font-size: 11px; font-weight: 500; }
.suggestion-chip:hover { border-color: #accfb7; background: #e4f1e7; }
.suggestion-chip:disabled { opacity: .55; cursor: default; }
.tool-card { display: flex; align-items: center; gap: 9px; width: fit-content; max-width: 100%; padding: 7px 10px; border-radius: 7px; background: #eff5f0; color: #5f8068; font-size: 11px; }
.tool-card .tool-icon { flex: none; color: #5f9973; font-size: 15px; }
.tool-card .tool-name { color: #467359; font-weight: 500; }
.tool-card .tool-status { margin-left: 12px; font-size: 10px; }
.tool-card .tool-status.running { color: var(--amber); }
.tool-card .tool-status.done { color: var(--green); }
.tool-card .tool-status.error { color: var(--red); }
.typing { display: flex; align-items: center; gap: 4px; padding: 7px 0; }
.typing span:not(.typing-label) { width: 5px; height: 5px; border-radius: 50%; background: #88a895; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.input-area { position: relative; padding: 22px 24px 16px; background: linear-gradient(to bottom, #f3f5fa00, var(--canvas) 18px); }
.input-row { width: min(100%, 840px); margin: 0 auto; }
.input-wrapper { border: 1px solid #dce4ef; border-radius: 15px; background: #fff; box-shadow: 0 8px 30px #244d2d0b, 0 2px 8px #244d2d06; transition: border-color .15s, box-shadow .15s; }
.input-wrapper:focus-within { border-color: #0872a5; box-shadow: 0 0 0 3px #80b79220, 0 8px 30px #244d2d0b; }
.input-controls { display: flex; align-items: flex-end; gap: 4px; min-height: 56px; padding: 7px; }
#chat-input { flex: 1; min-width: 0; max-height: 120px; padding: 10px 5px; border: 0; outline: 0; resize: none; background: transparent; color: #273b55; font-size: 13px; line-height: 1.5; }
#chat-input::placeholder { color: #9aaca0; }
.input-btn { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border: 0; border-radius: 9px; }
.btn-attach { background: transparent; color: #819c88; }
.btn-attach:hover { background: #eef5ef; color: var(--deep-green); }
.btn-send { background: #0872a5; color: #fff; }
.btn-send i { font-size: 18px; }
.btn-send:hover { background: #055d89; }
.btn-send:disabled { background: #e8efea; color: #9fb6a4; cursor: default; }
.btn-send.is-running { background: #e8f2eb; color: #245b3d; cursor: pointer; }
.btn-send.is-running:hover { background: #d6e9db; }
.file-previews { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 11px 0; }
.file-preview { display: flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 9px; border-radius: 6px; background: #eaf3eb; color: #375673; font-size: 11px; overflow-wrap: anywhere; }
.remove-file { color: #72937d; cursor: pointer; }
.remove-file:hover { color: var(--red); }
.input-hint { margin-top: 8px; color: #a1afa5; text-align: center; font-size: 10px; }

@media (max-width: 900px) {
  .chat-header { padding-right: 28px; padding-left: 28px; }
  .messages { padding-right: 25px; padding-left: 25px; }
}
@media (max-width: 768px) {
  .header .menu-toggle { display: grid; place-items: center; }
  .sidebar { position: fixed; top: 52px; bottom: 0; left: -270px; z-index: 101; width: 260px; height: calc(100dvh - 52px); transition: left .2s ease; }
  .sidebar.open { left: 0; }
  .sidebar-overlay.open { display: block; position: fixed; inset: 52px 0 0; z-index: 100; width: 100%; border: 0; background: #173e2e40; backdrop-filter: blur(2px); }
  .mobile-nav-close { display: grid; place-items: center; width: 27px; height: 27px; border: 0; border-radius: 6px; background: transparent; color: #799889; font-size: 17px; }
  .mobile-nav-close:hover { background: #edf5ef; }
  .chat-header { min-height: 82px; padding: 18px 22px 12px; }
  .chat-header h1 { font-size: 21px; }
  .mobile-new { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #dce9df; border-radius: 7px; background: #f7fbf8; color: #507a5f; font-size: 17px; }
  .messages { padding: 6px 22px 26px; }
  .welcome { padding-top: 60px; }
}
@media (max-width: 560px) {
  .chat-header { min-height: 76px; padding: 15px 18px 10px; }
  .chat-header h1 { font-size: 19px; }
  .messages { padding: 8px 18px 25px; }
  .welcome { padding-top: 43px; }
  .welcome h2 { font-size: 29px; }
  .welcome p { font-size: 13px; }
  .quick-actions { grid-template-columns: 1fr; }
  .quick-action { min-height: 51px; }
  .msg { max-width: 96%; }
  .input-area { padding: 16px 12px calc(12px + env(safe-area-inset-bottom)); }
  .input-hint { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Compact operational workspace: the same blue accents and slate canvas as Rosters. */
.chat-area { background:var(--canvas); }
.chat-header { min-height:70px;padding:16px 28px;border-bottom:1px solid var(--line);background:#fff; }
.chat-header h1 { font-size:20px;letter-spacing:-.4px; }
.sidebar { background:#fff;border-right:1px solid var(--line); }
.sidebar .nav-item.active { background:#e8f2f9;color:#0872a5; }
.sidebar .navigation-title strong { color:#17243b; }
.welcome { padding-top:clamp(32px,7vh,75px); }
.welcome h2 { font-size:32px;letter-spacing:-1px;font-weight:600; }
.quick-actions { gap:12px;margin-top:6px; }
.quick-action { border:1px solid var(--line);border-radius:10px;padding:17px;background:white;min-height:76px; }
.quick-action:hover { padding-left:17px;border-color:#91bfda;background:#f7fbff; }
.quick-actions-label { margin-top:32px; }
.msg.assistant .msg-avatar { color:#0872a5;background:#e5f1f9; }
.msg-bubble { font-size:14px; }
.msg-time { color:#8b9ab0; }
.input-area { background:var(--canvas);padding-top:12px; }
.input-wrapper { box-shadow:0 4px 18px #17243b06;border-radius:12px; }
.input-wrapper:focus-within { box-shadow:0 0 0 3px #0872a512; }
.console-config-button { display:grid;place-items:center;width:36px;height:36px;border:1px solid #e1e7f0;background:white;border-radius:8px;color:#5c718d;font-size:19px; }
.console-config-button:hover { background:#edf4fa;color:#0872a5; }
.chat-header-actions .console-config-button { order:2; }
#agent-configuration-dialog { position:fixed;inset:0 0 0 auto;margin:0;width:min(1060px,94vw);height:100dvh;max-height:100dvh;max-width:100vw;padding:0;border:0;border-left:1px solid #dce4ef;background:#f3f5fa;color:#17243b;box-shadow:-12px 0 50px #17243b16; }
#agent-configuration-dialog::backdrop { background:#16294245;backdrop-filter:blur(2px); }
.configuration-toolbar { position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;padding:15px 24px;background:white;border-bottom:1px solid #e1e7f0;font-weight:600; }
.configuration-toolbar span { display:flex;align-items:center;gap:10px; }
.configuration-toolbar button { display:grid;place-items:center;width:32px;height:32px;border:1px solid #e1e7f0;border-radius:8px;background:white;color:#5c718d;font-size:18px; }
#agent-configuration-content { padding:24px; }
@media(max-width:560px) { .chat-header{padding:14px 18px}.chat-header-actions{gap:8px}.status{font-size:10px}.welcome h2{font-size:27px}.quick-action{min-height:60px}.welcome{padding-top:28px}#agent-configuration-dialog{width:100vw}#agent-configuration-content{padding:16px}.configuration-toolbar{padding:12px 16px} }

.sidebar { width:76px;flex-basis:76px; }
.sidebar .navigation-scroll { flex:1;min-height:0;overflow:auto;padding-bottom:8px; }
.sidebar .navigation-title { display:grid;place-items:center;color:white;font-size:24px; }
.sidebar .navigation-heading { justify-content:center; }
.conversation-menu { position:relative; }
.conversation-menu summary { display:grid;place-items:center;width:36px;height:36px;border:1px solid #e1e7f0;border-radius:8px;background:white;color:#5c718d;font-size:19px;cursor:pointer;list-style:none; }
.conversation-menu summary::-webkit-details-marker { display:none; }
.conversation-popover { position:absolute;z-index:20;right:0;top:44px;width:280px;background:white;border:1px solid #e1e7f0;border-radius:12px;box-shadow:0 12px 40px #17243b18; }
.conversation-popover .conversation-heading { border:0;color:#73839d;font-size:10px; }
.conversation-popover .session-list { max-height:340px; }
.conversation-popover .session-item { font-size:13px; }
button:focus-visible, a:focus-visible, textarea:focus-visible, summary:focus-visible { outline-color:#0872a5; }
.quick-actions-label,.suggestion-heading,.input-hint { color:#8190a6; }
@media(max-width:768px){.sidebar{width:76px;left:-90px}.sidebar.open{left:0}.mobile-nav-close{display:none}}
.sidebar .navigation-title { display:grid !important; }
