:root {
  --ink: #17252a;
  --muted: #65757a;
  --line: #d9e2df;
  --paper: #f7f8f4;
  --panel: #ffffff;
  --navy: #1f3d45;
  --navy-deep: #152d35;
  --teal: #247f78;
  --teal-soft: #e2f1ed;
  --amber: #d79a45;
  --amber-soft: #fff1d6;
  --red: #b5544a;
  --shadow: 0 18px 45px rgba(33, 57, 58, .08);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); background: linear-gradient(130deg, #f2f5f0 0%, #fbfbf8 44%, #edf4f1 100%); }
.sidebar { display: flex; flex-direction: column; padding: 25px 18px 18px; color: #eef5ef; background: var(--navy-deep); background-image: linear-gradient(155deg, rgba(36,127,120,.32), transparent 38%), repeating-linear-gradient(125deg, transparent 0 28px, rgba(255,255,255,.025) 29px 30px); }
.brand-lockup, .mobile-brand { display: flex; align-items: center; gap: 11px; }
.brand-lockup { padding: 0 9px 28px; }
.brand-lockup strong, .mobile-brand strong { display: block; font-size: 17px; letter-spacing: .02em; }
.brand-lockup span { display: block; margin-top: 3px; color: #a9c0bf; font-size: 11px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px 9px 9px 2px; color: #fff; background: var(--amber); font-family: Georgia, serif; font-size: 21px; font-weight: 700; }
.primary-action, .secondary-action { border: 0; border-radius: 6px; padding: 11px 14px; font-weight: 700; }
.primary-action { display: flex; align-items: center; gap: 9px; color: var(--navy-deep); background: #f3c675; box-shadow: 0 8px 18px rgba(0,0,0,.14); }
.primary-action span { font-size: 22px; line-height: 12px; font-weight: 400; }
.sidebar-label { padding: 30px 10px 10px; color: #86a6a4; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.conversation-list { display: grid; gap: 4px; overflow: auto; }
.conversation-item { display: flex; align-items: center; width: 100%; padding: 10px; border: 1px solid transparent; border-radius: 5px; color: #cfddda; background: transparent; text-align: left; }
.conversation-item:hover, .conversation-item.active { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.09); color: white; }
.conversation-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer { margin-top: auto; padding: 16px 9px 0; border-top: 1px solid rgba(255,255,255,.1); color: #9cb2b0; font-size: 11px; }
.sidebar-footer small { display: block; padding-top: 9px; color: #6f9290; overflow-wrap: anywhere; }
.connection-dot { display: flex; align-items: center; gap: 7px; }
.connection-dot span { width: 7px; height: 7px; border-radius: 50%; background: #65c59d; box-shadow: 0 0 0 4px rgba(101,197,157,.13); }
.main-panel { min-width: 0; padding: 0 38px 45px; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 64px; border-bottom: 1px solid var(--line); }
.mobile-brand { display: none; }
.topbar-tools, .toolbar-actions { display: flex; align-items: center; gap: 10px; }
.status-pill, .knowledge-chip, .count-badge { border-radius: 99px; }
.status-pill { padding: 5px 10px; color: var(--teal); background: var(--teal-soft); font-size: 11px; font-weight: 700; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; color: var(--navy); background: white; font-size: 17px; }
.icon-button:hover { border-color: var(--teal); color: var(--teal); }
.icon-button.quiet { border: 0; background: transparent; }
.workspace-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 34px 0 24px; }
.eyebrow, .live-kicker { margin: 0 0 7px; color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1, h2 { margin: 0; color: var(--navy-deep); font-family: Georgia, serif; font-weight: 500; }
h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1; }
h2 { font-size: 23px; }
.knowledge-chip { padding: 8px 12px; border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.68); font-size: 11px; }
.knowledge-chip b { margin-left: 5px; color: var(--navy); font-family: monospace; font-weight: 500; }
.tabs { display: flex; gap: 25px; border-bottom: 1px solid var(--line); }
.tab { position: relative; padding: 12px 0 13px; border: 0; color: var(--muted); background: transparent; font-size: 13px; font-weight: 700; }
.tab.active { color: var(--navy); }
.tab.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; background: var(--amber); content: ""; }
.view { padding-top: 27px; animation: reveal .32s ease both; }
.assistant-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 20px; min-height: 650px; }
.chat-column, .evidence-panel, .catalog-list, .catalog-detail, .monitor-table-wrap { border: 1px solid var(--line); background: rgba(255,255,255,.86); box-shadow: var(--shadow); }
.chat-column { display: flex; min-height: 650px; flex-direction: column; border-radius: 10px 3px 10px 3px; }
.conversation-heading, .panel-title, .section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.conversation-heading { padding: 21px 24px 15px; border-bottom: 1px solid var(--line); }
.conversation-heading h2 { font-size: 20px; }
.message-list { display: flex; flex: 1; flex-direction: column; gap: 18px; overflow: auto; padding: 24px; }
.message { max-width: 85%; animation: rise .25s ease both; }
.message.user { align-self: flex-end; }
.message.assistant { align-self: flex-start; }
.message-meta { margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.message-body { padding: 14px 16px; border-radius: 3px 11px 11px 11px; color: #26383b; background: #f0f4f1; line-height: 1.55; white-space: pre-wrap; }
.message.user .message-body { border-radius: 11px 3px 11px 11px; color: white; background: var(--navy); }
.message.error .message-body { border-left: 3px solid var(--red); }
.message-citations { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.citation-pill { padding: 4px 7px; border-radius: 3px; color: var(--teal); background: var(--teal-soft); font-family: monospace; font-size: 10px; }
.composer { padding: 15px 19px 19px; border-top: 1px solid var(--line); background: #fbfcfa; }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 9px; }
.mode-select { color: var(--muted); font-size: 11px; font-weight: 700; }
.mode-select select, #job-select { margin-left: 5px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--navy); background: white; font-size: 11px; }
.composer-hint { color: #879695; font-size: 10px; }
.composer-box { display: flex; align-items: end; gap: 9px; padding: 10px; border: 1px solid #bdceca; border-radius: 7px; background: white; }
textarea { width: 100%; resize: vertical; min-height: 55px; border: 0; outline: 0; color: var(--ink); background: transparent; line-height: 1.5; }
.send-button { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 5px; color: white; background: var(--teal); font-size: 21px; }
.send-button:hover { background: var(--navy); }
.evidence-panel { align-self: start; min-height: 390px; border-radius: 3px 10px 3px 10px; }
.panel-title { padding: 17px 18px; border-bottom: 1px solid var(--line); color: var(--navy); font-size: 13px; font-weight: 700; }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; color: var(--teal); background: var(--teal-soft); font-size: 10px; }
.evidence-list { display: grid; gap: 9px; padding: 13px; }
.evidence-card { padding: 11px; border-left: 3px solid var(--amber); background: #fbfaf5; }
.evidence-card strong { display: block; margin-bottom: 4px; color: var(--navy); font-family: monospace; font-size: 11px; }
.evidence-card small { display: block; margin-bottom: 6px; color: var(--teal); overflow-wrap: anywhere; }
.evidence-card p { margin: 0; color: #657170; font-size: 11px; line-height: 1.4; }
.empty-panel { padding: 23px 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.panel-foot { padding: 13px 18px; border-top: 1px solid var(--line); color: var(--muted); font-family: monospace; font-size: 10px; }
.section-toolbar { margin-bottom: 20px; }
.secondary-action { border: 1px solid var(--line); color: var(--navy); background: white; }
.secondary-action:hover { border-color: var(--teal); }
.metrics-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.metric { padding: 15px; border: 1px solid var(--line); background: white; }
.metric strong { display: block; color: var(--navy-deep); font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.metric span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.monitor-table-wrap { overflow: auto; border-radius: 7px; }
.operations-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.operation-panel { display: grid; gap: 12px; padding: 22px; border: 1px solid var(--line); background: rgba(255,255,255,.86); box-shadow: var(--shadow); }
.provider-panel { grid-column: 1 / -1; }
.provider-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.provider-option { display: grid; gap: 5px; min-height: 104px; padding: 14px; border: 1px solid var(--line); border-radius: 5px; color: var(--navy); background: white; text-align: left; }
.provider-option:hover:not(:disabled), .provider-option.active { border-color: var(--teal); background: var(--teal-soft); }
.provider-option strong { font-size: 13px; }
.provider-option small, .provider-option span { color: var(--muted); font-size: 11px; }
.provider-option span { margin-top: auto; color: var(--teal); }
.provider-option.unavailable { opacity: .62; }
.provider-option.unavailable span { color: var(--red); }
.provider-option:disabled { cursor: default; }
.operation-copy { max-width: 60ch; color: var(--muted); line-height: 1.6; }
.field-label { color: var(--navy); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.text-input, .file-input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--navy); background: white; font: inherit; }
.danger-panel { border-color: rgba(181,84,74,.35); }
.danger-badge { padding: 4px 7px; border-radius: 4px; color: var(--red); background: #f8e4df; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.danger-action { width: fit-content; padding: 10px 14px; border: 1px solid var(--red); border-radius: 5px; color: white; background: var(--red); font: inherit; font-weight: 800; }
.danger-action:disabled, .primary-action:disabled { cursor: wait; opacity: .55; }
.operation-result { min-height: 20px; color: var(--muted); font-size: 13px; }
.corpus-panel { margin-top: 28px; padding: 20px; border: 1px solid var(--line); background: rgba(255,255,255,.66); }
.corpus-summary { margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.corpus-file-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.corpus-file { min-width: 0; padding: 12px; background: white; }
.corpus-file strong { display: block; overflow-wrap: anywhere; color: var(--navy); font-size: 12px; }
.corpus-file small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
td { color: #35484a; font-size: 12px; }
td:first-child { max-width: 300px; overflow-wrap: anywhere; font-weight: 700; }
.stage-track { display: flex; flex-wrap: wrap; gap: 4px; min-width: 300px; }
.stage { padding: 5px 7px; border-radius: 3px; font-family: monospace; font-size: 10px; background: #e7eeeb; }
.stage.succeeded { color: #246b57; background: #dff2e8; }.stage.failed { color: #a54e46; background: #f8e4df; }.stage.started { color: #9a6928; background: var(--amber-soft); }
.catalog-grid { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.6fr); gap: 18px; }
.catalog-list, .catalog-detail { min-height: 480px; border-radius: 7px; }
.catalog-list { padding: 8px; }
.catalog-item { width: 100%; padding: 12px; border: 0; border-bottom: 1px solid var(--line); color: var(--navy); background: transparent; text-align: left; }
.catalog-item:hover, .catalog-item.active { background: var(--teal-soft); }
.catalog-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.catalog-item small { display: block; padding-top: 4px; color: var(--muted); font-size: 10px; }
.catalog-detail { padding: 20px; }
.detail-section { margin-bottom: 20px; }.detail-section h3 { margin: 0 0 8px; color: var(--teal); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }.detail-section p { margin: 0; color: #536468; font-size: 13px; line-height: 1.55; }.detail-list { margin: 0; padding-left: 18px; color: #536468; font-size: 12px; line-height: 1.6; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 340px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 5px; color: var(--navy); background: white; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(10px); transition: .2s ease; font-size: 12px; }.toast.show { opacity: 1; transform: translateY(0); }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } } @keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 980px) { .shell { grid-template-columns: 220px minmax(0, 1fr); }.main-panel { padding-inline: 24px; }.assistant-grid { grid-template-columns: 1fr; }.evidence-panel { min-height: 250px; }.evidence-list { grid-template-columns: repeat(2, 1fr); }.metrics-row { grid-template-columns: repeat(3, 1fr); }.operations-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .shell { display: block; }.sidebar { display: none; }.main-panel { padding: 0 15px 28px; }.topbar { min-height: 58px; }.mobile-brand { display: flex; }.workspace-head { align-items: start; flex-direction: column; padding: 25px 0 17px; }.tabs { gap: 16px; overflow-x: auto; }.tab { white-space: nowrap; }.assistant-grid, .chat-column { min-height: 560px; }.conversation-heading { padding-inline: 16px; }.message-list { padding: 17px 14px; }.message { max-width: 94%; }.composer { padding: 12px; }.composer-toolbar { align-items: start; flex-direction: column; gap: 7px; }.evidence-list { grid-template-columns: 1fr; }.metrics-row { grid-template-columns: repeat(2, 1fr); }.section-toolbar { align-items: start; flex-direction: column; }.catalog-grid { grid-template-columns: 1fr; }.catalog-list { min-height: 210px; }.catalog-detail { min-height: 300px; }.corpus-file-list { grid-template-columns: 1fr; } }
