/* KBF measurement workbench. Presentation only; status colors remain semantic. */
@font-face {
  font-family: 'Space Grotesk';
  src: url('/assets/space-grotesk.woff2') format('woff2');
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}
:root {
  --display: 'Space Grotesk', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --paper: #f5f6f7;
  --line: #e3e5e7;
  --muted: #626870;
  --ink: #202020;
  --accent: #f57832;
  color: var(--ink);
  background: var(--paper);
}
body { background: linear-gradient(#fff 0 420px, var(--paper) 680px); }
.topbar, main { max-width: 1264px; padding-inline: 40px; }
.topbar { height: 88px; border-color: #ebedef; }
.brand { gap: 11px; font: 700 24px/1.1 var(--display); }
.brand-mark { width: 43px; height: 43px; border-radius: 13px 13px 13px 3px; color: #ff954f; }
.brand-sub { font: 400 10px/1.4 var(--display); letter-spacing: 0; color: #686d73; margin-top: 5px; }
.topbar nav { gap: 24px; }
.topbar .text-button { font-size: 13px; color: #4b5158; }
.language { border-radius: 7px; padding: 7px 12px; }
.intro { padding: 44px 0 35px; gap: 44px; align-items: center; }
.intro-content { flex: 1; min-width: 0; }
.intro h1 { font: 600 clamp(40px,4.25vw,57px)/1.08 var(--display); letter-spacing: -2.6px; max-width: 740px; text-wrap: balance; }
:lang(zh) .intro h1 { font-size: clamp(34px,3.7vw,49px); line-height: 1.32; letter-spacing: -1.8px; }
.intro-copy { max-width: 550px; font-size: 15px; line-height: 1.85; margin-top: 19px; color: #61676e; text-wrap: pretty; }
/* Visible mode links keep comparison and reference building one click away. */
.topbar nav { gap: 18px; }
.mode-switcher { display: flex; align-items: center; gap: 4px; }
.mode-switcher a { display: flex; align-items: center; gap: 6px; padding: 9px 10px; border-radius: 7px; font-size: 12px; white-space: nowrap; text-decoration: none; color: #59616a; }
.mode-switcher .icon { width: 15px; height: 15px; }
.mode-switcher a:hover { background: #fff8d9; color: #202020; }
.mode-switcher a.is-active { color: #803909; background: #fff0d2; box-shadow: inset 0 -2px #f5ba38; }
/* Two probe signatures and one scanning beam: a comparison, not a live result. */
.endpoint-showcase { position: relative; flex: 0 0 35%; min-width: 0; overflow: hidden; padding: 20px 22px 16px; border: 1px solid #e9daa1; border-radius: 15px; background: #fffcf0; }
.showcase-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.endpoint-counter { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0; border: 0; padding: 0; margin: 0; min-width: 0; }
.endpoint-counter strong { font: 500 clamp(48px,4.7vw,68px)/1 var(--display); letter-spacing: -3px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; max-width: 100%; }
.endpoint-counter span:not([data-icon]) { font: 500 12px/1.5 var(--display); letter-spacing: 0; color: #736444; margin-top: 7px; }
.motion-toggle { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #e8dcaf; border-radius: 50%; color: #78632b; background: #fffdf6; }
.motion-toggle:hover { background: #ffedaf; }
.motion-symbol { width: 8px; height: 10px; border-inline: 2px solid currentColor; }
.motion-toggle[aria-pressed="true"] .motion-symbol { width: 0; height: 0; border: 5px solid transparent; border-right: 0; border-left: 7px solid currentColor; margin-left: 2px; }
.signal-stage { margin: 5px -22px 0; overflow: hidden; }
.signal-art { display: block; width: 100%; height: 110px; }
.signal-endpoint { animation: signal-drift 7s ease-in-out infinite; transform-origin: center; }
.signal-scan { animation: signal-scan 7s linear infinite; }
@keyframes signal-drift { 0%,100% { transform: translateY(4px); } 50% { transform: translateY(-5px); } }
@keyframes signal-scan { from { transform: translateX(-12px); } to { transform: translateX(420px); } }
.is-paused .signal-art * { animation-play-state: paused; }
/* A continuous three-step strip with restrained colored number markers. */
.workflow { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; margin: 0 0 22px; padding: 0; background: #fff; border: 1px solid #e5dfcb; border-radius: 11px; overflow: hidden; }
.workflow li { display: block; position: relative; min-width: 0; padding: 16px 18px; background: transparent; border: 0; border-radius: 0; }
.workflow li+li { border: 0; border-left: 1px solid #e5dfcb; }
.workflow li>div { width: 100%; min-width: 0; }
.workflow-heading { display: flex; gap: 9px; align-items: center; }
.workflow-number { display: inline-grid; place-items: center; flex: 0 0 25px; width: 25px; height: 25px; border: 0; border-radius: 7px; background: #ffead8; font: 600 13px/1 var(--display); color: #9d430e; margin: 0; letter-spacing: 0; }
.workflow li:nth-child(2) .workflow-number { background: #f7d75b; color: #645019; }
.workflow li:nth-child(3) .workflow-number { background: #f8ecc1; color: #645019; }
.workflow strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.5; min-width: 0; }
.workflow p { color: #686960; font-size: 12px; line-height: 1.65; margin: 7px 0 0 34px; }
.workflow li:not(:last-child):before,.workflow li:not(:last-child):after { content: none; }
.panel { border: 1px solid #dfe2e5; border-radius: 15px; box-shadow: 0 3px 12px #18233204; margin-bottom: 28px; }
.new-test,.custom-flow { border-top: 1px solid #dfe2e5; }
.panel-head { padding: 23px 30px; border-bottom-color: #e9ebed; background: #fff; }
.panel-head h2 { font: 600 21px/1.4 var(--display); letter-spacing: -.7px; }
.setup-caption { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #f4d99a; border-radius: 7px; color: #803909; background: #fff0d2; box-shadow: inset 0 -2px #f5ba38; font-size: 12px; white-space: nowrap; }
.setup-caption .icon { width: 15px; height: 15px; }
.setup-grid { grid-template-columns: 1.1fr 1fr; }
.endpoint-column,.reference-column { padding: 30px; }
.endpoint-column { border-color: #e9ebed; }
.reference-column { background: #f8f9fa; }
.step-label { gap: 10px; margin-bottom: 25px; }
.step-label h3 { font: 600 17px var(--display); letter-spacing: -.3px; }
.step-label>span:first-child { color: #be4e17; }
.step-label>.step-number { font: 400 25px var(--display); color: #c6cbd0; }
label:not(.checkbox) { font-weight: 550; font-size: 13px; margin-top: 17px; margin-bottom: 8px; }
input:not([type=checkbox]),select,textarea { min-height: 46px; border-color: #d9dde1; border-radius: 8px; padding: 11px 13px; background-color: #fff; box-shadow: 0 1px 2px #00000002; transition: border-color .15s; }
input:not([type=checkbox]):hover,select:hover,textarea:hover { border-color: #aeb6bd; }
input::placeholder { color: #697582; }
input:focus,select:focus,textarea:focus { outline-color: #e36b2a; }
.field-help,.key-risk { font-size: 12px; line-height: 1.75; }
.key-risk { color: #646e77; }
.field-tip>summary { border-color: #d7dce0; color: #646e77; background: #fff; width: 22px; height: 22px; }
.field-tip>summary:hover { color: #a6440e; border-color: #e29b73; }
.label-with-tip>.field-tip>summary { top: -2px; }
.label-with-tip>.field-tip[open]>p { padding: 11px 14px; border-left: 2px solid #edab86; background: #fff4ec; color: #7b583f; border-radius: 0 6px 6px 0; }
.secondary { border-radius: 7px; font-size: 12px; padding: 9px 13px; }
.primary { border-radius: 8px; padding: 12px 22px; min-height: 46px; font-size: 14px; gap: 24px; }
.primary:not(:disabled):not(.is-danger):not(.is-working) { background: #f57832; border-color: #ed6c24; color: #202020; box-shadow: 0 2px 3px #a8451412; }
.primary:not(:disabled):not(.is-danger):not(.is-working):hover { background: #ff8b45; border-color: #db5a14; }
.primary:disabled { background: #e9ecef; border-color: #e1e4e7; color: #8a929a; }
.connection-row { margin: 18px 0; }
.advanced-settings { border-color: #e4e7ea; margin-top: 22px; }
.advanced-settings>summary { font-size: 12px; }
.reference-info { margin-top: 24px; border: 1px solid #e0e4e8; border-radius: 10px; padding: 23px; box-shadow: 0 3px 8px #20202003; }
.reference-info h3 { font: 600 18px/1.45 var(--display); letter-spacing: -.4px; }
.reference-info .source { color: #65707a; font-size: 11px; }
.stats-grid { gap: 24px 18px; margin: 26px 0 22px; }
.stats-grid dt { font-size: 11px; color: #616b75; }
.stats-grid dd { font: 500 31px/1.4 var(--display); letter-spacing: -1px; }
.stats-grid small { font-family: inherit; letter-spacing: 0; font-size: 11px; }
.stats-grid .source-stat dd { font: 500 14px/1.7 var(--display); letter-spacing: 0; }
.reference-empty { min-height: 140px; gap: 12px; background: #fff; padding: 12px; }
.reference-empty .icon { width: 30px; height: 30px; color: #c5cbd1; }
.reference-empty p { color: #697582; max-width: 230px; }
.reference-request { margin-top: 19px; font-size: 12px; }
.consent-area { padding: 22px 30px; border-color: #e7eaed; background: #fff; }
.required-hint { color: #66717d; font-size: 11px; }
.form-bottom { justify-content: flex-end; margin-top: 0; }
.workspace { padding: 30px; background: #fff; border-top: 1px solid #e7eaed; }
.workspace-head { padding-bottom: 19px; border-bottom: 1px solid #eceef0; }
.workspace-head h2 { font: 600 23px var(--display); letter-spacing: -.8px; }
.record-number { font-family: var(--display); }
.identity-tag { border-radius: 5px; background: #f6f7f8; }
.badge { border-radius: 20px; padding: 5px 11px; font-size: 11px; }
.badge.status-complete:before { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 6px 1px 0; border-radius: 50%; background: currentColor; }
.metric { padding: 26px; background: #f7f8fa; border-radius: 11px; border-color: #e0e4e8; }
.metric .value { font: 500 clamp(38px,4.6vw,58px)/1.15 var(--display); letter-spacing: -2.6px; margin: 14px 0; }
.metric .caption { font-size: 13px; font-weight: 550; }
.error-metric.has-error-rate { box-shadow: none; border-color: rgba(var(--error-rgb),.35); background: rgba(var(--error-rgb),.075); }
.error-heat-track { height: 7px; }
.error-heat-labels { font-family: inherit; }
.cost-summary { border-radius: 11px; padding: 27px 30px; }
.cost-amount { font-family: var(--display); font-weight: 500; font-size: 56px; letter-spacing: -2.5px; }
.cost-upper strong { font-family: var(--display); }
.budget-consent { padding: 17px; border-radius: 8px; }
.result-details strong,td.numeric { font-family: var(--display); font-variant-numeric: tabular-nums; }
.result-domains,.progress-details { border-radius: 8px; }
.comparison-workspace { padding: 30px; }
.compare-target { border-radius: 11px; padding: 24px; }
.target-letter { display: inline-grid; place-items: center; width: 35px; height: 35px; font: 600 18px var(--display); background: #fff; border: 1px solid #20202016; border-radius: 8px; }
.compare-target h3 { font-family: var(--display); letter-spacing: -.5px; }
.compare-error { font: 500 51px/1.2 var(--display); letter-spacing: -2px; margin-top: 28px; }
.custom-body { padding: 30px; gap: 32px; }
.custom-guide { background: #f5f7f8; border-radius: 10px; padding: 27px; border: 1px solid #e7eaed; }
.custom-guide h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.5px; }
.extra-endpoint legend { font-family: var(--display); font-size: 17px; }
.reference-retention { border-radius: 0 7px 7px 0; }
.records { box-shadow: none; }
.records .panel-head { padding-block: 21px; }
.count { font: 500 11px var(--display); background: #f0f2f4; color: #626c75; border-radius: 5px; min-width: 24px; text-align: center; }
.records-note { color: #66717d; padding-top: 17px; }
.empty { min-height: 205px; }
.empty-icon { display: grid; place-items: center; width: 46px; height: 46px; background: #f4f6f8; border: 1px solid #e7eaed; border-radius: 13px; color: #98a1aa; margin-bottom: 13px; }
.empty-icon .icon { width: 23px; height: 23px; }
.empty h3 { font-size: 14px; font-weight: 500; }
.empty p { color: #65707b; font-size: 12px; max-width: 340px; }
.record-table th { background: #fafbfc; font-size: 11px; padding-block: 14px; }
.record-table td { border-color: #e9ecef; }
.record-model { font-family: var(--display); font-size: 13px; }
.record-date,.record-meta { font-size: 11px; }
footer { color: #69737d; padding-block: 5px 35px; }
dialog { border-color: #e0e4e7; border-radius: 16px; padding: 30px; }
.dialog-head h2 { font: 600 24px var(--display); letter-spacing: -.7px; }
.local-option { border-radius: 9px; }
button,a,summary { touch-action: manipulation; }
.about-page .intro { padding: 54px 0 34px; }
.about-page .intro h1 { font-size: 48px; }
.about-content { max-width: 900px; padding: 40px; }
.about-content h2 { font-family: var(--display); }
@media(max-width:1000px) {
  .topbar,main { padding-inline: 28px; }
  .intro { gap: 22px; }
  .intro h1 { font-size: 46px; }
}
@media(max-width:760px) {
  .topbar,main { padding-inline: 20px; }
  .topbar { height: 74px; }
  .topbar nav { gap: 13px; }
  .brand { font-size: 21px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 10px 10px 10px 3px; }
  .intro { padding: 34px 0 28px; display: block; position: relative; }
  .intro h1,:lang(zh) .intro h1 { font-size: 36px; letter-spacing: -1.6px; max-width: 530px; line-height: 1.22; }
  .intro-copy { font-size: 14px; margin-top: 14px; max-width: 500px; }
  .audit-app .topbar { height: auto; min-height: 104px; padding-top: 15px; padding-bottom: 13px; flex-wrap: wrap; gap: 14px; }
  .audit-app .topbar nav { width: 100%; justify-content: space-between; gap: 10px; }
  .audit-app .topbar nav .language { order: 4; }
  .setup-grid { grid-template-columns: 1fr; }
  .panel { border-radius: 12px; margin-bottom: 22px; }
  .panel-head,.endpoint-column,.reference-column,.workspace,.comparison-workspace { padding: 23px; }
  .panel-head h2 { font-size: 19px; }
  .setup-caption { display: none; }
  .step-label { margin-bottom: 23px; }
  .endpoint-column { border-right: 0; }
  input:not([type=checkbox]),select,textarea,input[type=url],input[type=password],#target-model { font-size: 16px; }
  .reference-info { padding: 19px; }
  .reference-empty { min-height: 120px; }
  .stats-grid { gap: 22px 12px; }
  .stats-grid dd { font-size: 28px; }
  .consent-area { padding: 22px 23px; }
  .form-bottom { gap: 18px; }
  .metric { padding: 18px 15px; }
  .metric .value { font-size: 36px; letter-spacing: -1.7px; }
  .metric .caption { font-size: 12px; }
  .metric-pair { grid-template-columns: 1fr; gap: 12px; }
  .cost-summary { padding: 21px; }
  .cost-amount { font-size: 45px; }
  .compare-target { padding: 16px; }
  .compare-error { font-size: 34px; letter-spacing: -1.5px; }
  .compare-target h3 { font-size: 16px; }
  .custom-body { padding: 23px; gap: 23px; }
  .custom-guide { padding: 21px; }
  .empty { min-height: 190px; }
  .about-page .intro h1 { font-size: 36px; }
  .about-content { padding: 25px; }
}
@media(max-width:360px) {
  .topbar,main { padding-inline: 14px; }
  .topbar nav { gap: 9px; }
  .audit-app .topbar nav { gap: 6px; }
  .topbar .text-button { font-size: 11px; }
  .intro h1,:lang(zh) .intro h1 { font-size: 32px; }
  .panel-head,.endpoint-column,.reference-column,.workspace,.comparison-workspace { padding: 20px; }
  .compare-target { padding: 12px; }
}

@media(max-width:1000px) {
  .audit-app .topbar { height: auto; min-height: 104px; position: relative; padding-top: 15px; padding-bottom: 13px; flex-wrap: wrap; gap: 12px; }
  .audit-app .topbar nav { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 10px 20px; }
  .mode-switcher { order: -1; }
  .audit-app .topbar nav .language { position: absolute; right: 28px; top: 16px; }
}
@media(max-width:1100px) {
  .topbar nav { gap: 12px; }
  .mode-switcher a { padding-inline: 8px; font-size: 11px; }
  .topbar .text-button { font-size: 12px; }
}
@media(max-width:760px) {
  .audit-app .topbar { position: relative; gap: 12px; }
  .audit-app .topbar nav { flex-wrap: wrap; justify-content: flex-start; gap: 10px 20px; }
  .mode-switcher { width: 100%; order: -1; gap: 5px; }
  .mode-switcher a { flex: 1; justify-content: center; padding: 9px 5px; font-size: 11px; }
  .audit-app .topbar nav .language { position: absolute; right: 20px; top: 16px; }
  .topbar .brand-sub { display: block; font-size: 9px; }
  .endpoint-showcase { margin-top: 22px; padding: 18px 20px 14px; }
  .showcase-top { position: absolute; top: 20px; left: 20px; right: 20px; z-index: 1; }
  .endpoint-counter strong { font-size: 48px; }
  .signal-stage { margin: 45px -20px 0 60px; }
  .signal-art { height: 105px; }
  .workflow { margin-bottom: 22px; }
  .workflow li { padding: 13px 10px; }
  .workflow-heading { gap: 7px; align-items: flex-start; }
  .workflow strong { font-size: 12px; }
  .workflow p { margin: 7px 0 0; font-size: 11px; }
}
@media(max-width:520px) {
  .workflow { grid-template-columns: 1fr; }
  .workflow li { padding: 12px 14px; }
  .workflow li+li { border-left: 0; border-top: 1px solid #e5dfcb; }
  .workflow-heading { align-items: center; }
  .workflow strong { font-size: 13px; }
  .workflow p { margin-left: 34px; font-size: 12px; }
}
@media(prefers-reduced-motion:reduce) {
  .signal-art * { animation: none !important; }
  .signal-scan { transform: translateX(220px); }
  .motion-toggle { display: none; }
}

/* Keep the settings disclosure beside the connection test; expand below both. */
.endpoint-tools { position: relative; margin-top: 18px; }
.endpoint-tools .connection-row { min-height: 40px; margin: 0; padding-right: 150px; flex-wrap: wrap; }
.endpoint-tools .advanced-settings { margin: 0; padding: 0; border: 0; }
.endpoint-tools .advanced-settings>summary { position: absolute; top: 0; right: 0; min-height: 40px; gap: 8px; }
.endpoint-tools .advanced-settings>summary:hover { color: #a6440e; }
.endpoint-tools .advanced-settings>summary:after { margin-left: 5px; }
@media(max-width:520px) {
  .endpoint-tools .connection-row { padding-right: 116px; gap: 5px; }
  .endpoint-tools .connection-row .secondary { font-size: 11px; padding: 9px 8px; }
  .endpoint-tools .advanced-settings>summary { font-size: 11px; gap: 5px; }
  .endpoint-tools .advanced-settings>summary:after { margin-left: 0; }
  .endpoint-tools .advanced-settings>summary [data-icon],.endpoint-tools .connection-row button [data-icon] { display: none; }
}

/* Size the reference placeholder to the endpoint form, not a fixed tall card. */
.reference-info:has(.reference-empty) { min-height: 0; padding: 18px; }
@media(min-width:761px) {
  .reference-column:has(.reference-empty) { display: flex; flex-direction: column; }
  .reference-column:has(.reference-empty) > .label-with-tip > label { margin-top: 0; }
  .reference-info:has(.reference-empty) { flex: 1; display: grid; place-items: center; margin-top: 20px; max-height: 220px; }
  .reference-column:has(.reference-empty) .reference-request { min-height: 40px; margin-top: 18px; }
}

/* Keep pricing context with its estimate and task controls together. */
.cost-summary:has(.cost-totals) { display: block; }
.cost-totals { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.run-actions { align-items: center; gap: 12px; }
.workspace-toggle { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-size: 12px; }
.workspace-toggle:hover { color: var(--ink); }
@media (max-width: 600px) { .cost-totals { align-items: stretch; flex-direction: column; gap: 18px; } }

.cost-heading, .phase-title { position: relative; display: flex; align-items: center; gap: 8px; }
.context-help { flex: 0 0 auto; }
.context-help > summary { display: grid; place-items: center; list-style: none; width: 22px; height: 22px; padding: 0; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; font-weight: 600; cursor: pointer; opacity: .75; }
.context-help > summary::-webkit-details-marker { display: none; }
.context-help[open] > summary, .context-help > summary:hover { opacity: 1; }
.context-help .help-content { position: absolute; top: calc(100% + 8px); left: 0; z-index: 4; width: min(420px, calc(100vw - 120px)); padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); box-shadow: 0 6px 22px #00000014; font-size: 12px; line-height: 1.7; }
.context-help .price-source, .context-help .note { margin: 0; font-size: inherit; color: inherit; }
.cost-tokens { margin: 16px 0 0; font-size: 12px; }
.budget-consent { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); }
.run-actions > button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 20px; border-width: 1px; border-style: solid; border-radius: 7px; font-size: 14px; font-weight: 600; line-height: 22px; }

.cost-upper .context-help .help-content { left: auto; right: 0; }
@media (max-width: 600px) { .cost-upper .context-help .help-content { left: 0; right: auto; } }
