/* M2 ECO — Agzakhana Storefront (WebView app shell) */
:root {
  --agz-navy: #03214C;
  --agz-deep: #00163B;
  --agz-gold: #FCBD1A;
  --agz-teal: #00B8BC;
  --agz-ink: #081526;
  --agz-bg: #f5f7fb;
  --agz-card: #ffffff;
  --agz-muted: #6b7a86;
  --agz-border: #e6ecef;
  --agz-soft: #eef2f8;
  --agz-ok: #22a75d;
  --agz-warn: #b45309;
  --agz-danger: #c62828;
  --agz-medicine: #2563eb;
  --agz-lab: #22a75d;
  --agz-nursing: #7c3aed;
  --agz-radius: 16px;
  --agz-radius-sm: 12px;
  --agz-shadow: 0 2px 12px rgba(3, 33, 76, 0.08);
  --agz-shadow-lg: 0 12px 32px rgba(3, 33, 76, 0.14);
  --agz-safe-top: env(safe-area-inset-top, 0px);
  --agz-safe-bottom: env(safe-area-inset-bottom, 0px);
  --agz-tabbar-h: 64px;
  --agz-font: "Albert Sans", Cairo, Tajawal, system-ui, sans-serif;
}

html.m2agz-shell,
body.m2agz-shell {
  margin: 0;
  background: var(--agz-bg);
  color: var(--agz-ink);
  font-family: var(--agz-font);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 100%;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

body.m2agz-shell.m2agz-modal-open { overflow: hidden; }

.m2agz-app {
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  box-sizing: border-box;
  padding-bottom: calc(var(--agz-tabbar-h) + var(--agz-safe-bottom) + 16px);
  position: relative;
}

.m2agz-app--guest,
.m2agz-app--detail {
  padding-bottom: calc(16px + var(--agz-safe-bottom));
}

.m2agz-i {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[dir="rtl"] .m2agz-i--flip { transform: scaleX(-1); }

.m2agz-hero {
  background: linear-gradient(155deg, var(--agz-deep) 0%, var(--agz-navy) 55%, #04356e 100%);
  color: #fff;
  padding: calc(18px + var(--agz-safe-top)) 18px 28px;
  border-radius: 0 0 24px 24px;
  position: relative;
  overflow: hidden;
}

.m2agz-hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(252, 189, 26, 0.12);
  top: -50px;
  inset-inline-end: -40px;
  pointer-events: none;
}

.m2agz-hero__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.m2agz-hero__brand img { max-height: 42px; width: auto; display: block; }

.m2agz-hero__user { display: flex; align-items: center; gap: 12px; min-width: 0; }

.m2agz-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(252, 189, 26, 0.18);
  color: var(--agz-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  flex: 0 0 auto;
}

.m2agz-hero__meta { min-width: 0; }
.m2agz-hero__meta small { display: block; color: rgba(255,255,255,0.65); font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.m2agz-hero__meta strong { display: block; font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.m2agz-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.m2agz-appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-sizing: border-box;
  width: calc(100% - 28px);
  max-width: 532px;
  margin: calc(8px + var(--agz-safe-top)) auto 0;
  padding: 10px 12px;
  background: linear-gradient(145deg, var(--agz-deep), var(--agz-navy));
  color: #fff;
  border-radius: 16px;
  box-shadow: var(--agz-shadow);
}

.m2agz-appbar h1 { margin: 0; font-size: 17px; font-weight: 800; flex: 1; text-align: center; }
.m2agz-appbar a { color: #fff; text-decoration: none; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

.m2agz-body { padding: 16px 14px 8px; }

.m2agz-section { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 10px; }
.m2agz-section h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--agz-navy); }
.m2agz-section a { color: var(--agz-teal); font-size: 13px; font-weight: 700; text-decoration: none; }

.m2agz-card {
  background: var(--agz-card);
  border-radius: var(--agz-radius);
  box-shadow: var(--agz-shadow);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.m2agz-card--link { display: block; text-decoration: none; color: inherit; }

.m2agz-card__stripe { position: absolute; top: 0; inset-inline-start: 0; width: 4px; height: 100%; background: var(--agz-teal); }
.m2agz-card__stripe--medicine { background: var(--agz-medicine); }
.m2agz-card__stripe--lab { background: var(--agz-lab); }
.m2agz-card__stripe--nursing { background: var(--agz-nursing); }

.m2agz-card--service {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  cursor: pointer;
  border: 0;
  width: 100%;
  text-align: inherit;
  font: inherit;
}

.m2agz-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #fff;
}

.m2agz-card__icon--medicine { background: var(--agz-medicine); }
.m2agz-card__icon--lab { background: var(--agz-lab); }
.m2agz-card__icon--nursing { background: var(--agz-nursing); }

.m2agz-card__text h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: var(--agz-navy); }
.m2agz-card__text p { margin: 0; font-size: 13px; color: var(--agz-muted); line-height: 1.4; }

.m2agz-membership {
  background: linear-gradient(135deg, var(--agz-navy), #04356e);
  color: #fff;
  border-radius: var(--agz-radius);
  padding: 16px;
  margin-bottom: 14px;
}

.m2agz-membership__row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.m2agz-membership__no { font-size: 13px; opacity: 0.8; margin-bottom: 4px; }
.m2agz-membership__type { font-size: 15px; font-weight: 800; }
.m2agz-membership__saving { text-align: end; }
.m2agz-membership__saving small { display: block; font-size: 11px; opacity: 0.75; }
.m2agz-membership__saving strong { font-size: 18px; color: var(--agz-gold); }

.m2agz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--agz-radius-sm);
  border: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.m2agz-btn.block { width: 100%; }
.m2agz-btn--gold { background: var(--agz-gold); color: var(--agz-navy); }
.m2agz-btn--gold:active { background: #e0a40f; }
.m2agz-btn--teal { background: var(--agz-teal); color: #fff; }
.m2agz-btn--ghost { background: transparent; color: var(--agz-navy); border: 2px solid var(--agz-border); }
.m2agz-btn--danger { background: #fdecea; color: var(--agz-danger); }
.m2agz-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.m2agz-field { margin-bottom: 14px; }
.m2agz-field label { display: block; font-size: 13px; font-weight: 700; color: var(--agz-navy); margin-bottom: 6px; }

.m2agz-field input,
.m2agz-field select,
.m2agz-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--agz-border);
  border-radius: var(--agz-radius-sm);
  font-family: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--agz-ink);
}

.m2agz-field textarea { min-height: 88px; resize: vertical; }

.m2agz-field input:focus,
.m2agz-field select:focus,
.m2agz-field textarea:focus {
  outline: none;
  border-color: var(--agz-teal);
  box-shadow: 0 0 0 3px rgba(0, 184, 188, 0.15);
}

.m2agz-radio-group { display: grid; gap: 10px; }

.m2agz-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--agz-border);
  border-radius: var(--agz-radius-sm);
  background: #fff;
  cursor: pointer;
  min-height: 48px;
}

.m2agz-radio input { width: auto; min-height: auto; margin: 0; }
.m2agz-radio.is-selected { border-color: var(--agz-teal); background: rgba(0, 184, 188, 0.06); }

.m2agz-error {
  background: #fdecea;
  color: var(--agz-danger);
  padding: 12px 14px;
  border-radius: var(--agz-radius-sm);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
}

.m2agz-landing {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--agz-deep) 0%, var(--agz-navy) 45%, var(--agz-bg) 45%);
}

.m2agz-landing__hero {
  padding: calc(40px + var(--agz-safe-top)) 24px 48px;
  text-align: center;
  color: #fff;
}

.m2agz-landing__hero img { max-width: 200px; height: auto; margin: 0 auto 24px; display: block; }
.m2agz-landing__hero h1 { margin: 0 0 10px; font-size: 26px; font-weight: 800; }
.m2agz-landing__hero p { margin: 0; font-size: 15px; line-height: 1.6; opacity: 0.88; max-width: 320px; margin-inline: auto; }

.m2agz-landing__panel {
  flex: 1;
  background: var(--agz-bg);
  border-radius: 28px 28px 0 0;
  padding: 28px 20px calc(24px + var(--agz-safe-bottom));
  margin-top: -20px;
}

.m2agz-landing__features { display: grid; gap: 12px; margin-bottom: 24px; width: 100%; }

.m2agz-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  padding: 14px;
  border-radius: var(--agz-radius-sm);
  box-shadow: var(--agz-shadow);
}

.m2agz-feature__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--agz-gold); flex: 0 0 auto; }
.m2agz-landing__actions {
  display: grid;
  gap: 12px;
  width: 100%;
}

.m2agz-login {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--agz-safe-top)) 20px calc(24px + var(--agz-safe-bottom));
  background: linear-gradient(180deg, var(--agz-deep), var(--agz-navy) 40%, var(--agz-bg) 40%);
}

.m2agz-login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: var(--agz-radius);
  padding: 28px 22px;
  box-shadow: var(--agz-shadow-lg);
}

.m2agz-login-card img { max-height: 48px; display: block; margin: 0 auto 16px; }
.m2agz-login-card h1 { margin: 0 0 6px; text-align: center; font-size: 22px; font-weight: 800; color: var(--agz-navy); }
.m2agz-login-card .sub { text-align: center; color: var(--agz-muted); font-size: 14px; margin: 0 0 20px; }

.m2agz-search { position: relative; margin-bottom: 14px; }

.m2agz-search input {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 44px 12px 14px;
  border: 1px solid var(--agz-border);
  border-radius: var(--agz-radius-sm);
  font-family: inherit;
  font-size: 15px;
  background: #fff;
}

.m2agz-search__icon {
  position: absolute;
  inset-inline-end: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--agz-muted);
  pointer-events: none;
}

.m2agz-results { display: grid; gap: 8px; }

.m2agz-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border-radius: var(--agz-radius-sm);
  box-shadow: var(--agz-shadow);
  border: 0;
  width: 100%;
  text-align: inherit;
  font: inherit;
  cursor: pointer;
}

.m2agz-result__name { font-weight: 700; font-size: 14px; color: var(--agz-navy); }
.m2agz-result__price { font-size: 13px; color: var(--agz-teal); font-weight: 700; white-space: nowrap; }

.m2agz-qty { display: flex; align-items: center; gap: 10px; margin-top: 12px; }

.m2agz-qty button {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--agz-border);
  background: #fff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  color: var(--agz-navy);
}

.m2agz-qty input {
  width: 56px;
  text-align: center;
  min-height: 44px;
  border: 1px solid var(--agz-border);
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
}

.m2agz-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--agz-border);
}

.m2agz-line:last-child { border-bottom: 0; }
.m2agz-line__body { flex: 1; min-width: 0; }
.m2agz-line__name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.m2agz-line__meta { font-size: 12px; color: var(--agz-muted); }
.m2agz-line__price { font-weight: 800; color: var(--agz-navy); white-space: nowrap; }

.m2agz-totals { background: var(--agz-soft); border-radius: var(--agz-radius-sm); padding: 14px; margin-top: 14px; }

.m2agz-totals__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  margin-bottom: 8px;
}

.m2agz-totals__row:last-child {
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--agz-navy);
  padding-top: 8px;
  border-top: 1px dashed var(--agz-border);
}

.m2agz-totals__row em { font-style: normal; color: var(--agz-ok); }

.m2agz-dock {
  position: fixed;
  bottom: calc(var(--agz-tabbar-h) + var(--agz-safe-bottom));
  inset-inline: 0;
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--agz-border);
  z-index: 90;
}

.m2agz-app--detail .m2agz-dock,
.m2agz-app--guest .m2agz-dock { bottom: var(--agz-safe-bottom); }

.m2agz-status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.m2agz-status--new { background: #e3f2fd; color: #1565c0; }
.m2agz-status--processing { background: #fff3e0; color: #e65100; }
.m2agz-status--completed { background: #e8f5e9; color: #2e7d32; }
.m2agz-status--cancelled { background: #fce4ec; color: #c62828; }

.m2agz-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.m2agz-filter {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--agz-border);
  background: #fff;
  color: var(--agz-muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.m2agz-filter.is-active { background: var(--agz-navy); color: #fff; border-color: var(--agz-navy); }

.m2agz-timeline { position: relative; padding-inline-start: 24px; margin-top: 16px; }

.m2agz-timeline::before {
  content: "";
  position: absolute;
  inset-inline-start: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--agz-border);
}

.m2agz-timeline__item { position: relative; padding-bottom: 16px; }

.m2agz-timeline__item::before {
  content: "";
  position: absolute;
  inset-inline-start: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--agz-teal);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--agz-teal);
}

.m2agz-timeline__item.is-done::before { background: var(--agz-ok); box-shadow: 0 0 0 2px var(--agz-ok); }
.m2agz-timeline__title { font-weight: 800; font-size: 14px; margin-bottom: 2px; }
.m2agz-timeline__date { font-size: 12px; color: var(--agz-muted); }

.m2agz-tabbar {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 100;
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--agz-tabbar-h) + var(--agz-safe-bottom));
  padding-bottom: var(--agz-safe-bottom);
  background: #fff;
  border-top: 1px solid var(--agz-border);
  box-shadow: 0 -8px 24px rgba(3, 33, 76, 0.06);
}

.m2agz-desktop-brand { display: none; }

.m2agz-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--agz-muted);
  font-size: 10px;
  font-weight: 700;
  position: relative;
  min-height: var(--agz-tabbar-h);
}

.m2agz-tab__icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}

.m2agz-tab.is-active { color: var(--agz-navy); }
.m2agz-tab.is-active .m2agz-tab__icon-wrap { background: var(--agz-navy); color: var(--agz-gold); }
.m2agz-tab.is-hub .m2agz-tab__icon-wrap { width: 40px; height: 36px; border-radius: 12px; }
.m2agz-tab.is-hub.is-active .m2agz-tab__icon-wrap { background: var(--agz-gold); color: var(--agz-navy); }

.m2agz-tab__badge[hidden] { display: none; }

.m2agz-tab__badge {
  position: absolute;
  top: -3px;
  inset-inline-end: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--agz-danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.m2agz-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(3, 33, 76, 0.45);
  padding: 16px;
  padding-bottom: calc(16px + var(--agz-safe-bottom));
}

.m2agz-modal.is-open { display: flex; }

.m2agz-modal__sheet {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  animation: m2agz-slide-up 0.25s ease;
}

@keyframes m2agz-slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.m2agz-modal__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(34, 167, 93, 0.12);
  color: var(--agz-ok);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.m2agz-modal__sheet h3 { margin: 0 0 8px; font-size: 18px; font-weight: 800; color: var(--agz-navy); }
.m2agz-modal__sheet p { margin: 0 0 18px; font-size: 14px; color: var(--agz-muted); line-height: 1.5; }

.m2agz-empty { text-align: center; padding: 40px 20px; color: var(--agz-muted); }
.m2agz-empty__icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }

.m2agz-support-card { text-align: center; padding: 24px 16px; }
.m2agz-support-card p { color: var(--agz-muted); font-size: 14px; line-height: 1.6; margin: 0 0 18px; }
.m2agz-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.m2agz-order-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

.m2agz-receipt { background: #fff; border-radius: var(--agz-radius); padding: 20px; box-shadow: var(--agz-shadow); }
.m2agz-receipt__head { text-align: center; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 2px dashed var(--agz-border); }
.m2agz-receipt__head img { max-height: 36px; margin-bottom: 8px; }

.m2agz-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--agz-tabbar-h) + var(--agz-safe-bottom) + 16px);
  transform: translateX(-50%) translateY(20px);
  background: var(--agz-navy);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  z-index: 1300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100% - 32px);
  text-align: center;
  box-shadow: var(--agz-shadow-lg);
}

.m2agz-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }
.m2agz-shell--detail .m2agz-toast { bottom: calc(24px + var(--agz-safe-bottom)); }

.m2agz-profile-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--agz-border);
  font-size: 14px;
}

.m2agz-profile-row:last-child { border-bottom: 0; }
.m2agz-profile-row span { color: var(--agz-muted); }
.m2agz-profile-row strong { color: var(--agz-navy); text-align: end; }
.m2agz-spinner { text-align: center; padding: 20px; color: var(--agz-muted); font-size: 14px; }

.m2agz-services { display: grid; gap: 12px; }
.m2agz-form-grid { display: grid; gap: 0; }
.m2agz-form-grid .m2agz-field--full { grid-column: 1 / -1; }
.m2agz-orders-grid { display: grid; gap: 12px; }

/* ========== Desktop / tablet landscape (≥992px) ==========
   Keep the same Agzakhana identity, but use a wide app chrome
   instead of a phone column. Mobile (≤991) stays unchanged. */
@media (min-width: 992px) {
  html.m2agz-shell,
  body.m2agz-shell {
    background:
      radial-gradient(1200px 500px at 10% -10%, rgba(0, 184, 188, 0.12), transparent 60%),
      radial-gradient(900px 480px at 100% 0%, rgba(252, 189, 26, 0.14), transparent 55%),
      linear-gradient(165deg, #021633 0%, #03214c 42%, #f5f7fb 42%, #eef2f8 100%);
    background-attachment: fixed;
    overscroll-behavior: auto;
  }

  .m2agz-app {
    --agz-shell-max: 1120px;
    max-width: var(--agz-shell-max);
    margin: 28px auto 40px;
    min-height: calc(100dvh - 68px);
    background: var(--agz-card);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(3, 33, 76, 0.18);
    padding-bottom: 28px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .m2agz-app--guest,
  .m2agz-app--detail {
    padding-bottom: 28px;
  }

  /* Top desktop nav (same 5 items, moved from bottom) */
  .m2agz-tabbar {
    order: -1;
    position: sticky;
    top: 0;
    bottom: auto;
    inset-inline: auto;
    width: 100%;
    max-width: none;
    height: 72px;
    padding: 0 18px;
    padding-bottom: 0;
    border-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    background: linear-gradient(145deg, var(--agz-deep), var(--agz-navy));
    border-radius: 0;
    z-index: 80;
    grid-template-columns: auto repeat(5, minmax(0, 1fr));
  }

  .m2agz-tab {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    flex-direction: row;
    gap: 8px;
    min-height: 72px;
  }

  .m2agz-tab.is-active { color: #fff; }
  .m2agz-tab.is-active .m2agz-tab__icon-wrap {
    background: var(--agz-gold);
    color: var(--agz-navy);
  }
  .m2agz-tab.is-hub.is-active .m2agz-tab__icon-wrap {
    background: var(--agz-gold);
    color: var(--agz-navy);
  }
  .m2agz-tab:hover { color: #fff; }

  .m2agz-desktop-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 0 4px;
    margin-inline-end: 8px;
    border-inline-end: 1px solid rgba(255, 255, 255, 0.12);
  }

  .m2agz-desktop-brand img {
    height: 28px;
    width: auto;
    display: block;
  }

  .m2agz-hero {
    border-radius: 0;
    padding: 22px 28px 26px;
  }

  .m2agz-appbar {
    position: static;
    width: auto;
    max-width: none;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 14px 24px;
  }

  .m2agz-body {
    padding: 24px 28px 8px;
    flex: 1;
  }

  .m2agz-services {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .m2agz-services .m2agz-card {
    margin-bottom: 0;
    height: 100%;
    min-height: 110px;
  }

  .m2agz-membership {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
  }

  .m2agz-membership__row {
    width: 100%;
    align-items: center;
  }

  .m2agz-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
  }

  .m2agz-orders-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .m2agz-orders-grid .m2agz-card { margin-bottom: 0; }

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

  .m2agz-dock {
    position: sticky;
    bottom: 0;
    max-width: none;
    inset-inline: auto;
    width: 100%;
    margin: 0;
    border-radius: 0 0 28px 28px;
    box-shadow: 0 -8px 24px rgba(3, 33, 76, 0.06);
  }

  .m2agz-toast {
    bottom: 32px;
  }

  .m2agz-modal {
    align-items: center;
  }

  .m2agz-modal__sheet {
    max-width: 440px;
    border-radius: 20px;
  }

  /* Landing — split panel on desktop */
  .m2agz-landing {
    max-width: 1080px;
    min-height: calc(100dvh - 64px);
    margin: 32px auto;
    flex-direction: row;
    align-items: stretch;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(3, 33, 76, 0.2);
    background: #fff;
  }

  .m2agz-landing__hero {
    flex: 1 1 46%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 40px;
    text-align: start;
    background: linear-gradient(155deg, var(--agz-deep) 0%, var(--agz-navy) 55%, #04356e 100%);
  }

  .m2agz-landing__hero img {
    margin: 0 0 28px;
    max-width: 220px;
  }

  .m2agz-landing__hero h1 { font-size: 34px; }
  .m2agz-landing__hero p {
    max-width: 360px;
    margin-inline: 0;
    font-size: 16px;
  }

  .m2agz-landing__panel {
    flex: 1 1 54%;
    margin-top: 0;
    border-radius: 0;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--agz-bg);
  }

  .m2agz-landing__features,
  .m2agz-landing__actions {
    width: 100%;
    max-width: 440px;
    margin-inline: auto;
  }

  .m2agz-landing__features { margin-bottom: 28px; }

  .m2agz-landing__actions {
    grid-template-columns: 1fr;
  }

  /* Login — wider stage, same card */
  .m2agz-login {
    min-height: 100dvh;
    padding: 40px 24px;
    background:
      radial-gradient(900px 420px at 15% 0%, rgba(0, 184, 188, 0.16), transparent 55%),
      linear-gradient(165deg, var(--agz-deep) 0%, var(--agz-navy) 38%, var(--agz-bg) 38%);
  }

  .m2agz-login-card {
    max-width: 440px;
    padding: 36px 32px;
  }

  .m2agz-card--service:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(3, 33, 76, 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .m2agz-section h2 { font-size: 18px; }

  /* Support / account content width comfort */
  .m2agz-app--guest .m2agz-body,
  .m2agz-app--detail .m2agz-body {
    max-width: 920px;
    width: 100%;
    margin-inline: auto;
  }
}

@media (min-width: 1280px) {
  .m2agz-app {
    --agz-shell-max: 1200px;
  }

  .m2agz-landing {
    max-width: 1180px;
  }
}
