/* doctor.promedic1.com — library design system (single file, no webfonts) */
:root {
  --ac: #0d9488;
  --ink: #16202e;
  --ink-soft: #4b5a6e;
  --paper: #f7f5f0;
  --card: #ffffff;
  --line: #e5e0d6;
  --accent-soft: color-mix(in srgb, var(--ac) 12%, white);
  --accent-deep: color-mix(in srgb, var(--ac) 78%, black);
  --side-w: 308px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Naskh Arabic UI",
    "Noto Naskh Arabic", "Geeza Pro", "Times New Roman", Tahoma, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.85;
  font-size: 16.5px;
}
a { color: var(--ac); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #101a28 0%, #16222f 100%);
  color: #cfd9e4; border-inline-end: 1px solid #0b131d;
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 20px 20px 14px;
  color: #fff; font-weight: 800; font-size: 19px; letter-spacing: .3px;
}
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: conic-gradient(from 40deg, #14b8a6, #8b5cf6, #ef4565, #f59e0b, #14b8a6);
  box-shadow: 0 0 12px #14b8a6aa;
}
.brand-sub { font-weight: 500; font-size: 12px; opacity: .55; margin-inline-start: 2px; }
.side-search { padding: 4px 16px 12px; }
.side-search input {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid #2a3947;
  background: #0d1622; color: #e8eef4; font-size: 13.5px; font-family: inherit;
}
.side-search input:focus { outline: 2px solid var(--ac); border-color: transparent; }
.side-scroll { overflow-y: auto; flex: 1; padding: 4px 12px 30px; }
.side-scroll::-webkit-scrollbar { width: 8px; }
.side-scroll::-webkit-scrollbar-thumb { background: #2a3947; border-radius: 4px; }
.sd-h {
  margin: 18px 8px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: #7f93a6;
}
.sd-h.dim { color: #5c6e80; }
.sd-ul { list-style: none; margin: 0; padding: 0; }
.sd {
  display: block; padding: 7px 10px; margin: 2px 0; border-radius: 9px;
  color: #d6dfe8; font-size: 13.2px; line-height: 1.55; border-inline-start: 3px solid transparent;
}
.sd:hover { background: #1d2b3a; text-decoration: none; }
.sd.active {
  background: #20303f; color: #fff; font-weight: 600;
  border-inline-start: 3px solid var(--ac, #14b8a6);
}
.tag {
  display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 20px;
  background: #24343f; color: #93a7b8; vertical-align: middle;
}

/* ---------- main ---------- */
.main { min-width: 0; padding: 34px clamp(18px, 4vw, 58px) 60px; max-width: 1060px; }
.crumbs { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.pg-head h1 {
  margin: 6px 0 4px; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.35; font-weight: 800;
}
.sub { margin: 0 0 14px; color: var(--ink-soft); font-size: 16px; }
.cat-chip {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .4px;
  color: var(--accent-deep); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--ac) 35%, white);
  padding: 3px 12px; border-radius: 20px;
}
.cat-chip.sm { font-size: 11px; padding: 2px 9px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.badge {
  font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 20px;
  background: color-mix(in srgb, var(--ac) 14%, white); color: var(--accent-deep);
}
.badge.twin { background: #eef1f4; color: #5a6b7d; font-weight: 500; }
.stat { font-size: 13px; color: var(--ink-soft); }
.dl {
  font-size: 13px; font-weight: 600; padding: 5px 14px; border-radius: 9px;
  background: var(--ac); color: #fff !important; box-shadow: 0 2px 10px color-mix(in srgb, var(--ac) 35%, transparent);
}
.dl:hover { background: var(--accent-deep); text-decoration: none; }
.note {
  background: #fdf6e7; border: 1px solid #f0dcb0; border-radius: 10px;
  padding: 10px 14px; font-size: 14px; color: #7a5d1c;
}

/* ---------- toolbar ---------- */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 5; margin: 14px -6px 22px; padding: 8px 6px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.btn {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 6px 16px; border-radius: 9px; border: 1px solid color-mix(in srgb, var(--ac) 45%, white);
  background: var(--accent-soft); color: var(--accent-deep);
}
.btn:hover { background: color-mix(in srgb, var(--ac) 22%, white); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.tb-sp { flex: 1; }

/* ---------- collapsible sections ---------- */
.content { display: flex; flex-direction: column; gap: 14px; }
.sec {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: 0 1px 3px rgb(20 30 45 / 5%);
}
.sec > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; font-weight: 750; font-size: 17.5px; line-height: 1.5;
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
  border-inline-start: 4px solid var(--ac);
}
.sec > summary::-webkit-details-marker { display: none; }
.sec-mark {
  flex: none; width: 9px; height: 9px; border-radius: 3px; background: var(--ac);
  transform: rotate(45deg); transition: transform .18s ease;
}
.sec[open] > summary .sec-mark { transform: rotate(0deg) scale(1.25); }
.sec > summary:hover { background: linear-gradient(90deg, color-mix(in srgb, var(--ac) 20%, white), transparent 75%); }
.sec-body { padding: 6px 22px 20px; }
.sec.refs > summary { font-size: 15px; }
.count {
  font-size: 11.5px; font-weight: 600; background: #eef1f4; color: #5a6b7d;
  padding: 1px 9px; border-radius: 12px;
}
.content > h2 {
  font-size: 22px; margin: 18px 4px 2px; padding-inline-start: 12px;
  border-inline-start: 4px solid var(--ac);
}
.content h3 {
  font-size: 17.5px; margin: 20px 0 4px; color: var(--accent-deep);
}
.b-p { margin: 10px 0; }
.b-li { margin: 6px 0; padding-inline-start: 18px; position: relative; }
.b-li::before {
  content: ""; position: absolute; inset-inline-start: 2px; top: .85em;
  width: 7px; height: 7px; border-radius: 2px; background: var(--ac); transform: rotate(45deg);
}
.chat {
  display: inline-block; margin: 14px 0 4px; font-size: 12px; font-weight: 800;
  letter-spacing: 1px; padding: 2px 14px; border-radius: 16px;
}
.chat-user { background: #e8edf3; color: #51617a; }
.chat-kimi { background: var(--accent-soft); color: var(--accent-deep); }
.ref-line { font-size: 13.5px; color: var(--ink-soft); padding: 3px 0; border-bottom: 1px dashed var(--line); }
.sec.refs .sec-body { columns: 2; column-gap: 34px; }
.sec.refs .sec-body .tbl-wrap { column-span: all; }
.sec.refs .ref-line { break-inside: avoid; border-bottom: none; }
.muted { color: var(--ink-soft); font-size: 13px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; margin: 14px 0; border-radius: 11px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 14.2px; line-height: 1.7; }
thead th {
  background: var(--accent-soft); color: var(--accent-deep);
  font-weight: 750; text-align: start; padding: 9px 13px; white-space: nowrap;
}
tbody td { padding: 8px 13px; border-top: 1px solid var(--line); vertical-align: top; min-width: 90px; }
tbody tr:nth-child(even) { background: #faf9f6; }

/* ---------- avian deck ---------- */
.deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 10px 0 24px; }
.deck figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.deck img { display: block; width: 100%; height: auto; }
.deck figcaption { text-align: center; font-size: 12px; color: var(--ink-soft); padding: 5px; }

/* ---------- index ---------- */
.hero { padding: 30px 0 10px; }
.hero-kicker { color: var(--ac); font-weight: 800; letter-spacing: 2px; font-size: 13px; }
.hero h1 { font-size: clamp(30px, 4.4vw, 46px); margin: 8px 0 6px; }
.hero .sub { font-size: 17.5px; max-width: 62ch; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; }
.hs {
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  padding: 10px 22px; text-align: center; min-width: 108px;
}
.hs b { display: block; font-size: 24px; color: var(--ac); line-height: 1.3; }
.hs span { font-size: 12.5px; color: var(--ink-soft); }
.coll { margin-top: 42px; }
.coll > h2 { font-size: 24px; margin: 0 0 4px; }
.coll .en-name {
  font-size: 13px; color: var(--ink-soft); font-weight: 500;
  margin-inline-start: 10px; direction: ltr; unicode-bidi: isolate;
}
.hs b { direction: ltr; unicode-bidi: isolate; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 15px; margin-top: 16px; }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 15px;
  background: var(--card); border: 1px solid var(--line); border-radius: 15px;
  color: var(--ink); position: relative; overflow: hidden;
  box-shadow: 0 1px 3px rgb(20 30 45 / 5%); transition: transform .16s ease, box-shadow .16s ease;
}
.card::before {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--ac), transparent 85%);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px color-mix(in srgb, var(--ac) 18%, transparent); text-decoration: none; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h3 { margin: 4px 0 0; font-size: 16.5px; line-height: 1.6; }
.card-sub { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.card-meta .tag { background: var(--accent-soft); color: var(--accent-deep); }
.grid-note { grid-column: 1 / -1; }
.pg-foot {
  margin-top: 46px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-soft);
}

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: static; height: auto; border-inline-end: none;
    border-bottom: 1px solid #0b131d;
  }
  .side-scroll { max-height: 42vh; }
  .sec.refs .sec-body { columns: 1; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .main { padding: 22px 14px 40px; }
  .sec > summary { font-size: 15.5px; }
  .sec-body { padding: 4px 14px 16px; }
}

/* ---------- print ---------- */
@media print {
  .side, .toolbar, .dl { display: none; }
  .shell { display: block; }
  .sec { break-inside: avoid; }
}

/* ---------- dark ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6ebf2; --ink-soft: #9fb0c2; --paper: #0f1722; --card: #16202d; --line: #253243;
  }
  .tbl-wrap, .deck figure { background: var(--card); }
  tbody tr:nth-child(even) { background: #1a2534; }
  .badge.twin, .count { background: #22303f; color: #93a7b8; }
  .note { background: #2a2416; border-color: #4d4020; color: #d8c084; }
  .toolbar { background: color-mix(in srgb, var(--paper) 88%, transparent); }
}
