:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans Lao", sans-serif;
  color: #202334;
  background: #f5f6fb;
  --accent: #6547d9;
  --accent-strong: #4f34bf;
  --navy: #151858;
  --surface: #ffffff;
  --muted: #667085;
  --line: #dde1ed;
  --soft: #f0edff;
  --warning: #895400;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f5f6fb; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 12px max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(221, 225, 237, .86);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 11px; color: #151858; text-decoration: none; }
.brand img { width: 46px; height: 46px; object-fit: contain; }
.brand span { display: grid; gap: 1px; }
.brand strong { font-size: 19px; letter-spacing: -.02em; }
.brand small { color: #716a93; font-size: 11px; }
.site-header nav { display: flex; align-items: center; gap: 8px; }
.quiet-link, .secondary-button, .icon-button {
  min-height: 42px;
  border: 1px solid #d9dcea;
  border-radius: 11px;
  color: #4f5268;
  background: white;
  text-decoration: none;
}
.quiet-link { display: inline-flex; align-items: center; padding: 0 14px; }
.secondary-button { padding: 0 15px; }
.icon-button { width: 42px; padding: 0; font-size: 24px; }

.page-shell { width: min(1180px, calc(100% - 48px)); margin: 34px auto 70px; }
.membership-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: center;
  gap: 36px;
  padding: 38px 42px;
  border-radius: 25px;
  color: white;
  background: linear-gradient(135deg, #17194f 0%, #292077 55%, #6547d9 100%);
  box-shadow: 0 22px 55px rgba(42, 32, 111, .2);
}
.membership-hero::after {
  content: "";
  position: absolute;
  right: -95px;
  bottom: -125px;
  width: 330px;
  height: 330px;
  border: 42px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
}
.eyebrow { margin: 0 0 7px; color: #765ada; font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.membership-hero .eyebrow { color: #d8d0ff; }
h1 { margin: 0; max-width: 700px; font-size: clamp(30px, 4vw, 46px); line-height: 1.15; letter-spacing: -.035em; }
.hero-copy { margin: 17px 0 0; max-width: 660px; color: #dedcf6; line-height: 1.7; }
.membership-summary {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 18px;
  background: rgba(255, 255, 255, .11);
}
.membership-summary span, .membership-summary small { color: #dcd9f5; font-size: 12px; }
.membership-summary strong { font-size: 25px; }
.page-state { margin: 16px 2px 0; min-height: 24px; color: #667085; font-size: 14px; }
.page-state.error { color: #a23838; }
.page-state a { color: #4f34bf; font-weight: 700; }

.quota-section, .catalog-section, .orders-section, .notifications-section, .payment-card {
  margin-top: 22px;
  padding: 25px;
  border: 1px solid #e1e4ee;
  border-radius: 21px;
  background: white;
  box-shadow: 0 10px 30px rgba(28, 35, 66, .045);
}
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; color: #202334; font-size: 23px; letter-spacing: -.02em; }
.section-note { color: #7a8193; font-size: 12px; text-align: right; }

.quota-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quota-item { padding: 17px; border: 1px solid #e4e6ef; border-radius: 15px; background: #fafaff; }
.quota-item span { color: #747c8f; font-size: 12px; }
.quota-item strong { display: block; margin: 10px 0 6px; color: #292251; font-size: 27px; font-variant-numeric: tabular-nums; }
.quota-item small { color: #8a90a0; font-size: 11px; }

.period-selector { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #eceef4; }
.period-selector button { min-height: 39px; padding: 0 17px; border: 0; border-radius: 9px; color: #62697a; background: transparent; }
.period-selector button.selected { color: white; background: #6547d9; box-shadow: 0 6px 15px rgba(101, 71, 217, .22); }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-card { position: relative; display: flex; flex-direction: column; min-height: 330px; padding: 22px; border: 1px solid #dedfed; border-radius: 18px; background: #fff; }
.plan-card.featured { border-color: #8e79e6; background: linear-gradient(180deg, #f7f4ff, #fff 45%); box-shadow: 0 16px 34px rgba(75, 54, 159, .1); }
.plan-card .recommendation { align-self: flex-start; margin-bottom: 14px; padding: 5px 9px; border-radius: 999px; color: #4f34bf; background: #e9e3ff; font-size: 11px; font-weight: 750; }
.plan-card h3 { margin: 0; font-size: 21px; }
.plan-price { margin: 13px 0 4px; color: #17194f; font-size: 31px; font-weight: 800; }
.plan-price small { color: #747c8f; font-size: 12px; font-weight: 500; }
.intro-price { min-height: 20px; margin: 0 0 12px; color: #6547d9; font-size: 12px; }
.plan-entitlements { display: grid; gap: 8px; margin: 5px 0 22px; padding: 0; color: #555d70; font-size: 13px; list-style: none; }
.plan-entitlements li::before { content: "\2713"; margin-right: 8px; color: #6547d9; font-weight: 800; }
.plan-card button, .addon-card button {
  min-height: 44px;
  margin-top: auto;
  border: 0;
  border-radius: 11px;
  color: white;
  background: #6547d9;
  font-weight: 750;
}
.plan-card button:hover, .addon-card button:hover { background: #4f34bf; }

.addon-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.addon-card { display: flex; flex-direction: column; min-height: 190px; padding: 18px; border: 1px solid #e1e4ee; border-radius: 15px; background: #fafbff; }
.addon-card h3 { margin: 0; font-size: 16px; }
.addon-card p { margin: 7px 0 14px; color: #747c8f; font-size: 12px; line-height: 1.55; }
.addon-price { margin-top: auto; margin-bottom: 12px; color: #20234c; font-size: 23px; font-weight: 800; }
.addon-card button { margin-top: 0; }

.payment-card { border-color: #d4c9ff; background: #fcfbff; }
.receipt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.receipt-grid > div { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: white; }
.receipt-grid span { color: #7a8193; font-size: 11px; }
.receipt-grid strong { overflow-wrap: anywhere; color: #27223e; font-size: 14px; }
.payment-unavailable { margin-top: 14px; padding: 18px; border: 1px solid #f0d28d; border-radius: 14px; color: #7d4b00; background: #fff7e2; }
.payment-unavailable p { margin: 7px 0; line-height: 1.6; }
.payment-unavailable a { color: #684d16; font-weight: 750; }
.payment-declaration { display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(160px, 1fr); align-items: end; gap: 10px; margin-top: 14px; }
.payment-declaration label { display: grid; gap: 6px; color: #6d7486; font-size: 12px; }
.payment-declaration input, .payment-declaration select { min-height: 42px; padding: 0 11px; border: 1px solid #d7dbe7; border-radius: 10px; background: #f4f5f8; }
.payment-declaration button { min-height: 42px; border: 0; border-radius: 10px; padding: 0 16px; color: white; background: #6547d9; }
.payment-declaration .section-note { align-self: center; margin: 0; text-align: left; }

.order-list { display: grid; gap: 10px; }
.order-card { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(140px, .75fr) minmax(150px, .65fr) auto; align-items: center; gap: 16px; padding: 16px; border: 1px solid #e3e5ed; border-radius: 14px; }
.order-card h3 { margin: 0 0 6px; font-size: 15px; }
.order-card p, .order-card small { margin: 0; color: #7a8193; font-size: 11px; overflow-wrap: anywhere; }
.order-card .order-money { color: #292251; font-size: 18px; font-weight: 800; }
.status-badge { display: inline-flex; width: fit-content; padding: 6px 9px; border-radius: 999px; color: #5c4caa; background: #eeebfb; font-size: 11px; font-weight: 750; }
.status-badge.positive { color: #18723a; background: #e8f8ed; }
.status-badge.warning { color: #8a5d00; background: #fff3d7; }
.status-badge.muted { color: #6b7280; background: #eef0f4; }
.order-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.order-actions button { min-height: 38px; border: 0; border-radius: 9px; padding: 0 11px; color: #5945b7; background: #eeeafd; }
.order-actions button.cancel { color: #8a3d3d; background: #fff0f0; }
.empty-state { padding: 28px; border: 1px dashed #d8dce7; border-radius: 14px; color: #7a8193; text-align: center; }

.notifications-section { padding: 0; overflow: hidden; }
.notifications-section summary { display: flex; justify-content: space-between; align-items: center; min-height: 70px; padding: 0 24px; cursor: pointer; list-style: none; }
.notifications-section summary::-webkit-details-marker { display: none; }
.notifications-section summary > span:first-child { display: grid; gap: 3px; }
.notifications-section summary small, .notifications-section summary > span:last-child { color: #7a8193; font-size: 12px; }
.notification-list { display: grid; gap: 8px; padding: 0 24px 22px; }
.notification-item { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 13px 14px; border-radius: 11px; background: #f7f7fb; }
.notification-item p { margin: 0; color: #474d5d; font-size: 13px; }
.notification-item time { color: #858b9b; font-size: 11px; }

@media (max-width: 900px) {
  .membership-hero { grid-template-columns: 1fr; }
  .membership-summary { max-width: 420px; }
  .quota-grid, .addon-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card { min-height: 0; }
  .receipt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-card { grid-template-columns: 1fr 1fr; }
  .order-actions { justify-content: flex-start; }
}

@media (max-width: 620px) {
  .site-header { min-height: 68px; padding: 10px 16px; }
  .brand img { width: 42px; height: 42px; }
  .brand small { display: none; }
  .quiet-link { display: none; }
  .page-shell { width: min(100% - 24px, 1180px); margin-top: 16px; }
  .membership-hero { gap: 22px; padding: 27px 23px; border-radius: 20px; }
  .quota-section, .catalog-section, .orders-section, .payment-card { padding: 19px; border-radius: 18px; }
  .section-heading, .catalog-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .section-note { text-align: left; }
  .period-selector { width: 100%; }
  .period-selector button { flex: 1 1 0; padding: 0 8px; }
  .quota-grid, .addon-grid, .receipt-grid { grid-template-columns: 1fr 1fr; }
  .payment-declaration { grid-template-columns: 1fr; }
  .order-card { grid-template-columns: 1fr; gap: 9px; }
  .order-actions { justify-content: stretch; }
  .order-actions button { flex: 1 1 auto; min-height: 44px; }
  .notification-item { grid-template-columns: 1fr; gap: 5px; }
}

@media (max-width: 400px) {
  .quota-grid, .addon-grid, .receipt-grid { grid-template-columns: 1fr; }
}
