:root {
  --bg: #f3f7fb;
  --panel: #ffffff;
  --text: #132238;
  --muted: #5f6f83;
  --line: #dce5ef;
  --accent: #0c66e4;
  --accent-soft: #e9f1ff;
  --accent-deep: #0b4aa8;
  --danger-soft: #fff0f0;
  --danger-line: #f3c8c8;
  --danger-text: #8e2c2c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.is-locked {
  overflow: hidden;
}

.is-locked .layout {
  visibility: hidden;
}

.password-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(12, 102, 228, 0.18), transparent 22%),
    linear-gradient(180deg, #eef4fb 0%, #dfeaf6 100%);
}

.password-gate.is-hidden {
  display: none;
}

.gate-card {
  width: min(100%, 460px);
  padding: 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d7e3f2;
  box-shadow: 0 20px 50px rgba(9, 31, 64, 0.14);
}

.gate-card h2 {
  margin: 0;
  font-size: 28px;
}

.gate-copy {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.gate-form {
  margin-top: 20px;
}

.gate-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.gate-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #c8d7e8;
  border-radius: 12px;
  font: inherit;
  background: #ffffff;
}

.gate-input:focus {
  outline: 2px solid rgba(12, 102, 228, 0.22);
  outline-offset: 2px;
  border-color: var(--accent);
}

.gate-button {
  margin-top: 14px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  cursor: pointer;
}

.gate-error {
  min-height: 20px;
  margin: 12px 0 0;
  color: #b42318;
  font-size: 14px;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px 1fr;
}

.sidebar {
  background: #0f1d32;
  color: #edf3ff;
  border-right: 1px solid #1c2d4b;
  padding: 24px 18px;
}

.brand .eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #97acd3;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.tabs {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: #d2dff8;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.08);
}

.tab.is-active {
  background: #193259;
  border-color: #2f4f83;
  color: #ffffff;
}

.content {
  padding: 32px;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

h2 {
  margin: 0;
  font-size: 30px;
}

.lead {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 70ch;
}

.section-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-grid {
  margin-top: 24px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(9, 31, 64, 0.05);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.card ul {
  margin: 12px 0 0 16px;
  padding: 0;
}

.card li {
  margin-bottom: 6px;
}

.subtabs {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.subtab {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.subtab:hover {
  border-color: #bed0ea;
  background: #f7fbff;
}

.subtab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.subtab-panel {
  display: none;
}

.subtab-panel.is-active {
  display: block;
}

.hero-card {
  margin-top: 24px;
  padding: 22px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, #f8fbff 0%, #edf5ff 100%);
  border: 1px solid #d8e6fb;
  box-shadow: 0 10px 22px rgba(9, 31, 64, 0.05);
}

.hero-card h3 {
  margin: 0;
  font-size: 28px;
}

.flow-section {
  margin-top: 28px;
}

.flow-section-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.flow-section-header h3 {
  margin: 0;
  font-size: 24px;
}

.flow-section-header p {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
}

.email-flow-list {
  display: grid;
  gap: 18px;
}

.email-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 22px rgba(9, 31, 64, 0.05);
}

.email-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.email-card-header h4 {
  margin: 0;
  font-size: 20px;
}

.email-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.email-card > p {
  margin: 10px 0 0;
}

.email-copy {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  background: #fbfdff;
  border: 1px solid #e2ecf8;
}

.email-copy p {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.6;
}

.email-copy p:last-child {
  margin-bottom: 0;
}

.email-inline-image {
  display: block;
  width: 100%;
  max-width: 520px;
  margin: 14px 0;
  border-radius: 14px;
  border: 1px solid #d9e5f3;
  box-shadow: 0 10px 24px rgba(9, 31, 64, 0.08);
}

.phase-cta,
.logic-card {
  margin-top: 18px;
}

.funnel-shell {
  margin-top: 28px;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(12, 102, 228, 0.16), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(9, 31, 64, 0.08);
}

.funnel-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.funnel-header h3 {
  margin: 0;
  font-size: 26px;
}

.funnel-header p {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
}

.funnel-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.funnel-stage {
  width: var(--stage-width);
  min-height: 78px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  color: #ffffff;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  box-shadow: 0 12px 26px rgba(12, 102, 228, 0.16);
  position: relative;
  overflow: hidden;
}

.funnel-stage button,
.lost-stage button {
  font: inherit;
}

.funnel-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 35%);
  pointer-events: none;
}

.stage-number {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.funnel-stage h4,
.lost-stage h4 {
  margin: 0;
  font-size: 18px;
}

.funnel-stage p,
.lost-stage p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
}

.lost-stage {
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
}

.lost-stage .section-label {
  color: var(--danger-text);
}

.lost-stage h4 {
  color: #611b1b;
}

.lost-stage p {
  color: var(--danger-text);
}

.pipeline-support {
  margin-top: 20px;
}

.interactive-workspace {
  margin-top: 24px;
}

.interactive-workspace .funnel-shell,
.interactive-workspace .detail-shell {
  margin-top: 0;
}

.interactive-funnel {
  gap: 14px;
}

.interactive-stage {
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.interactive-stage:hover {
  transform: translateY(-2px);
}

.interactive-stage.is-selected {
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 18px 34px rgba(12, 102, 228, 0.24);
}

.interactive-stage:focus-visible {
  outline: 3px solid rgba(12, 102, 228, 0.28);
  outline-offset: 4px;
}

.interactive-lost {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.interactive-lost:hover {
  transform: translateY(-2px);
}

.interactive-lost.is-selected {
  border-color: #d88a8a;
  box-shadow: 0 16px 28px rgba(143, 44, 44, 0.12);
}

.detail-shell {
  margin-top: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 12px 28px rgba(9, 31, 64, 0.06);
}

.stage-detail {
  display: none;
}

.stage-detail.is-active {
  display: block;
}

.stage-detail h3 {
  margin: 0;
  font-size: 26px;
}

.detail-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 70ch;
}

.detail-meta {
  margin-top: 20px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.detail-block {
  padding: 16px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid #dbe8fb;
}

.detail-block span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-block p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

@media (min-width: 1100px) {
  .interactive-workspace {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.8fr);
    gap: 18px;
    align-items: start;
  }

  .interactive-workspace .funnel-shell,
  .interactive-workspace .detail-shell {
    height: calc(100vh - 172px);
  }

  .interactive-workspace .funnel-shell {
    padding: 18px;
  }

  .interactive-workspace .detail-shell {
    padding: 20px;
    overflow: auto;
  }

  .interactive-workspace .funnel-header {
    gap: 12px;
  }

  .interactive-workspace .funnel-header h3 {
    font-size: 22px;
  }

  .interactive-workspace .funnel-header p {
    max-width: 34ch;
    font-size: 13px;
  }

  .interactive-workspace .funnel-list {
    margin-top: 14px;
    gap: 8px;
  }

  .interactive-workspace .funnel-stage {
    min-height: 44px;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 15px;
  }

  .interactive-workspace .stage-number {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .interactive-workspace .funnel-stage h4 {
    font-size: 14px;
  }

  .interactive-workspace .funnel-stage p {
    display: none;
  }

  .interactive-workspace .interactive-funnel {
    gap: 7px;
  }

  .interactive-workspace .interactive-lost {
    margin-top: 10px;
    padding: 12px 16px;
  }

  .interactive-workspace .interactive-lost .section-label {
    margin-bottom: 4px;
    font-size: 11px;
  }

  .interactive-workspace .interactive-lost h4 {
    font-size: 16px;
  }

  .interactive-workspace .interactive-lost p:last-of-type {
    margin-top: 4px;
    font-size: 13px;
  }

  .interactive-workspace .stage-detail h3 {
    font-size: 24px;
  }

  .interactive-workspace .detail-copy {
    margin-top: 8px;
    font-size: 14px;
  }

  .interactive-workspace .detail-meta {
    margin-top: 16px;
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .interactive-workspace .detail-block {
    padding: 14px;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #1c2d4b;
  }

  .tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .tab {
    width: auto;
  }

  .funnel-header {
    flex-direction: column;
    align-items: start;
  }

  .flow-section-header,
  .email-card-header {
    flex-direction: column;
    align-items: start;
  }

  .funnel-stage {
    width: 100%;
    grid-template-columns: 52px 1fr;
  }

  .detail-shell {
    padding: 18px;
  }
}
