@font-face { font-family: "Hafs"; src: url("fonts/uthmanic_hafs_regular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "TahaNaskh"; src: url("fonts/kfgqpc_uthman_taha_naskh_regular.ttf") format("truetype"); font-display: swap; }

/* ================= Tokens ================= */
:root {
  --accent: #9b5a2c;
  --accent-deep: #7a4420;
  --gold: #c8a15a;
  --green: #2e9f6e;
  --ink: #2b2317;
  --ink-2: #7b6d5c;
  --ink-3: #aa9c89;
  --bg: #f3ece0;
  --wall-1: #fbe3c6;
  --wall-2: #e7d8bf;
  --paper: #fffcf5;
  --reader-bg: #ece3d4;
  --card: rgba(255, 255, 255, .62);
  --card-solid: #fffaf2;
  --hair: rgba(60, 45, 25, .11);
  --tab-active: rgba(155, 90, 44, .13);
  --seg-active: rgba(255, 255, 255, .95);

  /* Liquid Glass */
  --glass-bg: rgba(255, 255, 255, .52);
  --glass-strong: rgba(255, 252, 246, .80);
  --glass-border: rgba(255, 255, 255, .78);
  --glass-hi: rgba(255, 255, 255, .95);
  --glass-lo: rgba(60, 45, 25, .06);
  --glass-shadow: 0 12px 34px rgba(60, 45, 25, .14), 0 2px 6px rgba(60, 45, 25, .07);

  --hl-sel: rgba(255, 200, 60, .42);
  --hl-press: rgba(155, 90, 44, .22);
  --hl-range: rgba(46, 159, 110, .19);
  --hl-start: rgba(46, 159, 110, .45);
  --hl-bm: rgba(155, 90, 44, .10);

  --page-filter: none;
  --ayah-size: 24px;
  --tabbar-h: 62px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #e3a56d; --accent-deep: #b87a45; --gold: #c8a15a; --green: #43c08a;
    --ink: #f2e9d9; --ink-2: #b5a794; --ink-3: #7d7163;
    --bg: #141210; --wall-1: #2b2016; --wall-2: #1a1713; --paper: #1e1b16; --reader-bg: #110f0c;
    --card: rgba(255, 255, 255, .06); --card-solid: #221e19; --hair: rgba(255, 255, 255, .09);
    --tab-active: rgba(255, 255, 255, .11); --seg-active: rgba(255, 255, 255, .16);
    --glass-bg: rgba(42, 37, 31, .52); --glass-strong: rgba(34, 30, 25, .84);
    --glass-border: rgba(255, 255, 255, .13); --glass-hi: rgba(255, 255, 255, .16); --glass-lo: rgba(0, 0, 0, .35);
    --glass-shadow: 0 14px 36px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);
    --hl-sel: rgba(230, 180, 60, .32); --hl-press: rgba(227, 165, 109, .25);
    --hl-range: rgba(67, 192, 138, .18); --hl-start: rgba(67, 192, 138, .40); --hl-bm: rgba(227, 165, 109, .12);
    --page-filter: invert(.88) sepia(.3) hue-rotate(-8deg);
    color-scheme: dark;
  }
}

/* ================= Base ================= */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: #d8cfc0; color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Arabic", "SF Pro Text", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  display: flex; justify-content: center; -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) { body { background: #080706; } }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.device {
  position: relative; width: 100%; max-width: 430px; height: 100dvh; overflow: hidden;
  background:
    radial-gradient(120% 55% at 95% -10%, var(--wall-1), transparent 62%),
    radial-gradient(110% 50% at -15% 105%, var(--wall-2), transparent 60%),
    var(--bg);
}
@media (min-width: 520px) {
  body { align-items: center; }
  .device { height: min(900px, calc(100dvh - 32px)); border-radius: 46px; box-shadow: 0 0 0 10px #15120e, 0 30px 80px rgba(0, 0, 0, .35); }
}

/* Liquid Glass material */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(24px) saturate(185%);
  backdrop-filter: blur(24px) saturate(185%);
  border: .5px solid var(--glass-border);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi), inset 0 -.5px 0 var(--glass-lo);
}
.circle { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--ink); transition: transform .3s var(--spring); }
.circle svg { width: 21px; height: 21px; }
.circle:active, .tab:active, .tab-search:active, .as-action:active, .hero:active { transform: scale(.94); }

/* ================= Splash ================= */
.splash { position: absolute; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; transition: opacity .4s ease; }
.splash.done { opacity: 0; pointer-events: none; }
.splash-mark { font-family: "Hafs", serif; font-size: 54px; color: var(--accent); }
.splash-title { font-family: "TahaNaskh", serif; font-size: 34px; }
.splash-bar { width: 140px; height: 4px; background: var(--hair); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.splash-bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .3s; }

/* ================= Screens ================= */
.screen { position: absolute; inset: 0; }
.scroll {
  height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 40px);
}
.large-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 22px 4px 16px; }
.large-title h1 { margin: 0; font-size: 34px; line-height: 1.2; font-weight: 800; }
.large-title .sub { color: var(--ink-2); font-size: 14px; margin-top: 2px; }

/* hero card */
.hero {
  display: block; width: 100%; text-align: right; color: #fff8ee; border-radius: 28px; padding: 18px 20px 20px; margin-bottom: 18px;
  background: linear-gradient(140deg, #b06a35 0%, var(--accent-deep) 100%);
  box-shadow: 0 16px 34px rgba(122, 68, 32, .32), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -1px 0 rgba(0, 0, 0, .12);
  position: relative; overflow: hidden; transition: transform .3s var(--spring);
}
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 60% at 10% 0%, rgba(255, 255, 255, .22), transparent 60%); pointer-events: none; }
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.hero-label { font-size: 13px; font-weight: 600; opacity: .85; }
.hero-go { width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.hero-go svg { width: 18px; height: 18px; }
.hero-title { font-family: "TahaNaskh", serif; font-size: 30px; line-height: 1.35; margin-top: 4px; }
.hero-meta { font-size: 14px; opacity: .9; }
.hero-progress { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .22); margin-top: 14px; overflow: hidden; }
.hero-progress span { display: block; height: 100%; background: #fff3df; border-radius: 5px; }

/* segmented */
.segmented { display: flex; padding: 4px; border-radius: 999px; margin-bottom: 14px; position: sticky; top: 0; z-index: 3; }
.segmented.inner { background: var(--card); border: .5px solid var(--hair); position: static; margin: 0; }
.seg { flex: 1; height: 36px; border-radius: 999px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); transition: background .3s var(--ease), color .3s, box-shadow .3s; }
.seg.active { background: var(--seg-active); color: var(--ink); box-shadow: 0 3px 10px rgba(0, 0, 0, .1), inset 0 1px 0 var(--glass-hi); }

/* inset grouped list */
.card {
  background: var(--card); border-radius: 24px; border: .5px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 6px 20px rgba(60, 45, 25, .06);
}
.list { list-style: none; margin: 0 0 16px; padding: 0; overflow: hidden; }
.row { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px 16px; text-align: right; position: relative; transition: background .15s; cursor: pointer; }
.list > li + li .row::before { content: ""; position: absolute; top: 0; right: 64px; left: 0; height: .5px; background: var(--hair); }
.row:active { background: var(--tab-active); }
.num { flex: none; width: 36px; height: 36px; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--accent); position: relative; }
.num::before { content: ""; position: absolute; inset: 5px; border: 1.5px solid var(--gold); border-radius: 7px; transform: rotate(45deg); opacity: .8; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-family: "TahaNaskh", serif; font-size: 20px; line-height: 1.35; }
.row-sub { display: block; font-size: 12.5px; color: var(--ink-2); }
.row-end { flex: none; font-size: 12px; color: var(--ink-3); text-align: left; display: flex; align-items: center; gap: 6px; }
.row-end b { color: var(--ink-2); font-weight: 600; font-size: 13px; }
.chev { width: 14px; height: 14px; color: var(--ink-3); }
.icon-btn { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.icon-btn:hover { background: var(--tab-active); color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }

/* ================= Reader ================= */
/* الصفحة تغطي الشاشة كاملة (ورق ممتد من الحافة للحافة) والأزرار عائمة فوقها */
.reader {
  background: var(--paper);
  --pad-top: env(safe-area-inset-top);
  --pad-bottom: env(safe-area-inset-bottom);
}
.pager {
  position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; touch-action: manipulation;
}
.pager::-webkit-scrollbar { display: none; }
.pager.dragging { scroll-snap-type: none; cursor: grabbing; }
.slide {
  flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center; padding: var(--pad-top) 0 var(--pad-bottom);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.sheet {
  position: relative; flex: none; width: var(--sheet-w, 300px); height: var(--sheet-h, 485px);
  background: var(--paper);
}
.sheet img, .sheet svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sheet img { filter: var(--page-filter); }
.sheet rect { transition: fill .2s; }
.m-sel { fill: var(--hl-sel); } .m-press { fill: var(--hl-press); } .m-range { fill: var(--hl-range); }
.m-start { fill: var(--hl-start); } .m-bm { fill: var(--hl-bm); }

.text-page {
  width: 100%; height: 100%; overflow-y: auto; background: var(--paper); touch-action: pan-x pan-y;
  padding: calc(env(safe-area-inset-top) + 66px) 20px calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 34px);
}
.text-inner { max-width: 560px; margin: 0 auto; }
.slide:has(.text-page) { padding: 0; }
.text-inner { font-family: "Hafs", serif; font-size: var(--ayah-size); line-height: 2.1; text-align: justify; text-align-last: center; }
.sura-head { display: block; text-align: center; margin: 8px 0 4px; padding: 2px 0; color: var(--accent); font-family: "TahaNaskh", serif; font-size: 1.05em; border: 1.5px solid var(--gold); border-radius: 14px; }
.bismillah { display: block; text-align: center; color: var(--accent); }
.ayah { border-radius: 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background .2s; cursor: pointer; }
.ayah.m-sel { background: var(--hl-sel); } .ayah.m-press { background: var(--hl-press); } .ayah.m-range { background: var(--hl-range); }
.ayah.m-start { background: var(--hl-start); } .ayah.m-bm { background: var(--hl-bm); }
.marker { color: var(--gold); white-space: nowrap; }

.reader-bar {
  position: absolute; top: calc(env(safe-area-inset-top) + 10px); left: 12px; right: 12px; z-index: 10;
  display: flex; align-items: center; gap: 8px; transition: transform .5s var(--ease), opacity .3s;
}
.reader-info { flex: 1; min-width: 0; height: 44px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 15.5px; color: var(--ink); }
.reader-info .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); }
.reader-info .juz { font-family: "Hafs", serif; font-weight: 400; font-size: 17px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-badge { font-weight: 700; font-size: 15px; color: var(--accent); min-width: 44px; width: auto; padding: 0 10px; border-radius: 999px; }
.device.immersive .reader-bar { transform: translateY(calc(-100% - 24px - env(safe-area-inset-top))); opacity: 0; pointer-events: none; }

.wird-banner {
  position: absolute; z-index: 9; left: 50%; top: calc(env(safe-area-inset-top) + 64px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; border-radius: 999px; white-space: nowrap;
  font-size: 13.5px; font-weight: 600; transition: top .5s var(--ease); max-width: calc(100% - 24px);
}
.device.immersive .wird-banner { top: calc(env(safe-area-inset-top) + 10px); }
.wb-text { overflow: hidden; text-overflow: ellipsis; }
.wird-banner button { background: var(--card); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 0 0 var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.nav-arrow { position: absolute; top: 50%; z-index: 6; transform: translateY(-50%); display: none; }
.nav-arrow.next { left: 10px; } .nav-arrow.prev { right: 10px; }
@media (hover: hover) and (pointer: fine) { .nav-arrow { display: grid; opacity: .75; transition: opacity .3s; } .nav-arrow:hover { opacity: 1; } }
.device.immersive .nav-arrow { opacity: 0; pointer-events: none; }

/* ================= Tab bar ================= */
.tabbar-wrap {
  position: absolute; z-index: 20; left: 14px; right: 14px; bottom: calc(env(safe-area-inset-bottom) + 12px);
  display: flex; align-items: center; gap: 10px; transition: transform .5s var(--ease), opacity .3s;
}
.device.immersive .tabbar-wrap { transform: translateY(calc(100% + 40px)); opacity: 0; pointer-events: none; }
.tabbar { flex: 1; display: flex; height: var(--tabbar-h); border-radius: 999px; padding: 5px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 999px; font-size: 10.5px; font-weight: 600; color: var(--ink); transition: background .35s var(--ease), color .25s, transform .3s var(--spring); }
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--accent); background: var(--tab-active); }
.tab-search { width: var(--tabbar-h); height: var(--tabbar-h); border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--ink); transition: transform .3s var(--spring), color .2s; }
.tab-search svg { width: 25px; height: 25px; }
.tab-search.active { color: var(--accent); }

/* ================= Bottom sheets ================= */
.backdrop { position: absolute; inset: 0; z-index: 30; background: rgba(25, 18, 10, .22); opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.backdrop.show { opacity: 1; pointer-events: auto; }
.bsheet {
  position: absolute; z-index: 31; left: 8px; right: 8px; bottom: calc(env(safe-area-inset-bottom) + 8px);
  max-height: 82%; overflow-y: auto; border-radius: 34px; padding: 8px 18px 18px;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(30px) saturate(190%); backdrop-filter: blur(30px) saturate(190%);
  border: .5px solid var(--glass-border); box-shadow: 0 -4px 40px rgba(0, 0, 0, .18), inset 0 1px 0 var(--glass-hi);
  transform: translateY(calc(100% + 40px)); transition: transform .5s var(--ease); visibility: hidden;
}
.bsheet.show { transform: none; visibility: visible; }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--ink-3); opacity: .45; margin: 0 auto 12px; }
.as-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.as-title { font-size: 20px; font-weight: 800; }
.as-sub { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.close-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--card); color: var(--ink-2); font-size: 13px; flex: none; border: .5px solid var(--hair); }
.as-text { font-family: "Hafs", serif; font-size: 21px; line-height: 1.95; margin: 12px 0 14px; max-height: 6em; overflow-y: auto; }
.primary-btn {
  width: 100%; min-height: 54px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--green); color: #fff; font-weight: 700; font-size: 16px; padding: 8px 14px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--green) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .3s var(--spring);
}
.primary-btn small { font-weight: 500; font-size: 12.5px; opacity: .9; }
.primary-btn:active { transform: scale(.97); }
.primary-btn.neutral { background: var(--card); color: var(--ink); box-shadow: none; border: .5px solid var(--hair); }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }
.as-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.as-action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 20px; background: var(--card); border: .5px solid var(--hair); font-size: 12.5px; font-weight: 600; transition: transform .3s var(--spring); }
.as-action svg { width: 22px; height: 22px; color: var(--accent); }
.as-action.on svg { fill: var(--accent); }

.vs-group { margin-top: 18px; }
.vs-label { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; font-weight: 600; }
.vs-label b { color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.stepper { display: flex; align-items: center; justify-content: space-between; background: var(--card); border: .5px solid var(--hair); border-radius: 999px; padding: 4px; }
.stepper button { width: 64px; height: 36px; border-radius: 999px; font-weight: 700; color: var(--accent); }
.stepper button:active { background: var(--tab-active); }
.stepper span { font-weight: 700; }

/* ================= Toast ================= */
.toast {
  position: absolute; z-index: 50; left: 50%; top: calc(env(safe-area-inset-top) + 12px);
  transform: translate(-50%, calc(-100% - 30px)); transition: transform .5s var(--ease);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; background: var(--glass-strong);
}
.toast.show { transform: translate(-50%, 0); }

/* ================= Search ================= */
.search-field { display: flex; align-items: center; gap: 10px; height: 48px; border-radius: 999px; padding: 0 16px; margin-bottom: 8px; cursor: text; }
.search-field svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16.5px; color: var(--ink); }
.search-meta { font-size: 12.5px; color: var(--ink-2); padding: 2px 8px 10px; min-height: 18px; }
.result { display: block; width: 100%; text-align: right; padding: 13px 16px; position: relative; cursor: pointer; }
.list > li + li .result::before { content: ""; position: absolute; top: 0; right: 16px; left: 0; height: .5px; background: var(--hair); }
.result-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 2px; }
.result-top b { color: var(--accent); font-weight: 700; }
.result-text { font-family: "Hafs", serif; font-size: 20px; line-height: 1.9; }
mark { background: var(--hl-sel); color: inherit; border-radius: 5px; padding: 0 1px; }

/* ================= Wird ================= */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { border-radius: 22px; padding: 14px 10px; text-align: center; }
.stat b { display: block; font-size: 26px; font-weight: 800; line-height: 1.2; color: var(--ink); }
.stat span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.stat.hot b { color: var(--accent); }
.cta { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 22px; margin-bottom: 18px; text-align: right; transition: transform .3s var(--spring); }
.cta:active { transform: scale(.97); }
.cta-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; flex: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.cta-icon svg { width: 20px; height: 20px; }
.cta-main { flex: 1; min-width: 0; }
.cta-main b { display: block; font-size: 15.5px; }
.cta-main span { font-size: 13px; color: var(--ink-2); }
.group-label { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 4px 10px 8px; }
.wird-dot { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.wird-dot svg { width: 18px; height: 18px; }
.wird-title { display: block; font-weight: 700; font-size: 15.5px; }
.wird-title .arrow { color: var(--ink-3); margin: 0 4px; font-weight: 400; }

.empty { text-align: center; color: var(--ink-2); padding: 34px 20px; font-size: 15px; line-height: 1.7; }
.empty .big { display: block; font-size: 42px; margin-bottom: 6px; }
.steps { list-style: none; margin: 0; padding: 6px 16px 14px; text-align: right; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.steps li + li { border-top: .5px solid var(--hair); }
.step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); font-weight: 800; font-size: 13px; display: grid; place-items: center; }

/* ================= API lab ================= */
.api-card { margin-bottom: 10px; overflow: hidden; }
.api-row { display: flex; align-items: center; gap: 8px; padding: 12px 14px; direction: ltr; }
.api-sig { flex: 1; font: 13px/1.5 ui-monospace, Menlo, monospace; color: var(--ink); }
.api-sig input { width: 60px; font: inherit; padding: 2px 6px; border: .5px solid var(--hair); border-radius: 8px; background: var(--card-solid); color: var(--ink); }
.api-sig input.wide { width: 104px; }
.api-run { background: var(--accent); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.api-out { direction: ltr; margin: 0; padding: 10px 14px; border-top: .5px solid var(--hair); font: 11.5px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow: auto; }
.api-out .ok { color: var(--green); }
