/* =============================================================================
   PRIMARY MATH REVIEW WORKSHEET CSS (Prefix: .ex-mr- — Isolated per Law 4)
   1-page A4 illustrated worksheet with B&W colorable SVGs, arrow chains & ô ly.
   ============================================================================= */
.sheet.ex-mr-active .ws-header { display: none !important; }
.ex-mr-frame {
    border: 2px solid #0f172a; border-radius: 14px; padding: 10px 14px 12px;
    background: #fff; color: #0f172a; position: relative;
    font-family: 'Be Vietnam Pro', 'Lexend', sans-serif;
}
.ex-mr-head { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 6px; margin-bottom: 6px; }
.ex-mr-art { width: 52px; height: 52px; display: block; margin: 0 auto; }
.ex-mr-title-wrap { text-align: center; }
.ex-mr-pill {
    display: inline-block; border: 2px solid #0f172a; border-radius: 999px;
    padding: 3px 16px; font-size: 14.5px; font-weight: 800; letter-spacing: 0.3px; background: #f8fafc;
}
.ex-mr-sub { margin-top: 3px; font-size: 11.5px; font-weight: 700; color: #334155; display: flex; justify-content: center; gap: 14px; }
.ex-mr-info-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.ex-mr-grade-box {
    display: grid; grid-template-columns: 95px 1fr; border: 1.5px solid #0f172a;
    border-radius: 8px; overflow: hidden; margin-bottom: 8px; font-size: 11.5px;
}
.ex-mr-score-cell { border-right: 1.5px solid #0f172a; padding: 5px 8px; text-align: center; font-weight: 800; min-height: 36px; }
.ex-mr-remark-cell { padding: 5px 10px; font-weight: 700; min-height: 36px; }
.ex-mr-part-bar {
    background: #f1f5f9; border: 1.5px solid #0f172a; border-radius: 8px;
    padding: 3px 10px; font-size: 12.5px; font-weight: 800; margin: 7px 0 5px;
}
.ex-mr-frame .ws-section { margin: 0 0 6px !important; padding: 0 !important; }
.ex-mr-frame .ws-section-title {
    font-size: 12px !important; font-weight: 800 !important; margin: 0 0 4px !important;
    padding: 0 !important; border: none !important; background: none !important; color: #0f172a !important;
}
.ex-mr-mcq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; }
.ex-mr-mcq-card {
    border: 1px solid #cbd5e1; border-radius: 8px; padding: 5px 8px;
    font-size: 11.8px; line-height: 1.32; break-inside: avoid; background: #fff;
}
.ex-mr-mcq-stem { margin-bottom: 3px; }
.ex-mr-mcq-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 4px; font-size: 11.5px; }
.ex-mr-mcq-opts.is-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ex-mr-calc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px 10px; font-size: 12.5px; font-weight: 600; }
.ex-mr-calc-item {
    border: 1px dashed #94a3b8; border-radius: 7px; padding: 4px 8px;
    display: flex; align-items: center; justify-content: space-between;
}
.ex-mr-chain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: center; }
.ex-mr-chain-card {
    border: 1px solid #cbd5e1; border-radius: 8px; padding: 5px 6px;
    display: flex; align-items: center; justify-content: center; gap: 3px;
}
.ex-mr-box {
    min-width: 34px; height: 26px; border: 1.6px solid #0f172a; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; background: #fff;
}
.ex-mr-box.is-blank { background: #f8fafc; }
.ex-mr-arrow { width: 54px; height: 28px; flex: 0 0 auto; display: block; }
.ex-mr-cmp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; font-size: 12.5px; font-weight: 600; }
.ex-mr-cmp-item {
    border: 1px solid #cbd5e1; border-radius: 7px; padding: 4px 10px;
    display: flex; align-items: center; justify-content: space-between;
}
.ex-mr-sign-box {
    display: inline-block; width: 24px; height: 24px; border: 1.6px solid #0f172a;
    border-radius: 5px; vertical-align: middle; margin: 0 6px; background: #fff;
}
.ex-mr-bottom-row { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 10px; align-items: stretch; }
.ex-mr-pic-wrap {
    border: 1px solid #cbd5e1; border-radius: 8px; padding: 6px 8px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.ex-mr-pic-svg { height: 50px; max-width: 210px; display: block; }
.ex-mr-oly { display: inline-grid; grid-template-columns: repeat(5, 24px); border: 1.5px solid #0f172a; background: #fff; }
.ex-mr-oly span {
    width: 24px; height: 24px; border-right: 1px solid #64748b;
    background-image: linear-gradient(to right, transparent 48%, #cbd5e1 48%, #cbd5e1 52%, transparent 52%),
        linear-gradient(to bottom, transparent 48%, #cbd5e1 48%, #cbd5e1 52%, transparent 52%);
}
.ex-mr-oly span:last-child { border-right: none; }
.ex-mr-pill-box {
    border: 1.8px solid #0f172a; border-radius: 999px; padding: 8px 12px;
    display: flex; align-items: center; justify-content: space-around;
    font-size: 15px; font-weight: 800; letter-spacing: 0.5px; margin-top: 6px;
}
@media print {
    .ex-mr-frame { border-color: #000 !important; }
    .ex-mr-pill, .ex-mr-part-bar, .ex-mr-box.is-blank { background: #fff !important; }
}
