.leak-stage > .leak-sample-link {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
  margin-top: 8px;
}

.problem-card__panel .leak-sample-link {
  margin-top: 16px;
}

.leak-sample-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}

.leak-sample-link span {
  flex: none;
}

.leak-sample-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (min-width: 768px) {
  .leak-stage {
    height: auto;
    min-height: 240px;
  }
}

.leak-sample {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.leak-sample[hidden] {
  display: none;
}

html.leak-sample-open,
html.leak-sample-open body {
  overflow: hidden;
}

.leak-sample__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 8, 28, 0.72);
}

.leak-sample__sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(92dvh, 920px);
  border: 1px solid rgba(196, 176, 230, 0.55);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  background:
    radial-gradient(80% 36% at 100% 0%, rgba(196, 168, 255, 0.28), transparent 58%),
    linear-gradient(180deg, #fffcff 0%, #f7f3fd 100%);
  box-shadow: 0 -18px 48px rgba(28, 12, 48, 0.28);
  color: #17141f;
}

.leak-sample__handle {
  width: 42px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: rgba(90, 70, 130, 0.28);
}

.leak-sample__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px 12px;
  align-items: start;
  padding: 12px 16px 14px;
}

.leak-sample__heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.6vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #17141f;
}

.leak-sample__heading p {
  margin: 8px 0 0;
  max-width: 42em;
  color: #5c5668;
  font-size: 0.98rem;
  line-height: 1.45;
}

.leak-sample__close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: rgba(107, 63, 212, 0.08);
  color: #17141f;
}

.leak-sample__close svg {
  width: 16px;
  height: 16px;
}

.leak-sample__body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 16px calc(20px + env(safe-area-inset-bottom));
}

.leak-sample__body:focus {
  outline: none;
}

.leak-sample__body:focus-visible {
  box-shadow: inset var(--focus);
}

.leak-sample .revenue-leak-visual {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.leak-sample .rl-illustrative {
  margin: 0;
  color: #7a7388;
  font-size: 0.84rem;
  line-height: 1.4;
}

.leak-sample .rl-sheet,
.leak-sample .rl-card {
  background: #fff;
  border: 1px solid rgba(28, 20, 33, 0.1);
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(40, 20, 70, 0.06);
}

.leak-sample .rl-board {
  position: relative;
  min-width: 0;
  padding: 18px 14px 14px;
}

.leak-sample .rl-spine {
  position: absolute;
  top: 18px;
  bottom: 18px;
  right: 8px;
  display: none;
  align-items: center;
  writing-mode: vertical-rl;
  color: #9b92ad;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.leak-sample .rl-stages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.leak-sample .rl-stage {
  min-width: 0;
  text-align: center;
}

.leak-sample .rl-stage b {
  display: block;
  color: #17141f;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-transform: uppercase;
}

.leak-sample .rl-stage-word {
  display: block;
}

.leak-sample .rl-stage > span {
  display: none;
  margin-top: 4px;
  color: #6f6a7c;
  font-size: 0.78rem;
  line-height: 1.3;
}

.leak-sample .rl-plot {
  position: relative;
  margin-top: 8px;
}

.leak-sample .rl-cols {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  pointer-events: none;
}

.leak-sample .rl-cols span:not(:first-child) {
  border-left: 1px solid rgba(28, 20, 33, 0.1);
}

.leak-sample .rl-path {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.leak-sample .rl-draw {
  fill: none;
  stroke-width: 2.75;
  stroke-linecap: round;
}

.leak-sample .rl-node .rl-ring {
  fill: #f3edff;
}

.leak-sample .rl-node circle:last-child {
  fill: #17141f;
}

.leak-sample .rl-node-2 circle:last-child,
.leak-sample .rl-node-4 circle:last-child {
  fill: #7d5cff;
}

.leak-sample .rl-node-app .rl-halo {
  fill: rgba(226, 60, 173, 0.22);
}

.leak-sample .rl-node-app .rl-ring {
  fill: #fde8f6;
}

.leak-sample .rl-node-app circle:last-child {
  fill: #e23cad;
}

.leak-sample .rl-drop {
  stroke: #e23cad;
  stroke-width: 1.6;
  stroke-dasharray: 1.5 4;
  stroke-linecap: round;
}

.leak-sample .rl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.leak-sample .rl-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5c5668;
  font-size: 0.82rem;
}

.leak-sample .rl-mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.leak-sample .rl-mark-leak {
  background: #e23cad;
  box-shadow: 0 0 0 3px rgba(226, 60, 173, 0.18);
}

.leak-sample .rl-mark-minor {
  background: #7d5cff;
}

.leak-sample .rl-mark-ok {
  background: #17141f;
}

.leak-sample .rl-card {
  padding: 18px 16px 14px;
}

.leak-sample .rl-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.leak-sample .rl-card-kicker {
  margin: 0;
  color: #c43b86;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.leak-sample .rl-card-title {
  margin: 6px 0 0;
  color: #17141f;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.leak-sample .rl-card-icon {
  position: relative;
  display: grid;
  flex: none;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  background: rgba(226, 60, 173, 0.12);
  color: #c43b86;
}

.leak-sample .rl-card-icon svg {
  width: 24px;
  height: 24px;
}

.leak-sample .rl-card-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: #e23cad;
  box-shadow: 0 0 0 2px #fff;
  color: #fff;
  font-style: normal;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
}

.leak-sample .rl-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px 0 0;
  padding: 12px 4px;
  border-radius: 16px;
  background: rgba(23, 20, 31, 0.04);
}

.leak-sample .rl-stats div {
  min-width: 0;
  padding: 0 6px;
  text-align: center;
}

.leak-sample .rl-stats div + div {
  border-left: 1px solid rgba(28, 20, 33, 0.1);
}

.leak-sample .rl-stats dt {
  margin: 0;
  color: #7a7388;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
}

.leak-sample .rl-stats dd {
  margin: 6px 0 0;
  color: #17141f;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4.4vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.leak-sample .rl-stats .is-hot {
  color: #c43b86;
}

.leak-sample .rl-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.leak-sample .rl-badge,
.leak-sample .rl-priority {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leak-sample .rl-badge {
  background: #e23cad;
  color: #fff;
}

.leak-sample .rl-priority {
  background: rgba(23, 20, 31, 0.06);
  color: #5c5668;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.leak-sample .rl-points {
  margin-top: 14px;
  border-top: 1px solid rgba(28, 20, 33, 0.1);
}

.leak-sample .rl-points li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(28, 20, 33, 0.1);
}

.leak-sample .rl-point-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: rgba(107, 63, 212, 0.12);
  color: #6b3fd4;
}

.leak-sample .rl-point-icon svg {
  width: 16px;
  height: 16px;
}

.leak-sample .rl-point-icon.is-warn {
  background: rgba(226, 60, 173, 0.12);
  color: #c43b86;
}

.leak-sample .rl-points b {
  display: block;
  color: #7a7388;
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.leak-sample .rl-points div > span {
  display: block;
  margin-top: 3px;
  color: #17141f;
  font-size: 0.95rem;
  line-height: 1.4;
}

.leak-sample .rl-upside {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(226, 60, 173, 0.1);
  color: #8d2d62;
  font-size: 0.92rem;
  line-height: 1.45;
}

.leak-sample .rl-upside svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.leak-sample .rl-upside b {
  font-weight: 700;
}

@media (min-width: 480px) {
  .leak-sample .rl-stage > span {
    display: block;
  }

  .leak-sample .rl-board {
    padding: 22px 18px 16px;
  }
}

@media (min-width: 768px) {
  .leak-sample {
    align-items: center;
    padding: 32px 20px;
  }

  .leak-sample__sheet {
    width: min(720px, 100%);
    max-height: min(86dvh, 860px);
    border-bottom: 1px solid rgba(196, 176, 230, 0.55);
    border-radius: 24px;
  }

  .leak-sample__handle {
    display: none;
  }

  .leak-sample__header,
  .leak-sample__body {
    padding-left: 24px;
    padding-right: 24px;
  }

  .leak-sample .rl-spine {
    display: flex;
  }

  .leak-sample .rl-stages,
  .leak-sample .rl-cols {
    margin-right: 22px;
  }

  .leak-sample .rl-stage b {
    font-size: 0.68rem;
    letter-spacing: 0.04em;
  }

  .leak-sample .rl-stage-word {
    display: inline;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .leak-sample__backdrop {
    opacity: 0;
    transition: opacity 280ms var(--ease);
  }

  .leak-sample.is-open .leak-sample__backdrop {
    opacity: 1;
  }

  .leak-sample__sheet {
    transform: translateY(110%);
    transition: transform 300ms var(--ease);
  }

  .leak-sample.is-open .leak-sample__sheet {
    transform: none;
  }
}

@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .leak-sample__sheet {
    transform: translateY(16px);
  }

  .leak-sample.is-open .leak-sample__sheet {
    transform: none;
  }
}
