:root{
  --bg:#F6F7F9;
  --card:#FFFFFF;
  --ink:#1C2126;
  --muted:#5A626A;
  --line:#DCE1E7;

  --accent:#0B5CAB;
  --accentSoft:#E8F1FB;

  --shadow: 0 10px 30px rgba(16,24,40,.08);
  --radius:18px;
  --max:1180px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--ink);
  background:var(--bg);
  line-height:1.4;
}

img{ max-width:100%; display:block; }

a{ color:inherit; text-decoration:none; }
a.underline{ text-decoration:underline; }

.container{
  max-width:var(--max);
  margin:0 auto;
  padding:0 18px;
}

/* Safer text wrapping (prevents "runs outside the box") */
.muted, .small, .tile p, .tile li, .bioValue, .panel, .notice{
  overflow-wrap:anywhere;
  word-break:normal;
}

/* Accessibility */
.skip-link{
  position:absolute;
  left:-999px;
  top:0;
  background:#fff;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
}
.skip-link:focus{
  left:18px;
  top:10px;
  z-index:999;
}

/* Header / Nav */
header{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(246,247,249,.88);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 0;
  gap:14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:260px;
}
.brand img{
  width:44px;
  height:44px;
  object-fit:contain;
  border-radius:10px;
  background:#fff;
  border:1px solid var(--line);
  padding:4px;
  flex:0 0 auto;
}
.brand .name{ font-weight:900; }
.brand .tagline{ font-size:12px; color:var(--muted); }

nav{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
}

.navlink{
  display:inline-flex;
  align-items:center;
  padding:10px 12px;
  border-radius:12px;
  font-weight:900;
  color:var(--muted);
}

.navlink:hover{
  background:rgba(255,255,255,.75);
  border:1px solid var(--line);
  color:var(--ink);
}

.navlink:focus-visible{
  outline:none;
  box-shadow: 0 0 0 4px rgba(11,92,171,.18);
  border:1px solid rgba(11,92,171,.35);
}

.navlink[aria-current="page"]{
  background:#fff;
  border:1px solid var(--line);
  color:var(--ink);
}

/* Buttons */
.cta{ display:flex; gap:10px; align-items:center; }

.btn{
  border:1px solid var(--line);
  background:#fff;
  padding:10px 14px;
  border-radius:14px;
  font-weight:900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:10px;
}

.btn.primary{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}

.btn.soft{
  background:var(--accentSoft);
  color:var(--accent);
  border-color:var(--line);
}

.btn:hover,
.mini:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(16,24,40,.10);
}

.btn:active,
.mini:active{
  transform: translateY(0px);
  box-shadow: none;
}

.btn:focus-visible,
.mini:focus-visible{
  outline:none;
  box-shadow: 0 0 0 4px rgba(11,92,171,.18);
  border-color: rgba(11,92,171,.35);
}

/* Layout / Sections */
main{ padding:26px 0 54px; }

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

.sectionTitle{
  margin:22px 0 10px;
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:10px;
}

.sectionTitle h1,
.sectionTitle h2,
.sectionTitle h3{
  margin:0;
  letter-spacing:-.3px;
}
.sectionTitle h1{ font-size:28px; }
.sectionTitle h2{ font-size:24px; }
.sectionTitle .hint{ color:var(--muted); font-size:13px; }

/* Hero */
.hero{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:18px;
  padding:22px;
}
.hero h1{
  margin:0 0 10px;
  font-size:42px;
  letter-spacing:-.8px;
}
.hero p{
  margin:0 0 16px;
  color:var(--muted);
  font-size:16px;
}
.hero .actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.heroArt{
  min-height:260px;
  border-radius:16px;
  border:1px dashed var(--line);
  background:linear-gradient(135deg,#ffffff,#eef3f8);
  overflow:hidden;
}
.heroArt img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* Pills */
.pill{
  background:var(--accentSoft);
  color:var(--accent);
  border:1px solid var(--line);
  padding:8px 10px;
  border-radius:999px;
  font-size:13px;
  font-weight:900;
}

/* Tiles / Grid */
.grid4{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:14px;
}

.tile{ padding:16px; }
.tile h3{ margin:0 0 6px; font-size:16px; }
.tile p{ margin:0 0 10px; color:var(--muted); font-size:13px; }

/* Notice */
.notice{
  margin-top:14px;
  padding:14px 16px;
  border-radius:16px;
  background:var(--accentSoft);
  border:1px solid var(--line);
  color:var(--accent);
  font-weight:900;
}

/* Filters */
.filters{
  display:grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap:10px;
  padding:14px;
}

.field label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
  font-weight:900;
}

.field input,
.field select{
  width:100%;
  padding:11px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
  outline:none;
}

.field input:focus,
.field select:focus{
  border-color: rgba(11,92,171,.45);
  box-shadow: 0 0 0 4px rgba(11,92,171,.12);
}

/* Directory list cards */
.list{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  padding:14px;
}

/* Generic helpers */
.row{
  display:flex;
  gap:14px;
  align-items:flex-start;
}
.rowTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.rowTop h3, .rowTop h4{
  flex: 1 1 auto;
  min-width: 0;
}
.grow{
  flex:1 1 auto;
  min-width:0;
}
.m0{ margin:0; }
.spacer8{ height:8px; }
.spacer12{ height:12px; }

.muted{ color:var(--muted); }
.small{ font-size:13px; color:var(--muted); }

/* Small buttons */
.mini{
  padding:9px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  font-weight:900;
  cursor:pointer;
  font-size:13px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.mini.primary{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}

.mini.soft{
  background:var(--accentSoft);
  color:var(--accent);
}

/* Cards that are rendered as rows inside the .list container */
.card.row{
  padding:16px;
  box-shadow:none;
}

/* Provider avatars (prevents huge images) */
.avatarWrap{
  width:88px;
  height:88px;
  border-radius:18px;
  border:1px solid var(--line);
  background:#f1f4f7;
  overflow:hidden;
  flex:0 0 auto;
}

.avatarImg{
  width:100%;
  height:100%;
  object-fit:cover;
}

.avatarFallback{
  width:100%;
  height:100%;
  display:none;
  place-items:center;
  font-weight:900;
  color:var(--muted);
}

/* Detail pages */
.detail{ padding:18px; }

.detail .avatarWrap{
  width:260px;
  height:260px;
  border-radius:20px;
}

.panel{
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
}

.panel h3,
.panel h4{ margin:0 0 8px; font-size:14px; }

.panel ul{
  margin:0;
  padding-left:18px;
  color:var(--muted);
  font-size:13px;
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Specialties page enhancements */
.specTile .specTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.specBullets{
  margin:10px 0 0;
  padding-left:18px;
  color:var(--muted);
  font-size:13px;
}

.tileActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

/* Provider bio card */
.bioCard{
  margin-top:12px;
}

.bioRow{
  display:grid;
  grid-template-columns: 220px 1fr;
  gap:14px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}

.bioRow:last-child{
  border-bottom:none;
}

.bioLabel{
  font-weight:900;
  color:var(--ink);
  font-size:13px;
}

.bioValue{
  color:var(--muted);
  font-size:13px;
}

.bioList{
  margin:0;
  padding-left:18px;
}

/* Footer */
.footer{
  margin-top:24px;
  padding:18px 0;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:13px;
  display:flex;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}

/* Responsive */
@media (max-width: 1020px){
  .hero{ grid-template-columns:1fr; }
  .grid4{ grid-template-columns:1fr 1fr; }
  .filters{ grid-template-columns:1fr; }
  .list{ grid-template-columns:1fr; }
  nav{ justify-content:flex-start; }
  .brand{ min-width:unset; }
  .topbar{ align-items:flex-start; }
  .cta{ width:100%; justify-content:flex-start; }
}

@media (max-width: 820px){
  .detail .row{ flex-direction:column; }
  .detail .avatarWrap{ width:180px; height:180px; }
  .bioRow{ grid-template-columns: 1fr; }
}

@media (max-width: 520px){
  .grid4{ grid-template-columns:1fr; }
  .hero h1{ font-size:34px; }
}
