:root {
  --app-bg: #f5f7fb;
  --app-surface: #ffffff;
  --app-border: #e7eaf0;
  --app-text: #1f2937;
  --app-muted: #6b7280;
  --app-primary: #0d6efd;
  --app-purple: #6f42c1;
  --app-radius: 18px;
  --app-shadow: 0 14px 40px rgba(31, 41, 55, .07);
}

@font-face {
    font-family: "Avenir Next World";
    src: url("../fonts/AvenirNextWorld-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--app-text);
  background:
    radial-gradient(circle at top left, rgba(13, 110, 253, .08), transparent 30rem),
    radial-gradient(circle at 85% 20%, rgba(111, 66, 193, .06), transparent 28rem),
    var(--app-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { text-underline-offset: 2px; }

.site-navbar {
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(231, 234, 240, .9);
  box-shadow: 0 6px 22px rgba(31, 41, 55, .04);
}

.site-brand { gap: .7rem; color: #111827; }
.site-brand:hover { color: #111827; }
.site-brand-title { font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.site-brand-subtitle { color: var(--app-muted); font-size: .72rem; line-height: 1.15; }

.navbar-nav .nav-link {
  color: #4b5563;
  font-weight: 650;
  font-size: .93rem;
  border-radius: 9px;
  padding: .55rem .72rem !important;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #0d6efd;
  background: rgba(13, 110, 253, .07);
}
.dropdown-menu {
  border: 1px solid var(--app-border);
  border-radius: 14px;
  padding: .45rem;
  box-shadow: 0 18px 40px rgba(31, 41, 55, .12);
}
.dropdown-item {
  border-radius: 9px;
  padding: .55rem .65rem;
  font-size: .9rem;
}
.dropdown-item:active { background: var(--app-primary); }

.page-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 52px;
}
.page-shell-wide {
  width: min(1920px, calc(100% - 28px));
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 24px;
}
.page-heading h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -.035em;
}
.page-heading p {
  color: var(--app-muted);
  margin: .35rem 0 0;
  /*max-width: 760px;*/
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--app-primary), var(--app-purple));
  color: #fff;
  font-size: 21px;
  box-shadow: 0 8px 20px rgba(13,110,253,.22);
}

.surface-card,
.tool-card,
.resource-card,
.search-card {
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}

.hero-card {
  overflow: hidden;
  position: relative;
  padding: clamp(28px, 5vw, 58px);
  min-height: 310px;
  display: flex;
  align-items: center;
}
.hero-card::after {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  right: -90px;
  top: -110px;
  background: linear-gradient(135deg, rgba(13,110,253,.14), rgba(111,66,193,.1));
  pointer-events: none;
}
.hero-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  margin-bottom: 18px;
  filter: drop-shadow(0 8px 15px rgba(0,0,0,.08));
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.35rem);
  font-weight: 850;
  letter-spacing: -.05em;
  margin: 0 0 .7rem;
}
.hero-copy { color: var(--app-muted); max-width: 680px; font-size: 1.04rem; }

.section-heading { margin: 34px 0 16px; }
.section-heading h2 { font-size: 1.15rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.section-heading p { color: var(--app-muted); font-size: .9rem; margin: .25rem 0 0; }

.tool-card,
.resource-card {
  height: 100%;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tool-card:hover,
.resource-card:hover {
  transform: translateY(-3px);
  border-color: #d9e3f2;
  box-shadow: 0 18px 46px rgba(31,41,55,.11);
}
.tool-card a.stretched-link,
.resource-card a.stretched-link { text-decoration: none; }
.tool-card .card-body,
.resource-card .card-body { padding: 22px; }
.tool-icon,
.resource-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  margin-bottom: 16px;
  background: rgba(13,110,253,.09);
  color: var(--app-primary);
  font-size: 19px;
}
.tool-card h3,
.resource-card h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: .45rem; }
.tool-card p,
.resource-card p { color: var(--app-muted); font-size: .9rem; margin-bottom: 0; }
.tool-meta { margin-top: 14px; font-size: .78rem; font-weight: 700; color: #64748b; }

.search-card { padding: 16px; margin-bottom: 18px; }
.form-control,
.form-select,
.input-group-text {
  border-color: #d9dee7;
  border-radius: 11px;
}
.form-control,
.form-select { min-height: 44px; }
.form-control:focus,
.form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 .22rem rgba(13,110,253,.10);
}
.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > .input-group-text:not(:last-child),
.input-group > .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

.btn { border-radius: 11px; font-weight: 700; }
.btn-primary { box-shadow: 0 8px 18px rgba(13,110,253,.16); }

/* Address book */
#contentPanel { --bs-gutter-y: 1rem; }
.contact-card {
  border: 1px solid var(--app-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 26px rgba(31,41,55,.06) !important;
  overflow: hidden;
  background: #fff !important;
  transition: transform .16s ease, box-shadow .16s ease;
}
.contact-card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(31,41,55,.1) !important; }
.contact-card .card-img-top-style {
  min-height: 90px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.contact-card .card-body { padding: 16px; }
.contact-card .card-title { font-size: 1rem; font-weight: 800; letter-spacing: -.01em; }
.contact-card .card-title-under { color: #64748b !important; font-size: .78rem; }
.contact-card .card-footer {
  background: #fafbfc;
  border-top: 1px solid #eef0f4;
  color: #64748b;
  font-size: .78rem;
  padding: .65rem .9rem;
}
.copy-area {
  font-size: .88rem;
  text-align: left !important;
  word-break: break-word;
  border-radius: 9px !important;
  padding: .37rem .5rem !important;
  margin: 2px 0;
  color: #374151;
  background: #f8fafc !important;
  border: 1px solid transparent !important;
}
.copy-area:hover {
  color: #111827;
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  box-shadow: none !important;
}
.contact-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.contact-actions .btn { font-size: .75rem; padding: .34rem .55rem; }

/* Medication results */
.medication-card {
  border: 1px solid var(--app-border);
  border-radius: 16px;
  box-shadow: 0 8px 26px rgba(31,41,55,.06);
  height: 100%;
}
.medication-card .card-body { padding: 20px; }
.medication-card h3 { font-size: 1.05rem; font-weight: 800; }
.medication-meta { font-size: .82rem; color: #64748b; }
.medication-description { font-size: .9rem; color: #374151; }

.empty-state {
  text-align: center;
  padding: 44px 24px;
  color: var(--app-muted);
}
.empty-state .empty-icon { font-size: 2rem; color: #9ca3af; margin-bottom: 10px; }

.site-footer {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  color: #94a3b8;
  font-size: .78rem;
  padding: 0 0 28px;
}

@media (max-width: 991.98px) {
  .navbar-collapse { padding: .65rem 0 .35rem; }
  .page-heading { flex-direction: column; }
}

@media (max-width: 575.98px) {
  .page-shell, .site-footer { width: min(100% - 22px, 1220px); }
  .page-shell { padding-top: 22px; }
  .hero-card { padding: 28px 22px; min-height: 280px; }
}

.fa-custom-smile,
.fa-custom-file-csv {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  vertical-align: -2px;
}

.fa-custom-smile {
  -webkit-mask-image: url('../img/icon/face-smile.svg');
  mask-image: url('../img/icon/face-smile.svg');
  color: var(--app-muted);
}

.fa-custom-file-csv {
  -webkit-mask-image: url('../img/icon/file-csv.svg');
  mask-image: url('../img/icon/file-csv.svg');
  width: 18px;
  height: 18px;
  margin-right: 4px;
  vertical-align: -3px;
}

/* Typography - match Bootstrap / Envelope Printer */
:root {
    --bs-font-sans-serif:
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;
}

body {
    font-family:
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;
    font-weight: 400;
}

/* Branding */
.site-brand-logo {
    display: block;
    width: auto;
    height: 30px;
    max-width: 100%;
    margin-left: 5px;
}

.site-brand-title {
    font-family: "Avenir Next World", "Avenir Next", Avenir, sans-serif;
    font-weight: 500;
    letter-spacing: -0.01em;
    font-size: 1.15rem;
}

/* Navigation */
.navbar-nav .nav-link {
    font-weight: 500;
}

/* Page headings */
.hero-title {
    font-size: clamp(1.55rem, 2vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.page-heading h1 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.section-heading h2 {
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Home page cards */
.tool-card h3,
.resource-card h3 {
    font-weight: 600;
    letter-spacing: 0;
}

.tool-meta {
    font-weight: 600;
}

/* Address book */
.contact-card .card-title {
    font-weight: 600;
    letter-spacing: 0;
}

/* Medication search */
.medication-card h3 {
    font-weight: 600;
}

/* Buttons */
.btn {
    font-weight: 450;
}