:root {
  --ink: #101827;
  --ink-soft: #263449;
  --muted: #637083;
  --quiet: #8b96a6;
  --line: #dbe3ea;
  --line-strong: #c7d2dc;
  --paper: #f5f8f8;
  --surface: #ffffff;
  --surface-tint: #f9fbfc;
  --teal: #0597a2;
  --teal-dark: #047883;
  --teal-soft: #e7f7f8;
  --blue: #2866e8;
  --blue-soft: #ecf3ff;
  --amber: #d67a00;
  --amber-soft: #fff4df;
  --coral: #df493f;
  --coral-soft: #ffefee;
  --green: #149565;
  --green-soft: #e9f8ef;
  --shadow: 0 18px 45px rgba(16, 24, 39, 0.08);
  --shadow-soft: 0 8px 22px rgba(16, 24, 39, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

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

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 3px;
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
}

p {
  color: var(--muted);
  line-height: 1.45;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px 18px;
  background: #fbfdfd;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 23px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand span span {
  color: var(--teal);
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-soft);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.nav-item,
.workspace-switcher,
.role-select,
.profile-button,
.icon-button,
.primary-button,
.secondary-button,
.blue-button,
.text-button,
.add-workflow-button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.nav-item {
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--ink-soft);
  text-align: left;
  font-weight: 600;
}

.nav-item svg {
  color: var(--ink-soft);
}

.nav-item.active {
  background: var(--teal-soft);
  color: var(--ink);
}

.nav-item strong,
.notification-button span {
  min-width: 23px;
  height: 23px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.side-section {
  padding: 15px 6px 0;
  border-top: 1px solid var(--line);
}

.side-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.side-section h2 {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

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

.recent-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 10px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 33px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0 6px;
  color: var(--ink-soft);
  text-align: left;
  font-size: 13px;
}

.recent-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-strong);
}

.recent-item.active .recent-dot,
.recent-item:hover .recent-dot {
  background: var(--teal);
}

.side-metric {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.side-metric span,
.metric-card small,
.detail-meta,
.agent-panel small,
.shadow-panel small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.side-metric strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.side-metric p {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 12px;
  color: var(--green);
  font-size: 12px;
}

.side-metric p svg {
  width: 14px;
  height: 14px;
}

.sparkline {
  height: 45px;
  display: flex;
  align-items: end;
  gap: 5px;
  margin-bottom: 13px;
}

.sparkline span {
  flex: 1;
  min-width: 8px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, var(--teal), #53cbd0);
}

.sparkline span:nth-child(1) { height: 42%; }
.sparkline span:nth-child(2) { height: 58%; }
.sparkline span:nth-child(3) { height: 55%; }
.sparkline span:nth-child(4) { height: 76%; }
.sparkline span:nth-child(5) { height: 59%; }
.sparkline span:nth-child(6) { height: 70%; }
.sparkline span:nth-child(7) { height: 86%; }

.app-frame {
  min-width: 0;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.workspace-switcher,
.role-select,
.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 12px;
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 1px 1px rgba(16, 24, 39, 0.03);
}

.workspace-switcher {
  font-weight: 650;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-color: var(--line);
  background: var(--surface);
}

.notification-button {
  position: relative;
}

.notification-button span {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  font-size: 11px;
}

.profile-button {
  display: grid;
  grid-template-columns: 34px auto 16px;
  grid-template-rows: repeat(2, auto);
  column-gap: 9px;
  row-gap: 0;
  min-width: 186px;
  padding: 5px 9px 5px 5px;
  text-align: left;
}

.profile-button > span {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #293ecb;
  font-weight: 800;
}

.profile-button strong {
  font-size: 12px;
  line-height: 1.15;
}

.profile-button small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.profile-button svg {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  width: 16px;
  height: 16px;
}

.workspace {
  display: grid;
  gap: 16px;
  padding: 20px 24px 32px;
}

.command-grid {
  display: grid;
  grid-template-columns: 1fr minmax(270px, 1fr) minmax(270px, 1fr) 315px;
  gap: 16px;
  align-items: stretch;
}

.workspace-title,
.offer-panel,
.command-card,
.role-panel,
.pipeline,
.metric-card,
.workflow-browser,
.detail-pane,
.handoff-band,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.workspace-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 118px;
  padding: 18px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.workspace-title p {
  margin-bottom: 0;
  font-size: 13px;
}

.title-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
}

.title-icon svg {
  width: 21px;
  height: 21px;
}

.offer-panel {
  grid-column: span 3;
  min-height: 118px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-color: #b7dfe3;
  background: linear-gradient(135deg, #ffffff 0%, #f0fbfb 100%);
}

.offer-panel h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.offer-panel p {
  max-width: 800px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 13px;
}

.offer-panel ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.offer-panel li {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0 10px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.offer-actions {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.offer-actions a,
.primary-button,
.secondary-button {
  text-decoration: none;
}

.command-card {
  min-height: 132px;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
  align-items: center;
}

.command-card p {
  max-width: 330px;
  margin: 7px 0 18px;
  font-size: 13px;
}

.command-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
}

.command-teal .command-icon {
  background: linear-gradient(145deg, #05828d, #06b1bd);
}

.command-blue .command-icon {
  background: linear-gradient(145deg, #1b56da, #407cf5);
}

.command-icon svg {
  width: 28px;
  height: 28px;
}

.primary-button,
.blue-button,
.secondary-button,
.text-button,
.add-workflow-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  font-weight: 750;
  white-space: nowrap;
}

.command-card .primary-button,
.command-card .blue-button {
  min-width: 150px;
}

.primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.primary-button:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

.blue-button {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.blue-button:hover {
  background: #1f55c7;
}

.secondary-button,
.add-workflow-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.secondary-button:hover,
.icon-button:hover,
.add-workflow-button:hover,
.workspace-switcher:hover,
.role-select:hover,
.profile-button:hover {
  border-color: var(--teal);
}

.text-button {
  min-height: 30px;
  padding: 0 5px;
  color: var(--blue);
  background: transparent;
}

.role-panel {
  min-height: 132px;
  padding: 18px 18px 15px;
}

.role-panel > p {
  margin: 6px 0 12px;
  font-size: 12px;
}

.role-list {
  display: grid;
  gap: 7px;
}

.role-option {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 0 10px;
  text-align: left;
  font-weight: 650;
}

.role-option svg {
  color: var(--ink-soft);
}

.role-option.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.role-option .selected-check {
  width: 20px;
  height: 20px;
  display: none;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--teal-dark);
}

.role-option.active .selected-check {
  display: grid;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  overflow-x: auto;
}

.pipeline-node {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  min-width: 130px;
}

.pipeline-node span {
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-tint);
}

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

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

.pipeline-node.complete span {
  color: var(--teal);
  border-color: #96d9dd;
  background: var(--teal-soft);
}

.pipeline-node.active span {
  color: var(--blue);
  border-color: #a9c4ff;
  background: var(--blue-soft);
}

.pipeline-node.review span {
  color: var(--amber);
  border-color: #ffd491;
  background: var(--amber-soft);
}

.pipeline-node.autopilot span {
  color: var(--coral);
  border-color: #ffb5b0;
  background: var(--coral-soft);
}

.pipeline-line {
  display: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.metric-card strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.metric-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.metric-icon {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
}

.metric-icon.teal { color: var(--teal); background: var(--teal-soft); }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.coral { color: var(--coral); background: var(--coral-soft); }

.workbench {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.workflow-browser,
.detail-pane {
  min-width: 0;
}

.workflow-browser {
  padding: 14px;
}

.section-header,
.detail-header,
.apps-panel header,
.agent-panel header,
.shadow-panel header,
.permission-panel header,
.approval-checklist header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  margin: 14px 0 10px;
}

.search-box {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 10px;
}

.search-box svg {
  color: var(--quiet);
  width: 16px;
  height: 16px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  padding: 10px 11px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  justify-self: start;
  padding: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(5, 151, 162, 0.14);
}

textarea {
  min-height: 112px;
  line-height: 1.45;
  resize: vertical;
}

.search-box input {
  border: 0;
  padding: 0;
  min-width: 0;
  background: transparent;
}

.search-box input:focus {
  box-shadow: none;
}

.workflow-list {
  display: grid;
  gap: 9px;
}

.workflow-row {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  text-align: left;
  position: relative;
}

.workflow-row::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.workflow-row.active {
  background: var(--blue-soft);
  border-color: #c8ddff;
}

.workflow-row.active::before {
  background: var(--blue);
}

.workflow-row-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-soft);
  background: var(--surface-tint);
}

.workflow-row strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
}

.workflow-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill,
.status-badge,
.green-tag,
.apps-panel header span,
.permission-panel header span,
.approval-checklist header span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.shadow,
.status-badge.shadow {
  color: var(--blue);
  background: #dfeaff;
}

.status-pill.approve,
.status-badge.approve {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-pill.autopilot,
.status-badge.autopilot,
.green-tag {
  color: var(--green);
  background: var(--green-soft);
}

.status-pill.draft,
.status-badge.draft {
  color: var(--muted);
  background: #eef2f5;
}

.add-workflow-button {
  width: 100%;
  margin-top: 14px;
}

.detail-pane {
  overflow: hidden;
}

.detail-header {
  min-height: 74px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.detail-title-row h2 {
  font-size: 18px;
}

.detail-header p {
  margin: 4px 0 0;
  font-size: 12px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tabs {
  display: flex;
  gap: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  min-height: 46px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

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

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

.detail-grid {
  display: grid;
  grid-template-columns: minmax(155px, 0.95fr) minmax(165px, 1fr) minmax(180px, 1.1fr) minmax(215px, 1.3fr);
  gap: 12px;
}

.apps-panel,
.agent-panel,
.shadow-panel,
.permission-panel,
.approval-checklist,
.build-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.app-list,
.agent-list,
.gate-list,
.run-log,
.approval-queue,
.history-list,
.automation-map,
.artifact-actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.app-line,
.agent-line,
.gate-line,
.history-item,
.queue-item,
.map-step,
.run-item {
  display: grid;
  gap: 3px;
  min-height: 34px;
}

.app-line {
  grid-template-columns: 24px minmax(0, 1fr) 10px;
  align-items: center;
}

.app-line i,
.agent-line i {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--ink-soft);
}

.app-line strong,
.agent-line strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.22;
}

.connected-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.connected-dot.connected {
  background: var(--green);
}

.connected-dot.missing {
  background: var(--line-strong);
}

.copy-helper {
  position: fixed;
  top: 0;
  left: -9999px;
}

.agent-line {
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
}

.agent-line small {
  color: var(--ink-soft);
}

.test-stats {
  display: grid;
  gap: 9px;
  margin: 13px 0;
}

.test-stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.test-stats dt {
  max-width: 120px;
}

.test-stats dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.test-stats dd.pass {
  color: var(--green);
}

.full-width {
  width: 100%;
}

.gate-line {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.gate-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.gate-line strong,
.queue-item strong,
.history-item strong,
.run-item strong,
.map-step strong {
  color: var(--ink);
  font-size: 13px;
}

.gate-line span,
.queue-item span,
.history-item span,
.run-item span,
.map-step span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.gate-line > span:first-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.gate-status {
  min-width: 76px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 12px;
  font-weight: 800;
}

.gate-status.approved {
  color: var(--green);
  background: var(--green-soft);
}

.approval-checklist {
  margin-top: 12px;
}

.checklist-table {
  display: grid;
  margin-top: 10px;
}

.check-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 110px 110px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  text-align: left;
}

.check-row:first-child {
  border-top: 0;
}

.check-toggle {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: #fff;
}

.check-row.done .check-toggle {
  border-color: var(--green);
  background: var(--green);
}

.check-row.done .check-title {
  color: var(--muted);
  text-decoration: line-through;
}

.check-owner,
.check-date {
  color: var(--muted);
  font-size: 12px;
}

.automation-map {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.map-step {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  position: relative;
}

.map-step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -11px;
  top: 50%;
  width: 10px;
  border-top: 1px dashed var(--line-strong);
}

.map-step span:first-child {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-soft);
}

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

ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.run-item,
.queue-item,
.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.queue-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.queue-item button {
  min-width: 95px;
}

.handoff-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 2fr);
  gap: 18px;
  padding: 18px;
  align-items: center;
}

.handoff-band p {
  margin: 6px 0 0;
  font-size: 13px;
}

.handoff-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.modal {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(16, 24, 39, 0.42);
  backdrop-filter: blur(5px);
}

.modal-card {
  padding: 18px;
}

.modal-card header,
.modal-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-card header {
  margin-bottom: 16px;
}

.modal-card header p {
  margin: 4px 0 0;
  font-size: 13px;
}

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

.span-2 {
  grid-column: 1 / -1;
}

.modal-card footer {
  margin-top: 16px;
  justify-content: flex-end;
}

.agent-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.agent-steps article {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.agent-steps strong {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--teal);
  background: var(--teal-soft);
}

.agent-steps span {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
}

.prompt-box textarea {
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 40px));
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 11px 13px;
  font-size: 13px;
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.thanks-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper);
}

.thanks-panel {
  width: min(620px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
}

.thanks-panel .brand-mark {
  margin-bottom: 16px;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.thanks-next {
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.thanks-next ol {
  margin-bottom: 0;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  text-decoration: none;
  font-weight: 800;
}

.brand-block {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-block > div:last-child {
  min-width: 0;
}

.brand-block .eyebrow,
.brand-block h1 {
  overflow-wrap: anywhere;
}

.brand-link {
  color: var(--ink);
}

.primary-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  padding: 0 14px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.app-shell > .topbar,
.app-shell > .sample-page {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.sample-page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.sample-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 320px);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.sample-hero > div,
.sample-score,
.sample-panel,
.sample-metrics > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.sample-hero > div,
.sample-score,
.sample-panel {
  padding: 18px;
}

.sample-hero h2 {
  max-width: 720px;
  font-size: 30px;
  line-height: 1.08;
}

.sample-hero p {
  max-width: 780px;
  margin: 10px 0 0;
}

.sample-score {
  display: grid;
  align-content: center;
  gap: 8px;
}

.sample-score span,
.sample-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.sample-score strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.sample-score small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.sample-metrics,
.sample-grid {
  display: grid;
  gap: 12px;
}

.sample-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.sample-metrics > div {
  display: grid;
  gap: 7px;
  padding: 14px;
}

.sample-metrics strong {
  font-size: 14px;
  line-height: 1.25;
}

.sample-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sample-panel.wide {
  grid-column: 1 / -1;
}

.section-heading {
  margin-bottom: 12px;
}

.intake-form-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.wide-field {
  grid-column: 1 / -1;
}

.intake-form-panel .section-heading {
  margin-bottom: 0;
}

.saved-brief-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #b7dfe3;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal-soft), var(--blue-soft));
  padding: 14px;
}

.saved-brief-panel[hidden] {
  display: none;
}

.saved-brief-panel h3 {
  margin-bottom: 5px;
  font-size: 15px;
}

.saved-brief-panel p {
  margin: 0;
  font-size: 13px;
}

.saved-brief-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.intake-status {
  min-height: 18px;
  margin: -5px 0 0;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.scope-brief-field textarea {
  min-height: 190px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.toggle-label {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
}

.sample-flow,
.classification-grid,
.test-grid {
  display: grid;
  gap: 10px;
}

.sample-flow {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.map-node,
.test-card,
.classification-grid > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 12px;
}

.map-node {
  display: grid;
  gap: 6px;
}

.map-node strong,
.test-card strong,
.classification-grid h3 {
  color: var(--ink);
  font-size: 13px;
}

.map-node span,
.test-card p,
.classification-grid li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.classification-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.code-preview {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #13202b;
  color: #e6f2f1;
  padding: 14px;
  font-size: 12px;
  line-height: 1.5;
}

.test-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.test-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.test-card span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.offer-page {
  min-height: 100vh;
  display: grid;
  gap: 20px;
  padding: 20px;
}

.offer-nav,
.offer-hero,
.offer-grid article,
.offer-checks,
.offer-faq,
.offer-band,
.offer-close {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.offer-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
}

.offer-nav > div,
.offer-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.offer-brand {
  padding: 0;
}

.offer-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 24px;
  align-items: stretch;
  padding: clamp(20px, 4vw, 42px);
}

.offer-hero h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.98;
}

.offer-lede {
  max-width: 780px;
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 18px;
}

.offer-proof {
  display: grid;
  align-content: end;
  min-height: 280px;
  border: 1px solid #b7dfe3;
  border-radius: 8px;
  background: linear-gradient(160deg, #e7f7f8 0%, #ffffff 72%);
  padding: 22px;
}

.offer-proof span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.offer-proof strong {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.offer-proof p {
  margin-bottom: 0;
}

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

.offer-grid article {
  min-height: 190px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
}

.offer-grid article > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-soft);
}

.offer-grid h2 {
  font-size: 18px;
}

.offer-grid p {
  margin-bottom: 0;
  font-size: 14px;
}

.offer-checks {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 20px;
  padding: 20px;
}

.offer-checks h2,
.offer-faq h2 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: 24px;
}

.offer-checks p,
.offer-faq p {
  margin-bottom: 0;
}

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

.check-card-grid article,
.faq-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 14px;
}

.check-card-grid article {
  display: grid;
  gap: 8px;
}

.check-card-grid span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-soft);
}

.check-card-grid strong {
  color: var(--ink);
}

.check-card-grid p,
.faq-grid p {
  font-size: 13px;
}

.offer-faq {
  display: grid;
  gap: 16px;
  padding: 20px;
}

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

.faq-grid article {
  display: grid;
  gap: 8px;
}

.faq-grid h3 {
  font-size: 14px;
}

.offer-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 20px;
  padding: 20px;
}

.offer-band ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.offer-band li {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.offer-band li:first-child {
  border-top: 0;
  padding-top: 0;
}

.offer-band li strong {
  color: var(--ink);
}

.offer-band li span {
  color: var(--muted);
}

.offer-close {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.offer-close p {
  margin: 6px 0 0;
}

.calculator-page {
  min-height: 100vh;
  display: grid;
  gap: 20px;
  padding: 20px;
}

.calculator-hero,
.calculator-controls,
.calculator-results,
.calculator-snapshot,
.readiness-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.calculator-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 24px;
  align-items: stretch;
  padding: clamp(20px, 4vw, 42px);
}

.calculator-hero h1 {
  max-width: 820px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 0.98;
}

.calculator-lede {
  max-width: 760px;
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 18px;
}

.calculator-snapshot {
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 280px;
  border-color: #b7dfe3;
  background:
    linear-gradient(145deg, rgba(231, 247, 248, 0.95), rgba(255, 255, 255, 0.96) 64%),
    linear-gradient(35deg, rgba(40, 102, 232, 0.14), rgba(223, 73, 63, 0.08));
  padding: 22px;
}

.calculator-snapshot span,
.value-banner span,
.result-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.calculator-snapshot strong {
  color: var(--ink);
  font-size: 40px;
  line-height: 1;
}

.calculator-snapshot p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 800;
}

.calculator-snapshot small {
  color: var(--muted);
  font-size: 13px;
}

.calculator-workbench {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.calculator-controls,
.calculator-results {
  display: grid;
  gap: 18px;
  padding: 20px;
}

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

.input-field,
.range-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.input-field span,
.range-header span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.input-field input,
.input-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.input-field input:focus,
.input-field select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(5, 151, 162, 0.14);
}

.range-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 14px;
}

.range-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.range-header strong {
  color: var(--teal-dark);
  font-size: 18px;
}

.range-field input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.readiness-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--surface-tint);
}

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

.readiness-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.readiness-item input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.readiness-item span {
  display: grid;
  gap: 3px;
}

.readiness-item strong {
  color: var(--ink);
  font-size: 14px;
}

.readiness-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.result-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.result-header h2 {
  font-size: 24px;
}

.signal-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 850;
}

.signal-chip[data-state="caution"] {
  background: var(--amber-soft);
  color: var(--amber);
}

.signal-chip[data-state="weak"] {
  background: var(--coral-soft);
  color: var(--coral);
}

.value-banner {
  display: grid;
  gap: 8px;
  border: 1px solid #b7dfe3;
  border-radius: 8px;
  background: var(--teal-soft);
  padding: 18px;
}

.value-banner strong {
  color: var(--ink);
  font-size: 44px;
  line-height: 1;
}

.value-banner p {
  margin: 0;
  color: var(--ink-soft);
}

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

.result-grid > div {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 13px;
}

.result-grid strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.1;
}

.calc-plan {
  display: grid;
  gap: 10px;
}

.calc-plan > div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 13px;
}

.calc-plan span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  grid-row: span 2;
}

.calc-plan strong {
  color: var(--ink);
  font-size: 14px;
}

.calc-plan p {
  margin: 0;
  font-size: 13px;
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.calculator-proof {
  margin-bottom: 4px;
}

.builder-page {
  min-height: 100vh;
  display: grid;
  gap: 20px;
  padding: 20px;
}

.builder-hero,
.builder-controls,
.builder-results {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.builder-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 24px;
  align-items: stretch;
  padding: clamp(20px, 4vw, 42px);
}

.builder-hero h1 {
  max-width: 860px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.98;
}

.builder-lede {
  max-width: 760px;
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 18px;
}

.builder-snapshot {
  display: grid;
  align-content: end;
  gap: 12px;
  min-width: 0;
  border: 1px solid #b7dfe3;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal-soft), var(--blue-soft));
  padding: 22px;
}

.builder-snapshot span,
.builder-snapshot small,
.builder-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.builder-snapshot span {
  text-transform: uppercase;
}

.builder-snapshot strong {
  color: var(--ink);
  font-size: 32px;
  line-height: 1.05;
}

.builder-snapshot p {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 800;
}

.builder-workbench {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(360px, 1.05fr);
  gap: 20px;
  align-items: start;
}

.builder-controls,
.builder-results {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 20px;
}

.builder-apps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 14px;
}

.builder-apps legend {
  padding: 0 6px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.builder-apps label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 750;
}

.builder-apps input {
  accent-color: var(--teal);
}

.builder-readiness {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.builder-path {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.builder-path div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 12px;
}

.builder-path span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 850;
}

.builder-path strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

#briefOutput {
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.builder-status {
  min-height: 18px;
  margin: -6px 0 0;
}

.builder-proof {
  margin-bottom: 4px;
}

.package-page {
  min-height: 100vh;
  display: grid;
  gap: 20px;
  padding: 20px;
}

.package-hero,
.package-controls,
.package-results {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.package-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  gap: 24px;
  align-items: stretch;
  padding: clamp(20px, 4vw, 42px);
}

.package-hero h1 {
  max-width: 880px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.98;
}

.package-lede {
  max-width: 780px;
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 18px;
}

.package-snapshot {
  display: grid;
  align-content: end;
  gap: 10px;
  min-width: 0;
  border: 1px solid #b7dfe3;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal-soft), var(--blue-soft));
  padding: 22px;
}

.package-snapshot span,
.package-snapshot small,
.package-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.package-snapshot span {
  text-transform: uppercase;
}

.package-snapshot strong {
  color: var(--ink);
  font-size: 40px;
  line-height: 1;
}

.package-snapshot p {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 800;
}

.package-workbench {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(380px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.package-controls,
.package-results {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 20px;
}

#packageBriefInput {
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.artifact-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 12px;
  text-align: left;
}

.artifact-card[data-active="true"] {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(5, 151, 162, 0.12);
}

.artifact-card > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-soft);
}

.artifact-card strong,
.artifact-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.artifact-card strong {
  color: var(--ink);
  font-size: 14px;
}

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

.artifact-card .secondary-button {
  min-width: 96px;
}

.package-preview-field textarea {
  min-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.package-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.package-proof {
  margin-bottom: 4px;
}

.shadow-page {
  min-height: 100vh;
  display: grid;
  gap: 20px;
  padding: 20px;
}

.shadow-hero,
.shadow-controls,
.shadow-results {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.shadow-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  gap: 24px;
  align-items: stretch;
  padding: clamp(20px, 4vw, 42px);
}

.shadow-hero h1 {
  max-width: 880px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.98;
}

.shadow-lede {
  max-width: 780px;
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 18px;
}

.shadow-snapshot {
  display: grid;
  align-content: end;
  gap: 10px;
  min-width: 0;
  border: 1px solid #b7dfe3;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(231, 247, 248, 0.96), rgba(236, 243, 255, 0.95)),
    linear-gradient(45deg, rgba(5, 151, 162, 0.18), rgba(214, 122, 0, 0.08));
  padding: 22px;
}

.shadow-snapshot span,
.shadow-snapshot small,
.shadow-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.shadow-snapshot span {
  text-transform: uppercase;
}

.shadow-snapshot strong {
  color: var(--ink);
  font-size: 40px;
  line-height: 1;
}

.shadow-snapshot p {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 800;
}

.shadow-workbench {
  display: grid;
  grid-template-columns: minmax(340px, 0.88fr) minmax(390px, 1.12fr);
  gap: 20px;
  align-items: start;
}

.shadow-controls,
.shadow-results {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 20px;
}

#shadowBriefInput {
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

#shadowItemInput {
  min-height: 210px;
}

.shadow-result-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.shadow-path {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.shadow-path article,
.shadow-decision-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 12px;
}

.shadow-path span,
.shadow-decision-grid span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
}

.shadow-path strong,
.shadow-decision-grid strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.shadow-path p,
.shadow-decision-grid p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.shadow-decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shadow-decision-grid article {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.shadow-decision-grid span {
  margin-bottom: 0;
}

.shadow-draft-field textarea {
  min-height: 230px;
}

.shadow-packet-field textarea {
  min-height: 300px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.shadow-proof {
  margin-bottom: 4px;
}

.use-cases-page {
  min-height: 100vh;
  display: grid;
  gap: 20px;
  padding: 20px;
}

.use-case-hero,
.use-case-band,
.segment-detail,
.segment-cards a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.use-case-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 470px);
  gap: 26px;
  align-items: stretch;
  padding: clamp(20px, 4vw, 42px);
}

.use-case-hero h1 {
  max-width: 860px;
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 0.98;
}

.use-case-lede {
  max-width: 760px;
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 18px;
}

.use-case-visual {
  display: grid;
  align-content: end;
  gap: 12px;
  min-width: 0;
  margin: 0;
}

.use-case-visual img {
  width: 100%;
  max-height: 330px;
  object-fit: cover;
  object-position: top left;
  border: 1px solid #b7dfe3;
  border-radius: 8px;
  background: var(--teal-soft);
}

.use-case-visual figcaption {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

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

.segment-cards a {
  display: grid;
  gap: 10px;
  min-height: 170px;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
}

.segment-cards span,
.workflow-card-grid span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-soft);
  font-weight: 850;
}

.segment-cards strong {
  font-size: 18px;
}

.segment-cards small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.use-case-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 20px;
  padding: 20px;
}

.use-case-band h2,
.segment-heading h2 {
  max-width: 780px;
  margin-bottom: 10px;
  font-size: 24px;
}

.fit-grid,
.workflow-card-grid {
  display: grid;
  gap: 12px;
}

.fit-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fit-grid article,
.workflow-card-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 14px;
}

.fit-grid strong,
.workflow-card-grid h3 {
  color: var(--ink);
  font-size: 14px;
}

.fit-grid p,
.workflow-card-grid p,
.segment-heading p {
  margin-bottom: 0;
  font-size: 13px;
}

.segment-detail {
  display: grid;
  gap: 16px;
  padding: 20px;
  scroll-margin-top: 18px;
}

.workflow-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workflow-card-grid article {
  display: grid;
  gap: 9px;
}

.use-case-close-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

  .workspace-title {
    grid-column: 1 / -1;
    min-height: auto;
    padding: 0;
  }

  .offer-panel {
    grid-column: 1 / -1;
  }

  .role-panel {
    grid-column: 1 / -1;
  }

  .role-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .offer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .build-grid,
  .handoff-band,
  .offer-hero,
  .calculator-hero,
  .calculator-workbench,
  .builder-hero,
  .builder-workbench,
  .package-hero,
  .package-workbench,
  .shadow-hero,
  .shadow-workbench,
  .use-case-hero,
  .use-case-band,
  .offer-checks,
  .offer-band,
  .sample-hero {
    grid-template-columns: 1fr;
  }

  .check-card-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }

  .segment-cards,
  .fit-grid,
  .workflow-card-grid,
  .builder-readiness,
  .builder-path,
  .shadow-path,
  .shadow-decision-grid {
    grid-template-columns: 1fr;
  }

  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sample-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .handoff-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: auto;
    position: static;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 0 0 132px;
  }

  .nav-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .side-section,
  .side-metric {
    display: none;
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .workflow-browser {
    order: 2;
  }

  .detail-pane {
    order: 1;
  }

  .automation-map {
    grid-template-columns: 1fr;
  }

  .map-step:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .top-actions {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }

  .workspace-switcher,
  .role-select,
  .profile-button {
    flex: 1 1 auto;
  }

  .profile-button {
    min-width: 0;
  }

  .workspace {
    padding: 14px;
  }

  .command-grid,
  .metric-grid,
  .detail-grid,
  .modal-grid,
  .agent-steps,
  .handoff-form,
  .intake-form-panel {
    grid-template-columns: 1fr;
  }

  .saved-brief-panel {
    grid-template-columns: 1fr;
  }

  .saved-brief-actions {
    justify-content: stretch;
  }

  .saved-brief-actions .secondary-button,
  .saved-brief-actions .text-button {
    width: 100%;
  }

  .offer-panel {
    grid-template-columns: 1fr;
  }

  .offer-panel ul {
    display: grid;
  }

  .sample-page {
    padding: 14px;
  }

  .sample-hero h2 {
    font-size: 24px;
  }

  .sample-metrics,
  .sample-grid,
  .classification-grid,
  .test-grid,
  .sample-flow {
    grid-template-columns: 1fr;
  }

  .brand-block {
    width: 100%;
  }

  .brand-block,
  .sample-page,
  .sample-hero,
  .sample-metrics,
  .sample-grid,
  .sample-panel {
    min-width: 0;
    max-width: 100%;
  }

  .top-actions .primary-action {
    flex: 1 1 180px;
    max-width: 100%;
  }

  .offer-actions {
    min-width: 0;
  }

  .offer-page {
    padding: 12px;
  }

  .calculator-page {
    padding: 12px;
  }

  .builder-page {
    padding: 12px;
  }

  .package-page {
    padding: 12px;
  }

  .shadow-page {
    padding: 12px;
  }

  .use-cases-page {
    padding: 12px;
  }

  .offer-nav,
  .offer-close {
    align-items: stretch;
    flex-direction: column;
  }

  .offer-nav > div,
  .offer-hero-actions,
  .offer-close .primary-button {
    width: 100%;
  }

  .offer-nav .primary-button,
  .offer-nav .secondary-button,
  .offer-hero-actions .primary-button,
  .offer-hero-actions .secondary-button,
  .offer-close .primary-button {
    width: 100%;
  }

  .offer-proof {
    min-height: 220px;
  }

  .calculator-snapshot {
    min-height: 220px;
  }

  .calculator-hero h1 {
    font-size: 34px;
  }

  .builder-hero h1 {
    font-size: 34px;
  }

  .package-hero h1 {
    font-size: 34px;
  }

  .shadow-hero h1 {
    font-size: 34px;
  }

  .use-case-hero h1 {
    font-size: 34px;
  }

  .calculator-controls,
  .calculator-results,
  .builder-controls,
  .builder-results,
  .package-controls,
  .package-results,
  .shadow-controls,
  .shadow-results {
    padding: 16px;
  }

  .builder-apps {
    grid-template-columns: 1fr;
  }

  .artifact-grid {
    grid-template-columns: 1fr;
  }

  .artifact-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .artifact-card .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .shadow-result-grid,
  .shadow-path,
  .shadow-decision-grid {
    grid-template-columns: 1fr;
  }

  .use-case-band,
  .segment-detail {
    padding: 16px;
  }

  .input-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

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

  .value-banner strong {
    font-size: 36px;
  }

  .calc-actions .primary-button,
  .calc-actions .secondary-button {
    width: 100%;
  }

  .use-case-close-actions,
  .use-case-close-actions .primary-button,
  .use-case-close-actions .secondary-button {
    width: 100%;
  }

  .offer-grid {
    grid-template-columns: 1fr;
  }

  .offer-band li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .command-card {
    grid-template-columns: 50px minmax(0, 1fr);
    padding: 14px;
  }

  .command-icon {
    width: 50px;
    height: 50px;
  }

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

  .pipeline {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
  }

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

  .detail-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .detail-actions .secondary-button {
    flex: 1 1 160px;
  }

  .check-row {
    grid-template-columns: 26px minmax(0, 1fr);
    padding: 9px 0;
  }

  .check-owner,
  .check-date {
    grid-column: 2;
  }
}
