:root {
  --bg: #f2f1ed;
  --panel: #ffffff;
  --panel-alt: #f8f7f3;
  --panel-strong: #202723;
  --ink: #202420;
  --muted: #6f746f;
  --line: #dedfd9;
  --line-strong: #c7cac2;
  --gold: #a47725;
  --gold-soft: #f5eddc;
  --green: #267451;
  --green-soft: #e9f3ed;
  --blue: #326e8d;
  --blue-soft: #e9f1f5;
  --red: #a64843;
  --red-soft: #f8ecea;
  --shadow: 0 12px 32px rgba(42, 47, 40, 0.08);
  --header-height: 62px;
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #0e1210;
  --panel: #151a17;
  --panel-alt: #1b211d;
  --panel-strong: #edf0eb;
  --ink: #edf0eb;
  --muted: #9ca49c;
  --line: #2c342e;
  --line-strong: #465047;
  --gold: #d1aa57;
  --gold-soft: #302817;
  --green: #73bb90;
  --green-soft: #1d3326;
  --blue: #83b8d2;
  --blue-soft: #1d3039;
  --red: #df8b82;
  --red-soft: #3d2927;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}

button,
textarea,
a {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.assistant-app {
  width: 100%;
  height: 100%;
}

.assistant-header {
  position: relative;
  z-index: 30;
  height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(14px);
}

.assistant-header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  height: 100%;
  padding: 0 18px;
}

.assistant-brand-row,
.assistant-header-actions,
.assistant-runtime,
.assistant-brand {
  display: flex;
  align-items: center;
}

.assistant-brand-row {
  min-width: 0;
  gap: 8px;
}

.assistant-brand {
  min-width: 0;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.assistant-brand img {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.assistant-brand span {
  overflow: hidden;
  font-size: 16px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-brand strong {
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 11px;
}

.assistant-runtime {
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 11px;
}

.runtime-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 16%, transparent);
}

.runtime-dot.is-ready {
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 16%, transparent);
}

.runtime-dot.is-error {
  background: var(--red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 16%, transparent);
}

.assistant-header-actions {
  justify-content: flex-end;
  gap: 7px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 120ms ease, background 120ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-alt);
}

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: calc(100% - var(--header-height));
  min-height: 0;
}

.conversation-sidebar {
  position: fixed;
  z-index: 20;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: min(304px, 88vw);
  min-width: 0;
  transform: translateX(-102%);
  border-right: 1px solid var(--line);
  background: var(--panel-alt);
  box-shadow: 18px 0 42px rgba(0, 0, 0, 0.18);
  transition: transform 160ms ease;
}

body[data-sidebar-open="true"] .conversation-sidebar {
  transform: translateX(0);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 14px;
}

.sidebar-head > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-head strong {
  font-size: 15px;
}

.sidebar-kicker,
.sidebar-section-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.sidebar-kicker {
  color: var(--gold);
}

.new-chat-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 0 12px 18px;
  padding: 0 12px;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.sidebar-section-label {
  padding: 0 14px 7px;
}

.conversation-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 7px 10px;
}

.conversation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  min-height: 42px;
  margin-bottom: 3px;
  border-radius: 6px;
}

.conversation-row.is-active {
  background: var(--panel);
  box-shadow: inset 2px 0 0 var(--gold);
}

.conversation-select,
.conversation-remove {
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.conversation-select {
  min-width: 0;
  overflow: hidden;
  padding: 8px 9px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.conversation-remove {
  color: var(--muted);
  opacity: 0;
}

.conversation-row:hover .conversation-remove,
.conversation-remove:focus-visible {
  opacity: 1;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.sidebar-foot strong {
  color: var(--green);
}

.sidebar-scrim {
  position: fixed;
  z-index: 15;
  inset: var(--header-height) 0 0;
  visibility: hidden;
  border: 0;
  background: rgba(11, 14, 12, 0.42);
  opacity: 0;
  transition: opacity 160ms ease, visibility 160ms ease;
}

body[data-sidebar-open="true"] .sidebar-scrim {
  visibility: visible;
  opacity: 1;
}

.conversation-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  background: var(--panel);
}

.transcript {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 24px max(24px, calc((100% - 1120px) / 2)) 38px;
}

.assistant-welcome {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 18px 0 30px;
  text-align: left;
}

.welcome-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.welcome-mark,
.assistant-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line));
  background: var(--gold-soft);
}

.welcome-mark {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.welcome-mark img {
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.welcome-eyebrow,
.report-eyebrow {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
}

.assistant-welcome h1 {
  margin: 2px 0 0;
  font-size: 34px;
  line-height: 1.1;
}

.welcome-intro {
  width: min(650px, 100%);
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.welcome-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
  gap: 6px;
}

.welcome-proof > span {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 9px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 10px;
}

.welcome-proof i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.welcome-proof strong {
  color: var(--ink);
}

.quick-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  gap: 10px;
}

.quick-group {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 8px;
  background: var(--panel-alt);
}

.quick-group[data-intent="hero-build"] {
  border-top-color: var(--green);
}

.quick-group[data-intent="item-carriers"] {
  border-top-color: var(--blue);
}

.quick-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.quick-group-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
}

.quick-group[data-intent="hero-build"] .quick-group-index {
  color: var(--green);
}

.quick-group[data-intent="item-carriers"] .quick-group-index {
  color: var(--blue);
}

.quick-group-eyebrow {
  color: var(--muted);
  font-size: 10px;
}

.quick-group h2 {
  margin: 1px 0 0;
  font-size: 16px;
}

.quick-group > p {
  min-height: 36px;
  margin: 9px 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.quick-prompts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-prompt,
.suggestion-button,
.entity-option {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.quick-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 30px;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 11px;
}

.quick-prompt:hover {
  background: var(--panel);
  color: var(--ink);
}

.quick-prompt b {
  color: var(--gold);
  font-weight: 500;
}

.scenario-gallery {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.scenario-gallery-head,
.scenario-card {
  display: flex;
  align-items: center;
}

.scenario-gallery-head {
  justify-content: space-between;
  margin-bottom: 9px;
}

.scenario-gallery-head > div > span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 750;
}

.scenario-gallery h2 {
  margin: 1px 0 0;
  font-size: 14px;
}

.scenario-count {
  color: var(--muted);
  font-size: 10px;
}

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

.scenario-card {
  min-width: 0;
  min-height: 48px;
  padding: 6px 8px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.scenario-card:hover {
  border-color: var(--line-strong);
  background: var(--panel);
}

.scenario-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.scenario-card > span:nth-child(2) {
  min-width: 0;
  flex: 1 1 auto;
}

.scenario-card strong,
.scenario-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenario-card strong {
  font-size: 11px;
}

.scenario-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.scenario-card b {
  color: var(--muted);
  font-weight: 500;
}

.message-row {
  display: flex;
  width: min(100%, 1120px);
  margin: 0 auto 24px;
}

.message-row.is-user {
  justify-content: flex-end;
}

.message-row.is-assistant {
  align-items: flex-start;
  gap: 9px;
}

.assistant-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.assistant-avatar img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.user-message {
  width: fit-content;
  max-width: min(76%, 720px);
  padding: 11px 14px;
  border-radius: 8px 3px 8px 8px;
  background: var(--panel-strong);
  color: var(--panel);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
}

:root[data-theme="dark"] .user-message {
  color: #141814;
}

.assistant-message {
  width: min(1040px, calc(100% - 43px));
  min-width: 0;
}

.assistant-message-head {
  display: flex;
  align-items: baseline;
  min-height: 27px;
  gap: 7px;
}

.assistant-message-head strong {
  font-size: 13px;
}

.assistant-message-head span {
  color: var(--muted);
  font-size: 10px;
}

.assistant-summary {
  margin: 6px 0 12px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.75;
}

.thinking-panel {
  overflow: hidden;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
  color: var(--muted);
}

.thinking-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 10px;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-size: 11px;
}

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

.thinking-panel summary > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 650;
}

.thinking-panel summary i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.thinking-panel summary b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.thinking-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 9px 9px;
  gap: 6px;
}

.thinking-step {
  display: flex;
  align-items: flex-start;
  min-height: 43px;
  padding: 7px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  font-size: 10px;
  line-height: 1.45;
}

.thinking-step > span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
}

.thinking-step.is-active {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  background: var(--green-soft);
  color: var(--ink);
}

.thinking-panel .plan-line {
  margin: 0;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.thinking-panel .plan-line strong {
  color: var(--green);
  font-family: ui-monospace, "Cascadia Code", monospace;
}

.thinking-panel.is-loading {
  padding-top: 9px;
}

.result-report,
.result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 13px 15px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-alt);
}

.report-head h2,
.report-head h3,
.dossier-head h3,
.availability-report h2 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.25;
}

.report-head p,
.dossier-head p,
.availability-report p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.report-count,
.sample-badge,
.tier-badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.tier-badge {
  border-color: var(--gold);
  background: var(--gold);
  color: #171913;
}

.query-scope {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  padding: 9px 13px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--gold-soft) 50%, var(--panel));
}

.query-scope-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 10px;
}

.query-scope-label span {
  color: var(--muted);
}

.query-chips,
.trait-strip,
.owned-items,
.result-actions,
.suggestions,
.answer-evidence,
.context-links,
.composition-row,
.fact-display-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.query-chips {
  gap: 5px;
}

.query-chip {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10px;
}

.query-chip.is-included {
  border-color: color-mix(in srgb, var(--green) 40%, var(--line));
  color: var(--green);
}

.query-chip.is-excluded {
  border-color: color-mix(in srgb, var(--red) 40%, var(--line));
  color: var(--red);
  text-decoration: line-through;
}

.query-chip.is-objective {
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
  color: var(--gold);
}

.query-chip.is-ignored {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
  color: var(--blue);
}

.comp-switcher {
  display: flex;
  overflow-x: auto;
  padding: 8px;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.emblem-evidence {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--blue-soft);
}

.emblem-evidence-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.emblem-evidence-title > span {
  min-width: 0;
}

.emblem-evidence-title strong,
.emblem-evidence-title small {
  display: block;
}

.emblem-evidence-title strong {
  font-size: 11px;
}

.emblem-evidence-title small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.emblem-carriers {
  display: flex;
  overflow-x: auto;
  margin-top: 8px;
  gap: 5px;
}

.emblem-carriers > span {
  display: grid;
  grid-template-columns: 16px 30px minmax(54px, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  flex: 0 0 154px;
  min-width: 0;
  padding: 5px;
  gap: 2px 5px;
  border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line));
  border-radius: 5px;
  background: var(--panel);
}

.emblem-carriers b {
  grid-row: 1 / 3;
  color: var(--blue);
  font-size: 10px;
  text-align: center;
}

.emblem-carriers i {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  border-radius: 5px;
}

.emblem-carriers img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.emblem-carriers strong,
.emblem-carriers small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emblem-carriers strong {
  font-size: 10px;
}

.emblem-carriers small {
  color: var(--muted);
  font-size: 10px;
}

.comp-switch {
  display: grid;
  grid-template-columns: 24px minmax(120px, 1fr);
  grid-template-rows: auto auto;
  flex: 0 0 min(190px, 46vw);
  min-width: 0;
  padding: 7px 8px;
  column-gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-alt);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.comp-switch > span {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
}

.comp-switch strong,
.comp-switch small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comp-switch strong {
  font-size: 11px;
}

.comp-switch small {
  color: var(--muted);
  font-size: 10px;
}

.comp-switch.is-active {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.dossier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 75px;
  padding: 13px 15px;
  gap: 12px;
}

.dossier-badges {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
}

.dossier-body {
  padding: 0 14px 13px;
}

.stat-grid,
.baseline-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(94px, 1fr);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
}

.stat-cell,
.baseline-grid > div {
  min-width: 0;
  padding: 10px 8px;
  border-left: 1px solid var(--line);
  text-align: center;
}

.stat-cell:first-child,
.baseline-grid > div:first-child {
  border-left: 0;
}

.stat-cell strong,
.stat-cell span,
.baseline-grid strong,
.baseline-grid span {
  display: block;
}

.stat-cell strong,
.baseline-grid strong {
  font-size: 17px;
}

.stat-cell span,
.baseline-grid span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.stat-cell[data-tone="good"] strong {
  color: var(--green);
}

.stat-cell[data-tone="accent"] strong {
  color: var(--gold);
}

.dossier-section,
.report-section,
.fact-body {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 9px;
  gap: 10px;
}

.section-heading strong {
  font-size: 12px;
}

.section-heading span {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.trait-strip {
  gap: 6px;
}

.trait-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 7px;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-alt);
  font-size: 11px;
}

.trait-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.2);
}

:root[data-theme="dark"] .trait-chip img {
  filter: grayscale(1) brightness(1.8);
}

.trait-chip b {
  color: var(--gold);
}

.comp-roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.comp-unit {
  display: grid;
  grid-template-columns: 48px minmax(92px, 1fr) auto;
  align-items: center;
  min-width: 0;
  min-height: 62px;
  padding: 7px;
  gap: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.comp-unit:nth-child(4n + 2),
.comp-unit:nth-child(4n + 3) {
  background: var(--panel-alt);
}

.comp-unit-portrait,
.report-entity-avatar,
.table-hero {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  background: var(--panel-alt);
}

.comp-unit-portrait {
  width: 46px;
  height: 46px;
  border-radius: 6px;
}

.comp-unit-portrait img,
.report-entity-avatar img,
.table-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

[data-cost="1"] {
  border-color: #8c928d;
}

[data-cost="2"] {
  border-color: #3b966c;
}

[data-cost="3"] {
  border-color: #4383aa;
}

[data-cost="4"] {
  border-color: #9e58ac;
}

[data-cost="5"] {
  border-color: #c3942f;
}

.unit-role {
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-width: 20px;
  padding: 2px 3px;
  border-radius: 3px;
  background: rgba(20, 24, 21, 0.9);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.unit-stars {
  position: absolute;
  top: 1px;
  left: 2px;
  color: #ffd46e;
  font-size: 8px;
  text-shadow: 0 1px 2px #000;
}

.comp-unit-info {
  min-width: 0;
}

.comp-unit-info strong,
.comp-unit-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comp-unit-info strong {
  font-size: 12px;
}

.comp-unit-info span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.comp-unit-items,
.combo-items {
  display: flex;
  align-items: center;
  gap: 3px;
}

.item-icon {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--panel-alt);
}

.item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.unit-no-items {
  color: var(--muted);
  font-size: 10px;
}

.special-allocation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.special-allocation-list > span {
  display: grid;
  grid-template-columns: 30px minmax(86px, 1fr) 16px 30px minmax(72px, 1fr) auto;
  align-items: center;
  min-height: 46px;
  padding: 6px;
  gap: 5px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.special-allocation-list i,
.special-allocation-list em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  font-style: normal;
}

.special-allocation-list b,
.special-allocation-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.special-allocation-list em {
  color: var(--muted);
}

.allocation-hero {
  width: 30px;
  height: 30px;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  border-radius: 5px;
}

.allocation-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.special-allocation-list small {
  color: var(--muted);
  white-space: nowrap;
}

.special-allocation-list small[data-tone="good"] {
  color: var(--green);
}

.special-allocation-list small[data-tone="bad"] {
  color: var(--red);
}

.decision-signals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
}

.decision-signals > span {
  padding: 8px;
  border-left: 1px solid var(--line);
  text-align: center;
}

.decision-signals > span:first-child {
  border-left: 0;
}

.decision-signals small,
.decision-signals strong {
  display: block;
}

.decision-signals small {
  color: var(--muted);
  font-size: 10px;
}

.decision-signals strong {
  margin-top: 2px;
  font-size: 12px;
}

.result-actions {
  justify-content: flex-end;
  margin-top: 12px;
  gap: 6px;
}

.result-link,
.result-command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

.result-link:hover,
.result-command:hover {
  border-color: var(--gold);
}

.result-link.is-primary {
  border-color: var(--panel-strong);
  background: var(--panel-strong);
  color: var(--panel);
}

:root[data-theme="dark"] .result-link.is-primary {
  color: #141814;
}

.report-scope {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 12px;
  gap: 5px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 10px;
}

.scope-note {
  color: var(--gold);
}

.entity-report-head {
  justify-content: flex-start;
}

.entity-report-head > div {
  min-width: 0;
  flex: 1 1 auto;
}

.report-entity-avatar {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 7px;
}

.report-entity-avatar.is-item {
  border-width: 1px;
}

.report-item-stack {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  min-width: 52px;
}

.report-item-stack img {
  width: 38px;
  height: 38px;
  margin-left: -9px;
  border: 2px solid var(--panel);
  border-radius: 7px;
  object-fit: cover;
}

.report-item-stack img:first-child {
  margin-left: 0;
}

.baseline-grid {
  margin: 12px;
}

.owned-items {
  min-height: 42px;
  padding: 8px 12px;
  gap: 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--gold-soft);
  color: var(--muted);
  font-size: 10px;
}

.owned-item {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 6px 3px 3px;
  gap: 5px;
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
  border-radius: 5px;
  background: var(--panel);
  color: var(--ink);
  font-size: 10px;
}

.owned-item img {
  width: 20px;
  height: 20px;
  border-radius: 3px;
}

.report-warning {
  margin: 10px 12px 0;
  padding: 8px 10px;
  border: 1px dashed color-mix(in srgb, var(--gold) 55%, var(--line));
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.hero-build-report .report-section,
.item-carriers-report .report-section,
.ranked-report .data-table-scroll,
.entity-fact-report .report-section,
.entity-fact-report .fact-body {
  margin: 0 12px;
}

.compact-section {
  padding-bottom: 11px;
}

.data-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  scrollbar-width: thin;
}

.build-combo-table,
.single-item-table,
.carrier-table,
.ranked-table {
  min-width: 900px;
}

.build-combo-row,
.single-item-row,
.carrier-report-row,
.ranked-row {
  display: grid;
  align-items: center;
  min-height: 58px;
  padding: 7px 9px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.build-combo-row:last-child,
.single-item-row:last-child,
.carrier-report-row:last-child,
.ranked-row:last-child {
  border-bottom: 0;
}

.build-combo-row:nth-child(even),
.single-item-row:nth-child(even),
.carrier-report-row:nth-child(even),
.ranked-row:nth-child(even) {
  background: var(--panel-alt);
}

.build-combo-row {
  grid-template-columns: 28px 104px minmax(180px, 1fr) repeat(5, 62px);
}

.single-item-row,
.carrier-report-row {
  grid-template-columns: 28px 34px minmax(180px, 1fr) repeat(6, 62px);
}

.ranked-row {
  grid-template-columns: 28px 34px minmax(180px, 1fr) repeat(5, 66px);
}

.is-low-sample {
  opacity: 0.72;
}

.table-rank {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.combo-name {
  min-width: 0;
}

.combo-name strong,
.combo-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combo-name strong {
  font-size: 11px;
}

.combo-name small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.table-metric {
  text-align: right;
}

.table-metric strong,
.table-metric small {
  display: block;
}

.table-metric strong {
  font-size: 11px;
}

.table-metric small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.table-metric[data-tone="good"] strong {
  color: var(--green);
}

.table-metric[data-tone="bad"] strong {
  color: var(--red);
}

.table-hero {
  width: 34px;
  height: 34px;
  border-radius: 5px;
}

.context-links {
  gap: 6px;
}

.context-links a {
  display: flex;
  flex-direction: column;
  min-width: 160px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}

.context-links a:hover {
  border-color: var(--gold);
}

.context-links strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-links span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.hero-build-report > .result-actions,
.item-carriers-report > .result-actions,
.entity-fact-report > .result-actions {
  padding: 0 12px 12px;
}

.empty-copy {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.entity-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.entity-option {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 5px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-alt);
  color: var(--ink);
  font-size: 11px;
}

.entity-option:hover {
  border-color: var(--gold);
}

.entity-option img {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  object-fit: cover;
}

.fact-tags {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.fact-tags-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

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

.fact-stat-grid > span {
  padding: 9px;
  border-left: 1px solid var(--line);
  text-align: center;
}

.fact-stat-grid > span:first-child {
  border-left: 0;
}

.fact-stat-grid b,
.fact-stat-grid small {
  display: block;
}

.fact-stat-grid b {
  font-size: 13px;
}

.fact-stat-grid small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.fact-body h3 {
  margin: 0 0 7px;
  font-size: 14px;
}

.fact-body p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.fact-stat-line {
  margin-bottom: 7px !important;
  color: var(--green) !important;
  font-weight: 700;
}

.fact-display-stats,
.composition-row {
  padding: 9px 12px;
  gap: 6px;
  border-bottom: 1px solid var(--line);
}

.fact-display-stats > span,
.composition-row > span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 7px;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10px;
}

.fact-display-stats img,
.composition-row img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.member-grid > span {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.member-grid img {
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  object-fit: cover;
}

.member-grid b,
.member-grid small {
  overflow: hidden;
  padding-left: 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-grid b {
  font-size: 10px;
}

.member-grid small {
  color: var(--muted);
  font-size: 10px;
}

.availability-report {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  padding: 14px;
  gap: 12px;
}

.availability-symbol,
.route-symbol {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 17px;
  font-weight: 800;
}

.availability-report[data-status="unavailable"] .availability-symbol {
  background: var(--red-soft);
  color: var(--red);
}

.availability-report .report-scope {
  grid-column: 1 / -1;
  margin: 4px -14px -14px;
}

.tool-route-card .entity-card-head {
  display: flex;
  align-items: center;
  min-height: 68px;
  padding: 12px;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-alt);
}

.entity-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel-alt);
}

.entity-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-card-kicker {
  color: var(--gold) !important;
  font-size: 10px !important;
  font-weight: 800;
}

.tool-route-card .result-card-body {
  padding: 12px;
}

.entity-title {
  min-width: 0;
}

.entity-title strong,
.entity-title span {
  display: block;
}

.entity-title strong {
  font-size: 14px;
}

.entity-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.suggestions {
  margin-top: 9px;
  gap: 5px;
}

.suggestion-button {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 4px 7px;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-alt);
  color: var(--ink);
  font-size: 10px;
}

.suggestion-button span {
  color: var(--gold);
  font-weight: 700;
}

.suggestion-button b {
  color: var(--muted);
  font-weight: 500;
}

.answer-evidence {
  margin-top: 9px;
  gap: 5px;
}

.answer-evidence > span {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
}

.plan-line {
  color: var(--muted);
  font-size: 10px;
}

.composer-wrap {
  position: relative;
  z-index: 10;
  padding: 7px max(16px, calc((100% - 860px) / 2)) 12px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  backdrop-filter: blur(12px);
}

.intent-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(560px, 100%);
  margin: 0 auto 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
}

.intent-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 30px;
  padding: 0 7px;
  gap: 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.intent-tab[aria-pressed="true"] {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(32, 38, 33, 0.08);
}

.intent-symbol {
  color: var(--gold);
}

.composer {
  position: relative;
  width: min(820px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.composer:focus-within {
  border-color: var(--gold);
}

.composer-label {
  position: absolute;
  top: 11px;
  right: 52px;
  left: 13px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer.has-value .composer-label {
  display: none;
}

#question-input {
  display: block;
  width: 100%;
  min-height: 42px;
  max-height: 118px;
  padding: 8px 50px 2px 13px;
  resize: none;
  overflow-y: auto;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  outline: 0;
}

#question-input:disabled {
  cursor: not-allowed;
}

.composer-actions {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 2px 7px 6px 9px;
  gap: 7px;
}

.intent-chip {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 4px 6px;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.composer-status {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.send-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--panel);
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
}

:root[data-theme="dark"] .send-button {
  color: #141814;
}

.send-button.is-stop {
  background: var(--red);
  color: #fff;
}

.send-button:disabled {
  background: var(--line-strong);
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .transcript {
    padding-right: 16px;
    padding-left: 16px;
  }

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

  .quick-group:last-child {
    grid-column: 1 / -1;
  }

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

  .comp-roster {
    grid-template-columns: minmax(0, 1fr);
  }

  .comp-unit:nth-child(even) {
    background: var(--panel-alt);
  }

  .comp-unit:nth-child(odd) {
    background: var(--panel);
  }

  .special-allocation-list {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 640px) {
  :root {
    --header-height: 58px;
  }

  .assistant-header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 9px;
  }

  .assistant-runtime {
    display: none;
  }

  .assistant-brand img {
    width: 27px;
    height: 27px;
  }

  .assistant-brand span {
    font-size: 14px;
  }

  .assistant-brand strong,
  .back-button {
    display: none;
  }

  .transcript {
    padding: 13px 9px 24px;
  }

  .assistant-welcome {
    padding: 7px 0 20px;
  }

  .welcome-heading {
    justify-content: flex-start;
  }

  .welcome-mark {
    width: 46px;
    height: 46px;
  }

  .welcome-mark img {
    width: 39px;
    height: 39px;
  }

  .assistant-welcome h1 {
    font-size: 26px;
  }

  .welcome-intro {
    margin-top: 9px;
    font-size: 12px;
    text-align: left;
  }

  .welcome-proof {
    justify-content: flex-start;
    margin-top: 9px;
  }

  .welcome-proof > span {
    padding: 0 7px;
    font-size: 10px;
  }

  .quick-groups {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 12px;
    gap: 7px;
  }

  .quick-group,
  .quick-group:last-child {
    grid-column: auto;
    padding: 11px;
  }

  .quick-group > p {
    min-height: auto;
    margin: 7px 0 5px;
  }

  .quick-prompts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .scenario-gallery {
    padding: 10px;
  }

  .scenario-gallery-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

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

  .message-row {
    margin-bottom: 19px;
  }

  .message-row.is-assistant {
    gap: 6px;
  }

  .assistant-avatar {
    width: 30px;
    height: 30px;
  }

  .assistant-avatar img {
    width: 27px;
    height: 27px;
  }

  .assistant-message {
    width: calc(100% - 36px);
  }

  .user-message {
    max-width: 88%;
  }

  .thinking-timeline {
    grid-template-columns: minmax(0, 1fr);
  }

  .thinking-step {
    min-height: 35px;
  }

  .report-head,
  .dossier-head {
    align-items: flex-start;
    min-height: 66px;
    padding: 10px;
  }

  .report-head h2,
  .dossier-head h3 {
    font-size: 16px;
  }

  .report-count {
    font-size: 10px;
  }

  .query-scope {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .query-scope-label {
    flex-direction: row;
    justify-content: space-between;
  }

  .comp-switch {
    flex-basis: 176px;
  }

  .dossier-body {
    padding: 0 9px 10px;
  }

  .comp-unit {
    grid-template-columns: 44px minmax(82px, 1fr) auto;
    min-height: 58px;
    padding: 6px;
  }

  .comp-unit-portrait {
    width: 42px;
    height: 42px;
  }

  .item-icon {
    width: 27px;
    height: 27px;
  }

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

  .decision-signals > span:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .decision-signals > span:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .result-actions {
    justify-content: stretch;
  }

  .result-actions > * {
    flex: 1 1 auto;
  }

  .baseline-grid {
    margin: 9px;
  }

  .hero-build-report .report-section,
  .item-carriers-report .report-section,
  .ranked-report .data-table-scroll,
  .entity-fact-report .report-section,
  .entity-fact-report .fact-body {
    margin: 0 9px;
  }

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

  .fact-stat-grid > span:nth-child(4) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .fact-stat-grid > span:nth-child(n + 5) {
    border-top: 1px solid var(--line);
  }

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

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

  .availability-report {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 10px;
  }

  .availability-symbol {
    width: 36px;
    height: 36px;
  }

  .availability-report > .result-link {
    grid-column: 1 / -1;
  }

  .availability-report .report-scope {
    margin: 3px -10px -10px;
  }

  .composer-wrap {
    padding: 5px 7px max(8px, env(safe-area-inset-bottom));
  }

  .intent-tabs {
    margin-bottom: 4px;
  }

  .intent-tab {
    min-height: 29px;
    padding: 0 4px;
  }

  .intent-symbol {
    display: none;
  }

  .composer-label {
    max-width: calc(100% - 68px);
  }

  .composer-status {
    font-size: 10px;
  }
}

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

/* Product-facing report pass: keep the data dense, but remove developer chrome. */
:root {
  --report-serif: ui-serif, "Songti SC", "STSong", "SimSun", serif;
}

.assistant-message-head span {
  display: none;
}

.assistant-message-head strong {
  font-size: 15px;
}

.assistant-process {
  display: flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 9px;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.assistant-process time {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.process-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent);
}

.assistant-process.is-loading .process-dot {
  animation: assistant-pulse 1.1s ease-in-out infinite;
}

.process-ellipsis {
  width: 20px;
  overflow: hidden;
  color: var(--gold);
  letter-spacing: 2px;
  animation: assistant-ellipsis 1.1s steps(4, end) infinite;
}

@keyframes assistant-pulse {
  0%, 100% { opacity: .45; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes assistant-ellipsis {
  0% { width: 4px; }
  33% { width: 10px; }
  66% { width: 16px; }
  100% { width: 20px; }
}

.result-report,
.result-card {
  border-radius: 11px;
  box-shadow: 0 10px 26px rgba(42, 47, 40, 0.06);
}

.report-head {
  min-height: 84px;
  padding: 17px 19px;
}

.report-head h2,
.dossier-head h3,
.availability-report h2 {
  font-family: var(--report-serif);
  font-weight: 700;
  letter-spacing: 0;
}

.report-head h2 {
  font-size: 23px;
}

.report-head p,
.dossier-head p,
.availability-report p {
  font-size: 12px;
}

.query-scope {
  padding: 12px 18px;
}

.query-scope-label {
  font-size: 12px;
}

.query-scope-label strong {
  margin-top: 2px;
  font-size: 13px;
}

.query-chip {
  padding: 5px 9px;
  font-size: 11px;
}

.comp-switcher {
  padding: 10px 11px;
  gap: 8px;
  background: var(--panel-alt);
}

.comp-switch {
  flex-basis: 210px;
  min-height: 62px;
  padding: 9px 10px;
  border-radius: 8px;
}

.comp-switch strong {
  font-size: 13px;
}

.comp-switch small {
  margin-top: 4px;
  font-size: 11px;
}

.dossier-head {
  min-height: 92px;
  padding: 17px 19px;
}

.dossier-head h3 {
  font-size: 23px;
}

.dossier-head p {
  font-size: 13px;
}

.dossier-body {
  padding: 0 18px 18px;
}

.stat-grid,
.baseline-grid {
  border-radius: 9px;
}

.stat-cell,
.baseline-grid > div {
  padding: 13px 10px;
}

.stat-cell strong,
.baseline-grid strong {
  font-family: var(--report-serif);
  font-size: 22px;
}

.stat-cell span,
.baseline-grid span {
  margin-top: 5px;
  font-size: 11px;
}

.dossier-section,
.report-section,
.fact-body {
  padding: 16px 0;
}

.section-heading {
  margin-bottom: 11px;
}

.section-heading strong {
  font-size: 14px;
}

.section-heading span {
  font-size: 11px;
}

.trait-chip {
  min-height: 31px;
  padding: 4px 9px;
  font-size: 12px;
}

.comp-roster {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 0;
}

.comp-unit,
.comp-unit:nth-child(4n + 2),
.comp-unit:nth-child(4n + 3) {
  min-height: 86px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.comp-unit:nth-child(even) {
  background: var(--panel-alt);
}

.comp-unit-info strong {
  font-size: 13px;
}

.comp-unit-info span {
  margin-top: 3px;
  font-size: 11px;
}

.item-icon {
  width: 29px;
  height: 29px;
}

.decision-signals {
  margin-top: 15px;
  border-radius: 9px;
}

.decision-signals small {
  font-size: 11px;
}

.decision-signals strong {
  font-size: 14px;
}

.report-scope {
  padding: 10px 16px;
  font-size: 11px;
}

.answer-evidence {
  display: none;
}

.item-category-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 10px;
}

.item-category-rail > span {
  display: inline-flex;
  align-items: baseline;
  min-height: 27px;
  padding: 4px 8px;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-alt);
  color: var(--ink);
}

.item-category-rail b {
  font-size: 11px;
}

.item-category-rail small {
  color: var(--muted);
  font-size: 10px;
}

.item-category-rail > span[data-category="artifact"] {
  border-color: color-mix(in srgb, var(--blue) 45%, var(--line));
}

.item-category-rail > span[data-category="radiant"] {
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
}

.item-category-rail > span[data-category="emblem"] {
  border-color: color-mix(in srgb, #a963a9 55%, var(--line));
}

.intent-tabs {
  width: min(620px, 100%);
  margin-bottom: 8px;
  padding: 4px;
  border-radius: 9px;
}

.intent-tab {
  min-height: 38px;
  font-size: 13px;
}

.composer {
  border-radius: 11px;
}

#question-input {
  min-height: 47px;
  padding-top: 10px;
  font-size: 16px;
}

.composer-status {
  font-size: 11px;
}

@media (max-width: 900px) {
  .comp-roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .report-head {
    min-height: 78px;
    padding: 13px 12px;
  }

  .report-head h2 {
    font-size: 20px;
  }

  .dossier-head {
    min-height: 82px;
    padding: 13px 12px;
  }

  .dossier-head h3 {
    font-size: 20px;
  }

  .dossier-body {
    padding: 0 11px 12px;
  }

  .stat-grid,
  .baseline-grid {
    grid-auto-columns: minmax(108px, 1fr);
  }

  .stat-cell strong,
  .baseline-grid strong {
    font-size: 19px;
  }

  .comp-switch {
    flex-basis: 186px;
  }

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

  .comp-unit,
  .comp-unit:nth-child(4n + 2),
  .comp-unit:nth-child(4n + 3) {
    min-height: 80px;
  }

  .intent-tab {
    min-height: 36px;
    font-size: 12px;
  }
}

.assistant-presets {
  margin-top: 16px;
  padding: 15px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.preset-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.preset-heading > span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
}

.preset-heading h2 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.preset-tabs {
  display: flex;
  flex-wrap: wrap;
  margin-top: 11px;
  gap: 7px;
}

.preset-tab,
.preset-prompt,
.preset-emblem,
.preset-submit {
  cursor: pointer;
}

.preset-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.preset-tab.is-active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

.preset-panel {
  margin-top: 10px;
}

.preset-prompt-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.preset-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
  color: var(--ink);
  text-align: left;
  font-size: 12px;
}

.preset-prompt:hover {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.preset-prompt span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-prompt b {
  flex: 0 0 auto;
  margin-left: 8px;
  color: var(--gold);
}

.preset-panel-copy {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 12px;
}

.preset-emblems {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.preset-emblem {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  padding: 5px 7px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
  color: var(--ink);
  font-size: 11px;
  text-align: left;
}

.preset-emblem:hover,
.preset-emblem.is-selected {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

.preset-emblem img {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 5px;
  object-fit: cover;
}

.preset-emblem span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-transfer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.preset-submit {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--panel-strong);
  border-radius: 7px;
  background: var(--panel-strong);
  color: var(--panel);
  font-size: 12px;
  font-weight: 700;
}

.preset-submit:disabled {
  border-color: var(--line);
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .preset-prompt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preset-emblems {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .assistant-presets {
    padding: 12px;
  }

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

  .preset-emblem {
    min-height: 37px;
  }

  .preset-transfer-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
