body.plan-detail-open { overflow: hidden; }

.plan-detail {
  width: min(1180px, calc(100vw - 34px));
  max-width: none;
  max-height: min(92dvh, 980px);
  overflow: hidden;
  margin: auto;
  padding: 0;
  border: 1px solid rgba(255, 218, 112, 0.76);
  border-radius: 24px;
  background: #030200;
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 241, 189, 0.08) inset,
    0 34px 100px rgba(0, 0, 0, 0.92),
    0 0 54px rgba(210, 134, 20, 0.22);
  opacity: 0;
  transform: translateY(18px) scale(0.982);
  transition: opacity 220ms ease, transform 260ms ease, overlay 220ms ease allow-discrete, display 220ms ease allow-discrete;
}

.plan-detail[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  .plan-detail[open] {
    opacity: 0;
    transform: translateY(18px) scale(0.982);
  }
}

.plan-detail::backdrop {
  background: rgba(0, 0, 0, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.plan-detail--fallback {
  position: fixed;
  inset: 4vh auto auto 50%;
  z-index: 9998;
  transform: translateX(-50%);
}

.plan-detail__panel {
  position: relative;
  max-height: min(92dvh, 980px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #d79c26 #090704;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(203, 130, 18, 0.15), transparent 32%),
    linear-gradient(180deg, #080603 0%, #020100 48%, #000 100%);
}

.plan-detail__panel::before {
  content: "";
  position: fixed;
  z-index: 0;
  top: 0;
  left: 50%;
  width: min(720px, 66vw);
  height: 160px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 216, 106, 0.1), transparent 68%);
  pointer-events: none;
}

.plan-detail__header {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 26px clamp(22px, 4vw, 50px);
  border-bottom: 1px solid rgba(232, 174, 47, 0.28);
  background: rgba(4, 3, 1, 0.93);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}

.plan-detail__eyebrow {
  margin: 0 0 7px;
  color: #e4aa2f;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  line-height: 1.4;
}

.plan-detail__header h2 {
  margin: 0;
  color: #ffe786;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.3vw, 2.05rem);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.15;
  text-shadow: 0 0 22px rgba(225, 158, 32, 0.2);
}

.plan-detail__close {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.plan-detail__close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.plan-detail__close:hover,
.plan-detail__close:focus-visible {
  transform: rotate(6deg) scale(1.06);
  border-color: #ffe18a;
  background: rgba(225, 158, 32, 0.1);
  box-shadow: 0 0 24px rgba(225, 158, 32, 0.18);
}

.plan-detail__body {
  position: relative;
  z-index: 1;
  padding: 46px clamp(20px, 5vw, 66px) 52px;
}

.plan-detail__intro {
  padding: clamp(27px, 4vw, 46px);
  border: 1px solid rgba(231, 174, 49, 0.34);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 230, 143, 0.055), transparent 32%),
    rgba(255, 255, 255, 0.018);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 241, 187, 0.025) inset;
}

.plan-detail__intro h3 {
  margin: 0 0 25px;
  color: #fffdf8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.1vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.plan-detail__intro p,
.plan-detail__feature p {
  color: rgba(255, 255, 255, 0.75);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.97rem, 1.2vw, 1.07rem);
  line-height: 1.68;
}

.plan-detail__intro p { margin: 0 0 14px; }
.plan-detail__intro p:last-child { margin-bottom: 0; }

.plan-detail__section-title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  margin: 54px 0 30px;
  color: #f3be45;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.76rem, 1vw, 0.92rem);
  letter-spacing: 0.2em;
  text-align: center;
}

.plan-detail__section-title span {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 171, 45, 0.7));
}

.plan-detail__section-title span:last-child {
  background: linear-gradient(90deg, rgba(230, 171, 45, 0.7), transparent);
}

.plan-detail__features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.plan-detail__feature {
  position: relative;
  overflow: hidden;
  padding: 27px 28px 25px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.3);
  transition: transform 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.plan-detail__feature::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  width: 82px;
  height: 1px;
  background: linear-gradient(90deg, #ffe08a, transparent);
  box-shadow: 0 0 14px rgba(234, 172, 45, 0.35);
}

.plan-detail__feature--featured { grid-column: 1 / -1; }

.plan-detail__feature:hover {
  transform: translateY(-3px);
  border-color: rgba(235, 178, 51, 0.31);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.39), 0 0 25px rgba(211, 139, 20, 0.055);
}

.plan-detail__feature h3 {
  margin: 0 0 17px;
  color: #ffe689;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.18rem, 1.65vw, 1.48rem);
  font-weight: 500;
  line-height: 1.24;
}

.plan-detail__feature p { margin: 0 0 12px; }
.plan-detail__feature p:last-child { margin-bottom: 0; }

.plan-detail__ideal {
  position: relative;
  max-width: 840px;
  margin: 46px auto 0;
  padding: 26px 38px;
  border: 1px solid rgba(235, 177, 48, 0.46);
  border-radius: 14px;
  background: rgba(212, 138, 19, 0.055);
  color: #ffe998;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  font-style: normal;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 0 35px rgba(202, 126, 11, 0.08);
}

.plan-detail__closing-label {
  margin: 44px auto -28px;
  color: rgba(255, 255, 255, 0.52);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
}

.plan-detail__close-bottom {
  min-width: 190px;
  min-height: 50px;
  display: block;
  margin: 30px auto 0;
  padding: 13px 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.plan-detail__close-bottom:hover,
.plan-detail__close-bottom:focus-visible {
  transform: translateY(-2px);
  border-color: #ffe08a;
  box-shadow: 0 0 24px rgba(225, 158, 32, 0.15);
}

@media (max-width: 760px) {
  .plan-detail {
    width: calc(100vw - 18px);
    max-height: 96dvh;
    border-radius: 18px;
  }

  .plan-detail__panel { max-height: 96dvh; }

  .plan-detail__header {
    align-items: flex-start;
    padding: 19px 17px 18px;
  }

  .plan-detail__header h2 {
    padding-right: 4px;
    font-size: clamp(1.04rem, 5vw, 1.32rem);
  }

  .plan-detail__close {
    width: 42px;
    height: 42px;
  }

  .plan-detail__body { padding: 24px 13px 34px; }
  .plan-detail__intro { padding: 25px 20px; border-radius: 16px; }
  .plan-detail__intro h3 { font-size: clamp(2rem, 10vw, 2.8rem); }

  .plan-detail__section-title {
    grid-template-columns: 1fr;
    gap: 11px;
    margin: 40px 0 22px;
    line-height: 1.45;
  }

  .plan-detail__section-title span { display: none; }
  .plan-detail__features { grid-template-columns: 1fr; }
  .plan-detail__feature--featured { grid-column: auto; }
  .plan-detail__feature { padding: 24px 20px 22px; }
  .plan-detail__ideal { padding: 23px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .plan-detail,
  .plan-detail__close,
  .plan-detail__feature,
  .plan-detail__close-bottom { transition: none; }
}
