/* WAHAJ prototype — the pro layer: the Lab notebook, engineering habits, the command palette, shortcuts. */

/* ---------- the Lab notebook page ---------- */
.lb { position: absolute; inset: 0 26px 22px 14px; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 16px}
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 84px}
.lb-head h1 { margin: 0; font-size: 38px; font-weight: 600; letter-spacing: -.01em; line-height: 1.05}
.lb-head p { margin: 6px 0 0; font-size: 17px; color: var(--text-2)}
.lb-head .btn { height: 44px; gap: 8px}

/* five habits, one row */
.lb-habits { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px}
.lb-hab { padding: 14px 16px 12px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--panel); display: grid; gap: 8px}
.lb-hab.focus { border-color: var(--accent-2)}
.lb-hh { display: flex; align-items: center; gap: 8px}
.lb-hh b { font-size: 15px; color: var(--text)}
.lb-hh em { margin-inline-start: auto; font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--accent-2-text, #A78BFA); border: 1px solid var(--accent-2); border-radius: 999px; padding: 1px 8px}
.lb-hi { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--tile); color: var(--accent)}
.lb-hv b { font-size: 26px; font-weight: 600; color: var(--text); letter-spacing: -.01em}
.lb-meter { display: block; height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden}
.lb-meter i { display: block; height: 100%; border-radius: 999px; background: var(--accent)}
.lb-hab small { font-size: 12.5px; color: var(--muted)}

/* the runs on the left, the comparison on the right */
.lb-body { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 16px; min-height: 0}
.lb-runs, .lb-cmp { border-radius: 20px; border: 1px solid var(--line-2); background: var(--panel); min-height: 0}
.lb-runs { display: grid; grid-template-rows: auto auto minmax(0, 1fr); padding: 16px 14px 10px}
.lb-rh { display: flex; align-items: baseline; gap: 8px; padding: 0 4px 10px}
.lb-rh h3 { margin: 0; font-size: 18px; font-weight: 600}
.lb-rh small { font-size: 14px; color: var(--muted)}
.lb-filter { display: flex; gap: 6px; padding: 0 2px 10px; border-bottom: 1px solid var(--line)}
.lb-filter button { height: 36px; min-width: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px}
.lb-filter button.on { border-color: var(--accent); color: var(--text)}
.lb-filter button.on .ico { color: var(--accent)}
.lb-filter button.none { opacity: .45}
.lb-list { overflow: auto; padding: 8px 2px 4px; min-height: 0}
.lb-grp + .lb-grp { margin-top: 10px}
.lb-gh { display: flex; align-items: center; gap: 8px; padding: 6px 6px; font-size: 13px; font-weight: 600; color: var(--text-2)}
.lb-gh .ico { color: var(--accent)}
.lb-gh small { margin-inline-start: auto; font-weight: 500; color: var(--muted)}
.lb-run { width: 100%; display: grid; grid-template-columns: 26px minmax(0, 1fr) 44px auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; border: 1px solid transparent; background: none; text-align: start}
.lb-run:hover { background: var(--panel-2)}
.lb-run.on { border-color: var(--line-3, #3a3a3c); background: var(--panel-2)}
.lb-ab { width: 24px; height: 24px; border-radius: 50%; border: 1px dashed var(--line-3, #3a3a3c); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #000}
.lb-ab.a { border: 0; background: #A78BFA}
.lb-ab.b { border: 0; background: var(--accent)}
.lb-rt b { display: block; font-size: 14.5px; color: var(--text)}
.lb-rt small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis}
.lb-rs { font-size: 18px; text-align: end}
.lb-rs.ok { color: var(--accent)}
.lb-rs.bad { color: var(--warn)}
.lb-run .status-tag { height: 22px; padding: 0 9px; font-size: 11.5px}
.lb-empty, .lb-cmp-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; color: var(--muted); padding: 30px}
.lb-empty b { font-size: 17px; color: var(--text)}
.lb-empty .btn { margin-top: 6px; gap: 8px}

.lb-cmp { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; overflow: auto}
.lb-ch { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap}
.lb-mt { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--text)}
.lb-mt .ico { color: var(--accent)}
.lb-trail { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap}
.lb-trail i { color: var(--muted); display: inline-grid}
.lb-trail button { min-width: 38px; height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 13px}
.lb-trail button.ok b { color: var(--accent)}
.lb-trail button.bad b { color: var(--warn)}
.lb-trail button.on { border-color: var(--text-2)}
.lb-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center}
.lb-sc { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line-2)}
.lb-sc small { display: block; font-size: 13px; color: var(--muted)}
.lb-sc b { font-size: 34px; font-weight: 600; color: var(--text); letter-spacing: -.02em; line-height: 1.1}
.lb-sc b em { font-style: normal; font-size: 15px; color: var(--muted); font-weight: 500; margin-inline-start: 2px}
.lb-sc.ghost { color: var(--muted); font-size: 14px; justify-content: center; border-style: dashed}
.lb-score > .lb-sc.ghost { grid-column: 2 / 4}
.lb-delta { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 16px}
.lb-delta.up { color: var(--accent); border-color: rgba(0, 255, 111, .4)}
.lb-delta.down { color: var(--warn); border-color: rgba(255, 159, 10, .5)}
.lb-delta.down .ico { transform: rotate(180deg)}
.lb-parts { display: grid; gap: 10px}
.lb-pr { display: grid; grid-template-columns: 170px minmax(0, 1fr) 110px; gap: 14px; align-items: center}
.lb-pl { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2)}
.lb-pl .ico { color: var(--muted)}
.lb-bars { display: grid; gap: 4px}
.lb-bars i { display: block; height: 8px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--line-2)}
.lb-bars i.a { background: #A78BFA}
.lb-bars i.b { background: var(--accent)}
.lb-pr > b { text-align: end; font-size: 15px; color: var(--text); font-weight: 600}
.lb-pr > b small { font-size: 12.5px; color: var(--muted); font-weight: 500}
.lb-leg { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); padding-inline-start: 184px}
.lb-leg span { display: inline-flex; align-items: center; gap: 6px}
.lb-leg i { width: 10px; height: 10px; border-radius: 3px; background: #A78BFA}
.lb-leg i.b { background: var(--accent)}
.lb-chg h5 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--text)}
.lb-chips { display: flex; flex-wrap: wrap; gap: 8px}
.lb-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 13.5px; color: var(--text)}
.lb-chip .ico { color: var(--accent)}
.lb-chip.none { color: var(--muted)}
.lb-chip.scen .ico { color: var(--accent-2-text, #A78BFA)}
.lb-lesson, .lb-verdict { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; color: var(--text-2); border: 1px solid var(--line-2)}
.lb-lesson .ico { flex: none; margin-top: 2px; color: var(--accent-2-text, #A78BFA)}
.lb-verdict .ico { flex: none; margin-top: 2px}
.lb-verdict.ok .ico { color: var(--accent)}
.lb-verdict.bad .ico { color: var(--warn)}
.lb-verdict b { color: var(--text)}
.lb-acts { margin-top: auto; display: flex; justify-content: flex-end}
.lb-acts .btn { height: 42px; gap: 8px}

/* ---------- the command palette ---------- */
.modal-wrap:has(.modal.cmdk) { place-items: start center; padding-top: 140px}
.modal.cmdk { width: 680px; overflow: hidden}
.ck { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: 620px}
.ck-in { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 64px; border-bottom: 1px solid var(--line-2); color: var(--muted)}
.ck-in input { flex: 1; height: 100%; border: 0; outline: none; background: none; color: var(--text); font-size: 18px; font-family: inherit}
.ck-in input::placeholder { color: var(--muted)}
.ck kbd, .ks kbd { font: 500 12px var(--font, inherit); color: var(--text-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 7px; background: var(--panel-2); white-space: nowrap}
.ck-list { overflow: auto; padding: 8px; min-height: 120px}
.ck-g { padding: 10px 10px 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted)}
.ck-it { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; border: 0; background: none; text-align: start; color: var(--text)}
.ck-it.on { background: var(--tile)}
.ck-ic { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); color: var(--accent)}
.ck-t { font-size: 15px; font-weight: 500}
.ck-it small { font-size: 13px; color: var(--muted)}
.ck-it em { margin-inline-start: auto; font-style: normal; font-size: 12.5px; color: var(--muted)}
.ck-none { display: grid; justify-items: center; gap: 8px; padding: 36px; color: var(--muted)}
.ck-foot { display: flex; gap: 18px; padding: 12px 18px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted)}
.ck-foot span { display: inline-flex; align-items: center; gap: 4px}

/* ---------- keyboard shortcuts ---------- */
.modal.keys { width: 520px}
.ks { display: grid; gap: 4px}
.ks-r { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 2px; border-bottom: 1px solid var(--line)}
.ks-r:last-child { border-bottom: 0}
.ks-r span { display: inline-flex; gap: 4px}
.ks-r b { font-weight: 500; font-size: 15px; color: var(--text)}

/* ---------- coach notes in the mentor card, and weak-point chips ---------- */
.cn-h, .cn-t { display: block}
.cn-h { color: var(--text)}
.cn-t { margin-top: 6px}
.cn-k { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 2px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 13.5px; line-height: 1.3; color: var(--text)}
.cn-k .ico { color: var(--warn)}
.cn-k small { font-size: 12.5px; color: var(--muted)}
.cn-m { display: flex; flex-wrap: wrap; align-items: center; gap: 6px}
.cn-m .cn-k { margin: 8px 0 2px}
.cn-m .cn-ar { color: var(--muted); margin-top: 6px}
#stage[dir="rtl"] .lb-trail .ico-dir { transform: none}
.lb-vk { display: grid; gap: 2px; justify-items: start}
.lb-vk .cn-k { margin: 6px 0 0}
#st-msg .cn-k small { display: none}
.cn-k b { white-space: nowrap}
/* numbers read left to right in Arabic too */
.lb-pr > b, .lb-delta b, .lb-trail { direction: ltr; unicode-bidi: isolate}

/* the same page frame as Projects, Build and Missions: a 30 px title 18 px from the top, content from 92 px, 20 px from the right */
.lb { inset: 18px 20px 14px 15px; gap: 14px}
.lb-head { min-height: 0; height: 60px; align-items: flex-start}
.lb-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.028em; line-height: 1.2}
.lb-head p { margin: 4px 0 0; font-size: 16px}
