/* Blog post: Product Hunt study. Figma "Lead magnet / Product Hunt Reality Check" (5679:7614), popup 5713:2326 / 5713:2423 / 5713:2486.
   Builds on css/blog-post.css: only the blocks this study adds live here. */

.post-study {
  --ph-accent-text: #0570C8;
  --ph-accent-light: #5BB4FF;
  --ph-text-2: #5A5A5A;
  --ph-mixed: #A3A3A3;
  --ph-track: #F0F0F0;
}

/* Small blue caps label shared by kickers, short answers and cards */
.ph-label,
.ph-kicker,
.ph-answer::before {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.72px;
  text-transform: uppercase;
  color: var(--ph-accent-text);
}

.post-article .ph-label,
.post-article .ph-kicker { font-size: 12px; line-height: 1.4; color: var(--ph-accent-text); }

/* Finding label sits above its H2, so pull the heading up to it */
.post-article .ph-kicker { margin-bottom: -14px; padding-top: 32px; }
.post-article .ph-kicker + h2 { padding-top: 0; }

/* ------------------------------------------------------------------ note from Ayaan */
.ph-note {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 32px;
  border: 1px solid var(--post-border);
  border-radius: 16px;
  background: var(--post-bg-surface);
}

.ph-note-head { display: flex; align-items: center; gap: 14px; }
.ph-note-head img { border-radius: 50%; }
.post-article .ph-note-title { font-size: 18px; line-height: 1.3; font-weight: 500; letter-spacing: -0.27px; color: var(--post-text); }
.post-article .ph-note-role { font-size: 14px; line-height: 1.4; letter-spacing: -0.14px; color: var(--ph-text-2); }
.post-article .ph-note > p { font-size: 18px; line-height: 1.6; letter-spacing: -0.18px; color: var(--post-text); }
.post-article .ph-note .ph-note-sign { font-weight: 500; line-height: 1.4; color: var(--ph-accent-text); }

/* ------------------------------------------------------------------ how 76 made the cut */
.ph-cut {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--post-border);
  border-radius: 20px;
  background: var(--post-bg-surface);
}

.ph-cut-head { display: flex; justify-content: space-between; gap: 12px; }
.ph-cut-head span { font-size: 13px; font-weight: 500; color: var(--ph-text-2); }

.ph-cut-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
  list-style: none;
}

.post-article .ph-cut-steps li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border-radius: 14px;
  background: #F8F8F8;
  color: var(--post-text);
}

.ph-cut-steps li + li::before {
  content: "→";
  position: absolute;
  left: -27px;
  top: 50%;
  font-size: 20px;
  font-weight: 500;
  color: var(--ph-mixed);
  transform: translateY(-50%);
}

.ph-cut-steps strong { font-size: 40px; line-height: 1.05; font-weight: 600; letter-spacing: -1.6px; }
.ph-cut-what { font-size: 15px; line-height: 1.35; font-weight: 500; letter-spacing: -0.15px; }
.ph-cut-note { font-size: 13.5px; line-height: 1.45; color: var(--ph-text-2); }

.post-article .ph-cut-steps li.is-kept { background: var(--post-bg-inverse); color: #FFFFFF; }
.ph-cut-steps .is-kept strong { color: var(--ph-accent-light); }
.ph-cut-steps .is-kept .ph-cut-what { color: #FFFFFF; }
.ph-cut-steps .is-kept .ph-cut-note { color: var(--ph-mixed); }

.ph-cut-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--post-border);
  list-style: none;
}

.post-article .ph-cut-foot li { font-size: 13.5px; line-height: 1.5; color: var(--ph-text-2); }
.post-article .ph-cut-foot strong { font-weight: 600; }

/* ------------------------------------------------------------------ short answer and takeaway */
.post-article .ph-answer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border-radius: 12px;
  background: var(--post-bg-accent-subtle);
  font-size: 19px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.285px;
  color: var(--post-text);
}

.ph-answer::before { content: attr(data-label); }

.ph-takeaway {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--post-border);
}

.post-article .ph-takeaway p:last-child {
  font-size: 20px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.4px;
  color: var(--post-text);
}

/* ------------------------------------------------------------------ chart cards */
.ph-chart {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--post-border);
  border-radius: 16px;
  background: var(--post-bg-surface);
}

.ph-chart figcaption { display: flex; flex-direction: column; gap: 10px; }
.ph-chart figcaption strong { font-size: 20px; line-height: 1.3; font-weight: 500; letter-spacing: -0.4px; }
.ph-chart figcaption span { font-size: 14px; line-height: 1.5; letter-spacing: -0.14px; color: var(--ph-text-2); }

.post-article .ph-chart-label { margin-bottom: -8px; font-size: 13px; line-height: 1.3; font-weight: 600; letter-spacing: -0.13px; color: var(--ph-text-2); }
.post-article .ph-chart-label-gap { margin-top: 20px; }
.post-article .ph-chart-label-dark { font-size: 15px; font-weight: 500; color: var(--post-text); }
.post-article .ph-chart-note { font-size: 15px; line-height: 1.3; font-weight: 600; color: var(--post-text); }
.post-article .ph-source { font-size: 13px; line-height: 1.5; color: var(--ph-text-2); }

.ph-track {
  position: relative;
  display: block;
  height: 14px;
  border-radius: 999px;
  background: var(--ph-track);
  overflow: hidden;
}

.ph-track-lg { height: 28px; border-radius: 8px; }

.ph-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--w) * 1%);
  border-radius: inherit;
  background: var(--post-text);
}

.ph-fill.is-accent,
.is-accent > .ph-track .ph-fill { background: var(--post-accent); }

/* Funnel */
.ph-funnel { display: flex; flex-direction: column; gap: 12px; }
.ph-funnel-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  row-gap: 8px;
}
.ph-funnel-row .ph-track { grid-column: 1 / -1; }
.ph-funnel-name { font-size: 15px; line-height: 1.3; letter-spacing: -0.15px; color: var(--ph-text-2); }
.ph-funnel-value { font-size: 30px; line-height: 1.3; font-weight: 600; letter-spacing: -0.3px; }
.ph-funnel-row.is-accent .ph-funnel-value { color: var(--post-accent); }
.post-article .ph-funnel-step { font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--ph-accent-text); }

/* Horizontal bars with the value at the end */
.ph-hbars { display: flex; flex-direction: column; gap: 14px; }
.ph-hbars > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; }
.ph-hbars-wide > div { grid-template-columns: 200px minmax(0, 1fr); }
.ph-hbars-money > div { grid-template-columns: 150px minmax(0, 1fr); }
.ph-hbars dt { font-size: 16px; line-height: 1.3; font-weight: 500; color: var(--post-text); }
.ph-hbars-wide dt { font-size: 15px; font-weight: 400; }
.ph-hbars dd { display: flex; align-items: center; gap: 10px; min-width: 0; }

.ph-bar {
  flex: none;
  width: calc((100% - 96px) * var(--w) / 100);
  min-width: 4px;
  height: 30px;
  border-radius: 6px;
  background: var(--post-text);
}

.ph-bar-thin { width: 4px; border-radius: 2px; }
.ph-hbars .is-accent .ph-bar { background: var(--post-accent); }
.ph-bar-value { flex: none; font-size: 15px; line-height: 1.3; color: var(--ph-text-2); white-space: nowrap; }
.ph-bar-value small { margin-left: 4px; font-size: inherit; }

/* Rank dot strip */
.ph-strip svg { display: block; width: 100%; height: auto; overflow: visible; }
.ph-strip-axis line { stroke: #D4D4D4; stroke-width: 1; }
.ph-strip-axis text { font-size: 12px; fill: var(--ph-text-2); }
.ph-strip-dots circle { fill: var(--post-text); }
.ph-strip-dots circle.is-accent { fill: var(--post-accent); }
.ph-strip-accent { font-size: 13px; font-weight: 500; fill: var(--post-accent); }
.ph-strip-median { font-size: 13px; font-weight: 500; fill: var(--post-text); }

/* Head-to-head cards */
.ph-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.ph-compare-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--post-border);
  border-radius: 16px;
  background: var(--post-bg-surface);
}

.ph-compare-card img { width: 196px; height: auto; }
.ph-compare-card h3 { font-size: 20px; line-height: 1.3; font-weight: 500; letter-spacing: -0.4px; }
.post-article .ph-compare-big { font-size: 52px; line-height: 1; font-weight: 600; letter-spacing: -2.08px; color: var(--post-text); }
.post-article .ph-compare-big.is-accent { color: var(--post-accent); }
.post-article .ph-compare-sub { font-size: 14px; line-height: 1.4; letter-spacing: -0.14px; color: var(--ph-text-2); }
.ph-compare-card dl { display: flex; flex-direction: column; gap: 14px; width: 100%; padding-top: 14px; border-top: 1px solid var(--post-border); }
.ph-compare-card dl div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; line-height: 1.4; letter-spacing: -0.14px; }
.ph-compare-card dt { color: var(--ph-text-2); }
.ph-compare-card dd { font-weight: 500; text-align: right; }

/* No-audience columns */
.ph-columns {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  height: 260px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--post-border);
  list-style: none;
}

.post-article .ph-columns li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
  color: var(--post-text);
}

.ph-col { display: block; width: 72%; max-width: 32px; height: max(4px, calc((100% - 30px) * var(--h) / 100)); border-radius: 6px 6px 2px 2px; background: var(--post-text); }
.ph-col-value { font-size: 14px; line-height: 1; font-weight: 600; }
.ph-col-name {
  position: absolute;
  top: calc(100% + 8px);
  width: 100%;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
  color: var(--ph-text-2);
  hyphens: manual;
}
.ph-columns .is-accent .ph-col { background: var(--post-accent); }
.ph-columns .is-accent .ph-col-value { color: var(--post-accent); }
.ph-columns + .ph-chart-label { margin-top: 44px; }

/* Tally traffic split */
.ph-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.ph-badges img { width: 196px; height: auto; }

.ph-split {
  display: flex;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--post-text);
}

.ph-split-a { flex: none; width: calc(var(--w) * 1%); background: var(--post-accent); }
.ph-split-b { display: flex; align-items: center; padding: 0 14px; font-size: 15px; color: #FFFFFF; }
.ph-split-legend { display: flex; justify-content: space-between; gap: 16px; }
.post-article .ph-split-legend p { display: flex; flex-direction: column; font-size: 14px; line-height: 1.4; color: var(--ph-text-2); }
.post-article .ph-split-legend p:last-child { text-align: right; }
.ph-split-legend strong { font-size: 22px; line-height: 1.3; font-weight: 600; color: var(--post-text); }
.ph-split-legend strong.is-accent { color: var(--post-accent); }

/* Revenue bars with the median marker */
.ph-money { position: relative; padding-bottom: 28px; }
.ph-money .ph-bar { width: calc((100% - 84px) * var(--w) / 100); }
.ph-median-line {
  position: absolute;
  top: -6px;
  bottom: 22px;
  left: calc(162px + (100% - 162px - 84px) * var(--x) / 100);
  border-left: 1px dashed var(--ph-text-2);
}
.post-article .ph-median-label { position: absolute; left: 170px; bottom: 0; font-size: 12px; line-height: 1.3; color: var(--ph-text-2); }

.ph-legend { display: flex; flex-wrap: wrap; gap: 8px 40px; list-style: none; }
.post-article .ph-legend li { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.4; color: var(--ph-text-2); }
.ph-legend li::before { content: ""; width: 14px; height: 14px; border-radius: 3px; background: var(--post-text); }
.ph-legend li.is-accent::before { background: var(--post-accent); }
.ph-legend li.is-mixed::before { background: var(--ph-mixed); }

/* Visitor-to-user bars */
.ph-friction { display: flex; flex-direction: column; gap: 28px; }
.ph-friction-row { display: flex; flex-direction: column; gap: 10px; }
.post-article .ph-friction-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ph-text-2); }
.ph-friction-head strong { font-size: 16px; font-weight: 500; }
.post-article .ph-friction-notes { display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 13px; line-height: 1.4; font-weight: 500; color: var(--post-text); }
.ph-friction-notes .is-accent { color: var(--ph-accent-text); }

/* Verdict stacks */
.ph-stacks { display: flex; flex-direction: column; gap: 14px; }
.ph-stack { display: flex; flex-direction: column; gap: 6px; }
.post-article .ph-stack-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ph-text-2); }
.ph-stack-head strong { font-size: 16px; font-weight: 500; }
.post-article .ph-stack-bar { display: flex; gap: 2px; font-size: 12px; line-height: 24px; font-weight: 600; color: #FFFFFF; }
.ph-stack-bar > span { flex: var(--n) 0 0; min-width: 0; padding: 0 8px; border-radius: 4px; background: var(--post-text); white-space: nowrap; }
.ph-stack-bar .is-worth { background: var(--post-accent); }
.ph-stack-bar .is-mixed { background: var(--ph-mixed); }

/* Funnel table keeps a header row on every width */
.ph-table-plain thead th { font-weight: 600; }

/* ------------------------------------------------------------------ corrections, limits, terms */
.ph-corrections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--post-border);
  border-radius: 16px;
  background: var(--post-bg-page);
}

.ph-corrections > div { display: flex; flex-direction: column; gap: 8px; }
.ph-corrections > div + div { padding-top: 20px; border-top: 1px solid var(--post-border); }
.post-article .ph-corrections .ph-was,
.post-article .ph-corrections .ph-now { font-size: 17px; line-height: 1.55; letter-spacing: -0.17px; }
.post-article .ph-corrections .ph-was { color: var(--ph-text-2); }
.post-article .ph-corrections .ph-now { color: var(--post-text); }

.ph-rows {
  border: 1px solid var(--post-border);
  border-radius: 16px;
  background: var(--post-bg-surface);
  overflow: hidden;
}

.ph-rows > div {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 20px;
  padding: 16px 24px;
  font-size: 15px;
  letter-spacing: -0.15px;
}

.ph-rows > div + div { border-top: 1px solid var(--post-border); }
.ph-rows dt { line-height: 1.45; font-weight: 500; }
.ph-rows dd { line-height: 1.5; color: var(--ph-text-2); }

.ph-terms .ph-rows { border: 0; border-radius: 0; }
.ph-terms {
  border: 1px solid var(--post-border);
  border-radius: 16px;
  background: var(--post-bg-surface);
  overflow: hidden;
}

.ph-terms h3 { padding: 16px 24px; border-bottom: 1px solid var(--post-border); font-size: 16px; line-height: 1.4; font-weight: 500; }

.ph-image img { display: block; width: 100%; height: auto; border-radius: 16px; }

/* ------------------------------------------------------------------ dataset preview table */
.ph-dataset-table {
  border: 1px solid var(--post-border);
  border-radius: 16px;
  background: var(--post-bg-surface);
  overflow-x: auto;
}

.ph-dataset-table table { width: 100%; min-width: 640px; border-collapse: collapse; }
.ph-dataset-table caption { padding: 0; text-align: left; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ph-dataset-table thead th {
  padding: 12px 20px;
  border-bottom: 1px solid var(--post-border);
  background: var(--post-bg-page);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  text-align: left;
  color: var(--ph-text-2);
}

.ph-dataset-table tbody th,
.ph-dataset-table tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--post-border);
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -0.15px;
  font-weight: 400;
  text-align: left;
  color: var(--ph-text-2);
}

.ph-dataset-table tbody td:last-child { color: var(--post-text); }
.ph-dataset-table tbody th a { font-weight: 500; }
.ph-dataset-table tfoot td { padding: 16px 20px; background: var(--post-bg-page); font-size: 14px; line-height: 1.4; font-weight: 500; color: var(--post-text); }
.ph-dataset-table:focus-visible { outline: 2px solid var(--post-accent); outline-offset: 2px; }

/* Phones: each launch becomes a card (name, then year / rank / upvotes, then the result) instead of a
   640px table where only three columns show and nothing hints at the rest */
@media (max-width: 720px) {
  .ph-dataset-table { overflow: visible; border: 0; border-radius: 0; background: none; }
  .ph-dataset-table table, .ph-dataset-table tbody, .ph-dataset-table tfoot, .ph-dataset-table tfoot tr, .ph-dataset-table tfoot td { display: block; min-width: 0; }
  .ph-dataset-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ph-dataset-table tbody { display: flex; flex-direction: column; gap: 10px; }
  .ph-dataset-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding: 16px; border: 1px solid var(--post-border); border-radius: 14px; background: var(--post-bg-surface); }
  .ph-dataset-table tbody th, .ph-dataset-table tbody td { padding: 0; border: 0; }
  .ph-dataset-table tbody th, .ph-dataset-table tbody td:last-child { grid-column: 1 / -1; }
  .ph-dataset-table tbody th { font-size: 16px; color: var(--post-text); }
  .ph-dataset-table tbody td::before { display: block; margin-bottom: 2px; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0; color: var(--post-text-3); }
  .ph-dataset-table tbody td:nth-child(2)::before { content: "Year"; }
  .ph-dataset-table tbody td:nth-child(3)::before { content: "Rank"; }
  .ph-dataset-table tbody td:nth-child(4)::before { content: "Upvotes"; }
  .ph-dataset-table tbody td:nth-child(5)::before { content: "What the founder reported"; }
  .ph-dataset-table tfoot td { margin-top: 10px; border-radius: 14px; }
}

/* ------------------------------------------------------------------ dark dataset card */
.ph-dataset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 40px;
  border-radius: 24px;
  background: var(--post-bg-inverse);
  color: #FFFFFF;
}

.ph-dataset-image { display: block; width: 100%; margin-bottom: 12px; }
.ph-dataset-image img { display: block; width: 100%; height: auto; border-radius: 14px; }

.post-article .ph-dataset-pill {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.72px;
  text-transform: uppercase;
  color: var(--ph-accent-light);
}

.ph-dataset h3 { font-size: 30px; line-height: 1.2; font-weight: 500; letter-spacing: -0.9px; }
.post-article .ph-dataset-lead { font-size: 17px; line-height: 1.55; letter-spacing: -0.17px; color: var(--ph-mixed); }
.ph-dataset ul { display: flex; flex-direction: column; gap: 10px; list-style: none; }
.post-article .ph-dataset li { position: relative; padding-left: 20px; font-size: 15px; line-height: 1.5; letter-spacing: -0.15px; color: #FFFFFF; }
.ph-dataset li::before { content: ""; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--ph-accent-light); }

.ph-dataset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
  padding: 15px 20px;
  border-radius: 8px;
  background: var(--post-accent);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 500;
  color: #FFFFFF;
  transition: background 0.2s ease;
}

.ph-dataset-btn:hover { background: #0573CC; }
.ph-dataset-btn svg { width: 16px; height: 16px; }
.post-article .ph-dataset-note { margin-top: -8px; font-size: 13px; line-height: 1.5; color: var(--ph-mixed); }

/* ------------------------------------------------------------------ quote this study */
.ph-quotes {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: 16px;
  background: var(--post-bg-page);
  border: 1px solid var(--post-border);
}

.post-article .ph-quotes > p:not(.ph-label) { font-size: 15px; line-height: 1.5; letter-spacing: -0.15px; color: var(--ph-text-2); }
.ph-quotes ul { display: flex; flex-direction: column; gap: 10px; list-style: none; }

.post-article .ph-quotes li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--post-border);
  border-radius: 10px;
  background: var(--post-bg-surface);
}

.ph-quotes blockquote { font-size: 15px; line-height: 1.5; font-weight: 500; letter-spacing: -0.15px; color: var(--post-text); }

/* ------------------------------------------------------------------ final image, above the closing CTA */
.post-final-image {
  display: flex;
  justify-content: center;
  padding: 16px 32px;
  background: var(--post-bg-page, #FAFAFA);
}

.post-final-image a { display: block; width: 100%; max-width: 1376px; border-radius: 20px; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.post-final-image a:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(10, 10, 10, 0.16); }
.post-final-image a:focus-visible { outline: 2px solid #0588F0; outline-offset: 4px; }
.post-final-image picture { display: block; width: 100%; }

.post-final-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
}

/* ------------------------------------------------------------------ dataset popup */
.ph-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ph-gate[hidden] { display: none; }

.ph-gate-scrim { position: absolute; inset: 0; background: rgba(10, 10, 10, 0.6); }

.ph-gate-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  padding: 32px;
  border-radius: 20px;
  background: #FFFFFF;
  color: #0A0A0A;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: ph-gate-in 0.2s ease-out;
}

@keyframes ph-gate-in { from { opacity: 0; transform: translateY(8px); } }

.ph-gate-handle { display: none; }

.ph-gate-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #FAFAFA;
  color: #5A5A5A;
  cursor: pointer;
}

.ph-gate-close:hover { background: #F0F0F0; }
.ph-gate-close svg { width: 14px; height: 14px; }

.ph-gate-form-view,
.ph-gate-success-view { display: flex; flex-direction: column; gap: 20px; }
.ph-gate-form-view[hidden],
.ph-gate-success-view[hidden] { display: none; }

.ph-gate-top { display: flex; align-items: center; gap: 16px; padding-right: 32px; }
.ph-gate-top img { flex: none; border-radius: 8px; }
.ph-gate-top > div { display: flex; flex-direction: column; gap: 8px; }
.ph-gate-chips { display: flex; gap: 8px; }

.ph-gate-chips span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid #E5E5E5;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}

.ph-gate-chips span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #0588F0; }

.ph-gate h2 { font-size: 24px; line-height: 1.25; font-weight: 500; letter-spacing: -0.72px; }
.ph-gate-desc { font-size: 15px; line-height: 1.55; letter-spacing: -0.15px; color: #5A5A5A; }
.ph-gate-inside { display: flex; flex-direction: column; gap: 8px; list-style: none; }

.ph-gate-inside li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; letter-spacing: -0.14px; }

.ph-gate-inside li::before {
  content: "✓";
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #E6F4FE;
  font-size: 11px;
  font-weight: 600;
  color: #0570C8;
}

.ph-gate-form { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.ph-gate-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ph-gate-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.4; font-weight: 500; }

.ph-gate-fields input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  background: #FFFFFF;
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.15px;
  color: #0A0A0A;
}

.ph-gate-fields input::placeholder { color: #999999; }
.ph-gate-fields input:focus { outline: 2px solid #0588F0; outline-offset: -1px; border-color: transparent; }
.ph-gate-fields input[aria-invalid="true"] { border-color: #DC2626; }

.ph-gate-honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.ph-gate-error { font-size: 13px; line-height: 1.4; color: #DC2626; }

.ph-gate-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-radius: 8px;
  background: #0588F0;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.15px;
  color: #FFFFFF;
  cursor: pointer;
}

.ph-gate-submit:hover { background: #0573CC; }
.ph-gate-submit:disabled { opacity: 0.7; cursor: progress; }
.ph-gate-submit svg { width: 16px; height: 16px; }

.ph-gate-fine { font-size: 12px; line-height: 1.5; color: #5A5A5A; }

.ph-gate-from {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #E5E5E5;
  font-size: 13px;
  line-height: 1.4;
  color: #5A5A5A;
}

.ph-gate-from img { border-radius: 50%; }
.ph-gate-from strong { font-weight: 500; color: #0A0A0A; }

.ph-gate-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #0588F0;
  color: #FFFFFF;
}

.ph-gate-check svg { width: 20px; height: 20px; }
.ph-gate-success-view h2 { font-size: 26px; outline: none; }

.ph-gate-wait { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 12px; background: #FAFAFA; }
.ph-gate-wait p:last-child { font-size: 14px; line-height: 1.5; }

.ph-gate-back {
  width: 100%;
  margin-top: -8px;
  padding: 13px 20px;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  background: #FFFFFF;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #0A0A0A;
  cursor: pointer;
}

.ph-gate-back:hover { background: #FAFAFA; }

.ph-gate a:focus-visible,
.ph-gate button:focus-visible { outline: 2px solid #0588F0; outline-offset: 2px; }

html.ph-gate-open { overflow: hidden; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1023px) {
  .post-final-image { padding: 16px 24px; }
}

@media (max-width: 767px) {
  .ph-gate { align-items: flex-end; padding: 0; }

  .ph-gate-modal {
    max-width: none;
    max-height: 92vh;
    padding: 28px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    animation-name: ph-sheet-in;
    touch-action: pan-y;
  }

  @keyframes ph-sheet-in { from { transform: translateY(100%); } }

  .ph-gate-handle {
    display: block;
    position: absolute;
    top: 10px;
    left: calc(50% - 20px);
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: #E5E5E5;
  }

  .ph-gate-fields { grid-template-columns: minmax(0, 1fr); }
  .ph-gate-top img { width: 96px; height: 72px; }
  .ph-gate h2 { font-size: 20px; }
}

@media (max-width: 720px) {
  .ph-note,
  .ph-cut,
  .ph-chart,
  .ph-corrections { padding: 20px; }

  .ph-cut-steps,
  .ph-cut-foot { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ph-cut-steps li + li::before { display: none; }

  .ph-compare { grid-template-columns: minmax(0, 1fr); }
  .post-article .ph-compare-big { font-size: 44px; }

  .ph-hbars > div,
  .ph-hbars-wide > div,
  .ph-hbars-money > div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .ph-bar { width: calc((100% - 84px) * var(--w) / 100); height: 24px; }
  .ph-money .ph-bar { width: calc((100% - 84px) * var(--w) / 100); }
  .ph-median-line,
  .post-article .ph-median-label { display: none; }
  .ph-money { padding-bottom: 0; }

  /* Columns turn into labelled horizontal bars */
  .ph-columns { display: flex; flex-direction: column; align-items: stretch; gap: 8px; height: auto; border-bottom: 0; }
  .post-article .ph-columns li { display: grid; grid-template-columns: 104px minmax(0, 1fr) 36px; justify-content: stretch; justify-items: start; align-items: center; gap: 8px; height: auto; }
  .ph-col { order: 2; width: max(4px, calc(var(--h) * 1%)); max-width: none; height: 16px; border-radius: 4px; }
  .ph-col-value { order: 3; text-align: right; }
  .ph-col-name { position: static; order: 1; width: auto; font-size: 13px; text-align: left; }
  .ph-columns + .ph-chart-label { margin-top: 12px; }

  /* The rank strip scales down with the card, so its labels are drawn larger */
  .ph-strip-axis text { font-size: 24px; }
  .ph-strip-accent, .ph-strip-median { font-size: 17px; }
  .ph-strip-axis, .ph-strip-dots { transform: translateY(22px); }
  .ph-strip svg { overflow: visible; margin: 8px 0 28px; }

  .ph-badges img { width: calc(50% - 5px); }
  .ph-split-b { font-size: 13px; }

  .ph-rows > div { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px 20px; }
  .ph-terms h3 { padding: 14px 20px; }

  .ph-dataset { padding: 24px 20px; border-radius: 20px; }
  .ph-dataset h3 { font-size: 24px; }

  /* The funnel table keeps its rows as stacked cards like the MCP post tables */
  .post-final-image { padding: 8px 16px; }
  .post-final-image img { border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ph-gate-modal { animation: none; }
  .ph-dataset-btn,
  .post-final-image a { transition: none; }
}

@media (pointer: coarse) {
  .ph-gate-close { width: 40px; height: 40px; top: 12px; right: 12px; }
}
