    *{box-sizing:border-box;margin:0;padding:0;}
    html,body{height:100%;overflow:hidden;}
    body{font-family:'Segoe UI',Arial,sans-serif;background:#f0f4f8;color:#1a202c;}
    *{-webkit-user-select:none;user-select:none;}
    input{-webkit-user-select:text;user-select:text;}
    .screen{display:none;height:100vh;flex-direction:column;align-items:center;justify-content:center;padding:20px;overflow-y:auto;}
    .screen.active{display:flex;}
    .card{background:white;border-radius:16px;padding:32px;max-width:600px;width:100%;box-shadow:0 4px 24px rgba(0,0,0,0.10);}
    h1{font-size:1.7rem;color:#2b6cb0;margin-bottom:6px;}
    .sub{color:#718096;font-size:0.93rem;margin-bottom:20px;}
    input[type="text"]{width:100%;padding:11px 14px;border:2px solid #e2e8f0;border-radius:8px;font-size:1rem;margin-bottom:10px;direction:ltr;}
    input:focus{outline:none;border-color:#4299e1;}
    .btn{width:100%;padding:13px;border:none;border-radius:10px;font-size:1rem;font-weight:700;cursor:pointer;margin-top:6px;}
    .btn-blue{background:#3182ce;color:white;}.btn-green{background:#38a169;color:white;}.btn-red{background:#e53e3e;color:white;}
    .err{color:#c53030;font-size:0.88rem;margin-top:6px;text-align:center;}
    .inst-list{list-style:none;margin:12px 0;}
    .inst-list li{padding:9px 14px;margin-bottom:6px;border-radius:8px;font-size:0.93rem;display:flex;gap:8px;line-height:1.5;}
    .i-ok{background:#f0fff4;color:#276749;}.i-warn{background:#fff5f5;color:#c53030;font-weight:600;}
    .i-ai{background:#fef3c7;color:#92400e;font-weight:600;border:1px solid #f59e0b;}.i-info{background:#ebf8ff;color:#2c5282;}
    .badge-best{background:#ebf8ff;border:1px solid #90cdf4;color:#2b6cb0;padding:7px 14px;border-radius:8px;font-size:0.88rem;margin-bottom:8px;text-align:center;}
    .badge-att{background:#f0fff4;border:1px solid #9ae6b4;color:#276749;padding:7px 14px;border-radius:8px;font-size:0.88rem;margin-bottom:8px;text-align:center;}
    .badge-lock{background:#fff5f5;border:2px solid #fc8181;color:#c53030;padding:12px;border-radius:8px;text-align:center;font-weight:600;}
    #exam-screen{display:none;height:100vh;flex-direction:column;overflow:hidden;padding:0;align-items:stretch;}
    #exam-screen.active{display:flex;}
    .exam-header{background:#2b6cb0;color:white;padding:10px 20px;display:flex;justify-content:space-between;align-items:center;flex-shrink:0;flex-wrap:wrap;gap:6px;}
    .timer{font-size:1.3rem;font-weight:800;font-family:monospace;background:rgba(255,255,255,0.15);padding:5px 14px;border-radius:8px;letter-spacing:2px;}
    .timer.warn{background:#fc8181;animation:pulse 1s infinite;}
    @keyframes pulse{0%,100%{opacity:1}50%{opacity:0.7}}
    .exit-ctr{font-size:0.85rem;background:rgba(255,255,255,0.15);padding:3px 10px;border-radius:6px;font-weight:700;}
    .exit-ctr.danger{background:#fc8181;}
    .exam-body{flex:1;display:flex;flex-direction:column;overflow:hidden;padding:10px 16px;max-width:900px;width:100%;margin:0 auto;}
    .progress-wrap{background:#e2e8f0;border-radius:99px;height:5px;margin-bottom:8px;flex-shrink:0;}
    .progress-fill{height:5px;border-radius:99px;background:#48bb78;transition:width 0.3s;}
    .q-nav{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:8px;flex-shrink:0;}
    .q-btn{width:32px;height:32px;border-radius:7px;border:2px solid #cbd5e0;background:white;cursor:pointer;font-weight:700;font-size:0.82rem;color:#4a5568;}
    .q-btn.ans{background:#48bb78;border-color:#48bb78;color:white;}
    .q-btn.ans-fill{background:#ed8936;border-color:#ed8936;color:white;}
    .q-btn.cur{border-color:#3182ce;color:#3182ce;}
    .q-card{flex:1;background:white;border-radius:12px;padding:14px 18px;box-shadow:0 2px 10px rgba(0,0,0,0.07);overflow:hidden;margin-bottom:6px;display:flex;flex-direction:column;}
    .q-meta{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;flex-wrap:wrap;gap:4px;flex-shrink:0;}
    .q-num{font-size:0.8rem;color:#718096;font-weight:600;}
    .q-pts{background:#ebf8ff;color:#2b6cb0;padding:2px 8px;border-radius:20px;font-size:0.76rem;font-weight:700;}
    .q-topic{background:#f0fff4;color:#276749;padding:2px 8px;border-radius:20px;font-size:0.76rem;}
    .hint-btn{background:#fef3c7;border:1px solid #f59e0b;color:#92400e;padding:3px 10px;border-radius:20px;font-size:0.76rem;font-weight:700;cursor:pointer;}
    .q-text{font-size:0.97rem;font-weight:600;margin-bottom:8px;color:#2d3748;flex-shrink:0;}
    .code-block{background:#1a202c;color:#e2e8f0;border-radius:9px;padding:10px 14px;font-family:'Courier New',monospace;font-size:0.85rem;line-height:1.6;margin-bottom:10px;white-space:pre;overflow-x:auto;direction:ltr;text-align:left;flex-shrink:0;}
    .options{display:grid;grid-template-columns:1fr 1fr;gap:8px;flex-shrink:0;}
    .opt{display:flex;align-items:center;gap:8px;padding:10px 12px;border:2px solid #e2e8f0;border-radius:9px;cursor:pointer;transition:all 0.15s;font-size:0.88rem;}
    .opt:hover{border-color:#90cdf4;background:#ebf8ff;}
    .opt input{display:none;}
    .opt.sel{border-color:#3182ce;background:#ebf8ff;color:#2b6cb0;font-weight:600;}
    .dot{width:16px;height:16px;border-radius:50%;border:2px solid #cbd5e0;flex-shrink:0;}
    .opt.sel .dot{border-color:#3182ce;background:#3182ce;}
    .opt-code{font-family:monospace;background:#f7fafc;padding:1px 5px;border-radius:4px;direction:ltr;unicode-bidi:embed;}
    .fill-area{flex:1;overflow-y:auto;}
    .fill-code{background:#1a202c;border-radius:9px;padding:12px 16px;font-family:'Courier New',monospace;font-size:0.88rem;line-height:2;direction:ltr;text-align:left;}
    .fill-input{background:#fef3c7;border:2px solid #f59e0b;border-radius:6px;padding:4px 8px;font-family:'Courier New',monospace;font-size:0.9rem;color:#1a202c;width:clamp(70px,10ch,150px);max-width:150px;text-align:center;display:inline-block;vertical-align:middle;margin:0 3px;-webkit-user-select:text;user-select:text;}
    .fill-input:focus{outline:none;border-color:#3182ce;background:#ebf8ff;}
    .fill-grade{margin-top:8px;font-size:0.82rem;color:#718096;direction:rtl;}
    .exam-footer{flex-shrink:0;display:flex;gap:8px;align-items:center;padding:6px 0 2px;}
    .nav-btn{flex:1;padding:9px;border:none;border-radius:9px;font-size:0.92rem;font-weight:700;cursor:pointer;background:#3182ce;color:white;}
    .nav-btn:disabled{opacity:0.4;cursor:not-allowed;}
    .submit-btn{padding:9px 18px;border:none;border-radius:9px;font-size:0.92rem;font-weight:700;cursor:pointer;background:#e53e3e;color:white;}
    .unanswered{font-size:0.78rem;color:#c53030;font-weight:600;text-align:center;flex-shrink:0;}
    .score-card{text-align:center;padding:12px 0;}
    .score-num{font-size:4.5rem;font-weight:900;line-height:1;margin:12px 0;}
    .sc-ex{color:#38a169;}.sc-go{color:#3182ce;}.sc-ok{color:#d69e2e;}.sc-lo{color:#e53e3e;}
    .score-breakdown{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0;}
    .score-part{background:#f7fafc;border-radius:10px;padding:10px;text-align:center;}
    .score-part-n{font-size:1.8rem;font-weight:900;}
    .score-part-l{font-size:0.78rem;color:#718096;margin-top:2px;}
    .overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.75);z-index:999;align-items:center;justify-content:center;padding:16px;}
    .overlay.show{display:flex;}
    .popup{background:white;border-radius:16px;padding:24px;max-width:480px;width:100%;text-align:center;box-shadow:0 8px 40px rgba(0,0,0,0.3);max-height:85vh;overflow-y:auto;}
    .popup h2{color:#c53030;margin-bottom:6px;font-size:1.2rem;}
    .exit-big{font-size:2.5rem;font-weight:900;color:#e53e3e;margin:6px 0;}
    .ai-box{background:#fef3c7;border:2px solid #f59e0b;border-radius:9px;padding:10px 14px;margin:10px 0;color:#92400e;font-size:0.85rem;font-weight:600;line-height:1.5;}
    .ss-box{background:#fff5f5;border:2px solid #fc8181;border-radius:9px;padding:10px 14px;margin:10px 0;color:#c53030;font-size:0.85rem;font-weight:600;}
    .disq-box{background:#fff5f5;border:3px solid #fc8181;border-radius:12px;padding:24px;text-align:center;max-width:400px;}
    .hint-popup{background:white;border-radius:16px;padding:24px;max-width:520px;width:100%;box-shadow:0 8px 40px rgba(0,0,0,0.3);max-height:80vh;overflow-y:auto;text-align:right;}
    .hint-popup h3{color:#2b6cb0;margin-bottom:12px;}
    .hint-section{background:#f7fafc;border-radius:8px;padding:10px 12px;margin-bottom:8px;}
    .hint-section h4{color:#4a5568;font-size:0.85rem;margin-bottom:6px;}
    .hint-code{background:#1a202c;color:#e2e8f0;border-radius:6px;padding:8px 12px;font-family:'Courier New',monospace;font-size:0.82rem;direction:ltr;text-align:left;white-space:pre;}
    .loading{display:none;position:fixed;inset:0;background:rgba(255,255,255,0.92);z-index:9999;align-items:center;justify-content:center;flex-direction:column;gap:14px;}
    .loading.show{display:flex;}
    .spin{width:44px;height:44px;border:5px solid #e2e8f0;border-top-color:#3182ce;border-radius:50%;animation:sp 0.8s linear infinite;}
    @keyframes sp{to{transform:rotate(360deg)}}
    @media(max-width:600px){.options{grid-template-columns:1fr;}.exam-body{padding:6px 8px;}.q-card{padding:10px 12px;}}


/* Imported JSON hints */
.hint-json .hint-text{
  background:#fffaf0;
  border:1px solid #f6ad55;
  color:#744210;
  border-radius:8px;
  padding:10px 12px;
  line-height:1.7;
  font-size:0.92rem;
  font-weight:600;
}
.q-item-hint{
  background:#fffaf0;
  color:#744210;
  border:1px solid #f6ad55;
  border-radius:6px;
  padding:6px 8px;
  margin:6px 0;
  font-size:0.78rem;
  line-height:1.5;
}


/* תיקון סופי: שדות השלמה ורמזים */
.fill-input{
  width:auto !important;
  min-width:70px !important;
  max-width:180px !important;
  display:inline-block !important;
  padding:3px 8px !important;
  margin:0 4px !important;
  text-align:center !important;
  vertical-align:middle !important;
}

.fill-code .fill-input{
  width:12ch !important;
}

.hint-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  background:#fef3c7;
  border:1px solid #f59e0b;
  color:#92400e;
  padding:4px 12px;
  border-radius:20px;
  font-size:0.78rem;
  font-weight:800;
  cursor:pointer;
  margin-inline-start:6px;
}

.hint-btn:hover{
  background:#fde68a;
}

.hint-text{
  line-height:1.8;
  font-size:0.9rem;
  color:#2d3748;
}

.hint-text code{
  direction:ltr;
  unicode-bidi:embed;
  background:#edf2f7;
  color:#2b6cb0;
  padding:1px 5px;
  border-radius:4px;
  font-family:'Courier New',monospace;
}

.hint-json{
  border-right:4px solid #3182ce;
  background:#f7fafc;
}

/* ===== System generated hints: strings/lists index table ===== */
.index-hint-title{
  font-weight:800;
  color:#2b6cb0;
  margin-bottom:8px;
  direction:rtl;
}
.index-table-wrap{
  width:100%;
  overflow-x:auto;
  border:1px solid #bee3f8;
  border-radius:10px;
  background:#f7fbff;
  margin-top:8px;
}
.index-hint-table{
  border-collapse:collapse;
  min-width:max-content;
  width:auto;
  font-family:'Courier New',monospace;
  font-size:.84rem;
  direction:ltr;
}
.index-hint-table th,
.index-hint-table td{
  border:1px solid #bee3f8;
  padding:7px 10px;
  text-align:center;
  white-space:nowrap;
}
.index-hint-table th{
  background:#ebf8ff;
  color:#2b6cb0;
  font-family:'Segoe UI',Arial,sans-serif;
  font-weight:800;
  direction:rtl;
  position:sticky;
  right:0;
}
.index-hint-table tr:first-child td{
  background:#ffffff;
  font-weight:700;
}
.index-hint-table tr:nth-child(2) td{
  background:#f0fff4;
  color:#276749;
}
.index-hint-table tr:nth-child(3) td{
  background:#fffaf0;
  color:#92400e;
}
.hint-text{
  line-height:1.7;
}
.hint-text code{
  background:#edf2f7;
  color:#2b6cb0;
  padding:1px 5px;
  border-radius:4px;
  direction:ltr;
  display:inline-block;
}

/* Keep fill blanks compact and readable */
.fill-input{
  width:auto !important;
  min-width:42px;
  max-width:120px;
  padding:3px 8px;
  line-height:1.4;
}
.teacher-instructions {
  white-space: pre-line;
}
