:root {
  color-scheme: light;
  --bg: #f3f1eb;
  --surface: #fffdf8;
  --surface-2: #f8f6f0;
  --ink: #17191f;
  --ink-2: #243040;
  --muted: #606773;
  --line: rgba(23, 25, 31, 0.14);
  --line-strong: rgba(23, 25, 31, 0.24);
  --primary: #496f5d;
  --primary-dark: #365646;
  --accent: #496f5d;
  --accent-soft: #eef5ef;
  --warning: #b37a28;
  --warning-soft: #fff6e8;
  --danger: #8b4052;
  --danger-soft: #f8eef1;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
strong,
span,
button,
a,
em,
dl,
dd,
dt,
ol {
  margin: 0;
  overflow-wrap: anywhere;
}

button,
a,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1500px, calc(100% - 24px));
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px 0 22px;
}

.product-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--line);
}

.product-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.gallery-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.gallery-link::before {
  content: "";
  width: 18px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 3px;
}

.ghost-btn,
.primary-action,
.secondary-button,
.tour-card button {
  min-height: 38px;
  border-radius: var(--radius);
  padding: 10px 13px;
  border: 1px solid transparent;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ghost-btn,
.secondary-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-2);
}

.ghost-btn:hover,
.secondary-button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: #f8fafc;
}

.primary-action,
.tour-card button {
  background: var(--primary);
  color: #fff;
}

.primary-action:hover,
.tour-card button:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.tour-trigger-ready {
  box-shadow: 0 0 0 4px rgba(73, 111, 93, 0.12);
}

.demo-switcher {
  margin: 10px 0;
  max-width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.demo-switcher__copy {
  padding: 12px 14px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.demo-switcher__copy span,
.pane-header span,
.source-record span,
.system-notes span,
.ai-result span,
.analysis-section header span,
.evidence-panel header span,
.system-update span,
.audit-trail span,
.operator-topbar__title span,
.case-ribbon span,
.business-intro .eyebrow,
.business-intro__points span,
.business-intro__section span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.demo-switcher__copy strong {
  font-size: 0.92rem;
  line-height: 1.25;
}

.scenario-list {
  min-width: 0;
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  padding: 8px;
}

.scenario-item {
  flex: 0 0 194px;
  min-height: 46px;
  display: grid;
  gap: 3px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
}

.scenario-item span {
  color: #697789;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.scenario-item strong {
  font-size: 0.86rem;
  line-height: 1.15;
}

.scenario-item:hover,
.scenario-item.active {
  border-color: #a9d1c7;
  background: var(--accent-soft);
}

.operator-window {
  max-width: 100%;
  min-width: 0;
  border: 1px solid #8fa3b5;
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.operator-window:has(#chatSidebar.tour-focus) {
  overflow: visible;
}

.operator-topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 16px;
  background: #0f1b27;
  color: #eef6ff;
  border-bottom: 1px solid #24384b;
}

.operator-topbar__title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.operator-topbar__title strong {
  font-size: 1rem;
}

.operator-topbar__title span {
  color: #9eb4ca;
  text-transform: none;
  letter-spacing: 0;
}

.operator-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.operator-status span {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(168, 191, 212, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #dbe8f6;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 850;
}

.operator-status .locked-mode {
  border-color: rgba(255, 204, 138, 0.52);
  background: rgba(255, 204, 138, 0.14);
  color: #ffdcaa;
}

.case-ribbon {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(520px, 0.8fr);
  gap: 16px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.case-ribbon h2 {
  margin-top: 4px;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.08;
}

.operator-grid {
  min-width: 0;
  min-height: 690px;
  display: grid;
  grid-template-columns: 310px minmax(560px, 1fr) 350px;
}

.operator-pane {
  min-width: 0;
  padding: 15px;
  background: #fff;
}

.operator-pane + .operator-pane {
  border-left: 1px solid var(--line);
}

.pane-header {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.pane-header h3 {
  font-size: 1.04rem;
}

.ai-header {
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}

.ai-tour-summary {
  width: fit-content;
  max-width: 100%;
  margin: -6px 0 -6px -8px;
  padding: 6px 8px;
  border-radius: var(--radius);
}

.tour-focus-surface.tour-focus {
  background: #fff;
}

.source-record {
  min-height: 58px;
  display: grid;
  gap: 5px;
  align-content: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 -15px 12px;
  padding: 10px 15px;
  background: #f7f9fb;
}

.source-record strong {
  font-size: 1.08rem;
}

.locked-field-list,
.check-list,
.update-list,
.document-matches {
  display: grid;
  gap: 8px;
}

.locked-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.locked-field-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.locked-field-row strong {
  grid-column: 1;
  color: var(--ink);
}

.locked-field-row em {
  grid-row: 1 / span 2;
  grid-column: 2;
  justify-self: end;
  border-radius: 999px;
  padding: 4px 7px;
  background: #edf2f7;
  color: #526171;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 850;
}

.locked-field-row.missing em {
  background: var(--warning-soft);
  color: var(--warning);
}

.system-notes {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.system-notes p {
  margin-top: 7px;
  color: var(--ink-2);
  line-height: 1.45;
}

.ai-workbench {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 12px;
  background: #fbfcfd;
}

.ai-result {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 -15px;
  padding: 13px 15px;
  background: #fff;
}

.ai-result p {
  margin-top: 6px;
  font-size: 1.05rem;
  line-height: 1.48;
}

.analysis-columns {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
}

.analysis-section,
.evidence-panel,
.system-update,
.audit-trail {
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.analysis-section header,
.evidence-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.analysis-section header strong,
.evidence-panel header strong {
  color: var(--accent);
  font-size: 0.82rem;
}

.check-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 6px 0;
}

.check-row i {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid var(--warning);
  background: var(--warning-soft);
}

.check-row.done i {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.check-row strong {
  display: block;
}

.check-row p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.route-list {
  padding-left: 22px;
  display: grid;
  gap: 7px;
  color: var(--ink-2);
}

.route-list li::marker {
  color: var(--primary);
  font-weight: 900;
}

.document-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.document-match:last-child {
  border-bottom: 0;
}

.document-match span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.document-match strong {
  display: block;
  margin-top: 2px;
}

.document-match p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.document-match em {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 8px;
  font-style: normal;
  font-weight: 900;
}

.chat-composer {
  margin: 2px -15px -15px;
  padding: 12px 15px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-add-menu {
  position: relative;
}

.chat-add-button,
.chat-mic-button,
.chat-send-button {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid #cbd7e2;
  color: #667789;
}

.chat-add-button,
.chat-mic-button {
  background: #f7fafc;
  cursor: default;
}

.chat-add-button::before,
.chat-add-button::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.chat-add-button::after {
  transform: rotate(90deg);
}

.composer-tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 8;
  width: max-content;
  max-width: min(260px, calc(100vw - 52px));
  padding: 8px;
  display: grid;
  gap: 4px;
  border: 1px solid #cad7e0;
  border-radius: 8px;
  background: #101b27;
  color: #f7fbff;
  box-shadow: 0 16px 30px rgba(10, 19, 31, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.composer-tooltip span {
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.chat-add-menu:hover .composer-tooltip,
.chat-add-button:focus + .composer-tooltip,
.chat-add-button:focus-visible + .composer-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.chat-input-frame {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  border: 1px solid #cbd7e2;
  border-radius: 8px;
  background: #f7fafc;
}

.chat-composer textarea {
  width: 100%;
  min-height: 42px;
  max-height: 42px;
  resize: none;
  border: 0;
  border-radius: 8px 0 0 8px;
  padding: 11px 13px;
  background: transparent;
  color: #516173;
  line-height: 1.2;
  overflow: hidden;
}

.chat-composer textarea::placeholder {
  color: #697a8b;
}

.chat-composer textarea:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.chat-mic-button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
}

.chat-mic-button::before {
  content: "";
  width: 12px;
  height: 18px;
  border: 3px solid currentColor;
  border-radius: 999px;
}

.chat-mic-button::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 12px;
  border-bottom: 3px solid currentColor;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-radius: 0 0 10px 10px;
  transform: translateY(7px);
}

.chat-send-button {
  background: #dfe8ee;
  cursor: not-allowed;
}

.chat-send-button::before {
  content: "";
  width: 11px;
  height: 11px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  transform: translateX(-2px) rotate(45deg);
}

.system-draft {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
  background: #fffdf8;
}

.draft-body {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 -15px;
  padding: 12px 15px;
  background: #fff;
}

.draft-body p {
  color: var(--ink-2);
  line-height: 1.45;
}

.draft-body dl {
  margin-top: 11px;
  display: grid;
  gap: 8px;
}

.draft-body dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.draft-body dd {
  margin-top: 3px;
  color: var(--ink);
  line-height: 1.4;
}

.system-update {
  display: grid;
  gap: 8px;
}

.update-list div {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-weight: 750;
}

.audit-trail {
  align-self: end;
  color: var(--danger);
}

.audit-trail p {
  margin-top: 7px;
  border-left: 3px solid var(--danger);
  padding-left: 10px;
  line-height: 1.42;
}

.assistant-layout {
  height: min(760px, calc(100vh - 116px));
  min-height: 680px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  background: #fff;
}

.chat-sidebar {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: #f6f8fb;
}

.chat-sidebar__header {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.chat-sidebar__header span,
.chat-thread-header span,
.model-provider-strip span,
.answer-details span,
.answer-sources summary span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.chat-sidebar__header strong {
  font-size: 1.05rem;
}

.conversation-list {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0;
  padding: 8px;
  overflow: auto;
  background: #fff;
}

.chat-sidebar.tour-focus .conversation-list {
  overflow: visible;
}

.chat-sidebar.tour-focus .conversation-item {
  min-height: 72px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.chat-sidebar.tour-focus .conversation-copy {
  gap: 2px;
}

.conversation-item {
  min-width: 0;
  min-height: 84px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.conversation-item + .conversation-item {
  border-top-color: var(--line);
}

.conversation-item:hover,
.conversation-item.active {
  border-color: #a9d1c7;
  background: var(--accent-soft);
}

.conversation-avatar,
.message-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9f1f8;
  color: #33475b;
  font-size: 0.78rem;
  font-weight: 900;
}

.conversation-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.conversation-copy > span {
  color: #6e7c8c;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.conversation-copy strong,
.conversation-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-copy em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.conversation-meta {
  align-self: start;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
}

.chat-thread-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(250px, 1fr) auto;
  background: #fbfcfd;
}

.chat-thread-header {
  min-height: 84px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.chat-thread-header h2 {
  margin-top: 4px;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.08;
}

.chat-thread-header p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.35;
}

.model-provider-strip {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(520px, 1.35fr);
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.model-provider-copy strong {
  display: block;
  margin-top: 4px;
}

.model-provider-copy p {
  margin-top: 6px;
  color: var(--ink-2);
  line-height: 1.35;
}

.model-provider-list {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #f8fafc;
}

.model-provider-item {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas:
    "logo name"
    "logo note";
  gap: 2px 8px;
  align-items: center;
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
}

.model-provider-item:nth-child(3n) {
  border-right: 0;
}

.model-provider-item:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.model-provider-item.active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px #a9d1c7;
}

.model-provider-logo {
  grid-area: logo;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8eef5;
  color: #17334d;
  font-size: 0.7rem;
  font-weight: 900;
}

.model-provider-item strong {
  grid-area: name;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-provider-item em {
  grid-area: note;
  min-width: 0;
  color: var(--muted);
  font-size: 0.67rem;
  font-style: normal;
  line-height: 1.12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-transcript {
  min-width: 0;
  min-height: 0;
  padding: 22px 16px;
  overflow: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #fbfcfd, #f5f8fb);
}

.message-list {
  width: min(920px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.message-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.user-message {
  grid-template-columns: minmax(0, 1fr) 40px;
}

.user-message .message-avatar {
  grid-column: 2;
  grid-row: 1;
}

.user-message .message-bubble {
  grid-column: 1;
  grid-row: 1;
  width: min(720px, 100%);
  justify-self: end;
  background: #f8fafc;
}

.message-bubble {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.message-bubble header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.message-bubble header span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.message-bubble p {
  color: var(--ink-2);
  line-height: 1.55;
}

.assistant-message .message-avatar {
  background: var(--primary);
  color: #fff;
}

.assistant-message .message-bubble {
  border-color: #bdd3ec;
  box-shadow: 0 10px 28px rgba(37, 78, 125, 0.08);
}

.assistant-answer-text.tour-focus {
  padding: 6px 8px;
  border-radius: 6px;
}

.answer-sources {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.answer-sources summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

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

.answer-sources summary::before {
  content: "+";
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #e8eef5;
  color: var(--ink-2);
  font-weight: 900;
}

.answer-sources[open] summary::before {
  content: "-";
}

.answer-sources summary span {
  margin-right: auto;
}

.answer-sources summary strong {
  color: var(--accent);
  font-size: 0.82rem;
}

.answer-source-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.answer-source {
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.answer-source:last-child {
  border-bottom: 0;
}

.answer-source span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.answer-source strong {
  display: block;
  margin-top: 2px;
}

.answer-source p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.answer-details {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.answer-details section {
  min-width: 0;
}

.answer-details p {
  margin-top: 5px;
}

.chat-thread-panel > .chat-composer {
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.business-intro {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  width: min(340px, calc(100vw - 28px));
  max-height: min(360px, calc(100vh - 28px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 32px rgba(18, 34, 49, 0.16);
  padding: 14px;
}

body.tour-active .business-intro:not([hidden]) {
  right: 14px;
  bottom: 14px;
  z-index: 92;
  width: min(300px, calc(100vw - 28px));
  max-height: min(220px, calc(100vh - 28px));
  background: #fff;
  box-shadow: 0 10px 24px rgba(18, 34, 49, 0.18);
}

.business-intro[hidden] {
  display: none;
}

.business-intro__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.business-intro h2 {
  margin: 5px 0 7px;
  font-size: 1.04rem;
  line-height: 1.15;
}

.business-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.business-intro__close {
  border: 0;
  background: transparent;
  color: #2e4c67;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 0;
  white-space: nowrap;
}

.business-intro__points {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.business-intro__points article,
.business-intro__section {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  display: grid;
  gap: 4px;
}

.business-intro__section {
  margin-top: 8px;
}

.business-intro__points strong,
.business-intro__section strong {
  font-size: 0.86rem;
  line-height: 1.3;
}

.business-intro__points p {
  font-size: 0.82rem;
}

#tourOverlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

#tourOverlay[hidden] {
  display: none;
}

#tourSpotlight,
.tour-popover {
  transition:
    top 520ms cubic-bezier(0.2, 0.9, 0.2, 1),
    left 520ms cubic-bezier(0.2, 0.9, 0.2, 1),
    width 520ms cubic-bezier(0.2, 0.9, 0.2, 1),
    height 520ms cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 520ms cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: top, left, width, height;
}

.tour-scrim {
  position: fixed;
  background: rgba(6, 14, 24, 0.72);
  pointer-events: auto;
  transition: none;
}

#tourSpotlight {
  position: fixed;
  border-radius: var(--radius);
  border: 2px solid #7ec7ff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55) inset, 0 0 26px rgba(126, 199, 255, 0.42);
  pointer-events: none;
}

.tour-card[hidden] {
  display: none;
}

.tour-card {
  width: 340px;
  position: fixed;
  z-index: 91;
  border-radius: var(--radius);
  border: 1px solid #9ec6e6;
  background: #f8fcff;
  color: #17334d;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.23);
  padding: 14px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  pointer-events: auto;
}

.tour-counter {
  margin: 0 0 8px;
  color: #0e4f85;
  font-size: 0.82rem;
  font-weight: 800;
}

.tour-card h3 {
  margin: 0;
}

.tour-card p {
  margin: 8px 0 0;
  color: #17334d;
  line-height: 1.42;
}

.tour-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(76px, 0.85fr) minmax(76px, 0.85fr) minmax(118px, 1.25fr);
  gap: 6px;
}

.tour-actions button {
  justify-content: center;
  padding-right: 9px;
  padding-left: 9px;
  white-space: nowrap;
}

.tour-link {
  background: transparent !important;
  color: #2e4c67 !important;
}

.tour-focus {
  border-radius: var(--radius);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  #tourSpotlight,
  .tour-popover {
    transition: none;
  }
}

@media (max-width: 1220px) {
  .case-ribbon {
    grid-template-columns: 1fr;
  }

  .assistant-layout {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .chat-thread-header,
  .model-provider-strip {
    grid-template-columns: 1fr;
  }

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

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

  .system-draft {
    grid-column: 1 / -1;
    border-left: 0 !important;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 920px) {
  .assistant-layout {
    height: auto;
    grid-template-columns: 1fr;
  }

  .chat-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .demo-switcher,
  .operator-grid {
    grid-template-columns: 1fr;
  }

  .demo-switcher__copy {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .operator-topbar,
  .product-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .operator-status,
  .product-header__actions {
    justify-content: flex-start;
  }

  .operator-pane + .operator-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

}

@media (max-width: 680px) {
  .app-shell {
    width: min(390px, calc(100% - 20px));
    padding-top: 8px;
  }

  .product-header__actions {
    width: 100%;
  }

  .product-header__actions button {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
  }

  .scenario-item {
    flex-basis: 178px;
  }

  .assistant-layout {
    height: auto;
    min-height: 0;
  }

  .chat-sidebar__header,
  .chat-thread-header,
  .model-provider-strip,
  .chat-transcript {
    padding-right: 12px;
    padding-left: 12px;
  }

  .conversation-list {
    padding: 6px;
  }

  .conversation-item {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .conversation-meta {
    display: none;
  }

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

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

  .model-provider-item:nth-child(3n) {
    border-right: 1px solid var(--line);
  }

  .model-provider-item:nth-child(2n) {
    border-right: 0;
  }

  .model-provider-item:nth-last-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .model-provider-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .message-row {
    grid-template-columns: 1fr;
  }

  .message-avatar {
    display: none;
  }

  .message-bubble header {
    display: grid;
  }

  .user-message .message-bubble {
    width: 100%;
    justify-self: stretch;
  }

  .operator-topbar,
  .case-ribbon,
  .operator-pane {
    padding: 12px;
  }

  .ai-header {
    grid-template-columns: 1fr;
  }

  .chat-composer {
    margin-right: -12px;
    margin-left: -12px;
    margin-bottom: -12px;
    padding: 10px 12px;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .chat-add-button,
  .chat-mic-button,
  .chat-send-button {
    width: 40px;
    height: 40px;
  }

  .business-intro {
    right: 12px;
    bottom: 12px;
    width: min(320px, calc(100vw - 24px));
    max-height: min(300px, calc(100vh - 24px));
    padding: 12px;
  }

  body.tour-active .business-intro:not([hidden]) {
    right: 12px;
    bottom: 12px;
    width: min(280px, calc(100vw - 24px));
    max-height: min(190px, calc(100vh - 24px));
  }

  .tour-card {
    max-height: calc(100vh - 32px);
  }

  .tour-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
  }

  .tour-actions .tour-link {
    flex: 1.3 0 auto;
  }

  .tour-actions button {
    min-width: 0;
    flex: 1 1 0;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .tour-actions .tour-link {
    min-width: 0;
  }
}

/* Singularno unified color layer: safe shell/form/tour palette only. */
:root {
  color-scheme: light;
  --bg: #f3f1eb;
  --page: #f3f1eb;
  --surface: #fffdf8;
  --surface-2: #f8f6f0;
  --surface-soft: #f8f6f0;
  --surface-panel: #fffdf8;
  --ink: #17191f;
  --ink-2: #243040;
  --ink-soft: #606773;
  --muted: #606773;
  --line: rgba(23, 25, 31, 0.14);
  --line-strong: rgba(23, 25, 31, 0.24);
  --primary: #496f5d;
  --primary-dark: #365646;
  --primary-soft: #eef5ef;
  --accent: #496f5d;
  --accent-dark: #365646;
  --accent-soft: #eef5ef;
  --blue: #536d84;
  --blue-soft: #eef2f1;
  --warning: #b37a28;
  --warning-bg: #fff6e8;
  --warning-soft: #fff6e8;
  --warning-ink: #8a5a19;
  --success: #496f5d;
  --success-bg: #eef5ef;
  --danger: #8b4052;
  --danger-soft: #f8eef1;
}

body {
  background:
    linear-gradient(90deg, rgba(23, 25, 31, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(23, 25, 31, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #fbfaf6 0%, var(--bg) 58%, #eceff1 100%);
  background-size: 48px 48px, 48px 48px, auto;
}

.product-header {
  border-color: var(--line);
  color: var(--ink);
}

.gallery-link {
  color: var(--primary-dark);
}

.ghost-btn,
.secondary-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-2);
}

.ghost-btn:hover,
.secondary-button:hover:not(:disabled) {
  border-color: rgba(73, 111, 93, 0.42);
  background: var(--primary-soft);
}

.primary-action,
.tour-card button {
  border-color: var(--primary);
  background: var(--primary);
  color: #fffdf8;
}

.primary-action:hover,
.tour-card button:hover:not(:disabled) {
  background: var(--primary-dark);
}

.tour-trigger-ready {
  box-shadow: 0 0 0 4px rgba(73, 111, 93, 0.12);
}

.demo-switcher,
.model-provider-strip,
.business-intro {
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 18px 42px rgba(23, 25, 31, 0.08);
}

.demo-switcher__copy,
.case-ribbon,
.model-provider-list,
.model-provider-item,
.chat-thread-panel {
  background: var(--surface-soft);
}

.scenario-item:hover,
.scenario-item.active,
.conversation-item:hover,
.conversation-item.active,
.model-provider-item.active {
  border-color: rgba(73, 111, 93, 0.38);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px rgba(73, 111, 93, 0.12);
}

.conversation-avatar,
.message-avatar,
.model-provider-logo {
  background: #edf2ec;
  color: var(--primary-dark);
}

.chat-input-frame,
.chat-composer textarea {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  color: var(--ink);
}

.chat-composer textarea:disabled {
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}

.chat-add-button,
.chat-mic-button {
  border-color: var(--line);
  background: var(--surface);
}

.chat-send-button {
  background: var(--primary);
}

.composer-tooltip {
  border-color: rgba(83, 109, 132, 0.42);
  background: var(--charcoal, #20242c);
}

.tour-scrim {
  background: rgba(23, 25, 31, 0.72);
}

#tourSpotlight {
  border-color: rgba(179, 122, 40, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 253, 248, 0.65) inset, 0 0 26px rgba(179, 122, 40, 0.34);
}

.tour-card {
  border-color: rgba(179, 122, 40, 0.42);
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 24px 44px rgba(23, 25, 31, 0.24);
}

.tour-counter {
  color: var(--warning);
}

.tour-card p {
  color: var(--ink-2);
}

.tour-link {
  color: var(--primary-dark) !important;
}
