/*
  Customer UI, billing pages (P3; D164 restyle of U3's pages): Plan & Usage, the order receipt, the next-term page, the
  message pack page, Pricing, cart, checkout, payment result and card-to-card.
  Design: F:\Topshipping\UI_DESIGN_2026-11-19\polished\Plan.dc.html (plan card with the next-term panel, warning card,
  usage strip with three limits, pack cards, payments table); the other pages use the same card language.
  Loaded after customer.css by the billing views themselves (a <link> at the top of the page body: the Admin _Layout
  forwards no Styles section and the shared layouts are not changed by this lane). Uses customer.css tokens only.
  Same rules as customer.css: every class "cu-", logical properties only (RTL first), works at 375px, visible focus,
  no gradients (the design's warm gradient on the warning card is a flat warm wash here), text contrast >= 4.5:1.
*/

/* ---------- Page head: the small "back" link above the title ---------- */

.cu-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  font-size: var(--cu-fs-sm);
  font-weight: 600;
}

/* The chevron of the shared icon set points down; turned to point "back" (towards the inline start). */
.cu-back svg {
  transform: rotate(90deg);
}

[dir="ltr"] .cu-back svg {
  transform: rotate(-90deg);
}

/* ---------- Label / value rows (next-term panel, summaries) ---------- */

.cu-kv {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.875rem;
}

.cu-kv > li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px var(--cu-s3);
}

.cu-kv > li > span:first-child {
  color: var(--cu-muted);
}

.cu-kv > li > :last-child {
  text-align: end;
}

.cu-kv--lined {
  gap: 0;
}

.cu-kv--lined > li {
  padding: 12px 0;
  border-bottom: 1px solid var(--cu-divider);
}

.cu-kv--lined > li:last-child {
  border-bottom: 0;
}

/* ---------- Plan & Usage: plan card with the next-term panel ---------- */

.cu-bplan {
  display: flex;
  flex-wrap: wrap;
}

.cu-bplan__main {
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 26px;
}

.cu-bplan__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cu-bplan__label {
  color: var(--cu-muted);
  font-size: 0.875rem;
}

.cu-bplan__name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  font-size: 2.125rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.6px;
}

.cu-bplan__term {
  color: var(--cu-text-2);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
}

.cu-bplan__progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cu-bplan__days {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px var(--cu-s3);
  color: var(--cu-text-2);
  font-size: var(--cu-fs-sm);
}

.cu-bplan__days strong {
  color: var(--cu-text);
  font-weight: 700;
}

.cu-bplan__left--soon,
.cu-bplan__left--soon strong {
  color: var(--cu-warm);
}

.cu-bplan__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.cu-bplan__note {
  color: var(--cu-text-2);
  font-size: var(--cu-fs-sm);
  line-height: 1.8;
}

.cu-bplan__next {
  flex: 1 1 240px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 26px;
  border-inline-start: 1px solid var(--cu-divider);
  background: var(--cu-surface-3);
  font-size: 0.875rem;
}

.cu-bplan__next-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
}

.cu-bplan__hint {
  color: var(--cu-muted);
  font-size: var(--cu-fs-xs);
  line-height: 1.8;
}

/* ---------- Plan & Usage: warning card ---------- */

.cu-bwarn {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--cu-warm-wash);
  border-color: var(--cu-warm-line);
}

.cu-bwarn__icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--cu-warm-soft);
  color: var(--cu-warm);
}

.cu-bwarn__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
}

.cu-bwarn__text {
  color: var(--cu-text-2);
  font-size: var(--cu-fs-sm);
  line-height: 1.8;
}

.cu-bwarn__link {
  margin-top: auto;
  font-size: 0.875rem;
  font-weight: 600;
}

/* ---------- Plan & Usage: usage strip (three sold limits) ---------- */

.cu-bstrip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cu-bstrip__cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px;
  border-inline-end: 1px solid var(--cu-divider);
}

.cu-bstrip__cell:last-child {
  border-inline-end: 0;
}

.cu-bstrip__label {
  color: var(--cu-text-2);
  font-size: 0.875rem;
}

.cu-bstrip__value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.5px;
}

.cu-bstrip__of {
  color: var(--cu-muted);
  font-size: var(--cu-fs-md);
  font-weight: 500;
  letter-spacing: 0;
}

.cu-bstrip__note {
  color: var(--cu-muted);
  font-size: var(--cu-fs-xs);
  line-height: 1.7;
}

.cu-bstrip__note--warm {
  color: var(--cu-warm);
  font-weight: 600;
}

@media (max-width: 860px) {
  .cu-bstrip {
    grid-template-columns: minmax(0, 1fr);
  }

  .cu-bstrip__cell {
    padding: 16px;
    border-inline-end: 0;
    border-bottom: 1px solid var(--cu-divider);
  }

  .cu-bstrip__cell:last-child {
    border-bottom: 0;
  }

  .cu-bstrip__value {
    font-size: 1.5rem;
  }
}

/* ---------- Plan & Usage: message packs (D149) ---------- */

.cu-bpacks {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cu-bpacks__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}

.cu-bpacks__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}

.cu-bpacks__detail {
  color: var(--cu-muted);
  font-size: var(--cu-fs-sm);
}

.cu-bpackgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cu-bpackgrid > li {
  display: flex;
  min-width: 0;
}

.cu-body a.cu-bpack,
.cu-page a.cu-bpack {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 18px 20px;
  color: inherit;
  text-decoration: none;
}

.cu-body a.cu-bpack:hover,
.cu-page a.cu-bpack:hover {
  border-color: var(--cu-brand);
  color: inherit;
  text-decoration: none;
}

.cu-body a.cu-bpack:focus-visible,
.cu-page a.cu-bpack:focus-visible {
  border-radius: var(--cu-r-xl);
}

.cu-bpack__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cu-bpack__size {
  font-size: 1.25rem;
  font-weight: 700;
}

.cu-bpack__price {
  color: var(--cu-muted);
  font-size: var(--cu-fs-sm);
}

.cu-bpack__buy {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--cu-r-lg);
  background: var(--cu-brand-soft);
  color: var(--cu-brand-ink);
  font-size: 0.875rem;
  font-weight: 600;
}

a.cu-bpack:hover .cu-bpack__buy {
  background: var(--cu-brand);
  color: #FFFFFF;
}

/* ---------- Payments table (Plan & Usage) ---------- */

.cu-bpay__no {
  font-weight: 600;
  unicode-bidi: isolate;
}

.cu-bpay__sub {
  display: block;
  color: var(--cu-muted);
  font-size: var(--cu-fs-xs);
}

.cu-bpay__sub bdi {
  unicode-bidi: isolate;
}

.cu-bpay__amount {
  white-space: nowrap;
}

.cu-bpay__link {
  font-size: var(--cu-fs-sm);
  font-weight: 600;
  white-space: nowrap;
}

.cu-bpay__foot {
  padding: 12px 22px;
  border-top: 1px solid var(--cu-divider-2);
  color: var(--cu-muted);
  font-size: var(--cu-fs-sm);
}

.cu-bpay__empty {
  padding: 18px 22px;
  color: var(--cu-muted);
  font-size: var(--cu-fs-sm);
}

@media (max-width: 680px) {
  .cu-bpay .cu-table td:first-child,
  .cu-bpay .cu-table td:nth-child(2) {
    flex: 1 1 100%;
  }

  .cu-bpay .cu-table td:last-child {
    margin-inline-start: auto;
  }

  .cu-bpay__foot,
  .cu-bpay__empty {
    padding-inline: 16px;
  }
}

/* ---------- Summary cards (receipt, next term, pack, cart, checkout) ---------- */

.cu-bside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
}

.cu-bside__title {
  margin: 0;
  font-size: var(--cu-fs-lg);
  font-weight: 700;
}

.cu-bamount {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cu-bamount__value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.4px;
}

.cu-bamount__sub {
  color: var(--cu-muted);
  font-size: var(--cu-fs-sm);
}

.cu-bform {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cu-bform__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cu-bsection-title {
  margin: 0;
  font-size: var(--cu-fs-lg);
  font-weight: 700;
}

.cu-total--plain {
  padding-top: 12px;
}

/* ---------- Payment result: status card ---------- */

.cu-bresult {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
}

.cu-bresult__icon {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--cu-r-pill);
  display: grid;
  place-items: center;
  background: var(--cu-ok-soft);
  color: var(--cu-ok);
}

.cu-bresult__icon--wait {
  background: var(--cu-brand-soft);
  color: var(--cu-brand-ink);
}

.cu-bresult__icon--warm {
  background: var(--cu-warm-soft);
  color: var(--cu-warm);
}

.cu-bresult__text {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cu-bresult__text .cu-h1 {
  font-size: var(--cu-fs-2xl);
}

.cu-bresult__detail {
  color: var(--cu-text-2);
  font-size: var(--cu-fs-md);
  line-height: 1.8;
}

.cu-bresult__warn {
  color: var(--cu-warm);
  font-size: var(--cu-fs-sm);
  line-height: 1.8;
}

/* ---------- Card-to-card: the destination card ---------- */

.cu-bcardno {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px dashed var(--cu-dash);
  border-radius: 12px;
  background: var(--cu-surface-3);
}

.cu-bcardno__label {
  color: var(--cu-muted);
  font-size: var(--cu-fs-xs);
}

.cu-bcardno__number {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  unicode-bidi: isolate;
  text-align: start;
}

.cu-bcardno__holder {
  color: var(--cu-text-2);
  font-size: var(--cu-fs-sm);
}

/* ---------- Cart lines inside a flush card ---------- */

.cu-bcart .cu-cart__line {
  padding: 14px 22px;
  border-bottom-color: var(--cu-divider-2);
}

.cu-bcart .cu-cart > li:last-child {
  border-bottom: 0;
}

@media (max-width: 860px) {
  .cu-bcart .cu-cart__line {
    padding: 12px 16px;
  }
}

/* ---------- Pricing: plan cards ---------- */

.cu-plan-card__name {
  margin: 0;
  font-size: var(--cu-fs-lg);
  font-weight: 700;
}

.cu-plan-card__limits li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.cu-plan-card__limits svg {
  margin-top: 0.3em;
  color: var(--cu-ok);
}

.cu-plan-card__note {
  color: var(--cu-muted);
  font-size: var(--cu-fs-sm);
}

/* ---------- Phones ---------- */

@media (max-width: 860px) {
  .cu-bplan__main,
  .cu-bplan__next {
    padding: 18px 16px;
  }

  .cu-bplan__next {
    border-inline-start: 0;
    border-top: 1px solid var(--cu-divider);
  }

  .cu-bplan__name {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .cu-bplan__actions,
  .cu-bplan__actions .cu-btn,
  .cu-bside .cu-btn {
    width: 100%;
  }

  .cu-bamount__value {
    font-size: 1.5rem;
  }

  .cu-bcardno__number {
    font-size: 1.0625rem;
    letter-spacing: 0.04em;
  }
}

/* Payment result: the step list beside the receipt keeps its own height. */
.cu-grid > .cu-steps {
  align-self: start;
}

/* ---------- Pricing: term switch and message packs (public pages, 2026-11-22) ---------- */

/* The term switch keeps its own width instead of stretching across the page. */
.cu-pricing > .cu-segment {
  align-self: flex-start;
}

/* A pack that cannot be bought now (a guest, no plan, the trial): the same card without the buy action. */
.cu-bpack--info {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 18px 20px;
}

/* The cart lines keep their own height next to the total. */
.cu-grid > .cu-bcart {
  align-self: start;
}

/* F13: "added to cart" above the plans, with the cart actions; the page opens at it (#cart-added). */
.cu-cart-added {
  margin-block-end: var(--cu-s4);
  scroll-margin-block-start: 96px;
}

.cu-cart-added__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cu-s2);
}
