@font-face{
  font-family:"DIN Next LT Arabic";
  src:url("../fonts/DINNextLTArabic-Regular.ttf") format("truetype");
  font-style:normal;
  font-weight:400;
  font-display:swap;
}

:root{
  --blue:#00416B;
  --deep:#002343;
  --green:#00C08B;
  --green-dark:#008661;
  --gray:#4D5858;
  --text:#2F3B3E;
  --muted:#6C787A;
  --line:#D4DEE0;
  --line-strong:#B8C6C9;
  --surface:#FFFFFF;
  --soft:#F7FAFA;
  --blue-soft:#EAF1F5;
  --success-soft:#E6F9F4;
  --error:#D02C2F;
  --error-soft:#FBEAEA;
  --label:14px;
  --body:16px;
  --subtitle:20px;
  --heading:24px;
  --display:32px;
  --radius:16px;
  --control-radius:12px;
  --completion-radius:24px;
  --font:"DIN Next LT Arabic","DIN Next","DINNextLTArabic","Helvetica Neue",Helvetica,Arial,sans-serif;
}

*{box-sizing:border-box}
html,body,#app{margin:0;width:100%;height:100%;font-family:var(--font);color:var(--text);background:#fff;-webkit-font-smoothing:antialiased}
body{overflow:hidden}
button{font:inherit}
h1,h2,h3,p{margin:0}
button:focus-visible{outline:3px solid rgba(0,192,139,.22);outline-offset:2px}
.screen{width:100%;height:100%;min-height:680px;padding:6px;background:#fff}
.frame{width:100%;height:100%;min-height:668px;border:1px solid var(--line);border-radius:16px;background:var(--soft);overflow:hidden}

/* Buttons */
.btn{height:48px;min-width:118px;padding:0 20px;border-radius:var(--control-radius);border:1px solid transparent;font-size:var(--body);font-weight:700;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;white-space:nowrap}
.btn.primary{background:var(--green);color:#fff}.btn.primary:hover{background:var(--green-dark)}
.btn.secondary{background:#fff;color:var(--blue);border-color:var(--blue)}.btn.secondary:hover{background:var(--blue-soft)}
.btn:disabled{background:#F2F5F5!important;color:#97A4A6!important;border-color:#DCE4E6!important;cursor:not-allowed}

/* Start — shared template */
.start{display:grid;grid-template-columns:minmax(0,1.02fr) minmax(420px,.98fr);background:#fff}
.start-copy{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:16px;padding:58px 72px;min-width:0}
.start-copy h1{font-size:var(--display);line-height:1.18;font-weight:700;color:var(--blue);max-width:620px}
.start-copy p{font-size:var(--body);line-height:1.5;color:var(--gray);max-width:590px}
.start-copy .btn{margin-top:8px}
.start-art{display:flex;align-items:center;justify-content:center;padding:28px 34px 28px 10px;overflow:hidden;background:#fff}
.start-art img{width:100%;height:100%;max-height:600px;object-fit:contain;display:block}

/* Instructions — shared template */
.instructions{display:grid;grid-template-rows:minmax(0,1fr) 80px}
.instructions-main{padding:36px 48px 24px;display:flex;align-items:center}
.instructions-wrap{width:min(1180px,100%);margin:0 auto}
.instructions-wrap h1{font-size:var(--display);line-height:1.18;color:var(--blue);font-weight:700}
.instructions-intro{margin-top:10px;font-size:var(--body);line-height:1.5;color:var(--gray);max-width:900px}
.instruction-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:22px}
.instruction-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:22px 24px;min-height:220px}
.instruction-icon{width:48px;height:48px;margin-bottom:16px}
.instruction-icon svg{width:48px;height:48px;fill:none;stroke:var(--blue);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.instruction-icon .accent{stroke:var(--green)}
.instruction-card h2{font-size:var(--subtitle);line-height:1.25;color:var(--deep);font-weight:700}
.instruction-card p{margin-top:10px;font-size:var(--body);line-height:1.5;color:var(--gray)}
.instruction-note{margin-top:16px;background:#fff;border-left:4px solid var(--green);padding:13px 16px;font-size:var(--body);line-height:1.5;color:var(--text)}
.static-action{height:80px;background:#fff;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:flex-end;padding:16px 22px}

/* Shared activity shell */
.activity{display:grid;grid-template-rows:92px minmax(0,1fr) 80px}
.header{background:#fff;border-bottom:1px solid var(--line);padding:14px 24px;display:flex;align-items:center;justify-content:space-between;gap:24px}
.header-copy{min-width:0}.header-copy h1{font-size:var(--heading);line-height:1.18;font-weight:700;color:var(--blue)}
.header-copy p{margin-top:5px;font-size:var(--body);line-height:1.4;color:var(--muted)}
.progress{display:flex;align-items:center;gap:12px;flex:0 0 auto}.progress strong{font-size:var(--label);line-height:1.35;color:var(--gray);font-weight:500;white-space:nowrap}
.progress-track{width:180px;height:8px;border-radius:999px;background:var(--line);overflow:hidden}.progress-fill{height:100%;border-radius:inherit;background:var(--green)}
.content{padding:14px 16px;min-height:0;overflow:hidden}
.rail{background:#fff;border-top:1px solid var(--line);padding:16px 22px;display:grid;grid-template-columns:minmax(118px,1fr) minmax(0,2fr) minmax(118px,1fr);align-items:center;gap:18px}
.rail-left{justify-self:start}.rail-right{justify-self:end}.rail-note{text-align:center;font-size:var(--label);line-height:1.35;color:var(--muted)}

/* Dashboard */
.dashboard{width:min(1420px,100%);height:100%;margin:0 auto;display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px}
.dashboard-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;padding:2px 4px}
.dashboard-heading h2{font-size:var(--subtitle);line-height:1.25;color:var(--blue)}
.dashboard-heading p{margin-top:5px;font-size:var(--body);line-height:1.45;color:var(--gray)}
.count-pill{font-size:var(--label);font-weight:700;color:var(--green-dark);background:var(--success-soft);border-radius:999px;padding:8px 12px;white-space:nowrap}
.case-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:14px;min-height:0}
.case-card{width:100%;border:1px solid var(--line);border-radius:var(--radius);background:#fff;padding:18px 20px;display:flex;align-items:center;justify-content:space-between;gap:16px;text-align:left;cursor:pointer;color:var(--text);transition:border-color .15s,background .15s,box-shadow .15s;min-width:0}
.case-card:hover{border-color:#8FA6AC;background:#FCFEFE;box-shadow:0 5px 14px rgba(0,35,67,.05)}
.case-card.complete{border-color:#A7DECD;background:#FBFEFD}
.case-main{display:flex;align-items:center;gap:16px;min-width:0}.case-main img{width:70px;height:70px;border-radius:50%;object-fit:cover;border:3px solid var(--blue-soft);flex:0 0 70px}
.case-copy{min-width:0}.case-copy h3{font-size:var(--subtitle);line-height:1.25;color:var(--blue);font-weight:700}.case-copy p{margin-top:5px;font-size:var(--body);line-height:1.4;color:var(--gray)}
.case-status{font-size:var(--label);font-weight:700;color:var(--muted);background:#F1F5F5;border-radius:999px;padding:8px 11px;white-space:nowrap}.case-status.done{color:var(--green-dark);background:var(--success-soft)}

/* Case strip */
.case-strip{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:8px 14px;display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:58px}
.case-strip-id{display:flex;align-items:center;gap:10px;min-width:0}.case-strip-id img{width:42px;height:42px;border-radius:50%;object-fit:cover;border:2px solid var(--blue-soft);flex:0 0 42px}
.case-strip h2{font-size:var(--subtitle);line-height:1.2;color:var(--blue)}.case-strip p{font-size:var(--label);line-height:1.35;color:var(--muted);margin-top:2px}
.stage-pill{font-size:var(--label);line-height:1.35;color:var(--green-dark);background:var(--success-soft);padding:7px 10px;border-radius:999px;white-space:nowrap}

/* Record */
.record-wrap{width:min(1420px,100%);height:100%;margin:0 auto;display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px;min-height:0}
.record-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px}
.record-heading h2{font-size:var(--subtitle);line-height:1.25;color:var(--blue)}
.record-heading p{margin-top:4px;font-size:var(--body);line-height:1.45;color:var(--gray);max-width:900px}
.record-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:10px;min-height:0}
.record-item{position:relative;background:#F9FBFB;border:1px solid var(--line);border-radius:14px;padding:14px 16px 14px 58px;min-width:0;display:flex;align-items:center}
.record-index{position:absolute;left:16px;top:50%;transform:translateY(-50%);width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--blue-soft);color:var(--blue);font-size:var(--label);font-weight:700}
.record-item p{font-size:var(--body);line-height:1.5;color:var(--text)}
.record-item.empty{visibility:hidden}

/* Question screens */
.question-wrap{width:min(1420px,100%);height:100%;margin:0 auto;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:12px;min-height:0}
.question-wrap.has-confirmation{grid-template-rows:auto auto minmax(0,1fr) auto}
.task-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:15px 18px;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px}
.task-heading h2{font-size:var(--subtitle);line-height:1.25;color:var(--blue)}.task-heading p{margin-top:5px;font-size:var(--body);line-height:1.5;color:var(--gray)}
.gate-grid,.options-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:10px;min-height:0}
.option-card,.gate-card{width:100%;height:100%;min-height:70px;border:1.5px solid var(--line-strong);border-radius:var(--radius);background:#fff;padding:13px 15px;text-align:left;cursor:pointer;display:grid;grid-template-columns:26px minmax(0,1fr);gap:12px;align-items:center;color:var(--text);font-size:var(--body);line-height:1.5;transition:border-color .15s,background .15s;min-width:0}
.option-card:hover,.gate-card:hover{border-color:#8FA6AC}.option-card.selected,.gate-card.selected{border-color:var(--blue);background:#F4F8FA}
.radio{width:26px;height:26px;border:2px solid var(--line-strong);border-radius:50%;display:grid;place-items:center;background:#fff;flex:0 0 26px}.selected .radio{border-color:var(--blue)}.selected .radio::after{content:"";width:10px;height:10px;border-radius:50%;background:var(--blue)}
.gate-copy{min-width:0;display:grid;gap:4px}.gate-top{display:flex;align-items:baseline;gap:8px;min-width:0;flex-wrap:wrap}.gate-top span{font-size:var(--label);font-weight:700;color:var(--green-dark);background:var(--success-soft);border-radius:999px;padding:4px 8px;white-space:nowrap}.gate-top strong{font-size:var(--body);line-height:1.35;color:var(--blue)}
.justify-options .option-card{align-items:start;padding-top:14px;padding-bottom:14px}

/* Confirmation strip */
.confirmed-strip{background:#fff;border:1px solid var(--line);border-left:4px solid var(--green);border-radius:var(--radius);padding:8px 14px;display:flex;align-items:center;gap:10px;min-height:50px}
.confirmed-icon{width:32px;height:32px;flex:0 0 32px;border-radius:50%;background:var(--success-soft);color:var(--green-dark);display:grid;place-items:center}.confirmed-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round}
.confirmed-copy{display:flex;align-items:baseline;gap:8px;min-width:0;flex-wrap:wrap}.confirmed-copy span{font-size:var(--label);line-height:1.35;color:var(--muted);font-weight:700}.confirmed-copy strong{font-size:var(--body);line-height:1.4;color:var(--blue);font-weight:700}

/* Record launcher + modal */
.record-launcher{background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.record-toggle{width:100%;min-height:56px;border:0;background:#fff;color:var(--blue);padding:7px 8px 7px 16px;display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:14px;cursor:pointer;text-align:left}.record-toggle:hover{background:#FBFCFC}
.record-toggle-copy{display:grid;gap:1px;min-width:0}.record-toggle-copy strong{font-size:var(--body);line-height:1.35;font-weight:700;color:var(--blue)}.record-toggle-copy span{font-size:var(--label);line-height:1.35;color:var(--muted)}
.record-toggle-icon{width:40px;height:40px;border:1px solid var(--line);border-radius:12px;position:relative;display:block;color:var(--blue);background:#fff;font-size:0;line-height:0;justify-self:center;align-self:center}.record-toggle-icon::before,.record-toggle-icon::after{content:"";position:absolute;left:50%;top:50%;background:currentColor;border-radius:999px;transform:translate(-50%,-50%)}.record-toggle-icon::before{width:16px;height:2px}.record-toggle-icon::after{width:2px;height:16px}
.modal-overlay{position:fixed;inset:0;background:rgba(0,35,67,.32);display:flex;align-items:center;justify-content:center;padding:24px;z-index:120}
.record-modal{width:min(900px,calc(100% - 48px));max-height:calc(100% - 48px);background:#fff;border-radius:16px;box-shadow:0 22px 56px rgba(0,35,67,.24);padding:26px 28px 28px;display:grid;grid-template-rows:auto minmax(0,1fr);gap:16px;position:relative}
.modal-close{position:absolute;top:16px;right:16px;width:44px;height:44px;padding:0;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--blue);cursor:pointer;display:grid;place-items:center}.modal-close:hover{background:var(--blue-soft)}.modal-close svg{width:21px;height:21px;display:block;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.record-modal-head{display:grid;gap:5px;padding-right:58px}.record-modal-head h2{font-size:var(--heading);line-height:1.18;color:var(--blue);font-weight:700}.record-modal-head p{font-size:var(--body);line-height:1.5;color:var(--gray)}
.modal-record-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;min-height:0;overflow:auto}.modal-record-card{position:relative;background:var(--soft);border:1px solid var(--line);border-radius:14px;padding:13px 14px 13px 50px;min-width:0;display:flex;align-items:center}.modal-record-card span{position:absolute;left:13px;top:50%;transform:translateY(-50%);width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:var(--blue-soft);color:var(--blue);font-size:var(--label);font-weight:700}.modal-record-card p{font-size:var(--body);line-height:1.45;color:var(--text)}

/* Feedback */
.feedback-overlay{position:fixed;inset:0;background:rgba(0,35,67,.32);display:flex;align-items:center;justify-content:center;padding:24px;z-index:140}
.feedback-card{width:min(620px,calc(100% - 48px));background:#fff;border-radius:16px;box-shadow:0 22px 56px rgba(0,35,67,.24);padding:28px 32px 24px;display:grid;gap:18px}
.feedback-status{display:grid;justify-items:center;gap:10px;text-align:center}.feedback-icon{width:60px;height:60px;border-radius:50%;display:grid;place-items:center}.feedback-icon svg{width:30px;height:30px;display:block;fill:none;stroke:currentColor;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round}
.feedback-card.correct .feedback-icon{background:var(--success-soft);color:var(--green-dark)}.feedback-card.incorrect .feedback-icon{background:var(--error-soft);color:var(--error)}
.feedback-title{text-align:center;font-size:var(--heading);line-height:1.18;font-weight:700}.feedback-card.correct .feedback-title{color:var(--green-dark)}.feedback-card.incorrect .feedback-title{color:var(--error)}
.feedback-body{font-size:var(--body);line-height:1.5;color:var(--text);text-align:left}.feedback-actions{display:flex;justify-content:center}

/* Per-case result */
.case-result{width:min(1420px,100%);height:100%;margin:0 auto;display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px;min-height:0}
.result-panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;display:grid;grid-template-rows:auto minmax(0,1fr);gap:14px;min-height:0}
.result-heading{display:flex;align-items:center;justify-content:space-between;gap:18px}.result-heading h2{font-size:var(--subtitle);line-height:1.25;color:var(--blue)}.result-heading p{margin-top:4px;font-size:var(--body);line-height:1.45;color:var(--gray)}
.position-chip{flex:0 0 auto;min-width:220px;border-left:4px solid var(--green);background:var(--success-soft);border-radius:0 14px 14px 0;padding:10px 14px}.position-chip span{display:block;font-size:var(--label);line-height:1.35;color:var(--muted)}.position-chip strong{display:block;margin-top:2px;font-size:var(--subtitle);line-height:1.25;color:var(--green-dark)}
.pathway{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;min-height:0;align-items:stretch}.pathway-card{position:relative;border:1px solid var(--line);border-radius:14px;background:#F9FBFB;padding:14px;display:grid;grid-template-rows:auto auto 1fr;gap:8px;min-width:0}.pathway-card .path-number{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#EEF3F4;color:var(--gray);font-size:var(--label);font-weight:700}.pathway-card strong{font-size:var(--body);line-height:1.35;color:var(--blue)}.pathway-card p{font-size:var(--label);line-height:1.4;color:var(--gray)}.pathway-card.achieved{border-color:#A7DECD;background:#FBFEFD}.pathway-card.achieved .path-number{background:var(--success-soft);color:var(--green-dark)}.pathway-card.current{border:2px solid var(--green);background:#F4FCF9}.pathway-card.current::after{content:"Current position";position:absolute;right:10px;top:10px;font-size:var(--label);line-height:1.2;color:var(--green-dark);font-weight:700}

/* Summary */
.summary{display:grid;grid-template-rows:minmax(0,1fr) 80px}.summary-main{padding:28px 42px 18px;overflow:hidden}.summary-wrap{width:min(1180px,100%);height:100%;margin:0 auto;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:13px}
.summary-heading h1{font-size:var(--display);line-height:1.18;color:var(--blue);font-weight:700}.summary-heading p{margin-top:8px;font-size:var(--body);line-height:1.5;color:var(--gray);max-width:840px}
.summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:12px;min-height:0}.summary-card{background:#fff;border:1px solid var(--line);border-top:4px solid var(--blue);border-radius:var(--radius);padding:14px 16px;min-width:0;overflow:hidden}.summary-person{display:flex;align-items:center;gap:10px}.summary-person img{width:46px;height:46px;border-radius:50%;object-fit:cover;border:2px solid var(--blue-soft)}.summary-person h2{font-size:var(--subtitle);line-height:1.2;color:var(--blue)}.summary-person p{margin-top:3px;font-size:var(--label);line-height:1.35;color:var(--muted)}
.summary-position{margin-top:10px;border-top:1px solid var(--line);padding-top:9px;display:flex;align-items:baseline;justify-content:space-between;gap:12px}.summary-position span{font-size:var(--label);font-weight:700;line-height:1.35;color:var(--deep)}.summary-position strong{font-size:var(--body);line-height:1.4;color:var(--green-dark);text-align:right}.takeaway{border-left:4px solid var(--green);padding:10px 14px;font-size:var(--body);line-height:1.5;color:var(--text)}.takeaway strong{color:var(--blue)}

/* Completion */
.complete{display:grid;place-items:center;padding:30px;background:#F1FAF7}.complete-card{width:min(760px,100%);background:#fff;border:1px solid #DDECE7;border-radius:var(--completion-radius);padding:42px 34px;text-align:center;box-shadow:0 14px 36px rgba(0,35,67,.10)}.complete-mark{width:76px;height:76px;border-radius:50%;display:grid;place-items:center;background:var(--success-soft);color:var(--green-dark);margin:0 auto 18px}.complete-mark svg{width:38px;height:38px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.complete-card h1{font-size:var(--display);line-height:1.18;color:var(--blue);font-weight:700}.complete-card p{margin:12px auto 0;max-width:580px;font-size:var(--body);line-height:1.5;color:var(--gray)}

@media(max-width:1200px){
  .start-copy{padding:48px 38px 48px 42px}.start-art{padding:24px}.instructions-main{padding:32px 32px 20px}.header{padding:12px 20px}.progress-track{width:150px}.content{padding:12px 10px}.rail{padding:14px 18px}.summary-main{padding:26px 30px 16px}
}
@media(max-width:900px){
  body{overflow:auto}#app{height:auto;min-height:680px}.screen{height:auto;min-height:680px;padding:0}.frame{border-radius:0;border-left:0;border-right:0;min-height:680px}.start{grid-template-columns:minmax(0,1.05fr) minmax(300px,.75fr);min-height:680px}.start-art{padding:18px}.start-copy{padding:40px 34px}.instructions{min-height:680px}.activity{min-height:680px;grid-template-rows:auto minmax(0,1fr) auto}.header{align-items:flex-start}.header-copy p{display:none}.content{overflow:visible}.rail{position:sticky;bottom:0;z-index:10}.pathway{grid-template-columns:repeat(2,minmax(0,1fr))}.summary{min-height:680px}.summary-main{overflow:visible}
}
@media(max-width:700px){
  :root{--subtitle:18px;--heading:22px;--display:28px}
  .start{grid-template-columns:1fr;min-height:680px}.start-copy{padding:34px 20px 22px}.start-art{padding:12px 18px 24px;min-height:240px}.start-copy .btn{width:100%}
  .instructions{grid-template-rows:auto auto}.instructions-main{padding:28px 18px 20px;align-items:flex-start}.instruction-grid{grid-template-columns:1fr}.instruction-card{min-height:0;padding:18px;display:grid;grid-template-columns:48px minmax(0,1fr);column-gap:14px;row-gap:4px}.instruction-card .instruction-icon{grid-row:1/4}.instruction-card h2,.instruction-card p{grid-column:2}.static-action{position:sticky;bottom:0;z-index:10;padding:14px 18px}.static-action .btn{width:100%}
  .header{padding:14px 16px;flex-wrap:wrap;gap:10px}.header-copy{width:100%}.progress{width:100%}.progress-track{flex:1;width:auto}.content{padding:12px 10px}.rail{grid-template-columns:1fr 1fr;padding:12px 14px;gap:10px}.rail-note{display:none}.rail-left,.rail-right{width:100%}.rail .btn{width:100%}
  .dashboard-heading{display:block}.count-pill{display:inline-block;margin-top:10px}.case-grid{grid-template-columns:1fr;grid-template-rows:none}.case-card{align-items:flex-start;padding:14px}.case-main{align-items:flex-start}.case-main img{width:58px;height:58px;flex-basis:58px}.case-status{margin-left:auto}
  .case-strip{align-items:flex-start}.stage-pill{display:none}.record-grid,.gate-grid,.options-grid,.modal-record-grid{grid-template-columns:1fr;grid-template-rows:none}.record-card,.task-card{padding:14px}.record-item{min-height:72px}.record-item.empty{display:none}.question-wrap,.question-wrap.has-confirmation{grid-template-rows:auto auto auto}.justify-options .option-card{height:auto;min-height:72px}.gate-card,.option-card{height:auto;min-height:72px}
  .feedback-overlay{position:fixed;padding:16px}.feedback-card{width:calc(100% - 16px);padding:22px 18px}.record-modal{width:calc(100% - 20px);padding:22px 18px}.pathway{grid-template-columns:1fr}.result-heading{display:block}.position-chip{margin-top:12px;min-width:0;width:100%}
  .summary{grid-template-rows:auto auto}.summary-main{padding:28px 18px 20px}.summary-grid{grid-template-columns:1fr}.summary-card{padding:14px}.summary-position{display:grid;gap:3px}.summary-position strong{text-align:left}.complete{min-height:680px;padding:24px 18px}.complete-card{padding:32px 24px}
}
@media(max-width:480px){
  .start-art img{max-height:270px}.case-card{display:block}.case-status{display:inline-block;margin-top:12px}.case-main{gap:12px}.summary-position{grid-template-columns:1fr}.complete-mark{width:68px;height:68px}.complete-mark svg{width:34px;height:34px}
}

/* rev1 — LMS-safe gate hierarchy and content-driven justification layout */
/* Gate label is always a separate line above the gate name. */
.gate-top{
  display:grid !important;
  grid-template-columns:1fr !important;
  justify-items:start !important;
  align-items:start !important;
  gap:6px !important;
  min-width:0 !important;
}
.gate-top span{
  width:max-content !important;
  max-width:100% !important;
  line-height:1.25 !important;
}
.gate-top strong{
  display:block !important;
  width:100% !important;
  line-height:1.4 !important;
}
.gate-card{
  height:auto !important;
  min-height:88px !important;
  padding:12px 15px !important;
  align-items:center !important;
}
.gate-grid{
  grid-template-rows:repeat(2,minmax(0,1fr)) !important;
  align-items:stretch !important;
}

/* Long explanations must determine card height; never squeeze text to a fixed row. */
.question-wrap.has-confirmation{
  gap:8px !important;
}
.question-wrap.has-confirmation .case-strip{
  min-height:52px !important;
  padding:6px 12px !important;
}
.question-wrap.has-confirmation .confirmed-strip{
  min-height:44px !important;
  padding:6px 12px !important;
}
.question-wrap.has-confirmation .confirmed-icon{
  width:30px !important;
  height:30px !important;
  flex-basis:30px !important;
}
.question-wrap.has-confirmation .confirmed-icon svg{
  width:17px !important;
  height:17px !important;
}
.question-wrap.has-confirmation .task-card{
  padding:12px 16px !important;
  gap:8px !important;
  grid-template-rows:auto auto !important;
  align-content:start !important;
}
.question-wrap.has-confirmation .task-heading p{
  margin-top:4px !important;
}
.question-wrap.has-confirmation .record-toggle{
  min-height:50px !important;
  padding:5px 8px 5px 16px !important;
}
.question-wrap.has-confirmation .record-toggle-icon{
  width:38px !important;
  height:38px !important;
}
.justify-options{
  grid-template-rows:repeat(2,auto) !important;
  align-content:start !important;
  gap:10px !important;
  overflow:visible !important;
}
.justify-options .option-card{
  height:auto !important;
  min-height:72px !important;
  padding:10px 14px !important;
  align-items:center !important;
  overflow:visible !important;
}
.justify-options .option-card > span:last-child{
  min-width:0 !important;
  overflow-wrap:break-word !important;
}

@media(max-width:1200px){
  .gate-card{min-height:84px !important;padding:11px 14px !important}
  .question-wrap.has-confirmation .task-card{padding:11px 14px !important}
  .justify-options .option-card{padding:9px 13px !important}
}
@media(max-width:900px){
  .gate-grid,.justify-options{grid-template-columns:1fr !important;grid-template-rows:none !important}
  .gate-card,.justify-options .option-card{height:auto !important;min-height:72px !important}
  .question-wrap.has-confirmation{gap:10px !important}
  .question-wrap.has-confirmation .case-strip,
  .question-wrap.has-confirmation .confirmed-strip,
  .question-wrap.has-confirmation .record-toggle{min-height:initial !important}
}

/* rev3 — use the full question area without squeezing option text */
.question-wrap.has-confirmation .task-card{
  grid-template-rows:auto minmax(0,1fr) !important;
  align-content:stretch !important;
}
.question-wrap.has-confirmation .justify-options{
  height:100% !important;
  grid-template-rows:repeat(2,minmax(86px,1fr)) !important;
  align-content:stretch !important;
  align-items:stretch !important;
}
.question-wrap.has-confirmation .justify-options .option-card{
  height:100% !important;
  min-height:86px !important;
  align-items:center !important;
}
@media(max-width:1200px){
  .question-wrap.has-confirmation .justify-options{
    grid-template-rows:repeat(2,minmax(80px,1fr)) !important;
  }
  .question-wrap.has-confirmation .justify-options .option-card{
    min-height:80px !important;
  }
}
@media(max-width:900px){
  .question-wrap.has-confirmation .task-card{
    grid-template-rows:auto auto !important;
  }
  .question-wrap.has-confirmation .justify-options{
    height:auto !important;
    grid-template-columns:1fr !important;
    grid-template-rows:none !important;
  }
  .question-wrap.has-confirmation .justify-options .option-card{
    height:auto !important;
    min-height:72px !important;
  }
}
