:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #637083;
  --line: #d9e0e8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

.nav,
.actions,
.snippet-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

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

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

.button-lg {
  min-height: 46px;
  padding: 0 18px;
  font-weight: 800;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  align-items: center;
  gap: 48px;
  max-width: 1180px;
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: 56px 28px 86px;
}

.hero-copy {
  display: grid;
  gap: 22px;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1;
}

.lead {
  max-width: 660px;
  color: #465466;
  font-size: 19px;
  line-height: 1.6;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.trace-preview,
.assistant-preview,
.panel,
.auth-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.trace-preview {
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(23, 32, 42, 0.12);
}

.landing {
  background:
    linear-gradient(180deg, #ffffff 0, #f6f7f9 520px, #f6f7f9 100%);
}

.landing-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
}

.landing-hero {
  min-height: calc(100vh - 78px);
  padding-bottom: 64px;
}

.assistant-preview {
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(23, 32, 42, 0.12);
}

.chat-card {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.chat-bubble {
  max-width: 88%;
  padding: 14px 16px;
  border-radius: 8px;
  color: #243142;
  line-height: 1.45;
}

.chat-bubble.user {
  justify-self: end;
  background: #e8f1ff;
}

.chat-bubble.assistant {
  justify-self: start;
  background: #edf7f5;
}

.action-check {
  display: grid;
  gap: 7px;
  padding: 16px;
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 8px;
  background: #fbfdfc;
}

.action-check span {
  color: var(--muted);
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.mini-actions span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  background: #edf7f5;
  color: #18413d;
  font-size: 13px;
  font-weight: 800;
}

.landing-section,
.final-cta {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 28px;
}

.landing-section {
  border-top: 1px solid var(--line);
}

.problem-section,
.safety-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 36px;
  align-items: start;
}

.section-heading,
.section-copy {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

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

.landing-section h2,
.final-cta h2 {
  max-width: 820px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
}

.landing-section h3 {
  font-size: 19px;
  line-height: 1.25;
}

.section-copy p,
.problem-card p,
.step-card p,
.benefit-card p,
.safety-list,
.final-cta .login-link {
  color: #465466;
  font-size: 16px;
  line-height: 1.6;
}

.problem-card,
.step-card,
.benefit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.problem-card {
  display: grid;
  gap: 10px;
  padding: 24px;
  box-shadow: 0 18px 42px rgba(23, 32, 42, 0.08);
}

.step-grid,
.benefit-grid {
  display: grid;
  gap: 14px;
}

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

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

.step-card,
.benefit-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 20px;
}

.step-number {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.safety-section {
  align-items: center;
}

.safety-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 22px 22px 22px 42px;
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 8px;
  background: #edf7f5;
}

.final-cta {
  display: grid;
  justify-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.final-cta .actions {
  justify-content: center;
}

.login-link {
  align-self: center;
  color: var(--muted);
}

.landing-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 14px;
}

.browser-bar {
  display: flex;
  gap: 7px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

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

.trace-grid {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.trace-item {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.trace-item.active {
  border-color: rgba(15, 118, 110, 0.45);
  background: #edf7f5;
}

.trace-item span,
.muted {
  color: var(--muted);
}

.trace-line {
  width: 2px;
  height: 26px;
  margin-left: 24px;
  background: var(--line);
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-form {
  display: grid;
  gap: 16px;
  width: min(100%, 420px);
  padding: 28px;
}

label,
.create-form {
  display: grid;
  gap: 8px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

.error {
  min-height: 20px;
  color: var(--danger);
}

.dashboard-shell,
.app-shell {
  display: grid;
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
}

.dashboard-shell {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
}

.panel {
  min-width: 0;
  padding: 22px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.app-row,
.empty {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
  text-decoration: none;
}

.app-row span {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

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

.meta-grid div {
  min-width: 0;
  padding: 12px;
  border-radius: 6px;
  background: #f7f9fb;
}

.meta-grid dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.meta-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

pre {
  overflow: auto;
  margin: 12px 0 0;
  padding: 16px;
  border-radius: 6px;
  background: #111827;
  color: #f9fafb;
  font-size: 13px;
  line-height: 1.5;
}

.steps {
  display: grid;
  gap: 12px;
  padding-left: 22px;
  line-height: 1.55;
}

.spec-list,
.settings-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafbfc;
}

.spec-main,
.spec-meta {
  min-width: 0;
}

.spec-title-line,
.spec-actions,
.form-actions,
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spec-title-line {
  flex-wrap: wrap;
}

.spec-main p {
  margin-top: 6px;
  color: #465466;
  line-height: 1.45;
}

.spec-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.spec-note,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  color: #18413d;
  border-color: rgba(15, 118, 110, 0.25);
  background: #edf7f5;
  font-weight: 700;
}

.status-approved,
.status-test_passed {
  color: #0b5c29;
  border-color: #b7dfc4;
  background: #ecfdf3;
}

.status-test_failed,
.status-rejected {
  color: var(--danger);
  border-color: #f0b8b2;
  background: #fff1f0;
}

.spec-actions {
  align-self: start;
}

.toggle-row {
  grid-template-columns: auto 1fr;
  justify-content: start;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
}

@media (max-width: 860px) {
  .topbar,
  .nav,
  .actions,
  .snippet-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .dashboard-shell,
  .meta-grid,
  .spec-row,
  .problem-section,
  .safety-section,
  .step-grid,
  .benefit-grid {
    grid-template-columns: 1fr;
  }

  .spec-actions {
    flex-wrap: wrap;
  }

  .hero {
    min-height: auto;
  }

  .landing-section,
  .final-cta {
    padding: 52px 20px;
  }

  .landing-footer {
    flex-direction: column;
  }
}

@media (max-width: 1180px) and (min-width: 861px) {
  .step-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
