/* Card actions keep readable widths instead of squeezing four items into a pill row. */
body:not(.wl) #main .provider-card-actions {
 display: grid !important; grid-template-columns: minmax(0,1fr) 44px 44px;
 gap: 8px !important; align-items: center; width: 100%;
}
body:not(.wl) #main .provider-card-actions > a:first-child { grid-column: 1 / -1; }
body:not(.wl) #main .provider-card-actions > a:not(.provider-chat),
body:not(.wl) #main .rd-hcard-actions > a,
body:not(.wl) #main .doctor-card > div:last-child > a {
 display: flex; align-items: center; justify-content: center; gap: 6px;
 min-width: 0; min-height: 44px; padding: 10px 12px !important;
 border-radius: 12px !important; font-size: 13px !important; line-height: 1.35;
 text-align: center; white-space: normal; box-sizing: border-box;
 box-shadow: none !important; overflow-wrap: normal;
}
body:not(.wl) #main .provider-card-actions > .provider-chat {
 width: 44px; height: 44px; min-width: 44px; padding: 0;
 border-radius: 12px; display: flex; align-items: center; justify-content: center;
}
body:not(.wl) #main .rd-hcard-actions,
body:not(.wl) #main .doctor-card > div:last-child { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; align-items: stretch; }
@media(max-width:768px) {
 body:not(.wl) #main #hospitalsContainer .provider-card-actions > a:first-child { grid-column: 1; border-radius: 12px; }
}

/* Shared profile/treatment recommendation cards, in either theme. */
body #main :is(.rail-card,.rd-txcard,.rd-txhosp,.rd-txdoc) { min-width: 0; }
body #main :is(.rail-card-actions,.rd-txcard-actions) {
 display: grid; grid-template-columns: minmax(0,1fr) 44px 44px;
 gap: 8px; align-items: center; width: 100%; min-width: 0;
}
body #main :is(.rail-card-actions,.rd-txcard-actions) > a {
 min-width: 0; min-height: 44px; margin: 0; padding: 9px 10px;
 display: flex; align-items: center; justify-content: center;
 border-radius: 12px; white-space: normal; text-align: center;
 font-size: 13px; line-height: 1.35; box-sizing: border-box;
}
body #main :is(.rail-card-actions,.rd-txcard-actions) > :is(.rail-btn-wa,.rd-txcard-wa) {
 width: 44px; height: 44px; padding: 0; font-size: 0;
}
body #main :is(.rail-card-actions,.rd-txcard-actions) > :is(.rail-btn-wa,.rd-txcard-wa) span { display: none; }
body #main :is(.rail-card-actions,.rd-txcard-actions) .icon { width: 18px; height: 18px; flex: 0 0 18px; }
/* Match the approved compact-icon layout on hospital directories as well. */
body:not(.wl) #main .provider-card-actions > a:first-child { grid-column: 1; }
body:not(.wl) #main .provider-card-actions > a:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
body:not(.wl) #main .provider-card-actions > .provider-chat { grid-row: 1; grid-column: 2; }
body:not(.wl) #main .provider-card-actions > .provider-chat.telegram-link { grid-column: 3; }

/* Service identity must win over cloned WhatsApp classes and inline colours. */
body a.telegram-link:is(.rail-btn,.rd-txcard-wa,.provider-chat,.nav-wa-btn,.medical-nav-whatsapp,.wellness-nav-whatsapp,.sticky-btn,.btn-primary,.btn-outline,.btn-outline-teal,.rd-btn,.rd-btn-line,.rd-btn-ghost,.rd-quick-card,.wl-btn,.wl-ghost) {
 background: #eaf6fd !important; color: #087ab2 !important; border-color: #bddfee !important;
}
body a.telegram-link .icon { color: #168ac4 !important; }
body a[href*="wa.me/"]:is(.rail-btn-wa,.rd-txcard-wa,.provider-chat,.nav-wa-btn,.medical-nav-whatsapp,.wellness-nav-whatsapp,.sticky-btn-wa,.btn-primary,.btn-outline,.btn-outline-teal,.rd-btn-ghost,.rd-quick-card,.wl-ghost) {
 background: #25d366 !important; color: #073b1e !important; border-color: #25d366 !important;
}
body a[href*="wa.me/"]:is(.rail-btn-wa,.rd-txcard-wa,.provider-chat,.nav-wa-btn,.sticky-btn-wa) .icon { color: #073b1e !important; }
body #main :is(.rd-hero-actions,.card-actions,.rd-txnote-links,.contact-action-row) { flex-wrap: wrap; gap: 10px; min-width: 0; }
body #main :is(.rd-hero-actions,.card-actions,.rd-txnote-links,.contact-action-row) > a { max-width: 100%; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
body #main .contact-action-row > a { flex-shrink: 1; }
body #main :is(.rail-card-photo,.rail-card-avatar) { max-width: 100%; }
/* Footer service links each occupy their own icon/text contact row. */
body .footer-contact li.is-telegram { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 10px; align-items: center; }
body .footer-contact .is-telegram .icon { width: 20px; height: 20px; color: #8cc8f2; margin-top: 0; }
body .footer-contact .is-telegram a.telegram-link { color: #8cc8f2 !important; width: auto; min-width: 0; white-space: normal; word-break: normal; overflow-wrap: normal; }
