:root {
  --orange: #e65316;
  --orange-dark: #b8390d;
  --orange-pale: #fff1e9;
  --ink: #202529;
  --muted: #687077;
  --line: #dfe3e5;
  --line-dark: #c7cccf;
  --surface: #ffffff;
  --surface-soft: #f4f5f4;
  --surface-warm: #faf8f5;
  --steel: #3d474e;
  --green: #267a4d;
  --green-pale: #e9f5ee;
  --amber: #b7700c;
  --amber-pale: #fff4d9;
  --red: #b43d2d;
  --red-pale: #fff0ed;
  --shadow: 0 16px 44px rgba(29, 34, 37, 0.08);
  --radius: 14px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--surface-soft);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible,
tr:focus-visible {
  outline: 3px solid rgba(230, 83, 22, 0.28);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.prototype-note {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 24px;
  color: #f3f5f6;
  background: #30383d;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.prototype-note > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff7b39;
}

.prototype-note b {
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 600;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 22px;
  padding: 10px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  width: max-content;
}

.brand-mark {
  width: 47px;
  height: 47px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 2px solid var(--orange);
  background: var(--surface);
  line-height: 1;
}

.brand-mark strong {
  color: var(--orange);
  font-size: 20px;
  letter-spacing: -0.06em;
}

.brand-mark b {
  margin-top: 2px;
  color: var(--steel);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy strong {
  font-size: 18px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 12px;
}

.tab-list {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.tab-button {
  min-height: 40px;
  padding: 0 17px;
  border: 0;
  border-radius: 7px;
  color: #596168;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.tab-button:hover {
  color: var(--ink);
}

.tab-button.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(31, 38, 42, 0.08);
}

.details-button {
  justify-self: end;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--steel);
  background: var(--surface);
  font-size: 13px;
  font-weight: 650;
}

.details-button:hover,
.proof-details-button:hover,
.row-action:hover {
  border-color: var(--orange);
  color: var(--orange-dark);
}

.details-button span,
.proof-details-button span {
  font-size: 20px;
  line-height: 1;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: calc(100vh - 160px);
  margin: 0 auto;
  padding: 44px clamp(20px, 4vw, 64px) 64px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: view-in 220ms ease-out;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 30px;
}

.view-heading h1 {
  max-width: 800px;
  margin: 6px 0 0;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.view-heading h1 em {
  color: var(--orange);
  font-style: normal;
}

.eyebrow {
  margin: 0;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.heading-copy {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.knowledge-ready {
  min-width: 285px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-pale);
}

.knowledge-ready div {
  display: grid;
  gap: 4px;
}

.knowledge-ready strong {
  font-size: 14px;
}

.knowledge-ready small {
  color: var(--muted);
  font-size: 12px;
}

.assistant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.62fr);
  align-items: stretch;
  gap: 22px;
}

.conversation-card,
.proof-card,
.insight-card,
.admin-card,
.kpi-card,
.knowledge-stats article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.conversation-card {
  min-height: 670px;
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto auto;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.conversation-topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-warm);
}

.assistant-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sarathi-avatar,
.message-avatar {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--orange);
  font-weight: 800;
}

.sarathi-avatar {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  font-size: 19px;
}

.assistant-identity > div {
  display: grid;
  gap: 4px;
}

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

.assistant-identity div > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.assistant-identity i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.language-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.message-list {
  max-height: 485px;
  overflow-y: auto;
  padding: 25px 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)),
    repeating-linear-gradient(0deg, transparent 0 27px, #eceeed 28px);
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.message-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 7px;
  font-size: 13px;
}

.message-content {
  max-width: min(720px, 86%);
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 4px 13px 13px 13px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(27, 33, 36, 0.04);
}

.message-content p {
  margin: 0;
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.66;
}

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

.user-message .message-content {
  border-color: #f2d3c4;
  border-radius: 13px 4px 13px 13px;
  background: var(--orange-pale);
}

.answer-boundary {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.answer-boundary span {
  color: var(--green);
  font-weight: 800;
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.message-meta span {
  padding: 5px 8px;
  border-radius: 5px;
  color: var(--green);
  background: var(--green-pale);
  font-size: 10px;
  font-weight: 700;
}

.message-meta span.is-gap {
  color: var(--red);
  background: var(--red-pale);
}

.message-warning {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  color: #7d5010;
  background: var(--amber-pale);
  font-size: 11px;
}

.loading-message .message-content {
  display: flex;
  gap: 5px;
  padding: 18px;
}

.loading-message i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  animation: loading 900ms infinite alternate;
}

.loading-message i:nth-child(2) { animation-delay: 180ms; }
.loading-message i:nth-child(3) { animation-delay: 360ms; }

@keyframes loading {
  to { opacity: 0.25; transform: translateY(-3px); }
}

.suggestion-block {
  padding: 15px 20px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-warm);
}

.suggestion-title {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.suggestion-list button {
  min-height: 35px;
  padding: 0 11px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  color: var(--steel);
  background: var(--surface);
  font-size: 11px;
  font-weight: 650;
}

.suggestion-list button:hover {
  border-color: var(--orange);
  color: var(--orange-dark);
  background: var(--orange-pale);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.composer textarea {
  min-height: 50px;
  flex: 1;
  resize: none;
  padding: 14px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 14px;
  line-height: 1.45;
}

.composer textarea:focus {
  border-color: var(--orange);
  background: #fff;
}

.send-button,
.primary-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--orange);
  font-size: 13px;
  font-weight: 750;
}

.send-button:hover,
.primary-button:hover {
  background: var(--orange-dark);
}

.send-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.send-button b {
  font-size: 17px;
}

.proof-card {
  min-height: 670px;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.proof-heading h2,
.card-heading h2,
.admin-card h2 {
  margin: 6px 0 0;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.proof-content {
  flex: 1;
  padding: 26px 0;
}

.proof-empty {
  height: 100%;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.proof-empty > span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  color: var(--muted);
  font-size: 20px;
}

.proof-empty h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.proof-empty p {
  max-width: 275px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.proof-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border-radius: 9px;
  color: var(--green);
  background: var(--green-pale);
}

.proof-status.is-gap {
  color: var(--red);
  background: var(--red-pale);
}

.proof-status.is-followup {
  color: var(--amber);
  background: var(--amber-pale);
}

.proof-status > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 800;
}

.proof-status div {
  display: grid;
  gap: 3px;
}

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

.proof-status small {
  font-size: 11px;
}

.proof-list {
  margin-top: 23px;
  border-top: 1px solid var(--line);
}

.proof-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 15px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.proof-row span {
  color: var(--muted);
  font-size: 12px;
}

.proof-row strong {
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.proof-details-button {
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  color: var(--steel);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
}

.proof-details-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

/* Field insights */

.insights-heading,
.knowledge-heading {
  align-items: center;
}

.sample-data-note {
  max-width: 340px;
  padding: 14px 16px;
  border: 1px solid #e6cda4;
  border-radius: 9px;
  color: #80530e;
  background: var(--amber-pale);
  font-size: 12px;
  line-height: 1.45;
}

.sample-data-note span {
  display: block;
  margin-bottom: 3px;
  color: #5f3b06;
  font-weight: 800;
}

.sample-data-note button {
  display: block;
  margin-top: 9px;
  padding: 0;
  border: 0;
  color: #9a3b11;
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(145px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.filter-bar > div {
  display: grid;
  gap: 6px;
}

.filter-bar label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.filter-bar select {
  width: 100%;
  min-height: 42px;
  padding: 0 35px 0 11px;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}

.reset-filter {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  color: var(--steel);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 16px;
}

.kpi-card {
  min-height: 140px;
  display: flex;
  flex-direction: column;
  padding: 19px;
}

.kpi-card > span {
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.kpi-card strong {
  margin: 10px 0 8px;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.045em;
}

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

.kpi-primary {
  border-color: var(--orange);
  color: #fff;
  background: var(--orange);
}

.kpi-primary > span,
.kpi-primary small {
  color: rgba(255, 255, 255, 0.82);
}

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

.insight-card {
  padding: 21px;
}

.geography-card { grid-column: span 7; }
.topics-card { grid-column: span 5; }
.team-card { grid-column: span 12; }
.recent-card { grid-column: span 7; }
.gap-card { grid-column: span 5; }

.production-dimensions-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-style: dashed;
  background: var(--surface-soft);
}

.production-dimensions-card h2 {
  margin-top: 5px;
}

.production-dimensions-card p:not(.eyebrow) {
  max-width: 760px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.production-dimensions-card > span {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--muted);
  background: #fff;
  font-size: 10px;
  font-weight: 800;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.card-caption,
.gap-count,
.last-run {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.gap-count {
  padding: 6px 8px;
  border-radius: 5px;
  color: var(--red);
  background: var(--red-pale);
}

.geography-bars,
.topic-bars {
  display: grid;
  gap: 16px;
}

.insight-bar-row {
  display: grid;
  gap: 7px;
}

.insight-bar-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

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

.insight-bar-heading span {
  color: var(--muted);
  font-size: 10px;
}

.insight-bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 2px;
  background: #e9ecec;
}

.insight-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--orange);
  transition: width 260ms ease-out;
}

.topics-card .insight-bar-fill {
  background: var(--steel);
}

.team-table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 11px;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--orange-pale);
}

td:first-child {
  font-weight: 750;
}

.recent-list,
.gap-list {
  display: grid;
}

.recent-item,
.gap-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.recent-item:last-child,
.gap-item:last-child {
  border-bottom: 0;
}

.recent-status {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-pale);
  font-size: 10px;
  font-weight: 800;
}

.recent-status.is-gap {
  color: var(--red);
  background: var(--red-pale);
}

.recent-copy,
.gap-copy {
  min-width: 0;
  display: grid;
  flex: 1;
  gap: 5px;
}

.recent-copy strong,
.gap-copy strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-copy span,
.gap-copy span {
  color: var(--muted);
  font-size: 10px;
}

.gap-label {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 4px;
  color: var(--red);
  background: var(--red-pale);
  font-size: 9px;
  font-weight: 800;
}

.empty-state {
  margin: 0;
  padding: 20px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Knowledge base */

.primary-button {
  min-width: 160px;
}

.knowledge-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 16px;
}

.knowledge-stats article {
  display: grid;
  gap: 7px;
  padding: 18px;
}

.knowledge-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.knowledge-stats strong {
  font-size: 30px;
  line-height: 1;
}

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

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(290px, 0.78fr);
  align-items: start;
  gap: 16px;
}

.knowledge-main {
  display: grid;
  gap: 16px;
}

.admin-card {
  padding: 22px;
}

.approved-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 5px;
  color: var(--green);
  background: var(--green-pale);
  font-size: 10px;
  font-weight: 800;
}

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

.source-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.pdf-icon {
  width: 47px;
  height: 56px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--orange);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.source-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

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

.source-copy span,
.source-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-status {
  display: grid;
  gap: 4px;
  text-align: right;
}

.source-status span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.source-status small {
  color: var(--muted);
  font-size: 9px;
}

.row-action {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  color: var(--steel);
  background: #fff;
  font-size: 10px;
  font-weight: 750;
}

.index-pipeline {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.index-pipeline > i {
  color: var(--line-dark);
  font-style: normal;
}

.pipeline-step {
  min-width: 105px;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.pipeline-step > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 800;
}

.pipeline-step.is-complete > span {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-pale);
}

.pipeline-step strong {
  font-size: 11px;
}

.pipeline-step small {
  color: var(--muted);
  font-size: 9px;
}

.coverage-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.coverage-list > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--steel);
  background: var(--surface-soft);
  font-size: 11px;
}

.coverage-list b {
  color: var(--green);
  font-size: 9px;
}

.coverage-list b.is-gap {
  color: var(--red);
}

.admin-preview-card {
  position: sticky;
  top: 98px;
}

.admin-preview-card ul {
  display: grid;
  gap: 0;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.admin-preview-card li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  color: var(--steel);
  font-size: 11px;
  line-height: 1.45;
}

.admin-preview-card li span {
  color: var(--orange);
  font-size: 9px;
  font-weight: 850;
}

.preview-only-note {
  padding: 14px;
  border-radius: 8px;
  color: #78500e;
  background: var(--amber-pale);
  font-size: 10px;
  line-height: 1.5;
}

.preview-only-note strong {
  display: block;
  margin-bottom: 3px;
  color: #5b3a05;
  font-size: 11px;
}

/* Drawer */

.drawer-open {
  overflow: hidden;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(27, 33, 36, 0.5);
  cursor: default;
}

.detail-drawer {
  position: relative;
  z-index: 1;
  width: min(470px, 92vw);
  height: 100%;
  overflow-y: auto;
  padding: 25px;
  background: var(--surface);
  box-shadow: -20px 0 60px rgba(24, 31, 35, 0.18);
  animation: drawer-in 220ms ease-out;
}

@keyframes drawer-in {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 21px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  margin: 6px 0 0;
  font-size: 23px;
  letter-spacing: -0.03em;
}

.drawer-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--steel);
  background: var(--surface-soft);
  font-size: 23px;
  line-height: 1;
}

.drawer-content {
  padding-top: 10px;
}

.drawer-empty {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 13px;
  color: var(--muted);
  text-align: center;
}

.drawer-empty span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  font-weight: 800;
}

.drawer-empty p {
  max-width: 300px;
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.detail-list {
  display: grid;
}

.detail-section {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.detail-section-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-section-heading h3 {
  margin: 0;
  font-size: 14px;
}

.detail-section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.detail-section .detail-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-row {
  display: grid;
  gap: 7px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.detail-row span {
  color: var(--muted);
  font-size: 11px;
}

.detail-row strong {
  font-size: 11px;
  text-align: right;
}

.detail-row small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 14px 16px;
  border-left: 4px solid var(--orange);
  border-radius: 7px;
  color: #fff;
  background: var(--steel);
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.5;
}

.app-footer {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 4vw, 64px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
}

@media (max-width: 1120px) {
  .app-header {
    grid-template-columns: auto 1fr auto;
  }

  .brand-copy {
    display: none;
  }

  .tab-list {
    justify-self: center;
  }

  .assistant-layout,
  .knowledge-layout {
    grid-template-columns: 1fr;
  }

  .proof-card {
    min-height: auto;
  }

  .proof-empty {
    min-height: 180px;
  }

  .admin-preview-card {
    position: static;
  }

  .geography-card,
  .topics-card,
  .recent-card,
  .gap-card {
    grid-column: span 6;
  }
}

@media (max-width: 820px) {
  .prototype-note {
    justify-content: flex-start;
    overflow: hidden;
    white-space: nowrap;
  }

  .app-header {
    min-height: auto;
    grid-template-columns: auto 1fr;
    padding: 10px 16px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .tab-list {
    justify-self: stretch;
  }

  .tab-button {
    flex: 1;
    padding: 0 8px;
    font-size: 11px;
  }

  .details-button {
    display: none;
  }

  .app-shell {
    padding: 30px 16px 45px;
  }

  .view-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .view-heading h1 {
    font-size: 36px;
  }

  .knowledge-ready,
  .sample-data-note {
    width: 100%;
    max-width: none;
  }

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-grid,
  .knowledge-stats {
    grid-template-columns: 1fr 1fr;
  }

  .geography-card,
  .topics-card,
  .team-card,
  .recent-card,
  .gap-card {
    grid-column: span 12;
  }

  .production-dimensions-card {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

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

  .source-status,
  .row-action {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }

  .index-pipeline {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .index-pipeline > i {
    display: none;
  }

  .pipeline-step {
    min-width: 0;
    grid-template-columns: 32px auto 1fr;
    align-items: center;
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .prototype-note b {
    display: none;
  }

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

  .brand {
    display: none;
  }

  .tab-list {
    width: 100%;
  }

  .view-heading h1 {
    font-size: 32px;
  }

  .heading-copy {
    font-size: 14px;
  }

  .conversation-card {
    min-height: 650px;
  }

  .conversation-topbar,
  .message-list,
  .suggestion-block {
    padding-left: 14px;
    padding-right: 14px;
  }

  .language-note {
    display: none;
  }

  .message-content {
    max-width: 92%;
  }

  .suggestion-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .suggestion-list button {
    min-height: 44px;
    height: auto;
    padding: 7px;
  }

  .composer {
    align-items: stretch;
    flex-direction: column;
  }

  .send-button {
    min-height: 46px;
  }

  .filter-bar,
  .kpi-grid,
  .knowledge-stats,
  .coverage-list {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 118px;
  }

  .primary-button {
    width: 100%;
  }

  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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