/* MDJ Plans: accepted quote-ledger layout.
   Shared site tokens, compact data surfaces, pill actions and explicit mobile cards. */

.quote-ledger {
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto;
  padding: calc(var(--mdj-header-safe-offset) + 32px) 0 96px;
}

.quote-mast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, auto);
  gap: 20px 40px;
  align-items: end;
}

.quote-mast p {
  margin: 0;
}

.quote-mast__id {
  color: var(--red-bright);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.quote-mast h1 {
  max-width: 18ch;
  margin: 10px 0 0;
  color: var(--text);
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 880;
  letter-spacing: -.05em;
  line-height: 1.04;
}

:lang(zh) .quote-mast h1 {
  max-width: 10em;
}

.quote-mast__terms {
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.6;
  text-align: right;
}

.quote-mast__terms span {
  display: block;
}

.quote-rule {
  height: 1px;
  margin-top: 30px;
  background: var(--line);
}

.quote-lede {
  max-width: 60ch;
  margin: 24px 0 40px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.quote-section {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--mdj-header-safe-offset) + 16px);
}

.quote-section--guided {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.quote-section h2 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: clamp(1.08rem, 1.8vw, 1.25rem);
  font-weight: 850;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.quote-table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.quote-ledger table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.quote-ledger th,
.quote-ledger td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: .9rem;
  line-height: 1.45;
  text-align: left;
  vertical-align: middle;
}

.quote-ledger thead {
  background: var(--surface);
}

.quote-ledger thead th {
  padding-block: 11px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.quote-ledger tbody tr:last-child td {
  border-bottom: 0;
}

.quote-ledger .num {
  font-variant-numeric: tabular-nums;
  font-weight: 820;
  text-align: right;
  white-space: nowrap;
}

.quote-ledger .num strong {
  font: inherit;
}

.quote-ledger .num span {
  color: var(--muted);
  font-size: .66rem;
  font-weight: 760;
}

.quote-ledger td.plan {
  font-size: .96rem;
  font-weight: 850;
  white-space: nowrap;
}

.quote-ledger td.pick {
  width: 9rem;
  text-align: right;
}

.quote-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: .8rem;
  font-weight: 820;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 160ms ease;
}

.quote-cta:hover {
  border-color: color-mix(in srgb, var(--red-bright) 58%, var(--line));
  background: color-mix(in srgb, var(--red-bright) 8%, var(--surface));
  transform: translateY(-1px);
}

.quote-cta--primary {
  border-color: rgba(255, 255, 255, .18);
  background: linear-gradient(135deg, var(--red-bright), var(--red) 58%, #4e050a);
  box-shadow: 0 12px 30px rgba(143, 9, 21, .28);
  color: #fff;
}

.quote-cta--primary:hover {
  border-color: rgba(255, 255, 255, .26);
  background: linear-gradient(135deg, #e3293f, var(--red) 58%, #4e050a);
  color: #fff;
}

.quote-cta:active {
  transform: scale(.985);
}

.quote-cta:focus-visible,
.tier-switch button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 70%, transparent);
  outline-offset: 2px;
}

.quote-cta:disabled {
  opacity: .6;
  cursor: wait;
  transform: none;
}

.quote-ledger tr.is-usual {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.quote-ledger tr.is-usual td:first-child {
  padding-left: 16px;
  box-shadow: inset 3px 0 var(--red-bright);
}

.quote-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--gold) 46%, transparent);
  border-radius: 5px;
  color: var(--gold);
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .025em;
}

.quote-includes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.quote-includes p {
  margin: 0;
}

.quote-includes strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: .88rem;
}

.quote-includes span {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.55;
}

.quote-extra {
  display: flex;
  gap: 8px;
  margin: 16px 0 0;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--gold) 8%, var(--surface));
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.6;
}

.quote-extra strong {
  flex: 0 0 auto;
  color: var(--text);
}

.quote-notes {
  max-width: 86ch;
  margin: 22px 0 0;
  padding: 0;
  color: var(--subtle);
  font-size: .8rem;
  line-height: 1.65;
}

ol.quote-notes {
  padding-left: 1.35rem;
}

.quote-notes li + li {
  margin-top: 4px;
}

.tier-switch {
  display: inline-flex;
  gap: 4px;
  margin-top: 11px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.tier-switch button {
  min-height: 34px;
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: .7rem;
  font-weight: 800;
  white-space: nowrap;
}

.tier-switch button[aria-pressed="true"] {
  background: var(--red);
  color: #f7f4f2;
}

.quote-checkout {
  padding: 28px;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--gold) 5%, var(--surface));
}

.quote-checkout__heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
}

.quote-checkout__heading h2 {
  max-width: 30ch;
  margin-bottom: 8px;
}

.quote-checkout__heading > div > p:last-child {
  max-width: 66ch;
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.6;
}

.quote-checkout__kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.quote-checkout__form {
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(220px, 1.1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 24px;
}

.quote-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: .73rem;
  font-weight: 820;
}

.quote-field select,
.quote-field input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--bg-soft);
  color: var(--text);
  padding: 0 13px;
  font: inherit;
  font-size: .84rem;
  font-weight: 650;
}

.quote-field input {
  text-transform: uppercase;
}

.quote-field select:focus,
.quote-field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent);
}

.quote-field input[readonly] {
  border-color: color-mix(in srgb, var(--gold) 44%, var(--line));
  background: color-mix(in srgb, var(--gold) 7%, var(--bg-soft));
  cursor: default;
  letter-spacing: .05em;
}

.quote-checkout__form > .quote-cta {
  min-height: 46px;
}

.quote-checkout__status {
  min-height: 20px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.45;
}

.quote-checkout__status.is-ok {
  color: var(--gold);
}

.quote-checkout__status.is-error {
  color: var(--red-bright);
}

.quote-checkout__note {
  margin: 8px 0 0;
  color: var(--subtle);
  font-size: .72rem;
  line-height: 1.55;
}

.plans-data-status {
  margin: 32px 0 0;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--red-bright) 34%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--red-bright) 7%, var(--surface));
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.55;
}

.plans-data-status[hidden] {
  display: none;
}

.plans-page[data-plan-state="loading"] [data-plan-price],
.plans-page[data-plan-state="loading"] [data-research-price] {
  opacity: .62;
}

.quote-ledger ~ .site-footer .footer-brand span {
  color: var(--muted);
}

@media (max-width: 800px) {
  .quote-ledger {
    width: min(100% - 32px, 1040px);
    padding-top: calc(var(--mdj-header-safe-offset) + 24px);
  }

  .quote-mast {
    grid-template-columns: 1fr;
  }

  .quote-checkout__form {
    grid-template-columns: 1fr 1fr;
  }

  .quote-checkout__form > .quote-cta {
    grid-column: 1 / -1;
    width: 100%;
  }

  .quote-mast h1 {
    max-width: 15ch;
  }

  .quote-mast__terms {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 14px;
    text-align: left;
  }

  .quote-mast__terms span {
    display: inline;
  }

  .quote-includes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 16px;
    padding: 16px;
  }

  .quote-ledger thead {
    display: none;
  }

  .quote-table-wrap {
    border-radius: 12px;
  }

  .quote-ledger table,
  .quote-ledger tbody {
    display: block;
    width: 100%;
  }

  .quote-ledger tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 14px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }

  .quote-ledger tbody tr:last-child {
    border-bottom: 0;
  }

  .quote-ledger tr.is-usual {
    padding-inline: 16px;
  }

  .quote-ledger tr.is-usual td:first-child {
    padding-left: 0;
    box-shadow: none;
  }

  .quote-ledger td {
    padding: 2px 0;
    border: 0;
  }

  .quote-ledger td.plan {
    grid-column: 1;
  }

  .quote-ledger td.num {
    grid-column: 2;
    grid-row: 1;
  }

  .quote-ledger td[data-label]::before {
    display: block;
    color: var(--subtle);
    content: attr(data-label);
    font-size: .66rem;
    letter-spacing: .035em;
    text-transform: uppercase;
  }

  .quote-section--guided td[data-label="Period"],
  .quote-section:not(.quote-section--guided) td[data-label="Included"] {
    grid-column: 1 / -1;
  }

  :lang(zh) .quote-section--guided td[data-label="周期"],
  :lang(zh) .quote-section:not(.quote-section--guided) td[data-label="内容"],
  :lang(ru) .quote-section--guided td:nth-child(4),
  :lang(ru) .quote-section:not(.quote-section--guided) td:nth-child(2),
  :lang(tg) .quote-section--guided td:nth-child(4),
  :lang(tg) .quote-section:not(.quote-section--guided) td:nth-child(2) {
    grid-column: 1 / -1;
  }

  .quote-ledger td.pick {
    grid-column: 1 / -1;
    width: auto;
    padding-top: 10px;
    text-align: left;
  }

  .quote-ledger .pick .quote-cta {
    width: 100%;
    min-height: 48px;
  }
}

@media (max-width: 560px) {
  .quote-checkout {
    padding: 22px 18px;
  }

  .quote-checkout__heading,
  .quote-checkout__form {
    grid-template-columns: 1fr;
  }

  .quote-checkout__heading > .quote-cta,
  .quote-checkout__form > .quote-cta {
    grid-column: auto;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .quote-mast h1 {
    font-size: 2rem;
  }

  .quote-includes {
    grid-template-columns: 1fr;
  }

  .quote-extra {
    display: grid;
  }

  .tier-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quote-cta {
    transition-duration: .01ms;
  }

  .quote-cta:hover,
  .quote-cta:active {
    transform: none;
  }
}
