[hidden] { display: none !important; }
:root {
  --navy: #0F2A47;
  --teal: #0E7C86;
  --teal-2: #5FC9D2;
  --amber: #B86E00;
  --red: #A32020;
  --green: #1B7A43;
  --ink: #1C2430;
  --muted: #5B6675;
  --line: #D6DCE3;
  --paper: #FFFFFF;
  --bg: #F2F4F7;
  --stage: #1C2027;          /* constant neutral background during stimuli */
  --stage-ink: #E8ECF1;
  --stage-muted: #8A94A3;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6;
}
code, kbd { font-family: "Inter", Consolas, monospace; direction: ltr; unicode-bidi: embed; }
button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 10px 18px; }
button.primary { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; padding: 12px 28px; }
button.primary:disabled { opacity: .45; cursor: not-allowed; }
button.danger { background: var(--red); color: #fff; border-color: var(--red); }
input, select { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* ---------------- panel ---------------- */
#panel { max-width: 1180px; margin: 0 auto; padding: 18px 20px 40px; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); direction: ltr; }
.brand .logo { height: 40px; width: auto; display: block; }
.brand .labTag { font-family: "Inter", sans-serif; font-size: 14px; color: var(--muted); font-weight: 600; align-self: flex-end; margin-bottom: 4px; }
.brand .word { font-family: "Inter", sans-serif; font-size: 22px; letter-spacing: -.3px; }
.brand .word b { font-weight: 600; }
.brand .word i { font-style: normal; font-weight: 600; color: var(--teal); }
.brand .word small { font-size: 13px; color: var(--muted); margin-left: 4px; font-weight: 500; }
.pill { padding: 6px 14px; border-radius: 20px; font-weight: 600; font-size: 14px; }
.pill.off { background: #FBE9E9; color: var(--red); }
.pill.on { background: #E5F4EA; color: var(--green); }
.pill.stale { background: #FBF1E1; color: var(--amber); }

.grid { display: grid; grid-template-columns: 330px 1fr; gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.card.wide { grid-row: span 3; }
.card h2 { margin: 0 0 10px; font-size: 17px; color: var(--navy); }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid #EEF1F4; font-size: 14px; }
.kv span:first-child { color: var(--muted); }
.chips span { display: inline-block; font-size: 12px; border: 1px solid var(--teal); color: var(--teal); border-radius: 8px; padding: 0 6px; margin: 1px; direction: ltr; }
.live { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0 6px; }
.live div { background: var(--bg); border-radius: 10px; padding: 8px; text-align: center; }
.live b { display: block; font-size: 22px; color: var(--navy); font-family: "Inter", sans-serif; }
.live small { color: var(--muted); font-size: 12px; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.hint.warn { color: var(--amber); font-weight: 600; }
.hint code { font-size: 15px; color: var(--navy); font-weight: 600; }

.tests { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.test { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: right; background: #fff; }
.test:hover { border-color: var(--teal); }
.test.sel { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; }
.test.na { opacity: .55; }
.test .n { font-weight: 700; color: var(--navy); }
.test .q { font-size: 13px; color: var(--muted); }
.test .m { font-size: 12px; margin-top: 4px; color: var(--teal); }
.test.na .m { color: var(--amber); }
.opts { display: flex; flex-wrap: wrap; gap: 14px; margin: 16px 0 6px; }
.opts label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.opts input { width: 110px; }
.startRow { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.estimate { color: var(--muted); font-size: 14px; }
.keys ul { margin: 0; padding-right: 18px; font-size: 14px; }
.keys li { margin-bottom: 4px; }
kbd { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; font-size: 12px; }
#lastBody .kv b { font-family: "Inter", sans-serif; }
#lastBody .path { font-size: 12px; color: var(--muted); direction: ltr; text-align: left; word-break: break-all; margin-top: 6px; }

/* ---------------- stage ---------------- */
#stage { position: fixed; inset: 0; background: var(--stage); color: var(--stage-ink); z-index: 10; cursor: none; }
#stage.answering, #stage.confirming { cursor: default; }
#screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
#progress { position: absolute; bottom: 14px; left: 18px; font-size: 13px; color: #4A5260; font-family: "Inter", sans-serif; direction: ltr; }

.s-title { font-size: 44px; font-weight: 700; margin: 0 0 10px; }
.s-text { font-size: 24px; color: var(--stage-muted); max-width: 70vw; }
.s-count { font-family: "Inter", sans-serif; font-size: 96px; font-weight: 600; margin-top: 26px; color: var(--teal-2); direction: ltr; }
.s-ready small { display: block; color: var(--stage-muted); font-size: 22px; }
.s-ready b { font-size: 56px; }
.fixcross { font-size: 90px; font-weight: 300; color: var(--stage-ink); line-height: 1; font-family: "Inter", sans-serif; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4A5260; }
.thanks { font-size: 80px; color: var(--teal-2); }

/* items */
.it-color { width: 44vmin; height: 44vmin; border-radius: 50%; }
.it-number { font-family: "Inter", sans-serif; font-size: 38vmin; font-weight: 600; line-height: 1; direction: ltr; }
.it-shape svg { width: 42vmin; height: 42vmin; }
.it-card { width: 30vmin; height: 42vmin; background: #fff; border-radius: 2.2vmin; color: #1C2430; position: relative; display: flex; align-items: center; justify-content: center; box-shadow: 0 1vmin 4vmin rgba(0,0,0,.35); font-family: "Inter", sans-serif; direction: ltr; }
.it-card.red { color: #C93434; }
.it-card .big { font-size: 15vmin; line-height: 1; }
.it-card .corner { position: absolute; top: 1.8vmin; left: 2.2vmin; font-size: 5vmin; font-weight: 600; line-height: 1; text-align: center; }
.it-card .corner.br { top: auto; left: auto; bottom: 1.8vmin; right: 2.2vmin; transform: rotate(180deg); }
.it-image { position: relative; }
.it-image img { max-width: 78vw; max-height: 76vh; border-radius: 12px; display: block; }
.badge { position: absolute; top: -18px; right: -18px; width: 52px; height: 52px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.it-text .emoji { font-size: 20vmin; line-height: 1.1; }
.it-text .label { font-size: 9vmin; font-weight: 700; margin-top: 2vmin; }
.it-scenario { max-width: 66vw; background: #262B34; border: 1px solid #3A414D; border-radius: 22px; padding: 5vmin 6vmin; }
.it-scenario .emoji { font-size: 12vmin; }
.it-scenario .text { font-size: 5vmin; font-weight: 600; line-height: 1.6; }
.it-side { max-width: 66vw; border: 4px solid; border-radius: 26px; padding: 4vmin 6vmin; }
.it-side .emoji { font-size: 16vmin; line-height: 1.1; }
.it-side .label { font-size: 8vmin; font-weight: 700; }
.it-side .text { font-size: 3.6vmin; color: var(--stage-muted); margin-top: 1.5vmin; }
.it-video video { max-width: 86vw; max-height: 82vh; border-radius: 10px; background: #000; }

/* overview: all items at once, smaller */
.ov-prompt { font-size: 30px; font-weight: 700; margin-bottom: 4vmin; }
.ov { display: flex; flex-wrap: wrap; gap: 5vmin; justify-content: center; align-items: center; max-width: 92vw; }
.ov .it-color { width: 20vmin; height: 20vmin; }
.ov .it-number { font-size: 18vmin; }
.ov .it-shape svg { width: 19vmin; height: 19vmin; }
.ov .it-card { width: 15vmin; height: 21vmin; }
.ov .it-card .big { font-size: 8vmin; }
.ov .it-card .corner { font-size: 2.8vmin; }
.ov .it-text .emoji { font-size: 9vmin; }
.ov .it-text .label { font-size: 3.6vmin; }
.ov .it-scenario { max-width: 28vw; padding: 2.5vmin 3vmin; border-radius: 16px; }
.ov .it-scenario .emoji { font-size: 6vmin; }
.ov .it-scenario .text { font-size: 2.4vmin; }
.ov .it-side { max-width: 38vw; padding: 3vmin 4vmin; }
.ov .it-side .emoji { font-size: 9vmin; }
.ov .it-side .label { font-size: 4.5vmin; }
.ov .it-side .text { display: none; }
.ov.knowledge .it-text .label { font-size: 4.2vmin; background: #262B34; border: 1px solid #3A414D; border-radius: 14px; padding: 1.5vmin 3vmin; }

/* answer */
#answer { position: absolute; inset: 0; background: var(--stage); display: flex; align-items: center; justify-content: center; flex-direction: column; }
#answer h3 { font-size: 34px; margin: 0 0 26px; }
#answer .watchwait { font-size: 30px; color: var(--teal-2); }
#answer .watchwait .ico { font-size: 80px; display: block; margin-bottom: 8px; }
.ans-opts { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-width: 80vw; }
.ans-opts button { min-width: 170px; min-height: 76px; font-size: 22px; font-weight: 700; color: #fff; border: 3px solid transparent; position: relative; }
.ans-opts button .k { position: absolute; top: 4px; left: 8px; font-size: 13px; opacity: .7; font-family: "Inter"; }
.ans-opts button .rk { position: absolute; top: -12px; right: -12px; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--navy); font-size: 16px; display: flex; align-items: center; justify-content: center; }
.ans-opts button.picked { border-color: #fff; opacity: .55; }
.ans-neutral { margin-top: 22px; background: #8B97A6 !important; color: #1C2027 !important; min-width: 220px; font-size: 20px; font-weight: 700; }
.ans-small { margin-top: 30px; display: flex; gap: 12px; }
.ans-small button { background: transparent; color: var(--stage-muted); border-color: #3A414D; font-size: 14px; }
.intensity { display: flex; gap: 16px; }
.intensity button { min-width: 150px; min-height: 70px; font-size: 22px; font-weight: 700; background: #2A3A52; color: #fff; border: none; }

#confirm { position: absolute; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; }
#confirm .box { background: #fff; color: var(--ink); border-radius: 14px; padding: 24px 28px; text-align: center; }
#confirm .box p { font-size: 18px; margin: 0 0 16px; }
#confirm .box button { margin: 0 6px; }

/* ---------------- additions ---------------- */
.test .no { display: inline-block; min-width: 22px; height: 22px; border-radius: 11px; background: var(--navy); color: #fff; font-size: 12px; text-align: center; line-height: 22px; margin-left: 6px; padding: 0 4px; }
.test.tool .no { background: var(--amber); }
.opts label.chk span:last-child { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 14px; padding-top: 6px; }
.kv.daily b { font-size: 12px; font-weight: 600; }
#lastBody .qh { font-size: 15px; color: var(--navy); margin: 12px 0 4px; }
#lastBody .ql { font-size: 13px; padding: 2px 0; }
#stage.white { background: #FFFFFF; }
.s-text.small { font-size: 18px; margin-top: 18px; }
.s-count.small { font-size: 44px; margin-top: 18px; }
.s-count.big { font-size: 180px; }
.watchcue { font-size: 46px; font-weight: 700; color: var(--teal-2); }
.watchcue span { display: block; font-size: 120px; }
.secret { font-size: 90px; font-weight: 700; color: var(--teal-2); }
.statement { font-size: 7vmin; font-weight: 700; max-width: 80vw; line-height: 1.5; margin-bottom: 20px; }
.q-text { font-size: 4.6vmin; font-weight: 700; max-width: 80vw; margin-bottom: 5vmin; line-height: 1.6; }
.math-n { font-family: "Inter", sans-serif; font-size: 26vmin; font-weight: 600; direction: ltr; margin: 2vmin 0; }
.hurry { height: 48px; font-size: 40px; font-weight: 700; color: #F2B829; }
.breath { position: relative; width: 50vmin; height: 50vmin; display: flex; align-items: center; justify-content: center; }
.breath .ball { position: absolute; width: 50vmin; height: 50vmin; border-radius: 50%; background: radial-gradient(circle, #5FC9D2 0%, #0E7C86 70%); opacity: .55; transform: scale(.45); }
.breath .bt { position: relative; font-size: 7vmin; font-weight: 700; }
.decide { background: #262B34; border: 1px solid #3A414D; border-radius: 26px; padding: 5vmin 7vmin; max-width: 70vw; }
.decide .emoji { font-size: 14vmin; line-height: 1.1; }
.decide .d-title { font-size: 6vmin; font-weight: 700; }
.decide .d-text { font-size: 4.4vmin; color: var(--stage-ink); margin-top: 2vmin; line-height: 1.6; }
.pressed { height: 40px; margin-top: 14px; font-size: 26px; color: var(--teal-2); font-weight: 700; }
.outcome { font-size: 8vmin; font-weight: 700; }
.outcome.ok { color: #6BD69A; } .outcome.bad { color: #F08A8A; }
video.film { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.film-hint { position: absolute; bottom: 40px; width: 100%; text-align: center; font-size: 22px; }
.frame video { max-width: 70vw; max-height: 62vh; border-radius: 12px; background: #000; }
.cue { font-size: 14vmin; font-weight: 700; }
.eyes { transition: opacity 2s; }
.eyes.dim { opacity: 0; }
/* affect grid */
.agrid { position: relative; width: min(62vh, 520px); height: min(62vh, 520px); background: #262B34; border: 1px solid #3A414D; border-radius: 18px; cursor: crosshair; direction: ltr; }
.agrid .ax { position: absolute; background: #4A5260; }
.agrid .ax.h { left: 0; right: 0; top: 50%; height: 1px; }
.agrid .ax.v { top: 0; bottom: 0; left: 50%; width: 1px; }
.agrid .al { position: absolute; font-size: 15px; color: var(--stage-muted); font-weight: 600; }
.agrid .al.t { top: 6px; left: 52%; } .agrid .al.b { bottom: 6px; left: 52%; }
.agrid .al.r { right: 10px; top: 52%; } .agrid .al.l { left: 10px; top: 52%; }
.agrid .mk { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--teal-2); box-shadow: 0 0 0 4px rgba(95,201,210,.3); }
.tags { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 80vw; margin-top: 18px; }
.tags .tp { width: 100%; text-align: center; color: var(--stage-muted); font-size: 16px; }
.tags button { background: #2A3A52; color: #fff; border: none; font-size: 18px; font-weight: 600; min-width: 96px; }
.tags button.done { background: var(--teal); }
#answer video.mini { max-width: 320px; max-height: 180px; border-radius: 10px; margin-bottom: 10px; background: #000; }
.agrid.small { width: min(44vh, 400px); height: min(44vh, 400px); }

#progressCard h2 small { font-size: 12px; color: var(--teal); font-weight: 600; }
table.prog { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.prog th { text-align: right; color: var(--muted); font-weight: 600; font-size: 12px; padding: 4px 2px; border-bottom: 1px solid var(--line); }
table.prog td { padding: 5px 2px; border-bottom: 1px solid #EEF1F4; vertical-align: middle; }
table.prog .bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; width: 90px; display: inline-block; margin-left: 6px; vertical-align: middle; }
table.prog .bar i { display: block; height: 100%; background: var(--teal); }
table.prog b.up { color: var(--green); }

/* ---------------- login ---------------- */
.topRight { display: flex; align-items: center; gap: 10px; }
.userChip { font-size: 14px; color: var(--navy); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 4px 6px 4px 14px; display: flex; align-items: center; gap: 8px; }
.userChip button { padding: 3px 10px; font-size: 13px; border-radius: 14px; }
#login { position: fixed; inset: 0; background: rgba(15, 42, 71, .55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.loginBox { background: var(--paper); border-radius: 16px; padding: 24px 26px; width: 440px; max-width: 100%; max-height: 92vh; overflow: auto; }
.loginBox h2 { margin: 0 0 6px; color: var(--navy); font-size: 21px; }
.userList { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.userList button { text-align: right; display: flex; justify-content: space-between; align-items: center; }
.userList button small { color: var(--muted); font-family: "Inter", monospace; direction: ltr; }
.loginBox form { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.loginBox label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.loginBox label.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.loginBox .row { display: flex; gap: 8px; }
.loginBox summary { cursor: pointer; color: var(--teal); font-weight: 600; margin-top: 6px; }

/* ---------------- test groups ---------------- */
.tgroup { margin-bottom: 14px; }
.tgroup:last-child { margin-bottom: 0; }
.tghead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 8px; flex-wrap: wrap; }
.tghead h3 { margin: 0; font-size: 15px; color: var(--navy); }
.tghead h3 small { font-weight: 400; color: var(--muted); font-size: 13px; margin-right: 6px; }
.tghead .act { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.tghead .act button { padding: 6px 14px; font-size: 14px; border-color: var(--teal); color: var(--teal); font-weight: 600; }
.tgroup.personal { background: #F4FAFA; border-radius: 12px; padding: 10px; }
.tgroup.media { background: #FBF7F0; border-radius: 12px; padding: 10px; }
.tgroup .need { font-size: 13px; color: var(--muted); margin: -2px 0 8px; }

/* ---------------- modal: my info ---------------- */
.modal { position: fixed; inset: 0; background: rgba(15, 42, 71, .55); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modalBox { background: var(--paper); border-radius: 16px; padding: 20px 24px; width: 760px; max-width: 100%; max-height: 92vh; overflow: auto; }
.mHead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mHead h2 { margin: 0; color: var(--navy); font-size: 21px; }
.mHead .hint { margin: 2px 0 0; }
.x { border: none; background: none; font-size: 20px; padding: 4px 8px; color: var(--muted); }
.chips3 { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.chips3 span { background: var(--bg); border-radius: 18px; padding: 4px 12px; font-size: 13px; color: var(--ink); }
.chips3 span b { color: var(--teal); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tab { border: none; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 8px 12px; color: var(--muted); font-weight: 600; }
.tab.on { color: var(--navy); border-bottom-color: var(--teal); }
.qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 8px 0 12px; }
.qgrid label { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; color: var(--muted); }
.qgrid label.done span::after { content: " ✓"; color: var(--green); }
.modalBox .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.modalBox .msg { font-size: 14px; }
.msg.ok { color: var(--green); } .msg.err { color: var(--red); }
.stepsList { padding-right: 20px; margin: 4px 0; }
.stepsList li { margin-bottom: 14px; }
.promptBox { position: relative; margin-top: 6px; }
.promptBox pre { white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 12px 14px 12px 70px; font-family: inherit; font-size: 13px; margin: 0; max-height: 190px; overflow: auto; direction: rtl; }
.promptBox pre .ltr { display: block; direction: ltr; text-align: left; font-size: 12.5px; }
.promptBox button { position: absolute; left: 8px; top: 8px; padding: 5px 10px; font-size: 13px; }
.stepsList textarea { width: 100%; margin-top: 6px; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.pend { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.pend h4 { margin: 0 0 4px; font-size: 15px; color: var(--navy); }
.pend .checks span { display: inline-block; margin-left: 12px; font-size: 13px; }
.pend .acts { display: flex; gap: 8px; margin-top: 8px; }
.pend .ok { background: var(--green); color: #fff; border-color: var(--green); }
.memCols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0 12px; }
.memCols h3 { font-size: 15px; margin: 0 0 6px; color: var(--navy); }
.memCols h3 small { font-weight: 400; color: var(--muted); }
.memCols input { display: block; width: 100%; margin-bottom: 6px; }
@media (max-width: 640px) { .qgrid, .memCols { grid-template-columns: 1fr; } }
