:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #202938;
  background: #f5f7fa;
  font-synthesis: none;
  --blue: #146ff6;
  --blue-hover: #0f5fd7;
  --blue-soft: #eef5ff;
  --purple: #7c4dff;
  --purple-soft: #f3efff;
  --green: #16865d;
  --green-soft: #ebf8f2;
  --amber: #a86208;
  --amber-soft: #fff7e8;
  --red: #c23b3b;
  --red-soft: #fff0f0;
  --ink: #202938;
  --muted: #657187;
  --subtle: #8a95a7;
  --border: #e1e6ee;
  --border-strong: #d3dae6;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --sidebar-width: 276px;
  --inspector-width: 380px;
  --topbar-height: 64px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  overflow: hidden;
  background: #f5f7fa;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(20, 111, 246, .22);
  outline-offset: 2px;
}

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 12px;
  top: -50px;
  padding: 9px 14px;
  border-radius: 7px;
  background: var(--ink);
  color: white;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 10px; }

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 20px 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .96);
  position: relative;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; color: var(--ink); text-decoration: none; }
.brand img { display: block; width: 132px; height: auto; }
.brand-divider { width: 1px; height: 24px; background: var(--border-strong); }
.product-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; white-space: nowrap; }
.preview-label { padding: 2px 6px; border-radius: 4px; color: #6c45d7; background: var(--purple-soft); font-size: 12px; font-weight: 750; letter-spacing: .06em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.environment-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #28a372; box-shadow: 0 0 0 3px var(--green-soft); }
.toolbar-button { height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: #4d5a6e; font-size: 12px; cursor: pointer; }
.toolbar-button:hover { border-color: #c5cfdd; background: var(--surface-subtle); color: var(--ink); }
.toolbar-button svg { width: 15px; height: 15px; }
.account-menu { position: relative; }
.account-button { height: 40px; display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 5px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; }
.account-button:hover { border-color: #c5cfdd; background: var(--surface-subtle); }
.account-button > svg { width: 14px; height: 14px; color: var(--subtle); }
.account-avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 760; }
.account-copy { min-width: 0; max-width: 150px; text-align: left; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { color: var(--ink); font-size: 12px; font-weight: 680; }
.account-copy small { margin-top: 1px; color: var(--subtle); font-size: 12px; }
.account-popover { position: absolute; z-index: 30; top: 47px; right: 0; width: 220px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); box-shadow: 0 12px 30px rgba(32, 48, 72, .15); }
.account-popover > span { display: block; overflow: hidden; padding: 4px 6px 10px; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.account-popover button { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-subtle); color: var(--ink); font-size: 12px; text-align: left; cursor: pointer; }
.account-popover button:hover { border-color: #efcaca; background: var(--red-soft); color: var(--red); }

.login-page { min-height: 100%; overflow: auto; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 50% 0%, #eef5ff 0, #f7f9fc 45%, #f3f5f8 100%); }
.login-shell { width: min(440px, 100%); }
.login-brand { display: flex; justify-content: center; margin-bottom: 24px; }
.login-brand img { width: 148px; height: auto; }
.login-card { padding: 34px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255, 255, 255, .97); box-shadow: 0 18px 48px rgba(31, 52, 82, .1); text-align: center; }
.login-symbol { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 17px; border-radius: 13px; background: var(--blue-soft); color: var(--blue); }
.login-symbol svg { width: 25px; height: 25px; }
.login-card h1 { margin: 0; color: var(--ink); font-size: 24px; letter-spacing: -.02em; }
.login-card > p { margin: 10px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.login-primary { width: 100%; height: 44px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--blue); color: white; font-size: 14px; font-weight: 700; text-decoration: none; }
.login-primary:hover { background: var(--blue-hover); }
.login-primary.disabled { cursor: not-allowed; background: #aeb8c8; color: #f7f9fc; pointer-events: none; }
.login-secondary { width: 100%; height: 42px; display: grid; place-items: center; margin-top: 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 680; text-decoration: none; }
.login-secondary:hover { border-color: #a9c9f7; background: var(--blue-soft); color: var(--blue); }
.login-message { margin: 0 0 16px; padding: 10px 12px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 13px; line-height: 1.45; }
.login-message.success { background: var(--green-soft); color: var(--green); }
.login-security { display: flex; align-items: flex-start; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 12px; line-height: 1.45; text-align: left; }
.login-security svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; }

.shell {
  height: calc(100vh - var(--topbar-height));
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--surface);
}

.sidebar, .inspector { min-height: 0; overflow-y: auto; overflow-x: hidden; background: var(--surface-subtle); scrollbar-width: thin; scrollbar-color: #cbd3df transparent; }
.sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.sidebar-section { padding: 22px 18px 20px; border-bottom: 1px solid var(--border); }
.project-section { min-height: 0; flex: 1; display: flex; flex-direction: column; padding: 20px 12px; overflow: hidden; }
.project-section .section-heading-row { padding: 0 6px; }
.sidebar-footer { flex: 0 0 auto; padding: 10px 12px 14px; border-top: 1px solid var(--border); background: var(--surface-subtle); }
.sidebar-settings { width: 100%; min-width: 0; min-height: 48px; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #59677b; text-align: left; cursor: pointer; }
.sidebar-settings:hover, .sidebar-settings.active { border-color: #d8e7fb; background: #eaf3ff; color: var(--blue); }
.sidebar-settings > svg { width: 18px; height: 18px; justify-self: center; }
.sidebar-settings strong, .sidebar-settings small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-settings strong { color: #344256; font-size: 12px; }
.sidebar-settings small { margin-top: 2px; color: #8490a2; font-size: 12px; }
.sidebar-settings.active strong { color: var(--blue); }
.project-help { margin: -4px 6px 13px; color: var(--subtle); font-size: 12px; line-height: 1.45; }
.project-tree { min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 4px; padding: 2px; }
.project-tree-item { border-radius: 9px; }
.project-tree-item.active { background: #edf4ff; }
.project-tree-project { width: 100%; min-height: 48px; display: grid; grid-template-columns: 28px minmax(0, 1fr) 15px; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; }
.project-tree-project:hover { background: #f0f3f7; }
.project-tree-item.active > .project-tree-project { border-color: #d8e7fb; background: #eaf3ff; }
.project-tree-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: #fff; color: #627187; }
.project-tree-item.active .project-tree-icon { color: var(--blue); }
.project-tree-icon svg { width: 15px; height: 15px; }
.project-tree-project strong, .project-tree-project small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-tree-project strong { color: #344256; font-size: 12px; font-weight: 700; }
.project-tree-project small { margin-top: 2px; color: #8490a2; font-size: 12px; }
.project-tree-chevron { width: 13px; height: 13px; color: #8b96a7; transition: transform .16s ease; }
.project-tree-project[aria-expanded="true"] .project-tree-chevron { transform: rotate(90deg); }
.project-conversations { display: grid; gap: 2px; padding: 2px 7px 8px 43px; }
.conversation-tree-item, .new-conversation { min-width: 0; width: 100%; display: flex; align-items: center; gap: 7px; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; color: #667386; font-size: 12px; text-align: left; cursor: pointer; }
.conversation-tree-item:hover, .new-conversation:hover { background: rgba(255,255,255,.8); color: #344256; }
.conversation-tree-item.active { background: #fff; color: var(--blue); font-weight: 680; box-shadow: 0 1px 3px rgba(32,48,72,.06); }
.conversation-tree-item svg, .new-conversation svg { width: 14px; height: 14px; flex: 0 0 auto; }
.conversation-tree-item span, .new-conversation span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-conversation { color: #768398; }
.section-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.eyebrow { display: block; margin-bottom: 4px; color: var(--subtle); font-size: 12px; font-weight: 750; letter-spacing: .09em; line-height: 1.2; text-transform: uppercase; }
.section-heading-row h2, .inspector-header h2 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 680; }
.icon-button { flex: 0 0 auto; width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: #4c5b70; cursor: pointer; }
.icon-button:hover { border-color: #a9c8f5; color: var(--blue); background: var(--blue-soft); }
.icon-button svg { width: 16px; height: 16px; }

.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; pointer-events: none; right: 12px; top: 14px; width: 6px; height: 6px; border-right: 1.5px solid #78869a; border-bottom: 1.5px solid #78869a; transform: rotate(45deg); }
select, input, textarea { width: 100%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); outline: none; }
select { appearance: none; height: 40px; padding: 0 34px 0 11px; border-radius: 7px; font-size: 12px; font-weight: 620; }
input { height: 38px; border-radius: 7px; padding: 0 10px; font-size: 12px; }
select:hover, input:hover { border-color: #bac5d4; }
select:focus, input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20, 111, 246, .1); }
.field-label { display: block; margin: 15px 2px 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.path-field { position: relative; }
.path-field svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: #8793a5; pointer-events: none; }
.path-field input { padding-left: 33px; color: #526075; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.build-stages { padding: 20px 18px 17px; border-bottom: 1px solid var(--border); }
.sidebar-label { color: #717e91; font-size: 12px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.stage-list { position: relative; display: grid; gap: 1px; margin: 13px 0 0; padding: 0; list-style: none; }
.stage-list::before { content: ""; position: absolute; top: 22px; bottom: 22px; left: 14px; width: 1px; background: #dfe4ec; }
.stage-list li { position: relative; display: grid; grid-template-columns: 29px 1fr; align-items: center; gap: 10px; min-height: 48px; padding: 6px 6px 6px 0; color: #8a95a6; border-radius: 7px; }
.stage-list li.active { color: var(--ink); background: #edf4ff; }
.stage-list li.completed { color: #536176; }
.stage-marker { z-index: 1; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid #d8dfe8; border-radius: 50%; background: var(--surface-subtle); color: #8995a8; font-size: 12px; font-weight: 750; }
.stage-list li.active .stage-marker { border-color: var(--blue); background: var(--blue); color: white; box-shadow: 0 0 0 3px #e4efff; }
.stage-list li.completed .stage-marker { border-color: #a9d8c7; background: var(--green-soft); color: var(--green); }
.stage-list strong, .stage-list small { display: block; }
.stage-list strong { font-size: 12px; font-weight: 680; }
.stage-list small { margin-top: 2px; color: #929daf; font-size: 12px; line-height: 1.3; }

.history-section { min-height: 190px; padding: 20px 12px; }
.history-header { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 9px; }
.count-badge, .section-meta, .tab span { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e9edf3; color: #69768a; font-size: 12px; font-weight: 700; }
.run-history { display: grid; gap: 3px; }
.run-item { position: relative; width: 100%; display: block; padding: 10px 10px 9px 13px; border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.run-item::before { content: ""; position: absolute; left: 4px; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: transparent; }
.run-item:hover { background: #f0f3f7; }
.run-item.active { border-color: #dce9fb; background: #edf4ff; }
.run-item.active::before { background: var(--blue); }
.run-title { overflow: hidden; color: #3d4b60; font-size: 12px; font-weight: 620; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.run-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; color: #8995a6; font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 10px; background: #e8edf3; color: #657185; font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.badge.running { background: #e4efff; color: #155fbf; }
.badge.completed { background: #e2f4ec; color: #177553; }
.badge.failed, .badge.cancelled { background: #fde8e8; color: #ad3838; }

.conversation { min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; background: var(--surface); }
.conversation-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 28px; border-bottom: 1px solid var(--border); }
.conversation-header > div:first-child { min-width: 0; flex: 1; }
.conversation-header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.inspector-toggle { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 12px; cursor: pointer; }
.inspector-toggle svg { width: 17px; height: 17px; }
.inspector-toggle:hover, .inspector-toggle[aria-expanded="true"] { color: var(--blue); background: var(--blue-soft); border-color: #c7ddfb; }
.conversation-header h1 { max-width: 620px; overflow: hidden; margin: 0; color: var(--ink); font-size: 16px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.run-status { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-subtle); color: #697588; font-size: 12px; font-weight: 650; text-transform: capitalize; }
.run-status span { width: 6px; height: 6px; border-radius: 50%; background: #98a2b2; }
.run-status.running { border-color: #cde0fb; background: var(--blue-soft); color: #155fbf; }
.run-status.running span { background: var(--blue); animation: pulse 1.7s ease-in-out infinite; }
.run-status.completed { border-color: #cae8dc; background: var(--green-soft); color: #177553; }
.run-status.completed span { background: var(--green); }
.run-status.failed, .run-status.cancelled { border-color: #f4cdcd; background: var(--red-soft); color: var(--red); }
.run-status.failed span, .run-status.cancelled span { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }

.conversation-body { min-height: 0; flex: 1; position: relative; overflow: hidden; }
.welcome { width: min(600px, calc(100% - 56px)); margin: clamp(48px, 9vh, 100px) auto 150px; text-align: center; }
.ai-symbol { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 16px; border: 1px solid #ddd4ff; border-radius: 13px; background: var(--purple-soft); color: var(--purple); }
.ai-symbol svg { width: 25px; height: 25px; fill: currentColor; stroke: none; }
.welcome-kicker { color: var(--purple); font-size: 12px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.welcome h2 { margin: 7px 0 9px; color: #202938; font-size: clamp(24px, 2.3vw, 31px); font-weight: 690; letter-spacing: -.025em; }
.welcome > p { max-width: 530px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.65; }
.suggestion { width: 100%; display: grid; grid-template-columns: 38px 1fr 20px; align-items: center; gap: 12px; margin-top: 25px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; box-shadow: 0 4px 14px rgba(31, 47, 70, .04); }
.suggestion:hover { border-color: #a9c9f7; background: #fbfdff; box-shadow: 0 7px 20px rgba(31, 77, 145, .07); transform: translateY(-1px); }
.suggestion-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue); }
.suggestion-icon svg { width: 18px; height: 18px; }
.suggestion strong, .suggestion small { display: block; }
.suggestion strong { font-size: 12px; font-weight: 680; }
.suggestion small { margin-top: 3px; color: #7a8699; font-size: 12px; }
.suggestion .arrow { justify-self: end; width: 17px; height: 17px; color: var(--blue); }
.governance-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 17px; color: #8793a5; font-size: 12px; }
.governance-note svg { width: 14px; height: 14px; color: #6e7c91; }

.timeline { height: 100%; overflow-y: auto; display: none; padding: 28px clamp(28px, 7vw, 86px) 160px; scrollbar-width: thin; scrollbar-color: #cbd3df transparent; }
.message { position: relative; min-width: 0; margin: 0 0 22px; overflow-wrap: anywhere; font-size: 13px; line-height: 1.68; white-space: pre-wrap; }
.message::before { position: absolute; top: 1px; left: -34px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; font-size: 12px; font-weight: 800; }
.message.user { margin-left: 9%; padding: 12px 14px; border: 1px solid #d7e7fd; border-radius: 10px 10px 3px 10px; background: var(--blue-soft); color: #27374c; }
.message.user::before { content: "You"; left: auto; right: -35px; background: #d9e9ff; color: #1765cf; }
.message.assistant { color: #354358; }
.message.assistant::before { content: "AI"; border: 1px solid #dfd6ff; background: var(--purple-soft); color: var(--purple); }
.message.assistant.markdown-body > :first-child { margin-top: 0; }
.message.assistant.markdown-body > :last-child { margin-bottom: 0; }
.conversation-turn-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -8px 0 24px; color: #8792a3; font-size: 12px; line-height: 1.4; }
.conversation-turn-meta > span + span::before { content: "·"; margin-right: 8px; color: #b0b8c4; }
.conversation-turn-duration { color: #66758a; font-variant-numeric: tabular-nums; }
.document-message { margin-bottom: 14px; }
.generated-document-card { width: 100%; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; box-shadow: 0 4px 14px rgba(31, 47, 70, .04); }
.generated-document-card:hover { border-color: #a9c9f7; background: #fbfdff; box-shadow: 0 7px 20px rgba(31, 77, 145, .07); transform: translateY(-1px); }
.generated-document-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue); }
.generated-document-icon svg { width: 19px; height: 19px; }
.generated-document-card strong, .generated-document-card small { display: block; }
.generated-document-card strong { color: #2f3b4d; font-size: 13px; font-weight: 700; }
.generated-document-card small { margin-top: 3px; color: #7b8799; font-size: 12px; line-height: 1.4; }
.generated-document-open { display: flex; align-items: center; gap: 4px; color: var(--blue); font-size: 12px; font-weight: 700; }
.generated-document-open svg { width: 14px; height: 14px; }
.clarification-message { padding: 14px 16px; border: 1px solid #d9e5f7; border-left: 3px solid var(--blue); border-radius: 9px; background: #f8fbff; }
.clarification-message h2, .clarification-message h3 { margin: 0 0 10px; color: #334155; font-size: 14px; }
.clarification-message p { margin: 8px 0; }
.clarification-message ol, .clarification-message ul { margin: 8px 0; padding-left: 22px; }
.clarification-message li { margin: 7px 0; }
.plan-confirmation-message { padding: 15px 16px; border: 1px solid #cfe0fa; border-left: 3px solid var(--blue); border-radius: 9px; background: #f7faff; white-space: normal; }
.plan-confirmation-message strong { display: block; margin-bottom: 5px; color: #26364c; font-size: 14px; }
.plan-confirmation-message p { margin: 0 0 8px; }
.plan-confirmation-message small { color: #6e7d92; font-size: 12px; }
.application-completion-message { padding: 15px 16px; border: 1px solid #cce7dc; border-left: 3px solid var(--green); border-radius: 9px; background: #f6fbf8; white-space: normal; }
.application-completion-copy { margin-bottom: 12px; }
.application-completion-copy strong { display: block; margin-bottom: 4px; color: #196b50; font-size: 14px; }
.application-completion-copy p { margin: 0; color: #59697b; }
.application-completion-message .generated-document-card { background: #fff; }
.streaming-cursor { color: var(--purple); animation: blink .8s steps(2, start) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.event-card { min-width: 0; margin: 13px 0 20px; padding: 12px 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-subtle); }
.event-card.success { border-color: #cce7dc; background: #f6fbf8; }
.event-card.error { border-color: #f0cece; background: #fff8f8; }
.event-card.progress { border-color: #d4e3f8; background: #f7faff; }
.event-title { display: flex; align-items: center; gap: 7px; color: #344256; font-size: 12px; font-weight: 700; }
.event-title::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #98a4b5; }
.event-card.success .event-title::before { background: var(--green); }
.event-card.error .event-title::before { background: var(--red); }
.event-card.progress .event-title::before { background: var(--blue); }
.event-detail { margin: 5px 0 0 14px; overflow-wrap: anywhere; color: #718096; font-size: 12px; line-height: 1.5; }
.event-card button { margin: 10px 0 0 14px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: white; color: #46556a; font-size: 12px; font-weight: 650; cursor: pointer; }
.event-card button:hover { border-color: #9ebfea; color: var(--blue); }
.observable-activity { padding: 0; }
.observable-activity summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 13px; cursor: pointer; list-style: none; }
.observable-activity summary::-webkit-details-marker { display: none; }
.observable-activity summary::after { content: "⌄"; flex: 0 0 auto; color: #718096; font-size: 15px; transition: transform .16s ease; }
.observable-activity[open] summary { border-bottom: 1px solid #dce8f8; }
.observable-activity[open] summary::after { transform: rotate(180deg); }
.observable-activity .event-title { flex: 0 0 auto; min-width: max-content; white-space: nowrap; }
.observable-activity-summary { overflow: hidden; color: #718096; font-size: 12px; line-height: 1.3; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.observable-activity-details { padding: 8px 13px 11px; }
.observable-activity-section + .observable-activity-section { margin-top: 11px; padding-top: 10px; border-top: 1px solid #e2ebf8; }
.observable-activity-section > strong { display: block; color: #3c4c61; font-size: 12px; font-weight: 700; }
.observable-activity ol { margin: 7px 0 0 14px; padding: 0; list-style: none; }
.observable-activity li { position: relative; display: grid; gap: 2px; margin: 7px 0; padding-left: 14px; color: #52637b; font-size: 12px; line-height: 1.4; }
.observable-activity li::before { content: ""; position: absolute; left: 0; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.observable-activity li strong { color: #3c4c61; font-weight: 650; }
.observable-activity li span { color: #718096; }
.tool-activity li span { text-transform: capitalize; }

.composer { position: absolute; z-index: 4; left: clamp(26px, 6vw, 76px); right: clamp(26px, 6vw, 76px); bottom: 22px; overflow: visible; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); box-shadow: 0 10px 30px rgba(32, 48, 72, .11); }
.composer:focus-within { border-color: #89b7f7; box-shadow: 0 0 0 3px rgba(20, 111, 246, .1), 0 12px 34px rgba(32, 48, 72, .12); }
.composer.drag-active { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(20, 111, 246, .12), 0 12px 34px rgba(32, 48, 72, .12); }
.composer-attachments { display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px 0; scrollbar-width: thin; }
.composer-attachment { min-width: 0; max-width: 230px; flex: 0 1 230px; display: grid; grid-template-columns: 30px minmax(0, 1fr) 24px; align-items: center; gap: 8px; padding: 7px 7px 7px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-subtle); }
.resource-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: #eef3fb; color: #60708a; }
.resource-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.resource-icon-image { background: #eaf4ff; color: #1772e8; }
.resource-icon-pdf { background: #fff0f0; color: #e34850; }
.resource-icon-document { background: #eaf2ff; color: #2867d7; }
.resource-icon-spreadsheet { background: #e9f7f0; color: #16845b; }
.resource-icon-presentation { background: #fff3e6; color: #d76a16; }
.resource-icon-text { background: #f2efff; color: #7355d9; }
.composer-attachment span { min-width: 0; }
.composer-attachment strong, .composer-attachment small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-attachment strong { color: #354358; font-size: 12px; }
.composer-attachment small { margin-top: 2px; color: #8792a3; font-size: 12px; }
.remove-resource { width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #657187; cursor: pointer; }
.remove-resource:hover { background: #e8edf4; color: #263246; }
.remove-resource svg { width: 14px; height: 14px; }
.composer-input-wrap { position: relative; }
.prompt-editor { width: 100%; min-height: 70px; max-height: 180px; overflow-y: auto; padding: 14px 15px 9px; color: #2a374a; font-size: 12.5px; line-height: 1.55; outline: 2px solid transparent; white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt-editor:focus, .prompt-editor:focus-visible { outline: none; }
.prompt-editor:empty::before { content: attr(data-placeholder); color: #929cad; pointer-events: none; }
.application-resource-token { display: inline; margin: 0; padding: 0; border-radius: 0; background: transparent; color: #1769d9; font: inherit; font-weight: 650; line-height: inherit; vertical-align: baseline; user-select: all; }
.application-resource-token .resource-token-icon { display: inline; margin: 0 3px 0 0; padding: 0; color: inherit; vertical-align: baseline; }
.application-resource-token .resource-token-icon svg { width: 1em; height: 1em; display: inline-block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.12em; }
.application-resource-picker { position: absolute; z-index: 30; left: 10px; right: 10px; bottom: calc(100% + 8px); max-height: 280px; overflow-y: auto; padding: 7px; border: 1px solid #d8dfe9; border-radius: 12px; background: #fff; box-shadow: 0 18px 45px rgba(31, 47, 70, .18); }
.application-resource-picker-heading { padding: 7px 9px 6px; color: #7a8699; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.application-resource-picker-empty { padding: 10px; color: #7a8699; font-size: 12px; }
.application-resource-option { width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 9px; border: 0; border-radius: 8px; background: transparent; color: #304057; text-align: left; cursor: pointer; }
.application-resource-option:hover, .application-resource-option.active { background: #edf5ff; }
.application-resource-option:focus-visible { background: #edf5ff; outline: 2px solid var(--blue); outline-offset: -2px; }
.application-resource-option strong, .application-resource-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.application-resource-option strong { font-size: 12.5px; }
.application-resource-option small { margin-top: 1px; color: #7c899d; font-size: 12px; }
.application-resource-option .resource-kind { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: #edf3fc; color: #2869c7; }
.application-resource-option .resource-kind svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.application-resource-option { width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; align-items: center; padding: 8px 9px; border: 0; border-radius: 8px; background: transparent; color: #263448; text-align: left; cursor: pointer; }
.application-resource-option:hover { background: #eef5ff; }
.application-resource-option:focus-visible { background: #eef5ff; outline: 2px solid var(--blue); outline-offset: -2px; }
.application-resource-option .resource-kind { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #e8f1ff; color: #1669d8; font-size: 12px; font-weight: 800; }
.application-resource-option strong, .application-resource-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.application-resource-option strong { font-size: 12.5px; }
.application-resource-option small { margin-top: 2px; color: #7d8797; font-size: 12px; }
.conversation-reconnect { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 14px; border-top: 1px solid #f2d9d7; background: #fff6f5; color: #8e3f39; }
.conversation-reconnect span { display: grid; gap: 2px; min-width: 0; }
.conversation-reconnect strong { font-size: 12.5px; }
.conversation-reconnect small { color: #9b625d; font-size: 12px; line-height: 1.4; }
.conversation-reconnect a { flex: 0 0 auto; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 7px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.conversation-reconnect a:hover { background: var(--blue-hover); }
.composer-footer { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 7px 14px; }
.composer-footer-start { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; }
.agent-native-selects { display: none; }
.agent-config { position: relative; min-width: 0; margin-left: auto; }
.agent-config-button { min-width: 156px; max-width: 230px; height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 0; border-radius: 999px; background: #f3f4f6; color: #20242b; font-size: 12.5px; cursor: pointer; transition: background-color .15s ease; }
.agent-config-button:hover, .agent-config-button[aria-expanded="true"] { background: #e9ebef; }
.agent-config-button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.agent-config-bolt { width: 15px; height: 15px; flex: 0 0 auto; fill: currentColor; stroke: none; }
.agent-config-chevron { width: 15px; height: 15px; flex: 0 0 auto; margin-left: 2px; fill: none; stroke: #737b87; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.agent-config-model-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-config-effort-label { flex: 0 0 auto; color: #8a9099; }
.agent-config-menu { position: absolute; z-index: 20; right: 0; bottom: calc(100% + 10px); width: 286px; padding: 8px; border: 1px solid #d8dbe0; border-radius: 14px; background: #fff; box-shadow: 0 18px 48px rgba(20, 28, 40, .18), 0 3px 10px rgba(20, 28, 40, .08); }
.agent-config-main { display: grid; gap: 2px; }
.agent-config-row { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: #272b31; font-size: 13px; text-align: left; cursor: pointer; }
.agent-config-row:hover { background: #f4f5f7; }
.agent-config-row:focus-visible { background: #f4f5f7; outline: 2px solid rgba(20, 111, 246, .35); outline-offset: -2px; }
.agent-config-row > span:last-child { min-width: 0; display: flex; align-items: center; gap: 7px; color: #81868e; }
.agent-config-row strong { max-width: 152px; overflow: hidden; color: #747982; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.agent-config-row svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.agent-config-options { display: grid; gap: 4px; }
.agent-config-back { width: 100%; min-height: 40px; display: flex; align-items: center; gap: 7px; padding: 0 8px; border: 0; border-bottom: 1px solid #eceef1; background: transparent; color: #272b31; font-size: 13px; font-weight: 650; text-align: left; cursor: pointer; }
.agent-config-back svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.agent-config-option-list { max-height: 238px; overflow-y: auto; padding-top: 3px; }
.agent-config-option { width: 100%; min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #333943; font-size: 13px; text-align: left; cursor: pointer; }
.agent-config-option:hover { background: #f4f5f7; }
.agent-config-option:focus-visible { background: #f4f5f7; outline: 2px solid rgba(20, 111, 246, .35); outline-offset: -2px; }
.agent-config-option.selected { color: #11151a; font-weight: 650; }
.agent-config-option svg { width: 17px; height: 17px; fill: none; stroke: var(--blue); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.usage-grid { display: grid; gap: 12px; padding: 14px; }
.usage-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; }
.usage-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.usage-card strong { color: var(--ink); }
.usage-card small { display: block; color: var(--muted); margin-top: 3px; }
.usage-cost { text-align: right; }
.usage-cost > strong { display: block; font-size: 15px; }
.usage-token-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.usage-token-grid > div { min-width: 0; padding: 10px; border-radius: 8px; background: #f7f9fc; }
.usage-token-grid dt { color: var(--muted); font-size: 12px; }
.usage-token-grid dd { margin: 4px 0 0; color: var(--ink); font-size: 15px; font-weight: 700; }
.usage-token-grid .usage-total { background: var(--blue-soft); }
.usage-card > footer { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.settings-page { min-width: 0; min-height: 0; grid-column: 2; overflow-y: auto; background: #f7f9fc; }
.settings-header { min-height: 126px; display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; padding: 28px 34px 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.settings-header h2 { margin: 0; color: var(--ink); font-size: 24px; letter-spacing: -.02em; }
.settings-header p { max-width: 640px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.settings-back { flex: 0 0 auto; min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: #526075; font-size: 12px; font-weight: 680; cursor: pointer; white-space: nowrap; }
.settings-back:hover { border-color: #a9c9f7; background: var(--blue-soft); color: var(--blue); }
.settings-back svg { width: 15px; height: 15px; }
.settings-content { width: min(920px, calc(100% - 48px)); display: grid; gap: 18px; margin: 0 auto; padding: 28px 0 48px; }
.settings-card { min-width: 0; margin: 0; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 5px 18px rgba(31, 47, 70, .04); }
.settings-access-notice { display: grid; gap: 7px; border-color: #f0d7a1; background: #fffaf0; }
.settings-access-notice strong { color: var(--ink); }
.settings-access-notice p { margin: 0; color: var(--muted); }
.settings-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.settings-card-heading h2 { margin: 0; color: var(--ink); font-size: 16px; }
.settings-card .usage-grid { padding: 0; }
.settings-card.provider-admin, .settings-card.agent-policy-form { margin: 0; padding: 20px; }
.agent-policy-form { min-width: 0; display: grid; gap: 10px; margin: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.agent-policy-form label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.agent-policy-form input, .agent-policy-form select { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.provider-admin { min-width: 0; margin: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.provider-admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.provider-admin-heading > div { min-width: 0; }
.provider-admin-heading strong, .provider-admin-heading small { display: block; }
.provider-admin-heading small { margin-top: 4px; color: var(--muted); }
.provider-admin-heading button, .provider-actions button, .provider-form button { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-weight: 700; }
.provider-admin-heading button, .provider-actions button[type="submit"] { border-color: var(--blue); background: var(--blue); color: #fff; }
.provider-admin-heading button { flex: 0 0 auto; white-space: nowrap; }
.provider-list { display: grid; gap: 8px; margin-top: 14px; }
.provider-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; color: var(--ink); }
.provider-card strong, .provider-card small { display: block; }
.provider-card small { margin-top: 3px; color: var(--muted); overflow-wrap: anywhere; }
.provider-state { flex: none; padding: 4px 8px; border-radius: 999px; background: #f2f4f7; color: var(--muted); font-size: 12px; }
.provider-state.enabled { background: #e8f7f1; color: #157454; }
.provider-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.provider-form label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.provider-form input, .provider-form select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.provider-form .provider-wide, .provider-actions { grid-column: 1 / -1; }
.provider-pricing { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.provider-pricing > div:first-child strong, .provider-pricing > div:first-child small { display: block; }
.provider-pricing > div:first-child small { margin-top: 3px; color: var(--muted); }
.provider-rate-header, .provider-rate-row { display: grid; grid-template-columns: minmax(150px, 1.6fr) repeat(3, minmax(90px, 1fr)); gap: 8px; align-items: center; }
.provider-rate-header { color: var(--muted); font-size: 12px; }
.provider-rate-rows { display: grid; gap: 7px; }
.provider-rate-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.provider-rate-row input { min-height: 36px; }
.provider-rate-empty { color: var(--muted); font-size: 12px; }
.provider-form .provider-enabled { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.provider-form .provider-enabled input { width: 18px; min-height: 18px; }
.provider-actions { display: flex; justify-content: flex-end; gap: 8px; }
.add-resource { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #4c596b; cursor: pointer; }
.add-resource:hover { background: #edf1f6; color: #202938; }
.add-resource:disabled { cursor: wait; opacity: .5; }
.add-resource svg { width: 18px; height: 18px; }
.approval-mode { position: relative; flex: 0 0 auto; }
.approval-mode-button { min-height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 7px; border: 0; border-radius: 7px; background: transparent; color: #778397; font-size: 12px; cursor: pointer; white-space: nowrap; }
.approval-mode-button:hover, .approval-mode-button[aria-expanded="true"] { background: #f1f4f8; color: #344155; }
.approval-mode-button.full-control { color: #e64a19; background: #fff4ef; }
.approval-mode-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.approval-mode-button .approval-mode-chevron { width: 13px; height: 13px; }
.approval-mode-menu { position: absolute; z-index: 22; left: 0; bottom: calc(100% + 10px); width: 360px; padding: 7px; border: 1px solid #d8dbe0; border-radius: 14px; background: #fff; box-shadow: 0 18px 48px rgba(20, 28, 40, .18), 0 3px 10px rgba(20, 28, 40, .08); }
.approval-mode-heading { display: grid; gap: 2px; padding: 8px 10px 7px; border-bottom: 1px solid #eef0f3; margin-bottom: 4px; }
.approval-mode-heading strong { color: #6d7580; font-size: 12px; font-weight: 600; }
.approval-mode-heading small { color: #9aa1ab; font-size: 12px; }
.approval-mode-menu > button { width: 100%; display: grid; grid-template-columns: 24px minmax(0, 1fr) 18px; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: #283142; text-align: left; cursor: pointer; }
.approval-mode-menu > button:hover, .approval-mode-menu > button:focus-visible { background: #f4f6f9; }
.approval-mode-menu > button > svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.approval-mode-menu > button span:nth-child(2) { display: grid; gap: 2px; }
.approval-mode-menu strong { font-size: 12.5px; }
.approval-mode-menu small { color: #7e899b; font-size: 12px; line-height: 1.35; }
.approval-mode-check { color: var(--blue); font-weight: 800; opacity: 0; }
.approval-mode-menu [aria-checked="true"] .approval-mode-check { opacity: 1; }
.approval-mode-menu .approval-mode-full { color: #e64a19; }
.approval-mode-menu .approval-mode-full small { color: #e26942; }
.approval-mode-menu .approval-mode-full:hover, .approval-mode-menu .approval-mode-full:focus-visible, .approval-mode-menu .approval-mode-full[aria-checked="true"] { background: #fff4ef; }
.approval-mode-menu .approval-mode-full .approval-mode-check { color: #e64a19; }
.approval-mode-menu p { margin: 5px 8px 3px; color: #929bad; font-size: 12px; line-height: 1.4; }
.composer-footer .send-button { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #202124; color: #fff; cursor: pointer; transition: background-color .15s ease, transform .15s ease; }
.composer-footer .send-button:hover:not(:disabled) { background: #0f1115; transform: translateY(-1px); }
.composer-footer .send-button:disabled { cursor: default; background: #b8bdc5; color: #fff; opacity: 1; }
.composer-footer .send-button.stop { background: #202124; }
.composer-footer .send-button.stop:hover:not(:disabled) { background: #0f1115; }
.composer-footer .send-button.stop:disabled { background: #202124; cursor: wait; opacity: .72; }
.composer-footer .send-button svg { width: 18px; height: 18px; }
.composer-footer .send-button .stop-icon rect { fill: currentColor; stroke: none; }

.inspector { position: fixed; z-index: 20; top: calc(var(--topbar-height) + 16px); right: 16px; width: var(--inspector-width); max-width: calc(100vw - 32px); max-height: calc(100dvh - var(--topbar-height) - 32px); min-width: 0; overflow-y: auto; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: 0 6px 24px rgba(31, 47, 70, .09); }
.inspector-floating-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.inspector-floating-header h2 { margin: 0; font-size: 14px; font-weight: 680; }
.inspector-floating-header button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.inspector-floating-header button:hover { background: var(--surface-subtle); color: var(--ink); }
.inspector-floating-header svg { width: 18px; height: 18px; }
@media (min-width: 1200px) { .conversation.details-open { margin-right: calc(var(--inspector-width) + 32px); } }
.project-context-card, .dynamic-build-stages { margin: 14px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 4px 14px rgba(31, 47, 70, .035); }
.project-context-row { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 8px; padding: 9px 0; border-top: 1px solid #edf0f4; font-size: 12px; }
.project-context-row span { color: var(--subtle); }
.project-context-row strong { overflow: hidden; color: #3d4a5e; text-overflow: ellipsis; white-space: nowrap; }
.project-context-card .open-current-application { width: 100%; margin: 9px 0 0; }
.dynamic-build-stages { padding-bottom: 10px; }
.dynamic-build-stages .stage-list { margin-top: 8px; }
.inspector-build-plan { margin: 14px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 4px 14px rgba(31,47,70,.035); }
.environment-card { margin: 14px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 4px 14px rgba(31, 47, 70, .035); }
.environment-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid #edf0f4; }
.environment-heading h2 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 680; }
.environment-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 51px; border-bottom: 1px solid #edf0f4; }
.environment-row:last-of-type { border-bottom: 0; }
.environment-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: var(--blue-soft); color: var(--blue); }
.environment-icon svg { width: 15px; height: 15px; }
.environment-row strong, .environment-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.environment-row strong { color: #3d4a5e; font-size: 12px; font-weight: 680; }
.environment-row small { margin-top: 2px; color: #8792a3; font-size: 12px; }
.environment-row small.confirmed { color: var(--green); }
.environment-value { min-width: 0; }
.environment-chooser { display: grid; gap: 8px; padding: 10px 0 12px 40px; border-bottom: 1px solid #edf0f4; }
.environment-chooser button { height: 32px; border: 1px solid var(--blue); border-radius: 7px; background: var(--blue); color: white; font-size: 12px; font-weight: 680; cursor: pointer; }
.environment-chooser button:hover { border-color: var(--blue-hover); background: var(--blue-hover); }
.environment-hint { margin: 10px 0 0; color: #7d899b; font-size: 12px; line-height: 1.5; }
.open-current-application { margin: 8px 0 4px 40px; min-height: 34px; border: 1px solid var(--blue); border-radius: 7px; background: #fff; color: var(--blue); font-size: 12px; font-weight: 680; cursor: pointer; }
.open-current-application:hover { background: #eff6ff; }
.change-application-target { margin: 6px 0 4px 40px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 7px; background: #fff; color: #536176; font-size: 12px; font-weight: 680; text-align: left; cursor: pointer; }
.change-application-target:hover { border-color: #a9c9f7; color: var(--blue); background: #f8fbff; }
.change-application-target:disabled { cursor: wait; opacity: .62; }
.build-plan-card { display: grid; gap: 9px; padding: 12px 0 4px 40px; }
.build-plan-card.inspector-build-plan { margin: 14px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 4px 14px rgba(31,47,70,.035); }
.build-plan-card.hidden { display: none; }
.build-plan-heading { display: grid; gap: 2px; }
.build-plan-heading strong { color: #3d4a5e; font-size: 12px; }
.build-plan-heading small { color: #8792a3; font-size: 12px; }
.build-plan-field { display: grid; gap: 5px; color: #667386; font-size: 12px; font-weight: 650; }
.build-plan-field input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--ink); font: inherit; background: var(--surface); }
.build-plan-field textarea { width: 100%; min-height: 112px; padding: 9px 10px; resize: vertical; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--ink); font: inherit; font-weight: 450; line-height: 1.45; background: var(--surface); }
.build-plan-field textarea::placeholder { color: #929cad; }
.build-plan-field input:focus, .build-plan-field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20, 111, 246, .1); }
.brief-guidance { margin: 0; color: #7d899b; font-size: 12px; line-height: 1.45; }
.build-plan-card > button { height: 34px; border: 1px solid var(--blue); border-radius: 7px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 680; cursor: pointer; }
.build-plan-steps { display: grid; gap: 7px; margin: 2px 0 0; padding: 0; list-style: none; }
.build-plan-steps:empty { display: none; }
.build-plan-step { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 7px; align-items: start; color: #647185; font-size: 12px; line-height: 1.35; }
.build-plan-step::before { content: attr(data-index); width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 700; }
.build-plan-step strong, .build-plan-step small { display: block; }
.build-plan-step strong { color: #3d4a5e; font-size: 12px; }
.build-plan-step small { margin-top: 1px; color: #8792a3; font-size: 12px; }
.build-plan-step.status-running::before { background: var(--blue); color: #fff; }
.build-plan-step.status-readback-verified::before { background: var(--green-soft); color: var(--green); content: "✓"; }
.build-plan-step.status-failed::before { background: var(--red-soft); color: var(--red); content: "!"; }
.build-stage-action, .build-approval-actions button { min-height: 30px; margin-top: 7px; padding: 5px 9px; border: 1px solid var(--blue); border-radius: 6px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 680; cursor: pointer; }
.build-approval-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.build-approval-actions button.secondary { border-color: var(--border-strong); background: var(--surface); color: #59677b; }
.build-stage-ready { margin-top: 6px !important; padding: 6px 8px; border-radius: 6px; background: var(--green-soft); color: #177553 !important; white-space: normal; }
.inspector-header { height: 72px; display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.tabs { width: 100%; min-width: 0; min-height: 46px; display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); align-items: stretch; padding: 0 10px; overflow: hidden; border-bottom: 1px solid var(--border); background: var(--surface); }
.tab { min-width: 0; min-height: 46px; position: relative; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #7b8799; font-size: 12px; font-weight: 680; white-space: nowrap; cursor: pointer; }
.tab:hover { color: #415169; }
.tab.active { border-color: var(--blue); color: var(--blue); }
.tab span { height: 18px; min-width: 18px; padding: 0 3px; font-size: 12px; }
.tab.active span { background: #e1edff; color: var(--blue); }
.panel { padding: 5px 17px 24px; }
.inspector-section { padding: 17px 0 19px; border-bottom: 1px solid var(--border); }
.inspector-section:last-child { border-bottom: 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: #657287; font-size: 12px; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
.section-meta:empty { display: none; }
.empty-state { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 9px 10px; border: 1px dashed #d9dfe8; border-radius: 7px; color: #929daf; background: rgba(255, 255, 255, .55); font-size: 12px; }
.empty-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #c8cfda; }
.capability-route { padding: 10px; border: 1px solid #c8dcf9; border-radius: 8px; background: #f6f9ff; color: #4a5870; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.capability-route strong { display: block; color: #29436d; font-weight: 700; }
.capability-route-reason, .capability-route-observed { margin-top: 4px; color: #6f7e94; }
.capability-route-label { margin-top: 8px; color: #657287; font-size: 12px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.capability-chip-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.capability-chip-list span { max-width: 100%; padding: 2px 5px; border-radius: 4px; background: #e6efff; color: #3564b6; font-size: 12px; overflow-wrap: anywhere; }
.plan-item { position: relative; display: grid; grid-template-columns: 19px 1fr; gap: 7px; padding: 7px 0; color: #536176; font-size: 12px; line-height: 1.4; }
.plan-item + .plan-item::before { content: ""; position: absolute; left: 8px; top: -8px; width: 1px; height: 12px; background: #d9dfe8; }
.plan-marker { z-index: 1; width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid #d6dde7; border-radius: 50%; background: var(--surface-subtle); color: #8894a6; font-size: 12px; font-weight: 800; }
.plan-marker.check { border-color: #a7d8c5; background: var(--green-soft); color: var(--green); }
.plan-marker.current { border-color: #a9c9f7; background: var(--blue-soft); color: var(--blue); }
.tool-item, .resource-item, .artifact-item, .evidence-item { padding: 9px 0; border-bottom: 1px solid #e8ecf2; font-size: 12px; }
.artifact-open { width: 100%; border-top: 0; border-right: 0; border-left: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.artifact-open:hover strong, .artifact-open:focus-visible strong { color: var(--blue); }
.tool-item:last-child, .resource-item:last-child, .artifact-item:last-child, .evidence-item:last-child { border-bottom: 0; }
.tool-item strong, .resource-item strong, .artifact-item strong, .evidence-item strong { display: block; overflow-wrap: anywhere; color: #3c4a5e; font-weight: 660; line-height: 1.4; }
.tool-item div, .resource-item div, .artifact-item div, .evidence-item div { margin-top: 3px; overflow-wrap: anywhere; color: #8792a3; font-size: 12px; line-height: 1.45; }
.resource-item { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; align-items: start; }
.resource-item .resource-icon { grid-row: 1 / span 2; }
.resource-item-main { min-width: 0; }
.resource-actions { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.resource-actions button, .resource-actions a { padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 650; text-decoration: none; cursor: pointer; }
.resource-actions button:disabled { color: #8a95a7; cursor: default; }
.message-resources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.message-resource { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 8px; border: 1px solid #c8dcf9; border-radius: 7px; background: rgba(255,255,255,.72); color: #526075; font-size: 12px; }
.message-resource .resource-icon { width: 22px; height: 22px; border-radius: 5px; }
.message-resource .resource-icon svg { width: 14px; height: 14px; }
.message-resource strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-status { display: inline-flex; align-items: center; gap: 6px; }
.tool-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #9aa5b5; }
.tool-status.running::before, .tool-status.started::before { background: var(--blue); }
.tool-status.completed::before, .tool-status.succeeded::before { background: var(--green); }
.tool-status.failed::before { background: var(--red); }
.approval-card { margin-bottom: 10px; padding: 12px; border: 1px solid #ead6ad; border-left: 3px solid #d8982c; border-radius: 8px; background: var(--amber-soft); color: #586477; font-size: 12px; line-height: 1.5; }
.approval-message { width: min(100%, 720px); margin-bottom: 12px; white-space: normal; }
.approval-card.inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0; padding: 10px 12px; border-radius: 9px; font-size: 12px; line-height: 1.4; box-shadow: none; }
.approval-copy { min-width: 0; }
.approval-kicker { margin-bottom: 2px; color: #9a681a; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.approval-scope { display: inline; color: #7a5a22; font-size: 12px; font-weight: 650; }
.approval-card strong { display: block; margin-bottom: 4px; color: #4b402c; font-weight: 700; }
.approval-card code { display: block; overflow: auto; margin: 9px 0; padding: 8px; border-radius: 5px; background: #263041; color: #edf2f8; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.approval-actions { display: flex; gap: 7px; margin-top: 10px; }
.approval-card.inline .approval-actions { flex: 0 0 auto; margin-top: 0; }
.approval-actions button { padding: 6px 10px; border: 1px solid #d1d8e2; border-radius: 6px; background: white; color: #576578; font-size: 12px; font-weight: 680; cursor: pointer; }
.approval-actions button:hover { border-color: #a9b5c5; color: var(--ink); }
.approval-actions .accept { border-color: var(--blue); background: var(--blue); color: white; }
.approval-actions .accept:hover { border-color: var(--blue-hover); background: var(--blue-hover); color: white; }
.evidence-item.passed strong { color: var(--green); }
.evidence-item.failed strong { color: var(--red); }
.evidence-source { display: inline-flex; align-items: center; width: fit-content; padding: 2px 6px; border-radius: 10px; background: #edf1f6; color: #5e6c80 !important; font-weight: 650; }
.evidence-source.fixture { background: var(--amber-soft); color: var(--amber) !important; }
.evidence-source.live { background: var(--green-soft); color: var(--green) !important; }
.hidden { display: none !important; }

.document-reader { position: fixed; z-index: 40; top: var(--topbar-height); right: 0; bottom: 0; width: min(540px, calc(100vw - 48px)); display: flex; flex-direction: column; border-left: 1px solid var(--border-strong); background: var(--surface); box-shadow: -18px 0 48px rgba(26, 42, 67, .16); }
.document-reader-header { flex: 0 0 auto; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 18px 14px 22px; border-bottom: 1px solid var(--border); }
.document-reader-header h2 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 700; }
.document-reader.maximized { z-index: 60; inset: 0; width: 100vw; border-left: 0; box-shadow: none; }
.document-reader.maximized .document-reader-header { min-height: 64px; }
.preview-maximized { overflow: hidden; }
.document-reader-body { min-height: 0; flex: 1; overflow-y: auto; padding: 24px 28px 48px; scrollbar-width: thin; scrollbar-color: #cbd3df transparent; }
.document-reader-scrim { position: fixed; z-index: 35; inset: var(--topbar-height) 0 0; border: 0; background: rgba(31, 42, 58, .14); cursor: default; }
.application-preview { min-height: 0; flex: 1; display: flex; flex-direction: column; background: #f4f7fb; }
.application-preview-toolbar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 16px; border-bottom: 1px solid var(--border); color: #68768a; font-size: 12px; }
.application-preview-toolbar > span { min-width: 0; overflow: hidden; flex: 1 1 auto; text-overflow: ellipsis; white-space: nowrap; }
.application-preview-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; }
.application-preview-actions button { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; color: #59687b; font: inherit; font-weight: 650; white-space: nowrap; cursor: pointer; }
.application-preview-actions button:hover { border-color: #a9c9f7; color: var(--blue); background: #f8fbff; }
.application-preview-actions button:disabled { cursor: wait; opacity: .62; }
.application-preview-actions button svg { width: 14px; height: 14px; }
.application-preview-toolbar a { color: var(--blue); font-weight: 650; white-space: nowrap; text-decoration: none; }
.application-preview-toolbar a:hover { text-decoration: underline; }
.application-preview iframe { min-height: 0; flex: 1; width: 100%; border: 0; background: #fff; }
.application-link-icon { border-color: #c9e9dc; background: var(--green-soft); color: var(--green); }
.markdown-body { min-width: 0; overflow-wrap: anywhere; color: #38465a; font-size: 13px; line-height: 1.65; }
.markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5 { margin: 24px 0 9px; color: #202938; line-height: 1.3; }
.markdown-body h2:first-child, .markdown-body h3:first-child { margin-top: 0; }
.markdown-body h2 { font-size: 20px; }
.markdown-body h3 { font-size: 16px; }
.markdown-body h4, .markdown-body h5 { font-size: 14px; }
.markdown-body p { margin: 9px 0; }
.markdown-body ul, .markdown-body ol { margin: 9px 0; padding-left: 23px; }
.markdown-body li { margin: 5px 0; }
.markdown-body code { padding: 2px 5px; border-radius: 4px; background: #eef2f7; color: #344256; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.markdown-body pre { overflow-x: auto; margin: 12px 0; padding: 13px 14px; border-radius: 8px; background: #263041; color: #edf2f8; }
.markdown-body pre code { padding: 0; background: transparent; color: inherit; line-height: 1.55; white-space: pre; }
.markdown-body blockquote { margin: 12px 0; padding: 9px 13px; border-left: 3px solid var(--blue); background: var(--blue-soft); color: #526075; }
.markdown-table-wrap { overflow-x: auto; margin: 12px 0 18px; border: 1px solid var(--border); border-radius: 8px; }
.markdown-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
.markdown-body th, .markdown-body td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.markdown-body th { background: var(--surface-subtle); color: #455368; font-weight: 700; }
.markdown-body tr:last-child td { border-bottom: 0; }

#toast { position: fixed; z-index: 50; right: 22px; bottom: 22px; max-width: 360px; padding: 10px 13px; border: 1px solid #39465a; border-radius: 8px; background: #263246; color: white; font-size: 12px; line-height: 1.4; opacity: 0; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; box-shadow: 0 10px 25px rgba(20, 32, 50, .2); }
#toast.show { opacity: 1; transform: translateY(0); }
.modal-backdrop { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(31,42,58,.34); }
.project-modal { width: min(560px, 100%); max-height: min(760px, calc(100vh - 48px)); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); box-shadow: 0 24px 72px rgba(23,38,61,.22); }
.project-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.project-modal-header h2 { margin: 0; color: var(--ink); font-size: 19px; letter-spacing: -.01em; }
.project-modal-body { overflow-y: auto; display: grid; gap: 16px; padding: 20px 22px; }
.project-modal-body > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.modal-field { display: grid; gap: 7px; color: #526075; font-size: 12px; font-weight: 680; }
.target-mode { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.target-mode legend { margin-bottom: 7px; color: #526075; font-size: 12px; font-weight: 680; }
.target-mode label { display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.target-mode label:has(input:checked) { border-color: #a9c9f7; background: var(--blue-soft); }
.target-mode input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--blue); }
.target-mode strong, .target-mode small { display: block; }
.target-mode strong { color: #344256; font-size: 13px; }
.target-mode small { margin-top: 2px; color: #7f8b9d; font-size: 12px; font-weight: 450; line-height: 1.4; }
.modal-status { min-height: 38px; padding: 9px 11px; border-radius: 8px; background: var(--surface-subtle); color: #68768a; font-size: 12px; line-height: 1.45; }
.modal-status.error { background: var(--red-soft); color: var(--red); }
.modal-reconnect { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; justify-self: start; padding: 0 16px; border: 1px solid var(--blue); border-radius: 8px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
.modal-reconnect:hover { background: var(--blue-hover); }
.project-modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px 18px; border-top: 1px solid var(--border); }
.project-modal-footer button { min-width: 100px; height: 38px; border: 1px solid var(--blue); border-radius: 8px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.project-modal-footer button.secondary { border-color: var(--border-strong); background: var(--surface); color: #566579; }
.project-modal-footer button:disabled { cursor: not-allowed; opacity: .5; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px; padding: 0; border: 0; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 1180px) {
  :root { --sidebar-width: 238px; }
  .sidebar-section { padding-left: 14px; padding-right: 14px; }
  .build-stages { padding-left: 14px; padding-right: 14px; }
  .stage-list small { display: none; }
  .stage-list li { min-height: 40px; }
  .welcome { width: min(560px, calc(100% - 44px)); }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .shell { height: auto; min-height: calc(100vh - var(--topbar-height)); grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { grid-row: 1 / span 2; min-height: calc(100vh - var(--topbar-height)); }
  .conversation { min-height: 690px; }
  .settings-page { grid-column: 2; min-height: calc(100vh - var(--topbar-height)); }
  .inspector-header { height: 60px; }
  .panel { min-height: 210px; }
}

@media (max-width: 680px) {
  button, input, select, textarea { font-size: 14px; }
  .topbar { padding: 0 13px; }
  .brand img { width: 108px; }
  .brand-divider, .environment-status, .toolbar-button span { display: none; }
  .product-name { display: none; }
  .toolbar-button { width: 34px; justify-content: center; padding: 0; }
  .shell { display: block; }
  .sidebar { min-height: 0; max-height: none; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .project-section { padding: 16px; }
  .sidebar-footer { padding: 8px 16px 14px; }
  .build-stages { display: none; }
  .history-section { min-height: 0; padding: 13px 10px 15px; }
  .run-history { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
  .run-item { min-width: 190px; }
  .conversation { min-height: 650px; }
  .conversation-header { min-height: 62px; padding: 12px 16px; }
  .conversation-header h1 { max-width: 210px; font-size: 14px; }
  .welcome { width: calc(100% - 28px); margin-top: 44px; }
  .welcome > p, .message, .event-title, .event-detail, .empty-state, .tool-item, .resource-item, .artifact-item, .evidence-item, .approval-card { font-size: 14px; }
  .suggestion { grid-template-columns: 34px 1fr; }
  .suggestion .arrow { display: none; }
  .suggestion-icon { width: 34px; height: 34px; }
  .governance-note { align-items: flex-start; text-align: left; }
  .timeline { padding: 24px 42px 155px; }
  .message.user { margin-left: 0; }
  .composer { left: 14px; right: 14px; bottom: 16px; }
  .approval-mode-menu { width: min(360px, calc(100vw - 48px)); }
  .inspector { top: calc(var(--topbar-height) + 8px); right: 8px; max-width: calc(100vw - 16px); max-height: calc(100dvh - var(--topbar-height) - 16px); border-radius: 14px; }
  .conversation-header-actions { gap: 8px; }
  .inspector-toggle { width: 34px; padding: 7px; justify-content: center; }
  .inspector-toggle span { display: none; }
  .settings-page { min-height: 640px; }
  .settings-header { min-height: 0; display: grid; gap: 18px; padding: 22px 18px; }
  .settings-content { width: calc(100% - 28px); padding: 18px 0 36px; }
  .settings-back { justify-self: start; }
  .provider-admin-heading { align-items: flex-start; }
  .usage-card > header { display: grid; gap: 10px; }
  .usage-cost { text-align: left; }
  .usage-token-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage-token-grid .usage-total { grid-column: 1 / -1; }
  .provider-rate-header { display: none; }
  .provider-rate-row { grid-template-columns: 1fr; padding-top: 8px; border-top: 1px solid var(--line); }
  .document-reader { top: 0; width: 100vw; }
  .document-reader-header { min-height: 64px; padding: 12px 14px 12px 18px; }
  .document-reader-body { padding: 20px 18px 40px; font-size: 14px; }
  .application-preview-toolbar { align-items: flex-start; }
  .application-preview-actions { gap: 9px; }
  .application-preview-actions button > span { display: none; }
  .generated-document-card { grid-template-columns: 34px minmax(0, 1fr); }
  .generated-document-icon { width: 34px; height: 34px; }
  .generated-document-open { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.composer-footer-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.voice-input-button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--text-secondary, #64748b); cursor: pointer; }
.voice-input-button:hover { background: #f1f5f9; color: #146ff6; }
.voice-input-button:disabled { opacity: .45; cursor: default; }
.voice-input-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.voice-status { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 16px; border-top: 1px solid #e2e8f0; background: #f8fafc; font-size: 13px; color: #475569; }
.voice-status > span { flex: 1; min-width: 160px; }
.voice-status button { border: 1px solid #dbe3ef; border-radius: 8px; padding: 6px 10px; background: white; color: #334155; cursor: pointer; }
#stopVoice { color: #146ff6; }
:root { --generated-image-radius: 16px; }
.generated-image-card { max-width: 900px; width: 100%; border: 1px solid #e1e6ed; border-radius: var(--generated-image-radius); padding: 12px; background: #fff; }
.generated-image-card > button { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; color: inherit; }
.generated-image-card img { display: block; width: 100%; height: auto; border-radius: 10px; }
.generated-image-card small { color: #68758a; }
.generated-image-card > a { display: inline-block; margin-top: 12px; }
.artifact-image-preview { display: block; width: 100%; height: auto; }
