:root {
  --paper: #f5f1e8;
  --paper-strong: #fdfaf3;
  --ink: #223127;
  --ink-soft: #516054;
  --line: rgba(34, 49, 39, 0.12);
  --accent: #9f5a33;
  --accent-soft: rgba(159, 90, 51, 0.12);
  --olive: #4e6a57;
  --olive-deep: #314538;
  --user-bubble: linear-gradient(135deg, #334c3e, #476452);
  --shadow: 0 24px 60px rgba(58, 48, 34, 0.14);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(159, 90, 51, 0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(78, 106, 87, 0.18), transparent 30%),
    linear-gradient(180deg, #efe8dc 0%, #f7f2e8 55%, #f0ebdf 100%);
}

.shell {
  --rail-width: 286px;
  display: grid;
  grid-template-columns: var(--rail-width) 1fr;
  gap: 0;
  min-height: 100dvh;
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  transition: gap 180ms ease;
}

.shell.sidebar-collapsed {
  --rail-width: 0px;
  grid-template-columns: 1fr !important;
  gap: 0;
  overflow: visible;
}

.shell.sidebar-collapsed .chat-stage {
  grid-column: 1 !important;
  grid-row: 1;
}

.rail,
.chat-stage {
  backdrop-filter: blur(18px);
}

.rail {
  position: relative;
  z-index: 8;
  grid-column: 1;
  grid-row: 1;
  border-radius: 0;
  padding: 8px 8px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid rgba(34, 49, 39, 0.1);
  background: rgba(249, 246, 239, 0.88);
  transition: opacity 180ms ease, transform 180ms ease, padding 180ms ease, width 180ms ease, border-color 180ms ease;
}

.shell.sidebar-collapsed .rail {
  display: none;
  width: 0;
  height: 0;
  min-height: 0;
  max-height: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-12px);
}

.rail-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-height: 36px;
  padding-right: 34px;
}

.rail-head .ghost-icon {
  display: inline-grid;
}

#sidebarClose {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
}

.rail-dock {
  position: fixed;
  z-index: 40;
  isolation: isolate;
  left: 12px;
  top: 12px;
  width: 54px;
  border-radius: 20px;
  padding: 12px 0;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(18px);
  background: rgba(249, 246, 239, 0.9);
  border: 1px solid rgba(34, 49, 39, 0.1);
  box-shadow: 0 14px 28px rgba(34, 49, 39, 0.08);
  overflow: visible;
}

.mobile-surface-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 34;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid rgba(34, 49, 39, 0.1);
  background: rgba(249, 246, 239, 0.94);
  box-shadow: 0 16px 36px rgba(34, 49, 39, 0.12);
  backdrop-filter: blur(18px);
}

.mobile-nav-item {
  flex: 1 1 0;
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--ink-soft);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  cursor: pointer;
}

.mobile-nav-item.active {
  color: var(--accent);
  background: rgba(159, 90, 51, 0.1);
  border-color: rgba(159, 90, 51, 0.14);
}

.mobile-nav-icon {
  font-size: 15px;
  line-height: 1;
}

.shell.sidebar-collapsed .rail-dock {
  display: flex;
  transition: width 180ms ease, background 180ms ease, border-color 180ms ease;
}

.shell.sidebar-collapsed .rail-dock:hover,
.shell.sidebar-collapsed .rail-dock:focus-within {
  width: 58px;
  border-color: rgba(159, 90, 51, 0.24);
  background: rgba(252, 249, 242, 0.94);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--paper-strong);
  background: linear-gradient(135deg, var(--accent), #bc7b50);
}

.brand .eyebrow {
  margin-bottom: 2px;
}

.brand h1 {
  font-size: 16px;
  line-height: 1.15;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

h1,
h2 {
  margin: 0;
  font-family: "Georgia", "Times New Roman", "Songti SC", serif;
  font-weight: 700;
}

.panel {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  padding: 12px;
}

.panel h2 {
  font-size: 16px;
  margin-bottom: 10px;
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-top h2 {
  margin-bottom: 0;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  width: 100%;
  border: 1px solid rgba(34, 49, 39, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink);
  min-height: 52px;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.nav-item:hover,
.nav-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(159, 90, 51, 0.28);
  background: rgba(255, 255, 255, 0.72);
}

.nav-item.active {
  border-color: rgba(159, 90, 51, 0.38);
  background: linear-gradient(135deg, rgba(159, 90, 51, 0.11), rgba(78, 106, 87, 0.09));
  box-shadow: 0 14px 24px rgba(58, 48, 34, 0.08);
}

.nav-item-accent {
  background: rgba(255, 255, 255, 0.48);
  border-style: dashed;
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(34, 49, 39, 0.08);
  flex-shrink: 0;
  font-size: 14px;
}

.nav-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nav-copy strong {
  font-size: 12px;
  line-height: 1.3;
}

.nav-copy span {
  font-size: 10px;
  color: var(--ink-soft);
  line-height: 1.3;
}

.rail-panel {
  flex-shrink: 0;
}

.rail-panel[hidden] {
  display: none !important;
}

.session-panel {
  padding-bottom: 14px;
}

.history-panel {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}

.conversation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.history-panel .conversation-list {
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
}

.conversation-item {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-radius: 14px;
  padding: 8px 10px;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.conversation-item:hover,
.conversation-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(159, 90, 51, 0.35);
}

.conversation-item.active {
  background: linear-gradient(135deg, rgba(159, 90, 51, 0.12), rgba(78, 106, 87, 0.12));
  border-color: rgba(159, 90, 51, 0.45);
  box-shadow: 0 10px 20px rgba(58, 48, 34, 0.06);
}

.conversation-title {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.38;
  margin-bottom: 2px;
}

.conversation-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.conversation-main {
  flex: 1 1 auto;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

.conversation-edit {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.conversation-edit-input {
  width: 100%;
  border: 1px solid rgba(159, 90, 51, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
}

.conversation-edit-input:focus {
  outline: none;
  border-color: rgba(159, 90, 51, 0.34);
  box-shadow: 0 0 0 4px rgba(159, 90, 51, 0.08);
}

.conversation-actions {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}

.conversation-action {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(34, 49, 39, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-soft);
  cursor: pointer;
}

.conversation-action:hover,
.conversation-action:focus-visible {
  border-color: rgba(159, 90, 51, 0.42);
  color: var(--accent);
}

.conversation-meta {
  font-size: 11px;
  color: var(--ink-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-item {
  width: 100%;
  border: 1px solid rgba(34, 49, 39, 0.1);
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.template-item:hover,
.template-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(159, 90, 51, 0.28);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 22px rgba(58, 48, 34, 0.05);
}

.template-item strong {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 3px;
}

.template-item span {
  display: block;
  font-size: 10px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.chip {
  border: 1px solid var(--line);
  background: var(--paper-strong);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.chip:hover,
.chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(159, 90, 51, 0.4);
  background: #fff;
}

.field,
.toggle {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 14px;
}

.toggle {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

select,
textarea,
button {
  font: inherit;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

select {
  padding: 12px 14px;
}

.facts {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.facts li + li {
  margin-top: 4px;
}

.chat-stage {
  grid-column: 2;
  grid-row: 1;
  border-radius: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: rgba(247, 242, 232, 0.36);
  z-index: 1;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(249, 246, 239, 0.74);
}

.header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-main .eyebrow {
  margin-bottom: 2px;
}

#pageTitle {
  font-size: 24px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(56vw, 760px);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-actions[hidden] {
  display: none;
}

.header-actions .ghost-compact {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(34, 49, 39, 0.08);
  box-shadow: 0 8px 18px rgba(58, 48, 34, 0.05);
}

.docs-nav-panel {
  margin-top: 4px;
}

.docs-nav-head {
  margin-bottom: 12px;
}

.docs-nav-head p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.docs-nav-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.docs-nav-group {
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(34, 49, 39, 0.06);
  background: rgba(255, 255, 255, 0.46);
}

.docs-nav-group:has(a.active) {
  border-color: rgba(159, 90, 51, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(250, 245, 238, 0.7));
  box-shadow: 0 10px 22px rgba(58, 48, 34, 0.05);
}

.docs-nav-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.docs-nav-summary::-webkit-details-marker {
  display: none;
}

.docs-nav-summary::after {
  content: "▾";
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 14px;
  color: var(--ink-soft);
  transition: transform 180ms ease, color 180ms ease;
}

.docs-nav-group:not([open]) .docs-nav-summary::after {
  transform: rotate(-90deg);
}

.docs-nav-group[open] .docs-nav-summary::after {
  color: var(--accent);
}

.docs-nav-group h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink);
}

.docs-nav-group > p {
  margin: 6px 0 10px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.docs-nav-group nav {
  margin-top: 10px;
}

.docs-link-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.docs-link-list a {
  position: relative;
  overflow: hidden;
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1px solid rgba(34, 49, 39, 0.06);
  background: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  transition: background 220ms ease, border-color 220ms ease, color 220ms ease, transform 220ms ease, box-shadow 240ms ease;
}

.docs-link-list a strong {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
}

.docs-link-list a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 7px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(159, 90, 51, 0.95), rgba(188, 123, 80, 0.9));
  transform-origin: left center;
  transform: scaleX(var(--progress, 0));
  opacity: 0;
  transition: opacity 180ms ease, transform 220ms ease;
}

.docs-link-list a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(159, 90, 51, 0.95), rgba(188, 123, 80, 0.92));
  opacity: 0;
  transform: scaleY(0.4);
  transform-origin: center;
  transition: opacity 180ms ease, transform 220ms ease;
}

.docs-link-list a strong {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
}

.docs-link-list a span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.docs-link-list a:hover,
.docs-link-list a:focus-visible {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(159, 90, 51, 0.18);
  transform: translateY(-1px);
}

.docs-link-list a:hover strong,
.docs-link-list a:focus-visible strong {
  color: var(--accent);
}

.docs-link-list a.active {
  border-color: rgba(159, 90, 51, 0.32);
  background: linear-gradient(135deg, rgba(159, 90, 51, 0.12), rgba(78, 106, 87, 0.08));
  box-shadow: 0 12px 24px rgba(58, 48, 34, 0.06);
  transform: translateX(2px);
}

.docs-link-list a.active strong {
  color: var(--accent);
}

.docs-link-list a.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.docs-link-list a.active::after {
  opacity: 1;
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.ghost:hover,
.ghost:focus-visible {
  border-color: rgba(159, 90, 51, 0.32);
  background: rgba(255, 255, 255, 0.74);
  color: var(--accent);
}

.ghost-icon[data-tooltip] {
  position: relative;
  z-index: 81;
}

.ghost-icon[data-tooltip]::after {
  display: none !important;
}

.ghost-icon[data-tooltip]::before {
  display: none !important;
}

.ghost-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

.ghost:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

#sidebarToggle {
  display: none;
}

.ghost-compact {
  padding: 8px 12px;
  font-size: 13px;
}

.floating-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(34, 49, 39, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 14px 30px rgba(34, 49, 39, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 3000;
}

.floating-tooltip.open {
  opacity: 1;
  transform: translateY(0);
}

.floating-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  background: rgba(34, 49, 39, 0.94);
  transform: translateY(-50%) rotate(45deg);
}

.floating-tooltip[data-placement="right"]::after {
  left: -5px;
}

.floating-tooltip[data-placement="left"]::after {
  right: -5px;
}

.rail-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(34, 49, 39, 0.18);
  z-index: 24;
}

.surface {
  min-height: 0;
}

.surface[hidden] {
  display: none !important;
}

.shell.surface-docs-active #historyPanel,
.shell.surface-docs-active #capabilityPanel,
.shell.surface-docs-active #examplesPanel {
  display: none !important;
}

.surface-chat {
  min-height: 0;
  height: 100%;
  padding: 0 28px 24px;
}

.surface-chat:not(.is-empty) {
  display: grid;
  grid-template-rows: 1fr auto;
}

.surface-chat.is-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px 0 34px;
}

.surface-chat.is-empty .messages {
  display: none;
}

.surface-chat:not(.is-empty) .empty-hero {
  display: none;
}

.empty-hero {
  max-width: 720px;
  text-align: center;
}

.empty-hero h3 {
  margin: 0 0 14px;
  font-family: "Georgia", "Times New Roman", "Songti SC", serif;
  font-size: 34px;
  line-height: 1.18;
}

.empty-hero p:last-child {
  margin: 0 0 18px;
  color: var(--ink-soft);
  line-height: 1.75;
  font-size: 15px;
}

.hero-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(860px, 100%);
  margin-top: 8px;
}

.hero-action-card {
  border: 1px solid rgba(34, 49, 39, 0.1);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  border-radius: 20px;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(58, 48, 34, 0.05);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.hero-action-card:hover,
.hero-action-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(159, 90, 51, 0.28);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 20px 36px rgba(58, 48, 34, 0.08);
}

.hero-action-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  margin-bottom: 6px;
  color: var(--olive-deep);
}

.hero-action-card span {
  display: block;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.composer-settings-toggle {
  display: none;
}

.messages {
  overflow-y: auto;
  min-height: 0;
  padding: 28px 4px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

.message {
  width: min(880px, 100%);
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 28px rgba(58, 48, 34, 0.05);
  animation: rise 220ms ease;
}

.surface-docs {
  overflow-y: auto;
  min-height: 0;
  padding: 22px 28px 30px;
}

.mobile-sidebar-search {
  display: none;
}

.doc-article {
  max-width: 940px;
  margin: 0 auto;
  padding: 4px 0 72px;
  line-height: 1.82;
}

.doc-article section {
  padding: 22px 24px;
  border-radius: 24px;
  border: 1px solid rgba(34, 49, 39, 0.08);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 14px 30px rgba(58, 48, 34, 0.05);
}

.doc-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.doc-hero-copy {
  min-width: 0;
}

.doc-lead {
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink);
}

.doc-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.doc-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(34, 49, 39, 0.08);
  font-size: 12px;
  color: var(--ink);
}

.doc-mini-route {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(34, 49, 39, 0.1);
  display: grid;
  gap: 6px;
}

.doc-mini-route p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(34, 49, 39, 0.82);
}

.doc-grid {
  display: grid;
  gap: 14px;
}

.doc-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doc-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.doc-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(34, 49, 39, 0.06);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.doc-card h4 {
  margin: 0 0 10px;
}

.doc-card p:last-child,
.doc-card ul:last-child,
.doc-card ol:last-child {
  margin-bottom: 0;
}

.doc-example {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(159, 90, 51, 0.07);
  color: var(--accent);
  font-size: 12px;
  line-height: 1.7;
}

.doc-callout {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(78, 106, 87, 0.12);
  background: rgba(78, 106, 87, 0.07);
}

.doc-callout strong {
  display: block;
  margin-bottom: 8px;
}

.doc-callout p {
  margin: 0;
}

.doc-callout-warning {
  border-color: rgba(159, 90, 51, 0.16);
  background: rgba(159, 90, 51, 0.08);
}

.doc-callout-success {
  border-color: rgba(74, 111, 215, 0.16);
  background: rgba(74, 111, 215, 0.07);
}

.doc-figure {
  margin: 0 0 18px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(34, 49, 39, 0.06);
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.doc-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
}

.doc-figure figcaption {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.doc-figure-hero {
  align-self: stretch;
}

.doc-steps {
  padding-left: 22px;
}

.doc-section-tail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(34, 49, 39, 0.08);
}

.doc-section-learned {
  min-width: 0;
}

.doc-section-label {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.doc-section-learned p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink);
}

.doc-section-next {
  align-self: end;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(34, 49, 39, 0.08);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  line-height: 1;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.doc-section-next:hover,
.doc-section-next:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(159, 90, 51, 0.22);
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent);
}

.doc-article section + section {
  margin-top: 14px;
}

.doc-article section ul li + li,
.doc-article section ol li + li {
  margin-top: 6px;
}

.doc-article strong {
  color: var(--olive-deep);
}

.doc-article h3,
.doc-article h4 {
  font-family: "Georgia", "Times New Roman", "Songti SC", serif;
}

.doc-article h3 {
  margin: 0 0 18px;
  font-size: 34px;
  line-height: 1.18;
}

.doc-article h4 {
  margin: 28px 0 12px;
  font-size: 22px;
}

.doc-article p,
.doc-article ul,
.doc-article ol {
  margin: 0 0 16px;
}

.doc-article ul,
.doc-article ol {
  padding-left: 22px;
}

.message.user {
  margin-left: auto;
  color: var(--paper-strong);
  background: var(--user-bubble);
  border-color: rgba(255, 255, 255, 0.08);
}

.message.user.is-inline-editing {
  width: min(1180px, 100%);
  margin-left: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.message.user.is-inline-editing .message-head,
.message.user.is-inline-editing .message-capabilities,
.message.user.is-inline-editing .message-details {
  display: none !important;
}

.message.user.is-inline-editing .message-body {
  color: var(--ink);
}

.message.assistant {
  background: rgba(255, 255, 255, 0.86);
}

.message.system {
  border-style: dashed;
  background: rgba(159, 90, 51, 0.08);
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 12px;
}

.role {
  font-weight: 700;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
}

.meta-chip-button {
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
}

.meta-chip-button:hover {
  background: var(--accent-soft);
  color: var(--ink);
  filter: none;
}

.meta-chip-button:active,
.meta-chip-button:focus,
.meta-chip-button:focus-visible {
  background: var(--accent-soft);
  color: var(--ink);
  outline: none;
  box-shadow: none;
}

.message.user .meta-chip {
  background: rgba(255, 255, 255, 0.14);
  color: var(--paper-strong);
}

.message-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.message-capabilities[hidden] {
  display: none;
}

.capability-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(78, 106, 87, 0.1);
  color: var(--olive-deep);
  font-size: 12px;
  line-height: 1;
  border: 1px solid rgba(78, 106, 87, 0.12);
}

.structured-view {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(34, 49, 39, 0.08);
  background: rgba(250, 248, 242, 0.78);
}

.structured-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.structured-view-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  font-family: "Georgia", "Times New Roman", "Songti SC", serif;
}

.structured-view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.structured-card {
  border: 1px solid rgba(34, 49, 39, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px 14px;
}

.structured-card h4 {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.35;
}

.structured-card-subtitle {
  margin: -4px 0 10px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-muted);
}

.surface-graph {
  padding: 18px 18px 28px;
  overflow: auto;
}

.graph-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.graph-topbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(34, 49, 39, 0.08);
  border-radius: 20px;
  background: rgba(250, 248, 242, 0.82);
}

.graph-query {
  display: flex;
  gap: 12px;
  align-items: end;
}

.graph-field {
  flex: 1;
}

.graph-field input {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(34, 49, 39, 0.12);
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.9);
}

.graph-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.graph-status {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.graph-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.graph-status[data-tone="error"] {
  color: #9b3d30;
}

.graph-status[data-tone="success"] {
  color: #2f5d46;
}

.graph-tipbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.graph-source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(34, 49, 39, 0.08);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}

.graph-source-badge[data-tone="success"] {
  border-color: rgba(60, 107, 81, 0.18);
  background: rgba(239, 248, 243, 0.95);
  color: #315843;
}

.graph-source-badge[data-tone="warning"] {
  border-color: rgba(160, 116, 52, 0.18);
  background: rgba(251, 245, 232, 0.95);
  color: #7d5c2f;
}

.graph-source-badge[data-tone="info"] {
  border-color: rgba(70, 94, 135, 0.14);
  background: rgba(244, 247, 252, 0.94);
  color: #4e6078;
}

.graph-source-badge-inline {
  margin-top: 8px;
}

.graph-tip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(34, 49, 39, 0.06);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
}

.graph-scope {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.graph-scope-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 136px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(34, 49, 39, 0.08);
  background: rgba(255, 255, 255, 0.76);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.graph-scope-chip strong {
  font-size: 12px;
  color: var(--ink);
}

.graph-scope-chip span,
.graph-scope-chip small {
  color: var(--ink-soft);
  line-height: 1.5;
}

.graph-scope-chip span {
  font-size: 11px;
}

.graph-scope-chip small {
  font-size: 10px;
}

.graph-scope-chip:hover,
.graph-scope-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(34, 49, 39, 0.14);
  box-shadow: 0 10px 20px rgba(34, 49, 39, 0.06);
}

.graph-scope-chip.active {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(34, 49, 39, 0.2);
  box-shadow: inset 0 0 0 1px rgba(34, 49, 39, 0.04);
}

.graph-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.graph-maincolumn {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.graph-canvas-card,
.graph-panel {
  border: 1px solid rgba(34, 49, 39, 0.08);
  border-radius: 22px;
  background: rgba(250, 248, 242, 0.8);
}

.graph-canvas-card {
  padding: 14px;
}

.graph-canvas-head {
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.graph-canvas-head h3,
.graph-panel h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.graph-canvas-head p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.graph-canvas {
  width: 100%;
  min-height: 700px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top, rgba(113, 145, 124, 0.08), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,0.88), rgba(248,245,238,0.92));
  box-shadow: inset 0 0 0 1px rgba(34, 49, 39, 0.04), 0 18px 40px rgba(34, 49, 39, 0.1);
  cursor: grab;
}

.graph-canvas.dragging {
  cursor: grabbing;
}

.graph-view-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.graph-view-tools .ghost {
  min-width: 40px;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-color: rgba(34, 49, 39, 0.08);
}

.graph-view-tools .ghost:hover,
.graph-view-tools .ghost:focus-visible {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(34, 49, 39, 0.16);
}

.graph-sidepanel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.graph-detail-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 350px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(34, 49, 39, 0.1);
  border-radius: 24px;
  background: rgba(250, 248, 242, 0.96);
  box-shadow: 0 24px 60px rgba(34, 49, 39, 0.18);
  backdrop-filter: blur(16px);
  transform: translateX(calc(100% + 18px));
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease, width 220ms ease;
  z-index: 24;
  overflow: hidden;
}

.graph-detail-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.graph-detail-drawer.collapsed {
  width: 46px;
}

.graph-detail-drawer.collapsed .graph-detail {
  display: none;
}

.graph-detail-drawer.collapsed .graph-detail-drawer-head {
  position: relative;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 12px 6px 10px;
}

.graph-detail-drawer.collapsed .graph-detail-drawer-head .eyebrow,
.graph-detail-drawer.collapsed .graph-detail-drawer-head h3,
.graph-detail-drawer.collapsed .graph-detail-drawer-head .graph-source-badge-inline {
  display: none;
}

.graph-detail-drawer.collapsed .graph-detail-drawer-head::after {
  content: "详情";
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.graph-detail-drawer.collapsed .graph-detail-drawer-actions {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.graph-detail-drawer.collapsed .graph-detail-drawer-actions .graph-action-button,
.graph-detail-drawer.collapsed .graph-detail-drawer-actions .drawer-close {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
}

.graph-detail-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(34, 49, 39, 0.08);
  background: rgba(255, 255, 255, 0.46);
}

.graph-detail-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.graph-detail {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px 16px;
}

.graph-detail-section + .graph-detail-section {
  margin-top: 14px;
}

.graph-detail-section h5 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.graph-detail-body {
  margin-top: 8px;
  color: var(--ink);
  line-height: 1.7;
}

.graph-detail-submeta {
  margin-top: 8px;
  color: var(--ink-soft);
}

.graph-detail-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.graph-detail-badge {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(34, 49, 39, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.graph-detail-badge strong {
  font-size: 12px;
  color: var(--ink);
}

.graph-detail-badge span {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.graph-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.graph-panel {
  padding: 14px;
}

.graph-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.graph-recommendations {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.graph-workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.graph-field-compact {
  margin-top: 10px;
}

.graph-workspace-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.graph-workspace-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(34, 49, 39, 0.06);
  background: rgba(255, 255, 255, 0.78);
}

.graph-workspace-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.graph-workspace-copy strong {
  font-size: 13px;
  color: var(--ink);
}

.graph-workspace-copy span,
.graph-workspace-copy small {
  color: var(--ink-soft);
  line-height: 1.55;
}

.graph-workspace-copy span {
  font-size: 11px;
}

.graph-workspace-copy small {
  font-size: 10px;
}

.graph-workspace-item-actions,
.graph-workspace-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.graph-workspace-actions {
  margin-top: 10px;
}

.graph-compare-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.graph-compare-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.graph-compare-preview {
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(34, 49, 39, 0.06);
  background: rgba(255, 255, 255, 0.74);
}

.graph-compare-preview-label {
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

.graph-compare-preview-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink);
}

.graph-compare-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.graph-compare-surface {
  padding: 16px;
  border: 1px solid rgba(34, 49, 39, 0.08);
  border-radius: 22px;
  background: rgba(250, 248, 242, 0.8);
}

.graph-compare-surface-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.graph-compare-surface-head h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.graph-compare-surface-head p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.graph-compare-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
}

.graph-compare-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

.graph-compare-toolbar > .graph-action-button {
  margin-left: auto;
  flex-shrink: 0;
}

.graph-compare-filter .graph-action-button {
  flex-shrink: 0;
}

.graph-compare-filter .graph-action-button.active {
  border-color: rgba(159, 90, 51, 0.22);
  background: rgba(159, 90, 51, 0.08);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(159, 90, 51, 0.06);
}

@media (max-width: 1180px) {
  .graph-compare-toolbar {
    flex-wrap: wrap;
  }

  .graph-compare-filter {
    flex-wrap: wrap;
  }

  .graph-compare-toolbar > .graph-action-button {
    margin-left: 0;
  }
}

.graph-compare-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.graph-compare-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(34, 49, 39, 0.08);
  background:
    linear-gradient(135deg, rgba(159, 90, 51, 0.08), rgba(78, 106, 87, 0.05)),
    rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.graph-compare-summary h4 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

.graph-compare-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(34, 49, 39, 0.06);
  background: rgba(255, 255, 255, 0.8);
}

.graph-compare-card.is-reference {
  border-color: rgba(74, 111, 215, 0.18);
  background: linear-gradient(135deg, rgba(74, 111, 215, 0.08), rgba(255, 255, 255, 0.84));
  box-shadow: inset 0 0 0 1px rgba(74, 111, 215, 0.05);
}

.graph-compare-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.graph-compare-role {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

.graph-compare-card-head h4 {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

.graph-compare-meta,
.graph-compare-excerpt {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

.graph-compare-meta {
  color: var(--ink-soft);
}

.graph-compare-excerpt {
  color: var(--ink);
}

.graph-compare-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 14px;
  border: 1px solid rgba(34, 49, 39, 0.06);
  background: rgba(255, 255, 255, 0.7);
}

.graph-compare-block-common {
  border-color: rgba(78, 106, 87, 0.14);
  background: rgba(78, 106, 87, 0.06);
}

.graph-compare-block-diff {
  border-color: rgba(159, 90, 51, 0.16);
  background: rgba(159, 90, 51, 0.06);
}

.graph-compare-block h5 {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.graph-compare-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.graph-compare-lines p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink);
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.graph-compare-line-common {
  border-color: rgba(78, 106, 87, 0.16);
  background: rgba(78, 106, 87, 0.08);
  color: var(--olive-deep);
}

.graph-compare-line-diff {
  border-color: rgba(159, 90, 51, 0.18);
  background: rgba(159, 90, 51, 0.08);
  color: #7a4325;
}

.graph-compare-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(34, 49, 39, 0.06);
  background: rgba(255, 255, 255, 0.78);
  cursor: grab;
}

.graph-compare-item.is-reference {
  border-color: rgba(74, 111, 215, 0.22);
  background: linear-gradient(135deg, rgba(74, 111, 215, 0.08), rgba(255, 255, 255, 0.8));
  box-shadow: inset 0 0 0 1px rgba(74, 111, 215, 0.06);
}

.graph-compare-item.is-active {
  border-color: rgba(159, 90, 51, 0.24);
  box-shadow: inset 0 0 0 1px rgba(159, 90, 51, 0.08);
}

.graph-compare-item.dragging {
  opacity: 0.55;
}

.graph-compare-item.drag-over {
  border-color: rgba(74, 111, 215, 0.28);
  box-shadow: inset 0 0 0 1px rgba(74, 111, 215, 0.08);
}

.graph-compare-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.graph-compare-copy strong {
  font-size: 13px;
  color: var(--ink);
}

.graph-compare-copy span {
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.graph-compare-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-article section + section {
  margin-top: 28px;
}

.doc-article ul,
.doc-article ol {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 20px;
}

.doc-article li {
  line-height: 1.8;
  color: var(--ink);
}

.doc-template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.doc-template {
  cursor: pointer;
}

.doc-template:hover,
.doc-template:focus-visible {
  transform: translateY(-1px);
}

.graph-legend-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(34, 49, 39, 0.06);
}

.graph-legend-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.graph-legend-button.active {
  border-color: rgba(34, 49, 39, 0.18);
  box-shadow: inset 0 0 0 1px rgba(34, 49, 39, 0.06);
  background: rgba(255, 255, 255, 0.9);
}

.graph-recommendation {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(34, 49, 39, 0.06);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.graph-recommendation strong {
  font-size: 13px;
  color: var(--ink);
}

.graph-recommendation span,
.graph-recommendation small {
  color: var(--ink-soft);
  line-height: 1.55;
}

.graph-recommendation span {
  font-size: 12px;
}

.graph-recommendation small {
  font-size: 11px;
}

.graph-recommendation:hover,
.graph-recommendation:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(34, 49, 39, 0.14);
  box-shadow: 0 12px 24px rgba(34, 49, 39, 0.08);
  background: rgba(255, 255, 255, 0.92);
}

.graph-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 6px;
  flex: 0 0 auto;
}

.graph-legend-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.graph-legend-copy strong {
  font-size: 13px;
}

.graph-legend-copy span,
.graph-empty-copy,
.graph-detail p {
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.graph-detail-card h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.graph-detail-evidence {
  color: var(--accent);
}

.graph-detail-relations {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.graph-detail-group {
  border: 1px solid rgba(34, 49, 39, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

.graph-detail-group + .graph-detail-group {
  margin-top: 10px;
}

.graph-detail-group-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.54);
  cursor: pointer;
}

.graph-detail-group-summary::-webkit-details-marker {
  display: none;
}

.graph-detail-group-summary strong {
  font-size: 12px;
  color: var(--ink);
}

.graph-detail-group-summary span {
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.graph-detail-relation {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-top: 1px solid rgba(34, 49, 39, 0.06);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.graph-detail-relation strong {
  font-size: 12px;
  color: var(--ink);
}

.graph-detail-relation span {
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.graph-edge {
  cursor: pointer;
  transition: stroke-opacity 140ms ease, stroke-width 140ms ease;
}

.graph-edge:hover {
  stroke-opacity: 1;
  stroke-width: 2;
}

.graph-node {
  cursor: pointer;
}

.graph-node-hit {
  pointer-events: auto;
}

.graph-node circle {
  transition: transform 160ms ease, stroke-width 160ms ease, fill-opacity 160ms ease;
  transform-origin: center;
}

.graph-node:hover circle {
  transform: scale(1.03);
}

.graph-label {
  pointer-events: none;
  user-select: none;
}

.graph-label-connector {
  pointer-events: none;
}

.structured-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.structured-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 4px;
}

.structured-item p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.structured-evidence {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--accent);
}

.structured-followup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  border: 1px solid rgba(159, 90, 51, 0.18);
  background: rgba(159, 90, 51, 0.08);
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.structured-followup:hover,
.structured-followup:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(159, 90, 51, 0.4);
  background: rgba(159, 90, 51, 0.14);
}

.message-body {
  line-height: 1.72;
  font-size: 15px;
}

.message-body > :first-child {
  margin-top: 0;
}

.message-body > :last-child {
  margin-bottom: 0;
}

.message-body p,
.message-body ul,
.message-body ol,
.message-body blockquote,
.message-body pre,
.message-body h1,
.message-body h2,
.message-body h3,
.message-body h4 {
  margin: 0 0 14px;
}

.message-body h1,
.message-body h2,
.message-body h3,
.message-body h4 {
  font-family: "Georgia", "Times New Roman", "Songti SC", serif;
  line-height: 1.3;
}

.message-body h1 {
  font-size: 26px;
}

.message-body h2 {
  font-size: 22px;
}

.message-body h3 {
  font-size: 19px;
}

.message-body ul,
.message-body ol {
  padding-left: 22px;
}

.message-body li + li {
  margin-top: 8px;
}

.message-body blockquote {
  margin-left: 0;
  padding: 10px 14px;
  border-left: 3px solid rgba(159, 90, 51, 0.38);
  background: rgba(159, 90, 51, 0.06);
  color: var(--ink-soft);
  border-radius: 0 12px 12px 0;
}

.message-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(159, 90, 51, 0.26);
}

.message-body a:hover {
  border-bottom-color: rgba(159, 90, 51, 0.65);
}

.inline-evidence-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 4px;
}

.inline-evidence-prefix {
  font-size: 12px;
  color: var(--ink-soft);
}

.inline-evidence-ref {
  border: 1px solid rgba(159, 90, 51, 0.2);
  background: rgba(159, 90, 51, 0.08);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.inline-evidence-ref:hover,
.inline-evidence-ref:focus-visible {
  border-color: rgba(159, 90, 51, 0.42);
  background: rgba(159, 90, 51, 0.14);
}

.message-body code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(34, 49, 39, 0.06);
}

.code-block {
  overflow-x: auto;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f0ece2;
  border: 1px solid rgba(34, 49, 39, 0.08);
}

.code-block code {
  display: block;
  padding: 0;
  background: transparent;
  border-radius: 0;
  white-space: pre;
}

.code-lang {
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.message.user .message-body code {
  background: rgba(255, 255, 255, 0.14);
}

.message.user .message-body a {
  color: #fff6e8;
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

.message.user .code-block {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.12);
}

.message.user .code-lang {
  color: rgba(255, 255, 255, 0.7);
}

.message-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  overflow: visible;
}

.tool-anchor {
  position: relative;
  display: inline-flex;
}

.tool-anchor.has-menu {
  z-index: 32;
}

.tool-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  border-radius: 12px;
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
  position: relative;
}

.tool-button:hover,
.tool-button:focus-visible {
  border-color: rgba(159, 90, 51, 0.4);
  color: var(--accent);
}

.tool-button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: rgba(34, 49, 39, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 7px 9px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(34, 49, 39, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.tool-button:hover::after,
.tool-button:focus-visible::after {
  opacity: 1;
}

.tool-button[data-status]:not([data-status=""])::after {
  content: attr(data-status);
  opacity: 1;
}

.tool-icon {
  display: inline-grid;
  place-items: center;
  pointer-events: none;
}

.tool-icon.export,
.tool-icon.evidence,
.tool-icon.share {
  font-size: 16px;
}

.tool-button.active {
  background: rgba(159, 90, 51, 0.12);
  border-color: rgba(159, 90, 51, 0.4);
  color: var(--accent);
}

.message-details {
  margin-top: 14px;
  border-top: 1px dashed rgba(34, 49, 39, 0.12);
  padding-top: 12px;
}

.message-details summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 13px;
  list-style: none;
}

.message-details summary::-webkit-details-marker {
  display: none;
}

.message-details summary::after {
  content: "展开";
  margin-left: 8px;
  color: var(--accent);
}

.message-details[open] summary::after {
  content: "收起";
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.detail-card {
  border: 1px solid rgba(34, 49, 39, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
}

.detail-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(88px, auto) 1fr;
  gap: 8px 10px;
  font-size: 13px;
}

.detail-list dt {
  color: var(--ink-soft);
}

.detail-list dd {
  margin: 0;
  font-weight: 600;
  word-break: break-word;
}

.message.user .tool-button {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.82);
}

.message.user .tool-button.active,
.message.user .tool-button:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.message.user .message-details {
  border-top-color: rgba(255, 255, 255, 0.18);
}

.message.user .message-details summary,
.message.user .detail-list dt {
  color: rgba(255, 255, 255, 0.78);
}

.message.user .message-details summary::after {
  color: #fff2dc;
}

.message.user .detail-card {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.12);
}

.message.user .detail-list dd {
  color: #fff;
}

.message-inline-edit {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.message-inline-edit-input {
  flex: 1 1 auto;
  min-height: 52px;
  max-height: 180px;
  resize: none;
  border: 2px solid #1b63f0;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  padding: 12px 18px;
  outline: none;
  overflow-y: auto;
  box-shadow: none;
}

.message-inline-edit-cancel,
.message-inline-edit-submit {
  width: 42px;
  height: 42px;
  min-height: 42px;
  flex: 0 0 42px;
  border-radius: 999px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: rgba(34, 49, 39, 0.42);
  font-size: 24px;
  line-height: 1;
}

.message-inline-edit-submit {
  background: #1b63f0;
  color: #fff;
  font-size: 18px;
  box-shadow: none;
}

.message-inline-edit-cancel:hover,
.message-inline-edit-cancel:focus-visible,
.message-inline-edit-submit:hover,
.message-inline-edit-submit:focus-visible {
  background: transparent;
}

.message-inline-edit-cancel:hover,
.message-inline-edit-cancel:focus-visible {
  color: rgba(34, 49, 39, 0.58);
}

.message-inline-edit-submit:hover,
.message-inline-edit-submit:focus-visible {
  background: #1656d1;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(34, 49, 39, 0.18);
  z-index: 18;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(34, 49, 39, 0.2);
  z-index: 20;
}

.search-dialog {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(720px, calc(100% - 40px));
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  background: rgba(253, 250, 243, 0.97);
  box-shadow: 0 30px 70px rgba(34, 49, 39, 0.18);
  padding: 20px;
  z-index: 21;
  opacity: 0;
  pointer-events: none;
  transition: transform 200ms ease, opacity 200ms ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-dialog.open {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.search-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.search-dialog-head h3 {
  margin: 0;
  font-size: 24px;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-field span {
  font-size: 12px;
  color: var(--ink-soft);
}

.search-field input {
  width: 100%;
  border: 1px solid rgba(34, 49, 39, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
}

.search-field input:focus {
  outline: none;
  border-color: rgba(159, 90, 51, 0.3);
  box-shadow: 0 0 0 4px rgba(159, 90, 51, 0.08);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(56vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}

.search-result {
  width: 100%;
  border: 1px solid rgba(34, 49, 39, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.search-result:hover,
.search-result:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(159, 90, 51, 0.3);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 24px rgba(58, 48, 34, 0.06);
}

.search-result.active {
  transform: translateY(-1px);
  border-color: rgba(159, 90, 51, 0.34);
  background: linear-gradient(135deg, rgba(159, 90, 51, 0.11), rgba(78, 106, 87, 0.08));
  box-shadow: 0 14px 28px rgba(58, 48, 34, 0.08);
}

.search-result.active strong {
  color: var(--accent);
}

.search-result strong {
  display: block;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
}

.search-result-meta,
.search-result-snippet {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.search-result mark {
  background: rgba(159, 90, 51, 0.16);
  color: var(--accent);
  padding: 0 2px;
  border-radius: 4px;
}

.search-empty {
  border: 1px dashed rgba(34, 49, 39, 0.14);
  border-radius: 18px;
  padding: 18px;
  color: var(--ink-soft);
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.56);
}

.evidence-drawer {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(420px, calc(100% - 36px));
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(253, 250, 243, 0.96);
  box-shadow: 0 30px 70px rgba(34, 49, 39, 0.18);
  padding: 20px;
  z-index: 19;
  transform: translateX(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity;
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    visibility 0s linear 180ms;
  display: flex;
  flex-direction: column;
}

.evidence-drawer.open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s, 0s, 0s;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-head h3 {
  margin: 0;
  font-size: 22px;
  font-family: "Georgia", "Times New Roman", "Songti SC", serif;
}

.drawer-question {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.drawer-close {
  border: 1px solid rgba(34, 49, 39, 0.12);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
}

.drawer-close:hover,
.drawer-close:focus-visible {
  border-color: rgba(159, 90, 51, 0.4);
  color: var(--accent);
}

.drawer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 14px;
}

.drawer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
}

.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.drawer-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-group.focus {
  outline: 2px solid rgba(159, 90, 51, 0.22);
  outline-offset: 6px;
  border-radius: 18px;
}

.drawer-group-title {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.drawer-group-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.evidence-card {
  border: 1px solid rgba(34, 49, 39, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  padding: 14px;
}

.evidence-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.evidence-kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--olive-deep);
  background: rgba(78, 106, 87, 0.12);
  margin-bottom: 0;
}

.evidence-copy {
  border: 1px solid rgba(34, 49, 39, 0.1);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-soft);
  border-radius: 10px;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.evidence-copy:hover,
.evidence-copy:focus-visible {
  border-color: rgba(159, 90, 51, 0.4);
  color: var(--accent);
}

.evidence-copy::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  background: rgba(34, 49, 39, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 7px 9px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(34, 49, 39, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.evidence-copy:hover::after,
.evidence-copy:focus-visible::after {
  opacity: 1;
}

.evidence-copy[data-status]:not([data-status=""])::after {
  content: attr(data-status);
  opacity: 1;
}

.evidence-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.evidence-subtitle,
.evidence-location {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.evidence-location {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  position: relative;
  width: fit-content;
}

.evidence-location:hover,
.evidence-location:focus-visible {
  color: var(--accent);
}

.evidence-location::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  background: rgba(34, 49, 39, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 7px 9px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(34, 49, 39, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.evidence-location:hover::after,
.evidence-location:focus-visible::after {
  opacity: 1;
}

.evidence-location[data-status]:not([data-status=""])::after {
  content: attr(data-status);
  opacity: 1;
}

.evidence-location-rule {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(159, 90, 51, 0.08);
  border: 1px solid rgba(159, 90, 51, 0.12);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.evidence-snippet {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(34, 49, 39, 0.05);
  border: 1px solid rgba(34, 49, 39, 0.06);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.drawer-empty {
  border: 1px dashed rgba(34, 49, 39, 0.14);
  border-radius: 18px;
  padding: 18px;
  color: var(--ink-soft);
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.56);
}

.export-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 220px;
  border-radius: 18px;
  border: 1px solid rgba(34, 49, 39, 0.12);
  background: rgba(253, 250, 243, 0.98);
  box-shadow: 0 22px 48px rgba(34, 49, 39, 0.16);
  padding: 8px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top center;
  transition: opacity 160ms ease, transform 180ms ease;
}

.export-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.export-menu[data-placement="top"] {
  transform: translateY(6px) scale(0.98);
  transform-origin: bottom center;
}

.export-menu[data-placement="top"].open {
  transform: translateY(0) scale(1);
}

.export-menu::before {
  content: "";
  position: absolute;
  left: var(--export-arrow-left, 50%);
  width: 14px;
  height: 14px;
  background: rgba(253, 250, 243, 0.98);
}

.export-menu[data-placement="bottom"]::before {
  top: 0;
  border-top: 1px solid rgba(34, 49, 39, 0.12);
  border-left: 1px solid rgba(34, 49, 39, 0.12);
  transform: translate(-50%, -52%) rotate(45deg);
  box-shadow: -3px -3px 8px rgba(34, 49, 39, 0.05);
}

.export-menu[data-placement="top"]::before {
  bottom: 0;
  border-right: 1px solid rgba(34, 49, 39, 0.12);
  border-bottom: 1px solid rgba(34, 49, 39, 0.12);
  transform: translate(-50%, 52%) rotate(45deg);
  box-shadow: 3px 3px 8px rgba(34, 49, 39, 0.05);
}

.export-option {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.export-option:hover,
.export-option:focus-visible {
  background: rgba(159, 90, 51, 0.08);
}

.export-option.selected {
  background: rgba(159, 90, 51, 0.12);
}

.export-option.selected strong {
  color: var(--accent);
}

.export-option:active {
  transform: scale(0.985);
}

.export-option strong {
  font-size: 14px;
  font-weight: 700;
}

.export-option span {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.composer {
  position: relative;
  z-index: 1;
  margin: 8px auto 0;
  width: min(920px, 100%);
}

.composer-input-shell {
  position: relative;
  padding: 8px 12px 8px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(253, 250, 243, 0.94)),
    rgba(253, 250, 243, 0.92);
  box-shadow: 0 24px 52px rgba(58, 48, 34, 0.12);
  backdrop-filter: blur(18px);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.composer-edit-inline-cancel {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(34, 49, 39, 0.1);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-soft);
  font-size: 28px;
  line-height: 1;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.composer-edit-inline-cancel[hidden] {
  display: none;
}

.composer.is-editing #queryInput {
  padding-left: 48px;
}

.composer-input-shell:focus-within {
  border-color: rgba(159, 90, 51, 0.26);
  box-shadow: 0 28px 60px rgba(58, 48, 34, 0.16);
  transform: translateY(-1px);
}

#queryInput {
  min-height: 56px;
  max-height: 220px;
  resize: none;
  padding: 4px 4px 6px;
  line-height: 1.65;
  font-size: 15px;
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}

#queryInput:focus {
  outline: none;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid rgba(34, 49, 39, 0.08);
}

.composer-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
}

.inline-field,
.inline-toggle {
  min-height: 32px;
  border: 1px solid rgba(34, 49, 39, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-field span,
.inline-toggle span {
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.inline-field select {
  width: auto;
  min-width: 92px;
  border: 0;
  background: transparent;
  padding: 0 18px 0 0;
  border-radius: 0;
}

.inline-field select:focus {
  outline: none;
}

.inline-toggle {
  gap: 10px;
}

.inline-toggle input {
  margin: 0;
}

.hint {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

#sendButton {
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  padding: 0;
  color: var(--paper-strong);
  background: linear-gradient(135deg, var(--accent), #bf7043);
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(159, 90, 51, 0.2);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  display: inline-grid;
  place-items: center;
  position: relative;
}

#sendButton:hover:not(:disabled),
#sendButton:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(159, 90, 51, 0.26);
}

#sendButton[data-mode="busy"] {
  background: linear-gradient(135deg, var(--olive), var(--olive-deep));
  box-shadow: 0 12px 26px rgba(49, 69, 56, 0.24);
}

#sendButton[data-mode="busy"]:hover,
#sendButton[data-mode="busy"]:focus-visible {
  box-shadow: 0 16px 30px rgba(49, 69, 56, 0.28);
}

#sendButton .send-icon {
  font-size: 14px;
  line-height: 1;
  transform: translateY(-1px);
}

#sendButton[data-mode="busy"] .send-icon {
  font-size: 11px;
  transform: none;
}

#sendButton[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(34, 49, 39, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 14px 30px rgba(34, 49, 39, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 30;
}

#sendButton[data-tooltip]::before {
  content: "";
  position: absolute;
  right: 16px;
  bottom: calc(100% + 4px);
  width: 10px;
  height: 10px;
  background: rgba(34, 49, 39, 0.94);
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 140ms ease;
  pointer-events: none;
  z-index: 29;
}

#sendButton[data-tooltip]:hover::after,
#sendButton[data-tooltip]:hover::before,
#sendButton[data-tooltip]:focus-visible::after,
#sendButton[data-tooltip]:focus-visible::before {
  opacity: 1;
}

#sendButton[data-tooltip]:hover::after,
#sendButton[data-tooltip]:focus-visible::after {
  transform: translateY(0);
}

.loading::after {
  content: " ···";
  animation: blink 1s infinite;
}

.loading-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(159, 90, 51, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 30px rgba(58, 48, 34, 0.06);
}

.loading-card-title {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}

.loading-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.loading-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(159, 90, 51, 0.1);
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .loading-card {
    padding: 12px 14px;
    border-radius: 16px;
  }

  .loading-card-title {
    font-size: 13px;
  }

  .shell {
    grid-template-columns: 1fr;
    gap: 0;
  }

  body {
    overflow: hidden;
  }

  .chat-stage {
    grid-column: 1;
    grid-row: 1;
    grid-template-rows: 1fr;
    background: transparent !important;
  }

  .shell.sidebar-collapsed .rail-dock {
    display: none;
  }

  .mobile-surface-nav {
    display: none;
  }

  .ghost-icon[data-tooltip]::after,
  .ghost-icon[data-tooltip]::before,
  #sendButton[data-tooltip]::after,
  #sendButton[data-tooltip]::before {
    display: none;
  }

  button,
  summary,
  [role="button"],
  [data-action],
  [data-surface],
  .chip,
  .nav-item,
  .conversation-item,
  .tool-button,
  .ghost,
  .ghost-icon,
  .drawer-close,
  .search-result,
  .graph-recommendation,
  .graph-workspace-item,
  .graph-compare-item,
  .graph-action-button,
  .docs-nav-link,
  .doc-template,
  .doc-section-next,
  .inline-evidence-ref,
  .structured-followup {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(332px, calc(100vw - 40px));
    z-index: 25;
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(18px + env(safe-area-inset-bottom, 0px));
    gap: 14px;
    border-radius: 0 24px 24px 0;
    border-right: 1px solid rgba(34, 49, 39, 0.08);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 24px 0 50px rgba(34, 49, 39, 0.12);
    backdrop-filter: blur(24px);
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }

  .rail button,
  .rail a,
  .rail .nav-item,
  .rail .chip,
  .rail .conversation-item,
  .rail .ghost,
  .rail .ghost-icon,
  .rail .drawer-close {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .rail-head .ghost-icon {
    display: inline-grid;
  }

  #sidebarToggle {
    display: inline-grid;
  }

  .shell.sidebar-open .rail {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .shell.sidebar-collapsed .rail {
    width: min(332px, calc(100vw - 40px));
    padding-left: 14px;
    padding-right: 14px;
    border-color: rgba(34, 49, 39, 0.08);
    transform: translateX(-100%);
  }

  .shell.sidebar-open .rail-backdrop {
    display: block;
  }

  .rail-head {
    align-items: center;
    padding-right: 48px;
    min-height: 38px;
  }

  .mobile-sidebar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(34, 49, 39, 0.08);
    background: rgba(245, 245, 243, 0.98);
  }

  .mobile-sidebar-search-icon {
    flex: 0 0 auto;
    font-size: 18px;
    color: var(--ink-soft);
    line-height: 1;
  }

  .mobile-sidebar-search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    line-height: 1.2;
    outline: none;
    box-shadow: none;
    padding: 0;
  }

  .mobile-sidebar-search-input::placeholder {
    color: var(--ink-soft);
  }

  .mobile-sidebar-search-clear {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 18px;
    line-height: 1;
    padding: 0;
  }

  .brand {
    gap: 10px;
  }

  .brand .eyebrow {
    display: none;
  }

  .brand h1 {
    font-size: 18px;
    line-height: 1.12;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  #sidebarClose {
    top: 0;
    right: 0;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    background: rgba(248, 245, 239, 0.9);
  }

  .rail-nav {
    gap: 4px;
  }

  .nav-item {
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 16px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  .nav-item:hover,
  .nav-item:focus-visible {
    transform: none;
    background: rgba(34, 49, 39, 0.05);
    border-color: transparent;
  }

  .nav-item.active {
    background: rgba(159, 90, 51, 0.1);
    border-color: transparent;
    box-shadow: none;
  }

  .nav-item-accent {
    border-style: solid;
    background: rgba(34, 49, 39, 0.04);
  }

  .nav-icon {
    width: 24px;
    height: 24px;
    border-radius: 0;
    border: 0;
    background: transparent;
    font-size: 18px;
  }

  .nav-copy strong {
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
  }

  .nav-copy span {
    display: none;
  }

  .rail-nav .nav-item[data-action="search-chat"] {
    display: none;
  }

  .rail-nav .nav-item[data-action="new-chat"] {
    order: -1;
  }

  .panel {
    border-radius: 18px;
    background: rgba(250, 250, 248, 0.94);
    border-color: rgba(34, 49, 39, 0.08);
    padding: 12px;
    box-shadow: none;
  }

  .panel h2 {
    margin-bottom: 8px;
    font-size: 14px;
  }

  .chips {
    gap: 8px;
  }

  .chip {
    padding: 9px 12px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.98);
  }

  .conversation-list {
    max-height: none;
    gap: 6px;
  }

  .conversation-item {
    border-radius: 14px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.98);
  }

  .conversation-title {
    font-size: 14px;
  }

  .conversation-meta {
    font-size: 11px;
  }

  .chat-stage {
    min-height: 70vh;
  }

  .history-panel {
    min-height: 220px;
  }

  .chat-header {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 14px;
    right: 14px;
    z-index: 14;
    padding: 0;
    gap: 12px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    border: 0;
    background: transparent;
    pointer-events: none;
  }

  .header-actions {
    display: none;
  }

  .header-main {
    align-items: center;
    width: auto;
    pointer-events: none;
  }

  .header-main .eyebrow {
    display: none;
  }

  .header-main > div {
    display: none;
  }

  #pageTitle {
    display: none;
  }

  #sidebarToggle {
    display: inline-grid;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(34, 49, 39, 0.08);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(34, 49, 39, 0.1);
    backdrop-filter: blur(20px);
    pointer-events: auto;
  }

  .surface-chat,
  .surface-docs,
  .surface-graph {
    padding-top: calc(62px + env(safe-area-inset-top, 0px));
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: 24px;
  }

  .surface-chat {
    padding-top: 4px;
    background: transparent !important;
    padding-bottom: 0;
  }

  .surface-chat:not(.is-empty) {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  .surface-chat.is-empty {
    justify-content: flex-start;
    gap: 16px;
    padding: 12vh 0 calc(28px + env(safe-area-inset-bottom, 0px));
  }

  .empty-hero {
    width: 100%;
    max-width: 440px;
  }

  .empty-hero h3 {
    margin-bottom: 10px;
    font-size: 30px;
  }

  .empty-hero p:last-child {
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.65;
  }

  .hero-action-grid {
    gap: 10px;
  }

  .hero-action-card {
    min-height: 112px;
    padding: 14px 12px;
    border-radius: 18px;
  }

  .hero-action-card strong {
    font-size: 14px;
    margin-bottom: 4px;
  }

  .hero-action-card span {
    font-size: 12px;
    line-height: 1.45;
  }

  .messages {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 0 12px;
    gap: 12px;
    align-items: stretch;
    padding-bottom: calc(var(--mobile-composer-space, 88px) + env(safe-area-inset-bottom, 0px));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .message {
    width: 100%;
    padding: 14px;
    border-radius: 18px;
  }

  .message-head {
    margin-bottom: 8px;
    gap: 10px;
  }

  .meta {
    display: none;
  }

  .message-capabilities {
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .message-capabilities::-webkit-scrollbar {
    display: none;
  }

  .capability-chip {
    flex: 0 0 auto;
    padding: 5px 9px;
    font-size: 11px;
  }

  .structured-view {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 18px;
  }

  .structured-view-head h3 {
    font-size: 16px;
  }

  .message-body {
    font-size: 14px;
    line-height: 1.68;
  }

  .message-body h1 {
    font-size: 22px;
  }

  .message-body h2 {
    font-size: 19px;
  }

  .message-body h3 {
    font-size: 17px;
  }

  .message-tools {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin-top: 12px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .message-tools::-webkit-scrollbar {
    display: none;
  }

  .tool-anchor {
    flex: 0 0 auto;
  }

  .tool-button {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 16px;
  }

  .message-inline-edit {
    align-items: center;
    gap: 8px;
  }

  .message-inline-edit-input {
    min-height: 48px;
    max-height: 160px;
    padding: 10px 14px;
    line-height: 1.42;
  }

  .message-inline-edit-cancel,
  .message-inline-edit-submit {
    width: 36px;
    height: 36px;
    min-height: 36px;
    flex-basis: 36px;
    font-size: 22px;
  }

  .message-inline-edit-submit {
    font-size: 16px;
  }

  .message-details {
    margin-top: 10px;
    padding-top: 10px;
  }

  .message-details summary {
    font-size: 12px;
  }

  .composer {
    width: auto;
    margin-top: 0;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 12;
  }

  .composer-edit-state {
    display: none;
  }

  .composer-input-shell {
    padding: 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .composer-input-shell:focus-within {
    border-color: transparent;
    box-shadow: none;
    transform: none;
  }

  .composer.is-collapsed .composer-input-shell {
    padding: 0;
    border-radius: 0;
  }

  .composer-edit-inline-cancel {
    left: 6px;
    top: 6px;
    width: 32px;
    height: 32px;
    min-height: 32px;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 18px rgba(35, 33, 28, 0.08);
  }

  #queryInput {
    min-height: 28px;
    max-height: 112px;
    font-size: 16px;
    padding: 10px 88px 10px 14px;
    line-height: 1.45;
    transition: height 180ms ease;
    overflow-y: hidden;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(34, 49, 39, 0.08);
    border-radius: 24px;
    box-shadow: 0 14px 30px rgba(35, 33, 28, 0.08);
  }

  .composer.is-collapsed #queryInput {
    min-height: 28px;
    padding: 8px 88px 8px 14px;
    line-height: 1.35;
    border-radius: 999px;
  }

  .composer.is-editing #queryInput {
    padding-left: 44px;
  }

  #queryInput.is-scrollable {
    overflow-y: auto;
  }

  .composer-actions {
    position: absolute;
    right: 10px;
    bottom: 7px;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
    padding-top: 0;
    border-top: 0;
  }

  .composer.is-collapsed .composer-actions {
    gap: 6px;
  }

  .hint {
    display: none;
  }

  .composer-settings {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
    margin-top: 8px;
    overflow: visible;
    scrollbar-width: auto;
  }

  .composer-settings::-webkit-scrollbar {
    display: none;
  }

  .composer.mobile-settings-open .composer-settings {
    display: flex;
  }

  .composer-settings-toggle {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(34, 49, 39, 0.08);
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink-soft);
    flex: 0 0 auto;
    font-size: 12px;
  }

  #sendButton {
    width: 36px;
    height: 36px;
    background: #111111;
    box-shadow: 0 12px 26px rgba(17, 17, 17, 0.18);
  }

  #sendButton:hover:not(:disabled),
  #sendButton:focus-visible:not(:disabled) {
    box-shadow: 0 14px 28px rgba(17, 17, 17, 0.22);
  }

  #sendButton[data-mode="busy"] {
    background: #3f5c4b;
    box-shadow: 0 12px 24px rgba(63, 92, 75, 0.22);
  }

  .inline-field,
  .inline-toggle {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(252, 249, 243, 0.98);
  }

  .inline-field span,
  .inline-toggle span {
    font-size: 12px;
  }

  .inline-field select {
    min-width: 108px;
    max-width: 52%;
    text-align: right;
  }

  .inline-toggle {
    justify-content: flex-start;
    gap: 10px;
  }

  .graph-topbar {
    padding: 12px;
    border-radius: 18px;
  }

  .graph-query {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .graph-actions {
    justify-content: flex-start;
  }

  .graph-scope {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .graph-scope-chip {
    min-width: 0;
  }

  .graph-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .graph-maincolumn,
  .graph-sidepanel {
    gap: 12px;
  }

  .graph-canvas-card,
  .graph-panel,
  .graph-compare-surface {
    border-radius: 18px;
  }

  .graph-canvas-card {
    padding: 12px;
  }

  .graph-canvas {
    min-height: 520px;
    border-radius: 16px;
  }

  .graph-sidepanel {
    order: 2;
  }

  .graph-panel {
    padding: 12px;
  }

  .graph-compare-toolbar,
  .graph-compare-filter {
    flex-wrap: wrap;
  }

  .graph-compare-cards,
  .graph-compare-summary {
    grid-template-columns: 1fr;
  }

  .graph-detail-drawer {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: min(68dvh, 620px);
    border-radius: 24px;
    transform: translateY(calc(100% + 18px));
  }

  .graph-detail-drawer.open {
    transform: translateY(0);
  }

  .graph-detail-drawer.collapsed {
    width: auto;
    height: 70px;
  }

  .graph-detail-drawer.collapsed .graph-detail {
    display: none;
  }

  .graph-detail-drawer.collapsed .graph-detail-drawer-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 12px 14px;
  }

  .graph-detail-drawer.collapsed .graph-detail-drawer-head::after {
    content: none;
  }

  .graph-detail-drawer.collapsed .graph-detail-drawer-head .eyebrow,
  .graph-detail-drawer.collapsed .graph-detail-drawer-head h3 {
    display: block;
  }

  .graph-detail-drawer.collapsed .graph-detail-drawer-head .graph-source-badge-inline {
    display: none;
  }

  .graph-detail-drawer.collapsed .graph-detail-drawer-actions {
    flex-direction: row;
    width: auto;
  }

  .graph-detail {
    padding: 12px 14px 16px;
  }

  .surface-docs {
    padding-top: 14px;
  }

}

@media (max-width: 720px) {
  .shell {
    padding: 0;
    gap: 0;
  }

  .chat-stage {
    border-radius: 0;
    padding: 0;
  }

  .message {
    padding: 16px;
  }

  .chat-header {
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 12px;
    right: 12px;
  }

  .header-main {
    width: auto;
  }

  #pageTitle {
    display: none;
  }

  .empty-hero h3,
  .doc-article h3 {
    font-size: 28px;
  }

  .doc-hero,
  .doc-grid-2,
  .doc-grid-3 {
    grid-template-columns: 1fr;
  }

  .hero-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .structured-view-grid {
    grid-template-columns: 1fr;
  }

  .composer-actions {
    flex-direction: row;
    align-items: center;
  }

  .composer-settings {
    flex-direction: row;
  }

  .inline-field,
  .inline-toggle {
    width: auto;
  }

  .composer {
    padding: 10px 12px;
  }

  .surface-chat,
  .surface-docs {
    padding-left: 12px;
    padding-right: 12px;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .evidence-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(78dvh, 760px);
    border-radius: 24px 24px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .search-dialog {
    top: 12px;
    width: calc(100% - 24px);
    padding: 16px;
  }
}
