/* MEX 8 CSS - orange light modern exam UI */
.mex8-root{
  --mex8-bg:#fffaf5; --mex8-bg2:#ffffff; --mex8-border:#fed7aa; --mex8-border-strong:#fb923c;
  --mex8-accent:#f97316; --mex8-accent-dark:#c2410c; --mex8-accent-soft:#fff7ed;
  --mex8-text:#1f2937; --mex8-muted:#6b7280; --mex8-success:#10b981; --mex8-danger:#ef4444;
  min-height:100vh; background:linear-gradient(180deg,#fffaf5 0%,#fff 100%); color:var(--mex8-text);
  font-family:'Inter',ui-sans-serif,system-ui,-apple-system,sans-serif; box-sizing:border-box; padding:24px;
}
html,body{min-height:100%;background:linear-gradient(180deg,#fffaf5 0%,#fff 100%);}
body{margin:0;}
.mex8-root *{box-sizing:border-box}
.mex8-shell{max-width:1400px;margin:0 auto}
@keyframes mex8Slide{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:translateY(0)}}
@keyframes mex8Pulse{0%{box-shadow:0 0 0 0 rgba(249,115,22,.35)}70%{box-shadow:0 0 0 14px rgba(249,115,22,0)}100%{box-shadow:0 0 0 0 rgba(249,115,22,0)}}
.mex8-slide{animation:mex8Slide .45s cubic-bezier(.16,1,.3,1) forwards}
.mex8-stagger{opacity:0;transform:translateY(16px);transition:all .45s cubic-bezier(.16,1,.3,1)}
.mex8-stagger.mex8-visible{opacity:1;transform:translateY(0)}
.mex8-hero{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:34px 38px;border-radius:28px;background:linear-gradient(135deg,#fff7ed 0%,#fff 65%,#fff3e8 100%);border:1px solid #ffedd5;box-shadow:0 20px 40px rgba(249,115,22,.07);margin-bottom:28px}
.mex8-hero.is-small{padding:24px 28px}
.mex8-eyebrow{font-size:12px;text-transform:uppercase;letter-spacing:.14em;font-weight:800;color:var(--mex8-accent);margin-bottom:8px}
.mex8-title{margin:0;font-size:40px;line-height:1.05;font-weight:900;letter-spacing:-.03em;background:linear-gradient(to right,#9a3412,#f97316);-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.mex8-subtitle{margin-top:10px;font-size:16px;color:var(--mex8-muted);max-width:800px;line-height:1.6}
.mex8-hero-badge{width:124px;height:124px;border-radius:30px;display:grid;place-items:center;flex-shrink:0;background:linear-gradient(135deg,#f97316,#fb923c);color:#fff;box-shadow:0 18px 34px rgba(249,115,22,.22);padding:30px}
.mex8-layout{display:grid;grid-template-columns:320px 1fr;gap:28px}
.mex8-panel,.mex8-card{background:rgba(255,255,255,.82);backdrop-filter:blur(14px);border:1px solid #ffedd5;border-radius:28px;box-shadow:0 16px 40px rgba(15,23,42,.04)}
.mex8-panel{padding:24px}.mex8-card{padding:30px 34px}
.mex8-panel-label{font-size:12px;text-transform:uppercase;letter-spacing:.12em;color:#9ca3af;font-weight:800;margin-bottom:14px}
.mex8-section-title{font-size:24px;font-weight:800;color:#111827}
.mex8-sidebar,.mex8-main{min-width:0}
.mex8-cat-list,.mex8-pack-list,.mex8-strip-list{display:flex;flex-direction:column;gap:10px}
.mex8-cat-btn,.mex8-pack-btn,.mex8-strip{width:100%;border:1px solid transparent;background:#fff;border-radius:20px;padding:16px 18px;display:flex;align-items:center;gap:14px;text-align:left;cursor:pointer;transition:all .22s cubic-bezier(.16,1,.3,1);box-shadow:0 3px 10px rgba(15,23,42,.03);outline:none}
.mex8-cat-btn:hover,.mex8-pack-btn:hover,.mex8-strip:hover{border-color:#fdba74;box-shadow:0 12px 24px rgba(249,115,22,.1);background:#fffaf5}
.mex8-cat-btn.is-active{background:linear-gradient(135deg,#ea580c,#f97316);color:#fff;border-color:transparent;box-shadow:0 14px 28px rgba(249,115,22,.2)}
.mex8-cat-btn.is-active small,.mex8-cat-btn.is-active .mex8-cat-title{color:#fff}
.mex8-cat-icon{width:22px;height:22px;display:grid;place-items:center;color:currentColor;flex-shrink:0}.mex8-cat-icon-svg,.mex8-hero-badge-svg,.mex8-welcome-icon-svg{display:block;width:100%;height:100%}
.mex8-cat-copy,.mex8-pack-copy{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.mex8-cat-title,.mex8-pack-title{font-weight:800;font-size:15px;color:#111827}
.mex8-cat-copy small,.mex8-pack-copy small{font-size:12px;color:#9ca3af;font-weight:500}
.mex8-chip{flex-shrink:0;padding:6px 10px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.03em}
.mex8-chip.is-ready{background:#ffedd5;color:#c2410c}.mex8-chip.is-planned{background:#f3f4f6;color:#6b7280}
.mex8-pack-no,.mex8-strip-no{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;flex-shrink:0;background:#fff7ed;color:#c2410c;font-weight:900}
.mex8-pack-btn.is-disabled{opacity:.72;cursor:not-allowed}
.mex8-pack-btn.is-disabled:hover{transform:none;box-shadow:0 3px 10px rgba(15,23,42,.03);background:#fff}
.mex8-welcome{min-height:400px;display:grid;place-items:center;text-align:center;padding:60px 30px}
.mex8-welcome-icon{width:58px;height:58px;margin:0 auto 10px;color:#f97316}.mex8-welcome-title{font-size:24px;font-weight:800;margin-bottom:8px}
.mex8-welcome-text{max-width:620px;color:var(--mex8-muted);font-size:16px;line-height:1.7}
.mex8-playerbar{position:sticky;top:8px;z-index:40;margin-bottom:18px;background:rgba(255,255,255,.92);backdrop-filter:blur(18px);border:1px solid #ffedd5;border-radius:999px;padding:10px 12px;display:flex;align-items:center;gap:10px;box-shadow:0 12px 26px rgba(15,23,42,.06)}
.mex8-player-title{font-size:14px;font-weight:800;color:#111827;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mex8-player-actions{display:flex;align-items:center;gap:8px}
.mex8-pill-btn,.mex8-text-btn{border:none;background:#fff7ed;color:#c2410c;font-weight:800;cursor:pointer;padding:10px 16px;border-radius:999px;transition:all .2s;outline:none}
.mex8-pill-btn:hover,.mex8-text-btn:hover{background:#ffedd5}.mex8-text-btn{background:#fff}.mex8-text-btn.is-playing{background:#fff7ed;color:#c2410c;box-shadow:0 0 0 2px rgba(251,146,60,.18)}
.mex8-circle-btn{width:48px;height:48px;border-radius:50%;border:none;background:linear-gradient(135deg,#f97316,#ea580c);color:#fff;display:grid;place-items:center;cursor:pointer;font-size:17px;font-weight:900;box-shadow:0 12px 24px rgba(249,115,22,.18);outline:none}
.mex8-circle-btn.is-playing{background:#111827;animation:mex8Pulse 1.5s infinite}
.mex8-stage-nav{display:flex;gap:8px;margin-bottom:18px;flex-wrap:wrap}
.mex8-stage-pill{padding:10px 14px;border-radius:999px;background:#fff;border:1px solid #ffedd5;color:#9ca3af;font-size:12px;font-weight:800;letter-spacing:.04em}
.mex8-stage-pill.is-active{background:#fff7ed;color:#c2410c;border-color:#fdba74}.mex8-stage-pill.is-done{background:#f97316;color:#fff;border-color:#f97316}
.mex8-stage-card{min-height:calc(100vh - 260px)}
.mex8-badge{display:inline-flex;align-items:center;gap:8px;background:#fff7ed;color:#c2410c;border-radius:999px;padding:7px 14px;font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;margin-bottom:14px}
.mex8-stage-title{margin:0 0 8px 0;font-size:34px;line-height:1.1;font-weight:900;color:#111827;letter-spacing:-.03em}
.mex8-stage-text{font-size:16px;color:var(--mex8-muted);line-height:1.7;max-width:900px}
.mex8-info-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:28px}
.mex8-info-box{background:#fff;border:1px solid #ffedd5;border-radius:20px;padding:18px}
.mex8-info-label{font-size:11px;text-transform:uppercase;letter-spacing:.12em;font-weight:800;color:#9ca3af;margin-bottom:8px}
.mex8-info-value{font-weight:800;line-height:1.5}
.mex8-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:28px;padding-top:22px;border-top:1px solid #ffedd5}
.mex8-actions-right{display:flex;gap:10px;align-items:center}
.mex8-btn{border:none;border-radius:18px;padding:14px 20px;font-weight:800;font-size:15px;cursor:pointer;transition:all .22s;outline:none}
.mex8-btn-primary{background:linear-gradient(135deg,#f97316,#ea580c);color:#fff;box-shadow:0 14px 24px rgba(249,115,22,.18)}
.mex8-btn-ghost{background:#fff;border:1px solid #fed7aa;color:#9a3412}.mex8-btn-soft{background:#fff7ed;color:#c2410c}
.mex8-strip{display:grid;grid-template-columns:48px 1fr 1fr;align-items:center;gap:16px;border-radius:24px}
.mex8-strip.is-active{transform:none;border-color:#fb923c;background:#fff7ed;box-shadow:0 0 0 2px rgba(251,146,60,.28),0 14px 28px rgba(249,115,22,.12);animation:mex8PulseSoft .7s ease}
.mex8-strip-en{font-size:18px;font-weight:800;color:#111827}
.mex8-strip-pl{font-size:16px;color:#6b7280;transition:all .28s}
.mex8-pl-hidden .mex8-blur-target{filter:blur(6px);opacity:.35;user-select:none}
.mex8-task-layout{display:grid;grid-template-columns:320px 1fr;gap:20px;margin-top:22px}
.mex8-wordbank,.mex8-reading-panel{background:#fff;border:1px solid #ffedd5;border-radius:24px;padding:20px}
.mex8-bank-grid{display:flex;flex-direction:column;gap:10px}
.mex8-bank-item{width:100%;text-align:left;border:1px solid #fed7aa;background:#fff;border-radius:16px;padding:13px 14px;display:flex;justify-content:space-between;align-items:center;gap:8px;cursor:pointer;transition:all .2s;outline:none}
.mex8-bank-item strong{font-size:13px;color:#9a3412}.mex8-bank-item span{font-weight:700;color:#111827}
.mex8-bank-item:hover{background:#fff7ed}.mex8-bank-item.is-used{opacity:.5}
.mex8-bank-item.is-selected{border-color:#f97316;background:linear-gradient(135deg,#fff7ed,#ffedd5);box-shadow:0 0 0 4px rgba(249,115,22,.12);transform:translateX(6px)}
.mex8-bank-item.is-dragging{opacity:.9;border-style:dashed}
.mex8-bank-help{margin-top:12px;font-size:13px;color:#9ca3af}
.mex8-reading-text{font-size:19px;line-height:2.0;color:#1f2937}.mex8-reading-text p{margin:0 0 18px 0}
.mex8-gap{border:2px dashed #fdba74;background:#fff7ed;border-radius:16px;padding:7px 12px;display:inline-flex;align-items:center;gap:10px;margin:0 4px;vertical-align:middle;cursor:pointer;transition:all .18s;min-width:150px;justify-content:center;outline:none}
.mex8-gap:hover{transform:translateY(-1px)}
.mex8-gap-id{font-size:11px;font-weight:900;letter-spacing:.06em;color:#c2410c;text-transform:uppercase;background:#fff;border-radius:999px;padding:4px 8px}
.mex8-gap-fill{font-size:15px;font-weight:800;color:#111827}
.mex8-gap.is-correct{border-color:#10b981;background:#ecfdf5}.mex8-gap.is-wrong{border-color:#ef4444;background:#fef2f2}.mex8-gap.is-select-mode{box-shadow:0 0 0 4px rgba(249,115,22,.08)}
.mex8-feedback-panel,.mex8-result-box{margin-top:22px;padding:22px;border-radius:24px;border:1px solid #ffedd5;background:linear-gradient(180deg,#ffffff 0%,#fffaf5 100%);box-shadow:0 14px 30px rgba(15,23,42,.04)}
.mex8-feedback-panel.is-correct{background:linear-gradient(180deg,#ecfdf5 0%,#f7fffb 100%);border-color:#a7f3d0}
.mex8-feedback-panel.is-mixed{background:linear-gradient(180deg,#fffaf5 0%,#ffffff 100%);border-color:#fdba74}
.mex8-feedback-head{display:flex;align-items:flex-start;gap:14px;margin-bottom:16px}
.mex8-feedback-icon{width:54px;height:54px;border-radius:18px;display:grid;place-items:center;font-weight:900;font-size:24px;flex-shrink:0}
.mex8-feedback-icon.is-correct{background:#d1fae5;color:#047857}
.mex8-feedback-icon.is-mixed{background:#ffedd5;color:#c2410c}
.mex8-feedback-title{font-size:24px;font-weight:900;margin-bottom:6px;color:#111827}.mex8-feedback-text{color:#6b7280;line-height:1.6}
.mex8-answer-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px}
.mex8-answer-row{background:#fffaf5;border:1px solid #ffedd5;border-radius:16px;padding:14px;display:flex;flex-direction:column;gap:4px;cursor:pointer;transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;outline:none;text-align:left}
.mex8-answer-row:hover{box-shadow:0 12px 20px rgba(249,115,22,.08)}
.mex8-answer-row.is-correct{background:#f0fdf4;border-color:#86efac}
.mex8-answer-row.is-wrong{background:#fff7f7;border-color:#fca5a5}
.mex8-reading-review{margin-top:14px;padding:16px 18px;border-radius:20px;background:#fff;border:1px solid #ffedd5}
.mex8-reading-review p{margin:0 0 14px 0;line-height:2}
.mex8-reading-review p:last-child{margin-bottom:0}
.mex8-stage-result{display:grid;place-items:center;text-align:center}
.mex8-result-ring{width:150px;height:150px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(#f97316 0%,#fdba74 70%,#fff7ed 70%,#fff7ed 100%);color:#9a3412;font-size:30px;font-weight:900;margin-bottom:18px}
.mex8-empty{padding:26px;border-radius:18px;background:#fff7ed;color:#9a3412;font-weight:700}
.mex8-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}

/* Modal + feedback polish card */
.mex8-modal-backdrop{position:fixed;inset:0;background:rgba(17,24,39,.52);backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;padding:22px;z-index:180}
.mex8-modal{width:min(760px,100%);max-height:min(86vh,900px);overflow:auto;border-radius:28px;background:linear-gradient(180deg,#ffffff 0%,#fffaf5 100%);border:1px solid #ffedd5;box-shadow:0 28px 70px rgba(15,23,42,.28)}
.mex8-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:24px 26px 10px;border-bottom:1px solid #ffedd5}
.mex8-modal-close{width:42px;height:42px;border-radius:14px;border:1px solid #fed7aa;background:#fff;color:#9a3412;font-weight:900;cursor:pointer;outline:none}
.mex8-modal-body{padding:22px 26px 28px}
.mex8-modal-verdict{display:inline-flex;align-items:center;padding:8px 14px;border-radius:999px;font-weight:800;font-size:12px;letter-spacing:.04em;text-transform:uppercase;margin-bottom:14px}
.mex8-modal-verdict.is-correct{background:#d1fae5;color:#047857}
.mex8-modal-verdict.is-wrong{background:#fee2e2;color:#b91c1c}
.mex8-modal-text{margin:0 0 16px 0;font-size:16px;line-height:1.75;color:#374151}
.mex8-modal-sentence{padding:18px;border-radius:20px;background:#fff;border:1px solid #ffedd5;line-height:2;font-size:18px;color:#111827}
.mex8-modal-hint{margin-top:16px;padding:14px 16px;border-radius:16px;background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;font-weight:700;line-height:1.6}

/* Reading polish blocks + active paragraph */
.mex8-reading-toolbar{display:flex;justify-content:flex-end;margin-bottom:12px}
.mex8-para-block{padding:12px 14px;border:1px solid transparent;border-bottom:1px dashed #ffedd5;transition:background .2s ease,border-color .2s ease,box-shadow .2s ease;border-radius:18px;scroll-margin-top:90px}
.mex8-para-block:last-child{border-bottom:none}
.mex8-para-block.is-active{background:#fffaf0;border-color:#fdba74;box-shadow:0 0 0 2px rgba(251,146,60,.22),0 10px 24px rgba(249,115,22,.08);padding:12px 14px;animation:mex8PulseSoft .7s ease}
.mex8-para-block.is-drop-target{background:#fff7ed;border-color:#fb923c;box-shadow:0 0 0 3px rgba(251,146,60,.22),0 10px 24px rgba(249,115,22,.10);border-radius:18px}
.mex8-para-en{margin:0 0 8px 0}
.mex8-para-pl{margin:0;color:#9a3412;background:#fff7ed;border:1px solid #ffedd5;border-radius:14px;padding:10px 12px;font-size:15px;line-height:1.7;transition:filter .25s ease,opacity .25s ease,transform .2s ease}
.mex8-gap.is-correct{animation:mex8CorrectFlash .45s ease}
.mex8-gap.is-wrong{animation:mex8WrongFlash .45s ease}
.mex8-inline-answer{cursor:pointer;border:none;background:#fff;border-radius:12px;padding:4px 10px;font-weight:800;transition:transform .16s ease, box-shadow .16s ease, background .16s ease;outline:none}
.mex8-inline-answer:hover{box-shadow:0 8px 16px rgba(15,23,42,.08)}
.mex8-inline-answer.is-correct{background:#ecfdf5;color:#047857;animation:mex8CorrectFlash .45s ease}
.mex8-inline-answer.is-wrong{background:#fef2f2;color:#b91c1c;animation:mex8WrongFlash .45s ease}
.mex8-answer-row.is-correct{animation:mex8CorrectFlash .45s ease}
.mex8-answer-row.is-wrong{animation:mex8WrongFlash .45s ease}

/* no-jump interaction feel */
.mex8-root button{scroll-margin-top:100px;-webkit-tap-highlight-color:transparent}
.mex8-root button:focus{outline:none}

@keyframes mex8CorrectFlash{
  0%{transform:scale(.96);box-shadow:0 0 0 0 rgba(16,185,129,0)}
  35%{transform:scale(1.03);box-shadow:0 0 0 8px rgba(16,185,129,.14)}
  100%{transform:scale(1);box-shadow:0 0 0 0 rgba(16,185,129,0)}
}

@keyframes mex8PulseSoft{
  0%{box-shadow:0 0 0 0 rgba(249,115,22,0),0 10px 24px rgba(249,115,22,.04)}
  45%{box-shadow:0 0 0 6px rgba(249,115,22,.12),0 14px 30px rgba(249,115,22,.10)}
  100%{box-shadow:0 0 0 2px rgba(251,146,60,.22),0 10px 24px rgba(249,115,22,.08)}
}

@keyframes mex8WrongFlash{
  0%{transform:scale(.96);box-shadow:0 0 0 0 rgba(239,68,68,0)}
  35%{transform:scale(1.03);box-shadow:0 0 0 8px rgba(239,68,68,.14)}
  100%{transform:scale(1);box-shadow:0 0 0 0 rgba(239,68,68,0)}
}

@media (max-width:1100px){.mex8-layout,.mex8-task-layout,.mex8-info-grid{grid-template-columns:1fr}}
@media (max-width:780px){
  .mex8-root{padding:14px}.mex8-hero{padding:24px;flex-direction:column;align-items:flex-start}.mex8-title{font-size:32px}
  .mex8-hero-badge{width:86px;height:86px;border-radius:24px;padding:20px}.mex8-card,.mex8-panel{padding:18px}.mex8-stage-card{min-height:auto}.mex8-stage-title{font-size:28px}
  .mex8-strip{grid-template-columns:42px 1fr;gap:10px}.mex8-strip-pl{grid-column:2}
  .mex8-playerbar{position:fixed;top:0;left:0;right:0;border-radius:0;border-left:none;border-right:none;border-top:none;padding:10px 12px;z-index:120}
  .mex8-stage-nav{margin-top:78px}.mex8-actions{flex-direction:column-reverse;align-items:stretch}.mex8-actions-right{flex-direction:column}.mex8-btn{width:100%}.mex8-answer-grid{grid-template-columns:1fr}
  .mex8-modal-backdrop{padding:12px}.mex8-modal{max-height:88vh}.mex8-modal-head,.mex8-modal-body{padding-left:18px;padding-right:18px}
}

@media (max-width:780px){
  .mex8-sidebar{scroll-margin-top:0}
  .mex8-shell,.mex8-main,.mex8-panel,.mex8-card{scroll-margin-top:0}
}

/* Use of English */
.mex8-uoe-progress{margin-top:20px;margin-bottom:18px}
.mex8-uoe-progress-bar{height:10px;border-radius:999px;background:#ffedd5;overflow:hidden}
.mex8-uoe-progress-bar span{display:block;height:100%;border-radius:999px;background:linear-gradient(135deg,#f97316,#fb923c)}
.mex8-uoe-scoreline{margin-top:8px;font-size:13px;color:#9ca3af;font-weight:700}
.mex8-uoe-card{background:#fff;border:1px solid #ffedd5;border-radius:24px;padding:22px;transition:box-shadow .2s ease,border-color .2s ease,background .2s ease}
.mex8-uoe-card.is-active{background:#fffaf0;border-color:#fdba74;box-shadow:0 0 0 2px rgba(251,146,60,.22),0 10px 24px rgba(249,115,22,.08)}
.mex8-uoe-sentence{font-size:28px;line-height:1.45;font-weight:900;color:#111827;letter-spacing:-.02em;margin-bottom:10px}
.mex8-uoe-sentence-pl{margin:0 0 16px 0;color:#9a3412;background:#fff7ed;border:1px solid #ffedd5;border-radius:14px;padding:10px 12px;font-size:15px;line-height:1.7;transition:filter .25s ease,opacity .25s ease}
.mex8-uoe-options{display:grid;grid-template-columns:1fr;gap:12px;margin-top:16px}
.mex8-uoe-option{width:100%;text-align:left;border:1px solid #fed7aa;background:#fff;border-radius:18px;padding:15px 16px;display:flex;align-items:center;gap:12px;cursor:pointer;transition:all .2s;outline:none}
.mex8-uoe-option:hover{background:#fffaf5;box-shadow:0 12px 24px rgba(249,115,22,.08)}
.mex8-uoe-option:disabled{cursor:default;opacity:1}
.mex8-uoe-option.is-selected{border-color:#f97316;background:linear-gradient(135deg,#fff7ed,#ffedd5);box-shadow:0 0 0 4px rgba(249,115,22,.12)}
.mex8-uoe-option.is-correct{border-color:#10b981;background:#ecfdf5}
.mex8-uoe-option.is-wrong{border-color:#ef4444;background:#fef2f2}
.mex8-uoe-option-key{width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#fff7ed;color:#c2410c;font-weight:900;flex-shrink:0}
.mex8-uoe-option-text{font-weight:800;font-size:17px;color:#111827}
.mex8-uoe-answer-line{display:flex;flex-wrap:wrap;gap:14px;margin-top:14px;color:#374151;font-size:14px;font-weight:700}
.mex8-uoe-modal-sentence{font-size:20px;font-weight:800;line-height:1.7}
.mex8-uoe-modal-translation{margin-top:12px;padding:10px 12px;border-radius:14px;background:#fff7ed;border:1px solid #ffedd5;color:#9a3412;font-size:15px;line-height:1.7}
@media (max-width: 900px){
  .mex8-uoe-sentence{font-size:22px}
}


/* Writing */
.mex8-writing-bullets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:22px}
.mex8-writing-bullet{background:#fff;border:1px solid #ffedd5;border-radius:18px;padding:14px 16px;font-weight:700;line-height:1.6;color:#7c2d12}
.mex8-writing-bank{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px}

/* Patterns stage — full-width single-column list like para-blocks */
.mex8-writing-pattern-list{display:flex;flex-direction:column;gap:0;margin-top:18px}
.mex8-writing-pattern-row{width:100%;border:none;border-bottom:1px dashed #ffedd5;background:#fff;padding:16px 18px;display:flex;align-items:flex-start;gap:16px;text-align:left;cursor:pointer;transition:background .2s ease,border-color .2s ease,box-shadow .2s ease;border-radius:0;outline:none;scroll-margin-top:90px}
.mex8-writing-pattern-row:first-child{border-radius:18px 18px 0 0}
.mex8-writing-pattern-row:last-child{border-bottom:none;border-radius:0 0 18px 18px}
.mex8-writing-pattern-row:only-child{border-radius:18px}
.mex8-writing-pattern-row:hover{background:#fffaf5}
.mex8-writing-pattern-row.is-active{background:#fffaf0;border-color:#fdba74;box-shadow:0 0 0 2px rgba(251,146,60,.22),0 10px 24px rgba(249,115,22,.08);border-radius:18px;z-index:1;animation:mex8PulseSoft .7s ease}
.mex8-writing-pattern-body{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}

.mex8-writing-sentence{border:1px solid #fed7aa;background:#fff;border-radius:20px;padding:16px;text-align:left;cursor:pointer;transition:all .2s;outline:none}
.mex8-writing-sentence:hover{background:#fff7ed;box-shadow:0 12px 20px rgba(249,115,22,.08)}
.mex8-writing-sentence.is-active{border-color:#fb923c;background:#fff7ed;box-shadow:0 0 0 3px rgba(251,146,60,.18)}
.mex8-writing-sentence-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.mex8-writing-sentence-category{font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#c2410c}
.mex8-writing-sentence-en{font-size:16px;font-weight:800;color:#111827;line-height:1.6}
.mex8-writing-sentence-pl{font-size:14px;color:#6b7280;line-height:1.6;margin-top:2px}
.mex8-writing-layout{display:grid;grid-template-columns:340px 1fr;gap:20px;margin-top:20px}
.mex8-writing-dropzone{display:flex;flex-direction:column;gap:12px}
.mex8-writing-slot{width:100%;border:2px dashed #fdba74;background:#fffaf5;border-radius:18px;padding:14px 16px;text-align:left;display:flex;flex-direction:column;gap:8px;cursor:pointer;transition:all .18s ease;outline:none}
.mex8-writing-slot:hover{transform:translateY(-1px)}
.mex8-writing-slot.is-correct{border-color:#10b981;background:#ecfdf5;animation:mex8CorrectFlash .45s ease}
.mex8-writing-slot.is-wrong{border-color:#ef4444;background:#fef2f2;animation:mex8WrongFlash .45s ease}
.mex8-writing-slot-text{font-size:15px;font-weight:800;color:#111827;line-height:1.6}
.mex8-writing-step-card{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff7ed;border:1px solid #fed7aa;border-radius:22px;padding:18px 20px;margin-top:16px}
.mex8-writing-step-text{font-size:18px;font-weight:800;line-height:1.5;color:#9a3412}
.mex8-writing-production-list{display:flex;flex-direction:column;gap:14px;margin-top:18px}
.mex8-writing-production-item{background:#fff;border:1px solid #ffedd5;border-radius:22px;padding:18px}
.mex8-writing-production-item.is-correct{border-color:#86efac;background:#f0fdf4}
.mex8-writing-production-item.is-wrong{border-color:#fca5a5;background:#fff7f7}
.mex8-writing-production-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:12px}
.mex8-writing-production-pl{font-size:17px;font-weight:800;color:#9a3412;line-height:1.5}
.mex8-writing-input{width:100%;border:1px solid #fed7aa;border-radius:16px;padding:14px 16px;font-size:16px;font-weight:700;outline:none;background:#fff}
.mex8-writing-input:focus{border-color:#fb923c;box-shadow:0 0 0 4px rgba(251,146,60,.12)}
.mex8-writing-production-actions{display:flex;justify-content:flex-end;margin-top:12px}
.mex8-writing-feedback{margin-top:12px;padding:12px 14px;border-radius:16px;font-weight:700;line-height:1.6}
.mex8-writing-feedback.is-correct{background:#d1fae5;color:#047857}
.mex8-writing-feedback.is-wrong{background:#fee2e2;color:#b91c1c}

/* Result — full-width boxes, stacked EN + PL per line */
.mex8-result-box--wide{max-width:100%}
.mex8-writing-final-mail{display:flex;flex-direction:column;gap:8px}
.mex8-writing-final-line{display:flex;flex-direction:column;gap:3px;padding:14px 16px;border-radius:16px;border:1px solid #ffedd5;background:#fffaf5;line-height:1.6;text-align:left;width:100%;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background .18s ease;outline:none}
.mex8-writing-final-line:hover{transform:translateX(-3px);box-shadow:0 12px 20px rgba(249,115,22,.08)}
.mex8-writing-final-line.is-correct{background:#f0fdf4;border-color:#86efac}
.mex8-writing-final-line.is-wrong{background:#fff7f7;border-color:#fca5a5}
.mex8-writing-final-line.is-active{border-color:#fb923c;box-shadow:0 0 0 3px rgba(251,146,60,.18),0 14px 28px rgba(249,115,22,.10);background:#fffaf0;animation:mex8PulseSoft .7s ease}
.mex8-final-line-label{font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.07em;color:#c2410c;opacity:.7}
.mex8-writing-final-line.is-correct .mex8-final-line-label{color:#047857}
.mex8-writing-final-line.is-wrong .mex8-final-line-label{color:#b91c1c}
.mex8-final-line-en{font-size:16px;font-weight:800;color:#111827;line-height:1.5}
.mex8-final-line-pl{font-size:14px;color:#6b7280;line-height:1.5;margin-top:1px;transition:filter .25s ease,opacity .25s ease}

@media (max-width: 900px){
  .mex8-writing-layout,.mex8-writing-bank,.mex8-writing-bullets{grid-template-columns:1fr}
  .mex8-writing-step-card,.mex8-writing-production-head{flex-direction:column;align-items:flex-start}
}


@keyframes mex8PromptSlideIn{
  from{opacity:0;transform:translateX(34px)}
  to{opacity:1;transform:translateX(0)}
}
@keyframes mex8PlPulse{
  0%{box-shadow:0 0 0 0 rgba(220,38,38,.20)}
  70%{box-shadow:0 0 0 14px rgba(220,38,38,0)}
  100%{box-shadow:0 0 0 0 rgba(220,38,38,0)}
}
.mex8-writing-prompt-ribbon{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:16px;margin-top:18px;padding:16px 18px;border-radius:22px;border:1px solid #fed7aa;background:linear-gradient(135deg,#fff7ed 0%,#fff 100%);animation:mex8PromptSlideIn .35s cubic-bezier(.16,1,.3,1)}
.mex8-writing-prompt-ribbon--compact{margin-bottom:18px}
.mex8-writing-prompt-meta{padding:7px 12px;border-radius:999px;background:#fff;color:#b45309;font-size:12px;font-weight:900;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}
.mex8-pl-audio-btn{min-width:82px;height:82px;border-radius:999px;border:none;background:radial-gradient(circle at 35% 35%,#ef4444,#b91c1c);color:#fff;display:grid;place-items:center;font-weight:900;cursor:pointer;box-shadow:0 14px 28px rgba(220,38,38,.22);animation:mex8PlPulse 1.8s infinite;transition:transform .2s ease, box-shadow .2s ease, background .2s ease;outline:none;padding:0 12px;text-align:center}
.mex8-pl-audio-btn span{display:block;font-size:13px;line-height:1.1;letter-spacing:.02em}
.mex8-pl-audio-btn:hover{transform:translateY(-1px)}
.mex8-pl-audio-btn.is-playing{background:#111827;animation:mex8PlPulse 1.2s infinite;box-shadow:0 14px 30px rgba(17,24,39,.22)}
.mex8-pl-audio-btn--final{min-width:140px;height:54px;padding:0 18px}
.mex8-writing-layout{grid-template-columns:300px 1fr}
.mex8-writing-production-item--single{padding:26px;display:flex;flex-direction:column;gap:14px}
.mex8-writing-production-actions--split{justify-content:space-between;align-items:center;gap:12px}
@media (max-width: 860px){
  .mex8-writing-prompt-ribbon{grid-template-columns:1fr;justify-items:start}
  .mex8-pl-audio-btn{width:72px;height:72px;min-width:72px}
  .mex8-pl-audio-btn--final{width:auto;min-width:132px;height:48px}
  .mex8-writing-production-actions--split{flex-wrap:wrap}
}


/* ── Build stage: progressive email construction ── */
@keyframes mex8BuildRowIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes mex8BuildSlotIn {
  from { opacity: 0; transform: translateX(22px) scale(.97); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.mex8-writing-email-trail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Completed / locked rows — the growing email above the active slot */
.mex8-build-done-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 14px;
  border-radius: 16px;
  background: #fffaf5;
  border: 1px solid #ffedd5;
  border-left: 3px solid #fb923c;
  animation: mex8BuildRowIn .32s cubic-bezier(.16,1,.3,1) both;
}
.mex8-build-done-row.is-correct {
  border-left-color: #10b981;
  background: #f0fdf4;
  border-color: #a7f3d0;
  border-left-color: #10b981;
}
.mex8-build-done-row.is-wrong {
  border-left-color: #ef4444;
  background: #fff7f7;
  border-color: #fca5a5;
  border-left-color: #ef4444;
}
.mex8-build-done-label {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #c2410c;
  opacity: .65;
}
.mex8-build-done-row.is-correct .mex8-build-done-label { color: #047857; }
.mex8-build-done-row.is-wrong  .mex8-build-done-label { color: #b91c1c; }
.mex8-build-done-text {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.5;
}

/* Active slot wrapper — slides in from the right */
.mex8-build-active-slot {
  animation: mex8BuildSlotIn .38s cubic-bezier(.16,1,.3,1) both;
}
.mex8-build-active-slot .mex8-writing-slot {
  border: 2px dashed #fb923c;
  background: #fff7ed;
  box-shadow: 0 0 0 4px rgba(249,115,22,.08), 0 8px 20px rgba(249,115,22,.08);
}
.mex8-build-active-slot .mex8-writing-slot.is-filled {
  border-style: solid;
  border-color: #f97316;
  background: #fff7ed;
  box-shadow: 0 0 0 4px rgba(249,115,22,.12), 0 10px 24px rgba(249,115,22,.10);
}
.mex8-build-active-slot .mex8-writing-slot.is-select-mode {
  border-color: #f97316;
  box-shadow: 0 0 0 5px rgba(249,115,22,.16), 0 12px 28px rgba(249,115,22,.12);
  animation: mex8PulseSoft .7s ease;
}
.mex8-build-active-slot .mex8-gap-id {
  color: #c2410c;
}
.mex8-build-active-slot .mex8-writing-slot.is-empty .mex8-writing-slot-text {
  color: #9ca3af;
  font-style: italic;
  font-weight: 600;
}

@media (max-width: 780px) {
  .mex8-build-done-row { padding: 9px 12px; }
  .mex8-build-done-text { font-size: 14px; }
}
