 /* ── RESET & BASE ── */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { font-size: 16px; scroll-behavior: smooth; }

  :root {
    --green-deep:   #0a3d2e;
    --green-mid:    #1a6648;
    --green-soft:   #2d9b6f;
    --green-light:  #e8f5ef;
    --green-accent: #3ecf8e;
    --cream:        #faf8f4;
    --sand:         #f0ede6;
    --text-dark:    #111a16;
    --text-mid:     #3d5248;
    --text-muted:   #7a9487;
    --white:        #ffffff;
    --card-shadow:  0 4px 24px rgba(10,61,46,0.10);
    --card-shadow-hover: 0 12px 40px rgba(10,61,46,0.18);
    --radius-sm:    10px;
    --radius-md:    18px;
    --radius-lg:    28px;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'DM Sans', sans-serif;
    --transition:   0.22s cubic-bezier(0.4,0,0.2,1);
  }

  body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--text-dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
  }

  /* ── HEADER ── */
  header {
      background: var(--green-deep);
      padding: calc(env(safe-area-inset-top) + 18px) 20px 14px;
      position: sticky;
      top: 0;
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      box-shadow: 0 2px 16px rgba(0,0,0,0.18);
  }

  .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--green-accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .logo-icon svg { display: block; }

  .logo-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--white);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1;
  }

  .logo-sub {
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--green-accent);
    letter-spacing: 0.12em;
    text-transform: none;
    display: block;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* ── HERO / SEARCH AREA ── */
  .hero {
    background: linear-gradient(160deg, var(--green-deep) 0%, var(--green-mid) 100%);
    padding: 32px 20px 40px;
    position: relative;
    overflow: hidden;
  }

  .hero::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: rgba(62,207,142,0.08);
    pointer-events: none;
  }

  .hero::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -40px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
  }

  .hero-label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--green-accent);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .hero-label::before {
    content: '';
    display: inline-block;
    width: 18px; height: 2px;
    background: var(--green-accent);
    border-radius: 2px;
  }

  .hero-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--white);
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 6px;
  }

  .hero-title em {
    font-style: normal;
    color: var(--green-accent);
  }

  .hero-sub {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 24px;
    font-weight: 300;
  }

  .category-label {
      font-size: 0.72rem;
      font-weight: 600;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.74);
      margin-bottom: 10px;
    }
  
    .category-row {
      display: flex;
      gap: 8px;
      margin-bottom: 16px;
      flex-wrap: wrap;
    }
  
    .category-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-bottom: 16px;
  }

  .category-grid::-webkit-scrollbar { display: none; }

  .category-tile {
      background: rgba(255,255,255,0.07);
      border: 1.5px solid rgba(255,255,255,0.13);
      padding: 10px 8px;
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      height: 72px;
      gap: 5px;
      cursor: pointer;
      transition: all var(--transition);
      text-align: center;
      font-family: var(--font-body);
      width: 100%;
  }

  .category-tile.active {
      background: var(--green-accent);
      border-color: var(--green-accent);
  }

  .category-tile.active .tile-icon { color: var(--green-deep); }
  .category-tile.active .tile-label { color: var(--green-deep); }

  .tile-icon {
      width: 18px;
      height: 18px;
      color: var(--green-accent);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
  }

  .tile-label {
      font-size: 0.78rem;
      font-weight: 600;
      color: rgba(255,255,255,0.85);
      line-height: 1.3;
  }

  .locate-hint {
    margin-top: 10px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.72);
  }

  /* ── LOCATE BUTTON ── */
  .locate-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--green-accent);
    color: var(--green-deep);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
  }

  .locate-btn:active { transform: scale(0.97); }

  .locate-btn:hover {
    background: #52dfa0;
    box-shadow: 0 6px 24px rgba(62,207,142,0.35);
  }

  .locate-btn.loading {
    pointer-events: none;
    opacity: 0.85;
  }

  .locate-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
  }

  .locate-btn .btn-icon {
    transition: transform var(--transition);
  }

  .locate-btn:hover .btn-icon { transform: scale(1.15); }

  /* spinner */
  .spinner {
    width: 20px; height: 20px;
    border: 2.5px solid rgba(10,61,46,0.25);
    border-top-color: var(--green-deep);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
  }

  .locate-btn.loading .btn-icon { display: none; }
  .locate-btn.loading .spinner { display: block; }

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

  /* ── STATS BAR ── */
  .stats-bar {
    display: flex;
    gap: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    margin: 20px;
    margin-top: -20px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    display: none !important;
  }

  .stat-item {
    flex: 1;
    text-align: center;
    padding: 14px 8px;
    border-right: 1px solid var(--green-light);
  }

  .stat-item:last-child { border-right: none; }

  .stat-val {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--green-mid);
    display: block;
  }

  .stat-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    margin-top: 2px;
    display: block;
  }

  /* ── SECTION HEADINGS ── */
  .section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 20px;
    margin-bottom: 14px;
    margin-top: 8px;
  }

  .section-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-dark);
    font-weight: 700;
  }
  .section-title.results {
      font-size: 1rem;
      font-weight: 600;
  }

  .section-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
  }
  #resultsTitle {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      font-weight: 400;
      letter-spacing: 0.01em;
  }

  /* ── FILTER CHIPS ── */
  .filter-row {
    display: flex;
    gap: 8px;
    padding: 0 20px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .filter-row::-webkit-scrollbar { display: none; }

  .chip {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1.5px solid var(--green-light);
    background: var(--white);
    color: var(--text-mid);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
  }

  .chip.active, .chip:hover {
    background: var(--green-deep);
    border-color: var(--green-deep);
    color: var(--white);
  }

  /* ── PHARMACY CARDS ── */
  .cards-list {
    padding: 0 20px 100px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .pharmacy-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
    cursor: pointer;
    animation: fadeSlide 0.35s ease both;
  }

  @keyframes fadeSlide {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .pharmacy-card:active { transform: scale(0.985); }

  .pharmacy-card:hover {
    box-shadow: var(--card-shadow-hover);
  }

  .card-top {
    display: flex;
    align-items: flex-start;
    padding: 16px 16px 12px;
    gap: 14px;
  }

  .card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--green-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--green-mid);
  }

  .card-info { flex: 1; min-width: 0; }

  .card-name {
    font-weight: 600;
    font-size: 0.97rem;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
  }

  .card-address {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .distance-badge {
    flex-shrink: 0;
    background: var(--green-light);
    color: var(--green-mid);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    white-space: nowrap;
    align-self: flex-start;
  }

  .card-divider {
    height: 1px;
    background: var(--sand);
    margin: 0 16px;
  }

  .card-actions {
    display: flex;
    padding: 12px 16px;
    gap: 10px;
  }

  .action-btn {
    flex: 1;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition);
    text-decoration: none;
  }

  .action-btn.primary {
    background: var(--green-deep);
    color: var(--white);
  }

  .action-btn.primary:hover {
    background: var(--green-mid);
  }

  .action-btn.secondary {
    background: var(--green-light);
    color: var(--green-mid);
  }

  .action-btn.secondary:hover {
    background: #d5eddf;
  }

  .verified-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--green-soft);
    margin-top: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  /* ── EMPTY / ERROR STATE ── */
  .state-box {
    text-align: center;
    padding: 56px 20px 40px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .state-box.visible { display: flex; }

  .state-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
  }

  .state-icon.green { background: var(--green-light); }
  .state-icon.red { background: #fef0f0; }

  .state-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
  }

  .state-msg {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 280px;
    line-height: 1.6;
  }

  /* ── BOTTOM NAV ── */
  .bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--white);
    border-top: 1px solid var(--green-light);
    display: flex;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 200;
    box-shadow: 0 -4px 20px rgba(10,61,46,0.07);
  }

  .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-body);
    transition: all var(--transition);
    text-decoration: none;
    border-radius: 10px;
    margin: 0 4px;
    color: var(--text-muted);
  }

  .nav-item.active {
    color: var(--green-mid);
  }

  .nav-icon {
    width: 22px; height: 22px;
    transition: transform var(--transition);
  }

  .nav-item.active .nav-icon { transform: scale(1.1); }

  .nav-label {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  /* ── MODAL ── */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,20,15,0.55);
    z-index: 500;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
  }

  .modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .modal-sheet {
    background: var(--white);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .modal-overlay.open .modal-sheet { transform: translateY(0); }

  .modal-handle {
    width: 36px; height: 4px;
    background: var(--sand);
    border-radius: 4px;
    margin: 12px auto 0;
  }

  .modal-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--sand);
  }

  .modal-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
  }

  .modal-addr {
    font-size: 0.82rem;
    color: var(--text-muted);
  }

  .modal-body { padding: 20px; }

  .modal-detail-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--sand);
  }

  .modal-detail-row:last-of-type { border-bottom: none; }

  .modal-detail-icon {
    width: 38px; height: 38px;
    background: var(--green-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .modal-detail-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 2px;
  }

  .modal-detail-value {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-dark);
  }

  .modal-ctas {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 20px 8px;
  }

  .modal-cta {
    width: 100%;
    padding: 15px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition);
    text-decoration: none;
  }

  .modal-cta.primary {
    background: var(--green-deep);
    color: var(--white);
  }

  .modal-cta.outline {
    background: transparent;
    border: 1.5px solid var(--green-light);
    color: var(--green-mid);
  }

  .modal-cta:hover { opacity: 0.88; }

  /* ── SEARCH BAR ── */
  .search-wrap {
    padding: 0 20px 20px;
    position: relative;
  }

  .search-input {
    width: 100%;
    padding: 13px 16px 13px 44px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--green-light);
    background: var(--white);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-dark);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
  }

  .search-input::placeholder { color: var(--text-muted); }

  .search-input:focus {
    border-color: var(--green-soft);
    box-shadow: 0 0 0 3px rgba(45,155,111,0.12);
  }

  .search-icon {
    position: absolute;
    left: 34px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
  }

  /* ── COMING SOON TABS ── */
  .tab-page {
    display: none;
    padding: 40px 20px;
    text-align: center;
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }

  .tab-page.active { display: flex; }

  .coming-icon {
    width: 80px; height: 80px;
    background: var(--green-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
  }

  .coming-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
  }

  .coming-msg {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 260px;
    line-height: 1.7;
  }

  .coming-pill {
    background: var(--green-deep);
    color: var(--green-accent);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 100px;
    margin-top: 4px;
  }

  /* ── RESPONSIVE ── */
  @media (min-width: 480px) {
    .hero { padding: 40px 28px 52px; }
    .stats-bar { margin: 20px 28px; margin-top: -24px; }
    .section-header, .filter-row, .cards-list, .search-wrap { padding-left: 28px; padding-right: 28px; }
    .filter-row { padding-left: 28px; }
  }

  @media (min-width: 700px) {
    body { max-width: 480px; margin: 0 auto; }
    header { border-radius: 0; }
    .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
    .modal-overlay { align-items: center; }
    .modal-sheet { border-radius: 24px; max-width: 460px; margin: auto; transform: scale(0.92) translateY(10px); }
    .modal-overlay.open .modal-sheet { transform: scale(1) translateY(0); }
  }
  .verified-tag {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 0.68rem;
      font-weight: 700;
      color: #1a6648;
      background: #e8f5ef;
      padding: 3px 8px;
      border-radius: 6px;
      margin-top: 6px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
  }
  .availability-btn {
      background: linear-gradient(135deg, #3ecf8e, #2d9b6f);
      color: var(--green-deep);
      padding: 10px 16px;
  }

  .availability-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 16px 40px rgba(62,207,142,0.45);
  }
  
  .availability-btn:active {
      transform: scale(0.97);
  }

  .availability-btn.loading {
      pointer-events: none;
      opacity: 0.8;
  }
  @keyframes pulseGlow {
      0% { box-shadow: 0 0 0 0 rgba(62,207,142,0.5); }
      70% { box-shadow: 0 0 0 12px rgba(62,207,142,0); }
      100% { box-shadow: 0 0 0 0 rgba(62,207,142,0); }
  }
  
  .availability-btn.attention {
      animation: pulseGlow 2s infinite;
  }

  /* spinner for this button */
  .availability-btn .spinner {
      width: 16px;
      height: 16px;
      border: 2px solid rgba(255,255,255,0.3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
      display: none;
  }

  .availability-btn.loading .spinner {
      display: block;
  }

  .availability-btn.loading .btn-text {
      display: none;
  }
 #availabilitySection {
      position: sticky;
      top: 10px;
      z-index: 150;
      background: var(--cream);
      padding-top: 10px;
      padding-bottom: 10px;
  }

  /* Stagger animation delay for cards */
  .pharmacy-card:nth-child(1) { animation-delay: 0.05s; }
  .pharmacy-card:nth-child(2) { animation-delay: 0.1s; }
  .pharmacy-card:nth-child(3) { animation-delay: 0.15s; }
  .pharmacy-card:nth-child(4) { animation-delay: 0.2s; }
  .pharmacy-card:nth-child(5) { animation-delay: 0.25s; }
  .pharmacy-card:nth-child(6) { animation-delay: 0.3s; }

  /* ── MESSAGES TAB ───────────────────────────── */

  /* Override tab-page for messages so it flows naturally like a list page */
  #page-messages.tab-page {
    text-align: left;
    align-items: stretch;
    padding: 0 0 100px;
    gap: 0;
  }

  #page-messages .section-header {
    padding-top: 20px;
  }

  /* ── REQUEST CARD (outer container) ── */
  .request-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--green-mid);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    animation: fadeSlide 0.3s ease both;
  }

  /* ── REQUEST CARD TOP BAR ── */
  .request-card-top {
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid var(--green-mid);
  }

  .request-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  /* pill showing broadcast count */
  .broadcast-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--green-deep);
    color: var(--green-accent);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 100px;
    white-space: nowrap;
  }

  .request-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }


  .response-tally.waiting {
    background: #fff8e6;
    color: #92620a;
  }

  .response-tally.partial {
    background: #e8f5ef;
    color: var(--green-mid);
  }

  .response-tally.complete {
    background: var(--green-deep);
    color: var(--green-accent);
  }

  /* ── PHARMACY RESPONSES LIST (updated) ── */
  .pharmacy-responses {
    border-top: 1px solid var(--sand);
  }

  .pharmacy-response-row {
    padding: 14px 16px;
    border-bottom: none; 
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .pharmacy-response-row:nth-child(even) {
    background: var(--green-light);
  }
  .pharmacy-response-row:last-child {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
  }

  .pharmacy-response-row:last-child {
    border-bottom: none;
  }

  .pharm-row-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
  }

  .pharm-name {
     font-size: 0.88rem;
     font-weight: 700;
     color: var(--green-mid);
     letter-spacing: 0.01em;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
   }

  .pharm-address-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
  }

  .pharm-address {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pharm-dir-btn {
    flex-shrink: 0;
    background: var(--green-light);
    border: none;
    border-radius: 7px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: var(--green-mid);
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all var(--transition);
  }

  .pharm-dir-btn:hover {
    background: var(--green-deep);
    color: var(--white);
  }

  .pharm-dir-btn:active {
    transform: scale(0.96);
  }

  .pharm-status-badge {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .pharm-status-badge.pending {
    background: #fef3c7;
    color: #92600a;
  }

  .pharm-status-badge.responded {
    background: var(--green-light);
    color: var(--green-mid);
  }

  /* Bolder drug availability rows */
  .da-drug-name {
    color: var(--text-mid);
    font-weight: 500;
    font-size: 0.85rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .da-avail {
    font-weight: 700;
    font-size: 0.74rem;
    padding: 3px 8px;
    border-radius: 100px;
  }

  .da-price {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--green-mid);
  }

  .pharm-pending-msg {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    font-style: italic;
  }

  .request-drug {
     display: flex;
     flex-direction: column;
     line-height: 1.2;
     flex: 1;
   }

  .request-drug-label {
     font-size: 0.68rem;
     color: var(--text-muted);
     font-weight: 600;
     text-transform: uppercase;
     letter-spacing: 0.06em;
     line-height: 1;
     margin-bottom: 3px;
   }
   
   .request-drug-name {
     font-family: var(--font-display);
     font-size: 1.15rem;
     font-weight: 700;
     color: var(--green-deep);
     letter-spacing: -0.01em;
   }

  .request-time {
    font-size: 0.73rem;
    font-weight: 500;
    color: var(--text-muted);
  }

  .response-tally {
    font-size: 0.73rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 100px;
  }

  /* ── MAP MODAL ── */
  .map-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,20,15,0.6);
    z-index: 600;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(3px);
  }

  .map-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .map-modal-sheet {
    background: var(--white);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-height: 82vh;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .map-modal-overlay.open .map-modal-sheet {
    transform: translateY(0);
  }

  .map-modal-handle {
    width: 36px; height: 4px;
    background: var(--sand);
    border-radius: 4px;
    margin: 12px auto 0;
    flex-shrink: 0;
  }

  .map-modal-header {
    padding: 14px 20px 12px;
    border-bottom: 1px solid var(--sand);
    flex-shrink: 0;
  }

  .map-modal-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3px;
  }

  .map-modal-addr {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
  }

  .map-frame-wrap {
    flex: 1;
    min-height: 320px;
    position: relative;
    background: var(--green-light);
  }

  .map-frame-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    inset: 0;
  }

  .map-modal-footer {
    padding: 14px 20px 4px;
    flex-shrink: 0;
    display: flex;
    gap: 10px;
  }

  .map-open-btn {
    flex: 1;
    padding: 13px;
    background: var(--green-deep);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition);
  }

  .map-open-btn:hover { background: var(--green-mid); }
  .map-open-btn:active { transform: scale(0.97); }

  .map-close-btn {
    padding: 13px 18px;
    background: var(--sand);
    color: var(--text-mid);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
  }

  .map-close-btn:hover { background: #e0ddd6; }

  @media (min-width: 700px) {
    .map-modal-overlay { align-items: center; }
    .map-modal-sheet {
      border-radius: 24px;
      max-width: 460px;
      margin: auto;
      transform: scale(0.92) translateY(10px);
      max-height: 78vh;
    }
    .map-modal-overlay.open .map-modal-sheet { transform: scale(1) translateY(0); }
  }

  /* ── Drug availability rows within one pharmacy's response ── */
  .drug-availability-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .drug-avail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.78rem;
  }


  .da-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }


  .da-avail.yes {
    background: #dcfce7;
    color: #166534;
  }

  .da-avail.no {
    background: #fee2e2;
    color: #991b1b;
  }

  .modal-cta.loading {
      pointer-events: none;
      opacity: 0.85;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
  }
  
  .modal-cta .spinner {
      display: none;
  }
  
  .modal-cta.loading .spinner {
      display: inline-block;
  }
  .chat-btn {
    background: #25D366;
    color: white;
    border: none;
    padding: 5px 10px;      
    font-size: 0.82rem;     
    font-weight: 700;      
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
  }
  
  .chat-btn:active {
      transform: scale(0.97);
  }
  
  .chat-icon {
      font-size: 0.8rem;
  }
  #availabilitySection {
      position: sticky;
      top: 10px;
      z-index: 150;
      background: var(--cream);
      padding: 10px 20px;
  }
  .btn-text {
      font-size: 1rem;
      font-weight: 700;
      letter-spacing: -0.01em;
  }
  
  .primary-text {
      font-size: 1.05rem;
      font-weight: 800;
  }
  
  .secondary-text {
      font-size: 0.78rem;
      font-weight: 500;
      opacity: 0.85;
  }
  @keyframes popIn {
      from { opacity: 0; transform: scale(0.85); }
      to   { opacity: 1; transform: scale(1); }
  }
  /* ── NOTICES TAB ── */
  .notice-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    min-width: 0;
    animation: fadeSlide 0.3s ease both;
  }

  .notice-card-band {
    height: 5px;
    width: 100%;
  }

  .notice-card-band.deal {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
  }

  .notice-card-band.stock {
    background: linear-gradient(90deg, var(--green-accent), var(--green-mid));
  }

  .notice-card-band.update {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
  }

  .notice-card-body {
    padding: 14px 16px 0;
  }

  .notice-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }

  .notice-biz-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
  }

  .notice-biz-avatar.deal { background: #fef3c7; color: #92600a; }
  .notice-biz-avatar.stock { background: var(--green-light); color: var(--green-mid); }
  .notice-biz-avatar.update { background: #dbeafe; color: #1e40af; }

  .notice-biz-meta { flex: 1; min-width: 0; }

  .notice-business-name {
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--text-dark);
      line-height: 1.3;
      word-break: break-word;
      overflow-wrap: anywhere;
  }

  .notice-biz-dist {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
  }

  .notice-type-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 100px;
  }

  .notice-type-badge.deal { background: #fef3c7; color: #92600a; }
  .notice-type-badge.stock { background: var(--green-light); color: var(--green-mid); }
  .notice-type-badge.update { background: #dbeafe; color: #1e40af; }

  .notice-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.55;
    margin-bottom: 14px;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .notice-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 12px;
    border-top: 1px solid var(--sand);
  }

  .notice-time {
    font-size: 0.7rem;
    color: var(--text-muted);
  }

  .notice-chat-btn {
    background: var(--green-deep);
    color: var(--white);
    border: none;
    padding: 7px 13px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition);
  }

  .notice-chat-btn:hover { background: var(--green-mid); }
  .notice-chat-btn:active { transform: scale(0.97); }
  /* ── NOTICE CARD: address row ── */
  .notice-addr-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
  }

  .notice-addr-text {
      font-size: 0.83rem;
      font-weight: 600;
      color: var(--text-muted);
      word-break: break-word;
      overflow-wrap: anywhere;
      flex: 1;
      min-width: 0;
  }
  /* ── NOTICE CARD: image ── */
  .notice-image-wrap {
    margin: 0 16px 14px;
    border-radius: 12px;
    overflow: hidden;
    max-height: 200px;
    background: var(--sand);
    position: relative;
  }

  .notice-image-wrap img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
  }

  .notice-image-wrap:hover img {
    transform: scale(1.03);
  }

  .notice-image-label {
    position: absolute;
    bottom: 8px;
    left: 10px;
    background: rgba(10,61,46,0.72);
    color: var(--green-accent);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
  }
  #page-notices {
    overflow-x: hidden;
    width: 100%;
  }

  #noticesList {
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .pin-box {
      width: 44px;
      height: 52px;
      border: 2px solid var(--green-light);
      border-radius: 10px;
      font-family: var(--font-display);
      font-size: 1.4rem;
      font-weight: 700;
      text-align: center;
      color: var(--text-dark);
      background: var(--white);
      outline: none;
      transition: border-color var(--transition), box-shadow var(--transition);
      -webkit-appearance: none;
  }

  .pin-box:focus {
      border-color: var(--green-accent);
      box-shadow: 0 0 0 3px rgba(62,207,142,0.15);
  }

  .pin-box.filled {
      border-color: var(--green-mid);
      background: var(--green-light);
  }
  @keyframes shake {
      0%, 100% { transform: translateX(0); }
      20%       { transform: translateX(-8px); }
      40%       { transform: translateX(8px); }
      60%       { transform: translateX(-5px); }
      80%       { transform: translateX(5px); }
  }
  /* ── REPORT MODAL ── */
  .report-trigger {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin: 24px 20px 8px;
      padding: 14px 20px;

      
      background: var(--green-light);
      border: 1.5px dashed var(--green-soft);

      border-radius: var(--radius-md);
      cursor: pointer;
      transition: all var(--transition);
      font-family: var(--font-body);
      width: calc(100% - 40px);
      text-align: center;
  }
  
  .report-trigger-icon {
    width: 32px;
    height: 32px;
    background: var(--green-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition);
  }
  
  .report-trigger:hover .report-trigger-icon {
    background: #c5e8d8;
  }
  
  .report-trigger-text {
    text-align: left;
  }
  
  .report-trigger-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-mid);
    display: block;
    line-height: 1.3;
  }
  
  .report-trigger-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
    margin-top: 1px;
  }
  
  .report-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,20,15,0.55);
    z-index: 700;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
  }
  
  .report-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }
  
  .report-sheet {
    background: var(--white);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  
  .report-overlay.open .report-sheet {
    transform: translateY(0);
  }
  
  .report-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--sand);
    border-radius: 4px;
    margin: 12px auto 0;
  }
  
  .report-sheet-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--sand);
  }
  
  .report-sheet-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3px;
  }
  
  .report-sheet-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
  }
  
  .report-sheet-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  
  .report-field-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 7px;
    display: block;
  }
  
  .report-textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--green-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-dark);
    outline: none;
    resize: none;
    min-height: 110px;
    line-height: 1.6;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-sizing: border-box;
  }
  
  .report-textarea:focus {
    border-color: var(--green-soft);
    box-shadow: 0 0 0 3px rgba(45,155,111,0.1);
  }
  
  .report-textarea::placeholder {
    color: var(--text-muted);
  }
  
  .contact-pref-row {
    display: flex;
    gap: 10px;
  }
  
  .contact-pref-btn {
    flex: 1;
    padding: 11px 10px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--green-light);
    background: var(--white);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-mid);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--transition);
  }
  
  .contact-pref-btn.active {
    background: var(--green-deep);
    border-color: var(--green-deep);
    color: var(--white);
  }
  
  .report-contact-input {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--green-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-dark);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-sizing: border-box;
  }
  
  .report-contact-input:focus {
    border-color: var(--green-soft);
    box-shadow: 0 0 0 3px rgba(45,155,111,0.1);
  }
  
  .report-submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--green-deep);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: all var(--transition);
    letter-spacing: -0.01em;
  }
  
  .report-submit-btn:hover { background: var(--green-mid); }
  .report-submit-btn:active { transform: scale(0.97); }
  .report-submit-btn:disabled {
    opacity: 0.6;
    pointer-events: none;
  }
  
  .report-submit-btn .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
  }
  
  .report-submit-btn.loading .spinner { display: block; }
  .report-submit-btn.loading .report-btn-text { display: none; }
  
  .report-success-box {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px 20px;
    gap: 12px;
  }
  
  .report-success-box.visible { display: flex; }
  
  .report-success-icon {
    width: 60px;
    height: 60px;
    background: var(--green-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
  }
  
  .report-success-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
  }
  
  .report-success-msg {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 260px;
  }
  .section-subtitle {
      font-size: 0.72rem;
      color: var(--text-muted);
      font-weight: 500;
      margin-top: 2px;
  }
  .hero {
    padding: 24px 20px 26px;   /* was 32px 20px 40px */
  }
  
  .category-label {
    margin-bottom: 8px;        /* was 10px */
  }
  
  .category-grid {
    gap: 6px;                  /* was 8px */
    margin-bottom: 12px;       /* was 16px */
  }
  
  .category-tile {
    height: 58px;               /* was 72px */
    padding: 8px 6px;           /* was 10px 8px */
    gap: 3px;                   /* was 5px */
  }
  
  .tile-icon {
    width: 16px;                /* was 18px */
    height: 16px;
  }
  
  .tile-label {
    font-size: 0.72rem;         /* was 0.78rem */
  }
  
  .hero-title {
    font-size: 1.3rem;          /* was 1.5rem */
    margin-bottom: 4px;         /* was 6px */
  }
  
  .hero-sub {
    font-size: 0.82rem;         /* was 0.88rem */
    margin-bottom: 16px;        /* was 24px */
  }
  
  .chat-overlay { display: none; position: fixed; inset: 0; background: var(--cream, #faf8f4); z-index: 2000; flex-direction: column; }
  .chat-overlay.open { display: flex; }
  .chat-header { background: var(--green-deep, #0a3d2e); padding: calc(env(safe-area-inset-top) + 14px) 16px 14px; display: flex; align-items: center; gap: 12px; }
  .chat-back-btn { background: none; border: none; color: #fff; font-size: 1.3rem; cursor: pointer; padding: 4px; }
  .chat-header-title { color: #fff; font-weight: 700; font-size: 1rem; }
  .chat-header-sub { color: rgba(255,255,255,0.55); font-size: 0.72rem; margin-top: 2px; }
  .chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
  .chat-bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: 0.88rem; line-height: 1.5; }
  .chat-bubble.customer { align-self: flex-end; background: var(--green-deep, #0a3d2e); color: #fff; border-bottom-right-radius: 4px; }
  .chat-bubble.business { align-self: flex-start; background: #fff; color: var(--text-dark, #111a16); border: 1px solid var(--sand, #f0ede6); border-bottom-left-radius: 4px; }
  .chat-bubble img { max-width: 100%; border-radius: 10px; margin-top: 6px; }
  .chat-bubble-time { font-size: 0.65rem; opacity: 0.6; margin-top: 4px; }
  .chat-input-row { display: flex; gap: 8px; padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px); background: #fff; border-top: 1px solid var(--sand, #f0ede6); }
  .chat-input-row input { flex: 1; padding: 12px 14px; border: 1.5px solid var(--sand, #f0ede6); border-radius: 24px; font-family: var(--font-body); font-size: 0.9rem; outline: none; }
  .chat-send-btn { background: var(--green-deep, #0a3d2e); color: #fff; border: none; width: 44px; height: 44px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; flex-shrink: 0; }
  /* Block button hidden — re-enable by removing this rule */
  /*#chatBlockBtn { display: none !important; }*/
