:root {
  --brand: #003e58;
  --brand-deep: #001b43;
  --brand-soft: #3584a8;
  --accent: #43d1db;
  --accent-strong: #36a7af;
  --accent-soft: rgba(67, 209, 219, 0.12);
  --canvas: #f9fbfd;
  --canvas-soft: #f1f4f8;
  --panel: rgba(255, 255, 255, 0.96);
  --line: rgba(0, 62, 88, 0.12);
  --line-strong: rgba(0, 62, 88, 0.22);
  --text: #003e58;
  --muted: #506690;
  --danger: #df4759;
  --shadow: 0 18px 40px rgba(0, 62, 88, 0.08);
  --shadow-strong: 0 28px 70px rgba(0, 62, 88, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 48%, #eff6f7 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -2;
  border-radius: 999px;
  pointer-events: none;
}

body::before {
  top: -10rem;
  right: -10rem;
  width: 36rem;
  height: 36rem;
  background: radial-gradient(
    circle,
    rgba(67, 209, 219, 0.22) 0%,
    rgba(67, 209, 219, 0.08) 40%,
    transparent 72%
  );
}

body::after {
  top: 8rem;
  left: -14rem;
  width: 34rem;
  height: 34rem;
  background: radial-gradient(
    circle,
    rgba(53, 132, 168, 0.18) 0%,
    rgba(53, 132, 168, 0.06) 42%,
    transparent 72%
  );
}

code {
  font-family: "SFMono-Regular", "Menlo", monospace;
}

.panel-kicker,
.funnel-card-subtitle {
  margin: 0 0 10px;
  color: var(--brand-soft);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-shell {
  width: 100%;
  margin: 0;
  min-height: 100vh;
  padding: 32px 0;
}

.tool-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
  margin-top: 34px;
  padding: 22px 28px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 251, 253, 0.94));
  box-shadow: 0 14px 28px rgba(0, 62, 88, 0.05);
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.footer-link,
.footer-contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease;
}

.footer-link {
  border: 1px solid rgba(217, 226, 239, 0.96);
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
}

.footer-contact-button {
  border: 1px solid transparent;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 16px 28px rgba(67, 209, 219, 0.22);
}

.footer-link:hover,
.footer-contact-button:hover {
  transform: translateY(-1px);
}

.footer-contact-button:hover {
  background: var(--accent-strong);
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  min-width: 0;
}

.workspace.workspace-single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1480px;
  margin: 0 auto;
}

.funnel-nav-panel,
.funnel-detail {
  position: relative;
  border: 1px solid rgba(217, 226, 239, 0.92);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 253, 0.96));
  box-shadow: var(--shadow-strong);
}

.funnel-nav-panel::before,
.funnel-detail::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(67, 209, 219, 0.52), transparent);
}

.funnel-nav-panel {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 30px;
  backdrop-filter: blur(12px);
}

.panel-head h2 {
  margin: 0;
  color: var(--brand-deep);
  font-size: 1.4rem;
}

.funnel-nav {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.funnel-tab {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  box-shadow: 0 10px 28px rgba(0, 62, 88, 0.04);
  color: var(--brand);
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.funnel-tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 5px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, var(--accent), var(--brand-soft));
  opacity: 0;
  transform: scaleY(0.65);
  transform-origin: center;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.funnel-tab:hover,
.funnel-tab:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(53, 132, 168, 0.28);
  box-shadow: 0 18px 32px rgba(0, 62, 88, 0.08);
  outline: 0;
}

.funnel-tab.is-active {
  border-color: rgba(53, 132, 168, 0.44);
  background: linear-gradient(180deg, rgba(67, 209, 219, 0.15), rgba(255, 255, 255, 0.98) 72%);
  box-shadow:
    0 20px 36px rgba(0, 62, 88, 0.1),
    inset 0 0 0 1px rgba(67, 209, 219, 0.12);
}

.funnel-tab.is-active::before {
  opacity: 1;
  transform: scaleY(1);
}

.funnel-tab.is-active strong {
  color: var(--brand-deep);
}

.funnel-tab.is-active span {
  color: var(--brand);
}

.funnel-tab strong,
.funnel-tab span {
  display: block;
}

.funnel-tab strong {
  margin-bottom: 6px;
  color: var(--brand-deep);
  font-size: 1rem;
  line-height: 1.35;
}

.funnel-tab span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.funnel-detail {
  min-height: calc(100vh - 48px);
  min-width: 0;
  padding: 0 38px 38px;
  overflow: visible;
  isolation: isolate;
}

.funnel-detail.is-flow-view {
  padding: 0;
}

.funnel-detail.is-flow-view .funnel-header,
.funnel-detail.is-flow-view .flow-layout {
  padding: 0 28px;
}

.workspace.workspace-single .funnel-detail {
  width: 100%;
}

.funnel-detail::after {
  content: "";
  position: absolute;
  top: -9rem;
  right: -7rem;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(67, 209, 219, 0.14) 0%,
    rgba(67, 209, 219, 0.06) 42%,
    transparent 70%
  );
  z-index: 0;
}

.funnel-detail > * {
  position: relative;
  z-index: 1;
}

.funnel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 42px;
}

.funnel-title {
  max-width: 920px;
}

.funnel-title h2 {
  margin: 0;
  color: var(--brand-deep);
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.funnel-title p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  line-height: 1.65;
}

.toolbar-live-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.step-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}

.overview-layout {
  display: grid;
  gap: 42px;
}

.overview-layout .step-card {
  min-height: 0;
}

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

.overview-layout .option-pill img {
  width: 48px;
  height: 48px;
}

.flow-layout {
  display: grid;
  gap: 36px;
}

.flow-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  padding: 18px 20px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 253, 0.96));
  box-shadow: 0 12px 24px rgba(0, 62, 88, 0.05);
}

.flow-filter-bar.is-active {
  border-color: rgba(53, 132, 168, 0.22);
  box-shadow: 0 14px 28px rgba(0, 62, 88, 0.06);
}

.flow-filter-status {
  display: grid;
  gap: 6px;
  min-width: 280px;
  flex: 1 1 320px;
}

.flow-filter-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  width: fit-content;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(67, 209, 219, 0.12);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flow-filter-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.flow-filter-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1 1 340px;
}

.flow-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(53, 132, 168, 0.1);
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.4;
}

.flow-filter-reset {
  min-height: 42px;
  margin-left: auto;
}

.flow-filter-reset:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.flow-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.flow-tree-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding: 84px 28px 32px;
}

.flow-tree {
  min-width: max-content;
}

.flow-tree-node {
  --flow-connector-offset: 86px;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 48px;
  min-width: max-content;
}

.flow-tree-card-wrap {
  position: relative;
  padding: 10px 0;
}

.flow-tree-node > .flow-tree-card-wrap::after {
  content: "";
  position: absolute;
  top: var(--flow-connector-offset);
  right: -48px;
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, rgba(53, 132, 168, 0.4), rgba(67, 209, 219, 0.26));
}

.flow-tree-node.is-terminal-node > .flow-tree-card-wrap::after {
  display: none;
}

.flow-tree-card {
  display: grid;
  gap: 22px;
  width: 340px;
  padding: 30px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  box-shadow: var(--shadow);
}

.flow-tree-card.is-terminal {
  background: linear-gradient(
    180deg,
    rgba(67, 209, 219, 0.12) 0%,
    rgba(255, 255, 255, 0.98) 100%
  );
  border-color: rgba(67, 209, 219, 0.26);
}

.flow-tree-card h3 {
  margin: 0;
  color: var(--brand-deep);
  font-size: 1.18rem;
  line-height: 1.28;
}

.flow-tree-linear {
  display: flex;
  align-items: flex-start;
  gap: 36px;
  min-width: max-content;
}

.flow-tree-sections {
  position: relative;
  display: grid;
  gap: 30px;
  padding: 0 0 12px 30px;
}

.flow-tree-sections::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 24px;
  left: 0;
  width: 2px;
  background: linear-gradient(
    180deg,
    rgba(67, 209, 219, 0.18),
    rgba(53, 132, 168, 0.42),
    rgba(67, 209, 219, 0.18)
  );
}

.flow-tree-section {
  position: relative;
  display: grid;
  gap: 0;
  min-width: max-content;
}

.flow-tree-source {
  position: absolute;
  top: -34px;
  left: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 22px rgba(0, 62, 88, 0.06);
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.flow-tree-branch-list {
  display: grid;
  gap: 26px;
}

.flow-tree-branch {
  --branch-accent-line: rgba(53, 132, 168, 0.36);
  --branch-badge-center: 17px;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 30px;
  min-width: max-content;
}

.flow-tree-branch::before {
  content: "";
  position: absolute;
  top: var(--branch-badge-center);
  left: -30px;
  width: 30px;
  height: 2px;
  background: rgba(53, 132, 168, 0.36);
}

.flow-tree-branch.is-branch-accented::before {
  background: var(--branch-accent-line);
}

.flow-tree-branch.is-branch-accented::after {
  content: "";
  position: absolute;
  top: calc(var(--branch-badge-center) - 5px);
  left: -30px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--branch-accent-line);
  box-shadow: 0 0 0 6px var(--branch-accent-bg);
}

.flow-tree-branch-labels {
  position: relative;
  display: grid;
  gap: 12px;
  width: 300px;
  margin-top: -2px;
}

.flow-tree-branch-labels::after {
  content: "";
  position: absolute;
  top: var(--branch-badge-center);
  right: -30px;
  width: 30px;
  height: 2px;
  background: var(--branch-accent-line);
}

.flow-tree-branch-label {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  max-width: 300px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(67, 209, 219, 0.1);
  color: var(--brand-deep);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease,
    color 150ms ease;
}

.flow-tree-branch.is-branch-accented .flow-tree-branch-label {
  background: var(--branch-accent-bg);
  color: var(--branch-accent-text);
  box-shadow: inset 0 0 0 1px var(--branch-accent-border);
}

.flow-tree-branch-label:hover {
  transform: translateY(-1px);
}

.flow-tree-branch-label.is-flow-selected {
  box-shadow:
    inset 0 0 0 1px var(--branch-accent-border),
    0 10px 20px rgba(0, 62, 88, 0.08);
}

.flow-tree-children {
  display: grid;
  gap: 30px;
  min-width: max-content;
}

.flow-tree-children > .flow-tree-node > .flow-tree-card-wrap {
  padding-top: 0;
}

.flow-tree-merge-ref {
  display: grid;
  gap: 4px;
  width: 280px;
  padding: 16px 18px;
  border: 1px dashed rgba(53, 132, 168, 0.32);
  border-radius: 20px;
  background: rgba(249, 251, 253, 0.96);
  color: var(--muted);
}

.flow-tree-merge-ref strong {
  color: var(--brand);
  font-size: 0.92rem;
}

.flow-tree-merge-ref span {
  font-size: 0.88rem;
  line-height: 1.5;
}

.step-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 264px;
  padding: 30px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  box-shadow: var(--shadow);
}

.step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.step-page {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(67, 209, 219, 0.12);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dependency-chip,
.preview-dependency-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(53, 132, 168, 0.12);
  color: var(--brand-soft);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.step-card h3 {
  margin: 0;
  color: var(--brand-deep);
  font-size: 1.18rem;
  line-height: 1.28;
}

.step-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.hero-eyebrow {
  margin: -4px 0 0;
  color: var(--brand-soft);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
}

.hero-cta-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  width: fit-content;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.94rem;
  font-weight: 800;
  box-shadow: 0 14px 26px rgba(67, 209, 219, 0.2);
}

.developer-config {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.developer-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(53, 132, 168, 0.14);
  border-radius: 999px;
  background: rgba(241, 244, 248, 0.92);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: help;
}

.developer-chip[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  width: max-content;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 41, 92, 0.96);
  box-shadow: 0 14px 26px rgba(0, 41, 92, 0.18);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  transform: translate(-50%, 6px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.developer-chip[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  z-index: 5;
  width: 14px;
  height: 8px;
  background: rgba(0, 41, 92, 0.96);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.developer-chip[data-tooltip]:hover::after,
.developer-chip[data-tooltip]:hover::before,
.developer-chip[data-tooltip]:focus-visible::after,
.developer-chip[data-tooltip]:focus-visible::before {
  opacity: 1;
}

.developer-chip[data-tooltip]:hover::after,
.developer-chip[data-tooltip]:focus-visible::after {
  transform: translate(-50%, 0);
}

.task-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list li {
  position: relative;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.55;
}

.task-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.task-label {
  color: var(--text);
}

.task-meta {
  color: rgba(80, 102, 144, 0.82);
  font-size: 0.88rem;
  font-weight: 500;
}

.task-list li::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.group-stack {
  display: grid;
  gap: 22px;
}

.option-group {
  padding: 24px;
  border: 1px solid rgba(217, 226, 239, 0.92);
  border-radius: 24px;
  background-image: linear-gradient(180deg, #f9fbfd 72%, #ffffff);
}

.option-group.is-branch-accented {
  border-color: var(--branch-accent-border);
  background-image: linear-gradient(180deg, var(--branch-accent-bg) 0%, #ffffff 84%);
  box-shadow: inset 0 0 0 1px var(--branch-accent-border);
}

.option-group h4 {
  margin: 0 0 12px;
  color: var(--brand-deep);
  font-size: 0.98rem;
}

.option-group.is-branch-accented h4 {
  color: var(--branch-accent-text);
}

.option-group p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}

.option-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 16px 18px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(0, 62, 88, 0.04);
}

.option-pill.is-clickable {
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease,
    background-color 150ms ease;
}

.option-pill.is-clickable:hover {
  transform: translateY(-1px);
}

.option-pill.is-branch-accented {
  border-color: var(--branch-accent-border);
  background: linear-gradient(180deg, var(--branch-accent-bg), #ffffff 82%);
  box-shadow:
    inset 0 0 0 1px var(--branch-accent-border),
    0 12px 22px rgba(0, 62, 88, 0.05);
}

.option-pill img {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

.option-pill span {
  color: var(--brand-deep);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.42;
}

.option-pill.is-branch-accented span {
  color: var(--branch-accent-text);
}

.option-pill.is-flow-selected {
  box-shadow:
    inset 0 0 0 1px var(--branch-accent-border),
    0 14px 24px rgba(0, 62, 88, 0.08);
}

.option-pill.is-flow-dimmed {
  opacity: 0.46;
}

.empty-state {
  padding: 32px;
  border: 1px dashed rgba(53, 132, 168, 0.26);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 251, 253, 0.9));
  color: var(--muted);
}

.detail-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin: 0 -38px 34px;
  padding: 18px 38px;
  border-radius: 32px 32px 24px 24px;
  border-bottom: 1px solid rgba(217, 226, 239, 0.88);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 30px rgba(0, 62, 88, 0.06);
  backdrop-filter: blur(16px) saturate(140%);
}

.funnel-detail.is-flow-view .detail-toolbar {
  margin: 0 0 34px;
  padding: 18px 28px;
}

.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 999px;
  background: rgba(241, 244, 248, 0.94);
}

.developer-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.developer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(217, 226, 239, 0.82);
  border-radius: 999px;
  background: rgba(249, 251, 253, 0.92);
  color: rgba(0, 62, 88, 0.82);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: none;
}

.toolbar-utility-button {
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.88rem;
}

.developer-toggle-input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.developer-toggle-label {
  line-height: 1;
}

.view-button,
.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease;
}

.view-button {
  background: transparent;
  color: var(--muted);
}

.view-button-preview:not(.is-active) {
  border-color: var(--brand);
  background: rgba(255, 255, 255, 0.96);
  color: var(--brand);
  box-shadow: none;
}

.view-button.is-active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(0, 62, 88, 0.16);
}

.preview-runner {
  display: grid;
  gap: 30px;
}

.preview-progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preview-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(67, 209, 219, 0.12);
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.progress-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(217, 226, 239, 0.96);
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-soft), var(--accent));
  box-shadow: 0 10px 20px rgba(67, 209, 219, 0.22);
}

.preview-card {
  padding: 34px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 30px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  box-shadow: var(--shadow);
}

.preview-title {
  margin: 0 0 10px;
  color: var(--brand-deep);
  font-size: 1.65rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.preview-dependency-badge {
  margin-bottom: 12px;
}

.preview-copy,
.field-description {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
}

.preview-element {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.preview-html {
  color: var(--text);
  line-height: 1.65;
}

.preview-html p {
  margin: 0 0 12px;
}

.preview-html ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

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

.field-label {
  color: var(--brand-deep);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
}

.field-input,
.field-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 18px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.field-input:focus,
.field-textarea:focus {
  border-color: rgba(67, 209, 219, 0.5);
  outline: 0;
  box-shadow:
    0 0 0 4px rgba(67, 209, 219, 0.14),
    0 10px 24px rgba(0, 62, 88, 0.06);
}

.field-textarea {
  resize: vertical;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 20px;
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
}

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

.preview-choice {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: stretch;
  justify-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 22px;
  background: #ffffff;
  color: var(--brand-deep);
  box-shadow: 0 12px 22px rgba(0, 62, 88, 0.04);
  overflow: hidden;
  text-align: center;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.preview-choice img {
  width: 84px;
  height: 84px;
  flex: 0 0 auto;
  align-self: center;
  margin-top: 8px;
}

.preview-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: end;
  width: 100%;
  min-height: 66px;
  padding: 16px 14px;
  background: var(--brand);
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.preview-choice.is-selected {
  border-color: rgba(67, 209, 219, 0.58);
  background: linear-gradient(180deg, rgba(67, 209, 219, 0.1), rgba(255, 255, 255, 0.98));
  box-shadow: 0 18px 32px rgba(53, 132, 168, 0.12);
}

.preview-choice.is-selected span {
  background: linear-gradient(90deg, var(--brand-soft), var(--accent));
}

.preview-choice:hover,
.view-button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.preview-choice:hover {
  border-color: rgba(53, 132, 168, 0.26);
  box-shadow: 0 18px 28px rgba(0, 62, 88, 0.08);
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 16px 28px rgba(67, 209, 219, 0.24);
}

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

.secondary-button {
  border-color: rgba(217, 226, 239, 0.96);
  background: #ffffff;
  color: var(--brand);
  box-shadow: 0 10px 20px rgba(0, 62, 88, 0.05);
}

.ghost-button {
  border-color: transparent;
  background: rgba(67, 209, 219, 0.1);
  color: var(--accent-strong);
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.validation-box {
  padding: 16px 18px;
  border: 1px solid rgba(223, 71, 89, 0.2);
  border-radius: 20px;
  background: rgba(223, 71, 89, 0.08);
}

.validation-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--danger);
}

.validation-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.empty-page-note {
  padding: 16px 18px;
  border: 1px dashed rgba(53, 132, 168, 0.26);
  border-radius: 20px;
  background: rgba(249, 251, 253, 0.96);
  color: var(--muted);
}

.summary-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.summary-item {
  padding: 18px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  box-shadow: 0 10px 22px rgba(0, 62, 88, 0.04);
}

.summary-question,
.summary-value {
  margin: 0;
}

.summary-question {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.summary-value {
  color: var(--brand-deep);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.developer-panel {
  padding: 24px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
  box-shadow: var(--shadow);
}

.developer-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.developer-panel-head-copy {
  max-width: 760px;
}

.developer-panel h3 {
  margin: 0 0 10px;
  color: var(--brand-deep);
  font-size: 1.25rem;
}

.developer-panel-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.developer-panel-content {
  margin-top: 18px;
}

.finisher-toggle-button {
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.88rem;
}

.developer-panel-stack {
  display: grid;
  gap: 18px;
}

.template-block {
  padding: 18px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
}

.template-block h4 {
  margin: 0 0 8px;
  color: var(--brand-deep);
  font-size: 1.05rem;
}

.template-block-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.template-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.template-config-field {
  display: grid;
  gap: 8px;
}

.template-config-label {
  color: var(--brand);
  font-size: 0.88rem;
  font-weight: 700;
}

.developer-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 12px;
}

.template-code-wrap {
  width: 100%;
}

.template-render-wrap {
  width: 100%;
}

.template-section-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.template-textarea {
  width: 100%;
  min-height: 420px;
  padding: 18px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 22px;
  background: #ffffff;
  color: var(--brand-deep);
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  resize: vertical;
}

.template-textarea:focus {
  border-color: rgba(67, 209, 219, 0.5);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(67, 209, 219, 0.14);
}

.template-render-preview {
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(217, 226, 239, 0.96);
  border-radius: 22px;
  background: #ffffff;
  color: var(--brand-deep);
}

.template-render-preview p {
  margin-top: 0;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

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

  .workspace.workspace-single {
    max-width: none;
    margin: 0;
  }

  .funnel-nav-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .funnel-detail {
    min-height: unset;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 12px;
  }

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

  .funnel-detail,
  .funnel-nav-panel {
    padding: 20px;
    border-radius: 26px;
  }

  .step-grid {
    gap: 12px;
  }

  .detail-toolbar,
  .preview-progress-head,
  .preview-actions {
    align-items: stretch;
  }

  .toolbar-live-link {
    width: 100%;
  }

  .detail-toolbar {
    top: 8px;
    margin: 0 -20px 24px;
    padding: 12px 20px;
    border-radius: 26px 26px 20px 20px;
  }

  .view-switch {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    padding: 6px;
  }

  .developer-tools {
    width: 100%;
    margin-left: 0;
    justify-content: center;
    flex-wrap: wrap;
  }

  .developer-toggle {
    width: 100%;
    justify-content: center;
  }

  .view-button,
  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .view-switch .view-button {
    min-width: 0;
    padding: 0 12px;
    font-size: 0.9rem;
  }

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

  .flow-tree-scroll {
    padding-bottom: 10px;
  }

  .flow-filter-bar {
    padding: 16px 18px;
  }

  .flow-filter-status,
  .flow-filter-chip-list {
    min-width: 0;
    flex-basis: 100%;
  }

  .flow-filter-reset {
    width: 100%;
    margin-left: 0;
  }

  .flow-tree {
    min-width: 0;
  }

  .flow-tree-node {
    gap: 18px;
  }

  .flow-tree-card {
    width: 280px;
  }

  .flow-tree-sections {
    gap: 14px;
    padding-left: 14px;
  }

  .flow-tree-branch {
    flex-direction: column;
    gap: 10px;
  }

  .flow-tree-branch::before {
    left: -14px;
    width: 14px;
  }

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

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

  .tool-footer,
  .footer-links {
    justify-content: center;
  }

  .footer-link,
  .footer-contact-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .overview-layout .option-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview-image-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
