:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #edf0f6;
  --text: #182033;
  --muted: #5d6575;
  --line: #d9dee9;
  --blue: #2d5bd1;
  --blue-dark: #2247a4;
  --coral: #e45645;
  --amber: #c98616;
  --ink: #111827;
  --focus: #f4b740;
  --shadow: 0 18px 42px rgba(24, 32, 51, 0.13);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

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

a { color: inherit; }

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

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.mockup-page {
  min-height: 100vh;
  padding: 18px;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.canvas {
  width: min(100%, 390px);
  min-height: calc(100vh - 36px);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.canvas h1, .canvas h2, .canvas h3, .index-page h1, .index-page h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

.canvas h1 { font-size: 2rem; }
.canvas h2 { font-size: 1.25rem; }
.canvas p { margin: 0; color: var(--muted); }

.mini-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--blue-dark);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.wizard-progress span {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
}

.wizard-progress .active { background: var(--blue); }

.hero-copy, .panel, .board-hero, .quick-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.hero-copy {
  display: grid;
  gap: 14px;
  border-color: #cfd7e8;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%);
}

.desktop-aside { display: none; }

.value-row {
  display: grid;
  gap: 8px;
}

.value-row span, .reply-chip {
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 700;
}

.screen-title {
  font-size: 1.65rem;
}

.panel {
  display: grid;
  gap: 14px;
}

.panel-heading, .screen-actions.split, .equal-actions, .board-crumb {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.screen-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

.primary-button, .secondary-button, .text-action {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
}

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

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

.secondary-button {
  color: var(--text);
  background: #fff;
  border-color: var(--line);
}

.text-action {
  color: var(--blue-dark);
  background: transparent;
  padding-inline: 4px;
}

.full { width: 100%; }

.screen-actions .primary-button,
.screen-actions .secondary-button {
  flex: 1;
}

.field-grid {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-weight: 750;
}

.field span {
  font-size: 0.86rem;
}

.field input, .field select {
  min-height: 46px;
  width: 100%;
  border: 1px solid #cbd3df;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
}

.conditional-field[hidden] {
  display: none;
}

.field-disclosure {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 0;
}

.field-disclosure summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  cursor: pointer;
  color: var(--text);
  font-weight: 850;
}

.field-disclosure summary::marker {
  color: var(--blue-dark);
}

.disclosure-grid {
  padding: 0 14px 14px;
}

.review-list {
  display: grid;
  gap: 8px;
}

.review-list span {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 750;
}

.plain-note {
  padding: 12px;
  border-left: 4px solid var(--coral);
  background: #fff6f4;
  color: #683025 !important;
  border-radius: 6px;
}

.check-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.check-row input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
}

.check-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.equal-actions {
  align-items: stretch;
}

.equal-actions > * {
  flex: 1;
}

.compact-actions .primary-button,
.compact-actions .secondary-button {
  min-height: 40px;
}

.legacy-slot {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.legacy-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  color: var(--blue-dark);
}

.legacy-link.standalone {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  text-decoration: none;
}

.linking-prompt {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.choice-grid, .reply-grid, .quick-paths, .task-grid, .landing-grid {
  display: grid;
  gap: 10px;
}

.choice-card, .path-card, .task-card {
  min-height: 88px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 14px;
  border: 1px solid #cdd7ec;
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
}

.choice-card strong, .path-card strong, .task-card strong { color: var(--text); }
.choice-card span, .path-card span, .task-card small { color: var(--muted); }
.choice-card.quiet, .path-card:not(.primary-path) { background: var(--surface-2); }

.hint {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 900;
}

.success-panel {
  border-color: #bfd0ff;
  background: #f4f7ff;
}

.return-panel {
  border-color: #f1c9c1;
  background: #fff7f5;
}

.chat-thread {
  display: grid;
  gap: 12px;
}

.bubble {
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
}

.bubble.assistant {
  background: var(--surface-2);
}

.bubble.user {
  justify-self: end;
  background: var(--blue);
  color: #fff;
  max-width: 78%;
}

.bubble.user p { color: #fff; }

.bubble.compact {
  padding: 12px 14px;
}

.form-bubble {
  padding: 0;
  border: 0;
  background: transparent !important;
}

.reply-chip {
  text-decoration: none;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.reply-chip.alt {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.board-hero, .quick-hero {
  display: grid;
  gap: 14px;
}

.task-card {
  grid-template-columns: 38px 1fr;
  align-items: center;
}

.task-card span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.task-card.active {
  border-color: var(--blue);
}

.board-crumb {
  min-height: 44px;
  color: var(--muted);
}

.board-crumb a {
  color: var(--blue-dark);
  font-weight: 800;
}

.deck-shell {
  display: grid;
  gap: 14px;
}

.deck-count {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.stack-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid #ccd4e2;
  border-radius: 8px;
  box-shadow: 8px 8px 0 #e6eaf2;
}

.lead-card {
  background: #f8f9fc;
}

.stack-preview {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px dashed #c6cfde;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 750;
}

.quick-hero h1 {
  font-size: 2.15rem;
}

.path-card.primary-path {
  border-color: var(--blue);
  background: #f3f6ff;
}

.setup-dock {
  border-color: #d4bb73;
  background: #fffaf0;
}

.index-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 20px;
}

.index-hero, .index-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  margin-bottom: 18px;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.index-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 10px;
  background: var(--surface-2);
}

.index-card a {
  min-height: 36px;
  display: flex;
  align-items: center;
  color: var(--blue-dark);
  font-weight: 800;
}

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

.quiet-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

@media (min-width: 680px) {
  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (min-width: 900px) {
  .mockup-page {
    padding: 28px;
  }

  .canvas.desktop-key {
    width: min(100%, 1180px);
    min-height: calc(100vh - 56px);
    padding: 34px;
  }

  .canvas.desktop-key .hero-copy,
  .canvas.desktop-key .thread-layout,
  .canvas.desktop-key .dashboard-two-column,
  .canvas.desktop-key .desktop-deck,
  .canvas.desktop-key .launch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
    gap: 24px;
    align-items: start;
  }

  .canvas.desktop-key .hero-copy {
    grid-column: span 1;
  }

  .canvas.desktop-key .desktop-aside {
    display: grid;
  }

  .canvas.desktop-key .value-row,
  .canvas.desktop-key .choice-grid,
  .canvas.desktop-key .quick-paths,
  .canvas.desktop-key .landing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .canvas.desktop-key .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .canvas.desktop-key .task-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .canvas.desktop-key .board-hero {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .canvas.desktop-key h1 {
    font-size: 3.1rem;
  }
}
