:root {
  color-scheme: light;
  --ink: #121212;
  --ink-soft: #3e3e3e;
  --muted: #737373;
  --line: #dfdfdc;
  --line-strong: #c5c5c0;
  --paper: #f7f7f4;
  --surface: #ffffff;
  --blue: #0873c9;
  --blue-deep: #0756a8;
  --blue-soft: #edf6fc;
  --yellow: #f8bd2d;
  --yellow-soft: #fff8df;
  --green: #127a4c;
  --shadow: 0 18px 50px rgba(13, 23, 33, .08);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 8% 7%, rgba(248, 189, 45, .1), transparent 24rem),
    radial-gradient(circle at 91% 5%, rgba(8, 115, 201, .08), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, select, input { font: inherit; }
button, select { outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.hidden { display: none !important; }

.site-header {
  height: 76px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, .9);
  border-bottom: 1px solid rgba(223, 223, 220, .85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand { display: flex; align-items: center; min-width: 0; }
.brand-crop { width: 150px; height: 52px; display: block; overflow: hidden; position: relative; flex: 0 0 auto; }
.brand-crop img { width: 190px; max-width: none; position: absolute; left: -25px; top: -29px; }
.brand-divider { width: 1px; height: 28px; margin: 0 17px 0 4px; background: var(--line); }
.brand-copy { color: var(--muted); font-size: 12px; white-space: nowrap; }

.header-actions, .action-row, .system-status { display: flex; align-items: center; gap: 10px; }
.system-status { color: var(--ink-soft); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(18, 122, 76, .1); }

.button {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 620;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.button:disabled { opacity: .38; cursor: not-allowed; }
.button-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.button-primary:hover:not(:disabled) { background: #272727; }
.button-quiet { min-height: 36px; padding-inline: 15px; }

main { width: min(1720px, 100%); margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px) 80px; }

.hero {
  min-height: 330px;
  padding: clamp(58px, 8vw, 100px) 0 54px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 60px;
}
.eyebrow, .metric-label, .rail-label, .test-controls label > span {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero h1 { margin: 0; font-size: clamp(42px, 6vw, 84px); font-weight: 540; letter-spacing: -.06em; line-height: .98; }
.hero h1 span { color: #8a8a86; }
.hero-copy { max-width: 410px; margin: 0 0 7px; color: var(--ink-soft); font-size: 17px; line-height: 1.65; }

.performance-strip {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.performance-strip article { min-height: 142px; padding: 24px; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.performance-strip article:last-child { border-right: 0; }
.performance-strip .score-lead { color: #fff; background: var(--ink); }
.performance-strip .score-lead .metric-label, .performance-strip .score-lead small { color: #bdbdb9; }
.performance-strip strong { margin: auto 0 2px; font-size: clamp(36px, 4vw, 52px); font-weight: 570; letter-spacing: -.055em; line-height: 1; }
.performance-strip small { color: var(--muted); font-size: 11px; }

.demo-section, .evaluation-section { padding-top: 78px; }
.section-heading { margin-bottom: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.section-heading h2 { margin: 0; font-size: clamp(28px, 3vw, 42px); font-weight: 560; letter-spacing: -.045em; }
.section-heading .eyebrow { margin-bottom: 4px; }

.test-controls { display: grid; grid-template-columns: 150px minmax(280px, 430px) auto; align-items: end; gap: 10px; }
.test-controls label { display: flex; flex-direction: column; gap: 5px; }
.test-controls label > span { margin: 0 0 0 4px; }
select { width: 100%; height: 42px; padding: 0 36px 0 13px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); }
.case-meta { width: fit-content; margin: -8px 0 16px; padding: 6px 11px; border-radius: 999px; background: var(--yellow-soft); color: #665014; font-size: 11px; font-weight: 620; }

.surface { background: var(--surface); border: 1px solid var(--line); }
.shopping-workspace {
  min-height: 750px;
  display: grid;
  grid-template-columns: minmax(220px, .62fr) minmax(470px, 1.75fr) minmax(280px, .82fr);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.profile-rail, .insight-rail { min-width: 0; }
.profile-rail { padding: 21px; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.chat-panel { min-width: 0; display: grid; grid-template-rows: auto minmax(560px, 1fr) auto; border-width: 1px 0; }
.insight-rail { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }

.rail-heading { min-height: 31px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rail-heading .rail-label { margin: 0; }
.privacy-badge { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.customer-identity { margin: 27px 0 20px; display: flex; align-items: center; gap: 12px; }
.customer-avatar { width: 47px; height: 47px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(145deg, var(--blue-deep), var(--blue)); color: #fff; font-size: 17px; font-weight: 700; box-shadow: 0 8px 16px rgba(8, 115, 201, .2); }
.customer-identity h3 { margin: 0 0 1px; font-size: 16px; font-weight: 650; }
.customer-identity p { margin: 0; color: var(--muted); font-size: 11px; }
.profile-summary { min-height: 62px; margin-bottom: 26px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.profile-block { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.profile-block .rail-label { display: block; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 11px; }
.pill.active { background: var(--blue-soft); border-color: #bcdcf1; color: var(--blue-deep); }
.pill.retracted { color: var(--muted); text-decoration: line-through; }
.empty-copy { color: var(--muted); font-size: 11px; }
.profile-stats { margin: 7px 0 0; }
.profile-stats div { padding: 13px 0; border-bottom: 1px solid var(--line); }
.profile-stats dt { margin-bottom: 2px; color: var(--muted); font-size: 10px; }
.profile-stats dd { margin: 0; font-size: 13px; font-weight: 610; }
.chat-header { min-height: 76px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.agent-identity { display: flex; align-items: center; gap: 11px; }
.agent-mark, .welcome-mark { display: flex; align-items: center; justify-content: center; gap: 4px; background: linear-gradient(145deg, var(--blue-deep), var(--blue) 62%, var(--yellow)); }
.agent-mark { width: 42px; height: 42px; border-radius: 14px 14px 14px 5px; }
.agent-mark span, .welcome-mark span { width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.agent-identity strong { display: block; font-size: 13px; }
.agent-identity div > span { color: var(--muted); font-size: 10px; }
.turn-counter { padding: 5px 9px; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; }

.conversation { padding: 26px clamp(18px, 3vw, 34px); overflow-y: auto; max-height: 820px; background: #fcfcfb; scrollbar-width: thin; }
.empty-state { display: grid; place-items: center; }
.welcome-state { max-width: 360px; text-align: center; }
.welcome-mark { width: 58px; height: 58px; margin: 0 auto 17px; border-radius: 20px 20px 20px 7px; box-shadow: 0 12px 30px rgba(8, 115, 201, .2); }
.welcome-mark span { width: 6px; height: 6px; }
.welcome-state h3 { margin-bottom: 6px; font-size: 20px; }
.welcome-state p { margin: 0; color: var(--muted); }

.turn { padding-bottom: 23px; }
.turn + .turn { padding-top: 9px; }
.turn-label { margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #9a9a96; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.turn-label span + span::before { content: "·"; margin-right: 7px; }
.message-row { margin-bottom: 13px; display: flex; align-items: flex-end; gap: 9px; }
.message-row.customer { justify-content: flex-end; }
.message-avatar { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: var(--ink); color: #fff; font-size: 9px; font-weight: 700; }
.message-row.customer .message-avatar { order: 2; background: var(--blue); }
.message { max-width: 80%; padding: 11px 14px; border-radius: 15px; font-size: 13px; line-height: 1.55; }
.message-agent { border: 1px solid var(--line); border-bottom-left-radius: 4px; background: var(--surface); }
.message-user { border-bottom-right-radius: 4px; background: var(--ink); color: #fff; }
.pending-user { animation: fadeSlide .25s ease both; }
.message-note { margin: -5px 35px 15px; color: var(--muted); font-size: 9px; }
.attribute-badge { width: fit-content; margin: -3px 0 16px 35px; padding: 4px 7px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-deep); font-size: 9px; font-weight: 700; }

.result-intro { margin: 3px 0 10px 35px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-intro strong { font-size: 12px; }
.result-intro span { color: var(--muted); font-size: 10px; }
.recommendations { margin-left: 35px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.recommendation { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease; }
.recommendation:hover { border-color: var(--line-strong); box-shadow: 0 8px 22px rgba(0, 0, 0, .06); }
.product-heading { display: grid; grid-template-columns: 31px 1fr auto; align-items: start; gap: 9px; }
.recommendation-rank { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: var(--paper); color: var(--muted); font-family: ui-monospace, monospace; font-size: 10px; }
.recommendation-title { display: -webkit-box; min-height: 38px; overflow: hidden; font-size: 12px; font-weight: 650; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.recommendation-category { margin: 8px 0 0 40px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-signals { margin: 10px 0 0; padding-top: 9px; border-top: 1px solid var(--line); }
.product-signals summary { color: var(--blue-deep); font-size: 10px; font-weight: 650; cursor: pointer; }
.product-signals ul { margin: 8px 0 0; padding-left: 15px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.rating { color: #8d6b00; font-size: 9px; white-space: nowrap; }
.target-mark { padding: 3px 5px; border-radius: 999px; background: var(--yellow); color: #2c2205; font-size: 7px; font-weight: 800; letter-spacing: .06em; }
.recommendation.target { border-color: var(--yellow); box-shadow: inset 0 0 0 1px var(--yellow); }

.chat-composer { min-height: 70px; padding: 13px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); }
.composer-copy { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.composer-lock { color: var(--blue); font-size: 15px; }

.insight-rail { overflow-y: auto; max-height: 900px; }
.insight-rail > .rail-heading { min-height: 76px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.target-toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; font-size: 9px; }
.target-toggle input { appearance: none; width: 25px; height: 15px; margin: 0; position: relative; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); }
.target-toggle input::after { content: ""; width: 9px; height: 9px; position: absolute; top: 2px; left: 2px; border-radius: 50%; background: var(--muted); transition: transform .15s ease; }
.target-toggle input:checked { border-color: var(--blue); background: var(--blue-soft); }
.target-toggle input:checked::after { transform: translateX(10px); background: var(--blue); }
.insight-card { padding: 18px; border-bottom: 1px solid var(--line); }
.insight-title-row { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.insight-title-row .rail-label { margin: 0; }
.insight-icon { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue-deep); font-size: 11px; font-weight: 800; }
.insight-icon.sparkle { background: var(--yellow-soft); color: #987300; }
.intent-card > strong { display: block; margin-bottom: 6px; font-size: 16px; }
.intent-card > p, .explanation-card > p { margin-bottom: 13px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.confidence-row { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.confidence-track { height: 4px; overflow: hidden; border-radius: 999px; background: var(--line); }
.confidence-track span { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--yellow)); transition: width .3s ease; }
.confidence-row strong { color: var(--ink); font-size: 9px; }
.intent-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.intent-meta span { padding: 4px 6px; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 8px; }
.signal-list { margin: 0 0 12px; padding: 0; list-style: none; }
.signal-list li { padding: 7px 0 7px 15px; position: relative; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 10px; }
.signal-list li::before { content: ""; width: 5px; height: 5px; position: absolute; top: 12px; left: 1px; border-radius: 50%; background: var(--blue); }
.profile-use { margin: 0 !important; padding: 9px 10px; border-radius: 8px; background: var(--paper); }
.session-result { background: #fcfcfa; }
.result-heading { margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; }
.result-heading strong { font-size: 13px; }
.result-heading .hit { color: var(--green); }
.result-heading .miss { color: #a93232; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.result-grid div { padding: 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.result-grid span { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.result-grid strong { font-size: 14px; }
.retrieval-details { border-bottom: 1px solid var(--line); }
.retrieval-details summary { padding: 14px 18px; color: var(--muted); font-size: 10px; font-weight: 650; cursor: pointer; }
.details-content { padding: 0 18px 17px; }
.data-list { margin: 0 0 15px; }
.data-list div { padding: 5px 0; display: flex; justify-content: space-between; border-bottom: 1px dotted var(--line-strong); font-size: 9px; }
.data-list dt, .data-list dd { margin: 0; }
.data-list dd { font-family: ui-monospace, monospace; }
.detail-label { display: block; margin: 12px 0 4px; }
.details-content p { margin: 0; overflow-wrap: anywhere; }
.target-details { padding: 16px 18px; background: var(--yellow-soft); }
.target-details .rail-label, .target-details strong, .target-details code { display: block; }
.target-details strong { margin: 6px 0 3px; font-size: 11px; }
.target-details code { color: #70570d; font-size: 9px; }

.evaluation-section { padding-bottom: 30px; }
.compact-heading { align-items: center; }
.evaluation-status { padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.scenario-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 17px; border-bottom: 1px solid var(--line); text-align: left; font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
td { font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { font-weight: 650; text-transform: capitalize; }
.empty-cell { padding: 30px; color: var(--muted); text-align: center; }
.score-formula { margin: 12px 2px 0; color: var(--muted); font-size: 10px; }

footer { min-height: 100px; padding: 25px clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--ink); color: #fff; }
.footer-brand strong, .footer-brand span { display: block; }
.footer-brand strong { margin-bottom: 3px; font-size: 18px; }
.footer-brand span, .footer-meta { color: #a9a9a4; font-size: 10px; }
.footer-meta { display: flex; gap: 22px; text-transform: uppercase; letter-spacing: .08em; }

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

@media (max-width: 1260px) {
  .section-heading { align-items: flex-start; flex-direction: column; }
  .test-controls { width: 100%; grid-template-columns: 150px minmax(260px, 1fr) auto; }
  .shopping-workspace { grid-template-columns: 220px minmax(430px, 1.5fr) 280px; overflow-x: auto; }
  .recommendations { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .brand-copy, .brand-divider { display: none; }
  .hero { min-height: 290px; align-items: flex-start; flex-direction: column; gap: 28px; }
  .hero-copy { max-width: 620px; }
  .performance-strip { grid-template-columns: repeat(2, 1fr); }
  .performance-strip article:nth-child(2) { border-right: 0; }
  .performance-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .shopping-workspace { grid-template-columns: 240px minmax(500px, 1fr); }
  .insight-rail { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); max-height: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .insight-rail > .rail-heading { grid-column: 1 / -1; }
  .insight-rail > * { border-right: 1px solid var(--line); }
  .target-details, .retrieval-details { grid-column: 1 / -1; }
  .profile-rail { border-radius: var(--radius-lg) 0 0 0; }
  .chat-panel { border-radius: 0 var(--radius-lg) 0 0; border-right-width: 1px; }
}

@media (max-width: 720px) {
  .site-header { height: 66px; }
  .brand-crop { width: 124px; transform: scale(.88); transform-origin: left center; margin-right: -15px; }
  .system-status { display: none; }
  .hero { padding-top: 48px; min-height: 260px; }
  .hero h1 { font-size: 42px; }
  .performance-strip { grid-template-columns: 1fr; }
  .performance-strip article { min-height: 115px; border-right: 0; border-bottom: 1px solid var(--line); }
  .performance-strip article:last-child { border-bottom: 0; }
  .test-controls { grid-template-columns: 1fr; }
  .shopping-workspace { display: flex; flex-direction: column; overflow: visible; }
  .profile-rail, .chat-panel, .insight-rail { width: 100%; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); }
  .profile-rail { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .chat-panel { grid-template-rows: auto minmax(520px, 1fr) auto; }
  .insight-rail { display: block; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .insight-rail > * { border-right: 0; }
  .chat-composer { align-items: stretch; flex-direction: column; }
  .chat-composer .action-row { justify-content: flex-end; }
  .recommendations { margin-left: 0; }
  .result-intro { margin-left: 0; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 440px) {
  .button-quiet { display: none; }
  .hero h1 { font-size: 36px; }
  .chat-header { align-items: flex-start; }
  .turn-counter { display: none; }
  .message { max-width: 88%; }
  .chat-composer .action-row { display: grid; grid-template-columns: 1fr 1fr; }
  .chat-composer .button { padding-inline: 10px; }
  .compact-heading { flex-direction: column; align-items: flex-start; }
}
