/* =====================================================================
   رحلة الجسد — الواجهة (الإصدار 2: زجاجي هولوغرامي)
   ===================================================================== */
:root {
  --bg: #02080f; --glass: rgba(7, 20, 34, 0.74); --glass-2: rgba(11, 30, 50, 0.88); --line: rgba(120, 210, 255, 0.14); --line-2: rgba(120, 210, 255, 0.28);
  --ink: #e9f6ff; --mute: #8eb0c7; --dim: #5d7c92; --acc: #39d5ff; --acc-2: #7b8cff; --warm: #ffb547; --good: #4dffa6; --bad: #ff5d73;
  --r: 18px; --font: 'Cairo', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --top: 60px; --sheet-h: 0px; --shadow: 0 18px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; background: var(--bg); color: var(--ink); font-family: var(--font); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.ic { display: block; flex: none; }
#app { position: fixed; inset: 0; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.glass { background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); box-shadow: var(--shadow); }

/* ---------- عناصر عامة ---------- */
.ib { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: rgba(14, 38, 62, .55); display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: .18s; color: var(--ink); position: relative; }
.ib:hover { border-color: var(--line-2); background: rgba(57, 213, 255, .12); transform: translateY(-1px); }
.ib.on { background: linear-gradient(135deg, rgba(57, 213, 255, .28), rgba(123, 140, 255, .22)); border-color: rgba(57, 213, 255, .6); box-shadow: 0 0 18px rgba(57, 213, 255, .25); }
.ib.wide { width: auto; padding: 0 12px; font-size: 13px; font-weight: 600; }
.btn { height: 34px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(14, 38, 62, .6); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--line-2); background: rgba(57, 213, 255, .12); }
.btn.on { background: rgba(57, 213, 255, .22); border-color: var(--acc); }
.btn.pri { background: linear-gradient(135deg, #18b8ea, #3d6dff); border-color: transparent; color: #fff; font-weight: 700; box-shadow: 0 6px 20px rgba(24, 160, 234, .35); }
.btn.pri:hover { filter: brightness(1.1); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 9px; }
.kbd { font-family: var(--mono); font-size: 10px; color: var(--mute); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 8px currentColor; }
.scroll { overflow: auto; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: #1b4a6b transparent; }
.tip { position: relative; }

/* ---------- الشريط العلوي ---------- */
#topbar { position: absolute; top: 0; inset-inline: 0; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 14px; z-index: 32;
  background: linear-gradient(180deg, rgba(2, 9, 18, .92), rgba(2, 9, 18, .4)); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand .logo { width: 36px; height: 36px; filter: drop-shadow(0 0 10px rgba(57, 213, 255, .6)); }
.brand b { display: block; font-size: 17px; font-weight: 800; letter-spacing: .2px; background: linear-gradient(90deg, #fff, #9fe8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand small { display: block; font-size: 9.5px; color: var(--mute); letter-spacing: 3px; direction: ltr; text-align: right; }
.search { position: relative; flex: 1; max-width: 480px; }
.search .sic { position: absolute; inset-inline-start: 12px; top: 9px; color: var(--mute); pointer-events: none; }
#search { width: 100%; height: 40px; border-radius: 20px; border: 1px solid var(--line); background: rgba(10, 28, 46, .8); color: var(--ink); padding-inline: 40px 14px; font: inherit; font-size: 14px; outline: none; transition: .2s; }
#search:focus { border-color: var(--acc); box-shadow: 0 0 0 4px rgba(57, 213, 255, .12); }
.dropdown { position: absolute; top: 46px; inset-inline: 0; max-height: 62vh; overflow: auto; background: rgba(8, 22, 38, .97); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; z-index: 40; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); backdrop-filter: blur(16px); }
.dropdown .it { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.dropdown .it:hover, .dropdown .it.on { background: rgba(57, 213, 255, .12); }
.dropdown .it small { color: var(--mute); margin-inline-start: auto; font-size: 11px; direction: ltr; }
.dropdown .it .lay { font-size: 10px; color: var(--dim); }
.actions { display: flex; gap: 6px; margin-inline-start: auto; }
#profile { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 22px; border: 1px solid var(--line); background: rgba(10, 28, 46, .6); cursor: pointer; }
#profile .ring { width: 34px; height: 34px; position: relative; }
#profile .ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
#profile .pt { font-size: 11px; color: var(--mute); line-height: 1.25; }
#profile .pt b { display: block; color: var(--ink); font-size: 12px; }

/* ---------- شريط الأجهزة الجانبي ---------- */
#rail { position: absolute; top: calc(var(--top) + 12px); inset-inline-start: 12px; z-index: 16; display: flex; flex-direction: column; gap: 4px; padding: 7px; border-radius: 22px; max-height: calc(100vh - var(--top) - 24px); overflow-y: auto; scrollbar-width: none; }
#rail::-webkit-scrollbar { display: none; }
#rail .sb { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; background: rgba(255, 255, 255, .04); display: flex; align-items: center; justify-content: center; font-size: 15px; transition: .18s; position: relative; }
#rail .sb.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 20%, transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent); }
#rail .sb:not(.on) { opacity: .45; filter: grayscale(.6); }
#rail .sb:hover { opacity: 1; transform: scale(1.08); }
#rail .sep { height: 1px; background: var(--line); margin: 4px 2px; }
#rail .ib { flex: none; width: 34px; height: 34px; border-radius: 50%; }
#tooltip.tip { white-space: nowrap; }

/* ---------- درج الأجهزة والشجرة ---------- */
#nav { position: absolute; top: calc(var(--top) + 12px); bottom: 12px; inset-inline-start: 12px; width: 330px; z-index: 30; border-radius: var(--r); display: flex; flex-direction: column; overflow: hidden; transform: translateX(110%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
#nav.open { transform: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 800; }
#systems { padding: 8px; display: grid; gap: 3px; }
.sysrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; }
.sysrow:hover { background: rgba(255, 255, 255, .04); }
.sysrow input { accent-color: var(--acc); width: 16px; height: 16px; }
.sysrow .nm { flex: 1; font-size: 13px; cursor: pointer; }
.sysrow .pr { font-size: 10px; color: var(--mute); font-family: var(--mono); }
.sysrow .solo { opacity: .6; font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; background: none; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px 12px; border-bottom: 1px solid var(--line); }
.section-title { padding: 12px 14px 4px; font-size: 12px; color: var(--mute); letter-spacing: .4px; font-weight: 700; }
#tree { padding: 4px 8px 20px; font-size: 13px; }
.tn { display: flex; align-items: center; gap: 5px; padding: 3px 5px; border-radius: 7px; cursor: pointer; line-height: 1.55; }
.tn:hover { background: rgba(57, 213, 255, .08); }
.tn.cur { background: rgba(57, 213, 255, .18); color: #fff; }
.tn .tw { width: 16px; text-align: center; color: var(--mute); flex: none; font-size: 10px; }
.tn .v { width: 6px; height: 6px; border-radius: 50%; background: var(--good); flex: none; opacity: 0; }
.tn .v.on { opacity: .8; }
.tn .cube { font-size: 9px; color: var(--acc); opacity: .7; }
.tchild { padding-inline-start: 14px; border-inline-start: 1px dashed rgba(95, 208, 255, .15); margin-inline-start: 7px; }
#hud { flex: none; font-size: 11px; color: var(--mute); padding: 7px 12px; border-top: 1px solid var(--line); background: rgba(2, 10, 20, .5); }

/* ---------- بطاقة المعلومات ---------- */
#info { position: absolute; top: calc(var(--top) + 12px); bottom: 100px; inset-inline-end: 12px; width: 390px; z-index: 15; border-radius: var(--r); display: flex; flex-direction: column; overflow: hidden; transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
#info.collapsed { transform: translateX(-108%); opacity: 0; pointer-events: none; }
#info-toggle { position: absolute; top: calc(var(--top) + 22px); inset-inline-end: 410px; z-index: 16; width: 26px; height: 46px; border-radius: 10px; }
#info.collapsed ~ #info-toggle { inset-inline-end: 12px; }
#info-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.hero { position: relative; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% -20%, var(--sc, #39d5ff) 0%, transparent 60%); opacity: .28; pointer-events: none; }
.hero .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; position: relative; padding-inline-end: 72px; }
.tag { font-size: 11px; padding: 1px 9px; border-radius: 20px; border: 1px solid var(--line); color: var(--mute); background: rgba(0, 0, 0, .15); }
.tag.sys { color: #021018; font-weight: 800; border: 0; }
.hero h2 { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 800; position: relative; }
.hero .en { color: var(--mute); font-size: 12px; direction: ltr; text-align: right; font-family: var(--mono); position: relative; }
.hero .sibs { position: absolute; top: 12px; inset-inline-end: 12px; display: flex; gap: 4px; }
.hero .sibs .ib { width: 30px; height: 30px; border-radius: 9px; }
.hero .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; position: relative; }
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; margin-top: 10px; position: relative; }
.stat-chip { min-width: 0; color: var(--mute); font-size: 11px; padding: 4px 9px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.stat-chip b { display: block; font-size: 12.5px; color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 1px solid transparent; padding: 5px 11px; font-size: 13px; color: var(--mute); border-radius: 9px; white-space: nowrap; }
.tabs button.on { color: #fff; background: rgba(57, 213, 255, .14); border-color: rgba(57, 213, 255, .35); }
.tab-body { padding: 12px 18px 30px; font-size: 14.5px; line-height: 1.9; }
.tab-body p { margin: 0 0 10px; }
.tab-body h4 { margin: 16px 0 6px; font-size: 13.5px; color: var(--acc); display: flex; align-items: center; gap: 6px; }
.stats { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 13px; }
.stats td { padding: 7px 4px; border-bottom: 1px solid rgba(255, 255, 255, .06); vertical-align: top; }
.stats td:first-child { color: var(--mute); width: 38%; }
.fnl { margin: 0 0 10px; padding-inline-start: 18px; }
.fnl li { margin-bottom: 3px; }
.fnl li::marker { color: var(--acc); }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 20px; border: 1px solid var(--line); background: rgba(14, 38, 62, .6); font-size: 12.5px; cursor: pointer; transition: .15s; }
.chip:hover { border-color: var(--acc); background: rgba(57, 213, 255, .1); }
.chip small { color: var(--mute); }
.kid { display: flex; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; cursor: pointer; background: rgba(255, 255, 255, .02); transition: .15s; }
.kid:hover { border-color: var(--acc); background: rgba(57, 213, 255, .06); }
.kid b { display: block; font-size: 13.5px; }
.kid span { display: block; font-size: 12px; color: var(--mute); line-height: 1.6; }
.kid .ic2 { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; background: rgba(57, 213, 255, .1); color: var(--acc); font-size: 12px; }
.more { border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; margin-bottom: 8px; background: rgba(255, 255, 255, .02); }
.more b { color: var(--acc); font-size: 13px; }
.clin b { color: #ff8a9a; }
.fact { padding: 9px 12px; border-inline-start: 3px solid var(--warm); background: rgba(255, 181, 71, .06); border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
.note { font-size: 11.5px; color: var(--mute); margin-top: 14px; }
.welcome-hero { padding: 22px 18px 12px; }
.welcome-hero h2 { margin: 0 0 4px; font-size: 24px; font-weight: 800; }
.big-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.big-card { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: linear-gradient(160deg, rgba(57, 213, 255, .08), rgba(123, 140, 255, .04)); cursor: pointer; transition: .15s; }
.big-card:hover { border-color: var(--acc); transform: translateY(-2px); }
.big-card b { display: block; font-size: 13.5px; }
.big-card span { font-size: 11.5px; color: var(--mute); }

/* ---------- المسار ---------- */
#crumbs { position: absolute; top: calc(var(--top) + 12px); inset-inline-start: 50%; transform: translateX(50%); display: flex; gap: 4px; align-items: center; border-radius: 20px; padding: 5px 12px; z-index: 14; font-size: 12px; max-width: 46vw; overflow: hidden; white-space: nowrap; }
#crumbs a { color: var(--mute); cursor: pointer; text-decoration: none; }
#crumbs a:hover, #crumbs a.cur { color: #fff; }
#crumbs .sep { color: #2d5a7a; }

/* ---------- اللوحة السفلية: العمق والزوايا ---------- */
#dock { position: absolute; bottom: 14px; inset-inline-start: 50%; transform: translateX(50%); z-index: 18; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 22px; }
#dock .grp { display: flex; align-items: center; gap: 4px; }
#dock .vsep { width: 1px; height: 34px; background: var(--line); }
.depth { display: flex; flex-direction: column; gap: 4px; min-width: 330px; }
.depth .dt { font-size: 10.5px; color: var(--mute); display: flex; justify-content: space-between; letter-spacing: .3px; }
.depth .dt b { color: var(--warm); font-weight: 700; }
.depth .stops { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.depth .stop { display: flex; align-items: center; justify-content: center; gap: 5px; height: 34px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); font-size: 12.5px; font-weight: 700; color: var(--mute); transition: .2s; }
.depth .stop:hover { color: #fff; border-color: var(--line-2); }
.depth .stop.on { color: #fff; border-color: var(--lc); background: color-mix(in srgb, var(--lc) 22%, transparent); box-shadow: 0 0 16px color-mix(in srgb, var(--lc) 35%, transparent); }
.depth .track { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #e2b39b, #c0453f, #ff6b8a, #e9dfc6); opacity: .85; margin: 2px 6px 0; direction: ltr; }
.depth .track .knob { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(57, 213, 255, .5), 0 0 12px rgba(57, 213, 255, .8); transform: translate(-50%, -50%); }
.depth input[type=range] { position: absolute; inset: -8px 0; width: 100%; opacity: 0; cursor: pointer; margin: 0; direction: ltr; }
.depth .trackwrap { position: relative; }

/* ---------- خريطة الجسم ---------- */
#bodymap { position: absolute; bottom: 14px; inset-inline-start: 72px; z-index: 17; width: 86px; padding: 8px 6px 6px; border-radius: 18px; text-align: center; }
#bodymap svg { display: block; margin: 0 auto; cursor: pointer; }
#bodymap .bm-t { font-size: 10px; color: var(--mute); margin-top: 2px; }
#bodymap .zone { cursor: pointer; fill: rgba(57, 213, 255, .08); stroke: rgba(57, 213, 255, .45); stroke-width: 1; transition: .15s; }
#bodymap .zone:hover { fill: rgba(57, 213, 255, .35); }
#bodymap .mk { fill: var(--warm); filter: drop-shadow(0 0 4px var(--warm)); }

/* ---------- التسميات والتلميح ---------- */
#labels { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.lbl { position: absolute; top: 0; left: 0; font-size: 12px; padding: 3px 10px 3px 9px; border-radius: 12px; background: rgba(3, 14, 26, .82); border: 1px solid rgba(120, 210, 255, .3); white-space: nowrap; pointer-events: auto; cursor: pointer; color: #e4f6ff; display: flex; align-items: center; gap: 6px; transition: opacity .25s; backdrop-filter: blur(6px); }
.lbl i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--acc)); box-shadow: 0 0 8px var(--c, var(--acc)); flex: none; }
.lbl.sel { border-color: var(--good); color: #fff; box-shadow: 0 0 14px rgba(77, 255, 166, .25); }
.lbl:hover { border-color: var(--acc); }
#tooltip { position: absolute; z-index: 45; pointer-events: none; background: var(--glass-2); border: 1px solid var(--acc); padding: 5px 11px; border-radius: 10px; font-size: 13px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
#tooltip small { color: var(--mute); margin-inline-start: 6px; }

/* ---------- لوحة المحاكاة ---------- */
#sim { position: absolute; top: calc(var(--top) + 54px); inset-inline-start: 50%; transform: translateX(50%); width: min(540px, calc(100% - 860px)); min-width: 340px; border-radius: var(--r); z-index: 14; padding: 9px 13px; font-size: 12px; }
#sim .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#sim canvas { width: 100%; border-radius: 10px; display: block; margin-top: 6px; }
#sim .phase { color: var(--warm); font-weight: 800; font-size: 13px; flex: 1; }
#sim .kv { color: var(--mute); }
#sim .kv b { color: var(--ink); font-family: var(--mono); }
#sim input[type=range] { accent-color: var(--bad); width: 130px; }
.valve { font-size: 11px; padding: 1px 8px; border-radius: 10px; }
.valve.o { background: rgba(77, 255, 166, .14); color: var(--good); }
.valve.c { background: rgba(255, 93, 115, .14); color: #ff8a9a; }

/* ---------- بطاقة الرحلة ---------- */
#jcard { position: absolute; bottom: 104px; inset-inline-start: 50%; transform: translateX(50%); width: min(580px, calc(100% - 24px)); border-radius: var(--r); padding: 13px 17px; z-index: 25; border-color: rgba(57, 213, 255, .5); box-shadow: 0 0 40px rgba(57, 213, 255, .18), var(--shadow); }
#jcard h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
#jcard .jt { font-size: 12px; color: var(--mute); }
#jcard p { margin: 6px 0 10px; line-height: 1.85; font-size: 14.5px; }
#jcard .jbar { height: 4px; background: rgba(255, 255, 255, .08); border-radius: 2px; overflow: hidden; margin-bottom: 10px; }
#jcard .jbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc-2)); transition: width .3s; }
#jcard .row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- الطرفية ---------- */
#console { position: absolute; inset-inline: 0; bottom: 0; height: 42%; background: rgba(1, 7, 14, .95); border-top: 1px solid var(--acc); z-index: 35; display: flex; flex-direction: column; font-family: var(--mono); font-size: 13px; }
#con-out { flex: 1; overflow: auto; padding: 10px 16px; line-height: 1.7; }
#con-out .l { white-space: pre-wrap; }
#con-out .cmd { color: var(--acc); }
#con-out .err { color: #ff8a9a; }
#con-out .ok { color: var(--good); }
#con-out a { color: var(--warm); cursor: pointer; text-decoration: underline; }
.con-in { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--line); }
.con-in span { color: var(--acc); }
#con-input { flex: 1; background: none; border: 0; outline: none; color: var(--ink); font: inherit; font-family: var(--font); font-size: 15px; }
#con-hint { color: var(--mute); font-size: 11px; padding: 0 16px 6px; font-family: var(--font); }

/* ---------- النوافذ ---------- */
#modal { position: absolute; inset: 0; background: rgba(0, 4, 10, .66); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 14px; backdrop-filter: blur(4px); }
.modal-box { position: relative; width: min(720px, 100%); max-height: 88vh; overflow: auto; background: var(--glass-2); border: 1px solid var(--line-2); border-radius: 22px; padding: 22px 24px; box-shadow: 0 30px 90px rgba(0, 0, 0, .6); animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } }
.modal-box > .x { position: absolute; top: 12px; inset-inline-end: 12px; }
.modal-box h2 { margin: 0 0 10px; font-weight: 800; }
.qopt { display: block; width: 100%; text-align: start; padding: 11px 14px; margin: 7px 0; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); font-size: 14.5px; line-height: 1.6; transition: .15s; }
.qopt:hover { border-color: var(--acc); background: rgba(57, 213, 255, .06); }
.qopt.right { border-color: var(--good); background: rgba(77, 255, 166, .12); }
.qopt.wrong { border-color: var(--bad); background: rgba(255, 93, 115, .12); }
.qtext { font-size: 17px; line-height: 1.85; white-space: pre-wrap; font-weight: 600; }
.qprog { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .07); overflow: hidden; margin: 8px 0 14px; }
.qprog i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--good)); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.card { border: 1px solid var(--line); border-radius: 16px; padding: 13px; background: linear-gradient(160deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01)); cursor: pointer; transition: .18s; position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 90% 0%, var(--c, #39d5ff), transparent 55%); opacity: .14; }
.card:hover { border-color: var(--c, var(--acc)); transform: translateY(-2px); }
.card h4 { margin: 0 0 4px; position: relative; }
.card p { margin: 0; font-size: 12px; color: var(--mute); line-height: 1.7; position: relative; }
.card .done { color: var(--good); font-size: 11px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp th, .cmp td { border-bottom: 1px solid var(--line); padding: 7px; text-align: start; vertical-align: top; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13px; align-items: center; }

/* ---------- الترحيب ---------- */
#onboard { position: absolute; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(circle at 50% 40%, rgba(4, 30, 48, .55), rgba(1, 5, 10, .9)); backdrop-filter: blur(3px); }
.ob-box { width: min(640px, 100%); text-align: center; padding: 28px 26px; border-radius: 26px; animation: pop .35s ease-out; }
.ob-box h1 { margin: 6px 0; font-size: 30px; font-weight: 800; background: linear-gradient(90deg, #fff, #8fe6ff, #a7b3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ob-box p { color: var(--mute); line-height: 1.9; margin: 6px 0 16px; }
.ob-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 20px; text-align: start; }
.ob-step { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: rgba(255, 255, 255, .03); }
.ob-step .n { width: 30px; height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(57, 213, 255, .14); color: var(--acc); margin-bottom: 6px; }
.ob-step b { display: block; font-size: 13.5px; }
.ob-step span { font-size: 12px; color: var(--mute); line-height: 1.6; }
.ob-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- عصا التحكم ---------- */
#joy { position: absolute; bottom: calc(var(--sheet-h) + 120px); inset-inline-end: 22px; z-index: 22; display: flex; gap: 14px; align-items: flex-end; }
#joy .pad { width: 120px; height: 120px; border-radius: 50%; border: 1px solid var(--line-2); background: radial-gradient(circle, rgba(57, 213, 255, .12), rgba(7, 20, 34, .6)); position: relative; touch-action: none; }
#joy .stick { position: absolute; width: 50px; height: 50px; left: 35px; top: 35px; border-radius: 50%; background: rgba(57, 213, 255, .5); box-shadow: 0 0 18px rgba(57, 213, 255, .6); }
#joy .lift { display: flex; flex-direction: column; gap: 8px; }
#joy .lift .ib { width: 46px; height: 46px; border-radius: 14px; touch-action: none; }

/* ---------- الإشعارات والتحميل ---------- */
#toasts { position: absolute; top: calc(var(--top) + 54px); inset-inline-start: 50%; transform: translateX(50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--glass-2); border: 1px solid rgba(77, 255, 166, .6); border-radius: 14px; padding: 8px 15px; font-size: 13px; animation: tin .3s ease-out; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); backdrop-filter: blur(10px); }
.toast.ach { border-color: var(--warm); }
@keyframes tin { from { transform: translateY(-10px); opacity: 0; } }
#loading { position: absolute; inset: 0; z-index: 100; display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 45%, #06263c, #01060d 70%); font-size: 15px; transition: opacity .5s; }
#loading .beat { width: 110px; height: 110px; animation: beat 1s ease-in-out infinite; filter: drop-shadow(0 0 20px rgba(255, 77, 115, .6)); }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(.98); } 45% { transform: scale(1.06); } }
#loading .bar { width: 220px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; }
#loading .bar i { display: block; height: 100%; width: 30%; background: linear-gradient(90deg, var(--acc), var(--acc-2)); animation: load 1.2s ease-in-out infinite; }
@keyframes load { 0% { margin-inline-start: -30%; } 100% { margin-inline-start: 100%; } }
.err-box { padding: 16px; border: 1px solid var(--bad); border-radius: 14px; background: rgba(255, 93, 115, .08); max-width: 520px; text-align: center; line-height: 1.8; }

/* ---------- الجوال ---------- */
.mob-only { display: none !important; }
.grab { display: none; width: 46px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .25); margin: 8px auto 2px; cursor: pointer; flex: none; }
@media (max-width: 900px) {
  :root { --top: 54px; --tb: calc(60px + env(safe-area-inset-bottom, 0px)); }
  #topbar { gap: 6px; padding: 0 8px; }
  .brand div, #profile .pt { display: none; }
  .brand .logo { width: 30px; height: 30px; }
  .actions .desk { display: none !important; }
  .mob-only { display: inline-flex !important; }
  .actions .ib { width: 36px; height: 36px; }
  #profile { padding: 2px; border: 0; background: none; }
  #rail, #bodymap, #info-toggle { display: none !important; }
  #nav { inset-inline-start: 0; top: var(--top); bottom: var(--tb); width: min(340px, 88vw); border-radius: 0 18px 18px 0; }
  #info { inset-inline: 0; top: auto; bottom: var(--tb); width: auto; height: 46vh; border-bottom: 0; border-radius: 22px 22px 0 0; transition: height .28s; }
  #info.full { height: calc(100% - var(--top) - var(--tb) - 6px); }
  #info.min { height: 78px; }
  #info.collapsed { transform: none; opacity: 1; pointer-events: auto; }
  #info .grab { display: block; }
  #crumbs { max-width: calc(100% - 20px); top: calc(var(--top) + 8px); font-size: 11px; }
  #dock { bottom: calc(var(--sheet-h) + var(--tb) + 8px); inset-inline: 8px; transform: none; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; border-radius: 18px; }
  #dock .vsep { display: none; }
  #dock .grp.views { justify-content: space-between; }
  #dock .grp.views .ib { width: 34px; height: 32px; border-radius: 10px; }
  .depth { min-width: 0; }
  .depth .stop { height: 32px; font-size: 11.5px; }
  .depth .stop .ic { width: 16px; height: 16px; }
  body.info-full #dock, body.info-full #crumbs { display: none; }
  body:not(.info-min) #dock .grp.views { display: none; }
  #dock .depth .dt span { display: none; }
  #dock .depth .dt { justify-content: flex-start; }
  #sim { inset-inline: 6px; transform: none; width: auto; min-width: 0; top: calc(var(--top) + 42px); padding: 6px 9px; }
  #sim .row:nth-child(3) .kv, #sim #wig { display: none; }
  #sim canvas { height: 44px; }
  #jcard { bottom: auto; top: calc(var(--top) + 8px); }
  #console { height: 55%; }
  .ob-steps { grid-template-columns: 1fr; }
  .ob-box h1 { font-size: 24px; }
  #joy { inset-inline-end: 12px; bottom: calc(var(--sheet-h) + var(--tb) + 124px); }
  #console { bottom: var(--tb); }
}
@media (max-width: 1280px) and (min-width: 901px) {
  #info { width: 340px; }
  #info-toggle { inset-inline-end: 360px; }
  .depth { min-width: 280px; }
  #sim { width: min(480px, calc(100% - 760px)); }
  .tabs-top .lbl-t { display: none; }
  .tabs-top button.on .lbl-t { display: inline; }
  .search { max-width: 300px; }
}

/* ================= التبويبات الرئيسية ================= */
.tabs-top { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid var(--line); margin-inline-start: auto; }
.tabs-top button, #tabs button { appearance: none; border: 0; background: transparent; color: var(--mute); font: inherit; cursor: pointer; display: flex; align-items: center; gap: 7px; border-radius: 12px; transition: background .2s, color .2s; }
.tabs-top button { padding: 7px 12px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.tabs-top button:hover, #tabs button:hover { color: #fff; background: rgba(255,255,255,.06); }
.tabs-top button.on, #tabs button.on { color: #fff; background: linear-gradient(135deg, rgba(57,213,255,.24), rgba(123,140,255,.2)); box-shadow: inset 0 0 0 1px rgba(57,213,255,.35); }
.tabs-top button.on svg, #tabs button.on svg { color: var(--acc); }
#tabs { display: none; }
#page { position: absolute; inset: var(--top) 0 0 0; z-index: 31; display: flex; justify-content: center; padding: 14px; pointer-events: none; }
#page.hidden { display: none; }
#page .page-box { pointer-events: auto; width: min(1080px, 100%); height: 100%; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; animation: pagein .25s ease; }
@keyframes pagein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
#page-title { flex: 1; font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
#page-title small { font-size: 12.5px; color: var(--mute); font-weight: 500; }
#page-body { flex: 1; overflow: auto; padding: 16px 18px 24px; -webkit-overflow-scrolling: touch; }
.lib-tools { position: sticky; top: -16px; z-index: 2; background: rgba(7,18,32,.96); margin: -16px -18px 12px; padding: 12px 18px 10px; border-bottom: 1px solid var(--line); }
.lib-tools input { width: 100%; box-sizing: border-box; background: rgba(255,255,255,.05); border: 1px solid var(--line-2); border-radius: 12px; color: #fff; font: inherit; padding: 10px 14px; outline: none; }
.lib-tools input:focus { border-color: var(--acc); }
.fchips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.fchips::-webkit-scrollbar { display: none; }
.fchip { flex: none; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--ink); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.fchip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--acc)); display: inline-block; }
.fchip.on { background: var(--c, var(--acc)); color: #04121c; border-color: transparent; font-weight: 700; }
.fchip.on i { background: #04121c; }
.lib-count { font-size: 12px; color: var(--mute); margin-top: 6px; }
.lib-sys { margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; }
.lib-sys i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.lib-sys small { color: var(--mute); font-weight: 500; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.lib-card { border: 1px solid var(--line); border-inline-start: 3px solid var(--c); background: rgba(255,255,255,.03); border-radius: 12px; padding: 9px 11px; cursor: pointer; transition: background .15s, transform .15s; min-width: 0; }
.lib-card:hover { background: rgba(255,255,255,.07); transform: translateY(-1px); }
.lib-card b { display: block; font-size: 14px; }
.lib-card .en { font-size: 11.5px; color: var(--mute); direction: ltr; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-card p { margin: 5px 0 0; font-size: 12px; color: #b9cad8; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-card .bd { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.lib-card .bd span { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--mute); }
.lib-more { display: block; margin: 16px auto 0; }
.sec-h { font-weight: 800; font-size: 15px; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; color: #e6f3ff; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); margin-bottom: 6px; }
.set-row span small { display: block; color: var(--mute); font-size: 11.5px; }
.seg { display: flex; gap: 3px; background: rgba(255,255,255,.05); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--mute); font: inherit; font-size: 12.5px; padding: 5px 10px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--acc); color: #04121c; font-weight: 700; }
.sw { width: 44px; height: 26px; border-radius: 999px; background: rgba(255,255,255,.12); position: relative; border: 0; cursor: pointer; flex: none; }
.sw::after { content: ''; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: right .2s; }
.sw.on { background: var(--acc); }
.sw.on::after { right: 21px; }
.stat-big { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.stat-big div { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(255,255,255,.03); }
.stat-big b { display: block; font-size: 22px; color: #fff; }
.stat-big span { font-size: 12px; color: var(--mute); }
.qz-grid .card { cursor: pointer; }
.qz-grid .card .qprog { margin: 8px 0 0; }

/* ======== تبويبات بطاقة المعلومات (أوضح) ======== */
#info .tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 6px 12px; border-bottom: 1px solid var(--line); position: relative; }
#info .tabs::-webkit-scrollbar { display: none; }
#info .tabs button { flex: none; display: flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 10px; font-size: 13px; font-weight: 600; }
#info .tabs button svg { opacity: .8; }
#info .tabs button .n { font-size: 10.5px; background: rgba(255,255,255,.1); border-radius: 999px; padding: 0 6px; }
#info .tabs button.on { background: var(--sc, var(--acc)); color: #04121c; }
#info .tabs button.on .n { background: rgba(0,0,0,.15); }
table.anat { width: 100%; border-collapse: separate; border-spacing: 0 5px; }
table.anat td { padding: 8px 10px; background: rgba(255,255,255,.035); vertical-align: top; font-size: 13.5px; line-height: 1.6; }
table.anat td:first-child { width: 30%; color: var(--sc, var(--acc)); font-weight: 700; border-radius: 0 10px 10px 0; white-space: nowrap; }
table.anat td:last-child { border-radius: 10px 0 0 10px; }
.para { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 6px 0; line-height: 1.75; font-size: 13.5px; }
.miniq { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.miniq .qopt { padding: 8px 10px; font-size: 13px; }

@media (max-width: 900px) {
  :root { --tabs-h: 60px; }
  .tabs-top { display: none; }
  #tabs { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 33; height: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px)); padding: 4px 4px env(safe-area-inset-bottom, 0px); border-radius: 18px 18px 0 0; border-bottom: 0; justify-content: space-around; }
  #tabs button { flex: 1; flex-direction: column; gap: 2px; justify-content: center; font-size: 10.5px; font-weight: 600; padding: 4px 0; border-radius: 12px; min-width: 0; }
  #page { inset: var(--top) 0 calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px)) 0; padding: 0; }
  #page .page-box { border-radius: 0; border-inline: 0; }
  #page-body { padding: 12px 12px 20px; }
  .lib-tools { margin: -12px -12px 10px; padding: 10px 12px 8px; top: -12px; }
  .lib-grid { grid-template-columns: 1fr; }
  table.anat td:first-child { width: 34%; white-space: normal; }
}

#sim .kv.mini { display: none; }
#sim .phase { cursor: pointer; }
#sim.compact .row:not(:first-child), #sim.compact canvas { display: none !important; }
#sim.compact .kv.mini { display: inline-flex; }
#sim.compact { padding: 5px 9px; }
