@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');
:root {
  --primary: #1257b8;
  --primary-dark: #0d2b5c;
  --primary-light: #e8f1fc;
  --accent: #14b3c4;
  --text: #1d2a33;
  --muted: #5d6b75;
  --border: #dde5e8;
  --bg: #ffffff;
  --bg-soft: #f5f8f9;
  --danger: #c0392b;
  --success: #1e8449;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(16, 42, 51, .07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text); background: var(--bg); line-height: 1.6; font-size: 16px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: 1.85rem; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Top bar + header */
.topbar { background: var(--primary-dark); color: #d8ecec; font-size: .875rem; }
.topbar .container { display: flex; justify-content: space-between; gap: 12px; padding-top: 7px; padding-bottom: 7px; flex-wrap: wrap; }
.topbar a { color: #fff; }
header.site { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
header.site .container { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 40px; height: 40px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; }
.brand small { display: block; font-weight: 400; font-size: .75rem; color: var(--muted); }
nav.main { display: flex; align-items: center; gap: 26px; }
nav.main a { color: var(--text); font-weight: 500; }
nav.main a:hover { color: var(--primary); text-decoration: none; }
.menu-btn { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 1.2rem; cursor: pointer; }

/* Buttons */
.btn { display: inline-block; background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 11px 22px; font-weight: 600; font-size: 1rem; cursor: pointer; text-align: center; font-family: inherit; }
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn.outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn.outline:hover { background: var(--primary-light); }
.btn.light { background: #fff; color: var(--primary); }
.btn.small { padding: 6px 12px; font-size: .875rem; }
.btn.danger { background: var(--danger); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
nav.main .btn { color: #fff; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary-light), #fff 70%); padding: 70px 0 60px; }
.hero .container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 2.6rem; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 540px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; border: 1px solid var(--border); }
.hero-card h3 { margin-bottom: 14px; }
.info-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: 0; }
.info-row .ico { width: 34px; height: 34px; border-radius: 8px; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.info-row b { display: block; font-size: .85rem; color: var(--muted); font-weight: 500; }

/* Sections */
section { padding: 64px 0; }
section.soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.grid { display: grid; gap: 22px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.spec-card { text-align: center; }
.spec-card .ico { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; font-size: 1.6rem; }
.spec-card h3 { font-size: 1.1rem; }
.spec-card p { color: var(--muted); font-size: .93rem; margin: 0; }

/* Doctor cards */
.doc-card { display: flex; flex-direction: column; }
.doc-top { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.3rem; flex-shrink: 0; }
.doc-top h3 { font-size: 1.1rem; margin: 0; }
.tag { display: inline-block; background: var(--primary-light); color: var(--primary); font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 20px; }
.doc-card .quals { font-size: .88rem; color: var(--muted); margin: 0 0 12px; }
.doc-meta { display: flex; gap: 18px; font-size: .9rem; margin-bottom: 12px; flex-wrap: wrap; }
.doc-meta b { color: var(--text); }
.doc-card .timing { font-size: .88rem; background: var(--bg-soft); padding: 8px 12px; border-radius: 8px; margin-bottom: 16px; }
.doc-card .btn { margin-top: auto; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.checklist { list-style: none; padding: 0; margin: 18px 0 0; }
.checklist li { padding: 6px 0 6px 30px; position: relative; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: #fff; background: var(--primary); width: 20px; height: 20px; border-radius: 50%; font-size: .75rem; display: grid; place-items: center; top: 9px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center; }
.stat .n { font-size: 2rem; font-weight: 800; color: var(--primary); }

/* FAQ */
.faq { max-width: 800px; margin: 0 auto; }
details { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px; }
details summary { font-weight: 600; cursor: pointer; }
details p { margin: 10px 0 0; color: var(--muted); }

/* CTA + footer */
.cta { background: var(--primary); color: #fff; padding: 46px 0; }
.cta .container { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.cta h2 { margin: 0; }
footer.site { background: #0b1f3f; color: #b8c4d6; padding: 48px 0 20px; font-size: .93rem; }
footer.site h4 { color: #fff; margin: 0 0 12px; }
footer.site a { color: #b8c4d6; }
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site li { padding: 3px 0; }
footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 30px; }
footer .copy { border-top: 1px solid #1f3557; margin-top: 30px; padding-top: 18px; text-align: center; font-size: .85rem; }

/* Forms */
.form-wrap { max-width: 820px; margin: 0 auto; }
.steps { display: flex; gap: 10px; margin-bottom: 26px; }
.step { flex: 1; text-align: center; font-size: .9rem; color: var(--muted); padding-bottom: 8px; border-bottom: 3px solid var(--border); }
.step.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid #c9d4d8; border-radius: 8px; font-size: 1rem; font-family: inherit; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-light); border-color: var(--primary); }
.field { margin-bottom: 18px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.doc-select { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.doc-option { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; background: #fff; text-align: left; font-family: inherit; font-size: inherit; color: inherit; }
.doc-option:hover { border-color: var(--primary); }
.doc-option.selected { border-color: var(--primary); background: var(--primary-light); }
.doc-option.disabled { opacity: .6; cursor: not-allowed; }
.doc-option b { display: block; }
.doc-option span { font-size: .87rem; color: var(--muted); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot { padding: 9px 4px; border: 1.5px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; font-size: .92rem; font-family: inherit; color: var(--text); }
.slot:hover:not(:disabled) { border-color: var(--primary); }
.slot.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot:disabled { background: var(--bg-soft); color: #a9b5ba; text-decoration: line-through; cursor: not-allowed; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .95rem; }
.alert.error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }
.alert.success { background: #e9f7ef; color: var(--success); border: 1px solid #bfe5cd; }
.alert.info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #c7dbf5; }
.summary { background: var(--bg-soft); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px; }
.summary div { display: flex; justify-content: space-between; padding: 4px 0; gap: 10px; }
.confirm-box { text-align: center; padding: 30px 10px; }
.confirm-box .big { width: 70px; height: 70px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; font-size: 2rem; margin: 0 auto 16px; }
.ref { font-size: 1.6rem; font-weight: 800; letter-spacing: 1px; color: var(--primary); }
.page-head { background: var(--primary-light); padding: 40px 0; }
.page-head h1 { margin: 0; }
.hidden { display: none !important; }

/* Status badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .8rem; font-weight: 600; text-transform: capitalize; }
.badge.pending { background: #fff4e0; color: #a5650a; }
.badge.confirmed { background: #e3f0fb; color: #1d5f99; }
.badge.completed { background: #e9f7ef; color: var(--success); }
.badge.cancelled { background: #fdecea; color: var(--danger); }
.badge.no-show { background: #eee; color: #555; }

/* Responsive */
@media (max-width: 900px) {
  .hero .container, .about-grid { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  footer .cols { grid-template-columns: 1fr 1fr; }
  .menu-btn { display: block; }
  nav.main { display: none; position: absolute; top: 70px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 16px 20px; gap: 14px; border-bottom: 1px solid var(--border); }
  nav.main.open { display: flex; }
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .hero { padding: 44px 0; }
  .hero h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  section { padding: 46px 0; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2, .row, .row3, footer .cols { grid-template-columns: 1fr; }
  .topbar .hide-sm { display: none; }
}

/* ===== v2 additions ===== */
.small { font-size: .85rem; }
a.plain { color: inherit; }
.skip { position: absolute; top: 0; left: 8px; background: var(--primary); color: #fff; padding: 8px 14px; z-index: 100; transform: translateY(-120%); }
.skip:focus { transform: none; }
html[dir=rtl] .skip { left: auto; right: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.announce { background: var(--accent); color: #062a35; text-align: center; padding: 8px 16px; font-weight: 600; font-size: .92rem; }
.logo-img { width: 40px; height: 40px; }
nav.main a.active { color: var(--primary); font-weight: 700; }
nav.main { gap: 20px; }
.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 20px; margin-left: 4px; }
.pill.green { background: #e9f7ef; color: var(--success); }
.pill.red { background: #fdecea; color: var(--danger); }
.stars { color: #14b3c4; letter-spacing: 1px; }
.stars .off { color: #d5dde0; }
.stars.lg { font-size: 1.5rem; }
.rating-line { font-size: .9rem; margin-bottom: 8px; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.wa-float { position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 50%; background: #25d366; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.2); z-index: 30; }
.wa-float:hover { transform: scale(1.06); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -36px; position: relative; z-index: 2; }
.quick a { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; gap: 12px; align-items: center; color: var(--text); }
.quick a:hover { border-color: var(--primary); text-decoration: none; }
.quick .ico { width: 44px; height: 44px; border-radius: 10px; background: var(--primary-light); display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.quick b { display: block; }
.quick span.muted { font-size: .85rem; }
.testi { display: flex; flex-direction: column; gap: 8px; }
.testi p { margin: 0; font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--border); background: #fff; border-radius: 20px; padding: 6px 14px; cursor: pointer; font-family: inherit; font-size: .9rem; color: var(--text); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.toolbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }
.toolbar input[type=search] { max-width: 320px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 0; cursor: pointer; }
.check input { width: auto; }
.profile { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; align-items: start; }
.profile-head { display: flex; gap: 20px; align-items: center; }
.profile-head .avatar { width: 96px; height: 96px; font-size: 2rem; }
.timetable { width: 100%; border-collapse: collapse; }
.timetable td { padding: 8px 4px; border-bottom: 1px solid var(--border); }
.timetable tr.today td { font-weight: 700; color: var(--primary); }
.sticky { position: sticky; top: 90px; }
.review { border-bottom: 1px solid var(--border); padding: 14px 0; }
.review:last-child { border-bottom: 0; }
.map { width: 100%; height: 360px; border: 0; border-radius: var(--radius); }
.service-block { display: grid; grid-template-columns: 80px 1fr; gap: 20px; padding: 28px 0; border-bottom: 1px solid var(--border); }
.service-block .ico { width: 70px; height: 70px; border-radius: 50%; background: var(--primary-light); display: grid; place-items: center; font-size: 2rem; }
.cond { columns: 2; padding-left: 18px; margin: 10px 0; }
.values .card h3 { font-size: 1.05rem; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { display: none; }
.star-input label { font-size: 2rem; color: #d5dde0; cursor: pointer; margin: 0; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #14b3c4; }
.faq-group h3 { margin-top: 28px; }
.nf { text-align: center; padding: 90px 0; }
.nf .code { font-size: 5rem; font-weight: 800; color: var(--primary); line-height: 1; }
@media (max-width: 900px) {
  .quick { grid-template-columns: 1fr 1fr; }
  .profile { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 600px) {
  .quick { grid-template-columns: 1fr; margin-top: 20px; }
  .cond { columns: 1; }
  .service-block { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; text-align: center; }
}
@media print {
  header.site, .topbar, .announce, footer.site, .wa-float, .steps, .no-print { display: none !important; }
}

/* ===== Language switch + Urdu (right-to-left) ===== */
.lang-btn { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #c7dbf5; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 700; font-family: "Noto Nastaliq Urdu", "Segoe UI", system-ui, sans-serif; font-size: .95rem; line-height: 1.6; }
.lang-btn:hover { background: #d6e6fa; }
html[dir=rtl] body { font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Segoe UI", system-ui, sans-serif; line-height: 2.1; }
html[dir=rtl] h1, html[dir=rtl] h2, html[dir=rtl] h3 { line-height: 1.9; }
html[dir=rtl] .hero h1 { font-size: 2.2rem; }
html[dir=rtl] .lang-btn { font-family: "Segoe UI", system-ui, sans-serif; }
html[dir=rtl] .checklist li { padding: 6px 30px 6px 0; }
html[dir=rtl] .checklist li::before { left: auto; right: 0; top: 14px; }
html[dir=rtl] .cond { padding-left: 0; padding-right: 18px; }
html[dir=rtl] table.data th, html[dir=rtl] table.data td { text-align: right; }
html[dir=rtl] .timetable td:last-child { text-align: left !important; }
html[dir=rtl] .doc-option { text-align: right; }
html[dir=rtl] .wa-float { right: auto; left: 18px; }
html[dir=rtl] .avatar, html[dir=rtl] .ref, html[dir=rtl] .slot, html[dir=rtl] .quals,
html[dir=rtl] input[type=tel], html[dir=rtl] input[inputmode=tel], html[dir=rtl] input[type=email], html[dir=rtl] #ref { font-family: "Segoe UI", system-ui, sans-serif; }
html[dir=rtl] input[inputmode=tel], html[dir=rtl] input[type=email], html[dir=rtl] #ref { direction: ltr; text-align: right; }
html[dir=rtl] .quals { direction: ltr; text-align: right; line-height: 1.6; }
html[dir=rtl] .tag, html[dir=rtl] .badge, html[dir=rtl] .pill { line-height: 1.9; }
html[dir=rtl] .stars { direction: ltr; display: inline-block; }
.head-right { display: flex; align-items: center; gap: 10px; order: 3; }
header.site nav.main { order: 2; margin-left: auto; margin-right: 16px; }
html[dir=rtl] header.site nav.main { margin-left: 16px; margin-right: auto; }
@media (max-width: 900px) { header.site nav.main { margin: 0; } }

/* ===== Documents (letterhead, payslip, letters) ===== */
.doc-scroll { overflow-x: auto; padding: 10px 0; }
.lh-page { position: relative; width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; color: #222; box-shadow: 0 4px 24px rgba(0,0,0,.12);
  padding: 16mm 16mm 22mm 24mm; font-family: "Segoe UI", system-ui, Arial, sans-serif; font-size: 10.5pt; line-height: 1.5; overflow: hidden; direction: ltr; text-align: left; }
.lh-bar { position: absolute; left: 8mm; top: 0; bottom: 0; width: 4mm; background: var(--primary); }
.lh-watermark { position: absolute; left: 50%; top: 52%; width: 110mm; transform: translate(-50%, -50%); color: var(--primary); opacity: .06; pointer-events: none; }
.lh-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10mm; margin-bottom: 10mm; position: relative; }
.lh-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 3mm; }
.lh-logo { width: 26mm; height: 26mm; color: var(--primary); }
.lh-name { font-size: 15pt; font-weight: 800; letter-spacing: .3px; color: #1d2a33; text-transform: uppercase; }
.lh-name small { display: block; font-size: 8.5pt; font-weight: 500; letter-spacing: 1px; color: #5d6b75; }
.lh-contact { list-style: disc; margin: 2mm 0 0; padding: 0 0 0 9mm; border-left: 1.2mm solid var(--primary); font-size: 9.5pt; color: #333; max-width: 80mm; }
.lh-contact li { padding: .4mm 0; }
.lh-body { position: relative; }
.lh-body p { margin: 0 0 3.2mm; text-align: justify; }
.lh-body h4 { color: var(--primary-dark); margin: 5mm 0 2mm; font-size: 11pt; }
.lh-foot { position: absolute; left: 24mm; right: 16mm; bottom: 9mm; border-top: .3mm solid #cfd8dc; padding-top: 2mm; font-size: 8pt; color: #5d6b75; text-align: center; }
.doc-title { text-align: center; font-size: 15pt; font-weight: 800; letter-spacing: 3px; color: var(--primary-dark); margin: 0 0 5mm; }
.void { color: #c0392b; border: .6mm solid #c0392b; padding: 0 3mm; font-size: 11pt; letter-spacing: 2px; margin-left: 4mm; vertical-align: middle; }
.ps-info, .ps-table, .ps-summary, .kv { width: 100%; border-collapse: collapse; margin-bottom: 5mm; font-size: 9.8pt; position: relative; background: rgba(255,255,255,.6); }
.ps-info th, .ps-info td, .ps-table th, .ps-table td, .ps-summary th, .ps-summary td, .kv th, .kv td { border: .3mm solid #b8c7cc; padding: 1.6mm 2.4mm; text-align: left; vertical-align: top; }
.ps-info th, .kv th { background: #eef4fd; width: 22%; font-weight: 600; }
.kv th { width: 34%; }
.ps-table thead th { background: var(--primary); color: #fff; }
.ps-table thead tr:first-child th { background: var(--primary-dark); text-align: center; }
.ps-table tfoot th { background: #eef4fd; }
.ps-table td, .ps-table th { width: 25%; }
.ps-summary { width: 60%; margin-left: auto; }
.ps-summary tr.net th, .ps-summary tr.net td { background: var(--primary); color: #fff; font-size: 11pt; font-weight: 800; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.words { background: #f5f8f9; padding: 2mm 3mm; border-left: 1mm solid var(--primary); }
.sign-row { display: flex; justify-content: space-between; gap: 20mm; margin-top: 14mm; font-size: 9.5pt; }
.sign-row > div { flex: 1; text-align: center; }
.sign-line { border-top: .3mm solid #333; margin: 0 auto 1.5mm; width: 60mm; }
.sig .sign-line { margin: 0 0 1.5mm; }
.fine { font-size: 8.3pt; color: #5d6b75; margin-top: 6mm; text-align: center !important; }
.ltr-top { display: flex; justify-content: space-between; gap: 10mm; margin-bottom: 6mm; }
.ltr-date { text-align: right; color: var(--primary-dark); white-space: nowrap; }
.subj { font-weight: 700; color: var(--primary-dark); }
.sig { margin-top: 8mm; }
.duties { margin: 0 0 3mm 4mm; padding-left: 4mm; }
.duties li { margin-bottom: 1.2mm; text-align: justify; }
.lh-page.chart-page .oc { transform-origin: top left; }

/* ===== Organisation chart ===== */
.oc { display: flex; flex-direction: column; align-items: center; }
.oc-chain { display: flex; flex-direction: column; align-items: center; }
.oc-arrow { width: 3px; height: 26px; background: var(--primary); position: relative; margin: 0 auto 6px; }
.oc-arrow::after { content: ""; position: absolute; bottom: -7px; left: -5px; border: 6.5px solid transparent; border-top: 8px solid var(--primary); border-bottom: 0; }
.oc-card { background: #fff; border: 1.5px solid #c4d8f2; border-left: 5px solid var(--primary); border-radius: 8px; padding: 8px 12px; box-shadow: var(--shadow); text-align: left; }
.oc-card b { display: block; color: var(--text); }
.oc-card span { display: block; font-size: .86rem; color: var(--primary-dark); font-weight: 600; }
.oc-card small { display: block; font-size: .78rem; color: var(--muted); }
.oc-card.lg { min-width: 280px; text-align: center; border-left-width: 1.5px; border-top: 5px solid var(--primary); padding: 12px 18px; }
.oc-card.lg b { font-size: 1.15rem; }
.oc-card.head { background: var(--primary); border-color: var(--primary); }
.oc-card.head b, .oc-card.head span, .oc-card.head small { color: #fff; }
.oc-group.head { background: var(--primary-dark); }
.oc-card.sm { padding: 6px 10px; box-shadow: none; }
.oc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; width: 100%; border-top: 3px solid var(--primary); padding-top: 18px; margin-top: 4px; }
.oc-dept { background: var(--bg-soft); border-radius: 10px; padding: 10px; align-self: start; }
.oc-list { list-style: none; margin: 8px 0 0 10px; padding: 0 0 0 12px; border-left: 2px solid #c4d8f2; }
.oc-list li { position: relative; margin: 6px 0; }
.oc-list li::before { content: ""; position: absolute; left: -12px; top: 18px; width: 12px; border-top: 2px solid #c4d8f2; }
.oc-leadership { border-left-color: #0d2b5c; } .oc-clinical { border-left-color: #1257b8; } .oc-allied { border-left-color: #2f8f6f; }
.oc-nursing { border-left-color: #c2185b; } .oc-admin { border-left-color: #14b3c4; } .oc-support { border-left-color: #7b8a93; }
.oc-legend { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; font-size: .85rem; margin-bottom: 20px; }
.oc-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
html[dir=rtl] .oc-card { text-align: right; border-left-width: 1.5px; border-right: 5px solid var(--primary); }
html[dir=rtl] .oc-card.lg { border-right-width: 1.5px; text-align: center; }
html[dir=rtl] .oc-list { margin: 8px 10px 0 0; padding: 0 12px 0 0; border-left: 0; border-right: 2px solid #c4d8f2; }
html[dir=rtl] .oc-list li::before { left: auto; right: -12px; }
.chart-page .oc-grid { grid-template-columns: repeat(3, 1fr); gap: 3mm; padding-top: 4mm; }
.chart-page .oc-card { box-shadow: none; padding: 1.2mm 2.4mm; font-size: 8pt; }
.chart-page .oc-card.lg { min-width: 70mm; padding: 2mm 4mm; } .chart-page .oc-card.lg b { font-size: 10.5pt; }
.chart-page .oc-card span { font-size: 7.6pt; } .chart-page .oc-card small { font-size: 7pt; }
.chart-page .oc-dept { padding: 2mm; } .chart-page .oc-list { margin-top: 1.5mm; } .chart-page .oc-list li { margin: 1.2mm 0; }
.chart-page .oc-list li::before { top: 3.2mm; } .chart-page .oc-arrow { height: 5mm; }

/* printing a document from the staff panel or letterhead page */
@media print {
  @page { size: A4; margin: 0; }
  body.print-doc { background: #fff !important; margin: 0; }
  body.print-doc > *:not(#print-area) { display: none !important; }
  body.print-doc #print-area { display: block !important; }
  .lh-page { box-shadow: none; margin: 0; page-break-after: always; break-after: page; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lh-page:last-child { page-break-after: auto; break-after: auto; }
}
#print-area { display: none; }
/* compact org chart for the printed attachment (fits one A4 page) */
.chart-page .oc-grid { grid-template-columns: repeat(4, 1fr); gap: 2.5mm; }
.chart-page .oc-card.sm { padding: .8mm 1.8mm; border-radius: 4px; }
.chart-page .oc-card.sm b, .chart-page .oc-card.sm span { display: inline; font-size: 7.4pt; }
.chart-page .oc-card.sm span::before { content: " · "; color: #999; }
.chart-page .oc-card.sm small { display: none; }
.chart-page .oc-list li { margin: .8mm 0; } .chart-page .oc-list li::before { top: 2.4mm; }
.chart-page .oc-card.head { padding: 1.2mm 2mm; }
.chart-page .doc-title { margin-bottom: 3mm; }
.lh-page.chart-page { padding-right: 10mm; padding-left: 20mm; }
.chart-page .lh-head { margin-bottom: 3mm; }
.chart-page .lh-logo { width: 15mm; height: 15mm; }
.chart-page .lh-brand { flex-direction: row; align-items: center; }
.chart-page .oc-card.sm b, .chart-page .oc-card.sm span { display: block; line-height: 1.25; }
.chart-page .oc-card.sm b { font-size: 7.2pt; } .chart-page .oc-card.sm span { font-size: 6.6pt; }
.chart-page .oc-card.sm span::before { content: none; }
.chart-page .oc-card.lg { padding: 1.2mm 4mm; } .chart-page .oc-card.lg b { font-size: 9.5pt; }
.chart-page .oc-card.head b { font-size: 7.6pt; } .chart-page .oc-card.head span, .chart-page .oc-card.head small { font-size: 6.8pt; }
.chart-page .oc-arrow { height: 3.5mm; margin-bottom: 1.5mm; }
.chart-page .oc-grid { padding-top: 3mm; gap: 2mm; }
.chart-page .oc-list { margin-left: 1.5mm; padding-left: 2.5mm; } .chart-page .oc-list li::before { left: -2.5mm; width: 2.5mm; top: 2.6mm; }
@media (max-width: 1180px) and (min-width: 901px) { nav.main { gap: 12px; font-size: .92rem; } .brand small { display: none; } }

/* ===================== v5 visual refresh ===================== */
:root { --accent-soft: #e6f7f9; --ink-2: #33434d; --radius-lg: 18px; --shadow-lg: 0 18px 40px -18px rgba(13,43,92, .35); }
body { font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .brand, .btn, .ref, .stat .n, .kpi .n { font-family: "Plus Jakarta Sans", Inter, "Segoe UI", sans-serif; letter-spacing: -.01em; }
h2 { font-size: 2rem; }
.ic { width: 1.25em; height: 1.25em; flex-shrink: 0; vertical-align: -.22em; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }
.section-head .eyebrow { justify-content: center; }

/* header */
header.site { box-shadow: 0 1px 0 var(--border), 0 6px 20px -16px rgba(0,0,0,.25); backdrop-filter: saturate(1.4) blur(8px); background: rgba(255,255,255,.94); }
.logo-mark { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), #14b3c4); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 14px -6px rgba(18,87,184,.6); }
.logo-mark .ic { width: 24px; height: 24px; }
.logo-mark.sm { width: 32px; height: 32px; border-radius: 9px; display: inline-grid; vertical-align: middle; margin-right: 8px; box-shadow: none; }
.logo-mark.sm .ic { width: 18px; height: 18px; }
.foot-brand { display: flex; align-items: center; }
nav.main a:not(.btn) { position: relative; padding: 4px 0; }
nav.main a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--primary); transform: scaleX(0); transition: transform .2s; }
nav.main a:not(.btn):hover::after, nav.main a.active::after { transform: scaleX(1); }
.btn { border-radius: 10px; box-shadow: 0 6px 16px -10px rgba(18,87,184,.8); transition: transform .15s, box-shadow .15s, background .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgba(18,87,184,.9); }
.btn.outline, .btn.light { box-shadow: none; }

/* hero */
.hero { position: relative; overflow: hidden; padding: 72px 0 92px; background:
  radial-gradient(900px 420px at 85% 10%, rgba(20,179,196,.16), transparent 60%),
  radial-gradient(700px 380px at 0% 100%, rgba(20,179,196,.13), transparent 60%), linear-gradient(180deg, #f1f6fd, #fff); }
.hero .container { grid-template-columns: 1.1fr 1fr; }
.hero h1 { font-size: 3rem; line-height: 1.12; }
.hero h1 em { font-style: normal; color: var(--primary); background: linear-gradient(transparent 62%, rgba(20,179,196,.35) 62%); }
.hero-art { position: relative; }
.hero-art svg.scene { width: 100%; height: auto; display: block; filter: drop-shadow(0 30px 40px rgba(13,43,92,.18)); }
.float-chip { position: absolute; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); padding: 10px 14px; display: flex; gap: 10px; align-items: center; font-size: .88rem; animation: bob 6s ease-in-out infinite; }
.float-chip b { display: block; font-size: 1.05rem; font-family: "Plus Jakarta Sans", sans-serif; }
.float-chip .ic-wrap { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-light); color: var(--primary); }
.float-chip.c1 { left: -4%; top: 12%; } .float-chip.c2 { right: -2%; top: 48%; animation-delay: -2s; } .float-chip.c3 { left: 8%; bottom: -2%; animation-delay: -4s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.trust { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; color: var(--ink-2); font-size: .92rem; }
.trust span { display: inline-flex; gap: 8px; align-items: center; }
.trust .ic { color: var(--primary); }

/* cards & icons */
.card { border-radius: var(--radius-lg); border-color: #e4ecee; transition: transform .2s, box-shadow .2s, border-color .2s; }
a.card:hover, .doc-card:hover, .spec-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #c4d8f2; text-decoration: none; }
.ico-badge, .spec-card .ico, .service-block .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--primary);
  background: linear-gradient(135deg, #e6f0fc, #f5f9fe); border: 1px solid #d3e2f6; font-size: 0; }
.ico-badge .ic, .spec-card .ico .ic, .service-block .ico .ic { width: 28px; height: 28px; }
.spec-card { text-align: left; } .spec-card .ico { margin: 0 0 14px; }
.spec-card .more { display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; font-weight: 600; font-size: .9rem; color: var(--primary); }
.quick a { border-radius: var(--radius-lg); }
.quick .ico { font-size: 0; color: var(--primary); }
.quick .ico .ic { width: 22px; height: 22px; }
.info-row .ico { font-size: 0; } .info-row .ico .ic { width: 18px; height: 18px; }

/* doctor cards */
.avatar-svg, .avatar-img { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; display: block; object-fit: cover; }
.avatar-lg { width: 76px; height: 76px; }
.avatar-xl { width: 140px; height: 140px; box-shadow: 0 0 0 6px #fff, var(--shadow-lg); }
.avatar-sm { width: 40px; height: 40px; }
.doc-card { padding: 22px; }
.doc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.doc-facts div { background: var(--bg-soft); border-radius: 12px; padding: 8px 10px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; font-size: .78rem; color: var(--muted); }
.doc-facts .ic { grid-row: span 2; color: var(--primary); width: 20px; height: 20px; }
.doc-facts b { color: var(--text); font-size: .95rem; }
.doc-card .timing { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; border-radius: 12px; }
.doc-card .timing .ic { color: var(--primary); margin-top: 2px; }
.doc-card .timing span:not(.pill) { flex: 1; min-width: 60%; }
.prov { display: flex; gap: 10px; align-items: flex-start; background: #fdf3e2; border: 1px solid #f3d9ad; color: #6b4a12; border-radius: 12px; padding: 10px 14px; font-size: .9rem; margin: 0 0 18px; }
.prov.small { font-size: .82rem; padding: 8px 12px; }
.prov .ic { color: #b7791f; margin-top: 2px; }

/* steps graphic */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; position: relative; }
.how::before { content: ""; position: absolute; left: 16%; right: 16%; top: 38px; border-top: 2px dashed #c4d8f2; }
.how .step-card { position: relative; text-align: center; padding: 0 10px; }
.how .step-card .ico-badge { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 16px; background: #fff; border: 2px solid #c4d8f2; box-shadow: 0 0 0 8px #f5f8f9; }
.how .step-card .ico-badge::after { counter-increment: step; content: counter(step); position: absolute; margin: -54px 0 0 54px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 .8rem/26px Inter, sans-serif; }
.how h3 { font-size: 1.08rem; }

/* stat tiles */
.stat { border-radius: var(--radius-lg); text-align: left; padding: 20px 22px; }
.stat .n { font-size: 2.2rem; line-height: 1.1; }
.stat .ico-badge { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 10px; }
.stat .ico-badge .ic { width: 22px; height: 22px; }

/* charts */
.chart-card h3 { margin-bottom: 4px; }
.chart-card .sub { color: var(--muted); font-size: .88rem; margin: 0 0 16px; }
.hbars { display: grid; gap: 8px; }
.hb-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 12px; align-items: center; border-radius: 6px; outline-offset: 2px; }
.hb-label { font-size: .88rem; color: var(--ink-2); text-align: right; }
.hb-track { display: flex; align-items: center; gap: 8px; min-height: 24px; border-left: 1px solid #dfe6e8; }
.hb-bar { height: 18px; background: var(--primary); border-radius: 0 4px 4px 0; transition: filter .15s; min-width: 2px; }
.hb-row:hover .hb-bar, .hb-row:focus .hb-bar { filter: brightness(1.25); }
.hb-val { font-size: .82rem; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-table { margin-top: 12px; font-size: .85rem; }
.chart-table summary { cursor: pointer; color: var(--primary); }
.chart-table table { border-collapse: collapse; margin-top: 8px; width: 100%; }
.chart-table th, .chart-table td { border-bottom: 1px solid var(--border); padding: 4px 8px; text-align: left; }
.chart-tip { position: fixed; z-index: 200; display: none; pointer-events: none; background: #0b1f3f; color: #fff; font-size: .82rem; padding: 6px 10px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25); max-width: 280px; }
.tt-wrap { overflow-x: auto; border: 1px solid #e4ecee; border-radius: var(--radius-lg); background: #fff; }
table.tt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; min-width: 720px; }
.tt th, .tt td { padding: 8px 6px; border-bottom: 1px solid #eef3f4; text-align: center; }
.tt thead th { background: var(--bg-soft); font-weight: 600; color: var(--ink-2); position: sticky; top: 0; }
.tt tbody th { text-align: left; padding-left: 16px; font-weight: 600; white-space: nowrap; }
.tt tbody th small { display: block; color: var(--muted); font-weight: 400; }
.tt .today { background: #f1f6fe; } .tt thead th.today { background: #d6e6fa; color: #0d2b5c; }
.tt-cell { display: block; background: var(--primary-light); color: var(--primary-dark); border-radius: 8px; padding: 6px 4px; font-weight: 600; font-size: .78rem; white-space: nowrap; }
.tt-cell:hover, .tt-cell:focus { background: var(--primary); color: #fff; text-decoration: none; }
.tt td.off { color: #c4ced2; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; border-radius: 14px; overflow: hidden; position: relative; background: var(--bg-soft); aspect-ratio: 4/3; cursor: zoom-in; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery figure:hover img { transform: scale(1.05); }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px; color: #fff; font-size: .85rem; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.lightbox { position: fixed; inset: 0; background: rgba(8,20,24,.9); display: grid; place-items: center; z-index: 300; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 10px; }
.lightbox p { color: #fff; text-align: center; }
.lightbox button { position: absolute; top: 16px; right: 16px; background: #fff; border: 0; border-radius: 50%; width: 40px; height: 40px; font-size: 1.2rem; cursor: pointer; }

/* page head with pattern */
.page-head { position: relative; overflow: hidden; padding: 56px 0 50px; background:
  radial-gradient(600px 240px at 90% 0%, rgba(20,179,196,.18), transparent 70%), linear-gradient(180deg, #eaf2fd, #f6f9fe); }
.page-head::after { content: ""; position: absolute; right: -40px; top: -40px; width: 300px; height: 300px; opacity: .07;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M26 10h12v16h16v12H38v16H26V38H10V26h16z' fill='%231257b8'/%3E%3C/svg%3E") center/contain no-repeat; }
.page-head h1 { font-size: 2.4rem; }

/* doctor profile */
.profile-hero { display: flex; gap: 26px; align-items: center; }
.profile-hero h1 { font-size: 2rem; margin: 0 0 6px; }
.profile-hero .chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fact { display: inline-flex; gap: 6px; align-items: center; background: var(--bg-soft); border-radius: 30px; padding: 6px 12px; font-size: .88rem; }
.fact .ic { color: var(--primary); }

/* org chart photos */
.oc-card.has-av { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.oc-card.has-av > :not(.oc-av) { grid-column: 2; }
.oc-av { grid-row: span 3; width: 40px; height: 40px; }
.oc-card.lg.has-av { grid-template-columns: auto auto; justify-content: center; text-align: left; }
.oc-card.lg .oc-av { width: 54px; height: 54px; }

/* about */
.about-art svg { width: 100%; height: auto; }
.value-card .ico-badge { margin-bottom: 12px; }

/* CTA */
.cta { position: relative; overflow: hidden; background: linear-gradient(120deg, #1257b8, #1a7fd4 60%, #14b3c4); }
.cta::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255,255,255,.07); }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.shown { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } .float-chip { animation: none; } }
@media print { .reveal { opacity: 1 !important; transform: none !important; } }

/* org chart: validated department colours (CVD-checked) */
.oc-leadership { border-left-color: #2a78d6; } .oc-clinical { border-left-color: #eb6834; } .oc-allied { border-left-color: #1baf7a; }
.oc-nursing { border-left-color: #eda100; } .oc-admin { border-left-color: #e87ba4; } .oc-support { border-left-color: #008300; }
html[dir=rtl] .oc-leadership { border-right-color: #2a78d6; } html[dir=rtl] .oc-clinical { border-right-color: #eb6834; } html[dir=rtl] .oc-allied { border-right-color: #1baf7a; }
html[dir=rtl] .oc-nursing { border-right-color: #eda100; } html[dir=rtl] .oc-admin { border-right-color: #e87ba4; } html[dir=rtl] .oc-support { border-right-color: #008300; }

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { max-width: 520px; margin: 10px auto 0; }
  .how { grid-template-columns: 1fr; } .how::before { display: none; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 2.1rem; } h2 { font-size: 1.6rem; } .page-head h1 { font-size: 1.9rem; }
  .float-chip { font-size: .78rem; padding: 8px 10px; } .float-chip.c1 { left: 0; } .float-chip.c2 { right: 0; }
  .profile-hero { flex-direction: column; text-align: center; }
  .hb-row { grid-template-columns: 1fr; gap: 2px; } .hb-label { text-align: left; }
}
html[dir=rtl] .hb-label { text-align: left; } html[dir=rtl] .hb-track { border-left: 0; border-right: 1px solid #dfe6e8; }
html[dir=rtl] .hb-bar { border-radius: 4px 0 0 4px; }
html[dir=rtl] .eyebrow::before { order: 2; }
html[dir=rtl] h1, html[dir=rtl] h2, html[dir=rtl] h3, html[dir=rtl] .btn { font-family: "Noto Nastaliq Urdu", "Plus Jakarta Sans", sans-serif; letter-spacing: 0; }
html[dir=rtl] .spec-card { text-align: right; }
.doc-option { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
.doc-option .opt-av { grid-row: span 4; }
.doc-option > :not(.opt-av) { grid-column: 2; }
.doc-option br { display: none; }
html[dir=rtl] .doc-option { text-align: right; }
.photo-field { display: flex; gap: 16px; align-items: center; background: var(--bg-soft); border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.photo-field input[type=file] { padding: 6px; background: #fff; }
.profile-hero { margin-bottom: 24px; }
/* logo */
.logo-svg { width: 44px; height: 44px; display: block; flex-shrink: 0; filter: drop-shadow(0 4px 8px rgba(18,87,184,.25)); }
.logo-svg.sm { width: 34px; height: 34px; filter: none; display: inline-block; vertical-align: middle; margin-right: 10px; }
.brand { gap: 12px; }
.lh-logo svg { width: 100%; height: 100%; }
.lh-lockup { width: 78mm; height: auto; display: block; }
.chart-page .lh-lockup { width: 58mm; }
.logo-svg { height: 46px; width: auto; filter: drop-shadow(0 4px 8px rgba(18,87,184,.22)); }
.logo-svg.sm { height: 36px; width: auto; }
.lh-lockup { width: 82mm; }

/* ===== Org chart as a connected tree (v6) ===== */
.tree-fit { width: 100%; overflow: hidden; }
.tree { --L: #0d2b5c; width: max-content; margin: 0 auto; padding: 6px 4px 10px; }
.tree .oc-card { min-width: 150px; max-width: 230px; position: relative; z-index: 1; }
.tree .oc-card.lg { min-width: 300px; max-width: none; }
.tree .oc-card.sm { min-width: 112px; max-width: 150px; padding: 6px 9px; }
.tree .oc-card.sm b { font-size: .86rem; } .tree .oc-card.sm span { font-size: .74rem; }
.t-node { display: flex; flex-direction: column; align-items: center; position: relative; }
.t-stem { width: 2px; height: 16px; background: var(--L); }
.t-label { font-size: .75rem; font-weight: 700; color: var(--ink-2); background: #fff; padding: 0 6px; margin: -4px 0 0; position: relative; z-index: 1; }
.t-label + .t-row, .t-label + .t-col { margin-top: 2px; }
/* row: horizontal bus, arrows down */
.t-row { display: flex; align-items: flex-start; justify-content: center; }
.t-cell { position: relative; padding: 14px 8px 0; display: flex; flex-direction: column; align-items: center; }
.t-cell::before { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: 2px solid var(--L); }
.t-cell:first-child::before { left: 50%; } .t-cell:last-child::before { right: 50%; }
.t-row.one > .t-cell::before { display: none; }
.t-cell::after { content: ""; position: absolute; top: 0; left: calc(50% - 1px); width: 2px; height: 14px; background: var(--L); }
.t-cell > .t-node:not(.junction)::before { content: ""; border: 6px solid transparent; border-top: 8px solid var(--L); border-bottom: 0; margin-top: -1px; }
/* connector column inside a row: line comes down onto the bracket */
.t-cell.jcol { align-items: flex-start; }
.t-cell.jcol::after { left: 8px; }
.t-cell.jcol:last-child::before { right: calc(100% - 10px); }
.t-cell.jcol:first-child::before { left: 8px; }
.t-cell.jcol > .t-node > .t-col { margin-left: 0; }
.t-cell.jn > .t-node > .t-row { margin-top: 0; }
/* column: bracket line on the left, arrows right */
.t-node.lay-column { align-items: flex-start; }
.t-node.lay-column > .oc-card { width: 100%; }
.t-node.lay-column > .t-stem { margin-left: 22px; height: 10px; }
.t-col { display: flex; flex-direction: column; margin-left: 22px; }
.t-item { position: relative; padding: 5px 0 5px 24px; }
.t-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--L); }
.t-item:last-child::before { bottom: auto; height: 28px; }
.t-item::after { content: ""; position: absolute; left: 0; top: 27px; width: 18px; border-top: 2px solid var(--L); }
.t-item > .t-node::before { content: ""; position: absolute; left: -8px; top: 16px; border: 6px solid transparent; border-left: 8px solid var(--L); border-right: 0; z-index: 2; }
.t-item > .t-node.lay-row, .t-item > .t-node.lay-column { align-items: flex-start; }
.t-item > .t-node.lay-row > .t-stem { margin-left: 40px; }
.t-item > .t-node.lay-row > .t-label { margin-left: 8px; }
.t-item > .t-node.lay-row > .t-row { justify-content: flex-start; }
.t-item > .t-node.lay-row > .t-row > .t-cell:first-child::before { left: 41px; }
.t-item > .t-node.lay-row > .t-row > .t-cell:first-child::after { left: 40px; }
.t-item > .t-node.lay-row > .t-row > .t-cell:first-child { align-items: flex-start; padding-left: 8px; }
.t-item > .t-node.lay-row > .t-row > .t-cell:first-child > .t-node::before { margin-left: 26px; }
/* stack */
.t-stack { display: flex; flex-direction: column; gap: 12px; }
.tree-list { display: none; }
.oc-root { margin: 0; padding: 0; border: 0; }
.oc-root > li::before { display: none; }
@media (max-width: 760px) { .tree-fit { display: none; } .tree-list { display: block; } }
/* printed chart page */
.chart-page .tree-list { display: none !important; }
.chart-page .tree-fit { display: block !important; }
.chart-page .tree .oc-card { box-shadow: none; }
.chart-sign { display: flex; justify-content: flex-start; margin-top: 10mm; font-size: 9.5pt; }
.chart-sign div { text-align: center; }
.chart-sign .sign-line { width: 55mm; }
@media print { .chart-page .tree-fit { overflow: visible; } }
/* v6 fixes: left-align list items, fixed-width heads of lists so arrows land on them */
.t-item > .t-node { align-items: flex-start; }
.tree .t-node.lay-column > .oc-card { width: 220px; min-width: 220px; max-width: 220px; }
.tree .t-node.lay-column > .oc-card.lg { width: 300px; min-width: 300px; max-width: 300px; }
.t-cell.lcol { align-items: flex-start; }
.t-cell.lcol::after { left: 117px; }
.t-cell.lcol > .t-node::before { margin-left: 112px; }
.t-cell.lcol:first-child::before { left: 118px; }
.t-cell.lcol:last-child::before { right: calc(100% - 118px); }
.tree .oc-card.sm { max-width: 210px; }
.tree .oc-card b { white-space: nowrap; }
.tree .oc-card.sm span, .tree .oc-card.head span { white-space: nowrap; }
.tree .oc-card.head span, .tree .oc-card.lg span { white-space: normal; }
.tree .t-node.lay-column > .oc-card.head { width: 236px; min-width: 236px; max-width: 236px; }
.tree .t-node.lay-row > .oc-card.head, .tree .t-node.lay-row > .oc-card.sm { max-width: 230px; }
.t-cell.lcol::after { left: 125px; } .t-cell.lcol > .t-node::before { margin-left: 120px; }
.t-cell.lcol:first-child::before { left: 126px; } .t-cell.lcol:last-child::before { right: calc(100% - 126px); }
/* chart attachment prints on a landscape A4 page */
@page landscape { size: A4 landscape; margin: 0; }
.lh-page.chart-page { width: 297mm; min-height: 210mm; page: landscape; padding: 10mm 12mm 18mm 20mm; }
.chart-page .lh-head { margin-bottom: 2mm; }
.chart-page .lh-lockup { width: 60mm; }
.chart-page .lh-contact { font-size: 8.5pt; }
.chart-page .doc-title { font-size: 13pt; margin-bottom: 3mm; }
.chart-page .chart-sign { margin-top: 4mm; }
.chart-page .fine { margin-top: 2mm; }
.chart-page .lh-watermark { width: 80mm; }
.chart-page .tree .oc-card { padding: 6px 10px; }
.chart-page .tree .oc-card b { font-size: .9rem; } .chart-page .tree .oc-card span { font-size: .74rem; } .chart-page .tree .oc-card small { font-size: .7rem; display: block; }
.chart-page .tree .oc-card.lg b { font-size: 1.05rem; } .chart-page .tree .oc-card.lg span { font-size: .82rem; }
/* side rail: line continues right, first block hangs below it, the rest are fed from a rail on the right */
.t-node.lay-rail { align-items: stretch; padding-right: 30px; }
.t-node.lay-rail::before { content: ""; position: absolute; top: 0; left: 50%; right: 14px; border-top: 2px solid var(--L); }
.rail-top { position: relative; display: flex; justify-content: center; }
.rail-top::after { content: ""; position: absolute; right: -16px; top: 0; bottom: 0; border-right: 2px solid var(--L); }
.rail-col { display: flex; flex-direction: column; align-items: flex-end; margin-top: 10px; }
.rail-item { position: relative; padding: 6px 0; }
.rail-item::before { content: ""; position: absolute; right: -16px; top: -10px; bottom: 0; border-right: 2px solid var(--L); }
.rail-item + .rail-item::before { top: 0; }
.rail-item:last-child::before { bottom: auto; height: 39px; }
.rail-item + .rail-item:last-child::before { height: 29px; }
.rail-item::after { content: ""; position: absolute; right: -16px; top: 29px; width: 14px; border-top: 2px solid var(--L); }
.rail-item > .t-node { align-items: flex-end; }
.rail-item > .t-node::before { content: ""; position: absolute; right: -8px; top: 24px; border: 6px solid transparent; border-right: 8px solid var(--L); border-left: 0; z-index: 2; }
.rail-item > .t-node > .oc-card { width: 230px; min-width: 230px; max-width: 230px; }
.rail-item > .t-node > .t-stem { margin-right: 114px; }
.rail-item > .t-node.lay-row > .t-row { justify-content: flex-end; }
.rail-item > .t-node.lay-row > .t-row.one > .t-cell { width: 230px; }
.chart-page .rail-item > .t-node > .oc-card { width: 200px; min-width: 200px; max-width: 200px; }
.chart-page .rail-item > .t-node > .t-stem { margin-right: 99px; }
.chart-page .rail-item > .t-node.lay-row > .t-row.one > .t-cell { width: 200px; }
/* chart attachment: portrait again (the chart is tall, like the hospital's own) */
.lh-page.chart-page { width: 210mm; min-height: 297mm; page: auto; padding: 10mm 8mm 18mm 16mm; }
.chart-page .lh-lockup { width: 56mm; }
.chart-page .lh-contact { font-size: 8pt; }
.chart-page .lh-head { margin-bottom: 1mm; }
/* salary slip (sample format) */
.ss-title { text-align: center; font-size: 13pt; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; color: #1d2a33; margin: 2mm 0 1mm; }
.ss-sub { text-align: center; font-size: 9pt; color: #5d6b75; margin-bottom: 4mm; }
table.ss { width: 100%; border-collapse: collapse; font-size: 9.6pt; margin-bottom: 4mm; position: relative; background: rgba(255,255,255,.65); }
table.ss th, table.ss td { border: .35mm solid #2b3a42; padding: 1.8mm 2.4mm; vertical-align: middle; }
table.ss th { font-weight: 600; text-align: center; background: #f1f5fb; }
table.ss td.c { text-align: center; }
table.ss-pay thead th { background: #e3ecf8; }
table.ss-pay tbody td { height: 7mm; }
table.ss-pay tr.sub th, table.ss-pay tr.sub td { background: #f6f8fb; font-weight: 600; }
table.ss-pay tr.tot th { text-align: left; background: #fff; }
table.ss-pay tr.tot td { font-weight: 700; font-size: 10.5pt; }
table.ss-pay tr.net th, table.ss-pay tr.net td { background: var(--primary); color: #fff; border-color: #2b3a42; }
table.ss-pay td.words { font-size: 9pt; background: #fbfcfe; }
/* ===== Salary slip: landscape, plain, same layout as the hospital's sample ===== */
.ps-page { position: relative; width: 297mm; min-height: 210mm; background: #fff; color: #1b1b1b; margin: 0 auto; padding: 10mm 18mm 12mm;
  font-family: "Segoe UI", Calibri, Arial, sans-serif; box-shadow: 0 4px 24px rgba(0,0,0,.12); page: landscape; direction: ltr; text-align: left; }
.ps-logo { text-align: center; margin-bottom: 2mm; }
.ps-logo img { height: 30mm; width: auto; }
.ps-title { text-align: right; font-size: 14pt; text-decoration: underline; text-underline-offset: 2px; margin: 0 9mm 3mm 0; }
table.ps { width: 100%; border-collapse: collapse; font-size: 12.5pt; }
table.ps th, table.ps td { border: .35mm solid #222; padding: 1.6mm 3mm; font-weight: 400; vertical-align: middle; }
table.ps .hd { text-align: center; }
table.ps .val { text-align: center; }
table.ps .acc { text-align: left; letter-spacing: .3px; }
table.ps tr.cols th { text-align: center; padding: 2.6mm 3mm; font-size: 13pt; }
table.ps td.lbl { text-align: center; border-top: .35mm solid #222; border-bottom: .35mm solid #222; }
table.ps td.amt { text-align: center; font-size: 11pt; }
table.ps td.amt.i { font-style: italic; }
table.ps tr.tot th { text-align: left; padding: 2mm 3mm; }
table.ps tr.tot td { font-size: 13pt; }
table.ps td.blank { height: 22mm; vertical-align: bottom; }
.ps-verify { font-size: 7.5pt; color: #888; float: right; }
.ps-stamp { position: absolute; top: 12mm; right: 18mm; color: #c0392b; border: .6mm solid #c0392b; padding: 1mm 4mm; font-weight: 700; letter-spacing: 2px; }
@media print { .ps-page { box-shadow: none; margin: 0; break-after: page; -webkit-print-color-adjust: exact; print-color-adjust: exact; } .ps-page:last-child { break-after: auto; } }
.ps-page { height: 210mm; min-height: 0; overflow: hidden; padding: 8mm 18mm 8mm; }
.ps-logo img { height: 24mm; }
.ps-title { margin-bottom: 2.5mm; font-size: 13.5pt; }
table.ps { font-size: 12pt; }
table.ps th, table.ps td { padding: 1.3mm 3mm; }
table.ps td.lbl, table.ps td.amt { height: 8.5mm; }
table.ps tr.cols th { padding: 2mm 3mm; }
table.ps td.blank { height: 14mm; }
.cond-list { columns: 2; column-gap: 28px; margin-top: 6px; }
.cond-list li { break-inside: avoid; }
@media (max-width: 600px) { .cond-list { columns: 1; } }
/* payslip: more fixed rows now, keep it on one landscape page */
table.ps td.lbl, table.ps td.amt { height: 7.2mm; padding-top: .8mm; padding-bottom: .8mm; }
table.ps { font-size: 11.5pt; }
.ps-logo img { height: 21mm; }
table.ps td.blank { height: 11mm; }
