:root {
  font-family: system-ui, sans-serif;
  line-height: 1.45;
  color: #1a1a1a;
  background: #f4f4f5;
}

.wrap {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.meta {
  color: #555;
  font-size: 0.9rem;
  margin-top: 0;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card.error {
  border-left: 4px solid #c62828;
}

.card.result {
  border-left: 4px solid #2e7d32;
}

.hint {
  color: #666;
  font-size: 0.9rem;
}

.form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

button {
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #fff;
}

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

.process-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem;
}

.process-overlay.is-visible {
  display: flex;
}

.process-overlay__box {
  max-width: 22rem;
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.process-overlay__title {
  font-weight: 600;
  margin: 0.75rem 0 0.35rem;
  font-size: 1.05rem;
}

.process-overlay__hint {
  margin: 0;
  font-size: 0.88rem;
  color: #555;
}

.spinner {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto;
  border: 3px solid #e0e0e0;
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

pre.err {
  white-space: pre-wrap;
  color: #b71c1c;
}

pre.json {
  background: #f0f0f2;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.82rem;
}

.fields dt {
  font-weight: 600;
  margin-top: 0.75rem;
}

.fields dd {
  margin: 0.25rem 0 0 0;
}

.icp {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e0e0e0;
}

.path code {
  font-size: 0.9rem;
}

.form--stack {
  flex-direction: column;
  align-items: stretch;
  max-width: 100%;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-row label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #444;
}

.form-row input[type="text"],
.form-row select {
  padding: 0.45rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  max-width: 100%;
}

.form-row select {
  background: #fff;
  cursor: pointer;
}

.card--layer2 {
  border-left-color: #1565c0;
}

.section-title {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e8e8ea;
}

.lead {
  font-size: 1.1rem;
  margin: 0.25rem 0;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.75rem;
}

.benefit-card {
  background: #f8f8fa;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  font-size: 0.92rem;
}

.benefit-card p {
  margin: 0.35rem 0 0;
}

.segment {
  margin-bottom: 0.85rem;
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.diff-table th,
.diff-table td {
  border: 1px solid #ddd;
  padding: 0.45rem 0.55rem;
  vertical-align: top;
}

.diff-table th {
  background: #f0f0f2;
  text-align: left;
}

.faq-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.faq-list li {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #eee;
}

.faq-cat {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #666;
  margin-right: 0.35rem;
}

.fields--inline dt {
  margin-top: 0.5rem;
}

.card--layer3 {
  border-left-color: #6a1b9a;
}

.blog-post-pair {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e8e8ea;
}

.blog-post-pair:last-of-type {
  border-bottom: none;
}

.funnel-pill {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #555;
  background: #ececf0;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  vertical-align: middle;
}

.dual-format {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}

@media (max-width: 48rem) {
  .dual-format {
    grid-template-columns: 1fr;
  }
}

.format-label {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  color: #444;
}

.markdown-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8f8fa;
  border: 1px solid #e4e4e8;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  max-height: 28rem;
  overflow-y: auto;
}

.dual-format__col {
  min-width: 0;
}

.card--layer4 {
  border-left: 3px solid #6b46c1;
}

.card--layer5 {
  border-left: 3px solid #2c7a7b;
}

.sales-slide {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e8e8ec;
}

.sales-slide:first-of-type {
  border-top: none;
  padding-top: 0;
}

.slide-num {
  font-weight: 600;
}

.slide-kind-pill {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #276749;
  background: #f0fff4;
  border-radius: 4px;
  vertical-align: middle;
}

.sales-slide__notes {
  max-height: 16rem;
  margin-top: 0.35rem;
}

.card--layer6 {
  border-left: 3px solid #c05621;
}

.card--layer7 {
  border-left: 3px solid #805ad5;
}

.targeting-preview {
  max-height: 22rem;
}

.follow-up-file-list {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

.follow-up-preview {
  max-height: 22rem;
}

.one-pager-preview {
  max-height: 22rem;
}

.download-link {
  color: #2b6cb0;
  text-decoration: none;
  font-weight: 600;
}

.download-link:hover {
  text-decoration: underline;
}

.module-stage-fieldset {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 0.75rem 1rem 1rem;
  margin: 0;
}

.module-stage-fieldset legend {
  font-size: 0.88rem;
  font-weight: 600;
  color: #444;
  padding: 0 0.35rem;
}

.module-stage-hint {
  margin: 0.35rem 0 0.5rem;
}

.module-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.btn-secondary {
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #999;
  background: #fff;
  color: #1a1a1a;
  font-size: 0.85rem;
}

.btn-secondary:hover {
  background: #f0f0f0;
}

.module-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.module-check-list li {
  margin: 0.4rem 0;
}

.module-check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: normal;
  cursor: pointer;
}

.module-check-label input {
  margin-top: 0.2rem;
}

/* Runs history: sidebar + main */
.runs-page.wrap {
  max-width: 72rem;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 0.5rem;
}

.page-header h1 {
  margin-bottom: 0.25rem;
}

.page-nav {
  font-size: 0.95rem;
}

.page-nav a {
  color: #2b6cb0;
  font-weight: 600;
  text-decoration: none;
}

.page-nav a:hover {
  text-decoration: underline;
}

.runs-layout {
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) 1fr;
  gap: 1.25rem;
  align-items: start;
}

.runs-sidebar {
  padding: 1rem 1.1rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.runs-sidebar__title {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: #333;
}

.runs-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.runs-sidebar__list li {
  margin: 0;
  border-bottom: 1px solid #eee;
}

.runs-sidebar__list li:last-child {
  border-bottom: none;
}

.runs-sidebar__link {
  display: block;
  padding: 0.5rem 0.15rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #1a1a1a;
  text-decoration: none;
  word-break: break-word;
}

.runs-sidebar__link:hover {
  color: #2b6cb0;
}

.runs-sidebar__link.is-active {
  font-weight: 700;
  color: #2b6cb0;
  background: #f0f6fc;
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: 4px;
}

.runs-main {
  min-width: 0;
}

@media (max-width: 52rem) {
  .runs-layout {
    grid-template-columns: 1fr;
  }

  .runs-sidebar {
    position: static;
    max-height: none;
  }
}

/* Product-centric UI */
.dashboard-page.wrap {
  max-width: 64rem;
}

.btn-primary {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: #1a1a1a;
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid #333;
}

.btn-primary:hover {
  background: #333;
}

.btn-secondary {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: #fff;
  color: #1a1a1a !important;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid #333;
}

.btn-secondary:hover {
  background: #f0f0f0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.product-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: inherit;
  border: 1px solid #e8e8e8;
}

.product-card:hover {
  border-color: #2b6cb0;
  box-shadow: 0 2px 8px rgba(43, 108, 176, 0.12);
}

.product-card__title {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

.product-card__slug {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
}

.product-card__meta {
  font-size: 0.8rem;
  color: #888;
  margin: 0.5rem 0 0;
}

.flash-ok {
  border-left: 4px solid #2e7d32;
}

.flash-warn {
  border-left: 4px solid #ed6c02;
}

.product-page.wrap {
  max-width: 80rem;
}

.page-nav--actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr minmax(14rem, 20rem);
  gap: 1.25rem;
  align-items: start;
}

.product-main {
  min-width: 0;
}

.product-sidebar {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.product-sidebar__title {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.artifact-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.artifact-tabs a {
  font-size: 0.85rem;
  color: #2b6cb0;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: #f0f6fc;
}

.artifact-tabs a:hover {
  text-decoration: underline;
}

.history-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid #e0e0e0;
}

.history-timeline__item {
  padding: 0 0 1rem 0.85rem;
  margin-left: 0.25rem;
  position: relative;
}

.history-timeline__item::before {
  content: "";
  position: absolute;
  left: -0.45rem;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2b6cb0;
}

.history-timeline__time {
  font-size: 0.8rem;
  color: #666;
}

.history-timeline__kind {
  font-weight: 600;
  margin: 0.15rem 0;
  font-size: 0.9rem;
}

.history-timeline__summary {
  font-size: 0.88rem;
  margin: 0.25rem 0;
}

.history-timeline__routes {
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
  padding-left: 1rem;
}

.history-timeline__text {
  font-size: 0.8rem;
  white-space: pre-wrap;
  max-height: 8rem;
  overflow: auto;
}

.history-timeline__errors {
  color: #c62828;
  font-size: 0.82rem;
}

.form--stack textarea {
  width: 100%;
  min-height: 8rem;
  font-family: inherit;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

@media (max-width: 56rem) {
  .product-layout {
    grid-template-columns: 1fr;
  }

  .product-sidebar {
    position: static;
    max-height: none;
  }
}

