.plan-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#plans {
  width: 100%;
  min-width: 0;
  scroll-margin-top: 78px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 234px));
  justify-content: center;
  gap: 16px;
}

#plans .plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  min-height: 323px;
  padding: 24px;
  border: 2px solid #dfe3ec;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #f9f9fd);
  box-shadow: 0 10px 24px rgb(15 23 42 / 3%);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

@media (hover: hover) {
  #plans .plan-card:hover {
    transform: translateY(-1px);
    border-color: #baa0f4;
    box-shadow: 0 10px 24px rgb(124 58 237 / 9%);
  }
}

#plans .plan-card:has(input:checked) {
  border-color: #7c3aed;
  background: linear-gradient(180deg, #faf7ff, #fdfbff);
  box-shadow: 0 0 0 2px rgb(124 58 237 / 8%);
}

#plans .plan-card:has(:focus-visible),
#comparison summary:focus-visible,
#comparison .plan-comparison-scroll:focus-visible {
  outline: 3px solid #7c3aed;
  outline-offset: 3px;
}

#plans .plan-card input {
  position: absolute;
  inset: auto;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.plan-card-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding-right: 25px;
  color: #1f2937;
}

.plan-card-top::after {
  position: absolute;
  top: 50%;
  right: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border: 2px solid #cfd7e3;
  border-radius: 50%;
  background: #fff;
  color: white;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-50%);
  content: "";
}

.plan-card:has(input:checked) .plan-card-top::after {
  content: "✓";
  border-color: #7c3aed;
  background: #7c3aed;
}

.plan-card-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.plan-cycle,
.plan-recommended {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding-inline: 10px;
  border-radius: 999px;
  background: #efe7ff;
  color: #7130dc;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.plan-recommended {
  position: absolute;
  top: -12px;
  right: 18px;
  min-width: 54px;
  min-height: 28px;
  background: #7c3aed;
  color: white;
  box-shadow: 0 8px 18px rgb(124 58 237 / 20%);
}

.plan-card-price {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 24px;
  color: #111827;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.plan-card-price b {
  font-size: 26px;
  font-weight: 800;
}

.plan-audience {
  margin-top: 12px;
  color: #596579;
  font-size: 15px;
  line-height: 1.6;
}

.plan-uses {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: #667085;
  font-size: 14px;
  line-height: 1.5;
}

.plan-uses > span {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.plan-uses > span::before {
  flex: none;
  color: #97a2b5;
  content: "✓";
}

.plan-highlight {
  align-self: flex-start;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #985600;
  background: #fff1db;
  font-size: 12px;
  font-weight: 700;
}

#comparison {
  width: min(780px, 100%);
  min-width: 0;
  margin: 0 auto;
}

#comparison summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border-radius: 8px;
  color: #9ca3af;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
}

#comparison summary::-webkit-details-marker {
  display: none;
}

#comparison summary::after {
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border: solid currentColor;
  border-width: 0 1.6px 1.6px 0;
  content: "";
  transform: rotate(45deg);
}

#comparison summary:hover {
  color: #64748b;
}

#comparison[open] > summary {
  color: #7c3aed;
  font-weight: 700;
}

#comparison[open] > summary::after {
  margin-top: 3px;
  transform: rotate(225deg);
}

.comparison-content {
  min-width: 0;
  padding: 2px 0 10px;
  color: #374151;
}

.comparison-intro,
.comparison-title,
.comparison-hint,
.comparison-notes,
.comparison-sources {
  text-align: center;
  overflow-wrap: anywhere;
}

.comparison-intro {
  margin: 0 auto 14px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.55;
}

.comparison-title {
  margin: 0 auto 14px;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.comparison-hint,
.comparison-notes,
.comparison-sources {
  margin: 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
}

.comparison-content a {
  color: #6d28d9;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.comparison-matrix {
  min-width: 0;
  padding: 20px 18px 14px;
  border: 1px solid #e8eaef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 5%);
}

.comparison-group {
  min-width: 0;
  margin: 0;
}

.comparison-group + .comparison-group {
  margin-top: 22px;
}

.comparison-group h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding-left: 2px;
  color: #7c3aed;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -.02em;
}

.comparison-group h4::before {
  flex: 0 0 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px #ece3fd;
  content: "";
}

.plan-comparison-scroll {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.plan-comparison-scroll table {
  width: 100%;
  min-width: 620px;
  table-layout: fixed;
  border-collapse: collapse;
  color: #1f2937;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.plan-comparison-scroll th,
.plan-comparison-scroll td {
  padding: 8px 5px;
  border-bottom: 1px solid #eef1f6;
  vertical-align: middle;
  text-align: center;
  overflow-wrap: anywhere;
}

.plan-comparison-scroll thead th {
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.plan-comparison-scroll thead th:first-child {
  width: 28%;
  color: #768399;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
}

.plan-comparison-scroll thead th:last-child {
  width: 20%;
}

.plan-comparison-scroll tbody th,
.plan-comparison-scroll tbody td {
  font-weight: 500;
}

.plan-comparison-scroll tbody th {
  color: #374151;
  text-align: left;
}

.plan-comparison-scroll .comparison-unavailable {
  color: #667085;
}

.plan-comparison-scroll tbody tr:last-child > * {
  border-bottom: 0;
}

.comparison-notes {
  margin: 16px 0 0;
}

.comparison-sources {
  margin-top: 4px;
}

@media (max-width: 720px) {
  .comparison-intro {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .comparison-title {
    margin-bottom: 10px;
    font-size: 15px;
  }

  .comparison-matrix {
    padding: 12px 8px 10px;
    border-radius: 12px;
  }

  .comparison-group + .comparison-group {
    margin-top: 14px;
  }

  .comparison-group h4 {
    margin-bottom: 8px;
    font-size: 13px;
  }

  .plan-comparison-scroll table {
    font-size: 11px;
    line-height: 1.3;
  }

  .plan-comparison-scroll th,
  .plan-comparison-scroll td {
    padding: 6px 3px;
  }

  .plan-comparison-scroll thead th {
    font-size: 12px;
  }

  .plan-comparison-scroll tr > th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    box-shadow: 1px 0 #eef1f6;
  }

  .plan-comparison-scroll thead th:first-child {
    width: 23%;
  }

  .comparison-hint,
  .comparison-notes,
  .comparison-sources {
    font-size: 11px;
  }

  .comparison-notes {
    margin-top: 10px;
  }
}

@media (max-width: 430px) {
  .comparison-matrix {
    padding: 10px 6px 8px;
  }

  .comparison-group h4 {
    margin-bottom: 6px;
    font-size: 12px;
  }

  .plan-comparison-scroll table {
    font-size: 10px;
  }

  .plan-comparison-scroll th,
  .plan-comparison-scroll td {
    padding: 5px 2px;
  }

  .plan-comparison-scroll thead th {
    font-size: 11px;
  }

  .plan-comparison-scroll thead th:first-child {
    font-size: 9px;
  }
}

@media (max-width: 1060px) {
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #plans {
    scroll-margin-top: 94px;
  }

  .plan-grid {
    gap: 8px;
  }

  #plans .plan-card {
    align-items: center;
    min-height: 108px;
    padding: 12px 8px 10px;
    border-radius: 14px;
    text-align: center;
    box-shadow: none;
  }

  .plan-card-top {
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding-right: 0;
  }

  .plan-card-name {
    font-size: 14px;
    letter-spacing: -.025em;
  }

  .plan-cycle {
    min-height: 24px;
    padding-inline: 7px;
    font-size: 10px;
  }

  .plan-card-price,
  .plan-card-price b {
    font-size: 16px;
  }

  .plan-card-price {
    margin-top: 8px;
    gap: 2px;
  }

  .plan-recommended,
  .plan-highlight,
  .plan-audience,
  .plan-uses,
  .plan-card-top::after {
    display: none;
  }

  #comparison summary {
    min-height: 38px;
  }
  #plans [data-plan="pro20x"] .plan-audience {
    display: block;
    margin: 4px 0 0;
    font-size: 10px;
    line-height: 14px;
  }
}

@media (min-width: 761px) and (max-width: 1060px) {
  .plan-grid { gap: 10px; }
  #plans .plan-card { min-height: 132px; }
  .plan-card-name { font-size: 16px; }
  .plan-card-price, .plan-card-price b { font-size: 22px; }
  .plan-card-price { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  #plans .plan-card {
    transition: none;
  }

  #plans .plan-card:hover {
    transform: none;
  }
}
