/* ============================================================
   AEROGYAN — English & speaking (english.js)
   2026-11-02 · studio redesign 2026-11-10. Loaded the first time the
   page (or its admin tab) opens — moved out of styles.css.
   ============================================================ */
.en-wrap { max-width: 1200px; margin: 0 auto; padding: 8px 0 48px; color: var(--text-primary); }
.en2 { --en-ac: var(--brand-600, #4f46e5); --en-grad: linear-gradient(135deg, #6366f1, #06b6d4); --en-ok: #16a34a; --en-bad: #dc2626;
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 22px; align-items: start; }
[data-theme="dark"] .en2, [data-theme="dim"] .en2 { --en-ac: var(--brand-400, #818cf8); }

/* ── side navigation ── */
.en2-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; padding: 14px; border-radius: 20px; background: var(--bg-surface); border: 1px solid var(--border-default); box-shadow: var(--shadow-sm); min-width: 0; }
.en2-brand { display: flex; gap: 10px; align-items: center; padding: 2px 4px; }
.en2-logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--en-grad); font-size: 18px; box-shadow: 0 6px 16px rgba(99,102,241,.35); flex: none; }
.en2-brand b { display: block; font-size: 16px; line-height: 1.1; } .en2-brand small { color: var(--text-secondary); font-size: 13px; }
.en2 .en-tabs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.en2 .en-tabs button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 0; background: none; color: var(--text-secondary); font: inherit; font-weight: 600; cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.en2 .en-tabs button i { width: 18px; text-align: center; }
.en2 .en-tabs button:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.en2 .en-tabs button.on { background: linear-gradient(135deg, #4f46e5, #6366f1); color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.28); }
.en2 .en-tabs button:focus-visible { outline: 2px solid var(--en-ac); outline-offset: 2px; }
.en-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; line-height: 18px; text-align: center; margin-left: auto; }
.en2-side-foot { border-top: 1px solid var(--border-subtle); padding-top: 10px; }
.en-hi-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.en2-main { min-width: 0; }
.en2-top { margin-bottom: 14px; }
.en2-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.en2-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 7px; border-radius: 999px; background: var(--bg-surface); border: 1px solid var(--border-default); font: inherit; color: var(--text-primary); min-height: 38px; }
.en2-chip b { font-size: 15px; } .en2-chip span { font-size: 12px; color: var(--text-secondary); }
button.en2-chip { cursor: pointer; } button.en2-chip:hover { border-color: var(--en-ac); }
.en2-chip.lvl b { background: var(--en-grad); color: #fff; padding: 2px 8px; border-radius: 8px; font-size: 13px; }
.en2-chip > i { color: #f59e0b; margin-left: 4px; }
.en2-chip.fire > i { color: var(--text-tertiary); } .en2-chip.fire.on > i { color: #f97316; }
.en2-chip.goal .val { stroke: #f59e0b; } .en2-chip.goal.met { border-color: #16a34a; } .en2-chip.goal.met .val { stroke: #16a34a; }

/* ── cards and shared bits ── */
.en-card { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; min-width: 0; }
.en-card h3 { margin: 0 0 6px; font-size: 18px; } .en-card h4 { margin: 16px 0 8px; font-size: 15px; } .en-card h3 > i, .en-card h4 > i { color: var(--en-ac, #4f46e5); margin-right: 4px; }
.en-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; } .en-card-head h3 { flex: 1; margin: 0; min-width: 0; }
.en-warn { border-color: #d97706; background: color-mix(in srgb, #d97706 8%, var(--bg-surface)); }
.en-hi { margin: 4px 0 8px; padding: 6px 10px; border-left: 3px solid #d97706; background: color-mix(in srgb, #d97706 8%, transparent); border-radius: 0 8px 8px 0; font-size: 15px; }
.en-hi-inline { color: #b45309; }
.en-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.en-inline select { font: inherit; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); min-width: 0; max-width: 100%; }
.en-start { border-color: #6366f1; background: linear-gradient(160deg, color-mix(in srgb, #6366f1 8%, var(--bg-surface)), var(--bg-surface) 70%); }
.en2-kicker { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--en-ac, #4f46e5); margin: 0 0 6px; }
.en2-bar { flex: 1; height: 12px; border-radius: 999px; background: var(--bg-surface-3); overflow: hidden; min-width: 60px; }
.en2-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #06b6d4); transition: width .4s ease; }
.en2-bar.ok > i { background: #16a34a; } .en2-bar.over > i { background: #f59e0b; }
.en2 kbd { font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border-default); background: var(--bg-surface-2); color: var(--text-secondary); }
.en2 .btn kbd { margin-left: 4px; background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); color: inherit; }
.en2 .btn-outline kbd { background: var(--bg-surface-2); border-color: var(--border-default); }

/* rings */
.en2-ringwrap { position: relative; display: inline-grid; place-items: center; flex: none; }
.en2-ringwrap svg { display: block; }
.en2-ringwrap .trk { stroke: color-mix(in srgb, var(--text-tertiary) 25%, transparent); }
.en2-ringwrap .val { stroke: #6366f1; transition: stroke-dashoffset .7s cubic-bezier(.2,.8,.2,1); }
.en2-ringwrap.ok .val { stroke: #16a34a; }
.en2-ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.en2-ring-in b { font-size: 26px; font-weight: 800; } .en2-ring-in small { font-size: 12px; color: var(--text-secondary); }

/* ── Today ── */
.en2-hero { position: relative; overflow: hidden; display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 24px 26px; border-radius: 24px; color: #fff; margin-bottom: 14px;
  background: radial-gradient(120% 140% at 100% 0%, rgba(6,182,212,.55), transparent 55%), radial-gradient(90% 120% at 0% 100%, rgba(168,85,247,.45), transparent 60%), linear-gradient(135deg, #1e1b4b, #4338ca 55%, #4f46e5);
  box-shadow: 0 18px 40px rgba(67,56,202,.25); }
.en2-hero::after { content: ''; position: absolute; right: 120px; top: -70px; width: 300px; height: 300px; border: 2px dashed rgba(255,255,255,.14); border-radius: 50%; pointer-events: none; }
.en2-hero-l { position: relative; z-index: 1; min-width: 0; }
.en2-hello { margin: 0 0 4px; opacity: .85; font-weight: 600; }
.en2-hero h2 { margin: 0 0 14px; font-size: 26px; line-height: 1.2; color: #fff; }
.en2-week { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.en2-week > span { display: grid; justify-items: center; gap: 4px; }
.en2-week > span > i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); font-size: 12px; font-style: normal; }
.en2-week > span.on > i { background: #f59e0b; color: #1e1b4b; box-shadow: 0 0 0 3px rgba(245,158,11,.25); }
.en2-week > span.today > i { outline: 2px solid #fff; outline-offset: 2px; }
.en2-week small { font-size: 11px; opacity: .8; }
.en2-hero-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.en2 .btn.en2-cta { background: #fff; color: #3730a3; border: 0; font-weight: 700; box-shadow: 0 6px 16px rgba(0,0,0,.18); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.en2 .btn.en2-cta:hover { transform: translateY(-1px); }
.en2 .btn.en2-ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.32); }
.en2-hero-r { position: relative; z-index: 1; display: grid; justify-items: center; gap: 10px; flex: none; }
.en2-hero .trk { stroke: rgba(255,255,255,.18); } .en2-hero .val { stroke: #fbbf24; }
.en2-hero .en2-ring-in small { color: rgba(255,255,255,.8); } .en2-hero .en2-ring-in b { font-size: 34px; }
.en2-streak { padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.14); font-weight: 700; font-size: 14px; } .en2-streak.on i { color: #fb923c; }
.en2-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.en2-grid > .en-card { margin-bottom: 0; }
.en2-plan ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.en2-plan li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); }
.en2-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.en2-ic.c1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); } .en2-ic.c2 { background: linear-gradient(135deg, #f59e0b, #f97316); } .en2-ic.c3 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.en2-ic.c4 { background: linear-gradient(135deg, #10b981, #14b8a6); } .en2-ic.c5 { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.en2-plan-t { flex: 1; min-width: 0; } .en2-plan-t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .en2-plan-t small { color: var(--text-secondary); font-size: 13px; display: block; }
.en2-phrase { background: linear-gradient(160deg, color-mix(in srgb, #f59e0b 10%, var(--bg-surface)), var(--bg-surface) 65%); }
.en2-phrase blockquote { margin: 4px 0 6px; font-size: 22px; font-weight: 700; line-height: 1.3; }
.en2-ph-hi { color: #b45309; margin: 0 0 6px; } .en2-ph-use { color: var(--text-secondary); font-size: 14px; margin: 0 0 10px; } .en2-ph-use i { color: #d97706; }
.en2-heat { display: grid; grid-template-rows: repeat(7, 13px); grid-auto-flow: column; grid-auto-columns: 13px; gap: 3px; margin: 10px 0 6px; overflow-x: auto; padding-bottom: 2px; }
.en2-heat i, .en2-heat-legend i { border-radius: 3px; background: color-mix(in srgb, var(--text-tertiary) 18%, transparent); }
.en2-heat i.pad { background: none; }
.en2-heat i.l1, .en2-heat-legend i.l1 { background: #c7d2fe; } .en2-heat i.l2, .en2-heat-legend i.l2 { background: #818cf8; }
.en2-heat i.l3, .en2-heat-legend i.l3 { background: #6366f1; } .en2-heat i.l4, .en2-heat-legend i.l4 { background: #4338ca; }
.en2-heat-legend { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-secondary); } .en2-heat-legend i { width: 11px; height: 11px; display: inline-block; }
.en2-heat-legend span:first-child { margin-right: 3px; } .en2-heat-legend span:last-child { margin-left: 3px; }
.en2-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.en2-nums div { padding: 10px 6px; border-radius: 12px; background: var(--bg-surface-2); text-align: center; min-width: 0; } .en2-nums b { display: block; font-size: 20px; } .en2-nums small { font-size: 12px; color: var(--text-secondary); }
.en2-badges h3 small { font-weight: 500; color: var(--text-secondary); font-size: 13px; margin-left: 6px; }
.en2-badges ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px 8px; }
.en2-badges li { display: grid; justify-items: center; align-content: start; gap: 5px; text-align: center; font-size: 12px; line-height: 1.25; color: var(--text-secondary); }
.en2-badges li > span { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 19px; background: var(--bg-surface-3); color: var(--text-tertiary); }
.en2-badges li.got > span { background: linear-gradient(135deg, #fbbf24, #f97316); color: #fff; box-shadow: 0 6px 14px rgba(249,115,22,.28); }
.en2-badges li.got small { color: var(--text-primary); font-weight: 600; }
.en2-badges em { display: block; width: 44px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #6366f1 var(--f), var(--bg-surface-3) var(--f)); }
.en2-pop { position: absolute; z-index: 1000; padding: 12px; border-radius: 16px; background: var(--bg-elevated); border: 1px solid var(--border-default); box-shadow: var(--shadow-lg); display: grid; gap: 6px; color: var(--text-primary); }
.en2-pop p { margin: 0 0 4px; font-size: 13px; color: var(--text-secondary); }
.en2-pop button { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: inherit; font: inherit; cursor: pointer; text-align: left; }
.en2-pop button:hover, .en2-pop button.on { border-color: #6366f1; } .en2-pop button.on { background: color-mix(in srgb, #6366f1 10%, var(--bg-surface)); }
.en2-pop button small { display: block; color: var(--text-secondary); font-size: 12px; } .en2-pop em { font-style: normal; font-weight: 700; color: #6366f1; }

/* ── Learn: the route ── */
.en2-route { display: flex; align-items: center; gap: 4px; padding: 14px 16px; overflow-x: auto; }
.en2-leg { display: grid; justify-items: center; gap: 2px; flex: none; min-width: 62px; font-size: 12px; color: var(--text-secondary); }
.en2-leg-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--bg-surface-3); color: var(--text-secondary); border: 2px solid var(--border-default); }
.en2-leg.done .en2-leg-dot { background: #16a34a; color: #fff; border-color: #16a34a; }
.en2-leg.cur .en2-leg-dot { background: var(--en-grad); color: #fff; border-color: transparent; box-shadow: 0 0 0 5px rgba(99,102,241,.18); }
.en2-leg b { color: var(--text-primary); }
.en2-leg-line { flex: 1 1 24px; min-width: 16px; height: 0; border-top: 2px dashed var(--border-strong); margin-bottom: 30px; }
.en-levels { display: grid; gap: 10px; margin-bottom: 10px; }
.en-level { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 18px; overflow: hidden; }
.en-level.cur { border-color: #6366f1; }
.en-level-head { width: 100%; display: grid; grid-template-columns: auto 1fr 120px auto auto; align-items: center; gap: 12px; padding: 12px 16px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.en-code { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bg-surface-3); font-weight: 800; color: var(--en-ac, #4f46e5); }
.en-level.cur .en-code { background: var(--en-grad); color: #fff; }
.en-code.sm { width: auto; height: auto; padding: 2px 8px; border-radius: 8px; font-size: 12px; }
.en-lname b { font-size: 16px; } .en-lname em { font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #4f46e5; color: #fff; margin-left: 4px; vertical-align: 2px; }
.en-lname small { display: block; color: var(--text-secondary); font-size: 13px; }
.en-meter { height: 8px; border-radius: 4px; background: var(--bg-surface-3); overflow: hidden; } .en-meter i { display: block; height: 100%; background: #16a34a; }
.en-count { font-size: 13px; color: var(--text-secondary); } .en-chev { transition: transform .2s; color: var(--text-secondary); } .en-level.open .en-chev { transform: rotate(180deg); }
.en-level-body { padding: 0 16px 14px; }
.en2-path { list-style: none; margin: 6px 0 12px; padding: 0; position: relative; display: grid; gap: 10px; }
.en2-path::before { content: ''; position: absolute; left: 21px; top: 22px; bottom: 22px; border-left: 3px dashed var(--border-strong); }
.en2-wp { display: flex; align-items: center; gap: 12px; position: relative; }
.en2-wp-dot { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; background: var(--bg-surface); border: 3px solid var(--border-strong); color: var(--text-secondary); z-index: 1; }
.en2-wp.done .en2-wp-dot { background: #16a34a; border-color: #16a34a; color: #fff; }
.en2-wp.next .en2-wp-dot { background: var(--en-grad); border-color: transparent; color: #fff; animation: en2-glow 2.2s infinite; }
@keyframes en2-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,.45); } 60% { box-shadow: 0 0 0 10px rgba(99,102,241,0); } }
.en2-wp-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border-default); background: var(--bg-surface); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.en2-wp-card:hover { border-color: #6366f1; transform: translateX(3px); box-shadow: var(--shadow-sm); }
.en2-wp.next .en2-wp-card { border-color: #6366f1; background: color-mix(in srgb, #6366f1 6%, var(--bg-surface)); }
.en2-wp-t { flex: 1; min-width: 0; } .en2-wp-t b { display: block; } .en2-wp-t small { color: var(--text-secondary); font-size: 13px; }
.en2-wp-meta { display: flex; align-items: center; gap: 8px; color: var(--text-tertiary); flex: none; }
.en2-best { font-size: 13px; padding: 2px 8px; border-radius: 999px; background: var(--bg-surface-3); color: var(--text-secondary); }
.en2-best.ok { background: color-mix(in srgb, #16a34a 15%, transparent); color: #15803d; }
.en2-go { font-size: 13px; font-weight: 700; color: #fff; background: #4f46e5; padding: 3px 10px; border-radius: 999px; }

/* ── the lesson player ── */
.en2-player { max-width: 780px; margin: 0 auto; }
.en2-pl-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.en2-pl-top .en-x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-default); background: var(--bg-surface); display: grid; place-items: center; padding: 0; flex: none; }
.en2-combo { font-weight: 800; color: #f97316; white-space: nowrap; animation: en2-pop .3s; }
@keyframes en2-pop { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.en2-pl-card { padding: 22px 24px; min-height: 260px; margin-bottom: 0; border-radius: 22px 22px 0 0; }
.en2-pl-card h3 { font-size: 22px; margin: 2px 0 6px; }
.en2-rules { margin: 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 8px; }
.en2-rules li { counter-increment: r; display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg-surface-2); line-height: 1.5; }
.en2-rules li::before { content: counter(r); width: 24px; height: 24px; flex: none; border-radius: 50%; background: #4f46e5; color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.en2-pl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border: 1px solid var(--border-default); border-top: 0; border-radius: 0 0 22px 22px; background: var(--bg-surface-2); position: sticky; bottom: 0; z-index: 3; }
.en2-pl-foot.ok { background: color-mix(in srgb, #16a34a 14%, var(--bg-surface)); border-color: #16a34a; }
.en2-pl-foot.bad { background: color-mix(in srgb, #dc2626 10%, var(--bg-surface)); border-color: #dc2626; }
.en2-pl-foot.end { justify-content: center; }
.en2-fb { display: grid; gap: 2px; min-width: 0; flex: 1; }
.en2-fb b { font-size: 17px; } .en2-pl-foot.ok .en2-fb b { color: #15803d; } .en2-pl-foot.bad .en2-fb b { color: #b91c1c; }
.en2-fb .en-answer, .en2-fb .en-why { margin: 0; }
.en2-pl-card .en-ex { border: 0; padding: 0; background: none; }
.en2-pl-card .en-q { font-size: 19px; }
.en2-pl-card .en-opts { display: grid; gap: 8px; }
.en2-pl-card .en-opts label { position: relative; padding: 12px 14px; border-width: 2px; font-size: 16px; display: flex; align-items: center; gap: 10px; transition: border-color .15s, background .15s; }
.en2-pl-card .en-opts label:hover { border-color: #6366f1; }
.en2-pl-card .en-opts input { position: absolute; opacity: 0; pointer-events: none; }
.en2-pl-card .en-opts label:focus-within { outline: 2px solid #6366f1; outline-offset: 2px; }
.en2-pl-card .en-fixin, .en2-pl-card .en-fill input { font-size: 17px; }
.en2-pl-card .en-chip { font-size: 16px; padding: 8px 14px; }
.en2-done { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 6px 0; }
.en2-done h3 { margin: 6px 0 0; font-size: 22px; }
.en2-recap { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.en2-recap li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--bg-surface-2); font-size: 14px; }
.en2-recap li.ok > i { color: #16a34a; margin-top: 3px; } .en2-recap li.bad > i { color: #dc2626; margin-top: 3px; } .en2-recap small { display: block; color: #15803d; }

/* lessons: rule, examples, sentences, exercises */
.en-goal { color: var(--text-secondary); margin: 0 0 6px; }
.en-examples, .en-sayit, .en-phrases { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.en-examples li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--bg-surface-2); } .en-examples small { display: block; color: #b45309; font-size: 14px; }
.en-say { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-default); background: var(--bg-elevated); color: #6366f1; cursor: pointer; display: inline-grid; place-items: center; vertical-align: middle; }
.en-say:hover { border-color: #6366f1; background: color-mix(in srgb, #6366f1 10%, var(--bg-elevated)); }
.en-mic { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--en-grad, #4f46e5); color: #fff; cursor: pointer; display: inline-grid; place-items: center; }
.en-mic.big { width: 46px; height: 46px; font-size: 18px; } .en-mic:disabled { opacity: .45; cursor: not-allowed; }
.en-mic.live { background: #dc2626; animation: en-pulse 1.2s infinite; }
@keyframes en-pulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 70% { box-shadow: 0 0 0 10px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
.en-sent { border: 1px solid var(--border-default); border-radius: 14px; padding: 8px 10px; background: var(--bg-surface); transition: border-color .2s; }
.en-sent.cleared { border-color: #16a34a; background: color-mix(in srgb, #16a34a 5%, var(--bg-surface)); }
.en-sent-line { display: flex; align-items: center; gap: 10px; } .en-sent-text { flex: 1; min-width: 0; font-size: 16px; }
.en-sent-out:empty { display: none; } .en-sent-out { margin-top: 8px; }
.en-listening { color: #dc2626; font-size: 14px; } .en-listening i { font-size: 9px; vertical-align: 2px; }
.en-sent-score { font-size: 14px; } .en-sent-score b { font-size: 18px; margin-right: 4px; }
.en-sent-score.ok b { color: #16a34a; } .en-sent-score.mid b { color: #d97706; } .en-sent-score.bad { color: #dc2626; }
.en-marked { margin: 4px 0; font-size: 16px; } .en-marked .hit { color: #16a34a; } .en-marked .miss { color: #dc2626; text-decoration: underline wavy; }
.en-heard { color: var(--text-secondary); }
.en-exs { padding-left: 1.4em; display: grid; gap: 12px; margin: 8px 0; }
.en-ex { padding: 10px 12px; border: 1px solid var(--border-default); border-radius: 12px; }
.en-ex.ok { border-color: #16a34a; background: color-mix(in srgb, #16a34a 6%, transparent); } .en-ex.bad { border-color: #dc2626; background: color-mix(in srgb, #dc2626 5%, transparent); }
.en-q { font-weight: 600; margin-bottom: 10px; line-height: 2; }
.en-fill input { font: inherit; width: 9em; max-width: 100%; margin: 0 4px; padding: 2px 8px; border: 0; border-bottom: 2px solid #6366f1; background: var(--bg-surface-2); color: var(--text-primary); border-radius: 6px 6px 0 0; }
.en-fixin { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--border-default); border-radius: 10px; background: var(--bg-surface); color: var(--text-primary); }
.en-wrongline { color: #dc2626; text-decoration-color: rgba(220,38,38,.5); font-weight: 500; }
.en-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--bg-surface-3); font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-right: 4px; line-height: 1.6; }
.en-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.en-opts label { padding: 7px 12px; border: 1px solid var(--border-default); border-radius: 12px; cursor: pointer; }
.en-opts label input { margin-right: 6px; }
.en-opts label.on { border-color: #6366f1; background: color-mix(in srgb, #6366f1 10%, transparent); }
.en-opts label.right { border-color: #16a34a; background: color-mix(in srgb, #16a34a 14%, transparent); } .en-opts label.wrong { border-color: #dc2626; background: color-mix(in srgb, #dc2626 12%, transparent); }
.en-orderline { min-height: 50px; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 2px dashed var(--border-default); border-radius: 12px; margin-bottom: 10px; align-items: center; }
.en-ph { color: var(--text-secondary); font-size: 13px; }
.en-chips, .en-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.en-chip { font: inherit; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); cursor: pointer; transition: border-color .15s, transform .1s; }
.en-chip:hover:not(:disabled) { border-color: #6366f1; } .en-chip:active:not(:disabled) { transform: scale(.96); }
.en-chip.on { border-color: #6366f1; background: color-mix(in srgb, #6366f1 12%, transparent); }
.en-chip:disabled { opacity: .35; cursor: default; }
.en-answer, .en-why { font-size: 14px; margin-top: 6px; } .en-why { color: var(--text-secondary); }
.en-score { font-weight: 700; font-size: 17px; } .en-score.ok { color: #16a34a; } .en-score.bad { color: #dc2626; }
.en2-test .en2-bar { margin: 4px 0 8px; height: 8px; }

/* ── Read ── */
.en-passages { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.en-passage { --lvc: #6366f1; text-align: left; display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border-default); border-top: 4px solid var(--lvc); background: var(--bg-surface); color: inherit; font: inherit; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.en-passage.lv1 { --lvc: #10b981; } .en-passage.lv2 { --lvc: #06b6d4; } .en-passage.lv3 { --lvc: #6366f1; } .en-passage.lv4 { --lvc: #a855f7; } .en-passage.lv5 { --lvc: #f43f5e; }
.en-passage:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); } .en-passage small { color: var(--text-secondary); font-size: 13px; } .en-passage.read small { color: #16a34a; }
.en2-pc-top { display: flex; justify-content: space-between; align-items: center; } .en2-pc-top i { color: #16a34a; }
h4.en-mine em { font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #4f46e5; color: #fff; }
.en2-readbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border-radius: 14px; background: var(--bg-surface-2); margin: 4px 0 10px; position: sticky; top: 76px; z-index: 4; }
.en2-fontbtns { margin-left: auto; display: inline-flex; gap: 4px; }
.en-text { font-size: 18px; line-height: 1.95; margin: 8px 0 12px; }
.en-w { cursor: pointer; border-radius: 4px; padding: 0 1px; transition: background .12s; }
.en-w:hover, .en-w:focus { background: color-mix(in srgb, #6366f1 14%, transparent); outline: none; }
.en-w.g { text-decoration: underline dotted #6366f1; text-underline-offset: 4px; }
.en-w.mine { background: color-mix(in srgb, #d97706 18%, transparent); }
.en-w.sel { background: #4f46e5; color: #fff; }
.en-w.speaking { background: #fde68a; color: #1e1b4b; box-shadow: 0 0 0 2px #fde68a; }
.en-w.demo { cursor: default; }
.en-wordcard { position: sticky; bottom: 12px; z-index: 5; background: var(--bg-elevated); border: 1px solid #6366f1; border-radius: 16px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); margin-bottom: 10px; }
.en-wordcard p { margin: 4px 0; }
.en-wc-head { display: flex; align-items: center; gap: 8px; } .en-wc-head b { font-size: 20px; } .en-wc-head small { color: var(--text-secondary); font-style: italic; }
.en-wc-head .en-x { margin-left: auto; }
.en-x { border: 0; background: none; color: var(--text-secondary); cursor: pointer; padding: 6px 8px; border-radius: 8px; font-size: 16px; } .en-x:hover { color: #dc2626; background: var(--bg-surface-2); }
.en-ex-line { color: var(--text-secondary); font-style: italic; }
.en2-shadow { counter-reset: s; }

/* ── My words ── */
.en2-strength { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 10px 0 6px; }
.en2-strength .b1, .en2-strength-legend .b1 { background: #ef4444; } .en2-strength .b2, .en2-strength-legend .b2 { background: #f59e0b; }
.en2-strength .b3, .en2-strength-legend .b3 { background: #eab308; } .en2-strength .b4, .en2-strength-legend .b4 { background: #22c55e; }
.en2-strength .b5, .en2-strength-legend .b5 { background: #15803d; }
.en2-strength-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.en2-strength-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 4px; vertical-align: -1px; }
.en-addword { display: flex; gap: 8px; margin: 12px 0 2px; flex-wrap: wrap; }
.en-addword input, .en2-wtools input { flex: 1 1 200px; min-width: 0; font: inherit; padding: 8px 12px; border: 1px solid var(--border-default); border-radius: 10px; background: var(--bg-surface); color: var(--text-primary); }
.en2-wtools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.en-wordlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.en-wordlist.en2-wgrid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.en-wordlist li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-surface); }
.en-wordlist li[hidden] { display: none; }
.en-wordlist li > div { flex: 1; min-width: 0; } .en-wordlist small { display: block; color: var(--text-secondary); }
.en-box { display: inline-flex; gap: 3px; } .en-box i { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-surface-3); border: 1px solid var(--border-default); } .en-box i.on { background: #16a34a; border-color: #16a34a; }
.en-flash { text-align: center; } .en-flash .en-card-head { justify-content: space-between; } .en-flash .rv-actions { justify-content: center; }
.en-flash-word { font-size: 36px; font-weight: 800; margin: 0; } .en-flash-mean { font-size: 19px; margin: 4px 0; }
.en2-flip { perspective: 1200px; max-width: 460px; height: 240px; margin: 14px auto 8px; cursor: pointer; outline: none; }
.en2-flip:focus-visible .en2-face { outline: 3px solid #6366f1; outline-offset: 3px; }
.en2-flip-in { position: relative; width: 100%; height: 100%; transition: transform .55s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.en2-flip.flipped .en2-flip-in { transform: rotateY(180deg); }
.en2-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 18px; text-align: center; box-shadow: var(--shadow-md); }
.en2-face.front { background: linear-gradient(135deg, #4f46e5, #06b6d4); color: #fff; } .en2-face.front .en-flash-word { color: #fff; } .en2-face.front small { opacity: .85; }
.en2-face.back { background: var(--bg-surface); border: 1px solid var(--border-default); transform: rotateY(180deg); overflow: auto; }
.en2-flash-sm { font-weight: 800; color: #6366f1; font-size: 18px; }
.en2-flash-say { text-align: center; margin-bottom: 4px; }
.en2-quiz-q { font-size: 24px; font-weight: 800; text-align: center; margin: 10px 0 16px; display: flex; justify-content: center; gap: 8px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.en2-quiz-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.en2-quiz-opts button, .en2-sopts button { font: inherit; padding: 14px; border-radius: 14px; border: 2px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); cursor: pointer; text-align: left; display: flex; gap: 8px; align-items: center; transition: border-color .15s, transform .1s, background .15s; overflow-wrap: anywhere; }
.en2-quiz-opts button:hover:not(:disabled), .en2-sopts button:hover:not(:disabled) { border-color: #6366f1; transform: translateY(-1px); }
.en2-quiz-opts button.right, .en2-sopts button.right { border-color: #16a34a; background: color-mix(in srgb, #16a34a 14%, var(--bg-surface)); }
.en2-quiz-opts button.wrong, .en2-sopts button.wrong { border-color: #dc2626; background: color-mix(in srgb, #dc2626 10%, var(--bg-surface)); }
.en2-quiz-opts button:disabled, .en2-sopts button:disabled { cursor: default; }
.en2-quiz .rv-actions { margin-top: 12px; }

/* ── Speak ── */
.en2-subnav { display: flex; gap: 4px; padding: 5px; border-radius: 14px; background: var(--bg-surface-3); margin-bottom: 14px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.en2-subnav::-webkit-scrollbar { display: none; }
.en2-subnav button { font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 10px; border: 0; background: none; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.en2-subnav button.on { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); } .en2-subnav button.on i { color: #6366f1; }
.en2-sounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; }
.en2-snd, .en-scen-card { --sc: linear-gradient(90deg, #6366f1, #8b5cf6); }
.en2 .s1 { --sc: linear-gradient(135deg, #06b6d4, #3b82f6); } .en2 .s2 { --sc: linear-gradient(135deg, #f59e0b, #f97316); } .en2 .s3 { --sc: linear-gradient(135deg, #10b981, #14b8a6); }
.en2 .s4 { --sc: linear-gradient(135deg, #ec4899, #f43f5e); } .en2 .s5 { --sc: linear-gradient(135deg, #a855f7, #6366f1); }
.en2-snd { display: grid; gap: 6px; text-align: left; padding: 16px 14px 14px; border-radius: 16px; border: 1px solid var(--border-default); background: var(--bg-surface); color: inherit; font: inherit; cursor: pointer; position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.en2-snd::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--sc); }
.en2-snd:hover { border-color: #6366f1; transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.en2-snd-pair { font-size: 21px; font-weight: 800; }
.en2-snd-bar { height: 6px; border-radius: 999px; background: var(--bg-surface-3); overflow: hidden; } .en2-snd-bar i { display: block; height: 100%; background: #16a34a; }
.en2-snd small { color: var(--text-secondary); }
.en2-tip { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, #f59e0b 10%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #f59e0b 40%, transparent); margin: 6px 0; }
.en2-tip > i { color: #d97706; font-size: 18px; margin-top: 2px; } .en2-tip p { margin: 0 0 4px; } .en2-tip .en-hi { margin: 4px 0 0; }
.en2-pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.en2-pair { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: var(--bg-surface-2); } .en2-pair > span { color: var(--text-tertiary); font-size: 12px; }
.en2-pw { flex: 1; min-width: 0; font: inherit; font-weight: 700; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary); cursor: pointer; display: flex; gap: 6px; align-items: center; justify-content: center; }
.en2-pw i { color: #6366f1; font-size: 13px; } .en2-pw:hover { border-color: #6366f1; }
.en2-smodes { margin-top: 14px; }
.en2-sgame { margin-top: 14px; padding: 18px 16px; border-radius: 18px; background: var(--bg-surface-2); text-align: center; display: grid; gap: 10px; justify-items: center; }
.en2-sgame > .en2-bar { width: 100%; flex: none; }
.en2-sgame p { margin: 0; } .en2-sgame .en2-kicker { margin: 0; }
.en2-play { width: 84px; height: 84px; border-radius: 50%; border: 0; color: #fff; font-size: 28px; cursor: pointer; background: var(--en-grad); box-shadow: 0 10px 26px rgba(99,102,241,.35); transition: transform .1s; } .en2-play:active { transform: scale(.95); }
.en2-sopts { display: grid; grid-template-columns: repeat(2, minmax(0, 170px)); gap: 10px; } .en2-sopts button { justify-content: center; font-size: 21px; font-weight: 800; }
.en2-sword { font-size: 42px; font-weight: 800; display: flex; gap: 10px; align-items: center; }
.en2-sout { min-height: 24px; }
.en2-sgame .rv-actions { justify-content: center; }
.en-talkbox { margin-top: 12px; }
.en2-topic { display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--bg-surface-2); font-weight: 600; margin-bottom: 10px; } .en2-topic i { color: #6366f1; }
.en2-livebar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.en2-ringwrap.timer .val { stroke: #dc2626; } .en2-ringwrap.timer b { font-size: 18px; }
.en2-livestats { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; } .en2-livestats span { font-size: 13px; color: var(--text-secondary); } .en2-livestats b { display: block; font-size: 22px; color: var(--text-primary); }
.en-live { min-height: 90px; padding: 10px 12px; border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-surface-2); font-size: 16px; line-height: 1.6; margin-bottom: 10px; overflow-wrap: anywhere; }
.en-live i { color: var(--text-secondary); }
.en2-chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.en2-chart .band { fill: color-mix(in srgb, #16a34a 12%, transparent); } .en2-chart .lbl { font-size: 11px; fill: #15803d; }
.en2-chart .line { fill: none; stroke: #6366f1; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.en2-chart .dot { fill: #6366f1; stroke: var(--bg-surface); stroke-width: 2; } .en2-chart .fbar { fill: #f59e0b; opacity: .8; } .en2-chart .axis { stroke: var(--border-default); }
.en2-key { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: 3px; } .en2-key.line { background: #6366f1; } .en2-key.fbar { background: #f59e0b; height: 8px; width: 8px; vertical-align: 0; }

/* ── Talk ── */
.en-scen { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.en-scen-card, .en-prompt, .en-own { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px; border: 1px solid var(--border-default); background: var(--bg-surface); color: inherit; font: inherit; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.en-scen-card:hover:not(:disabled), .en-prompt:hover:not(:disabled), .en-own:hover:not(:disabled) { border-color: #6366f1; transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.en-scen-card:disabled, .en-prompt:disabled, .en-own:disabled { opacity: .55; cursor: not-allowed; }
.en-scen-card small, .en-prompt small, .en-own small { color: var(--text-secondary); font-size: 13px; }
.en-scen-card em, .en-prompt em { font-style: normal; font-size: 12px; color: var(--text-secondary); margin-top: auto; }
.en2-scen-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: var(--sc, var(--en-grad)); font-size: 18px; margin-bottom: 4px; flex: none; }
.en2-scen-ic.sm { width: 34px; height: 34px; font-size: 15px; margin: 0; background: var(--en-grad); }
.en2-fit { display: inline-block; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, #16a34a 15%, transparent); color: #15803d; font-weight: 700; margin-right: 4px; }
.en2-hist { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.en2-hist li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 12px; background: var(--bg-surface-2); }
.en2-hist li small { color: var(--text-secondary); margin-left: auto; }
.en2-scorechip { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bg-surface-3); white-space: nowrap; }
.en2-scorechip.ok { background: color-mix(in srgb, #16a34a 15%, transparent); color: #15803d; } .en2-scorechip.mid { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #b45309; }
.en2-scorechip.bad { background: color-mix(in srgb, #dc2626 14%, transparent); color: #b91c1c; } .en2-scorechip.live { background: color-mix(in srgb, #6366f1 15%, transparent); color: #4338ca; }
.rv-pill.bad { color: #b91c1c; }
.en2-turns { display: inline-flex; gap: 3px; } .en2-turns i { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-surface-3); border: 1px solid var(--border-default); } .en2-turns i.on { background: #6366f1; border-color: #6366f1; }
.en-chat { display: flex; flex-direction: column; gap: 10px; max-height: 500px; overflow-y: auto; padding: 12px; margin-bottom: 10px; border-radius: 16px; background: var(--bg-surface-2); }
.en-msg { display: flex; flex-direction: column; max-width: 85%; } .en-msg.me { align-self: flex-end; align-items: flex-end; }
.en-msg.ai { flex-direction: row; align-items: flex-end; gap: 8px; }
.en2-av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--en-grad); color: #fff; font-size: 12px; }
.en-bubble { padding: 10px 13px; border-radius: 16px; background: var(--bg-surface); white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; }
.en-msg.ai .en-bubble { border: 1px solid var(--border-subtle); border-bottom-left-radius: 4px; }
.en-msg.me .en-bubble { background: linear-gradient(135deg, #4f46e5, #6366f1); color: #fff; border-bottom-right-radius: 4px; }
.en-bubble .en-say { width: 26px; height: 26px; font-size: 11px; margin-left: 4px; }
.en-fix { margin-top: 4px; padding: 8px 10px; border-radius: 12px; border: 1px solid #d97706; background: color-mix(in srgb, #d97706 8%, var(--bg-surface)); font-size: 14px; max-width: 100%; }
.en-fix i.fa-wand-magic-sparkles { color: #d97706; } .en-fix small { display: block; color: var(--text-secondary); margin-top: 2px; } .en-fix .en-say { width: 24px; height: 24px; font-size: 10px; }
.en-ok { font-size: 12px; color: #16a34a; margin-top: 2px; }
.en-hint { font: inherit; font-size: 14px; border: 1px dashed #6366f1; background: none; color: var(--text-primary); border-radius: 10px; padding: 6px 10px; cursor: pointer; margin-bottom: 8px; text-align: left; max-width: 100%; }
.en-hint i { color: #d97706; }
.en-send { display: flex; gap: 8px; align-items: flex-end; }
.en-send textarea { flex: 1; min-width: 0; font: inherit; padding: 9px 12px; border: 1px solid var(--border-default); border-radius: 12px; background: var(--bg-surface); color: var(--text-primary); resize: vertical; }
.en-feedback { border-top: 1px solid var(--border-default); margin-top: 12px; padding-top: 12px; }
.en2-fbtop { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; } .en2-fbtop .pp-dims { flex: 1; min-width: 220px; }
.en-mistakes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.en-mistakes li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-default); }
.en-mistakes s { color: #dc2626; } .en-mistakes b { color: #16a34a; font-weight: 600; } .en-mistakes small { color: var(--text-secondary); }
.en-phrases li { display: flex; align-items: center; gap: 8px; }
.en2-call { display: grid; justify-items: center; gap: 8px; padding: 20px 16px; margin-bottom: 12px; border-radius: 20px; color: #fff; text-align: center;
  background: radial-gradient(circle at 50% 25%, rgba(99,102,241,.35), transparent 60%), linear-gradient(135deg, #1e1b4b, #312e81); }
.en2-orb { position: relative; width: 96px; height: 96px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-size: 30px; background: var(--en-grad); box-shadow: 0 10px 30px rgba(6,182,212,.35); transition: background .3s; }
.en2-orb-ring { position: absolute; inset: -8px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); opacity: 0; }
.en2-call.listening .en2-orb { background: linear-gradient(135deg, #ef4444, #f97316); box-shadow: 0 10px 30px rgba(239,68,68,.4); }
.en2-call.listening .en2-orb-ring { animation: en2-ring 1.4s infinite; border-color: rgba(248,113,113,.7); }
.en2-call.speaking .en2-orb-ring { animation: en2-ring 1.8s infinite; }
.en2-call.thinking .en2-orb { animation: en2-breathe 1.2s infinite; }
@keyframes en2-ring { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes en2-breathe { 50% { transform: scale(.93); } }
.en2-call-st { margin: 0; font-weight: 700; } .en2-call-tx { margin: 0; min-height: 1.4em; opacity: .85; max-width: 520px; overflow-wrap: anywhere; }
.en2-call .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }

/* ── Write ── */
.en-own { flex-direction: row; align-items: center; gap: 12px; width: 100%; margin: 8px 0 12px; background: linear-gradient(135deg, color-mix(in srgb, #6366f1 8%, var(--bg-surface)), var(--bg-surface)); }
.en-own > i:first-child { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; color: #fff; background: var(--en-grad); flex: none; }
.en-own > i:last-child { margin-left: auto; color: var(--text-tertiary); } .en-own span { display: grid; min-width: 0; }
.en-prompts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; } .en-prompt .en-code { align-self: flex-start; }
.en-task { padding: 10px 12px; border-radius: 12px; background: var(--bg-surface-2); margin: 0 0 10px; } .en-task em { color: var(--text-secondary); font-style: normal; }
.en-field { display: grid; gap: 4px; font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.en-field input { font: inherit; font-weight: 400; padding: 9px 12px; border: 1px solid var(--border-default); border-radius: 10px; background: var(--bg-surface); color: var(--text-primary); }
.en-editor { width: 100%; font: inherit; font-size: 16px; line-height: 1.7; padding: 12px 14px; border: 1px solid var(--border-default); border-radius: 14px; background: var(--bg-surface); color: var(--text-primary); resize: vertical; }
.en-editor:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px color-mix(in srgb, #6366f1 20%, transparent); }
.en2-write { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; margin-bottom: 14px; }
.en2-write > .en-card { margin-bottom: 0; }
.en2-check { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; }
.en2-check h4 { margin: 0 0 10px; } .en2-check h4 small { font-weight: 500; color: var(--text-secondary); font-size: 12px; margin-left: 4px; }
.en2-qstats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.en2-qstats span { padding: 6px 8px; border-radius: 10px; background: var(--bg-surface-2); font-size: 12px; color: var(--text-secondary); } .en2-qstats b { display: block; font-size: 17px; color: var(--text-primary); }
.en2-qissues { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.en2-qissues li { padding: 8px 10px; border-radius: 10px; border-left: 3px solid #dc2626; background: var(--bg-surface-2); display: grid; gap: 4px; font-size: 14px; overflow-wrap: anywhere; }
.en2-qissues li.style { border-left-color: #f59e0b; } .en2-qissues s { color: #dc2626; } .en2-qissues b { color: #15803d; } .en2-qissues i { font-size: 11px; color: var(--text-tertiary); }
.en2-qissues small { color: var(--text-secondary); } .en2-qissues .btn { justify-self: start; }
.en2-qok { color: #15803d; font-weight: 600; }
.en2-wgoal { display: flex; align-items: center; gap: 10px; margin: 8px 0; } .en2-wgoal .en2-bar { height: 8px; } .en2-wgoal small { color: var(--text-secondary); white-space: nowrap; }
.en2-pbank { margin: 10px 0; padding: 8px 12px; border-radius: 12px; background: var(--bg-surface-2); } .en2-pbank summary { cursor: pointer; font-weight: 600; } .en2-pbank summary i { color: #6366f1; }
.en2-pb-g { display: grid; grid-template-columns: 80px 1fr; gap: 8px; margin-top: 8px; align-items: start; } .en2-pb-g b { font-size: 13px; color: var(--text-secondary); padding-top: 6px; }
.en2-pb-g > div { display: flex; flex-wrap: wrap; gap: 6px; } .en2-pb-g .en-chip { font-size: 13px; padding: 4px 10px; }
.en-scoreline { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; } .en-scoreline > div { flex: 1; min-width: 200px; } .en-scoreline p { margin: 6px 0 0; }
.en-diff { line-height: 1.95; font-size: 16px; padding: 12px 14px; border-radius: 14px; background: var(--bg-surface-2); overflow-wrap: anywhere; }
.en-diff del { color: #dc2626; text-decoration-thickness: 2px; } .en-diff ins { color: #15803d; text-decoration: none; background: color-mix(in srgb, #16a34a 16%, transparent); border-radius: 4px; padding: 0 2px; }
.en-clean { white-space: pre-line; padding: 8px 12px; border-left: 3px solid #16a34a; }
.en-report details { margin: 10px 0; } .en-report summary { cursor: pointer; font-weight: 600; }
.en-better { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; } .en-better li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .en-better span { color: var(--text-secondary); } .en-better i { color: var(--text-secondary); font-size: 12px; }
.en-bylevel { display: flex; flex-wrap: wrap; gap: 8px; } .en-bylevel span { padding: 4px 10px; border-radius: 999px; background: var(--bg-surface-2); font-size: 13px; }

/* grid lists never grow wider than their card (an item with one-line text would push the page sideways on a phone) */
.en-levels, .en2-path, .en2-recap, .en-examples, .en-sayit, .en-phrases, .en-mistakes, .en2-hist, .en2-qissues, .en2-rules { grid-template-columns: minmax(0, 1fr); }
.en2-plan li, .en2-wp, .en2-hist li { min-width: 0; }

/* confetti */
.en2-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 3000; overflow: hidden; }
.en2-confetti i { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; animation: en2-fall 2.2s cubic-bezier(.2,.6,.4,1) forwards; }
@keyframes en2-fall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: .9; } }

/* dark themes */
[data-theme="dark"] .en2-heat i.l1, [data-theme="dark"] .en2-heat-legend i.l1, [data-theme="dim"] .en2-heat i.l1, [data-theme="dim"] .en2-heat-legend i.l1 { background: #312e81; }
[data-theme="dark"] .en2-heat i.l2, [data-theme="dark"] .en2-heat-legend i.l2, [data-theme="dim"] .en2-heat i.l2, [data-theme="dim"] .en2-heat-legend i.l2 { background: #4338ca; }
[data-theme="dark"] .en2-heat i.l4, [data-theme="dark"] .en2-heat-legend i.l4, [data-theme="dim"] .en2-heat i.l4, [data-theme="dim"] .en2-heat-legend i.l4 { background: #a5b4fc; }
[data-theme="dark"] .en-hi-inline, [data-theme="dark"] .en2-ph-hi, [data-theme="dark"] .en-examples small,
[data-theme="dim"] .en-hi-inline, [data-theme="dim"] .en2-ph-hi, [data-theme="dim"] .en-examples small { color: #fbbf24; }
[data-theme="dark"] .en2-best.ok, [data-theme="dark"] .en2-fit, [data-theme="dark"] .en2-scorechip.ok, [data-theme="dark"] .en2-recap small, [data-theme="dark"] .en2-qissues b, [data-theme="dark"] .en2-qok, [data-theme="dark"] .en-diff ins,
[data-theme="dim"] .en2-best.ok, [data-theme="dim"] .en2-fit, [data-theme="dim"] .en2-scorechip.ok, [data-theme="dim"] .en2-recap small, [data-theme="dim"] .en2-qissues b, [data-theme="dim"] .en2-qok, [data-theme="dim"] .en-diff ins { color: #4ade80; }
[data-theme="dark"] .en2-scorechip.mid, [data-theme="dim"] .en2-scorechip.mid { color: #fbbf24; }
[data-theme="dark"] .en2-scorechip.bad, [data-theme="dim"] .en2-scorechip.bad, [data-theme="dark"] .rv-pill.bad, [data-theme="dim"] .rv-pill.bad { color: #f87171; }
[data-theme="dark"] .en2-scorechip.live, [data-theme="dim"] .en2-scorechip.live { color: #a5b4fc; }
[data-theme="dark"] .en2-pl-foot.ok .en2-fb b, [data-theme="dim"] .en2-pl-foot.ok .en2-fb b { color: #4ade80; }
[data-theme="dark"] .en2-pl-foot.bad .en2-fb b, [data-theme="dim"] .en2-pl-foot.bad .en2-fb b { color: #f87171; }
[data-theme="dark"] .en2-chart .lbl, [data-theme="dim"] .en2-chart .lbl { fill: #4ade80; }
[data-theme="dark"] .en2 .btn.en2-cta, [data-theme="dim"] .en2 .btn.en2-cta { color: #312e81; }

@media (prefers-reduced-motion: reduce) {
  .en-mic.live, .en2-wp.next .en2-wp-dot, .en2-call .en2-orb, .en2-call .en2-orb-ring, .en2-combo { animation: none !important; }
  .en2-flip-in, .en2-bar > i, .en2-ringwrap .val { transition: none; }
}

/* ── tablets and phones ── */
@media (max-width: 1100px) {
  .en2-write { grid-template-columns: minmax(0, 1fr); } .en2-check { position: static; max-height: none; }
}
@media (max-width: 900px) {
  .en2 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .en2-side { position: static; flex-direction: row; align-items: center; padding: 6px; border-radius: 16px; gap: 6px; }
  .en2-brand { display: none; }
  .en2-side-foot { border: 0; padding: 0 6px 0 0; flex: none; }
  .en2 .en-tabs { flex-direction: row; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
  .en2 .en-tabs::-webkit-scrollbar { display: none; }
  .en2 .en-tabs button { width: auto; flex: none; padding: 8px 12px; }
  .en2-chips { justify-content: flex-start; }
  .en2-grid { grid-template-columns: minmax(0, 1fr); }
  .en2-playing .en2-side, .en2-playing .en2-top { display: none; }
}
@media (max-width: 640px) {
  .en-card { padding: 14px 12px; }
  .en2-side-foot .en-hi-toggle { font-size: 12px; }
  .en2-chip { padding: 4px 10px 4px 6px; min-height: 34px; } .en2-chip span { display: none; } .en2-chip.lvl span, .en2-chip.goal span { display: none; }
  .en2-hero { flex-direction: column; align-items: stretch; padding: 18px 16px; gap: 14px; }
  .en2-hero::after { right: -120px; }
  .en2-hero h2 { font-size: 21px; }
  .en2-hero-r { flex-direction: row; justify-content: space-between; align-items: center; order: -1; }
  .en2-hero .en2-ringwrap.big { transform: scale(.8); transform-origin: left center; margin: -12px 0 -12px; }
  .en2-week { gap: 5px; } .en2-week > span > i { width: 28px; height: 28px; }
  .en2-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .en2-heat { grid-template-rows: repeat(7, 10px); grid-auto-columns: 10px; gap: 2px; }
  .en-level-head { grid-template-columns: auto 1fr auto auto; gap: 10px; padding: 10px 12px; } .en-level-head .en-meter { display: none; }
  .en-lname small { display: none; }
  .en2-wp-t small { display: none; }
  .en2-path::before { left: 17px; } .en2-wp-dot { width: 36px; height: 36px; font-size: 13px; }
  .en2-pl-card { padding: 16px 14px; min-height: 0; } .en2-pl-card .en-q { font-size: 17px; }
  .en2-pl-foot { padding: 12px 14px; }
  .en2-quiz-opts { grid-template-columns: minmax(0, 1fr); }
  .en2-sopts { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .en2-sword { font-size: 34px; }
  .en2-readbar { position: static; } .en2-fontbtns { margin-left: 0; }
  .en-msg { max-width: 94%; } .en-text { font-size: 17px; }
  .en-send { flex-wrap: wrap; } .en-send textarea { flex-basis: 100%; }
  .en2-hist li small { margin-left: 0; }
  .en2-pb-g { grid-template-columns: minmax(0, 1fr); }
  .en2-flip { height: 220px; } .en-flash-word { font-size: 30px; }
  .en-wordlist.en2-wgrid { grid-template-columns: minmax(0, 1fr); }
  .en2-route { padding: 12px 10px; } .en2-leg { min-width: 50px; } .en2-leg-dot { width: 34px; height: 34px; }
}
