.data-store-page,
.data-store-checkout-page {
  --store-surface: var(--poya-surface, #fff);
  --store-surface-soft: var(--poya-surface-soft, #f8fbfd);
  --store-ink: var(--poya-ink, #142033);
  --store-muted: var(--poya-muted, #607083);
  --store-border: var(--poya-border, #dce6ef);
  --store-border-strong: var(--poya-border-strong, #c7d5e2);
  --store-primary: var(--poya-brand-700, #1769aa);
  --store-primary-strong: var(--poya-brand-900, #0b426f);
  --store-success: var(--poya-success, #137a50);
  --store-warning: var(--poya-warning, #9a6700);
  --store-danger: var(--poya-danger, #b42318);
  color: var(--store-ink);
}

.data-store-main,
.data-store-checkout-shell {
  width: min(100% - 2rem, 1180px);
  margin-inline: auto;
  padding-block: clamp(1rem, 2.5vw, 2.5rem);
}

.data-store-page .poya-page-backlinks {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 0;
}

.data-store-page .poya-page-backlinks .back-link {
  display: inline-flex;
  align-items: center;
  min-block-size: 38px;
  padding-inline: .65rem;
}

.data-store-hero,
.data-store-checkout-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  margin-block-end: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.6rem);
  border: 1px solid var(--store-border);
  border-radius: 26px;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, .16), transparent 34%),
    linear-gradient(120deg, var(--poya-brand-900), var(--poya-brand-700), var(--poya-brand-500));
  color: #fff;
  box-shadow: var(--poya-shadow-md, 0 12px 36px rgba(20, 46, 72, .09));
}

.data-store-hero,
.data-store-checkout-hero {
  text-align: center;
}

.data-store-hero h1,
.data-store-checkout-hero h1 {
  margin: 0 0 .55rem;
}

.data-store-hero p,
.data-store-checkout-hero p {
  margin: 0;
  color: #eaf4fb;
  line-height: 1.9;
}

.data-store-state-card {
  border: 1px solid var(--store-border-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, .9);
  color: var(--store-ink);
}

.data-store-state-card span {
  color: var(--store-muted);
  font-size: .88rem;
}

.data-store-state-card strong {
  font-size: 1.08rem;
}

.data-store-state-card small {
  color: var(--store-muted);
  line-height: 1.7;
}

.data-store-state-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem 1rem;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto 1rem;
  padding: 1rem 1.2rem;
}

.data-store-state-card > div {
  display: grid;
  gap: .2rem;
}

.data-store-comparison-fields[hidden],
.data-store-comparison-fields > label[hidden],
.data-store-comparison-fields select[hidden] {
  display: none !important;
}

.data-store-state-card button,
.data-store-history-heading button,
.data-store-error button,
.data-store-package-head button,
.data-store-citizen-grid button,
.data-store-mode-reset,
.data-store-checkout-alert button,
.empty-state button,
.data-store-payment-state button {
  min-block-size: 44px;
  border: 1px solid var(--store-border-strong);
  border-radius: 12px;
  background: var(--store-surface);
  color: var(--store-primary-strong);
  padding: .65rem 1rem;
  font: inherit;
  font-weight: 800;
}

.data-store-state-card[data-stale="true"] {
  border-color: #d7b25c;
  background: #fff9e8;
}

.data-store-state-warning {
  grid-column: 1 / -1;
  margin: 0;
  color: #6f5100;
  line-height: 1.8;
}

.data-store-builder,
.data-store-citizen-products,
.data-store-citizen-purchase,
.data-store-checkout-card {
  max-width: 1180px;
  margin: 0 auto 1.25rem;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--store-border);
  border-radius: 24px;
  background: var(--store-surface);
  box-shadow: var(--poya-shadow-md, 0 12px 36px rgba(20, 46, 72, .09));
}

.data-store-builder[hidden],
.data-store-citizen-purchase[hidden],
.data-store-citizen-config[hidden],
.data-store-comparison-fields[hidden] { display: none !important; }

.data-store-citizen-purchase {
  margin-block: 1.5rem 0;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--store-border-strong);
  border-radius: 20px;
  background: var(--store-surface-soft);
}

.data-store-citizen-purchase > .data-store-package-head {
  margin-block-end: 1rem;
}

#dataStoreCitizenWorkspace:empty { display: none; }

.dashboard-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-block-end: 1rem;
}

.dashboard-section-heading h2,
.data-store-package-head h3,
.data-store-checkout-card h2 {
  margin: 0;
}

.dashboard-section-heading p {
  margin: .35rem 0 0;
  color: var(--store-muted);
  line-height: 1.8;
}

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

.data-store-step-grid label,
.data-store-citizen-config label {
  display: grid;
  gap: .45rem;
  font-weight: 800;
}

.data-store-step-grid select,
.data-store-citizen-config select {
  min-block-size: 48px;
  inline-size: 100%;
  border: 1px solid var(--store-border-strong);
  border-radius: 13px;
  background: var(--store-surface);
  color: var(--store-ink);
  padding: .65rem .8rem;
  font: inherit;
}

.data-store-step-grid select:disabled,
.data-store-citizen-config select:disabled {
  background: var(--store-surface-soft);
  color: #7a8797;
}

.data-store-eligibility {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  margin: 1.2rem 0;
}

.data-store-eligibility > p {
  grid-column: 1 / -1;
  margin: 0;
  padding: .9rem 1rem;
  border-radius: 14px;
  background: var(--store-surface-soft);
  color: var(--store-muted);
}

.data-store-eligibility > div {
  display: grid;
  gap: .2rem;
  padding: 1rem;
  border: 1px solid var(--store-border);
  border-radius: 16px;
  background: var(--store-surface-soft);
}

.data-store-eligibility > div[data-ok="true"] {
  border-color: #99cfb5;
  background: #effaf4;
}

.data-store-eligibility > div[data-ok="false"] {
  border-color: #e4afa6;
  background: #fff5f3;
}

.data-store-eligibility strong {
  font-size: 1.4rem;
}

.data-store-eligibility span {
  color: var(--store-muted);
  font-size: .84rem;
}

.data-store-package-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-block-start: 1.5rem;
}

.data-store-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-block-start: 1rem;
}

.data-product-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .8rem;
  min-block-size: 150px;
  padding: 1rem;
  border: 1px solid var(--store-border);
  border-radius: 18px;
  background: var(--store-surface);
  color: var(--store-ink);
  cursor: pointer;
  transition:
    transform var(--poya-motion, 240ms),
    box-shadow var(--poya-motion, 240ms),
    border-color var(--poya-motion, 240ms),
    background var(--poya-motion, 240ms);
}

.data-product-card:hover {
  transform: translateY(-3px);
  border-color: #9ab8cf;
  box-shadow: 0 12px 28px rgba(15, 76, 129, .1);
}

.data-product-card:focus-within {
  border-color: var(--store-primary);
  box-shadow: var(--poya-focus, 0 0 0 3px rgba(23, 105, 170, .24));
}

.data-product-card:has(input:checked) {
  border-color: #2f8f7f;
  background: #f0fbf7;
}

.data-product-card input {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: 1rem;
  inline-size: 20px;
  block-size: 20px;
}

.data-product-number {
  display: grid;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  margin-block-start: 2rem;
  border-radius: 11px;
  background: #ecf2ff;
  color: #284f8d;
  font-weight: 900;
}

.data-product-select { display: contents; }

.data-product-copy,
.data-product-card-extra {
  display: grid;
  gap: .35rem;
  padding-inline-start: 1.7rem;
}

.data-product-card-extra {
  grid-column: 2;
}

.data-product-card small {
  color: var(--store-muted);
  line-height: 1.75;
}

.data-product-card em {
  color: #1d776c;
  font-style: normal;
  font-size: .76rem;
  font-weight: 800;
}

.data-store-price-box {
  position: sticky;
  z-index: 5;
  inset-block-end: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin-block-start: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 18px;
  background: #102f35;
  color: #fff;
  box-shadow: 0 18px 38px rgba(7, 31, 36, .25);
}

.data-store-price-box > div:first-child {
  display: grid;
  gap: .25rem;
}

.data-store-price-box strong {
  font-size: 1.65rem;
}

.data-store-price-box small {
  color: #d5e9e4;
  line-height: 1.7;
}

.data-store-price-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.data-store-price-box button,
.data-store-primary-action {
  min-block-size: 48px;
  border: 0;
  border-radius: 13px;
  background: #ffb43f;
  color: #1e2a27;
  padding: .85rem 1.25rem;
  font: inherit;
  font-weight: 900;
}

.data-store-price-box button:disabled,
.data-store-primary-action:disabled {
  background: #cbd4d2;
  color: #54615e;
  opacity: 1;
}

.data-store-server-preview {
  grid-column: 1 / -1;
  max-inline-size: 100%;
  margin: .25rem 0 0;
  padding: .8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, .09);
  color: #f5fbf9;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.8;
}

.data-store-citizen-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.data-store-citizen-grid article {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: .5rem;
  padding: 1.25rem;
  border: 1px solid var(--store-border);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--store-surface), var(--store-surface-soft));
}

.data-store-citizen-grid article.is-unavailable {
  opacity: .56;
  filter: grayscale(.18);
}
.data-store-citizen-grid article.is-unavailable button { cursor: not-allowed; }

.data-store-citizen-grid h3 {
  margin: 0;
}

.data-store-citizen-grid p {
  margin: 0;
  color: var(--store-muted);
  line-height: 1.8;
}

.data-store-citizen-grid button {
  inline-size: 100%;
}

.data-store-citizen-config {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--store-border);
  border-radius: 18px;
  background: var(--store-surface-soft);
}

.data-store-citizen-config fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.data-store-citizen-config legend {
  margin-block-end: .6rem;
  font-weight: 800;
}

.data-store-citizen-config fieldset > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .55rem;
}

.data-store-citizen-config fieldset label {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem;
  border: 1px solid var(--store-border);
  border-radius: 12px;
  background: var(--store-surface);
}

.data-store-comparison-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  grid-column: 1 / -1;
  padding: 1rem;
  border: 1px solid var(--store-border);
  border-radius: 16px;
  background: var(--store-surface);
}
.data-store-comparison-intro {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--store-muted);
  text-align: center;
  font-weight: 700;
}

.data-store-loading,
.data-store-error {
  max-width: 760px;
  margin: 3rem auto;
  padding: 2rem;
  border: 1px solid var(--store-border);
  border-radius: 20px;
  background: var(--store-surface);
  color: var(--store-ink);
  text-align: center;
}

.data-store-loading span {
  display: inline-block;
  inline-size: 30px;
  block-size: 30px;
  border: 3px solid #d7e7e2;
  border-block-start-color: #2f8f7f;
  border-radius: 50%;
  animation: dataStoreSpin .8s linear infinite;
}

@keyframes dataStoreSpin {
  to { transform: rotate(360deg); }
}

/* Checkout */
.data-store-checkout-hero {
  grid-template-columns: 1fr;
  min-block-size: 170px;
}

.data-store-checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 1rem;
}

.data-store-checkout-card {
  margin: 0 0 1rem;
}

.data-store-checkout-alert {
  margin-block-end: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--store-border);
  border-inline-start-width: 5px;
  border-radius: 16px;
  background: var(--store-surface);
}

.data-store-checkout-alert[data-type="error"] {
  border-inline-start-color: var(--store-danger);
  background: #fff5f3;
}

.data-store-checkout-alert[data-type="warning"] {
  border-inline-start-color: var(--store-warning);
  background: #fff9e8;
}

.data-store-checkout-alert[data-type="success"] {
  border-inline-start-color: var(--store-success);
  background: #effaf4;
}

.data-store-checkout-alert p {
  margin: .35rem 0 0;
}

.data-store-order-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.data-store-order-summary > div {
  padding: .8rem;
  border: 1px solid var(--store-border);
  border-radius: 12px;
  background: var(--store-surface-soft);
}

.data-store-order-summary dt {
  color: var(--store-muted);
  font-size: .82rem;
}

.data-store-order-summary dd {
  margin: .2rem 0 0;
  font-weight: 800;
}

.data-store-checkout-products {
  display: grid;
  gap: .65rem;
  margin: .75rem 0;
  padding: 0;
  list-style: none;
}

.data-store-checkout-products li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .7rem;
  padding: .8rem;
  border: 1px solid var(--store-border);
  border-radius: 13px;
}

.data-store-checkout-products li > span {
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  border-radius: 10px;
  background: #ecf2ff;
  color: #284f8d;
  font-weight: 900;
}

.data-store-checkout-products li > div {
  display: grid;
  gap: .2rem;
}

.data-store-checkout-products small,
.data-store-checkout-products em {
  color: var(--store-muted);
  font-style: normal;
  line-height: 1.65;
}

.data-store-checkout-quote {
  display: grid;
  gap: .35rem;
  margin: 1.25rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--store-border);
  border-radius: 16px;
  background: var(--store-surface-soft);
}

.data-store-checkout-quote span,
.data-store-checkout-quote small,
.data-store-server-price {
  color: var(--store-muted);
}

.data-store-checkout-quote strong {
  font-size: 1.35rem;
}

.data-store-server-price {
  line-height: 1.9;
}

.data-store-payment-state {
  display: grid;
  gap: .5rem;
  margin-block-end: 1rem;
  padding: 1rem;
  border: 1px solid var(--store-border);
  border-radius: 14px;
  background: var(--store-surface-soft);
}

.data-store-payment-state p {
  margin: 0;
  color: var(--store-muted);
  line-height: 1.8;
}

.data-store-payment-state button,
.data-store-primary-action {
  inline-size: 100%;
  margin-block-start: .55rem;
}

.data-store-history-heading,
.purchase-history-head,
.purchase-history-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  flex-wrap: wrap;
}

.data-store-history-heading {
  justify-content: center;
  text-align: center;
}

.data-store-history-heading p {
  margin: .35rem 0 0;
  color: var(--store-muted);
}

.purchase-history-loading,
.checkout-loading-placeholder,
.empty-state {
  padding: 1.2rem;
  border: 1px dashed var(--store-border-strong);
  border-radius: 14px;
  background: var(--store-surface-soft);
  text-align: center;
}

.checkout-loading-placeholder,
.empty-state {
  display: grid;
  gap: .45rem;
}

.purchase-history-card {
  display: grid;
  gap: .7rem;
  margin-block-start: .75rem;
  padding: 1rem;
  border: 1px solid var(--store-border);
  border-radius: 15px;
  background: var(--store-surface-soft);
}

.purchase-history-head small {
  display: block;
  margin-block-start: .25rem;
  color: var(--store-muted);
}

.purchase-history-head > span {
  padding: .3rem .65rem;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1e5794;
  font-size: .8rem;
  font-weight: 800;
}

.purchase-history-meta {
  color: var(--store-muted);
  font-size: .86rem;
}

.purchase-history-packages {
  margin: 0;
  color: var(--store-muted);
  line-height: 1.8;
  font-size: .86rem;
}

/* Dark theme parity. The regular light theme is the approved moonlight presentation. */
.theme-dark .data-store-hero,
.theme-dark .data-store-checkout-hero {
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, .06), transparent 34%),
    linear-gradient(135deg, #17263a, #211f3c 50%, #132e2a);
}

.theme-dark .data-store-hero p,
.theme-dark .data-store-checkout-hero p {
  color: #c7d4e2;
}

.theme-dark .data-store-state-card,
.theme-dark .data-store-builder,
.theme-dark .data-store-citizen-products,
.theme-dark .data-store-checkout-card,
.theme-dark .data-product-card,
.theme-dark .data-store-citizen-grid article,
.theme-dark .data-store-citizen-config,
.theme-dark .data-store-loading,
.theme-dark .data-store-error,
.theme-dark .data-store-checkout-alert {
  background: var(--store-surface);
  color: var(--store-ink);
}

.theme-dark .data-store-state-card[data-stale="true"],
.theme-dark .data-store-checkout-alert[data-type="warning"] {
  background: #352d18;
  color: #ffe7a3;
}

.theme-dark .data-store-eligibility > div[data-ok="true"],
.theme-dark .data-product-card:has(input:checked),
.theme-dark .data-store-checkout-alert[data-type="success"] {
  background: #173127;
  color: #d7f4e5;
}

.theme-dark .data-store-eligibility > div[data-ok="false"],
.theme-dark .data-store-checkout-alert[data-type="error"] {
  background: #3a201f;
  color: #ffd4cf;
}

.theme-dark .data-store-price-box {
  background: #091e23;
}

@media (max-width: 980px) {
  .data-store-step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-store-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-store-citizen-grid {
    grid-template-columns: 1fr;
  }

  .data-store-checkout-grid {
    grid-template-columns: 1fr;
  }
}

.data-store-checkout-page .form-header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.data-store-checkout-page .form-header-logo {
  grid-column: 2;
  justify-self: center;
}

.data-store-checkout-page .back-link {
  grid-column: 1;
  justify-self: start;
}

.data-store-checkout-page .header-nav-group {
  grid-column: 3;
}

@media (max-width: 720px) {
  .data-store-main,
  .data-store-checkout-shell {
    width: min(100% - 1rem, 1180px);
  }

  .data-store-page .form-header-inner {
    align-items: stretch;
  }

  .data-store-page .poya-page-backlinks {
    inline-size: 100%;
  }

  .data-store-page .header-nav-group {
    inline-size: 100%;
  }

  .data-store-step-grid,
  .data-store-products,
  .data-store-eligibility,
  .data-store-order-summary,
  .data-store-comparison-fields {
    grid-template-columns: 1fr;
  }

  .dashboard-section-heading,
  .data-store-package-head,
  .data-store-history-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .data-store-state-card {
    grid-template-columns: 1fr;
  }

  .data-store-state-card button {
    inline-size: 100%;
  }

  .data-store-price-box {
    position: static;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .data-store-price-actions {
    flex-direction: column;
  }

  .data-store-price-box button {
    inline-size: 100%;
  }
}

@media (max-width: 420px) {
  .data-store-hero,
  .data-store-checkout-hero,
  .data-store-builder,
  .data-store-citizen-products,
  .data-store-citizen-purchase,
  .data-store-checkout-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .data-product-card {
    min-block-size: 0;
  }

  .data-store-price-box strong {
    font-size: 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .data-product-card,
  .data-store-loading span {
    animation: none !important;
    transition: none !important;
  }

  .data-product-card:hover {
    transform: none;
  }
}

.data-product-catalog-link { display:inline-flex; align-items:center; justify-content:center; margin-block-start:.55rem; min-height:2.25rem; padding:.35rem .7rem; border:1px solid var(--store-border); border-radius:.65rem; color:var(--store-primary); font-size:.78rem; font-weight:900; text-decoration:none; }
.data-product-catalog-link:hover,.data-product-catalog-link:focus-visible { border-color:var(--store-primary); text-decoration:underline; }

.data-product-output-catalog {
  margin-block-start: .45rem;
  padding-block-start: .45rem;
  border-block-start: 1px solid var(--store-border);
  color: var(--store-muted);
  font-size: .78rem;
  line-height: 1.75;
}
.data-product-output-catalog summary {
  inline-size: fit-content;
  color: var(--store-primary);
  cursor: pointer;
  font-weight: 900;
}
.data-product-output-catalog div,
.data-product-output-catalog p { margin: .35rem 0 0; }
.data-product-output-catalog strong { color: var(--store-ink); }

.data-citizen-formats {
  color: #1d776c;
  font-style: normal;
  font-size: .76rem;
  font-weight: 800;
}

/* Citizen offer matrix — pricing v6 */
.data-citizen-offer-summary {
  display: block;
  margin-top: .4rem;
  font-size: .84rem;
  font-weight: 700;
  color: var(--poya-muted, #52606d);
}
.data-store-citizen-offer-field {
  display: grid;
  gap: .35rem;
  margin-top: .75rem;
}
.data-store-citizen-offer-field select {
  width: 100%;
}
.data-store-selection-help {
  margin: .35rem 0 .75rem;
  font-size: .82rem;
  line-height: 1.8;
  color: var(--poya-muted, #52606d);
}

.data-store-citizen-offer-details {
  display: grid;
  gap: .3rem;
  margin: 0 0 .85rem;
  padding: .75rem .85rem;
  border: 1px solid var(--store-border);
  border-radius: .75rem;
  background: color-mix(in srgb, var(--store-primary) 5%, transparent);
  color: var(--store-muted);
  font-size: .8rem;
  line-height: 1.75;
}
.data-store-citizen-offer-details > strong,
.data-store-citizen-offer-details span {
  color: var(--store-ink);
  font-weight: 900;
}
.data-store-citizen-offer-details:empty { display: none; }
