* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #06145f;
  --primary-dark: #050a35;
  --primary-light: #081872;
  --accent: #0f766e;
  --border: #e5e7eb;
  --muted: #6b7280;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  --rose: #a61e4d;
  --gold: #c9922a;
  --navy: #1e3a5f;
}
body {
  font-family: Poppins, system-ui, sans-serif;
  background: linear-gradient(180deg, #f0f4ff 0%, #f4f6f9 180px, #f4f6f9 100%);
  color: #1f2937;
  min-height: 100vh;
  padding: 14px 12px 88px;
}
/* ShareThis floating bar — keep below modals, above page content */
#st-1, #st-2 { z-index: 5 !important; }
.page { max-width: 760px; margin: 0 auto; }
.page-wide { max-width: 920px; }
.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--primary);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  padding: 14px 16px 16px;
}
.site-logo {
  display: block;
  text-align: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  text-decoration: none;
  position: relative;
}
.site-logo img {
  display: block;
  width: 100%;
  max-width: 460px;
  max-height: 78px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
}
.site-logo::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 460px);
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--navy));
}
.site-nav { display: flex; flex-direction: column; gap: 8px; }
.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  transition: transform 0.15s, opacity 0.2s;
}
.nav-btn:hover { color: #fff; opacity: 0.94; transform: translateY(-1px); }
.nav-ehs { background: linear-gradient(135deg, #e11d48, #9f1239); }
.nav-whatsapp { background: linear-gradient(135deg, #2e7d32, #43a047); }
.nav-telegram { background: linear-gradient(135deg, #1565c0, #1e88e5); }
.nav-payslip { background: linear-gradient(135deg, #92400e, #b45309); }
.nav-pension { background: linear-gradient(135deg, #1e3a5f, #2563eb); }
.card {
  background: var(--card);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px 22px;
}
.page-title {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  text-align: center;
  margin: 0 0 22px;
  padding: 16px 14px;
  border-radius: 12px;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.45;
}
.page-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin: -10px 0 22px;
  line-height: 1.5;
}
.ad-wrap { margin: 0 0 20px; text-align: center; }
.hospitals-list .ad-wrap { margin: 10px 0 6px; }
body.med-results-page .med-search-ads { display: none !important; }
.search-form { display: flex; flex-direction: column; gap: 18px; max-width: 520px; margin: 0 auto; }
.btn-med {
  background: linear-gradient(135deg, var(--accent), #14b8a6);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.22);
}
.btn-med:hover { opacity: 0.95; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
select, input[type=text] {
  width: 100%; padding: 12px 14px; border: 1px solid #cbd5e1;
  border-radius: 10px; font: inherit;
}
.btn-primary, .btn-secondary, .btn-small {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 10px; cursor: pointer; text-decoration: none; font: inherit; font-weight: 600;
}
.btn-primary { background: var(--accent); color: #fff; padding: 12px 18px; width: 100%; justify-content: center; }
.btn-secondary { background: #e2e8f0; color: #334155; padding: 10px 16px; }
.source-note, .legend, .disclaimer { color: var(--muted); font-size: 0.92rem; text-align: center; }
.med-results-count {
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 13px 14px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
}
.med-results-count strong { color: #111827; font-size: 1.1rem; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.alert-info { background: #eff6ff; color: #1e40af; }

/* List header — EHS-style columns */
.med-list-head {
  display: grid;
  grid-template-columns: 2.2rem 1fr 5.5rem;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.med-col-action { text-align: center; }

/* Hospital rows */
.hospitals-list { display: flex; flex-direction: column; gap: 8px; }
.hospital-row {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.hospital-row:hover {
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  border-left-color: #94a3b8;
}
.hospital-row.is-open {
  border-left-color: var(--primary);
  box-shadow: 0 4px 14px rgba(15, 76, 129, 0.12);
}
.hospital-row-header {
  display: grid;
  grid-template-columns: 2.2rem 1fr 5.5rem;
  gap: 10px;
  align-items: center;
}
.si-no {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.88rem;
  line-height: 1.4;
}
.hospital-name-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hospital-name-block .name {
  font-weight: 700;
  color: #111827;
  font-size: 0.88rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-scheme-badge {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  padding: 4px 10px !important;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  border: 1px solid transparent;
}
.expanded-address-only {
  margin: 0;
  padding: 4px 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #334155;
  word-break: break-word;
}
.med-scheme-cell {
  justify-self: start;
  text-align: center;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
  line-height: 1.3;
  padding: 6px 10px !important;
  border: 1px solid transparent;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.scheme-badge-lg {
  font-size: 0.82rem !important;
  padding: 5px 10px !important;
  font-weight: 800 !important;
}
.scheme-short { display: none; }
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-valid { background: #dcfce7; color: #166534; }
.status-expiring { background: #fef3c7; color: #92400e; }
.status-expired { background: #fee2e2; color: #991b1b; }
/* EHS + Reimbursement — green/teal highlight */
.scheme-both {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border-color: #6ee7b7;
}
.scheme-possible {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e3a8a;
  border-color: #93c5fd;
}
/* Reimbursement only — warm amber highlight */
.scheme-reimb {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  color: #9a3412;
  border-color: #fdba74;
}
.expand-btn {
  justify-self: center;
  background: linear-gradient(135deg, #334155, #475569);
  color: #fff;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  font-family: inherit;
}
.expand-btn.active { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }

/* Expanded details */
.hospital-details-expanded {
  display: none;
  margin-top: 10px;
  padding: 10px 4px 4px;
  border-top: 1px dashed #e2e8f0;
  background: #f8fafc;
  border-radius: 0 0 8px 8px;
}
.hospital-details-expanded.show { display: block; }
.expanded-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.eq-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #475569;
}
.eq-dates { font-size: 0.68rem; }
.expanded-block { margin-bottom: 10px; }
.expanded-block-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent);
  margin-bottom: 6px;
}
.expanded-text { margin: 0; font-size: 0.84rem; line-height: 1.45; color: #374151; }
.expanded-text.muted { color: var(--muted); }
.expanded-specs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.spec-compact {
  font-size: 0.72rem;
  background: #eef2ff;
  color: #3730a3;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}
.expanded-contact-block { margin-top: 8px; }
.expanded-phone-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #047857;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}
.expanded-phone-pill.is-static { background: #f3f4f6; color: #374151; }
.expanded-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  width: 100%;
}
.expanded-actions > .view-full-page-btn,
.expanded-actions > .view-ehs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  font-family: inherit;
  text-align: center;
}
.expanded-actions > a:only-child {
  flex: 1 1 100%;
  width: 100%;
}
.view-full-page-btn { background: var(--primary); color: #fff; }
.view-ehs-btn { background: #dbeafe; color: #1d4ed8; }

.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; justify-content: center; }
.pagination a {
  padding: 8px 12px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  text-decoration: none;
  font-weight: 600;
}
.pagination a.active { background: var(--accent); color: #fff; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-panel { background: #f8fafc; border-radius: 12px; padding: 16px; }
.detail-panel h2 { margin: 0 0 12px; font-size: 1rem; color: var(--primary); }
.btn-row { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.contact-list { margin: 0; padding-left: 18px; }

@media (max-width: 640px) {
  .med-list-head { display: none; }
  .hospital-row-header {
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }
  .si-no { padding-top: 2px; }
  .hospital-name-block {
    min-width: 0;
    gap: 5px;
  }
  .hospital-name-block .name {
    font-size: 0.84rem;
    -webkit-line-clamp: 3;
  }
  .row-scheme-badge {
    display: inline-block !important;
    font-size: 0.7rem !important;
    padding: 3px 8px !important;
    white-space: normal;
    line-height: 1.3;
  }
  .expand-btn {
    align-self: start;
    margin-top: 2px;
    padding: 5px 8px;
    font-size: 0.72rem;
  }
  .expanded-actions > .view-full-page-btn,
  .expanded-actions > .view-ehs-btn {
    font-size: 0.72rem;
    padding: 9px 8px;
    line-height: 1.25;
    white-space: normal;
  }
  .detail-grid { grid-template-columns: 1fr; }
}
