:root {
  --green: #4c8051;
  --green-light: #9cc043;
  --green-soft: #eaf4d8;
  --orange: #fbb03b;
  --orange-dark: #f26522;
  --ink: #101512;
  --muted: #5f666e;
  --line: #dce5d6;
  --paper: #ffffff;
  --wash: #f7f9f4;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wash);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; }
button, input, textarea { font: inherit; }

.demo-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
}

.demo-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; text-decoration: none; }
.demo-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 12px; font-weight: 900; }
.demo-chip, .status-badge, .result-count { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; font-size: 13px; font-weight: 750; color: var(--green); background: var(--green-soft); }

.demo-main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: clamp(48px, 8vw, 92px) 0 76px; }
.demo-intro { margin-bottom: 38px; }
.eyebrow { margin: 0 0 9px; color: var(--orange-dark); text-transform: uppercase; font-weight: 850; font-size: 12px; letter-spacing: 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 13px; font-size: clamp(42px, 6.6vw, 76px); line-height: .98; letter-spacing: 0; }
.lede { max-width: 660px; font-size: 19px; line-height: 1.55; color: var(--muted); }

.scout-layout { display: grid; grid-template-columns: minmax(310px, .9fr) minmax(380px, 1.1fr); gap: 22px; align-items: start; }
.scout-workbench { display: grid; gap: 16px; }
.scout-form, .recommendations-panel, .status-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: 0 16px 42px rgba(76, 128, 81, .06); }
.scout-form { padding: clamp(22px, 4vw, 34px); }
.form-heading h2, .section-heading h2, .status-heading h2 { margin-bottom: 6px; font-size: 24px; }
.form-heading p { color: var(--muted); line-height: 1.45; }
label { display: block; margin-top: 18px; font-size: 14px; font-weight: 750; }
label span { display: block; margin-bottom: 7px; }
label b { color: var(--orange-dark); }
label em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 650; }
textarea, input { width: 100%; border: 1px solid #bfcfbb; border-radius: 6px; padding: 12px 13px; background: #fff; color: var(--ink); outline: none; }
textarea { resize: vertical; min-height: 104px; line-height: 1.45; }
textarea:focus, input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(156, 192, 67, .2); }
.budget-field { max-width: 310px; }
.input-with-suffix { position: relative; }
.input-with-suffix input { padding-right: 48px; }
.input-with-suffix span { position: absolute; right: 12px; top: 13px; margin: 0; color: var(--muted); font-size: 12px; }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.35; }
.primary-button { width: 100%; margin-top: 25px; min-height: 46px; border: 0; border-radius: 6px; background: var(--green); color: #fff; font-weight: 800; cursor: pointer; }
.primary-button:hover, .primary-button:focus-visible { background: #396940; }

.recommendations-panel { min-height: 422px; padding: clamp(22px, 4vw, 34px); }
.section-heading, .status-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 17px; margin-bottom: 18px; }
.section-heading .eyebrow, .status-heading .eyebrow { margin-bottom: 5px; }
.result-count { white-space: nowrap; background: #f8fbf3; color: var(--green); }
.recommendations-empty { padding: 48px 6px; color: var(--muted); line-height: 1.55; }
.recommendations-empty.error { color: #a33f24; }
.recommendation-list { display: grid; gap: 12px; }
.selection-note { margin: 0 0 3px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.recommendation-card { border: 1px solid #d4e2cf; border-left: 4px solid var(--green-light); border-radius: 6px; padding: 15px; }
.recommendation-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.recommendation-head p { margin: 0; color: var(--green); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.recommendation-head strong { font-size: 19px; }
.recommendation-head small { font-size: 10px; color: var(--muted); }
.archive-label { color: var(--muted); font-size: 13px !important; }
.new-score { color: var(--orange-dark); font-size: 13px !important; }
.recommendation-card h3 { margin: 10px 0 3px; font-size: 21px; }
.result-status { display: inline-block; margin-top: 9px; color: #8c4b0c; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.result-status.new { color: var(--orange-dark); }
.tool-price { margin-bottom: 13px; color: var(--muted); font-size: 14px; font-weight: 700; }
.recommendation-card dl { display: grid; gap: 10px; margin: 0 0 15px; }
.recommendation-card dt { color: var(--green); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.recommendation-card dd { margin: 3px 0 0; color: #343a36; font-size: 14px; line-height: 1.44; }
.recommendation-card a { color: var(--green); font-size: 14px; font-weight: 800; }
.recommendation-card a:hover { color: var(--orange-dark); }
.archive-match { margin-top: 6px; border-top: 1px solid var(--line); padding: 18px 0 2px; color: var(--muted); }
.archive-match h3 { margin: 4px 0 6px; color: var(--ink); font-size: 17px; }
.archive-match p { margin-bottom: 10px; font-size: 14px; line-height: 1.45; }
.archive-eyebrow { color: var(--orange-dark); font-size: 11px !important; font-weight: 850; text-transform: uppercase; }
.archive-actions { display: flex; flex-wrap: wrap; gap: 11px 16px; }
.archive-actions a { color: var(--green); font-size: 13px; font-weight: 800; }

.status-panel { padding: clamp(22px, 4vw, 34px); }
.status-badge.pending { color: var(--muted); background: #f5f7f4; }
.status-badge.ready { color: #245a2f; background: var(--green-soft); border-color: #b7d494; }
.status-badge.warning { color: #7d5412; background: #fff4dc; border-color: #f4cf83; }
.status-badge.muted { color: var(--muted); background: #f5f7f4; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.status-grid div { min-height: 88px; padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.status-grid dt { margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.status-grid dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 750; line-height: 1.4; }
.status-note { margin: 16px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.code-status-panel {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-color: #36583b;
  background: #101a13;
  box-shadow: 0 18px 42px rgba(24, 67, 34, .18);
  color: #f6f9f3;
}
.code-status-panel::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(156, 192, 67, .08) 42%, transparent 70%);
  content: "";
  pointer-events: none;
}
.code-status-panel .status-heading { position: relative; border-bottom-color: rgba(191, 222, 180, .24); }
.code-status-panel .status-heading h2 { color: #fff; }
.code-status-panel .eyebrow { color: #bfe879; }
.console-led { display: inline-block; width: 7px; height: 7px; margin: 0 7px 1px 0; border-radius: 50%; background: #bfe879; box-shadow: 0 0 0 0 rgba(191, 232, 121, .65); animation: console-pulse 1.6s ease-out infinite; }
.code-status-panel .status-badge { position: relative; color: #112014; background: #bfe879; border-color: #cdeca0; }
.code-status-panel .status-badge.muted { color: #e6eee0; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .24); }
.code-status-panel .status-badge.warning { color: #f7dfad; background: rgba(242, 101, 34, .18); border-color: rgba(242, 101, 34, .48); }
.code-status-panel .status-grid { position: relative; border-color: rgba(191, 222, 180, .24); }
.code-status-panel .status-grid div { min-height: 76px; border-color: rgba(191, 222, 180, .24); background: rgba(255, 255, 255, .035); }
.code-status-panel .status-grid dt { color: #aebda9; }
.code-status-panel .status-grid dd { color: #f7fbf3; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.code-status-panel .status-note { position: relative; margin-bottom: 0; color: #c4d0bf; font-size: 12px; }

.flight-recorder { position: relative; margin-top: 18px; border-top: 1px solid rgba(191, 222, 180, .24); padding-top: 14px; }
.flight-recorder-toggle { display: grid; grid-template-columns: auto 1fr auto; width: 100%; align-items: center; gap: 10px; border: 0; padding: 5px 0; color: #f7fbf3; background: transparent; text-align: left; cursor: pointer; }
.flight-recorder-toggle:focus-visible { outline: 2px solid #bfe879; outline-offset: 4px; }
.flight-recorder-toggle strong { display: block; font-size: 14px; }
.flight-recorder-toggle small { display: block; margin-top: 2px; color: #aebda9; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
.flight-recorder-signal { width: 10px; height: 10px; border: 2px solid #fbb03b; border-radius: 50%; box-shadow: 0 0 0 0 rgba(251, 176, 59, .55); animation: recorder-pulse 1.8s ease-out infinite; }
.flight-recorder-action { color: #bfe879; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; text-transform: uppercase; }
.flight-recorder-content { margin-top: 13px; border: 1px solid rgba(191, 222, 180, .24); background: rgba(0, 0, 0, .14); }
.flight-recorder-intro { margin: 0; padding: 13px 14px; border-bottom: 1px solid rgba(191, 222, 180, .18); color: #c4d0bf; font-size: 11px; line-height: 1.45; }
.flight-current-trace { padding: 14px; }
.flight-empty { margin: 0; color: #aebda9; font-size: 12px; line-height: 1.45; }
.flight-trace-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: #bfe879; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.flight-trace-head time { color: #aebda9; font-weight: 600; letter-spacing: 0; }
.flight-trace-task { margin: 0 0 12px; color: #fff; font-size: 13px; font-weight: 750; line-height: 1.4; }
.flight-trace-steps { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.flight-trace-steps li { display: grid; grid-template-columns: 23px 1fr; gap: 8px; align-items: start; }
.flight-trace-steps li > span { color: #fbb03b; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; font-weight: 800; }
.flight-trace-steps p { margin: 0; }
.flight-trace-steps strong { display: block; color: #f7fbf3; font-size: 12px; }
.flight-trace-steps small { display: block; margin-top: 1px; color: #aebda9; font-size: 11px; line-height: 1.38; }
.flight-recorder-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(150px, .7fr); border-top: 1px solid rgba(191, 222, 180, .18); }
.flight-recorder-grid > section { min-width: 0; padding: 13px 14px; }
.flight-recorder-grid > section + section { border-left: 1px solid rgba(191, 222, 180, .18); }
.flight-panel-label { margin: 0 0 9px; color: #bfe879; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.flight-recent-list { display: grid; gap: 7px; max-height: 170px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.flight-recent-list li { display: grid; grid-template-columns: auto auto 1fr; column-gap: 6px; align-items: baseline; padding-bottom: 7px; border-bottom: 1px solid rgba(191, 222, 180, .1); }
.flight-recent-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.flight-recent-list time, .flight-recent-list small { color: #aebda9; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; }
.flight-source { color: #fbb03b; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; font-weight: 800; }
.flight-recent-list p { grid-column: 1 / -1; margin: 4px 0 1px; overflow: hidden; color: #f7fbf3; font-size: 11px; font-weight: 700; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.flight-recent-list small { grid-column: 1 / -1; }
.flight-heatmap-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.flight-heatmap-heading span { color: #aebda9; font-size: 10px; }
.flight-heatmap { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; }
.flight-heatmap-cell { aspect-ratio: 1; min-width: 4px; border: 1px solid rgba(191, 222, 180, .2); background: rgba(255, 255, 255, .05); }
.flight-heatmap-cell[data-level="1"] { border-color: rgba(191, 232, 121, .55); background: rgba(191, 232, 121, .28); }
.flight-heatmap-cell[data-level="2"] { border-color: rgba(191, 232, 121, .66); background: rgba(191, 232, 121, .45); }
.flight-heatmap-cell[data-level="3"] { border-color: #bfe879; background: rgba(191, 232, 121, .68); }
.flight-heatmap-cell[data-level="4"] { border-color: #e1ff9f; background: #bfe879; box-shadow: 0 0 10px rgba(191, 232, 121, .38); }
.flight-heatmap-axis { display: flex; justify-content: space-between; margin-top: 5px; color: #aebda9; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; }

@keyframes console-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(191, 232, 121, .15); opacity: .72; }
  45% { box-shadow: 0 0 0 6px rgba(191, 232, 121, 0); opacity: 1; }
}

@keyframes recorder-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 176, 59, .28); }
  50% { box-shadow: 0 0 0 5px rgba(251, 176, 59, 0); }
}

@media (max-width: 760px) {
  .demo-header { min-height: 62px; padding-inline: 20px; }
  .demo-chip { display: none; }
  .demo-main { width: min(100% - 28px, 620px); padding-top: 44px; }
  .scout-layout { grid-template-columns: 1fr; }
  .recommendations-panel { min-height: 0; }
}

@media (max-width: 470px) {
  .status-grid { grid-template-columns: 1fr; }
  h1 { font-size: 46px; }
  .section-heading, .status-heading { display: block; }
  .result-count, .status-badge { display: inline-block; margin-top: 12px; }
  .flight-recorder-grid { grid-template-columns: 1fr; }
  .flight-recorder-grid > section + section { border-top: 1px solid rgba(191, 222, 180, .18); border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .console-led, .flight-recorder-signal { animation: none; }
}
