:root {
  --sidebar: #073f31;
  --sidebar-hover: #145445;
  --sidebar-active: #2b6658;
  --canvas: #fcfcfa;
  --surface: #ffffff;
  --surface-soft: #f5f6f3;
  --ink: #17201b;
  --muted: #68736d;
  --line: #dedfd9;
  --green: #0f6b50;
  --green-soft: #e7f1ec;
  --orange: #e9773f;
  --red: #c65050;
  --blue: #397797;
  --shadow: 0 8px 30px rgba(21, 34, 27, .08);
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { min-width: 320px; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.chat-app { height: 100vh; display: grid; grid-template-columns: 284px minmax(0, 1fr); background: var(--canvas); }
.sidebar {
  position: relative;
  z-index: 30;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 14px;
  color: #edf7f2;
  background: var(--sidebar);
}
.sidebar-brand { height: 42px; padding: 0 6px; display: flex; align-items: center; gap: 11px; }
.sidebar-brand strong { font-size: 19px; letter-spacing: -.02em; }
.brand-mark, .welcome-logo, .turn-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  background: var(--green);
  border-radius: 10px;
  font: 700 19px Georgia, serif;
}
.brand-mark { width: 34px; height: 34px; color: var(--sidebar); background: #f5faf7; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 20px; }
.icon-button:hover { color: var(--ink); background: var(--surface-soft); }
.sidebar-close { display: none; margin-left: auto; color: rgba(255,255,255,.72); }
.sidebar-close:hover { color: white; background: rgba(255,255,255,.1); }
.new-chat-button {
  width: 100%;
  height: 48px;
  margin: 20px 0 12px;
  padding: 0 13px;
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 11px;
  color: white;
  background: transparent;
  text-align: left;
}
.new-chat-button:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.36); }
.new-chat-button .ph { font-size: 18px; }
.tool-nav { display: grid; gap: 3px; margin: 6px 0 18px; }
.tool-nav-item {
  height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 9px;
  color: rgba(244,251,247,.78);
  background: transparent;
  text-align: left;
  font-size: 13px;
}
.tool-nav-item .ph { width: 20px; font-size: 19px; }
.tool-nav-item:hover, .tool-nav-item.is-active { color: white; background: var(--sidebar-hover); }
.history-search {
  height: 40px;
  margin: 0 5px 14px;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px;
  color: rgba(255,255,255,.6);
}
.history-search input { width: 100%; border: 0; outline: 0; color: white; background: transparent; font-size: 12px; }
.history-search input::placeholder { color: rgba(255,255,255,.5); }
.history-area { min-height: 0; flex: 1; overflow-y: auto; }
.history-heading { padding: 0 9px 7px; display: flex; justify-content: space-between; color: rgba(255,255,255,.48); font-size: 10px; }
.history-heading button { border: 0; color: rgba(255,255,255,.48); background: transparent; font-size: 9px; }
.history-heading button:hover { color: white; }
.history-list { display: grid; gap: 3px; }
.history-group-label { margin: 12px 9px 4px; color: rgba(255,255,255,.45); font-size: 10px; }
.history-item {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  color: rgba(255,255,255,.76);
  background: transparent;
  text-align: left;
}
.history-item:hover { color: white; background: var(--sidebar-hover); }
.history-item.is-active { color: white; background: var(--sidebar-active); }
.history-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.history-item time { color: rgba(255,255,255,.45); font-size: 9px; }
.history-empty { padding: 18px 10px; color: rgba(255,255,255,.45); font-size: 11px; line-height: 1.6; }
.sidebar-profile {
  min-height: 66px;
  margin-top: 12px;
  padding: 12px 7px 4px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,.14);
}
.profile-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: white; background: #13765b; font-weight: 700; }
.sidebar-profile strong, .sidebar-profile small { display: block; }
.sidebar-profile strong { font-size: 12px; }
.sidebar-profile small { margin-top: 3px; color: rgba(255,255,255,.5); font-size: 9px; }
.sidebar-profile > .ph { color: rgba(255,255,255,.58); }
.sidebar-scrim { display: none; }

.chat-main { position: relative; min-width: 0; height: 100vh; display: grid; grid-template-rows: 58px minmax(0, 1fr); background: var(--canvas); }
.workspace-body { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(420px, 1fr); }
.dialogue-column { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
body.results-visible .workspace-body { grid-template-columns: minmax(390px, .78fr) minmax(620px, 1.22fr); }
.results-dock { min-width: 0; min-height: 0; overflow: hidden; border-left: 1px solid var(--line); background: #f7f8f5; }
.results-dock:not(.hidden) { display: grid; grid-template-rows: 52px minmax(0, 1fr); }
.results-dock-header { padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: white; }
.results-dock-header strong, .results-dock-header span { display: block; }
.results-dock-header strong { font-size: 12px; }
.results-dock-header div > span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.result-state-badge { padding: 4px 7px; border-radius: 99px; color: var(--green); background: var(--green-soft); font-size: 8px; }
.results-dock-scroll { min-height: 0; padding: 14px; overflow-y: auto; }
.chat-header {
  position: relative;
  z-index: 15;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #eeeeea;
  background: rgba(252,252,250,.96);
}
.sidebar-open { display: none; }
.chat-title { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.chat-title strong { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.chat-title span { display: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.connection-status { padding: 6px 9px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: white; font-size: 9px; }
.connection-status > i { width: 7px; height: 7px; border-radius: 50%; background: #48b77f; box-shadow: 0 0 0 4px rgba(72,183,127,.13); }

.conversation-scroll { min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.welcome-state { min-height: calc(100vh - 250px); padding: 80px 24px 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.welcome-logo { width: 54px; height: 54px; font-size: 27px; }
.welcome-state h1 { margin: 20px 0 8px; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.04em; }
.welcome-state > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.prompt-suggestions { width: min(760px, 100%); margin-top: 32px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.prompt-suggestions button { min-height: 66px; padding: 12px 14px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; text-align: left; font-size: 11px; }
.prompt-suggestions button:hover { border-color: #aabeb4; background: #f8faf8; }
.prompt-suggestions .ph { color: var(--green); font-size: 20px; }
.conversation-thread { width: min(1020px, calc(100% - 48px)); margin: 0 auto; }
.chat-message { margin: 24px 0; display: flex; gap: 12px; align-items: flex-start; }
.chat-message.user { justify-content: flex-end; }
.chat-message .message-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-size: 11px; font-weight: 700; }
.chat-message.user .message-avatar { order: 2; background: #185e4b; }
.chat-bubble { max-width: min(720px, 80%); padding: 11px 14px; border-radius: 14px 4px 14px 14px; background: #f0f1ee; font-size: 13px; line-height: 1.65; }
.chat-message.assistant .chat-bubble { border-radius: 4px 14px 14px 14px; background: transparent; padding: 4px 0; }
.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }
.message-content p { margin: 0 0 10px; }
.message-content h1, .message-content h2, .message-content h3, .message-content h4 { margin: 18px 0 8px; letter-spacing: -.015em; line-height: 1.35; }
.message-content h1 { font-size: 18px; }
.message-content h2 { font-size: 16px; }
.message-content h3 { font-size: 14px; }
.message-content h4 { font-size: 13px; }
.message-content ul, .message-content ol { margin: 7px 0 11px; padding-left: 22px; }
.message-content li { margin: 3px 0; }
.message-content hr { margin: 16px 0; border: 0; border-top: 1px solid var(--line); }
.message-content code { padding: 2px 5px; border-radius: 5px; color: #265b48; background: var(--green-soft); font: .9em Consolas, monospace; }
.message-content pre { max-width: 100%; padding: 11px; overflow-x: auto; border-radius: 9px; color: #eef7f2; background: #16382d; }
.message-content pre code { padding: 0; color: inherit; background: transparent; }
.message-content blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid #a9c8ba; color: var(--muted); }
.message-content a { color: var(--green); text-underline-offset: 2px; }
.chat-message.user .message-content p { margin: 0; }
.message-tools { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.message-tools span { padding: 3px 6px; border-radius: 5px; color: var(--green); background: var(--green-soft); font: 8px Consolas, monospace; }

.assistant-turn { width: min(1060px, calc(100% - 48px)); margin: 30px auto 8px; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; }
.turn-avatar { width: 38px; height: 38px; font-size: 18px; }
.turn-content { min-width: 0; }
.turn-author { height: 38px; display: flex; align-items: center; gap: 9px; }
.turn-author strong { font-size: 13px; }
.turn-author span { color: var(--muted); font-size: 9px; }
.plan-heading { margin: 4px 0 13px; display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.plan-heading h2, .result-titlebar h2 { margin: 0; font-size: 17px; }
.plan-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.data-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.data-cell { padding: 5px 8px; border-radius: 7px; color: var(--muted); background: var(--surface-soft); font-size: 9px; }
.data-cell span { margin-right: 4px; }
.data-cell strong { color: var(--ink); font-weight: 600; }
.intent-card { padding: 11px 12px; border: 1px solid #cfe0d7; border-radius: 10px; background: #f2f7f4; }
.intent-card h3 { margin: 0 0 7px; font-size: 11px; }
.tag { display: inline-block; margin: 2px 4px 2px 0; padding: 4px 7px; border-radius: 99px; color: var(--green); background: white; font-size: 9px; }
.data-warning { margin-bottom: 8px; color: #8c512f; font-size: 9px; line-height: 1.5; }
.compact-disclosure { margin-top: 9px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.compact-disclosure > summary { min-height: 44px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.compact-disclosure summary::-webkit-details-marker { display: none; }
.compact-disclosure summary > span { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; }
.compact-disclosure summary .ph { color: var(--green); font-size: 18px; }
.compact-disclosure summary small { margin-left: auto; color: var(--muted); font-size: 9px; }
.compact-disclosure summary::after { content: "⌄"; color: var(--muted); font-size: 14px; transition: transform .2s; }
.compact-disclosure[open] summary::after { transform: rotate(180deg); }
.workflow-card { padding: 4px 12px 13px; }
.workflow-graph { display: flex; flex-direction: column; }
.workflow-terminal { align-self: center; min-width: 150px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; text-align: center; }
.workflow-terminal strong, .workflow-terminal small { display: block; }
.workflow-terminal strong { font: 700 9px Consolas, monospace; }
.workflow-terminal small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.workflow-terminal.is-path { border-color: #e6b08d; background: #fff7f2; }
.workflow-terminal.is-executed { border-color: #9cc6b2; background: #f1f8f4; }
.workflow-branch-line, .workflow-merge-line { height: 22px; position: relative; }
.workflow-branch-line::before, .workflow-merge-line::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid #c5cbc7; }
.workflow-branch-line span { position: absolute; left: 50%; top: 5px; padding: 1px 5px; transform: translateX(-50%); color: var(--muted); background: white; font: 8px Consolas, monospace; }
.workflow-lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.workflow-lane { padding: 9px; border: 1px solid var(--line); border-radius: 9px; }
.workflow-lane > header { margin-bottom: 7px; padding-bottom: 7px; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid #eceeea; }
.workflow-lane > header strong, .workflow-lane > header small { display: block; }
.workflow-lane > header strong { font-size: 9px; }
.workflow-lane > header small { margin-top: 2px; color: var(--muted); font: 8px Consolas, monospace; }
.workflow-lane > header > span { color: var(--green); font-size: 8px; }
.workflow-lane.is-inactive { opacity: .48; }
.workflow-lane-nodes { display: grid; gap: 5px; }
.workflow-arrow { display: none; }
.workflow-node { min-height: 38px; padding: 6px 7px; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fbfbf9; }
.workflow-node-dot { width: 7px; height: 7px; border-radius: 50%; background: #b6bdb8; }
.workflow-node strong, .workflow-node small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-node strong { font-size: 9px; }
.workflow-node small { margin-top: 2px; color: var(--muted); font: 7px Consolas, monospace; }
.workflow-node em { color: var(--muted); font-size: 7px; font-style: normal; }
.workflow-node.is-path { border-color: #ebbc9d; background: #fff7f2; }
.workflow-node.is-path .workflow-node-dot { background: var(--orange); }
.workflow-node.is-executed { border-color: #acd0bd; background: #f1f8f4; }
.workflow-node.is-executed .workflow-node-dot { background: var(--green); }
.workflow-node.is-skipped { opacity: .5; }
.workflow-node.is-conditional::after { display: none; }
.workflow-detail { margin: 9px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.plan-list { padding: 0 12px 12px; display: grid; gap: 5px; }
.plan-node { min-height: 42px; padding: 7px 8px; display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 8px; align-items: center; border-top: 1px solid #eceee9; }
.node-order { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); background: var(--surface-soft); font-size: 8px; }
.plan-node strong, .plan-node small { display: block; }
.plan-node strong { font-size: 10px; }
.plan-node small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.node-status { padding: 3px 6px; border-radius: 99px; color: var(--muted); background: var(--surface-soft); font-size: 8px; }
.node-status.completed { color: var(--green); background: var(--green-soft); }
.approve-button { margin-top: 11px; min-height: 42px; padding: 0 17px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 9px; color: white; background: var(--green); font-size: 11px; font-weight: 650; }
.approve-button:hover { background: #0a573f; }
.runtime-disclosure { margin-top: 11px; }
.runtime-plan-heading { padding: 10px 12px 4px; display: flex; align-items: center; gap: 7px; border-top: 1px solid #eceee9; font-size: 10px; }
.clarification-card { margin-top: 9px; padding: 12px; border: 1px solid #edc3aa; border-radius: 10px; background: #fff5ee; }
.clarification-card h3 { margin: 0 0 4px; font-size: 11px; }
.clarification-card p, .clarification-card small { color: #805037; font-size: 9px; }
.clarification-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.clarification-grid label { color: var(--muted); font-size: 9px; }
.clarification-grid input, .clarification-grid select { width: 100%; margin-top: 4px; padding: 7px; border: 1px solid #dfba9f; border-radius: 7px; background: white; }
.clarification-card button { margin-top: 9px; padding: 7px 10px; border: 0; border-radius: 7px; color: white; background: var(--orange); font-size: 9px; }

.result-summary { margin: 3px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.result-surface { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 3px 14px rgba(21,34,27,.04); }
.result-titlebar { min-height: 52px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.result-titlebar > div:first-child { display: flex; align-items: baseline; gap: 9px; }
.result-titlebar h2 { font-size: 15px; }
.result-titlebar > div > span { color: var(--muted); font-size: 9px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 8px; }
.legend span::before { content: ""; width: 6px; height: 6px; margin-right: 4px; display: inline-block; border-radius: 50%; background: currentColor; }
.legend .covered { color: #55a77e; }
.legend .uncovered { color: var(--red); }
.legend .facility { color: var(--blue); }
.legend .candidate { color: var(--orange); }
.map-result-grid { min-height: 466px; display: grid; grid-template-columns: minmax(0, 1fr) 250px; }
#map { min-width: 0; min-height: 466px; overflow: hidden; background: #eef1eb; }
.map-stage-real { width: 100%; height: 390px; }
#map svg { display: block; width: 100%; height: 480px; }
.candidate-pane { min-width: 0; max-height: 466px; overflow-y: auto; border-left: 1px solid var(--line); }
.candidate-pane > header { height: 48px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.candidate-pane header strong { font-size: 11px; }
.candidate-pane header small { color: var(--muted); font-size: 8px; }
.candidate-card { width: 100%; padding: 11px 12px; display: block; border: 0; border-bottom: 1px solid #eceeea; border-radius: 0; color: inherit; background: white; text-align: left; }
.candidate-card:hover, .candidate-card.is-selected { background: #f3f7f4; }
.candidate-card.is-selected { box-shadow: inset 3px 0 0 var(--orange); }
.candidate-rank { width: 20px; height: 20px; margin-right: 6px; display: inline-grid; place-items: center; border-radius: 50%; color: white; background: var(--orange); font-size: 8px; }
.candidate-card strong { font-size: 10px; }
.candidate-card p { margin: 7px 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.candidate-empty { padding: 16px 12px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.candidate-stats { display: flex; flex-wrap: wrap; gap: 4px; }
.candidate-stats span { padding: 3px 5px; border-radius: 4px; color: #885035; background: #fff0e7; font-size: 7px; }
.metric-grid { min-height: 74px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.metric-card { padding: 12px 15px; border-right: 1px solid var(--line); }
.metric-card:last-child { border-right: 0; }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card > span { color: var(--muted); font-size: 8px; }
.metric-card strong { margin: 3px 0; font-size: 18px; }
.metric-card small { color: var(--green); font-size: 7px; }
.result-disclosure { margin-top: 9px; }
.inline-action { margin-left: auto; border: 0; color: var(--green); background: transparent; font-size: 9px; }
.report { padding: 0 14px 14px; }
.report-summary { margin: 2px 0 12px; padding-left: 11px; border-left: 2px solid var(--orange); font-size: 12px; line-height: 1.7; }
.report h4 { margin: 12px 0 6px; font-size: 10px; }
.report ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 9px; line-height: 1.7; }
#trace { padding: 0 14px 14px; }
.trace-item { padding: 8px 0; display: grid; grid-template-columns: 8px minmax(0,1fr) auto; gap: 8px; border-bottom: 1px solid #eceeea; }
.trace-dot { width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: #49a675; }
.trace-item strong, .trace-item small { display: block; }
.trace-item strong { font: 700 9px Consolas, monospace; }
.trace-item small, .trace-time { color: var(--muted); font-size: 7px; }
.validation-block { margin-top: 8px; }
.check { padding: 6px 0; display: flex; justify-content: space-between; gap: 12px; font-size: 9px; }
.check small { color: var(--muted); }
.check b { color: var(--green); }
.map-provider-toolbar { min-height: 42px; padding: 7px 9px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); }
.map-provider-toolbar label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8px; }
.map-provider-toolbar select { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; background: white; font-size: 9px; }
.map-mode-switch { display: flex; padding: 2px; border-radius: 7px; background: #edf0eb; }
.map-mode-switch button { padding: 5px 8px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 8px; }
.map-mode-switch button.is-active { color: white; background: var(--green); }
.provider-badge { margin-left: auto; padding: 4px 7px; border-radius: 99px; color: var(--green); background: var(--green-soft); font-size: 8px; }
.map-scenario-detail { min-height: 34px; padding: 8px 11px; border-top: 1px solid var(--line); color: var(--muted); background: white; font-size: 8px; }
.map-api-notice { margin: 10px; padding: 9px; border: 1px solid #ecc5ad; border-radius: 8px; color: #805038; background: #fff4ed; font-size: 9px; }
.map-unavailable { min-height: 500px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-align: center; }
.map-unavailable .ph { color: var(--green); font-size: 34px; }
.map-unavailable strong { color: var(--ink); font-size: 12px; }
.map-unavailable span { font-size: 9px; }
.amap-pin { width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid white; color: white; box-shadow: 0 3px 10px rgba(18,42,31,.22); font-weight: 700; }
.amap-pin-facility { border-radius: 7px; background: var(--blue); font-size: 16px; }
.amap-pin-candidate { border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--orange); }
.amap-pin-candidate span { transform: rotate(45deg); }
.amap-pin-candidate.is-selected { width: 32px; height: 32px; background: #6d3b8f; box-shadow: 0 0 0 4px rgba(109,59,143,.16); }
.amap-pin-candidate.is-muted { opacity: .62; }
.amap-info { min-width: 170px; padding: 3px; }
.amap-info strong, .amap-info span { display: block; }
.amap-info strong { margin-bottom: 6px; }
.amap-info span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.conversation-bottom-space { height: 40px; }

.composer-dock { position: relative; z-index: 12; padding: 4px 24px 10px; background: var(--canvas); }
.followup-examples { width: min(900px, 100%); margin: 0 auto 7px; display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; }
.followup-examples button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: white; font-size: 8px; }
.followup-examples button:hover { color: var(--green); border-color: #a4c0b3; }
.composer {
  position: relative;
  width: min(940px, 100%);
  min-height: 94px;
  margin: 0 auto;
  padding: 12px 13px 9px;
  border: 1px solid #d5d7d2;
  border-radius: 16px;
  background: white;
  box-shadow: 0 5px 24px rgba(21,34,27,.1);
}
.composer textarea { width: 100%; max-height: 150px; min-height: 30px; padding: 2px 2px 8px; overflow-y: auto; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; line-height: 1.55; }
.composer textarea::placeholder { color: #8a938e; }
.composer-toolbar { min-height: 34px; padding-right: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-toolbar > div { display: flex; align-items: center; gap: 9px; }
.composer-tool { min-height: 30px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; font-size: 9px; }
.composer-tool:hover { color: var(--green); border-color: #aac2b7; }
.composer-model { display: none; }
.send-button { position: absolute; right: 12px; bottom: 10px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; color: white; background: var(--green); font-size: 17px; }
.send-button:hover { background: #09553e; }
.send-button:disabled { opacity: .5; cursor: wait; }
.send-button:disabled .ph-circle-notch, .approve-button:disabled .ph-circle-notch { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.composer-note { margin: 6px 0 0; color: #89908c; text-align: center; font-size: 8px; }
.error-box { width: min(940px,100%); margin: 6px auto 0; padding: 8px 10px; border-radius: 8px; color: var(--red); background: #faeaea; font-size: 9px; }

.context-dialog { width: min(520px, calc(100% - 28px)); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow); }
.context-dialog::backdrop { background: rgba(10,20,15,.32); backdrop-filter: blur(2px); }
.dialog-shell { padding: 20px; display: grid; gap: 13px; }
.dialog-shell header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-shell h2 { margin: 0; font-size: 17px; }
.dialog-shell header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.dialog-shell > label, .settings-grid label, .upload-fields label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.dialog-shell select, .dialog-shell input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font-size: 11px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 11px; border-radius: 10px; background: var(--surface-soft); }
.upload-fields { display: grid; gap: 9px; padding: 11px; border-radius: 10px; background: var(--surface-soft); }
.source-status { margin: 0; color: var(--green); font-size: 9px; line-height: 1.55; }
.dialog-confirm { min-height: 40px; border: 0; border-radius: 9px; color: white; background: var(--green); font-size: 11px; font-weight: 650; }
.tool-dialog-content { display: grid; gap: 7px; }
.tool-capability { padding: 10px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--line); border-radius: 9px; }
.tool-capability .ph { color: var(--green); font-size: 18px; }
.tool-capability strong, .tool-capability small { display: block; }
.tool-capability strong { font-size: 10px; }
.tool-capability small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }

@media (max-width: 980px) {
  .chat-app { grid-template-columns: 244px minmax(0,1fr); }
  body.results-visible .workspace-body { grid-template-columns: minmax(350px, .72fr) minmax(520px, 1.28fr); }
  .map-result-grid { grid-template-columns: minmax(0,1fr) 210px; }
  .assistant-turn { width: calc(100% - 32px); }
}

@media (max-width: 760px) {
  html, body, .chat-app { width: 100%; max-width: 100%; overflow-x: hidden; }
  .chat-app { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 284px; transform: translateX(-100%); transition: transform .22s ease; }
  body.sidebar-visible .sidebar { transform: translateX(0); }
  .sidebar-close, .sidebar-open { display: grid; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; display: block; visibility: hidden; opacity: 0; border: 0; background: rgba(7,18,13,.38); transition: opacity .2s; }
  body.sidebar-visible .sidebar-scrim { visibility: visible; opacity: 1; }
  .chat-main { width: 100vw; max-width: 100vw; height: 100dvh; overflow: hidden; }
  .workspace-body, body.results-visible .workspace-body { display: grid; grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .dialogue-column { min-height: calc(100dvh - 58px); }
  .results-dock { min-height: 78vh; border-top: 1px solid var(--line); border-left: 0; }
  .results-dock:not(.hidden) { display: grid; }
  .chat-header { padding: 0 12px; }
  .chat-title span, .connection-status { display: none; }
  .conversation-scroll { padding-bottom: 128px; }
  .welcome-state { width: 100%; min-height: calc(100dvh - 186px); padding-inline: 16px; overflow: hidden; }
  .welcome-state > p { width: 330px; max-width: calc(100vw - 32px); white-space: normal; overflow-wrap: anywhere; }
  .prompt-suggestions { width: calc(100vw - 32px); max-width: calc(100vw - 32px); min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .prompt-suggestions button { width: 100%; max-width: calc(100vw - 32px); min-width: 0; }
  .assistant-turn, .conversation-thread { width: calc(100% - 24px); }
  .map-result-grid { display: block; }
  .candidate-pane { max-height: 260px; border-top: 1px solid var(--line); border-left: 0; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card:nth-child(2) { border-right: 0; }
  .metric-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .workflow-lanes { grid-template-columns: 1fr; }
  .composer-dock {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    min-width: 0;
    padding: 4px 10px max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(222, 223, 217, .75);
  }
  .composer { width: calc(100vw - 20px); max-width: calc(100vw - 20px); min-width: 0; }
  .send-button { position: absolute; right: 12px; bottom: 10px; }
}

@media (max-width: 480px) {
  .assistant-turn { grid-template-columns: 30px minmax(0,1fr); gap: 9px; }
  .turn-avatar { width: 30px; height: 30px; font-size: 14px; border-radius: 8px; }
  .turn-author { height: 30px; }
  .plan-heading { display: block; }
  .data-summary { margin-top: 8px; justify-content: flex-start; }
  .result-titlebar { align-items: flex-start; padding-block: 11px; }
  .legend { display: none; }
  .map-result-grid, #map { min-height: 436px; }
  .map-stage-real { height: 360px; }
  .composer-model { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
}
