[hidden] { display: none !important; }

:root {
  --d-paper: #FFFFFF;
  --d-ink: #0F172A;
  --d-ink-soft: #475569;
  --d-ink-faint: #94A3B8;
  --d-rx: #1D4ED8;
  --d-rx-dark: #1E40AF;
  --d-rx-light: #DBEAFE;
  --d-rx-lighter: #EFF6FF;
  --d-safe-bottom: env(safe-area-inset-bottom, 0px);
  --d-safe-top: env(safe-area-inset-top, 0px);
}

body {
  background: var(--d-paper);
  color: var(--d-ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.d-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  padding-top: var(--d-safe-top);
}
.d-header-inner {
  max-width: 48rem;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}
.d-brand { text-decoration: none; display: flex; flex-direction: column; }
.d-brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--d-ink); }
.d-brand-sub { margin-top: 2px; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.22em; color: var(--d-ink-soft); }
.d-nav { display: flex; gap: 2px; border: 1px solid rgba(15, 23, 42, 0.1); border-radius: 999px; background: white; padding: 2px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.d-nav-link { padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--d-ink-soft); text-decoration: none; transition: background-color 0.15s, color 0.15s; }
.d-nav-link.active { background: var(--d-ink); color: var(--d-paper); }
.d-nav-link:not(.active):hover { color: var(--d-ink); }
.d-auth-link { margin-left: 10px; font-size: 12px; font-weight: 600; color: var(--d-rx); text-decoration: none; white-space: nowrap; }
.d-auth-link:hover { text-decoration: underline; }
.d-btn-dimmed { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.d-signin-link { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--d-rx); text-decoration: none; }
.d-signin-link:hover { text-decoration: underline; }
.d-phone-masked-note { margin: 4px 0 0; font-size: 11px; color: var(--d-ink-faint); }
.d-rule { height: 2px; background-image: linear-gradient(90deg, var(--d-rx) 0%, var(--d-rx) 62.5%, transparent 62.5%, transparent 100%); background-size: 16px 2px; background-repeat: repeat-x; }

.d-main { max-width: 48rem; margin: 0 auto; padding: 1rem 1rem 6rem; }

.d-sticky-top { position: sticky; top: 64px; z-index: 25; background: var(--d-paper); padding-bottom: 0.5rem; margin: 0 -1rem; padding-left: 1rem; padding-right: 1rem; padding-top: 0.5rem; }
.d-h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; margin: 0; }
.d-meta { margin: 2px 0 0; font-size: 12.5px; color: var(--d-ink-faint); }

.d-search { display: flex; align-items: center; gap: 8px; height: 44px; border-radius: 12px; border: 1px solid rgba(15,23,42,0.15); background: var(--d-paper); padding: 0 14px; margin-top: 12px; }
.d-search:focus-within { border-color: var(--d-rx); }
.d-search-icon { color: var(--d-ink-faint); font-size: 16px; }
.d-search input { flex: 1; border: 0; background: transparent; font-size: 16px; color: var(--d-ink); outline: none; }
.d-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.d-search-clear { margin-left: 4px; }
.d-search-hint { margin: 8px 0 0; padding: 0 4px; font-size: 11px; font-weight: 500; color: var(--d-ink-faint); }

.d-filter-row { margin-top: 10px; padding: 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.d-filter-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: var(--d-rx); padding: 4px 12px; font-size: 12px; font-weight: 600; color: white; }
.d-filter-count { font-size: 12px; font-weight: 500; color: var(--d-ink-faint); }

.d-specialty-banner { margin: 0 -1rem 8px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(15,23,42,0.1); background: var(--d-rx-lighter); padding: 10px 1rem; }
.d-specialty-banner-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--d-rx); }
.d-specialty-banner-count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--d-rx-dark); }

.d-empty { padding: 4rem 0; text-align: center; }
.d-empty p { font-size: 14px; color: var(--d-ink-faint); margin: 0 0 1rem; }

.d-btn-pill { border-radius: 999px; background: var(--d-rx); color: white; border: 0; padding: 8px 20px; font-size: 13px; font-weight: 600; cursor: pointer; }
.d-btn-pill:active { transform: scale(0.95); }

.d-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 999px; background: rgba(15,23,42,0.1); color: var(--d-ink-soft); border: 0; cursor: pointer; }

.d-section-heading { position: sticky; top: 154px; z-index: 20; margin: 0 -1rem; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.95); backdrop-filter: blur(8px); padding: 8px 1rem; }
.d-section-heading .bi { color: var(--d-ink-faint); font-size: 14px; }
.d-section-heading-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: var(--d-ink-soft); }
.d-section-count { margin-left: auto; border-radius: 999px; background: rgba(15,23,42,0.05); padding: 2px 8px; font-size: 10.5px; font-weight: 600; color: var(--d-ink-faint); }

.d-row, .d-list-btn { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid rgba(15,23,42,0.06); background: transparent; padding: 10px 4px; text-align: left; cursor: pointer; }
.d-row:last-child, .d-list-btn:last-child { border-bottom: 0; }
.d-row:hover, .d-list-btn:hover { background: rgba(239,246,255,0.6); }
.d-chip { display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(15,23,42,0.06); color: rgba(15,23,42,0.6); }
.d-chip .bi { font-size: 16px; }
.d-chip-lg { width: 48px; height: 48px; border-radius: 12px; }
.d-chip-lg .bi { font-size: 22px; }
.d-row-main, .d-list-btn-main { min-width: 0; flex: 1; }
.d-row-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 600; color: var(--d-ink); }
.d-row-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; font-size: 12px; font-weight: 500; color: var(--d-ink-faint); }
.d-row .bi-chevron-right { color: rgba(15,23,42,0.2); font-size: 14px; }
mark { background: var(--d-rx-light); padding: 0 1px; border-radius: 2px; font-weight: 600; color: inherit; }

.d-fab { position: fixed; bottom: calc(1.5rem + var(--d-safe-bottom)); right: 1.25rem; z-index: 40; display: flex; align-items: center; gap: 10px; height: 52px; border-radius: 999px; background: var(--d-ink); color: var(--d-paper); border: 0; padding: 0 20px; box-shadow: 0 12px 24px rgba(15,23,42,0.25); cursor: pointer; font-size: 14px; font-weight: 600; }
.d-fab:active { transform: scale(0.95); }

.d-sheet-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(15,23,42,0.5); backdrop-filter: blur(4px); }
.d-sheet { width: 100%; max-width: 28rem; border-radius: 24px 24px 0 0; background: var(--d-paper); padding-bottom: var(--d-safe-bottom); max-height: 85vh; overflow-y: auto; animation: d-slide-up 0.25s ease-out; }
@keyframes d-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.d-sheet-grabber { width: 48px; height: 6px; border-radius: 999px; background: rgba(15,23,42,0.15); margin: 12px auto 8px; }
.d-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 8px 20px 16px; }
.d-sheet-head-main { display: flex; align-items: center; gap: 14px; }
.d-sheet-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.d-sheet-sub { margin: 2px 0 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--d-ink-faint); }
.d-sheet-org { margin: 4px 0 0; font-size: 13px; color: var(--d-ink-soft); }
.d-role-badge { display: inline-block; border-radius: 999px; background: var(--d-ink); padding: 2px 10px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; color: var(--d-paper); margin-bottom: 4px; }

.d-specialty-list { max-height: 60vh; overflow-y: auto; padding: 0 12px 16px; }
.d-specialty-row { display: flex; width: 100%; align-items: center; gap: 12px; border: 0; background: transparent; border-radius: 12px; padding: 10px 12px; text-align: left; cursor: pointer; }
.d-specialty-row:hover { background: rgba(239,246,255,0.6); }
.d-specialty-row-label { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--d-ink); }
.d-count-badge { border-radius: 999px; background: rgba(15,23,42,0.05); padding: 2px 8px; font-size: 11px; font-weight: 600; color: var(--d-ink-faint); }

.d-phone-list { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.d-phone-card { border-radius: 16px; border: 1px solid rgba(15,23,42,0.1); background: white; padding: 16px; }
.d-phone-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.18em; color: var(--d-ink-faint); margin: 0; }
.d-phone-number { font-variant-numeric: tabular-nums; padding: 4px 0 16px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--d-ink); }
.d-phone-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.d-phone-actions a { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 12px; font-size: 14px; font-weight: 600; text-decoration: none; }
.d-call-btn { background: var(--d-ink); color: var(--d-paper); }
.d-whatsapp-btn { background: #25D366; color: white; }
.d-phone-actions a:active { transform: scale(0.95); }

.d-council-head { padding: 0 4px; margin-bottom: 1.5rem; }
.d-council-list { display: flex; flex-direction: column; gap: 1rem; }
.d-council-card { display: block; width: 100%; text-align: left; border-radius: 20px; padding: 1.5rem; border: 1px solid rgba(15,23,42,0.1); background: white; box-shadow: 0 1px 2px rgba(15,23,42,0.03); cursor: pointer; }
.d-council-card:active { transform: scale(0.98); }
.d-council-card-primary { background: var(--d-ink); color: var(--d-paper); border: none; box-shadow: 0 20px 40px rgba(15,23,42,0.2); }
.d-role-pill { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.2em; background: var(--d-rx-lighter); color: var(--d-rx); }
.d-council-card-primary .d-role-pill { background: var(--d-rx); color: white; }
.d-council-name { display: block; margin-top: 1rem; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--d-ink); }
.d-council-card-primary .d-council-name { color: var(--d-paper); }
.d-council-org { display: block; margin-top: 6px; font-size: 14px; color: var(--d-ink-soft); }
.d-council-card-primary .d-council-org { color: rgba(255,255,255,0.6); }
.d-council-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 1.25rem; font-size: 13px; font-weight: 600; color: var(--d-ink-soft); }
.d-council-card-primary .d-council-cta { color: rgba(255,255,255,0.8); }

/* Phone + OTP login flow */
.d-auth-main { display: flex; justify-content: center; padding-top: 3rem; }
.d-auth-card { width: 100%; max-width: 22rem; text-align: center; }
.d-auth-icon { margin: 0 auto 1rem; width: 56px; height: 56px; border-radius: 16px; }
.d-auth-icon .bi { font-size: 26px; }
.d-auth-title { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 8px; }
.d-auth-sub { font-size: 13.5px; color: var(--d-ink-soft); margin: 0 0 20px; line-height: 1.5; }
.d-auth-error { font-size: 13px; font-weight: 600; color: #B91C1C; background: #FEF2F2; border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; text-align: left; }
.d-auth-form { display: flex; flex-direction: column; gap: 10px; }
.d-auth-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--d-ink-faint); text-align: left; }
.d-auth-input { height: 52px; border-radius: 12px; border: 1px solid rgba(15,23,42,0.15); background: var(--d-paper); padding: 0 16px; font-size: 18px; color: var(--d-ink); outline: none; text-align: center; letter-spacing: 0.05em; }
.d-auth-input:focus { border-color: var(--d-rx); }
.d-otp-input { font-size: 28px; font-weight: 700; letter-spacing: 0.5em; padding-left: 20px; }
.d-auth-submit { width: 100%; height: 52px; font-size: 15px; margin-top: 6px; }
.d-auth-footnote { margin: 20px 0 0; font-size: 12.5px; color: var(--d-ink-faint); }
.d-auth-footnote a { color: var(--d-rx); font-weight: 600; text-decoration: none; }
.d-auth-footnote a:hover { text-decoration: underline; }
.d-dev-hint { font-size: 12px; font-weight: 600; color: #92400E; background: #FFFBEB; border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; text-align: left; }
.d-confirm-identity { border: 1px solid rgba(15,23,42,0.1); border-radius: 16px; padding: 20px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 2px; }
.d-confirm-name { font-size: 19px; font-weight: 700; color: var(--d-ink); }
.d-confirm-sub { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--d-ink-faint); }
.d-confirm-phone { margin-top: 8px; font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; color: var(--d-ink-soft); }
.d-auth-resend-form { margin-top: 14px; }
.d-auth-resend { background: none; border: 0; font-size: 12.5px; font-weight: 600; color: var(--d-rx); cursor: pointer; padding: 0; }
.d-auth-resend:hover { text-decoration: underline; }
