@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --brand-primary: #0B3D91;
  --brand-primary-dark: #072C6B;
  --brand-accent: #F5C518;
  --brand-surface: #F4F7FB;
  --brand-font: 'DM Sans', 'Segoe UI', sans-serif;
  --ink: #152033;
  --muted: #667085;
  --line: #E4EAF2;
  --danger: #D92D20;
  --success: #039855;
  --card: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(11, 61, 145, 0.08);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--brand-font);
  color: var(--ink);
  background: #fff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

.container { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.container-sm { width: min(920px, calc(100% - 2rem)); margin: 0 auto; }

/* Utility */
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--brand-primary); }
.fw-700 { font-weight: 700; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 0; border-radius: 999px; padding: .75rem 1.15rem;
  background: var(--brand-primary); color: #fff; font-weight: 600; cursor: pointer;
  min-height: 44px; text-decoration: none;
}
.btn:hover { background: var(--brand-primary-dark); color: #fff; text-decoration: none; }
.btn-accent { background: var(--brand-accent); color: #1a1a1a; }
.btn-accent:hover { filter: brightness(.96); color: #1a1a1a; }
.btn-outline {
  background: #fff; color: var(--brand-primary);
  border: 1.5px solid var(--brand-primary);
}
.btn-outline:hover { background: #f3f7ff; color: var(--brand-primary); }
.btn-ghost { background: transparent; color: var(--brand-primary); border: 1px solid var(--line); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: .45rem .9rem; font-size: .9rem; }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; }

/* Forms — equal width everywhere */
label { display: block; font-size: .9rem; color: var(--muted); margin: .85rem 0 .35rem; }
.required, .field .required, em.required { color: var(--danger); font-style: normal; }
.form-stack, .auth-form, .card.form-stack { width: 100%; max-width: 100%; box-sizing: border-box; }
.form-stack .field, .auth-form .field { width: 100%; box-sizing: border-box; }
.input, .select, .textarea, input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="url"], input[type="number"], input[type="date"], input[type="file"],
input[type="search"], input[type="datetime-local"], select, textarea,
.form-stack input:not([type="checkbox"]):not([type="radio"]),
.form-stack select, .form-stack textarea,
.auth-form input:not([type="checkbox"]):not([type="radio"]),
.card input:not([type="checkbox"]):not([type="radio"]),
.card select, .card textarea {
  width: 100% !important; max-width: 100%; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 12px;
  padding: .8rem .95rem; background: #fff; color: var(--ink); min-height: 46px;
  display: block;
}
.textarea, textarea { min-height: 110px; resize: vertical; }
.input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(11,61,145,.2); border-color: var(--brand-primary);
}
.input-icon {
  display: flex; align-items: center; gap: .55rem;
  border: 1px solid var(--line); border-radius: 999px; padding: .35rem .85rem .35rem 1rem;
  background: #fff; min-height: 48px;
}
.input-icon input { border: 0; outline: 0; min-height: 0; padding: .4rem 0; background: transparent; }
.search-pill { border-radius: 999px; }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem;
}
.card-soft { background: var(--brand-surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.badge {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: .18rem .65rem; font-size: .75rem; font-weight: 600;
  background: #e8efff; color: var(--brand-primary);
}
.badge-accent { background: #fff4c2; color: #7a5a00; }
.badge-danger { background: #fee4e2; color: var(--danger); }
.badge-success { background: #d1fadf; color: var(--success); }
.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid var(--brand-primary); color: var(--brand-primary);
  border-radius: 999px; padding: .2rem .7rem; font-size: .78rem; font-weight: 600;
}

/* Alerts */
.alert { border-radius: 12px; padding: .85rem 1rem; margin: 0 0 1rem; }
.alert-error { background: #fef3f2; color: var(--danger); border: 1px solid #fecdca; }
.alert-success { background: #ecfdf3; color: var(--success); border: 1px solid #abefc6; }
.alert-warning { background: #fffaeb; color: #b54708; border: 1px solid #fedf89; }

/* Top utility */
.topbar {
  background: var(--brand-primary-dark); color: #fff; font-size: .88rem;
}
.topbar .container { display: flex; justify-content: flex-end; align-items: center; gap: 1rem; min-height: 36px; flex-wrap: wrap; }
.topbar a { color: #fff; opacity: .92; }
.topbar .sep { opacity: .45; }

/* Header */
.site-header {
  background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40;
}
.header-main {
  display: flex; align-items: center; gap: .55rem; padding: .65rem 0;
  flex-wrap: nowrap !important; width: 100%;
}
.brand-lockup {
  display: flex; align-items: center; gap: .45rem; text-decoration: none; color: var(--ink);
  flex: 0 0 auto; max-width: 10.5rem;
}
.brand-lockup:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; background: var(--brand-accent);
  display: grid; place-items: center; font-weight: 800; color: var(--brand-primary-dark);
  overflow: hidden; flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-text {
  font-weight: 800; font-size: .9rem; letter-spacing: .01em; color: var(--brand-primary);
  line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-primary {
  display: flex; flex-wrap: nowrap !important; gap: .4rem .55rem; align-items: center;
  flex: 1 1 auto; min-width: 0; justify-content: center;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.nav-primary::-webkit-scrollbar { display: none; }
.nav-primary a {
  color: var(--ink); font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .01em; text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
.nav-primary a:hover { color: var(--brand-primary); }
.header-actions {
  margin-left: auto; display: flex; align-items: center; gap: .4rem;
  flex-wrap: nowrap !important; flex: 0 0 auto; min-width: 0;
}
.header-actions > a { white-space: nowrap; font-weight: 700; font-size: .82rem; }
.header-user-link {
  max-width: 5.5rem; overflow: hidden; text-overflow: ellipsis;
}
.location-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1.5px solid #e8c96a; border-radius: 999px;
  padding: .2rem .55rem .2rem .2rem;
  background: #fff; font-weight: 600; font-size: .82rem;
  min-height: 36px; box-shadow: 0 1px 0 rgba(232, 201, 106, .25);
  flex: 0 0 auto;
}
.location-pill-ico {
  width: 30px; height: 30px; border-radius: 50%;
  background: #f5c518; color: var(--brand-primary-dark, #0b3d91);
  display: grid; place-items: center; flex-shrink: 0;
}
.location-pill-ico svg { display: block; }
.location-pill select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border: 0; background: transparent; padding: 0 .15rem 0 0;
  min-height: 0; min-width: 4.5rem; max-width: 7rem;
  font: inherit; font-weight: 600; font-size: .82rem; color: #1f2937;
  cursor: pointer; outline: none; box-shadow: none;
}
.location-pill select:focus { outline: none; box-shadow: none; }
.location-pill-chev {
  width: 0; height: 0; margin-left: .1rem; flex-shrink: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid #111;
  opacity: .85;
}
.location-pill .pin { color: #e11d48; }
.cart-btn {
  position: relative; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); display: grid; place-items: center; background: #fff;
  flex: 0 0 auto;
}
.cart-btn .count {
  position: absolute; top: -4px; right: -4px; background: var(--brand-accent);
  color: #111; border-radius: 999px; font-size: .68rem; font-weight: 800;
  min-width: 18px; height: 18px; display: grid; place-items: center;
}

/* Search strip */
.search-strip {
  background: var(--brand-accent); padding: .75rem 0;
}
.search-strip .row {
  display: grid; grid-template-columns: 160px 140px 1fr auto; gap: .55rem; align-items: center;
}
.search-strip select, .search-strip input {
  border: 0; border-radius: 10px; min-height: 44px; padding: .65rem .8rem;
}
.search-strip .btn { border-radius: 10px; background: var(--brand-primary); }

/* Hero marketplace */
.hero-market {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; padding: 1.5rem 0 1rem;
}
.hero-slider {
  position: relative; border-radius: 22px; overflow: hidden; min-height: 320px;
  background: linear-gradient(135deg, #dce8ff, #f7f9fc 55%, #fff4c8);
  border: 1px solid var(--line);
}
.hero-slider .slide-content { padding: 2rem; max-width: 28rem; }
.hero-slider h1 { margin: 0 0 .6rem; font-size: clamp(1.6rem, 3vw, 2.3rem); color: var(--brand-primary-dark); }
.book-widget {
  background: #fff; border-radius: 22px; border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 1.25rem;
}
.book-widget h2 {
  margin: 0 0 1rem; color: var(--brand-primary); font-size: 1.15rem;
  text-transform: uppercase; letter-spacing: .04em;
}
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: .85rem; }
.quick-tile {
  background: var(--brand-primary); color: #fff; border-radius: 14px; padding: .85rem .5rem;
  text-align: center; font-size: .78rem; font-weight: 600; text-decoration: none; min-height: 78px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
}
.quick-tile:hover { background: var(--brand-primary-dark); color: #fff; text-decoration: none; }
.quick-tile .ico { font-size: 1.25rem; }

/* Sections */
.section { padding: 1.75rem 0; }
.section-head {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  margin-bottom: 1rem; flex-wrap: nowrap;
}
.section-head h2 {
  margin: 0; font-size: clamp(.95rem, 3.6vw, 1.25rem); color: var(--brand-primary-dark);
  line-height: 1.25; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.link-more {
  color: #e11d48; font-weight: 700; font-size: .78rem; white-space: nowrap; flex-shrink: 0;
  text-decoration: none;
}

/* Grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem; }
.cat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: .9rem .5rem;
  text-align: center; text-decoration: none; color: var(--ink); min-height: 110px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem;
}
.cat-card:hover { border-color: var(--brand-primary); box-shadow: var(--shadow); text-decoration: none; }
.cat-ico {
  width: 52px; height: 52px; border-radius: 50%; background: #eef3ff;
  display: grid; place-items: center; color: var(--brand-primary); font-weight: 800;
}

/* Test cards */
.test-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1rem;
  display: flex; flex-direction: column; gap: .55rem; min-height: 100%;
}
.test-card h3 { margin: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: .02em; }
.test-card .price { font-size: 1.35rem; font-weight: 800; color: var(--ink); }
.test-card .meta { font-size: .88rem; color: var(--muted); }
.avail { display: flex; flex-wrap: wrap; gap: .55rem; font-size: .82rem; color: var(--success); font-weight: 600; }
.test-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: auto; }
.marketplace-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1.25rem; }
.side-cats {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: .75rem;
  max-height: 70vh; overflow: auto; position: sticky; top: 90px;
}
.side-cats a {
  display: block; padding: .55rem .65rem; border-radius: 10px; color: var(--ink);
  text-decoration: none; font-size: .9rem;
}
.side-cats a:hover, .side-cats a.active { background: #eef3ff; color: var(--brand-primary); font-weight: 600; }
.toggle-row { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toggle-chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: .45rem 1rem; font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink);
}
.toggle-chip.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }

/* Footer */
.site-footer { background: var(--brand-primary-dark); color: #d7e3ff; margin-top: 2.5rem; }
.site-footer a { color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 1.25rem; padding: 2rem 0 1.25rem;
}
.footer-grid h4 { color: #fff; margin: 0 0 .75rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: .4rem 0; }
.socials { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: .75rem; }
.socials a {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.12);
  display: grid; place-items: center; color: #fff; text-decoration: none; font-size: .75rem; font-weight: 700;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15); padding: .85rem 0 1.1rem; font-size: .85rem;
}

/* Callback bar */
.callback-bar {
  position: sticky; bottom: 0; z-index: 30;
  background: var(--brand-primary); color: #fff; padding: .75rem 0;
}
.callback-bar .row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.callback-bar input { max-width: 220px; border: 0; border-radius: 10px; }

/* Empty / loading */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--muted);
}
.empty-state .icon {
  width: 84px; height: 84px; margin: 0 auto 1rem; border-radius: 50%;
  border: 3px solid #b7c7f5; display: grid; place-items: center;
  color: #7b93d9; font-size: 2rem; font-weight: 700;
}
.skeleton {
  background: linear-gradient(90deg, #eef2f8, #f8fafc, #eef2f8);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* Auth cards — equal-width fields */
.auth-shell { min-height: 70vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--brand-surface); }
.auth-page {
  display: flex; justify-content: center; align-items: flex-start;
  padding: 1.25rem 1rem 2rem; width: 100%; box-sizing: border-box;
}
.auth-card {
  width: min(440px, 100%);
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.auth-form { width: 100%; }
.auth-form .field { width: 100%; margin: 0 0 .85rem; }
.auth-form .field > span { display: block; margin-bottom: .35rem; font-weight: 600; color: var(--muted); font-size: .9rem; }
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="tel"] {
  display: block;
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 48px;
}
.auth-check {
  display: flex !important;
  align-items: flex-start;
  gap: .55rem;
  margin: .35rem 0 1rem;
  color: var(--ink);
}
.auth-check input { width: auto !important; min-height: 0 !important; margin-top: .15rem; }
.auth-actions { display: grid; gap: .65rem; }
.auth-link { margin-top: 1rem; text-align: center; }

/* Public mobile-first shell */
.public-site {
  --brand-font: Manrope, "DM Sans", Segoe UI, sans-serif;
  font-family: var(--brand-font);
  background: #f6f8fc;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 10px);
}
.public-site.is-auth { padding-bottom: 1rem; }
.brand-mark-sm { width: 36px; height: 36px; border-radius: 10px; font-size: .95rem; }
.mobile-app-header { display: none; padding: .75rem 0 .35rem; }
.mobile-profile-card {
  display: flex; align-items: center; justify-content: space-between; gap: .55rem;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: .7rem .8rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}
.mobile-city-bar {
  flex: 1; min-width: 0; margin: 0;
  display: inline-flex; align-items: center; gap: .25rem;
}
.mobile-city-bar select {
  max-width: none; width: auto; min-width: 0;
  font-size: .9rem; font-weight: 700;
}
.mobile-user { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; min-width: 0; }
.mobile-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(145deg, #6d28d9, #2563eb); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem; overflow: hidden; flex-shrink: 0;
}
.home-quick-panel { margin-top: .85rem; width: 100%; }
.ph-tile-report {
  width: 1.35rem; height: 1.35rem; display: inline-block; position: relative;
  border: 2px solid currentColor; border-radius: 3px; background: transparent;
  box-sizing: border-box; vertical-align: -2px;
}
.ph-tile-report::before {
  content: ""; position: absolute; left: 15%; right: 15%; top: 28%; height: 2px;
  background: currentColor; border-radius: 1px;
  box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
}
.mobile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mobile-user-meta { min-width: 0; }
.mobile-user-meta strong { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-city { display: inline-flex; align-items: center; gap: .2rem; margin-top: .15rem; }
.mobile-city select {
  border: 0; background: transparent; padding: 0; min-height: 0; font-size: .82rem; font-weight: 600; color: var(--brand-primary);
  width: auto; max-width: 120px;
}
.mobile-header-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.icon-chip {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; position: relative; text-decoration: none; font-size: 1rem;
}
.icon-chip.accent { background: #fff8db; border-color: #f5e4a0; }
.icon-chip .count {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; border-radius: 999px;
  background: #e11d48; color: #fff; font-size: .65rem; font-weight: 800; display: grid; place-items: center;
}
.mobile-search {
  margin-top: .75rem; display: flex; align-items: center; gap: .45rem;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .7rem .35rem .9rem;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .04);
}
.mobile-search input {
  border: 0; outline: 0; min-height: 40px; padding: .35rem 0; background: transparent; width: 100%;
}
.mobile-search .mic-btn {
  border: 0; background: var(--brand-primary); color: #fff; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
}
.flash-wrap { padding-top: .75rem; }

.home-hero { padding: .5rem 0 0; }
.banner-carousel { position: relative; }
.banner-track { position: relative; border-radius: 18px; overflow: hidden; min-height: 150px; }
.banner-slide {
  display: none; position: relative; min-height: 150px; padding: 0; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark) 60%, #1d4ed8);
  background-size: cover; background-position: center;
}
.banner-slide.is-active { display: block; }
.banner-slide .ph-banner-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 1.15rem 1.35rem; color: #fff; z-index: 1;
}
.banner-slide .ph-banner-fallback strong { font-size: clamp(1.05rem, 2.5vw, 1.45rem); line-height: 1.25; }
.banner-slide .ph-banner-fallback small { margin-top: .4rem; opacity: .92; font-size: .9rem; }
.banner-slide .banner-cta { margin-top: .65rem; font-weight: 700; opacity: 1; }
.banner-dots { display: flex; justify-content: center; gap: .35rem; margin-top: .55rem; }
.banner-dot {
  width: 7px; height: 7px; border-radius: 50%; border: 0; background: #c7d2e5; padding: 0; cursor: pointer;
}
.banner-dot.is-active { background: var(--brand-primary); width: 18px; border-radius: 999px; }

.quick-actions {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; margin: .9rem 0 .65rem;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: .75rem .5rem;
}
.quick-round {
  text-align: center; text-decoration: none; color: var(--ink); font-size: .68rem; font-weight: 600;
  display: grid; gap: .3rem; justify-items: center;
}
.quick-round span {
  width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid #d7e3ff; background: #fff;
  display: grid; place-items: center; font-size: .85rem;
}
.quick-tiles {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
}
.quick-tiles a {
  background: var(--brand-primary); color: #fff; text-decoration: none; border-radius: 14px;
  min-height: 54px; display: grid; place-items: center; text-align: center; font-size: .78rem; font-weight: 700;
  padding: .45rem; position: relative;
}
.quick-tiles a i {
  position: absolute; top: -6px; right: -4px; background: #f97316; color: #fff; font-style: normal;
  font-size: .62rem; border-radius: 999px; padding: .1rem .35rem;
}

.cat-grid-compact { grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.cat-card-sm {
  min-height: 78px; padding: .55rem .35rem; border-radius: 14px; gap: .3rem; font-size: .78rem; font-weight: 600;
}
.cat-ico-sm {
  width: 34px !important; height: 34px !important; font-size: .95rem !important;
  background: #eef3ff; border: 1px solid #d7e3ff; overflow: hidden;
}
.cat-ico-sm img { width: 100%; height: 100%; object-fit: cover; }
.h-scroll {
  display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .35rem; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.h-scroll.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.h-scroll.no-scrollbar::-webkit-scrollbar { display: none; width: 0; height: 0; }
.h-scroll > * { flex: 0 0 min(78%, 260px); scroll-snap-align: start; }
.nav-primary a { display: inline-flex; align-items: center; gap: .4rem; }
.nav-ico {
  width: 18px; height: 18px; object-fit: contain; flex-shrink: 0;
}
.nav-ico-emoji {
  width: 20px; height: 20px; display: inline-grid; place-items: center;
  font-size: .95rem; line-height: 1; flex-shrink: 0;
  background: #eef3ff; border-radius: 7px;
}
.menu-toggle {
  border: 1px solid var(--line); background: #fff; border-radius: 12px; width: 38px; height: 38px;
  font-size: 1.1rem; cursor: pointer; flex-shrink: 0;
}
.side-drawer[hidden] { display: none !important; }
.side-drawer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  z-index: 240;
  overflow: hidden;
}
.side-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .5);
}
.side-drawer-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(82vw, 300px);
  max-width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  background: #fff;
  padding: 1.05rem 1rem 1.25rem;
  padding-top: calc(1.05rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 10px 0 36px rgba(15, 23, 42, .22);
  border-radius: 0 18px 18px 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.side-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin: 0 0 .35rem;
  min-height: 40px;
}
.side-drawer-head strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}
.side-drawer-close {
  border: 0;
  background: #fee2e2;
  color: #dc2626;
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  font-weight: 800;
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(185, 28, 28, .08);
}
.side-drawer-auth {
  display: grid;
  gap: .55rem;
  margin: .35rem 0 .55rem;
}
.side-drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--brand-primary);
  color: #fff;
  border-radius: 12px;
  padding: .78rem 1rem;
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
  border: 1.5px solid var(--brand-primary);
  box-sizing: border-box;
}
.side-drawer-cta.outline {
  background: #fff;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.side-drawer-nav {
  display: flex;
  flex-direction: column;
  margin: .35rem 0 0;
  flex: 1;
  min-height: 0;
}
.side-drawer-nav a {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .82rem .15rem;
  border-bottom: 1px solid #e8eef5;
  color: #0f172a;
  text-decoration: none;
  font-weight: 600;
  font-size: .94rem;
  line-height: 1.2;
  box-sizing: border-box;
}
.side-drawer-nav a:last-child { border-bottom: 0; }
.side-drawer-ico {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}
.side-drawer-ico img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}
.side-drawer-label {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.public-bottom-nav .ico-img { width: 20px; height: 20px; object-fit: contain; }
.test-card-accent { background: linear-gradient(180deg, #ffe56d, #ffef9a); border: 0; }
.package-card .badge { align-self: flex-start; }
.stats-compact .stat {
  width: 72px; height: 72px; margin: 0 auto; font-size: .9rem; border-radius: 50%;
}
.stats-compact { justify-items: center; }

/* Popular test / package offer cards */
.section-head-center { position: relative; }
.section-head-center h2 { text-align: center; flex: 1; white-space: normal; overflow: visible; text-overflow: unset; }
.section-head-center .link-more { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.offer-track > .lab-offer-card { flex: 0 0 min(86%, 300px); }
.lab-offer-card {
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08); border: 1px solid #e8eef7;
  display: flex; flex-direction: column; min-height: 100%;
}
.lab-offer-head {
  background: var(--brand-accent, #F5C518); color: #111; font-weight: 800; font-size: .78rem;
  letter-spacing: .02em; padding: .85rem .9rem; line-height: 1.35; min-height: 3.4rem;
  display: flex; align-items: center;
}
.lab-offer-body { padding: .85rem .95rem 1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.lab-offer-line { margin: 0; font-size: .78rem; color: #475467; line-height: 1.4; }
.lab-offer-line a { color: var(--brand-primary); font-weight: 600; text-decoration: none; }
.lab-ico { display: inline-block; width: 1.1rem; }
.lab-offer-price-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: .35rem; gap: .5rem; }
.lab-mrp { display: block; text-decoration: line-through; color: #98a2b3; font-size: .85rem; }
.lab-price { font-size: 1.35rem; font-weight: 800; color: var(--brand-primary); line-height: 1.1; }
.lab-off-badge {
  background: radial-gradient(circle at 30% 30%, #ffe56d, #f5c518 55%, #e8a900);
  color: #111; font-weight: 900; font-size: .85rem; border-radius: 50%;
  width: 58px; height: 58px; display: grid; place-items: center; flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(11, 61, 145, .12);
}
.lab-offer-actions { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .55rem; }
.lab-book-btn {
  border-radius: 999px; padding: .55rem 1rem .55rem 1.1rem; font-size: .88rem;
  display: inline-flex; align-items: center; gap: .45rem;
}
.lab-book-btn span {
  width: 22px; height: 22px; border-radius: 50%; background: var(--brand-accent);
  color: #111; display: grid; place-items: center; font-weight: 900;
}
.lab-know { color: var(--brand-primary); font-weight: 700; font-size: .88rem; text-decoration: none; white-space: nowrap; }

/* Why AVX Labs */
.why-section { background: #f3f5f8; margin: 1rem 0 0; overflow: hidden; }
.why-split { display: grid; grid-template-columns: 1.35fr 1fr; min-height: 420px; }
.why-copy { padding: 2rem clamp(1rem, 4vw, 3rem); }
.why-copy h2 { margin: 0 0 .5rem; color: #1f2937; font-size: clamp(1.4rem, 3vw, 2rem); }
.why-sub { margin: 0 0 1.25rem; color: #667085; max-width: 40rem; }
.why-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.why-stat-card {
  background: #fff; border-radius: 12px; padding: .9rem .55rem; text-align: center;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}
.why-stat-ico { font-size: 1.6rem; line-height: 1; margin-bottom: .35rem; min-height: 2rem; display: grid; place-items: center; }
.why-stat-ico img { width: 36px; height: 36px; object-fit: contain; }
.why-stat-metric { color: var(--brand-primary); font-weight: 800; font-size: 1.15rem; }
.why-stat-label { color: #475467; font-size: .78rem; margin-top: .15rem; }
.why-visual {
  background: #0b3d91 center/cover no-repeat;
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
  min-height: 280px;
}
.why-visual-fallback {
  background:
    linear-gradient(135deg, rgba(11,61,145,.75), rgba(7,44,107,.9)),
    radial-gradient(circle at 30% 40%, #7eb6ff, transparent 50%),
    #0b3d91;
}
.why-cert { padding: 1.25rem 0 1.75rem; }
.why-cert h3 { margin: 0; color: #1f2937; font-size: 1.25rem; }

/* Contact page — equal-height info + form panels */
.contact-intro { margin: 0 0 1rem; }
.contact-layout {
  display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: stretch;
}
.contact-info-card,
.contact-form-card {
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.contact-form-card {
  gap: .75rem;
}
.contact-info-card h2, .contact-form-card h2 {
  margin: 0 0 .85rem; font-size: 1.1rem; color: var(--brand-primary-dark);
}
.contact-info-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.1rem; flex: 1; align-content: start;
}
.contact-info-list li { display: flex; gap: .7rem; align-items: flex-start; }
.contact-info-list strong { display: block; font-size: .8rem; color: var(--muted); font-weight: 700; }
.contact-info-list a, .contact-info-list span { color: var(--ink); word-break: break-word; }
.contact-ico {
  width: 40px; height: 40px; border-radius: 12px; background: #eef3ff; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.1rem;
}
.contact-form-card .field { margin-bottom: 0; }
.contact-form-card .contact-submit { margin-top: auto; }
.contact-submit { min-height: 48px; border-radius: 999px; font-weight: 800; }

/* Promotions page — equal-height cards */
.offers-hero {
  background: linear-gradient(120deg, var(--brand-primary), var(--brand-primary-dark) 55%, var(--brand-accent));
  color: #fff; border-radius: 18px; padding: 1.15rem 1.25rem; margin-bottom: 1rem;
}
.offers-hero h1 { margin: 0 0 .35rem; color: #fff; font-size: clamp(1.25rem, 4vw, 1.75rem); }
.offers-hero p { margin: 0; opacity: .95; }
.offers-grid {
  display: grid; grid-template-columns: 1fr; gap: .85rem; align-items: stretch;
}
.offer-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 1rem;
  display: flex; flex-direction: column; min-height: 220px; height: 100%;
}
.offer-card-body { display: flex; flex-direction: column; gap: .55rem; flex: 1; min-height: 0; }
.offer-card-body h3 {
  margin: 0; font-size: 1.05rem; color: var(--brand-primary-dark);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.5em;
}
.offer-card-desc {
  margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 5.2em;
}
.offer-card-actions { margin-top: auto; padding-top: .75rem; }
.offer-card-actions .btn { min-height: 44px; border-radius: 999px; font-weight: 700; }

@media (min-width: 768px) {
  .contact-layout {
    grid-template-columns: minmax(240px, 1fr) 1fr;
    gap: 1.25rem;
    align-items: stretch;
  }
  .offers-grid { grid-template-columns: repeat(2, 1fr); }
  .offer-card { min-height: 240px; }
}
@media (min-width: 1100px) {
  .offers-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Special offers CTAs — equal buttons */
.offer-cta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .85rem;
}
.offer-cta-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 1.1rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .45rem; min-height: 100%;
}
.offer-cta-ico {
  width: 44px; height: 44px; border-radius: 12px; background: #eef3ff;
  display: grid; place-items: center; font-size: 1.25rem;
}
.offer-cta-card h3 { margin: 0; font-size: 1.05rem; color: var(--brand-primary-dark); }
.offer-cta-card p { margin: 0 0 .35rem; color: var(--muted); font-size: .9rem; flex: 1; }
.offer-cta-btn {
  width: 100%; min-height: 48px; border-radius: 999px; margin-top: auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .95rem; text-decoration: none !important;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  color: #fff !important; border: 0; box-shadow: 0 8px 18px rgba(11,61,145,.22);
}
.offer-cta-btn:hover { filter: brightness(1.05); color: #fff !important; }

/* Videos multi-card carousel (desktop 3 / mobile 1) */
.videos-section { padding-top: .5rem; }
.videos-head { margin-bottom: 1.1rem; justify-content: center; }
.videos-head h2 {
  width: 100%; text-align: center; margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem); font-weight: 800; color: #334155;
}
.video-carousel { position: relative; }
.video-dots {
  display: flex; justify-content: center; gap: .45rem; margin: 0 0 .65rem;
}
.video-dot {
  width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0;
  background: var(--brand-primary); opacity: .45; cursor: pointer; transition: .2s ease;
}
.video-dot.is-active { opacity: 1; background: var(--brand-accent); transform: scale(1.15); }
.video-viewport { overflow: hidden; width: 100%; }
.video-track {
  display: flex; gap: 1.1rem; transition: transform .45s ease;
  will-change: transform;
}
.video-card {
  flex: 0 0 100%;
  border-radius: 16px; overflow: hidden; background: #fff;
  box-shadow: 0 10px 28px rgba(15,23,42,.1); border: 1px solid #eef2f7;
  display: flex; flex-direction: column; min-width: 0;
}
.video-media {
  position: relative; display: block; width: 100%; aspect-ratio: 16/9;
  border: 0; padding: 0; cursor: pointer; background: #0b1220; overflow: hidden;
}
.video-thumb {
  position: absolute; inset: 0; background: #dbe7ff center/cover no-repeat;
}
.video-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,.88); color: #111;
  display: grid; place-items: center; font-size: 1.15rem; line-height: 1;
  box-shadow: 0 8px 20px rgba(15,23,42,.25); z-index: 2; pointer-events: none;
}
.video-brand {
  position: absolute; top: .55rem; right: .55rem; background: var(--brand-accent);
  color: #111; font-size: .68rem; font-weight: 800; padding: .22rem .45rem; border-radius: 4px; z-index: 3;
  max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.video-embed {
  position: absolute; inset: 0; z-index: 4; background: #000;
}
.video-embed iframe, .video-embed video {
  width: 100%; height: 100%; border: 0; display: block; object-fit: cover;
}
.video-card.is-playing .video-play,
.video-card.is-playing .video-thumb { opacity: 0; pointer-events: none; }
.video-caption {
  background: var(--brand-accent); color: #111; font-weight: 700; font-size: .92rem;
  padding: .85rem 1rem; min-height: 3.4rem; text-align: center;
  display: flex; align-items: center; justify-content: center; line-height: 1.3;
}
@media (min-width: 700px) {
  .video-card { flex-basis: calc((100% - 1.1rem) / 2); }
}
@media (min-width: 981px) {
  .video-card { flex-basis: calc((100% - 2.2rem) / 3); }
  .video-caption { font-size: .95rem; min-height: 3.6rem; }
  .video-play { width: 60px; height: 60px; font-size: 1.25rem; }
}
@media (max-width: 699px) {
  .video-track { gap: .75rem; }
  .video-card { flex-basis: 88%; }
  .video-caption { font-size: .88rem; padding: .75rem .85rem; min-height: 3.1rem; }
}

/* Cart checkout bar */
.cart-page { padding-bottom: calc(var(--nav-h) + 88px); }
.cart-item-card {
  display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem;
}
.cart-item-main h3 { margin: .35rem 0; font-size: 1rem; }
.cart-checkout-bar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-bottom));
  z-index: 55; background: #fff; border-top: 1px solid var(--line);
  padding: .75rem 1rem; display: flex; align-items: center; gap: .75rem;
  box-shadow: 0 -10px 28px rgba(15,23,42,.1);
}
.cart-checkout-total { display: flex; flex-direction: column; min-width: 5.5rem; }
.cart-checkout-total span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.cart-checkout-total strong { font-size: 1.15rem; color: var(--brand-primary-dark); }
.cart-checkout-btn {
  flex: 1; min-height: 50px; border-radius: 999px; font-weight: 800; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  color: #fff !important; text-decoration: none !important;
  box-shadow: 0 10px 22px rgba(11,61,145,.28);
}
.cart-checkout-btn span {
  width: 24px; height: 24px; border-radius: 50%; background: var(--brand-accent);
  color: #111; display: grid; place-items: center; font-weight: 900;
}
.app-bottom-nav { display: grid !important; }

/* Article cards */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.article-card {
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 8px 22px rgba(15,23,42,.08); border: 1px solid #eef2f7;
  display: flex; flex-direction: column;
}
.article-media {
  position: relative; display: block; min-height: 170px; background: linear-gradient(135deg,#dbe7ff,#f8fafc) center/cover no-repeat;
  text-decoration: none; color: inherit;
}
.article-brand {
  position: absolute; top: .55rem; right: .55rem; background: var(--brand-accent);
  color: #111; font-size: .65rem; font-weight: 800; padding: .2rem .4rem; border-radius: 4px;
}
.article-date {
  position: absolute; right: .55rem; bottom: .55rem; background: var(--brand-primary);
  color: #fff; font-size: .72rem; font-weight: 700; padding: .25rem .45rem; border-radius: 4px;
}
.article-overlay-title {
  position: absolute; left: .75rem; top: 2rem; right: 30%;
  color: var(--brand-primary-dark); font-weight: 800; font-size: .95rem; line-height: 1.25;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}
.article-body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.article-body h3 { margin: 0; font-size: 1rem; }
.article-body h3 a { color: var(--brand-primary); text-decoration: none; }
.article-body p { margin: 0; color: #667085; font-size: .88rem; line-height: 1.45; flex: 1; }
.article-more { color: var(--brand-primary); font-size: .82rem; font-weight: 600; text-decoration: none; }

@media (max-width: 900px) {
  .why-split { grid-template-columns: 1fr; }
  .why-visual { clip-path: none; min-height: 220px; order: -1; }
  .why-stat-grid, .article-grid { grid-template-columns: repeat(2, 1fr); }
  .offer-cta-grid { grid-template-columns: 1fr; }
  .section-head-center .link-more { position: static; transform: none; }
  .section-head-center { flex-wrap: wrap; justify-content: space-between; }
}
@media (max-width: 640px) {
  .why-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: 1fr; }
  .offer-cta-card { padding: 1rem; }
  .offer-cta-btn { min-height: 50px; }
}

.site-footer { background: #eef3fb; color: #334155; margin-top: 1.5rem; }
.site-footer a { color: var(--brand-primary-dark); }
.footer-grid h4 { color: var(--brand-primary-dark); text-transform: uppercase; font-size: .85rem; letter-spacing: .04em; }
.footer-bar { background: var(--brand-primary); color: #fff; }
.footer-bar a { color: #fff; }
.footer-bar-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem;
  text-align: left; padding: .85rem 0; font-size: .88rem;
}
.footer-social { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; justify-content: flex-end; font-size: .82rem; }
.footer-social a {
  border: 1px solid rgba(255,255,255,.55); border-radius: 8px; padding: .2rem .45rem; text-decoration: none;
}

.public-bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding: .3rem .2rem calc(.3rem + var(--safe-bottom));
  box-shadow: 0 -8px 24px rgba(15, 23, 42, .06);
}
.public-bottom-nav a {
  text-align: center; color: #98a2b3; text-decoration: none; font-size: .7rem; font-weight: 700;
  padding: .3rem .15rem; display: flex; flex-direction: column; align-items: center; gap: .12rem;
}
.public-bottom-nav a.active { color: var(--brand-primary); }
.public-bottom-nav a.active::before {
  content: ""; width: 18px; height: 3px; border-radius: 999px; background: var(--brand-primary); margin-bottom: .1rem;
}
.public-bottom-nav .ico { font-size: 1.05rem; line-height: 1; }
/* Keep bottom nav on login/register so Profile/Reports/Alerts stay reachable */
.public-site.is-auth .public-bottom-nav { display: grid; }
.public-site.is-auth { padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 10px); }
.lang-btn { color: #fff !important; border-color: rgba(255,255,255,.3) !important; }

/* ===== App / mobile shell ===== */
body.app-body { background: var(--brand-surface); overflow-x: hidden; }
.app-shell {
  max-width: 480px; margin: 0 auto; min-height: 100vh; background: #f3f5f9;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px); overflow-x: hidden;
}
.app-top {
  background: #fff; padding: .85rem 1rem; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 20;
}
.app-top h1 { margin: 0; font-size: 1.1rem; flex: 1; }
.app-content { padding: .85rem; }

/* Patient home — screenshot UI (mobile + desktop) */
.ph-home { display: grid; gap: .75rem; }
.ph-profile-card {
  display: flex; align-items: center; justify-content: space-between; gap: .65rem;
  background: #fff; border-radius: 16px; padding: .75rem .85rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .05); border: 1px solid #e8eef7;
}
.ph-user { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.ph-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(145deg, #6d28d9, #2563eb); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem; flex-shrink: 0;
}
.ph-user-meta { min-width: 0; }
.ph-user-meta strong {
  display: block; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-city { display: inline-flex; align-items: center; gap: .15rem; margin-top: .1rem; }
.ph-city select {
  border: 0; background: transparent; padding: 0; min-height: 0; width: auto; max-width: 130px;
  font-size: .82rem; font-weight: 600; color: #334155;
}
.ph-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.ph-chip {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid #e4eaf2; background: #fff;
  display: grid; place-items: center; text-decoration: none; font-size: 1.05rem; position: relative; color: var(--brand-primary);
}
.ph-chip.accent { background: #fff8db; border-color: #f5e4a0; }
.ph-chip .count {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; border-radius: 999px;
  background: #e11d48; color: #fff; font-size: .62rem; font-weight: 800; display: grid; place-items: center;
}
.ph-search {
  display: flex; align-items: center; gap: .4rem; background: #fff; border: 1.5px solid #d7e3ff;
  border-radius: 999px; padding: .3rem .55rem .3rem .95rem; box-shadow: 0 4px 14px rgba(15,23,42,.04);
}
.ph-search input {
  border: 0; outline: 0; min-height: 40px; padding: .3rem 0; background: transparent; width: 100%; font-size: .92rem;
}
.ph-mic {
  border: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-primary); color: #fff;
  display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
}
.ph-banner .banner-track { min-height: 140px; border-radius: 16px; }
.ph-banner .banner-slide { min-height: 140px; border-radius: 16px; }
.ph-banner-fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 1.1rem 1.25rem; color: #fff;
}
.ph-banner-fallback strong { font-size: 1.15rem; line-height: 1.25; }
.ph-banner-fallback small { margin-top: .35rem; opacity: .92; font-size: .85rem; }
.ph-banner .banner-dots { margin-top: .5rem; }
.ph-banner .banner-dot { background: #98a2b3; }
.ph-banner .banner-dot.is-active { background: #111; width: 8px; height: 8px; border-radius: 50%; }

.ph-panel {
  background: #fff; border-radius: 18px; border: 1px solid #e8eef7; padding: .85rem .7rem .9rem;
  box-shadow: 0 8px 22px rgba(15,23,42,.05);
}
.ph-rounds {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-bottom: .8rem;
}
.ph-rounds a {
  text-align: center; text-decoration: none; color: #334155; font-size: .65rem; font-weight: 600;
  display: grid; gap: .35rem; justify-items: center; line-height: 1.2;
}
.ph-rounds span {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid #c7d7f5; background: #fff;
  display: grid; place-items: center; font-size: 1.15rem; color: var(--brand-primary);
}
.ph-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.ph-tiles a {
  background: var(--brand-primary); color: #fff !important; text-decoration: none; border-radius: 14px;
  min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .25rem; text-align: center; font-size: .78rem; font-weight: 700; padding: .5rem .3rem; position: relative;
}
.ph-tile-ico { font-size: 1.15rem; line-height: 1; }
.ph-tiles a i {
  position: absolute; top: -7px; right: -5px; background: #f97316; color: #fff; font-style: normal;
  font-size: .62rem; font-weight: 800; border-radius: 999px; padding: .12rem .4rem;
}

.ph-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .35rem;
}
.ph-section-head h2 {
  margin: 0; font-size: 1rem; color: #475467; font-weight: 700; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-section-head a { color: #e11d48; font-weight: 700; font-size: .78rem; text-decoration: none; flex-shrink: 0; }

.ph-tests { display: flex; gap: .7rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .15rem; }
.ph-test-card {
  flex: 0 0 min(78%, 260px); scroll-snap-align: start;
  background: linear-gradient(160deg, #ffe56d 0%, #ffc107 55%, #ffb300 100%);
  border-radius: 16px; padding: .95rem; min-height: 150px;
  display: flex; flex-direction: column; gap: .35rem; border: 0;
  box-shadow: 0 8px 18px rgba(245, 158, 11, .2);
}
.ph-test-card h3 {
  margin: 0; font-size: .92rem; text-transform: uppercase; letter-spacing: .02em;
  color: #111; line-height: 1.3; min-height: 2.5em;
}
.ph-test-meta { color: #475467; font-size: .82rem; font-weight: 600; }
.ph-test-foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .35rem;
}
.ph-price { font-size: 1.2rem; font-weight: 800; color: #111; }
.ph-add {
  border: 0; background: var(--brand-primary); color: #fff; border-radius: 10px;
  padding: .55rem .85rem; font-weight: 700; font-size: .82rem; cursor: pointer; white-space: nowrap;
}
.ph-empty { color: var(--muted); padding: .75rem; }

.ph-cats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem;
  background: #fff; border: 1px solid #e8eef7; border-radius: 18px; padding: .85rem .65rem;
  box-shadow: 0 6px 16px rgba(15,23,42,.04);
}
.ph-cat {
  text-align: center; text-decoration: none; color: #334155; font-size: .78rem; font-weight: 600;
  display: grid; gap: .4rem; justify-items: center;
}
.ph-cat-ico {
  width: 54px; height: 54px; border-radius: 16px; background: #eef3ff;
  display: grid; place-items: center; font-size: 1.45rem;
}
.ph-cat-ico img { width: 32px; height: 32px; object-fit: contain; }

@media (min-width: 768px) {
  .app-shell:not(.portal-shell) { max-width: 560px; box-shadow: 0 0 0 1px #e8eef7, 0 24px 60px rgba(15,23,42,.08); }
  .app-content { padding: 1.1rem 1.15rem; }
  .ph-rounds span { width: 56px; height: 56px; font-size: 1.3rem; }
  .ph-rounds a { font-size: .72rem; }
  .ph-tiles a { min-height: 84px; font-size: .85rem; }
  .ph-test-card { flex-basis: min(46%, 240px); }
  .ph-cats { grid-template-columns: repeat(3, 1fr); gap: .85rem; }
  .ph-banner .banner-track, .ph-banner .banner-slide { min-height: 180px; }
}
@media (min-width: 1100px) {
  .app-shell:not(.portal-shell) { max-width: 640px; }
  .ph-cats { grid-template-columns: repeat(3, 1fr); }
}
.app-card {
  background: #fff; border-radius: 18px; border: 1px solid var(--line);
  padding: 1rem; margin-bottom: .85rem; box-shadow: 0 6px 18px rgba(15,23,42,.04);
}
.bottom-nav, .app-bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: min(480px, 100%);
  background: #fff; border-top: 1px solid var(--line);
  display: grid !important; grid-template-columns: repeat(4, 1fr);
  padding: .35rem .25rem calc(.35rem + var(--safe-bottom));
  z-index: 70;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, .06);
}
.bottom-nav a, .app-bottom-nav a {
  text-align: center; color: #98a2b3; text-decoration: none; font-size: .72rem; font-weight: 700;
  padding: .35rem .2rem; display: flex; flex-direction: column; align-items: center; gap: .15rem;
}
.bottom-nav a.active, .app-bottom-nav a.active { color: var(--brand-primary); }
.bottom-nav .ico, .app-bottom-nav .ico { font-size: 1.15rem; line-height: 1; }
.app-bottom-nav a.active::before {
  content: ""; width: 18px; height: 3px; border-radius: 999px; background: var(--brand-primary); margin-bottom: .1rem;
}

.profile-hero {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  color: #fff; border-radius: 20px; padding: 1.1rem; display: flex; gap: .85rem; align-items: center;
}
.avatar {
  width: 56px; height: 56px; border-radius: 50%; background: #34c759;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.2rem;
}
.menu-list { background: #fff; border-radius: 18px; border: 1px solid var(--line); overflow: hidden; }
.menu-list a {
  display: flex; align-items: center; gap: .75rem; padding: 1rem;
  border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.menu-list a:last-child { border-bottom: 0; }
.menu-list .chev { margin-left: auto; color: #98a2b3; }
.date-scroller { display: flex; gap: .55rem; overflow-x: auto; padding-bottom: .35rem; }
.date-chip {
  min-width: 64px; border: 1px solid var(--line); border-radius: 12px; padding: .55rem;
  text-align: center; background: #fff; text-decoration: none; color: var(--ink);
}
.date-chip.active { background: var(--success); color: #fff; border-color: var(--success); }
.section-bar {
  background: linear-gradient(90deg, #ffe9a8, #fff6d6); border-radius: 14px;
  padding: .85rem 1rem; font-weight: 700; color: var(--brand-primary-dark); margin: .75rem 0;
}
.option-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.option-card {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 1rem; background: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; cursor: pointer;
}
.option-card.selected { border-color: var(--brand-primary); background: #f5f8ff; }
.booking-confirm-form {
  position: relative;
  padding-bottom: calc(4.75rem + var(--nav-h) + var(--safe-bottom)) !important;
}
.booking-confirm-form .payment-method-field { margin-bottom: .5rem; }
.sticky-confirm {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  width: min(480px, 100%);
  background: #eef2ff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  z-index: 65;
  box-sizing: border-box;
}
.portal-desktop-bar { display: none; }
.empty-state { text-align: center; padding: 1.75rem 1rem; }
.empty-state .icon { font-size: 2rem; margin-bottom: .5rem; }
.empty-state .btn { margin-top: .75rem; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: .65rem .5rem; border-bottom: 1px solid var(--line); text-align: left; font-size: .88rem; vertical-align: top; }
.admin-panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; overflow-x: auto; }
.admin-page-title { margin: 0 0 .35rem; }
.admin-page-sub { color: var(--muted, #5b6b63); margin: 0 0 1rem; }

/* Admin */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-side { background: var(--brand-primary-dark); color: #fff; padding: 1.25rem 1rem; }
.admin-side a { display: block; color: #d7e3ff; padding: .55rem .65rem; border-radius: 10px; text-decoration: none; margin-bottom: .25rem; }
.admin-side a:hover, .admin-side a.active { background: rgba(255,255,255,.12); color: #fff; }
.admin-main { padding: 1.25rem; background: var(--brand-surface); }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; }
.table th, .table td { padding: .75rem; border-bottom: 1px solid var(--line); text-align: left; font-size: .92rem; }
.color-row { display: flex; gap: .5rem; align-items: center; }
.color-row input[type="color"] { width: 46px; height: 42px; padding: 0; border: 0; background: transparent; }

/* Why us */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.stat {
  background: var(--brand-primary); color: #fff; border-radius: 50%; aspect-ratio: 1;
  display: grid; place-items: center; text-align: center; padding: .75rem; font-weight: 800;
}
.stat small { display: block; font-weight: 500; opacity: .9; font-size: .7rem; }

.lang-switch a { margin-left: .35rem; font-weight: 700; }

@media (max-width: 980px) {
  .hero-market, .marketplace-layout, .footer-grid, .grid-3, .admin-shell, .offer-grid { grid-template-columns: 1fr; }
  .cat-grid, .cat-grid-compact { grid-template-columns: repeat(3, 1fr); }
  .search-strip .row { grid-template-columns: 1fr; }
  .nav-primary, .desktop-header, .desktop-topbar, .search-strip, .callback-bar { display: none !important; }
  .mobile-app-header { display: block; }
  .stats-row { grid-template-columns: repeat(4, 1fr); }
  .side-cats { position: static; max-height: none; }
  .site-header { position: sticky; top: 0; z-index: 40; background: #f6f8fc; border-bottom: 0; }
}

@media (min-width: 981px) {
  .public-site .public-bottom-nav { display: none !important; }
  .public-site, .public-site.is-auth { padding-bottom: 0; }
  .mobile-app-header { display: none !important; }

  /* Patient portal — desktop layout (not phone shell) */
  body.app-body { background: #eef2f7; }
  .app-shell.portal-shell {
    max-width: min(1100px, calc(100% - 2rem));
    margin: 1.25rem auto 2rem;
    min-height: calc(100vh - 2.5rem);
    padding-bottom: 1.5rem;
    border-radius: 18px;
    box-shadow: 0 0 0 1px #e8eef7, 0 18px 48px rgba(15, 23, 42, .08);
    overflow: visible;
  }
  .portal-desktop-bar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    position: sticky;
    top: 0;
    z-index: 40;
  }
  .portal-desktop-brand {
    font-weight: 800;
    color: var(--brand-primary);
    text-decoration: none;
    white-space: nowrap;
  }
  .portal-desktop-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .85rem;
    align-items: center;
    justify-content: flex-end;
  }
  .portal-desktop-nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: .88rem;
    padding: .35rem .15rem;
  }
  .portal-desktop-nav a.active,
  .portal-desktop-nav a:hover { color: var(--brand-primary); }
  .app-shell.portal-shell .bottom-nav,
  .app-shell.portal-shell .app-bottom-nav { display: none !important; }
  .app-shell.portal-shell .app-content { padding: 1.25rem 1.5rem 1.75rem; max-width: 920px; margin: 0 auto; width: 100%; }
  .app-shell.portal-shell .booking-confirm-form {
    padding-bottom: 1rem !important;
  }
  .app-shell.portal-shell .sticky-confirm {
    position: static;
    transform: none;
    left: auto;
    width: auto;
    margin: 1rem 0 0;
    border-radius: 14px;
    border: 1px solid var(--line);
  }

  .desktop-header.header-main {
    display: grid !important;
    grid-template-columns: minmax(9rem, 1fr) auto minmax(9rem, 1fr);
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center;
    gap: .5rem 1rem;
    width: 100%;
  }
  .desktop-header .brand-lockup {
    flex: 0 0 auto; max-width: 12rem;
    justify-self: start;
  }
  .desktop-header .nav-primary {
    display: flex !important;
    flex: 0 0 auto;
    flex-wrap: nowrap !important;
    gap: .35rem .65rem;
    min-width: 0;
    justify-content: center;
    justify-self: center;
    overflow: visible;
  }
  .desktop-header .nav-primary a { font-size: .66rem; gap: .28rem; }
  .desktop-header .nav-ico { width: 14px; height: 14px; }
  .desktop-header .nav-ico-emoji { font-size: .85rem; }
  .desktop-header .header-actions {
    display: flex !important;
    flex: 0 0 auto;
    flex-wrap: nowrap !important;
    gap: .35rem;
    margin-left: 0;
    justify-self: end;
  }
  .desktop-header .header-actions .btn {
    display: inline-flex; min-height: 34px; padding: .35rem .75rem; font-size: .78rem;
    white-space: nowrap; flex: 0 0 auto;
  }
  .desktop-header .location-pill { min-height: 34px; padding: .15rem .45rem .15rem .15rem; font-size: .78rem; }
  .desktop-header .location-pill-ico { width: 26px; height: 26px; }
  .desktop-header .cart-btn { width: 34px; height: 34px; }
  .banner-track { min-height: 280px; }
  .banner-slide { min-height: 280px; }
}
@media (min-width: 1100px) {
  .desktop-header .nav-primary { gap: .45rem .65rem; }
  .desktop-header .nav-primary a { font-size: .72rem; }
  .desktop-header .brand-lockup { max-width: 12rem; }
  .desktop-header .brand-text { font-size: .95rem; }
}
@media (min-width: 1280px) {
  .desktop-header .nav-primary a { font-size: .78rem; }
  .desktop-header .header-actions { gap: .55rem; }
  .desktop-header .brand-text { font-size: 1rem; }
  .desktop-header .header-user-link { max-width: 7rem; }
}
@media (min-width: 981px) {
  .h-scroll:not(.ph-tests) { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .h-scroll:not(.ph-tests) > * { flex: none; }
  .ph-tests { display: flex; }
  .ph-test-card { flex: 0 0 min(32%, 280px); }
  .home-quick-panel {
    max-width: none; width: 100%; margin: 1rem auto 0; padding: 1.5rem 2rem 1.65rem;
    display: grid; justify-items: stretch; gap: 1.1rem;
  }
  .home-quick-panel .ph-rounds {
    width: 100%; max-width: none; margin: 0; gap: 1.25rem;
    justify-items: center;
  }
  .home-quick-panel .ph-rounds a {
    font-size: .82rem; width: 100%; max-width: 180px;
  }
  .home-quick-panel .ph-rounds span { width: 68px; height: 68px; font-size: 1.5rem; }
  .home-quick-panel .ph-tiles {
    width: 100%; max-width: none; margin: 0; gap: 1rem;
  }
  .home-quick-panel .ph-tiles a { min-height: 96px; font-size: 1rem; }
  .cart-checkout-bar {
    left: 50%; transform: translateX(-50%); width: min(920px, calc(100% - 2rem));
    bottom: 1rem; border-radius: 16px; border: 1px solid var(--line);
  }
  .cart-page { padding-bottom: 6rem; }
  .offer-cta-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .grid-2, .quick-grid { grid-template-columns: 1fr 1fr; }
  .header-actions .btn { display: none; }
  .cat-grid, .cat-grid-compact { grid-template-columns: repeat(3, 1fr); }
  body { overflow-x: hidden; }
  .site-header, .header-main, .container { max-width: 100%; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.25rem 0; }
}

/* Phase 4 ops forms & alert queue */
.field { display:block; width:100%; max-width:100%; margin:0 0 .75rem; box-sizing:border-box; }
.field > span, .field > legend { display:block; font-size:.85rem; font-weight:600; margin-bottom:.35rem; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field input[type="number"], .field input[type="date"], .field input[type="file"],
.field input[type="password"], .field input[type="datetime-local"],
.field select, .field textarea {
  width:100% !important; max-width:100%; box-sizing:border-box;
  border:1px solid var(--line); border-radius:12px; padding:.8rem .95rem;
  font:inherit; background:#fff; min-height:46px; display:block;
}
.ops-alert-bar {
  display:flex; flex-wrap:wrap; gap:.4rem; align-items:center;
  position:sticky; top:0; z-index:40; background:#fff; border:1px solid var(--line);
  border-radius:12px; padding:.45rem .55rem; margin-bottom:.75rem;
}
.ops-alert-bar.has-alerts { border-color: var(--danger); box-shadow:0 0 0 2px rgba(217,45,32,.08); }
.ops-alert-count {
  display:inline-flex; min-width:1.25rem; height:1.25rem; align-items:center; justify-content:center;
  border-radius:999px; background:var(--danger); color:#fff; font-size:.75rem; font-weight:700; padding:0 .35rem; margin-left:.25rem;
}
.ops-alert-panel {
  border:1px solid var(--line); border-radius:12px; background:#fff; margin-bottom:.85rem; max-height:280px; overflow:auto;
}
.ops-alert-panel-head { font-weight:700; padding:.65rem .75rem; border-bottom:1px solid var(--line); }
.ops-alert-item {
  display:flex; justify-content:space-between; gap:.75rem; padding:.65rem .75rem; border-bottom:1px solid var(--line);
}
.ops-alert-actions { display:flex; flex-direction:column; gap:.35rem; }

/* ===== Reception desktop dashboard ===== */
.rx-body { margin: 0; background: #eef2f7; color: #0f172a; min-height: 100vh; }
.rx-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.rx-sidebar {
  background: linear-gradient(180deg, #0b3d91 0%, #072c6b 100%);
  color: #fff; padding: 1.1rem .85rem 1.5rem; position: sticky; top: 0; height: 100vh; overflow: auto;
}
.rx-brand { display: flex; align-items: center; gap: .7rem; padding: .35rem .45rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: .85rem; }
.rx-brand-mark {
  width: 42px; height: 42px; border-radius: 12px; background: #f5c518; color: #0b3d91;
  display: grid; place-items: center; font-weight: 800; overflow: hidden; flex-shrink: 0;
}
.rx-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.rx-brand-text strong { display: block; font-size: .95rem; line-height: 1.2; }
.rx-brand-text small { opacity: .75; font-size: .72rem; }
.rx-nav { display: grid; gap: .2rem; }
.rx-nav a {
  color: rgba(255,255,255,.88); text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: .72rem .85rem; border-radius: 12px; border-left: 3px solid transparent;
}
.rx-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.rx-nav a.is-active {
  background: rgba(255,255,255,.14); color: #fff; border-left-color: #7dd3fc;
}
.rx-main { min-width: 0; display: flex; flex-direction: column; }
.rx-topbar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: #fff; border-bottom: 1px solid #e2e8f0; padding: .75rem 1.15rem;
  position: sticky; top: 0; z-index: 30;
}
.rx-menu-btn {
  display: none; border: 0; background: #f1f5f9; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1.1rem;
}
.rx-topbar-title { min-width: 8rem; }
.rx-topbar-title strong { display: block; font-size: 1rem; color: #0b3d91; }
.rx-topbar-title small { color: #64748b; font-size: .78rem; }
.rx-top-search {
  flex: 1; min-width: 220px; max-width: 520px; display: flex; align-items: center; gap: .45rem;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 999px; padding: .35rem .9rem;
}
.rx-top-search input {
  border: 0; outline: 0; background: transparent; width: 100%; min-height: 34px; font: inherit; padding: 0;
}
.rx-topbar-actions { display: flex; align-items: center; gap: .45rem; margin-left: auto; }
.rx-icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid #e2e8f0; background: #fff;
  display: grid; place-items: center; text-decoration: none; color: #334155; cursor: pointer;
}
.rx-user { display: flex; align-items: center; gap: .5rem; padding-left: .25rem; }
.rx-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #0b3d91; color: #fff;
  display: grid; place-items: center; font-weight: 800;
}
.rx-user-meta strong { display: block; font-size: .85rem; line-height: 1.15; }
.rx-user-meta small { color: #64748b; font-size: .7rem; font-weight: 700; letter-spacing: .04em; }
.rx-logout { margin: 0; }
.rx-content { padding: 1.25rem 1.35rem 2rem; }
.rx-content .ops-alert-bar { position: static; }

.rx-dash-head h1 { margin: 0; color: #0b3d91; font-size: clamp(1.6rem, 2.4vw, 2rem); font-weight: 800; }
.rx-dash-head p { margin: .35rem 0 1.15rem; color: #64748b; max-width: 46rem; }
.rx-find { margin-bottom: 1.15rem; }
.rx-find label { display: block; font-weight: 700; color: #0b3d91; margin-bottom: .4rem; font-size: .9rem; }
.rx-find-row { display: flex; gap: .65rem; align-items: stretch; }
.rx-find-row input {
  flex: 1; border: 1px solid #dbe3ef; border-radius: 12px; min-height: 48px; padding: .75rem 1rem;
  background: #fff; font: inherit;
}
.rx-find-row .btn { border-radius: 12px; min-height: 48px; padding: 0 1.35rem; font-weight: 700; }

.rx-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1.35rem;
}
.rx-metric {
  background: #fff; border-radius: 16px; padding: 1rem 1.05rem; min-height: 104px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05); border: 1px solid #eef2f7;
  display: flex; flex-direction: column; justify-content: space-between; gap: .55rem;
}
.rx-metric span {
  color: #94a3b8; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.rx-metric strong { font-size: 1.85rem; color: #0f172a; line-height: 1; }
.rx-metric strong.accent { color: #f97316; }

.rx-section-label {
  margin: 0 0 .75rem; color: #94a3b8; font-size: .78rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.rx-actions {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1.25rem;
}
.rx-action {
  background: #fff; border: 1px solid #eef2f7; border-radius: 18px; min-height: 132px;
  padding: 1.1rem .9rem; text-decoration: none; color: #0b3d91;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .65rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05); font-weight: 700; text-align: center;
}
.rx-action strong { font-size: .95rem; }
.rx-action-ico {
  width: 48px; height: 48px; border-radius: 14px; background: #e8eefc; color: #0b3d91;
  display: grid; place-items: center; font-size: 1.35rem;
}
.rx-action-ico.search { background: #dbeafe; }
.rx-action-ico.bed { background: #e0e7ff; }
.rx-action-ico.danger { background: #fee2e2; }
.rx-action-ico.lab { background: #dcfce7; }
.rx-action-ico.bill { background: #dbeafe; }
.rx-action-ico.hist { background: #fef3c7; }
.rx-action.primary { background: #0b3d91; color: #fff; border-color: #0b3d91; }
.rx-action.primary .rx-action-ico { background: #93c5fd; color: #0b3d91; font-size: 1.6rem; font-weight: 800; }
.rx-action.accent { background: #f97316; color: #fff; border-color: #f97316; }
.rx-action.accent .rx-action-ico { background: rgba(255,255,255,.22); color: #fff; }

.rx-toolbar { display: flex; flex-wrap: wrap; gap: .65rem; margin-bottom: 1.1rem; }
.rx-panel {
  background: #fff; border: 1px solid #eef2f7; border-radius: 18px; padding: 1rem 1.1rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04); margin-bottom: 1rem;
}
.rx-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .65rem;
}
.rx-panel-head h2 { margin: 0; font-size: 1.05rem; color: #0b3d91; }
.rx-panel-head a { color: #e11d48; font-weight: 700; text-decoration: none; font-size: .85rem; }
.rx-row {
  display: flex; justify-content: space-between; gap: .75rem; align-items: center;
  padding: .7rem 0; border-bottom: 1px solid #eef2f7; text-decoration: none; color: inherit;
}
.rx-row:last-child { border-bottom: 0; }
.rx-row strong { display: block; }
.rx-row small, .rx-row-meta span { color: #64748b; font-size: .82rem; }
.rx-row-meta { text-align: right; }
.rx-row-meta em {
  display: inline-block; margin-top: .2rem; font-style: normal; font-size: .72rem; font-weight: 700;
  background: #eef2ff; color: #0b3d91; border-radius: 999px; padding: .15rem .5rem; text-transform: uppercase;
}

/* Reception inner pages keep readable width */
.rx-content > .app-card,
.rx-content > form,
.rx-content > .search-strip,
.rx-content > .grid-2 { max-width: 960px; }

@media (max-width: 1100px) {
  .rx-metrics, .rx-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .rx-shell { grid-template-columns: 1fr; }
  .rx-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); z-index: 60;
    transform: translateX(-105%); transition: transform .25s ease;
  }
  body.rx-sidebar-open .rx-sidebar { transform: none; box-shadow: 16px 0 40px rgba(15,23,42,.28); }
  .rx-menu-btn { display: grid; place-items: center; }
  .rx-user-meta { display: none; }
  .rx-top-search { order: 5; flex: 1 1 100%; max-width: none; }
}
@media (max-width: 640px) {
  .rx-metrics, .rx-actions { grid-template-columns: 1fr 1fr; }
  .rx-find-row { flex-direction: column; }
  .rx-content { padding: .9rem; }
}

/* Book a Test + patient picker modal */
.rx-book-choices {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin: 0 0 1.25rem;
}
.rx-book-choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: .45rem;
  text-align: left; text-decoration: none; color: inherit; cursor: pointer;
  border: 1px solid #dbe3f0; border-radius: 18px; padding: 1.15rem 1.2rem; background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05); transition: border-color .15s, transform .15s;
  font: inherit;
}
.rx-book-choice:hover { border-color: #0b3d91; transform: translateY(-1px); }
.rx-book-choice.primary { background: #0b3d91; color: #fff; border-color: #0b3d91; }
.rx-book-choice.primary span:last-child { color: rgba(255,255,255,.85); }
.rx-book-choice strong { font-size: 1.1rem; }
.rx-book-choice > span:last-child { font-size: .88rem; color: #64748b; line-height: 1.35; }
.rx-book-choice-ico {
  width: 2.6rem; height: 2.6rem; border-radius: 14px; display: grid; place-items: center;
  background: #dbeafe; color: #0b3d91; font-size: 1.35rem; font-weight: 800;
}
.rx-book-choice.primary .rx-book-choice-ico { background: rgba(255,255,255,.2); color: #fff; }
.rx-book-choice-ico.search { background: #e0e7ff; }

.rx-picker-list { display: flex; flex-direction: column; gap: .35rem; max-height: min(50vh, 360px); overflow: auto; }
.rx-picker-item {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  padding: .75rem .85rem; border: 1px solid #e2e8f0; border-radius: 14px;
  text-decoration: none; color: inherit; background: #fff;
}
.rx-picker-item:hover { border-color: #0b3d91; background: #f8fafc; }
.rx-picker-item strong { display: block; }
.rx-picker-item small { color: #64748b; font-size: .82rem; }
.rx-picker-meta { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.rx-picker-meta em { font-style: normal; font-size: .78rem; font-weight: 700; color: #0b3d91; }

.rx-modal[hidden] { display: none !important; }
.rx-modal {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1rem;
}
.rx-modal-backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, .45);
}
.rx-modal-card {
  position: relative; z-index: 1; width: min(520px, 100%);
  background: #fff; border-radius: 18px; padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28); max-height: min(90vh, 640px);
  display: flex; flex-direction: column; gap: .55rem;
}
.rx-modal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.rx-modal-head h2 { margin: 0; font-size: 1.15rem; }
.rx-modal-sub { margin: 0; font-size: .85rem; }
.rx-modal-foot { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; margin-top: .35rem; }
.rx-modal-empty { padding: .75rem 0; }
body.rx-modal-open { overflow: hidden; }
@media (max-width: 720px) {
  .rx-book-choices { grid-template-columns: 1fr; }
}

.rx-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; max-height: 280px; overflow: auto; padding: .2rem; }
.rx-check {
  display: flex; align-items: center; gap: .45rem; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: .55rem .65rem; background: #fff; font-size: .88rem;
}
.rx-check span { flex: 1; min-width: 0; }
.rx-check strong { color: #0b3d91; white-space: nowrap; }
.rx-pay-box {
  margin-top: .75rem; padding: .9rem 1rem; border-radius: 14px; background: #f8fafc; border: 1px solid #e2e8f0;
}
.rx-print {
  width: min(800px, calc(100% - 2rem)); margin: 0 auto 2rem; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.5rem; box-shadow: 0 10px 30px rgba(15,23,42,.06);
}
.rx-print-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #0b3d91; padding-bottom: .85rem; margin-bottom: 1rem; }
.rx-print-head h1 { margin: 0; color: #0b3d91; font-size: 1.35rem; }
.rx-print-head p { margin: .2rem 0 0; color: #64748b; font-size: .88rem; }
.rx-print-meta { text-align: right; font-size: .9rem; }
.rx-print-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.rx-print-grid h2 { margin: 0 0 .35rem; font-size: .95rem; color: #0b3d91; }
.rx-print-grid p { margin: .15rem 0; font-size: .9rem; }
.rx-print-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.rx-print-table th, .rx-print-table td { border-bottom: 1px solid #e2e8f0; padding: .55rem .35rem; text-align: left; font-size: .92rem; }
.rx-print-table th { color: #64748b; font-size: .78rem; text-transform: uppercase; }
.rx-print-table td:last-child, .rx-print-table th:last-child { text-align: right; }
.rx-print-totals { margin-left: auto; width: min(280px, 100%); display: grid; gap: .35rem; }
.rx-print-totals div { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.rx-print-totals .grand { border-top: 1px solid #cbd5e1; padding-top: .45rem; font-size: 1.05rem; color: #0b3d91; }
.rx-print-foot { margin-top: 1.25rem; border-top: 1px dashed #cbd5e1; padding-top: .85rem; font-size: .85rem; color: #64748b; }
@media (max-width: 700px) {
  .rx-check-grid, .rx-print-grid { grid-template-columns: 1fr; }
}
