:root {
  --bg: #f7f8f7;
  --surface: #ffffff;
  --surface-strong: #f0f4f2;
  --text: #18201d;
  --muted: #65706b;
  --border: #d9e0dc;
  --accent: #0f766e;
  --accent-dark: #0b5e58;
  --amber: #b7791f;
  --red: #b42318;
  --green: #157347;
  --shadow: 0 18px 45px rgba(21, 32, 28, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  background: #111a20;
  border-bottom: 1px solid #24323a;
  color: #ffffff;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 760;
}

.topbar p {
  margin: 7px 0 0;
  color: #c2cbc7;
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.topbar-actions .home-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2e4449;
  border-radius: 6px;
  padding: 8px 12px;
  color: #d8fffa;
  background: #14343a;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.topbar-actions .home-link:hover {
  color: #ffffff;
  background: #1b474f;
  border-color: #3a6269;
}

.topbar-actions .home-link:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.35);
  outline-offset: 1px;
}

button:hover {
  border-color: #b9c4bf;
  background: #f9fbfa;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 1px;
}

button.primary {
  width: 100%;
  margin-top: 12px;
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

button.primary:hover {
  background: var(--accent-dark);
}

button.secondary {
  color: var(--accent-dark);
}

.topbar button {
  border-color: #2e4449;
}

.topbar button.secondary {
  color: #d8fffa;
  background: #14343a;
}

.topbar button.secondary:hover {
  background: #1b474f;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 1px;
  background: #d7e1dd;
  border-bottom: 1px solid #cbd7d2;
}

.insight-strip article {
  min-height: 92px;
  padding: 16px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8f6 100%);
}

.insight-strip span,
.impact-card span {
  display: block;
  color: #53605b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-strip strong {
  display: block;
  margin-top: 6px;
  color: #10231f;
  font-size: 24px;
  line-height: 1;
}

.insight-strip small {
  display: block;
  margin-top: 7px;
  color: #64716c;
  font-size: 13px;
  line-height: 1.35;
}

.command-center {
  margin: 18px;
  padding: 18px;
  border: 1px solid #cad8d3;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 0%, rgba(15, 118, 110, 0.12), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #f3f8f6 100%);
  box-shadow: var(--shadow);
}

.command-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #0f766e;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.command-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.command-header p {
  max-width: 780px;
  margin: 8px 0 0;
  color: #53605b;
  font-size: 14px;
  line-height: 1.45;
}

.live-badge {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  border: 1px solid #bcd8d2;
  border-radius: 999px;
  padding: 6px 10px;
  background: #ffffff;
  color: #0b5e58;
  font-size: 12px;
  font-weight: 800;
}

.live-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}

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

.signal-tile {
  padding: 15px;
  background: #ffffff;
}

.signal-tile span {
  display: block;
  color: #5b6863;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.signal-tile strong {
  display: block;
  margin-top: 7px;
  color: #13221e;
  font-size: 15px;
  line-height: 1.25;
}

.signal-tile small {
  display: block;
  margin-top: 9px;
  color: #65706b;
  font-size: 12px;
  line-height: 1.4;
}

.signal-meter {
  height: 7px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f0;
}

.signal-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #14b8a6);
}

.signal-meter.amber i {
  background: linear-gradient(90deg, #b7791f, #f59e0b);
}

.signal-meter.green i {
  background: linear-gradient(90deg, #157347, #22c55e);
}

.demo-intelligence {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.workflow-map,
.proof-ledger {
  min-width: 0;
  padding: 16px;
  background: #ffffff;
}

.workflow-map h3,
.proof-ledger h3 {
  margin: 0 0 12px;
  color: #24332e;
  font-size: 14px;
  text-transform: uppercase;
}

.flow-rail {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.flow-rail span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border: 1px solid #cddbd6;
  border-radius: 6px;
  padding: 7px 10px;
  background: #f7faf8;
  color: #23332e;
  font-size: 12px;
  font-weight: 750;
}

.flow-rail span + span::before {
  content: "";
  width: 10px;
  height: 1px;
  margin-left: -18px;
  margin-right: 8px;
  background: #9eb0aa;
}

.proof-ledger dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.proof-ledger div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
}

.proof-ledger dt {
  color: #0b5e58;
  font-size: 12px;
  font-weight: 850;
}

.proof-ledger dd {
  margin: 0;
  color: #53605b;
  font-size: 13px;
  line-height: 1.4;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title span {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #0f766e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.section-title h2 {
  margin: 0;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}

.proof-strip div {
  padding: 15px;
  background: #f7faf8;
}

.proof-strip strong {
  display: block;
  margin-bottom: 6px;
  color: #10231f;
  font-size: 13px;
}

.proof-strip span {
  color: #5d6864;
  font-size: 13px;
  line-height: 1.45;
}

.impact-card {
  padding: 16px;
  border: 1px solid #bcd8d2;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e9faf6 0%, #ffffff 72%);
}

.impact-card strong {
  display: block;
  margin-top: 6px;
  color: #0b5e58;
  font-size: 22px;
  line-height: 1.1;
}

.impact-card p {
  margin: 8px 0 0;
  color: #53605b;
  font-size: 13px;
  line-height: 1.45;
}

.brief-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.brief-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: #ffffff;
}

.brief-card.primary-brief {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #0f2c2c 0%, #10231f 100%);
  color: #ffffff;
}

.brief-card h2,
.brief-card h3 {
  margin: 0 0 10px;
}

.brief-card p {
  margin: 0;
  color: #5d6864;
  font-size: 14px;
  line-height: 1.55;
}

.brief-card.primary-brief p {
  color: #d8fffa;
  font-size: 16px;
}

.brief-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.brief-actions button {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.copy-status {
  color: var(--muted);
  font-size: 13px;
}

.brief-copy-label {
  display: block;
  margin-top: 16px;
  color: #31413c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brief-copy-box {
  width: 100%;
  min-height: 126px;
  margin-top: 12px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: #f7faf8;
  color: #25302c;
  font-size: 13px;
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(460px, 1fr) minmax(260px, 320px);
  gap: 18px;
  padding: 18px;
  min-height: calc(100vh - 84px);
}

.input-panel,
.workspace,
.sales-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.input-panel,
.sales-panel {
  padding: 18px;
}

.panel-header h2,
.sales-panel h2,
.result-header h2,
.advisor-layout h2,
.obd-grid h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.panel-header p,
.sales-panel p,
.result-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

form {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #33413b;
  font-size: 13px;
  font-weight: 720;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 11px;
  font-size: 14px;
  line-height: 1.4;
}

textarea {
  resize: vertical;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.workspace {
  overflow: hidden;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-strong);
}

.tab {
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  min-height: 48px;
  padding: 0 18px;
  color: var(--muted);
}

.tab.active {
  background: var(--surface);
  color: var(--accent-dark);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.tab-panel {
  display: none;
  padding: 20px;
}

.tab-panel.active {
  display: block;
}

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

.risk {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid;
  white-space: nowrap;
}

.risk.high,
.risk.safety-critical {
  color: var(--red);
  background: #fff4f2;
  border-color: #ffd0ca;
}

.risk.medium {
  color: var(--amber);
  background: #fff8e8;
  border-color: #f2dca2;
}

.risk.low {
  color: var(--green);
  background: #edf8f1;
  border-color: #c6e6d1;
}

.result-grid,
.advisor-layout,
.obd-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

article {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: #ffffff;
}

article h3 {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.25;
}

article p,
li {
  color: #33413b;
  font-size: 14px;
  line-height: 1.5;
}

ol,
ul {
  margin: 0;
  padding-left: 20px;
}

li + li {
  margin-top: 8px;
}

.sales-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.sales-panel section {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.sales-panel section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.sales-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  color: #42504a;
}

.metric-list {
  display: grid;
  gap: 10px;
}

.metric-list div {
  display: grid;
  gap: 3px;
}

.metric-list strong {
  font-size: 13px;
}

.metric-list span,
.compact-list li,
.demo-note p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .command-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .demo-intelligence {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 330px minmax(0, 1fr);
  }

  .sales-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sales-panel section {
    border-bottom: 0;
    border-right: 1px solid var(--border);
    padding-right: 14px;
    padding-bottom: 0;
  }

  .sales-panel section:last-child {
    border-right: 0;
  }
}

@media (max-width: 820px) {
  .command-center {
    margin: 12px;
    padding: 14px;
    overflow: hidden;
  }

  .command-header {
    flex-direction: column;
  }

  .command-header h2 {
    font-size: 20px;
  }

  .command-grid,
  .proof-ledger div {
    grid-template-columns: 1fr;
  }

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

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .field-grid,
  .result-grid,
  .advisor-layout,
  .obd-grid,
  .brief-layout,
  .sales-panel {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    flex: 0 0 auto;
  }

  .sales-panel section {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 16px;
  }
}

@media (max-width: 1180px) {
  .insight-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .insight-strip,
  .proof-strip {
    grid-template-columns: 1fr;
  }

  .insight-strip article {
    min-height: auto;
    padding: 14px 18px;
  }
}
