:root {
  color-scheme: light;
  --ink: #141923;
  --muted: #637083;
  --line: #dbe3ec;
  --paper: #ffffff;
  --page: #f3f6fa;
  --green: #168a62;
  --green-dark: #0f684b;
  --blue: #2167d5;
  --orange: #ef7b37;
  --red: #d94b38;
  --soft-green: #e8f7f1;
  --soft-blue: #eef5ff;
  --shadow: 0 18px 46px rgba(24, 42, 65, 0.11);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  flex: 0 0 auto;
}

h1,
h2,
h3,
p,
strong,
span {
  overflow-wrap: anywhere;
}

.app-shell {
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto;
  padding-bottom: 26px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  min-height: 80px;
  padding: 12px 0;
  background: rgba(243, 246, 250, 0.86);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  line-height: 1.15;
}

.brand small {
  margin-top: 2px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tabs {
  justify-self: end;
  display: inline-flex;
  gap: 6px;
  max-width: 100%;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.tab-button:hover,
.tab-button.active {
  background: var(--soft-green);
  color: var(--green-dark);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.buy-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.stock-panel,
.quantity-panel,
.summary-panel,
.tool-panel,
.result-panel,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.stock-panel {
  grid-column: 1 / -1;
  display: grid;
  min-height: 230px;
  align-content: center;
  gap: 14px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(22, 138, 98, 0.1), rgba(33, 103, 213, 0.08)),
    var(--paper);
}

.label {
  margin: 0;
  color: var(--orange);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 8vw, 78px);
  line-height: 0.98;
}

h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.stock-counter {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(22, 138, 98, 0.22);
  border-radius: 8px;
  background: #fff;
}

.stock-counter span {
  color: var(--green-dark);
  font-size: 52px;
  font-weight: 950;
  line-height: 0.9;
}

.stock-counter strong {
  font-size: 18px;
  line-height: 1.2;
}

.stock-note,
.plain-text,
.fineprint,
.result-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.quantity-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.section-title {
  display: grid;
  gap: 6px;
}

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

.tier-button {
  display: grid;
  gap: 7px;
  min-height: 102px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.tier-button:hover,
.tier-button.active {
  border-color: rgba(22, 138, 98, 0.55);
  background: var(--soft-green);
}

.tier-button strong {
  font-size: 22px;
}

.tier-button span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.custom-quantity,
.stack-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: rgba(33, 103, 213, 0.62);
  box-shadow: 0 0 0 4px rgba(33, 103, 213, 0.12);
}

.summary-panel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
  padding: 20px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.summary-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-row strong {
  font-size: 24px;
}

.summary-row:first-of-type {
  border-top: 0;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 950;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
}

.primary-button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  border-color: #9fb7ac;
  background: #9fb7ac;
  transform: none;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: rgba(33, 103, 213, 0.45);
  background: var(--soft-blue);
  transform: translateY(-1px);
}

.full {
  width: 100%;
}

.fineprint {
  font-size: 12px;
}

.utility-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
  padding-top: 20px;
}

.tool-panel,
.result-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.wide-panel {
  max-width: 780px;
  margin-top: 20px;
}

.stack-form {
  display: grid;
  gap: 13px;
}

.result-panel h2 {
  margin: 0;
}

.delivery-box,
.result-delivery {
  display: grid;
  gap: 10px;
}

.credential-row,
.link-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.credential-row code {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--soft-blue);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.link-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.link-card strong {
  font-size: 16px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.instruction-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.instruction-list li::marker {
  color: var(--orange);
  font-weight: 950;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
}

.footer-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  font-weight: 950;
}

.checkout-modal {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: 0;
  background: transparent;
}

.checkout-modal::backdrop {
  background: rgba(20, 25, 35, 0.58);
  backdrop-filter: blur(5px);
}

.modal-card {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.payment-summary {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(22, 138, 98, 0.24);
  border-radius: 8px;
  background: var(--soft-green);
}

.payment-summary span,
.payment-summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.payment-summary strong {
  color: var(--green-dark);
  font-size: 34px;
  line-height: 1;
}

.bharatpe-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(22, 138, 98, 0.24);
  border-radius: 8px;
  background: #fbfffd;
}

.bharatpe-box p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.upi-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.upi-card img {
  display: block;
  width: min(100%, 280px);
  max-height: 360px;
  margin: 0 auto;
  object-fit: contain;
}

.upi-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.upi-card strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}

.status-box {
  padding: 12px 14px;
  border: 1px solid #b9d7ff;
  border-radius: 8px;
  background: var(--soft-blue);
  color: #174a83;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.45;
}

.status-box.success {
  border-color: rgba(22, 138, 98, 0.3);
  background: var(--soft-green);
  color: var(--green-dark);
}

.status-box.error {
  border-color: rgba(217, 75, 56, 0.35);
  background: #fff1ed;
  color: #973118;
}

@media (max-width: 900px) {
  .topbar,
  .buy-grid,
  .utility-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    justify-self: stretch;
  }

  .tab-button {
    flex: 1 0 auto;
  }

  .summary-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1040px);
  }

  .stock-panel,
  .quantity-panel,
  .summary-panel,
  .tool-panel,
  .result-panel {
    padding: 18px;
  }

  .tier-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 38px;
  }

  .stock-counter {
    width: 100%;
    justify-content: space-between;
  }

  .stock-counter span {
    font-size: 44px;
  }

  .primary-button,
  .secondary-button,
  .contact-actions a {
    width: 100%;
  }
}
