:root {
  color-scheme: light;
  --ink: #172019;
  --muted: #657068;
  --line: #dfe4df;
  --line-strong: #c8d0c9;
  --canvas: #f3f5f2;
  --paper: #ffffff;
  --forest: #173f2e;
  --forest-soft: #e6f0e9;
  --amber: #8b5b12;
  --amber-soft: #fbf1dc;
  --rose: #8a3d3d;
  --rose-soft: #faeaea;
  --blue: #375c78;
  --blue-soft: #e8f0f5;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(23, 32, 25, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

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

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(55, 92, 120, 0.25);
  outline-offset: 2px;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.8rem, 4vw, 3.25rem);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1.06rem;
  letter-spacing: -0.018em;
}

p {
  color: var(--muted);
}

.prototype-banner {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #e7d6b7;
  background: var(--amber-soft);
  color: #65471a;
  text-align: center;
  font-size: 0.8rem;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: calc(100vh - 42px);
  flex-direction: column;
  padding: 1.5rem 1.1rem;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 0.55rem;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: var(--forest);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-name {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
}

.eyebrow {
  margin-bottom: 0.28rem;
  color: #7a847c;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 0.3rem;
  margin-top: 2.1rem;
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #5d685f;
  cursor: pointer;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  background: #edf1ed;
  color: var(--ink);
}

.nav-item.is-active {
  font-weight: 700;
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--forest);
}

.sidebar-offer {
  margin-top: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafbfa;
}

.sidebar-offer p {
  margin-bottom: 0.35rem;
  color: #4d5950;
  font-size: 0.78rem;
}

.sidebar-offer .small {
  margin-top: 0.65rem;
  margin-bottom: 0;
  color: #889089;
}

.main-content {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 3vw, 3.5rem) 5rem;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.header-actions,
.panel-heading,
.view-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.view {
  animation: appear 180ms ease both;
}

.view[hidden] {
  display: none;
}

.view-heading {
  align-items: flex-end;
  padding: 3.8rem 0 2rem;
}

.view-heading > div:first-child {
  max-width: 760px;
}

.view-heading p:last-child {
  max-width: 680px;
  margin-bottom: 0;
  font-size: 1rem;
}

.mode-chip,
.status-label,
.status-pill,
.execution-label,
.owner-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  white-space: nowrap;
}

.mode-chip {
  padding: 0.48rem 0.75rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: #59635b;
  font-size: 0.74rem;
  font-weight: 700;
}

.mode-chip-green {
  border-color: #c8dbce;
  background: var(--forest-soft);
  color: var(--forest);
}

.button {
  min-height: 42px;
  padding: 0.68rem 1rem;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 730;
}

.button-primary {
  background: var(--forest);
  color: white;
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--paper);
}

.button-dark {
  background: #1f2420;
  color: white;
}

.button-full {
  width: 100%;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--forest);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
}

.attention-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.2rem;
  padding: 1.35rem;
  border: 1px solid #d4ded6;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.attention-card p:last-child {
  margin-bottom: 0;
}

.attention-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: var(--forest-soft);
  color: var(--forest);
  font-weight: 800;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.status-card,
.panel,
.preview-panel,
.tool-card,
.boundary-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.status-card {
  padding: 1.2rem;
}

.status-card h3 {
  margin-top: 1rem;
}

.status-card p {
  min-height: 66px;
  font-size: 0.84rem;
}

.status-label,
.status-pill,
.execution-label,
.owner-label {
  padding: 0.24rem 0.5rem;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}

.status-ready {
  background: var(--forest-soft);
  color: var(--forest);
}

.status-attention,
.status-missing {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-limited,
.status-blocked {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-new {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-contacted,
.status-qualified,
.status-booked {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-won {
  background: var(--forest-soft);
  color: var(--forest);
}

.status-lost,
.status-spam {
  background: var(--rose-soft);
  color: var(--rose);
}

.section-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.2rem;
}

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

.panel {
  padding: 1.25rem;
}

.panel-heading {
  align-items: flex-start;
  margin-bottom: 1.2rem;
}

.panel-heading h3 {
  margin-bottom: 0;
}

.compact-list {
  display: grid;
  gap: 0.7rem;
}

.compact-row {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid #edf0ed;
}

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

.compact-row div {
  display: grid;
  gap: 0.2rem;
}

.compact-row span:not(.status-pill) {
  color: var(--muted);
  font-size: 0.75rem;
}

.compact-row time {
  color: var(--muted);
  font-size: 0.72rem;
}

.empty-state {
  margin-bottom: 0;
  padding: 1.2rem 0;
  color: #8a938c;
  font-size: 0.82rem;
}

.builder-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.8fr) minmax(420px, 1.2fr);
  gap: 1.2rem;
  align-items: start;
}

.form-panel {
  display: grid;
  gap: 1rem;
}

.field,
.field-row {
  display: grid;
  gap: 0.45rem;
}

.field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

label {
  color: #4c574f;
  font-size: 0.76rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 43px;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: white;
  color: var(--ink);
}

.form-message {
  display: none;
  padding: 0.7rem;
  border-radius: 9px;
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 0.76rem;
}

.form-message.has-message {
  display: block;
}

.save-state {
  color: #7b847d;
  font-size: 0.72rem;
}

.preview-panel {
  overflow: hidden;
  padding: 1.1rem;
  background: #e9ede9;
}

.preview-browser {
  overflow: hidden;
  border: 1px solid #cfd6cf;
  border-radius: 14px;
  background: white;
  box-shadow: 0 20px 45px rgba(25, 33, 27, 0.12);
}

.browser-bar {
  display: flex;
  gap: 5px;
  padding: 0.65rem;
  border-bottom: 1px solid #edf0ed;
  background: #f7f8f7;
}

.browser-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c5cbc6;
}

.preview-content {
  width: min(470px, 100%);
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 3rem);
}

.preview-kicker {
  color: var(--forest);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preview-content h3 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.estimate-preview-form {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.privacy-note,
.verification-note p {
  font-size: 0.72rem;
}

.preview-result {
  min-height: 1.4rem;
  margin-top: 0.8rem;
  color: var(--forest);
  font-size: 0.76rem;
  font-weight: 700;
}

.verification-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 1rem 0.2rem 0;
}

.verification-note p {
  margin-bottom: 0;
  color: #556158;
}

.verification-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 0.3rem;
  border-radius: 50%;
  background: var(--amber);
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.table-panel .panel-heading {
  padding: 1.25rem 1.25rem 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #fafbfa;
  color: #778078;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

td {
  font-size: 0.8rem;
}

td strong,
.table-subtext {
  display: block;
}

.table-subtext {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.status-select {
  min-width: 112px;
  min-height: 36px;
  padding: 0.45rem 0.55rem;
  font-size: 0.74rem;
}

.foundation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 1rem;
  align-items: start;
}

.foundation-list {
  display: grid;
}

.foundation-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: start;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.foundation-item:first-child {
  border-top: 0;
}

.foundation-marker {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 800;
}

.foundation-ready {
  background: var(--forest-soft);
  color: var(--forest);
}

.foundation-missing {
  background: var(--amber-soft);
  color: var(--amber);
}

.foundation-blocked {
  background: var(--blue-soft);
  color: var(--blue);
}

.foundation-copy h4 {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.foundation-copy p {
  margin-bottom: 0.45rem;
  font-size: 0.76rem;
}

.owner-label {
  padding-left: 0;
  color: #7d867f;
}

.quiet-panel {
  background: #f7f9f7;
}

.clean-list {
  display: grid;
  gap: 0.6rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}

.clean-list li {
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  color: #58635a;
  font-size: 0.78rem;
}

.event-list {
  display: grid;
}

.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

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

.event-row div {
  display: grid;
  gap: 0.25rem;
}

.event-row code {
  color: var(--muted);
  font-size: 0.72rem;
}

.tool-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.tool-card {
  display: flex;
  min-height: 245px;
  flex-direction: column;
  padding: 1.2rem;
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.6rem;
}

.tool-index {
  color: #9aa29b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.execution-label {
  background: #f0f2f0;
  color: #5d675f;
}

.tool-card p {
  flex: 1;
  font-size: 0.8rem;
}

.tool-card .text-button {
  margin-top: 1.2rem;
  text-align: left;
}

.boundary-card {
  margin-top: 1rem;
  padding: 1.3rem;
  background: #f9faf9;
}

.boundary-card p:last-child {
  margin-bottom: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.summary-strip span {
  display: grid;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.72rem;
}

.summary-strip b {
  color: var(--ink);
  font-size: 1.6rem;
}

.action-queue {
  display: grid;
  gap: 0.75rem;
}

.action-queue .attention-card {
  box-shadow: none;
}

.step-strip {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.step-strip span {
  flex: 0 0 auto;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.estimator-panel,
.toolbar,
.lead-detail,
.analytics-tools {
  margin-bottom: 1rem;
}

.inline-actions,
.inline-form,
.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}

.toolbar .field {
  flex: 1 1 180px;
}

.calculation-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--forest-soft);
}

.calculation-result p:last-child {
  margin-bottom: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.inline-form {
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}

.inline-form input {
  width: auto;
  flex: 1 1 180px;
}

.activity-list p,
.page-audit p {
  margin: 0;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
}

.page-audit + .page-audit {
  margin-top: 1rem;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 12px;
  background: #f5f7f5;
  color: #3f4b42;
  font-size: 0.72rem;
}

textarea {
  resize: vertical;
}

output {
  display: block;
  margin-top: 1rem;
  overflow-wrap: anywhere;
  color: var(--forest);
  font-size: 0.75rem;
}

.overview-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.75fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.workspace-spotlight,
.scan-card {
  min-height: 290px;
  border-radius: 24px;
}

.workspace-spotlight {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-direction: column;
  padding: clamp(1.5rem, 4vw, 3rem);
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 15%, rgba(151, 206, 174, 0.2), transparent 35%),
    linear-gradient(145deg, #101612, #1b3527);
  color: white;
  box-shadow: 0 28px 70px rgba(23, 32, 25, 0.16);
}

.workspace-spotlight .eyebrow {
  color: #a7c7b2;
}

.workspace-spotlight h3 {
  max-width: 720px;
  margin-bottom: 0.75rem;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.workspace-spotlight p:not(.eyebrow) {
  max-width: 620px;
  margin-bottom: 1.4rem;
  color: #c7d4ca;
  font-size: 1rem;
}

.button-light {
  border-color: rgba(255, 255, 255, 0.18);
  background: white;
  color: #142018;
}

.scan-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--line);
  background: var(--paper);
}

.scan-card h3 {
  max-width: 240px;
  font-size: 1.45rem;
  line-height: 1.08;
}

.scan-card > p:not(.eyebrow) {
  min-height: 48px;
  margin: auto 0 1rem;
  font-size: 0.8rem;
}

.scan-progress {
  --scan-progress: 0%;
  position: relative;
  height: 8px;
  margin: 1.2rem 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ece8;
}

.scan-progress span {
  display: block;
  width: var(--scan-progress);
  height: 100%;
  border-radius: inherit;
  background: var(--forest);
  transition: width 360ms ease;
}

.scan-progress.is-running::after {
  position: absolute;
  inset: 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  content: "";
  animation: scan-progress 900ms linear infinite;
}

.queue-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.queue-heading h3 {
  font-size: 1.35rem;
}

.action-queue .attention-card {
  min-height: 72px;
  padding: 0.9rem 1rem;
}

.action-queue .attention-card h3 {
  margin: 0;
  font-size: 0.92rem;
}

.action-queue .attention-icon {
  width: 34px;
  height: 34px;
}

.pipeline-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.pipeline-step {
  display: grid;
  min-width: 100px;
  min-height: 86px;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.pipeline-step:hover {
  transform: translateY(-2px);
}

.pipeline-step.is-active {
  border-color: var(--forest);
  background: var(--forest);
  color: white;
}

.pipeline-step strong {
  font-size: 1.7rem;
  line-height: 1;
}

.pipeline-step span {
  align-self: end;
  font-size: 0.72rem;
}

.preview-selector {
  width: min(420px, 100%);
  margin-bottom: 0.9rem;
}

.local-demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.55fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-preview-stage,
.readiness-stage {
  min-height: 355px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
}

.search-preview-stage {
  overflow: hidden;
  box-shadow: var(--shadow);
}

.search-preview-stage .browser-bar {
  padding: 0.9rem 1.1rem;
  background: #f5f7f5;
}

.search-result-preview {
  display: flex;
  min-height: 305px;
  justify-content: center;
  flex-direction: column;
  padding: clamp(1.5rem, 5vw, 3.8rem);
}

.search-result-preview small {
  color: #3f684d;
  font-size: 0.78rem;
}

.search-result-preview h3 {
  max-width: 720px;
  margin: 0.35rem 0 0.6rem;
  color: #174ea6;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.search-result-preview > p:not(.preview-kicker) {
  max-width: 650px;
  font-size: 0.95rem;
}

.preview-facts {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preview-facts span {
  padding: 0.38rem 0.6rem;
  border-radius: 999px;
  background: #f0f3f0;
  color: #4d5950;
  font-size: 0.7rem;
  font-weight: 700;
}

.readiness-stage {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 1.5rem;
  text-align: center;
}

.readiness-stage .eyebrow {
  align-self: flex-start;
}

.readiness-ring {
  --readiness: 0%;
  display: grid;
  width: 128px;
  height: 128px;
  margin: 0.8rem 0 1rem;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, white 59%, transparent 61%), conic-gradient(var(--forest) var(--readiness), #e8ece8 0);
  transition: background 360ms ease;
}

.readiness-ring strong {
  font-size: 1.85rem;
  letter-spacing: -0.05em;
}

.readiness-stage h3 {
  margin-bottom: 0.3rem;
  font-size: 1.15rem;
}

.readiness-stage p:not(.eyebrow) {
  margin-bottom: 0;
  font-size: 0.76rem;
}

.readiness-stage .scan-progress {
  width: 100%;
  margin-top: auto;
}

.control-drawer,
.detail-drawer {
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.control-drawer > summary,
.detail-drawer > summary,
.tool-proof > summary {
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 750;
  list-style-position: inside;
}

.control-drawer > .panel,
.detail-drawer > pre {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 16px 16px;
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

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

.check-row p {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
}

.check-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest-soft);
  color: var(--forest);
  font-weight: 800;
}

.check-missing .check-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.analytics-flow {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 50px minmax(150px, 1fr) 50px minmax(150px, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.analytics-flow > p {
  grid-column: 1 / -1;
  margin: 0;
  color: #667168;
  font-size: 0.76rem;
}

.flow-node {
  display: flex;
  min-height: 82px;
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.flow-node > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--forest-soft);
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 800;
}

.flow-node div {
  display: grid;
}

.flow-node small {
  color: #7b847d;
  font-size: 0.65rem;
}

.flow-node strong {
  font-size: 0.8rem;
}

.flow-node.is-offline {
  border-style: dashed;
  opacity: 0.68;
}

.flow-connector {
  height: 2px;
  overflow: hidden;
  background: #dce3dd;
}

.flow-connector span {
  display: block;
  width: 50%;
  height: 100%;
  background: var(--forest);
  transform: translateX(-110%);
}

.flow-connector.is-dashed {
  background: repeating-linear-gradient(90deg, #cbd2cc 0 5px, transparent 5px 9px);
}

.analytics-flow.is-running .flow-connector:not(.is-dashed) span {
  animation: flow-handoff 720ms ease infinite;
}

.analytics-flow.is-complete .flow-node:not(.is-offline) {
  border-color: #a8c9b2;
  background: #f4faf6;
}

.analytics-flow.has-error .flow-node:first-child {
  border-color: #d8aaaa;
  background: var(--rose-soft);
}

.workspace-tool-explorer {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1.58fr);
  gap: 1rem;
}

.tool-rail {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.tool-rail-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.15rem 0.7rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  cursor: pointer;
  text-align: left;
}

.tool-rail-button .tool-index {
  grid-row: 1 / 3;
  align-self: center;
}

.tool-rail-button strong {
  font-size: 0.8rem;
}

.tool-rail-button small {
  color: #7b857d;
  font-size: 0.66rem;
}

.tool-rail-button.is-active {
  border-color: var(--forest);
  background: var(--forest);
  color: white;
}

.tool-rail-button.is-active small,
.tool-rail-button.is-active .tool-index {
  color: #b9cbbf;
}

.tool-detail {
  min-height: 560px;
  padding: clamp(1.4rem, 4vw, 2.8rem);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 10%, rgba(151, 206, 174, 0.18), transparent 35%),
    #152219;
  color: white;
}

.tool-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.tool-detail-heading h3 {
  margin-top: 0.4rem;
  font-size: clamp(1.8rem, 4vw, 3.25rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.tool-detail-heading p:not(.eyebrow) {
  max-width: 620px;
  color: #c4d1c7;
}

.tool-handoff {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 2rem 0;
}

.tool-flow-step {
  display: grid;
  min-height: 155px;
  align-content: start;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.055);
}

.tool-flow-step > span {
  display: grid;
  width: 27px;
  height: 27px;
  margin-bottom: 1.4rem;
  place-items: center;
  border-radius: 50%;
  background: #d9e9de;
  color: var(--forest);
  font-size: 0.7rem;
  font-weight: 800;
}

.tool-flow-step small {
  color: #9eb1a3;
}

.tool-flow-step strong {
  margin-top: 0.35rem;
  font-size: 0.82rem;
}

.tool-proof {
  margin-bottom: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.tool-proof > summary {
  padding-left: 0;
}

.tool-proof dl {
  margin: 0 0 1rem;
}

.tool-proof dl div {
  display: grid;
  grid-template-columns: minmax(90px, 0.3fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.6rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tool-proof dt {
  color: #9eb1a3;
  font-size: 0.7rem;
}

.tool-proof dd {
  margin: 0;
  color: #e4ece6;
  font-size: 0.76rem;
}

@keyframes scan-progress {
  from { transform: translateX(-120%); }
  to { transform: translateX(340%); }
}

@keyframes flow-handoff {
  from { transform: translateX(-110%); }
  to { transform: translateX(220%); }
}

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

@media (max-width: 1000px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

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

  .builder-grid,
  .foundation-layout,
  .overview-stage,
  .local-demo-grid {
    grid-template-columns: 1fr;
  }

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

  .analytics-flow .flow-connector {
    display: none;
  }

  .analytics-flow .button,
  .analytics-flow > p {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .prototype-banner {
    text-align: left;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: block;
    width: 100%;
    height: auto;
    padding: 0.5rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-lockup {
    display: none;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.3rem;
    margin-top: 0;
    padding-bottom: 0;
  }

  .nav-item {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    padding: 0.55rem 0.35rem;
    font-size: 0.72rem;
    line-height: 1.15;
    text-align: center;
  }

  .nav-dot,
  .sidebar-offer {
    display: none;
  }

  .main-content {
    padding: 1rem 1rem 4rem;
  }

  .workspace-header,
  .view-heading,
  .header-actions {
    align-items: flex-start;
  }

  .view-heading,
  .workspace-header {
    flex-direction: column;
  }

  .view-heading {
    padding-top: 2.7rem;
  }

  .attention-card {
    grid-template-columns: auto 1fr;
  }

  .attention-card .button {
    grid-column: 1 / -1;
  }

  .status-grid,
  .section-grid-wide,
  .tool-map,
  .field-row {
    grid-template-columns: 1fr;
  }

  .workspace-tool-explorer {
    grid-template-columns: 1fr;
  }

  .tool-rail {
    display: flex;
    padding-bottom: 0.35rem;
    overflow-x: auto;
  }

  .tool-rail-button {
    min-width: 210px;
    flex: 0 0 210px;
  }

  .tool-handoff,
  .analytics-flow {
    grid-template-columns: 1fr;
  }

  .tool-detail {
    min-height: auto;
  }

  .tool-detail-heading {
    flex-direction: column;
  }

  .analytics-flow .button,
  .analytics-flow > p {
    grid-column: auto;
  }

  .workspace-spotlight,
  .scan-card,
  .search-preview-stage,
  .readiness-stage {
    min-height: 320px;
  }

  .status-card p {
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
