/* =====================================================================
   KIỂM TRA IQ CHUẨN QUỐC TẾ (/kiemtraiq)
   Refined Classic Academic & Modern Edtech UI matching reference design
   ===================================================================== */
[hidden] { display: none !important; }

:root {
  --iq-navy: #122E60;
  --iq-navy-mid: #1D4ED8;
  --iq-navy-dark: #102A63;
  --iq-gold: #E5B449;
  --iq-gold-dark: #B07C1B;
  --iq-gold-soft: #FEF7E4;
  --iq-blue: #2563EB;
  --iq-blue-soft: #EAF2FF;
  --iq-violet: #7C3AED;
  --iq-teal: #0891B2;
  --iq-emerald: #10B981;
  --iq-bg: #ECF4FF;
  --iq-card: #FFFFFF;
  --iq-text: #102445;
  --iq-muted: #566C8F;
  --iq-border: #D9E6F7;
  --iq-green: #0F9D6E;
  --iq-green-soft: #DCFCE7;
  --iq-amber: #E2820A;
  --iq-amber-soft: #FEF3C7;
  --iq-red: #DC2626;
  --iq-red-soft: #FEE2E2;
  --iq-shadow: 0 12px 32px rgba(24, 72, 168, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  color: var(--iq-text);
  background: radial-gradient(880px 520px at 96% 2%, #FFF1D0 0%, rgba(255, 241, 208, 0) 64%),
              radial-gradient(960px 540px at 3% 0%, #D9EBFF 0%, rgba(217, 235, 255, 0) 62%),
              radial-gradient(760px 440px at 52% 18%, #E4FBF4 0%, rgba(228, 251, 244, 0) 64%),
              linear-gradient(180deg, #EBF4FF 0%, #F6FAFF 56%, #EDF6FF 100%);
  -webkit-text-size-adjust: 100%;
}

button, input, select { font-family: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--iq-gold); outline-offset: 2px; }

.iq-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.iq-shell > * {
  position: relative;
  z-index: 1;
}

.iq-bg-waves {
  position: fixed;
  inset: 0;
  z-index: 0 !important;
  pointer-events: none;
  overflow: hidden;
}
.iq-bg-waves svg {
  position: absolute;
  bottom: -2%;
  left: 50%;
  transform: translateX(-50%);
  width: max(1280px, 106vw);
  height: auto;
  display: block;
}

.iq-boot {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--iq-navy);
  font-weight: 600;
}

.iq-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3.5px solid rgba(27, 54, 93, 0.16);
  border-top-color: var(--iq-navy);
  animation: iqSpin 0.8s linear infinite;
}
@keyframes iqSpin { to { transform: rotate(360deg); } }

/* ---------- Top Navigation Header ---------- */
.iq-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #E5EEF9;
  box-shadow: 0 2px 14px rgba(18, 52, 110, 0.04);
}

.iq-topbar-in {
  max-width: min(1320px, 95vw);
  margin: 0 auto;
  padding: 9px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.iq-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--iq-navy);
  min-width: 0;
}

.iq-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 56%, #4F46E5 100%);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.30);
}
.iq-brand-logo svg { width: 24px; height: 24px; }
.iq-brand-sep {
  width: 1px;
  height: 26px;
  background: #D4E1F2;
  flex: none;
}

.iq-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.iq-brand-text b {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--iq-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.iq-brand-text small {
  font-size: 10.5px;
  font-weight: 800;
  color: #B7791F;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iq-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.iq-btn-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #CFE0F7;
  background: #FFFFFF;
  color: var(--iq-navy);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(24, 72, 168, 0.06);
  transition: transform 0.15s, border-color 0.15s, background 0.15s, color 0.15s;
}
.iq-btn-home svg { width: 17px; height: 17px; flex: none; }
.iq-btn-home:hover { border-color: #7BB2FA; background: #EFF6FF; color: #1D4ED8; transform: translateY(-1px); }

.iq-btn-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #2575FC 0%, #1D56C8 100%);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
  transition: transform 0.15s, filter 0.15s, border-color 0.15s;
}
.iq-login-ic { width: 16px; height: 16px; display: grid; place-items: center; flex: none; }
.iq-login-ic svg { width: 16px; height: 16px; }
.iq-btn-auth:hover { filter: brightness(1.07); transform: translateY(-1px); }
.iq-btn-auth.logged {
  background: linear-gradient(135deg, #FFFDF6 0%, #FFF6E0 100%);
  color: var(--iq-navy);
  border: 1px solid #ECCE84;
  box-shadow: 0 2px 8px rgba(217, 151, 30, 0.12);
  padding: 0 13px 0 4px;
}
.iq-btn-auth.logged:hover { filter: none; border-color: #DFB54E; background: #FFF4D4; }
.iq-btn-auth .iq-avt {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: linear-gradient(145deg, #FCE078, #E69D1E);
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(217, 119, 6, 0.24);
}
.iq-btn-auth .iq-avt svg { width: 17px; height: 17px; }
.iq-btn-auth .iq-chev { width: 15px; height: 15px; color: #566C8F; flex: none; margin-left: 1px; }

/* ---------- Main Container ---------- */
.iq-main {
  flex: 1;
  width: 100%;
  max-width: min(1320px, 95vw);
  margin: 0 auto;
  padding: 16px 20px 22px;
}

.iq-card {
  background: var(--iq-card);
  border: 1px solid #D4E4F8;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(24, 72, 168, 0.075);
  padding: 20px 24px;
}

/* ---------- Buttons ---------- */
.iq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 14px;
  border: 0;
  font-size: 14.5px;
  font-weight: 700;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s, background 0.15s;
}
.iq-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.iq-btn svg { width: 17px; height: 17px; flex: none; }
.iq-btn-primary {
  background: linear-gradient(95deg, #2575FC 0%, #1D56C8 58%, #1644AC 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.iq-btn-primary:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.iq-btn-gold {
  background: linear-gradient(135deg, #FDE28A 0%, #F0BC46 58%, #DC9A22 100%);
  color: #0F2347;
  box-shadow: 0 4px 0 #B67D14, 0 8px 18px rgba(182, 125, 20, 0.24);
}
.iq-btn-gold:hover:not(:disabled) { filter: brightness(1.04); transform: translateY(-1px); }
.iq-btn-soft {
  background: var(--iq-blue-soft);
  color: #1648AC;
  border: 1px solid #C2DCFD;
}
.iq-btn-soft:hover:not(:disabled) { background: #DBEAFE; }
.iq-btn-outline {
  background: #FFFFFF;
  color: var(--iq-navy);
  border: 1.5px solid var(--iq-border);
}
.iq-btn-outline:hover:not(:disabled) { border-color: #2563EB; background: #F5F9FF; color: #1D4ED8; }
.iq-btn-danger-soft {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1.5px solid #FECACA;
}
.iq-btn-danger-soft:hover:not(:disabled) { background: #FEE2E2; border-color: #FCA5A5; }

.iq-btn-start {
  position: relative;
  width: 100%;
  min-height: 52px;
  padding: 12px 48px;
  border-radius: 13px;
  border: 0;
  border-bottom: 3px solid #F3B93B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(95deg, #2575FC 0%, #1D56C8 54%, #1744AA 100%);
  color: #FFFFFF;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 24px rgba(37, 117, 252, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: transform 0.16s, box-shadow 0.16s, filter 0.16s;
}
.iq-btn-start:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1.5px);
  box-shadow: 0 14px 30px rgba(37, 117, 252, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.iq-btn-start:active:not(:disabled) { transform: translateY(0); }
.iq-btn-start-play { width: 15px; height: 15px; flex: none; color: #F9C646; }
.iq-btn-start-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.92;
  transition: transform 0.16s;
}
.iq-btn-start:hover .iq-btn-start-arrow { transform: translate(3px, -50%); }

/* ---------- Lobby ---------- */
.iq-hero {
  background: linear-gradient(112deg, #13398A 0%, #1D56C8 46%, #2572F2 82%, #1C50BF 100%);
  color: #FFFFFF;
  border-radius: 20px;
  padding: 20px 26px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 18px 38px rgba(24, 86, 200, 0.22);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.iq-hero::before {
  content: '';
  position: absolute;
  right: 110px;
  top: -75px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(72, 214, 255, 0.28), transparent 68%);
  pointer-events: none;
}
.iq-hero::after {
  content: '';
  position: absolute;
  left: -60px;
  bottom: -110px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 208, 92, 0.20), transparent 68%);
  pointer-events: none;
}

.iq-hero-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.iq-hero-visual {
  width: 260px;
  flex: none;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.iq-hero-visual img {
  width: 296px;
  max-width: none;
  height: auto;
  display: block;
  margin: -30px -18px -30px -12px;
  -webkit-mask-image: radial-gradient(ellipse 49% 49% at 50% 50%, #000 54%, rgba(0, 0, 0, 0.82) 72%, rgba(0, 0, 0, 0.32) 88%, transparent 99%);
  mask-image: radial-gradient(ellipse 49% 49% at 50% 50%, #000 54%, rgba(0, 0, 0, 0.82) 72%, rgba(0, 0, 0, 0.32) 88%, transparent 99%);
}

.iq-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(253, 224, 134, 0.58);
  color: #FFE58F;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  margin-bottom: 8px;
  backdrop-filter: blur(4px);
}

.iq-hero h1 {
  margin: 0 0 6px;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: clamp(22px, 2.35vw, 29px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #FFFFFF;
}
.iq-hero-gold {
  color: #FDE047;
  position: relative;
  display: inline-block;
  text-shadow: 0 2px 10px rgba(250, 204, 21, 0.28);
}
.iq-hero-spark {
  width: 15px;
  height: 15px;
  vertical-align: top;
  margin-left: 3px;
  margin-top: -1px;
  color: #FEF08A;
}

.iq-hero p {
  margin: 0;
  max-width: 720px;
  font-size: 13.5px;
  line-height: 1.48;
  color: rgba(240, 247, 255, 0.94);
}

.iq-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.iq-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5.5px 11.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.30);
  font-size: 11.8px;
  font-weight: 600;
  color: #FFFFFF;
  backdrop-filter: blur(5px);
  transition: background 0.15s ease;
}
.iq-hero-pill:hover { background: rgba(255, 255, 255, 0.22); }
.iq-hero-pill svg { width: 15px; height: 15px; flex: none; color: #FFE27A; }

.iq-lobby-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.iq-lobby-card {
  display: flex;
  flex-direction: column;
}

.iq-lobby-cta-wrap {
  margin-top: auto;
  padding-top: 6px;
}

.iq-section-title {
  margin: 0 0 14px;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 17.5px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--iq-navy);
  display: flex;
  align-items: center;
  gap: 11px;
}
.iq-title-ic {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #EAF2FF;
  border: 1px solid #C9DDFD;
  color: #1D4ED8;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.08);
}
.iq-title-ic svg { width: 21px; height: 21px; }
.iq-title-ic.is-blue { background: linear-gradient(145deg, #EFF6FF, #DBEAFE); border-color: #BFDBFE; }
.iq-title-ic.is-violet { background: linear-gradient(145deg, #F5F3FF, #EDE9FE); border-color: #DDD6FE; }
.iq-title-ic.is-amber { background: linear-gradient(145deg, #FFFBEB, #FEF3C7); border-color: #FDE68A; }
.iq-title-ic.is-teal { background: linear-gradient(145deg, #F0FDFA, #CCFBF1); border-color: #99F6E4; }
.iq-title-ic.is-emerald { background: linear-gradient(145deg, #ECFDF5, #D1FAE5); border-color: #A7F3D0; }
.iq-title-ic.is-sm { width: 30px; height: 30px; border-radius: 8px; }
.iq-title-ic.is-sm svg { width: 17px; height: 17px; }

.iq-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--iq-amber-soft);
  border: 1px solid #FCD34D;
  color: #78350F;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.48;
  margin-bottom: 14px;
}
.iq-notice.info {
  background: var(--iq-blue-soft);
  border-color: #BFDBFE;
  color: var(--iq-navy);
}
.iq-notice.ok {
  background: var(--iq-green-soft);
  border-color: #86EFAC;
  color: #14532D;
}

.iq-form-group { margin-bottom: 16px; }
.iq-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--iq-navy);
  margin-bottom: 7px;
}
.iq-form-group .iq-req { color: var(--iq-red); }

.iq-input-wrap {
  position: relative;
}
.iq-input-ic {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  color: #254A8A;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.iq-input-ic svg { width: 19px; height: 19px; }

.iq-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid #D4E1F2;
  background: #FFFFFF;
  color: var(--iq-text);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.iq-input.has-ic { padding-left: 44px; }
.iq-input::placeholder { color: #8A9BB8; font-weight: 400; }
.iq-input:focus {
  border-color: var(--iq-blue);
  box-shadow: 0 0 0 3px rgba(24, 98, 227, 0.12);
  background: #FFFFFF;
  outline: none;
}

.iq-form-err {
  min-height: 16px;
  margin: 4px 0 8px;
  color: var(--iq-red);
  font-size: 12.5px;
  font-weight: 600;
}

.iq-profile-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #EEF7FF 0%, #FFFFFF 56%, #FFF9E6 100%);
  border: 1.5px solid #C8DDF9;
  border-left: 4px solid #2563EB;
  margin-bottom: 14px;
}
.iq-profile-avt {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(145deg, #FDE078, #EB9F1C);
  border: 2.5px solid #FFFFFF;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 4px 12px rgba(235, 159, 28, 0.30);
  overflow: hidden;
}
.iq-profile-avt svg { width: 32px; height: 32px; }
.iq-profile-info { flex: 1; min-width: 0; }
.iq-profile-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.iq-profile-info b {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--iq-navy);
}
.iq-verified-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: #DCFCE7;
  border: 1px solid #86EFAC;
  color: #15803D;
  font-size: 11px;
  font-weight: 800;
}
.iq-profile-info small {
  display: block;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--iq-muted);
  margin-top: 3px;
}
.iq-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #D3E3FA;
  font-size: 12px;
  color: #425B82;
  font-weight: 600;
}
.iq-profile-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #D4E3FA;
}
.iq-profile-meta b {
  font-size: 12.5px;
  font-weight: 800;
  color: #1D4ED8;
}

.iq-ready-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.iq-ready-tile {
  background: #F4F9FF;
  border: 1px solid #D1E3FA;
  border-radius: 13px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.iq-ready-tile:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(24, 72, 168, 0.07); }
.iq-ready-tile.is-time { background: #F0F7FF; border-color: #C7DFFE; }
.iq-ready-tile.is-score { background: #ECFDF5; border-color: #A7F3D0; }
.iq-ready-tile.is-cert { background: #FFFBEB; border-color: #FDE68A; }
.iq-ready-ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #DBEAFE;
  color: #1D4ED8;
  display: grid;
  place-items: center;
  flex: none;
  margin-bottom: 2px;
}
.iq-ready-tile.is-time .iq-ready-ic { background: #DBEAFE; color: #1D4ED8; }
.iq-ready-tile.is-score .iq-ready-ic { background: #D1FAE5; color: #059669; }
.iq-ready-tile.is-cert .iq-ready-ic { background: #FEF3C7; color: #D97706; }
.iq-ready-ic svg { width: 16px; height: 16px; }
.iq-ready-tile b {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--iq-navy);
  line-height: 1.25;
}
.iq-ready-tile small {
  display: block;
  font-size: 11px;
  color: var(--iq-muted);
  line-height: 1.35;
}

.iq-struct-bar {
  display: flex;
  gap: 4px;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  margin: -2px 0 12px;
  background: #EAF0F8;
}
.iq-struct-bar i { display: block; height: 100%; border-radius: 999px; }
.iq-struct-bar .is-spatial { background: linear-gradient(90deg, #3B82F6, #1D4ED8); }
.iq-struct-bar .is-logical { background: linear-gradient(90deg, #8B5CF6, #6D28D9); }
.iq-struct-bar .is-numerical { background: linear-gradient(90deg, #06B6D4, #0891B2); }
.iq-struct-bar .is-verbal { background: linear-gradient(90deg, #FBBF24, #D97706); }

.iq-structure-list {
  display: grid;
  gap: 8px;
}
.iq-struct-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 13px;
  border-radius: 13px;
  background: linear-gradient(90deg, #F7FAFF 0%, #FFFFFF 36%);
  border: 1px solid #D5E5FA;
  border-left: 4px solid #2563EB;
  box-shadow: 0 2px 8px rgba(24, 72, 168, 0.04);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.iq-struct-item:hover { transform: translateX(2px); box-shadow: 0 5px 14px rgba(24, 72, 168, 0.08); }
.iq-struct-ic {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(145deg, #EFF6FF, #DBEAFE);
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
}
.iq-struct-ic svg { width: 22px; height: 22px; }
.iq-struct-body {
  flex: 1;
  min-width: 0;
}
.iq-struct-body b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--iq-navy);
}
.iq-struct-body small {
  display: block;
  font-size: 11.5px;
  color: var(--iq-muted);
  margin-top: 1px;
}
.iq-struct-badge {
  flex: none;
  padding: 4px 10px;
  border-radius: 9px;
  background: #DBEAFE;
  color: #1D4ED8;
  font-size: 12px;
  font-weight: 800;
  min-width: 56px;
  text-align: center;
}
.iq-struct-item.is-logical { background: linear-gradient(90deg, #F8F6FF 0%, #FFFFFF 36%); border-color: #E2DCFE; border-left-color: #7C3AED; }
.iq-struct-item.is-logical .iq-struct-ic { background: linear-gradient(145deg, #F5F3FF, #EDE9FE); border-color: #DDD6FE; color: #6D28D9; }
.iq-struct-item.is-logical .iq-struct-badge { background: #EDE9FE; color: #6D28D9; }
.iq-struct-item.is-numerical { background: linear-gradient(90deg, #F0FCFF 0%, #FFFFFF 36%); border-color: #C7EFF7; border-left-color: #0891B2; }
.iq-struct-item.is-numerical .iq-struct-ic { background: linear-gradient(145deg, #ECFEFF, #CFFAFE); border-color: #A5F3FC; color: #0891B2; }
.iq-struct-item.is-numerical .iq-struct-badge { background: #CFFAFE; color: #0E7490; }
.iq-struct-item.is-verbal { background: linear-gradient(90deg, #FFFBF0 0%, #FFFFFF 36%); border-color: #FBE6B2; border-left-color: #D97706; }
.iq-struct-item.is-verbal .iq-struct-ic { background: linear-gradient(145deg, #FFFBEB, #FEF3C7); border-color: #FDE68A; color: #B45309; }
.iq-struct-item.is-verbal .iq-struct-badge { background: #FEF3C7; color: #B45309; }

.iq-struct-note {
  margin-top: auto;
  padding: 9px 12px;
  border-radius: 11px;
  background: linear-gradient(90deg, #F3F8FF 0%, #FDFBF5 100%);
  border: 1px solid #DBE7F7;
  border-left: 3.5px solid #C5A059;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 11.5px;
  line-height: 1.42;
  color: #4A6082;
}
.iq-struct-note svg {
  width: 17px;
  height: 17px;
  color: #4D74B2;
  flex: none;
  margin-top: 1px;
}

/* History table / sleek bottom bar */
.iq-history-card {
  margin-top: 16px;
  padding: 16px 24px;
}
.iq-history-card.is-empty {
  padding: 12px 22px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.iq-history-card.is-empty .iq-section-title {
  margin: 0;
  font-size: 15.5px;
  flex: none;
}
.iq-hist-sep {
  width: 1px;
  height: 22px;
  background: #DCE7F5;
  flex: none;
}
.iq-hist-empty-msg {
  margin: 0;
  padding-right: 76px;
  color: var(--iq-muted);
  font-size: 13px;
  line-height: 1.45;
  position: relative;
  z-index: 1;
}
.iq-hist-wm {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 66px;
  height: 42px;
  color: #D4A446;
  pointer-events: none;
}

.iq-hist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.iq-hist-head .iq-section-title { margin-bottom: 0; }
.iq-hist-count {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: #EEF4FF;
  border: 1px solid #D3E3FA;
  color: #174DB8;
  font-size: 12px;
  font-weight: 700;
}
.iq-table-wrap {
  overflow-x: auto;
  border: 1px solid #DCE7F5;
  border-radius: 12px;
}
.iq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.iq-table th {
  text-align: left;
  padding: 10px 14px;
  background: linear-gradient(180deg, #F0F7FF 0%, #E7F1FD 100%);
  color: #365078;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1.5px solid #D3E3F7;
  white-space: nowrap;
}
.iq-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #EDF2FA;
  vertical-align: middle;
}
.iq-table tbody tr:last-child td { border-bottom: 0; }
.iq-table tbody tr:hover td { background: #F5F9FF; }
.iq-table code, .iq-hist-code {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 7px;
  background: #F3F7FD;
  border: 1px solid #DCE7F5;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: #1E3A5F;
}
.iq-hist-pct {
  color: var(--iq-muted);
  font-weight: 600;
  margin-left: 4px;
}
.iq-hist-cert-btn {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 13px;
  gap: 6px;
  border: 1px solid #CFA552;
  box-shadow: 0 3px 10px rgba(154, 118, 50, 0.22);
}
.iq-hist-cert-btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.iq-iq-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1849B2, #2563EB);
  color: #FFE89E;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.20);
}
.iq-iq-pill.is-muted {
  background: #E2E8F0;
  color: #475569;
  box-shadow: none;
}

.iq-official-cert {
  margin-top: 16px;
  padding: 18px 22px;
  border-radius: 18px;
  background: linear-gradient(120deg, #13398A 0%, #1D56C8 56%, #2570EE 100%);
  border: 1.5px solid #E9C66B;
  color: #FFFFFF;
  box-shadow: 0 14px 30px rgba(24, 86, 200, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.iq-oc-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.iq-oc-score {
  min-width: 82px;
  padding: 9px 12px;
  border-radius: 13px;
  background: rgba(12, 34, 84, 0.56);
  border: 1.5px solid #F0CC72;
  text-align: center;
  flex: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.iq-oc-score small {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #E7C878;
}
.iq-oc-score b {
  display: block;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: #FFFFFF;
  margin-top: 2px;
}
.iq-oc-info { min-width: 0; }
.iq-oc-eyebrow {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #F6D889;
  margin-bottom: 4px;
}
.iq-oc-rank {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 17px;
  color: #FFFFFF;
}
.iq-oc-rank b { font-weight: 800; }
.iq-oc-rank span { font-size: 13px; color: rgba(224, 237, 255, 0.88); }
.iq-oc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
  font-size: 12.5px;
  color: rgba(224, 237, 255, 0.88);
}
.iq-oc-meta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #FFE8A3;
  font-weight: 700;
}
.iq-oc-btn {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid #CFA552;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  flex: none;
}
.iq-oc-btn svg { width: 17px; height: 17px; flex: none; }

.iq-hist-rank-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.iq-hist-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.iq-hist-badge.is-best {
  background: #FEF3C7;
  border: 1px solid #E5B958;
  color: #92400E;
}
.iq-hist-badge.is-ok {
  background: #E8F1FE;
  border: 1px solid #C5DBFB;
  color: #174DB8;
}
.iq-hist-badge.is-muted {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: #64748B;
}
.iq-hist-more-wrap {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}
.iq-hist-more-btn {
  min-height: 36px;
  padding: 6px 16px;
  border-radius: 10px;
  font-size: 13px;
}

/* ---------- Exam Workspace ---------- */
.iq-exam-top {
  position: sticky;
  top: 0;
  z-index: 25;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #D7E5F7;
  padding: 11px 28px 13px;
  box-shadow: 0 3px 14px rgba(24, 72, 168, 0.05);
}
.iq-exam-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.5px;
  background: #E2EEFC;
  overflow: hidden;
}
.iq-exam-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563EB 0%, #06B6D4 55%, #10B981 100%);
  border-radius: 0 3px 3px 0;
  transition: width 0.25s ease;
}
.iq-exam-top-in {
  max-width: min(1540px, 95vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.iq-main.iq-exam-main {
  max-width: min(1540px, 95vw);
  padding: 20px 28px 26px;
  display: flex;
  flex-direction: column;
}
.iq-exam-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.iq-exam-brand-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 58%, #4F46E5 100%);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.24);
}
.iq-exam-brand-ic svg { width: 19px; height: 19px; }
.iq-exam-title b {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--iq-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.iq-timer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1849B2, #2563EB);
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 16.5px;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.24);
}
.iq-timer.warn { background: var(--iq-amber); }
.iq-timer.danger { background: var(--iq-red); animation: iqPulse 1s ease-in-out infinite; }
@keyframes iqPulse { 50% { transform: scale(1.04); } }

.iq-exam-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 365px;
  gap: 22px;
  align-items: stretch;
  min-height: min(760px, calc(100vh - 108px));
}

.iq-exam-qcard {
  display: flex;
  flex-direction: column;
  padding: 26px 32px;
}

.iq-q-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 2px;
}

.iq-q-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1.5px solid #EAF0F8;
  margin-bottom: 18px;
}

.iq-q-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.iq-badge {
  display: inline-flex;
  align-items: center;
  padding: 5.5px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
}
.iq-badge-num { background: linear-gradient(135deg, #1A4FC2, #2563EB); color: #FFFFFF; }
.iq-badge-cat { background: var(--iq-blue-soft); color: var(--iq-blue); }
.iq-badge-cat.is-spatial { background: #DBEAFE; color: #1D4ED8; }
.iq-badge-cat.is-logical { background: #EDE9FE; color: #6D28D9; }
.iq-badge-cat.is-numerical { background: #CFFAFE; color: #0E7490; }
.iq-badge-cat.is-verbal { background: #FEF3C7; color: #B45309; }
.iq-badge-diff.easy { background: var(--iq-green-soft); color: #047857; }
.iq-badge-diff.medium { background: var(--iq-amber-soft); color: #B45309; }
.iq-badge-diff.hard { background: var(--iq-red-soft); color: var(--iq-red); }

.iq-flag-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--iq-border);
  background: #FFFFFF;
  color: var(--iq-muted);
  font-size: 13.5px;
  font-weight: 700;
}
.iq-flag-btn.active {
  background: var(--iq-amber-soft);
  border-color: var(--iq-amber);
  color: #92400E;
}

.iq-q-prompt {
  background: linear-gradient(180deg, #F6FAFF 0%, #EDF4FF 100%);
  border: 1.5px solid #D3E3FA;
  border-left: 5px solid #1555D8;
  border-radius: 16px;
  padding: 18px 24px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(18, 52, 110, 0.05);
}
.iq-q-prompt.is-compact {
  padding: 12px 16px;
  margin-bottom: 10px;
  border-left-width: 4px;
  border-radius: 12px;
}
.iq-q-eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1953C7;
  margin-bottom: 8px;
}
.iq-q-lead {
  font-size: 18.5px;
  line-height: 1.6;
  font-weight: 700;
  color: #0F2342;
}
.iq-q-prompt.is-compact .iq-q-lead {
  font-size: 14.5px;
}
.iq-q-ask {
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px dashed #C7DAF5;
  font-size: 17.5px;
  font-weight: 800;
  line-height: 1.5;
  color: #0D2551;
}
.iq-q-prompt.is-compact .iq-q-ask {
  margin-top: 9px;
  padding-top: 8px;
  font-size: 14.5px;
}

.iq-analogy-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.iq-an-card {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 13px;
  background: #FFFFFF;
  border: 1.5px solid #C8DBF6;
  box-shadow: 0 2px 6px rgba(18, 52, 110, 0.05);
}
.iq-an-card.is-target {
  border-color: #B9D0F5;
  background: #FFFFFF;
}
.iq-an-term {
  font-size: 16.5px;
  font-weight: 800;
  color: #0F2342;
  letter-spacing: 0.01em;
}
.iq-an-arrow {
  color: #1A5AD8;
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
}
.iq-an-blank {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  background: #FFF8E7;
  border: 2px dashed #C5A059;
  color: #1B365D;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 800;
  font-size: 20px;
}
.iq-an-like {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: #DCE9FD;
  color: #16449C;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.iq-seq-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.iq-seq-tile {
  min-width: 52px;
  height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1.5px solid #C8DBF6;
  color: #0F2342;
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(18, 52, 110, 0.05);
}
.iq-seq-tile.is-blank {
  background: #FFF8E7;
  border: 2px dashed #C5A059;
  color: #1B365D;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 23px;
}

.iq-eq-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.iq-eq-chip {
  padding: 9px 16px;
  border-radius: 11px;
  background: #FFFFFF;
  border: 1.5px solid #C8DBF6;
  color: #0F2342;
  font-size: 16.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.iq-clue-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.iq-clue-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #D9E6F8;
  font-size: 15.5px;
  line-height: 1.5;
  font-weight: 600;
  color: #1E293B;
}
.iq-clue-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1A5AD8;
  margin-top: 8px;
  flex: none;
}
.iq-clue-idx {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #E3EEFE;
  color: #154BB8;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 1px;
}
.iq-code-pill {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 7px;
  background: #0F2342;
  color: #FFE8A3;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-right: 4px;
}

.iq-card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
.iq-mini-card {
  min-width: 82px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 2px solid #C8DBF6;
  text-align: center;
  box-shadow: 0 3px 8px rgba(18, 52, 110, 0.06);
}
.iq-mini-card small {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--iq-muted);
  margin-bottom: 3px;
}
.iq-mini-card b {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--iq-navy);
  line-height: 1.1;
}

.iq-set-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1.5px solid #BBD4F8;
  color: #14439B;
  font-size: 0.92em;
  font-weight: 800;
  margin: 0 2px;
}

.iq-ans-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5C7295;
}
.iq-ans-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E6EFFA;
}

.iq-pair-opt {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.iq-pair-sep {
  color: #1A5AD8;
  font-weight: 900;
}

.iq-svg-wrap {
  display: flex;
  justify-content: center;
  margin: 10px 0 24px;
}
.iq-svg-wrap svg { max-height: min(360px, 34vh); width: auto; max-width: 100%; height: auto; }
.iq-svg-wrap .iq-svg-matrix { width: min(420px, 100%); height: auto; }
.iq-svg-wrap .iq-svg-strip { width: min(780px, 100%); height: auto; }
.iq-svg-wrap .iq-svg-net { width: min(340px, 100%); height: auto; }
.iq-svg-wrap .iq-svg-num { width: min(620px, 100%); height: auto; }

.iq-options-grid {
  display: grid;
  gap: 16px;
}
.iq-options-grid.text-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.iq-options-grid.svg-opts-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.iq-options-grid.svg-opts-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.iq-opt-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  min-height: 68px;
  border-radius: 18px;
  border: 2px solid var(--iq-border);
  background: #FFFFFF;
  color: var(--iq-text);
  text-align: left;
  transition: transform 0.12s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.iq-opt-btn.has-svg {
  flex-direction: column;
  justify-content: center;
  padding: 18px 14px;
  gap: 10px;
  text-align: center;
}
.iq-opt-btn:hover {
  border-color: #60A5FA;
  background: #F4F9FF;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.08);
}
.iq-opt-btn.selected {
  border-color: #2563EB;
  background: linear-gradient(135deg, #EFF6FF 0%, #E1EEFF 100%);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.iq-opt-key {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #EFF5FC;
  border: 1.5px solid #CFE0F5;
  color: var(--iq-navy);
  font-weight: 800;
  font-size: 15px;
  display: grid;
  place-items: center;
  flex: none;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.iq-opt-btn.selected .iq-opt-key {
  background: linear-gradient(135deg, #1D4ED8, #2563EB);
  border-color: #1D4ED8;
  color: #FFFFFF;
}
.iq-opt-svg { width: 100%; max-width: 148px; }
.iq-options-grid.svg-opts-6 .iq-opt-svg { max-width: 118px; }
.iq-opt-svg svg { width: 100%; height: auto; display: block; }
.iq-opt-label { font-size: 16px; font-weight: 600; line-height: 1.48; }

.iq-q-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1.5px solid #EAF0F8;
}
.iq-q-nav .iq-btn {
  min-height: 48px;
  padding: 10px 24px;
  font-size: 15.5px;
}

/* Palette Sidebar */
.iq-palette-card {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  padding: 24px;
}
.iq-palette-stats {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--iq-muted);
  margin-bottom: 12px;
}
.iq-tier-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--iq-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 12px 0 7px;
}
.iq-palette-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
}
.iq-pal-btn {
  position: relative;
  height: 44px;
  border-radius: 11px;
  border: 1.5px solid var(--iq-border);
  background: #F8FAFC;
  color: var(--iq-navy);
  font-weight: 700;
  font-size: 15px;
  display: grid;
  place-items: center;
}
.iq-pal-btn.answered {
  background: #DCFCE7;
  border-color: #34D399;
  color: #065F46;
}
.iq-pal-btn.current {
  background: linear-gradient(135deg, #1D4ED8, #2563EB);
  border-color: #1D4ED8;
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.32);
}
.iq-pal-btn.flagged::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--iq-amber);
}
.iq-pal-footer {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.iq-pal-footer #iqSubmitSide {
  min-height: 48px;
  font-size: 15.5px;
}
.iq-palette-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--iq-muted);
}
.iq-legend-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.iq-legend-dot i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid var(--iq-border);
}

.iq-mobile-pal-btn { display: none; }
.iq-fs-btn {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 12.5px;
  border-radius: 10px;
}
.iq-exam-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.iq-pal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.iq-pal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 35, 66, 0.48);
  backdrop-filter: blur(2px);
  z-index: 55;
}

/* ---------- Result Dashboard ---------- */
.iq-result-hero {
  background: linear-gradient(115deg, #13398A 0%, #1D56C8 55%, #2570EE 100%);
  color: #FFFFFF;
  border-radius: 22px;
  padding: 28px;
  border: 1.5px solid rgba(246, 200, 95, 0.78);
  box-shadow: 0 16px 36px rgba(24, 86, 200, 0.22);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  margin-bottom: 20px;
}

.iq-score-circle {
  width: 164px;
  height: 164px;
  border-radius: 50%;
  background: radial-gradient(circle, #2563EB 0%, #143A8A 100%);
  border: 4px solid #F6C85F;
  box-shadow: 0 0 0 7px rgba(246, 200, 95, 0.22), 0 10px 24px rgba(15, 38, 86, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.iq-score-circle small {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  color: #E6CE91;
  letter-spacing: 0.1em;
}
.iq-score-circle b {
  font-family: 'Playfair Display', serif;
  font-size: 56px;
  line-height: 1.05;
  color: #FFFFFF;
}
.iq-score-circle span {
  font-size: 12.5px;
  font-weight: 700;
  color: #F4DE9E;
  margin-top: 2px;
}

.iq-result-meta h2 {
  margin: 0 0 6px;
  font-family: 'Playfair Display', 'Be Vietnam Pro', serif;
  font-size: clamp(22px, 2.6vw, 30px);
  color: #FFE8A3;
}
.iq-result-en {
  font-size: 14.5px;
  font-weight: 600;
  color: #C7D9F2;
  margin-bottom: 10px;
}
.iq-result-comment {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.55;
  color: #FFFFFF;
}
.iq-result-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.iq-res-pill {
  padding: 6px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13.5px;
  font-weight: 600;
}
.iq-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.iq-domain-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 18px;
  margin-bottom: 20px;
}
.iq-bars { display: grid; gap: 14px; }
.iq-bar-row { display: grid; gap: 6px; }
.iq-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--iq-navy);
}
.iq-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.iq-bar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.iq-bar-dot.is-spatial { background: #2563EB; box-shadow: 0 0 0 3px #DBEAFE; }
.iq-bar-dot.is-logical { background: #7C3AED; box-shadow: 0 0 0 3px #EDE9FE; }
.iq-bar-dot.is-numerical { background: #0891B2; box-shadow: 0 0 0 3px #CFFAFE; }
.iq-bar-dot.is-verbal { background: #D97706; box-shadow: 0 0 0 3px #FEF3C7; }
.iq-bar-track {
  height: 12px;
  border-radius: 999px;
  background: #E8F0FA;
  overflow: hidden;
}
.iq-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3B82F6, #1D4ED8);
  transition: width 0.5s ease;
}
.iq-bar-fill.is-spatial { background: linear-gradient(90deg, #60A5FA, #1D4ED8); }
.iq-bar-fill.is-logical { background: linear-gradient(90deg, #A78BFA, #6D28D9); }
.iq-bar-fill.is-numerical { background: linear-gradient(90deg, #22D3EE, #0891B2); }
.iq-bar-fill.is-verbal { background: linear-gradient(90deg, #FBBF24, #D97706); }
.iq-radar-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.iq-radar-box svg { width: min(340px, 100%); height: auto; }

/* Review list */
.iq-review-list { display: grid; gap: 14px; margin-top: 16px; }
.iq-review-item {
  border: 1.5px solid var(--iq-border);
  border-radius: 16px;
  padding: 16px;
  background: #FFFFFF;
}
.iq-review-item.ok { border-left: 5px solid var(--iq-green); }
.iq-review-item.bad { border-left: 5px solid var(--iq-red); }
.iq-review-exp {
  margin-top: 10px;
  padding: 10px 13px;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #334155;
}

/* ---------- Certificate Stage ---------- */
.iq-cert-stage {
  max-width: 1060px;
  margin: 0 auto;
}
.iq-cert-toolbar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid #D7E4F6;
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 6px 20px rgba(18, 52, 110, 0.06);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.iq-cert-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.iq-cert-toolbar .iq-btn {
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 11px;
  font-size: 13.5px;
  line-height: 1;
}
.iq-cert-toolbar .iq-btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.iq-cert-toolbar .iq-btn-gold {
  border: 1px solid #CFA552;
  box-shadow: 0 4px 12px rgba(154, 118, 50, 0.24);
}
.iq-cert-toolbar .iq-cert-act-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 11px;
}
.iq-cert-toolbar .iq-cert-act-btn span {
  display: none;
}
.iq-cert-toolbar .iq-cert-act-btn svg {
  width: 19px;
  height: 19px;
}
.iq-cert-toolbar .iq-cert-act-btn.is-loading svg {
  animation: iqSpin 0.9s linear infinite;
}
.iq-cert-frame {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(15, 35, 66, 0.22);
  background: #FAF5E8;
  border: 1px solid #E3D4B1;
}
.iq-cert-svg {
  width: 100%;
  height: auto;
  display: block;
}
.iq-cert-mobile-tip {
  display: none;
  margin: 10px 0 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--iq-muted);
}
.iq-cert-disclaimer {
  margin: 16px auto 0;
  padding: 0 12px;
  text-align: center;
  color: var(--iq-muted);
  font-size: 13px;
  line-height: 1.55;
}
.iq-cert-disclaimer p { margin: 2px 0; }
.iq-cert-disclaimer p:first-child { font-style: italic; }

/* ---------- Modal ---------- */
.iq-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100020;
  background: rgba(15, 35, 66, 0.62);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.iq-modal-backdrop.is-locked {
  background: rgba(9, 24, 52, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.iq-boot-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--iq-navy);
  text-align: center;
}
.iq-boot-sub {
  margin: -6px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--iq-muted);
  text-align: center;
  max-width: 440px;
  line-height: 1.5;
}
body.iq-exam-shielded .iq-exam-main,
body.iq-exam-shielded .iq-exam-top {
  filter: blur(20px);
  opacity: 0.08;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transition: filter 0.12s ease, opacity 0.12s ease;
}
.iq-esc-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.iq-esc-modal-actions .iq-btn {
  width: 100%;
  min-height: 46px;
}
.iq-modal-box {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: #FFFFFF;
  border-radius: 22px;
  padding: 24px 22px 20px;
  box-shadow: 0 24px 60px rgba(15, 35, 66, 0.35);
}
.iq-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: #EFF6FF;
  color: var(--iq-navy);
  font-weight: 800;
  font-size: 15px;
}
.iq-modal-title {
  margin: 0 0 6px;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--iq-navy);
  text-align: center;
}
.iq-modal-sub {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--iq-muted);
  text-align: center;
  line-height: 1.45;
}

.iq-toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  width: max-content;
  max-width: calc(100vw - 24px);
  text-align: center;
  z-index: 100080;
  padding: 10px 18px;
  border-radius: 14px;
  background: var(--iq-navy);
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 10px 26px rgba(15, 35, 66, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.iq-toast.show { opacity: 1; transform: translate(-50%, 0); }

#iqPrintHost { display: none; }


/* ---------- Age Group Stratification Panel & Balanced Lobby ---------- */
.iq-age-panel {
  padding: 15px 22px 17px;
  margin-bottom: 18px;
}
.iq-age-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.iq-age-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.iq-age-panel-title h2 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
  color: var(--iq-navy);
  letter-spacing: -0.01em;
}
.iq-step-badge {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #06B6D4);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 3px 9px rgba(37, 99, 235, 0.28);
}
.iq-age-panel-hint {
  font-size: 11.5px;
  font-weight: 700;
  color: #0E7490;
  background: #ECFEFF;
  border: 1px solid #A5F3FC;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.iq-age-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.iq-age-card {
  text-align: left;
  padding: 13px 15px;
  border-radius: 15px;
  border: 1.5px solid #D5E2F4;
  background: #FAFCFF;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .14s ease, background .16s ease;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.iq-age-card:hover {
  border-color: #7FA7EC;
  background: #FFFFFF;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(24, 72, 168, 0.09);
}
.iq-age-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.iq-age-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.iq-age-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  display: grid;
  place-items: center;
  flex: none;
}
.iq-age-ic svg { width: 20px; height: 20px; }
.iq-age-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--iq-navy);
  line-height: 1.25;
  white-space: nowrap;
}
.iq-age-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.8px solid #BDD0EC;
  background: #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 900;
  color: transparent;
  flex: none;
  transition: background .15s ease, border-color .15s ease;
}
.iq-age-card.active .iq-age-radio { color: #FFFFFF; }
.iq-age-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.iq-age-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2.5px 9.5px;
  border-radius: 999px;
  background: #E2ECFC;
  color: #1D4ED8;
  white-space: nowrap;
}
.iq-age-spec {
  font-size: 13px;
  font-weight: 700;
  color: #1E3A5F;
  white-space: nowrap;
}
.iq-age-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px dashed #DDE8F7;
}
.iq-age-std {
  font-size: 11.5px;
  font-weight: 600;
  color: #4A6082;
  min-width: 0;
}
.iq-age-bank {
  font-size: 11px;
  font-weight: 800;
  color: #1D4ED8;
  white-space: nowrap;
  flex: none;
}

/* 3 distinct age-group accents (Emerald 6-10 / Royal Blue 11-15 / Violet 16+) */
.iq-age-card.is-age-610 { border-color: #C7EEDF; background: #F7FEFB; }
.iq-age-card.is-age-610 .iq-age-ic { background: #ECFDF5; border-color: #A7F3D0; }
.iq-age-card.is-age-610 .iq-age-badge { background: #DCFCE7; color: #047857; }
.iq-age-card.is-age-610 .iq-age-bank { color: #059669; }
.iq-age-card.is-age-610:hover { border-color: #34D399; background: #FFFFFF; box-shadow: 0 6px 16px rgba(16, 185, 129, 0.12); }
.iq-age-card.is-age-610.active {
  border-color: #10B981;
  background: linear-gradient(145deg, #ECFDF5 0%, #FFFFFF 64%, #FEFCE8 100%);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.17), inset 0 0 0 1px rgba(16, 185, 129, 0.22);
}
.iq-age-card.is-age-610.active .iq-age-card-title { color: #047857; }
.iq-age-card.is-age-610.active .iq-age-radio,
.iq-age-card.is-age-610.active .iq-age-badge { background: #059669; border-color: #059669; color: #FFFFFF; }

.iq-age-card.is-age-1115 { border-color: #C8DDFB; background: #F7FAFF; }
.iq-age-card.is-age-1115 .iq-age-ic { background: #EFF6FF; border-color: #BFDBFE; }
.iq-age-card.is-age-1115 .iq-age-badge { background: #DBEAFE; color: #1D4ED8; }
.iq-age-card.is-age-1115 .iq-age-bank { color: #1D4ED8; }
.iq-age-card.is-age-1115:hover { border-color: #60A5FA; background: #FFFFFF; box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12); }
.iq-age-card.is-age-1115.active {
  border-color: #2563EB;
  background: linear-gradient(145deg, #EFF6FF 0%, #FFFFFF 64%, #F0F9FF 100%);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.17), inset 0 0 0 1px rgba(37, 99, 235, 0.22);
}
.iq-age-card.is-age-1115.active .iq-age-card-title { color: #1E40AF; }
.iq-age-card.is-age-1115.active .iq-age-radio,
.iq-age-card.is-age-1115.active .iq-age-badge { background: #2563EB; border-color: #2563EB; color: #FFFFFF; }

.iq-age-card.is-age-16p { border-color: #DDD6FE; background: #FAF8FF; }
.iq-age-card.is-age-16p .iq-age-ic { background: #F5F3FF; border-color: #DDD6FE; }
.iq-age-card.is-age-16p .iq-age-badge { background: #EDE9FE; color: #6D28D9; }
.iq-age-card.is-age-16p .iq-age-bank { color: #6D28D9; }
.iq-age-card.is-age-16p:hover { border-color: #A78BFA; background: #FFFFFF; box-shadow: 0 6px 16px rgba(124, 58, 237, 0.12); }
.iq-age-card.is-age-16p.active {
  border-color: #7C3AED;
  background: linear-gradient(145deg, #F5F3FF 0%, #FFFFFF 64%, #FFFBEB 100%);
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.17), inset 0 0 0 1px rgba(124, 58, 237, 0.22);
}
.iq-age-card.is-age-16p.active .iq-age-card-title { color: #5B21B6; }
.iq-age-card.is-age-16p.active .iq-age-radio,
.iq-age-card.is-age-16p.active .iq-age-badge { background: #7C3AED; border-color: #7C3AED; color: #FFFFFF; }

.iq-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0 12px;
}
.iq-tier-tile {
  background: #F6F9FE;
  border: 1px solid #DAE6F8;
  border-radius: 11px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.iq-tier-tile.is-easy { background: #F0FDF4; border-color: #BBF7D0; }
.iq-tier-tile.is-medium { background: #EFF6FF; border-color: #BFDBFE; }
.iq-tier-tile.is-hard { background: #FFFBEB; border-color: #FDE68A; }
.iq-tier-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.iq-tier-tile.is-easy .iq-tier-dot { background: #16A34A; box-shadow: 0 0 0 3px #DCFCE7; }
.iq-tier-tile.is-medium .iq-tier-dot { background: #2563EB; box-shadow: 0 0 0 3px #DBEAFE; }
.iq-tier-tile.is-hard .iq-tier-dot { background: #D97706; box-shadow: 0 0 0 3px #FEF3C7; }
.iq-tier-tile b {
  display: block;
  font-size: 12.2px;
  font-weight: 800;
  color: var(--iq-navy);
  line-height: 1.25;
}
.iq-tier-tile small {
  display: block;
  font-size: 10.8px;
  color: var(--iq-muted);
  margin-top: 1px;
}
.iq-age-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 9.5px;
  border-radius: 999px;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  color: #3730A3;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.iq-age-pill.is-age-610 { background: #DCFCE7; border-color: #86EFAC; color: #047857; }
.iq-age-pill.is-age-1115 { background: #DBEAFE; border-color: #93C5FD; color: #1D4ED8; }
.iq-age-pill.is-age-16p { background: #EDE9FE; border-color: #C4B5FD; color: #6D28D9; }
.iq-official-cert .iq-age-pill {
  background: rgba(255, 232, 163, 0.16);
  border-color: rgba(246, 216, 137, 0.52);
  color: #FFE8A3;
}
.iq-official-certs-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.iq-official-certs-list .iq-official-cert {
  margin-top: 0;
}

/* ---------- Responsive ---------- */
@media (min-width: 1240px) {
  .iq-hero-pills { flex-wrap: nowrap; }
  .iq-hero-pill { white-space: nowrap; }
}

@media (min-width: 1025px) and (max-height: 790px) {
  .iq-main { padding: 10px 20px 12px; }
  .iq-hero { padding: 16px 24px; margin-bottom: 10px; }
  .iq-hero-pills { margin-top: 10px; }
  .iq-card { padding: 14px 20px; }
  .iq-age-panel { padding: 12px 18px; margin-bottom: 10px; }
  .iq-age-panel-head { margin-bottom: 8px; }
  .iq-age-card { padding: 9px 12px; gap: 5px; }
  .iq-age-ic { width: 30px; height: 30px; border-radius: 8px; }
  .iq-age-ic svg { width: 17px; height: 17px; }
  .iq-tier-grid { margin: 8px 0 8px; }
  .iq-tier-tile { padding: 7px 9px; }
  .iq-lobby-grid { gap: 12px; }
  .iq-profile-box { padding: 11px 14px; margin-bottom: 11px; }
  .iq-ready-grid { margin-bottom: 11px; gap: 8px; }
  .iq-ready-tile { padding: 8px 10px; }
  .iq-struct-bar { margin: -2px 0 9px; }
  .iq-struct-item { padding: 6px 12px; }
  .iq-struct-note { margin-top: 8px; padding: 8px 11px; }
  .iq-history-card.is-empty { margin-top: 10px; padding: 10px 20px; }
}

@media (min-width: 1025px) {
  html.iq-exam-locked,
  body.iq-exam-locked {
    height: 100dvh;
    overflow: hidden;
  }
  body.iq-exam-locked {
    user-select: none;
    -webkit-user-select: none;
  }
  body.iq-exam-locked .iq-shell {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  body.iq-exam-locked .iq-exam-top {
    flex: none;
    padding: 8px 24px;
  }
  body.iq-exam-locked .iq-main.iq-exam-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 12px 24px 14px;
  }
  body.iq-exam-locked .iq-exam-layout {
    flex: 1;
    min-height: 0;
    height: 100%;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 16px;
  }
  body.iq-exam-locked .iq-exam-qcard {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 16px 24px 14px;
  }
  body.iq-exam-locked .iq-q-header {
    flex: none;
    padding-bottom: 10px;
    margin-bottom: 10px;
  }
  body.iq-exam-locked .iq-q-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 2px 6px 0;
  }
  body.iq-exam-locked .iq-q-body.is-split {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.iq-exam-locked .iq-q-nav {
    flex: none;
    padding-top: 10px;
    margin-top: 8px;
  }
  body.iq-exam-locked .iq-q-nav .iq-btn {
    min-height: 42px;
    padding: 8px 20px;
    font-size: 14.5px;
  }

  .iq-exam-qcard .iq-q-prompt {
    padding: 11px 16px 12px;
    margin-bottom: 12px;
    border-radius: 13px;
  }
  .iq-exam-qcard .iq-q-eyebrow { margin-bottom: 4px; font-size: 10.5px; }
  .iq-exam-qcard .iq-q-lead { font-size: 16.5px; line-height: 1.48; }
  .iq-exam-qcard .iq-q-ask { margin-top: 8px; padding-top: 7px; font-size: 15.5px; }
  .iq-exam-qcard .iq-clue-list { margin-top: 8px; gap: 5px; }
  .iq-exam-qcard .iq-clue-item { padding: 6px 11px; font-size: 14px; line-height: 1.4; }
  .iq-exam-qcard .iq-analogy-stage { margin-top: 10px; gap: 10px; }
  .iq-exam-qcard .iq-an-card { padding: 7px 13px; }
  .iq-exam-qcard .iq-an-term { font-size: 15px; }
  .iq-exam-qcard .iq-seq-strip { margin-top: 10px; gap: 8px; }
  .iq-exam-qcard .iq-seq-tile { min-width: 46px; height: 42px; font-size: 17.5px; }
  .iq-exam-qcard .iq-ans-label { margin: 2px 0 8px; }
  .iq-exam-qcard .iq-svg-wrap { margin: 4px 0 12px; }
  .iq-exam-qcard .iq-svg-wrap svg { max-height: min(240px, 25vh); }
  .iq-exam-qcard .iq-options-grid { gap: 10px; }
  .iq-exam-qcard .iq-opt-btn { padding: 11px 14px; min-height: 54px; border-radius: 14px; }
  .iq-exam-qcard .iq-opt-btn.has-svg { padding: 10px 8px; gap: 6px; }
  .iq-exam-qcard .iq-opt-key { width: 28px; height: 28px; font-size: 13.5px; }
  .iq-exam-qcard .iq-opt-label { font-size: 15px; }
  .iq-exam-qcard .iq-opt-svg { max-width: 112px; }
  .iq-exam-qcard .iq-options-grid.svg-opts-6 .iq-opt-svg { max-width: 96px; }

  .iq-q-split {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(250px, 390px) minmax(0, 1fr);
    gap: 20px;
    align-items: center;
  }
  .iq-split-fig {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    padding: 8px;
    border-radius: 16px;
    background: #F8FBFF;
    border: 1px solid #E2ECF9;
  }
  .iq-split-fig .iq-svg-wrap {
    margin: 0;
    width: 100%;
    height: 100%;
    align-items: center;
  }
  .iq-split-fig .iq-svg-wrap svg {
    width: 100%;
    height: min(350px, calc(100dvh - 315px));
    max-height: 100%;
    max-width: 100%;
    display: block;
  }
  .iq-split-opts {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
  }
  .iq-split-opts .iq-options-grid.svg-opts-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .iq-split-opts .iq-options-grid.svg-opts-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .iq-split-opts .iq-opt-svg {
    max-width: min(110px, 13.5vh);
  }
  .iq-split-opts .iq-options-grid.svg-opts-6 .iq-opt-svg {
    max-width: min(94px, 12vh);
  }

  body.iq-exam-locked .iq-palette-card {
    position: static;
    height: 100%;
    min-height: 0;
    padding: 15px 16px 14px;
    overflow: hidden;
  }
  body.iq-exam-locked .iq-palette-stats { margin-bottom: 6px; font-size: 13px; }
  body.iq-exam-locked .iq-tier-label { margin: 7px 0 4px; font-size: 11px; }
  body.iq-exam-locked .iq-palette-grid { gap: 6px; }
  body.iq-exam-locked .iq-pal-btn {
    height: clamp(28px, 4.1vh, 38px);
    font-size: 13.5px;
    border-radius: 9px;
  }
  body.iq-exam-locked .iq-pal-footer {
    flex: none;
    padding-top: 10px;
    gap: 8px;
  }
  body.iq-exam-locked .iq-pal-footer #iqSubmitSide {
    min-height: 42px;
    font-size: 14.5px;
  }
}

@media (min-width: 1180px) {
  .iq-options-grid.svg-opts-6.is-strip-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .iq-options-grid.svg-opts-6.is-strip-6 .iq-opt-svg {
    max-width: 96px;
  }
}

@media (min-width: 1025px) and (max-height: 760px) {
  .iq-split-fig .iq-svg-wrap svg {
    height: min(310px, calc(100dvh - 300px));
  }
  .iq-exam-qcard .iq-q-prompt { padding: 9px 14px 10px; margin-bottom: 9px; }
  .iq-exam-qcard .iq-q-lead { font-size: 15.5px; }
  .iq-split-opts .iq-opt-btn.has-svg { padding: 8px 6px; gap: 4px; }
  .iq-split-opts .iq-options-grid.svg-opts-6 .iq-opt-svg { max-width: 82px; }
}

@media (max-width: 1024px) {
  .iq-q-split { display: block; }
  .iq-split-fig { padding: 0; border: 0; background: transparent; margin-bottom: 4px; }
  .iq-hero-visual { width: 220px; }
  .iq-hero-visual img { width: 255px; margin: -18px -10px; }
  .iq-domain-grid { grid-template-columns: 1fr; }
  .iq-main.iq-exam-main { max-width: 100%; padding: 14px 12px 34px; display: block; }
  .iq-exam-top { padding: 10px 14px; }
  .iq-exam-layout { grid-template-columns: 1fr; min-height: auto; }
  .iq-exam-qcard { padding: 18px; }
  .iq-q-prompt { padding: 15px 16px; margin-bottom: 16px; }
  .iq-q-lead { font-size: 16px; }
  .iq-an-term { font-size: 14.5px; }
  .iq-seq-tile { min-width: 44px; height: 42px; font-size: 17px; }
  .iq-opt-svg { max-width: 112px; }
  .iq-palette-card { display: none; }
  .iq-palette-card.mobile-open {
    display: block;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 66px;
    top: auto;
    max-height: 62vh;
    overflow-y: auto;
    z-index: 40;
    box-shadow: 0 20px 50px rgba(15, 35, 66, 0.38);
  }
  .iq-mobile-pal-btn { display: inline-flex; }
}

@media (max-width: 900px) {
  .iq-hero { flex-direction: column; align-items: stretch; gap: 18px; }
  .iq-hero-visual { width: 100%; justify-content: center; }
  .iq-hero-visual img { width: min(280px, 76%); margin: -8px auto; }
  .iq-age-panel-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .iq-age-grid { grid-template-columns: 1fr; gap: 8px; }
  .iq-lobby-grid { grid-template-columns: 1fr; }
  .iq-history-card.is-empty {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .iq-hist-sep { display: none; }
  .iq-hist-wm { opacity: 0.45; right: 12px; }
}

@media (max-width: 720px) {
  .iq-main { max-width: 100%; padding: 12px 12px 28px; }
  .iq-topbar-in { max-width: 100%; padding: 8px 12px; gap: 8px; }
  .iq-brand { gap: 8px; }
  .iq-brand-logo { width: 32px; height: 32px; border-radius: 9px; }
  .iq-brand-logo svg { width: 18px; height: 18px; }
  .iq-brand-sep { display: none; }
  .iq-brand-text b { font-size: 14.5px; }
  .iq-brand-text small { font-size: 9.5px; }
  .iq-top-actions { gap: 6px; }
  .iq-btn-home span { display: none; }
  .iq-btn-home { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .iq-btn-auth { height: 34px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
  .iq-btn-auth.logged { padding: 0 9px 0 4px; }
  .iq-btn-auth .iq-auth-name {
    max-width: 108px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .iq-age-panel { padding: 14px; margin-bottom: 12px; }
  .iq-age-panel-title h2 { font-size: 15px; }
  .iq-age-card { padding: 10px 12px; gap: 6px; }
  .iq-age-ic { width: 31px; height: 31px; }
  .iq-exam-brand-ic { width: 28px; height: 28px; border-radius: 8px; }
  .iq-exam-brand-ic svg { width: 16px; height: 16px; }
  .iq-tier-grid { grid-template-columns: 1fr; gap: 7px; }
  .iq-card, .iq-hero { padding: 16px 14px; border-radius: 16px; }
  .iq-hero-badge { font-size: 9.5px; line-height: 1.35; border-radius: 10px; padding: 4px 10px; }
  .iq-hero h1 { font-size: 20px; }
  .iq-hero p { font-size: 12.5px; }
  .iq-hero-pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
  .iq-hero-pill { padding: 6px 8px; font-size: 11px; border-radius: 10px; line-height: 1.3; white-space: normal; text-align: left; }
  .iq-section-title { font-size: 15.5px; gap: 9px; margin-bottom: 12px; }
  .iq-title-ic { width: 32px; height: 32px; border-radius: 9px; }
  .iq-title-ic svg { width: 17px; height: 17px; }

  .iq-input { font-size: 16px; height: 44px; }
  .iq-profile-box { padding: 12px; gap: 11px; margin-bottom: 12px; }
  .iq-profile-avt { width: 44px; height: 44px; }
  .iq-profile-avt svg { width: 26px; height: 26px; }
  .iq-profile-info b { font-size: 15px; }
  .iq-profile-info small { font-size: 12px; }
  .iq-profile-meta { gap: 6px; font-size: 11.5px; }
  .iq-ready-grid { grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
  .iq-ready-tile { flex-direction: row; align-items: center; gap: 10px; padding: 9px 11px; }
  .iq-ready-ic { margin-bottom: 0; }
  .iq-btn-start { padding: 12px 16px; font-size: 14px; min-height: 48px; }
  .iq-btn-start-arrow { display: none; }
  .iq-struct-item { padding: 8px 10px; gap: 9px; }
  .iq-struct-ic { width: 32px; height: 32px; }
  .iq-struct-ic svg { width: 18px; height: 18px; }
  .iq-struct-badge { min-width: 46px; padding: 3px 7px; font-size: 11.5px; }

  .iq-official-cert { flex-direction: column; align-items: stretch; padding: 15px 14px; gap: 13px; border-radius: 16px; }
  .iq-oc-left { gap: 12px; align-items: flex-start; }
  .iq-oc-score { min-width: 68px; padding: 8px 9px; }
  .iq-oc-score b { font-size: 24px; }
  .iq-oc-rank { font-size: 15.5px; }
  .iq-oc-meta { font-size: 12px; gap: 4px 10px; }
  .iq-oc-btn { width: 100%; }

  .iq-history-card { padding: 14px; }
  .iq-hist-empty-msg { padding-right: 0; }
  .iq-hist-wm { display: none; }
  .iq-table-wrap { border: 0; border-radius: 0; overflow: visible; }
  .iq-table { display: block; }
  .iq-table thead { display: none; }
  .iq-table tbody { display: grid; gap: 10px; }
  .iq-table tr {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid #DCE7F5;
    border-radius: 13px;
    background: #FAFDFE;
  }
  .iq-table tbody tr:hover td { background: transparent; }
  .iq-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    font-size: 13px;
  }
  .iq-table td::before {
    content: attr(data-label);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--iq-muted);
    flex: none;
  }
  .iq-hist-rank-cell { justify-content: flex-end; text-align: right; }

  .iq-exam-top { padding: 8px 10px; }
  .iq-exam-title-prefix, .iq-pal-btn-long, .iq-fs-btn { display: none !important; }
  .iq-exam-title { gap: 6px; }
  .iq-exam-title b { font-size: 13.5px; }
  .iq-exam-top-right { gap: 5px; }
  .iq-timer { padding: 5px 10px; font-size: 13.5px; }
  #iqTogglePal, #iqSubmitTop {
    min-height: 33px !important;
    padding: 5px 10px !important;
    font-size: 12.5px !important;
    border-radius: 10px;
    box-shadow: none;
  }
  .iq-main.iq-exam-main { padding: 10px 10px 24px; }
  .iq-exam-qcard { padding: 14px 12px; }
  .iq-q-header { padding-bottom: 10px; margin-bottom: 12px; gap: 6px; }
  .iq-badge { padding: 4px 9px; font-size: 11.5px; }
  .iq-flag-btn { padding: 5px 9px; font-size: 11.5px; }
  .iq-q-prompt { padding: 12px 13px; margin-bottom: 12px; border-radius: 13px; border-left-width: 4px; }
  .iq-q-eyebrow { margin-bottom: 4px; font-size: 10px; }
  .iq-q-lead { font-size: 15px; line-height: 1.5; }
  .iq-q-ask { margin-top: 9px; padding-top: 8px; font-size: 14.5px; }
  .iq-clue-list { margin-top: 9px; gap: 6px; }
  .iq-clue-item { padding: 7px 10px; font-size: 13.5px; line-height: 1.45; }
  .iq-analogy-stage { flex-direction: column; align-items: stretch; gap: 7px; margin-top: 10px; }
  .iq-an-card { justify-content: center; padding: 8px 10px; gap: 7px; }
  .iq-an-term { font-size: 13.5px; }
  .iq-an-like { align-self: center; font-size: 11.5px; }
  .iq-seq-strip { gap: 6px; margin-top: 10px; }
  .iq-seq-tile { min-width: 40px; height: 38px; padding: 0 8px; font-size: 15.5px; border-radius: 10px; }
  .iq-svg-wrap { margin: 8px 0 14px; }
  .iq-svg-wrap svg { max-height: none; max-width: 100%; height: auto; }
  .iq-svg-wrap .iq-svg-matrix { width: min(290px, 100%); }
  .iq-svg-wrap .iq-svg-net { width: min(240px, 100%); }
  .iq-svg-wrap .iq-svg-strip,
  .iq-svg-wrap .iq-svg-num { width: 100%; }
  .iq-ans-label { margin: 2px 0 9px; font-size: 11px; }
  .iq-options-grid { gap: 9px; }
  .iq-options-grid.text-opts { grid-template-columns: 1fr; }
  .iq-options-grid.svg-opts-6,
  .iq-options-grid.svg-opts-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iq-opt-btn { padding: 11px 12px; min-height: 50px; border-radius: 13px; gap: 10px; }
  .iq-opt-key { width: 28px; height: 28px; font-size: 13px; }
  .iq-opt-label { font-size: 14px; }
  .iq-opt-btn.has-svg { padding: 10px 8px; gap: 6px; }
  .iq-opt-svg { max-width: 88px; }
  .iq-q-nav { gap: 8px; padding-top: 14px; margin-top: 16px; }
  .iq-q-nav .iq-btn { flex: 1; min-height: 44px; padding: 8px 10px; font-size: 13.5px; }
  .iq-palette-card.mobile-open {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-height: 76dvh;
    padding: 16px 14px max(16px, env(safe-area-inset-bottom));
    border-radius: 20px;
    border: 1.5px solid #CBD9EE;
    z-index: 60;
  }
  .iq-palette-card.mobile-open .iq-pal-btn { height: 38px; font-size: 14px; }

  .iq-result-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 20px 16px; gap: 16px; border-radius: 18px; }
  .iq-score-circle { width: 132px; height: 132px; }
  .iq-score-circle b { font-size: 44px; }
  .iq-result-pills { justify-content: center; }
  .iq-result-actions { flex-direction: column; width: 100%; gap: 9px; }
  .iq-result-actions .iq-btn { width: 100%; min-height: 46px; }
  .iq-bar-head { flex-wrap: wrap; gap: 4px 8px; font-size: 13px; }
  .iq-review-item { padding: 13px 12px; border-radius: 14px; }
  .iq-modal-box { padding: 20px 16px 18px; border-radius: 18px; }

  .iq-cert-toolbar {
    padding: 8px 10px;
    border-radius: 13px;
    margin-bottom: 12px;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .iq-back-long { display: none; }
  .iq-cert-toolbar .iq-cert-back-btn {
    min-height: 38px;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 10px;
  }
  .iq-cert-actions { gap: 7px; flex-wrap: nowrap; }
  .iq-cert-toolbar .iq-cert-act-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
    border-radius: 10px;
  }
  .iq-cert-toolbar .iq-cert-act-btn svg { width: 18px; height: 18px; }
  .iq-cert-frame {
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(15, 35, 66, 0.16);
  }
  .iq-cert-mobile-tip {
    display: block;
    font-size: clamp(9.5px, 2.6vw, 11.5px);
    letter-spacing: -0.01em;
    white-space: nowrap;
  }
  .iq-cert-disclaimer {
    margin-top: 8px;
    padding: 0;
    font-size: clamp(7.5px, 2.12vw, 11px);
    line-height: 1.5;
    letter-spacing: -0.015em;
  }
  .iq-cert-disclaimer p { white-space: nowrap; }
}

@media (max-width: 640px) {
  .iq-hero-visual { display: none; }
}

@media (max-width: 520px) {
  .iq-btn-auth.logged .iq-auth-name { display: none; }
  .iq-btn-auth.logged { padding: 0 7px 0 4px; gap: 3px; }
  .iq-brand-text small { display: none; }
  .iq-exam-top-in { padding: 0; }
}

@media (max-width: 420px) {
  .iq-exam-title > span { display: none; }
}

/* ---------- Strict Landscape A4 Print Styling ---------- */
@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #FAF5E8 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  #iqRoot, .iq-bg-waves, .iq-toast, .iq-modal-backdrop, .tkhs-lop, .tkhs-bao {
    display: none !important;
  }
  #iqPrintHost {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  #iqPrintHost .iq-cert-svg {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    object-fit: contain;
  }
}
