.corely-pricing-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(1rem, 1.4vw, 1.45rem) !important;
  margin-inline: auto;
  max-width: min(1540px, calc(100vw - 3rem));
  transition: opacity 180ms ease, filter 180ms ease;
}

.corely-pricing-grid[aria-busy="true"],
#comparison .glass-panel[aria-busy="true"] {
  opacity: 0.88;
  filter: saturate(0.95);
}

.corely-pricing-grid[aria-busy="true"] .corely-plan-card,
#comparison .glass-panel[aria-busy="true"] .corely-comparison-row {
  pointer-events: none;
}

.pricing-toggle,
.corely-pricing-toggle {
  position: relative;
  isolation: isolate;
  width: min(100%, 24rem);
  gap: 0.3rem;
  padding: 0.38rem;
  border: 1px solid var(--glass-control-border) !important;
  background: var(--glass-control-fill) !important;
  box-shadow: var(--glass-control-shadow) !important;
  backdrop-filter: blur(var(--glass-control-blur));
  -webkit-backdrop-filter: blur(var(--glass-control-blur));
  overflow: hidden;
}

.pricing-toggle::before,
.corely-pricing-toggle::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.42), transparent 38%),
    radial-gradient(circle at 80% 10%, rgb(var(--accent-rgb) / 0.10), transparent 42%);
  pointer-events: none;
}

.corely-pricing-toggle .pricing-toggle-option,
.pricing-toggle .pricing-toggle-option {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  min-height: 2.75rem;
  gap: 0.45rem;
  color: rgb(var(--muted-rgb));
  font-weight: 850;
  letter-spacing: 0;
  outline: none;
}

.corely-pricing-toggle .pricing-toggle-option.is-active,
.pricing-toggle .pricing-toggle-option.is-active {
  background: var(--glass-control-active-bg) !important;
  color: #fff;
  box-shadow: var(--glass-control-active-shadow) !important;
}

.pricing-toggle .pricing-toggle-option:hover:not(.is-active),
.corely-pricing-toggle .pricing-toggle-option:hover:not(.is-active) {
  background: rgb(var(--surface-rgb) / 0.42);
  color: rgb(var(--text-rgb));
}

.pricing-toggle .pricing-toggle-option:focus-visible,
.corely-pricing-toggle .pricing-toggle-option:focus-visible {
  box-shadow:
    0 0 0 2px rgb(var(--surface-rgb) / 0.95),
    0 0 0 4px rgb(var(--accent-rgb) / 0.34);
}

.corely-pricing-save-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.25rem;
  padding: 0 0.48rem;
  border: 1px solid rgb(var(--accent-rgb) / 0.16);
  border-radius: 999px;
  background: rgb(var(--accent-rgb) / 0.10);
  color: rgb(var(--accent-rgb));
  font-size: 0.62rem;
  font-weight: 950;
  white-space: nowrap;
}

.pricing-toggle-option.is-active .corely-pricing-save-badge {
  border-color: rgb(255 255 255 / 0.32);
  background: rgb(255 255 255 / 0.84);
  color: rgb(var(--accent-strong-rgb, var(--accent-rgb)));
}

.corely-plan-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(10.9rem, auto) minmax(5.05rem, auto) minmax(3rem, auto) minmax(0, 1fr);
  min-height: 42rem;
  height: 100%;
  gap: 1rem;
  border-radius: 1.75rem;
  padding: clamp(1.35rem, 1.55vw, 1.75rem);
  background: var(--glass-card-fill);
  box-shadow: var(--glass-card-shadow);
  backdrop-filter: blur(var(--glass-surface-blur)) saturate(1.06);
  -webkit-backdrop-filter: blur(var(--glass-surface-blur)) saturate(1.06);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
  overflow: hidden;
}

.corely-plan-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background:
    var(--glass-reflection),
    linear-gradient(180deg, rgb(var(--accent-rgb) / 0.045), transparent 48%);
  pointer-events: none;
}

html[data-theme-page="public"] .corely-plan-card::before {
  background:
    var(--glass-reflection),
    linear-gradient(180deg, rgb(var(--accent-rgb) / 0.045), transparent 48%) !important;
}

.corely-plan-card > * {
  position: relative;
  z-index: 1;
}

.corely-plan-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--glass-hover-shadow);
}

.corely-plan-card--recommended {
  border-color: rgb(var(--accent-rgb) / 0.62) !important;
  box-shadow:
    0 28px 74px -48px rgb(var(--accent-rgb) / 0.34),
    var(--glass-card-shadow) !important;
}

.corely-plan-card--recommended::before {
  background:
    var(--glass-reflection),
    linear-gradient(180deg, rgb(var(--accent-rgb) / 0.10), transparent 42%);
}

html[data-theme-page="public"] .corely-plan-card--recommended::before {
  background:
    var(--glass-reflection),
    linear-gradient(180deg, rgb(var(--accent-rgb) / 0.10), transparent 42%) !important;
}

.corely-plan-badge {
  position: absolute !important;
  top: 0.9rem;
  right: 0.95rem;
  z-index: 2 !important;
  border-radius: 999px;
  background: rgb(var(--accent-rgb));
  color: white;
  padding: 0.5rem 0.85rem;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 14px 28px -18px rgb(var(--accent-rgb) / 0.55);
}

.corely-plan-card--recommended .corely-plan-card__top {
  padding-top: 1.35rem;
}

.corely-plan-target {
  min-height: 2.25rem;
  color: rgb(var(--accent-rgb));
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
}

.corely-plan-card__top {
  display: grid;
  grid-template-rows: minmax(2.25rem, auto) minmax(2rem, auto) minmax(4.25rem, auto);
  align-content: start;
  gap: 0.62rem;
  min-width: 0;
}

.corely-plan-card h3 {
  min-height: 2rem;
  margin: 0;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.12;
  white-space: nowrap;
}

.corely-plan-description,
.corely-plan-value {
  color: rgb(var(--muted-rgb));
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.55;
}

.corely-plan-description {
  display: -webkit-box;
  min-height: 4rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.corely-plan-price {
  display: flex;
  min-height: 5.05rem;
  align-items: end;
  gap: 0.45rem;
  padding-top: 0.25rem;
}

.corely-plan-price span {
  color: rgb(var(--text-rgb));
  font-size: clamp(2.25rem, 4vw, 2.9rem);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.corely-plan-price small {
  color: rgb(var(--muted-rgb));
  font-size: 0.9rem;
  font-weight: 800;
}

.corely-plan-features {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}

.corely-plan-feature {
  display: flex;
  gap: 0.65rem;
  color: rgb(var(--text-rgb));
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
}

.corely-plan-feature .material-symbols-outlined {
  color: rgb(var(--accent-rgb));
  font-size: 1.18rem;
  line-height: 1.25rem;
}

.corely-plan-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
}

.corely-plan-card__footer {
  display: grid;
  align-items: end;
  min-height: 3rem;
}

.corely-plan-card__details {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 1rem;
}

.corely-plan-value {
  display: -webkit-box;
  min-height: 4.1rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.corely-plan-limits span {
  border: 1px solid rgb(var(--border-rgb) / 0.6);
  border-radius: 999px;
  background: rgb(var(--surface-rgb) / 0.52);
  color: rgb(var(--muted-rgb));
  padding: 0.45rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 850;
}

.corely-plan-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  padding-inline: 1rem;
  border: 1px solid rgb(var(--border-rgb) / 0.72);
  border-radius: 999px;
  background: rgb(var(--surface-rgb) / 0.68);
  color: rgb(var(--text-rgb));
  font-size: 0.88rem;
  font-weight: 900;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.corely-plan-cta:hover {
  transform: translateY(-1px);
  border-color: rgb(var(--accent-rgb) / 0.38);
}

.corely-plan-cta--primary {
  border-color: rgb(var(--accent-rgb));
  background: rgb(var(--accent-rgb));
  color: white;
}

.corely-comparison-panel {
  padding: clamp(1.1rem, 3vw, 2rem);
  overflow: visible !important;
}

.corely-comparison-groups {
  display: grid;
  gap: 1rem;
}

.corely-comparison-group {
  border: 1px solid rgb(var(--border-rgb) / 0.5);
  border-radius: 1.4rem;
  background: rgb(var(--surface-rgb) / 0.44);
  overflow: hidden;
}

.corely-comparison-group__header {
  display: grid;
  gap: 0.4rem;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid rgb(var(--border-rgb) / 0.42);
}

.corely-comparison-group__header p {
  color: rgb(var(--text-rgb));
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.corely-comparison-group__header span,
.corely-comparison-row p {
  color: rgb(var(--muted-rgb));
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.6;
}

.corely-comparison-row {
  display: grid;
  grid-template-columns: minmax(12rem, 0.9fr) minmax(0, 1.4fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
}

.corely-comparison-row + .corely-comparison-row {
  border-top: 1px solid rgb(var(--border-rgb) / 0.34);
}

.corely-comparison-row strong {
  color: rgb(var(--text-rgb));
  font-size: 0.95rem;
  font-weight: 900;
}

.corely-comparison-values {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

.corely-comparison-values span {
  border-radius: 0.9rem;
  background: rgb(var(--surface-rgb) / 0.62);
  color: rgb(var(--text-rgb));
  padding: 0.65rem 0.55rem;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 850;
}

.corely-comparison-values span.is-pro {
  background: rgb(var(--accent-rgb) / 0.10);
  color: rgb(var(--accent-rgb));
}

.corely-comparison-values small {
  display: block;
  margin-bottom: 0.2rem;
  color: rgb(var(--muted-rgb));
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.corely-pricing-trust {
  position: relative;
}

.corely-pricing-examples__header,
.corely-trust-header {
  max-width: 46rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.corely-pricing-examples__header p,
.corely-trust-header p {
  color: rgb(var(--accent-rgb));
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.corely-pricing-examples__header h2,
.corely-trust-header h2 {
  margin-top: 0.75rem;
  color: rgb(var(--text-rgb));
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1;
}

.corely-pricing-examples__header span,
.corely-trust-header span {
  display: block;
  margin-top: 1rem;
  color: rgb(var(--muted-rgb));
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.7;
}

.corely-pricing-examples__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.corely-pricing-example {
  border-radius: 1.5rem;
  padding: 1.35rem;
}

.corely-pricing-example span {
  color: rgb(var(--accent-rgb));
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.corely-pricing-example h3 {
  margin-top: 1rem;
  color: rgb(var(--text-rgb));
  font-size: 1.15rem;
  font-weight: 950;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.corely-pricing-example p,
.corely-pricing-example strong {
  display: block;
  margin-top: 0.85rem;
  color: rgb(var(--muted-rgb));
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.65;
}

.corely-pricing-example strong {
  color: rgb(var(--text-rgb));
  font-weight: 850;
}

.corely-trust-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.corely-trust-card {
  border-radius: 1.5rem;
  padding: 1.3rem;
}

.corely-trust-card .material-symbols-outlined {
  color: rgb(var(--accent-rgb));
  font-size: 1.6rem;
}

.corely-trust-card h3 {
  margin-top: 1rem;
  color: rgb(var(--text-rgb));
  font-size: 1rem;
  font-weight: 900;
}

.corely-trust-card p {
  margin-top: 0.6rem;
  color: rgb(var(--muted-rgb));
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.65;
}

.corely-pricing-api-status {
  display: none;
  margin-top: 1rem;
  border: 1px solid rgb(var(--border-rgb) / 0.55);
  border-radius: 999px;
  background: rgb(var(--surface-rgb) / 0.58);
  color: rgb(var(--muted-rgb));
  padding: 0.55rem 0.8rem;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .corely-pricing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: min(1120px, calc(100vw - 2.5rem));
  }

  .corely-pricing-examples__grid,
  .corely-trust-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .corely-pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: min(760px, calc(100vw - 2rem));
  }

  .corely-comparison-row {
    grid-template-columns: 1fr;
  }

  .corely-comparison-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pricing-toggle,
  .corely-pricing-toggle {
    width: min(100%, 20.5rem);
    padding: 0.32rem;
  }

  .pricing-toggle .pricing-toggle-option,
  .corely-pricing-toggle .pricing-toggle-option {
    min-height: 2.6rem;
    padding-inline: 0.74rem;
    font-size: 0.82rem;
  }

  .corely-pricing-save-badge {
    min-height: 1.12rem;
    padding-inline: 0.38rem;
    font-size: 0.56rem;
  }

  .corely-pricing-grid {
    grid-template-columns: 1fr;
    max-width: min(28rem, calc(100vw - 1.25rem));
  }

  .corely-plan-card {
    grid-template-rows: auto auto auto auto;
    min-height: 0;
    border-radius: 1.5rem;
    padding: 1.25rem;
  }

  .corely-plan-card__top,
  .corely-plan-description,
  .corely-plan-value,
  .corely-plan-price {
    min-height: 0;
  }

  .corely-plan-card h3 {
    white-space: normal;
  }

  .corely-pricing-examples__grid,
  .corely-trust-grid {
    grid-template-columns: 1fr;
  }

  .corely-comparison-values {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .corely-plan-card,
  .corely-plan-cta,
  .pricing-toggle-option {
    transition: none;
  }

  .corely-plan-card:hover,
  .corely-plan-cta:hover {
    transform: none;
  }
}
