:root {
  --ink: #0b1f3a;
  --ink-2: #172f4f;
  --text: #26384f;
  --muted: #6a788a;
  --line: #dce4ea;
  --paper: #f4f7f8;
  --white: #fff;
  --blue: #1764df;
  --blue-soft: #edf2ff;
  --teal: #078f87;
  --teal-soft: #e9f6f4;
  --orange: #e58b14;
  --orange-soft: #fff3df;
  --red: #b94a50;
  --red-soft: #fff0f0;
  --green: #27784f;
  --green-soft: #eaf6ef;
  --shadow: 0 18px 48px rgba(11, 31, 58, .10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: #eef2f4;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  line-height: 1.55;
  letter-spacing: 0;
}

button,
input,
select { font: inherit; }

button { color: inherit; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workbench {
  width: min(1320px, calc(100% - 32px));
  margin: 16px auto;
  border: 1px solid #ced9e1;
  background: var(--white);
  box-shadow: var(--shadow);
}

.workbench-header {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 30px 36px;
  color: var(--ink);
  background: #f1f7ff;
}

.product-tag,
.section-no {
  display: block;
  color: #1764df;
  font-size: 13px;
  font-weight: 900;
}

.workbench-header h1 {
  margin: 6px 0 2px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.24;
}

.workbench-header p {
  margin: 0;
  color: #516171;
  font-size: 14px;
}

.demo-disclosure {
  min-width: 220px;
  display: grid;
  grid-template-columns: 10px 1fr;
  column-gap: 10px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid #cadcf4;
  background: #ffffff;
}

.demo-disclosure i,
.subhead small i {
  width: 8px;
  height: 8px;
  display: block;
  background: #6fd3ca;
  border-radius: 50%;
}

.demo-disclosure span { font-size: 13px; font-weight: 850; }
.demo-disclosure small { grid-column: 2; color: #64758b; font-size: 12px; }

.agent-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.agent-tabs button {
  min-height: 82px;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-content: center;
  padding: 14px 24px;
  border: 0;
  border-right: 1px solid var(--line);
  color: #5e6c7d;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.agent-tabs button:last-child { border-right: 0; }
.agent-tabs button:hover { background: #f9fbfc; }
.agent-tabs button.active { color: var(--ink); background: var(--white); box-shadow: inset 0 -4px 0 var(--teal); }
.agent-tabs button > span { grid-row: 1 / 3; align-self: center; color: var(--teal); font-size: 12px; font-weight: 900; }
.agent-tabs strong { font-size: 17px; }
.agent-tabs small { color: var(--muted); font-size: 11px; }

.agent-panel { display: none; padding: 34px; }
.agent-panel.active { display: block; }

.panel-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
  gap: 40px;
  align-items: end;
  margin-bottom: 28px;
}

.panel-intro .section-no { color: var(--teal); }
.panel-intro h2 { max-width: 720px; margin: 5px 0 0; color: var(--ink); font-size: clamp(25px, 3vw, 36px); line-height: 1.28; }
.panel-intro > p { margin: 0 0 4px; color: var(--muted); font-size: 13px; }

.operation-grid {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  min-height: 720px;
  border: 1px solid var(--line);
  background: var(--white);
}

.source-column {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.run-column { padding: 24px; min-width: 0; }

.column-title {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.column-title > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--white);
  background: var(--ink);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
}

.column-title > div { display: grid; }
.column-title strong { color: var(--ink); font-size: 15px; }
.column-title small { color: var(--muted); font-size: 10px; }

.source-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.source-options button {
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  color: #526174;
  background: var(--white);
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
}

.source-options button:hover { border-color: #aab8c5; }
.source-options button.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.source-options strong,
.source-options small { display: block; }
.source-options strong { font-size: 12px; }
.source-options small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.source-preview {
  height: 500px;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--white);
}

.preview-bar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  background: #f9fbfc;
}

.preview-bar strong { color: var(--ink); font-size: 11px; }
.preview-bar span { color: var(--muted); font-size: 9px; }

.email-preview { padding: 14px; }
.email-meta { display: grid; grid-template-columns: 50px 1fr; gap: 5px 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 10px; }
.email-meta span { color: var(--muted); }
.email-meta strong { color: var(--text); overflow-wrap: anywhere; }
.email-body { margin: 14px 0 0; color: #46576a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; line-height: 1.75; white-space: pre-wrap; }
.attachment { margin-top: 13px; padding: 10px; border-left: 3px solid var(--teal); background: var(--teal-soft); color: #3d5d5a; font-size: 10px; }

.image-document { min-width: 580px; margin: 14px; padding: 18px 14px; border: 1px solid #cfd5d9; background: #fffdf8; box-shadow: 0 8px 20px rgba(32, 45, 55, .08); }
.image-document h4 { margin: 0 0 4px; color: var(--ink); font-size: 14px; text-align: center; }
.image-document > p { margin: 0 0 14px; color: var(--muted); font-size: 9px; text-align: center; }
.sheet-label { margin-top: 10px; padding: 5px 7px; color: #5d3a0e; background: #f5c88c; font-size: 9px; font-weight: 900; }
.mini-rate-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 8px; }
.mini-rate-table th,
.mini-rate-table td { padding: 5px 3px; border: 1px solid #cfd5d9; text-align: center; overflow-wrap: anywhere; }
.mini-rate-table th { background: #eef2f3; }
.schedule-table th { background: #f9e2c3; }
.complex-rate-table th:nth-child(1) { width: 18%; }
.complex-rate-table th:nth-child(4) { width: 12%; }
.complex-rate-table th:nth-child(5) { width: 16%; }
.complex-rate-table th:nth-child(6) { width: 25%; }
.complex-rate-table tr:nth-child(4) td,
.complex-rate-table tr:nth-child(5) td { background: #fff2d9; }
.image-note { margin: 12px 0 0; color: #5e6976; font-size: 9px; }

.excel-preview { overflow: auto; padding: 13px; }
.excel-sheet { min-width: 1060px; border-collapse: collapse; font-size: 9px; }
.excel-sheet th,
.excel-sheet td { padding: 7px 8px; border: 1px solid #d8e0e5; text-align: left; white-space: nowrap; }
.excel-sheet th { color: var(--white); background: #397568; }
.excel-sheet tr:nth-child(even) td { background: #f5faf8; }

.primary-action {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--blue);
  color: var(--white);
  background: var(--blue);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 850;
}

.primary-action:hover { background: #1848c1; }
.primary-action:disabled { border-color: #9aabc0; background: #9aabc0; cursor: wait; }
.text-action { width: 100%; margin-top: 8px; padding: 6px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; }
.text-action:hover { color: var(--ink); }

.agent-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  margin: 0 0 18px;
  padding: 0;
  overflow-x: auto;
  list-style: none;
}

.agent-steps li {
  position: relative;
  min-width: 94px;
  min-height: 108px;
  padding: 0 9px 10px 0;
}

.agent-steps li::before {
  content: "";
  position: absolute;
  left: 11px;
  right: -1px;
  top: 10px;
  height: 2px;
  background: #d7e0e6;
}

.agent-steps li:last-child::before { right: 70%; }

.agent-steps i {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 2px solid #c7d2dc;
  background: var(--white);
  border-radius: 50%;
}

.agent-steps strong { display: block; color: #526174; font-size: 10px; }
.agent-steps small { display: block; margin-top: 3px; color: #8a97a5; font-size: 8px; line-height: 1.45; }
.agent-steps em { display: block; margin-top: 7px; color: #99a5b1; font-size: 8px; font-style: normal; font-weight: 850; }

.agent-steps li.running i { border-color: var(--blue); box-shadow: 0 0 0 5px rgba(36, 87, 214, .11); animation: pulse 1s infinite; }
.agent-steps li.running::before { background: linear-gradient(90deg, var(--blue) 0 48%, #d7e0e6 48% 100%); }
.agent-steps li.running strong,
.agent-steps li.running em { color: var(--blue); }
.agent-steps li.done i { border-color: var(--teal); background: var(--teal); }
.agent-steps li.done i::after { content: "✓"; color: var(--white); font-size: 10px; font-style: normal; font-weight: 900; }
.agent-steps li.done::before { background: var(--teal); }
.agent-steps li.done strong { color: var(--ink); }
.agent-steps li.done em { color: var(--green); }
.agent-steps li.warn i { border-color: var(--orange); background: var(--orange-soft); }
.agent-steps li.warn i::after { content: "!"; color: var(--orange); font-size: 11px; font-style: normal; font-weight: 900; }
.agent-steps li.warn strong,
.agent-steps li.warn em { color: #a76208; }

@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(36, 87, 214, .05); } }

.run-output {
  min-height: 470px;
  border: 1px solid var(--line);
  background: #fbfcfd;
}

.output-empty {
  min-height: 468px;
  display: grid;
  place-content: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.output-empty span { color: var(--ink); font-size: 17px; font-weight: 850; }
.output-empty p { max-width: 360px; margin: 6px 0 0; font-size: 11px; }

.parse-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.parse-summary > div { padding: 14px; border-right: 1px solid var(--line); }
.parse-summary > div:last-child { border-right: 0; }
.parse-summary strong { display: block; color: var(--ink); font-size: 18px; }
.parse-summary span { color: var(--muted); font-size: 9px; }

.structured-table { width: 1260px; min-width: 1260px; border-collapse: collapse; table-layout: auto; font-size: 9px; }
.structured-table th,
.structured-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.structured-table th { color: #637286; background: #f3f6f8; font-size: 8px; }
.structured-table td { color: #33475e; }
.structured-table tr.flagged td { background: #fffaf0; }
.confidence { display: inline-flex; align-items: center; gap: 4px; color: var(--green); font-weight: 850; }
.confidence.low { color: #ad680b; }

.review-box { margin: 15px; border: 1px solid #efc27b; background: var(--orange-soft); }
.review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px; border-bottom: 1px solid #efcf9a; }
.review-head strong { color: #704506; font-size: 13px; }
.review-head p { margin: 3px 0 0; color: #8a641f; font-size: 10px; }
.review-head span { padding: 3px 7px; color: #8d5505; background: #ffe3af; font-size: 8px; font-weight: 900; }
.review-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 13px; gap: 8px; }
.review-compare div { min-height: 64px; padding: 9px; background: rgba(255, 255, 255, .65); }
.review-compare span { display: block; color: #8a6f42; font-size: 8px; }
.review-compare strong { display: block; margin-top: 6px; color: #513b16; font-size: 12px; overflow-wrap: anywhere; }
.review-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 13px 13px; }
.review-actions select { min-height: 36px; max-width: 260px; border: 1px solid #d6b371; background: var(--white); color: #513b16; font-size: 10px; }
.review-actions button { min-height: 36px; padding: 7px 13px; border: 1px solid var(--ink); color: var(--white); background: var(--ink); border-radius: 4px; cursor: pointer; font-size: 10px; font-weight: 850; }
.review-box.approved { border-color: #99cfb1; background: var(--green-soft); }
.review-box.approved .review-head { border-bottom-color: #b9ddc8; }
.review-box.approved .review-head strong { color: #205f40; }
.review-box.approved .review-head p { color: #46745c; }
.review-box.approved .review-head span { color: var(--green); background: #d3ecde; }
.review-box.approved .review-compare span { color: #5d7c6b; }
.review-box.approved .review-compare strong { color: #284f3b; }
.review-audit { background: rgba(255, 255, 255, .46); border-top: 1px solid #b9ddc8; }

.result-zone { margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--line); }
.result-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 16px; }
.result-head .section-no { color: var(--teal); }
.result-head h3 { margin: 5px 0 0; color: var(--ink); font-size: 24px; }
.result-metrics { display: flex; align-items: stretch; border: 1px solid var(--line); }
.result-metrics span { min-width: 96px; padding: 8px 12px; border-right: 1px solid var(--line); color: var(--muted); font-size: 8px; text-align: center; }
.result-metrics span:last-child { border-right: 0; }
.result-metrics strong { display: block; color: var(--ink); font-size: 13px; }

.result-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); min-height: 440px; border: 1px solid var(--line); }
.database-panel { min-width: 0; border-right: 1px solid var(--line); }
.chat-panel { min-width: 0; display: grid; grid-template-rows: auto minmax(200px, 1fr) auto auto; }
.subhead { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f8fafb; }
.subhead strong { color: var(--ink); font-size: 12px; }
.subhead small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }

.table-wrap { overflow: auto; }
.table-wrap table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 9px; }
.database-panel .table-wrap table { min-width: 1180px; }
.table-wrap th,
.table-wrap td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.table-wrap th { color: #637286; background: #f3f6f8; }
.table-wrap tr.new-record td { background: var(--teal-soft); }
.status-pill { display: inline-block; padding: 3px 6px; color: var(--green); background: var(--green-soft); border-radius: 3px; font-size: 8px; font-weight: 850; }

.chat-log { min-height: 250px; max-height: 330px; overflow-y: auto; padding: 14px; background: #fbfcfd; }
.message { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: start; margin-bottom: 12px; }
.message span { padding-top: 5px; color: var(--muted); font-size: 8px; font-weight: 850; }
.message p { margin: 0; padding: 9px 10px; color: #40536a; background: var(--white); border: 1px solid var(--line); border-radius: 5px; font-size: 10px; white-space: pre-line; }
.message.user p { color: var(--white); background: var(--blue); border-color: var(--blue); }

.quick-prompts { display: flex; flex-wrap: wrap; gap: 5px; padding: 9px 12px; border-top: 1px solid var(--line); background: var(--white); }
.quick-prompts button { min-height: 28px; padding: 5px 8px; border: 1px solid #bfcbd5; color: #53657a; background: var(--white); border-radius: 4px; cursor: pointer; font-size: 8px; }
.quick-prompts button:hover { border-color: var(--blue); color: var(--blue); }

.chat-form { display: grid; grid-template-columns: 1fr 58px; gap: 7px; padding: 10px 12px; border-top: 1px solid var(--line); }
.chat-form input { min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid #bfcbd5; border-radius: 4px; color: var(--text); font-size: 10px; }
.chat-form input:focus { outline: 2px solid rgba(36, 87, 214, .18); border-color: var(--blue); }
.chat-form button { border: 1px solid var(--blue); color: var(--white); background: var(--blue); border-radius: 4px; cursor: pointer; font-size: 10px; font-weight: 850; }

.booking-compare { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 10px; }
.booking-compare th,
.booking-compare td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.booking-compare th { color: var(--muted); background: #f3f6f8; font-size: 8px; }
.booking-compare tr.conflict td { background: #fffaf0; }
.field-ok { color: var(--green); font-weight: 850; }
.field-warn { color: #a76208; font-weight: 850; }

.booking-draft { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.draft-field { min-height: 78px; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.draft-field:nth-child(2n) { border-right: 0; }
.draft-field span { display: block; color: var(--muted); font-size: 8px; }
.draft-field strong { display: block; margin-top: 5px; color: var(--ink); font-size: 11px; overflow-wrap: anywhere; }
.audit-line { grid-column: 1 / -1; padding: 14px; color: #41645f; background: var(--teal-soft); font-size: 9px; }

.insight-workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 650px;
  border: 1px solid var(--line);
}

.permission-column {
  padding: 24px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.role-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.role-switcher button {
  min-height: 42px;
  border: 1px solid var(--line);
  color: #526174;
  background: var(--white);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.role-switcher button.active {
  border-color: var(--ink);
  color: var(--white);
  background: var(--ink);
}

.permission-summary {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  background: var(--blue-soft);
}

.permission-summary span,
.permission-summary strong,
.permission-summary small { display: block; }
.permission-summary span { color: var(--muted); font-size: 8px; font-weight: 850; }
.permission-summary strong { margin-top: 4px; color: var(--ink); font-size: 15px; }
.permission-summary small { margin-top: 5px; color: #617084; font-size: 9px; }

.permission-details,
.reasoning-details,
.dashboard-details,
.answer-details { margin-top: 12px; }

.permission-details > summary,
.reasoning-details > summary,
.dashboard-details > summary,
.answer-details > summary {
  padding: 10px 12px;
  border: 1px solid var(--line);
  color: #405169;
  background: var(--white);
  cursor: pointer;
  font-size: 9px;
  font-weight: 850;
}

.permission-details[open] > summary,
.reasoning-details[open] > summary,
.dashboard-details[open] > summary,
.answer-details[open] > summary { color: var(--blue); border-color: #a9bce9; background: var(--blue-soft); }

.permission-card {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: var(--white);
}

.permission-card-head {
  padding: 15px;
  border-bottom: 1px solid var(--line);
  background: var(--blue-soft);
}

.permission-card-head span,
.permission-row span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
}

.permission-card-head strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
}

.permission-row {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}

.permission-row:last-child { border-bottom: 0; }
.permission-row strong { display: block; margin-top: 4px; color: #3d5067; font-size: 10px; line-height: 1.55; }
.permission-row.denied strong { color: #a04d52; }

.action-permission-card {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--white);
}

.action-permission-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.action-permission-head strong { color: var(--ink); font-size: 10px; }
.action-permission-head span { color: var(--muted); font-size: 8px; }
.action-permission-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }

.permission-action {
  min-width: 0;
  padding: 9px 3px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.permission-action:last-child { border-right: 0; }
.permission-action span,
.permission-action strong { display: block; }
.permission-action span { color: var(--muted); font-size: 7px; }
.permission-action strong { margin-top: 3px; font-size: 8px; }
.permission-action.allow strong { color: var(--green); }
.permission-action.review strong { color: #a76208; }
.permission-action.deny strong { color: var(--red); }

.permission-note {
  margin-top: 12px;
  padding: 14px;
  color: #405169;
  background: var(--teal-soft);
  border-left: 3px solid var(--teal);
}

.permission-note strong { display: block; color: var(--ink); font-size: 11px; }
.permission-note p { margin: 5px 0 0; font-size: 9px; }

.insight-main { min-width: 0; padding: 24px; }

.insight-context {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr 1fr;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: #f9fbfc;
}

.insight-context > div {
  min-width: 0;
  padding: 11px 13px;
  border-right: 1px solid var(--line);
}

.insight-context > div:last-child { border-right: 0; }
.insight-context span,
.insight-context strong,
.insight-context small { display: block; }
.insight-context span { color: var(--muted); font-size: 7px; font-weight: 850; }
.insight-context strong { margin-top: 3px; color: var(--ink); font-size: 11px; overflow-wrap: anywhere; }
.insight-context small { margin-top: 3px; color: #738195; font-size: 7px; line-height: 1.4; }
.insight-context .context-health { color: #a76208; }

.insight-view-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.insight-view-switcher button {
  min-height: 58px;
  padding: 9px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  color: #53657a;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.insight-view-switcher button:last-child { border-right: 0; }
.insight-view-switcher span,
.insight-view-switcher small { display: block; }
.insight-view-switcher span { font-size: 10px; font-weight: 900; }
.insight-view-switcher small { margin-top: 2px; color: #8490a0; font-size: 7px; }
.insight-view-switcher button:hover { background: var(--white); }
.insight-view-switcher button.active { color: var(--ink); background: var(--white); box-shadow: inset 0 -3px 0 var(--teal); }

.insight-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(350px, .82fr); gap: 14px; }

.insight-dashboard {
  min-width: 0;
  min-height: 440px;
  align-self: start;
  border: 1px solid var(--line);
  background: var(--white);
}

.order-overview { padding: 17px; }

.order-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.order-overview-head span { color: var(--teal); font-size: 8px; font-weight: 900; }
.order-overview-head h3 { margin: 4px 0 2px; color: var(--ink); font-size: 19px; line-height: 1.3; }
.order-overview-head p { margin: 0; color: var(--muted); font-size: 9px; }
.order-overview-head b { flex: 0 0 auto; padding: 5px 9px; color: #995a07; background: var(--orange-soft); border: 1px solid #f0c47e; border-radius: 999px; font-size: 8px; }

.order-priority { display: grid; grid-template-columns: .82fr 1.18fr; margin-top: 12px; border: 1px solid #efd49f; background: #fffaf0; }
.order-priority > div { padding: 11px 12px; border-right: 1px solid #efd49f; }
.order-priority > div:last-child { border-right: 0; }
.order-priority span,
.order-priority strong,
.order-priority small { display: block; }
.order-priority span { color: #95610e; font-size: 7px; font-weight: 900; }
.order-priority strong { margin-top: 3px; color: var(--ink); font-size: 10px; line-height: 1.45; }
.order-priority small { margin-top: 4px; color: #755f3e; font-size: 7px; }

.order-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; border: 1px solid var(--line); }
.order-fact { min-height: 58px; padding: 10px 11px; border-right: 1px solid var(--line); }
.order-fact:last-child { border-right: 0; }
.order-fact span,
.order-fact strong { display: block; }
.order-fact span { color: var(--muted); font-size: 7px; }
.order-fact strong { margin-top: 4px; color: #334a66; font-size: 10px; }

.dashboard-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 10px;
}

.dashboard-section-head strong { color: var(--ink); font-size: 11px; }
.dashboard-section-head span { color: var(--muted); font-size: 7px; text-align: right; }

.dashboard-details > summary { display: flex; align-items: center; justify-content: space-between; }
.dashboard-details > summary span { color: var(--muted); font-size: 7px; font-weight: 700; }
.deep-timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.deep-timeline li { position: relative; min-height: 95px; padding: 10px; border: 1px solid var(--line); background: #f8fafb; }
.deep-timeline li i { width: 8px; height: 8px; display: block; margin-bottom: 7px; border: 2px solid #aeb9c3; background: var(--white); border-radius: 50%; }
.deep-timeline strong,
.deep-timeline span,
.deep-timeline small { display: block; }
.deep-timeline strong { color: #43556b; font-size: 8px; }
.deep-timeline span { margin-top: 3px; color: var(--muted); font-size: 7px; }
.deep-timeline small { margin-top: 5px; color: #8490a0; font-size: 7px; line-height: 1.45; }
.deep-timeline li.done { background: var(--green-soft); border-color: #badbc7; }
.deep-timeline li.done i { border-color: var(--teal); background: var(--teal); }
.deep-timeline li.current { background: var(--blue-soft); border-color: #96ade8; box-shadow: inset 0 0 0 1px #c3d0f2; }
.deep-timeline li.current i { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36, 87, 214, .10); }
.deep-timeline li.current strong { color: var(--blue); }

.dashboard-view { padding: 16px; }
.insight-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.insight-kpis article { min-height: 84px; padding: 12px; border-right: 1px solid var(--line); }
.insight-kpis article:last-child { border-right: 0; }
.insight-kpis span,
.insight-kpis strong,
.insight-kpis small { display: block; }
.insight-kpis span { color: var(--muted); font-size: 7px; }
.insight-kpis strong { margin-top: 4px; color: var(--ink); font-size: 17px; }
.insight-kpis small { margin-top: 4px; color: #66758a; font-size: 7px; }

.insight-table-wrap { overflow: auto; border: 1px solid var(--line); }
.insight-table { width: 100%; min-width: 660px; border-collapse: collapse; table-layout: auto; font-size: 8px; }
.insight-table th,
.insight-table td { padding: 10px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.insight-table th { color: var(--muted); background: #f2f5f7; font-size: 7px; white-space: nowrap; }
.insight-table tbody tr:last-child td { border-bottom: 0; }
.insight-table td { color: #506176; }
.insight-table td strong { color: var(--ink); }
.priority-pill { display: inline-flex; min-width: 26px; justify-content: center; padding: 3px 6px; border-radius: 999px; font-size: 7px; font-weight: 900; }
.priority-pill.high { color: var(--red); background: var(--red-soft); }
.priority-pill.medium { color: #9a610d; background: var(--orange-soft); }

.drill-path { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.drill-path span { padding: 5px 8px; color: #35536f; background: var(--blue-soft); white-space: nowrap; font-size: 7px; font-weight: 850; }
.drill-path i { color: #8b9aaa; font-size: 8px; font-style: normal; }
.business-table { min-width: 720px; }

.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.evidence-card { min-height: 112px; padding: 12px; border: 1px solid var(--line); border-top: 3px solid var(--teal); background: #fbfdfd; }
.evidence-card span,
.evidence-card strong,
.evidence-card small,
.evidence-card em { display: block; }
.evidence-card span { color: var(--teal); font-size: 7px; font-weight: 900; }
.evidence-card strong { margin-top: 5px; color: var(--ink); font-size: 10px; }
.evidence-card small { margin-top: 6px; color: var(--muted); font-size: 7px; }
.evidence-card em { margin-top: 10px; color: var(--green); font-size: 7px; font-style: normal; font-weight: 850; }
.evidence-card.restricted { border-top-color: #c9a5a8; background: #fbf7f7; }
.evidence-card.restricted span,
.evidence-card.restricted em { color: var(--red); }
.audit-head { margin-top: 20px; }
.audit-timeline { margin: 0; padding: 0; border: 1px solid var(--line); list-style: none; }
.audit-timeline li { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.audit-timeline li:last-child { border-bottom: 0; }
.audit-timeline time { color: var(--teal); font-size: 8px; font-weight: 900; }
.audit-timeline strong,
.audit-timeline small { display: block; }
.audit-timeline strong { color: #405169; font-size: 8px; }
.audit-timeline small { margin-top: 3px; color: var(--muted); font-size: 7px; }

.insight-chat {
  min-height: 440px;
  border: 1px solid var(--line);
}

.insight-chat .chat-log { max-height: 315px; }
.compact-intro p { max-width: 92%; }
.message.rich { width: 100%; }
.message.rich > span { display: block; }
.agent-answer { margin-top: 4px; padding: 12px; border: 1px solid var(--line); border-left: 3px solid var(--teal); background: var(--white); }
.agent-answer.warning { border-left-color: var(--orange); }
.agent-answer.denied { border-left-color: var(--red); background: #fffafa; }
.answer-head span,
.answer-head strong { display: block; }
.answer-head span { color: var(--teal); font-size: 7px; font-weight: 900; }
.agent-answer.warning .answer-head span { color: #a76208; }
.agent-answer.denied .answer-head span { color: var(--red); }
.answer-head strong { margin-top: 4px; color: var(--ink); font-size: 12px; line-height: 1.4; }
.agent-answer > p { margin: 8px 0 0 !important; padding: 0 !important; border: 0 !important; color: #53657a !important; background: transparent !important; font-size: 8px !important; line-height: 1.6; }
.answer-outcome { display: grid; grid-template-columns: .8fr 1.2fr; gap: 8px; margin-top: 10px; }
.answer-outcome .answer-risk,
.answer-outcome .answer-next { margin: 0; padding: 9px; border: 1px solid var(--line); background: #f8fafb; }
.answer-details { margin-top: 8px; }
.answer-details > summary { padding: 8px 9px; font-size: 7px; }
.answer-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; border: 1px solid var(--line); }
.answer-facts > div { padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.answer-facts > div:nth-child(2n) { border-right: 0; }
.answer-facts > div:nth-last-child(-n + 2) { border-bottom: 0; }
.answer-facts span,
.answer-facts strong { display: block; }
.answer-facts span { color: var(--muted); font-size: 6px; }
.answer-facts strong { margin-top: 3px; color: #334a66; font-size: 8px; overflow-wrap: anywhere; }
.answer-evidence { margin-top: 9px; padding: 9px; background: #f4f7f8; }
.answer-evidence > strong { color: var(--ink); font-size: 7px; }
.answer-evidence ul { margin: 5px 0 0; padding-left: 14px; color: #637286; font-size: 7px; line-height: 1.55; }
.answer-risk,
.answer-next { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.answer-risk span,
.answer-risk strong,
.answer-next > span,
.answer-next > strong { display: block; }
.answer-risk span,
.answer-next > span { color: var(--muted); font-size: 6px; font-weight: 850; }
.answer-risk strong,
.answer-next > strong { margin-top: 3px; color: #43566c; font-size: 8px; line-height: 1.5; }
.answer-next button { margin-top: 8px; padding: 7px 9px; border: 1px solid var(--blue); color: var(--blue); background: var(--white); border-radius: 3px; cursor: pointer; font-size: 7px; font-weight: 900; }
.answer-next button:hover { color: var(--white); background: var(--blue); }
.answer-next button:disabled { border-color: #afbbc6; color: #7c8997; background: #edf1f3; cursor: default; }
.action-receipt { margin: 8px 0 0 24px; padding: 11px; border: 1px solid #a9d2bc; background: var(--green-soft); }
.action-receipt span,
.action-receipt strong,
.action-receipt small { display: block; }
.action-receipt span { color: var(--green); font-size: 7px; font-weight: 900; }
.action-receipt strong { margin-top: 3px; color: var(--ink); font-size: 11px; }
.action-receipt p { margin: 5px 0 0; color: #476856; font-size: 8px; }
.action-receipt small { margin-top: 5px; color: #6e8476; font-size: 7px; }

.reasoning-details { margin-top: 12px; }
.insight-reasoning { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 8px 0 0; padding: 0; border: 1px solid var(--line); list-style: none; }
.insight-reasoning li { min-height: 70px; padding: 10px; border-right: 1px solid var(--line); background: #fafcfd; }
.insight-reasoning li:last-child { border-right: 0; }
.insight-reasoning span,
.insight-reasoning strong,
.insight-reasoning small { display: block; }
.insight-reasoning span { color: var(--teal); font-size: 7px; font-weight: 900; }
.insight-reasoning strong { margin-top: 4px; color: var(--ink); font-size: 9px; }
.insight-reasoning small { margin-top: 3px; color: var(--muted); font-size: 7px; line-height: 1.4; }

.capability-ribbon {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 16px;
  border: 1px solid var(--line);
  background: var(--line);
  gap: 1px;
}

.capability-ribbon span {
  min-height: 56px;
  display: grid;
  place-items: center;
  padding: 8px;
  color: #405169;
  background: var(--white);
  font-size: 9px;
  font-weight: 850;
  text-align: center;
}

@media (max-width: 1050px) {
  .operation-grid { grid-template-columns: 340px minmax(0, 1fr); }
  .source-options { grid-template-columns: 1fr; }
  .source-options button { min-height: 52px; }
  .source-preview { height: 440px; }
  .result-grid { grid-template-columns: 1fr; }
  .database-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-panel { min-height: 430px; }
  .insight-workspace { grid-template-columns: 280px minmax(0, 1fr); }
  .insight-grid { grid-template-columns: 1fr; }
  .insight-chat { min-height: 480px; }
  .insight-chat .chat-log { max-height: 360px; }
  .capability-ribbon { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .workbench { width: 100%; margin: 0; border: 0; box-shadow: none; }
  .workbench-header { align-items: flex-start; flex-direction: column; padding: 24px 18px; }
  .demo-disclosure { width: 100%; min-width: 0; }
  .agent-tabs button { min-height: 92px; padding: 12px; grid-template-columns: 24px 1fr; }
  .agent-tabs strong { font-size: 14px; }
  .agent-tabs small { font-size: 9px; }
  .agent-panel { padding: 28px 16px; }
  .panel-intro { grid-template-columns: 1fr; gap: 12px; }
  .operation-grid { grid-template-columns: 1fr; }
  .source-column { border-right: 0; border-bottom: 1px solid var(--line); }
  .source-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .source-options button { min-height: 68px; padding: 8px; }
  .source-preview { height: 410px; }
  .run-column { padding: 20px 14px; }
  .agent-steps { grid-template-columns: repeat(5, 104px); }
  .parse-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parse-summary > div:nth-child(2) { border-right: 0; }
  .parse-summary > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .review-compare { grid-template-columns: 1fr; }
  .review-actions { align-items: stretch; flex-direction: column; }
  .review-actions select { max-width: none; width: 100%; }
  .result-head { align-items: flex-start; flex-direction: column; }
  .result-metrics { width: 100%; }
  .result-metrics span { min-width: 0; flex: 1; }
  .result-grid { min-height: 0; }
  .insight-workspace { grid-template-columns: 1fr; }
  .permission-column { border-right: 0; border-bottom: 1px solid var(--line); }
  .insight-main { padding: 20px 14px; }
  .insight-context { grid-template-columns: 1fr; }
  .insight-context > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .insight-context > div:last-child { border-bottom: 0; }
  .insight-view-switcher { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-view-switcher button:nth-child(2) { border-right: 0; }
  .insight-view-switcher button:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .deep-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-reasoning { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-reasoning li:nth-child(2n) { border-right: 0; }
  .insight-reasoning li:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 440px) {
  .workbench-header h1 { font-size: 28px; }
  .source-options { grid-template-columns: 1fr; }
  .source-options button { min-height: 48px; }
  .source-preview { height: 390px; }
  .result-metrics { display: grid; grid-template-columns: repeat(3, 1fr); }
  .result-metrics span { padding-inline: 6px; }
  .booking-draft { grid-template-columns: 1fr; }
  .draft-field,
  .draft-field:nth-child(2n) { border-right: 0; }
  .agent-tabs { grid-template-columns: 1fr; }
  .agent-tabs button { min-height: 70px; border-right: 0; border-bottom: 1px solid var(--line); }
  .capability-ribbon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-context { grid-template-columns: 1fr; }
  .insight-context > div,
  .insight-context > div:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .insight-context > div:last-child { border-bottom: 0; }
  .insight-view-switcher { grid-template-columns: 1fr; }
  .insight-view-switcher button,
  .insight-view-switcher button:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .insight-view-switcher button:last-child { border-bottom: 0; }
  .order-overview { padding: 13px; }
  .order-overview-head { flex-direction: column; }
  .order-priority,
  .answer-outcome { grid-template-columns: 1fr; }
  .order-priority > div { border-right: 0; border-bottom: 1px solid #efd49f; }
  .order-priority > div:last-child { border-bottom: 0; }
  .order-facts,
  .answer-facts,
  .evidence-grid { grid-template-columns: 1fr; }
  .order-fact,
  .order-fact:nth-child(2n),
  .order-fact:nth-last-child(-n + 2),
  .answer-facts > div,
  .answer-facts > div:nth-child(2n),
  .answer-facts > div:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .order-fact:last-child,
  .answer-facts > div:last-child { border-bottom: 0; }
  .deep-timeline { grid-template-columns: 1fr; }
  .insight-kpis { grid-template-columns: 1fr; }
  .insight-kpis article { border-right: 0; border-bottom: 1px solid var(--line); }
  .insight-kpis article:last-child { border-bottom: 0; }
  .insight-reasoning { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .insight-reasoning li { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .insight-reasoning li:nth-child(2n) { border-right: 0; }
  .insight-reasoning li:nth-last-child(-n + 2) { border-bottom: 0; }
}

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