/* The Biomedical Index — styles */
:root {
  --bg: #F3F6F9; --surface: #fff; --surface-2: #F7FAFC; --ink: #0A1B2B; --ink-2: #33475B; --muted: #62748A;
  --line: #E1E8EF; --line-2: #CFD9E3; --brand: #0FA896; --brand-ink: #08796D; --brand-soft: #E2F7F3;
  --blue: #1F6FEB; --coral: #EE4D6A; --amber: #C77F06; --hero: #071522;
  --shadow-sm: 0 1px 2px rgba(10, 27, 43, .06);
  --shadow: 0 1px 2px rgba(10, 27, 43, .05), 0 10px 28px -14px rgba(10, 27, 43, .22);
  --shadow-lg: 0 24px 64px -20px rgba(10, 27, 43, .35);
  --r: 16px; --r-sm: 10px; --hdr: 64px;
  --font: 'Inter', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --display: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', 'Inter', system-ui, 'Segoe UI', sans-serif;
  --badge-bg: hsl(var(--h, 172) 75% 94%); --badge-ink: hsl(var(--h, 172) 72% 27%); --badge-dot: hsl(var(--h, 172) 70% 42%);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #06111B; --surface: #0C1B29; --surface-2: #102334; --ink: #EAF1F7; --ink-2: #C3D0DC; --muted: #8AA0B5;
  --line: #1B3145; --line-2: #294359; --brand: #2ADFC2; --brand-ink: #5DEED7; --brand-soft: #0D2C30;
  --blue: #6AA5FF; --coral: #FF7D93; --amber: #F2B441;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -18px rgba(0, 0, 0, .8);
  --shadow-lg: 0 28px 70px -20px rgba(0, 0, 0, .85);
  --badge-bg: hsl(var(--h, 172) 45% 17%); --badge-ink: hsl(var(--h, 172) 80% 76%); --badge-dot: hsl(var(--h, 172) 75% 58%);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; max-width: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; max-width: 100%; overflow-wrap: break-word; }
html[lang="ar"] body { font-size: 15.5px; line-height: 1.7; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -.02em; line-height: 1.2; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { letter-spacing: 0; line-height: 1.45; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
mark { background: color-mix(in srgb, var(--brand) 24%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.skip { position: absolute; inset-inline-start: 8px; top: 8px; z-index: 100; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip:focus, .skip:focus-visible { width: auto; height: auto; padding: 8px 14px; clip: auto; clip-path: none; overflow: visible; white-space: nowrap; background: var(--surface); border-radius: 8px; }
.wrap { width: min(1320px, 100% - 40px); margin-inline: auto; max-width: 100%; min-width: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ── Header ── */
.hdr { position: sticky; top: 0; z-index: 40; height: var(--hdr); background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line); }
.hdr .wrap { height: 100%; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; direction: ltr; }
.brand svg { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 6px 16px -6px rgba(15, 168, 150, .6); }
.brand-txt { display: flex; flex-direction: column; line-height: 1; }
.brand-txt small { font: 700 9px/1 var(--display); letter-spacing: .28em; color: var(--muted); margin-bottom: 3px; }
.brand-txt b { font: 800 18px/1 var(--display); letter-spacing: -.03em; }
.brand-txt b span { color: var(--brand); margin-inline-start: 3px; }
.nav { display: flex; gap: 2px; margin-inline-start: 14px; }
.nav a { padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.on { color: var(--ink); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.hdr .sp { flex: 1; }
.qs { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px; min-width: 210px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: 13.5px; }
.qs:hover { border-color: var(--line-2); color: var(--ink-2); }
.qs kbd { margin-inline-start: auto; }
kbd { font: 600 11px/1 var(--font); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); }
.ibtn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 700; font-size: 13px; flex: none; }
.ibtn:hover { border-color: var(--line-2); color: var(--ink); }
.ibtn .cnt { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--coral); color: #fff; font: 700 10.5px/18px var(--font); text-align: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; font-weight: 600; font-size: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.pri { background: var(--ink); color: var(--surface); border-color: var(--ink); }
[data-theme="dark"] .btn.pri { background: var(--brand); border-color: var(--brand); color: #04201c; }
.btn.pri:hover { filter: brightness(1.12); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand-ink); }
.btn.ghost:hover { background: var(--brand-soft); }

/* ── Hero ── */
.hero { position: relative; overflow: hidden; background: var(--hero); color: #fff; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background:
  radial-gradient(60% 90% at 88% 10%, rgba(31, 111, 235, .38), transparent 60%),
  radial-gradient(50% 80% at 8% 100%, rgba(25, 211, 181, .28), transparent 60%); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(80% 90% at 50% 30%, #000, transparent); -webkit-mask-image: radial-gradient(80% 90% at 50% 30%, #000, transparent); }
.hero .wrap { padding: 54px 0 0; text-align: center; }
.kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); font-size: 12.5px; font-weight: 600; color: #BFF5EA; }
.kicker i { width: 7px; height: 7px; border-radius: 50%; background: #2EE6C8; box-shadow: 0 0 0 0 rgba(46, 230, 200, .7); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(46, 230, 200, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 230, 200, 0); } }
.hero h1 { font-size: clamp(30px, 4.6vw, 54px); font-weight: 800; margin: 18px auto 12px; max-width: 880px; text-wrap: balance; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #2EE6C8, #6FB1FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: #B9C8D6; font-size: clamp(15px, 1.5vw, 17.5px); max-width: 700px; margin: 0 auto; text-wrap: pretty; }
.search { position: relative; max-width: 760px; margin: 28px auto 0; }
.search .ic { position: absolute; inset-inline-start: 20px; top: 50%; transform: translateY(-50%); width: 21px; height: 21px; color: #6B8196; pointer-events: none; }
.search input { width: 100%; height: 62px; padding: 0 56px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .18); background: #fff; color: #0A1B2B; font-size: 17px; box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .7), 0 0 0 6px rgba(255, 255, 255, .06); outline: none; }
.search input::placeholder { color: #8496A8; }
.search input:focus { box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .7), 0 0 0 4px rgba(46, 230, 200, .45); }
.search .x { position: absolute; inset-inline-end: 16px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 9px; color: #62748A; display: none; place-items: center; }
.search.has .x { display: grid; }
.search .x:hover { background: #EEF2F6; }
.tries { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; font-size: 13px; color: #8FA3B6; align-items: center; }
.tries button { padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .05); color: #D7E3EE; font-size: 13px; }
.tries button:hover { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .3); }
.stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 44px; margin-top: 34px; }
.stats div { text-align: center; }
.stats b { display: block; font: 800 30px/1.1 var(--display); letter-spacing: -.03em; color: #fff; font-variant-numeric: tabular-nums; }
.stats span { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #8FA3B6; }
html[lang="ar"] .stats span { letter-spacing: 0; font-size: 13px; }
.ecg { display: block; width: 100%; height: 64px; margin-top: 18px; }
.ecg path { fill: none; stroke: url(#ecgG); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2600; stroke-dashoffset: 2600; animation: draw 5s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ── Category bar ── */
.catbar { position: sticky; top: var(--hdr); z-index: 30; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.catbar { max-width: 100%; }
.catbar .wrap { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; min-width: 0; max-width: 100%; }
.catbar .wrap::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; flex: none; }
.pill .ic { color: var(--badge-dot); }
.pill:hover { border-color: var(--line-2); }
.pill em { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--bg); color: var(--muted); font-variant-numeric: tabular-nums; }
.pill.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.pill.on .ic { color: inherit; }
.pill.on em { background: rgba(255, 255, 255, .16); color: inherit; }
[data-theme="dark"] .pill.on { background: var(--brand); border-color: var(--brand); color: #04201c; }
[data-theme="dark"] .pill.on em { background: rgba(0, 0, 0, .16); }

/* ── Layout ── */
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 26px; padding: 26px 0 70px; align-items: start; }
.filters { position: sticky; top: calc(var(--hdr) + 76px); max-height: calc(100vh - var(--hdr) - 96px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; scrollbar-width: thin; }
.f-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.f-head h2 { font-size: 16px; }
.link { color: var(--brand-ink); font-weight: 600; font-size: 13px; }
.link:hover { text-decoration: underline; }
.fg { padding: 14px 0 4px; border-top: 1px solid var(--line); margin-top: 12px; }
.fg:first-of-type { border-top: 0; margin-top: 0; }
.fg h3 { font: 700 11px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
html[lang="ar"] .fg h3 { letter-spacing: 0; font-size: 13px; }
.fg > span { display: block; }
.opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 9px; font-size: 14px; color: var(--ink-2); text-align: start; }
.opt:hover { background: var(--surface-2); }
.opt .ic { color: var(--badge-dot); }
.opt span.l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt em { font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.opt.on { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.opt.zero { opacity: .45; }
.box { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--line-2); flex: none; display: grid; place-items: center; color: transparent; }
.opt.on .box { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-theme="dark"] .opt.on .box { color: #04201c; }
.box .ic { width: 11px; height: 11px; stroke-width: 3; color: inherit; }
.f-in { width: 100%; height: 36px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13.5px; margin-bottom: 8px; outline: none; }
.f-in:focus { border-color: var(--brand); }
.flag { width: 20px; height: 14px; border-radius: 3px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(10, 27, 43, .1); background: var(--line); }
.flag-x { display: inline-grid; place-items: center; width: 20px; height: 14px; border-radius: 3px; background: var(--line); color: var(--muted); font: 700 8px/1 var(--font); flex: none; }
.flag-g { color: var(--blue); width: 16px; height: 16px; }
.tagc { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; height: 25px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--ink-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
button.tag:hover, a.tag:hover { border-color: var(--brand); color: var(--brand-ink); }
.tag.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }

/* ── Results head ── */
.r-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.r-count { font-size: 14.5px; color: var(--muted); }
.r-count b { color: var(--ink); font-weight: 700; font-size: 17px; font-family: var(--display); }
.r-head .sp { flex: 1; }
.sel { height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 500; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.seg button { width: 32px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.seg button.on { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.only-m { display: none; }
.smart { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); background: linear-gradient(90deg, var(--brand-soft), var(--surface)); font-size: 13.5px; color: var(--ink-2); }
.smart > .ic { color: var(--brand); }
.smart b { font-weight: 600; }
.smart .tag { background: var(--surface); }
.smart .link { margin-inline-start: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; }
html[dir="rtl"] .chip { padding: 0 11px 0 6px; }
.chip button { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.chip button:hover { background: var(--bg); color: var(--ink); }
.chip .ic { width: 12px; height: 12px; }

/* ── Cards ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 14px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; min-width: 0; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.c-top { display: flex; align-items: center; gap: 8px; min-height: 28px; margin-bottom: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--badge-bg); color: var(--badge-ink); font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--badge-dot); flex: none; }
.c-top .st { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.star { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--line-2); flex: none; margin-inline-start: auto; }
.star:hover { background: var(--surface-2); color: var(--amber); }
.star.on { color: var(--amber); }
.star.on .ic { fill: currentColor; }
.c-main { display: flex; gap: 12px; align-items: center; min-width: 0; }
.logo { position: relative; width: 46px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center; overflow: hidden; background: hsl(var(--lh, 200) 55% 93%); color: hsl(var(--lh, 200) 55% 30%); font: 800 15px/1 var(--display); box-shadow: inset 0 0 0 1px rgba(10, 27, 43, .07); }
[data-theme="dark"] .logo { background: hsl(var(--lh, 200) 35% 20%); color: hsl(var(--lh, 200) 70% 78%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 8px; object-fit: contain; background: #fff; opacity: 0; transition: opacity .2s; }
.logo img.ok { opacity: 1; }
.logo.lg { width: 68px; height: 68px; border-radius: 16px; font-size: 22px; }
.logo.lg img { padding: 11px; }
.c-main h3 { font-size: 16px; font-weight: 700; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.c-main:hover h3 { color: var(--brand-ink); }
.loc { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.loc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desc { margin: 12px 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; direction: ltr; text-align: start; }
html[dir="rtl"] .desc, html[dir="rtl"] .d-desc { direction: ltr; text-align: left; }
html[dir="rtl"] .c-main h3, html[dir="rtl"] .d-head h2, html[dir="rtl"] .rel b, html[dir="rtl"] .ev b, html[dir="rtl"] .sv b { unicode-bidi: plaintext; text-align: right; }
.card .tagc { max-height: 25px; overflow: hidden; margin-bottom: 12px; }
.c-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; }
.pb { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; }
.pb.free { background: #E4F7EC; color: #116B3A; } .pb.paid { background: #FFF1D9; color: #8A5300; } .pb.freemium { background: #E8EEFF; color: #2B4BB3; } .pb.yr, .pb.mo { background: var(--bg); color: var(--muted); font-weight: 600; }
[data-theme="dark"] .pb.free { background: #10321F; color: #7EE2A8; } [data-theme="dark"] .pb.paid { background: #3A2A0B; color: #F2C56B; } [data-theme="dark"] .pb.freemium { background: #18264F; color: #9DB5FF; }
.cmp { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: auto; color: var(--muted); font-weight: 500; cursor: pointer; padding: 4px 6px; border-radius: 7px; }
.cmp:hover { color: var(--ink); background: var(--surface-2); }
.cmp.on { color: var(--brand-ink); font-weight: 600; }
.cmp.on .box { background: var(--brand); border-color: var(--brand); color: #fff; }
.more { display: inline-flex; align-items: center; gap: 3px; color: var(--brand-ink); font-weight: 700; }
.more .ic { width: 14px; height: 14px; }
html[dir="rtl"] .more .ic, html[dir="rtl"] .flip { transform: scaleX(-1); }
.more:hover { text-decoration: underline; }

/* list view */
.grid.list { grid-template-columns: 1fr; gap: 10px; }
.grid.list .card { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr) auto; grid-template-areas: "main desc foot" "top tags foot"; column-gap: 20px; row-gap: 6px; align-items: center; padding: 14px 18px; }
.grid.list .c-top { grid-area: top; margin: 0; } .grid.list .c-top .star { display: none; }
.grid.list .c-main { grid-area: main; } .grid.list .desc { grid-area: desc; margin: 0; -webkit-line-clamp: 2; }
.grid.list .tagc { grid-area: tags; margin: 0; } .grid.list .c-foot { grid-area: foot; border: 0; padding: 0; margin: 0; flex-direction: column; align-items: flex-end; }
.grid.list .cmp { margin: 0; }
/* table view */
.tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
.tbl th { text-align: start; font: 700 11px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 13px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; white-space: nowrap; }
html[lang="ar"] .tbl th { letter-spacing: 0; font-size: 12.5px; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .nm { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 220px; }
.tbl .nm .logo { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; } .tbl .nm .logo img { padding: 4px; }
.tbl .nm:hover { color: var(--brand-ink); }
.tbl .acts { display: flex; gap: 2px; justify-content: flex-end; }
.empty { text-align: center; padding: 70px 20px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); }
.empty .ic { width: 38px; height: 38px; color: var(--line-2); margin-bottom: 10px; }
.empty h3 { font-size: 18px; margin-bottom: 6px; } .empty p { color: var(--muted); margin-bottom: 16px; }
.morebar { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 26px; color: var(--muted); font-size: 13px; }

/* ── Sheets & modals ── */
.ovl { position: fixed; inset: 0; z-index: 60; background: rgba(4, 14, 24, .55); backdrop-filter: blur(3px); animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 61; width: min(620px, 100%); background: var(--bg); box-shadow: var(--shadow-lg); overflow: auto; animation: slide .26s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
html[dir="rtl"] .sheet { animation-name: slideR; }
@keyframes slideR { from { transform: translateX(-40px); opacity: 0; } }
.sh-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 12px 18px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.sh-bar .crumbs { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-bar .crumbs a:hover { color: var(--brand-ink); }
.sh-body { padding: 22px; }
.d-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.d-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.d-head h2 { font-size: 24px; font-weight: 800; }
.alt-n { font-size: 14px; color: var(--muted); margin-top: 2px; unicode-bidi: plaintext; }
button.tile { cursor: pointer; } button.tile:hover { border-color: var(--brand); }
.d-desc { font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px 18px; margin: 20px 0; padding: 18px 0; border-block: 1px solid var(--line); }
.facts dt { font: 700 10.5px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
html[lang="ar"] .facts dt { letter-spacing: 0; font-size: 12.5px; }
.facts dd { margin: 0; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 7px; overflow-wrap: anywhere; }
.facts dd a, .facts dd button { color: var(--brand-ink); text-align: start; font-weight: 600; } .facts dd a:hover, .facts dd button:hover { text-decoration: underline; }
.d-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.sec-t { font-size: 15px; margin: 26px 0 12px; }
.rel { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.rel a { display: flex; gap: 11px; align-items: center; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.rel a:hover { border-color: var(--brand); }
.rel .logo { width: 36px; height: 36px; border-radius: 9px; font-size: 12px; } .rel .logo img { padding: 5px; }
.rel b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel div { min-width: 0; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.modal { position: fixed; z-index: 61; inset: 0; margin: auto; width: min(560px, calc(100% - 28px)); height: fit-content; max-height: calc(100% - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop .2s cubic-bezier(.2, .8, .2, 1); }
.modal.wide { width: min(1080px, calc(100% - 28px)); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.m-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.m-head h2 { font-size: 18px; flex: 1; }
.m-body { padding: 20px; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.form input, .form select, .form textarea { height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 14.5px; font-weight: 400; outline: none; width: 100%; }
.form textarea { height: 96px; padding: 10px 12px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ok-box { text-align: center; padding: 14px 6px; }
.ok-box .ic { width: 44px; height: 44px; color: var(--brand); margin-bottom: 8px; }
.ok-box p { color: var(--muted); margin: 8px 0 16px; }
/* compare */
.cmp-t { width: 100%; border-collapse: collapse; font-size: 13.5px; table-layout: fixed; min-width: 640px; }
.cmp-t th, .cmp-t td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.cmp-t tbody th { width: 130px; font: 700 10.5px/1.4 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
html[lang="ar"] .cmp-t tbody th { letter-spacing: 0; font-size: 12.5px; }
.cmp-t thead th { vertical-align: bottom; } .cmp-t thead .logo { margin-bottom: 8px; }
.cmp-t thead b { display: block; font: 700 15px/1.3 var(--display); }
.cmp-t td .tagc { gap: 5px; }
.tray { position: fixed; z-index: 45; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 16px; border-radius: 16px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow-lg); max-width: calc(100% - 24px); animation: pop .2s; }
[data-theme="dark"] .tray { background: #173046; color: var(--ink); border: 1px solid var(--line-2); }
.tray .lbl { font-size: 13px; font-weight: 600; white-space: nowrap; }
.tray .th { display: flex; }
.tray .logo { width: 30px; height: 30px; border-radius: 8px; font-size: 10.5px; margin-inline-start: -6px; box-shadow: 0 0 0 2px var(--ink); } .tray .logo img { padding: 4px; }
.tray .th .logo:first-child { margin: 0; }
.tray .btn { height: 34px; background: var(--brand); border-color: var(--brand); color: #04201c; }
.tray .xb { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; opacity: .7; } .tray .xb:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
/* saved */
.sv { display: flex; gap: 12px; align-items: center; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.sv a { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: center; }
.sv .logo { width: 38px; height: 38px; border-radius: 10px; font-size: 12.5px; } .sv .logo img { padding: 5px; }
.sv b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sv small { color: var(--muted); font-size: 12.5px; }
.sv div { min-width: 0; }
/* palette */
.pal { position: fixed; z-index: 71; top: 12vh; left: 50%; transform: translateX(-50%); width: min(640px, calc(100% - 24px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s; }
.ovl.top { z-index: 70; }
.pal-in { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.pal-in .ic { width: 19px; height: 19px; color: var(--muted); }
.pal-in input { flex: 1; height: 56px; border: 0; outline: 0; background: none; font-size: 16.5px; min-width: 0; }
.pal-list { max-height: 52vh; overflow: auto; padding: 8px; }
.pal-list h4 { font: 700 10.5px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 6px; }
html[lang="ar"] .pal-list h4 { letter-spacing: 0; font-size: 12.5px; }
.pi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: start; font-size: 14px; }
.pi.sel { background: var(--brand-soft); }
.pi .logo { width: 30px; height: 30px; border-radius: 8px; font-size: 10.5px; } .pi .logo img { padding: 4px; }
.pi .pic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--badge-bg); color: var(--badge-ink); flex: none; }
.pi b { font-weight: 600; } .pi small { color: var(--muted); margin-inline-start: auto; font-size: 12px; white-space: nowrap; }
.pi span.t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-ft { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--surface-2); }
.toast { position: fixed; z-index: 90; bottom: 78px; left: 50%; transform: translateX(-50%); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--surface); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: pop .2s; }

/* ── Pages (insights / events) ── */
.page { padding: 38px 0 80px; }
.page-h { margin-bottom: 26px; }
.page-h h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }
.page-h p { color: var(--muted); margin-top: 8px; max-width: 720px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.tile b { display: block; font: 800 32px/1.1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; font-weight: 500; }
.tile .ic { width: 22px; height: 22px; color: var(--brand); margin-bottom: 10px; }
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.panel h2 { font-size: 16px; margin-bottom: 16px; }
.panel.full { grid-column: 1 / -1; }
.bar { display: grid; grid-template-columns: minmax(110px, 190px) minmax(0, 1fr) 44px; gap: 12px; align-items: center; width: 100%; padding: 6px 6px; border-radius: 8px; font-size: 13.5px; text-align: start; }
button.bar:hover { background: var(--surface-2); }
.bar .bl { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.bar .bl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .bl .ic { color: var(--badge-dot); }
.bar .bt { height: 10px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.bar .bt i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, hsl(var(--h, 172) 70% 45%), hsl(var(--h, 172) 75% 58%)); min-width: 3px; }
html[dir="rtl"] .bar .bt i { margin-inline-start: 0; }
.bar em { font-style: normal; font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 16px; }
.month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.month.now { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.month h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 10px; }
.month h2 em { font: 700 10.5px/1 var(--font); font-style: normal; padding: 4px 7px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-ink); }
.month h2 span { margin-inline-start: auto; font: 600 12px/1 var(--font); color: var(--muted); }
.ev { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; min-width: 0; }
.ev:hover { background: var(--surface-2); }
.ev .logo { width: 34px; height: 34px; border-radius: 9px; font-size: 11.5px; } .ev .logo img { padding: 5px; }
.ev div { min-width: 0; }
.ev b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ev small span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.month .none { color: var(--muted); font-size: 13px; padding: 8px; }

/* ── Footer ── */
.ftr { border-top: 1px solid var(--line); background: var(--surface); padding: 30px 0; font-size: 13.5px; color: var(--muted); }
.ftr .wrap { display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: center; }
.ftr .sp { flex: 1; }
.ftr a:hover { color: var(--ink); }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .nav a span { display: none; } .nav a .ic { display: block; }
  .qs { min-width: 0; width: 38px; padding: 0; justify-content: center; } .qs span, .qs kbd { display: none; }
  .hdr .btn.pri span { display: none; } .hdr .btn.pri { width: 38px; padding: 0; height: 38px; }
}
@media (min-width: 1081px) { .nav a .ic { display: none; } }
/* Mobile menu is hidden on desktop; see max-width: 900px. */
.menu-btn, .nav-drawer, .nav-ovl { display: none; }
body.m-open { overflow: hidden; }

@media (max-width: 900px) {
  .menu-btn { display: inline-grid; }
  .hdr .wrap > .nav,
  .hdr .wrap > .hdr-tool { display: none; }
  .hdr .wrap { gap: 8px; min-width: 0; max-width: 100%; }
  .brand { min-width: 0; }
  .nav-ovl {
    display: none;
    position: fixed;
    inset: var(--hdr) 0 0 0;
    z-index: 38;
    background: rgba(4, 14, 24, .45);
  }
  .nav-drawer {
    display: none;
    position: fixed;
    top: var(--hdr);
    inset-inline: 0;
    z-index: 39;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 8px 12px 18px;
    max-height: calc(100dvh - var(--hdr));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.m-open .nav-ovl,
  body.m-open .nav-drawer { display: block; }
  .drawer-nav { display: flex; flex-direction: column; gap: 2px; }
  .drawer-nav a {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 12px 14px; border-radius: 11px; font-weight: 600; font-size: 15px;
    color: var(--ink-2); white-space: normal;
  }
  .drawer-nav a .ic { display: block; width: 20px; height: 20px; flex: none; }
  .drawer-nav a span { display: inline; }
  .drawer-nav a:hover, .drawer-nav a.on { color: var(--ink); background: var(--bg); }
  .drawer-nav a.on { box-shadow: inset 0 0 0 1px var(--line); }
  .drawer-tools {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
  }
  .drawer-tools .btn { flex: 1 1 calc(50% - 8px); min-height: 42px; white-space: normal; height: auto; padding: 8px 14px; }

  .layout { grid-template-columns: 1fr; padding-top: 18px; }
  .filters { position: fixed; inset: 0 auto 0 0; z-index: 62; width: min(340px, 88%); max-height: none; border-radius: 0; border: 0; transform: translateX(-105%); transition: transform .25s; top: 0; }
  html[dir="rtl"] .filters { inset: 0 0 0 auto; transform: translateX(105%); }
  body.f-open .filters { transform: none; box-shadow: var(--shadow-lg); }
  body.f-open::after { content: ""; position: fixed; inset: 0; z-index: 61; background: rgba(4, 14, 24, .55); }
  .only-m { display: inline-flex; }
  .panels { grid-template-columns: 1fr; }
  .grid.list .card { grid-template-columns: 1fr; grid-template-areas: "top" "main" "desc" "tags" "foot"; }
  .grid.list .c-foot { flex-direction: row; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 28px); max-width: 100%; }
  .brand-txt small { display: none; } .brand-txt b { font-size: 16px; }
  .nav { margin-inline-start: 0; } .hdr .wrap { gap: 8px; } .nav a { padding: 8px; }
  .hero .wrap { padding-top: 36px; }
  .search input { height: 54px; font-size: 16px; padding: 0 48px; border-radius: 15px; } .search .ic { inset-inline-start: 16px; }
  .stats { gap: 14px 26px; } .stats b { font-size: 24px; }
  .grid { grid-template-columns: 1fr; }
  .form .row { grid-template-columns: 1fr; }
  .sh-body { padding: 14px; } .d-card { padding: 16px; } .d-head h2 { font-size: 20px; }
  .bar { grid-template-columns: minmax(90px, 130px) minmax(0, 1fr) 36px; }
  .tray .lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } .ecg path { stroke-dashoffset: 0; } }
