/* Medicine section — layout of the approved Academy design, using the identity tokens
   defined in mci-academy-brand.css. */
.md { --md-pad: 20px; color: var(--ink); }
.md-wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--md-pad); }

/* Hero */
.md-hero { background: linear-gradient(180deg, var(--brand-tint) 0%, #fff 100%); border-bottom: 1px solid var(--mci-line); padding: 28px 0 36px; }
html[data-theme="dark"] .md-hero { background: linear-gradient(180deg, #0F2340 0%, var(--bg) 100%); border-bottom-color: var(--line); }
.md-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--mci-slate); margin-bottom: 18px; }
html[data-theme="dark"] .md-crumbs { color: var(--muted); }
.md-crumbs a { color: var(--brand-text); font-weight: 600; }
html[data-theme="dark"] .md-crumbs a { color: var(--brand-on-dark); }
.md-crumbs span[aria-hidden] { opacity: .55; }
.md-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 10px; }
html[data-theme="dark"] .md-eyebrow { color: var(--brand-on-dark); }
.md-eyebrow img { width: 22px; height: 15px; border-radius: 2px; }
.md-h1 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; font-weight: 800; color: var(--ink); max-width: 30em; }
.md-intro { margin-top: 16px; max-width: 52em; display: grid; gap: 12px; font-size: 16px; line-height: 1.65; color: var(--ink-2); }

/* Body grid */
.md-body { padding: 36px 0 72px; }
.md-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; align-items: start; }
.md-aside { position: sticky; top: 96px; display: grid; gap: 14px; }
.md-nav { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.md-nav__title { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--mci-slate); padding: 8px 10px 6px; }
html[data-theme="dark"] .md-nav__title { color: var(--muted); }
.md-nav a { display: block; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); line-height: 1.35; }
.md-nav a:hover { background: var(--blue-soft); }
.md-nav a.on { background: var(--brand-tint); color: var(--mci-navy); box-shadow: inset 3px 0 0 var(--brand); }
[dir="rtl"] .md-nav a.on { box-shadow: inset -3px 0 0 var(--brand); }
html[data-theme="dark"] .md-nav a.on { background: #16304F; color: #fff; }
.md-nav__toggle { display: none; }
.md-backlink { font-size: 13px; font-weight: 700; color: var(--brand-text); padding: 0 10px; }

/* Sections and blocks */
.md-main { display: grid; gap: 34px; min-width: 0; }
.md-sec { scroll-margin-top: 96px; display: grid; gap: 14px; min-width: 0; }
.md-sec + .md-sec { border-top: 1px solid var(--line); padding-top: 30px; }
.md-h2 { font-size: clamp(21px, 2.2vw, 26px); font-weight: 800; color: var(--ink); line-height: 1.25; }
.md-h3 { font-size: 16px; font-weight: 800; color: var(--ink); margin-top: 6px; }
.md-p { font-size: 16px; line-height: 1.65; color: var(--ink-2); max-width: 60em; }
.md-p strong, .md-list strong, .md-table strong { color: var(--ink); font-weight: 700; }
.md-p a, .md-list a, .md-table a { color: var(--brand-text); font-weight: 600; text-decoration: underline; }
.md-list { display: grid; gap: 8px; padding-inline-start: 22px; margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 60em; }
.md-list li::marker { color: var(--brand-text); font-weight: 700; }
.md-sec__label { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-text); }

/* Responsive tables: horizontal scroll inside the card on small screens */
.md-table-wrap { border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; background: var(--card); -webkit-overflow-scrolling: touch; }
.md-table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.md-table--wide { min-width: 640px; }
.md-table th { text-align: start; background: var(--mci-mist); color: var(--mci-navy); font-weight: 800; font-size: 12.5px; letter-spacing: .02em; padding: 11px 14px; border-bottom: 1px solid var(--line); }
html[data-theme="dark"] .md-table th { background: #0F1E33; color: #EAF1F8; }
.md-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.md-table tr:last-child td { border-bottom: 0; }
.md-table td:first-child { font-weight: 600; color: var(--ink); }

/* Navigation cards ("Go to …") — navigation, never product CTAs */
.md-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.md-card { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; transition: border-color .15s, box-shadow .15s; }
.md-card:hover { border-color: var(--brand); box-shadow: 0 8px 24px rgba(11, 42, 80, .08); }
.md-card__title { font-weight: 800; font-size: 15.5px; color: var(--ink); line-height: 1.35; }
.md-card__text { font-size: 14px; line-height: 1.55; color: var(--muted); }
.md-card__go { margin-top: auto; font-size: 13.5px; font-weight: 700; color: var(--brand-text); }
html[data-theme="dark"] .md-card__go { color: var(--brand-on-dark); }
.md-links { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.md-link { font-size: 14.5px; font-weight: 700; color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px; }
html[data-theme="dark"] .md-link { color: var(--brand-on-dark); }
.md-anchors { display: flex; flex-wrap: wrap; gap: 8px; }
.md-anchors a { font-size: 13px; font-weight: 700; color: var(--mci-navy); border: 1px solid var(--mci-divider); border-radius: 999px; padding: 6px 12px; background: #fff; }
html[data-theme="dark"] .md-anchors a { background: transparent; color: #EAF1F8; border-color: rgba(255,255,255,.2); }

/* CTA blocks and product buttons */
.md-sec--cta { background: var(--brand-tint); border: 1px solid #CDE9F3; border-radius: 18px; padding: 22px; }
.md-sec + .md-sec--cta { border-top: 1px solid #CDE9F3; padding-top: 22px; }
html[data-theme="dark"] .md-sec--cta { background: #0F2340; border-color: rgba(78, 182, 219, .25); }
.md-cta-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-text); }
html[data-theme="dark"] .md-cta-eyebrow { color: var(--brand-on-dark); }
.md-buttons { display: grid; gap: 12px; }
.md-btnrow { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.md-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 11px 18px; border-radius: 10px; font-weight: 700; font-size: 14.5px; line-height: 1.3; text-align: start; transition: background .15s, border-color .15s; }
.md .md-btn--start, .md button.md-btn--start { background: var(--btn-primary); color: #fff; }
.md .md-btn--start:hover, .md button.md-btn--start:hover { background: var(--mci-navy); }
.md .md-btn--notify { background: #fff; color: var(--mci-navy); border: 1.5px solid var(--mci-divider); }
.md-btn--notify:hover { border-color: var(--mci-blue); background: #F7FBFD; }
html[data-theme="dark"] .md-btn--notify { background: transparent; color: #EAF1F8; border-color: rgba(255,255,255,.25); }
.md-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.md-btnmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--mci-slate); }
html[data-theme="dark"] .md-btnmeta { color: var(--muted); }
.md-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.md-chip--available { background: #D1FAE5; color: #047857; }
.md-chip--soon { background: #FEF3C7; color: #92400E; }
.md-chip--wait { background: var(--mci-mist); color: var(--mci-slate); border: 1px solid var(--mci-line); }

/* Medicine index tree */
.md-regions { display: grid; gap: 34px; }
.md-region__label { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 12px; }
.md-countries { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.md-country { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.md-country__head { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--ink); }
.md-country__head img { width: 28px; height: 19px; border-radius: 3px; flex-shrink: 0; }
.md-country ol { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.4; }
.md-country ol a { color: var(--ink-2); font-weight: 500; }
.md-country ol a:hover { color: var(--brand-text); text-decoration: underline; }
.md-country__meta { font-size: 12px; color: var(--muted); }
.md-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.md-stat { background: #fff; border: 1px solid var(--mci-line); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--mci-slate); }
.md-stat b { display: block; font-size: 20px; color: var(--mci-navy); }
html[data-theme="dark"] .md-stat { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .md-stat b { color: #fff; }

/* Product page & forms */
.md-panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 14px; }
.md-dl { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 10px 18px; font-size: 14.5px; margin: 0; }
.md-dl dt { font-weight: 700; color: var(--mci-slate); }
.md-dl dd { margin: 0; color: var(--ink); font-weight: 600; }
.md-alert { border-radius: 12px; padding: 14px 16px; font-size: 14.5px; line-height: 1.55; }
.md-alert--ok { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.md-alert--info { background: var(--brand-tint); color: var(--mci-navy); border: 1px solid #CDE9F3; }
.md-alert--warn { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.md-alert--error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.md-form { display: grid; gap: 16px; }
.md-field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.md-field input { width: 100%; min-height: 44px; border: 1px solid var(--mci-divider); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px; background: #fff; color: var(--mci-navy); }
.md-field input:focus { outline: 3px solid rgba(34, 164, 210, .35); border-color: var(--brand); }
.md-field input[aria-invalid="true"] { border-color: #DC2626; }
.md-field .md-err { color: #B91C1C; font-size: 13px; margin-top: 6px; }
.md-other { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13.5px; color: var(--muted); }
.md-other a { font-weight: 700; color: var(--brand-text); }
.md-dir-country { display: grid; gap: 12px; }
.md-dir-country h2 { font-size: 20px; font-weight: 800; }
.md-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }

@media (max-width: 1023px) {
  .md-grid { grid-template-columns: 1fr; gap: 24px; }
  .md-aside { position: static; }
  .md-nav__toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; font-weight: 800; font-size: 14px; padding: 10px; color: var(--ink); }
  .md-nav[data-collapsed="true"] .md-nav__list { display: none; }
}
@media (max-width: 640px) {
  .md { --md-pad: 16px; }
  .md-hero { padding: 20px 0 26px; }
  .md-sec--cta { padding: 18px; }
  .md-btn { width: 100%; }
  .md-btnrow { align-items: stretch; }
  .md-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .md-dl dd { margin-bottom: 8px; }
}
