:root{
  --bg:#f4f7fb;--panel:#ffffff;--line:#d7deea;--shadow:0 18px 40px rgba(21,34,64,.08);--text:#132033;--muted:#607087;
  --green:#dff7e9;--blue:#e5f2ff;--purple:#efe8ff;--orange:#fff1df;--red:#ffe8e8;--yellow:#fff8d9;--pink:#ffe9f5;
  --brand:#1f3764;--brand2:#355dac;--brand-soft:#edf3ff;--radius:24px;
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,'Apple Color Emoji','Segoe UI Emoji','Noto Color Emoji',sans-serif;background:linear-gradient(180deg,#f4f7fb 0%,#eef2fb 100%);color:var(--text)}
.app-shell{display:grid;grid-template-columns:280px 1fr;min-height:100vh}
.sidebar{background:#fff;border-right:1px solid var(--line);padding:20px;position:sticky;top:0;height:100vh}
.brand{display:flex;gap:12px;align-items:center;margin-bottom:22px}.brand-logo{width:56px;height:56px;border-radius:18px;display:grid;place-items:center;background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;font-size:22px;font-weight:800}
.brand h1{margin:0;font-size:22px}.brand p{margin:4px 0 0;color:var(--muted);font-size:13px}
.menu{display:grid;gap:10px}
.menu-item{width:100%;text-align:left;border:1px solid var(--line);background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);border-radius:16px;padding:14px 16px;font-size:15px;font-weight:700;cursor:pointer;transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;box-shadow:0 8px 22px rgba(25,42,70,.04)}
.menu-item:hover,.menu-item.active{background:var(--brand-soft);border-color:#bdd0f4;transform:translateY(-2px);box-shadow:0 14px 26px rgba(31,55,100,.12)}
.sidebar-box{margin-top:20px;border:1px solid var(--line);border-radius:22px;padding:18px;background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);box-shadow:0 14px 30px rgba(31,55,100,.07)}
.sidebar-box h3{margin:0 0 8px}.sidebar-box p{margin:0;color:var(--muted);line-height:1.6}
.content{padding:20px}.topbar{display:flex;gap:14px;align-items:center;margin-bottom:18px}
.icon-btn{width:46px;height:46px;border-radius:14px;border:1px solid var(--line);background:#fff;display:none;cursor:pointer}
.small-label{font-size:13px;color:var(--muted);margin-bottom:4px}.main-label{font-size:20px;font-weight:800}
.screen{display:none}.screen.active{display:block}.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px}.panel-soft{background:linear-gradient(180deg,#f8fbff 0%,#ffffff 100%);border:1px solid var(--line);border-radius:30px;box-shadow:var(--shadow);padding:18px}
.hero-grid{display:grid;grid-template-columns:1.45fr 1fr;gap:18px;margin-bottom:18px}.hero-panel{background:linear-gradient(135deg,#ffffff 0%,#f1f6ff 50%,#eef8f0 100%)}
.hero-panel h2{margin:10px 0;font-size:38px;line-height:1.12}.hero-panel p{color:var(--muted);line-height:1.7;font-size:16px}
.tag{display:inline-block;padding:8px 12px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-size:13px;font-weight:800}
.hero-actions,.toolbar{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between}.hero-actions{margin-top:18px}
.stats{display:grid;grid-template-columns:1fr 1fr;gap:12px}.stat{border-radius:20px;padding:18px;border:1px solid var(--line);display:grid;gap:6px}.stat strong{font-size:28px}
.stat.green{background:var(--green)}.stat.blue{background:var(--blue)}.stat.purple{background:var(--purple)}.stat.orange{background:var(--orange)}
.home-card-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}.home-card{cursor:pointer;transition:.18s ease}.home-card:hover{transform:translateY(-4px)}
.card-emoji{font-size:34px;margin-bottom:10px}.home-card h3{margin:0 0 8px;font-size:22px}.home-card p{margin:0;color:#334459;line-height:1.6}
.home-card.green{background:linear-gradient(180deg,#fff 0%,#f2fff7 100%)}.home-card.blue{background:linear-gradient(180deg,#fff 0%,#f2f9ff 100%)}.home-card.purple{background:linear-gradient(180deg,#fff 0%,#f7f2ff 100%)}.home-card.orange{background:linear-gradient(180deg,#fff 0%,#fff8ef 100%)}
.section-head{margin-bottom:14px}.section-head h2{margin:0 0 6px}.section-head p{margin:0;color:var(--muted);line-height:1.6}
.tabs{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.tab-btn,.primary-btn,.secondary-btn,.play-btn,.phrase-play,.jump-select,.story-control{border:none;border-radius:16px;padding:13px 16px;font-weight:800;transition:.15s ease}
.tab-btn,.jump-select{background:#fff;border:1px solid var(--line)}.tab-btn.active,.tab-btn:hover{background:var(--brand-soft);border-color:#bdd0f4}
.primary-btn,.play-btn,.phrase-play{background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;cursor:pointer}.secondary-btn{background:#fff;color:var(--text);border:1px solid var(--line);cursor:pointer}
.primary-btn:hover,.secondary-btn:hover,.play-btn:hover,.phrase-play:hover,.tab-btn:hover{transform:translateY(-2px);box-shadow:0 8px 18px rgba(19,31,59,.12)}
.page-indicator{background:var(--brand-soft);color:var(--brand);padding:10px 14px;border-radius:999px;font-weight:800}
.word-grid,.phrase-grid,.grammar-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.word-card,.phrase-card,.grammar-card,.story-card,.lesson-item,.extra-card,.example-card,.story-segment{border:1px solid var(--line);border-radius:22px;padding:16px;background:#fff}
.word-card{display:grid;gap:12px}.word-top{display:flex;gap:12px;align-items:center}.word-emoji{width:58px;height:58px;border-radius:18px;background:#f4f7fb;display:grid;place-items:center;font-size:30px}
.word-meta h3{margin:0;font-size:22px}.word-meta p{margin:4px 0 0;color:var(--muted)}.word-pairs{display:grid;grid-template-columns:1fr 1fr;gap:10px}.word-pair{border-radius:16px;padding:12px 14px;font-weight:700}.word-pair.it{background:var(--green)}.word-pair.en{background:var(--blue)}.word-example{color:#34465a;line-height:1.6;font-size:14px}
.flag-badge{display:inline-block;width:22px;height:16px;border-radius:5px;vertical-align:-3px;margin-right:8px;background-size:cover;background-position:center;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08),0 2px 5px rgba(0,0,0,.12)}
.flag-it{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 16'%3E%3Crect width='8' height='16' fill='%23009b3a'/%3E%3Crect x='8' width='8' height='16' fill='%23ffffff'/%3E%3Crect x='16' width='8' height='16' fill='%23ce2b37'/%3E%3C/svg%3E")}
.flag-en{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 36'%3E%3Crect width='60' height='36' fill='%23012169'/%3E%3Cpath d='M0 0l25 15M35 21l25 15M60 0L35 15M25 21L0 36' stroke='%23fff' stroke-width='7'/%3E%3Cpath d='M0 0l25 15M35 21l25 15M60 0L35 15M25 21L0 36' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30 0v36M0 18h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0v36M0 18h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E");position:relative;overflow:hidden}
.flag-uk{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 36'%3E%3Crect width='60' height='36' fill='%23012169'/%3E%3Cpath d='M0 0l25 15M35 21l25 15M60 0L35 15M25 21L0 36' stroke='%23fff' stroke-width='7'/%3E%3Cpath d='M0 0l25 15M35 21l25 15M60 0L35 15M25 21L0 36' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30 0v36M0 18h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0v36M0 18h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E");position:relative;overflow:hidden}
.flag-us{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 19 10'%3E%3Crect width='19' height='10' fill='%23b22234'/%3E%3Cg fill='%23fff'%3E%3Crect y='1' width='19' height='1'/%3E%3Crect y='3' width='19' height='1'/%3E%3Crect y='5' width='19' height='1'/%3E%3Crect y='7' width='19' height='1'/%3E%3Crect y='9' width='19' height='1'/%3E%3C/g%3E%3Crect width='8' height='5.5' fill='%233c3b6e'/%3E%3Cg fill='%23fff'%3E%3Ccircle cx='1' cy='1' r='.35'/%3E%3Ccircle cx='2.2' cy='1.8' r='.35'/%3E%3Ccircle cx='3.4' cy='1' r='.35'/%3E%3Ccircle cx='4.6' cy='1.8' r='.35'/%3E%3Ccircle cx='5.8' cy='1' r='.35'/%3E%3Ccircle cx='7' cy='1.8' r='.35'/%3E%3Ccircle cx='1.6' cy='3' r='.35'/%3E%3Ccircle cx='2.8' cy='3.8' r='.35'/%3E%3Ccircle cx='4' cy='3' r='.35'/%3E%3Ccircle cx='5.2' cy='3.8' r='.35'/%3E%3Ccircle cx='6.4' cy='3' r='.35'/%3E%3C/svg%3E")}
.lesson-chip-row{display:flex;gap:8px;flex-wrap:wrap}
.lesson-chip{display:inline-flex;align-items:center;padding:8px 12px;border-radius:999px;background:#eef4ff;color:var(--brand);font-weight:800;font-size:12px;letter-spacing:.02em}
.lesson-chip.soft{background:#fff5e9;color:#ad5b18}

.lesson-layout{display:grid;grid-template-columns:320px 1fr;gap:18px}.lesson-sidebar{display:grid;gap:10px;align-content:start}
.lesson-nav-btn{width:100%;text-align:left;border:1px solid var(--line);background:#fff;border-radius:18px;padding:14px 16px;cursor:pointer;transition:.16s ease}
.lesson-nav-btn.active,.lesson-nav-btn:hover{background:var(--brand-soft);border-color:#bdd0f4}.lesson-nav-btn .mini{display:block;font-size:12px;color:var(--muted);margin-top:4px}
.lesson-banner{display:flex;justify-content:space-between;gap:14px;align-items:center;margin-bottom:14px}
.lesson-banner h2{margin:4px 0 6px;font-size:34px;line-height:1.12}.lesson-banner p{margin:0;color:var(--muted);line-height:1.6}.lesson-badge{min-width:86px;height:86px;border-radius:24px;display:grid;place-items:center;font-size:42px;background:#f4f7fb}
.help-note{border-radius:18px;padding:14px 16px;margin-bottom:14px;font-weight:700;line-height:1.6}.help-note.green{background:var(--green)}.help-note.blue{background:var(--blue)}.help-note.purple{background:var(--purple)}.help-note.orange{background:var(--orange)}.help-note.red{background:var(--red)}
.lesson-intro{color:var(--muted);line-height:1.7;margin:0 0 16px}.lesson-items,.story-wrap{display:grid;gap:12px}
.lesson-item{display:grid;gap:12px;background:linear-gradient(180deg,#ffffff,#f9fbff)}.lesson-item-top{display:flex;justify-content:space-between;gap:10px;align-items:center;padding-bottom:6px;border-bottom:1px solid #edf2fb}.lesson-name{display:flex;gap:10px;align-items:center}.lesson-name .emoji{width:48px;height:48px;border-radius:16px;background:#f4f7fb;display:grid;place-items:center;font-size:24px}.lesson-name h4{margin:0;font-size:22px}.lesson-name p{margin:4px 0 0;color:var(--muted);font-size:14px}
.lesson-example,.story-para{display:grid;grid-template-columns:1fr 1fr;gap:10px}.ex-box,.story-it,.story-en{border-radius:16px;padding:12px 14px;line-height:1.6;font-size:14px}.ex-box.it,.story-it{background:var(--green)}.ex-box.en,.story-en{background:var(--blue)}
.extras-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-top:16px}.extra-card{background:#fbfcff;padding:16px 18px;border:1px solid #e6edf8}.extra-card strong{display:block;margin-bottom:6px;color:var(--brand)}
.story-stage{display:grid;gap:14px;margin-bottom:16px;background:radial-gradient(circle at top left,#f6f8ff,transparent 30%),linear-gradient(180deg,#fafcff 0%,#ffffff 100%)}
.story-hero{position:relative;min-height:280px;border-radius:28px;overflow:hidden;background:linear-gradient(135deg,#142645,#2b4f89 45%,#e69d67 100%);border:1px solid rgba(255,255,255,.2)}
.story-art-strip{position:absolute;top:16px;left:16px;z-index:2;display:inline-flex;gap:10px;align-items:center;padding:10px 14px;border-radius:999px;background:rgba(255,255,255,.16);backdrop-filter:blur(12px);color:#fff;font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.story-image{position:absolute;inset:0;display:grid;place-items:center;font-size:108px;background:radial-gradient(circle at top left,#ffffff40,transparent 34%),radial-gradient(circle at bottom right,#ffffff26,transparent 30%)}
.story-overlay{position:absolute;left:0;right:0;bottom:0;padding:28px;background:linear-gradient(180deg,transparent,rgba(10,18,34,.84));color:white}
.story-overlay h2{margin:0 0 6px;font-size:36px}.story-overlay p{margin:0;opacity:.95;max-width:700px}
.story-meta-bar,.story-control-bar,.story-jump-row,.story-progress-text{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between}
.story-chip{padding:10px 14px;border-radius:999px;background:#fff;border:1px solid var(--line);font-weight:800;color:var(--brand)}
.story-control-bar{background:#fff;border:1px solid var(--line);padding:12px;border-radius:22px;box-shadow:0 12px 24px rgba(31,55,100,.08)}
.story-control{flex:1 1 160px;text-align:center}
.story-progress-wrap{background:#fff;border:1px solid var(--line);padding:14px 16px;border-radius:22px}
#storySeekBar{width:100%;appearance:none;height:8px;border-radius:999px;background:#dce8ff;outline:none}
#storySeekBar::-webkit-slider-thumb{appearance:none;width:22px;height:22px;border-radius:50%;background:linear-gradient(135deg,var(--brand),var(--brand2));border:none;box-shadow:0 8px 18px rgba(31,55,100,.25);cursor:pointer}
#storySeekBar::-moz-range-thumb{width:22px;height:22px;border-radius:50%;background:linear-gradient(135deg,var(--brand),var(--brand2));border:none;box-shadow:0 8px 18px rgba(31,55,100,.25);cursor:pointer}
.story-progress-text{margin-top:10px;font-size:13px;color:var(--muted)}
.story-scene-tags{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.story-scene-tags span{padding:7px 10px;border-radius:999px;background:rgba(255,255,255,.14);backdrop-filter:blur(8px);color:#fff;font-size:12px;font-weight:800}
.story-jump-row{justify-content:flex-start}.story-jump-row label{font-weight:800;color:var(--brand)}
.story-segment{display:grid;gap:14px;background:linear-gradient(180deg,#ffffff,#fbfcff);transition:.18s ease;scroll-margin-top:20px}
.story-segment.active{border-color:#90aeea;box-shadow:0 16px 32px rgba(53,93,172,.14);transform:translateY(-2px);background:linear-gradient(180deg,#ffffff,#f5f9ff)}
.title-card{background:linear-gradient(135deg,#f8fbff,#fff7ef)}
.story-segment-top{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.story-segment-top h3{margin:4px 0 6px;font-size:24px}.story-segment-top p{margin:0;color:var(--muted);line-height:1.6}.segment-kicker{display:inline-block;padding:7px 10px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.story-segment-actions{display:flex;gap:10px;flex-wrap:wrap}.story-mini-btn{padding:10px 12px;border-radius:14px}
.phrase-card{display:grid;gap:10px}.phrase-card:nth-child(5n+1){background:var(--green)}.phrase-card:nth-child(5n+2){background:var(--blue)}.phrase-card:nth-child(5n+3){background:var(--purple)}.phrase-card:nth-child(5n+4){background:var(--orange)}.phrase-card:nth-child(5n){background:var(--yellow)}.phrase-head{display:flex;justify-content:space-between;gap:10px;align-items:center}.phrase-card h3,.grammar-card h3,.example-card h4{margin:0}.phrase-card p,.grammar-card p,.detail-text,.detail-summary,.example-card p{margin:0;line-height:1.6;color:#304154}
.grammar-layout{display:grid;grid-template-columns:1fr 1fr;gap:18px}.grammar-grid-panel,.grammar-detail-panel{min-height:300px}
.grammar-card{cursor:pointer;display:grid;gap:12px;transition:.18s ease}.grammar-card.green{background:var(--green)}.grammar-card.blue{background:var(--blue)}.grammar-card.purple{background:var(--purple)}.grammar-card.orange{background:var(--orange)}.grammar-card.red{background:var(--red)}.grammar-card.active{outline:3px solid #8aaef0;box-shadow:0 16px 32px rgba(53,93,172,.12)}.grammar-card-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.accordion-toggle{width:42px;height:42px;border:none;border-radius:14px;background:rgba(255,255,255,.78);font-size:28px;line-height:1;font-weight:700;color:var(--brand);cursor:pointer}.grammar-mini-examples{display:flex;gap:8px;flex-wrap:wrap}.grammar-mini-examples span{padding:8px 10px;border-radius:999px;background:rgba(255,255,255,.7);font-size:12px;font-weight:700}.grammar-subcats{display:none}.grammar-subcats.show{display:block}.grammar-subcat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.grammar-subcat{padding:14px;border-radius:18px;background:rgba(255,255,255,.65);border:1px solid rgba(255,255,255,.8)}.grammar-subcat strong{display:block;margin-bottom:6px;color:var(--brand)}.grammar-subcat p{margin:0;color:#31445a;line-height:1.6}.grammar-detail-panel{position:sticky;top:20px;align-self:start}
.detail-hero{min-height:160px;border-radius:22px;display:grid;place-items:center;background:linear-gradient(135deg,#eef5ff,#fff4ea);font-size:64px;margin-bottom:14px}
.detail-summary{font-weight:700;margin-bottom:10px}.detail-text{margin-bottom:12px;white-space:pre-line}.detail-examples{display:grid;gap:10px}.example-card{background:#fbfcff;padding:16px 18px;border:1px solid #e8eef8}.example-card h4{display:flex;gap:8px;align-items:center}
@media (max-width:1100px){.lesson-layout,.hero-grid,.word-grid,.phrase-grid,.grammar-grid,.home-card-grid,.lesson-example,.story-para,.word-pairs,.extras-grid,.grammar-layout,.grammar-subcat-grid{grid-template-columns:1fr}}
@media (max-width:980px){
  .app-shell{grid-template-columns:1fr}
  .sidebar{position:fixed;left:-100%;width:280px;z-index:40;transition:left .25s ease;box-shadow:0 10px 30px rgba(0,0,0,.12)}
  .sidebar.open{left:0}
  .icon-btn{display:inline-grid;place-items:center}
  .content{padding:14px}
  .main-label{font-size:17px}
  .hero-panel h2,.lesson-banner h2,.story-overlay h2{font-size:28px}
  .story-control{flex:1 1 calc(50% - 8px)}
  .grammar-detail-panel{position:static}
}

.grammar-layout-v2{grid-template-columns:300px 1fr}
.grammar-sidebar{display:grid;gap:10px;align-content:start}
.grammar-nav-btn{padding:14px 16px;border-radius:18px;border:1px solid var(--line);background:#fff;cursor:pointer;text-align:left;display:grid;gap:6px;transition:.18s ease}
.grammar-nav-btn.active{border-color:#88a9e8;box-shadow:0 14px 28px rgba(53,93,172,.12);background:linear-gradient(180deg,#fff,#f5f9ff)}
.grammar-nav-btn .mini{color:var(--muted);font-size:13px;line-height:1.5}
.grammar-main-panel{display:grid;gap:16px}
.grammar-banner{margin-bottom:0}
.grammar-submenu{display:flex;gap:10px;flex-wrap:wrap}
.grammar-tab{padding:11px 14px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--brand);font-weight:700;cursor:pointer}
.grammar-tab.active{background:var(--brand);color:#fff;border-color:var(--brand)}
.grammar-detail-body{display:grid;gap:14px}
.grammar-section-card{border:1px solid var(--line);border-radius:22px;padding:18px;background:#fff}
.grammar-section-card h3{margin:0 0 8px}
.grammar-section-card p{margin:0;line-height:1.7;color:#304154}
.grammar-points{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.grammar-point{border:1px solid var(--line);border-radius:18px;padding:14px;background:#fbfcff}
.grammar-point strong{display:block;margin-bottom:6px;color:var(--brand)}
.grammar-point p{margin:0;line-height:1.65;color:#304154}
.grammar-examples-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.story-control-bar .story-control{min-width:120px}
.story-progress-wrap input[type=range]{width:100%}
.story-timeline-note{font-size:13px;color:var(--muted);margin-bottom:10px}
@media (max-width:1100px){.grammar-layout-v2,.grammar-points,.grammar-examples-grid{grid-template-columns:1fr}}

.phrase-card-upgraded{background:linear-gradient(180deg,#ffffff,#f9fbff);gap:14px}
.phrase-card-upgraded:nth-child(5n+1){background:linear-gradient(180deg,#ffffff,#effaf3)}
.phrase-card-upgraded:nth-child(5n+2){background:linear-gradient(180deg,#ffffff,#eef6ff)}
.phrase-card-upgraded:nth-child(5n+3){background:linear-gradient(180deg,#ffffff,#f5efff)}
.phrase-card-upgraded:nth-child(5n+4){background:linear-gradient(180deg,#ffffff,#fff4e8)}
.phrase-card-upgraded:nth-child(5n){background:linear-gradient(180deg,#ffffff,#fffbe8)}
.phrase-card-top{display:grid;grid-template-columns:64px 1fr auto;gap:14px;align-items:start}
.phrase-icon{width:64px;height:64px;border-radius:20px;background:#fff;display:grid;place-items:center;font-size:30px;border:1px solid var(--line);box-shadow:0 8px 18px rgba(19,31,59,.06)}
.phrase-label{font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
.phrase-translation{font-size:15px;color:#47607c;line-height:1.65}
.phrase-flag-row{display:flex;gap:10px;flex-wrap:wrap}
.phrase-flag-pill{display:inline-flex;gap:8px;align-items:center;padding:10px 12px;border-radius:999px;background:rgba(255,255,255,.85);border:1px solid var(--line);font-size:14px;color:#18314f}
.phrase-tip{padding:12px 14px;border-radius:16px;background:#fff;border:1px dashed #c9d8ef;color:#51657d;line-height:1.6}
@media (max-width:1100px){.phrase-card-top{grid-template-columns:1fr}.phrase-icon{width:56px;height:56px}}


.grammar-nav-btn strong{font-size:16px;line-height:1.35}
.grammar-nav-btn{padding:16px 18px;background:linear-gradient(180deg,#fff,#f9fbff)}
.grammar-submenu{gap:12px;margin-top:4px}
.grammar-tab{padding:12px 16px;box-shadow:0 6px 14px rgba(19,31,59,.05)}
.grammar-section-card,.grammar-point,.example-card{box-shadow:0 10px 24px rgba(19,31,59,.05)}
.example-card h4{margin:0 0 10px;font-size:17px}
.example-card p{margin:0;color:#31445a;line-height:1.65}
.phrase-card-upgraded{border-radius:24px;box-shadow:0 16px 34px rgba(19,31,59,.06)}
.phrase-texts h3{margin:4px 0 8px;font-size:24px;line-height:1.25}
.phrase-translation{font-size:16px;line-height:1.55}
.phrase-flag-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.phrase-flag-pill strong{font-size:15px;line-height:1.5}
.phrase-tip strong{display:block;color:#17365f;margin-bottom:4px}
@media (max-width:900px){.phrase-flag-row{grid-template-columns:1fr}}



/* Global polish */
.panel,
.panel-soft,
.sidebar-box,
.menu-item,
.primary-btn,
.secondary-btn,
.icon-btn,
.story-control-btn,
.phrase-card,
.lesson-card,
.grammar-topic-btn,
.grammar-tab,
.story-part,
.stat,
.word-card,
.info-card{
  will-change: transform;
}

.panel,
.panel-soft{
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.panel:hover,
.panel-soft:hover{
  transform: translateY(-3px);
  box-shadow: 0 22px 44px rgba(21,34,64,.12);
  border-color: #c6d8f6;
}

.primary-btn,
.secondary-btn,
.icon-btn,
.story-control-btn{
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.icon-btn:hover,
.story-control-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(31,55,100,.14);
}

.stat,
.word-card,
.lesson-card,
.phrase-card,
.info-card,
.story-part,
.grammar-topic-btn,
.grammar-tab{
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}

.stat:hover,
.word-card:hover,
.lesson-card:hover,
.phrase-card:hover,
.info-card:hover,
.story-part:hover,
.grammar-topic-btn:hover,
.grammar-tab:hover{
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(31,55,100,.1);
  border-color: #bdd0f4;
}

.phrase-card,
.lesson-card,
.word-card,
.info-card{
  background: linear-gradient(180deg,#ffffff 0%,#f9fbff 100%);
  border-radius: 22px;
}

.grammar-topic-btn{
  background: linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  border-radius: 20px;
}

.grammar-topic-btn.active,
.grammar-tab.active{
  box-shadow: 0 16px 30px rgba(31,55,100,.14);
}

.story-part.active,
.grammar-topic-btn.active{
  transform: translateY(-2px);
}

.flag-badge{
  box-shadow: 0 8px 16px rgba(21,34,64,.10), inset 0 0 0 1px rgba(255,255,255,.6);
}

@media (prefers-reduced-motion: reduce){
  .panel,
  .panel-soft,
  .sidebar-box,
  .menu-item,
  .primary-btn,
  .secondary-btn,
  .icon-btn,
  .story-control-btn,
  .phrase-card,
  .lesson-card,
  .grammar-topic-btn,
  .grammar-tab,
  .story-part,
  .stat,
  .word-card,
  .info-card{
    transition:none !important;
  }
}


.home-card-grid-upgraded{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}
.practice-layout{display:grid;grid-template-columns:320px 1fr;gap:18px}
.practice-sidebar{display:grid;gap:16px;align-self:start;position:sticky;top:20px}
.practice-main{display:grid;gap:18px}
.practice-mode-list{display:grid;gap:12px}
.practice-mode-btn{width:100%;text-align:left;border:1px solid var(--line);background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);border-radius:18px;padding:14px 16px;cursor:pointer;display:grid;gap:5px;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}
.practice-mode-btn:hover,.practice-mode-btn.active{transform:translateY(-2px);box-shadow:0 16px 30px rgba(31,55,100,.12);border-color:#bdd0f4;background:var(--brand-soft)}
.practice-mode-btn strong{font-size:15px}
.practice-mode-btn span{font-size:13px;color:var(--muted);line-height:1.5}
.practice-side-actions{display:grid;gap:10px}
.practice-banner{background:linear-gradient(135deg,#ffffff 0%,#eef5ff 48%,#f3fff5 100%)}
.practice-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.practice-stat-card{border:1px solid var(--line);border-radius:22px;padding:16px;background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);display:grid;gap:5px;box-shadow:0 14px 30px rgba(31,55,100,.06)}
.practice-stat-card strong{font-size:26px}
.practice-stat-card span{color:var(--muted);font-weight:700}
.practice-progress-wrap{margin-top:-4px}
.practice-progress-bar{height:16px;border-radius:999px;background:#e8eef8;overflow:hidden;border:1px solid var(--line)}
.practice-progress-bar span{display:block;height:100%;width:0%;background:linear-gradient(90deg,var(--brand) 0%,var(--brand2) 100%);border-radius:999px;transition:width .25s ease}
.practice-card{min-height:420px}
.empty-state{min-height:360px;display:grid;place-items:center;text-align:center;padding:28px}
.empty-emoji{font-size:52px;margin-bottom:10px}
.practice-question-top{display:flex;gap:12px;justify-content:space-between;align-items:flex-start;flex-wrap:wrap;margin-bottom:16px}
.practice-pill{display:inline-block;padding:8px 12px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-weight:800;font-size:12px}
.practice-question-card h3{margin:0;font-size:28px;line-height:1.2}
.practice-question-card p{color:var(--muted);line-height:1.7}
.options-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-top:18px}
.option-btn{width:100%;text-align:left;border:1px solid var(--line);background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);border-radius:20px;padding:16px;cursor:pointer;font-weight:700;line-height:1.55;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.option-btn:hover{transform:translateY(-2px);box-shadow:0 14px 28px rgba(31,55,100,.1);border-color:#bdd0f4}
.option-btn.correct{background:linear-gradient(180deg,#effcf4 0%,#e0f7e9 100%);border-color:#95d7af}
.option-btn.wrong{background:linear-gradient(180deg,#fff2f2 0%,#ffe0e0 100%);border-color:#efabab}
.practice-feedback{margin-top:18px;border:1px solid var(--line);border-radius:20px;padding:16px;background:linear-gradient(180deg,#ffffff 0%,#f9fbff 100%)}
.practice-feedback.good{background:linear-gradient(180deg,#effcf4 0%,#f7fffa 100%)}
.practice-feedback.bad{background:linear-gradient(180deg,#fff3f3 0%,#fff9f9 100%)}
.practice-feedback h4{margin:0 0 8px}
.practice-feedback p{margin:0;color:#334459;line-height:1.7}
.practice-next-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.result-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:18px}
.result-card{border:1px solid var(--line);border-radius:20px;padding:18px;background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)}
.result-card strong{font-size:28px;display:block;margin-bottom:6px}
.result-card span{color:var(--muted);font-weight:700}
.mistake-list{display:grid;gap:12px;margin-top:18px}
.mistake-card{border:1px solid var(--line);border-radius:18px;padding:14px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%)}
.mistake-card h4{margin:0 0 8px;font-size:16px}
.mistake-card p{margin:4px 0;color:#42546a}
.practice-launch-row{margin:10px 0 6px}
@media (max-width:1100px){.practice-layout{grid-template-columns:1fr}.practice-sidebar{position:static}}
@media (max-width:760px){.practice-stats{grid-template-columns:repeat(2,1fr)}.options-grid,.result-grid{grid-template-columns:1fr}}

.translator-box{display:flex;gap:10px;margin-top:10px}
.translator-box input{flex:1;padding:14px;border-radius:14px;border:1px solid var(--line);font-size:15px}
.translator-result{margin-top:18px;padding:18px;border-radius:20px}

.translator-box{display:flex;gap:12px;margin-top:10px;align-items:center}
.translator-box input{flex:1;padding:16px 18px;border-radius:18px;border:1px solid var(--line);font-size:16px;background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.translator-box input:focus{outline:none;border-color:#bdd0f4;box-shadow:0 12px 24px rgba(31,55,100,.08);transform:translateY(-1px)}
.translator-result{margin-top:18px;padding:22px;border-radius:24px;min-height:150px}
.translator-help-note{margin-top:16px}
.translator-output{display:grid;gap:8px}
.translator-output h3{margin:0;font-size:28px;line-height:1.25}
.translator-output p{margin:0;color:#42546a;line-height:1.7}
.translator-badge{display:inline-block;width:max-content;padding:8px 12px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-weight:800;font-size:12px}
.translator-note{color:var(--muted)!important;font-size:14px}
@media (max-width:760px){
  .translator-box{flex-direction:column;align-items:stretch}
}


.translator-result{margin-top:18px;padding:22px;border-radius:24px;min-height:150px}
.translator-output{display:grid;gap:10px}
.translator-output h3{margin:0;font-size:28px;line-height:1.25}
.translator-output p{margin:0;color:#42546a;line-height:1.7}
.translator-badge{display:inline-block;width:max-content;padding:8px 12px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-weight:800;font-size:12px}
.translator-note{color:var(--muted)!important;font-size:14px}
.translator-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:8px}


.translator-panel{display:grid;gap:16px}
.translator-box{display:flex;gap:12px;align-items:center}
.translator-box input{flex:1;padding:16px 18px;border-radius:20px;border:1px solid var(--line);font-size:16px;background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.translator-box input:focus{outline:none;border-color:#bdd0f4;box-shadow:0 12px 24px rgba(31,55,100,.08);transform:translateY(-1px)}
.translator-suggestions{display:flex;flex-wrap:wrap;gap:10px}
.suggestion-chip{border:1px solid var(--line);background:linear-gradient(180deg,#fff 0%,#f7fbff 100%);border-radius:999px;padding:10px 14px;font-weight:700;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.suggestion-chip:hover{transform:translateY(-2px);box-shadow:0 12px 24px rgba(31,55,100,.08);border-color:#bdd0f4}
.translator-detect,.translator-result,.translator-examples{padding:20px;border-radius:24px}
.detect-badge,.translator-badge,.translator-subtitle{display:inline-block;width:max-content;padding:8px 12px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-weight:800;font-size:12px}
.translator-detect p{margin:12px 0 0;color:#42546a;line-height:1.7}
.detect-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:14px}
.detect-card{border:1px solid var(--line);border-radius:18px;padding:14px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%)}
.detect-card strong{display:block;margin-bottom:6px}
.detect-card span{color:#42546a;line-height:1.6}
.translator-output{display:grid;gap:10px}
.translator-output h3{margin:0;font-size:30px;line-height:1.2}
.translator-output p{margin:0;color:#42546a;line-height:1.7}
.translator-note{color:var(--muted)!important;font-size:14px}
.translator-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
.translator-word-map{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-top:10px}
.translator-word-card{border:1px solid var(--line);border-radius:18px;padding:12px 14px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%)}
.translator-word-card strong{display:block;font-size:15px}
.translator-word-card span{display:block;color:#42546a;margin-top:4px}
.translator-example-list{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:12px}
.translator-example-card{border:1px solid var(--line);border-radius:18px;padding:14px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);display:grid;gap:6px}
.translator-example-card strong{font-size:15px}
.translator-example-card span{color:#42546a;line-height:1.6}
@media (max-width:900px){
  .translator-example-list,.detect-grid{grid-template-columns:1fr}
}
@media (max-width:760px){
  .translator-box{flex-direction:column;align-items:stretch}
}


.translator-language-strip{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.translator-lang-card{display:flex;gap:12px;align-items:center;border:1px solid var(--line);background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);padding:12px 14px;border-radius:20px}
.translator-lang-card strong{display:block;font-size:15px}
.translator-lang-card span{display:block;color:var(--muted);font-size:13px;margin-top:2px}
.translator-arrow{font-weight:900;color:var(--brand);font-size:20px}
.translator-flag{width:28px;height:20px;border-radius:6px;box-shadow:0 8px 16px rgba(21,34,64,.10), inset 0 0 0 1px rgba(255,255,255,.6)}
.hidden{display:none!important}


.detect-dual-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:14px}
.detect-dual-card{border:1px solid var(--line);border-radius:18px;padding:14px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%)}
.detect-dual-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px}
.detect-lang-row{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);font-weight:700}
.detect-pair{display:grid;gap:8px}
.detect-mini{border:1px solid var(--line);border-radius:14px;padding:10px 12px;background:#fff}
.detect-mini strong{display:block;font-size:13px;margin-bottom:4px;color:#42546a}
.detect-mini span{display:block;font-size:15px;color:var(--text);line-height:1.5}
@media (max-width:900px){
  .detect-dual-grid{grid-template-columns:1fr}
}


.translator-panel{background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)}
.translator-language-strip{margin-top:2px}
.translator-lang-card{box-shadow:0 12px 24px rgba(31,55,100,.08);border-radius:22px}
.translator-detect{background:linear-gradient(135deg,#eef6ff 0%,#f8fcff 100%)}
.translator-result{background:linear-gradient(135deg,#fbfffd 0%,#f5fbff 100%)}
.translator-examples{background:linear-gradient(135deg,#fffdf7 0%,#fff 100%)}
.detect-dual-card:nth-child(1){background:linear-gradient(180deg,#fff7fb 0%,#ffffff 100%)}
.detect-dual-card:nth-child(2){background:linear-gradient(180deg,#f7fbff 0%,#ffffff 100%)}
.detect-dual-card:nth-child(3){background:linear-gradient(180deg,#f7fff8 0%,#ffffff 100%)}
.detect-mini{box-shadow:0 8px 16px rgba(31,55,100,.05)}
.translator-object-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.object-pill{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:999px;background:linear-gradient(180deg,#fff 0%,#f7fbff 100%);border:1px solid var(--line);font-weight:700;box-shadow:0 8px 18px rgba(31,55,100,.05)}
.object-emoji{font-size:20px}
.translator-status-good{color:#1b6e3d}
.translator-status-soft{color:#4b5e78}
.translator-example-card{box-shadow:0 10px 22px rgba(31,55,100,.05)}
.suggestion-chip:nth-child(1){background:linear-gradient(180deg,#fff5e8 0%,#fffdf8 100%)}
.suggestion-chip:nth-child(2){background:linear-gradient(180deg,#eef6ff 0%,#fbfdff 100%)}
.suggestion-chip:nth-child(3){background:linear-gradient(180deg,#f6efff 0%,#fcfaff 100%)}
.suggestion-chip:nth-child(4){background:linear-gradient(180deg,#eefbf2 0%,#fbfffd 100%)}
.suggestion-chip:nth-child(5){background:linear-gradient(180deg,#fff1f6 0%,#fffafd 100%)}
.suggestion-chip:nth-child(6){background:linear-gradient(180deg,#fff9db 0%,#fffef7 100%)}
.suggestion-chip:nth-child(7){background:linear-gradient(180deg,#eefeff 0%,#fbffff 100%)}
.suggestion-chip:nth-child(8){background:linear-gradient(180deg,#f4f1ff 0%,#fcfbff 100%)}


/* Translator UI refinement */
.detect-mini.en-box{background:linear-gradient(180deg,#eef6ff 0%,#f8fbff 100%)}
.detect-mini.it-box{background:linear-gradient(180deg,#eefbf2 0%,#f9fffb 100%)}
.detect-mini.en-box strong{color:#345b8c}
.detect-mini.it-box strong{color:#2e7a4c}
.detect-mini.en-box span,.detect-mini.it-box span{font-weight:700}
.translator-object-row{margin-top:16px}
.object-pill{background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);padding:12px 14px;border-radius:18px}
.object-pill .object-emoji{font-size:22px}
.object-pill.object-it{background:linear-gradient(180deg,#f4fff7 0%,#fcfffd 100%)}
.object-pill.object-en{background:linear-gradient(180deg,#f1f7ff 0%,#fcfdff 100%)}
.translator-example-card{transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease}
.translator-example-card:hover{transform:translateY(-2px);box-shadow:0 14px 26px rgba(31,55,100,.09);border-color:#bdd0f4}
.translator-suggestions{transition:all .2s ease}
.suggestion-chip{transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease}
.suggestion-chip:hover{transform:translateY(-2px) scale(1.01)}
.translator-result{position:relative;overflow:hidden}
.translator-result::after{
  content:"";
  position:absolute;
  right:-40px; top:-40px;
  width:180px; height:180px;
  background:radial-gradient(circle, rgba(53,93,172,.08) 0%, rgba(53,93,172,0) 70%);
  pointer-events:none;
}



/* Translator network icon upgrade */
.object-pill{
  gap:10px;
}
.object-icon{
  width:24px;
  height:24px;
  border-radius:8px;
  object-fit:cover;
  box-shadow:0 6px 12px rgba(31,55,100,.10);
  background:#fff;
}
.object-emoji.fallback{
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:8px;
  background:#fff;
  box-shadow:0 6px 12px rgba(31,55,100,.10);
}
.translator-suggestions{
  min-height:54px;
}
.suggestion-chip.active-topic{
  border-color:#8fb6f5;
  box-shadow:0 12px 24px rgba(53,93,172,.10);
}



/* Smart translator visual showcase */
.translator-result-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr);gap:20px;align-items:stretch}
.translator-visual-stage{min-height:240px;border:1px dashed #d8e3f7;border-radius:24px;background:linear-gradient(180deg,#ffffff 0%,#f3f8ff 100%);padding:18px;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden}
.translator-visual-placeholder{display:grid;gap:8px;place-items:center;text-align:center;color:#607086}
.translator-visual-emoji{font-size:42px}
.translator-visual-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:14px;width:100%}
.translator-visual-card{display:grid;gap:10px;align-content:start;background:rgba(255,255,255,.92);border:1px solid var(--line);border-radius:22px;padding:14px;box-shadow:0 16px 30px rgba(31,55,100,.08);min-height:190px}
.translator-visual-card.featured{grid-column:span 2;min-height:230px}
.translator-visual-media{display:grid;place-items:center;background:linear-gradient(180deg,#f7fbff 0%,#eef5ff 100%);border-radius:18px;min-height:120px;padding:12px;overflow:hidden}
.translator-visual-card.featured .translator-visual-media{min-height:170px}
.translator-visual-media img{max-width:100%;max-height:150px;object-fit:contain;filter:drop-shadow(0 12px 24px rgba(31,55,100,.14))}
.translator-visual-card.featured .translator-visual-media img{max-height:200px}
.translator-visual-fallback{font-size:64px;line-height:1}
.translator-visual-card.featured .translator-visual-fallback{font-size:88px}
.translator-visual-label{display:grid;gap:4px;text-align:center}
.translator-visual-label strong{font-size:22px;line-height:1.15}
.translator-visual-label span{font-size:14px;color:var(--muted)}
.translator-object-row{display:none!important}
@media (max-width:900px){
  .translator-result-grid{grid-template-columns:1fr}
  .translator-visual-card.featured{grid-column:auto}
}

/* App-like mobile polish */
html{scroll-behavior:smooth}
body{min-height:100vh;-webkit-tap-highlight-color:transparent}
.topbar{position:sticky;top:0;z-index:18;padding:12px 14px;border:1px solid rgba(215,222,234,.7);border-radius:22px;background:rgba(255,255,255,.72);backdrop-filter:blur(16px);box-shadow:0 10px 26px rgba(21,34,64,.06)}
.content{padding:20px 20px 28px}
.translator-panel{display:grid;gap:18px;background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%)}
.translator-box{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:14px;border:1px solid #dbe5f5;border-radius:24px;background:linear-gradient(180deg,#f8fbff,#ffffff)}
#translatorInput{width:100%;min-height:58px;border:1px solid var(--line);border-radius:18px;padding:0 18px;font-size:16px;font-weight:600;outline:none;background:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.7)}
#translatorInput:focus{border-color:#8cb0ef;box-shadow:0 0 0 4px rgba(82,126,214,.12)}
#translateBtn{min-width:154px}
.translator-language-strip{display:grid;grid-template-columns:1fr auto 1fr;gap:12px;align-items:center}
.translator-lang-card{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:20px;border:1px solid #dce7f6;background:linear-gradient(180deg,#ffffff,#f7faff);box-shadow:0 10px 22px rgba(31,55,100,.06)}
.translator-arrow{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:var(--brand-soft);color:var(--brand);font-weight:800}
.translator-lang-card span{display:block;color:var(--muted);font-size:13px;margin-top:4px}
.translator-suggestions{display:flex;gap:10px;overflow:auto;padding-bottom:4px;scrollbar-width:none}
.translator-suggestions::-webkit-scrollbar{display:none}
.suggestion-chip{flex:0 0 auto;border:1px solid #dce5f4;background:linear-gradient(180deg,#fff,#f8fbff);border-radius:999px;padding:12px 16px;font-weight:800;color:#213553;cursor:pointer;box-shadow:0 8px 20px rgba(31,55,100,.05)}
.suggestion-chip:hover{transform:translateY(-2px)}
.translator-detect,.translator-result,.translator-examples{padding:20px}
.translator-visual-loading{display:grid;gap:10px;place-items:center;text-align:center;color:var(--muted)}
.mini-loader{width:42px;height:42px;border-radius:50%;border:4px solid #dbe6f7;border-top-color:#4e74c7;animation:spin .85s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.translator-visual-media{position:relative}
.translator-visual-media img{width:100%;max-height:180px;object-fit:contain;border-radius:16px}
.translator-visual-fallback{font-size:74px;line-height:1}
.translator-visual-label strong{display:block;font-size:18px;color:#132c4e}
.translator-visual-label span{display:block;margin-top:4px;color:#6b7c92;font-size:13px;text-transform:capitalize}

@media (max-width:980px){
  .sidebar{width:min(86vw,320px);padding-bottom:90px}
  .content{padding:12px 12px 26px}
  .panel,.panel-soft{padding:16px}
  .brand{margin-bottom:16px}
}
@media (max-width:760px){
  .topbar{border-radius:18px;padding:10px 12px;margin-bottom:14px}
  .main-label{font-size:16px;line-height:1.35}
  .hero-panel h2,.lesson-banner h2,.story-overlay h2,.phrase-texts h3{font-size:24px}
  .translator-language-strip{grid-template-columns:1fr;gap:10px}
  .translator-arrow{display:none}
  .translator-box{grid-template-columns:1fr;padding:12px}
  #translateBtn{width:100%;min-height:52px}
  #translatorInput{min-height:54px;font-size:16px}
  .translator-result-grid{grid-template-columns:1fr !important}
  .translator-visual-stage{min-height:200px;padding:14px}
  .translator-visual-grid{grid-template-columns:1fr 1fr}
  .translator-visual-card.featured{grid-column:auto;min-height:190px}
  .translator-visual-card{min-height:170px;padding:12px}
  .translator-visual-card.featured .translator-visual-media,.translator-visual-media{min-height:120px}
  .toolbar,.hero-actions{gap:10px}
  .primary-btn,.secondary-btn,.play-btn,.tab-btn,.jump-select,.story-control{width:100%;justify-content:center}
}
@media (max-width:520px){
  :root{--radius:20px}
  .content{padding:10px 10px calc(18px + env(safe-area-inset-bottom))}
  .screen{padding-bottom:6px}
  .panel,.panel-soft,.sidebar-box{border-radius:20px}
  .brand-logo{width:48px;height:48px;border-radius:16px}
  .story-control{flex:1 1 100%}
  .phrase-card-top,.story-segment-top,.hero-actions,.toolbar{grid-template-columns:1fr}
  .stats,.practice-stats,.translator-visual-grid{grid-template-columns:1fr}
  .translator-detect,.translator-result,.translator-examples{padding:16px}
  .translator-visual-card,.translator-visual-card.featured{min-height:auto}
}


/* Translator UI improvements */
.improved-result-grid{grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr);gap:22px;align-items:stretch}
.improved-output{padding:4px 0;gap:14px}
.translator-live-badge{font-size:11px;letter-spacing:.04em}
.meaning-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.meaning-pill{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border:1px solid #dbe5f4;border-radius:999px;background:#fff;color:#163154;font-size:14px;box-shadow:0 8px 18px rgba(26,45,82,.06)}
.meaning-pill strong{font-weight:800;color:#102746}
.compact-actions{margin-top:6px}
.compact-play-btn{width:auto !important;min-width:160px;padding:12px 18px;border-radius:18px;font-size:15px;box-shadow:0 12px 24px rgba(40,71,131,.18)}
.clean-stage{border:1px solid #dbe6f7 !important;border-style:solid !important;background:linear-gradient(180deg,#ffffff 0%,#f7faff 100%) !important;min-height:260px;padding:16px}
.translator-visual-grid.single-view{grid-template-columns:1fr;max-width:100%}
.solo-card{min-height:auto !important;padding:16px;border-radius:24px}
.solo-media{min-height:220px !important;background:linear-gradient(180deg,#f8fbff 0%,#eef4ff 100%);border:1px solid #e4ecf8}
.solo-media img{width:100%;height:100%;max-height:320px;object-fit:contain;border-radius:18px;display:block}
.single-line-label{display:flex;justify-content:center;align-items:center;text-align:center}
.single-line-label strong{font-size:20px}
.translator-visual-placeholder.compact{gap:10px;padding:18px}
.translator-visual-placeholder.compact .translator-visual-emoji{font-size:32px;width:64px;height:64px;display:grid;place-items:center;border-radius:18px;background:#edf3ff}
.hidden-note{display:none !important}
#translatorResult{background:linear-gradient(180deg,#fdfefe 0%,#f7fbff 100%)}
#translatorDetect{background:linear-gradient(180deg,#f4f8ff 0%,#fbfdff 100%)}
#translatorInput{min-height:56px;border-radius:18px;padding:0 18px;font-size:16px}
#translateBtn{min-width:132px;border-radius:18px}
.translator-box{align-items:center;gap:12px;background:#fff;border:1px solid #dbe5f5;border-radius:24px;padding:10px 10px 10px 14px;box-shadow:0 12px 28px rgba(28,48,88,.06)}
.translator-language-strip{gap:12px}
.translator-lang-card{border-radius:22px;padding:14px 16px;background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);border:1px solid #dbe5f4;box-shadow:0 10px 22px rgba(28,48,88,.05)}
.translator-suggestions{gap:10px}
.suggestion-chip{border-radius:999px;padding:11px 15px}
@media (max-width: 900px){
  .improved-result-grid{grid-template-columns:1fr}
  .clean-stage{min-height:220px}
}
@media (max-width: 640px){
  .translator-box{flex-direction:column;align-items:stretch;padding:12px}
  #translateBtn,.compact-play-btn{width:100% !important;min-width:0}
  .meaning-row{align-items:stretch}
  .meaning-pill{width:100%;justify-content:center}
  .solo-media{min-height:180px !important}
  .single-line-label strong{font-size:18px}
  .translator-language-strip{grid-template-columns:1fr}
}


/* v20 translator polish */
.translation-topline{display:flex;align-items:center;gap:10px;margin-top:2px}
.lang-chip{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:16px;border:1px solid #dbe5f4;background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);box-shadow:0 8px 18px rgba(26,45,82,.05);color:#133052}
.lang-chip strong{font-size:15px;font-weight:800}
.live-chip{background:linear-gradient(180deg,#f6fbff 0%,#eef5ff 100%)}
.translator-main-word{font-size:clamp(40px,6vw,56px);line-height:1.05;letter-spacing:-.03em;color:#102746;margin-top:2px}
.meaning-pill-yellow{background:linear-gradient(180deg,#fff8d9 0%,#fff0ad 100%);border-color:#f1dd8d;box-shadow:0 10px 18px rgba(209,179,59,.16)}
.meaning-pill-yellow strong,.meaning-pill-yellow span{color:#102746}
.compact-play-btn{position:relative;display:inline-flex;align-items:center;gap:10px;min-width:0;padding:12px 20px;border-radius:20px;font-size:15px;font-weight:800;transition:transform .14s ease,box-shadow .14s ease,filter .14s ease}
.compact-play-btn:hover{transform:translateY(-1px)}
.compact-play-btn:active,.compact-play-btn.is-pressed{transform:scale(.97);filter:brightness(.98)}
.compact-play-btn.is-speaking{box-shadow:0 0 0 6px rgba(76,116,204,.13),0 14px 28px rgba(40,71,131,.22)}
.compact-play-btn.is-speaking::after,.compact-play-btn.is-speaking::before{content:'';position:absolute;inset:-8px;border-radius:24px;border:2px solid rgba(76,116,204,.20);animation:playPulse 1.1s ease-out forwards;pointer-events:none}
.compact-play-btn.is-speaking::before{animation-delay:.12s}
@keyframes playPulse{0%{transform:scale(.96);opacity:.9}100%{transform:scale(1.08);opacity:0}}
.play-icon{display:inline-grid;place-items:center;width:22px;height:22px}
.translator-lang-card:first-child{background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%)}
.translator-lang-card:last-child{background:linear-gradient(180deg,#fffaf0 0%,#fff5cf 100%);border-color:#f1e1a5}
.translator-lang-card strong{font-size:17px}
.translator-lang-card span{font-size:13px}
#translatorInput::placeholder{color:#6f7784;font-weight:700}
.clean-stage{border-radius:28px;box-shadow:inset 0 1px 0 rgba(255,255,255,.6), 0 18px 35px rgba(31,55,100,.06)}
.solo-card{background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);border:1px solid #dfe8f7;box-shadow:0 16px 32px rgba(24,45,88,.08)}
.solo-media{min-height:260px !important;padding:16px;background:linear-gradient(180deg,#f8fbff 0%,#edf4ff 100%)}
.solo-media img{width:100%;height:100%;max-height:360px;object-fit:contain;border-radius:18px;background:#eef4ff;padding:8px;box-shadow:none;filter:none}
.single-line-label{padding-top:2px}
.single-line-label strong{font-size:22px}
#translatorDetect .detect-badge,#translatorResult .translator-badge{font-size:13px}
@media (max-width:640px){
  .translator-main-word{font-size:42px}
  .translation-topline{justify-content:flex-start}
  .meaning-pill-yellow{justify-content:flex-start}
  .compact-play-btn{width:auto;min-height:50px}
  .solo-media{min-height:200px !important}
}


/* v21 cleanup: remove VIP styling, stronger Italian-learning UI */
body{
  font-weight:600;
  letter-spacing:.01em;
}
.sidebar{
  background:linear-gradient(180deg,#ffffff 0%,#f7faff 100%);
}
.brand h1,.main-label,.hero-panel h2,.lesson-banner h2,.story-overlay h2,.section-head h2{
  font-weight:900;
}
.brand p,.small-label,.section-head p,.hero-panel p,.lesson-intro,.word-example,.phrase-translation,.grammar-section-card p,.grammar-point p,.example-card p{
  font-weight:700;
}
.tag{
  background:linear-gradient(180deg,#fff7d6 0%,#ffeeb0 100%);
  color:#473100;
  border:1px solid #efd981;
  box-shadow:0 10px 18px rgba(212,179,61,.16);
}
.panel,.panel-soft,.word-card,.phrase-card,.grammar-card,.story-segment,.lesson-item,.extra-card,.example-card,.translator-lang-card,.translator-box,.translator-result,.translator-examples,.translator-detect{
  border-color:#d9e4f7;
  box-shadow:0 18px 36px rgba(28,49,92,.08);
}
.small-label{
  font-weight:800;
  color:#516585;
}
.topbar{
  padding:10px 12px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  border:1px solid #dbe5f4;
  border-radius:24px;
  box-shadow:0 14px 32px rgba(19,31,59,.05);
}
.menu-item{
  font-weight:800;
}
.menu-item.active,.menu-item:hover{
  background:linear-gradient(180deg,#f2f7ff 0%,#ebf3ff 100%);
}
.home-card h3,.word-meta h3,.phrase-texts h3,.translator-output h3{
  font-weight:900;
}
.page-indicator,.lesson-chip,.segment-kicker,.phrase-label{
  font-weight:900;
}
.meaning-pill,.meaning-pill-yellow{
  font-size:16px;
  font-weight:800;
  padding:12px 16px;
  border-radius:18px;
}
.meaning-pill-yellow{
  background:linear-gradient(180deg,#fff8d6 0%,#ffefab 100%);
  border:1px solid #edd57a;
  box-shadow:0 14px 24px rgba(212,179,61,.18);
}
.meaning-pill-yellow strong,.meaning-pill strong{
  font-weight:900;
}
.translator-lang-card{
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  border:1px solid #dce7f7;
  border-radius:24px;
}
.translator-lang-card strong{
  font-size:18px;
  font-weight:900;
}
.translator-lang-card span{
  font-weight:700;
  color:#5f728d;
}
.translator-box{
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  border-radius:26px;
}
#translatorInput{
  font-weight:800;
}
#translatorInput::placeholder{
  font-weight:700;
  color:#7b8798;
}
.suggestion-chip{
  font-weight:800;
  border:1px solid #dde6f6;
  box-shadow:0 10px 20px rgba(27,43,74,.06);
}
.translator-detect .detect-badge,.translator-badge,.translator-subtitle{
  font-weight:900;
  letter-spacing:.02em;
}
.translator-visual-stage{
  border:1px solid #dce6f6;
  border-style:solid;
  background:linear-gradient(180deg,#ffffff 0%,#f6faff 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
}
.translator-visual-card{
  border-radius:24px !important;
  overflow:hidden;
  border:1px solid #d8e4f5 !important;
  box-shadow:0 18px 34px rgba(31,55,100,.10) !important;
}
.translator-visual-card img{
  object-fit:cover;
}
.translator-output p,.translator-detect p,.translator-example-card span{
  font-weight:700;
}
.translator-example-card strong{
  font-weight:900;
}
.sidebar-box{display:none !important;}
@media (max-width:980px){
  .topbar{padding:10px}
  .brand h1{font-size:20px}
}


/* v22 translator learning polish */
#translateBtn{position:relative;overflow:hidden;min-width:146px;font-weight:900;letter-spacing:.01em}
#translateBtn:hover{transform:translateY(-1px)}
#translateBtn:active,#translateBtn.is-pressed{transform:scale(.975);box-shadow:0 8px 18px rgba(40,71,131,.22);filter:brightness(.98)}
#translateBtn.is-loading{opacity:.92;pointer-events:none}
#translateBtn.is-loading::after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.18),transparent);animation:translateSweep 1.1s linear infinite}
@keyframes translateSweep{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}
.two-meaning-row{display:flex;flex-wrap:wrap;gap:12px}
.meaning-pill-italian{background:linear-gradient(180deg,#eff8ef 0%,#dff2df 100%);border-color:#bfe2bf;box-shadow:0 10px 18px rgba(92,153,92,.12)}
.meaning-pill-italian strong,.meaning-pill-italian span{color:#143a22}
.translator-main-word{font-weight:900;letter-spacing:-.02em}
.translator-live-badge{font-weight:900;box-shadow:0 10px 22px rgba(28,48,88,.08)}
.translator-detect p,.translator-output p,.translator-lang-card span{font-weight:600}
.translator-lang-card strong,.translator-subtitle,.translator-example-card strong{font-weight:900}
@media (max-width:700px){.two-meaning-row{flex-direction:column}#translateBtn{width:100%}}


/* v23 translator meaning + image cleanup */
.live-chip-it{
  background:linear-gradient(180deg,#effaf1 0%,#daf3df 100%);
  border-color:#b8dfc1;
}
.live-chip-it strong,.italian-main-word.green-text{color:#17562e}
.single-meaning-row{display:flex;flex-wrap:wrap;gap:12px}
.meaning-pill-wide{max-width:100%}
.translator-visual-stage.clean-stage{align-items:stretch}
.solo-card{height:100%}
.solo-media{min-height:320px !important;padding:14px;background:linear-gradient(180deg,#f8fbff 0%,#eef4ff 100%);border:1px solid #dbe5f6}
.solo-media img{width:100%;height:100%;max-height:360px;object-fit:cover;border-radius:18px;background:#eef4ff;padding:0;display:block}
.single-line-label{padding-top:6px}
.single-line-label strong{font-size:24px;font-weight:900}
@media (max-width:900px){
  .solo-media{min-height:220px !important}
  .solo-media img{max-height:260px}
}

/* translator learning upgrade */
.richer-result-grid{align-items:start;gap:18px}
.meaning-stack{display:flex;flex-direction:column;gap:10px;margin:14px 0 12px}
.meaning-pill-blue{background:#e7f0ff;border:1px solid #c7d8ff;color:#18345e}
.tense-chip{background:#eef4d7;border:1px solid #d9e7a8;color:#36511d}
.learning-mini-card{background:#fff;border:1px solid #dfe7f7;border-radius:16px;padding:12px 14px;margin:12px 0;box-shadow:0 8px 24px rgba(19,43,94,.06)}
.learning-mini-title{font-weight:800;color:#16315f;margin-bottom:8px;font-size:14px}
.learning-mini-card p{margin:0;color:#35506f;font-weight:600;line-height:1.5}
.mini-pair-wrap{display:flex;flex-wrap:wrap;gap:10px}
.mini-pair{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:#f4f7ff;border:1px solid #d8e2fb;color:#17345f;font-size:14px}
.mini-pair strong{font-weight:800}
.mini-pair em{font-style:normal;color:#1f6b38;font-weight:700}
.vocab-pill{background:#eef9ec;border-color:#cde9c8}
@media (max-width: 900px){
  .richer-result-grid{grid-template-columns:1fr}
}


/* v27 translator button press color + single meaning box */
#translateBtn{
  transition:transform .16s ease, box-shadow .16s ease, filter .16s ease, background .16s ease, border-color .16s ease;
}
#translateBtn:active,
#translateBtn.is-pressed{
  background:linear-gradient(180deg,#22c55e 0%,#16a34a 100%) !important;
  border-color:#15803d !important;
  color:#fff !important;
  box-shadow:0 10px 22px rgba(22,163,74,.30) !important;
  transform:translateY(1px) scale(.975);
}
#translateBtn.is-loading{
  background:linear-gradient(180deg,#34d399 0%,#10b981 100%) !important;
  border-color:#059669 !important;
  color:#fff !important;
}
.meaning-stack{display:flex;flex-wrap:wrap;gap:10px}
.meaning-stack .meaning-pill{margin-right:0}


/* Story player upgrade */
.story-stage{position:relative;overflow:hidden}
.story-control-bar-upgraded{position:sticky;top:12px;z-index:4}
.story-player-shell{display:grid;grid-template-columns:1.2fr auto;gap:16px;align-items:center;padding:16px 18px;border:1px solid var(--line);border-radius:24px;background:linear-gradient(135deg,#fffdf4 0%,#fff 55%,#f7fbff 100%);box-shadow:0 16px 30px rgba(31,55,100,.08)}
.story-now-kicker{display:inline-flex;align-items:center;gap:8px;padding:7px 10px;border-radius:999px;background:#fff3bf;color:#6f5700;font-size:12px;font-weight:900;letter-spacing:.05em;text-transform:uppercase}
.story-now-line{margin-top:10px;font-size:20px;font-weight:900;line-height:1.45;color:#17263f}
.story-now-sub{margin-top:6px;color:var(--muted);font-weight:700}
.story-wave{display:flex;align-items:flex-end;gap:6px;min-height:58px;padding:10px 12px;border-radius:18px;background:#0f2447;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}
.story-wave span{display:block;width:7px;height:16px;border-radius:999px;background:linear-gradient(180deg,#ffe27a 0%,#8be0b0 100%);opacity:.92;transform-origin:center bottom;animation:storyWave 1s ease-in-out infinite;animation-play-state:paused}
.story-wave.playing span{animation-play-state:running}
.story-wave.paused span{animation-play-state:paused;opacity:.55}
.story-wave span:nth-child(2){animation-delay:.08s;height:22px}.story-wave span:nth-child(3){animation-delay:.16s;height:30px}.story-wave span:nth-child(4){animation-delay:.24s;height:24px}.story-wave span:nth-child(5){animation-delay:.32s;height:18px}.story-wave span:nth-child(6){animation-delay:.40s;height:27px}
@keyframes storyWave{0%,100%{transform:scaleY(.55)}50%{transform:scaleY(1.45)}}
.story-wrap{gap:16px}
.story-segment{padding:18px 18px 16px;border-radius:24px}
.story-segment.active{border-color:#f2cf63;box-shadow:0 18px 36px rgba(199,149,24,.16);background:linear-gradient(180deg,#fffdf3 0%,#ffffff 100%)}
.story-segment-top h3{font-size:22px}
.story-segment-top p{font-size:15px}
.story-para{grid-template-columns:1.15fr .85fr;align-items:start}
.story-it,.story-en{position:relative;border-radius:20px;padding:14px 16px}
.story-it{background:linear-gradient(180deg,#f7fff8 0%,#fcfffd 100%)}
.story-en{background:linear-gradient(180deg,#f4f8ff 0%,#fcfdff 100%)}
.story-line-list{display:grid;gap:10px;margin-top:12px}
.story-line-row{border:1px solid rgba(53,93,172,.10);border-radius:18px;padding:12px 13px;background:rgba(255,255,255,.72);transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease}
.story-line-row.active{border-color:#f0cd60;background:linear-gradient(180deg,#fff8c9 0%,#fffef2 100%);box-shadow:0 14px 28px rgba(199,149,24,.18);transform:translateY(-1px)}
.story-line-row.done{border-color:#cae8d4;background:linear-gradient(180deg,#f4fff7 0%,#ffffff 100%)}
.story-line-it{font-size:17px;line-height:1.8;font-weight:800;color:#173252}
.story-line-it .word{display:inline-block;padding:1px 2px;border-radius:8px;transition:background .12s ease,color .12s ease, transform .12s ease}
.story-line-it .word.active{background:#ffd84d;color:#1d1d1d;transform:translateY(-1px)}
.story-line-en{margin-top:8px;font-size:14px;line-height:1.6;color:#54657e;font-weight:700}
.story-line-label{display:inline-flex;align-items:center;gap:7px;margin-bottom:8px;padding:6px 10px;border-radius:999px;background:#eef5ff;color:#355dac;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.05em}
.story-segment-actions .story-mini-btn,.story-jump-row .play-btn{position:relative;overflow:hidden}
.story-segment-actions .story-mini-btn:active,.story-jump-row .play-btn:active,.story-control:active{transform:scale(.98)}
@media (max-width:900px){.story-player-shell,.story-para{grid-template-columns:1fr}.story-now-line{font-size:18px}}

/* --- v30 learning growth upgrade --- */
.home-upgrade-grid,
.progress-roadmap-grid,
.progress-bottom-grid,
.progress-top-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
  margin-top:18px;
}
.upgrade-panel,.progress-main-panel,.progress-side-panel{overflow:hidden;}
.pathway-steps,.mini-progress-grid,.progress-top-grid,.community-feed,.leaderboard-list,.badge-shelf,.level-roadmap,.roadmap-steps,.daily-challenge-box,.pronunciation-studio{display:grid;gap:12px;}
.pathway-step,.roadmap-step,.level-card,.leaderboard-item,.community-post,.badge-card,.challenge-card,.mini-progress-card,.pronunciation-card,.stat-shell{
  background:rgba(255,255,255,.72);
  border:1px solid rgba(120,120,160,.14);
  border-radius:18px;
  padding:14px;
}
.pathway-step,.roadmap-step{display:flex;justify-content:space-between;gap:14px;align-items:center;}
.step-copy h4,.badge-card h4,.challenge-card h4,.pronunciation-card h4{margin:0 0 6px;}
.step-copy p,.badge-card p,.challenge-card p,.leaderboard-item p,.community-post p,.pronunciation-card p{margin:0;color:#556;}
.step-kicker,.level-chip,.community-meta,.leaderboard-rank{font-size:.82rem;font-weight:700;opacity:.8;}
.step-actions,.challenge-actions,.pronunciation-actions{display:flex;gap:10px;flex-wrap:wrap;}
.progress-layout{display:grid;grid-template-columns:minmax(0,2.2fr) minmax(300px,1fr);gap:18px;}
.progress-bottom-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
.progress-top-grid{grid-template-columns:repeat(4,minmax(0,1fr));margin:18px 0;}
.stat-shell strong{display:block;font-size:1.8rem;}
.stat-shell span{color:#667;}
.mini-progress-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
.mini-progress-card strong{display:block;font-size:1.4rem;}
.challenge-card.done{border-color:#47b972;background:rgba(83,194,116,.12);}
.level-roadmap{grid-template-columns:repeat(4,minmax(0,1fr));}
.level-card.active{border-color:#5f79ff;box-shadow:0 10px 30px rgba(95,121,255,.14);transform:translateY(-2px);}
.level-card.locked{opacity:.58;}
.level-card.current{background:linear-gradient(135deg,rgba(95,121,255,.12),rgba(84,202,164,.12));}
.level-card .level-meter{height:8px;background:#e8ebff;border-radius:999px;overflow:hidden;margin-top:12px;}
.level-card .level-meter span{display:block;height:100%;background:linear-gradient(90deg,#5f79ff,#54caa4);}
.badge-shelf{grid-template-columns:repeat(2,minmax(0,1fr));}
.badge-card.locked{opacity:.5;filter:grayscale(.2);}
.badge-icon{font-size:1.5rem;display:inline-flex;margin-bottom:8px;}
.leaderboard-item{display:flex;justify-content:space-between;align-items:center;gap:12px;}
.leaderboard-item.you{border-color:#5f79ff;background:rgba(95,121,255,.09);}
.community-composer{display:grid;grid-template-columns:180px 1fr auto;gap:12px;margin:16px 0 18px;}
.community-composer input{border:none;outline:none;padding:14px 16px;border-radius:14px;background:#f6f7fd;}
.community-post{display:grid;gap:8px;}
.community-post .community-meta{display:flex;justify-content:space-between;gap:12px;}
.daily-challenge-mini{margin-bottom:12px;}
.pronunciation-card audio{width:100%;margin-top:8px;}
.pronunciation-card textarea,.pronunciation-card input{width:100%;border:none;outline:none;padding:12px 14px;border-radius:12px;background:#f6f7fd;margin-top:10px;}
.wordbank-audio-row{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:12px;}
.community-empty{padding:18px;border-radius:16px;background:#f7f8ff;color:#667;text-align:center;}
@media (max-width: 1100px){
  .progress-layout,.home-upgrade-grid,.progress-roadmap-grid,.progress-bottom-grid,.progress-top-grid,.mini-progress-grid,.level-roadmap,.badge-shelf,.community-composer{grid-template-columns:1fr;}
}
@media (max-width: 720px){
  .pathway-step,.roadmap-step,.leaderboard-item,.community-meta{flex-direction:column;align-items:flex-start;}
  .step-actions,.challenge-actions,.pronunciation-actions{width:100%;}
  .step-actions .primary-btn,.step-actions .secondary-btn,.challenge-actions .primary-btn,.pronunciation-actions .primary-btn,.pronunciation-actions .secondary-btn,.community-composer .primary-btn{width:100%;}
  .topbar{position:sticky;top:0;z-index:20;backdrop-filter:blur(12px);}
  .content{padding:14px;}
  .hero-grid,.home-card-grid{gap:14px;}
  .story-control-bar-upgraded{display:grid;grid-template-columns:repeat(2,1fr);}
  .story-jump-row{grid-template-columns:1fr;}
  .practice-stats{grid-template-columns:repeat(2,minmax(0,1fr));}
}


/* --- v31 progress + community polish --- */
.progress-insight-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-top:18px;margin-bottom:18px}
.weekly-activity{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:12px;align-items:end;min-height:190px}
.activity-day{display:grid;gap:8px;justify-items:center}
.activity-day strong{font-size:13px;color:#29466d}.activity-day small{font-size:12px;color:#73839a}
.activity-bar{width:100%;height:120px;border-radius:18px;background:linear-gradient(180deg,#fff8d9,#fff3b3);border:1px solid #f1dd89;display:flex;align-items:flex-end;padding:8px;box-shadow:inset 0 1px 0 rgba(255,255,255,.7)}
.activity-bar span{display:block;width:100%;border-radius:12px;background:linear-gradient(180deg,#ffd95a,#f0a61e)}
.focus-tracker,.milestone-list{display:grid;gap:12px}.focus-card,.milestone-card{padding:14px;border-radius:18px;background:linear-gradient(180deg,#fffef7,#fff7d6);border:1px solid #f1df8c}
.focus-meta{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:8px}.focus-meta span{font-size:13px;color:#695f3e}
.focus-meter{height:10px;border-radius:999px;background:#f5ebbb;overflow:hidden}.focus-meter span{display:block;height:100%;background:linear-gradient(90deg,#ffcc3e,#e79810)}
.community-layout{display:grid;gap:18px}
.community-info-bar,.community-stats-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}
.community-stats-grid{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:10px}
.community-info-chip,.community-stat-card{padding:14px;border-radius:18px;background:linear-gradient(180deg,#fffef6,#fff7cf);border:1px solid #edd77e}
.community-info-chip strong,.community-stat-card strong{display:block;color:#7d5a05}.community-stat-card strong{font-size:1.5rem}
.community-info-chip span,.community-stat-card span{color:#766942}
.community-composer{grid-template-columns:160px 140px 1fr auto;background:linear-gradient(180deg,#fffdf4,#fff8da);padding:14px;border-radius:22px;border:1px solid #eedc91}
.community-composer input,.community-composer select{border:none;outline:none;padding:14px 16px;border-radius:14px;background:#fffdf2;border:1px solid #f0df98}
.thread-yellow{background:linear-gradient(180deg,#fffdf1 0%,#fff4b8 100%);border:1px solid #edd06a;box-shadow:0 12px 28px rgba(182,145,33,.14)}
.community-post-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.community-topic-pill,.community-thread-badge{display:inline-flex;align-items:center;padding:7px 11px;border-radius:999px;background:#fff3b8;border:1px solid #e6c75b;color:#7d5a05;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.05em}
.community-thread-badge{background:#ffe684}
.community-thread-actions{display:flex;gap:10px;flex-wrap:wrap}
.community-post p{font-size:15px;line-height:1.7;color:#463d1e}
.badge-card.unlocked{background:linear-gradient(180deg,#fffef6,#eefbf2);border-color:#9fddb2}
.level-card.current{background:linear-gradient(135deg,rgba(255,221,112,.35),rgba(255,244,190,.82))}
.level-card .level-meter{height:10px;background:#f0e5ba}.level-card .level-meter span{background:linear-gradient(90deg,#ffcc3e,#ef9815)}
@media (max-width:1100px){.progress-insight-grid,.community-stats-grid,.community-info-bar{grid-template-columns:1fr 1fr}.weekly-activity{grid-template-columns:repeat(7,minmax(42px,1fr))}}
@media (max-width:720px){.progress-insight-grid,.community-info-bar,.community-stats-grid,.weekly-activity,.community-composer{grid-template-columns:1fr}.community-post-head{flex-direction:column;align-items:flex-start}}

/* v33 auth */
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.auth-dock{display:flex;align-items:center;gap:10px;margin-left:auto}
.auth-pill{padding:10px 14px;border-radius:999px;background:#fff7d1;border:1px solid rgba(214,170,0,.25);font-weight:700;color:#7a5a00}
.auth-open-btn{min-width:110px}
.auth-modal{position:fixed;inset:0;display:grid;place-items:center;z-index:2000}
.auth-modal.hidden{display:none}
.auth-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.55);backdrop-filter:blur(4px)}
.auth-card{position:relative;z-index:2;width:min(92vw,560px);background:#fff;border-radius:24px;padding:20px;box-shadow:0 24px 70px rgba(15,23,42,.22);display:grid;gap:12px}
.auth-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.auth-tabs{display:flex;gap:8px;background:#f6f7fb;padding:6px;border-radius:999px}
.auth-tab{border:none;background:transparent;padding:10px 14px;border-radius:999px;font-weight:700;cursor:pointer}
.auth-tab.active{background:#ffd84d;color:#4d3a00}
.auth-panel{display:none;gap:10px}
.auth-panel.active{display:grid}
.auth-panel input{width:100%;padding:14px 16px;border:1px solid #d8dbe7;border-radius:16px;font-size:15px}
.auth-note{font-size:14px;color:#475569;background:#f8fafc;border-radius:16px;padding:12px 14px}
.auth-note.error{background:#fff1f2;color:#b42318}
.auth-session-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.auth-live-user{font-size:14px;color:#475569}
.auth-inline-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;background:#fff7d1;border:1px solid rgba(214,170,0,.28);padding:14px 16px;border-radius:18px;margin:12px 0 16px;color:#5f4700}
.auth-inline-banner strong{display:block}
.auth-inline-banner span{font-size:14px;color:#7a5a00}
.auth-inline-btn{white-space:nowrap}
@media (max-width: 720px){
  .auth-dock{width:100%;justify-content:space-between}
  .auth-card{padding:18px;border-radius:22px}
}

/* v36 community + admin refresh */
.community-top-grid,
.community-main-grid,
.summary-chip-grid,
.admin-users-grid,
.admin-user-stats,
.identity-stats{display:grid;gap:16px}
.community-top-grid{grid-template-columns:1.1fr .9fr;margin-bottom:16px}
.community-main-grid{grid-template-columns:1.05fr .95fr;align-items:start}
.community-composer-v2{display:grid;grid-template-columns:160px 1fr auto;gap:12px;margin:16px 0}
.community-composer-v2 input,.community-composer-v2 select,.thread-comment-box input,.admin-user-actions input{width:100%;padding:14px 16px;border-radius:16px;border:1px solid var(--line);background:#fff;color:#17365f;font:inherit}
.community-inline-message{min-height:24px;margin-bottom:10px;color:#2f5d1d;font-weight:700}
.community-inline-message.error{color:#b23a2b}
.community-post{cursor:pointer;border:1px solid #ead37c;background:linear-gradient(180deg,#fffbe6,#fff5c9);margin-bottom:14px}
.community-post.active{box-shadow:0 18px 36px rgba(170,128,0,.16);border-color:#d9b83d}
.community-topic-pill{display:inline-flex;padding:8px 12px;border-radius:999px;background:#f0cf58;color:#6b5100;font-weight:800;font-size:12px;text-transform:uppercase;letter-spacing:.04em}
.community-thread-badge{padding:10px 12px;border-radius:999px;background:rgba(255,255,255,.75);color:#7a5d00;font-weight:800}
.community-thread-panel{position:sticky;top:20px}
.thread-card,.thread-placeholder{border:1px solid var(--line);border-radius:24px;padding:18px;background:linear-gradient(180deg,#ffffff,#fbfcff)}
.thread-head h3{margin:6px 0 8px}
.thread-head p{margin:0;color:#31445a;line-height:1.7}
.thread-comment-list{display:grid;gap:12px;margin:16px 0}
.thread-comment-item{padding:14px;border-radius:18px;background:#f7faff;border:1px solid #e5edf9}
.thread-comment-top{display:flex;justify-content:space-between;gap:12px;margin-bottom:8px;color:#5b6d82;font-size:13px}
.thread-comment-item p{margin:0;color:#24384f;line-height:1.65}
.thread-comment-actions,.community-thread-actions,.admin-user-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.thread-comment-box{display:grid;grid-template-columns:1fr auto;gap:12px}
.thread-empty{padding:12px 0;color:#667a92}
.community-account-card h3,.community-user-summary h3{margin:6px 0}
.summary-chip-grid{grid-template-columns:repeat(4,1fr);margin-top:10px}
.summary-chip,.identity-chip,.community-stat-card{padding:14px;border-radius:18px;background:#fff;border:1px solid var(--line);display:grid;gap:4px}
.summary-chip strong,.identity-chip strong,.community-stat-card strong{font-size:24px;color:#16365f}
.progress-identity-box{margin-bottom:16px}
.identity-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
.identity-head h3{margin:6px 0}.identity-head p{margin:0;color:#586b83}
.identity-stats{grid-template-columns:repeat(3,1fr)}
.admin-panel-wrap{margin-top:20px}
.admin-note{margin-bottom:14px;color:#5a6f88;font-weight:700}
.admin-users-grid{grid-template-columns:repeat(2,1fr)}
.admin-user-card{padding:18px;border-radius:22px;border:1px solid var(--line);background:linear-gradient(180deg,#ffffff,#f9fbff)}
.admin-user-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:6px}.admin-user-head span{padding:6px 10px;border-radius:999px;background:#edf3ff;color:#284f87;font-weight:800;font-size:12px;text-transform:uppercase}
.admin-user-card p{margin:0 0 10px;color:#536780}.admin-user-stats{grid-template-columns:repeat(2,1fr);margin-bottom:10px}.admin-user-stats span{padding:10px 12px;border-radius:14px;background:#fff;border:1px solid var(--line);font-size:13px;font-weight:700;color:#28425e}
.thread-note{margin-top:10px;color:#5f6f84}
@media (max-width:1100px){.community-top-grid,.community-main-grid,.summary-chip-grid,.admin-users-grid,.identity-stats{grid-template-columns:1fr}.community-thread-panel{position:static}.community-composer-v2,.thread-comment-box{grid-template-columns:1fr}}


/* v40 profile cleanup */
.community-account-card{
  background: linear-gradient(135deg,#fff7d6,#ffe7a3);
  border:1px solid #e9c75c;
}
.community-user-summary{
  background: linear-gradient(135deg,#eef6ff,#dfeeff);
  border:1px solid #bcd3fb;
}
.profile-frame{display:flex;align-items:center;gap:14px;padding:14px;border-radius:20px;background:rgba(255,255,255,.72);border:1px solid rgba(255,255,255,.9);box-shadow:0 12px 24px rgba(21,34,64,.08)}
.profile-frame-soft{margin:8px 0 12px;background:linear-gradient(135deg,#ffffff,#f5f9ff);border:1px solid #dbe7fb}
.profile-avatar{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;font-size:28px;background:linear-gradient(135deg,#294f90,#4a7bd1);color:#fff;box-shadow:0 12px 22px rgba(41,79,144,.25)}
.summary-chip:nth-child(1){background:linear-gradient(135deg,#fff7d8,#ffefb3)}
.summary-chip:nth-child(2){background:linear-gradient(135deg,#eef8ff,#dcebff)}
.summary-chip:nth-child(3){background:linear-gradient(135deg,#f4ecff,#e8dbff)}
.summary-chip:nth-child(4){background:linear-gradient(135deg,#eafcf1,#d5f8e5)}
.summary-chip:nth-child(5){background:linear-gradient(135deg,#fff1ea,#ffdcca)}
.summary-chip:nth-child(6){background:linear-gradient(135deg,#fff8ea,#ffeebf)}
.thread-note{margin-top:12px;font-weight:700;color:#6b5100}

/* v41 community refinements */
.community-head-clean p{display:none}
.compact-community-top-grid{grid-template-columns:.95fr 1.05fr;gap:12px}
.compact-profile-frame{padding:12px 14px;border-radius:18px;gap:12px;min-height:auto}
.compact-summary-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:6px}
.compact-summary-grid .summary-chip{padding:12px;border-radius:16px}
.compact-community-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.compact-community-stats .community-stat-card{padding:12px;border-radius:16px}
.compact-community-main-grid{grid-template-columns:1.08fr .92fr;gap:14px}
.compact-community-post{padding:14px 16px;border-radius:20px;gap:10px;margin-bottom:12px}
.compact-post-head{align-items:flex-start;gap:10px}
.post-meta-wrap{display:grid;gap:8px}
.community-meta{display:flex;align-items:center;gap:10px}
.community-meta span{display:block;color:#6f7b8c;font-size:12px}
.open-thread-btn{padding:10px 14px;border-radius:999px}
.compact-actions .secondary-btn,.compact-thread-box .primary-btn,.reply-composer .secondary-btn,.load-more-btn{padding:10px 14px;border-radius:14px}
.compact-thread-card{padding:14px;border-radius:22px}
.compact-thread-box{margin-top:12px}
.thread-comment-item{padding:12px 13px;border-radius:16px}
.thread-reply-item{margin-top:10px;margin-left:18px;padding:10px 12px;border-radius:14px;background:#fff;border:1px solid #dfe6f4}
.reply-list{display:grid;gap:8px;margin-top:6px}
.reply-composer{display:none;grid-template-columns:1fr auto;gap:8px;margin-top:10px}
.reply-composer.visible{display:grid}
.reply-composer input{width:100%;padding:10px 12px;border-radius:14px;border:1px solid var(--line);background:#fff;color:#17365f;font:inherit}
.load-more-wrap{display:flex;justify-content:center;margin-top:10px}
.avatar-with-badge{position:relative;overflow:hidden}
.avatar-with-badge .avatar-emoji{font-size:20px;line-height:1}
.avatar-with-badge .avatar-initial{position:absolute;right:6px;bottom:5px;font-size:10px;font-weight:800;background:rgba(255,255,255,.9);color:#1f3c64;border-radius:999px;padding:1px 4px}
.profile-avatar{width:46px;height:46px;border-radius:16px;background:linear-gradient(135deg,#3b66ad,#7aa2e6);display:grid;place-items:center;color:#fff;box-shadow:0 10px 18px rgba(59,102,173,.22)}
.compact-identity-head{gap:14px}
.identity-profile-wrap{display:flex;align-items:center;gap:12px}
.compact-identity-stats{gap:10px}
.compact-identity-stats .identity-chip{padding:12px;min-width:88px}
.summary-posts{background:linear-gradient(135deg,#fff3bf,#ffe68a)}
.summary-comments{background:linear-gradient(135deg,#e3f2fd,#c8e7ff)}
.summary-xp{background:linear-gradient(135deg,#f2e8ff,#ddc6ff)}
.summary-tests{background:linear-gradient(135deg,#ffe8d6,#ffd0b5)}
.stat-posts{background:linear-gradient(135deg,#fff8d9,#ffefb8)}
.stat-questions{background:linear-gradient(135deg,#e9f3ff,#d2e6ff)}
.stat-wins{background:linear-gradient(135deg,#f3ebff,#e1d2ff)}
.stat-comments{background:linear-gradient(135deg,#e9f8ff,#d4efff)}
.community-topic-pill.topic-tip,.community-post.topic-tip{background:linear-gradient(135deg,#efe4ff,#dbc5ff);border-color:#a877ff}
.community-topic-pill.topic-goal,.community-post.topic-goal{background:linear-gradient(135deg,#e3f2ff,#c7e4ff);border-color:#67aef3}
.community-topic-pill.topic-question,.community-post.topic-question{background:linear-gradient(135deg,#fff1dc,#ffd7a6);border-color:#f3b454}
.community-topic-pill.topic-win,.community-post.topic-win{background:linear-gradient(135deg,#ecffe5,#cef5c0);border-color:#7fd47c}
.community-post.topic-tip p,.community-post.topic-goal p,.community-post.topic-question p,.community-post.topic-win p{color:#24384f}
.community-topic-pill{display:inline-flex;align-items:center;justify-content:center;padding:7px 12px;border-radius:999px;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;border:1px solid transparent;color:#28435f;background:#fff;max-width:max-content}
.thread-card.topic-tip{background:linear-gradient(180deg,#faf5ff,#f0e6ff)}
.thread-card.topic-goal{background:linear-gradient(180deg,#f4fbff,#e5f4ff)}
.thread-card.topic-question{background:linear-gradient(180deg,#fff9ef,#fff1da)}
.thread-card.topic-win{background:linear-gradient(180deg,#f8fff3,#edffe3)}
.community-composer-v2.compact-composer input,.community-composer-v2.compact-composer select{padding:12px 14px;border-radius:16px}
.community-composer-v2.compact-composer{grid-template-columns:160px 1fr auto;gap:10px}
@media (max-width:1100px){.compact-community-top-grid,.compact-community-main-grid,.compact-summary-grid,.compact-community-stats{grid-template-columns:1fr}}
@media (max-width:720px){.compact-summary-grid{grid-template-columns:repeat(2,1fr)}.community-composer-v2.compact-composer,.reply-composer,.compact-thread-box{grid-template-columns:1fr}.thread-reply-item{margin-left:8px}}


.auth-forgot-btn{margin-top:12px;width:100%;}
.auth-forgot{margin-top:12px;display:grid;gap:10px;}
.auth-forgot.hidden{display:none;}
.auth-forgot-note{font-size:14px;color:#5f6f8b;line-height:1.4;}

.auth-card-wide{max-width:640px;width:min(640px,92vw)}
.auth-account-box{display:grid;gap:14px}
.auth-inline-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.auth-inline-actions{display:flex;gap:12px;flex-wrap:wrap}
.auth-warning-box{padding:12px 14px;border-radius:18px;background:#fff2d7;color:#7a5b00;font-weight:700}
.admin-modal-wrap{display:grid;gap:14px}
.admin-modal-head h4{margin:4px 0 0;font-size:1.1rem}
.admin-table-wrap{overflow:auto;border:1px solid #d9e1ef;border-radius:20px;background:#fff}
.admin-table{width:100%;border-collapse:collapse;min-width:860px}
.admin-table th,.admin-table td{padding:12px 10px;border-bottom:1px solid #edf2fb;text-align:left;vertical-align:middle}
.admin-table th{font-size:.82rem;text-transform:uppercase;letter-spacing:.04em;color:#556a8a;background:#f5f8ff}
.admin-table-actions{display:flex;gap:8px;flex-wrap:wrap}
.admin-temp-pass{min-width:110px;padding:10px 12px;border-radius:14px;border:1px solid #cad4e5;background:#fffef5}
.status-badge{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:#eef3ff;color:#2f4f8f;font-weight:800;font-size:.8rem}
.status-badge.warn{background:#fff1c8;color:#8b6300}
@media (max-width:720px){.auth-inline-grid{grid-template-columns:1fr}}

.auth-forgot-row,.auth-forgot-step{display:grid;gap:10px;}
.auth-forgot-step.hidden{display:none;}
.auth-forgot-step .primary-btn{width:100%;}


/* v46 thread polish */
.profile-frame-rich{margin-top:6px}
.profile-frame-copy h3{margin:0 0 2px}
.profile-frame-copy p{margin:0;color:#5b6b86}
.limit-pill-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}
.limit-pill{padding:11px 12px;border-radius:16px;border:1px solid #d7e1f5;background:#fff;display:grid;gap:2px}
.limit-pill strong{font-size:18px;color:#193766}
.limit-pill span{font-size:13px;color:#66789a}
.limit-pill-posts{background:linear-gradient(135deg,#fff6d2,#ffe9a2)}
.limit-pill-replies{background:linear-gradient(135deg,#edf7ff,#dceeff)}
.compact-summary-grid-six{grid-template-columns:repeat(3,minmax(0,1fr))}
.summary-post-limit{background:linear-gradient(135deg,#fff2e9,#ffd8c2)}
.summary-reply-limit{background:linear-gradient(135deg,#edf8ef,#d3f4de)}
.community-post.topic-question{background:linear-gradient(135deg,#ffeecf,#ffe2b1);border-color:#f1b24b}
.community-post.topic-goal{background:linear-gradient(135deg,#e7f4ff,#cfe8ff);border-color:#69ace7}
.community-post.topic-tip{background:linear-gradient(135deg,#f1e9ff,#e0d0ff);border-color:#a582f2}
.community-post.topic-win{background:linear-gradient(135deg,#fff7cf,#ffec8d);border-color:#e2c24a}
.community-topic-pill.topic-question{background:#ffe6b3;color:#8b5900;border-color:#f0bf59}
.community-topic-pill.topic-goal{background:#d9edff;color:#145b95;border-color:#75b5ee}
.community-topic-pill.topic-tip{background:#eadcff;color:#5d33b0;border-color:#af8bf0}
.community-topic-pill.topic-win{background:#fff1a8;color:#7b5a00;border-color:#e5c74f}
.thread-card.topic-question{background:linear-gradient(180deg,#fff7e7,#fffef8);border:1px solid #f0c36a}
.thread-card.topic-goal{background:linear-gradient(180deg,#eef7ff,#fafcff);border:1px solid #8ac0ef}
.thread-card.topic-tip{background:linear-gradient(180deg,#f5efff,#faf8ff);border:1px solid #b89ef2}
.thread-card.topic-win{background:linear-gradient(180deg,#fff8dc,#fffdf2);border:1px solid #e7ca64}
.thread-comment-item{padding:12px 14px;border-radius:18px;background:#fff;border:1px solid #dde5f1;margin-bottom:12px}
.comment-target-line,.reply-target-line{display:flex;align-items:center;gap:6px;margin:4px 0 8px;color:#6c7c99;font-size:13px;font-weight:700}
.reply-target-btn{border:0;background:transparent;padding:0;color:#3562b5;font-weight:800;cursor:default}
.thread-replies-wrap{margin-top:10px;display:grid;gap:10px}
.thread-reply-item{margin-top:0;margin-left:22px;padding:12px 13px;border-radius:16px;border:1px solid #dfe6f4;box-shadow:0 6px 16px rgba(32,54,92,.05)}
.thread-reply-item.reply-tone-1{background:linear-gradient(135deg,#eef7ff,#f9fcff)}
.thread-reply-item.reply-tone-2{background:linear-gradient(135deg,#fff5ea,#fffaf5)}
.thread-reply-item.reply-tone-3{background:linear-gradient(135deg,#f4efff,#fbf9ff)}
.thread-reply-item.reply-tone-4{background:linear-gradient(135deg,#edf9f0,#f9fffb)}
.reply-actions-row .secondary-btn,.comment-actions-row .secondary-btn{background:#fff}
@media (max-width:1100px){.compact-summary-grid-six{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:720px){.limit-pill-row,.compact-summary-grid-six{grid-template-columns:1fr}.thread-reply-item{margin-left:10px}}

.auth-card-head h3{font-size:18px;line-height:1.25;margin:0;}
.auth-card-head .small-label{font-size:12px;color:#5b6b88;font-weight:700;}
.auth-tabs{overflow:auto;scrollbar-width:none;}
.auth-tabs::-webkit-scrollbar{display:none;}
.auth-tab{font-size:14px;padding:9px 14px;}
.auth-panel input{background:#fbfcff;}
.auth-forgot-row{grid-template-columns:1fr;}
.auth-alert{padding:12px 14px;border-radius:16px;font-size:14px;line-height:1.45;}
.auth-alert-danger{background:#fff1f3;border:1px solid #f1b9c3;color:#b42318;}
.auth-forgot-note{font-size:13px;color:#5f6f8b;}
.auth-note{font-size:13px;border:1px solid #edf1f7;}
@media (min-width:700px){.auth-forgot-row{grid-template-columns:1fr auto;align-items:center;}.auth-forgot-row .secondary-btn{min-width:150px;}}
@media (max-width:640px){.auth-card{width:min(94vw,560px);padding:16px;border-radius:20px;gap:10px;}.auth-card-head h3{font-size:16px;}.auth-tab{font-size:13px;padding:8px 12px;}.auth-panel input{padding:13px 14px;border-radius:14px;font-size:14px;}.auth-forgot-btn,.auth-panel .primary-btn,.auth-panel .secondary-btn{min-height:46px;}.auth-note{font-size:12px;padding:10px 12px;}.auth-alert{font-size:13px;padding:10px 12px;}}


.reply-mention-bar{font-size:.82rem;color:#4e6388;margin-bottom:6px;font-weight:700}
.reply-target-line{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.reply-target-btn{background:none;border:none;color:#335fb8;font-weight:800;padding:0;cursor:pointer}
.auth-bell-badge{margin-left:6px}
.auth-bell-inline{display:inline-block;background:#fff4cf;color:#7a5a00;padding:8px 10px;border-radius:999px;font-weight:800}
.reply-actions-row .secondary-btn,.comment-actions-row .secondary-btn{min-width:auto}
.thread-reply-item{border-left:3px solid rgba(62,104,194,.18)}
.reply-tone-1{background:#eef5ff}.reply-tone-2{background:#fff6ea}.reply-tone-3{background:#f5efff}.reply-tone-4{background:#eefbf3}


/* v49 reply lineage */
.thread-replies-wrap{position:relative}
.thread-reply-item{position:relative;overflow:visible}
.thread-reply-item.depth-1{margin-left:18px}
.thread-reply-item.depth-2{margin-left:34px}
.thread-reply-item.depth-3{margin-left:50px}
.thread-reply-item.depth-4{margin-left:66px}
.reply-connector{position:absolute;left:-16px;top:18px;bottom:18px;width:2px;border-radius:999px;background:linear-gradient(180deg,#9dc2ff,#d7e6ff)}
.reply-connector.depth-2{background:linear-gradient(180deg,#ffcf8f,#ffe9c7)}
.reply-connector.depth-3{background:linear-gradient(180deg,#d1b8ff,#efe6ff)}
.reply-connector.depth-4{background:linear-gradient(180deg,#aee8c0,#ddf8e5)}
.reply-target-rich{font-weight:800;color:#5d7092}
.reply-parent-preview{display:grid;gap:4px;padding:10px 12px;margin:8px 0 10px;border-radius:14px;border:1px solid #dfe8f6;background:#f8fbff}
.reply-parent-preview.main-preview{background:linear-gradient(135deg,#eef6ff,#f9fcff);border-color:#cfe0fb}
.reply-parent-preview.nested-preview.depth-1{background:linear-gradient(135deg,#edf6ff,#fbfdff);border-color:#d3e4fb}
.reply-parent-preview.nested-preview.depth-2{background:linear-gradient(135deg,#fff5ea,#fffaf5);border-color:#ffe0b9}
.reply-parent-preview.nested-preview.depth-3{background:linear-gradient(135deg,#f5efff,#fbf9ff);border-color:#dfd0ff}
.reply-parent-preview.nested-preview.depth-4{background:linear-gradient(135deg,#edf9f0,#f9fffb);border-color:#cdebd7}
.reply-preview-label{font-size:12px;font-weight:900;color:#35598d;text-transform:uppercase;letter-spacing:.04em}
.reply-preview-text{font-size:13px;color:#47607f;line-height:1.45}
.comment-target-line{margin-bottom:10px}
@media (max-width:720px){
  .thread-reply-item.depth-1,.thread-reply-item.depth-2,.thread-reply-item.depth-3,.thread-reply-item.depth-4{margin-left:10px}
  .reply-connector{left:-8px}
}

.reply-composer{margin-top:10px;margin-bottom:4px}
.thread-reply-item .reply-composer{margin-top:12px}


/* Grammar Guide refresh */
.grammar-sidebar{gap:12px}
.grammar-nav-btn{padding:14px 15px;border-radius:20px;min-height:auto;box-shadow:0 10px 22px rgba(19,31,59,.05)}
.grammar-nav-btn strong{font-size:15px}
.grammar-nav-topline{display:flex;align-items:center;justify-content:space-between;gap:10px}
.grammar-nav-icon{width:36px;height:36px;border-radius:12px;display:grid;place-items:center;background:rgba(255,255,255,.72);font-size:18px;box-shadow:inset 0 0 0 1px rgba(255,255,255,.38)}
.grammar-nav-count{font-size:11px;font-weight:800;padding:6px 9px;border-radius:999px;background:rgba(255,255,255,.82);color:#22324a;letter-spacing:.02em}
.grammar-nav-btn.is-green{background:linear-gradient(135deg,#effdf4 0%,#f9fff7 100%)}
.grammar-nav-btn.is-blue{background:linear-gradient(135deg,#eef6ff 0%,#fbfdff 100%)}
.grammar-nav-btn.is-purple{background:linear-gradient(135deg,#f6f0ff 0%,#fcf9ff 100%)}
.grammar-nav-btn.is-orange{background:linear-gradient(135deg,#fff5ea 0%,#fffdf8 100%)}
.grammar-nav-btn.is-red{background:linear-gradient(135deg,#fff0f0 0%,#fff9f9 100%)}
.grammar-submenu{gap:10px}
.grammar-tab{padding:10px 14px;border-radius:14px;font-size:14px;min-height:auto;background:linear-gradient(180deg,#fff,#f7faff)}
.grammar-tab span{display:flex;align-items:center;gap:8px}
.grammar-tab.active{transform:translateY(-1px);box-shadow:0 12px 22px rgba(53,93,172,.16)}
.grammar-summary-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:4px}
.grammar-mini-box{padding:10px 12px;border-radius:16px;background:linear-gradient(180deg,#ffffff,#f8fbff);border:1px solid var(--line);box-shadow:0 10px 18px rgba(19,31,59,.04)}
.grammar-mini-box span{display:block;font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin-bottom:4px}
.grammar-mini-box strong{font-size:14px;color:#1f2f46}
.grammar-section-card{padding:16px 17px;border-radius:20px}
.grammar-section-card.accent-card.is-green{background:linear-gradient(135deg,#effdf4 0%,#ffffff 100%)}
.grammar-section-card.accent-card.is-blue{background:linear-gradient(135deg,#eef6ff 0%,#ffffff 100%)}
.grammar-section-card.accent-card.is-purple{background:linear-gradient(135deg,#f6f0ff 0%,#ffffff 100%)}
.grammar-section-card.accent-card.is-orange{background:linear-gradient(135deg,#fff5ea 0%,#ffffff 100%)}
.grammar-section-card.accent-card.is-red{background:linear-gradient(135deg,#fff0f0 0%,#ffffff 100%)}
.grammar-card-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.grammar-card-chip{padding:7px 10px;border-radius:999px;background:rgba(255,255,255,.82);border:1px solid rgba(126,151,198,.22);font-size:11px;font-weight:800;color:#2d4360;text-transform:uppercase;letter-spacing:.03em}
.grammar-points.compact{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.grammar-point{padding:12px 13px;border-radius:16px;background:linear-gradient(180deg,#ffffff,#fbfcff)}
.grammar-point:nth-child(4n+1){background:linear-gradient(135deg,#eef6ff,#ffffff)}
.grammar-point:nth-child(4n+2){background:linear-gradient(135deg,#effdf4,#ffffff)}
.grammar-point:nth-child(4n+3){background:linear-gradient(135deg,#fff5ea,#ffffff)}
.grammar-point:nth-child(4n+4){background:linear-gradient(135deg,#f6f0ff,#ffffff)}
.grammar-examples-grid{gap:10px}
.example-card.colorful{position:relative;padding:14px 14px 14px 46px;border-radius:18px;overflow:hidden}
.example-card.colorful:nth-child(4n+1){background:linear-gradient(135deg,#eef6ff,#ffffff)}
.example-card.colorful:nth-child(4n+2){background:linear-gradient(135deg,#effdf4,#ffffff)}
.example-card.colorful:nth-child(4n+3){background:linear-gradient(135deg,#fff5ea,#ffffff)}
.example-card.colorful:nth-child(4n+4){background:linear-gradient(135deg,#f6f0ff,#ffffff)}
.example-index{position:absolute;left:12px;top:12px;width:24px;height:24px;border-radius:999px;background:#fff;border:1px solid rgba(126,151,198,.26);display:grid;place-items:center;font-size:12px;font-weight:800;color:#304154}
.practice-boxes .grammar-point{min-height:110px}
.grammar-practice-checklist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.check-item{padding:11px 12px;border-radius:14px;background:linear-gradient(180deg,#ffffff,#f8fbff);border:1px solid var(--line);font-weight:700;color:#26405f}
@media (max-width:1100px){.grammar-summary-strip,.grammar-points.compact,.grammar-practice-checklist{grid-template-columns:1fr}}

/* === 2026 UI refresh: screenshot-style modern learning dashboard === */
:root{
  --ui-bg:#f5f7fb;
  --ui-panel:#ffffff;
  --ui-line:#dfe6f1;
  --ui-text:#14233b;
  --ui-muted:#5f6f86;
  --ui-blue:#2563eb;
  --ui-blue-soft:#eef5ff;
  --ui-green:#16a34a;
  --ui-green-soft:#effbf3;
  --ui-purple:#9333ea;
  --ui-purple-soft:#f6efff;
  --ui-orange:#f97316;
  --ui-orange-soft:#fff4ea;
  --ui-pink:#ec4899;
  --ui-pink-soft:#fff0f7;
  --ui-cyan:#06b6d4;
  --ui-cyan-soft:#edfafd;
  --ui-yellow:#eab308;
  --ui-yellow-soft:#fffbea;
  --ui-violet:#7c3aed;
  --ui-violet-soft:#f3efff;
  --ui-shadow:0 20px 45px rgba(28,44,76,.07);
}
body{background:linear-gradient(180deg,#f7f9fc 0%,#f3f6fb 100%);color:var(--ui-text)}
.app-shell{grid-template-columns:300px 1fr;gap:16px;max-width:1536px;margin:0 auto}
.sidebar{background:rgba(255,255,255,.78);border:1px solid var(--ui-line);border-radius:28px;padding:24px 18px;box-shadow:var(--ui-shadow);margin:0 0 16px 0;top:16px;height:calc(100vh - 32px)}
.content{padding:16px 16px 26px}
.brand-v2{margin-bottom:18px}.brand-logo{width:56px;height:56px;border-radius:18px;background:linear-gradient(135deg,#22c55e,#2563eb);font-size:26px;box-shadow:0 14px 28px rgba(37,99,235,.18)}
.brand h1{font-size:18px;font-weight:900;letter-spacing:-.02em}.brand p{font-size:14px;color:var(--ui-muted)}
.sidebar-title{font-size:14px;font-weight:900;color:#22344f;margin:4px 6px 14px}
.menu-v2{display:grid;gap:12px}.menu-item{display:grid;grid-template-columns:52px 1fr 18px;align-items:center;gap:12px;padding:14px 14px;border-radius:20px;border:1px solid var(--ui-line);background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);box-shadow:none}
.menu-item:hover,.menu-item.active{transform:none;box-shadow:0 14px 28px rgba(31,55,100,.08)}
.menu-item.active{background:#f6fff8;border-color:#9fdfb0}
.menu-icon{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;color:#fff;font-size:20px;font-weight:700;box-shadow:inset 0 1px 0 rgba(255,255,255,.28)}
.menu-icon.green{background:linear-gradient(135deg,#22c55e,#16a34a)}
.menu-icon.blue{background:linear-gradient(135deg,#4f8cff,#2563eb)}
.menu-icon.purple{background:linear-gradient(135deg,#a855f7,#7c3aed)}
.menu-icon.orange{background:linear-gradient(135deg,#fb923c,#f97316)}
.menu-icon.pink{background:linear-gradient(135deg,#f472b6,#ec4899)}
.menu-icon.cyan{background:linear-gradient(135deg,#22d3ee,#06b6d4)}
.menu-icon.yellow{background:linear-gradient(135deg,#facc15,#eab308)}
.menu-icon.violet{background:linear-gradient(135deg,#8b5cf6,#7c3aed)}
.menu-icon.slate{background:linear-gradient(135deg,#64748b,#475569)}
.menu-icon.home{background:linear-gradient(135deg,#f59e0b,#ef4444)}
.menu-copy{display:grid;gap:3px;text-align:left}.menu-copy strong{font-size:15px;color:#27405f}.menu-copy small{font-size:12px;color:var(--ui-muted)}.menu-arrow{font-size:28px;line-height:1;color:#6f85a3}
.sidebar-streak-card{margin-top:18px;border:1px solid #f3b683;background:linear-gradient(180deg,#fff9f2 0%,#fff 100%);box-shadow:none}.streak-top{font-weight:900;color:#f97316;margin-bottom:8px}.streak-pill{margin-top:14px;padding:12px 14px;border-radius:999px;background:#fff;color:#44576f;font-weight:800;text-align:center;border:1px solid #f2dcc7}
.topbar-v2{display:flex;align-items:center;justify-content:space-between;gap:16px;position:sticky;top:16px;z-index:10;padding:18px 24px;border-radius:28px;background:rgba(255,255,255,.76);border:1px solid rgba(223,230,241,.9);box-shadow:var(--ui-shadow);backdrop-filter:blur(14px)}
.small-label{font-size:14px;font-weight:900;color:#b026ff;text-transform:none;letter-spacing:0}.main-label{font-size:15px;color:var(--ui-muted);font-weight:700}
.topbar-actions{display:flex;gap:12px}.icon-btn.soft,.topbar .icon-btn{width:58px;height:58px;border-radius:16px;border:1px solid var(--ui-line);background:linear-gradient(180deg,#fff 0%,#fdf7ff 100%);font-size:28px;box-shadow:none}
#menuToggle{display:none}
.panel,.panel-soft,.word-card,.phrase-card,.grammar-card,.story-segment,.lesson-item,.extra-card,.example-card,.translator-lang-card,.translator-box,.translator-result,.translator-examples,.translator-detect{border:1px solid var(--ui-line);border-radius:28px;background:linear-gradient(180deg,#fff 0%,#fcfdff 100%);box-shadow:var(--ui-shadow)}
.section-head h2,.lesson-banner h2,.hero-panel h2,.story-overlay h2{letter-spacing:-.03em}
.primary-btn,.play-btn,.phrase-play{background:linear-gradient(135deg,#2f6df6,#2563eb);border:none;border-radius:16px;padding:16px 24px;min-height:54px;box-shadow:0 14px 24px rgba(37,99,235,.22)}
.secondary-btn,.tab-btn,.jump-select,.story-control{background:#fff;border:1px solid var(--ui-line);color:#22344f;border-radius:16px;padding:15px 20px;min-height:54px}
.page-indicator{background:#eef3fb;color:#27405f;border-radius:999px;padding:12px 18px}
.grammar-layout-v2{grid-template-columns:280px 1fr;gap:18px}
.grammar-sidebar{background:transparent;border:none;box-shadow:none;padding:0}
.grammar-main-panel{padding:24px 26px;gap:22px}
.grammar-banner{align-items:flex-start;padding-top:6px}.grammar-banner .small-label{margin-bottom:10px}.grammar-banner h2{font-size:56px;line-height:1.05;margin:0 0 8px}.grammar-banner p{font-size:16px;color:var(--ui-muted);font-weight:700;max-width:880px}.lesson-badge#grammarDetailHero{width:164px;height:82px;border-radius:24px;background:#f3f4f7;display:flex;align-items:center;justify-content:center;font-size:42px;box-shadow:none;border:1px solid #eceff4}
.help-note.blue{display:grid;grid-template-columns:repeat(4,1fr);gap:0;padding:0;overflow:hidden;border-radius:24px;border:1px solid #f1ddcf;background:linear-gradient(180deg,#fbfeff 0%,#fffdfb 100%);min-height:92px}
.help-note.blue::before{content:'🟢';display:flex;align-items:center;justify-content:center;font-size:30px;background:var(--ui-green-soft)}
.help-note.blue{font-size:0}
.help-note.blue{position:relative}
.help-note.blue::after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,transparent 24.8%,#e7edf6 25%,#e7edf6 25.2%,transparent 25.3%,transparent 49.8%,#e7edf6 50%,#e7edf6 50.2%,transparent 50.3%,transparent 74.8%,#e7edf6 75%,#e7edf6 75.2%,transparent 75.3%)}
#grammarFocusNote{color:transparent}
#grammarFocusNote{display:grid;grid-template-columns:repeat(4,1fr)}
#grammarFocusNote > *{display:none}
#grammarFocusNote{padding:0}
#grammarFocusNote{background:linear-gradient(180deg,#fbfeff 0%,#fffdfb 100%)}
#grammarFocusNote::before{content:'🎯\A Focus\A One rule at a time';white-space:pre;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:4px;padding:22px 26px;font-size:14px;line-height:1.3;color:#1b8f39;font-weight:900;background:transparent}
#grammarFocusNote::marker{display:none}
#grammarFocusNote::after{content:''}
/* overlay text cells */
.grammar-main-panel .help-note.blue{position:relative}
.grammar-main-panel .help-note.blue .focus-card{display:none}
.grammar-main-panel .help-note.blue{grid-template-columns:repeat(4,minmax(0,1fr))}
.grammar-main-panel .help-note.blue span{display:none}
.grammar-main-panel .help-note.blue:has(+ .practice-launch-row){}
/* inject visible columns */
.grammar-main-panel .help-note.blue{overflow:hidden}
.grammar-main-panel .help-note.blue{font-size:14px;color:#22344f}
.grammar-main-panel .help-note.blue{padding:0}
.grammar-main-panel .help-note.blue{display:flex}
.grammar-main-panel .help-note.blue::before{content:'🎯  Focus\AOne rule at a time';white-space:pre;display:flex;flex-direction:column;justify-content:center;padding:22px 26px;min-width:25%;font-weight:900;color:#16a34a}
.grammar-main-panel .help-note.blue::after{content:'⭐  Goal\AMaster with confidence';white-space:pre;display:flex;flex-direction:column;justify-content:center;padding:22px 26px;min-width:25%;font-weight:900;color:#f97316;border-left:1px solid #e7edf6}
.grammar-main-panel .help-note.blue{justify-content:space-between}
.practice-launch-row{display:flex;justify-content:space-between;align-items:center;margin-top:-4px}
.practice-launch-row .primary-btn{order:2}.practice-launch-row .page-indicator{order:1;background:#eef3fb}.practice-launch-row .page-indicator::before{content:'Quick check after grammar study';font-weight:800}.practice-launch-row .page-indicator{font-size:0}
#openPracticeFromGrammarBtn::before{content:'Start Smart Practice';font-size:16px}
#openPracticeFromGrammarBtn{font-size:0;padding-inline:26px}
.grammar-submenu{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;border-bottom:1px solid #e8edf5}
.grammar-tab{min-height:70px;border-radius:20px 20px 0 0;border:1px solid #e6eaf2;border-bottom:none;background:linear-gradient(180deg,#fff 0%,#fafbfd 100%);font-size:17px;font-weight:900;color:#27405f;justify-content:flex-start;padding:0 22px}.grammar-tab + .grammar-tab{margin-left:8px}.grammar-tab.active{background:#fff;box-shadow:none;border-bottom:3px solid var(--ui-blue)}
.grammar-tab:nth-child(1){color:var(--ui-blue)}.grammar-tab:nth-child(2){color:#8b2db8}.grammar-tab:nth-child(3){color:#16a34a}.grammar-tab:nth-child(4){color:#f97316}
.grammar-tab.active:nth-child(1){background:linear-gradient(180deg,#ffffff 0%,#f9fbff 100%)}
.grammar-tab.active:nth-child(2){border-bottom-color:#8b2db8}.grammar-tab.active:nth-child(3){border-bottom-color:#16a34a}.grammar-tab.active:nth-child(4){border-bottom-color:#f97316}
.grammar-detail-body{grid-template-columns:1.55fr .95fr;gap:22px;align-items:start}
.grammar-summary-strip{grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.grammar-mini-box{border-radius:22px;padding:18px;background:#fff}.grammar-mini-box:nth-child(1){background:linear-gradient(180deg,#eef5ff,#fff)}.grammar-mini-box:nth-child(2){background:linear-gradient(180deg,#effbf3,#fff)}.grammar-mini-box:nth-child(3){background:linear-gradient(180deg,#fff4ea,#fff)}
.grammar-section-card{padding:24px;border-radius:24px}.grammar-section-card h3{font-size:22px;margin-bottom:12px}.grammar-section-card p{font-size:16px;line-height:1.7;color:#304154}
.grammar-points.compact{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.grammar-point{border:1px solid var(--ui-line);border-radius:22px;padding:22px 20px;min-height:146px;display:grid;align-content:start;gap:10px}.grammar-point strong{font-size:17px}.grammar-point p{font-size:15px;line-height:1.65;margin:0}
.grammar-section-card + .grammar-points.compact{grid-column:1/2}
#grammarExamples{grid-column:1/-1}.grammar-examples-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.example-card.colorful{border-radius:22px;padding:18px 18px 20px;box-shadow:none;border:1px solid var(--ui-line)}.example-card.colorful:nth-child(3n+1){background:linear-gradient(180deg,#eef5ff,#fff)}.example-card.colorful:nth-child(3n+2){background:linear-gradient(180deg,#effbf3,#fff)}.example-card.colorful:nth-child(3n+3){background:linear-gradient(180deg,#fff4ea,#fff)}.example-index{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#fff;border:1px solid var(--ui-line);font-weight:900;color:#27405f;margin-bottom:12px}
.grammar-practice-checklist{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:18px}.check-item{padding:16px 18px;border-radius:18px;background:#effbf3;border:1px solid #cce9d4;font-weight:800;color:#1c5b35}
/* right side cards from grammar content */
.grammar-detail-body > .grammar-section-card:nth-of-type(2),
.grammar-detail-body > .grammar-points.compact:nth-of-type(2){grid-column:2/3}
/* make overview resemble screenshot with a right info rail */
#grammarDetailBody{position:relative}
#grammarDetailBody .grammar-section-card{box-shadow:none}
#grammarDetailBody .grammar-section-card:nth-of-type(1){grid-column:1/2}
#grammarDetailBody .grammar-points.compact{grid-column:1/2}
#grammarDetailBody .grammar-points.compact + .grammar-section-card{grid-column:2/3}
#grammarDetailBody .grammar-points.compact + .grammar-section-card + .grammar-section-card{grid-column:2/3}
/* global cards */
.home-card,.upgrade-panel,.progress-main-panel,.progress-side-panel,.word-card,.phrase-card,.lesson-item,.story-segment,.translator-panel{border-radius:28px}
.story-stage{border-radius:30px}
.toolbar{gap:14px}
@media (max-width:1200px){
  .grammar-banner h2{font-size:42px}
  .grammar-detail-body{grid-template-columns:1fr}
  .grammar-examples-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
  .app-shell{grid-template-columns:1fr}
  #menuToggle{display:grid}
  .sidebar{position:fixed;left:-110%;top:12px;width:min(90vw,330px);height:calc(100vh - 24px);z-index:30}
  .sidebar.open{left:12px}
  .topbar-actions{display:none}
  .grammar-layout-v2{grid-template-columns:1fr}
  .grammar-submenu{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;border-bottom:none}
  .grammar-tab,.grammar-tab + .grammar-tab{margin-left:0;border:1px solid #e6eaf2;border-radius:18px}
  .grammar-tab.active{border-bottom:1px solid #e6eaf2}
}
@media (max-width:640px){
  .grammar-banner h2{font-size:34px}
  .grammar-main-panel{padding:18px}
  .grammar-points.compact,.grammar-practice-checklist,.grammar-examples-grid{grid-template-columns:1fr}
  .practice-launch-row{gap:10px}
}

/* refined grammar widgets */
.help-note.blue{display:grid !important;grid-template-columns:repeat(4,minmax(0,1fr));gap:0 !important;padding:0 !important;font-size:14px !important;color:inherit !important;overflow:hidden;border-radius:24px;background:linear-gradient(180deg,#fbfeff 0%,#fffdfb 100%) !important;border:1px solid #f1ddcf !important;box-shadow:none !important}
.help-note.blue::before,.help-note.blue::after{display:none !important;content:none !important}
.focus-pill{display:flex;align-items:center;gap:14px;padding:22px 24px;min-height:92px;position:relative}.focus-pill + .focus-pill{border-left:1px solid #e7edf6}.focus-pill strong{display:block;font-size:15px}.focus-pill small{display:block;color:var(--ui-muted);font-size:14px;margin-top:4px}.focus-emoji{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;font-size:24px;background:#fff;border:1px solid #e5ebf4}.focus-pill.green strong{color:#16a34a}.focus-pill.blue strong{color:#2563eb}.focus-pill.purple strong{color:#9333ea}.focus-pill.orange strong{color:#f97316}
.overview-main-card{grid-column:1/2}
.overview-side-stack{grid-column:2/3;display:grid;gap:18px}
.overview-feature-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-top:18px}.overview-feature{border:1px solid var(--ui-line);border-radius:22px;padding:22px 16px;background:#fff;text-align:center;display:grid;gap:10px;align-content:start}.overview-feature.blue{background:linear-gradient(180deg,#eef5ff,#fff)}.overview-feature.pink{background:linear-gradient(180deg,#fff0f7,#fff)}.overview-feature.green{background:linear-gradient(180deg,#effbf3,#fff)}.overview-feature.orange{background:linear-gradient(180deg,#fff4ea,#fff)}.overview-icon{font-size:42px;font-weight:900;line-height:1;color:#2563eb}.overview-feature.pink .overview-icon{color:#db2777}.overview-feature.green .overview-icon{color:#16a34a}.overview-feature.orange .overview-icon{color:#f59e0b}.overview-feature strong{font-size:16px}.overview-feature span{color:#42556d;font-weight:700}
.quick-tip-box{margin-top:18px;padding:20px 22px;border-radius:20px;background:linear-gradient(180deg,#eef5ff 0%,#f8fbff 100%);border:1px solid #dbe7fb}.quick-tip-box strong{display:block;color:#2563eb;font-size:18px;margin-bottom:6px}.quick-tip-box p{margin:0 !important}
.side-table-card,.learn-card{background:linear-gradient(180deg,#f9fbff 0%,#fff 100%)}.side-table-card h3{color:#2563eb}.learn-card h3{color:#15803d}
.overview-table-wrap{padding:8px 0 0}.overview-table{width:100%;border-collapse:separate;border-spacing:0;overflow:hidden;border-radius:18px;border:1px solid #dfe6f1}.overview-table th,.overview-table td{padding:16px 14px;border-right:1px solid #dfe6f1;border-bottom:1px solid #dfe6f1;text-align:left;font-weight:700}.overview-table th:last-child,.overview-table td:last-child{border-right:none}.overview-table tr:last-child td{border-bottom:none}.overview-table thead th{background:#f4f7fb;color:#22344f}.overview-table tbody td:first-child{color:#2563eb}
.learn-list{display:grid;gap:14px}.learn-item{display:flex;align-items:flex-start;gap:10px;font-weight:800;color:#1f5d37}.learn-item span{color:#2d3f57;font-weight:700}
@media (max-width:1200px){.overview-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.overview-side-stack{grid-column:1/2}}
@media (max-width:640px){.help-note.blue{grid-template-columns:1fr 1fr}.focus-pill{padding:16px}.focus-pill:nth-child(3){border-left:none;border-top:1px solid #e7edf6}.focus-pill:nth-child(4){border-top:1px solid #e7edf6}.overview-feature-grid{grid-template-columns:1fr 1fr}}

/* --- menu + layout fit fixes --- */
.app-shell{align-items:start}
.content,.lesson-main,.practice-main,.panel,.panel-soft,.grammar-main-panel,.grammar-detail-body,.overview-main-card,.overview-side-stack{min-width:0}
.sidebar-title{letter-spacing:.01em}
.menu-v2{max-height:calc(100vh - 230px);overflow:auto;padding-right:4px}
.menu-v2::-webkit-scrollbar{width:8px}.menu-v2::-webkit-scrollbar-thumb{background:#d9e2f2;border-radius:999px}
.menu-item{min-height:86px;align-items:center}
.menu-copy{min-width:0;display:grid;gap:4px}
.menu-copy strong,.menu-copy small{display:block;max-width:100%;overflow-wrap:anywhere;word-break:break-word}
.menu-copy strong{font-size:15px;line-height:1.2;color:#20314e}
.menu-copy small{font-size:12px;line-height:1.35;color:#667a96}
.menu-arrow{align-self:center;justify-self:end;font-size:18px;color:#6d7f9b}
.topbar-v2{position:relative;top:0;margin-bottom:16px}
.section-focused .topbar-v2{position:sticky;top:16px}
.lesson-layout,.practice-layout{align-items:start}
.grammar-layout-v2{grid-template-columns:minmax(260px,320px) minmax(0,1fr)}
.grammar-sidebar{position:sticky;top:108px;max-height:calc(100vh - 130px);overflow:auto;padding-right:6px}
.grammar-sidebar::-webkit-scrollbar{width:8px}.grammar-sidebar::-webkit-scrollbar-thumb{background:#d9e2f2;border-radius:999px}
.grammar-submenu{display:flex;flex-wrap:wrap;gap:12px;border-bottom:none}
.grammar-tab{flex:0 0 auto;min-width:160px;max-width:100%;padding:16px 18px;border-radius:20px}
.grammar-tab span{display:block;white-space:normal;line-height:1.25}
.grammar-detail-body{grid-template-columns:minmax(0,1.35fr) minmax(320px,.85fr)}
.overview-feature-grid{grid-template-columns:repeat(4,minmax(110px,1fr))}
.overview-feature{min-width:0;padding:18px 12px}
.overview-feature strong,.overview-feature span{overflow-wrap:anywhere}
.overview-icon{font-size:34px}
.grammar-section-card,.grammar-point,.quick-tip-box,.side-table-card,.learn-card{min-width:0}
.overview-table-wrap{overflow:auto}
.overview-table{min-width:420px}
.learn-item{align-items:flex-start;line-height:1.45}
.grammar-nav-btn{min-width:0}
.grammar-nav-btn strong,.grammar-nav-btn .mini{display:block;overflow-wrap:anywhere;word-break:break-word}
@media (max-width:1500px){
  .grammar-detail-body{grid-template-columns:1fr}
  .overview-side-stack{grid-column:1/2}
  .overview-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:1200px){
  .app-shell{grid-template-columns:280px minmax(0,1fr)}
  .grammar-layout-v2,.lesson-layout{grid-template-columns:1fr}
  .grammar-sidebar{position:static;max-height:none;overflow:visible;padding-right:0}
}
@media (max-width:980px){
  .topbar-v2{padding:16px 18px;border-radius:22px}
  .menu-item{min-height:78px}
}
@media (max-width:640px){
  .grammar-submenu{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .grammar-tab{min-width:0;width:100%}
  .overview-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* === Final grammar/menu cleanup === */
.topbar-back-btn{display:none;white-space:nowrap;min-height:48px;border-radius:18px;padding:0 18px;font-weight:800}
body.menu-hidden-desktop .topbar-back-btn{display:inline-flex;align-items:center}
@media (min-width:1101px){
  body.menu-hidden-desktop .app-shell{grid-template-columns:0 minmax(0,1fr)!important;gap:0!important;max-width:1720px}
  body.menu-hidden-desktop .sidebar{opacity:0;pointer-events:none;transform:translateX(-24px);width:0!important;padding:0!important;margin:0!important;border:none!important;overflow:hidden}
  body.menu-hidden-desktop .content{padding-left:10px!important}
}

/* keep mobile drawer behavior normal */
@media (max-width:1100px){
  .topbar-back-btn{display:none!important}
}

/* grammar page spacing and overlap fixes */
.grammar-layout-v2{grid-template-columns:minmax(235px,270px) minmax(0,1fr)!important;gap:18px!important}
.grammar-sidebar{gap:10px!important}
.grammar-nav-btn{padding:14px 14px!important;border-radius:22px!important;min-height:auto!important;align-content:start!important}
.grammar-nav-btn strong{font-size:15px!important;line-height:1.25!important}
.grammar-nav-btn .mini{font-size:12px!important;line-height:1.45!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.grammar-nav-topline{margin-bottom:8px!important}
.grammar-nav-count{font-size:12px!important;padding:7px 10px!important}

.grammar-main-panel{padding:20px 22px!important;gap:18px!important;min-width:0}
.grammar-banner{align-items:flex-start!important;gap:18px!important}
.grammar-banner h2{font-size:clamp(32px,4.2vw,58px)!important;line-height:1.02!important;letter-spacing:-.03em}
.grammar-banner p{max-width:900px!important;font-size:18px!important;line-height:1.55!important}
#grammarDetailHero{min-width:138px;min-height:94px;border-radius:22px!important;display:grid;place-items:center;font-size:52px!important;padding:14px 18px!important}

#grammarFocusNote{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:0!important;border:1px solid #e8edf6!important;border-radius:26px!important;overflow:hidden!important;padding:0!important;background:#fff!important}
#grammarFocusNote::before,#grammarFocusNote::after{display:none!important;content:none!important}
#grammarFocusNote .focus-pill{border:none!important;border-right:1px solid #e8edf6!important;border-radius:0!important;min-height:88px;padding:18px 22px!important;display:flex!important;align-items:center!important;gap:14px!important;background:transparent!important}
#grammarFocusNote .focus-pill:last-child{border-right:none!important}
#grammarFocusNote .focus-emoji{width:48px;height:48px;border-radius:999px;display:grid;place-items:center;font-size:24px;background:rgba(255,255,255,.8)}
#grammarFocusNote .focus-pill strong{display:block;font-size:18px;line-height:1.1;margin-bottom:4px}
#grammarFocusNote .focus-pill small{display:block;font-size:14px;color:#57687f}

.practice-launch-row{justify-content:space-between!important;align-items:center!important;gap:14px!important;flex-wrap:wrap}
.practice-launch-row .page-indicator{margin-left:auto}

.grammar-submenu{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important;border-bottom:none!important}
.grammar-tab{min-height:96px!important;border-radius:26px!important;padding:20px 16px!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;text-align:left!important}
.grammar-tab span{font-size:15px!important;line-height:1.35!important;font-weight:800!important}

.grammar-detail-body{display:grid!important;gap:18px!important;min-width:0}
.grammar-detail-body.tab-overview{grid-template-columns:minmax(0,1.45fr) minmax(320px,.9fr)!important;align-items:start}
.grammar-detail-body.tab-overview > .grammar-summary-strip{grid-column:1/-1}
.grammar-detail-body.tab-overview > .overview-main-card{grid-column:1/2}
.grammar-detail-body.tab-overview > .overview-side-stack{grid-column:2/3}
.grammar-detail-body.tab-pattern,
.grammar-detail-body.tab-examples,
.grammar-detail-body.tab-practice{grid-template-columns:1fr!important}
.grammar-detail-body.tab-exercises{grid-template-columns:1fr!important}
.grammar-detail-body.tab-exercises > *{grid-column:1/-1!important}
.grammar-detail-body.tab-exercises .grammar-exercise-layout{grid-template-columns:1fr!important}
.grammar-detail-body.tab-exercises .exercise-master-card{width:100%!important;max-width:none!important}
.grammar-detail-body.tab-exercises .exercise-inline-panel{width:100%!important}

.grammar-detail-body.tab-pattern > .grammar-points,
.grammar-detail-body.tab-practice > .grammar-points,
.grammar-detail-body.tab-practice > .grammar-practice-checklist{grid-column:auto!important}
.grammar-detail-body > .grammar-section-card:nth-of-type(2),
.grammar-detail-body > .grammar-points.compact:nth-of-type(2){grid-column:auto!important}

.grammar-summary-strip{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:14px!important;margin-bottom:0!important}
.grammar-mini-box{padding:16px 18px!important;border-radius:20px!important;min-height:86px;display:grid;align-content:center}
.grammar-mini-box span{font-size:12px!important;letter-spacing:.08em;text-transform:uppercase;font-weight:800;color:#6d7d91}
.grammar-mini-box strong{font-size:22px!important;line-height:1.15!important}

.overview-main-card,.overview-side-stack,.grammar-section-card,.grammar-point,.example-card,.quick-tip-box{min-width:0}
.overview-main-card{padding:22px!important}
.overview-main-card p{font-size:16px!important;line-height:1.8!important}
.overview-feature-grid{grid-template-columns:repeat(4,minmax(120px,1fr))!important;gap:14px!important}
.overview-feature{padding:18px 14px!important;min-height:160px!important}
.overview-icon{font-size:54px!important;line-height:1!important}
.overview-feature strong{font-size:16px!important}
.overview-feature span{font-size:13px!important;line-height:1.45!important;word-break:break-word}
.quick-tip-box{margin-top:16px!important;padding:18px 18px!important;border-radius:22px!important}
.quick-tip-box p{margin-top:8px!important}

.overview-side-stack{display:grid!important;gap:16px!important;align-content:start}
.side-table-card,.learn-card{padding:18px!important}
.overview-table{table-layout:fixed;width:100%}
.overview-table th,.overview-table td{padding:14px 12px!important;font-size:14px!important;word-break:break-word}
.learn-list{display:grid;gap:12px}
.learn-item{display:flex;gap:10px;align-items:flex-start;font-size:15px;line-height:1.5}

.grammar-points.compact,.practice-boxes{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important}
.grammar-point{padding:18px!important;border-radius:22px!important}
.grammar-point strong{font-size:16px!important;display:block;margin-bottom:8px}
.grammar-point p{font-size:14px!important;line-height:1.7!important}

.grammar-examples-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important}
.example-card.colorful{padding:18px 18px 18px 60px!important;position:relative!important;min-height:128px!important}
.example-card.colorful h4,.example-card.colorful p{overflow-wrap:anywhere}
.example-index{left:16px!important;top:16px!important;width:32px!important;height:32px!important}

.grammar-practice-checklist{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:12px!important}
.check-item{padding:14px 16px!important;border-radius:18px!important;font-size:14px!important;line-height:1.45!important}

@media (max-width:1320px){
  .grammar-detail-body.tab-overview{grid-template-columns:1fr!important}
  .overview-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media (max-width:1100px){
  .grammar-layout-v2{grid-template-columns:1fr!important}
  #grammarFocusNote{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .grammar-submenu{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .grammar-examples-grid,.grammar-points.compact,.practice-boxes,.grammar-practice-checklist{grid-template-columns:1fr!important}
}
@media (max-width:720px){
  .grammar-main-panel{padding:16px!important}
  .grammar-banner h2{font-size:34px!important}
  #grammarDetailHero{min-width:96px;min-height:72px;font-size:36px!important}
  #grammarFocusNote{grid-template-columns:1fr!important}
  #grammarFocusNote .focus-pill{border-right:none!important;border-bottom:1px solid #e8edf6!important}
  #grammarFocusNote .focus-pill:last-child{border-bottom:none!important}
  .grammar-submenu{grid-template-columns:1fr 1fr!important}
  .overview-feature-grid{grid-template-columns:1fr 1fr!important}
}


/* FIX layout centering */
.content, .community-page, .home-page {
  max-width: 1200px;
  margin: 0 auto;
}

/* prevent vertical centering bug */
.app-shell{
  align-items: start !important;
}

/* remove extra top gap */
body, .content{
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* fix large empty scroll issue */
.main-wrapper, .page{
  min-height: auto !important;
  height: auto !important;
}

/* slight zoom reduction */
body{
  font-size: 15px;
}


/* v52 desktop balance fix */
@media (min-width: 1101px){
  .content, .community-page, .home-page {
    max-width: 1320px !important;
    margin: 0 auto !important;
  }

  .app-shell{
    grid-template-columns: 340px minmax(0,1fr) !important;
    max-width: 1460px !important;
    gap: 20px !important;
    align-items: start !important;
  }

  .sidebar{
    width: 100% !important;
    padding: 22px 18px !important;
  }

  .grammar-sidebar,
  .lesson-sidebar{
    min-width: 0;
  }

  .topbar-v2,
  .section-focused .topbar-v2{
    position: sticky !important;
    top: 8px !important;
    z-index: 40 !important;
    padding: 12px 18px !important;
    border-radius: 22px !important;
    margin-bottom: 12px !important;
  }

  .topbar-v2 .icon-btn.soft,
  .topbar-v2 .icon-btn,
  .topbar-back-btn,
  .topbar-v2 .primary-btn,
  .topbar-v2 .secondary-btn{
    min-height: 46px !important;
    height: 46px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-radius: 16px !important;
  }

  .topbar-v2 .icon-btn.soft,
  .topbar-v2 .icon-btn{
    width: 46px !important;
    font-size: 22px !important;
  }

  .topbar-brand h1,
  .topbar-v2 h1,
  .topbar-v2 h2,
  .topbar-v2 h3{
    font-size: 16px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }

  .topbar-v2 p,
  .topbar-v2 .muted,
  .topbar-v2 small{
    font-size: 12px !important;
    line-height: 1.3 !important;
    margin: 2px 0 0 !important;
  }

  .grammar-banner,
  .grammar-banner-hero,
  .overview-hero,
  .lesson-hero{
    scroll-margin-top: 84px;
  }

  body.menu-hidden-desktop .app-shell{
    grid-template-columns: 0 minmax(0,1fr) !important;
    max-width: 1500px !important;
    gap: 0 !important;
  }

  body.menu-hidden-desktop .content,
  body.menu-hidden-desktop .community-page,
  body.menu-hidden-desktop .home-page{
    max-width: 1380px !important;
  }
}


/* v53 facebook-like replies + modern community */
.modern-composer{position:relative;grid-template-columns:160px 1fr;align-items:center;background:linear-gradient(135deg,#fff7dc,#fffef6);border:1px solid #efd27a;border-radius:24px;padding:14px;box-shadow:0 18px 34px rgba(34,52,86,.08)}
.composer-post-note{grid-column:2;justify-self:start;font-size:12px;font-weight:800;color:#7183a0;margin-top:-4px}
.fb-composer-shell{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:22px;border:1px solid #dbe4f3;background:linear-gradient(180deg,#fff,#f9fbff);box-shadow:inset 0 1px 0 rgba(255,255,255,.85)}
.fb-composer-shell.main-composer{min-height:64px}
.fb-composer-shell.mini{padding:8px 10px;border-radius:18px}
.fb-composer-shell input{flex:1;border:0;outline:none;background:transparent;font:inherit;color:#17365f;min-width:0}
.fb-composer-shell input::placeholder{color:#7e8da8}
.fb-composer-tools{display:flex;align-items:center;gap:8px}
.composer-tool-btn,.composer-send-btn{border:0;cursor:pointer;display:grid;place-items:center;transition:.16s ease}
.composer-tool-btn{width:38px;height:38px;border-radius:999px;background:#f1f5fb;color:#355dac;font-size:18px}
.composer-send-btn{width:42px;height:42px;border-radius:999px;background:linear-gradient(135deg,#2f62e9,#2b57cc);color:#fff;font-size:18px;box-shadow:0 12px 24px rgba(47,98,233,.28)}
.composer-tool-btn:hover,.composer-send-btn:hover{transform:translateY(-1px)}
.emoji-popover{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;padding:10px 12px;border-radius:18px;border:1px solid #d9e3f2;background:#fff;box-shadow:0 18px 34px rgba(19,31,59,.12)}
.emoji-choice{border:0;background:#f4f7fc;border-radius:12px;padding:8px 10px;cursor:pointer;font-size:18px}
.facebook-comment-box{display:grid;gap:8px;margin-top:16px;padding:14px;border-radius:22px;background:linear-gradient(135deg,#f8fbff,#ffffff);border:1px solid #dde6f5}
.comment-helper-row{display:flex;justify-content:space-between;gap:10px;color:#70809b;font-size:12px;font-weight:800;padding:0 4px}
.reply-composer{display:none;gap:8px;margin-top:12px;padding:12px;border-radius:18px;background:linear-gradient(135deg,#f8fbff,#ffffff);border:1px solid #dce5f4}
.reply-composer.visible{display:grid}
.reply-mention-bar{margin-bottom:0}
.compact-thread-card{box-shadow:0 18px 36px rgba(21,34,64,.08)}
.thread-comment-item{background:linear-gradient(180deg,#ffffff,#fbfdff);box-shadow:0 10px 22px rgba(31,55,100,.05)}
.thread-comment-top strong{font-size:15px;color:#2a4162}
.thread-comment-top span{font-weight:700}
.thread-comment-actions.compact-actions{margin-top:12px}
.reply-actions-row .secondary-btn,.comment-actions-row .secondary-btn{border-radius:14px;padding:10px 14px}
.compact-community-main-grid{grid-template-columns:.92fr 1.08fr;align-items:start}
.community-feed{display:grid;gap:14px}
.compact-community-post{background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(248,251,255,.96));box-shadow:0 16px 30px rgba(21,34,64,.06)}
.compact-community-post.active{transform:translateY(-1px);box-shadow:0 20px 36px rgba(31,55,100,.12)}
.community-thread-panel{position:sticky;top:96px}
.community-head-clean h2{font-size:2rem;letter-spacing:-.03em}
.community-account-card,.community-user-summary,.community-stat-card{box-shadow:0 16px 30px rgba(21,34,64,.06)}
.community-topic-pill{box-shadow:inset 0 1px 0 rgba(255,255,255,.7)}
.thread-empty,.community-empty{padding:18px;border-radius:18px;background:linear-gradient(135deg,#f7faff,#ffffff);border:1px dashed #cfdaec;text-align:center;font-weight:700}
.load-more-btn{background:linear-gradient(180deg,#fff,#f8fbff);border:1px solid #d6e0f0}
@media (max-width:1100px){.compact-community-main-grid{grid-template-columns:1fr}.community-thread-panel{position:static;top:auto}.modern-composer{grid-template-columns:1fr}.composer-post-note{grid-column:auto}}
@media (max-width:720px){.comment-helper-row{flex-direction:column;align-items:flex-start}.fb-composer-shell{padding:9px 10px}.composer-tool-btn{width:34px;height:34px}.composer-send-btn{width:38px;height:38px}}


/* v54 facebook style reply improvements */
.fb-emoji-popover{width:260px;display:block;position:relative;padding:12px;border-radius:20px;background:#fff;border:1px solid #d9e3f2;box-shadow:0 18px 44px rgba(19,31,59,.18)}
.fb-emoji-popover[hidden]{display:none !important}
.emoji-popover-head{font-size:13px;font-weight:800;color:#6f7f98;margin-bottom:10px}
.emoji-popover-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.emoji-choice{display:grid;place-items:center;min-height:48px;border:0;background:#f4f7fc;border-radius:14px;padding:0;cursor:pointer;font-size:24px;transition:transform .15s ease, background .15s ease}
.emoji-choice:hover{transform:translateY(-1px);background:#eaf1ff}
.reply-composer{display:none;gap:10px;margin-top:14px;padding:14px 16px;border-radius:22px;background:linear-gradient(180deg,#ffffff,#f8fbff);border:1px solid #dce5f4}
.reply-composer.visible{display:grid}
.reply-fb-shell,.thread-main-fb-shell{min-height:56px;border-radius:999px;background:#fff;border:1px solid #d7e2f3;box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 8px 18px rgba(31,55,100,.06)}
.reply-fb-shell input,.thread-main-fb-shell input{padding-left:8px}
.reply-parent-preview{display:block;padding:10px 14px;margin:0 0 10px;border-radius:16px}
.reply-preview-text{display:block;color:#49607f;font-size:14px;line-height:1.45;font-weight:700}
.reply-preview-label{display:none}
.thread-reply-item{border-radius:20px;background:linear-gradient(180deg,#f9fbff,#f4f8ff);border:1px solid #dce6f6;padding:14px 16px 16px;box-shadow:0 8px 18px rgba(31,55,100,.05)}
.thread-comment-item p,.thread-reply-item p{margin:0 0 10px;color:#24384f;line-height:1.7}
.reply-target-line,.reply-mention-bar,.comment-helper-row{display:none !important}
.thread-comment-actions.compact-actions,.reply-actions-row{margin-top:10px}
.thread-comment-box.facebook-comment-box{display:grid;grid-template-columns:1fr;gap:10px;padding-top:8px}
.thread-comment-box .emoji-popover,.reply-composer .emoji-popover{margin-top:0}


.dynamic-overview-grid .overview-feature{
  position:relative;
  align-items:flex-start;
  gap:10px;
}
.dynamic-overview-grid .overview-feature span{
  min-height:48px;
}
.mini-sound-btn{
  margin-top:10px;
  border:none;
  border-radius:999px;
  padding:10px 14px;
  font-weight:800;
  font-size:13px;
  cursor:pointer;
  background:linear-gradient(135deg,#eef4ff,#dfe9ff);
  color:#2a4fbf;
  box-shadow:0 10px 24px rgba(56,92,185,.12);
}
.mini-sound-btn:hover{transform:translateY(-1px)}
.grammar-audio-card .mini-sound-btn{width:max-content}
.grammar-quick-check-card{
  margin-top:18px;
  background:#fff;
  border:1px solid rgba(100,138,214,.16);
}
.grammar-quick-check-intro{
  margin:0 0 14px;
}
.grammar-check-progress{
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#6d7b98;
  margin-bottom:8px;
}
.grammar-check-question-wrap h4{
  margin:0 0 14px;
  font-size:22px;
}
.grammar-check-options{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.grammar-check-option{
  border:1px solid #d7e2fa;
  background:#f8fbff;
  border-radius:18px;
  padding:14px 16px;
  text-align:left;
  font-weight:800;
  color:#243554;
  cursor:pointer;
}
.grammar-check-option.correct{background:#ecfbf2;border-color:#8fd7ab;color:#17753c}
.grammar-check-option.wrong{background:#fff1f1;border-color:#f0a4a4;color:#a33d3d}
.grammar-check-feedback{
  margin-top:12px;
  font-weight:700;
  color:#40506f;
}
.grammar-check-feedback .good{color:#17753c}
.grammar-check-feedback .bad{color:#a33d3d}
.grammar-check-next-btn{margin-top:14px}
.grammar-check-result{
  display:flex;
  flex-direction:column;
  gap:14px;
  align-items:flex-start;
}
.grammar-check-score{
  font-size:34px;
  line-height:1;
  font-weight:900;
  color:#2d63ea;
}
.overview-table td, .overview-table th{vertical-align:top}
@media (max-width: 860px){
  .grammar-check-options{grid-template-columns:1fr}
}


/* v57 grammar polish */
#grammarDetailHero{
  width:112px!important;
  min-width:112px!important;
  height:112px!important;
  min-height:112px!important;
  font-size:56px!important;
  line-height:1!important;
  overflow:hidden!important;
}
.grammar-banner{grid-template-columns:minmax(0,1fr) auto!important;display:grid!important;align-items:center!important}
.grammar-banner p{font-size:17px!important}
#openPracticeFromGrammarBtn{
  font-size:16px!important;
  padding:14px 22px!important;
  min-height:54px!important;
  border-radius:18px!important;
  box-shadow:0 14px 28px rgba(40,71,131,.16)!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:10px!important;
}
#openPracticeFromGrammarBtn::before{content:'🧪'!important;font-size:18px;margin-right:2px}
.practice-launch-row .page-indicator{
  font-size:13px!important;
  padding:10px 14px!important;
  border-radius:999px!important;
  color:#35507a!important;
  background:linear-gradient(180deg,#eef5ff,#f8fbff)!important;
  border:1px solid #d9e4f7!important;
}
.practice-launch-row .page-indicator::before{content:none!important}
.grammar-audio-now{
  margin-top:16px;
  padding:16px 18px;
  border-radius:18px;
  background:linear-gradient(180deg,#f7faff 0%,#ffffff 100%);
  border:1px solid #d9e4f7;
  box-shadow:0 10px 22px rgba(48,76,132,.06);
}
.grammar-audio-now strong{
  display:block;
  margin-bottom:6px;
  color:#2563eb;
  font-size:15px;
}
.grammar-audio-now p{
  margin:0!important;
  color:#304154!important;
  font-weight:700;
  line-height:1.55!important;
}
.grammar-audio-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:8px;
}
.grammar-refresh-btn{
  min-height:38px;
  padding:8px 14px;
  font-size:13px;
}
.grammar-audio-line{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin:6px 0;
  color:#304154;
  font-weight:700;
  line-height:1.6;
}
.grammar-audio-line .flag-pill{
  flex:0 0 auto;
}
.grammar-audio-translation{
  color:#4c5f79;
  font-weight:600;
}
.dynamic-overview-grid .mini-sound-btn{
  margin-top:4px;
  min-height:44px;
  border-radius:999px;
  font-weight:800;
}
.dynamic-overview-grid .overview-feature{
  min-height:178px!important;
}
@media (max-width:900px){
  .grammar-banner{grid-template-columns:1fr!important}
  #grammarDetailHero{width:92px!important;min-width:92px!important;height:92px!important;min-height:92px!important;font-size:44px!important}
}


/* v58 translator smart upgrade */
.translator-panel{background:linear-gradient(180deg,#fbfdff 0%,#f6f9ff 100%)}
.translator-language-strip{gap:14px;margin-bottom:18px}
.translator-lang-card{border:1px solid #dce6f7;border-radius:22px;padding:16px 18px;background:rgba(255,255,255,.88);box-shadow:0 12px 28px rgba(28,46,94,.06)}
.translator-arrow{width:48px;height:48px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(180deg,#ffffff 0%,#eef4ff 100%);border:1px solid #dbe6f8;box-shadow:0 10px 20px rgba(28,46,94,.08)}
.translator-box{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;padding:16px;border-radius:26px;background:linear-gradient(135deg,#ffffff 0%,#f4f8ff 100%);border:1px solid #dbe6f8;box-shadow:0 20px 38px rgba(31,55,100,.08)}
#translatorInput{min-height:58px;border:1px solid #d4dff4;border-radius:18px;padding:0 18px;font-size:16px;font-weight:700;background:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
#translatorInput:focus{outline:none;border-color:#8eb3ff;box-shadow:0 0 0 4px rgba(95,121,255,.12)}
.translator-suggestions{gap:10px;margin:16px 0 22px}
.suggestion-chip{border-radius:999px;padding:10px 14px;background:linear-gradient(180deg,#ffffff 0%,#f5f8ff 100%);border:1px solid #d9e4f7;font-weight:800;box-shadow:0 8px 18px rgba(28,46,94,.05)}
.translator-detect.panel-soft,.translator-result.panel-soft,.translator-examples.panel-soft{border-radius:28px;border:1px solid #dbe5f7;background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);box-shadow:0 18px 36px rgba(31,55,100,.08)}
.detect-badge{display:inline-flex;align-items:center;padding:8px 14px;border-radius:999px;background:#edf2ff;color:#274b84;font-weight:900;letter-spacing:.01em}
.detect-dual-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:16px}
.detect-dual-card{padding:14px;border-radius:22px;border:1px solid #dbe4f6;background:linear-gradient(180deg,#fbfdff 0%,#f4f8ff 100%)}
.detect-dual-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
.detect-dual-head strong{font-size:14px;color:#18345e}
.detect-lang-row{display:flex;align-items:center;gap:8px;color:#5b6f8d;font-size:13px;font-weight:800;flex-wrap:wrap}
.detect-pair{display:grid;gap:10px}
.detect-mini{padding:14px 14px 12px;border-radius:18px;border:1px solid #d6e1f4;min-height:92px;background:#f7faff}
.detect-mini strong{display:block;margin-bottom:8px;font-size:13px;color:#3a5f93}
.detect-mini span{display:block;font-size:26px;line-height:1.15;font-weight:900;color:#17263f;word-break:break-word}
.detect-mini.it-box{background:linear-gradient(180deg,#f4fbf5 0%,#ebf7ee 100%);border-color:#cfe7d5}
.detect-mini.it-box strong{color:#2f7b48}
.translator-result-grid.improved-result-grid{gap:18px;align-items:stretch}
.translator-output.improved-output{padding:4px 2px}
.translation-topline{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:10px}
.lang-chip{display:inline-flex;align-items:center;gap:8px;padding:9px 14px;border-radius:999px;border:1px solid #d8e2f8;background:#f4f8ff;box-shadow:0 8px 16px rgba(31,55,100,.06)}
.italian-main-word.green-text{font-size:clamp(34px,4vw,52px);line-height:1.05;margin:8px 0 10px}
.meaning-pill{display:inline-flex;align-items:center;gap:10px;padding:13px 16px;border-radius:18px;border:1px solid #ebd47e;background:linear-gradient(180deg,#fff4c8 0%,#ffefb0 100%);color:#493d14;box-shadow:0 10px 20px rgba(201,161,44,.15)}
.compact-actions{margin-top:16px}
.compact-play-btn{min-width:180px;border-radius:18px;padding:15px 20px;box-shadow:0 16px 28px rgba(52,97,255,.24)}
.translator-visual-stage.clean-stage{display:flex;align-items:stretch}
.translator-visual-grid.single-view{display:grid;width:100%}
.translator-visual-card.featured.solo-card{display:grid;grid-template-rows:minmax(360px,1fr) auto;background:linear-gradient(180deg,#ffffff 0%,#f7faff 100%)}
.solo-media{min-height:360px !important;max-height:360px;display:flex;align-items:center;justify-content:center;padding:18px;background:linear-gradient(180deg,#f8fbff 0%,#edf3ff 100%);border:1px solid #dce6f7}
.solo-media img{width:100%;height:100%;object-fit:contain !important;object-position:center center;border-radius:18px;background:#fff;display:block}
.translator-visual-fallback{display:grid;place-items:center;width:100%;height:100%;font-size:88px;border-radius:18px;background:linear-gradient(180deg,#ffffff 0%,#eef4ff 100%)}
.single-line-label{display:flex;flex-direction:column;gap:10px;padding:14px 16px 18px}
.single-line-label strong{font-size:24px;font-weight:900;color:#17345f}
.visual-query-chip{display:inline-flex;align-items:center;width:max-content;max-width:100%;padding:8px 12px;border-radius:999px;background:#eef4ff;border:1px solid #d7e2f7;color:#355987;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.04em}
.translator-example-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.translator-example-card{padding:16px 18px;border-radius:20px;border:1px solid #dbe4f6;background:linear-gradient(180deg,#ffffff 0%,#f6f9ff 100%);box-shadow:0 10px 22px rgba(31,55,100,.06)}
.translator-example-card span{display:block;margin-top:8px;color:#21633c}
.translator-visual-placeholder.compact{min-height:360px;border-radius:24px}
.translator-visual-loading{min-height:360px;display:grid;place-items:center;gap:10px;border-radius:24px;border:1px solid #dbe5f7;background:linear-gradient(180deg,#f9fbff 0%,#eef4ff 100%);color:#34527d;font-weight:900}
@media (max-width:980px){
  .detect-dual-grid,.translator-example-list{grid-template-columns:1fr}
  .translator-box{grid-template-columns:1fr}
  #translateBtn,.compact-play-btn{width:100%}
  .translator-visual-card.featured.solo-card{grid-template-rows:minmax(280px,1fr) auto}
  .solo-media,.translator-visual-placeholder.compact,.translator-visual-loading{min-height:280px !important;max-height:none}
}


/* v59 compact translator tuning */
#screen-translator .panel{padding:20px 22px !important}
#translatorDetect{padding:14px 16px !important;border-radius:22px !important}
#translatorDetect p{margin:8px 0 0 !important;font-size:14px !important;line-height:1.5 !important}
.detect-badge{padding:7px 12px !important;font-size:12px !important}
.detect-dual-grid{gap:10px !important;margin-top:12px !important}
.detect-dual-card{padding:12px !important;border-radius:18px !important}
.detect-mini{padding:10px 11px !important;border-radius:14px !important}
.translator-result-grid.improved-result-grid{grid-template-columns:minmax(0,1.08fr) minmax(250px,.72fr) !important;gap:14px !important}
.translator-output.improved-output{padding:0 !important;gap:10px !important}
.translation-topline{margin:2px 0 0 !important}
.translator-main-word{font-size:clamp(30px,4vw,46px) !important;margin:2px 0 0 !important}
.meaning-pill-wide{padding:12px 16px !important;border-radius:18px !important}
.learning-mini-card{margin:8px 0 !important;padding:10px 12px !important;border-radius:14px !important}
.learning-mini-title{font-size:13px !important;margin-bottom:6px !important}
.compact-play-btn{min-width:150px !important;padding:12px 16px !important;border-radius:16px !important;box-shadow:0 10px 20px rgba(52,97,255,.18) !important}
.translator-visual-stage.clean-stage{padding:12px !important;min-height:unset !important}
.solo-card{border-radius:22px !important}
.solo-media{min-height:230px !important;max-height:230px !important;padding:10px !important;border-radius:18px !important}
.solo-media img{width:100% !important;height:100% !important;max-height:none !important;object-fit:contain !important;object-position:center center !important;background:#fff !important;padding:4px !important}
.single-line-label{gap:6px !important;padding:10px 10px 12px !important}
.single-line-label strong{font-size:18px !important}
.visual-query-chip{font-size:12px !important;padding:6px 10px !important}
.translator-visual-placeholder.compact,.translator-visual-loading{min-height:230px !important;border-radius:18px !important}
@media (max-width: 980px){
  .translator-result-grid.improved-result-grid{grid-template-columns:1fr !important;gap:12px !important}
  .solo-media,.translator-visual-placeholder.compact,.translator-visual-loading{min-height:190px !important;max-height:190px !important}
  .translator-main-word{font-size:36px !important}
}


/* v60 translator compact + faster image */
#screen-translator .panel{padding:16px 18px !important}
.translator-result-grid.improved-result-grid{grid-template-columns:minmax(0,1.1fr) minmax(220px,.66fr) !important;gap:12px !important}
.translator-output.improved-output{gap:8px !important}
.translator-live-badge{padding:6px 10px !important;font-size:12px !important}
.lang-chip{padding:7px 12px !important}
.italian-main-word.green-text,.translator-main-word{font-size:clamp(28px,3.2vw,42px) !important;line-height:1.08 !important}
.meaning-pill,.meaning-pill-wide{padding:10px 14px !important;border-radius:16px !important;font-size:14px !important}
.learning-mini-card{padding:9px 11px !important;margin:6px 0 !important}
.compact-actions{margin-top:10px !important}
.compact-play-btn{min-width:132px !important;padding:10px 14px !important;border-radius:14px !important}
.translator-visual-stage.clean-stage{padding:10px !important;border-radius:22px !important}
.translator-visual-card.featured.solo-card{grid-template-rows:minmax(210px,1fr) auto !important}
.solo-media{min-height:210px !important;max-height:210px !important;padding:8px !important;border-radius:16px !important}
.solo-media img{padding:2px !important;border-radius:14px !important}
.single-line-label{padding:8px 8px 10px !important;gap:4px !important}
.single-line-label strong{font-size:16px !important}
.visual-query-chip{padding:5px 9px !important;font-size:11px !important;letter-spacing:.02em !important;text-transform:none !important}
.translator-visual-placeholder.compact,.translator-visual-loading{min-height:210px !important;max-height:210px !important}
#translatorDetect{padding:12px 14px !important}
.detect-dual-grid{gap:8px !important;margin-top:10px !important}
.detect-dual-card{padding:10px !important}
.detect-mini{padding:9px 10px !important}
@media (max-width:980px){
  #screen-translator .panel{padding:14px !important}
  .translator-result-grid.improved-result-grid{grid-template-columns:1fr !important;gap:10px !important}
  .solo-media,.translator-visual-placeholder.compact,.translator-visual-loading{min-height:170px !important;max-height:170px !important}
  .italian-main-word.green-text,.translator-main-word{font-size:34px !important}
}


.grammar-exercise-layout{display:grid;gap:16px}

.grammar-tab:nth-child(5){color:#d97706}
.grammar-tab.active:nth-child(5){border-bottom-color:#d97706;background:linear-gradient(180deg,#fffef7 0%,#fff9e8 100%)}
.exercise-part-toolbar{display:grid;gap:14px;margin-top:16px}
.exercise-part-tabs{display:flex;gap:10px;overflow:auto;padding-bottom:4px}
.exercise-part-btn{flex:0 0 auto;min-width:118px;border:1px solid #e5eaf3;background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);border-radius:20px;padding:14px 16px;text-align:left;color:#27405f;font-weight:900;cursor:pointer;box-shadow:0 8px 18px rgba(31,55,100,.06);transition:.18s ease}
.exercise-part-btn span{display:block;font-size:15px;line-height:1.1}
.exercise-part-btn small{display:block;margin-top:5px;font-size:12px;color:#6a7b93;font-weight:800}
.exercise-part-btn:hover{transform:translateY(-1px)}
.exercise-part-btn.active{background:linear-gradient(135deg,#eef4ff 0%,#fff7d1 100%);border-color:#cdd8ef;color:#18345e;box-shadow:0 12px 22px rgba(53,93,172,.12)}
.exercise-part-pager{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.compact-nav-btn{min-height:48px;padding:12px 16px;border-radius:16px}
.exercise-page-card{min-height:420px}
@media (max-width:760px){.exercise-part-pager{display:grid;grid-template-columns:1fr 1fr;}.exercise-part-pager .story-chip{grid-column:1/-1;justify-self:center}}

.grammar-exercise-actions{margin-top:10px}
.exercise-list{display:grid;gap:12px}
.exercise-list.numbered-list .exercise-item{align-items:flex-start}
.exercise-item{display:flex;gap:10px;flex-wrap:wrap;padding:14px 16px;border:1px solid var(--line);border-radius:18px;background:#fff}
.exercise-item strong{color:var(--brand)}
.exercise-answer{width:100%;padding:10px 12px;border-radius:14px;background:var(--yellow);border:1px solid rgba(201,170,59,.28);font-weight:700;color:#403000;margin-top:4px}
@media (min-width: 980px){
  .grammar-exercise-layout{grid-template-columns:1fr 1fr}
  .grammar-exercise-layout > :first-child{grid-column:1 / -1}
}


.single-panel-layout{display:block}
.exercise-master-card{display:grid;gap:16px}
.exercise-top-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.horizontal-only-toolbar{display:grid;gap:16px}
.horizontal-only-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;padding-bottom:6px}
.exercise-inline-panel{border:1px solid #dfe8f6;background:linear-gradient(180deg,#ffffff 0%,#f9fbff 100%);border-radius:24px;padding:18px;box-shadow:0 12px 28px rgba(41,71,122,.06)}
.exercise-inline-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.inline-pager{justify-content:flex-end}
.exercise-inline-body{display:grid;gap:12px}
.exercise-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.exercise-row-head{display:flex;gap:10px;align-items:flex-start;line-height:1.45}
.exercise-row-head span{font-weight:700;color:#243b5c}
@media (max-width:900px){
  .exercise-grid{grid-template-columns:1fr}
  .exercise-inline-head{align-items:flex-start}
  .inline-pager{justify-content:flex-start}
}


/* v70 lessons polish */
.lesson-layout{grid-template-columns:300px minmax(0,1fr);align-items:start}
.lesson-main{min-width:0;width:100%}
.lesson-toolbar{display:grid;grid-template-columns:minmax(190px,1fr) auto minmax(190px,1fr);gap:14px;align-items:center}
.lesson-toolbar .secondary-btn,.lesson-toolbar .primary-btn{width:100%;justify-content:center}
.lesson-toolbar-bottom{margin-top:14px;margin-bottom:6px}
.lesson-items{grid-template-columns:1fr;gap:14px}
.lesson-item{width:100%;padding:18px 20px}
.lesson-item-top{align-items:flex-start}
.lesson-name{min-width:0;flex:1}
.lesson-name h4{font-size:20px;line-height:1.15}
.lesson-name p{font-size:15px}
.lesson-example{grid-template-columns:1fr 1fr;gap:12px;align-items:stretch}
.ex-box{display:flex;flex-direction:column;gap:10px;min-height:116px}
.ex-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.ex-head strong{display:flex;align-items:center;gap:8px;font-size:14px}
.ex-line{font-size:18px;line-height:1.5;color:#132848;font-weight:800}
.lesson-sentence-play{margin-left:auto;white-space:nowrap}
.lesson-word-play{min-width:130px}
#lessonExtras{margin-top:10px}
@media (max-width:1100px){
  .lesson-toolbar{grid-template-columns:1fr}
  .lesson-example{grid-template-columns:1fr}
}


/* Global active audio button state */
.primary-btn.audio-active,.secondary-btn.audio-active,.play-btn.audio-active,.phrase-play.audio-active,.mini-sound-btn.audio-active,.story-control.audio-active,.story-mini-btn.audio-active{
  background:linear-gradient(135deg,#22c55e,#16a34a) !important;
  color:#fff !important;
  border-color:rgba(22,163,74,.32) !important;
  box-shadow:0 0 0 4px rgba(34,197,94,.14),0 16px 30px rgba(22,163,74,.24) !important;
  transform:translateY(-1px);
}
.primary-btn.audio-active::after,.secondary-btn.audio-active::after,.play-btn.audio-active::after,.phrase-play.audio-active::after,.mini-sound-btn.audio-active::after,.story-control.audio-active::after,.story-mini-btn.audio-active::after{
  content:'';
  position:absolute;
  inset:-6px;
  border-radius:inherit;
  border:2px solid rgba(34,197,94,.22);
  pointer-events:none;
  animation:audioPulse 1.15s ease-out infinite;
}
.primary-btn,.secondary-btn,.play-btn,.phrase-play,.mini-sound-btn,.story-control,.story-mini-btn{position:relative;overflow:hidden}
@keyframes audioPulse{
  0%{transform:scale(.98);opacity:.9}
  100%{transform:scale(1.06);opacity:0}
}

/* Daily Italiano videos */
.menu-icon.red{background:linear-gradient(135deg,#ff5858,#ff2d55);color:#fff}
.videos-shell{display:grid;gap:18px}
.videos-shell-grid{position:relative}
.videos-hero{display:flex;justify-content:space-between;gap:18px;align-items:center;background:linear-gradient(135deg,#fff7f4 0%,#fff 45%,#eef4ff 100%);border:1px solid #ffd7cf}
.videos-hero h2{margin:6px 0 8px;font-size:30px}
.videos-hero p{margin:0;color:#4a5f77;line-height:1.7}
.videos-hero-actions{display:flex;gap:12px;flex-wrap:wrap}
.video-gallery-panel{display:grid;gap:16px}
.video-gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px}
.video-gallery-card{position:relative;border:1px solid var(--line);border-radius:22px;padding:10px;background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);box-shadow:0 12px 24px rgba(31,55,100,.08);cursor:pointer;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background .18s ease}
.video-gallery-card:hover,.video-gallery-card.active{transform:translateY(-4px);box-shadow:0 18px 32px rgba(31,55,100,.14);border-color:#7fc8ff}
.video-gallery-card:hover{background:linear-gradient(180deg,#eef8ff 0%,#f3fbff 100%)}
.video-gallery-card.active{background:linear-gradient(180deg,#eef4ff 0%,#fff3fa 100%)}
.video-gallery-thumb{position:relative;aspect-ratio:9/16;border-radius:16px;overflow:hidden;background:#000;margin-bottom:10px}
.video-gallery-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.video-gallery-thumb::after{content:'▶';position:absolute;right:10px;bottom:10px;width:34px;height:34px;border-radius:999px;display:grid;place-items:center;background:rgba(12,21,38,.72);color:#fff;font-size:14px;font-weight:900}
.video-gallery-copy{display:grid;gap:6px}
.video-gallery-copy strong{font-size:15px;line-height:1.3}
.video-gallery-copy span{font-size:12px;line-height:1.45;color:#607087}
.video-gallery-tag{display:inline-flex;align-items:center;justify-content:center;width:max-content;padding:6px 10px;border-radius:999px;background:#eef4ff;color:#355dac;font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}
.video-lightbox[hidden]{display:none !important}
.video-lightbox{position:fixed;inset:0;z-index:70;display:grid;place-items:center;padding:22px}
.video-lightbox-backdrop{position:absolute;inset:0;background:rgba(10,16,28,.66);backdrop-filter:blur(4px)}
body[data-theme="light"] .video-lightbox-backdrop{background:rgba(241,245,251,.82)}
.video-lightbox-dialog{position:relative;z-index:1;width:min(760px,88vw)}
.video-lightbox-stage{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:10px}
.video-lightbox-main{display:grid;gap:12px;background:var(--panel);border-radius:24px;box-shadow:0 24px 52px rgba(12,21,38,.24);padding:14px 14px 12px}
.video-lightbox-close{position:absolute;right:-6px;top:-6px;z-index:2;width:44px;height:44px;border-radius:999px;border:1px solid var(--line);background:var(--panel);color:var(--text);font-size:28px;cursor:pointer;box-shadow:0 10px 24px rgba(12,21,38,.16)}
.video-nav-btn{width:42px;height:42px;border-radius:999px;border:1px solid rgba(255,255,255,.18);background:rgba(12,21,38,.78);color:#fff;font-size:28px;cursor:pointer;display:grid;place-items:center;box-shadow:0 14px 24px rgba(12,21,38,.24)}
body[data-theme="light"] .video-nav-btn{background:#fff;color:#1f3764;border-color:var(--line)}
.video-player-top,.video-main-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.video-embed-wrap{position:relative;aspect-ratio:9/16;max-width:430px;width:100%;margin:0 auto;border-radius:28px;overflow:hidden;background:#000;box-shadow:0 28px 55px rgba(12,21,38,.22), inset 0 0 0 1px rgba(255,255,255,.08)}
.video-embed-wrap-modal{max-width:250px}
.video-embed-wrap iframe,.video-embed-wrap .di-video-player,.video-embed-wrap .di-video-player iframe{position:absolute;inset:0;width:100%;height:100%;border:0;background:#000}
.video-meta-block{text-align:center;display:grid;gap:6px}
.video-meta-block h3{margin:2px 0 0;font-size:24px;line-height:1.2}
.video-meta-block p{margin:0;color:#566b84;line-height:1.7}
.video-brand{color:#8b3dff;font-weight:900;letter-spacing:.08em}
.video-load-more-wrap{display:flex;justify-content:center;padding-top:4px}
.story-chip-playing{transition:background .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease}
.story-chip-playing.is-live{background:linear-gradient(135deg,#ddfbe7,#f4fff7);border-color:#8dd9a3;color:#16763a;box-shadow:0 10px 22px rgba(22,118,58,.12)}
body[data-theme="dark"] .story-chip-playing.is-live{background:linear-gradient(135deg,rgba(22,118,58,.28),rgba(34,197,94,.12));border-color:rgba(134,239,172,.44);color:#b7f7c7}

.video-empty-state{padding:24px;border:1px dashed var(--line);border-radius:22px;text-align:center;color:var(--muted);background:linear-gradient(180deg,#fff 0%,#f8fbff 100%)}
.video-gallery-copy strong{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.video-gallery-copy span{display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
@media (max-width: 900px){
  .video-lightbox{padding:12px}
  .video-lightbox-stage{grid-template-columns:1fr;gap:12px}
  .video-nav-btn{width:100%;height:48px;border-radius:16px;font-size:28px}
  .video-nav-btn-left{order:2}
  .video-lightbox-main{order:1}
  .video-nav-btn-right{order:3}
}
.share-btn-vip.youtube{background:linear-gradient(135deg,#ff3131,#d70000)}
.share-btn-vip.instagram{background:linear-gradient(135deg,#ff53a5,#ff8a3d)}
.section-head-tight{margin-bottom:0}
@media (max-width:1080px){.videos-layout{grid-template-columns:1fr}.video-sidebar-panel{order:2}.video-main-panel{order:1}.video-side-list{grid-template-columns:1fr 1fr;max-height:none}}
@media (max-width:760px){.videos-hero{padding:20px}.videos-hero h2{font-size:24px}.video-meta-block h3{font-size:24px}.video-side-list{grid-template-columns:1fr}.share-row-vip{grid-template-columns:1fr 1fr}.video-side-card{grid-template-columns:92px 1fr}}


/* Theme toggle + refined shorts player */
.auth-dock{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-left:auto}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid var(--line);background:linear-gradient(180deg,#ffffff 0%,#f6f9ff 100%);border-radius:999px;width:74px;height:48px;cursor:pointer;box-shadow:0 10px 22px rgba(21,34,64,.08);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.theme-toggle:hover{transform:translateY(-2px);box-shadow:0 14px 26px rgba(21,34,64,.12)}
.theme-toggle-track{position:relative;display:flex;align-items:center;justify-content:space-between;width:100%;padding:0 10px}
.theme-icon{font-size:16px;line-height:1;z-index:1;opacity:.92}
.theme-toggle-thumb{position:absolute;left:4px;top:50%;transform:translateY(-50%);width:38px;height:38px;border-radius:999px;background:linear-gradient(135deg,#1f3764,#355dac);box-shadow:0 10px 20px rgba(31,55,100,.24);transition:transform .22s ease,background .22s ease}
.theme-toggle.dark .theme-toggle-thumb,.theme-toggle[aria-pressed="true"] .theme-toggle-thumb{transform:translate(28px,-50%);background:linear-gradient(135deg,#0f1727,#253552)}
#videosSubscribeBtn{background:linear-gradient(135deg,#ff3b30,#d71f14);border-color:#d71f14;color:#fff;box-shadow:0 16px 28px rgba(215,31,20,.22)}
.videos-shell{gap:14px}
.videos-hero{padding:18px 20px;gap:16px}
.videos-hero h2{font-size:24px}
.videos-hero p{max-width:760px;line-height:1.55}
.videos-layout{grid-template-columns:minmax(0,1.08fr) minmax(300px,.72fr);gap:14px}
.video-main-panel,.video-sidebar-panel{gap:12px}
.video-embed-wrap{aspect-ratio:9/16;max-width:320px;border-radius:24px;box-shadow:0 22px 40px rgba(12,21,38,.18), inset 0 0 0 1px rgba(255,255,255,.08)}
.video-meta-block{max-width:640px;margin:0 auto;text-align:left}
.video-meta-block h3{font-size:24px;margin:2px 0 6px}
.video-meta-block p{line-height:1.55}
.video-main-actions{justify-content:center}
.video-side-list{gap:10px;max-height:680px;padding-right:2px}
.video-side-card{grid-template-columns:88px 1fr;gap:10px;padding:8px 10px;border-radius:18px}
.video-side-copy strong{font-size:14px;margin-bottom:4px}
.video-side-copy span{font-size:12px;line-height:1.4}
.share-panel-vip{padding:16px 18px;border-radius:24px}
.share-panel-vip p{line-height:1.5}
@media (max-width:1080px){.videos-layout{grid-template-columns:1fr}.video-sidebar-panel{order:2}.video-main-panel{order:1}.video-side-list{grid-template-columns:1fr 1fr;max-height:none}.auth-dock{width:100%;justify-content:flex-end}}
@media (max-width:760px){.videos-hero{padding:16px}.videos-hero h2{font-size:22px}.video-embed-wrap{max-width:280px}.video-meta-block h3{font-size:21px}.video-side-list{grid-template-columns:1fr}.share-row-vip{grid-template-columns:1fr 1fr}.video-side-card{grid-template-columns:82px 1fr}.theme-toggle{width:68px;height:44px}.theme-toggle-thumb{width:34px;height:34px}.theme-toggle.dark .theme-toggle-thumb,.theme-toggle[aria-pressed="true"] .theme-toggle-thumb{transform:translate(24px,-50%)}}

body[data-theme="dark"]{--bg:#0e1626;--panel:#121c2d;--line:#263246;--shadow:0 20px 44px rgba(0,0,0,.35);--text:#e8eef8;--muted:#97a7bd;--green:#183326;--blue:#14283f;--purple:#211938;--orange:#3b2915;--red:#3b1b1d;--yellow:#403713;--pink:#3b1d32;--brand:#7ea6ff;--brand2:#4f7cff;--brand-soft:#18263d}
body[data-theme="dark"]{background:linear-gradient(180deg,#0b1220 0%,#111b2d 100%)}
body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .menu-item,
body[data-theme="dark"] .sidebar-box,
body[data-theme="dark"] .word-card,
body[data-theme="dark"] .phrase-card,
body[data-theme="dark"] .grammar-card,
body[data-theme="dark"] .story-card,
body[data-theme="dark"] .lesson-item,
body[data-theme="dark"] .extra-card,
body[data-theme="dark"] .example-card,
body[data-theme="dark"] .story-segment,
body[data-theme="dark"] .panel-soft,
body[data-theme="dark"] .video-side-card,
body[data-theme="dark"] .topbar-v2,
body[data-theme="dark"] .icon-btn.soft,
body[data-theme="dark"] .topbar .icon-btn,
body[data-theme="dark"] .secondary-btn,
body[data-theme="dark"] .theme-toggle{background:linear-gradient(180deg,#141f31 0%,#101827 100%);color:var(--text)}
body[data-theme="dark"] .panel,
body[data-theme="dark"] .videos-hero{background:linear-gradient(135deg,#141f31 0%,#101827 100%)}
body[data-theme="dark"] .topbar-v2{border-color:rgba(72,91,121,.55);background:rgba(14,22,38,.78)}
body[data-theme="dark"] .small-label,body[data-theme="dark"] .video-side-copy span,body[data-theme="dark"] .share-panel-vip p,body[data-theme="dark"] .videos-hero p,body[data-theme="dark"] .video-meta-block p,body[data-theme="dark"] .section-head p{color:var(--muted)}
body[data-theme="dark"] .video-queue-label{color:#9bb6ea}
body[data-theme="dark"] .video-side-card.active{background:linear-gradient(135deg,#1a2740 0%,#1b1e35 100%)}
body[data-theme="dark"] .video-side-card:hover,body[data-theme="dark"] .video-side-card.active{border-color:#5471a7}
body[data-theme="dark"] .tab-btn,body[data-theme="dark"] .jump-select{background:#141f31;color:var(--text)}
body[data-theme="dark"] .auth-pill{background:linear-gradient(180deg,#141f31 0%,#101827 100%);border-color:var(--line);color:var(--text)}
body[data-theme="dark"] #videosSubscribeBtn{box-shadow:0 16px 28px rgba(255,59,48,.24)}


/* ===== Enhanced dark mode polish ===== */
body[data-theme="dark"]{
  --bg:#07111f;
  --panel:#0f1b2f;
  --line:#2a3a58;
  --shadow:0 24px 55px rgba(0,0,0,.42);
  --text:#eef4ff;
  --muted:#a8b6cf;
  --green:#173625;
  --blue:#142d4d;
  --purple:#24183f;
  --orange:#3c2814;
  --red:#3a1b23;
  --yellow:#433714;
  --pink:#391a35;
  --brand:#8eb7ff;
  --brand2:#4f86ff;
  --brand-soft:#14243b;
  background:
    radial-gradient(circle at top center, rgba(55,105,255,.18), transparent 26%),
    radial-gradient(circle at bottom center, rgba(0,221,185,.10), transparent 28%),
    linear-gradient(180deg,#06101d 0%,#0b1630 52%,#08111e 100%);
  color:var(--text);
}

body[data-theme="dark"] .app-shell{background:transparent}

body[data-theme="dark"] .sidebar{
  background:linear-gradient(180deg,rgba(14,24,42,.96) 0%,rgba(8,17,31,.96) 100%);
  border-right:1px solid rgba(126,166,255,.22);
  box-shadow:inset -1px 0 0 rgba(255,255,255,.02);
}

body[data-theme="dark"] .brand h1,
body[data-theme="dark"] .main-label,
body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] strong,
body[data-theme="dark"] .menu-copy strong,
body[data-theme="dark"] .home-card h3,
body[data-theme="dark"] .hero-panel h2,
body[data-theme="dark"] .section-head h2{
  color:#f4f8ff !important;
}

body[data-theme="dark"] .brand p,
body[data-theme="dark"] .menu-copy small,
body[data-theme="dark"] .home-card p,
body[data-theme="dark"] .section-head p,
body[data-theme="dark"] .small-label,
body[data-theme="dark"] p,
body[data-theme="dark"] span{
  color:var(--muted);
}

body[data-theme="dark"] .topbar-v2{
  background:linear-gradient(180deg,rgba(8,18,34,.92) 0%,rgba(10,21,40,.86) 100%);
  border-color:rgba(126,166,255,.22);
  box-shadow:0 18px 38px rgba(0,0,0,.24);
  backdrop-filter:blur(14px);
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .panel-soft,
body[data-theme="dark"] .videos-hero,
body[data-theme="dark"] .home-card,
body[data-theme="dark"] .sidebar-box,
body[data-theme="dark"] .story-card,
body[data-theme="dark"] .grammar-card,
body[data-theme="dark"] .word-card,
body[data-theme="dark"] .phrase-card,
body[data-theme="dark"] .lesson-item,
body[data-theme="dark"] .example-card,
body[data-theme="dark"] .extra-card,
body[data-theme="dark"] .video-side-card,
body[data-theme="dark"] .video-gallery-card,
body[data-theme="dark"] .menu-item{
  background:linear-gradient(180deg, rgba(17,29,51,.96) 0%, rgba(10,19,35,.96) 100%);
  border-color:rgba(138,175,255,.22);
  box-shadow:0 18px 36px rgba(0,0,0,.22);
}

body[data-theme="dark"] .menu-item:hover,
body[data-theme="dark"] .menu-item.active,
body[data-theme="dark"] .home-card:hover,
body[data-theme="dark"] .video-gallery-card:hover,
body[data-theme="dark"] .video-side-card:hover{
  background:linear-gradient(180deg, rgba(25,44,76,.98) 0%, rgba(13,24,43,.98) 100%);
  border-color:rgba(124,177,255,.52);
  box-shadow:0 18px 42px rgba(58,110,255,.18);
}

body[data-theme="dark"] .hero-panel{
  background:
    radial-gradient(circle at top right, rgba(69,120,255,.20), transparent 34%),
    linear-gradient(135deg, #0f1b31 0%, #112241 48%, #0d1830 100%);
}

body[data-theme="dark"] .tag{
  background:linear-gradient(135deg,#f5df89 0%,#fff1bb 100%);
  color:#473409 !important;
  box-shadow:0 10px 24px rgba(245,223,137,.18);
}

body[data-theme="dark"] .stat.green{background:linear-gradient(135deg,#11301f 0%,#173b28 100%)}
body[data-theme="dark"] .stat.blue{background:linear-gradient(135deg,#122842 0%,#173459 100%)}
body[data-theme="dark"] .stat.purple{background:linear-gradient(135deg,#24173d 0%,#301e50 100%)}
body[data-theme="dark"] .stat.orange{background:linear-gradient(135deg,#3e2612 0%,#543112 100%)}

body[data-theme="dark"] .primary-btn{
  background:linear-gradient(135deg,#4c82ff 0%,#295eff 100%);
  color:#fff;
  box-shadow:0 18px 32px rgba(61,116,255,.32);
}

body[data-theme="dark"] .secondary-btn,
body[data-theme="dark"] .icon-btn,
body[data-theme="dark"] .icon-btn.soft,
body[data-theme="dark"] .theme-toggle,
body[data-theme="dark"] .auth-pill{
  background:linear-gradient(180deg,#15243d 0%,#0f1b31 100%);
  color:#eef4ff;
  border-color:rgba(138,175,255,.26);
}

body[data-theme="dark"] .secondary-btn:hover,
body[data-theme="dark"] .icon-btn:hover,
body[data-theme="dark"] .theme-toggle:hover{
  border-color:rgba(138,175,255,.55);
  box-shadow:0 12px 28px rgba(58,110,255,.18);
}

body[data-theme="dark"] .brand-logo{box-shadow:0 18px 36px rgba(58,110,255,.24)}
body[data-theme="dark"] .menu-icon{box-shadow:0 10px 22px rgba(0,0,0,.18)}

body[data-theme="dark"] .hero-panel p,
body[data-theme="dark"] .home-card p,
body[data-theme="dark"] .story-card p,
body[data-theme="dark"] .grammar-card p,
body[data-theme="dark"] .word-card p,
body[data-theme="dark"] .phrase-card p{
  color:#b7c4da !important;
}

body[data-theme="dark"] .main-label{opacity:.95}
body[data-theme="dark"] .auth-pill{box-shadow:0 12px 24px rgba(0,0,0,.18)}
body[data-theme="dark"] .theme-toggle{box-shadow:0 12px 30px rgba(0,0,0,.22)}

body[data-theme="dark"] .video-lightbox-dialog,
body[data-theme="dark"] .video-lightbox-main{
  background:linear-gradient(180deg,#0d1930 0%,#081221 100%);
  border-color:rgba(138,175,255,.25);
}

body[data-theme="dark"] .video-nav-btn,
body[data-theme="dark"] .video-lightbox-close{
  background:linear-gradient(180deg,#182845 0%,#0e1a2f 100%);
  color:#eef4ff;
  border:1px solid rgba(138,175,255,.26);
}

body[data-theme="dark"] .story-chip,
body[data-theme="dark"] #videoCounter{
  background:linear-gradient(180deg,#152641 0%,#0f1c34 100%);
  color:#eef4ff;
  border-color:rgba(138,175,255,.24);
}

body[data-theme="dark"] .story-chip-playing.is-live{
  background:linear-gradient(135deg,rgba(18,102,51,.60),rgba(23,146,73,.28));
  border-color:rgba(134,239,172,.46);
  color:#d7ffe2;
  box-shadow:0 10px 24px rgba(16,185,129,.18);
}



/* ===== Full-site premium dark mode ===== */
body[data-theme="dark"]{
  background:
    radial-gradient(circle at 18% 0%, rgba(56,107,255,.22), transparent 24%),
    radial-gradient(circle at 82% 100%, rgba(0,214,170,.10), transparent 26%),
    linear-gradient(180deg,#05101d 0%,#081427 45%,#06101c 100%) !important;
}

body[data-theme="dark"] .content{
  background:transparent;
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .panel-soft,
body[data-theme="dark"] .community-post,
body[data-theme="dark"] .community-thread-panel,
body[data-theme="dark"] .community-account-card,
body[data-theme="dark"] .community-user-summary,
body[data-theme="dark"] .community-stat-card,
body[data-theme="dark"] .summary-chip,
body[data-theme="dark"] .limit-pill,
body[data-theme="dark"] .translator-box,
body[data-theme="dark"] .translator-language-strip,
body[data-theme="dark"] .translator-lang-card,
body[data-theme="dark"] .translator-example-card,
body[data-theme="dark"] .translator-detect,
body[data-theme="dark"] .translator-breakdown-card,
body[data-theme="dark"] .grammar-detail-card,
body[data-theme="dark"] .grammar-exercise-card,
body[data-theme="dark"] .practice-shell .panel,
body[data-theme="dark"] .progress-card,
body[data-theme="dark"] .community-composer,
body[data-theme="dark"] .fb-composer-shell,
body[data-theme="dark"] .thread-comment-item,
body[data-theme="dark"] .thread-reply-item,
body[data-theme="dark"] .story-stage-card,
body[data-theme="dark"] .story-progress-card,
body[data-theme="dark"] .story-segment,
body[data-theme="dark"] .lesson-card,
body[data-theme="dark"] .phrase-page-shell,
body[data-theme="dark"] .phrase-nav-shell,
body[data-theme="dark"] .word-stage,
body[data-theme="dark"] .word-card,
body[data-theme="dark"] .auth-card,
body[data-theme="dark"] .auth-card-shell,
body[data-theme="dark"] .admin-card,
body[data-theme="dark"] .video-gallery-panel,
body[data-theme="dark"] .video-lightbox-main,
body[data-theme="dark"] .video-preview-card{
  background:
    radial-gradient(circle at top right, rgba(66,118,255,.10), transparent 30%),
    linear-gradient(180deg, rgba(14,25,45,.98) 0%, rgba(8,16,31,.98) 100%) !important;
  border-color:rgba(134,171,255,.20) !important;
  box-shadow:0 18px 42px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.02);
}

body[data-theme="dark"] .hero-panel,
body[data-theme="dark"] .videos-hero{
  background:
    radial-gradient(circle at top right, rgba(88,132,255,.22), transparent 32%),
    radial-gradient(circle at bottom left, rgba(0,214,170,.08), transparent 24%),
    linear-gradient(135deg,#0f1c34 0%,#102240 48%,#0b162b 100%) !important;
}

body[data-theme="dark"] .community-post:hover,
body[data-theme="dark"] .thread-comment-item:hover,
body[data-theme="dark"] .thread-reply-item:hover,
body[data-theme="dark"] .translator-example-card:hover,
body[data-theme="dark"] .grammar-card:hover,
body[data-theme="dark"] .word-card:hover,
body[data-theme="dark"] .phrase-card:hover,
body[data-theme="dark"] .lesson-item:hover,
body[data-theme="dark"] .story-segment:hover,
body[data-theme="dark"] .summary-chip:hover,
body[data-theme="dark"] .community-stat-card:hover{
  border-color:rgba(132,180,255,.42) !important;
  box-shadow:0 18px 38px rgba(60,112,255,.18) !important;
  transform:translateY(-2px);
}

body[data-theme="dark"] .section-head h2,
body[data-theme="dark"] .community-head-clean h2,
body[data-theme="dark"] .translator-panel h2,
body[data-theme="dark"] .practice-shell h2,
body[data-theme="dark"] .progress-panel h2{
  color:#f6f9ff !important;
}

body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select,
body[data-theme="dark"] #translatorInput,
body[data-theme="dark"] #communityPostInput,
body[data-theme="dark"] #threadCommentInput{
  background:linear-gradient(180deg,#15233b 0%,#0e1a30 100%) !important;
  color:#eef4ff !important;
  border:1px solid rgba(135,171,255,.24) !important;
  box-shadow:none !important;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder{
  color:#95a9c9 !important;
}

body[data-theme="dark"] .community-composer,
body[data-theme="dark"] .modern-composer,
body[data-theme="dark"] .translator-box{
  background:
    linear-gradient(180deg, rgba(245,231,182,.96) 0%, rgba(236,225,188,.96) 100%);
  color:#24324d !important;
  border-color:rgba(255,224,137,.34) !important;
  box-shadow:0 16px 36px rgba(0,0,0,.16);
}

body[data-theme="dark"] .community-composer .composer-post-note,
body[data-theme="dark"] .community-composer select,
body[data-theme="dark"] .community-composer input{
  color:#30425f !important;
}

body[data-theme="dark"] .summary-chip,
body[data-theme="dark"] .community-stat-card,
body[data-theme="dark"] .limit-pill{
  color:#eef4ff;
}

body[data-theme="dark"] .summary-posts,
body[data-theme="dark"] .stat-posts,
body[data-theme="dark"] .limit-pill-posts{background:linear-gradient(135deg,#f0e3a5 0%,#f5eabb 100%) !important;color:#3f3411 !important}
body[data-theme="dark"] .summary-comments,
body[data-theme="dark"] .stat-comments,
body[data-theme="dark"] .limit-pill-replies{background:linear-gradient(135deg,#dce7f4 0%,#c9d8e9 100%) !important;color:#24344f !important}
body[data-theme="dark"] .summary-xp,
body[data-theme="dark"] .stat-wins{background:linear-gradient(135deg,#ddd4f0 0%,#cec2e8 100%) !important;color:#392c59 !important}
body[data-theme="dark"] .summary-tests,
body[data-theme="dark"] .stat-questions{background:linear-gradient(135deg,#cfe6d8 0%,#c2ddcc 100%) !important;color:#284438 !important}
body[data-theme="dark"] .summary-post-limit{background:linear-gradient(135deg,#f0d8c8 0%,#ead1c2 100%) !important;color:#5a392d !important}
body[data-theme="dark"] .summary-reply-limit{background:linear-gradient(135deg,#efe1bc 0%,#ebddb2 100%) !important;color:#52421c !important}

body[data-theme="dark"] .community-post p,
body[data-theme="dark"] .thread-comment-item p,
body[data-theme="dark"] .thread-reply-item p,
body[data-theme="dark"] .translator-panel p,
body[data-theme="dark"] .practice-shell p,
body[data-theme="dark"] .progress-panel p,
body[data-theme="dark"] .story-stage-card p,
body[data-theme="dark"] .phrase-card p,
body[data-theme="dark"] .word-card p{
  color:#b9c7dc !important;
}

body[data-theme="dark"] .community-topic-pill,
body[data-theme="dark"] .detect-badge,
body[data-theme="dark"] .tag{
  box-shadow:0 10px 24px rgba(0,0,0,.16);
}

body[data-theme="dark"] .tab-btn.active,
body[data-theme="dark"] .suggestion-chip:hover,
body[data-theme="dark"] .jump-chip:hover,
body[data-theme="dark"] .load-more-btn:hover{
  border-color:rgba(132,180,255,.5) !important;
  box-shadow:0 12px 26px rgba(60,112,255,.16) !important;
}

body[data-theme="dark"] .progress-ring-card,
body[data-theme="dark"] .streak-pill,
body[data-theme="dark"] .identity-chip{
  background:linear-gradient(180deg,#14253f 0%,#0e1b31 100%) !important;
  border-color:rgba(132,180,255,.26) !important;
}

body[data-theme="dark"] .community-main-grid,
body[data-theme="dark"] .community-top-grid,
body[data-theme="dark"] .summary-chip-grid,
body[data-theme="dark"] .community-stats-grid{
  gap:16px;
}

body[data-theme="dark"] .open-thread-btn,
body[data-theme="dark"] .composer-tool-btn,
body[data-theme="dark"] .composer-send-btn,
body[data-theme="dark"] .share-btn-vip{
  box-shadow:0 10px 22px rgba(0,0,0,.18);
}

\n
/* ===== A-to-Z full dark mode override ===== */
body[data-theme="dark"]{
  --bg:#06111f;
  --panel:#0d1a2d;
  --line:#243753;
  --text:#eef4ff;
  --muted:#a8b9d2;
  --brand:#86aeff;
  --brand2:#4578ff;
  --brand-soft:#12233d;
  background:
    radial-gradient(circle at 18% 0%, rgba(72,116,255,.22), transparent 26%),
    radial-gradient(circle at 82% 100%, rgba(0,214,170,.10), transparent 28%),
    linear-gradient(180deg,#04101d 0%,#081427 48%,#05101c 100%) !important;
  color:var(--text) !important;
}

body[data-theme="dark"] .content,
body[data-theme="dark"] .screen{
  background:transparent !important;
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] strong,
body[data-theme="dark"] b,
body[data-theme="dark"] .main-label,
body[data-theme="dark"] .menu-copy strong,
body[data-theme="dark"] .section-head h2,
body[data-theme="dark"] .hero-panel h2{
  color:#f5f9ff !important;
}

body[data-theme="dark"] p,
body[data-theme="dark"] span,
body[data-theme="dark"] small,
body[data-theme="dark"] label,
body[data-theme="dark"] .small-label,
body[data-theme="dark"] .menu-copy small,
body[data-theme="dark"] .section-head p{
  color:var(--muted) !important;
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .topbar-v2{
  background:linear-gradient(180deg,rgba(10,21,39,.94) 0%,rgba(8,18,34,.92) 100%) !important;
  border-color:rgba(132,174,255,.22) !important;
  box-shadow:0 18px 40px rgba(0,0,0,.24) !important;
  backdrop-filter:blur(14px);
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .panel-soft,
body[data-theme="dark"] .hero-panel,
body[data-theme="dark"] .videos-hero,
body[data-theme="dark"] .video-gallery-panel,
body[data-theme="dark"] .video-lightbox-main,
body[data-theme="dark"] .video-preview-strip,
body[data-theme="dark"] .video-preview-card,
body[data-theme="dark"] .sidebar-box,
body[data-theme="dark"] .story-stage,
body[data-theme="dark"] .story-stage-card,
body[data-theme="dark"] .story-player-shell,
body[data-theme="dark"] .story-progress-wrap,
body[data-theme="dark"] .grammar-detail-card,
body[data-theme="dark"] .grammar-exercise-card,
body[data-theme="dark"] .translator-panel,
body[data-theme="dark"] .translator-detect,
body[data-theme="dark"] .translator-result,
body[data-theme="dark"] .translator-examples,
body[data-theme="dark"] .translator-visual-stage,
body[data-theme="dark"] .translator-visual-card,
body[data-theme="dark"] .community-account-card,
body[data-theme="dark"] .community-user-summary,
body[data-theme="dark"] .community-thread-panel,
body[data-theme="dark"] .thread-card,
body[data-theme="dark"] .thread-placeholder,
body[data-theme="dark"] .auth-card,
body[data-theme="dark"] .auth-card-shell,
body[data-theme="dark"] .admin-card,
body[data-theme="dark"] .admin-table-wrap,
body[data-theme="dark"] .practice-banner,
body[data-theme="dark"] .result-card,
body[data-theme="dark"] .mistake-card,
body[data-theme="dark"] .progress-card,
body[data-theme="dark"] .focus-card,
body[data-theme="dark"] .milestone-card,
body[data-theme="dark"] .side-table-card,
body[data-theme="dark"] .learn-card{
  background:
    radial-gradient(circle at top right, rgba(74,119,255,.10), transparent 30%),
    linear-gradient(180deg, rgba(14,25,45,.98) 0%, rgba(8,17,32,.98) 100%) !important;
  border-color:rgba(132,174,255,.20) !important;
  box-shadow:0 18px 42px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.02) !important;
}

body[data-theme="dark"] .menu-item,
body[data-theme="dark"] .lesson-item,
body[data-theme="dark"] .story-segment,
body[data-theme="dark"] .grammar-card,
body[data-theme="dark"] .word-card,
body[data-theme="dark"] .phrase-card,
body[data-theme="dark"] .phrase-card-upgraded,
body[data-theme="dark"] .home-card,
body[data-theme="dark"] .community-post,
body[data-theme="dark"] .thread-comment-item,
body[data-theme="dark"] .thread-reply-item,
body[data-theme="dark"] .translator-example-card,
body[data-theme="dark"] .translator-lang-card,
body[data-theme="dark"] .translator-word-card,
body[data-theme="dark"] .detect-card,
body[data-theme="dark"] .detect-dual-card,
body[data-theme="dark"] .detect-mini,
body[data-theme="dark"] .grammar-point,
body[data-theme="dark"] .example-card,
body[data-theme="dark"] .extra-card,
body[data-theme="dark"] .exercise-item,
body[data-theme="dark"] .option-btn,
body[data-theme="dark"] .practice-stat-card,
body[data-theme="dark"] .summary-chip,
body[data-theme="dark"] .identity-chip,
body[data-theme="dark"] .community-stat-card,
body[data-theme="dark"] .limit-pill,
body[data-theme="dark"] .admin-user-card,
body[data-theme="dark"] .video-side-card,
body[data-theme="dark"] .video-gallery-card,
body[data-theme="dark"] .overview-feature,
body[data-theme="dark"] .grammar-mini-box,
body[data-theme="dark"] .check-item,
body[data-theme="dark"] .learning-mini-card,
body[data-theme="dark"] .mini-pair{
  background:
    linear-gradient(180deg, rgba(18,31,54,.98) 0%, rgba(11,21,38,.98) 100%) !important;
  border-color:rgba(132,174,255,.22) !important;
  color:var(--text) !important;
  box-shadow:0 14px 34px rgba(0,0,0,.18) !important;
}

body[data-theme="dark"] .menu-item:hover,
body[data-theme="dark"] .menu-item.active,
body[data-theme="dark"] .lesson-item:hover,
body[data-theme="dark"] .story-segment:hover,
body[data-theme="dark"] .grammar-card:hover,
body[data-theme="dark"] .word-card:hover,
body[data-theme="dark"] .phrase-card:hover,
body[data-theme="dark"] .phrase-card-upgraded:hover,
body[data-theme="dark"] .home-card:hover,
body[data-theme="dark"] .community-post:hover,
body[data-theme="dark"] .thread-comment-item:hover,
body[data-theme="dark"] .thread-reply-item:hover,
body[data-theme="dark"] .video-gallery-card:hover,
body[data-theme="dark"] .video-side-card:hover,
body[data-theme="dark"] .option-btn:hover,
body[data-theme="dark"] .translator-example-card:hover,
body[data-theme="dark"] .summary-chip:hover,
body[data-theme="dark"] .community-stat-card:hover{
  background:
    linear-gradient(180deg, rgba(25,43,74,.98) 0%, rgba(13,24,43,.98) 100%) !important;
  border-color:rgba(132,180,255,.48) !important;
  box-shadow:0 18px 38px rgba(61,112,255,.18) !important;
  transform:translateY(-2px);
}

body[data-theme="dark"] .tab-btn,
body[data-theme="dark"] .grammar-tab,
body[data-theme="dark"] .grammar-nav-btn,
body[data-theme="dark"] .practice-mode-btn,
body[data-theme="dark"] .exercise-part-btn,
body[data-theme="dark"] .lesson-nav-btn,
body[data-theme="dark"] .lesson-chip,
body[data-theme="dark"] .lesson-chip.soft,
body[data-theme="dark"] .story-chip,
body[data-theme="dark"] .community-topic-pill,
body[data-theme="dark"] .community-thread-badge,
body[data-theme="dark"] .detect-badge,
body[data-theme="dark"] .tag,
body[data-theme="dark"] .meaning-pill,
body[data-theme="dark"] .meaning-pill-yellow,
body[data-theme="dark"] .object-pill,
body[data-theme="dark"] .status-badge,
body[data-theme="dark"] .page-indicator,
body[data-theme="dark"] .lesson-badge,
body[data-theme="dark"] .video-queue-label{
  background:linear-gradient(180deg,#152641 0%,#0f1c34 100%) !important;
  color:#eef4ff !important;
  border-color:rgba(132,174,255,.24) !important;
  box-shadow:0 10px 24px rgba(0,0,0,.14);
}

body[data-theme="dark"] .tag,
body[data-theme="dark"] .detect-badge,
body[data-theme="dark"] .meaning-pill-yellow{
  background:linear-gradient(135deg,#f1e19f 0%,#ffefbf 100%) !important;
  color:#4a3910 !important;
}

body[data-theme="dark"] .summary-posts,
body[data-theme="dark"] .stat-posts,
body[data-theme="dark"] .limit-pill-posts,
body[data-theme="dark"] .summary-post-limit{
  background:linear-gradient(135deg,#f1e2a8 0%,#f4e8bf 100%) !important;
  color:#4b3b14 !important;
}
body[data-theme="dark"] .summary-comments,
body[data-theme="dark"] .stat-comments,
body[data-theme="dark"] .limit-pill-replies,
body[data-theme="dark"] .summary-reply-limit{
  background:linear-gradient(135deg,#d8e4f1 0%,#c9d8e8 100%) !important;
  color:#263b5a !important;
}
body[data-theme="dark"] .summary-xp,
body[data-theme="dark"] .stat-wins{
  background:linear-gradient(135deg,#ddd4f0 0%,#cec2e8 100%) !important;
  color:#453263 !important;
}
body[data-theme="dark"] .summary-tests,
body[data-theme="dark"] .stat-questions{
  background:linear-gradient(135deg,#d2e8d8 0%,#c5dfcc 100%) !important;
  color:#274739 !important;
}

body[data-theme="dark"] .primary-btn,
body[data-theme="dark"] .play-btn,
body[data-theme="dark"] .phrase-play,
body[data-theme="dark"] .mini-sound-btn,
body[data-theme="dark"] .story-control,
body[data-theme="dark"] .composer-send-btn,
body[data-theme="dark"] .share-btn-vip,
body[data-theme="dark"] .video-nav-btn{
  background:linear-gradient(135deg,#4c82ff 0%,#2d63ff 100%) !important;
  color:#ffffff !important;
  border-color:transparent !important;
  box-shadow:0 18px 30px rgba(61,116,255,.28) !important;
}

body[data-theme="dark"] .secondary-btn,
body[data-theme="dark"] .icon-btn,
body[data-theme="dark"] .icon-btn.soft,
body[data-theme="dark"] .theme-toggle,
body[data-theme="dark"] .auth-pill,
body[data-theme="dark"] .composer-tool-btn,
body[data-theme="dark"] .load-more-btn{
  background:linear-gradient(180deg,#15243d 0%,#0f1b31 100%) !important;
  color:#eef4ff !important;
  border-color:rgba(132,174,255,.26) !important;
}

body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select,
body[data-theme="dark"] #translatorInput,
body[data-theme="dark"] #communityPostInput,
body[data-theme="dark"] #threadCommentInput,
body[data-theme="dark"] .reply-composer input,
body[data-theme="dark"] .admin-user-actions input,
body[data-theme="dark"] .auth-panel input{
  background:linear-gradient(180deg,#14233c 0%,#0e1a30 100%) !important;
  color:#eef4ff !important;
  border:1px solid rgba(132,174,255,.24) !important;
  box-shadow:none !important;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder{
  color:#95a9c9 !important;
}

body[data-theme="dark"] .translator-box,
body[data-theme="dark"] .community-composer,
body[data-theme="dark"] .modern-composer,
body[data-theme="dark"] .fb-composer-shell,
body[data-theme="dark"] .thread-main-fb-shell,
body[data-theme="dark"] .reply-fb-shell{
  background:linear-gradient(180deg,#12243f 0%,#0d1b31 100%) !important;
  border-color:rgba(132,174,255,.24) !important;
  color:#eef4ff !important;
}

body[data-theme="dark"] .translator-language-strip,
body[data-theme="dark"] .translator-arrow,
body[data-theme="dark"] .translator-box,
body[data-theme="dark"] .translator-detect.panel-soft,
body[data-theme="dark"] .translator-result.panel-soft,
body[data-theme="dark"] .translator-examples.panel-soft{
  background:
    linear-gradient(180deg, rgba(14,25,45,.98) 0%, rgba(8,17,32,.98) 100%) !important;
  border-color:rgba(132,174,255,.20) !important;
}

body[data-theme="dark"] .translator-lang-card:first-child,
body[data-theme="dark"] .translator-lang-card:last-child,
body[data-theme="dark"] .detect-mini.en-box,
body[data-theme="dark"] .detect-mini.it-box,
body[data-theme="dark"] .object-pill.object-it,
body[data-theme="dark"] .object-pill.object-en{
  background:linear-gradient(180deg,#173055 0%,#10243f 100%) !important;
  color:#eef4ff !important;
}

body[data-theme="dark"] .story-control-bar,
body[data-theme="dark"] .story-progress-wrap,
body[data-theme="dark"] .story-image,
body[data-theme="dark"] .title-card,
body[data-theme="dark"] .detail-hero,
body[data-theme="dark"] .practice-feedback,
body[data-theme="dark"] .exercise-inline-panel,
body[data-theme="dark"] .auth-note,
body[data-theme="dark"] .auth-inline-banner,
body[data-theme="dark"] .auth-warning-box{
  background:linear-gradient(180deg,#13243d 0%,#0d1a2d 100%) !important;
  border-color:rgba(132,174,255,.20) !important;
  color:#eef4ff !important;
}

body[data-theme="dark"] .video-lightbox-dialog,
body[data-theme="dark"] .video-lightbox-main,
body[data-theme="dark"] .video-lightbox-close{
  background:linear-gradient(180deg,#0c1830 0%,#071221 100%) !important;
  border-color:rgba(132,174,255,.24) !important;
  color:#eef4ff !important;
}

body[data-theme="dark"] .story-chip-playing.is-live{
  background:linear-gradient(135deg,rgba(18,102,51,.60),rgba(23,146,73,.28)) !important;
  border-color:rgba(134,239,172,.46) !important;
  color:#d8ffe3 !important;
  box-shadow:0 10px 24px rgba(16,185,129,.18) !important;
}

body[data-theme="dark"] .word-emoji,
body[data-theme="dark"] .phrase-icon,
body[data-theme="dark"] .lesson-name .emoji,
body[data-theme="dark"] .object-icon,
body[data-theme="dark"] .focus-emoji,
body[data-theme="dark"] .example-index{
  background:linear-gradient(180deg,#1a2f50 0%,#12335f 100%) !important;
  border-color:rgba(132,174,255,.24) !important;
}

body[data-theme="dark"] .overview-table thead th,
body[data-theme="dark"] .admin-table th{
  background:linear-gradient(180deg,#173055 0%,#10243f 100%) !important;
  color:#eef4ff !important;
}

body[data-theme="dark"] .admin-table td,
body[data-theme="dark"] .overview-table td{
  background:rgba(10,21,39,.75) !important;
  color:#dbe7fa !important;
  border-color:rgba(132,174,255,.16) !important;
}

body[data-theme="dark"] .community-post p,
body[data-theme="dark"] .thread-comment-item p,
body[data-theme="dark"] .thread-reply-item p,
body[data-theme="dark"] .word-card p,
body[data-theme="dark"] .phrase-card p,
body[data-theme="dark"] .phrase-card-upgraded p,
body[data-theme="dark"] .story-segment p,
body[data-theme="dark"] .lesson-item p,
body[data-theme="dark"] .grammar-point p,
body[data-theme="dark"] .translator-panel p,
body[data-theme="dark"] .translator-example-card p,
body[data-theme="dark"] .practice-banner p,
body[data-theme="dark"] .result-card p{
  color:#b9c8dc !important;
}

/* force remaining bright containers to dark */
body[data-theme="dark"] [class*="card"]:not(.primary-btn):not(.play-btn):not(.phrase-play),
body[data-theme="dark"] [class*="panel"]:not(.primary-btn):not(.play-btn):not(.phrase-play),
body[data-theme="dark"] [class*="box"]:not(.primary-btn):not(.play-btn):not(.phrase-play),
body[data-theme="dark"] [class*="shell"]:not(.primary-btn):not(.play-btn):not(.phrase-play){
  border-color:rgba(132,174,255,.20) !important;
}
\n

/* ===== Readability fix: community + grammar + global dark text ===== */
body[data-theme="dark"]{
  --text-strong:#f5f9ff;
  --text-mid:#dbe6f7;
  --text-soft:#b8c7de;
  --text-dim:#9db0cb;
}

/* global readable text pass */
body[data-theme="dark"] *,
body[data-theme="dark"] *::before,
body[data-theme="dark"] *::after{
  text-shadow:none !important;
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] h5,
body[data-theme="dark"] h6,
body[data-theme="dark"] strong,
body[data-theme="dark"] b,
body[data-theme="dark"] .main-label,
body[data-theme="dark"] .menu-copy strong,
body[data-theme="dark"] .section-head h2,
body[data-theme="dark"] .hero-panel h2,
body[data-theme="dark"] .community-head-clean h2,
body[data-theme="dark"] .grammar-layout h2,
body[data-theme="dark"] .grammar-layout h3,
body[data-theme="dark"] .grammar-detail-card h2,
body[data-theme="dark"] .grammar-detail-card h3,
body[data-theme="dark"] .grammar-card h3,
body[data-theme="dark"] .word-card h3,
body[data-theme="dark"] .phrase-card h3,
body[data-theme="dark"] .lesson-item h3,
body[data-theme="dark"] .story-segment strong,
body[data-theme="dark"] .community-post strong,
body[data-theme="dark"] .thread-comment-top strong,
body[data-theme="dark"] .thread-reply-item strong,
body[data-theme="dark"] .summary-chip strong,
body[data-theme="dark"] .community-stat-card strong,
body[data-theme="dark"] .identity-chip strong,
body[data-theme="dark"] .limit-pill strong,
body[data-theme="dark"] .translator-example-card strong,
body[data-theme="dark"] .translator-lang-card strong{
  color:var(--text-strong) !important;
}

body[data-theme="dark"] p,
body[data-theme="dark"] span,
body[data-theme="dark"] small,
body[data-theme="dark"] label,
body[data-theme="dark"] li,
body[data-theme="dark"] td,
body[data-theme="dark"] th,
body[data-theme="dark"] .small-label,
body[data-theme="dark"] .menu-copy small,
body[data-theme="dark"] .section-head p,
body[data-theme="dark"] .community-post p,
body[data-theme="dark"] .thread-comment-item p,
body[data-theme="dark"] .thread-reply-item p,
body[data-theme="dark"] .grammar-card p,
body[data-theme="dark"] .grammar-detail-card p,
body[data-theme="dark"] .word-card p,
body[data-theme="dark"] .phrase-card p,
body[data-theme="dark"] .lesson-item p,
body[data-theme="dark"] .story-segment p,
body[data-theme="dark"] .translator-panel p,
body[data-theme="dark"] .translator-example-card p,
body[data-theme="dark"] .translator-lang-card span,
body[data-theme="dark"] .video-gallery-copy span,
body[data-theme="dark"] .video-side-copy span,
body[data-theme="dark"] .community-meta span{
  color:var(--text-soft) !important;
}

body[data-theme="dark"] .menu-item,
body[data-theme="dark"] .lesson-item,
body[data-theme="dark"] .story-segment,
body[data-theme="dark"] .grammar-card,
body[data-theme="dark"] .word-card,
body[data-theme="dark"] .phrase-card,
body[data-theme="dark"] .community-post,
body[data-theme="dark"] .thread-comment-item,
body[data-theme="dark"] .thread-reply-item,
body[data-theme="dark"] .video-gallery-card,
body[data-theme="dark"] .video-side-card{
  color:var(--text-mid) !important;
}

/* community specific */
body[data-theme="dark"] .community-account-card,
body[data-theme="dark"] .community-user-summary,
body[data-theme="dark"] .community-thread-panel,
body[data-theme="dark"] .community-post,
body[data-theme="dark"] .community-composer,
body[data-theme="dark"] .fb-composer-shell,
body[data-theme="dark"] .thread-comment-item,
body[data-theme="dark"] .thread-reply-item,
body[data-theme="dark"] .admin-panel-wrap .panel,
body[data-theme="dark"] .admin-card{
  background:
    linear-gradient(180deg, rgba(16,29,50,.98) 0%, rgba(10,20,37,.98) 100%) !important;
  border-color:rgba(138,176,255,.22) !important;
}

body[data-theme="dark"] .community-composer select,
body[data-theme="dark"] .community-composer input,
body[data-theme="dark"] .fb-composer-shell input,
body[data-theme="dark"] .reply-composer input{
  color:#eef4ff !important;
  background:linear-gradient(180deg,#14233c 0%,#0d1a30 100%) !important;
}

body[data-theme="dark"] .community-composer select option{
  color:#eef4ff;
  background:#10203a;
}

body[data-theme="dark"] .community-inline-message,
body[data-theme="dark"] .composer-post-note,
body[data-theme="dark"] .community-empty{
  color:var(--text-dim) !important;
}

body[data-theme="dark"] .summary-chip,
body[data-theme="dark"] .community-stat-card,
body[data-theme="dark"] .limit-pill{
  border:1px solid rgba(255,255,255,.08) !important;
}

body[data-theme="dark"] .profile-frame,
body[data-theme="dark"] .compact-profile-frame,
body[data-theme="dark"] .profile-frame-rich{
  background:linear-gradient(180deg,#173055 0%,#112542 100%) !important;
  border-color:rgba(138,176,255,.24) !important;
}
body[data-theme="dark"] .profile-frame h3,
body[data-theme="dark"] .profile-frame p,
body[data-theme="dark"] .profile-frame span{
  color:#f4f8ff !important;
}

/* grammar guide specific */
body[data-theme="dark"] .grammar-card,
body[data-theme="dark"] .grammar-detail-card,
body[data-theme="dark"] .grammar-point,
body[data-theme="dark"] .grammar-mini-box,
body[data-theme="dark"] .overview-feature,
body[data-theme="dark"] .check-item,
body[data-theme="dark"] .learning-mini-card,
body[data-theme="dark"] .mini-pair,
body[data-theme="dark"] .exercise-item,
body[data-theme="dark"] .exercise-inline-panel,
body[data-theme="dark"] .grammar-exercise-card{
  background:
    linear-gradient(180deg, rgba(16,29,50,.98) 0%, rgba(10,20,37,.98) 100%) !important;
  border-color:rgba(138,176,255,.22) !important;
}

body[data-theme="dark"] .grammar-card .examples-count,
body[data-theme="dark"] .grammar-card .count-badge,
body[data-theme="dark"] .grammar-card .badge,
body[data-theme="dark"] .lesson-item .examples-count,
body[data-theme="dark"] .story-chip,
body[data-theme="dark"] .page-indicator,
body[data-theme="dark"] .lesson-badge,
body[data-theme="dark"] .meaning-pill,
body[data-theme="dark"] .meaning-pill-yellow,
body[data-theme="dark"] .grammar-nav-btn,
body[data-theme="dark"] .grammar-tab,
body[data-theme="dark"] .tab-btn{
  color:#eef4ff !important;
}

body[data-theme="dark"] .grammar-card.active,
body[data-theme="dark"] .grammar-card:hover,
body[data-theme="dark"] .lesson-item.active,
body[data-theme="dark"] .lesson-item:hover,
body[data-theme="dark"] .story-segment.active,
body[data-theme="dark"] .story-segment:hover{
  background:
    linear-gradient(180deg, rgba(24,43,74,.98) 0%, rgba(12,24,45,.98) 100%) !important;
  border-color:rgba(138,176,255,.42) !important;
}

body[data-theme="dark"] .grammar-detail-card .topic,
body[data-theme="dark"] .grammar-detail-card .focus,
body[data-theme="dark"] .grammar-detail-card .examples,
body[data-theme="dark"] .grammar-detail-card .goal,
body[data-theme="dark"] .grammar-detail-card .pattern,
body[data-theme="dark"] .grammar-detail-card .overview,
body[data-theme="dark"] .grammar-detail-card .practice,
body[data-theme="dark"] .grammar-detail-card .memory,
body[data-theme="dark"] .grammar-detail-card .notice{
  color:#f2f7ff !important;
}

body[data-theme="dark"] .grammar-detail-card [class*="title"],
body[data-theme="dark"] .grammar-detail-card [class*="label"],
body[data-theme="dark"] .grammar-detail-card [class*="heading"],
body[data-theme="dark"] .grammar-detail-card [class*="name"]{
  color:#f4f8ff !important;
}

body[data-theme="dark"] .grammar-detail-card [class*="desc"],
body[data-theme="dark"] .grammar-detail-card [class*="summary"],
body[data-theme="dark"] .grammar-detail-card [class*="tip"],
body[data-theme="dark"] .grammar-detail-card [class*="text"],
body[data-theme="dark"] .grammar-detail-card [class*="example"]{
  color:var(--text-soft) !important;
}

/* blue/green bilingual boxes in lessons readable */
body[data-theme="dark"] .object-pill.object-it,
body[data-theme="dark"] .object-pill.object-en,
body[data-theme="dark"] .detect-mini.en-box,
body[data-theme="dark"] .detect-mini.it-box,
body[data-theme="dark"] .mini-pair,
body[data-theme="dark"] .learning-mini-card{
  color:#eef4ff !important;
}

body[data-theme="dark"] .object-pill.object-it *,
body[data-theme="dark"] .object-pill.object-en *,
body[data-theme="dark"] .detect-mini.en-box *,
body[data-theme="dark"] .detect-mini.it-box *,
body[data-theme="dark"] .mini-pair *,
body[data-theme="dark"] .learning-mini-card *{
  color:#eef4ff !important;
}

/* remove washed-out light backgrounds that still appear */
body[data-theme="dark"] .community-account-card *,
body[data-theme="dark"] .community-user-summary *,
body[data-theme="dark"] .community-post *,
body[data-theme="dark"] .thread-comment-item *,
body[data-theme="dark"] .thread-reply-item *,
body[data-theme="dark"] .grammar-card *,
body[data-theme="dark"] .grammar-detail-card *,
body[data-theme="dark"] .lesson-item *,
body[data-theme="dark"] .story-segment *,
body[data-theme="dark"] .word-card *,
body[data-theme="dark"] .phrase-card *{
  border-color:rgba(138,176,255,.18);
}

/* keep pastel stat cards readable */
body[data-theme="dark"] .summary-posts *,
body[data-theme="dark"] .summary-comments *,
body[data-theme="dark"] .summary-xp *,
body[data-theme="dark"] .summary-tests *,
body[data-theme="dark"] .summary-post-limit *,
body[data-theme="dark"] .summary-reply-limit *,
body[data-theme="dark"] .stat-posts *,
body[data-theme="dark"] .stat-comments *,
body[data-theme="dark"] .stat-wins *,
body[data-theme="dark"] .stat-questions *,
body[data-theme="dark"] .limit-pill-posts *,
body[data-theme="dark"] .limit-pill-replies *{
  color:inherit !important;
}



/* ===== Final readability fix for white/faded text areas ===== */
body[data-theme="dark"] .overview-feature,
body[data-theme="dark"] .overview-card,
body[data-theme="dark"] .overview-tab-panel,
body[data-theme="dark"] .grammar-overview-panel,
body[data-theme="dark"] .grammar-overview-card,
body[data-theme="dark"] .sentence-map,
body[data-theme="dark"] .sentence-map-card,
body[data-theme="dark"] .detail-panel,
body[data-theme="dark"] .detail-card,
body[data-theme="dark"] .pattern-card,
body[data-theme="dark"] .memory-card,
body[data-theme="dark"] .focus-card,
body[data-theme="dark"] .sound-card{
  background:linear-gradient(180deg, rgba(15,28,49,.98) 0%, rgba(9,18,34,.98) 100%) !important;
  color:#eef4ff !important;
  border-color:rgba(138,176,255,.22) !important;
}

body[data-theme="dark"] .overview-feature *,
body[data-theme="dark"] .overview-card *,
body[data-theme="dark"] .overview-tab-panel *,
body[data-theme="dark"] .grammar-overview-panel *,
body[data-theme="dark"] .grammar-overview-card *,
body[data-theme="dark"] .sentence-map *,
body[data-theme="dark"] .sentence-map-card *,
body[data-theme="dark"] .detail-panel *,
body[data-theme="dark"] .detail-card *,
body[data-theme="dark"] .pattern-card *,
body[data-theme="dark"] .memory-card *,
body[data-theme="dark"] .focus-card *,
body[data-theme="dark"] .sound-card *{
  color:#eef4ff !important;
}

body[data-theme="dark"] .overview-feature p,
body[data-theme="dark"] .overview-card p,
body[data-theme="dark"] .grammar-overview-panel p,
body[data-theme="dark"] .grammar-overview-card p,
body[data-theme="dark"] .sentence-map p,
body[data-theme="dark"] .sentence-map-card p,
body[data-theme="dark"] .detail-panel p,
body[data-theme="dark"] .detail-card p,
body[data-theme="dark"] .pattern-card p,
body[data-theme="dark"] .memory-card p,
body[data-theme="dark"] .focus-card p,
body[data-theme="dark"] .sound-card p{
  color:#d7e3f7 !important;
}

body[data-theme="dark"] .english-box,
body[data-theme="dark"] .italian-box,
body[data-theme="dark"] .translation-box,
body[data-theme="dark"] .sentence-box,
body[data-theme="dark"] .meaning-box,
body[data-theme="dark"] .object-pill,
body[data-theme="dark"] .object-pill.object-it,
body[data-theme="dark"] .object-pill.object-en,
body[data-theme="dark"] .detect-mini.en-box,
body[data-theme="dark"] .detect-mini.it-box,
body[data-theme="dark"] .mini-pair,
body[data-theme="dark"] .learning-mini-card,
body[data-theme="dark"] .translation-pair > div,
body[data-theme="dark"] [class*="english"],
body[data-theme="dark"] [class*="italian"]{
  color:#eef4ff !important;
}

body[data-theme="dark"] .english-box *,
body[data-theme="dark"] .italian-box *,
body[data-theme="dark"] .translation-box *,
body[data-theme="dark"] .sentence-box *,
body[data-theme="dark"] .meaning-box *,
body[data-theme="dark"] .object-pill *,
body[data-theme="dark"] .detect-mini.en-box *,
body[data-theme="dark"] .detect-mini.it-box *,
body[data-theme="dark"] .mini-pair *,
body[data-theme="dark"] .learning-mini-card *,
body[data-theme="dark"] .translation-pair > div *{
  color:#eef4ff !important;
}

body[data-theme="dark"] .english-box p,
body[data-theme="dark"] .italian-box p,
body[data-theme="dark"] .translation-box p,
body[data-theme="dark"] .sentence-box p,
body[data-theme="dark"] .meaning-box p,
body[data-theme="dark"] .object-pill p,
body[data-theme="dark"] .mini-pair p,
body[data-theme="dark"] .learning-mini-card p{
  color:#dbe6f7 !important;
}

body[data-theme="dark"] .object-pill.object-en,
body[data-theme="dark"] .detect-mini.en-box,
body[data-theme="dark"] .english-box{
  background:linear-gradient(180deg,#17345a 0%,#112846 100%) !important;
}

body[data-theme="dark"] .object-pill.object-it,
body[data-theme="dark"] .detect-mini.it-box,
body[data-theme="dark"] .italian-box{
  background:linear-gradient(180deg,#154b34 0%,#103726 100%) !important;
}

/* numbers/lesson bilingual rows */
body[data-theme="dark"] .learning-mini-card .small-label,
body[data-theme="dark"] .mini-pair .small-label,
body[data-theme="dark"] .object-pill .small-label,
body[data-theme="dark"] .sentence-box .small-label,
body[data-theme="dark"] .meaning-box .small-label{
  color:#f2f7ff !important;
  opacity:.95;
}

body[data-theme="dark"] .learning-mini-card [class*="word"],
body[data-theme="dark"] .learning-mini-card [class*="sentence"],
body[data-theme="dark"] .mini-pair [class*="word"],
body[data-theme="dark"] .mini-pair [class*="sentence"],
body[data-theme="dark"] .object-pill [class*="word"],
body[data-theme="dark"] .object-pill [class*="sentence"]{
  color:#ffffff !important;
  opacity:1 !important;
}

/* fix pale panels inside grammar overview screenshot */
body[data-theme="dark"] .grammar-detail-card [style*="background"],
body[data-theme="dark"] .overview-feature [style*="background"],
body[data-theme="dark"] .sentence-map-card [style*="background"]{
  color:#eef4ff !important;
}

/* stronger force for invisible text */
body[data-theme="dark"] [style*="color: rgb(0"],
body[data-theme="dark"] [style*="color:#000"],
body[data-theme="dark"] [style*="color: #000"],
body[data-theme="dark"] [style*="color:#111"],
body[data-theme="dark"] [style*="color: #111"],
body[data-theme="dark"] [style*="color:#222"],
body[data-theme="dark"] [style*="color: #222"]{
  color:#eef4ff !important;
}



/* ===== Video popup compact + preview strip ===== */
.video-lightbox{padding:18px}
.video-lightbox-dialog{width:min(1120px,94vw)}
.video-lightbox-stage{grid-template-columns:48px minmax(0,560px) minmax(220px,280px) 48px;align-items:stretch;gap:14px}
.video-lightbox-main{padding:12px 12px 14px;align-content:start;min-height:0}
.video-embed-wrap-modal{max-width:220px;max-height:58vh}
.video-meta-block h3{font-size:20px}
.video-meta-block p{font-size:14px;line-height:1.5}
.video-main-actions{justify-content:center;position:sticky;bottom:0;padding-top:4px}
.video-main-actions .secondary-btn,.video-main-actions .primary-btn{min-width:180px}
.video-preview-strip{display:grid;grid-template-rows:auto 1fr;gap:12px;padding:12px;border-radius:24px;max-height:min(78vh,720px);overflow:hidden}
.video-preview-head{display:flex;justify-content:space-between;align-items:center;gap:10px;text-transform:uppercase}
.video-preview-head strong{font-size:14px;letter-spacing:.06em}
.video-preview-head span{font-size:11px;letter-spacing:.08em;color:var(--muted);font-weight:800}
.video-preview-list{display:grid;gap:12px;overflow:auto;padding-right:4px}
.video-preview-card{display:grid;grid-template-columns:78px 1fr;gap:12px;align-items:center;text-align:left;border:1px solid var(--line);background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);border-radius:20px;padding:10px;cursor:pointer;transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;color:var(--text)}
.video-preview-card:hover{transform:translateY(-2px);border-color:#91b4ff;box-shadow:0 14px 26px rgba(31,55,100,.14)}
.video-preview-thumb{position:relative;aspect-ratio:9/16;border-radius:14px;overflow:hidden;background:#000}
.video-preview-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.video-preview-copy{display:grid;gap:6px}
.video-preview-copy em{font-style:normal;color:#8ea1c1;font-size:11px;font-weight:800;letter-spacing:.04em}
.video-preview-copy strong{font-size:16px;line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body[data-theme="dark"] .video-preview-strip{background:linear-gradient(180deg,#0f1c31 0%,#0a1528 100%);border-color:rgba(132,174,255,.22)}
body[data-theme="dark"] .video-preview-card{background:linear-gradient(180deg,#172741 0%,#101d33 100%);border-color:rgba(132,174,255,.2);color:#eef4ff}
body[data-theme="dark"] .video-preview-copy em{color:#a8b9d2}
body[data-theme="dark"] .video-preview-card:hover{border-color:rgba(132,180,255,.45);box-shadow:0 14px 28px rgba(61,112,255,.18)}
@media (max-width: 1100px){
  .video-lightbox-dialog{width:min(980px,96vw)}
  .video-lightbox-stage{grid-template-columns:48px minmax(0,1fr) minmax(200px,240px) 48px}
}
@media (max-width: 900px){
  .video-lightbox{padding:10px}
  .video-lightbox-dialog{width:min(680px,96vw)}
  .video-lightbox-stage{grid-template-columns:1fr;gap:10px}
  .video-nav-btn{width:100%;height:46px;border-radius:16px;font-size:26px}
  .video-nav-btn-left{order:2}
  .video-lightbox-main{order:1}
  .video-preview-strip{order:3;max-height:none;padding:10px}
  .video-nav-btn-right{order:4}
  .video-preview-list{grid-auto-flow:column;grid-auto-columns:minmax(180px, 72%);overflow-x:auto;overflow-y:hidden;padding-bottom:4px}
  .video-preview-card{grid-template-columns:64px 1fr;min-height:112px}
  .video-embed-wrap-modal{max-width:200px;max-height:48vh}
  .video-main-actions .secondary-btn,.video-main-actions .primary-btn{min-width:0;flex:1 1 0}
}
@media (max-width: 560px){
  .video-lightbox-main{padding:10px}
  .video-player-top{gap:8px}
  .video-meta-block h3{font-size:18px}
  .video-meta-block p{font-size:13px}
  .video-embed-wrap-modal{max-width:170px;max-height:42vh}
  .video-preview-list{grid-auto-columns:minmax(160px, 82%)}
  .video-lightbox-close{right:0;top:-4px}
}


/* ===== Popup compact polish + responsive up-next ===== */
.video-lightbox{padding:14px !important}
.video-lightbox-dialog{width:min(980px,94vw) !important}
.video-lightbox-stage{
  grid-template-columns:38px minmax(0,560px) minmax(220px,260px) 38px !important;
  gap:12px !important;
  align-items:stretch !important;
}
.video-lightbox-main{
  gap:10px !important;
  padding:12px 12px 10px !important;
  border-radius:22px !important;
}
.video-lightbox-close{
  width:40px !important;
  height:40px !important;
  right:-2px !important;
  top:-2px !important;
  font-size:26px !important;
}
.video-nav-btn{
  width:38px !important;
  height:38px !important;
  font-size:24px !important;
  align-self:center !important;
}
.video-embed-wrap-modal{
  max-width:220px !important;
  max-height:52vh !important;
}
.video-meta-block{gap:4px !important}
.video-meta-block h3{font-size:18px !important;margin:0 !important}
.video-meta-block p{font-size:13px !important;line-height:1.45 !important}
.video-main-actions{
  gap:10px !important;
  margin-top:2px !important;
}
.video-main-actions .secondary-btn,
.video-main-actions .primary-btn{
  padding:12px 16px !important;
  min-height:48px !important;
}
.video-preview-strip{
  padding:10px !important;
  border-radius:22px !important;
  max-height:72vh !important;
  overflow:hidden !important;
}
.video-preview-head{margin-bottom:6px !important}
.video-preview-list{
  gap:10px !important;
  max-height:calc(72vh - 44px) !important;
  overflow:auto !important;
  padding-right:3px !important;
}
.video-preview-card{
  grid-template-columns:74px 1fr !important;
  gap:10px !important;
  padding:8px !important;
  border-radius:18px !important;
  min-height:128px !important;
}
.video-preview-thumb{border-radius:12px !important}
.video-preview-copy{gap:4px !important}
.video-preview-copy strong{font-size:15px !important}
.video-preview-copy em{font-size:10px !important}
@media (max-width: 1100px){
  .video-lightbox-dialog{width:min(920px,95vw) !important}
  .video-lightbox-stage{
    grid-template-columns:36px minmax(0,1fr) minmax(210px,240px) 36px !important;
    gap:10px !important;
  }
  .video-embed-wrap-modal{max-width:210px !important}
}
@media (max-width: 900px){
  .video-lightbox{padding:10px !important}
  .video-lightbox-dialog{width:min(700px,96vw) !important}
  .video-lightbox-stage{grid-template-columns:1fr !important;gap:10px !important}
  .video-lightbox-main{order:1 !important}
  .video-preview-strip{
    order:2 !important;
    max-height:none !important;
    padding:10px !important;
  }
  .video-nav-btn{
    width:100% !important;
    height:44px !important;
    border-radius:14px !important;
  }
  .video-nav-btn-left{order:3 !important}
  .video-nav-btn-right{order:4 !important}
  .video-preview-list{
    display:grid !important;
    grid-auto-flow:column !important;
    grid-auto-columns:minmax(170px,74%) !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    max-height:none !important;
    padding-bottom:4px !important;
  }
  .video-preview-card{
    min-height:112px !important;
    grid-template-columns:62px 1fr !important;
  }
}
@media (max-width: 560px){
  .video-lightbox{padding:8px !important}
  .video-lightbox-main{padding:10px !important}
  .video-embed-wrap-modal{
    max-width:180px !important;
    max-height:42vh !important;
  }
  .video-main-actions{
    grid-template-columns:1fr 1fr !important;
    display:grid !important;
  }
  .video-main-actions .secondary-btn,
  .video-main-actions .primary-btn{
    width:100% !important;
    min-width:0 !important;
    padding:11px 12px !important;
  }
  .video-preview-head strong{font-size:13px !important}
  .video-preview-head span{font-size:10px !important}
}


.stat[data-open-screen]{cursor:pointer;}
.stat[data-open-screen] strong,.stat[data-open-screen] span{pointer-events:none;}


/* UI polish upgrade: animated menu + home tiles */
.screen.active{animation:none}
.screen-enter{animation:screenFadeUp .46s cubic-bezier(.2,.8,.2,1)}
@keyframes screenFadeUp{
  from{opacity:0;transform:translateY(18px) scale(.988)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

.menu-item,
.stat[data-open-screen],
.home-card[data-open-screen]{
  position:relative;
  overflow:hidden;
  isolation:isolate;
}

.menu-item::before,
.stat[data-open-screen]::before,
.home-card[data-open-screen]::before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(120deg,transparent 0%,rgba(255,255,255,.14) 35%,rgba(255,255,255,.78) 50%,rgba(255,255,255,.14) 65%,transparent 100%);
  transform:translateX(-140%);
  transition:transform .7s ease;
  pointer-events:none;
  z-index:0;
}
.menu-item:hover::before,
.menu-item.active::before,
.stat[data-open-screen]:hover::before,
.home-card[data-open-screen]:hover::before{
  transform:translateX(140%);
}
.menu-item > *,
.stat[data-open-screen] > *,
.home-card[data-open-screen] > *{position:relative;z-index:1}

.menu-item{
  transform-origin:left center;
  transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease,background .22s ease;
  animation:menuItemIn .55s ease both;
  animation-delay:calc(var(--menu-index,0) * 45ms);
}
@keyframes menuItemIn{
  from{opacity:0;transform:translateX(-18px)}
  to{opacity:1;transform:translateX(0)}
}
.menu-item:hover{
  transform:translateX(4px) scale(1.01) !important;
  border-color:#b9cff3;
}
.menu-item.active{
  transform:translateX(8px) scale(1.015) !important;
  box-shadow:0 18px 34px rgba(31,55,100,.12), 0 0 0 1px rgba(255,255,255,.7) inset !important;
}
.menu-item.active .menu-copy strong{color:#17365f}
.menu-item.active .menu-arrow{transform:translateX(2px);color:#27405f}
.menu-item.active::after{
  content:"";
  position:absolute;
  left:0;
  top:14px;
  bottom:14px;
  width:5px;
  border-radius:999px;
  background:linear-gradient(180deg,#22c55e,#2563eb);
  box-shadow:0 0 0 1px rgba(255,255,255,.55);
}
.menu-item.menu-active-pop{animation:menuActivePop .45s ease}
@keyframes menuActivePop{
  0%{transform:translateX(0) scale(.985)}
  60%{transform:translateX(10px) scale(1.02)}
  100%{transform:translateX(8px) scale(1.015)}
}
.menu-item:nth-child(1).active{background:linear-gradient(135deg,#fff8ed 0%,#eef8f2 100%)}
.menu-item:nth-child(2).active{background:linear-gradient(135deg,#fff1f7 0%,#fef8ff 100%)}
.menu-item:nth-child(3).active{background:linear-gradient(135deg,#effff4 0%,#f8fffb 100%)}
.menu-item:nth-child(4).active{background:linear-gradient(135deg,#eef5ff 0%,#f7fbff 100%)}
.menu-item:nth-child(5).active{background:linear-gradient(135deg,#f5eeff 0%,#fbf8ff 100%)}
.menu-item:nth-child(6).active{background:linear-gradient(135deg,#ecfcff 0%,#f7feff 100%)}
.menu-item:nth-child(7).active{background:linear-gradient(135deg,#fff6ee 0%,#fffbf6 100%)}
.menu-item:nth-child(8).active{background:linear-gradient(135deg,#f3eeff 0%,#fbf8ff 100%)}
.menu-item:nth-child(9).active{background:linear-gradient(135deg,#fffbe8 0%,#fffef8 100%)}
.menu-item:nth-child(10).active{background:linear-gradient(135deg,#f3f7ff 0%,#fbfdff 100%)}
.menu-item:nth-child(11).active{background:linear-gradient(135deg,#fff1f1 0%,#fff9f9 100%)}

.stats .stat,
.home-card-grid .home-card{
  cursor:pointer;
  animation:tileIn .5s ease both;
  animation-delay:calc(var(--tile-index,0) * 60ms);
}
@keyframes tileIn{
  from{opacity:0;transform:translateY(18px)}
  to{opacity:1;transform:translateY(0)}
}
.stats .stat:hover,
.home-card-grid .home-card:hover{
  transform:translateY(-8px) scale(1.02) !important;
  box-shadow:0 24px 40px rgba(31,55,100,.14) !important;
}
.stats .stat:active,
.home-card-grid .home-card:active{
  transform:translateY(-2px) scale(.985) !important;
}

.stats .stat.green:hover{background:linear-gradient(135deg,#d9fbe7 0%,#bff4d5 100%)}
.stats .stat.blue:hover{background:linear-gradient(135deg,#e6f2ff 0%,#cde6ff 100%)}
.stats .stat.purple:hover{background:linear-gradient(135deg,#f1e7ff 0%,#decfff 100%)}
.stats .stat.orange:hover{background:linear-gradient(135deg,#fff3e4 0%,#ffe0b8 100%)}
.home-card.green:hover{background:linear-gradient(135deg,#ffffff 0%,#dbf9e8 100%)}
.home-card.blue:hover{background:linear-gradient(135deg,#ffffff 0%,#dcebff 100%)}
.home-card.purple:hover{background:linear-gradient(135deg,#ffffff 0%,#eadcff 100%)}
.home-card.orange:hover{background:linear-gradient(135deg,#ffffff 0%,#ffe7c8 100%)}

.stats .stat strong,
.home-card h3{transition:letter-spacing .2s ease, transform .2s ease, color .2s ease}
.stats .stat:hover strong,
.home-card:hover h3{letter-spacing:-.01em;transform:translateX(2px);color:#102746}
.stats .stat span,
.home-card p{transition:color .2s ease, opacity .2s ease}
.stats .stat:hover span,
.home-card:hover p{color:#314968}

.hero-panel,
.topbar-v2,
.sidebar,
.sidebar-streak-card{
  backdrop-filter:blur(14px);
}
.topbar-v2{transition:box-shadow .22s ease, transform .22s ease}
.topbar-v2:hover{box-shadow:0 20px 40px rgba(21,34,64,.10);transform:translateY(-1px)}
.brand-logo{transition:transform .4s ease, box-shadow .4s ease}
.brand:hover .brand-logo{transform:rotate(-6deg) scale(1.05);box-shadow:0 18px 34px rgba(37,99,235,.24)}

@media (prefers-reduced-motion: reduce){
  .screen-enter,
  .menu-item,
  .stats .stat,
  .home-card-grid .home-card{animation:none !important}
  .menu-item::before,
  .stat[data-open-screen]::before,
  .home-card[data-open-screen]::before{display:none}
}


/* Home quick boxes premium refresh */
.stats{align-items:stretch}
.stat[data-open-screen]{
  min-height:176px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:10px;
  padding:18px 18px 20px;
  border-radius:24px;
  border:1px solid rgba(181,195,221,.65);
  box-shadow:0 12px 26px rgba(32,55,96,.08);
  transition:transform .24s ease, box-shadow .24s ease, border-color .24s ease, filter .24s ease;
}
.stat[data-open-screen]:hover{
  transform:translateY(-6px) scale(1.02);
  box-shadow:0 24px 42px rgba(32,55,96,.16);
  border-color:rgba(91,123,201,.45);
  filter:saturate(1.05);
}
.stat[data-open-screen]:active{
  transform:translateY(-2px) scale(.995);
}
.stat-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.stat-emoji{
  width:54px;height:54px;border-radius:18px;display:inline-flex;align-items:center;justify-content:center;
  font-size:28px;background:rgba(255,255,255,.62);backdrop-filter:blur(8px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.65), 0 10px 18px rgba(27,39,70,.08);
}
.stat-chip{
  padding:8px 12px;border-radius:999px;font-size:12px;font-weight:800;letter-spacing:.02em;
  background:rgba(255,255,255,.75);color:#20365a;border:1px solid rgba(255,255,255,.55);
}
.stat[data-open-screen] strong{font-size:32px;line-height:1.02;letter-spacing:-.02em}
.stat[data-open-screen] span:last-child{font-size:16px;font-weight:700;color:#344861;max-width:15ch;line-height:1.35}
.stat-videos{background:linear-gradient(135deg,#ffe3ec 0%,#ffd4e2 38%,#ffeec9 100%) !important}
.stat-lessons{background:linear-gradient(135deg,#dff0ff 0%,#d9ebff 45%,#e9e2ff 100%) !important}
.stat-community{background:linear-gradient(135deg,#efe4ff 0%,#e6ddff 46%,#ffe7f2 100%) !important}
.stat-translator{background:linear-gradient(135deg,#fff1d9 0%,#ffe7c3 44%,#e5f7f2 100%) !important}
.stat-videos .stat-chip{color:#8d2859}
.stat-lessons .stat-chip{color:#25519d}
.stat-community .stat-chip{color:#6a35a4}
.stat-translator .stat-chip{color:#986118}
.stat-videos .stat-emoji{background:linear-gradient(135deg,rgba(255,255,255,.88),rgba(255,237,244,.8))}
.stat-lessons .stat-emoji{background:linear-gradient(135deg,rgba(255,255,255,.9),rgba(228,240,255,.82))}
.stat-community .stat-emoji{background:linear-gradient(135deg,rgba(255,255,255,.9),rgba(242,235,255,.82))}
.stat-translator .stat-emoji{background:linear-gradient(135deg,rgba(255,255,255,.9),rgba(255,242,214,.82))}

body[data-theme="dark"] .stat[data-open-screen]{border-color:rgba(255,255,255,.08);box-shadow:0 12px 28px rgba(0,0,0,.24)}
body[data-theme="dark"] .stat[data-open-screen] strong{color:#16233c}
body[data-theme="dark"] .stat[data-open-screen] span:last-child{color:#344861}
body[data-theme="dark"] .stat-chip{background:rgba(255,255,255,.72)}


/* Home hero slider */
.hero-slider{position:relative;overflow:hidden;min-height:430px;border-radius:30px;background:linear-gradient(135deg,#ffffff 0%,#f1f6ff 50%,#eef8f0 100%)}
.hero-slide{display:none;animation:heroFade .45s ease}
.hero-slide.active{display:block}
@keyframes heroFade{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.hero-slider .tag{background:linear-gradient(180deg,#fff6d9,#f7e5a6);color:#5f4700;border:1px solid #e8d27e}
.hero-mini-posts{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:18px}
.hero-mini-card,.hero-demo-post{border:1px solid var(--line);border-radius:20px;padding:14px 16px;background:rgba(255,255,255,.72);backdrop-filter:blur(10px);box-shadow:0 12px 24px rgba(25,42,70,.06)}
.hero-mini-card strong,.hero-demo-post strong{display:block;font-size:18px;margin-bottom:6px;color:var(--brand)}
.hero-mini-card span,.hero-demo-post span{color:#45586f;line-height:1.5}
.hero-mini-card.green{background:linear-gradient(180deg,#ffffff,#effaf3)}
.hero-mini-card.blue{background:linear-gradient(180deg,#ffffff,#eef6ff)}
.hero-mini-card.purple{background:linear-gradient(180deg,#ffffff,#f5efff)}
.hero-demo-post{cursor:pointer;text-align:left;transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease}
.hero-demo-post:hover{transform:translateY(-3px);border-color:#b7cdf5;box-shadow:0 16px 28px rgba(31,55,100,.12);background:linear-gradient(180deg,#fff,#f6f9ff)}
.hero-slider-nav{position:absolute;left:18px;right:18px;bottom:16px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.hero-nav-btn{width:48px;height:48px;border:none;border-radius:16px;background:rgba(255,255,255,.82);backdrop-filter:blur(10px);font-size:28px;font-weight:800;color:var(--brand);cursor:pointer;box-shadow:0 12px 24px rgba(19,31,59,.08);transition:transform .18s ease, box-shadow .18s ease, background .18s ease}
.hero-nav-btn:hover{transform:translateY(-2px);background:#fff;box-shadow:0 16px 28px rgba(19,31,59,.12)}
.hero-dots{display:flex;align-items:center;gap:10px}
.hero-dot{width:12px;height:12px;border:none;border-radius:999px;background:#c7d6ef;cursor:pointer;transition:transform .18s ease, width .18s ease, background .18s ease}
.hero-dot.active{width:34px;background:linear-gradient(135deg,var(--brand),var(--brand2))}
@media (max-width:1100px){.hero-mini-posts{grid-template-columns:1fr}.hero-slider{min-height:auto;padding-bottom:80px}}


/* Hero slider upgrade */
.hero-slide{cursor:pointer}
.hero-slide .hero-nav-btn,.hero-slide .hero-dot{cursor:pointer}
.hero-slide-wordbank h2,.hero-slide-grammar h2{max-width:15ch}
.wordbank-preview-cards .hero-mini-card{display:grid;gap:12px;align-content:start;min-height:168px}
.hero-mini-word-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.hero-mini-word-top strong{margin:0;font-size:22px}
.hero-mini-word{cursor:pointer}
.hero-mini-word:hover{border-color:#b7cdf5;box-shadow:0 18px 30px rgba(31,55,100,.12);transform:translateY(-4px)}
.hero-mini-flags{display:flex;gap:8px;flex-wrap:wrap}
.mini-flag-pill{display:inline-flex;align-items:center;gap:8px;padding:8px 10px;border-radius:999px;background:rgba(255,255,255,.82);border:1px solid rgba(199,213,239,.9);font-size:12px;font-weight:800;color:#20365a}
.hero-mini-play{width:36px;height:36px;border:none;border-radius:12px;background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;font-size:14px;font-weight:800;cursor:pointer;box-shadow:0 10px 20px rgba(31,55,100,.18);transition:transform .18s ease, box-shadow .18s ease, filter .18s ease}
.hero-mini-play:hover{transform:translateY(-2px) scale(1.04);box-shadow:0 14px 24px rgba(31,55,100,.2);filter:saturate(1.06)}
.hero-mini-play.audio-active,.hero-mini-play.is-speaking{background:linear-gradient(135deg,#2a5fd2,#5e8cff)}
.hero-slide-wordbank .hero-mini-card span:last-child{font-size:18px;font-weight:700;color:#435977}
.grammar-demo-posts{align-items:stretch}
.grammar-demo-card{display:grid;gap:10px;min-height:170px;padding:18px 18px 20px;border-radius:22px}
.grammar-demo-card small{font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#5b6d84}
.grammar-demo-card strong{font-size:22px;margin:0;color:#162a49}
.grammar-demo-card span{font-size:15px;line-height:1.55;color:#465a73}
.grammar-demo-card.articles{background:linear-gradient(180deg,#fff,#eef7ff)}
.grammar-demo-card.tense{background:linear-gradient(180deg,#fff,#effaf3)}
.grammar-demo-card.order{background:linear-gradient(180deg,#fff,#f7f0ff)}
.grammar-demo-card:hover{transform:translateY(-4px);box-shadow:0 18px 30px rgba(31,55,100,.12);border-color:#b7cdf5}
.stat[data-open-screen] strong{font-size:30px;line-height:1.08;word-break:break-word}
.stat[data-open-screen] span:last-child{max-width:none}
.stat-community strong{font-size:28px}
@media (max-width:1100px){
  .hero-slide-wordbank h2,.hero-slide-grammar h2{max-width:none}
  .wordbank-preview-cards .hero-mini-card,.grammar-demo-card{min-height:auto}
}


/* Requested polish update */
.hero-slider{padding-bottom:28px;overflow:hidden}
.hero-slider-nav{top:18px !important;right:18px !important;left:auto !important;bottom:auto !important;justify-content:flex-end !important;z-index:5}
.hero-slider-nav-dots-only{width:auto}
.hero-dots{background:rgba(255,255,255,.76);backdrop-filter:blur(10px);padding:8px 10px;border-radius:999px;box-shadow:0 10px 24px rgba(31,55,100,.08)}
.hero-slide h2{max-width:none !important;line-height:1.05 !important;letter-spacing:-.035em !important;text-wrap:unset !important}
.hero-title-line{display:block !important;white-space:nowrap}
.hero-title-line-flags{display:flex !important;align-items:center;gap:12px}
.hero-flag-line{display:inline-flex !important;align-items:center;gap:6px;margin:0 !important;flex:0 0 auto}
.hero-slide p{max-width:820px !important}
.stat-community strong{font-size:27px !important}
.video-embed-wrap,.video-embed-wrap-modal{background:linear-gradient(135deg,#121722,#1e283c) !important}
.video-embed-wrap .di-video-player{width:100%;height:100%;position:absolute;inset:0}
.video-embed-wrap .di-video-player iframe{width:100%;height:100%;border:0;border-radius:inherit;background:#000}
@media (max-width:1100px){
  .hero-slider{padding-top:56px}
  .hero-slider-nav{top:14px !important;right:14px !important}
  .hero-title-line{white-space:normal}
  .hero-title-line-flags{display:block !important}
  .hero-title-line-flags .hero-flag-line{display:flex !important;margin:0 0 8px 0 !important}
}

.hero-slider{padding-bottom:28px;overflow:hidden}
.hero-slider-nav{top:18px !important;right:18px !important;left:auto !important;bottom:auto !important;justify-content:flex-end !important;z-index:5}
.hero-slider-nav-dots-only{width:auto}
.hero-dots{background:rgba(255,255,255,.76);backdrop-filter:blur(10px);padding:8px 10px;border-radius:999px;box-shadow:0 10px 24px rgba(31,55,100,.08)}
.hero-slide h2{max-width:none !important;line-height:1.05 !important;letter-spacing:-.035em !important;text-wrap:unset !important}
.hero-title-line{display:block !important;white-space:nowrap}
.hero-title-line-flags{display:flex !important;align-items:center;gap:12px}
.hero-flag-line{display:inline-flex !important;align-items:center;gap:6px;margin:0 !important;flex:0 0 auto}
.hero-slide p{max-width:820px !important}
.stat-community strong{font-size:27px !important}
.video-embed-wrap,.video-embed-wrap-modal{background:linear-gradient(135deg,#121722,#1e283c) !important}
.video-embed-wrap .di-video-player{width:100%;height:100%;position:absolute;inset:0}
.video-embed-wrap .di-video-player iframe{width:100%;height:100%;border:0;border-radius:inherit;background:#000}
@media (max-width:1100px){
  .hero-slider{padding-top:56px}
  .hero-slider-nav{top:14px !important;right:14px !important}
  .hero-title-line{white-space:normal}
  .hero-title-line-flags{display:block !important}
  .hero-title-line-flags .hero-flag-line{display:flex !important;margin:0 0 8px 0 !important}
}

/* final requested polish */
.profile-icon-btn,.auth-open-icon-btn{position:relative;display:grid;place-items:center;padding:0;overflow:hidden}
.profile-icon-shape,.account-avatar-icon{display:block;width:26px;height:26px;border-radius:999px;background:#fff;position:relative;box-shadow:0 1px 0 rgba(255,255,255,.35) inset}
.profile-icon-shape::before,.account-avatar-icon::before{content:"";position:absolute;left:50%;top:2px;transform:translateX(-50%);width:11px;height:11px;border-radius:50%;background:#fff}
.profile-icon-shape::after,.account-avatar-icon::after{content:"";position:absolute;left:50%;bottom:1px;transform:translateX(-50%);width:18px;height:10px;border-radius:12px 12px 8px 8px;background:#fff}
.profile-icon-btn{background:linear-gradient(135deg,#3c8cdf,#2f6eb8)!important}
.auth-open-icon-btn{min-width:58px;width:58px;height:58px;border-radius:18px;padding:0;font-size:0}
.auth-open-icon-btn .account-avatar-icon{width:28px;height:28px;background:#fff;box-shadow:none}
.auth-open-icon-btn .account-avatar-icon::before,.auth-open-icon-btn .account-avatar-icon::after{background:#2f6eb8}
.auth-open-icon-btn .account-avatar-icon{background:transparent}
.auth-open-icon-btn .auth-bell-badge{position:absolute;right:6px;top:4px;font-size:13px}

.hero-slider{position:relative;overflow:hidden}
.hero-slide{display:none;min-height:500px;flex-direction:column;align-items:flex-start}
.hero-slide.active{display:flex}
.hero-slide h2{max-width:100%;margin-right:0;font-size:clamp(2.2rem,4vw,4.15rem);line-height:1.06;letter-spacing:-.04em;overflow-wrap:anywhere;word-break:normal}
.hero-slide p{max-width:92%;font-size:clamp(1rem,1.3vw,1.18rem);line-height:1.58}
.hero-slide .hero-actions,.hero-slide .hero-mini-posts{margin-top:auto}
.hero-slide .hero-actions{padding-top:28px;width:100%;display:flex;justify-content:space-between;align-items:flex-end}
.hero-slide .hero-mini-posts{width:100%;padding-top:22px}
.hero-slider-nav{position:absolute;top:22px;right:24px;left:auto;bottom:auto;z-index:4;display:flex;justify-content:flex-end;align-items:center}
.hero-slider-nav-dots-only .hero-dots{margin-left:auto}
.hero-nav-btn{display:none!important}
.hero-dots{gap:10px;background:rgba(255,255,255,.84);padding:8px 12px;border-radius:999px;box-shadow:0 10px 24px rgba(31,55,100,.08)}
.hero-dot{width:14px;height:14px;border:none;border-radius:999px;background:#c7d6ee;transition:all .18s ease}
.hero-dot.active{width:40px;background:#2f5eb3}
.hero-title-line{display:block!important;white-space:normal!important;text-wrap:balance;max-width:100%}
.hero-title-line-flags{display:flex!important;align-items:center;gap:12px;flex-wrap:wrap}
.hero-flag-line{display:inline-flex;align-items:center;gap:8px;flex-shrink:0}
.wordbank-preview-cards .hero-mini-card span:last-child,.grammar-demo-card span{overflow-wrap:anywhere}
.hero-mini-flags{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 14px}
.mini-flag-pill{width:48px;height:36px;justify-content:center;padding:0;gap:0}
.mini-flag-pill span:not(.flag-badge){display:none!important}
.flag-badge{width:18px;height:18px;min-width:18px}
.hero-title-line-flags .flag-badge{width:18px;height:18px;min-width:18px}
.stat-community strong{font-size:clamp(2rem,2.4vw,2.55rem);line-height:1.05;white-space:nowrap}

.story-chip-playing,.video-brand{display:none!important}
.video-meta{padding-top:8px}
#diVideoTitle{font-size:2rem}
#diVideoDesc{max-width:42ch}
.video-lightbox .video-preview-copy strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

@media (max-width: 1100px){
  .hero-slide{min-height:unset}
  .hero-slide h2{font-size:clamp(2rem,5.5vw,3.4rem)}
  .hero-slide p{max-width:100%}
  .hero-slide .hero-actions{gap:16px;flex-wrap:wrap}
}
@media (max-width: 820px){
  .hero-slider-nav{top:16px;right:16px}
  .hero-slide h2{max-width:100%;padding-right:0}
  .hero-title-line-flags{display:block!important}
  .hero-flag-line{display:flex;margin:0 0 8px 0}
  .hero-slide .hero-actions{justify-content:flex-start}
}
.hero-slide{padding-right:190px}
.hero-slide-wordbank .hero-mini-posts,.hero-slide-grammar .hero-mini-posts{padding-right:0}
@media (max-width: 820px){.hero-slide{padding-right:0}}


/* final requested fixes */
.profile-icon-btn,.auth-open-icon-btn{background:#fff!important;border:1px solid #d6e2f4!important;box-shadow:0 10px 24px rgba(21,34,64,.08)!important}
.profile-icon-shape,.account-avatar-icon{background:#3c8cdf!important}
.profile-icon-shape::before,.profile-icon-shape::after,.account-avatar-icon::before,.account-avatar-icon::after{background:#3c8cdf!important}

.hero-slider{min-height:430px!important}
.hero-slide{min-height:430px!important;padding-right:10px}
.hero-slide h2{font-size:clamp(2.15rem,3.3vw,3.75rem)!important;line-height:1.06!important;max-width:92%!important;overflow-wrap:break-word!important;word-break:normal!important}
.hero-slide p{max-width:86%!important}
.hero-slide .hero-actions{padding-top:18px!important}
.hero-title-line{white-space:normal!important;text-wrap:balance!important}
.hero-slide-wordbank .hero-mini-posts,.hero-slide-grammar .hero-mini-posts{margin-top:20px!important}
.hero-mini-flags{gap:10px!important}
.mini-flag-pill{padding:8px 10px!important;min-width:auto!important}
.mini-flag-pill strong,.mini-flag-pill span+span{display:none!important}

@media (min-width: 1101px){
  .hero-slide-wordbank h2,.hero-slide-grammar h2,.hero-slide:not(.hero-slide-wordbank):not(.hero-slide-grammar) h2{max-width:12.8ch!important}
}
@media (max-width: 1100px){
  .hero-slider,.hero-slide{min-height:auto!important}
  .hero-slide h2{max-width:100%!important}
  .hero-slide p{max-width:100%!important}
}


/* Final compact home + profile adjustments */

.hero-grid{gap:14px!important;margin-bottom:14px!important;align-items:stretch}
.hero-slider{min-height:340px!important;padding:18px 18px 22px!important;border-radius:28px!important}
.hero-panel h2{font-size:28px!important;line-height:1.08!important;letter-spacing:-.035em!important;margin:8px 0 10px!important;max-width:12ch!important}
.hero-panel p{font-size:15px!important;line-height:1.55!important;max-width:62ch!important;margin:0 0 14px!important}
.hero-title-line{display:block;white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important}
.hero-slide-wordbank h2,.hero-slide-grammar h2{max-width:13ch!important}
.hero-actions{margin-top:10px!important;align-items:flex-end!important}
.hero-actions .primary-btn,.hero-actions .secondary-btn{padding:14px 18px!important;min-height:50px!important}
.hero-mini-posts{gap:10px!important;margin-top:14px!important}
.wordbank-preview-cards .hero-mini-card,.grammar-demo-card{min-height:138px!important;padding:12px 14px!important}
.hero-mini-word-top strong{font-size:18px!important}
.hero-slide-wordbank .hero-mini-card span:last-child,.hero-demo-post span{font-size:15px!important;line-height:1.4!important}
.hero-mini-play{width:34px!important;height:34px!important;border-radius:11px!important}
.hero-mini-flags{gap:6px!important}
.mini-flag-pill{width:34px!important;height:34px!important;min-width:34px!important;padding:0!important;display:grid!important;place-items:center!important}
.flag-badge{width:18px!important;height:18px!important}
.hero-slider-nav-dots-only{top:16px!important;right:16px!important;left:auto!important;bottom:auto!important;justify-content:flex-end!important;background:rgba(255,255,255,.82)!important;padding:8px 12px!important;border-radius:999px!important;box-shadow:0 8px 22px rgba(21,34,64,.08)!important}
.home-card-grid{gap:12px!important}
.home-nav-card{min-height:198px!important;padding:18px 20px!important}
.home-nav-card strong{font-size:24px!important;line-height:1.02!important}
.home-nav-card p{font-size:13px!important;line-height:1.35!important}
.profile-icon-btn{background:#fff!important;border:2px solid #3c8cdf!important;box-shadow:0 10px 24px rgba(21,34,64,.08)!important;width:58px!important;height:58px!important;border-radius:18px!important}
.profile-icon-shape{width:34px!important;height:34px!important;background:#3c8cdf!important;box-shadow:none!important}
.profile-icon-shape::before{width:14px!important;height:14px!important;top:1px!important;background:#3c8cdf!important}
.profile-icon-shape::after{width:24px!important;height:14px!important;bottom:0!important;background:#3c8cdf!important;border-radius:14px 14px 10px 10px!important}
.videos-hero{padding:16px 18px!important;gap:14px!important}
.videos-hero h2{font-size:22px!important;margin:4px 0 6px!important}
.videos-hero p{font-size:14px!important;line-height:1.5!important}
.video-grid-vip{gap:12px!important}
.video-card-vip{padding:10px!important}
.video-card-vip .thumb-vip{aspect-ratio:9/16!important}
@media (max-width:1100px){
  .hero-panel h2,.hero-slide-wordbank h2,.hero-slide-grammar h2{max-width:none!important;font-size:26px!important}
  .hero-slider{min-height:auto!important}
}


/* final compact fixes */
.topbar-actions-clean{display:none !important}
.hero-slider{padding:22px 24px 20px !important; min-height:0 !important}
.hero-slide{min-height:390px !important}
.hero-slide h2.hero-title-plain{
  max-width:690px !important;
  margin:0 0 12px 0 !important;
  font-size:clamp(2.1rem, 3.4vw, 3.6rem) !important;
  line-height:1.1 !important;
  letter-spacing:-.035em !important;
  text-wrap:balance !important;
  overflow-wrap:normal !important;
  word-break:normal !important;
}
.hero-title-wordbank{display:flex !important; align-items:flex-start; gap:12px; flex-wrap:wrap}
.hero-title-wordbank .hero-title-text{display:inline !important}
.hero-slide p{max-width:700px !important}
.hero-slide .hero-actions{padding-top:18px !important}
.hero-mini-posts{padding-top:16px !important}
.hero-slider-nav{top:18px !important; right:18px !important}
.hero-dot{width:14px !important; height:14px !important}
.hero-dot.active{width:48px !important}
.hero-mini-flags{gap:10px !important}
.mini-flag-pill{width:34px !important; height:34px !important; border-radius:999px !important}
.flag-badge{width:16px !important; height:16px !important; min-width:16px !important}
.hero-title-wordbank .hero-flag-line .flag-badge{width:18px !important; height:18px !important; min-width:18px !important}
.story-chip-playing{display:none !important}
.profile-icon-btn{display:none !important}
.auth-open-icon-btn{
  min-width:60px !important;
  width:60px !important;
  height:60px !important;
  border-radius:20px !important;
  padding:0 !important;
  font-size:0 !important;
  background:#ffffff !important;
  border:1px solid #d6e2f4 !important;
  box-shadow:0 12px 24px rgba(21,34,64,.10) !important;
}
.account-avatar-icon{
  width:36px !important;
  height:36px !important;
  border-radius:999px !important;
  background:#428fe8 !important;
  box-shadow:none !important;
  position:relative !important;
}
.account-avatar-icon::before{
  content:"" !important;
  position:absolute !important;
  left:50% !important;
  top:6px !important;
  transform:translateX(-50%) !important;
  width:14px !important;
  height:14px !important;
  border-radius:50% !important;
  background:#ffffff !important;
}
.account-avatar-icon::after{
  content:"" !important;
  position:absolute !important;
  left:50% !important;
  bottom:5px !important;
  transform:translateX(-50%) !important;
  width:22px !important;
  height:13px !important;
  border-radius:14px 14px 10px 10px !important;
  background:#ffffff !important;
}
@media (max-width:1100px){
  .hero-slide{min-height:360px !important}
  .hero-slide h2.hero-title-plain{max-width:100% !important; font-size:clamp(1.9rem, 6vw, 3rem) !important}
}


/* final requested fixes */
#authDock{margin-left:auto;display:flex;align-items:center;gap:12px}
.auth-open-icon-btn{width:56px!important;height:56px!important;border-radius:18px!important;background:linear-gradient(180deg,#4a95ec 0%,#2f6fd7 100%)!important;border:1px solid rgba(55,110,196,.22)!important;display:inline-flex!important;align-items:center;justify-content:center;box-shadow:0 12px 24px rgba(41,101,198,.22)!important;padding:0!important;min-width:56px!important}
.auth-open-icon-btn .account-avatar-icon{width:32px!important;height:32px!important;display:block!important;position:relative!important;background:transparent!important;box-shadow:none!important}
.auth-open-icon-btn .account-avatar-icon::before{content:''!important;position:absolute!important;left:50%!important;top:0!important;transform:translateX(-50%)!important;width:14px!important;height:14px!important;border-radius:50%!important;background:#fff!important}
.auth-open-icon-btn .account-avatar-icon::after{content:''!important;position:absolute!important;left:50%!important;bottom:1px!important;transform:translateX(-50%)!important;width:24px!important;height:14px!important;border-radius:14px 14px 10px 10px!important;background:#fff!important}
.auth-open-btn .auth-bell-badge{position:absolute;right:-4px;top:-5px}
.topbar .auth-open-btn{position:relative;overflow:visible}

.story-chip-playing{display:inline-flex!important;align-items:center;justify-content:center;min-height:50px;padding:0 20px!important;font-weight:900!important}
.story-chip-playing.is-live{background:linear-gradient(135deg,#dcf8e5,#f4fff7)!important;border-color:#8fd7a4!important;color:#198542!important;box-shadow:0 10px 24px rgba(25,133,66,.15)!important}
.video-brand{display:none!important}

.hero-slide h2.hero-title-plain{max-width:none!important;width:calc(100% - 170px)!important;font-size:clamp(2rem,3.7vw,4.2rem)!important;line-height:1.06!important;letter-spacing:-.04em!important;word-break:normal!important;overflow-wrap:normal!important;text-wrap:pretty!important;margin-bottom:18px!important}
.hero-title-wordbank{display:block!important}
.hero-title-wordbank .hero-flag-line{display:inline-flex!important;vertical-align:middle!important;margin-right:10px!important;gap:8px!important}
.hero-title-wordbank .hero-title-text{display:inline!important}
.hero-slide p{max-width:86%!important}
.hero-slider-nav-dots-only{top:18px!important;right:18px!important}

.hero-mini-flags{gap:10px!important}
.mini-flag-pill{background:transparent!important;border:none!important;box-shadow:none!important;padding:0!important;width:auto!important;height:auto!important;min-width:0!important;border-radius:0!important}
.mini-flag-pill .flag-badge{width:26px!important;height:26px!important;min-width:26px!important;box-shadow:none!important;border:0!important}

.hero-mini-play.audio-active,.hero-mini-play.is-speaking,.hero-mini-play[aria-pressed='true']{background:linear-gradient(135deg,#3abf72,#1d8f49)!important;border-color:#1d8f49!important;color:#fff!important;box-shadow:0 10px 22px rgba(29,143,73,.25)!important}

@media (max-width: 980px){
  .hero-slide h2.hero-title-plain{width:100%!important;max-width:100%!important;font-size:clamp(1.95rem,7vw,3.3rem)!important}
  .hero-slide p{max-width:100%!important}
}


/* slider order + hover pause + natural full-line wrap */
.hero-slide h2.hero-title-plain,
.hero-slide-wordbank h2,
.hero-slide-grammar h2{
  width:100% !important;
  max-width:100% !important;
  white-space:normal !important;
  text-wrap:wrap !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
}
.hero-slide p,
.hero-slide .hero-actions,
.hero-slide .hero-mini-posts{
  max-width:100% !important;
  width:100% !important;
}
.hero-title-wordbank{
  display:flex !important;
  align-items:flex-start !important;
  gap:10px !important;
  flex-wrap:wrap !important;
}
.hero-title-wordbank .hero-flag-line{
  display:inline-flex !important;
  vertical-align:top !important;
  margin:2px 0 0 0 !important;
}
.hero-title-wordbank .hero-title-text{
  display:inline !important;
  flex:1 1 320px !important;
  min-width:0 !important;
}
@media (min-width:981px){
  .hero-slide{min-height:390px !important}
}

/* ===== Dark mode contrast hotfix (readability) ===== */
body[data-theme="dark"] .stat-videos,
body[data-theme="dark"] .stat-lessons,
body[data-theme="dark"] .stat-community,
body[data-theme="dark"] .stat-translator,
body[data-theme="dark"] #grammarFocusNote,
body[data-theme="dark"] #grammarFocusNote .focus-pill,
body[data-theme="dark"] .overview-feature.blue,
body[data-theme="dark"] .overview-feature.pink,
body[data-theme="dark"] .overview-feature.green,
body[data-theme="dark"] .overview-feature.orange{
  color:#17263d !important;
}

body[data-theme="dark"] .stat-videos *,
body[data-theme="dark"] .stat-lessons *,
body[data-theme="dark"] .stat-community *,
body[data-theme="dark"] .stat-translator *,
body[data-theme="dark"] #grammarFocusNote *,
body[data-theme="dark"] .overview-feature.blue *,
body[data-theme="dark"] .overview-feature.pink *,
body[data-theme="dark"] .overview-feature.green *,
body[data-theme="dark"] .overview-feature.orange *{
  color:inherit !important;
}

body[data-theme="dark"] .stat-videos strong,
body[data-theme="dark"] .stat-lessons strong,
body[data-theme="dark"] .stat-community strong,
body[data-theme="dark"] .stat-translator strong,
body[data-theme="dark"] #grammarFocusNote .focus-pill strong,
body[data-theme="dark"] .overview-feature strong{
  color:#10233b !important;
}

body[data-theme="dark"] .stat-videos span,
body[data-theme="dark"] .stat-lessons span,
body[data-theme="dark"] .stat-community span,
body[data-theme="dark"] .stat-translator span,
body[data-theme="dark"] #grammarFocusNote .focus-pill small,
body[data-theme="dark"] .overview-feature span{
  color:#43566f !important;
}

body[data-theme="dark"] #grammarFocusNote{
  background:linear-gradient(180deg,#fbfeff 0%,#fffdfb 100%) !important;
  border-color:#e8edf6 !important;
  box-shadow:0 18px 32px rgba(0,0,0,.18), 0 0 0 1px rgba(255,255,255,.04) inset !important;
}

body[data-theme="dark"] #grammarFocusNote .focus-pill{
  background:transparent !important;
  border-right:1px solid #e8edf6 !important;
}
body[data-theme="dark"] #grammarFocusNote .focus-pill:last-child{border-right:none !important;}
body[data-theme="dark"] #grammarFocusNote .focus-emoji{
  background:#1e3a68 !important;
  color:#ffffff !important;
  border:1px solid rgba(30,58,104,.18) !important;
}

body[data-theme="dark"] .stat-chip{
  background:rgba(255,255,255,.55) !important;
  border:1px solid rgba(16,35,59,.08) !important;
}
body[data-theme="dark"] .stat-emoji{
  color:#132a47 !important;
  box-shadow:none !important;
}

body[data-theme="dark"] .lesson-nav-btn .mini,
body[data-theme="dark"] .examples-count,
body[data-theme="dark"] .count-badge{
  color:#eaf1ff !important;
}

body[data-theme="dark"] .lesson-nav-btn .examples-count,
body[data-theme="dark"] .grammar-card .examples-count,
body[data-theme="dark"] .grammar-card .count-badge{
  background:rgba(255,255,255,.16) !important;
  border:1px solid rgba(255,255,255,.14) !important;
}

/* ===== Dark mode targeted readability fix: hero mini boxes + grammar menu ===== */
body[data-theme="dark"] .hero-slide-wordbank .hero-mini-card,
body[data-theme="dark"] .hero-demo-post,
body[data-theme="dark"] .grammar-demo-card{
  background:linear-gradient(180deg,#f7fbff 0%,#eef4fb 100%) !important;
  border:1px solid #d9e5f5 !important;
  box-shadow:0 14px 30px rgba(0,0,0,.16) !important;
  color:#18283d !important;
}

body[data-theme="dark"] .hero-slide-wordbank .hero-mini-card *,
body[data-theme="dark"] .hero-demo-post *,
body[data-theme="dark"] .grammar-demo-card *{
  color:inherit;
}

body[data-theme="dark"] .hero-mini-word-top strong,
body[data-theme="dark"] .hero-demo-post strong,
body[data-theme="dark"] .grammar-demo-card strong{
  color:#10233b !important;
}

body[data-theme="dark"] .hero-slide-wordbank .hero-mini-card span:last-child,
body[data-theme="dark"] .hero-demo-post span,
body[data-theme="dark"] .grammar-demo-card span,
body[data-theme="dark"] .hero-mini-card span{
  color:#4a5d76 !important;
}

body[data-theme="dark"] .hero-mini-flags{
  filter:none !important;
}

body[data-theme="dark"] .hero-mini-play{
  background:linear-gradient(135deg,#5a8cff 0%,#3e72ff 100%) !important;
  color:#fff !important;
  box-shadow:0 12px 24px rgba(62,114,255,.28) !important;
}

body[data-theme="dark"] .grammar-nav-btn,
body[data-theme="dark"] .grammar-nav-btn.is-green,
body[data-theme="dark"] .grammar-nav-btn.is-blue,
body[data-theme="dark"] .grammar-nav-btn.is-purple,
body[data-theme="dark"] .grammar-nav-btn.is-orange,
body[data-theme="dark"] .grammar-nav-btn.is-red{
  background:linear-gradient(180deg,#f9fbff 0%,#eef4fb 100%) !important;
  border:1px solid #dbe6f5 !important;
  box-shadow:0 14px 28px rgba(0,0,0,.16) !important;
  color:#16283d !important;
}

body[data-theme="dark"] .grammar-nav-btn strong,
body[data-theme="dark"] .grammar-nav-btn .mini,
body[data-theme="dark"] .grammar-nav-btn .grammar-nav-count,
body[data-theme="dark"] .grammar-nav-btn .grammar-nav-icon{
  color:#16283d !important;
}

body[data-theme="dark"] .grammar-nav-btn .mini{
  color:#51657d !important;
}

body[data-theme="dark"] .grammar-nav-btn .grammar-nav-count{
  background:rgba(255,255,255,.92) !important;
  border:1px solid #d5e0f0 !important;
}

body[data-theme="dark"] .grammar-nav-btn .grammar-nav-icon{
  background:linear-gradient(180deg,#ffffff 0%,#f1f5fb 100%) !important;
  border:1px solid #d9e4f3 !important;
}

body[data-theme="dark"] .grammar-nav-btn.active{
  background:linear-gradient(135deg,#dfeaff 0%,#edf3ff 100%) !important;
  border-color:#8fb0ef !important;
  box-shadow:0 16px 32px rgba(76,130,255,.20) !important;
}

body[data-theme="dark"] .grammar-audio-now,
body[data-theme="dark"] .grammar-quick-check-card,
body[data-theme="dark"] .quick-tip-box,
body[data-theme="dark"] .grammar-section-card.accent-card,
body[data-theme="dark"] .grammar-check-option{
  background:linear-gradient(180deg,#f9fbff 0%,#eff4fb 100%) !important;
  border-color:#dbe4f2 !important;
  color:#18283d !important;
}

body[data-theme="dark"] .grammar-audio-now *,
body[data-theme="dark"] .grammar-quick-check-card *,
body[data-theme="dark"] .quick-tip-box *,
body[data-theme="dark"] .grammar-section-card.accent-card *,
body[data-theme="dark"] .grammar-check-option *{
  color:inherit;
}

body[data-theme="dark"] .grammar-audio-now strong,
body[data-theme="dark"] .grammar-quick-check-card h3,
body[data-theme="dark"] .grammar-quick-check-card h4,
body[data-theme="dark"] .grammar-section-card.accent-card h3,
body[data-theme="dark"] .quick-tip-box h3{
  color:#10233b !important;
}

body[data-theme="dark"] #grammarAudioNowText,
body[data-theme="dark"] .grammar-quick-check-card p,
body[data-theme="dark"] .grammar-check-progress,
body[data-theme="dark"] .grammar-check-feedback,
body[data-theme="dark"] .grammar-section-card.accent-card p,
body[data-theme="dark"] .quick-tip-box p{
  color:#4c6077 !important;
}

body[data-theme="dark"] .grammar-check-option{
  font-weight:800;
  color:#22344f !important;
}

body[data-theme="dark"] .grammar-check-option.correct{
  background:#ecfbf2 !important;
  border-color:#8fd7ab !important;
  color:#17753c !important;
}

body[data-theme="dark"] .grammar-check-option.wrong{
  background:#fff1f1 !important;
  border-color:#f0a4a4 !important;
  color:#a33d3d !important;
}

/* ===== v3 dark mode polish: lessons + grammar menus + pressed states ===== */
body[data-theme="dark"] .lesson-nav-btn,
body[data-theme="dark"] .grammar-nav-btn,
body[data-theme="dark"] .grammar-nav-btn.is-green,
body[data-theme="dark"] .grammar-nav-btn.is-blue,
body[data-theme="dark"] .grammar-nav-btn.is-purple,
body[data-theme="dark"] .grammar-nav-btn.is-orange,
body[data-theme="dark"] .grammar-nav-btn.is-red{
  background:linear-gradient(180deg,#162744 0%,#0f1d35 100%) !important;
  border:1px solid rgba(109,146,214,.28) !important;
  box-shadow:0 14px 28px rgba(0,0,0,.18) !important;
  color:#eef4ff !important;
}

body[data-theme="dark"] .lesson-nav-btn strong,
body[data-theme="dark"] .grammar-nav-btn strong,
body[data-theme="dark"] .lesson-nav-btn .grammar-nav-icon,
body[data-theme="dark"] .grammar-nav-btn .grammar-nav-icon,
body[data-theme="dark"] .lesson-nav-btn .examples-count,
body[data-theme="dark"] .grammar-nav-btn .grammar-nav-count{
  color:#f4f8ff !important;
}

body[data-theme="dark"] .lesson-nav-btn .mini,
body[data-theme="dark"] .grammar-nav-btn .mini{
  color:#b9c8df !important;
}

body[data-theme="dark"] .grammar-nav-btn .grammar-nav-icon,
body[data-theme="dark"] .lesson-nav-btn .emoji,
body[data-theme="dark"] .lesson-name .emoji,
body[data-theme="dark"] .grammar-nav-btn .grammar-nav-count,
body[data-theme="dark"] .examples-count,
body[data-theme="dark"] .count-badge{
  background:rgba(255,255,255,.10) !important;
  border:1px solid rgba(255,255,255,.12) !important;
  box-shadow:none !important;
}

body[data-theme="dark"] .lesson-nav-btn:hover,
body[data-theme="dark"] .lesson-nav-btn.active,
body[data-theme="dark"] .grammar-nav-btn:hover,
body[data-theme="dark"] .grammar-nav-btn.active{
  background:linear-gradient(180deg,#223a63 0%,#173153 100%) !important;
  border-color:rgba(132,174,255,.52) !important;
  box-shadow:0 18px 34px rgba(56,110,220,.22) !important;
  transform:translateY(-1px);
}

body[data-theme="dark"] .lesson-nav-btn.active strong,
body[data-theme="dark"] .grammar-nav-btn.active strong{
  color:#ffffff !important;
}

body[data-theme="dark"] .lesson-nav-btn.active .mini,
body[data-theme="dark"] .grammar-nav-btn.active .mini{
  color:#d7e4f8 !important;
}

body[data-theme="dark"] .grammar-tab,
body[data-theme="dark"] .tab-btn,
body[data-theme="dark"] .secondary-btn,
body[data-theme="dark"] .story-control,
body[data-theme="dark"] .jump-select,
body[data-theme="dark"] .practice-mode-btn,
body[data-theme="dark"] .exercise-part-btn{
  color:#eef4ff !important;
}

body[data-theme="dark"] .play-btn:active,
body[data-theme="dark"] .primary-btn:active,
body[data-theme="dark"] .secondary-btn:active,
body[data-theme="dark"] .phrase-play:active,
body[data-theme="dark"] .mini-sound-btn:active,
body[data-theme="dark"] .story-control:active,
body[data-theme="dark"] .story-mini-btn:active,
body[data-theme="dark"] .tab-btn:active,
body[data-theme="dark"] .grammar-tab:active,
body[data-theme="dark"] .lesson-nav-btn:active,
body[data-theme="dark"] .grammar-nav-btn:active,
body[data-theme="dark"] .theme-toggle:active,
body[data-theme="dark"] .icon-btn:active,
body[data-theme="dark"] button:active{
  transform:translateY(1px) scale(.985) !important;
  filter:brightness(1.08) saturate(1.08) !important;
}

body[data-theme="dark"] .play-btn:focus-visible,
body[data-theme="dark"] .primary-btn:focus-visible,
body[data-theme="dark"] .secondary-btn:focus-visible,
body[data-theme="dark"] .phrase-play:focus-visible,
body[data-theme="dark"] .mini-sound-btn:focus-visible,
body[data-theme="dark"] .story-control:focus-visible,
body[data-theme="dark"] .story-mini-btn:focus-visible,
body[data-theme="dark"] .tab-btn:focus-visible,
body[data-theme="dark"] .grammar-tab:focus-visible,
body[data-theme="dark"] .lesson-nav-btn:focus-visible,
body[data-theme="dark"] .grammar-nav-btn:focus-visible,
body[data-theme="dark"] .theme-toggle:focus-visible,
body[data-theme="dark"] .icon-btn:focus-visible,
body[data-theme="dark"] button:focus-visible{
  outline:2px solid rgba(132,174,255,.72) !important;
  outline-offset:2px !important;
}

body[data-theme="dark"] .theme-toggle[aria-pressed="true"]{
  background:linear-gradient(135deg,#284a7f 0%,#1a3156 100%) !important;
  border-color:rgba(132,174,255,.46) !important;
  box-shadow:0 14px 28px rgba(56,110,220,.20) !important;
}

/* ===== v4 dark mode play green + lesson/example readability + global button states ===== */
body[data-theme="dark"] .play-btn,
body[data-theme="dark"] .phrase-play,
body[data-theme="dark"] .compact-play-btn,
body[data-theme="dark"] .mini-sound-btn,
body[data-theme="dark"] #pronunciationPlayBtn,
body[data-theme="dark"] #playItalianBtn,
body[data-theme="dark"] .story-mini-btn.play-btn,
body[data-theme="dark"] [data-play]{
  transition:transform .16s ease, box-shadow .16s ease, filter .16s ease, background .18s ease, border-color .18s ease, color .18s ease !important;
}

body[data-theme="dark"] .play-btn.audio-active,
body[data-theme="dark"] .play-btn.is-speaking,
body[data-theme="dark"] .play-btn[aria-pressed="true"],
body[data-theme="dark"] .phrase-play.audio-active,
body[data-theme="dark"] .phrase-play.is-speaking,
body[data-theme="dark"] .phrase-play[aria-pressed="true"],
body[data-theme="dark"] .compact-play-btn.audio-active,
body[data-theme="dark"] .compact-play-btn.is-speaking,
body[data-theme="dark"] .compact-play-btn[aria-pressed="true"],
body[data-theme="dark"] .mini-sound-btn.audio-active,
body[data-theme="dark"] .mini-sound-btn.is-speaking,
body[data-theme="dark"] .mini-sound-btn[aria-pressed="true"],
body[data-theme="dark"] #pronunciationPlayBtn.audio-active,
body[data-theme="dark"] #pronunciationPlayBtn.is-speaking,
body[data-theme="dark"] #pronunciationPlayBtn[aria-pressed="true"],
body[data-theme="dark"] #playItalianBtn.audio-active,
body[data-theme="dark"] #playItalianBtn.is-speaking,
body[data-theme="dark"] #playItalianBtn[aria-pressed="true"],
body[data-theme="dark"] .story-mini-btn.play-btn.audio-active,
body[data-theme="dark"] .story-mini-btn.play-btn.is-speaking,
body[data-theme="dark"] .story-mini-btn.play-btn[aria-pressed="true"],
body[data-theme="dark"] [data-play].audio-active,
body[data-theme="dark"] [data-play].is-speaking,
body[data-theme="dark"] [data-play][aria-pressed="true"]{
  background:linear-gradient(135deg,#22c55e 0%,#16a34a 100%) !important;
  color:#ffffff !important;
  border-color:#15803d !important;
  box-shadow:0 0 0 1px rgba(134,239,172,.16), 0 14px 30px rgba(22,163,74,.30), 0 0 0 6px rgba(34,197,94,.10) !important;
  filter:none !important;
}

body[data-theme="dark"] .play-btn.audio-active:hover,
body[data-theme="dark"] .play-btn.is-speaking:hover,
body[data-theme="dark"] .phrase-play.audio-active:hover,
body[data-theme="dark"] .phrase-play.is-speaking:hover,
body[data-theme="dark"] .compact-play-btn.audio-active:hover,
body[data-theme="dark"] .compact-play-btn.is-speaking:hover,
body[data-theme="dark"] .mini-sound-btn.audio-active:hover,
body[data-theme="dark"] .mini-sound-btn.is-speaking:hover,
body[data-theme="dark"] #pronunciationPlayBtn.audio-active:hover,
body[data-theme="dark"] #playItalianBtn.audio-active:hover{
  background:linear-gradient(135deg,#24d061 0%,#16a34a 100%) !important;
}

body[data-theme="dark"] .primary-btn.is-pressed,
body[data-theme="dark"] .secondary-btn.is-pressed,
body[data-theme="dark"] .play-btn.is-pressed,
body[data-theme="dark"] .phrase-play.is-pressed,
body[data-theme="dark"] .compact-play-btn.is-pressed,
body[data-theme="dark"] .mini-sound-btn.is-pressed,
body[data-theme="dark"] .story-control.is-pressed,
body[data-theme="dark"] .tab-btn.is-pressed,
body[data-theme="dark"] .grammar-tab.is-pressed,
body[data-theme="dark"] .lesson-nav-btn.is-pressed,
body[data-theme="dark"] .grammar-nav-btn.is-pressed,
body[data-theme="dark"] .theme-toggle.is-pressed,
body[data-theme="dark"] .icon-btn.is-pressed{
  transform:translateY(1px) scale(.98) !important;
  filter:brightness(1.06) saturate(1.06) !important;
}

body[data-theme="dark"] .lesson-item .ex-box,
body[data-theme="dark"] .lesson-item .ex-box *,
body[data-theme="dark"] .example-card .ex-box,
body[data-theme="dark"] .example-card .ex-box *,
body[data-theme="dark"] .story-it,
body[data-theme="dark"] .story-it *,
body[data-theme="dark"] .story-en,
body[data-theme="dark"] .story-en *,
body[data-theme="dark"] .word-pair,
body[data-theme="dark"] .word-pair *,
body[data-theme="dark"] .translation-box,
body[data-theme="dark"] .translation-box *{
  color:#f5f9ff !important;
}

body[data-theme="dark"] .lesson-item .ex-box.it,
body[data-theme="dark"] .story-it,
body[data-theme="dark"] .word-pair.it{
  background:linear-gradient(135deg,#13432b 0%,#0f3421 100%) !important;
  border:1px solid rgba(84,196,132,.24) !important;
}

body[data-theme="dark"] .lesson-item .ex-box.en,
body[data-theme="dark"] .story-en,
body[data-theme="dark"] .word-pair.en{
  background:linear-gradient(135deg,#173760 0%,#102845 100%) !important;
  border:1px solid rgba(132,174,255,.24) !important;
}

body[data-theme="dark"] .lesson-item .lesson-name p,
body[data-theme="dark"] .lesson-item .mini,
body[data-theme="dark"] .lesson-item .lesson-example .label,
body[data-theme="dark"] .lesson-item .word-example,
body[data-theme="dark"] .lesson-example,
body[data-theme="dark"] .example-card p,
body[data-theme="dark"] .detail-summary,
body[data-theme="dark"] .detail-text{
  color:#d7e4f8 !important;
}

body[data-theme="dark"] .lesson-nav-btn,
body[data-theme="dark"] .grammar-nav-btn{
  background:linear-gradient(180deg,#152844 0%,#0f1e35 100%) !important;
  border-color:rgba(132,174,255,.22) !important;
  box-shadow:0 14px 28px rgba(0,0,0,.18) !important;
}

body[data-theme="dark"] .lesson-nav-btn strong,
body[data-theme="dark"] .lesson-nav-btn h4,
body[data-theme="dark"] .grammar-nav-btn strong,
body[data-theme="dark"] .grammar-nav-btn h4,
body[data-theme="dark"] .lesson-name h4,
body[data-theme="dark"] .lesson-banner h2,
body[data-theme="dark"] .lesson-item h3,
body[data-theme="dark"] .lesson-item h4,
body[data-theme="dark"] .example-card h4{
  color:#f5f9ff !important;
}

body[data-theme="dark"] .lesson-nav-btn .mini,
body[data-theme="dark"] .grammar-nav-btn .mini,
body[data-theme="dark"] .lesson-nav-btn p,
body[data-theme="dark"] .grammar-nav-btn p{
  color:#d4e0f3 !important;
}

body[data-theme="dark"] .lesson-nav-btn:hover,
body[data-theme="dark"] .grammar-nav-btn:hover,
body[data-theme="dark"] .lesson-nav-btn.active,
body[data-theme="dark"] .grammar-nav-btn.active{
  background:linear-gradient(180deg,#20385d 0%,#162d4e 100%) !important;
  border-color:rgba(132,174,255,.50) !important;
}

body[data-theme="dark"] .tab-btn,
body[data-theme="dark"] .grammar-tab,
body[data-theme="dark"] .lesson-chip,
body[data-theme="dark"] .page-indicator,
body[data-theme="dark"] .jump-select{
  color:#eef4ff !important;
}

body[data-theme="dark"] .tab-btn.active,
body[data-theme="dark"] .grammar-tab.active,
body[data-theme="dark"] .lesson-chip.active,
body[data-theme="dark"] .page-indicator.active{
  background:linear-gradient(135deg,#294b7f 0%,#1b3258 100%) !important;
  border-color:rgba(132,174,255,.42) !important;
  color:#ffffff !important;
}

body[data-theme="dark"] .play-btn,
body[data-theme="dark"] .phrase-play,
body[data-theme="dark"] .compact-play-btn,
body[data-theme="dark"] #pronunciationPlayBtn,
body[data-theme="dark"] #playItalianBtn{
  font-weight:900 !important;
  letter-spacing:.01em;
}

body[data-theme="dark"] .lesson-item,
body[data-theme="dark"] .example-card,
body[data-theme="dark"] .grammar-card,
body[data-theme="dark"] .word-card,
body[data-theme="dark"] .phrase-card,
body[data-theme="dark"] .story-segment{
  backdrop-filter:blur(8px);
}

body[data-theme="dark"] .lesson-item-top,
body[data-theme="dark"] .grammar-card-head,
body[data-theme="dark"] .word-top{
  border-color:rgba(132,174,255,.16) !important;
}

/* ===== v5 dark mode global readability + play red active ===== */
body[data-theme="dark"] .play-btn,
body[data-theme="dark"] .phrase-play,
body[data-theme="dark"] .compact-play-btn,
body[data-theme="dark"] .mini-sound-btn,
body[data-theme="dark"] #pronunciationPlayBtn,
body[data-theme="dark"] #playItalianBtn,
body[data-theme="dark"] .story-mini-btn.play-btn,
body[data-theme="dark"] .hero-mini-play,
body[data-theme="dark"] [data-play],
body[data-theme="dark"] [data-word-audio]{
  color:#ffffff !important;
}

body[data-theme="dark"] .play-btn.audio-active,
body[data-theme="dark"] .play-btn.is-speaking,
body[data-theme="dark"] .play-btn[aria-pressed="true"],
body[data-theme="dark"] .phrase-play.audio-active,
body[data-theme="dark"] .phrase-play.is-speaking,
body[data-theme="dark"] .phrase-play[aria-pressed="true"],
body[data-theme="dark"] .compact-play-btn.audio-active,
body[data-theme="dark"] .compact-play-btn.is-speaking,
body[data-theme="dark"] .compact-play-btn[aria-pressed="true"],
body[data-theme="dark"] .mini-sound-btn.audio-active,
body[data-theme="dark"] .mini-sound-btn.is-speaking,
body[data-theme="dark"] .mini-sound-btn[aria-pressed="true"],
body[data-theme="dark"] #pronunciationPlayBtn.audio-active,
body[data-theme="dark"] #pronunciationPlayBtn.is-speaking,
body[data-theme="dark"] #pronunciationPlayBtn[aria-pressed="true"],
body[data-theme="dark"] #playItalianBtn.audio-active,
body[data-theme="dark"] #playItalianBtn.is-speaking,
body[data-theme="dark"] #playItalianBtn[aria-pressed="true"],
body[data-theme="dark"] .story-mini-btn.play-btn.audio-active,
body[data-theme="dark"] .story-mini-btn.play-btn.is-speaking,
body[data-theme="dark"] .story-mini-btn.play-btn[aria-pressed="true"],
body[data-theme="dark"] .hero-mini-play.audio-active,
body[data-theme="dark"] .hero-mini-play.is-speaking,
body[data-theme="dark"] .hero-mini-play[aria-pressed="true"],
body[data-theme="dark"] [data-play].audio-active,
body[data-theme="dark"] [data-play].is-speaking,
body[data-theme="dark"] [data-play][aria-pressed="true"],
body[data-theme="dark"] [data-word-audio].audio-active,
body[data-theme="dark"] [data-word-audio].is-speaking,
body[data-theme="dark"] [data-word-audio][aria-pressed="true"]{
  background:linear-gradient(135deg,#ef4444 0%,#dc2626 55%,#b91c1c 100%) !important;
  border-color:#991b1b !important;
  color:#fff !important;
  box-shadow:0 0 0 1px rgba(254,202,202,.12), 0 14px 30px rgba(220,38,38,.30), 0 0 0 6px rgba(239,68,68,.10) !important;
}

body[data-theme="dark"] .play-btn.audio-active:hover,
body[data-theme="dark"] .play-btn.is-speaking:hover,
body[data-theme="dark"] .phrase-play.audio-active:hover,
body[data-theme="dark"] .phrase-play.is-speaking:hover,
body[data-theme="dark"] .compact-play-btn.audio-active:hover,
body[data-theme="dark"] .compact-play-btn.is-speaking:hover,
body[data-theme="dark"] .mini-sound-btn.audio-active:hover,
body[data-theme="dark"] .mini-sound-btn.is-speaking:hover,
body[data-theme="dark"] #pronunciationPlayBtn.audio-active:hover,
body[data-theme="dark"] #playItalianBtn.audio-active:hover,
body[data-theme="dark"] .hero-mini-play.audio-active:hover,
body[data-theme="dark"] .hero-mini-play.is-speaking:hover{
  background:linear-gradient(135deg,#f15b5b 0%,#dc2626 60%,#b91c1c 100%) !important;
}

body[data-theme="dark"] .menu-item *,
body[data-theme="dark"] .lesson-nav-btn *,
body[data-theme="dark"] .grammar-nav-btn *,
body[data-theme="dark"] .tab-btn *,
body[data-theme="dark"] .grammar-tab *,
body[data-theme="dark"] .page-indicator *,
body[data-theme="dark"] .lesson-chip *,
body[data-theme="dark"] .story-control *,
body[data-theme="dark"] .secondary-btn *,
body[data-theme="dark"] .example-card *,
body[data-theme="dark"] .lesson-item *,
body[data-theme="dark"] .grammar-card *,
body[data-theme="dark"] .word-card *,
body[data-theme="dark"] .phrase-card *{
  color:inherit;
}

body[data-theme="dark"] .menu-item,
body[data-theme="dark"] .lesson-nav-btn,
body[data-theme="dark"] .grammar-nav-btn,
body[data-theme="dark"] .tab-btn,
body[data-theme="dark"] .grammar-tab,
body[data-theme="dark"] .page-indicator,
body[data-theme="dark"] .lesson-chip,
body[data-theme="dark"] .jump-select,
body[data-theme="dark"] .story-control,
body[data-theme="dark"] .secondary-btn,
body[data-theme="dark"] .example-card,
body[data-theme="dark"] .lesson-item,
body[data-theme="dark"] .grammar-card,
body[data-theme="dark"] .word-card,
body[data-theme="dark"] .phrase-card,
body[data-theme="dark"] .story-segment,
body[data-theme="dark"] .story-card{
  color:#eef4ff !important;
}

body[data-theme="dark"] .menu-copy strong,
body[data-theme="dark"] .lesson-nav-btn strong,
body[data-theme="dark"] .grammar-nav-btn strong,
body[data-theme="dark"] .tab-btn,
body[data-theme="dark"] .grammar-tab,
body[data-theme="dark"] .page-indicator,
body[data-theme="dark"] .lesson-chip,
body[data-theme="dark"] .example-card h4,
body[data-theme="dark"] .lesson-item h3,
body[data-theme="dark"] .lesson-item h4,
body[data-theme="dark"] .grammar-card h3,
body[data-theme="dark"] .word-meta h3,
body[data-theme="dark"] .phrase-card h3,
body[data-theme="dark"] .story-card h3,
body[data-theme="dark"] .story-segment h4{
  color:#f8fbff !important;
}

body[data-theme="dark"] .menu-copy small,
body[data-theme="dark"] .lesson-nav-btn .mini,
body[data-theme="dark"] .grammar-nav-btn .mini,
body[data-theme="dark"] .example-card p,
body[data-theme="dark"] .lesson-item p,
body[data-theme="dark"] .grammar-card p,
body[data-theme="dark"] .word-card p,
body[data-theme="dark"] .phrase-card p,
body[data-theme="dark"] .story-card p,
body[data-theme="dark"] .story-segment p,
body[data-theme="dark"] .detail-summary,
body[data-theme="dark"] .detail-text,
body[data-theme="dark"] .word-example,
body[data-theme="dark"] .phrase-translation{
  color:#dbe6f7 !important;
}

body[data-theme="dark"] .word-pair.it,
body[data-theme="dark"] .lesson-item .ex-box.it,
body[data-theme="dark"] .story-it{
  background:linear-gradient(135deg,#163f2b 0%,#102f21 100%) !important;
  color:#f7fffb !important;
}

body[data-theme="dark"] .word-pair.en,
body[data-theme="dark"] .lesson-item .ex-box.en,
body[data-theme="dark"] .story-en{
  background:linear-gradient(135deg,#183a64 0%,#102846 100%) !important;
  color:#f7fbff !important;
}

body[data-theme="dark"] .word-pair.it *,
body[data-theme="dark"] .word-pair.en *,
body[data-theme="dark"] .lesson-item .ex-box *,
body[data-theme="dark"] .story-it *,
body[data-theme="dark"] .story-en *{
  color:inherit !important;
}

/* ===== v6 targeted dark mode fixes: phrases + translator + audio ===== */
body[data-theme="dark"] .primary-btn.audio-active,
body[data-theme="dark"] .secondary-btn.audio-active,
body[data-theme="dark"] .play-btn.audio-active,
body[data-theme="dark"] .phrase-play.audio-active,
body[data-theme="dark"] .mini-sound-btn.audio-active,
body[data-theme="dark"] .story-control.audio-active,
body[data-theme="dark"] .story-mini-btn.audio-active,
body[data-theme="dark"] .hero-mini-play.audio-active,
body[data-theme="dark"] .compact-play-btn.audio-active{
  background:linear-gradient(135deg,#ff5b5b 0%,#e11d48 100%) !important;
  color:#fff !important;
  border-color:rgba(255,104,104,.38) !important;
  box-shadow:0 0 0 4px rgba(255,91,91,.14),0 18px 34px rgba(225,29,72,.26) !important;
}

body[data-theme="dark"] .primary-btn.audio-active::after,
body[data-theme="dark"] .secondary-btn.audio-active::after,
body[data-theme="dark"] .play-btn.audio-active::after,
body[data-theme="dark"] .phrase-play.audio-active::after,
body[data-theme="dark"] .mini-sound-btn.audio-active::after,
body[data-theme="dark"] .story-control.audio-active::after,
body[data-theme="dark"] .story-mini-btn.audio-active::after,
body[data-theme="dark"] .hero-mini-play.audio-active::after,
body[data-theme="dark"] .compact-play-btn.audio-active::after{
  border-color:rgba(255,91,91,.28) !important;
}

body[data-theme="dark"] .phrase-card,
body[data-theme="dark"] .phrase-card-upgraded,
body[data-theme="dark"] .phrase-page-shell,
body[data-theme="dark"] .phrase-nav-shell{
  background:
    radial-gradient(circle at top right, rgba(66,118,255,.10), transparent 30%),
    linear-gradient(180deg, rgba(15,27,49,.98) 0%, rgba(8,17,31,.98) 100%) !important;
  border-color:rgba(136,176,255,.22) !important;
}

body[data-theme="dark"] .phrase-card h3,
body[data-theme="dark"] .phrase-card .phrase-label,
body[data-theme="dark"] .phrase-card .phrase-translation,
body[data-theme="dark"] .phrase-card .phrase-tip,
body[data-theme="dark"] .phrase-card .phrase-tip strong,
body[data-theme="dark"] .phrase-card .phrase-flag-pill,
body[data-theme="dark"] .phrase-card .phrase-flag-pill strong,
body[data-theme="dark"] .phrase-card .phrase-icon,
body[data-theme="dark"] .phrase-card .phrase-texts,
body[data-theme="dark"] .phrase-card .phrase-texts *{
  color:#eef4ff !important;
}

body[data-theme="dark"] .phrase-card .phrase-label{
  color:#9eb7dd !important;
}

body[data-theme="dark"] .phrase-card .phrase-translation,
body[data-theme="dark"] .phrase-card .phrase-tip{
  color:#d6e2f4 !important;
}

body[data-theme="dark"] .phrase-card .phrase-flag-pill{
  background:linear-gradient(180deg,#182946 0%,#112039 100%) !important;
  border-color:rgba(138,175,255,.24) !important;
  box-shadow:none !important;
}

body[data-theme="dark"] .phrase-card .phrase-tip{
  background:linear-gradient(180deg,#13243d 0%,#0e1d33 100%) !important;
  border:1px dashed rgba(138,175,255,.28) !important;
}

body[data-theme="dark"] #screen-translator .panel,
body[data-theme="dark"] .translator-panel,
body[data-theme="dark"] .translator-result,
body[data-theme="dark"] .translator-detect,
body[data-theme="dark"] .translator-examples,
body[data-theme="dark"] .translator-box,
body[data-theme="dark"] .translator-lang-card,
body[data-theme="dark"] .translator-word-card,
body[data-theme="dark"] .translator-example-card,
body[data-theme="dark"] .translator-visual-card,
body[data-theme="dark"] .translator-visual-placeholder,
body[data-theme="dark"] .translator-visual-loading{
  background:
    radial-gradient(circle at top right, rgba(66,118,255,.10), transparent 30%),
    linear-gradient(180deg, rgba(15,27,49,.98) 0%, rgba(8,17,31,.98) 100%) !important;
  color:#eef4ff !important;
  border-color:rgba(136,176,255,.22) !important;
}

body[data-theme="dark"] #translatorInput,
body[data-theme="dark"] .translator-box input,
body[data-theme="dark"] .translator-box textarea{
  background:linear-gradient(180deg,#15243d 0%,#0f1b31 100%) !important;
  color:#f4f8ff !important;
  border-color:rgba(138,175,255,.24) !important;
}

body[data-theme="dark"] .translator-output,
body[data-theme="dark"] .translator-output h3,
body[data-theme="dark"] .translator-output p,
body[data-theme="dark"] .translator-note,
body[data-theme="dark"] .translator-detect p,
body[data-theme="dark"] .translator-lang-card strong,
body[data-theme="dark"] .translator-lang-card span,
body[data-theme="dark"] .translator-word-card strong,
body[data-theme="dark"] .translator-word-card span,
body[data-theme="dark"] .translator-example-card strong,
body[data-theme="dark"] .translator-example-card span,
body[data-theme="dark"] .translator-main-word,
body[data-theme="dark"] .italian-main-word,
body[data-theme="dark"] .green-text{
  color:#eef4ff !important;
}

body[data-theme="dark"] .translator-note,
body[data-theme="dark"] .translator-output p,
body[data-theme="dark"] .translator-detect p,
body[data-theme="dark"] .translator-lang-card span,
body[data-theme="dark"] .translator-word-card span,
body[data-theme="dark"] .translator-example-card span{
  color:#d3e0f3 !important;
}

body[data-theme="dark"] .translator-badge,
body[data-theme="dark"] .detect-badge,
body[data-theme="dark"] .translator-subtitle{
  background:linear-gradient(135deg,#183153 0%,#11233c 100%) !important;
  color:#dce8ff !important;
  border:1px solid rgba(138,175,255,.24) !important;
}

body[data-theme="dark"] .translator-object-chip,
body[data-theme="dark"] .suggestion-chip,
body[data-theme="dark"] .jump-chip{
  background:linear-gradient(180deg,#162742 0%,#10203a 100%) !important;
  color:#edf4ff !important;
  border-color:rgba(138,175,255,.24) !important;
}

/* ===== v7 translator dark mode cleanup ===== */
body[data-theme="dark"] #screen-translator .translation-topline .lang-chip,
body[data-theme="dark"] #screen-translator .translation-topline .live-chip,
body[data-theme="dark"] #screen-translator .translation-topline .live-chip-it{
  background:linear-gradient(135deg,#173d2a 0%,#102c1f 100%) !important;
  border-color:rgba(110,214,152,.24) !important;
  color:#effff5 !important;
  box-shadow:0 10px 22px rgba(0,0,0,.16) !important;
}

body[data-theme="dark"] #screen-translator .translation-topline .lang-chip strong,
body[data-theme="dark"] #screen-translator .translation-topline .live-chip strong,
body[data-theme="dark"] #screen-translator .translation-topline .live-chip-it strong{
  color:#f4fff8 !important;
}

body[data-theme="dark"] #screen-translator .meaning-pill,
body[data-theme="dark"] #screen-translator .meaning-pill-yellow,
body[data-theme="dark"] #screen-translator .meaning-pill-wide{
  background:linear-gradient(135deg,#f2e2a6 0%,#e9d082 100%) !important;
  border:1px solid rgba(242,219,132,.46) !important;
  color:#34280a !important;
  box-shadow:0 12px 24px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.28) !important;
}

body[data-theme="dark"] #screen-translator .meaning-pill *,
body[data-theme="dark"] #screen-translator .meaning-pill-yellow *,
body[data-theme="dark"] #screen-translator .meaning-pill-wide *{
  color:#34280a !important;
}

body[data-theme="dark"] #screen-translator .translator-visual-card.featured.solo-card{
  background:linear-gradient(180deg,#13233d 0%,#0d182b 100%) !important;
  border-color:rgba(136,176,255,.24) !important;
}

body[data-theme="dark"] #screen-translator .solo-media{
  background:linear-gradient(180deg,#eef3fb 0%,#dfe8f5 100%) !important;
  border:1px solid rgba(198,211,231,.95) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.58) !important;
}

body[data-theme="dark"] #screen-translator .solo-media img{
  background:#f8fbff !important;
}

body[data-theme="dark"] #screen-translator .single-line-label{
  align-items:center !important;
}

body[data-theme="dark"] #screen-translator .single-line-label strong,
body[data-theme="dark"] #screen-translator .translator-visual-label strong{
  color:#f4f8ff !important;
}

body[data-theme="dark"] #screen-translator .visual-query-chip{
  background:linear-gradient(180deg,#e9f0fb 0%,#dce8f7 100%) !important;
  border-color:#c5d5ea !important;
  color:#284466 !important;
}

body[data-theme="dark"] #screen-translator .translator-visual-placeholder.compact,
body[data-theme="dark"] #screen-translator .translator-visual-loading{
  color:#eaf1ff !important;
}

body[data-theme="dark"] #screen-translator .translator-visual-placeholder.compact strong,
body[data-theme="dark"] #screen-translator .translator-visual-loading span{
  color:#f4f8ff !important;
}

body[data-theme="dark"] #screen-translator .translator-visual-placeholder.compact span{
  color:#d5e1f4 !important;
}

body[data-theme="dark"] #screen-translator .flag-badge,
body[data-theme="dark"] #screen-translator .translator-flag{
  box-shadow:0 0 0 1px rgba(255,255,255,.08), 0 8px 16px rgba(0,0,0,.14) !important;
}

/* === Mobile rebuild v2 === */
.sidebar-topline{display:flex;align-items:center;justify-content:space-between;gap:12px}
.sidebar-close{display:none;border:none;background:#eef3fb;color:#27405f;width:42px;height:42px;border-radius:14px;font-size:18px;font-weight:800;cursor:pointer}
.mobile-backdrop,.mobile-dock{display:none}

@media (max-width:900px){
  html,body{overflow-x:hidden}
  body.menu-open{overflow:hidden}
  .app-shell{display:block !important;max-width:none !important;gap:0 !important}
  .content{padding:12px 12px calc(94px + env(safe-area-inset-bottom)) !important}
  .topbar,
  .topbar-v2,
  .section-focused .topbar-v2{
    position:sticky !important;
    top:0 !important;
    z-index:24 !important;
    margin:0 0 14px !important;
    padding:12px 14px !important;
    min-height:auto !important;
    border-radius:0 0 22px 22px !important;
    background:rgba(255,255,255,.92) !important;
    backdrop-filter:blur(16px) !important;
    box-shadow:0 10px 26px rgba(17,29,52,.08) !important;
  }
  #menuToggle{display:grid !important;place-items:center}
  .topbar-back-btn{display:none !important}
  .main-label{font-size:16px !important;line-height:1.35 !important}
  .small-label{font-size:11px !important;letter-spacing:.08em;text-transform:uppercase}

  .mobile-backdrop{
    display:block;
    position:fixed;
    inset:0;
    background:rgba(12,18,31,.45);
    backdrop-filter:blur(3px);
    opacity:0;
    pointer-events:none;
    transition:opacity .25s ease;
    z-index:32;
  }
  .mobile-backdrop.active{opacity:1;pointer-events:auto}

  .sidebar{
    position:fixed !important;
    left:0 !important;
    top:0 !important;
    bottom:0 !important;
    width:min(88vw,340px) !important;
    height:100dvh !important;
    margin:0 !important;
    border:none !important;
    border-radius:0 26px 26px 0 !important;
    background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%) !important;
    box-shadow:0 24px 60px rgba(9,16,31,.24) !important;
    padding:16px 14px 110px !important;
    overflow-y:auto !important;
    transform:translateX(-108%) !important;
    transition:transform .28s ease !important;
    z-index:35 !important;
  }
  .sidebar.open{transform:translateX(0) !important}
  .sidebar-close{display:grid;place-items:center}
  .brand{margin-bottom:14px !important}
  .brand-logo{width:48px;height:48px;border-radius:16px;font-size:20px}
  .brand h1{font-size:18px !important;line-height:1.2 !important;margin:0}
  .brand p{margin:4px 0 0 !important;font-size:12px !important}
  .sidebar-title{margin:10px 4px 12px !important;font-size:13px !important}
  .menu.menu-v2{display:grid;gap:10px}
  .menu-item{
    min-height:66px !important;
    border-radius:20px !important;
    padding:14px 14px !important;
    background:#fff !important;
    border:1px solid #e5edf8 !important;
    box-shadow:0 8px 18px rgba(19,31,59,.05) !important;
  }
  .menu-copy strong{font-size:15px !important}
  .menu-copy small{font-size:12px !important;line-height:1.4 !important}
  .menu-arrow{font-size:24px !important}
  .sidebar-box.sidebar-streak-card{display:block !important;margin-top:14px !important}

  .mobile-dock{
    display:grid;
    grid-template-columns:repeat(5,1fr);
    gap:8px;
    position:fixed;
    left:10px;
    right:10px;
    bottom:calc(10px + env(safe-area-inset-bottom));
    z-index:31;
    padding:10px;
    border-radius:24px;
    background:rgba(255,255,255,.96);
    backdrop-filter:blur(18px);
    box-shadow:0 18px 40px rgba(11,18,34,.16);
    border:1px solid rgba(222,232,247,.95);
  }
  .mobile-dock-item{
    border:none;
    background:transparent;
    border-radius:18px;
    min-height:58px;
    display:grid;
    gap:4px;
    place-items:center;
    color:#56708b;
    font-weight:800;
    cursor:pointer;
  }
  .mobile-dock-item span{font-size:20px;line-height:1}
  .mobile-dock-item small{font-size:11px;line-height:1.1}
  .mobile-dock-item.active,
  .mobile-dock-item:active{
    background:linear-gradient(180deg,#eef5ff 0%,#f8fbff 100%);
    color:#184ea8;
  }
  .mobile-dock-menu{color:#1f3f68}

  .screen,
  .panel,
  .panel-soft,
  .home-card,
  .stat,
  .word-card,
  .phrase-card,
  .lesson-card,
  .story-stage,
  .story-part,
  .translator-panel,
  .translator-result,
  .translator-examples,
  .community-shell,
  .feed-card,
  .post-card{
    border-radius:22px !important;
  }
  .hero-grid,
  .stats,
  .home-card-grid,
  .home-card-grid-upgraded,
  .grammar-layout-v2,
  .practice-layout,
  .progress-layout,
  .videos-layout,
  .community-layout,
  .translator-result-grid,
  .result-grid,
  .options-grid,
  .overview-feature-grid,
  .grammar-examples-grid,
  .grammar-points,
  .phrase-flag-row{
    grid-template-columns:1fr !important;
  }
  .hero-slide h2.hero-title-plain,
  .hero-title-plain,
  .grammar-banner h2{width:100% !important;font-size:28px !important;line-height:1.15 !important}
  .hero-slider{padding:18px 16px 22px !important;min-height:auto !important}
  .hero-slider-nav,
  .hero-slider-nav-dots-only{position:static !important;margin-top:10px !important;padding:0 !important;background:transparent !important;box-shadow:none !important}
  .hero-mini-posts,
  .wordbank-preview-cards,
  .grammar-demo-posts{grid-template-columns:1fr !important}
  .stat{min-height:auto !important;padding:16px !important}

  .grammar-submenu,
  .exercise-part-tabs,
  .horizontal-only-tabs{
    display:flex !important;
    flex-wrap:nowrap !important;
    overflow-x:auto !important;
    padding-bottom:6px !important;
    gap:10px !important;
    scroll-snap-type:x proximity;
  }
  .grammar-tab,
  .exercise-part-tab,
  .horizontal-only-tab{
    flex:0 0 auto !important;
    min-width:max-content !important;
    min-height:52px !important;
    border-radius:18px !important;
    padding:0 16px !important;
    scroll-snap-align:start;
  }

  .lesson-toolbar,
  .toolbar,
  .story-control-bar,
  .practice-next-row,
  .translator-box,
  .topbar-actions,
  .auth-dock{flex-wrap:wrap !important}
  .primary-btn,
  .secondary-btn,
  .story-control,
  .story-control-btn,
  .toolbar .primary-btn,
  .toolbar .secondary-btn{min-height:48px !important}

  input[type="text"],
  textarea,
  select,
  .translator-box input,
  .community-compose textarea,
  .community-compose input{font-size:16px !important}

  #screen-community .panel,
  #screen-community .panel-soft,
  #screen-community .community-shell,
  #screen-community .feed-card,
  #screen-community .post-card,
  #screen-home .panel,
  #screen-stories .panel,
  #screen-grammar .panel,
  #screen-wordbank .panel,
  #screen-phrases .panel,
  #screen-translator .panel,
  #screen-practice .panel,
  #screen-progress .panel,
  #screen-lessons .panel,
  #screen-videos .panel{
    margin-bottom:12px !important;
  }
}


/* === Mobile fixes v3: grammar tabs, stories spacing, video sound === */
.video-sound-btn{
  min-width:140px;
}
.video-sound-btn.is-on{
  background:linear-gradient(180deg,#eaf6ff 0%,#dcedff 100%);
  color:#154ea3;
  border-color:#a8c6f8;
}

@media (max-width:900px){
  .content{
    padding:12px 12px calc(122px + env(safe-area-inset-bottom)) !important;
  }

  .screen.active,
  #screen-home,
  #screen-stories,
  #screen-grammar,
  #screen-wordbank,
  #screen-videos{
    padding-bottom:18px !important;
  }

  .mobile-dock{
    left:12px;
    right:12px;
    bottom:calc(8px + env(safe-area-inset-bottom));
    gap:6px;
    padding:8px;
    border-radius:22px;
  }
  .mobile-dock-item{
    min-height:52px;
    padding:6px 4px;
    border-radius:16px;
  }
  .mobile-dock-item span{font-size:18px}
  .mobile-dock-item small{font-size:10px}
  body.compact-mobile-dock .mobile-dock{
    left:16px;
    right:16px;
    padding:7px;
    gap:4px;
  }

  .story-shell,
  .story-layout,
  .story-main-panel,
  .stories-shell,
  #screen-stories .panel{
    overflow:visible !important;
  }
  #screen-stories .panel{
    margin-bottom:16px !important;
  }
  #screen-stories .lesson-layout,
  #screen-stories .story-layout-v2,
  #screen-stories .story-layout{
    gap:14px !important;
  }

  .grammar-main-panel,
  .grammar-detail-body,
  #screen-grammar .panel{
    overflow:visible !important;
  }
  .grammar-submenu{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    overflow:visible !important;
    gap:10px !important;
    padding:0 !important;
    margin:8px 0 14px !important;
  }
  .grammar-tab{
    min-width:0 !important;
    width:100%;
    min-height:56px !important;
    height:auto;
    padding:12px 12px !important;
    border-radius:18px !important;
    white-space:normal !important;
    text-align:left;
    align-items:flex-start;
    justify-content:flex-start;
    line-height:1.25;
    box-shadow:0 8px 18px rgba(15,25,48,.06);
  }
  .grammar-tab span{
    display:block;
    width:100%;
    white-space:normal;
    font-size:14px;
  }
  .grammar-tab.active{
    box-shadow:0 10px 22px rgba(36,77,146,.16);
  }

  .exercise-part-tabs,
  .horizontal-only-tabs{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    overflow:visible !important;
    gap:10px !important;
    padding-bottom:0 !important;
  }
  .exercise-part-btn,
  .horizontal-only-tabs .exercise-part-btn{
    min-width:0 !important;
    width:100%;
  }

  .video-lightbox-dialog{
    width:min(100vw - 12px, 960px) !important;
    max-width:none !important;
  }
  .video-lightbox-stage{
    gap:10px !important;
  }
  .video-lightbox-main.panel{
    padding:14px !important;
  }
  .video-main-actions{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:10px !important;
  }
  .video-main-actions .primary-btn,
  .video-main-actions .secondary-btn{
    width:100% !important;
    min-width:0 !important;
  }
  .video-sound-btn{
    grid-column:1 / -1;
  }
  .video-preview-strip{
    padding-bottom:20px !important;
  }
}

@media (max-width:560px){
  .content{
    padding:10px 10px calc(126px + env(safe-area-inset-bottom)) !important;
  }
  .mobile-dock{
    left:8px;
    right:8px;
    border-radius:20px;
  }
  .grammar-submenu,
  .exercise-part-tabs,
  .horizontal-only-tabs{
    grid-template-columns:1fr !important;
  }
  .grammar-tab{
    min-height:52px !important;
  }
  .video-main-actions{
    grid-template-columns:1fr !important;
  }
}

/* === v4 exact fixes: visible grammar/story nav + real video volume === */
.video-volume-panel{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border:1px solid #dbe5f4;
  border-radius:18px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
}
.video-volume-text{font-weight:800;color:#27405f;white-space:nowrap}
#videoVolumeRange{flex:1;min-width:120px}
#videoVolumeLabel{min-width:44px;text-align:right;color:#184ea8}

@media (max-width:900px){
  .content{
    padding:12px 12px calc(150px + env(safe-area-inset-bottom)) !important;
  }

  .lesson-layout,
  .grammar-layout-v2,
  #screen-stories .lesson-layout,
  #screen-grammar .grammar-layout-v2{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:14px !important;
  }

  .lesson-sidebar,
  .grammar-sidebar,
  #storySidebar,
  #grammarSidebar{
    position:static !important;
    top:auto !important;
    width:100% !important;
    max-height:none !important;
    overflow:visible !important;
    transform:none !important;
    order:1 !important;
    z-index:1 !important;
  }

  .lesson-main,
  .grammar-main-panel,
  #screen-stories .lesson-main,
  #screen-grammar .grammar-main-panel{
    order:2 !important;
    min-width:0 !important;
    overflow:visible !important;
  }

  #storySidebar,
  #grammarSidebar{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:10px !important;
    margin-bottom:2px !important;
  }

  #storySidebar .lesson-nav-btn,
  #grammarSidebar .grammar-nav-btn{
    width:100% !important;
    min-height:auto !important;
    padding:14px 14px !important;
    border-radius:20px !important;
  }

  #screen-stories .lesson-main,
  #screen-stories .story-wrap,
  #screen-stories .story-stage,
  #screen-stories .panel,
  #screen-grammar .grammar-main-panel,
  #screen-grammar .panel{
    overflow:visible !important;
    margin-bottom:16px !important;
  }

  #screen-stories .story-wrap,
  #screen-grammar .grammar-main-panel{
    padding-bottom:14px !important;
  }

  .grammar-submenu{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
    margin-top:10px !important;
  }

  .grammar-tab{
    min-width:0 !important;
    width:100% !important;
    min-height:62px !important;
    padding:14px 12px !important;
    box-shadow:none !important;
  }

  .video-main-actions{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:10px !important;
  }

  .video-volume-panel{
    width:100% !important;
  }
}

@media (max-width:560px){
  .content{
    padding:10px 10px calc(168px + env(safe-area-inset-bottom)) !important;
  }

  .mobile-dock{
    padding:7px !important;
  }

  .mobile-dock-item{
    min-height:50px !important;
  }

  .grammar-submenu{
    grid-template-columns:1fr !important;
  }

  .video-volume-panel{
    flex-wrap:wrap;
    align-items:center;
  }

  #videoVolumeRange{
    width:100%;
    min-width:0;
    order:3;
  }

  #videoVolumeLabel{
    margin-left:auto;
  }
}

/* =========================================================
   MOBILE FULL REDESIGN v8 — phone-first UI polish
   Goal: bottom navigation, compact menu sheet, less text,
   separate mobile feel for every tab from iPhone-sized screens
   to wider Android devices.
   ========================================================= */
@media (max-width: 900px){
  :root{
    --m-bg:#f4f7fc;
    --m-card:#ffffff;
    --m-ink:#14233a;
    --m-muted:#6b7d92;
    --m-border:rgba(208,221,240,.95);
    --m-shadow:0 14px 34px rgba(15,31,56,.10);
    --m-blue:#2563eb;
    --m-green:#14a06f;
    --m-purple:#7c3aed;
    --m-orange:#f97316;
    --m-pink:#db2777;
  }

  html{background:var(--m-bg);}
  body{
    background:
      radial-gradient(circle at 12% -10%, rgba(73,131,255,.18), transparent 34%),
      radial-gradient(circle at 95% 4%, rgba(20,160,111,.12), transparent 28%),
      linear-gradient(180deg,#f8fbff 0%,#eef4fb 100%) !important;
    color:var(--m-ink);
    -webkit-tap-highlight-color:transparent;
  }

  .app-shell{min-height:100dvh !important;}
  .content{
    width:100% !important;
    padding:10px 10px calc(112px + env(safe-area-inset-bottom)) !important;
  }

  /* Compact phone top bar */
  .topbar,
  .topbar-v2,
  .section-focused .topbar-v2{
    display:grid !important;
    grid-template-columns:46px 1fr auto !important;
    align-items:center !important;
    gap:10px !important;
    top:0 !important;
    padding:10px 12px !important;
    margin:0 -10px 12px !important;
    border-radius:0 0 26px 26px !important;
    border:0 !important;
    background:rgba(255,255,255,.86) !important;
    box-shadow:0 12px 28px rgba(17,29,52,.10) !important;
  }
  .topbar > div:not(.topbar-actions){min-width:0;}
  .small-label{display:none !important;}
  .main-label{
    font-size:16px !important;
    font-weight:900 !important;
    letter-spacing:-.02em !important;
    color:#13233c !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    max-width:100% !important;
  }
  .icon-btn,
  #menuToggle{
    width:46px !important;
    height:46px !important;
    border-radius:17px !important;
    background:linear-gradient(180deg,#ffffff,#eef5ff) !important;
    border:1px solid var(--m-border) !important;
    box-shadow:0 10px 22px rgba(30,62,120,.10) !important;
    color:#163760 !important;
    font-size:21px !important;
  }
  .topbar-actions{justify-self:end;}

  /* Bottom sheet menu — opens above bottom dock, not a clunky side drawer */
  .mobile-backdrop{
    background:rgba(11,18,32,.38) !important;
    backdrop-filter:blur(6px) !important;
    z-index:48 !important;
  }
  .sidebar{
    left:10px !important;
    right:10px !important;
    top:auto !important;
    bottom:calc(88px + env(safe-area-inset-bottom)) !important;
    width:auto !important;
    max-height:min(72dvh,620px) !important;
    height:auto !important;
    border-radius:30px !important;
    padding:14px 12px 16px !important;
    transform:translateY(120%) scale(.98) !important;
    opacity:0 !important;
    transition:transform .24s ease, opacity .2s ease !important;
    box-shadow:0 28px 70px rgba(10,19,36,.26) !important;
    border:1px solid rgba(222,232,247,.95) !important;
    background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%) !important;
    z-index:55 !important;
  }
  .sidebar.open{transform:translateY(0) scale(1) !important;opacity:1 !important;}
  .sidebar-topline{padding:2px 2px 10px !important;}
  .brand-v2{gap:9px !important;margin:0 !important;}
  .brand-logo{width:42px !important;height:42px !important;border-radius:16px !important;font-size:19px !important;}
  .brand h1{font-size:15px !important;max-width:190px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .brand p{display:none !important;}
  .sidebar-close{width:40px !important;height:40px !important;border-radius:15px !important;}
  .sidebar-title{display:none !important;}
  .menu.menu-v2{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:9px !important;
    padding:0 !important;
  }
  .menu-item{
    min-height:74px !important;
    display:grid !important;
    grid-template-columns:36px 1fr !important;
    align-items:center !important;
    gap:9px !important;
    padding:11px !important;
    border-radius:22px !important;
    box-shadow:0 10px 24px rgba(17,35,66,.07) !important;
  }
  .menu-icon{width:36px !important;height:36px !important;border-radius:14px !important;font-size:17px !important;}
  .menu-copy{min-width:0 !important;}
  .menu-copy strong{font-size:13px !important;line-height:1.15 !important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .menu-copy small{display:none !important;}
  .menu-arrow{display:none !important;}
  .menu-item.active{
    border-color:rgba(37,99,235,.30) !important;
    background:linear-gradient(180deg,#edf5ff 0%,#ffffff 100%) !important;
    box-shadow:0 14px 28px rgba(37,99,235,.14) !important;
  }
  .sidebar-box.sidebar-streak-card{display:none !important;}

  /* App dock */
  .mobile-dock{
    display:grid !important;
    grid-template-columns:repeat(5,1fr) !important;
    left:10px !important;
    right:10px !important;
    bottom:calc(8px + env(safe-area-inset-bottom)) !important;
    gap:6px !important;
    padding:8px !important;
    border-radius:28px !important;
    background:rgba(255,255,255,.94) !important;
    border:1px solid rgba(216,228,245,.95) !important;
    box-shadow:0 18px 46px rgba(13,24,45,.18) !important;
    backdrop-filter:blur(20px) !important;
    z-index:54 !important;
  }
  .mobile-dock-item{
    min-width:0 !important;
    min-height:56px !important;
    border-radius:21px !important;
    padding:6px 2px !important;
    color:#62768e !important;
  }
  .mobile-dock-item span{font-size:20px !important;}
  .mobile-dock-item small{font-size:10.5px !important;font-weight:900 !important;letter-spacing:-.01em !important;}
  .mobile-dock-item.active{
    background:linear-gradient(180deg,#eaf2ff 0%,#ffffff 100%) !important;
    color:#174ea6 !important;
    box-shadow:inset 0 0 0 1px rgba(37,99,235,.12), 0 8px 18px rgba(37,99,235,.10) !important;
  }
  .mobile-dock-menu{
    background:linear-gradient(180deg,#14233c 0%,#223f68 100%) !important;
    color:#fff !important;
  }

  /* Universal mobile card language */
  .screen{animation:none !important;}
  .panel,.panel-soft,.hero-panel,.stats,.home-card,.stat,.word-card,.phrase-card,.lesson-card,
  .story-stage,.story-part,.translator-panel,.translator-result,.translator-examples,.community-shell,
  .feed-card,.post-card,.grammar-main-card,.grammar-topic-panel,.practice-card,.progress-card,.video-main-panel,.video-sidebar-panel{
    border-radius:26px !important;
    border:1px solid rgba(218,229,244,.95) !important;
    box-shadow:var(--m-shadow) !important;
    background:rgba(255,255,255,.94) !important;
  }
  h1,h2,h3{letter-spacing:-.035em !important;}
  .panel p,.hero-slide p,.home-card p,.stat span,.lesson-card p,.phrase-card p,.info-card p,.help-note p,
  .grammar-point p,.grammar-example-card span,.story-part p,.translator-note,.community-card p{
    font-size:13px !important;
    line-height:1.45 !important;
  }

  /* Home mobile */
  body[data-active-screen="home"] .content{background:radial-gradient(circle at top left,rgba(37,99,235,.08),transparent 34%);}
  .hero-grid,.stats,.home-card-grid,.home-card-grid-upgraded{grid-template-columns:1fr !important;gap:11px !important;}
  .hero-panel,.hero-slider{min-height:0 !important;padding:16px !important;padding-bottom:56px !important;overflow:hidden !important;}
  .hero-slide{padding:0 !important;gap:10px !important;}
  .hero-title-plain,.hero-slide h2{font-size:24px !important;line-height:1.05 !important;margin:2px 0 4px !important;}
  .tag{font-size:11px !important;padding:7px 10px !important;border-radius:999px !important;}
  .hero-mini-posts,.wordbank-preview-cards,.grammar-demo-posts{grid-template-columns:1fr 1fr !important;gap:9px !important;}
  .hero-mini-posts > :first-child{grid-column:1/-1;}
  .hero-mini-card,.hero-demo-post{min-height:auto !important;padding:12px !important;border-radius:20px !important;}
  .stats{display:grid !important;grid-template-columns:1fr 1fr !important;}
  .stat{padding:14px !important;min-height:104px !important;}
  .stat strong{font-size:17px !important;}

  /* Stories */
  body[data-active-screen="stories"] .screen.active{background:linear-gradient(180deg,rgba(219,39,119,.07),transparent 220px);border-radius:28px;}
  #screen-stories .story-para,#screen-stories .story-player-shell{grid-template-columns:1fr !important;gap:10px !important;}
  #screen-stories .story-now-line{font-size:18px !important;}
  #screen-stories .story-part{padding:14px !important;}

  /* Grammar */
  body[data-active-screen="grammar"] .screen.active{background:linear-gradient(180deg,rgba(20,160,111,.08),transparent 240px);border-radius:28px;}
  #screen-grammar .grammar-layout,#screen-grammar .grammar-layout-v2{grid-template-columns:1fr !important;gap:12px !important;}
  #screen-grammar .grammar-topic-list{display:grid !important;grid-template-columns:1fr 1fr !important;gap:9px !important;}
  #screen-grammar .grammar-topic-btn{min-height:62px !important;padding:10px !important;border-radius:20px !important;}
  #screen-grammar .grammar-topic-btn p,#screen-grammar .grammar-topic-btn small{display:none !important;}
  #screen-grammar .grammar-topic-btn strong{font-size:13px !important;}
  #screen-grammar .grammar-submenu{display:flex !important;overflow-x:auto !important;gap:8px !important;padding-bottom:4px !important;scroll-snap-type:x mandatory;}
  #screen-grammar .grammar-tab{flex:0 0 auto !important;min-width:112px !important;min-height:48px !important;padding:10px 12px !important;border-radius:18px !important;scroll-snap-align:start;}
  #screen-grammar .grammar-tab small{display:none !important;}

  /* Word bank */
  body[data-active-screen="wordbank"] .screen.active{background:linear-gradient(180deg,rgba(37,99,235,.08),transparent 240px);border-radius:28px;}
  #screen-wordbank .word-grid,#screen-wordbank .word-pairs{grid-template-columns:1fr !important;gap:10px !important;}
  #screen-wordbank .word-card{padding:14px !important;}
  #screen-wordbank .word-card .word-main,#screen-wordbank .italian-main-word{font-size:22px !important;}

  /* Phrases */
  body[data-active-screen="phrases"] .screen.active{background:linear-gradient(180deg,rgba(124,58,237,.08),transparent 240px);border-radius:28px;}
  #screen-phrases .phrase-grid{grid-template-columns:1fr !important;gap:10px !important;}
  #screen-phrases .phrase-card{padding:14px !important;}
  #screen-phrases .phrase-card-top{grid-template-columns:auto 1fr !important;gap:10px !important;}
  #screen-phrases .phrase-icon{width:46px !important;height:46px !important;border-radius:17px !important;}

  /* Translator */
  body[data-active-screen="translator"] .screen.active{background:linear-gradient(180deg,rgba(6,182,212,.08),transparent 240px);border-radius:28px;}
  #screen-translator .translator-grid,#screen-translator .translator-main-grid,#screen-translator .translation-layout{grid-template-columns:1fr !important;gap:12px !important;}
  #screen-translator textarea,#screen-translator input{font-size:16px !important;border-radius:20px !important;}
  #screen-translator .translator-actions,#screen-translator .translation-actions{grid-template-columns:1fr !important;gap:9px !important;}

  /* Practice */
  body[data-active-screen="practice"] .screen.active{background:linear-gradient(180deg,rgba(249,115,22,.09),transparent 240px);border-radius:28px;}
  #screen-practice .practice-layout,#screen-practice .options-grid,#screen-practice .result-grid{grid-template-columns:1fr !important;gap:10px !important;}
  #screen-practice .practice-stats{grid-template-columns:1fr 1fr !important;gap:9px !important;}

  /* Progress */
  body[data-active-screen="progress"] .screen.active{background:linear-gradient(180deg,rgba(79,70,229,.08),transparent 240px);border-radius:28px;}
  #screen-progress .progress-insight-grid,#screen-progress .community-stats-grid,#screen-progress .weekly-activity{grid-template-columns:1fr 1fr !important;gap:9px !important;}

  /* Community */
  body[data-active-screen="community"] .screen.active{background:linear-gradient(180deg,rgba(245,158,11,.10),transparent 240px);border-radius:28px;}
  #screen-community .compact-community-top-grid,#screen-community .compact-community-main-grid,#screen-community .community-composer-v2,#screen-community .reply-composer{grid-template-columns:1fr !important;gap:10px !important;}
  #screen-community .compact-summary-grid,#screen-community .compact-summary-grid-six{grid-template-columns:1fr 1fr !important;}

  /* Lessons */
  body[data-active-screen="lessons"] .screen.active{background:linear-gradient(180deg,rgba(15,118,110,.08),transparent 240px);border-radius:28px;}
  #screen-lessons .lesson-layout,#screen-lessons .lesson-example{grid-template-columns:1fr !important;gap:10px !important;}
  #screen-lessons .lesson-card{padding:14px !important;}

  /* Videos */
  body[data-active-screen="videos"] .screen.active{background:linear-gradient(180deg,rgba(239,68,68,.08),transparent 240px);border-radius:28px;}
  #screen-videos .videos-layout,#screen-videos .video-side-list{grid-template-columns:1fr !important;gap:10px !important;}
  #screen-videos .videos-hero{padding:16px !important;border-radius:26px !important;}
  #screen-videos .videos-hero h2,#screen-videos .video-meta-block h3{font-size:22px !important;line-height:1.1 !important;}
  #screen-videos .video-side-card{grid-template-columns:82px 1fr !important;border-radius:20px !important;}

  /* Touch targets */
  button,.primary-btn,.secondary-btn,.story-chip,.grammar-tab,.grammar-topic-btn{min-height:44px;}
}

@media (max-width: 430px){
  .content{padding-left:8px !important;padding-right:8px !important;padding-bottom:calc(104px + env(safe-area-inset-bottom)) !important;}
  .topbar,.topbar-v2,.section-focused .topbar-v2{margin-left:-8px !important;margin-right:-8px !important;grid-template-columns:44px 1fr auto !important;}
  .mobile-dock{left:8px !important;right:8px !important;padding:7px !important;border-radius:24px !important;gap:4px !important;}
  .mobile-dock-item{min-height:52px !important;border-radius:18px !important;}
  .mobile-dock-item span{font-size:19px !important;}
  .mobile-dock-item small{font-size:10px !important;}
  .sidebar{left:8px !important;right:8px !important;bottom:calc(82px + env(safe-area-inset-bottom)) !important;border-radius:26px !important;}
  .menu.menu-v2{grid-template-columns:1fr 1fr !important;gap:8px !important;}
  .menu-item{min-height:68px !important;padding:10px !important;}
  .hero-title-plain,.hero-slide h2{font-size:22px !important;}
  .stats,#screen-grammar .grammar-topic-list,#screen-progress .progress-insight-grid,#screen-progress .community-stats-grid,#screen-community .compact-summary-grid,#screen-community .compact-summary-grid-six{grid-template-columns:1fr 1fr !important;}
}

@media (max-width: 360px){
  .mobile-dock-item small{display:none !important;}
  .mobile-dock-item{min-height:48px !important;}
  .mobile-dock{grid-template-columns:repeat(5,1fr) !important;}
  .menu-copy strong{font-size:12px !important;}
  .main-label{font-size:15px !important;}
}

body[data-theme="dark"] .mobile-dock,
body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .topbar-v2{
  background:rgba(12,22,39,.92) !important;
  border-color:rgba(130,160,210,.18) !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] .main-label{color:#eef4ff !important;}

/* === v9 mobile requested fixes: video sound state, swipe/scroll, grammar submenu boxes, light default === */
@media (max-width: 760px){
  body{color-scheme:light !important;background:#f6f9ff !important;}
  body[data-theme="dark"]{--m-bg:#f6f9ff;--m-card:#ffffff;--m-text:#122033;--m-muted:#617188;background:#f6f9ff !important;color:#122033 !important;}
  #screen-videos .video-gallery-panel,#screen-videos .video-gallery-grid,#screen-videos .video-preview-list,#screen-videos .video-preview-strip{-webkit-overflow-scrolling:touch !important;overscroll-behavior:contain !important;}
  .video-lightbox-main,.video-lightbox-stage{touch-action:pan-y pinch-zoom !important;}
  .video-sound-btn{min-width:118px !important;justify-content:center !important;background:#fff7ed !important;color:#9a3412 !important;border-color:#fed7aa !important;}
  .video-sound-btn.is-on{background:#ecfdf5 !important;color:#047857 !important;border-color:#a7f3d0 !important;}
  .video-preview-strip{max-height:34vh !important;overflow-y:auto !important;overflow-x:hidden !important;}
  .video-preview-list{max-height:30vh !important;overflow-y:auto !important;overflow-x:hidden !important;grid-auto-flow:row !important;grid-auto-columns:unset !important;grid-template-columns:1fr !important;padding-right:2px !important;}
  .video-preview-card{width:100% !important;}
  #grammarSubmenu,.grammar-submenu{display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:10px !important;overflow:visible !important;padding:4px 0 12px !important;background:transparent !important;border:0 !important;box-shadow:none !important;}
  #grammarSubmenu .grammar-tab,.grammar-submenu .grammar-tab{min-height:74px !important;width:100% !important;display:flex !important;align-items:center !important;justify-content:center !important;gap:7px !important;padding:12px 10px !important;border-radius:22px !important;border:1.5px solid #dce7f7 !important;background:linear-gradient(180deg,#ffffff,#f8fbff) !important;box-shadow:0 10px 24px rgba(22,34,58,.08) !important;font-size:14px !important;font-weight:900 !important;line-height:1.15 !important;white-space:normal !important;text-align:center !important;color:#24415f !important;}
  #grammarSubmenu .grammar-tab.active,.grammar-submenu .grammar-tab.active{border-color:#3b82f6 !important;background:linear-gradient(180deg,#eef6ff,#ffffff) !important;color:#1d4ed8 !important;box-shadow:0 12px 28px rgba(59,130,246,.16) !important;}
}
@media (max-width: 390px){#grammarSubmenu,.grammar-submenu{grid-template-columns:1fr !important;}#grammarSubmenu .grammar-tab,.grammar-submenu .grammar-tab{min-height:60px !important;}}

/* v10 mobile fixes: visible grammar tabs, light default, video arrows/swipe hints */
@media (max-width: 760px){
  body, body[data-theme="dark"], body[data-theme="light"]{background:#f7fbff !important;color:#12223a !important;}
  #screen-grammar #grammarSubmenu,
  #screen-grammar .grammar-submenu{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
    width:100% !important;
    overflow:visible !important;
    padding:8px 0 14px !important;
    margin:8px 0 10px !important;
    border:0 !important;
    background:transparent !important;
  }
  #screen-grammar #grammarSubmenu .grammar-tab,
  #screen-grammar .grammar-submenu .grammar-tab{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-width:0 !important;
    width:100% !important;
    min-height:58px !important;
    padding:10px 8px !important;
    border-radius:18px !important;
    border:1.5px solid #dbe7f8 !important;
    background:#fff !important;
    color:#16365f !important;
    box-shadow:0 10px 22px rgba(24,45,82,.08) !important;
    font-size:13px !important;
    font-weight:900 !important;
    line-height:1.1 !important;
    white-space:normal !important;
    text-align:center !important;
  }
  #screen-grammar #grammarSubmenu .grammar-tab.active,
  #screen-grammar .grammar-submenu .grammar-tab.active{
    color:#1e55c7 !important;
    border-color:#3b82f6 !important;
    background:linear-gradient(180deg,#eef6ff,#ffffff) !important;
  }
  #screen-grammar #grammarSubmenu .grammar-tab span,
  #screen-grammar .grammar-submenu .grammar-tab span{display:block !important;}

  .video-lightbox{padding:8px !important;align-items:stretch !important;}
  .video-lightbox-dialog{width:100% !important;max-width:430px !important;margin:auto !important;}
  .video-lightbox-stage{position:relative !important;display:block !important;padding:0 42px !important;}
  .video-lightbox-main{position:relative !important;z-index:1 !important;}
  .video-nav-btn{position:absolute !important;top:42% !important;z-index:5 !important;width:42px !important;height:86px !important;border-radius:22px !important;background:rgba(15,34,65,.86) !important;color:#fff !important;font-size:36px !important;box-shadow:0 14px 28px rgba(15,34,65,.22) !important;}
  .video-nav-btn-left{left:0 !important;}
  .video-nav-btn-right{right:0 !important;}
  .video-mobile-swipe-hint{display:flex !important;align-items:center !important;justify-content:space-between !important;gap:6px !important;margin:8px 0 0 !important;padding:8px 10px !important;border-radius:16px !important;background:#fff !important;border:1px solid #dbe7f8 !important;box-shadow:0 8px 18px rgba(24,45,82,.08) !important;color:#1b3f72 !important;font-size:11px !important;font-weight:900 !important;text-align:center !important;}
  .video-mobile-swipe-hint strong{font-size:12px !important;color:#2563eb !important;}
  .video-volume-panel{width:100% !important;display:grid !important;grid-template-columns:auto 1fr auto !important;gap:8px !important;}
  #videoVolumeRange{width:100% !important;touch-action:none !important;}
}
@media (min-width: 761px){.video-mobile-swipe-hint{display:none !important;}}
@media (max-width: 360px){#screen-grammar #grammarSubmenu,#screen-grammar .grammar-submenu{grid-template-columns:1fr !important;}.video-lightbox-stage{padding:0 34px !important;}.video-nav-btn{width:36px !important;}}

/* === v11 HARD FIX: Grammar menu buttons visible on all mobile devices === */
@media (max-width: 900px){
  #screen-grammar .grammar-main-panel{overflow:visible !important;}
  #screen-grammar #grammarSubmenu,
  #screen-grammar .grammar-submenu{
    position:relative !important;
    z-index:30 !important;
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
    width:100% !important;
    max-width:100% !important;
    height:auto !important;
    max-height:none !important;
    overflow:visible !important;
    padding:10px 0 14px !important;
    margin:10px 0 14px !important;
    transform:none !important;
    background:transparent !important;
    border:0 !important;
  }
  #screen-grammar #grammarSubmenu .grammar-tab,
  #screen-grammar .grammar-submenu .grammar-tab{
    position:relative !important;
    inset:auto !important;
    transform:none !important;
    opacity:1 !important;
    visibility:visible !important;
    display:flex !important;
    flex:initial !important;
    width:100% !important;
    min-width:0 !important;
    max-width:none !important;
    min-height:58px !important;
    height:auto !important;
    margin:0 !important;
    padding:10px 8px !important;
    align-items:center !important;
    justify-content:center !important;
    border-radius:20px !important;
    border:1.5px solid #dbe7f8 !important;
    background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%) !important;
    box-shadow:0 8px 18px rgba(24,45,82,.08) !important;
    color:#173b68 !important;
    font-size:13px !important;
    font-weight:900 !important;
    line-height:1.15 !important;
    text-align:center !important;
    white-space:normal !important;
  }
  #screen-grammar #grammarSubmenu .grammar-tab span,
  #screen-grammar .grammar-submenu .grammar-tab span{
    display:block !important;
    width:100% !important;
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
  }
  #screen-grammar #grammarSubmenu .grammar-tab.active,
  #screen-grammar .grammar-submenu .grammar-tab.active{
    color:#1d4ed8 !important;
    border-color:#3b82f6 !important;
    background:linear-gradient(180deg,#eef6ff 0%,#ffffff 100%) !important;
    box-shadow:0 10px 24px rgba(59,130,246,.18) !important;
  }
  #screen-grammar #grammarDetailBody,
  #screen-grammar .grammar-detail-body{
    position:relative !important;
    z-index:1 !important;
    margin-top:0 !important;
    clear:both !important;
  }
}
@media (max-width: 370px){
  #screen-grammar #grammarSubmenu,
  #screen-grammar .grammar-submenu{grid-template-columns:1fr !important;}
}

/* === v12 TikTok / Facebook Reels style video tab (mobile only) === */
@media (max-width: 760px){
  body.video-modal-open{overflow:hidden !important; touch-action:none !important;}
  .video-lightbox{
    position:fixed !important; inset:0 !important; z-index:9999 !important;
    display:flex !important; align-items:stretch !important; justify-content:center !important;
    padding:0 !important; background:#05070d !important;
  }
  .video-lightbox[hidden]{display:none !important;}
  .video-lightbox-backdrop{position:absolute !important; inset:0 !important; background:#05070d !important; opacity:1 !important;}
  .video-lightbox-dialog{
    position:relative !important; z-index:2 !important; width:100vw !important; max-width:none !important;
    height:100dvh !important; max-height:none !important; margin:0 !important; border-radius:0 !important;
    background:#05070d !important; overflow:hidden !important; box-shadow:none !important;
    padding:0 !important;
  }
  .video-lightbox-stage{
    display:block !important; width:100% !important; height:100% !important; padding:0 !important;
    position:relative !important; overflow:hidden !important; background:#05070d !important;
  }
  .video-lightbox-main{
    width:100% !important; height:100% !important; padding:0 !important; margin:0 !important;
    border:0 !important; border-radius:0 !important; background:#05070d !important; box-shadow:none !important;
    display:flex !important; align-items:center !important; justify-content:center !important;
  }
  .video-embed-wrap-modal{
    position:absolute !important; inset:0 !important; width:100% !important; height:100% !important;
    border-radius:0 !important; overflow:hidden !important; background:#000 !important; margin:0 !important;
  }
  .di-video-player,.di-video-player iframe,#diYoutubeMount{
    width:100% !important; height:100% !important; border:0 !important; display:block !important;
  }
  .di-video-player iframe{object-fit:cover !important;}
  .video-player-top{
    position:absolute !important; left:14px !important; right:72px !important; top:calc(env(safe-area-inset-top) + 12px) !important;
    z-index:8 !important; display:flex !important; gap:8px !important; align-items:center !important; pointer-events:none !important;
  }
  #videoCounter{display:inline-flex !important; background:rgba(0,0,0,.48) !important; color:#fff !important; border:1px solid rgba(255,255,255,.16) !important; backdrop-filter:blur(12px) !important;}
  .video-lightbox-close{
    position:absolute !important; top:calc(env(safe-area-inset-top) + 12px) !important; right:14px !important; z-index:12 !important;
    width:46px !important; height:46px !important; border-radius:999px !important; color:#fff !important;
    background:rgba(0,0,0,.55) !important; border:1px solid rgba(255,255,255,.18) !important;
    font-size:30px !important; line-height:1 !important; display:grid !important; place-items:center !important;
  }
  .video-meta-block{
    position:absolute !important; left:16px !important; right:84px !important; bottom:calc(env(safe-area-inset-bottom) + 110px) !important;
    z-index:8 !important; color:#fff !important; margin:0 !important; padding:0 !important; text-shadow:0 2px 18px rgba(0,0,0,.78) !important;
  }
  #diVideoTitle{font-size:20px !important; line-height:1.18 !important; margin:0 0 6px !important; color:#fff !important; display:-webkit-box !important; -webkit-line-clamp:2 !important; -webkit-box-orient:vertical !important; overflow:hidden !important;}
  #diVideoDesc{font-size:12px !important; line-height:1.35 !important; max-width:100% !important; margin:0 !important; color:rgba(255,255,255,.82) !important; display:-webkit-box !important; -webkit-line-clamp:2 !important; -webkit-box-orient:vertical !important; overflow:hidden !important;}
  .video-main-actions{
    position:absolute !important; right:12px !important; bottom:calc(env(safe-area-inset-bottom) + 108px) !important; z-index:10 !important;
    display:flex !important; flex-direction:column !important; gap:10px !important; align-items:center !important; width:58px !important;
  }
  .video-main-actions .secondary-btn,.video-main-actions .primary-btn{
    width:54px !important; height:54px !important; min-height:54px !important; padding:0 !important; border-radius:999px !important;
    display:grid !important; place-items:center !important; font-size:0 !important; color:#fff !important;
    background:rgba(0,0,0,.48) !important; border:1px solid rgba(255,255,255,.18) !important; backdrop-filter:blur(12px) !important;
    box-shadow:0 14px 28px rgba(0,0,0,.25) !important;
  }
  #videoSoundToggleBtn::before{content:'🔊'; font-size:24px;}
  #videoSoundToggleBtn:not(.is-on)::before{content:'🔇';}
  #videoNextInlineBtn::before{content:'⬆️'; font-size:23px;}
  #videoViewAllBtn::before{content:'▦'; font-size:25px; font-weight:900;}
  .video-volume-panel{
    position:fixed !important; left:16px !important; right:16px !important; bottom:calc(env(safe-area-inset-bottom) + 28px) !important;
    z-index:11 !important; width:auto !important; display:grid !important; grid-template-columns:auto 1fr auto !important; gap:10px !important;
    align-items:center !important; padding:11px 13px !important; border-radius:999px !important; background:rgba(0,0,0,.56) !important;
    border:1px solid rgba(255,255,255,.16) !important; color:#fff !important; backdrop-filter:blur(14px) !important;
  }
  .video-volume-text{font-size:12px !important; font-weight:900 !important; color:#fff !important;}
  #videoVolumeLabel{font-size:12px !important; color:#fff !important;}
  #videoVolumeRange{width:100% !important; accent-color:#fff; touch-action:none !important;}
  .video-preview-strip{display:none !important;}
  .video-nav-btn{
    position:absolute !important; z-index:9 !important; right:12px !important; left:auto !important; width:54px !important; height:54px !important;
    border-radius:999px !important; background:rgba(0,0,0,.48) !important; border:1px solid rgba(255,255,255,.18) !important;
    color:#fff !important; font-size:36px !important; line-height:1 !important; display:grid !important; place-items:center !important;
    box-shadow:0 14px 28px rgba(0,0,0,.25) !important;
  }
  .video-nav-btn-left{top:calc(50% - 72px) !important;}
  .video-nav-btn-right{top:calc(50% - 6px) !important;}
  .video-nav-btn-left::after{content:'Previous'; position:absolute; right:62px; top:50%; transform:translateY(-50%); font-size:11px; font-weight:900; color:#fff; background:rgba(0,0,0,.4); padding:6px 9px; border-radius:999px; white-space:nowrap;}
  .video-nav-btn-right::after{content:'Next'; position:absolute; right:62px; top:50%; transform:translateY(-50%); font-size:11px; font-weight:900; color:#fff; background:rgba(0,0,0,.4); padding:6px 9px; border-radius:999px; white-space:nowrap;}
  .video-mobile-swipe-hint{
    position:absolute !important; left:50% !important; top:calc(env(safe-area-inset-top) + 66px) !important; transform:translateX(-50%) !important;
    z-index:10 !important; margin:0 !important; padding:8px 11px !important; width:auto !important; max-width:calc(100% - 32px) !important;
    background:rgba(0,0,0,.48) !important; border:1px solid rgba(255,255,255,.16) !important; color:#fff !important;
    border-radius:999px !important; box-shadow:none !important; backdrop-filter:blur(12px) !important; gap:10px !important;
  }
  .video-mobile-swipe-hint strong,.video-mobile-swipe-hint span{color:#fff !important; font-size:11px !important; white-space:nowrap !important;}
  .compact-mobile-dock .mobile-dock{display:none !important;}
  #screen-videos .videos-hero p{display:none !important;}
  #screen-videos .videos-hero h2{font-size:21px !important;}
  #screen-videos .video-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:10px !important;}
  #screen-videos .video-gallery-card{border-radius:20px !important; padding:8px !important;}
  #screen-videos .video-gallery-copy span{display:none !important;}
}

/* === v14 clean TikTok mobile video UI fixes === */
@media (max-width: 760px){
  /* remove clutter */
  .video-volume-panel,
  #videoVolumePanel,
  .video-mobile-swipe-hint,
  .video-preview-strip,
  #videoPreviewStrip,
  .video-brand,
  .video-nav-btn-left::after,
  .video-nav-btn-right::after{
    display:none !important;
    visibility:hidden !important;
  }

  /* full screen clean modal */
  .video-lightbox,
  .video-lightbox-dialog,
  .video-lightbox-stage,
  .video-lightbox-main{
    background:#05070d !important;
    overflow:hidden !important;
  }

  /* center the video and make it cover the mobile screen */
  .video-embed-wrap-modal{
    position:absolute !important;
    inset:0 !important;
    width:100vw !important;
    height:100dvh !important;
    margin:0 !important;
    padding:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    overflow:hidden !important;
    background:#05070d !important;
    border:0 !important;
  }
  .di-video-player,
  #diVideoPlayer{
    position:absolute !important;
    inset:0 !important;
    width:100vw !important;
    height:100dvh !important;
    overflow:hidden !important;
    background:#05070d !important;
  }
  #diYoutubeMount,
  .di-video-player iframe,
  #diYoutubeMount iframe{
    position:absolute !important;
    left:50% !important;
    top:50% !important;
    width:100vw !important;
    height:177.78vw !important;
    min-height:100dvh !important;
    min-width:56.25dvh !important;
    transform:translate(-50%,-50%) !important;
    border:0 !important;
    display:block !important;
    background:#05070d !important;
  }

  /* compact top chips */
  .video-player-top{
    top:calc(env(safe-area-inset-top) + 12px) !important;
    left:12px !important;
    right:76px !important;
    gap:6px !important;
    z-index:20 !important;
    pointer-events:none !important;
  }
  #videoNowPlayingChip,
  #videoCounter{
    min-height:0 !important;
    height:28px !important;
    padding:5px 9px !important;
    border-radius:999px !important;
    font-size:11px !important;
    line-height:1 !important;
    font-weight:900 !important;
    letter-spacing:.01em !important;
    box-shadow:none !important;
    max-width:max-content !important;
    white-space:nowrap !important;
    background:rgba(0,0,0,.42) !important;
    color:#fff !important;
    border:1px solid rgba(255,255,255,.14) !important;
    backdrop-filter:blur(12px) !important;
  }
  #videoNowPlayingChip{
    background:rgba(22,163,74,.78) !important;
  }

  /* close button compact */
  .video-lightbox-close{
    top:calc(env(safe-area-inset-top) + 10px) !important;
    right:12px !important;
    width:46px !important;
    height:46px !important;
    z-index:30 !important;
  }

  /* text smaller and lower-left like reels */
  .video-meta-block{
    left:14px !important;
    right:82px !important;
    bottom:calc(env(safe-area-inset-bottom) + 34px) !important;
    z-index:18 !important;
    padding:0 !important;
    margin:0 !important;
    max-width:calc(100vw - 108px) !important;
  }
  #diVideoTitle{
    font-size:17px !important;
    line-height:1.15 !important;
    margin:0 0 4px !important;
    font-weight:900 !important;
    color:#fff !important;
    text-shadow:0 2px 16px rgba(0,0,0,.9) !important;
    -webkit-line-clamp:2 !important;
  }
  #diVideoDesc{
    font-size:11px !important;
    line-height:1.25 !important;
    margin:0 !important;
    color:rgba(255,255,255,.86) !important;
    text-shadow:0 2px 14px rgba(0,0,0,.9) !important;
    -webkit-line-clamp:2 !important;
  }

  /* TikTok-style right action buttons, no text labels */
  .video-main-actions{
    right:12px !important;
    bottom:calc(env(safe-area-inset-bottom) + 34px) !important;
    width:50px !important;
    gap:10px !important;
    z-index:22 !important;
  }
  .video-main-actions .secondary-btn,
  .video-main-actions .primary-btn,
  .video-nav-btn{
    width:48px !important;
    height:48px !important;
    min-width:48px !important;
    min-height:48px !important;
    padding:0 !important;
    border-radius:999px !important;
    font-size:0 !important;
    overflow:hidden !important;
    color:#fff !important;
    background:rgba(0,0,0,.44) !important;
    border:1px solid rgba(255,255,255,.16) !important;
    backdrop-filter:blur(12px) !important;
    box-shadow:0 10px 24px rgba(0,0,0,.26) !important;
  }
  #videoSoundToggleBtn::before{font-size:22px !important; content:'🔊' !important;}
  #videoSoundToggleBtn:not(.is-on)::before{content:'🔇' !important;}
  #videoViewAllBtn::before{font-size:22px !important; content:'▦' !important;}
  #videoNextInlineBtn{display:none !important;}

  /* arrow buttons only, no previous/next labels */
  .video-nav-btn{
    right:12px !important;
    left:auto !important;
    z-index:23 !important;
    display:grid !important;
    place-items:center !important;
    font-size:34px !important;
    line-height:1 !important;
  }
  .video-nav-btn-left{top:calc(50% - 58px) !important;}
  .video-nav-btn-right{top:calc(50% + 2px) !important;}
  .video-nav-btn-left::before{content:'‹' !important; font-size:38px !important; color:#fff !important;}
  .video-nav-btn-right::before{content:'›' !important; font-size:38px !important; color:#fff !important;}
  .video-nav-btn-left,
  .video-nav-btn-right{font-size:0 !important;}

  /* stop any overlap from old inline controls */
  .video-main-actions > *{position:relative !important; z-index:1 !important;}
}

/* === v15 fix: show full video, centered; no crop on mobile === */
@media (max-width: 760px){
  .video-embed-wrap-modal{
    position:absolute !important;
    left:50% !important;
    top:50% !important;
    right:auto !important;
    bottom:auto !important;
    width:min(100vw, 56.25dvh) !important;
    height:100dvh !important;
    max-width:100vw !important;
    max-height:100dvh !important;
    transform:translate(-50%, -50%) !important;
    display:block !important;
    overflow:hidden !important;
    background:#05070d !important;
  }
  .di-video-player,
  #diVideoPlayer{
    position:absolute !important;
    inset:0 !important;
    width:100% !important;
    height:100% !important;
    overflow:hidden !important;
    background:#05070d !important;
  }
  #diYoutubeMount,
  .di-video-player iframe,
  #diYoutubeMount iframe{
    position:absolute !important;
    inset:0 !important;
    left:0 !important;
    top:0 !important;
    width:100% !important;
    height:100% !important;
    min-width:0 !important;
    min-height:0 !important;
    max-width:100% !important;
    max-height:100% !important;
    transform:none !important;
    object-fit:contain !important;
    object-position:center center !important;
    border:0 !important;
    display:block !important;
    background:#05070d !important;
  }
  .video-lightbox-stage,
  .video-lightbox-main{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
  }
}

/* === v16 FINAL: YouTube Shorts center fix (no left crop) === */
@media (max-width: 760px){
  .video-lightbox,
  .video-lightbox-dialog,
  .video-lightbox-stage,
  .video-lightbox-main{
    position:fixed !important;
    inset:0 !important;
    width:100vw !important;
    height:100dvh !important;
    max-width:none !important;
    max-height:none !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:#05070d !important;
    overflow:hidden !important;
    display:block !important;
  }

  .video-embed-wrap-modal{
    position:absolute !important;
    inset:0 !important;
    width:100vw !important;
    height:100dvh !important;
    max-width:none !important;
    max-height:none !important;
    min-width:0 !important;
    min-height:0 !important;
    transform:none !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:#05070d !important;
    overflow:hidden !important;
  }

  #diVideoPlayer,
  .di-video-player{
    position:absolute !important;
    inset:0 !important;
    width:100vw !important;
    height:100dvh !important;
    max-width:none !important;
    max-height:none !important;
    overflow:hidden !important;
    background:#05070d !important;
  }

  /* Important: YouTube Shorts often sticks left inside a 9:16 iframe.
     A wide 16:9 iframe centered in the viewport keeps the actual Short centered
     while the black side area is cropped away by the modal. */
  #diYoutubeMount,
  #diYoutubeMount iframe,
  .di-video-player iframe{
    position:absolute !important;
    left:50% !important;
    top:50% !important;
    width:177.78dvh !important;
    height:100dvh !important;
    min-width:177.78dvh !important;
    min-height:100dvh !important;
    max-width:none !important;
    max-height:none !important;
    transform:translate(-50%, -50%) !important;
    border:0 !important;
    margin:0 !important;
    padding:0 !important;
    display:block !important;
    background:#05070d !important;
  }

  .video-lightbox-backdrop{display:none !important;}

  /* keep clean TikTok-style controls above video */
  .video-player-top{
    position:absolute !important;
    top:calc(env(safe-area-inset-top) + 10px) !important;
    left:10px !important;
    right:70px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:8px !important;
    z-index:60 !important;
    pointer-events:none !important;
  }

  #videoNowPlayingChip,
  #videoCounter{
    height:22px !important;
    min-height:22px !important;
    padding:4px 8px !important;
    font-size:9px !important;
    line-height:1 !important;
    border-radius:999px !important;
    white-space:nowrap !important;
    max-width:120px !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }

  .video-lightbox-close{
    position:absolute !important;
    top:calc(env(safe-area-inset-top) + 8px) !important;
    right:10px !important;
    width:42px !important;
    height:42px !important;
    z-index:80 !important;
  }

  .video-volume-panel,
  #videoVolumePanel,
  .video-mobile-swipe-hint,
  #videoNextInlineBtn,
  .video-preview-strip,
  #videoPreviewStrip,
  .video-brand,
  .video-nav-btn-left::after,
  .video-nav-btn-right::after{
    display:none !important;
  }
}

/* === v17 mobile-only video controls auto-hide + true fit/no rounded crop === */
@media (max-width: 760px){
  .video-lightbox,
  .video-lightbox-dialog,
  .video-lightbox-stage,
  .video-lightbox-main{
    position:fixed !important;
    inset:0 !important;
    width:100vw !important;
    height:100dvh !important;
    max-width:none !important;
    max-height:none !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:#05070d !important;
    overflow:hidden !important;
  }

  .video-embed-wrap-modal{
    position:absolute !important;
    left:50% !important;
    top:50% !important;
    width:min(100vw, 56.25dvh) !important;
    height:min(100dvh, 177.78vw) !important;
    max-width:100vw !important;
    max-height:100dvh !important;
    transform:translate(-50%, -50%) !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:#05070d !important;
    overflow:visible !important;
    box-shadow:none !important;
  }

  #diVideoPlayer,
  .di-video-player,
  #diYoutubeMount,
  #diYoutubeMount iframe,
  .di-video-player iframe{
    position:absolute !important;
    inset:0 !important;
    left:0 !important;
    top:0 !important;
    width:100% !important;
    height:100% !important;
    min-width:0 !important;
    min-height:0 !important;
    max-width:100% !important;
    max-height:100% !important;
    transform:none !important;
    border:0 !important;
    border-radius:0 !important;
    margin:0 !important;
    padding:0 !important;
    display:block !important;
    background:#05070d !important;
    box-shadow:none !important;
  }

  .video-mobile-touch-layer{
    position:absolute !important;
    inset:0 !important;
    z-index:16 !important;
    background:transparent !important;
    touch-action:manipulation !important;
  }

  .video-player-top,
  .video-lightbox-close,
  .video-main-actions,
  .video-nav-btn{
    transition:opacity .22s ease, transform .22s ease, visibility .22s ease !important;
    opacity:1 !important;
    visibility:visible !important;
    pointer-events:auto !important;
  }

  .video-mobile-controls-hidden .video-player-top,
  .video-mobile-controls-hidden .video-lightbox-close,
  .video-mobile-controls-hidden .video-main-actions,
  .video-mobile-controls-hidden .video-nav-btn{
    opacity:0 !important;
    visibility:hidden !important;
    pointer-events:none !important;
  }

  .video-mobile-controls-hidden .video-player-top,
  .video-mobile-controls-hidden .video-lightbox-close{
    transform:translateY(-8px) !important;
  }

  .video-mobile-controls-hidden .video-main-actions,
  .video-mobile-controls-hidden .video-nav-btn{
    transform:translateY(8px) !important;
  }
}

/* === v18 mobile video theme + improved action icons (mobile only) === */
@media (max-width: 760px){
  :root{
    --video-ui-bg-light:#ffffff;
    --video-ui-fg-light:#111827;
    --video-ui-line-light:rgba(17,24,39,.14);
    --video-ui-card-light:rgba(255,255,255,.88);
    --video-ui-shadow-light:0 12px 28px rgba(15,23,42,.18);
    --video-ui-bg-dark:#05070d;
    --video-ui-fg-dark:#ffffff;
    --video-ui-line-dark:rgba(255,255,255,.18);
    --video-ui-card-dark:rgba(0,0,0,.52);
    --video-ui-shadow-dark:0 14px 30px rgba(0,0,0,.30);
  }

  /* Normal/light mode video tab stays white; dark mode stays black. */
  body:not([data-theme="dark"]) .video-lightbox,
  body:not([data-theme="dark"]) .video-lightbox-dialog,
  body:not([data-theme="dark"]) .video-lightbox-stage,
  body:not([data-theme="dark"]) .video-lightbox-main,
  body:not([data-theme="dark"]) .video-embed-wrap-modal,
  body:not([data-theme="dark"]) #diVideoPlayer,
  body:not([data-theme="dark"]) .di-video-player,
  body:not([data-theme="dark"]) #diYoutubeMount,
  body:not([data-theme="dark"]) #diYoutubeMount iframe,
  body:not([data-theme="dark"]) .di-video-player iframe{
    background:var(--video-ui-bg-light) !important;
  }

  body[data-theme="dark"] .video-lightbox,
  body[data-theme="dark"] .video-lightbox-dialog,
  body[data-theme="dark"] .video-lightbox-stage,
  body[data-theme="dark"] .video-lightbox-main,
  body[data-theme="dark"] .video-embed-wrap-modal,
  body[data-theme="dark"] #diVideoPlayer,
  body[data-theme="dark"] .di-video-player,
  body[data-theme="dark"] #diYoutubeMount,
  body[data-theme="dark"] #diYoutubeMount iframe,
  body[data-theme="dark"] .di-video-player iframe{
    background:var(--video-ui-bg-dark) !important;
  }

  /* Make top chips readable on both themes. */
  body:not([data-theme="dark"]) #videoNowPlayingChip,
  body:not([data-theme="dark"]) #videoCounter{
    background:var(--video-ui-card-light) !important;
    color:var(--video-ui-fg-light) !important;
    border-color:var(--video-ui-line-light) !important;
    box-shadow:var(--video-ui-shadow-light) !important;
    text-shadow:none !important;
  }
  body[data-theme="dark"] #videoNowPlayingChip,
  body[data-theme="dark"] #videoCounter{
    background:var(--video-ui-card-dark) !important;
    color:var(--video-ui-fg-dark) !important;
    border-color:var(--video-ui-line-dark) !important;
    box-shadow:var(--video-ui-shadow-dark) !important;
  }

  /* Improved rounded glass buttons. */
  .video-lightbox-close,
  .video-main-actions .secondary-btn,
  .video-main-actions .primary-btn,
  .video-nav-btn{
    font-size:0 !important;
    line-height:0 !important;
    display:grid !important;
    place-items:center !important;
  }
  body:not([data-theme="dark"]) .video-lightbox-close,
  body:not([data-theme="dark"]) .video-main-actions .secondary-btn,
  body:not([data-theme="dark"]) .video-main-actions .primary-btn,
  body:not([data-theme="dark"]) .video-nav-btn{
    background:var(--video-ui-card-light) !important;
    color:var(--video-ui-fg-light) !important;
    border-color:var(--video-ui-line-light) !important;
    box-shadow:var(--video-ui-shadow-light) !important;
  }
  body[data-theme="dark"] .video-lightbox-close,
  body[data-theme="dark"] .video-main-actions .secondary-btn,
  body[data-theme="dark"] .video-main-actions .primary-btn,
  body[data-theme="dark"] .video-nav-btn{
    background:var(--video-ui-card-dark) !important;
    color:var(--video-ui-fg-dark) !important;
    border-color:var(--video-ui-line-dark) !important;
    box-shadow:var(--video-ui-shadow-dark) !important;
  }

  /* Back icon: replace old X with clean arrow-left. */
  .video-lightbox-close{color:transparent !important; overflow:hidden !important;}
  .video-lightbox-close::before{
    content:'' !important;
    width:23px !important;
    height:23px !important;
    display:block !important;
    background:currentColor !important;
    color:inherit !important;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3Cpath d='M9 12h11'/%3E%3C/svg%3E") center/contain no-repeat !important;
            mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 18l-6-6 6-6'/%3E%3Cpath d='M9 12h11'/%3E%3C/svg%3E") center/contain no-repeat !important;
  }
  body:not([data-theme="dark"]) .video-lightbox-close::before{background:var(--video-ui-fg-light) !important;}
  body[data-theme="dark"] .video-lightbox-close::before{background:var(--video-ui-fg-dark) !important;}

  /* Mute/sound icon: replace emoji with crisp SVG icon. */
  #videoSoundToggleBtn::before,
  #videoSoundToggleBtn:not(.is-on)::before{
    content:'' !important;
    width:24px !important;
    height:24px !important;
    display:block !important;
    background:currentColor !important;
  }
  #videoSoundToggleBtn::before{
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4z'/%3E%3Cpath d='M16 8.5a5 5 0 010 7'/%3E%3Cpath d='M18.5 6a8.5 8.5 0 010 12'/%3E%3C/svg%3E") center/contain no-repeat !important;
            mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4z'/%3E%3Cpath d='M16 8.5a5 5 0 010 7'/%3E%3Cpath d='M18.5 6a8.5 8.5 0 010 12'/%3E%3C/svg%3E") center/contain no-repeat !important;
  }
  #videoSoundToggleBtn:not(.is-on)::before{
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4z'/%3E%3Cpath d='M18 9l4 4'/%3E%3Cpath d='M22 9l-4 4'/%3E%3C/svg%3E") center/contain no-repeat !important;
            mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4z'/%3E%3Cpath d='M18 9l4 4'/%3E%3Cpath d='M22 9l-4 4'/%3E%3C/svg%3E") center/contain no-repeat !important;
  }

  /* Menu icon: cleaner 3-line list instead of old square glyph. */
  #videoViewAllBtn::before{
    content:'' !important;
    width:24px !important;
    height:24px !important;
    display:block !important;
    background:currentColor !important;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M5 7h14'/%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M5 17h14'/%3E%3C/svg%3E") center/contain no-repeat !important;
            mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M5 7h14'/%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M5 17h14'/%3E%3C/svg%3E") center/contain no-repeat !important;
  }
  body:not([data-theme="dark"]) #videoSoundToggleBtn::before,
  body:not([data-theme="dark"]) #videoViewAllBtn::before{background:var(--video-ui-fg-light) !important;}
  body[data-theme="dark"] #videoSoundToggleBtn::before,
  body[data-theme="dark"] #videoViewAllBtn::before{background:var(--video-ui-fg-dark) !important;}

  /* Keep video title readable without forcing the whole tab black in light mode. */
  body:not([data-theme="dark"]) #diVideoTitle,
  body:not([data-theme="dark"]) #diVideoDesc{
    color:#ffffff !important;
    text-shadow:0 2px 18px rgba(0,0,0,.86) !important;
  }
}

/* v19 Word Bank audio layout + mobile lesson play fix */
.word-card .word-top{
  justify-content:space-between;
  align-items:flex-start;
}
.word-card .word-meta{
  min-width:0;
  flex:1;
}
.word-single-play{
  flex:0 0 auto;
  min-height:40px;
  padding:9px 13px;
  border-radius:14px;
  white-space:nowrap;
  font-size:13px;
  box-shadow:0 10px 18px rgba(47,109,246,.16);
}
.word-example{
  display:grid;
  gap:12px;
  border-radius:18px;
  padding:14px;
  background:rgba(47,109,246,.06);
  border:1px solid rgba(47,109,246,.12);
}
.word-example-lines{
  line-height:1.55;
}
.word-sentence-play{
  width:100%;
  min-height:50px;
  justify-content:center;
}
body[data-theme="dark"] .word-example{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.12);
}

@media (max-width:700px){
  .word-card .word-top{
    gap:10px;
    align-items:center;
  }
  .word-single-play{
    min-height:36px;
    padding:8px 10px;
    font-size:12px;
    border-radius:12px;
  }
  .word-sentence-play{
    min-height:46px;
    padding:12px 14px;
    font-size:14px;
  }
  .lesson-item-top{
    gap:8px;
    align-items:flex-start;
  }
  .lesson-word-play{
    min-width:0 !important;
    width:auto !important;
    flex:0 0 auto;
    padding:8px 10px !important;
    min-height:36px !important;
    border-radius:12px !important;
    font-size:12px !important;
    line-height:1 !important;
    white-space:nowrap;
    box-shadow:0 8px 16px rgba(47,109,246,.16) !important;
  }
  .lesson-name{
    min-width:0;
    flex:1 1 auto;
  }
  .lesson-name .emoji{
    width:42px;
    height:42px;
    border-radius:14px;
    font-size:22px;
    flex:0 0 auto;
  }
  .lesson-name h4{
    font-size:18px;
    overflow-wrap:anywhere;
  }
  .lesson-name p{
    font-size:13px;
    line-height:1.3;
  }
}

/* v19 Word Bank audio layout + mobile lesson play fix */
.word-card .word-top{
  justify-content:space-between;
  align-items:flex-start;
}
.word-card .word-meta{
  min-width:0;
  flex:1;
}
.word-single-play{
  flex:0 0 auto;
  min-height:40px;
  padding:9px 13px;
  border-radius:14px;
  white-space:nowrap;
  font-size:13px;
  box-shadow:0 10px 18px rgba(47,109,246,.16);
}
.word-example{
  display:grid;
  gap:12px;
  border-radius:18px;
  padding:14px;
  background:rgba(47,109,246,.06);
  border:1px solid rgba(47,109,246,.12);
}
.word-example-lines{
  line-height:1.55;
}
.word-sentence-play{
  width:100%;
  min-height:50px;
  justify-content:center;
}
body[data-theme="dark"] .word-example{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.12);
}

@media (max-width:700px){
  .word-card .word-top{
    gap:10px;
    align-items:center;
  }
  .word-single-play{
    min-height:36px;
    padding:8px 10px;
    font-size:12px;
    border-radius:12px;
  }
  .word-sentence-play{
    min-height:46px;
    padding:12px 14px;
    font-size:14px;
  }
  .lesson-item-top{
    gap:8px;
    align-items:flex-start;
  }
  .lesson-word-play{
    min-width:0 !important;
    width:auto !important;
    flex:0 0 auto;
    padding:8px 10px !important;
    min-height:36px !important;
    border-radius:12px !important;
    font-size:12px !important;
    line-height:1 !important;
    white-space:nowrap;
    box-shadow:0 8px 16px rgba(47,109,246,.16) !important;
  }
  .lesson-name{
    min-width:0;
    flex:1 1 auto;
  }
  .lesson-name .emoji{
    width:42px;
    height:42px;
    border-radius:14px;
    font-size:22px;
    flex:0 0 auto;
  }
  .lesson-name h4{
    font-size:18px;
    overflow-wrap:anywhere;
  }
  .lesson-name p{
    font-size:13px;
    line-height:1.3;
  }
}


/* v20 Word Bank label + mobile dark-mode contrast fixes */
@media (max-width:980px){
  body[data-theme="dark"]{
    --text:#f8fbff;
    --muted:#d2dcf0;
    --panel:#0d1a30;
    --line:rgba(160,190,255,.34);
    color:#f8fbff !important;
  }

  body[data-theme="dark"] .sidebar,
  body[data-theme="dark"] .topbar-v2,
  body[data-theme="dark"] .panel,
  body[data-theme="dark"] .panel-soft,
  body[data-theme="dark"] .home-card,
  body[data-theme="dark"] .word-card,
  body[data-theme="dark"] .phrase-card,
  body[data-theme="dark"] .grammar-card,
  body[data-theme="dark"] .lesson-item,
  body[data-theme="dark"] .story-card,
  body[data-theme="dark"] .extra-card,
  body[data-theme="dark"] .example-card,
  body[data-theme="dark"] .translator-box,
  body[data-theme="dark"] .community-post,
  body[data-theme="dark"] .community-thread-panel,
  body[data-theme="dark"] .progress-panel,
  body[data-theme="dark"] .video-side-card{
    background:linear-gradient(180deg,#101f38 0%,#081528 100%) !important;
    border-color:rgba(160,190,255,.36) !important;
    color:#f8fbff !important;
  }

  body[data-theme="dark"] .menu-item{
    background:linear-gradient(180deg,#132642 0%,#0b1830 100%) !important;
    border:1px solid rgba(160,190,255,.34) !important;
    color:#f8fbff !important;
  }
  body[data-theme="dark"] .menu-item.active,
  body[data-theme="dark"] .menu-item:hover{
    background:linear-gradient(180deg,#1b3760 0%,#102443 100%) !important;
    border-color:rgba(148,190,255,.72) !important;
  }

  body[data-theme="dark"] .brand h1,
  body[data-theme="dark"] .sidebar-title,
  body[data-theme="dark"] .menu-copy strong,
  body[data-theme="dark"] .menu-arrow,
  body[data-theme="dark"] .main-label,
  body[data-theme="dark"] h1,
  body[data-theme="dark"] h2,
  body[data-theme="dark"] h3,
  body[data-theme="dark"] h4,
  body[data-theme="dark"] .screen-title,
  body[data-theme="dark"] .section-head h2,
  body[data-theme="dark"] .lesson-banner h2,
  body[data-theme="dark"] .word-meta h3,
  body[data-theme="dark"] .phrase-texts h3,
  body[data-theme="dark"] .grammar-nav-btn strong,
  body[data-theme="dark"] .lesson-name h4,
  body[data-theme="dark"] .hero-title-text{
    color:#ffffff !important;
    text-shadow:0 1px 10px rgba(0,0,0,.22);
  }

  body[data-theme="dark"] .brand p,
  body[data-theme="dark"] .menu-copy small,
  body[data-theme="dark"] .small-label,
  body[data-theme="dark"] .section-head p,
  body[data-theme="dark"] .home-card p,
  body[data-theme="dark"] .word-meta p,
  body[data-theme="dark"] .phrase-translation,
  body[data-theme="dark"] .lesson-name p,
  body[data-theme="dark"] .grammar-nav-btn .mini,
  body[data-theme="dark"] .lesson-intro,
  body[data-theme="dark"] .detail-text,
  body[data-theme="dark"] .detail-summary,
  body[data-theme="dark"] .example-card p,
  body[data-theme="dark"] .grammar-section-card p,
  body[data-theme="dark"] .grammar-point p,
  body[data-theme="dark"] p,
  body[data-theme="dark"] .muted{
    color:#d2dcf0 !important;
  }

  body[data-theme="dark"] .tab-btn,
  body[data-theme="dark"] .jump-select,
  body[data-theme="dark"] .grammar-tab,
  body[data-theme="dark"] .lesson-nav-btn,
  body[data-theme="dark"] .grammar-nav-btn,
  body[data-theme="dark"] .secondary-btn,
  body[data-theme="dark"] .icon-btn,
  body[data-theme="dark"] .sidebar-close{
    background:#11233f !important;
    color:#f8fbff !important;
    border-color:rgba(160,190,255,.42) !important;
  }
  body[data-theme="dark"] .tab-btn.active,
  body[data-theme="dark"] .grammar-tab.active,
  body[data-theme="dark"] .lesson-nav-btn.active,
  body[data-theme="dark"] .grammar-nav-btn.active{
    background:linear-gradient(135deg,#3d76ff 0%,#2457e8 100%) !important;
    color:#ffffff !important;
    border-color:rgba(180,207,255,.78) !important;
  }

  body[data-theme="dark"] .word-pair,
  body[data-theme="dark"] .phrase-flag-pill,
  body[data-theme="dark"] .grammar-section-card,
  body[data-theme="dark"] .grammar-point,
  body[data-theme="dark"] .ex-box,
  body[data-theme="dark"] .story-it,
  body[data-theme="dark"] .story-en,
  body[data-theme="dark"] .word-example{
    color:#f8fbff !important;
    border-color:rgba(160,190,255,.28) !important;
  }

  body[data-theme="dark"] .flag-badge,
  body[data-theme="dark"] .menu-icon,
  body[data-theme="dark"] .word-emoji,
  body[data-theme="dark"] .lesson-name .emoji{
    filter:none !important;
  }
}

/* v21 mobile grammar overview dark contrast + compact portrait top heading */
@media (max-width:980px){
  body[data-theme="dark"] .overview-feature,
  body[data-theme="dark"] .overview-feature.blue,
  body[data-theme="dark"] .overview-feature.pink,
  body[data-theme="dark"] .overview-feature.green,
  body[data-theme="dark"] .overview-feature.orange{
    background:linear-gradient(180deg,#162b4d 0%,#0b1b33 100%) !important;
    border-color:rgba(160,190,255,.40) !important;
    color:#f8fbff !important;
    box-shadow:0 14px 28px rgba(0,0,0,.22) !important;
  }
  body[data-theme="dark"] .overview-feature strong,
  body[data-theme="dark"] .overview-feature span{
    color:#f8fbff !important;
    text-shadow:0 1px 8px rgba(0,0,0,.24);
  }
  body[data-theme="dark"] .overview-feature .overview-icon{
    color:#93c5fd !important;
    text-shadow:0 2px 12px rgba(0,0,0,.35);
  }
  body[data-theme="dark"] .overview-feature.pink .overview-icon{color:#f9a8d4 !important;}
  body[data-theme="dark"] .overview-feature.green .overview-icon{color:#86efac !important;}
  body[data-theme="dark"] .overview-feature.orange .overview-icon{color:#fdba74 !important;}

  body[data-theme="dark"] #grammarFocusNote{
    background:#0b1b33 !important;
    border-color:rgba(160,190,255,.40) !important;
  }
  body[data-theme="dark"] #grammarFocusNote .focus-pill{
    background:linear-gradient(180deg,#162b4d 0%,#0b1b33 100%) !important;
    border-color:rgba(160,190,255,.30) !important;
    color:#f8fbff !important;
  }
  body[data-theme="dark"] #grammarFocusNote .focus-pill strong{color:#ffffff !important;}
  body[data-theme="dark"] #grammarFocusNote .focus-pill small{color:#d2dcf0 !important;}
  body[data-theme="dark"] #grammarFocusNote .focus-emoji{
    background:rgba(255,255,255,.12) !important;
    color:#ffffff !important;
  }
}

@media (max-width:700px) and (orientation:portrait){
  .topbar > div:not(.topbar-actions){min-width:0 !important;}
  .main-label{
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:clip !important;
    max-width:calc(100vw - 150px) !important;
  }
}
@media (max-width:900px) and (orientation:landscape){
  .main-label{
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:unset !important;
    max-width:none !important;
  }
}

/* v22: account icon turns green only when user is logged in (desktop + mobile) */
.auth-open-icon-btn.is-logged-in,
.auth-open-icon-btn[data-auth-state="logged-in"]{
  background:linear-gradient(180deg,#31c768 0%,#138a3d 100%) !important;
  border-color:rgba(19,138,61,.35) !important;
  box-shadow:0 12px 24px rgba(19,138,61,.22) !important;
}
.auth-open-icon-btn.is-guest,
.auth-open-icon-btn[data-auth-state="guest"]{
  background:linear-gradient(180deg,#4a95ec 0%,#2f6fd7 100%) !important;
  border-color:rgba(55,110,196,.22) !important;
  box-shadow:0 12px 24px rgba(41,101,198,.22) !important;
}
.auth-open-icon-btn.is-logged-in .account-avatar-icon::before,
.auth-open-icon-btn.is-logged-in .account-avatar-icon::after,
.auth-open-icon-btn[data-auth-state="logged-in"] .account-avatar-icon::before,
.auth-open-icon-btn[data-auth-state="logged-in"] .account-avatar-icon::after,
.auth-open-icon-btn.is-guest .account-avatar-icon::before,
.auth-open-icon-btn.is-guest .account-avatar-icon::after,
.auth-open-icon-btn[data-auth-state="guest"] .account-avatar-icon::before,
.auth-open-icon-btn[data-auth-state="guest"] .account-avatar-icon::after{
  background:#ffffff !important;
}

/* === v23 mobile polish pack: header, dock, cards, dark contrast, landscape === */
@media (max-width:980px){
  html,body{max-width:100% !important;overflow-x:hidden !important;}
  body{font-size:15px !important;-webkit-text-size-adjust:100%;}

  /* Compact, cleaner mobile header */
  .topbar,
  .topbar-v2,
  .section-focused .topbar-v2{
    min-height:58px !important;
    padding:9px 10px !important;
    gap:8px !important;
    align-items:center !important;
    border-radius:0 0 18px 18px !important;
  }
  .topbar > div:not(.topbar-actions){
    min-width:0 !important;
    flex:1 1 auto !important;
  }
  .main-label{
    font-size:15px !important;
    line-height:1.18 !important;
    font-weight:900 !important;
    letter-spacing:-.02em !important;
  }
  .small-label{
    font-size:10px !important;
    line-height:1.1 !important;
    letter-spacing:.08em !important;
  }
  .topbar-actions{
    gap:7px !important;
    flex:0 0 auto !important;
    align-items:center !important;
  }
  #menuToggle,
  .topbar .icon-btn,
  .topbar-v2 .icon-btn,
  .auth-open-icon-btn,
  .theme-toggle,
  .sidebar-close{
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    min-height:42px !important;
    border-radius:14px !important;
    display:grid !important;
    place-items:center !important;
    padding:0 !important;
    line-height:1 !important;
  }
  .auth-open-icon-btn .account-avatar-icon{width:27px !important;height:27px !important;}
  .auth-open-icon-btn .account-avatar-icon::before{width:12px !important;height:12px !important;}
  .auth-open-icon-btn .account-avatar-icon::after{width:21px !important;height:12px !important;}

  /* Better mobile content rhythm */
  .content{padding:10px 10px calc(88px + env(safe-area-inset-bottom)) !important;}
  .screen{gap:12px !important;}
  .section-head,
  .lesson-banner,
  .grammar-banner,
  .story-banner{
    padding:16px 14px !important;
    border-radius:20px !important;
  }
  .section-head h2,
  .lesson-banner h2,
  .grammar-banner h2,
  .story-banner h2{
    font-size:clamp(22px,6.1vw,30px) !important;
    line-height:1.08 !important;
    letter-spacing:-.04em !important;
  }
  .section-head p,
  .lesson-banner p,
  .grammar-banner p,
  .story-banner p{
    font-size:14px !important;
    line-height:1.45 !important;
  }
  .panel,
  .panel-soft,
  .home-card,
  .stat,
  .word-card,
  .phrase-card,
  .lesson-card,
  .lesson-item,
  .story-stage,
  .story-part,
  .grammar-card,
  .grammar-section-card,
  .grammar-point,
  .overview-feature,
  .example-card,
  .practice-card,
  .progress-card,
  .translator-panel,
  .translator-result,
  .translator-examples,
  .community-shell,
  .feed-card,
  .post-card{
    border-radius:20px !important;
    padding:14px !important;
  }
  .home-card h3,
  .word-meta h3,
  .phrase-texts h3,
  .lesson-name h4,
  .grammar-section-card h3,
  .grammar-point h4,
  .overview-feature strong{
    font-size:clamp(18px,5.1vw,24px) !important;
    line-height:1.12 !important;
    letter-spacing:-.03em !important;
  }
  .home-card p,
  .word-meta p,
  .phrase-translation,
  .lesson-name p,
  .grammar-section-card p,
  .grammar-point p,
  .example-card p,
  .overview-feature span,
  .detail-text,
  .detail-summary{
    font-size:14px !important;
    line-height:1.45 !important;
  }
  .primary-btn,
  .secondary-btn,
  .story-control,
  .story-control-btn,
  .lesson-play-btn,
  .sound-btn,
  .word-play-btn,
  .sentence-play-btn,
  .toolbar .primary-btn,
  .toolbar .secondary-btn{
    min-height:46px !important;
    border-radius:16px !important;
    font-size:14px !important;
    font-weight:900 !important;
  }
  .lesson-toolbar,
  .toolbar,
  .story-control-bar,
  .practice-next-row,
  .translator-box,
  .auth-dock{
    gap:8px !important;
  }

  /* Polished bottom navigation */
  .mobile-dock{
    left:9px !important;
    right:9px !important;
    bottom:calc(8px + env(safe-area-inset-bottom)) !important;
    padding:7px !important;
    gap:5px !important;
    border-radius:22px !important;
    grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  }
  .mobile-dock-item{
    min-height:52px !important;
    border-radius:17px !important;
    gap:3px !important;
    color:#38506b !important;
    font-weight:900 !important;
    letter-spacing:-.01em !important;
  }
  .mobile-dock-item span{
    font-size:19px !important;
    width:24px !important;
    height:24px !important;
    display:grid !important;
    place-items:center !important;
    line-height:1 !important;
  }
  .mobile-dock-item small{
    font-size:10.5px !important;
    line-height:1 !important;
    max-width:100% !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }
  .mobile-dock-item.active{
    background:linear-gradient(180deg,#e8f1ff 0%,#f7fbff 100%) !important;
    color:#1555bf !important;
    box-shadow:inset 0 0 0 1px rgba(57,111,235,.18),0 8px 16px rgba(29,78,216,.12) !important;
  }
  .mobile-dock-item.active span{
    transform:translateY(-1px) !important;
  }

  /* Make the slide-out menu headings and items easier to scan */
  .sidebar{padding:14px 12px 98px !important;}
  .brand{gap:9px !important;margin-bottom:10px !important;}
  .brand-logo{width:44px !important;height:44px !important;border-radius:15px !important;}
  .brand h1{font-size:17px !important;line-height:1.1 !important;}
  .brand p{font-size:11.5px !important;line-height:1.3 !important;}
  .sidebar-title{font-size:12px !important;line-height:1.2 !important;margin:8px 4px 10px !important;}
  .menu.menu-v2{gap:8px !important;}
  .menu-item{min-height:60px !important;padding:11px 12px !important;border-radius:18px !important;}
  .menu-copy strong{font-size:14.5px !important;line-height:1.15 !important;}
  .menu-copy small{font-size:11.5px !important;line-height:1.28 !important;}
  .menu-icon{width:38px !important;height:38px !important;min-width:38px !important;border-radius:14px !important;}
  .menu-arrow{font-size:21px !important;}
}

@media (max-width:980px) and (max-height:740px){
  .mobile-dock{padding:6px !important;border-radius:20px !important;}
  .mobile-dock-item{min-height:47px !important;}
  .mobile-dock-item span{font-size:18px !important;width:22px !important;height:22px !important;}
  .mobile-dock-item small{font-size:9.8px !important;}
  .content{padding-bottom:calc(78px + env(safe-area-inset-bottom)) !important;}
}

/* v23 mobile dark-mode readability audit */
@media (max-width:980px){
  body[data-theme="dark"]{
    background:#061122 !important;
    color:#f8fbff !important;
    --text:#f8fbff !important;
    --muted:#d8e4f7 !important;
    --panel:#0f2038 !important;
    --panel-2:#09182d !important;
    --line:rgba(160,190,255,.38) !important;
  }
  body[data-theme="dark"] .content,
  body[data-theme="dark"] .app-shell{
    background:#061122 !important;
  }
  body[data-theme="dark"] .topbar,
  body[data-theme="dark"] .topbar-v2,
  body[data-theme="dark"] .section-focused .topbar-v2{
    background:rgba(8,20,39,.96) !important;
    border:1px solid rgba(160,190,255,.22) !important;
    border-top:none !important;
    box-shadow:0 12px 30px rgba(0,0,0,.34) !important;
  }
  body[data-theme="dark"] .sidebar{
    background:linear-gradient(180deg,#0d1d36 0%,#061224 100%) !important;
    color:#f8fbff !important;
  }
  body[data-theme="dark"] .mobile-backdrop{background:rgba(0,0,0,.58) !important;}
  body[data-theme="dark"] .mobile-dock{
    background:rgba(7,18,35,.97) !important;
    border-color:rgba(160,190,255,.28) !important;
    box-shadow:0 18px 42px rgba(0,0,0,.42),inset 0 1px 0 rgba(255,255,255,.05) !important;
  }
  body[data-theme="dark"] .mobile-dock-item{
    color:#d7e5fb !important;
  }
  body[data-theme="dark"] .mobile-dock-item.active,
  body[data-theme="dark"] .mobile-dock-item:active{
    background:linear-gradient(180deg,#1d5ce8 0%,#113b9f 100%) !important;
    color:#ffffff !important;
    box-shadow:0 10px 22px rgba(29,92,232,.26),inset 0 0 0 1px rgba(225,238,255,.16) !important;
  }
  body[data-theme="dark"] .mobile-dock-menu{color:#eaf2ff !important;}

  body[data-theme="dark"] .panel,
  body[data-theme="dark"] .panel-soft,
  body[data-theme="dark"] .home-card,
  body[data-theme="dark"] .stat,
  body[data-theme="dark"] .word-card,
  body[data-theme="dark"] .phrase-card,
  body[data-theme="dark"] .lesson-card,
  body[data-theme="dark"] .lesson-item,
  body[data-theme="dark"] .story-stage,
  body[data-theme="dark"] .story-part,
  body[data-theme="dark"] .grammar-card,
  body[data-theme="dark"] .grammar-section-card,
  body[data-theme="dark"] .grammar-point,
  body[data-theme="dark"] .overview-feature,
  body[data-theme="dark"] .example-card,
  body[data-theme="dark"] .practice-card,
  body[data-theme="dark"] .progress-card,
  body[data-theme="dark"] .progress-panel,
  body[data-theme="dark"] .translator-panel,
  body[data-theme="dark"] .translator-result,
  body[data-theme="dark"] .translator-examples,
  body[data-theme="dark"] .community-shell,
  body[data-theme="dark"] .feed-card,
  body[data-theme="dark"] .post-card,
  body[data-theme="dark"] .community-post,
  body[data-theme="dark"] .community-thread-panel,
  body[data-theme="dark"] .video-side-card,
  body[data-theme="dark"] .sidebar-box,
  body[data-theme="dark"] .auth-card,
  body[data-theme="dark"] .modal-card{
    background:linear-gradient(180deg,#10213b 0%,#08182d 100%) !important;
    border-color:rgba(160,190,255,.34) !important;
    color:#f8fbff !important;
    box-shadow:0 14px 28px rgba(0,0,0,.24) !important;
  }
  body[data-theme="dark"] .section-head,
  body[data-theme="dark"] .lesson-banner,
  body[data-theme="dark"] .grammar-banner,
  body[data-theme="dark"] .story-banner{
    background:linear-gradient(135deg,#16315a 0%,#0a1b35 100%) !important;
    border-color:rgba(160,190,255,.34) !important;
    color:#ffffff !important;
  }
  body[data-theme="dark"] .menu-item{
    background:linear-gradient(180deg,#132846 0%,#0a1a31 100%) !important;
    border-color:rgba(160,190,255,.32) !important;
    color:#f8fbff !important;
  }
  body[data-theme="dark"] .menu-item.active,
  body[data-theme="dark"] .menu-item:active{
    background:linear-gradient(180deg,#1c58d9 0%,#103a96 100%) !important;
    border-color:rgba(214,231,255,.55) !important;
    color:#ffffff !important;
  }

  body[data-theme="dark"] h1,
  body[data-theme="dark"] h2,
  body[data-theme="dark"] h3,
  body[data-theme="dark"] h4,
  body[data-theme="dark"] h5,
  body[data-theme="dark"] h6,
  body[data-theme="dark"] .main-label,
  body[data-theme="dark"] .brand h1,
  body[data-theme="dark"] .sidebar-title,
  body[data-theme="dark"] .menu-copy strong,
  body[data-theme="dark"] .menu-arrow,
  body[data-theme="dark"] .screen-title,
  body[data-theme="dark"] .section-head h2,
  body[data-theme="dark"] .lesson-banner h2,
  body[data-theme="dark"] .grammar-banner h2,
  body[data-theme="dark"] .story-banner h2,
  body[data-theme="dark"] .word-meta h3,
  body[data-theme="dark"] .phrase-texts h3,
  body[data-theme="dark"] .lesson-name h4,
  body[data-theme="dark"] .grammar-nav-btn strong,
  body[data-theme="dark"] .overview-feature strong,
  body[data-theme="dark"] .grammar-section-card h3,
  body[data-theme="dark"] .grammar-point h4,
  body[data-theme="dark"] .example-card h4,
  body[data-theme="dark"] .hero-title-text{
    color:#ffffff !important;
    opacity:1 !important;
    text-shadow:0 1px 8px rgba(0,0,0,.25) !important;
  }
  body[data-theme="dark"] p,
  body[data-theme="dark"] small,
  body[data-theme="dark"] label,
  body[data-theme="dark"] .small-label,
  body[data-theme="dark"] .brand p,
  body[data-theme="dark"] .menu-copy small,
  body[data-theme="dark"] .section-head p,
  body[data-theme="dark"] .home-card p,
  body[data-theme="dark"] .word-meta p,
  body[data-theme="dark"] .phrase-translation,
  body[data-theme="dark"] .lesson-name p,
  body[data-theme="dark"] .grammar-section-card p,
  body[data-theme="dark"] .grammar-point p,
  body[data-theme="dark"] .overview-feature span,
  body[data-theme="dark"] .example-card p,
  body[data-theme="dark"] .lesson-intro,
  body[data-theme="dark"] .detail-text,
  body[data-theme="dark"] .detail-summary,
  body[data-theme="dark"] .muted,
  body[data-theme="dark"] .mini,
  body[data-theme="dark"] .subtext{
    color:#d8e4f7 !important;
    opacity:1 !important;
  }
  body[data-theme="dark"] a{color:#9cc4ff !important;}
  body[data-theme="dark"] strong{color:#ffffff !important;}
  body[data-theme="dark"] .chip,
  body[data-theme="dark"] .tag,
  body[data-theme="dark"] .pill,
  body[data-theme="dark"] .badge,
  body[data-theme="dark"] .focus-pill,
  body[data-theme="dark"] .word-pair,
  body[data-theme="dark"] .word-example,
  body[data-theme="dark"] .phrase-flag-pill,
  body[data-theme="dark"] .ex-box,
  body[data-theme="dark"] .story-it,
  body[data-theme="dark"] .story-en,
  body[data-theme="dark"] .grammar-tab,
  body[data-theme="dark"] .lesson-nav-btn,
  body[data-theme="dark"] .tab-btn,
  body[data-theme="dark"] .jump-select,
  body[data-theme="dark"] .horizontal-only-tab,
  body[data-theme="dark"] .exercise-part-tab{
    background:#10233f !important;
    border-color:rgba(160,190,255,.34) !important;
    color:#f8fbff !important;
  }
  body[data-theme="dark"] .chip small,
  body[data-theme="dark"] .tag small,
  body[data-theme="dark"] .pill small,
  body[data-theme="dark"] .badge small{color:#d8e4f7 !important;}
  body[data-theme="dark"] .grammar-tab.active,
  body[data-theme="dark"] .lesson-nav-btn.active,
  body[data-theme="dark"] .tab-btn.active,
  body[data-theme="dark"] .horizontal-only-tab.active,
  body[data-theme="dark"] .exercise-part-tab.active{
    background:linear-gradient(135deg,#3d76ff 0%,#2054db 100%) !important;
    border-color:rgba(214,231,255,.62) !important;
    color:#ffffff !important;
  }
  body[data-theme="dark"] input,
  body[data-theme="dark"] textarea,
  body[data-theme="dark"] select,
  body[data-theme="dark"] .translator-box input,
  body[data-theme="dark"] .community-compose textarea,
  body[data-theme="dark"] .community-compose input{
    background:#08182d !important;
    border-color:rgba(160,190,255,.38) !important;
    color:#ffffff !important;
  }
  body[data-theme="dark"] input::placeholder,
  body[data-theme="dark"] textarea::placeholder{color:#aebfe0 !important;opacity:1 !important;}
  body[data-theme="dark"] .primary-btn,
  body[data-theme="dark"] .word-play-btn,
  body[data-theme="dark"] .sentence-play-btn,
  body[data-theme="dark"] .sound-btn,
  body[data-theme="dark"] .lesson-play-btn{
    color:#ffffff !important;
    border-color:rgba(214,231,255,.22) !important;
  }
  body[data-theme="dark"] .secondary-btn,
  body[data-theme="dark"] .icon-btn,
  body[data-theme="dark"] #menuToggle,
  body[data-theme="dark"] .sidebar-close,
  body[data-theme="dark"] .theme-toggle{
    background:#10233f !important;
    border-color:rgba(160,190,255,.34) !important;
    color:#f8fbff !important;
  }
}

@media (max-width:900px) and (orientation:landscape){
  .content{padding:8px 10px calc(70px + env(safe-area-inset-bottom)) !important;}
  .topbar,
  .topbar-v2,
  .section-focused .topbar-v2{
    min-height:50px !important;
    padding:7px 10px !important;
    border-radius:0 0 16px 16px !important;
  }
  #menuToggle,
  .topbar .icon-btn,
  .topbar-v2 .icon-btn,
  .auth-open-icon-btn,
  .theme-toggle,
  .sidebar-close{
    width:38px !important;
    height:38px !important;
    min-width:38px !important;
    min-height:38px !important;
  }
  .main-label{font-size:14px !important;white-space:normal !important;max-width:none !important;overflow:visible !important;text-overflow:unset !important;}
  .mobile-dock{left:12vw !important;right:12vw !important;padding:6px !important;bottom:calc(6px + env(safe-area-inset-bottom)) !important;}
  .mobile-dock-item{min-height:44px !important;grid-template-columns:auto auto !important;display:flex !important;align-items:center !important;justify-content:center !important;gap:5px !important;}
  .mobile-dock-item span{font-size:17px !important;width:21px !important;height:21px !important;}
  .mobile-dock-item small{font-size:10px !important;display:block !important;}
  .home-card-grid,
  .home-card-grid-upgraded,
  .wordbank-preview-cards,
  .grammar-demo-posts,
  .stats,
  .overview-feature-grid,
  .grammar-examples-grid,
  .grammar-points,
  .phrase-flag-row,
  .translator-result-grid,
  .result-grid,
  .options-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
  .section-head,
  .lesson-banner,
  .grammar-banner,
  .story-banner,
  .panel,
  .panel-soft,
  .home-card,
  .stat,
  .word-card,
  .phrase-card,
  .lesson-card,
  .lesson-item,
  .story-stage,
  .story-part,
  .grammar-card,
  .grammar-section-card,
  .grammar-point,
  .overview-feature,
  .example-card,
  .practice-card,
  .progress-card,
  .translator-panel,
  .translator-result,
  .translator-examples,
  .community-shell,
  .feed-card,
  .post-card{padding:12px !important;border-radius:18px !important;}
}

@media (max-width:380px){
  .mobile-dock-item small{display:none !important;}
  .mobile-dock-item{min-height:46px !important;}
  .mobile-dock{grid-template-columns:repeat(5,1fr) !important;}
  .topbar-actions{gap:5px !important;}
  #menuToggle,
  .topbar .icon-btn,
  .topbar-v2 .icon-btn,
  .auth-open-icon-btn,
  .theme-toggle{width:39px !important;height:39px !important;min-width:39px !important;min-height:39px !important;}
  .main-label{font-size:14px !important;max-width:calc(100vw - 136px) !important;}
}

/* v24 mobile usability polish: touch targets, audio buttons, safe areas, lesson readability */
:is(.play-btn,.phrase-play,.mini-sound-btn,.compact-play-btn,.video-sound-btn,.story-control,.story-mini-btn){
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:7px !important;
  min-height:42px !important;
  line-height:1.1 !important;
  white-space:nowrap !important;
  touch-action:manipulation !important;
  -webkit-tap-highlight-color:transparent !important;
}
.mini-sound-btn,
.word-single-play,
.word-sentence-play,
.lesson-sentence-play{
  border-radius:999px !important;
  font-weight:900 !important;
}
.word-sentence-play,
.lesson-sentence-play{
  box-shadow:0 12px 22px rgba(52,97,255,.16) !important;
}
:is(.primary-btn,.secondary-btn,.tab-btn,.lesson-nav-btn,.grammar-nav-btn,.grammar-tab,.horizontal-only-tab,.exercise-part-tab,.icon-btn,#menuToggle,.sidebar-close,.theme-toggle,.mobile-dock-item){
  touch-action:manipulation !important;
  -webkit-tap-highlight-color:transparent !important;
}
:is(.primary-btn,.secondary-btn,.tab-btn,.lesson-nav-btn,.grammar-nav-btn,.grammar-tab,.horizontal-only-tab,.exercise-part-tab,.icon-btn,#menuToggle,.sidebar-close,.theme-toggle,.mobile-dock-item):active,
:is(.play-btn,.phrase-play,.mini-sound-btn,.compact-play-btn,.video-sound-btn,.story-control,.story-mini-btn):active{
  transform:scale(.98) !important;
}

@media (max-width:980px){
  html,body{overflow-x:hidden !important;}
  .app-shell{min-height:100dvh !important;}
  .content{
    padding-left:max(12px, env(safe-area-inset-left)) !important;
    padding-right:max(12px, env(safe-area-inset-right)) !important;
    padding-bottom:calc(104px + env(safe-area-inset-bottom)) !important;
  }
  .topbar,
  .topbar-v2,
  .section-focused .topbar-v2{
    padding-top:calc(9px + env(safe-area-inset-top)) !important;
    padding-left:max(10px, env(safe-area-inset-left)) !important;
    padding-right:max(10px, env(safe-area-inset-right)) !important;
    min-height:calc(56px + env(safe-area-inset-top)) !important;
  }
  .sidebar{
    padding-top:calc(14px + env(safe-area-inset-top)) !important;
    padding-left:max(12px, env(safe-area-inset-left)) !important;
    padding-right:max(12px, env(safe-area-inset-right)) !important;
    padding-bottom:calc(112px + env(safe-area-inset-bottom)) !important;
  }
  .mobile-dock{
    left:max(9px, env(safe-area-inset-left)) !important;
    right:max(9px, env(safe-area-inset-right)) !important;
    bottom:calc(8px + env(safe-area-inset-bottom)) !important;
  }

  :is(.primary-btn,.secondary-btn,.tab-btn,.lesson-nav-btn,.grammar-nav-btn,.grammar-tab,.horizontal-only-tab,.exercise-part-tab,.play-btn,.phrase-play,.mini-sound-btn,.compact-play-btn,.video-sound-btn,.story-control,.story-mini-btn){
    min-height:44px !important;
    min-width:44px !important;
  }
  :is(.icon-btn,#menuToggle,.sidebar-close,.theme-toggle,.auth-open-icon-btn,.topbar .icon-btn,.topbar-v2 .icon-btn){
    width:44px !important;
    height:44px !important;
    min-width:44px !important;
    min-height:44px !important;
    display:inline-grid !important;
    place-items:center !important;
  }

  :is(.word-single-play,.word-sentence-play,.lesson-word-play,.lesson-sentence-play,.mini-sound-btn,.phrase-play,.story-mini-btn,.compact-play-btn){
    min-height:44px !important;
    padding:10px 14px !important;
    border-radius:999px !important;
    font-size:13px !important;
    letter-spacing:-.01em !important;
    box-shadow:0 10px 20px rgba(52,97,255,.14) !important;
  }
  .word-single-play{margin-top:0 !important;align-self:start !important;}
  .word-sentence-play{width:100% !important;margin-top:10px !important;}
  .word-example{display:grid !important;gap:10px !important;}
  .word-example-lines{line-height:1.65 !important;overflow-wrap:anywhere !important;}
  .ex-head{display:flex !important;align-items:center !important;justify-content:space-between !important;gap:8px !important;flex-wrap:wrap !important;}
  .lesson-sentence-play{margin-left:0 !important;}

  .lesson-layout{grid-template-columns:1fr !important;gap:12px !important;}
  .lesson-sidebar{gap:8px !important;}
  .lesson-item{
    gap:14px !important;
    padding:16px !important;
    border-radius:22px !important;
  }
  .lesson-item-top{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    gap:12px !important;
    align-items:start !important;
    padding-bottom:10px !important;
  }
  .lesson-name{min-width:0 !important;align-items:flex-start !important;}
  .lesson-name .emoji{
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    border-radius:14px !important;
    font-size:22px !important;
  }
  .lesson-name h4{
    font-size:clamp(18px,5vw,22px) !important;
    line-height:1.24 !important;
    letter-spacing:-.02em !important;
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
  }
  .lesson-name p{
    font-size:14px !important;
    line-height:1.5 !important;
    overflow-wrap:anywhere !important;
  }
  .lesson-word-play{
    min-width:74px !important;
    height:44px !important;
    padding:0 12px !important;
    font-size:13px !important;
  }
  .lesson-chip-row{gap:7px !important;}
  .lesson-chip{font-size:11.5px !important;padding:8px 10px !important;}
  .lesson-example{grid-template-columns:1fr !important;gap:10px !important;}
  .ex-box,
  .story-it,
  .story-en{
    padding:13px 14px !important;
    line-height:1.68 !important;
    font-size:14.5px !important;
    border-radius:18px !important;
  }
  .ex-line{
    line-height:1.7 !important;
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
  }

  body[data-theme="dark"] :is(.word-single-play,.word-sentence-play,.lesson-word-play,.lesson-sentence-play,.mini-sound-btn,.phrase-play,.story-mini-btn,.compact-play-btn){
    background:linear-gradient(135deg,#2f6dff 0%,#1849ca 100%) !important;
    color:#ffffff !important;
    border:1px solid rgba(214,231,255,.28) !important;
    box-shadow:0 12px 24px rgba(0,0,0,.28) !important;
  }
  body[data-theme="dark"] .ex-box,
  body[data-theme="dark"] .word-example,
  body[data-theme="dark"] .word-pair,
  body[data-theme="dark"] .lesson-chip{
    background:#10233f !important;
    color:#f8fbff !important;
    border-color:rgba(160,190,255,.34) !important;
  }
}

@media (max-width:560px){
  .word-top{
    display:grid !important;
    grid-template-columns:auto minmax(0,1fr) auto !important;
    gap:10px !important;
    align-items:start !important;
  }
  .word-emoji{
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    border-radius:14px !important;
    font-size:22px !important;
  }
  .word-meta{min-width:0 !important;}
  .word-meta h3{overflow-wrap:anywhere !important;word-break:break-word !important;}
  .word-single-play{padding:8px 12px !important;font-size:12.5px !important;min-height:42px !important;}
  .lesson-item-top{grid-template-columns:minmax(0,1fr) auto !important;}
  .lesson-word-play{min-width:64px !important;font-size:12.5px !important;}
  .lesson-sentence-play{width:100% !important;margin-top:4px !important;}
  .ex-head{display:grid !important;grid-template-columns:1fr !important;align-items:start !important;}
}

@media (max-width:380px){
  .content{padding-left:10px !important;padding-right:10px !important;}
  .lesson-item{padding:13px !important;}
  .lesson-item-top{gap:8px !important;}
  .lesson-name{gap:8px !important;}
  .lesson-name .emoji{width:38px !important;height:38px !important;min-width:38px !important;font-size:20px !important;}
  .lesson-word-play{min-width:58px !important;padding:0 10px !important;}
}

/* v25 mobile bottom dock auto-hide on scroll */
@media (max-width:980px){
  .mobile-dock{
    transition:transform .24s ease, opacity .20s ease, filter .20s ease !important;
    will-change:transform, opacity !important;
  }
  body.compact-mobile-dock:not(.mobile-dock-hidden) .mobile-dock{
    display:grid !important;
  }
  body.mobile-dock-hidden:not(.menu-open) .mobile-dock{
    transform:translate3d(0, calc(125% + env(safe-area-inset-bottom)), 0) !important;
    opacity:0 !important;
    pointer-events:none !important;
    filter:blur(1px) !important;
  }
  body.menu-open .mobile-dock,
  body.mobile-dock-force-visible .mobile-dock{
    transform:translate3d(0,0,0) !important;
    opacity:1 !important;
    pointer-events:auto !important;
    filter:none !important;
  }
}
@media (prefers-reduced-motion: reduce){
  .mobile-dock{transition:none !important;}
}

/* v26 connection problem message: mobile + desktop */
.di-connection-banner{
  position:fixed;
  left:50%;
  top:calc(14px + env(safe-area-inset-top));
  transform:translate3d(-50%,-130%,0);
  z-index:9999;
  width:min(560px, calc(100vw - 28px));
  pointer-events:none;
  opacity:0;
  transition:transform .24s ease, opacity .22s ease;
}
.di-connection-banner.is-visible{
  transform:translate3d(-50%,0,0);
  opacity:1;
  pointer-events:auto;
}
.di-connection-card{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 14px;
  border-radius:18px;
  background:rgba(255,255,255,.96);
  color:#172033;
  border:1px solid rgba(228,184,42,.48);
  box-shadow:0 16px 36px rgba(14,24,44,.18);
  backdrop-filter:blur(14px);
  font-weight:900;
  line-height:1.25;
}
.di-connection-icon{font-size:18px;line-height:1;}
.di-connection-text{min-width:0;}
.di-connection-retry{
  border:0;
  border-radius:999px;
  padding:8px 12px;
  background:#2563eb;
  color:#fff;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}
.di-connection-retry:active{transform:scale(.97);}
body[data-theme="dark"] .di-connection-card{
  background:rgba(17,24,39,.96);
  color:#f8fafc;
  border-color:rgba(250,204,21,.42);
  box-shadow:0 18px 42px rgba(0,0,0,.42);
}
body[data-theme="dark"] .di-connection-retry{background:#22c55e;color:#06220f;}

/* v26 pull-to-refresh: mobile only */
.di-pull-refresh{
  position:fixed;
  left:50%;
  top:calc(10px + env(safe-area-inset-top));
  transform:translate3d(-50%, calc(-115% + var(--pull-y, 0px)), 0) scale(.96);
  z-index:9998;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
}
.di-pull-active .di-pull-refresh{
  opacity:1;
  transform:translate3d(-50%, calc(-58% + var(--pull-y, 0px)), 0) scale(1);
}
.di-pull-refresh-card{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:42px;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(255,255,255,.96);
  border:1px solid rgba(15,23,42,.08);
  box-shadow:0 14px 34px rgba(14,24,44,.18);
  color:#172033;
  font-size:13px;
  font-weight:900;
  backdrop-filter:blur(14px);
}
.di-pull-refresh-spinner{
  width:24px;
  height:24px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:#eef5ff;
  color:#2563eb;
  font-size:17px;
  line-height:1;
  transition:transform .18s ease, background .18s ease, color .18s ease;
}
.di-pull-refresh.is-ready .di-pull-refresh-spinner,
.di-pull-refresh.is-refreshing .di-pull-refresh-spinner{
  background:#dcfce7;
  color:#15803d;
}
.di-pull-refresh.is-refreshing .di-pull-refresh-spinner{
  animation:diPullSpin .68s linear infinite;
}
@keyframes diPullSpin{to{transform:rotate(360deg);}}
body[data-theme="dark"] .di-pull-refresh-card{
  background:rgba(17,24,39,.96);
  color:#f8fafc;
  border-color:rgba(148,163,184,.22);
  box-shadow:0 16px 38px rgba(0,0,0,.42);
}
body[data-theme="dark"] .di-pull-refresh-spinner{background:#1f2937;color:#bfdbfe;}
body[data-theme="dark"] .di-pull-refresh.is-ready .di-pull-refresh-spinner,
body[data-theme="dark"] .di-pull-refresh.is-refreshing .di-pull-refresh-spinner{background:#14532d;color:#bbf7d0;}
@media (min-width:981px){.di-pull-refresh{display:none !important;}}
@media (max-width:520px){
  .di-connection-banner{width:calc(100vw - 18px);top:calc(8px + env(safe-area-inset-top));}
  .di-connection-card{justify-content:flex-start;padding:11px 12px;border-radius:16px;font-size:13.5px;}
  .di-connection-retry{padding:7px 10px;font-size:12.5px;}
  .di-pull-refresh-card{min-height:40px;padding:7px 12px;font-size:12.5px;}
}
@media (prefers-reduced-motion: reduce){
  .di-connection-banner,.di-pull-refresh,.di-pull-refresh-spinner{transition:none !important;animation:none !important;}
}



/* === Inline Monster Vocabulary Game integration === */
#screen-game {
  padding: 0 !important;
  overflow: visible;
}
body[data-active-screen="game"] .content {
  padding-left: 10px !important;
  padding-right: 10px !important;
}
.di-game-embed-shell {
  display: grid;
  gap: 0;
  width: min(1180px, 100%);
  margin: 0 auto;
}
.di-game-section-head {
  margin-bottom: 0;
}
#diMonsterGameRoot {
  position: relative;
  width: 100%;
  height: min(735px, calc(100svh - 118px));
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 34px;
  color: var(--dark);
  font-family: ui-rounded, "Trebuchet MS", "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--sky);
  -webkit-tap-highlight-color: transparent;
}
#diMonsterGameRoot .di-owl-logo {
  display: grid;
  place-items: center;
  position: relative;
  border: 4px solid #0f7437;
  background: linear-gradient(145deg, #fff, #fff6db 52%, #f56f5f);
  box-shadow: 0 5px 0 rgba(4,89,38,.24), 0 10px 20px rgba(48,93,112,.14);
}
#diMonsterGameRoot .di-owl-logo span {
  font-size: 68%;
  line-height: 1;
}
#diMonsterGameRoot .di-owl-logo b {
  position: absolute;
  bottom: 2px;
  font-size: 9px;
  color: #168840;
  font-weight: 1000;
  line-height: 1;
}
#diMonsterGameRoot .logo.di-owl-logo {
  width: 50px;
  height: 50px;
  border-radius: 16px;
}
#diMonsterGameRoot .mini-logo.di-owl-logo {
  width: 40px;
  height: 40px;
  border-radius: 13px;
}
#diMonsterGameRoot .result-logo.di-owl-logo {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  margin: 0 auto;
}
#diMonsterGameRoot .confetti {
  left: 0;
}
@media (max-width: 920px) {
  #screen-game {
    padding: 0 0 10px !important;
  }
  #diMonsterGameRoot {
    height: auto;
    min-height: 820px;
    border-radius: 26px;
  }
}
@media (max-width: 520px) {
  #diMonsterGameRoot {
    min-height: 860px;
  }
}
body[data-theme="dark"] #diMonsterGameRoot {
  color: #2d3342;
}


#diMonsterGameRoot{
  --sky: #82d8f7;
  --sky-soft: #bfefff;
  --green: #178840;
  --green-bright: #20b456;
  --red: #d73817;
  --red-soft: #fce9e6;
  --blue: #1597d3;
  --cream: #fff2a8;
  --dark: #2d3342;
  --text: #59677b;
  --panel: rgba(255,255,255,.96);
  --panel-soft: #f8fcff;
  --line: #b7c9d4;
  --line-dark: #9eb4c0;
  --shadow: 0 9px 0 rgba(91,113,124,.18), 0 18px 38px rgba(48,93,112,.18);
  --soft-shadow: 0 5px 0 rgba(91,113,124,.16), 0 10px 20px rgba(48,93,112,.12);
  --radius: 30px;
  --app-w: min(1120px, 100%);
}
#diMonsterGameRoot, #diMonsterGameRoot *{ box-sizing: border-box; }
#diMonsterGameRoot button{ font: inherit; }
#diMonsterGameRoot .scene{ position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: linear-gradient(#78d2f3 0 62%, #afe56f 62% 75%, #fff4b5 75% 87%, #64cce8 87% 100%); }
#diMonsterGameRoot .cloud{ position: absolute; width: 165px; height: 56px; background: rgba(255,255,255,.76); border-radius: 999px; }
#diMonsterGameRoot .cloud:before, #diMonsterGameRoot .cloud:after{ content:""; position:absolute; background:inherit; border-radius:50%; }
#diMonsterGameRoot .cloud:before{ width: 78px; height: 78px; left: 25px; top: -32px; }
#diMonsterGameRoot .cloud:after{ width: 94px; height: 94px; right: 20px; top: -46px; }
#diMonsterGameRoot .cloud-one{ left: 7vw; top: 7vh; animation: float 6s ease-in-out infinite; }
#diMonsterGameRoot .cloud-two{ right: 7vw; top: 16vh; transform: scale(.92); animation: float 7s ease-in-out infinite reverse; opacity:.72; }
#diMonsterGameRoot .sun{ position:absolute; right:7vw; top:6vh; width:104px; height:104px; border-radius:50%; background:#fff649; box-shadow: 0 0 0 22px rgba(243,255,90,.28); animation: pulse 3s ease-in-out infinite; }
#diMonsterGameRoot .hill{ position:absolute; left:-5vw; width:112vw; border-radius: 50% 50% 0 0; opacity:.55; }
#diMonsterGameRoot .hill-one{ height: 170px; top: 62vh; background:#c8ee7a; transform: rotate(2deg); }
#diMonsterGameRoot .hill-two{ height: 130px; top: 73vh; background:#e9f9aa; transform: rotate(-4deg); }
#diMonsterGameRoot .water{ position:absolute; left:6vw; right:6vw; bottom:0; height: 12vh; background: rgba(77,198,229,.75); border-top: 5px solid rgba(255,255,255,.55); }
#diMonsterGameRoot .tree{ position:absolute; width:18px; border-radius: 999px; background:#7b512c; }
#diMonsterGameRoot .tree span{ position:absolute; left:50%; transform:translateX(-50%); width:50px; height:62px; border-radius:999px; background:#61ad62; border:4px solid rgba(50,125,61,.55); }
#diMonsterGameRoot .tree-left{ left: 6px; top: -8px; height: 292px; }
#diMonsterGameRoot .tree-left span:nth-child(1){top:-12px}
#diMonsterGameRoot .tree-left span:nth-child(2){top:88px}
#diMonsterGameRoot .tree-left span:nth-child(3){top:188px}
#diMonsterGameRoot .tree-right{ right: 7vw; bottom: 62px; height: 100px; transform: scale(.68); }
#diMonsterGameRoot .tree-right span:nth-child(1){top:-33px}
#diMonsterGameRoot .tree-right span:nth-child(2){top:20px}
@keyframes float{ 0%,100%{translate:0 0} 50%{translate:0 -12px} }
@keyframes pulse{ 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
#diMonsterGameRoot .di-game-app{ position: relative; z-index: 2; width: var(--app-w); height: 100%; margin: 0 auto; padding: clamp(8px,1.4vh,14px) 0; }
#diMonsterGameRoot .di-game-screen{ width: 100%; height: 100%; display: none; min-height: 0; }
#diMonsterGameRoot .di-game-screen.is-active{ display: grid; animation: screenIn .22s ease-out; }
@keyframes screenIn{ from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
#diMonsterGameRoot .compact-card{ background: var(--panel); border: 6px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
#diMonsterGameRoot .pressable{ cursor: pointer; transition: transform .14s ease, box-shadow .14s ease, filter .14s ease, background .16s ease, border-color .16s ease; }
#diMonsterGameRoot .pressable:hover:not(:disabled){ transform: translateY(-2px); filter: brightness(1.03); }
#diMonsterGameRoot .pressable:active:not(:disabled){ transform: translateY(4px); box-shadow: 0 2px 0 rgba(91,113,124,.18), 0 8px 18px rgba(48,93,112,.14) !important; }
#diMonsterGameRoot .pressable:disabled{ opacity: .55; cursor: not-allowed; }
#diMonsterGameRoot .sound-toggle{ position: absolute; right: max(10px,1.3vw); top: max(8px,1.2vh); z-index: 40; width: 58px; height: 56px; border: 5px solid #a62e14; border-radius: 16px; background: #d83810; color: #fff; font-size: 26px; box-shadow: 0 6px 0 rgba(102,58,36,.34); }
#diMonsterGameRoot .sound-toggle.is-off{ background:#82929e; border-color:#61717c; }
#diMonsterGameRoot .di-game-screen-menu{ grid-template-rows: auto 1fr; gap: clamp(8px,1.4vh,14px); align-items: stretch; }
#diMonsterGameRoot .top-card{ width: min(880px, 100%); justify-self: center; min-height: 68px; padding: 8px 14px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
#diMonsterGameRoot .brand{ display:flex; align-items:center; min-width:0; gap:10px; }
#diMonsterGameRoot .logo{ width: 50px; height: 50px; flex:0 0 auto; animation: wiggle 2.4s ease-in-out infinite; }
#diMonsterGameRoot .mini-logo{ width: 40px; height: 40px; flex:0 0 auto; }
#diMonsterGameRoot .brand-text{ display:grid; min-width:0; line-height:1.05; }
#diMonsterGameRoot .brand-text strong{ font-size: clamp(22px, 3vw, 34px); letter-spacing:-.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#diMonsterGameRoot .brand-text span{ color:var(--text); font-size: 14px; font-weight:900; }
@keyframes wiggle{ 0%,100%{transform:rotate(-2deg) translateY(0)} 50%{transform:rotate(2deg) translateY(-4px)} }
#diMonsterGameRoot .menu-btn{ border: 4px solid #0f7437; border-radius: 18px; padding: 11px 16px; background: var(--green); color:#fff; font-weight:1000; box-shadow: 0 6px 0 rgba(4,89,38,.30); white-space: nowrap; }
#diMonsterGameRoot .menu-btn.secondary{ background:#fff; color:var(--dark); border-color: var(--line); box-shadow: var(--soft-shadow); }
#diMonsterGameRoot .select-wrap{ position: relative; min-height:0; display:grid; grid-template-rows: auto minmax(0,1fr) auto; align-items:stretch; }
#diMonsterGameRoot .select-title{ width: min(500px, calc(100% - 68px)); min-height: clamp(64px, 10vh, 86px); margin: 0 auto -34px; z-index:4; display:grid; place-items:center; background:#fff; color:#343946; font-size: clamp(30px,5vw,50px); font-weight:1000; letter-spacing:-.04em; border: 6px solid #ffe68e; box-shadow: 0 0 0 5px var(--line), 0 5px 0 rgba(91,113,124,.18); border-radius: 42px; position:relative; }
#diMonsterGameRoot .category-panel{ width: min(1040px, 100%); height: 100%; min-height:0; justify-self:center; padding: clamp(54px,8vh,78px) clamp(58px,7vw,78px) clamp(28px,4vh,38px); border-radius: 44px; display:grid; align-items:center; }
#diMonsterGameRoot .category-grid{ height: 100%; min-height:0; display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); grid-template-rows: repeat(2, minmax(120px, 1fr)); gap: clamp(14px,2vw,22px); align-items:stretch; }
#diMonsterGameRoot .category-card{ position:relative; border: 5px solid var(--line); border-radius: 28px; background:#fff; color:#b55050; box-shadow: var(--soft-shadow); display:grid; place-items:center; grid-template-rows: 1fr auto; padding: 10px; font-weight:1000; min-width:0; overflow:hidden; }
#diMonsterGameRoot .category-card:hover{ border-color:#93bfda; background:#fcfeff; }
#diMonsterGameRoot .category-card:active{ transform: translateY(4px); }
#diMonsterGameRoot .category-icon{ font-size: clamp(40px,5.5vh,62px); line-height:1; filter: drop-shadow(0 5px 0 rgba(0,0,0,.08)); align-self:end; }
#diMonsterGameRoot .category-name{ font-size: clamp(17px,2vw,25px); line-height:1.1; text-align:center; word-break:break-word; }
#diMonsterGameRoot .category-count{ position:absolute; right: 10px; top: 10px; min-width:30px; height:30px; border-radius:999px; display:grid; place-items:center; background:#e8f7ff; color:#327295; border:3px solid #c3d7e2; font-size:14px; font-weight:1000; }
#diMonsterGameRoot .nav-arrow{ position:absolute; top:50%; translate: 0 -35%; z-index:8; width:60px; height:60px; border-radius:50%; border: 6px solid #e1edf2; background:#fff; color:#ffda57; font-size:52px; line-height:.65; font-weight:1000; box-shadow: var(--soft-shadow); display:grid; place-items:center; }
#diMonsterGameRoot .nav-left{ left: clamp(-4px, -3vw, -30px); }
#diMonsterGameRoot .nav-right{ right: clamp(-4px, -3vw, -30px); }
#diMonsterGameRoot .page-dots{ height: 24px; display:flex; justify-content:center; align-items:center; gap:8px; }
#diMonsterGameRoot .dot{ width:10px; height:10px; border-radius:50%; border:0; background: rgba(255,255,255,.75); box-shadow: 0 0 0 2px rgba(103,133,147,.35); cursor:pointer; }
#diMonsterGameRoot .dot.active{ width:30px; border-radius:999px; background:#178840; }
#diMonsterGameRoot .di-game-screen-game{ grid-template-rows: auto 14px minmax(0, 1fr) auto; gap: clamp(6px,1.2vh,10px); }
#diMonsterGameRoot .game-header{ min-height: clamp(76px, 10vh, 94px); padding: 8px 16px; display:grid; grid-template-columns: auto auto minmax(0,1fr) auto; align-items:center; gap: 12px; }
#diMonsterGameRoot .back-btn{ width:56px; height:56px; border-radius:18px; border:5px solid #126e35; background:#147b39; color:#fff; font-size:32px; font-weight:1000; box-shadow:0 6px 0 rgba(4,89,38,.35); }
#diMonsterGameRoot .game-copy{ min-width:0; align-self:center; }
#diMonsterGameRoot .game-copy h1{ margin:0; font-size: clamp(32px, 5vw, 58px); line-height:.95; letter-spacing:-.055em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#diMonsterGameRoot .game-copy p{ margin: 8px 0 0; color:var(--text); font-size: clamp(15px, 1.8vw, 22px); font-weight:1000; line-height:1.1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#diMonsterGameRoot .score-cluster{ display:flex; align-items:center; gap:10px; }
#diMonsterGameRoot .score-pill{ min-width: 92px; height: 68px; border-radius: 24px; border: 5px solid var(--line); background: linear-gradient(#fff, #f3f8fb); box-shadow: 0 4px 0 rgba(91,113,124,.14); display:grid; place-items:center; grid-template-rows: auto 1fr; padding: 6px 8px; }
#diMonsterGameRoot .score-pill span{ color:#5a6677; font-weight:1000; font-size: 13px; text-transform:uppercase; letter-spacing:.06em; }
#diMonsterGameRoot .score-pill b{ font-size: 30px; line-height:1; }
#diMonsterGameRoot .progress-track{ position:relative; width:100%; height:14px; background:rgba(255,255,255,.92); border:4px solid var(--line); border-radius:999px; overflow:hidden; box-shadow: 0 4px 0 rgba(91,113,124,.14); }
#diMonsterGameRoot .progress-fill{ height:100%; width:0%; background: linear-gradient(90deg, #21b650, #c5e614 45%, #ffcb00 65%, #f05a1c); border-radius:inherit; transition: width .25s ease; }
#diMonsterGameRoot .progress-glow{ position:absolute; inset:0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); opacity:.4; }
#diMonsterGameRoot .play-board{ min-height:0; padding: clamp(12px,1.8vh,18px); display:grid; grid-template-columns: minmax(300px, 38%) 1fr; gap: clamp(12px,1.6vw,18px); overflow:hidden; }
#diMonsterGameRoot .prompt-column{ min-height:0; display:grid; grid-template-rows: minmax(0, 1fr) auto; gap: clamp(10px,1.4vh,14px); }
#diMonsterGameRoot .monster-box, #diMonsterGameRoot .word-box, #diMonsterGameRoot .answer-card{ border:5px solid var(--line); border-radius: 28px; background: rgba(250,254,255,.92); box-shadow: var(--soft-shadow); }
#diMonsterGameRoot .monster-box{ min-height:0; display:grid; place-items:center; position:relative; overflow:hidden; }
#diMonsterGameRoot .monster-bubble{ width: min(190px, 38vh); aspect-ratio:1; border-radius:50%; display:grid; place-items:center; background: #e9fbff; animation: bob 2.1s ease-in-out infinite; }
#diMonsterGameRoot .monster{ font-size: clamp(58px, 9vh, 98px); line-height:1; filter: drop-shadow(0 8px 0 rgba(0,0,0,.08)); }
#diMonsterGameRoot .monster-shadow{ position:absolute; bottom:15%; width:85px; height:15px; border-radius:50%; background: rgba(75,97,105,.08); }
@keyframes bob{ 0%,100%{transform:translateY(0) rotate(-1deg)} 50%{transform:translateY(-8px) rotate(1deg)} }
#diMonsterGameRoot .word-box{ text-align:center; padding: clamp(12px,1.6vh,18px); background:#fff; }
#diMonsterGameRoot .word-box p{ margin:0 0 8px; color:#5a6677; font-size: clamp(15px,1.5vw,20px); font-weight:1000; }
#diMonsterGameRoot .word-box strong{ display:block; color:#ba5457; font-size: clamp(30px,4vw,52px); line-height:1; word-break: break-word; }
#diMonsterGameRoot .listen-btn{ margin-top: clamp(10px,1.3vh,14px); min-width: 150px; border:5px solid #b93416; border-radius: 22px; background:#df3b10; color:#fff; padding: 12px 18px; font-weight:1000; box-shadow: 0 7px 0 rgba(117,43,22,.35); }
#diMonsterGameRoot .listen-btn.listened{ background: #18a84f; border-color: #087f36; box-shadow: 0 7px 0 rgba(4,89,38,.35); }
#diMonsterGameRoot .listen-btn.is-listening{ animation: listenPulse .55s ease-in-out infinite alternate; }
@keyframes listenPulse{ to { transform: scale(1.035); } }
#diMonsterGameRoot .options-grid{ min-height:0; display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: repeat(2, minmax(0,1fr)); gap: clamp(12px,1.6vw,18px); }
#diMonsterGameRoot .answer-card{ position:relative; min-height:0; display:grid; place-items:center; align-content:center; gap: clamp(6px, .9vh, 10px); padding: 10px; color:#b45053; font-weight:1000; overflow:hidden; }
#diMonsterGameRoot .answer-card:hover:not(:disabled){ border-color:#90bdd4; background:#fff; transform: translateY(-2px); }
#diMonsterGameRoot .answer-card.is-correct{ background:#e4ffe9; border-color:#20b456; color:#13833a; animation: correctPop .35s ease; }
#diMonsterGameRoot .answer-card.is-wrong{ background:#ffe8e6; border-color:#df3b10; color:#a42d17; animation: shake .32s ease; }
#diMonsterGameRoot .answer-emoji{ font-size: clamp(42px, 7vh, 78px); line-height:1; filter: drop-shadow(0 6px 0 rgba(0,0,0,.07)); }
#diMonsterGameRoot .answer-main{ font-size: clamp(21px, 3vw, 34px); line-height:1.05; text-align:center; }
#diMonsterGameRoot .answer-sub{ color:#5f6c7f; font-size: clamp(13px, 1.4vw, 17px); line-height:1.1; text-align:center; font-weight:1000; }
#diMonsterGameRoot .answer-card.mode-translation .answer-main{ color:#b45053; font-size: clamp(27px, 4vw, 48px); }
#diMonsterGameRoot .answer-card.mode-meaning .answer-main{ color:#2d3342; }
@keyframes correctPop{ 0%{transform:scale(1)} 50%{transform:scale(1.04)} 100%{transform:scale(1)} }
@keyframes shake{ 0%,100%{transform:translateX(0)} 25%{transform:translateX(-7px)} 50%{transform:translateX(7px)} 75%{transform:translateX(-4px)} }
#diMonsterGameRoot .game-footer{ min-height: clamp(66px, 8.5vh, 82px); padding: 10px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
#diMonsterGameRoot .feedback-copy{ min-width:0; }
#diMonsterGameRoot .feedback-copy strong{ display:block; font-size: clamp(18px,2.2vw,27px); line-height:1.05; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#diMonsterGameRoot .feedback-copy p{ margin: 6px 0 0; color:#5a6677; font-size: clamp(13px,1.5vw,17px); font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#diMonsterGameRoot .next-btn{ min-width: 125px; border:5px solid #0f7437; border-radius: 22px; background:#1aa751; color:#fff; padding: 13px 18px; font-weight:1000; box-shadow:0 7px 0 rgba(4,89,38,.30); }
#diMonsterGameRoot .next-btn:disabled{ background:#99d3ae; border-color:#7db890; }
#diMonsterGameRoot .di-game-screen-result{ place-items:center; }
#diMonsterGameRoot .result-card{ width:min(620px,100%); padding:30px; text-align:center; }
#diMonsterGameRoot .result-logo{ width:78px; height:78px; }
#diMonsterGameRoot .trophy{ font-size:80px; animation: bob 1.4s ease-in-out infinite; }
#diMonsterGameRoot .result-card h2{ margin:0; font-size: clamp(34px,5vw,56px); letter-spacing:-.05em; }
#diMonsterGameRoot .result-card p{ margin:10px auto 20px; max-width:480px; color:var(--text); font-size:18px; font-weight:800; line-height:1.45; }
#diMonsterGameRoot .result-actions{ display:flex; justify-content:center; gap:12px; flex-wrap:wrap; }
#diMonsterGameRoot .confetti{ position:absolute; top:-16px; width:10px; height:16px; border-radius:4px; z-index:999; pointer-events:none; animation: fall 1.35s linear forwards; }
@keyframes fall{ to { transform: translateY(110vh) rotate(720deg); opacity:0; } }
@media (max-width: 920px){#diMonsterGameRoot .di-game-app{ height:auto; min-height:100svh; width:min(100% - 14px, 760px); }
#diMonsterGameRoot .sound-toggle{ width:50px; height:48px; font-size:22px; border-width:4px; }
#diMonsterGameRoot .di-game-screen{ height:auto; min-height: calc(100svh - 20px); }
#diMonsterGameRoot .di-game-screen-menu.is-active, #diMonsterGameRoot .di-game-screen-result.is-active{ display:grid; }
#diMonsterGameRoot .category-panel{ height:auto; min-height: 560px; padding: 62px 18px 28px; }
#diMonsterGameRoot .category-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: repeat(4, 118px); gap:12px; }
#diMonsterGameRoot .nav-arrow{ width:50px; height:50px; font-size:42px; top:auto; bottom: 4px; translate:0 0; }
#diMonsterGameRoot .nav-left{ left: 14px; }
#diMonsterGameRoot .nav-right{ right: 14px; }
#diMonsterGameRoot .di-game-screen-game{ grid-template-rows: auto 12px auto auto; min-height:auto; }
#diMonsterGameRoot .game-header{ grid-template-columns: auto auto minmax(0,1fr); grid-template-areas:"back logo copy" "score score score"; padding: 8px 10px; gap:8px; }
#diMonsterGameRoot .back-btn{ grid-area:back; width:48px; height:48px; font-size:28px; border-width:4px; }
#diMonsterGameRoot .mini-logo{ grid-area:logo; width:38px; height:38px; }
#diMonsterGameRoot .game-copy{ grid-area:copy; }
#diMonsterGameRoot .game-copy h1{ font-size: clamp(28px,8vw,42px); }
#diMonsterGameRoot .game-copy p{ white-space:normal; font-size: 14px; margin-top:5px; }
#diMonsterGameRoot .score-cluster{ grid-area:score; justify-content:space-between; gap:7px; }
#diMonsterGameRoot .score-pill{ flex:1; min-width:0; height:54px; border-width:4px; border-radius:18px; }
#diMonsterGameRoot .score-pill span{ font-size:11px; }
#diMonsterGameRoot .score-pill b{ font-size:24px; }
#diMonsterGameRoot .play-board{ grid-template-columns:1fr; padding:10px; overflow:visible; gap:10px; }
#diMonsterGameRoot .prompt-column{ grid-template-columns: 1fr; grid-template-rows: 150px auto; }
#diMonsterGameRoot .monster-bubble{ width:120px; }
#diMonsterGameRoot .monster{ font-size:64px; }
#diMonsterGameRoot .word-box strong{ font-size:34px; }
#diMonsterGameRoot .options-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: repeat(2, 132px); gap:10px; }
#diMonsterGameRoot .answer-emoji{ font-size:44px; }
#diMonsterGameRoot .answer-main{ font-size:21px; }
#diMonsterGameRoot .answer-sub{ font-size:12px; }
#diMonsterGameRoot .game-footer{ min-height:0; padding:10px; }
#diMonsterGameRoot .feedback-copy strong, #diMonsterGameRoot .feedback-copy p{ white-space:normal; }
#diMonsterGameRoot .next-btn{ min-width:96px; padding: 11px 12px; border-width:4px; }}
@media (max-width: 520px){#diMonsterGameRoot .top-card{ min-height: 62px; padding:8px 10px; border-radius:24px; }
#diMonsterGameRoot .logo{ width:42px; height:42px; }
#diMonsterGameRoot .brand-text strong{ font-size:21px; }
#diMonsterGameRoot .brand-text span{ font-size:12px; }
#diMonsterGameRoot .menu-btn{ padding:9px 11px; font-size:14px; border-width:4px; }
#diMonsterGameRoot .select-title{ width: calc(100% - 40px); min-height:62px; font-size:31px; margin-bottom:-28px; }
#diMonsterGameRoot .category-panel{ border-width:7px; border-radius:34px; padding-top:56px; }
#diMonsterGameRoot .category-grid{ grid-template-rows: repeat(4, 104px); }
#diMonsterGameRoot .category-icon{ font-size:36px; }
#diMonsterGameRoot .category-name{ font-size:17px; }
#diMonsterGameRoot .category-count{ min-width:26px; height:26px; font-size:12px; }
#diMonsterGameRoot .game-copy h1{ font-size:30px; }
#diMonsterGameRoot .options-grid{ grid-template-rows: repeat(2, 118px); }
#diMonsterGameRoot .answer-card{ border-width:4px; border-radius:22px; }
#diMonsterGameRoot .answer-main{ font-size:18px; }
#diMonsterGameRoot .answer-card.mode-translation .answer-main{ font-size:27px; }
#diMonsterGameRoot .listen-btn{ min-width:132px; padding:10px 12px; border-width:4px; }}
@media (max-height: 720px) and (min-width: 921px){#diMonsterGameRoot{ --app-w: min(1040px, 91vw); }
#diMonsterGameRoot .sound-toggle{ width:50px; height:48px; font-size:22px; border-width:4px; }
#diMonsterGameRoot .game-header{ min-height: 74px; }
#diMonsterGameRoot .game-copy h1{ font-size:42px; }
#diMonsterGameRoot .game-copy p{ font-size:16px; margin-top:4px; }
#diMonsterGameRoot .score-pill{ height:56px; min-width:82px; border-width:4px; }
#diMonsterGameRoot .score-pill b{ font-size:25px; }
#diMonsterGameRoot .play-board{ padding:12px; }
#diMonsterGameRoot .monster-bubble{ width: 135px; }
#diMonsterGameRoot .monster{ font-size:70px; }
#diMonsterGameRoot .word-box strong{ font-size:34px; }
#diMonsterGameRoot .answer-emoji{ font-size:48px; }
#diMonsterGameRoot .answer-main{ font-size:24px; }
#diMonsterGameRoot .game-footer{ min-height:60px; }}
#diMonsterGameRoot .di-game-screen-game[data-mode="picture"] .word-box strong, #diMonsterGameRoot .di-game-screen-game[data-mode="meaning"] .word-box strong{
  color: #2f6f96;
  font-size: clamp(24px, 3vw, 38px);
}
#diMonsterGameRoot .answer-card.mode-picture .answer-sub{ color:#7890a0; }
#diMonsterGameRoot .answer-card.is-correct .answer-sub, #diMonsterGameRoot .answer-card.is-wrong .answer-sub{ color: inherit; opacity: .85; }
@media (min-width: 921px){#diMonsterGameRoot .di-game-app{ padding-top: clamp(10px, 1.2vh, 16px); padding-bottom: clamp(10px, 1.2vh, 16px); }
#diMonsterGameRoot .play-board{ max-height: calc(100svh - 205px); }
#diMonsterGameRoot .word-box{ display:grid; align-content:center; justify-items:center; }}
@media (max-width: 920px){#diMonsterGameRoot .di-game-screen-game[data-mode="picture"] .word-box strong, #diMonsterGameRoot .di-game-screen-game[data-mode="meaning"] .word-box strong{ font-size: 28px; }}
#diMonsterGameRoot .listen-btn[hidden]{ display: none !important; }
#diMonsterGameRoot .picture-label{ color: #5f6c7f; font-size: clamp(15px, 1.7vw, 22px) !important; }
#diMonsterGameRoot .di-game-screen-game[data-mode="picture"] .answer-card{ background: linear-gradient(#ffffff, #f8fdff); }
#diMonsterGameRoot .di-game-screen-game[data-mode="picture"] .answer-card .answer-emoji{ font-size: clamp(54px, 9vh, 90px); }
#diMonsterGameRoot .di-game-screen-game[data-mode="picture"] .word-box strong, #diMonsterGameRoot .di-game-screen-game[data-mode="meaning"] .word-box strong{ max-width: 100%; }
#diMonsterGameRoot .options-grid.match-grid{
  grid-template-columns: 0.92fr 1.08fr;
  grid-template-rows: 1fr;
  align-items: stretch;
  gap: clamp(10px, 1.4vw, 16px);
}
#diMonsterGameRoot .match-side{
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}
#diMonsterGameRoot .match-side h3{
  margin: 0;
  text-align: center;
  color: #415064;
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 1000;
}
#diMonsterGameRoot .match-list{
  min-height: 0;
  display: grid;
  gap: 8px;
}
#diMonsterGameRoot .object-list, #diMonsterGameRoot .target-list{ grid-template-rows: repeat(4, minmax(0, 1fr)); }
#diMonsterGameRoot .match-object, #diMonsterGameRoot .drop-zone{
  width: 100%;
  border: 5px solid var(--line);
  border-radius: 22px;
  background: rgba(250,254,255,.94);
  box-shadow: var(--soft-shadow);
  display: grid;
  place-items: center;
  align-content: center;
  padding: 8px;
  min-height: 0;
  color: #3f4b5e;
  font-weight: 1000;
  cursor: pointer;
}
#diMonsterGameRoot .match-object{
  grid-template-columns: auto 1fr;
  justify-content: start;
  gap: 10px;
  text-align: left;
}
#diMonsterGameRoot .match-object.is-selected{
  border-color: #168dd0;
  background: #e8f8ff;
  transform: translateY(-2px) scale(1.01);
}
#diMonsterGameRoot .match-object.is-used{
  opacity: .45;
  filter: grayscale(.2);
  transform: scale(.96);
}
#diMonsterGameRoot .match-object:disabled{ cursor: not-allowed; }
#diMonsterGameRoot .match-emoji{ font-size: clamp(32px, 5.4vh, 56px); line-height: 1; filter: drop-shadow(0 5px 0 rgba(0,0,0,.08)); }
#diMonsterGameRoot .match-small{ font-size: clamp(13px, 1.4vw, 17px); color: #69788b; }
#diMonsterGameRoot .drop-zone{
  background: #fff;
  color: #ba5457;
  text-align: center;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
#diMonsterGameRoot .drop-zone.is-over{
  background: #e8f8ff;
  border-color: #1597d3;
  transform: scale(1.015);
}
#diMonsterGameRoot .drop-zone.is-correct{
  background: #e4ffe9;
  border-color: #20b456;
  color: #13833a;
}
#diMonsterGameRoot .drop-zone.is-wrong{
  background: #ffe8e6;
  border-color: #df3b10;
  color: #a42d17;
  animation: shake .32s ease;
}
#diMonsterGameRoot .drop-zone .target-word{ font-size: clamp(19px, 2.5vw, 30px); line-height: 1; }
#diMonsterGameRoot .drop-zone small{ color: #5f6c7f; font-size: clamp(11px, 1.1vw, 14px); font-weight: 1000; }
#diMonsterGameRoot .drop-zone.is-correct small{ color: #13833a; }
#diMonsterGameRoot .di-game-screen-game[data-mode="match"] .prompt-column{ grid-template-rows: minmax(0, 1fr) auto; }
#diMonsterGameRoot .di-game-screen-game[data-mode="match"] .word-box strong{ color: #2f6f96; font-size: clamp(26px, 3vw, 38px); }
#diMonsterGameRoot .di-game-screen-game[data-mode="match"] .monster-bubble{ width: min(155px, 32vh); }
@media (max-width: 920px){#diMonsterGameRoot .options-grid.match-grid{ grid-template-columns: 1fr; grid-template-rows: auto auto; }
#diMonsterGameRoot .match-side{ gap: 6px; }
#diMonsterGameRoot .object-list{ grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: repeat(2, 82px); }
#diMonsterGameRoot .target-list{ grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: repeat(2, 92px); }
#diMonsterGameRoot .match-object{ grid-template-columns: 1fr; gap: 2px; text-align:center; }
#diMonsterGameRoot .match-emoji{ font-size: 34px; }
#diMonsterGameRoot .match-small{ font-size: 12px; }
#diMonsterGameRoot .drop-zone{ border-width: 4px; border-radius: 20px; padding: 7px; }
#diMonsterGameRoot .drop-zone .target-word{ font-size: 18px; }
#diMonsterGameRoot .drop-zone small{ font-size: 11px; }}
@media (max-width: 520px){#diMonsterGameRoot .object-list{ grid-template-rows: repeat(2, 72px); }
#diMonsterGameRoot .target-list{ grid-template-rows: repeat(2, 84px); }
#diMonsterGameRoot .match-side h3{ font-size: 14px; }
#diMonsterGameRoot .match-emoji{ font-size: 30px; }
#diMonsterGameRoot .drop-zone .target-word{ font-size: 16px; }}
#diMonsterGameRoot .sun::before{
  content: "";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 1000;
  color: #7a4a00;
  opacity: 0;
  transition: opacity .15s ease;
}
#diMonsterGameRoot .sun.sun-happy{
  animation: sunHappy .85s ease both;
  background: #fff655;
}
#diMonsterGameRoot .sun.sun-happy::before{ content: "😊"; opacity: 1; }
#diMonsterGameRoot .sun.sun-sad{
  animation: sunSad .55s ease both;
  background: #ffd6d6;
  box-shadow: 0 0 0 22px rgba(255,120,120,.25);
}
#diMonsterGameRoot .sun.sun-sad::before{ content: "😟"; opacity: 1; }
@keyframes sunHappy{
  0%,100% { transform: scale(1) rotate(0); }
  35% { transform: scale(1.18) rotate(-8deg); }
  70% { transform: scale(1.08) rotate(8deg); }
}
@keyframes sunSad{
  0%,100% { transform: translateX(0) scale(1); }
  25% { transform: translateX(-8px) scale(.96); }
  50% { transform: translateX(8px) scale(.96); }
  75% { transform: translateX(-5px) scale(.96); }
}
#diMonsterGameRoot .options-grid.match-grid .match-object{
  grid-template-columns: 1fr;
  text-align: center;
  justify-content: center;
  min-height: 82px;
}
#diMonsterGameRoot .options-grid.match-grid .match-object .match-emoji{
  font-size: clamp(42px, 7vh, 68px);
}
#diMonsterGameRoot .options-grid.match-grid .drop-zone .target-word{
  color: #ba5457;
  font-size: clamp(21px, 2.6vw, 34px);
}
#diMonsterGameRoot .options-grid.match-grid .drop-zone small{
  color: #5f6c7f;
  text-transform: none;
}
#diMonsterGameRoot .di-game-screen-game[data-mode="match"] .word-box strong{
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.18;
}
#diMonsterGameRoot .di-game-screen-game[data-mode="match"] .word-box p{
  font-size: clamp(14px, 1.4vw, 18px);
}
#diMonsterGameRoot .result-card{
  max-width: 760px;
  background: rgba(255,255,255,.96);
}
#diMonsterGameRoot .result-card h2{
  margin: 8px 0 8px;
  color: #ffdd37;
  font-size: clamp(48px, 9vw, 86px);
  line-height: .9;
  text-transform: uppercase;
  letter-spacing: -0.06em;
  text-shadow:
    0 4px 0 #fff,
    0 -4px 0 #fff,
    4px 0 0 #fff,
    -4px 0 0 #fff,
    0 8px 0 rgba(91,113,124,.35);
}
#diMonsterGameRoot .result-text{
  margin: 4px auto 22px;
  max-width: 620px;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
}
#diMonsterGameRoot .result-stars{
  display: flex;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 14px);
  margin: 10px 0 12px;
}
#diMonsterGameRoot .result-star{
  display: inline-grid;
  place-items: center;
  width: clamp(46px, 7vw, 76px);
  height: clamp(46px, 7vw, 76px);
  font-size: clamp(42px, 6.5vw, 72px);
  line-height: 1;
  color: #d8d8d8;
  text-shadow: 0 4px 0 #fff, 0 0 0 4px #aeb7bd;
  filter: drop-shadow(0 5px 0 rgba(91,113,124,.30));
}
#diMonsterGameRoot .result-star.filled{
  color: #ffdd37;
}
#diMonsterGameRoot .result-score-label{
  margin-top: 6px;
  font-size: clamp(24px, 4vw, 42px);
  color: #3f4653;
  font-weight: 1000;
}
#diMonsterGameRoot .result-score-big{
  font-size: clamp(42px, 7vw, 78px);
  color: #2d3342;
  font-weight: 1000;
  line-height: .95;
  margin-bottom: 8px;
}
#diMonsterGameRoot .result-summary{
  color: #59677b;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 900;
}
@media (max-width: 920px){#diMonsterGameRoot .options-grid.match-grid .match-object{ min-height: 76px; }
#diMonsterGameRoot .options-grid.match-grid .match-object .match-emoji{ font-size: 38px; }
#diMonsterGameRoot .di-game-screen-game[data-mode="match"] .word-box strong{ font-size: 18px; }
#diMonsterGameRoot .result-card{ padding: 22px 14px; }}

/* Final embedded game fit fixes */
#diMonsterGameRoot .top-card,
#diMonsterGameRoot .game-header{
  padding-right: 86px !important;
}
#diMonsterGameRoot .sound-toggle{
  width: 52px !important;
  height: 52px !important;
  top: 16px !important;
  right: 18px !important;
  font-size: 22px !important;
  border-radius: 15px !important;
}
@media (max-width: 760px){
  #diMonsterGameRoot .top-card,
  #diMonsterGameRoot .game-header{
    padding-right: 62px !important;
  }
  #diMonsterGameRoot .sound-toggle{
    width: 44px !important;
    height: 44px !important;
    top: 10px !important;
    right: 10px !important;
    font-size: 19px !important;
  }
}

/* === v9 integrated game crop fix === */
body[data-active-screen="game"] .content{
  padding-top: 6px !important;
}
#screen-game{
  min-height: 0 !important;
}
.di-game-embed-shell{
  width: min(1060px, 100%) !important;
}
#diMonsterGameRoot{
  height: min(650px, calc(100svh - 96px)) !important;
  min-height: 545px !important;
  max-width: 1060px !important;
  margin: 0 auto !important;
}
#diMonsterGameRoot .di-game-screen-result{
  padding: 14px !important;
  place-items: center !important;
  overflow: hidden !important;
}
#diMonsterGameRoot .di-game-screen-result .result-card{
  width: min(560px, calc(100% - 20px)) !important;
  max-height: calc(100% - 18px) !important;
  padding: 14px 18px !important;
  border-width: 5px !important;
  border-radius: 28px !important;
  display: grid !important;
  justify-items: center !important;
  align-content: center !important;
  gap: 4px !important;
  overflow: hidden !important;
}
#diMonsterGameRoot .di-game-screen-result .result-logo.di-owl-logo{
  width: 54px !important;
  height: 54px !important;
  border-radius: 16px !important;
  margin: 0 auto !important;
  border-width: 3px !important;
}
#diMonsterGameRoot .di-game-screen-result .result-logo.di-owl-logo b{
  font-size: 8px !important;
}
#diMonsterGameRoot .di-game-screen-result .trophy{
  font-size: clamp(42px, 6vh, 56px) !important;
  line-height: 1 !important;
  margin: 0 !important;
}
#diMonsterGameRoot .di-game-screen-result .result-card h2{
  font-size: clamp(44px, 7vw, 66px) !important;
  line-height: .86 !important;
  margin: 4px 0 !important;
}
#diMonsterGameRoot .di-game-screen-result .result-stars{
  gap: 8px !important;
  margin: 6px 0 !important;
}
#diMonsterGameRoot .di-game-screen-result .result-star{
  width: clamp(36px, 5vw, 52px) !important;
  height: clamp(36px, 5vw, 52px) !important;
  font-size: clamp(34px, 5vw, 50px) !important;
}
#diMonsterGameRoot .di-game-screen-result .result-score-label{
  margin-top: 0 !important;
  font-size: clamp(20px, 3vw, 30px) !important;
  line-height: 1 !important;
}
#diMonsterGameRoot .di-game-screen-result .result-score-big{
  font-size: clamp(48px, 7vw, 72px) !important;
  line-height: .9 !important;
  margin: 0 !important;
}
#diMonsterGameRoot .di-game-screen-result .result-summary{
  max-width: 500px !important;
  font-size: clamp(14px, 1.6vw, 17px) !important;
  line-height: 1.22 !important;
  margin: 3px auto 8px !important;
}
#diMonsterGameRoot .di-game-screen-result .result-text{
  margin: 0 auto 6px !important;
  max-width: 520px !important;
}
#diMonsterGameRoot .di-game-screen-result .result-actions{
  gap: 10px !important;
  margin-top: 2px !important;
}
#diMonsterGameRoot .di-game-screen-result .menu-btn{
  padding: 9px 15px !important;
  border-width: 4px !important;
  border-radius: 16px !important;
  box-shadow: 0 5px 0 rgba(4,89,38,.24) !important;
}
@media (max-width: 920px){
  .di-game-embed-shell{ width: min(760px, 100%) !important; }
  #diMonsterGameRoot{
    height: auto !important;
    min-height: 720px !important;
    max-width: 760px !important;
  }
  #diMonsterGameRoot .di-game-screen-result .result-card{
    width: min(520px, calc(100% - 14px)) !important;
    padding: 14px 12px !important;
  }
}
@media (max-width: 520px){
  #diMonsterGameRoot{ min-height: 680px !important; }
  #diMonsterGameRoot .di-game-screen-result .result-card h2{ font-size: 46px !important; }
  #diMonsterGameRoot .di-game-screen-result .result-star{ width: 34px !important; height: 34px !important; font-size: 32px !important; }
  #diMonsterGameRoot .di-game-screen-result .result-score-big{ font-size: 54px !important; }
  #diMonsterGameRoot .di-game-screen-result .result-summary{ font-size: 13px !important; }
}


/* =========================================================
   DI LOOK UPDATE - modern game polish
   Changes: compact header, premium cards, Italian subtitles,
   progress line, smoother hover states, and better mobile fit.
   ========================================================= */
#screen-game{
  background:
    radial-gradient(circle at top left, rgba(151, 90, 255, .10), transparent 34%),
    radial-gradient(circle at top right, rgba(32, 180, 86, .10), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #eef7ff 100%);
}
.di-game-embed-shell{
  width: min(1180px, 100%) !important;
  margin-inline: auto !important;
  padding: clamp(6px, 1vw, 12px) !important;
}
#diMonsterGameRoot{
  --green: #159447;
  --green-bright: #22c463;
  --line: #b9d0dc;
  --line-dark: #8eaab8;
  --panel: rgba(255,255,255,.94);
  --shadow: 0 10px 0 rgba(86,112,126,.16), 0 22px 48px rgba(56,97,117,.18);
  --soft-shadow: 0 5px 0 rgba(86,112,126,.14), 0 14px 28px rgba(56,97,117,.12);
  border-radius: 34px !important;
  outline: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 22px 55px rgba(43, 89, 120, .20), inset 0 0 0 1px rgba(255,255,255,.50);
  overflow: hidden;
}
#diMonsterGameRoot .scene{
  background:
    radial-gradient(circle at 82% 19%, rgba(255, 247, 65, .95) 0 52px, rgba(255, 247, 65, .28) 53px 105px, transparent 106px),
    linear-gradient(#78d8f5 0 61%, #b5e97f 61% 76%, #fff5bf 76% 87%, #5ecae7 87% 100%) !important;
}
#diMonsterGameRoot .cloud{ opacity: .58 !important; filter: blur(.2px); }
#diMonsterGameRoot .tree{ opacity: .86; }
#diMonsterGameRoot .di-game-screen-menu{
  grid-template-rows: auto minmax(0,1fr) !important;
  gap: 12px !important;
}
#diMonsterGameRoot .top-card{
  width: min(940px, calc(100% - 92px)) !important;
  min-height: 62px !important;
  padding: 8px 14px !important;
  border-width: 5px !important;
  border-radius: 28px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,252,255,.96)) !important;
  backdrop-filter: blur(8px);
}
#diMonsterGameRoot .brand{ gap: 12px !important; }
#diMonsterGameRoot .logo.di-owl-logo{
  width: 46px !important;
  height: 46px !important;
  border-radius: 15px !important;
  animation-duration: 3.2s !important;
}
#diMonsterGameRoot .brand-text strong{
  font-size: clamp(25px, 3vw, 39px) !important;
  letter-spacing: -.055em !important;
}
#diMonsterGameRoot .brand-text span{
  color: #667186 !important;
  font-size: clamp(13px, 1.6vw, 16px) !important;
}
#diMonsterGameRoot .menu-btn{
  background: linear-gradient(180deg, #22b75a, #12813d) !important;
  border-color: #0b6f31 !important;
  border-radius: 19px !important;
  padding: 10px 17px !important;
  box-shadow: 0 6px 0 rgba(6,91,39,.34), 0 14px 24px rgba(13,126,58,.18) !important;
}
#diMonsterGameRoot .menu-btn:hover:not(:disabled){
  transform: translateY(-3px) scale(1.015) !important;
}
#diMonsterGameRoot .sound-toggle{
  right: 16px !important;
  top: 15px !important;
  width: 52px !important;
  height: 52px !important;
  border-width: 5px !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #ff5f2f, #d33313) !important;
  box-shadow: 0 6px 0 rgba(133,47,26,.34), 0 14px 24px rgba(202,63,24,.18) !important;
}
#diMonsterGameRoot .select-wrap{
  width: min(1110px, 100%) !important;
  justify-self: center !important;
}
#diMonsterGameRoot .select-title{
  width: min(520px, calc(100% - 96px)) !important;
  min-height: clamp(58px, 8vh, 78px) !important;
  margin-bottom: -30px !important;
  font-size: clamp(32px, 4.5vw, 54px) !important;
  border-width: 5px !important;
  border-color: #ffe38a !important;
  color: #333946 !important;
  box-shadow: 0 0 0 5px rgba(174,198,211,.9), 0 7px 0 rgba(91,113,124,.14), 0 15px 26px rgba(74,114,136,.10) !important;
}
#diMonsterGameRoot .category-panel{
  width: min(1080px, 100%) !important;
  padding: clamp(58px, 8vh, 76px) clamp(52px, 6vw, 72px) clamp(30px, 4vh, 42px) !important;
  border-width: 6px !important;
  border-radius: 42px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(251,255,252,.94)) !important;
}
#diMonsterGameRoot .category-grid{
  gap: clamp(16px, 2.1vw, 24px) !important;
}
#diMonsterGameRoot .category-card{
  grid-template-rows: minmax(34px,1fr) auto auto auto auto !important;
  gap: 3px !important;
  isolation: isolate;
  padding: 14px 12px 12px !important;
  border: 5px solid rgba(171,193,205,.95) !important;
  border-radius: 29px !important;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,.95), rgba(255,255,255,.58) 30%, transparent 58%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.82)) !important;
  color: #ad4c51 !important;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease, filter .18s ease !important;
}
#diMonsterGameRoot .category-card::before{
  content:"";
  position:absolute;
  inset: 10px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,.84), rgba(255,255,255,.10));
  opacity: .75;
  z-index: -1;
}
#diMonsterGameRoot .category-shine{
  position:absolute;
  inset:-45% auto auto -35%;
  width: 75%;
  height: 180%;
  transform: rotate(22deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.58), transparent);
  opacity: 0;
  transition: opacity .18s ease, translate .55s ease;
  pointer-events: none;
}
#diMonsterGameRoot .category-card:hover{
  transform: translateY(-5px) !important;
  border-color: #8fc8e7 !important;
  box-shadow: 0 8px 0 rgba(86,112,126,.16), 0 20px 34px rgba(45,108,143,.18) !important;
  filter: saturate(1.05);
}
#diMonsterGameRoot .category-card:hover .category-shine{
  opacity: 1;
  translate: 165% 0;
}
#diMonsterGameRoot .category-card:active{ transform: translateY(2px) !important; }
#diMonsterGameRoot .category-icon{
  align-self: end !important;
  font-size: clamp(36px, 5.5vh, 58px) !important;
  margin-bottom: 1px;
  filter: drop-shadow(0 7px 0 rgba(44,68,78,.08)) !important;
}
#diMonsterGameRoot .category-name{
  font-size: clamp(19px, 2vw, 27px) !important;
  color: #b14d54 !important;
  letter-spacing: -.035em;
}
#diMonsterGameRoot .category-subtitle{
  display:block;
  color:#617187;
  font-weight: 1000;
  font-size: clamp(11px, 1vw, 13px);
  letter-spacing: .05em;
  text-transform: uppercase;
  line-height: 1.05;
}
#diMonsterGameRoot .category-meta{
  display:block;
  color:#748397;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
  margin-top: 3px;
}
#diMonsterGameRoot .category-progress{
  width: min(116px, 76%);
  height: 8px;
  display:block;
  margin-top: 7px;
  border-radius: 999px;
  background: rgba(190,211,222,.58);
  box-shadow: inset 0 1px 3px rgba(70,94,106,.15);
  overflow:hidden;
}
#diMonsterGameRoot .category-progress i{
  display:block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22b75a, #7ddf61);
  min-width: 0;
  transition: width .45s ease;
}
#diMonsterGameRoot .category-count{
  right: 11px !important;
  top: 10px !important;
  min-width: 32px !important;
  height: 32px !important;
  background: linear-gradient(180deg, #f5fcff, #e5f6ff) !important;
  color: #2f7c9d !important;
  border-color: #bcd4df !important;
  box-shadow: 0 3px 0 rgba(86,112,126,.11);
}
#diMonsterGameRoot .category-tick{
  position:absolute;
  left: 11px;
  top: 10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display:grid;
  place-items:center;
  font-size: 17px;
  color:#fff;
  background: linear-gradient(180deg, #21bb59, #11843e);
  box-shadow: 0 4px 0 rgba(6,91,39,.20);
  opacity: 0;
  scale: .7;
  transition: opacity .18s ease, scale .18s ease;
}
#diMonsterGameRoot .category-card.is-started .category-tick,
#diMonsterGameRoot .category-card.is-complete .category-tick{
  opacity: 1;
  scale: 1;
}
#diMonsterGameRoot .cat-theme-1{ background: linear-gradient(180deg, #fff, #fff6f6) !important; }
#diMonsterGameRoot .cat-theme-2{ background: linear-gradient(180deg, #fff, #f0fbff) !important; }
#diMonsterGameRoot .cat-theme-3{ background: linear-gradient(180deg, #fff, #f5fff5) !important; }
#diMonsterGameRoot .cat-theme-4{ background: linear-gradient(180deg, #fff, #fff9ec) !important; }
#diMonsterGameRoot .cat-theme-5{ background: linear-gradient(180deg, #fff, #f7f1ff) !important; }
#diMonsterGameRoot .cat-theme-6{ background: linear-gradient(180deg, #fff, #fff1f8) !important; }
#diMonsterGameRoot .cat-theme-7{ background: linear-gradient(180deg, #fff, #f0fff9) !important; }
#diMonsterGameRoot .cat-theme-8{ background: linear-gradient(180deg, #fff, #f2f6ff) !important; }
#diMonsterGameRoot .nav-arrow{
  width: 56px !important;
  height: 56px !important;
  border-width: 5px !important;
  color: #ffd23f !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 6px 0 rgba(86,112,126,.13), 0 15px 25px rgba(56,97,117,.12) !important;
}
#diMonsterGameRoot .page-dots{
  gap: 8px !important;
  height: 28px !important;
  align-items:center;
}
#diMonsterGameRoot .page-dots .dot{
  width: 14px !important;
  height: 14px !important;
  border: 3px solid #d8edf7 !important;
  box-shadow: 0 2px 0 rgba(86,112,126,.14);
}
#diMonsterGameRoot .page-dots .dot.active{
  width: 42px !important;
  background: linear-gradient(90deg, #158941, #22ba58) !important;
  border-color: #0f7d39 !important;
}
#diMonsterGameRoot .category-empty-state{
  grid-column: 1 / -1;
  display:grid;
  place-items:center;
  min-height: 220px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(240,250,255,.92));
  border: 4px dashed rgba(158,186,200,.9);
  color:#516174;
  font-weight: 1000;
  font-size: 24px;
}
#diMonsterGameRoot .game-header,
#diMonsterGameRoot .play-board,
#diMonsterGameRoot .game-footer,
#diMonsterGameRoot .result-card{
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,253,255,.95)) !important;
}
#diMonsterGameRoot .answer-card,
#diMonsterGameRoot .monster-box,
#diMonsterGameRoot .word-box{
  background: linear-gradient(180deg, #fff, #f9fdff) !important;
}
@media (max-width: 920px){
  .di-game-embed-shell{ padding: 4px !important; }
  #diMonsterGameRoot{ min-height: 760px !important; border-radius: 28px !important; }
  #diMonsterGameRoot .top-card{
    width: min(720px, calc(100% - 78px)) !important;
  }
  #diMonsterGameRoot .category-panel{
    min-height: 590px !important;
    padding: 60px 22px 34px !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    grid-template-rows: repeat(4, 122px) !important;
    gap: 13px !important;
  }
  #diMonsterGameRoot .category-card{ border-radius: 24px !important; padding: 10px 9px !important; }
  #diMonsterGameRoot .category-icon{ font-size: 38px !important; }
  #diMonsterGameRoot .nav-arrow{ bottom: 7px !important; }
}
@media (max-width: 520px){
  #diMonsterGameRoot{ min-height: 710px !important; }
  #diMonsterGameRoot .top-card{
    width: calc(100% - 68px) !important;
    min-height: 58px !important;
    padding: 7px 9px !important;
    border-width: 4px !important;
    border-radius: 22px !important;
  }
  #diMonsterGameRoot .logo.di-owl-logo{ width: 38px !important; height: 38px !important; }
  #diMonsterGameRoot .brand-text strong{ font-size: 20px !important; }
  #diMonsterGameRoot .brand-text span{ font-size: 11px !important; }
  #diMonsterGameRoot .menu-btn{ padding: 8px 10px !important; font-size: 13px !important; border-width: 3px !important; }
  #diMonsterGameRoot .sound-toggle{ width: 46px !important; height: 46px !important; right: 9px !important; top: 10px !important; }
  #diMonsterGameRoot .select-title{
    width: calc(100% - 44px) !important;
    min-height: 56px !important;
    font-size: 29px !important;
    margin-bottom: -26px !important;
    border-width: 4px !important;
  }
  #diMonsterGameRoot .category-panel{
    min-height: 560px !important;
    padding: 54px 12px 38px !important;
    border-width: 5px !important;
    border-radius: 30px !important;
  }
  #diMonsterGameRoot .category-grid{ grid-template-rows: repeat(4, 112px) !important; gap: 10px !important; }
  #diMonsterGameRoot .category-card{ border-width: 4px !important; border-radius: 22px !important; }
  #diMonsterGameRoot .category-icon{ font-size: 32px !important; }
  #diMonsterGameRoot .category-name{ font-size: 17px !important; }
  #diMonsterGameRoot .category-subtitle{ font-size: 10px !important; }
  #diMonsterGameRoot .category-meta{ font-size: 10px !important; }
  #diMonsterGameRoot .category-progress{ height: 6px !important; margin-top: 4px !important; }
  #diMonsterGameRoot .category-count{ min-width: 27px !important; height: 27px !important; font-size: 12px !important; right: 8px !important; top: 8px !important; }
}

/* --- v3 fresh color refresh / modern palette --- */
:root{
  --bg:#f7f8ff;
  --panel:#ffffff;
  --line:#d8dff3;
  --shadow:0 18px 40px rgba(49,61,119,.08);
  --text:#1f2940;
  --muted:#6b7591;
  --green:#e8fbf2;
  --blue:#edf4ff;
  --purple:#f3edff;
  --orange:#fff4e6;
  --red:#ffecef;
  --yellow:#fff9de;
  --pink:#ffedf8;
  --brand:#5a54e8;
  --brand2:#17b3c1;
  --brand-soft:#eef0ff;
}
body{
  background:linear-gradient(180deg,#f8f9ff 0%,#f0f5ff 52%,#eefaf9 100%) !important;
}
.sidebar{
  background:linear-gradient(180deg,#ffffff 0%,#f8f9ff 100%) !important;
  border-right-color:#e2e7f7 !important;
}
.brand-logo,
.primary-btn,.play-btn,.phrase-play{
  background:linear-gradient(135deg,#5a54e8 0%,#17b3c1 100%) !important;
}
.menu-item:hover,.menu-item.active,
.tab-btn.active,.tab-btn:hover,
.lesson-nav-btn.active,.lesson-nav-btn:hover,
.grammar-nav-btn.active{
  background:linear-gradient(180deg,#f5f3ff 0%,#ecfbff 100%) !important;
  border-color:#cfd8ff !important;
}
.tag,.page-indicator,.lesson-chip,.grammar-tab.active{
  background:linear-gradient(135deg,#edeaff 0%,#e7fbff 100%) !important;
  color:#4b44cc !important;
  border-color:#d4dcff !important;
}
.grammar-tab.active{ color:#fff !important; background:linear-gradient(135deg,#5a54e8 0%,#17b3c1 100%) !important; }
.hero-panel{
  background:linear-gradient(135deg,#ffffff 0%,#f1efff 42%,#eafcf9 100%) !important;
}
.sidebar-box,.panel-soft,.practice-stat-card,.result-card,.translator-lang-card{
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%) !important;
}
.home-card.green{background:linear-gradient(180deg,#fff 0%,#eefbf5 100%) !important}
.home-card.blue{background:linear-gradient(180deg,#fff 0%,#eef5ff 100%) !important}
.home-card.purple{background:linear-gradient(180deg,#fff 0%,#f4efff 100%) !important}
.home-card.orange{background:linear-gradient(180deg,#fff 0%,#fff4e8 100%) !important}

#diMonsterGameRoot{
  --sky:#8fcbff;
  --sky-soft:#dff2ff;
  --green:#23a86d;
  --green-bright:#36c68a;
  --red:#ff7a59;
  --red-soft:#fff0ea;
  --blue:#32a9ff;
  --cream:#ffe9a3;
  --dark:#2a3150;
  --text:#69748f;
  --panel:rgba(255,255,255,.97);
  --panel-soft:#fbfdff;
  --line:#c8d5e8;
  --line-dark:#afc1d8;
  --shadow:0 9px 0 rgba(108,123,164,.16), 0 18px 38px rgba(80,95,145,.18);
  --soft-shadow:0 5px 0 rgba(108,123,164,.15), 0 10px 22px rgba(80,95,145,.13);
}
#diMonsterGameRoot .scene{
  background:linear-gradient(#95cfff 0 58%, #baf1d0 58% 73%, #fff4b9 73% 86%, #7fd7ea 86% 100%) !important;
}
#diMonsterGameRoot .sun{
  background:#ffe769 !important;
  box-shadow:0 0 0 22px rgba(255,232,105,.24) !important;
}
#diMonsterGameRoot .hill-one{ background:#baf0a5 !important; }
#diMonsterGameRoot .hill-two{ background:#ddf7b7 !important; }
#diMonsterGameRoot .water{ background:rgba(93,214,227,.72) !important; }
#diMonsterGameRoot .tree{ background:#8e603a !important; }
#diMonsterGameRoot .tree span{ background:#71c27c !important; border-color:rgba(65,148,84,.45) !important; }
#diMonsterGameRoot .compact-card,
#diMonsterGameRoot .top-card,
#diMonsterGameRoot .category-panel,
#diMonsterGameRoot .monster-box,
#diMonsterGameRoot .word-box,
#diMonsterGameRoot .answer-card,
#diMonsterGameRoot .score-pill{
  border-color:#c9d7e8 !important;
  box-shadow:0 6px 0 rgba(110,126,167,.14), 0 16px 30px rgba(84,102,155,.12) !important;
}
#diMonsterGameRoot .menu-btn{
  border-color:#4c58d2 !important;
  background:linear-gradient(135deg,#5e58ec 0%,#14b9c4 100%) !important;
  box-shadow:0 6px 0 rgba(72,83,172,.28) !important;
}
#diMonsterGameRoot .menu-btn.secondary{
  color:#30425e !important;
  background:linear-gradient(180deg,#ffffff 0%,#f4f7ff 100%) !important;
}
#diMonsterGameRoot .select-title{
  color:#313652 !important;
  background:linear-gradient(180deg,#ffffff 0%,#f7f4ff 100%) !important;
  border-color:#ffd67c !important;
  box-shadow:0 0 0 5px #cad9ea, 0 5px 0 rgba(107,125,159,.18) !important;
}
#diMonsterGameRoot .category-card{
  color:#a14973 !important;
  border-color:#bfd0e4 !important;
}
#diMonsterGameRoot .category-card:hover{
  border-color:#acbfff !important;
  box-shadow:0 8px 0 rgba(109,124,171,.15), 0 20px 34px rgba(85,100,162,.16) !important;
}
#diMonsterGameRoot .category-name{
  color:#b04d73 !important;
}
#diMonsterGameRoot .category-subtitle,
#diMonsterGameRoot .category-meta{
  color:#697691 !important;
}
#diMonsterGameRoot .category-progress i{
  background:linear-gradient(90deg,#5a54e8 0%,#19b7b9 100%) !important;
}
#diMonsterGameRoot .category-count{
  background:linear-gradient(180deg,#f7f5ff,#e8f4ff) !important;
  color:#4e63c4 !important;
  border-color:#cfdbef !important;
}
#diMonsterGameRoot .category-tick{
  background:linear-gradient(180deg,#5a54e8,#17b3c1) !important;
  box-shadow:0 4px 0 rgba(68,81,163,.2) !important;
}
#diMonsterGameRoot .cat-theme-1{ background: linear-gradient(180deg, #fff, #fff3f8) !important; }
#diMonsterGameRoot .cat-theme-2{ background: linear-gradient(180deg, #fff, #eef8ff) !important; }
#diMonsterGameRoot .cat-theme-3{ background: linear-gradient(180deg, #fff, #eefcf4) !important; }
#diMonsterGameRoot .cat-theme-4{ background: linear-gradient(180deg, #fff, #fff6ea) !important; }
#diMonsterGameRoot .cat-theme-5{ background: linear-gradient(180deg, #fff, #f4efff) !important; }
#diMonsterGameRoot .cat-theme-6{ background: linear-gradient(180deg, #fff, #fff0f6) !important; }
#diMonsterGameRoot .cat-theme-7{ background: linear-gradient(180deg, #fff, #effff9) !important; }
#diMonsterGameRoot .cat-theme-8{ background: linear-gradient(180deg, #fff, #eef2ff) !important; }
#diMonsterGameRoot .nav-arrow{
  color:#6b61ff !important;
  border-color:#dde7f2 !important;
  background:rgba(255,255,255,.98) !important;
}
#diMonsterGameRoot .dot.active,
#diMonsterGameRoot .page-dot.active,
#diMonsterGameRoot .pager-dot.active{
  background:linear-gradient(135deg,#5a54e8 0%,#17b3c1 100%) !important;
}

/* --- v4 premium category fix: no text crop + more premium game UI --- */
#diMonsterGameRoot .top-card{
  width: min(960px, calc(100% - 84px)) !important;
  min-height: 72px !important;
  padding: 10px 16px !important;
  border-radius: 30px !important;
  border: 4px solid rgba(206,218,241,.95) !important;
  background:
    radial-gradient(circle at 14% 20%, rgba(255,255,255,.9), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.92)) !important;
  box-shadow: 0 8px 0 rgba(112,126,170,.14), 0 18px 36px rgba(90,104,152,.12) !important;
}
#diMonsterGameRoot .brand-text strong{
  color:#29314f !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.85);
}
#diMonsterGameRoot .menu-btn{
  min-width: 170px !important;
  border-width: 4px !important;
  border-radius: 20px !important;
  background: linear-gradient(135deg,#655cf1 0%,#1bc0c6 100%) !important;
  border-color:#4f58d4 !important;
  box-shadow: 0 6px 0 rgba(76,86,176,.28), 0 14px 26px rgba(74,115,194,.18) !important;
}
#diMonsterGameRoot .menu-btn:hover:not(:disabled){
  filter: brightness(1.03) saturate(1.04);
}
#diMonsterGameRoot .sound-toggle{
  width: 56px !important;
  height: 56px !important;
  border-width: 4px !important;
  border-radius: 20px !important;
  background: linear-gradient(135deg,#ff6a4d 0%,#d63b17 100%) !important;
  box-shadow: 0 6px 0 rgba(165,71,42,.28), 0 12px 24px rgba(206,87,48,.18) !important;
}
#diMonsterGameRoot .select-title{
  width: min(540px, calc(100% - 96px)) !important;
  min-height: clamp(62px, 8vh, 82px) !important;
  font-size: clamp(32px, 4.2vw, 56px) !important;
  border-radius: 38px !important;
  background: linear-gradient(180deg,rgba(255,255,255,.98),rgba(249,246,255,.95)) !important;
  box-shadow: 0 0 0 4px rgba(201,214,235,.95), 0 6px 0 rgba(110,123,163,.16), 0 16px 30px rgba(90,103,153,.12) !important;
}
#diMonsterGameRoot .category-panel{
  width: min(1110px, 100%) !important;
  padding: clamp(62px, 8vh, 80px) clamp(48px, 5.4vw, 64px) clamp(36px, 4vh, 46px) !important;
  border-width: 5px !important;
  border-radius: 40px !important;
  border-color:#d0dbef !important;
  background:
    radial-gradient(circle at 86% 9%, rgba(255,239,171,.24), transparent 16%),
    radial-gradient(circle at 14% 16%, rgba(255,255,255,.55), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,252,255,.92)) !important;
  box-shadow: 0 8px 0 rgba(113,126,163,.14), 0 24px 40px rgba(87,103,155,.10) !important;
}
#diMonsterGameRoot .category-grid{
  grid-template-columns: repeat(4, minmax(0,1fr)) !important;
  grid-template-rows: repeat(2, minmax(186px, 1fr)) !important;
  gap: clamp(16px, 1.8vw, 20px) !important;
}
#diMonsterGameRoot .category-card{
  min-height: 186px !important;
  grid-template-rows: auto auto auto auto auto !important;
  align-content: center !important;
  justify-items: center !important;
  gap: 4px !important;
  padding: 14px 10px 16px !important;
  border-width: 4px !important;
  border-radius: 28px !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,.98), rgba(255,255,255,.58) 28%, transparent 54%),
    linear-gradient(180deg, rgba(255,255,255,.99), rgba(251,252,255,.90)) !important;
  box-shadow: 0 6px 0 rgba(122,133,170,.12), 0 16px 30px rgba(90,103,153,.10) !important;
}
#diMonsterGameRoot .category-card::before{
  inset: 8px !important;
  border-radius: 20px !important;
  background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.22)) !important;
}
#diMonsterGameRoot .category-card::after{
  content:"";
  position:absolute;
  left:10px; right:10px; bottom:10px;
  height: 36%;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.18));
  pointer-events:none;
}
#diMonsterGameRoot .category-card:hover{
  transform: translateY(-6px) scale(1.01) !important;
  border-color:#b8c6ff !important;
  box-shadow: 0 10px 0 rgba(112,124,166,.14), 0 22px 40px rgba(90,103,153,.16) !important;
}
#diMonsterGameRoot .category-icon{
  font-size: clamp(34px, 4.2vh, 46px) !important;
  align-self: center !important;
  margin-top: 2px !important;
  margin-bottom: 1px !important;
  filter: drop-shadow(0 6px 10px rgba(89,97,138,.12)) !important;
}
#diMonsterGameRoot .category-name{
  font-size: clamp(15px, 1.55vw, 21px) !important;
  line-height: 1.03 !important;
  max-width: 92% !important;
  min-height: 42px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: balance;
}
#diMonsterGameRoot .category-subtitle{
  font-size: clamp(10px, .9vw, 12px) !important;
  line-height: 1.05 !important;
  margin-top: -1px !important;
}
#diMonsterGameRoot .category-progress{
  width: min(110px, 78%) !important;
  height: 7px !important;
  margin-top: 5px !important;
}
#diMonsterGameRoot .category-meta{
  font-size: 10px !important;
  line-height: 1.15 !important;
  margin-top: 4px !important;
  padding-bottom: 2px !important;
  white-space: nowrap !important;
}
#diMonsterGameRoot .category-count{
  min-width: 30px !important;
  width: 30px !important;
  height: 30px !important;
  top: 9px !important;
  right: 9px !important;
  font-size: 12px !important;
  font-weight: 1000 !important;
}
#diMonsterGameRoot .category-tick{
  left: 9px !important;
  top: 9px !important;
  width: 26px !important;
  height: 26px !important;
  font-size: 14px !important;
}
#diMonsterGameRoot .nav-arrow{
  width: 58px !important;
  height: 58px !important;
  border-width: 4px !important;
  color:#635ef1 !important;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,250,255,.96)) !important;
  box-shadow: 0 8px 0 rgba(113,126,163,.12), 0 18px 28px rgba(87,103,155,.14) !important;
}
#diMonsterGameRoot .nav-arrow:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 0 rgba(113,126,163,.12), 0 22px 34px rgba(87,103,155,.16) !important;
}
#diMonsterGameRoot .page-dots{
  gap: 10px !important;
  margin-top: 4px !important;
}
#diMonsterGameRoot .page-dots .dot{
  width: 13px !important;
  height: 13px !important;
  border: 2px solid #d4dff0 !important;
  background: rgba(255,255,255,.92) !important;
}
#diMonsterGameRoot .page-dots .dot.active{
  width: 38px !important;
  border-radius: 999px !important;
  border-color:#4e57d8 !important;
  background: linear-gradient(135deg,#5f57ef 0%,#19bfc4 100%) !important;
  box-shadow: 0 4px 10px rgba(95,87,239,.24) !important;
}

/* extra premium tint for category themes */
#diMonsterGameRoot .cat-theme-1{ background: linear-gradient(180deg,#fff,#fff5fa) !important; }
#diMonsterGameRoot .cat-theme-2{ background: linear-gradient(180deg,#fff,#eff7ff) !important; }
#diMonsterGameRoot .cat-theme-3{ background: linear-gradient(180deg,#fff,#effcf6) !important; }
#diMonsterGameRoot .cat-theme-4{ background: linear-gradient(180deg,#fff,#fff7ec) !important; }
#diMonsterGameRoot .cat-theme-5{ background: linear-gradient(180deg,#fff,#f6f1ff) !important; }
#diMonsterGameRoot .cat-theme-6{ background: linear-gradient(180deg,#fff,#fff2f7) !important; }
#diMonsterGameRoot .cat-theme-7{ background: linear-gradient(180deg,#fff,#effef9) !important; }
#diMonsterGameRoot .cat-theme-8{ background: linear-gradient(180deg,#fff,#f0f4ff) !important; }

@media (max-width: 1180px){
  #diMonsterGameRoot .category-panel{
    padding: 56px 26px 30px !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    grid-template-rows: repeat(4, minmax(154px, 1fr)) !important;
    gap: 12px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height: 154px !important;
    padding: 12px 9px 13px !important;
  }
  #diMonsterGameRoot .category-name{
    font-size: 18px !important;
    min-height: 38px !important;
  }
  #diMonsterGameRoot .category-subtitle{ font-size: 10px !important; }
}

@media (max-width: 680px){
  #diMonsterGameRoot .top-card{
    width: calc(100% - 24px) !important;
    min-height: 64px !important;
    padding: 8px 10px !important;
  }
  #diMonsterGameRoot .menu-btn{
    min-width: 136px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
  }
  #diMonsterGameRoot .select-title{
    width: min(92%, calc(100% - 36px)) !important;
    min-height: 58px !important;
    font-size: clamp(27px, 8vw, 40px) !important;
  }
  #diMonsterGameRoot .category-panel{
    padding: 50px 14px 22px !important;
    border-radius: 28px !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-rows: repeat(4, minmax(132px, 1fr)) !important;
    gap: 10px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height: 132px !important;
    border-radius: 22px !important;
    padding: 9px 7px 10px !important;
  }
  #diMonsterGameRoot .category-icon{ font-size: 28px !important; }
  #diMonsterGameRoot .category-name{ font-size: 15px !important; min-height: 32px !important; }
  #diMonsterGameRoot .category-subtitle{ font-size: 9px !important; }
  #diMonsterGameRoot .category-meta{ font-size: 8px !important; }
  #diMonsterGameRoot .category-progress{ width: min(84px, 80%) !important; height: 6px !important; }
  #diMonsterGameRoot .nav-arrow{ width: 48px !important; height: 48px !important; }
}

/* --- v5 fit fix: smaller category boxes inside container + cleaner premium look --- */
#diMonsterGameRoot .select-title{
  width: min(510px, calc(100% - 90px)) !important;
  min-height: clamp(58px, 7.4vh, 74px) !important;
  font-size: clamp(30px, 4vw, 52px) !important;
  margin-bottom: -26px !important;
}
#diMonsterGameRoot .category-panel{
  width: min(1080px, 100%) !important;
  padding: clamp(52px, 6.8vh, 68px) clamp(34px, 4.2vw, 48px) clamp(22px, 3vh, 30px) !important;
  border-radius: 38px !important;
  overflow: hidden !important;
}
#diMonsterGameRoot .category-grid{
  grid-template-columns: repeat(4, minmax(0,1fr)) !important;
  grid-template-rows: repeat(2, minmax(150px, 1fr)) !important;
  gap: clamp(12px, 1.5vw, 16px) !important;
  align-items: stretch !important;
}
#diMonsterGameRoot .category-card{
  min-height: 150px !important;
  padding: 10px 8px 11px !important;
  border-radius: 24px !important;
  border-width: 4px !important;
  gap: 3px !important;
  box-shadow: 0 5px 0 rgba(122,133,170,.11), 0 14px 26px rgba(90,103,153,.09) !important;
}
#diMonsterGameRoot .category-card::before{
  inset: 7px !important;
  border-radius: 18px !important;
}
#diMonsterGameRoot .category-card:hover{
  transform: translateY(-4px) scale(1.008) !important;
}
#diMonsterGameRoot .category-icon{
  font-size: clamp(30px, 3.8vh, 40px) !important;
  margin-top: 0 !important;
}
#diMonsterGameRoot .category-name{
  font-size: clamp(14px, 1.35vw, 19px) !important;
  min-height: 34px !important;
  max-width: 90% !important;
  line-height: 1.04 !important;
}
#diMonsterGameRoot .category-subtitle{
  font-size: clamp(9px, .82vw, 11px) !important;
}
#diMonsterGameRoot .category-progress{
  width: min(96px, 74%) !important;
  height: 6px !important;
  margin-top: 4px !important;
}
#diMonsterGameRoot .category-meta{
  font-size: 9px !important;
  margin-top: 3px !important;
}
#diMonsterGameRoot .category-count{
  min-width: 28px !important;
  width: 28px !important;
  height: 28px !important;
  top: 8px !important;
  right: 8px !important;
  font-size: 11px !important;
}
#diMonsterGameRoot .category-tick{
  width: 24px !important;
  height: 24px !important;
  top: 8px !important;
  left: 8px !important;
  font-size: 12px !important;
}
#diMonsterGameRoot .nav-arrow{
  width: 52px !important;
  height: 52px !important;
  top: 50% !important;
}
#diMonsterGameRoot .page-dots{
  margin-top: 2px !important;
  height: 22px !important;
}
#diMonsterGameRoot .page-dots .dot{
  width: 12px !important;
  height: 12px !important;
}
#diMonsterGameRoot .page-dots .dot.active{
  width: 34px !important;
}

/* extra polish */
#diMonsterGameRoot .category-panel{
  background:
    radial-gradient(circle at 84% 10%, rgba(255,239,171,.18), transparent 15%),
    radial-gradient(circle at 16% 12%, rgba(255,255,255,.45), transparent 14%),
    linear-gradient(180deg, rgba(255,255,255,.97), rgba(248,251,255,.93)) !important;
  box-shadow: 0 8px 0 rgba(113,126,163,.13), 0 22px 36px rgba(87,103,155,.09) !important;
}
#diMonsterGameRoot .category-card{
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,.96), rgba(255,255,255,.54) 28%, transparent 52%),
    linear-gradient(180deg, rgba(255,255,255,.99), rgba(250,252,255,.90)) !important;
}
#diMonsterGameRoot .category-name{
  color:#a34771 !important;
}
#diMonsterGameRoot .category-subtitle,
#diMonsterGameRoot .category-meta{
  color:#6e7890 !important;
}

@media (max-width: 1180px){
  #diMonsterGameRoot .category-panel{
    padding: 50px 22px 24px !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    grid-template-rows: repeat(4, minmax(138px, 1fr)) !important;
    gap: 10px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height: 138px !important;
    padding: 9px 7px 10px !important;
  }
  #diMonsterGameRoot .category-name{
    font-size: 16px !important;
    min-height: 32px !important;
  }
}

@media (max-width: 680px){
  #diMonsterGameRoot .select-title{
    min-height: 54px !important;
    font-size: clamp(26px, 7.5vw, 36px) !important;
  }
  #diMonsterGameRoot .category-panel{
    padding: 46px 12px 18px !important;
    border-radius: 28px !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-rows: repeat(4, minmax(122px, 1fr)) !important;
    gap: 8px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height: 122px !important;
    border-radius: 20px !important;
    padding: 8px 6px 8px !important;
  }
  #diMonsterGameRoot .category-icon{ font-size: 26px !important; }
  #diMonsterGameRoot .category-name{ font-size: 14px !important; min-height: 28px !important; }
  #diMonsterGameRoot .category-subtitle{ font-size: 8px !important; }
  #diMonsterGameRoot .category-meta{ font-size: 8px !important; }
  #diMonsterGameRoot .category-progress{ width: min(82px, 72%) !important; }
}

/* --- v6 monster reaction update: happy/sad response in big box --- */
#diMonsterGameRoot .monster-box{
  grid-template-rows: minmax(0,1fr) auto auto;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 16px 14px 14px;
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,.75), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(245,250,255,.92));
  transition: border-color .22s ease, box-shadow .22s ease, background .22s ease, transform .22s ease;
}
#diMonsterGameRoot .monster-box::before{
  content:"";
  position:absolute;
  inset:auto auto 12px 14px;
  width:68px;
  height:68px;
  border-radius:18px;
  background:rgba(223,239,247,.35);
  filter: blur(2px);
  pointer-events:none;
}
#diMonsterGameRoot .monster-bubble{
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 10px 26px rgba(255,255,255,.42), 0 14px 22px rgba(85,118,144,.12);
  transition: background .22s ease, transform .22s ease, box-shadow .22s ease;
}
#diMonsterGameRoot .monster-bubble::after{
  content:"";
  position:absolute;
  inset:18% 22% auto auto;
  width:26%;
  height:26%;
  border-radius:50%;
  background:rgba(255,255,255,.4);
  filter: blur(1px);
}
#diMonsterGameRoot .monster{
  transition: transform .2s ease, filter .2s ease;
}
#diMonsterGameRoot .monster-mood{
  position: relative;
  z-index: 1;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 92%;
  background: rgba(233,242,250,.88);
  color: #56657a;
  border: 2px solid rgba(177,201,218,.9);
  box-shadow: 0 6px 0 rgba(141,160,176,.12);
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 1000;
  line-height: 1.15;
}
#diMonsterGameRoot .monster-box.react-happy{
  border-color: #89d2a8;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.78), transparent 26%),
    linear-gradient(180deg, rgba(240,255,246,.98), rgba(232,255,239,.92));
  box-shadow: 0 7px 0 rgba(90,150,111,.14), 0 18px 30px rgba(77,142,103,.12);
}
#diMonsterGameRoot .monster-box.react-happy .monster-mood{
  background: rgba(222,255,233,.95);
  border-color: #91d8a9;
  color: #1d7f4a;
}
#diMonsterGameRoot .monster-bubble.react-happy{
  background: radial-gradient(circle at 36% 28%, #fffac7 0%, #dffff0 55%, #c2f2d7 100%);
  animation: monsterCelebrate .82s ease;
}
#diMonsterGameRoot .monster-box.react-happy .monster{
  transform: scale(1.12) rotate(-6deg);
  filter: drop-shadow(0 8px 0 rgba(29,127,74,.12));
}
#diMonsterGameRoot .monster-box.react-sad{
  border-color: #f0b2b2;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.72), transparent 26%),
    linear-gradient(180deg, rgba(255,246,246,.98), rgba(255,238,238,.93));
  box-shadow: 0 7px 0 rgba(174,121,121,.12), 0 18px 30px rgba(165,99,99,.1);
}
#diMonsterGameRoot .monster-box.react-sad .monster-mood{
  background: rgba(255,232,232,.95);
  border-color: #efb6b6;
  color: #a44d4d;
}
#diMonsterGameRoot .monster-bubble.react-sad{
  background: radial-gradient(circle at 36% 28%, #ffffff 0%, #ffe2e5 52%, #ffd0d3 100%);
  animation: monsterWobble .6s ease;
}
#diMonsterGameRoot .monster-box.react-sad .monster{
  transform: translateY(1px) scale(.98);
  filter: drop-shadow(0 8px 0 rgba(164,77,77,.12));
}
@keyframes monsterCelebrate{
  0%{ transform: translateY(0) scale(1) rotate(0deg); }
  28%{ transform: translateY(-10px) scale(1.08) rotate(-7deg); }
  56%{ transform: translateY(-4px) scale(1.04) rotate(6deg); }
  100%{ transform: translateY(0) scale(1) rotate(0deg); }
}
@keyframes monsterWobble{
  0%,100%{ transform: translateX(0) scale(1); }
  20%{ transform: translateX(-8px) rotate(-4deg); }
  40%{ transform: translateX(8px) rotate(4deg); }
  60%{ transform: translateX(-5px) rotate(-3deg); }
  80%{ transform: translateX(5px) rotate(3deg); }
}
@media (max-width: 920px){
  #diMonsterGameRoot .monster-box{
    gap: 8px;
    padding: 12px 10px 10px;
  }
  #diMonsterGameRoot .monster-mood{
    min-height: 34px;
    padding: 7px 12px;
    font-size: 12px;
  }
}

/* v47 professional admin user manager */
.auth-card-wide{
  max-width:980px;
  width:min(980px,94vw);
  max-height:92vh;
  overflow:hidden;
}
.auth-card-wide .auth-panel.active{min-height:0;}
.admin-modal-pro{gap:16px;min-height:0;}
.admin-modal-head-pro{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;}
.admin-modal-head-pro h4{font-size:1.35rem;margin:4px 0 4px;color:#16233c;}
.admin-modal-head-pro p{margin:0;color:#667085;font-size:14px;line-height:1.45;}
.admin-mini-stats{display:grid;grid-template-columns:repeat(3,minmax(78px,1fr));gap:10px;min-width:270px;}
.admin-mini-stats span{display:grid;gap:2px;padding:12px 14px;border-radius:18px;background:linear-gradient(180deg,#ffffff,#f4f7ff);border:1px solid #dce5f5;box-shadow:0 10px 22px rgba(38,64,113,.08);}
.admin-mini-stats strong{font-size:22px;color:#14284b;line-height:1;}
.admin-mini-stats small{font-size:12px;color:#667085;font-weight:800;text-transform:uppercase;letter-spacing:.04em;}
.admin-tools-row{display:flex;align-items:end;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px;border:1px solid #e5ecf7;border-radius:20px;background:#f8fbff;}
.admin-search-box{display:grid;gap:6px;flex:1;min-width:260px;}
.admin-search-box span,.admin-user-control label span{font-size:12px;text-transform:uppercase;letter-spacing:.05em;font-weight:900;color:#51637f;}
.admin-search-box input{width:100%;padding:12px 14px;border-radius:16px;border:1px solid #d4deef;background:#fff;color:#17365f;font:inherit;}
.admin-scroll-hint{padding:10px 12px;border-radius:999px;background:#fff7d1;border:1px solid #f0dc92;color:#6d5300;font-size:13px;font-weight:800;}
.admin-users-scroll{max-height:min(58vh,580px);overflow:auto;border:1px solid #d9e3f3;border-radius:22px;background:#f6f9ff;padding:10px;scrollbar-gutter:stable;}
.admin-users-scroll::-webkit-scrollbar{width:10px;height:10px;}
.admin-users-scroll::-webkit-scrollbar-thumb{background:#c6d4ea;border-radius:999px;border:2px solid #f6f9ff;}
.admin-user-list{display:grid;gap:10px;}
.admin-user-row{display:grid;grid-template-columns:minmax(230px,1.25fr) minmax(210px,.85fr) minmax(230px,1fr) minmax(245px,1fr);gap:12px;align-items:center;padding:14px;border:1px solid #dfe8f7;border-radius:20px;background:linear-gradient(180deg,#ffffff,#fbfdff);box-shadow:0 12px 26px rgba(20,45,86,.07);}
.admin-user-row.hidden{display:none;}
.admin-user-row.is-admin-row{background:linear-gradient(135deg,#fff8d8,#fffefd);border-color:#ead27b;}
.admin-user-main{display:flex;align-items:center;gap:12px;min-width:0;}
.admin-avatar{width:48px;height:48px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,#284f90,#4d7ce0);color:#fff;font-size:24px;box-shadow:0 12px 22px rgba(45,92,170,.22);flex:0 0 auto;}
.admin-user-copy{min-width:0;display:grid;gap:4px;}
.admin-user-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.admin-user-title strong{font-size:16px;color:#10213f;word-break:break-word;}
.admin-user-email{font-size:14px;color:#51637f;word-break:break-word;}
.role-pill{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;background:#eaf1ff;color:#284f87;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.04em;}
.role-pill.role-admin{background:#ffe997;color:#5e4700;}
.admin-user-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;}
.admin-user-metrics span{display:grid;gap:2px;padding:10px;border-radius:16px;background:#f8fbff;border:1px solid #e0e9f7;text-align:center;}
.admin-user-metrics strong{font-size:18px;color:#14335f;line-height:1;}
.admin-user-metrics small,.admin-user-status small{font-size:11px;color:#667085;font-weight:900;text-transform:uppercase;letter-spacing:.04em;}
.admin-user-status{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;}
.admin-user-status>div{display:grid;align-content:center;gap:6px;min-height:62px;padding:10px;border-radius:16px;background:#fff;border:1px solid #e2eaf7;}
.admin-user-control{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end;}
.admin-user-control label{display:grid;gap:6px;min-width:0;}
.admin-temp-pass{width:100%;min-width:0;padding:11px 12px;border-radius:14px;border:1px solid #cad4e5;background:#fffef5;color:#17365f;font:inherit;}
.admin-actions-pro{display:flex;gap:8px;flex-wrap:nowrap;margin-top:0;}
.admin-actions-pro .secondary-btn{padding:10px 12px;min-width:76px;}
.secondary-btn.danger-soft{background:#fff1f2;border:1px solid #fecdd3;color:#b42318;}
.status-badge.success{background:#e8f8ee;color:#176337;}
@media (max-width:960px){
  .auth-card-wide{width:min(94vw,760px);}
  .admin-modal-head-pro{flex-direction:column;}
  .admin-mini-stats{width:100%;min-width:0;}
  .admin-user-row{grid-template-columns:1fr;}
  .admin-user-control{grid-template-columns:1fr;}
  .admin-actions-pro{flex-wrap:wrap;}
  .admin-user-status{grid-template-columns:1fr 1fr 1fr;}
}
@media (max-width:620px){
  .auth-card-wide{width:96vw;max-height:94vh;padding:14px;border-radius:20px;}
  .admin-mini-stats,.admin-user-metrics,.admin-user-status{grid-template-columns:1fr;}
  .admin-users-scroll{max-height:56vh;padding:8px;}
  .admin-user-row{padding:12px;border-radius:18px;}
}
body[data-theme="dark"] .admin-modal-head-pro h4,
body[data-theme="dark"] .admin-user-title strong,
body[data-theme="dark"] .admin-mini-stats strong,
body[data-theme="dark"] .admin-user-metrics strong{color:#eef4ff;}
body[data-theme="dark"] .admin-modal-head-pro p,
body[data-theme="dark"] .admin-user-email,
body[data-theme="dark"] .admin-mini-stats small,
body[data-theme="dark"] .admin-user-metrics small,
body[data-theme="dark"] .admin-user-status small{color:#a9bad8;}
body[data-theme="dark"] .admin-tools-row,
body[data-theme="dark"] .admin-users-scroll,
body[data-theme="dark"] .admin-user-row,
body[data-theme="dark"] .admin-mini-stats span,
body[data-theme="dark"] .admin-user-metrics span,
body[data-theme="dark"] .admin-user-status>div{background:linear-gradient(180deg,#14233c 0%,#0e1a30 100%) !important;border-color:rgba(132,174,255,.24) !important;color:#eef4ff;}
body[data-theme="dark"] .admin-user-row.is-admin-row{background:linear-gradient(180deg,#1f2940 0%,#121f34 100%) !important;border-color:rgba(255,226,135,.35) !important;}
body[data-theme="dark"] .admin-search-box input,
body[data-theme="dark"] .admin-temp-pass{background:linear-gradient(180deg,#14233c 0%,#0e1a30 100%) !important;color:#eef4ff !important;border-color:rgba(132,174,255,.26) !important;}
body[data-theme="dark"] .secondary-btn.danger-soft{background:linear-gradient(180deg,#3a1720,#281018) !important;color:#ffd6dc !important;border-color:rgba(255,125,145,.35) !important;}
body[data-theme="dark"] .admin-scroll-hint{background:linear-gradient(180deg,#2a2440,#171f32) !important;color:#ffeeb0 !important;border-color:rgba(255,224,120,.28) !important;}

/* v61 admin user manager overlap fix + cleaner layout */
.admin-modal-pro{
  gap:18px;
}
.admin-modal-head-pro{
  padding-bottom:2px;
}
.admin-modal-head-pro h4{
  font-size:1.45rem;
  margin:4px 0 6px;
}
.admin-modal-head-pro p{
  max-width:760px;
}
.admin-tools-row{
  padding:14px;
  border-radius:22px;
  background:linear-gradient(180deg,#f9fbff 0%,#f4f8ff 100%);
}
.admin-search-box input{
  min-height:54px;
  font-weight:700;
}
.admin-users-scroll{
  max-height:min(60vh,620px);
  padding:14px;
  background:linear-gradient(180deg,#f7faff 0%,#f1f6ff 100%);
}
.admin-user-list{
  gap:14px;
}
.admin-user-row{
  grid-template-columns:minmax(240px,1.1fr) minmax(300px,1.2fr) minmax(240px,.9fr);
  grid-template-areas:
    "main metrics control"
    "main status  control";
  gap:14px 16px;
  align-items:stretch;
  padding:16px;
  border-radius:22px;
}
.admin-user-main{grid-area:main;align-self:center;}
.admin-user-metrics{grid-area:metrics;grid-template-columns:repeat(3,minmax(0,1fr));align-self:start;}
.admin-user-status{grid-area:status;grid-template-columns:repeat(3,minmax(0,1fr));align-self:start;}
.admin-user-metrics span,
.admin-user-status > div{
  min-width:0;
}
.admin-user-status > div,
.admin-user-metrics span{
  min-height:78px;
}
.admin-user-control{
  grid-area:control;
  grid-template-columns:1fr;
  gap:12px;
  align-items:stretch;
  align-content:start;
  padding:14px;
  border-radius:18px;
  background:linear-gradient(180deg,#f9fbff 0%,#f4f8ff 100%);
  border:1px solid #dbe5f5;
  min-width:0;
}
.admin-user-control label{
  gap:8px;
}
.admin-user-control label span{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.admin-user-control label span::after{
  content:'manual reset';
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border-radius:999px;
  background:#eef3ff;
  color:#34548a;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
  flex:0 0 auto;
}
.admin-temp-pass{
  min-height:48px;
  padding:12px 14px;
  font-weight:800;
  letter-spacing:.02em;
}
.admin-actions-pro{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  width:100%;
}
.admin-actions-pro .secondary-btn{
  width:100%;
  min-width:0;
  min-height:46px;
  padding:11px 12px;
  border-radius:14px;
}
.secondary-btn.danger-soft{
  font-weight:800;
}
@media (max-width:1180px){
  .admin-user-row{
    grid-template-columns:minmax(0,1fr) minmax(250px,.85fr);
    grid-template-areas:
      "main control"
      "metrics control"
      "status control";
  }
}
@media (max-width:880px){
  .admin-modal-head-pro,
  .admin-tools-row{
    gap:14px;
  }
  .admin-user-row{
    grid-template-columns:1fr;
    grid-template-areas:
      "main"
      "metrics"
      "status"
      "control";
  }
  .admin-user-control{
    padding:12px;
  }
}
@media (max-width:620px){
  .admin-users-scroll{
    padding:10px;
  }
  .admin-user-row{
    padding:14px;
    border-radius:18px;
  }
  .admin-mini-stats,
  .admin-user-metrics,
  .admin-user-status,
  .admin-actions-pro{
    grid-template-columns:1fr;
  }
  .admin-user-control label span{
    flex-wrap:wrap;
  }
}
body[data-theme="dark"] .admin-tools-row,
body[data-theme="dark"] .admin-users-scroll,
body[data-theme="dark"] .admin-user-control{
  background:linear-gradient(180deg,#13233c 0%,#0e1a30 100%) !important;
  border-color:rgba(132,174,255,.24) !important;
}
body[data-theme="dark"] .admin-user-control label span::after{
  background:rgba(116,154,255,.16) !important;
  color:#d8e6ff !important;
}

/* v62 admin scroll fix + colorful stats + stronger game responsiveness */
.auth-card-wide{
  overflow:auto !important;
  overscroll-behavior:contain;
}
.auth-card-wide .auth-panel.active{
  max-height:calc(92vh - 132px);
  overflow:auto;
  padding-right:2px;
  scrollbar-gutter:stable;
}
.auth-card-wide .auth-panel.active::-webkit-scrollbar{
  width:9px;
}
.auth-card-wide .auth-panel.active::-webkit-scrollbar-thumb{
  background:#c9d7ec;
  border-radius:999px;
}
.admin-users-scroll{
  overflow-y:auto !important;
  overflow-x:hidden !important;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y;
  overscroll-behavior:contain;
  scroll-behavior:smooth;
  min-height:220px;
}
.admin-mini-stats span:nth-child(1){
  background:linear-gradient(180deg,#ffffff 0%,#eef4ff 100%) !important;
  border-color:#cfdcf5 !important;
}
.admin-mini-stats span:nth-child(2){
  background:linear-gradient(180deg,#ffffff 0%,#fff6de 100%) !important;
  border-color:#f0ddb0 !important;
}
.admin-mini-stats span:nth-child(3){
  background:linear-gradient(180deg,#ffffff 0%,#eefcf2 100%) !important;
  border-color:#cfe9d7 !important;
}
.admin-user-metrics span:nth-child(1){
  background:linear-gradient(180deg,#fffdf2 0%,#fff3c8 100%) !important;
  border-color:#ecd88b !important;
}
.admin-user-metrics span:nth-child(2){
  background:linear-gradient(180deg,#f6fbff 0%,#dff1ff 100%) !important;
  border-color:#b8daf6 !important;
}
.admin-user-metrics span:nth-child(3){
  background:linear-gradient(180deg,#faf6ff 0%,#ece0ff 100%) !important;
  border-color:#d3bef7 !important;
}
.admin-user-status > div:nth-child(1){
  background:linear-gradient(180deg,#fff9ec 0%,#fff3d6 100%) !important;
  border-color:#f0dfb0 !important;
}
.admin-user-status > div:nth-child(2){
  background:linear-gradient(180deg,#f1f7ff 0%,#e2eeff 100%) !important;
  border-color:#c7d8fb !important;
}
.admin-user-status > div:nth-child(3){
  background:linear-gradient(180deg,#f6fff8 0%,#e4f7ea 100%) !important;
  border-color:#c8e6d1 !important;
}
.admin-user-control{
  background:linear-gradient(180deg,#ffffff 0%,#f7faff 100%) !important;
}
@media (max-width:620px){
  .auth-card-wide{
    max-height:94vh;
  }
  .auth-card-wide .auth-panel.active{
    max-height:calc(94vh - 118px);
  }
}
body[data-theme="dark"] .admin-mini-stats span:nth-child(1),
body[data-theme="dark"] .admin-user-metrics span:nth-child(2),
body[data-theme="dark"] .admin-user-status > div:nth-child(2){
  background:linear-gradient(180deg,#16304e 0%,#12263f 100%) !important;
}
body[data-theme="dark"] .admin-mini-stats span:nth-child(2),
body[data-theme="dark"] .admin-user-metrics span:nth-child(1),
body[data-theme="dark"] .admin-user-status > div:nth-child(1){
  background:linear-gradient(180deg,#3a2f12 0%,#26200f 100%) !important;
}
body[data-theme="dark"] .admin-mini-stats span:nth-child(3),
body[data-theme="dark"] .admin-user-metrics span:nth-child(3),
body[data-theme="dark"] .admin-user-status > div:nth-child(3){
  background:linear-gradient(180deg,#173625 0%,#10271a 100%) !important;
}

/* embedded game final responsive fit */
#screen-game{
  overflow:visible !important;
}
.di-game-embed-shell{
  width:min(1120px,100%) !important;
  padding:clamp(4px,1vw,10px) !important;
}
#diMonsterGameRoot{
  width:100% !important;
  max-width:1120px !important;
  height:auto !important;
  min-height:clamp(560px, calc(100svh - 112px), 760px) !important;
  overflow:hidden !important;
}
#diMonsterGameRoot .di-game-app{
  width:min(100%, 1120px) !important;
  height:auto !important;
  min-height:inherit;
  padding:clamp(8px,1vw,12px) !important;
}
#diMonsterGameRoot .di-game-screen,
#diMonsterGameRoot .di-game-screen.is-active{
  height:auto !important;
}
#diMonsterGameRoot .select-wrap{
  min-height:0;
  padding-bottom:10px;
}
#diMonsterGameRoot .select-title{
  width:min(520px, calc(100% - 88px)) !important;
  margin:0 auto -24px !important;
  min-height:clamp(56px, 7vw, 74px) !important;
  font-size:clamp(28px, 4.6vw, 52px) !important;
}
#diMonsterGameRoot .category-panel{
  width:min(1080px,100%) !important;
  height:auto !important;
  min-height:0 !important;
  padding:clamp(48px, 6vh, 62px) clamp(18px, 3vw, 34px) clamp(22px, 3vh, 28px) !important;
  border-radius:34px !important;
}
#diMonsterGameRoot .category-grid{
  grid-template-columns:repeat(4, minmax(0,1fr)) !important;
  grid-template-rows:none !important;
  align-content:start !important;
  gap:clamp(10px, 1.6vw, 16px) !important;
}
#diMonsterGameRoot .category-card{
  min-height:clamp(122px, 16vw, 148px) !important;
  padding:10px 8px 11px !important;
}
#diMonsterGameRoot .category-name{
  min-height:32px !important;
}
#diMonsterGameRoot .category-progress{
  width:min(92px, 76%) !important;
}
#diMonsterGameRoot .nav-arrow{
  z-index:12 !important;
}
#diMonsterGameRoot .cat-theme-1{ background:linear-gradient(180deg,#fff8fb 0%,#ffe6f0 100%) !important; border-color:#f0bfd2 !important; }
#diMonsterGameRoot .cat-theme-2{ background:linear-gradient(180deg,#f6fbff 0%,#dff0ff 100%) !important; border-color:#b8d8f4 !important; }
#diMonsterGameRoot .cat-theme-3{ background:linear-gradient(180deg,#f6fff9 0%,#def7e6 100%) !important; border-color:#bfe4cb !important; }
#diMonsterGameRoot .cat-theme-4{ background:linear-gradient(180deg,#fffaf1 0%,#ffeac7 100%) !important; border-color:#efd39d !important; }
#diMonsterGameRoot .cat-theme-5{ background:linear-gradient(180deg,#faf7ff 0%,#eadfff 100%) !important; border-color:#d1c0f4 !important; }
#diMonsterGameRoot .cat-theme-6{ background:linear-gradient(180deg,#fff8fc 0%,#ffe0ef 100%) !important; border-color:#f2bfd9 !important; }
#diMonsterGameRoot .cat-theme-7{ background:linear-gradient(180deg,#f7fffb 0%,#daf8ef 100%) !important; border-color:#bde6d8 !important; }
#diMonsterGameRoot .cat-theme-8{ background:linear-gradient(180deg,#f7f9ff 0%,#dde6ff 100%) !important; border-color:#bdcbf5 !important; }
#diMonsterGameRoot .cat-theme-1 .category-name{ color:#b04576 !important; }
#diMonsterGameRoot .cat-theme-2 .category-name{ color:#2e77af !important; }
#diMonsterGameRoot .cat-theme-3 .category-name{ color:#2f8c57 !important; }
#diMonsterGameRoot .cat-theme-4 .category-name{ color:#b46d13 !important; }
#diMonsterGameRoot .cat-theme-5 .category-name{ color:#7550c7 !important; }
#diMonsterGameRoot .cat-theme-6 .category-name{ color:#c34f8b !important; }
#diMonsterGameRoot .cat-theme-7 .category-name{ color:#14806f !important; }
#diMonsterGameRoot .cat-theme-8 .category-name{ color:#4565c6 !important; }

@media (max-width:1100px){
  #diMonsterGameRoot .category-grid{
    grid-template-columns:repeat(3, minmax(0,1fr)) !important;
  }
}
@media (max-width:860px){
  #diMonsterGameRoot{
    min-height:clamp(620px, calc(100svh - 96px), 860px) !important;
  }
  #diMonsterGameRoot .top-card{
    width:calc(100% - 16px) !important;
  }
  #diMonsterGameRoot .select-title{
    width:min(92%, calc(100% - 32px)) !important;
    margin-bottom:-20px !important;
  }
  #diMonsterGameRoot .category-panel{
    padding:44px 14px 18px !important;
    border-radius:26px !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
    gap:10px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height:128px !important;
    border-radius:20px !important;
  }
  #diMonsterGameRoot .nav-arrow{
    width:46px !important;
    height:46px !important;
    top:auto !important;
    bottom:42px !important;
    translate:0 0 !important;
  }
  #diMonsterGameRoot .nav-left{ left:8px !important; }
  #diMonsterGameRoot .nav-right{ right:8px !important; }
}
@media (max-width:520px){
  #screen-game{
    padding-bottom:8px !important;
  }
  .di-game-embed-shell{
    padding:2px !important;
  }
  #diMonsterGameRoot{
    border-radius:22px !important;
    min-height:680px !important;
  }
  #diMonsterGameRoot .top-card{
    min-height:60px !important;
    padding:8px 8px !important;
  }
  #diMonsterGameRoot .brand-text strong{
    font-size:clamp(18px, 5vw, 24px) !important;
  }
  #diMonsterGameRoot .brand-text span{
    font-size:11px !important;
  }
  #diMonsterGameRoot .menu-btn{
    min-width:118px !important;
    padding:8px 10px !important;
    font-size:13px !important;
  }
  #diMonsterGameRoot .select-title{
    min-height:52px !important;
    font-size:clamp(24px, 8vw, 34px) !important;
  }
  #diMonsterGameRoot .category-grid{
    gap:8px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height:118px !important;
    padding:8px 6px 8px !important;
  }
  #diMonsterGameRoot .category-icon{
    font-size:24px !important;
  }
  #diMonsterGameRoot .category-name{
    font-size:13px !important;
    min-height:26px !important;
  }
  #diMonsterGameRoot .category-subtitle,
  #diMonsterGameRoot .category-meta{
    font-size:8px !important;
  }
  #diMonsterGameRoot .category-progress{
    width:min(78px, 72%) !important;
  }
  #diMonsterGameRoot .nav-arrow{
    width:42px !important;
    height:42px !important;
    bottom:38px !important;
    font-size:34px !important;
  }
  #diMonsterGameRoot .page-dots{
    height:20px !important;
    margin-top:4px !important;
  }
}
@media (max-width:380px){
  #diMonsterGameRoot .category-grid{
    grid-template-columns:1fr !important;
  }
  #diMonsterGameRoot .category-card{
    min-height:104px !important;
  }
  #diMonsterGameRoot .nav-arrow{
    bottom:34px !important;
  }
}

/* v63 game container bigger + cleaner fit */
.di-game-embed-shell{
  width:min(1260px, 100%) !important;
  padding:clamp(6px, 1.2vw, 14px) !important;
}
#diMonsterGameRoot{
  max-width:1240px !important;
  min-height:clamp(700px, calc(100svh - 92px), 860px) !important;
  border-radius:30px !important;
}
#diMonsterGameRoot .di-game-app{
  width:min(100%, 1200px) !important;
  padding:clamp(10px, 1.2vw, 16px) !important;
}
#diMonsterGameRoot .select-title{
  width:min(620px, calc(100% - 110px)) !important;
  min-height:clamp(62px, 7vw, 86px) !important;
  font-size:clamp(30px, 4.3vw, 58px) !important;
  margin:0 auto -26px !important;
}
#diMonsterGameRoot .category-panel{
  width:min(1160px, 100%) !important;
  padding:clamp(54px, 6vh, 72px) clamp(22px, 3vw, 42px) clamp(26px, 3vh, 36px) !important;
  border-radius:38px !important;
}
#diMonsterGameRoot .category-grid{
  grid-template-columns:repeat(4, minmax(0,1fr)) !important;
  gap:clamp(12px, 1.7vw, 18px) !important;
}
#diMonsterGameRoot .category-card{
  min-height:clamp(145px, 18vw, 178px) !important;
  padding:12px 10px 13px !important;
  border-radius:26px !important;
}
#diMonsterGameRoot .category-icon{
  font-size:clamp(30px, 4.2vh, 44px) !important;
}
#diMonsterGameRoot .category-name{
  font-size:clamp(15px, 1.5vw, 22px) !important;
  min-height:36px !important;
}
#diMonsterGameRoot .category-subtitle{
  font-size:clamp(9px, .9vw, 12px) !important;
}
#diMonsterGameRoot .category-progress{
  width:min(108px, 76%) !important;
}
#diMonsterGameRoot .nav-arrow{
  width:54px !important;
  height:54px !important;
}
@media (max-width:1100px){
  #diMonsterGameRoot{
    min-height:clamp(720px, calc(100svh - 90px), 960px) !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-columns:repeat(3, minmax(0,1fr)) !important;
  }
  #diMonsterGameRoot .category-card{
    min-height:150px !important;
  }
}
@media (max-width:860px){
  .di-game-embed-shell{
    width:min(860px, 100%) !important;
    padding:6px !important;
  }
  #diMonsterGameRoot{
    min-height:760px !important;
    border-radius:24px !important;
  }
  #diMonsterGameRoot .select-title{
    width:min(94%, calc(100% - 28px)) !important;
    min-height:58px !important;
    font-size:clamp(26px, 7vw, 40px) !important;
    margin-bottom:-20px !important;
  }
  #diMonsterGameRoot .category-panel{
    padding:46px 14px 22px !important;
    border-radius:28px !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
    gap:10px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height:134px !important;
    padding:10px 8px !important;
  }
}
@media (max-width:520px){
  .di-game-embed-shell{
    width:100% !important;
    padding:2px !important;
  }
  #diMonsterGameRoot{
    min-height:700px !important;
    border-radius:20px !important;
  }
  #diMonsterGameRoot .category-grid{
    gap:8px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height:122px !important;
    border-radius:20px !important;
  }
  #diMonsterGameRoot .category-name{
    font-size:14px !important;
    min-height:28px !important;
  }
  #diMonsterGameRoot .category-progress{
    width:min(82px, 72%) !important;
  }
}

/* v64 community premium narrower layout + larger game container */
#screen-community{
  padding-top: 6px !important;
}
#screen-community .community-layout{
  width: min(1280px, calc(100% - 56px)) !important;
  margin: 0 auto !important;
  gap: 20px !important;
}
#screen-community .panel{
  max-width: 1220px !important;
  margin: 0 auto !important;
  border-radius: 32px !important;
  padding: 22px 22px 24px !important;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.96)) !important;
  border: 1px solid #d8e4f6 !important;
  box-shadow: 0 18px 40px rgba(21,34,64,.06) !important;
}
#screen-community .section-head{
  margin-bottom: 16px !important;
}
#screen-community .section-head h2{
  font-size: clamp(34px, 3.8vw, 58px) !important;
  letter-spacing: -.04em !important;
}
#screen-community .section-head p{
  color: #6b7b94 !important;
  max-width: 760px !important;
}
#screen-community .compact-community-top-grid,
#screen-community .compact-community-main-grid,
#screen-community .compact-summary-grid,
#screen-community .compact-summary-grid-six{
  width: 100% !important;
}
#screen-community .community-composer,
#screen-community .community-composer-v2,
#screen-community .modern-composer{
  max-width: 1180px !important;
  margin: 18px auto 20px !important;
  padding: 16px !important;
  border-radius: 26px !important;
  background: linear-gradient(180deg,#fffdf4,#fff8df) !important;
  border: 1px solid #ecd27d !important;
  box-shadow: 0 12px 24px rgba(196,160,51,.08) !important;
}
#screen-community .community-feed{
  max-width: 1180px !important;
  margin: 0 auto !important;
  gap: 16px !important;
}
#screen-community .community-post,
#screen-community .compact-community-post,
#screen-community .thread-card,
#screen-community .post-card,
#screen-community .feed-card{
  border-radius: 24px !important;
}
#screen-community .community-stat-card,
#screen-community .summary-chip,
#screen-community .limit-pill,
#screen-community .community-account-card,
#screen-community .community-user-summary{
  border-radius: 22px !important;
}
@media (max-width: 900px){
  #screen-community .community-layout{
    width: min(100%, calc(100% - 18px)) !important;
  }
  #screen-community .panel{
    padding: 16px 14px 18px !important;
    border-radius: 24px !important;
  }
  #screen-community .section-head h2{
    font-size: clamp(28px, 8vw, 40px) !important;
  }
}

/* make game selection area larger and more spacious */
.di-game-embed-shell{
  width: min(1340px, 100%) !important;
  padding: clamp(8px, 1.3vw, 16px) !important;
}
#diMonsterGameRoot{
  max-width: 1300px !important;
  min-height: clamp(760px, calc(100svh - 84px), 940px) !important;
  border-radius: 34px !important;
}
#diMonsterGameRoot .di-game-app{
  width: min(100%, 1260px) !important;
  padding: clamp(12px, 1.4vw, 18px) !important;
}
#diMonsterGameRoot .select-title{
  width: min(660px, calc(100% - 112px)) !important;
  min-height: clamp(68px, 7.5vw, 92px) !important;
  font-size: clamp(34px, 4.6vw, 62px) !important;
  margin: 0 auto -30px !important;
}
#diMonsterGameRoot .category-panel{
  width: min(1220px, 100%) !important;
  padding: clamp(62px, 6.6vh, 82px) clamp(24px, 3.4vw, 48px) clamp(28px, 3vh, 38px) !important;
  border-radius: 42px !important;
}
#diMonsterGameRoot .category-grid{
  grid-template-columns: repeat(4, minmax(0,1fr)) !important;
  gap: clamp(14px, 1.8vw, 20px) !important;
}
#diMonsterGameRoot .category-card{
  min-height: clamp(165px, 19vw, 198px) !important;
  padding: 14px 12px 15px !important;
  border-radius: 28px !important;
}
#diMonsterGameRoot .category-icon{
  font-size: clamp(34px, 4.6vh, 50px) !important;
}
#diMonsterGameRoot .category-name{
  font-size: clamp(16px, 1.6vw, 24px) !important;
  min-height: 40px !important;
}
#diMonsterGameRoot .category-subtitle{
  font-size: clamp(10px, .95vw, 13px) !important;
}
#diMonsterGameRoot .category-progress{
  width: min(116px, 76%) !important;
  height: 7px !important;
}
#diMonsterGameRoot .category-meta{
  font-size: 10px !important;
}
#diMonsterGameRoot .nav-arrow{
  width: 58px !important;
  height: 58px !important;
}
@media (max-width: 1100px){
  #diMonsterGameRoot{
    min-height: 820px !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
  }
  #diMonsterGameRoot .category-card{
    min-height: 160px !important;
  }
}
@media (max-width: 860px){
  .di-game-embed-shell{
    width: min(920px, 100%) !important;
    padding: 6px !important;
  }
  #diMonsterGameRoot{
    min-height: 780px !important;
    border-radius: 26px !important;
  }
  #diMonsterGameRoot .select-title{
    width: min(95%, calc(100% - 28px)) !important;
    min-height: 60px !important;
    font-size: clamp(28px, 7.5vw, 42px) !important;
    margin-bottom: -22px !important;
  }
  #diMonsterGameRoot .category-panel{
    padding: 50px 16px 24px !important;
    border-radius: 30px !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 12px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height: 142px !important;
    padding: 11px 8px !important;
  }
}
@media (max-width: 520px){
  #diMonsterGameRoot{
    min-height: 730px !important;
    border-radius: 22px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height: 128px !important;
  }
  #diMonsterGameRoot .category-name{
    font-size: 14px !important;
    min-height: 28px !important;
  }
}

/* v65 single-scroll admin modal + cleaner premium account manager */
body.auth-modal-open{
  overflow:hidden !important;
}
.auth-modal{
  padding:16px;
  overflow:hidden;
}
.auth-card-wide{
  width:min(1080px, 95vw) !important;
  max-width:1080px !important;
  max-height:min(92vh, 900px) !important;
  overflow:hidden !important;
  display:grid !important;
  grid-template-rows:auto auto minmax(0,1fr) !important;
  gap:14px !important;
  border-radius:28px !important;
}
.auth-card-wide .auth-panel.active{
  display:grid !important;
  min-height:0 !important;
  max-height:none !important;
  overflow:visible !important;
  align-content:start;
}
.auth-card-wide .auth-tabs{
  position:sticky;
  top:0;
  z-index:5;
  background:#f6f7fb;
}
.admin-modal-pro{
  min-height:0 !important;
  height:100%;
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr);
}
.admin-modal-head-pro{
  align-items:center !important;
  padding-right:4px;
}
.admin-modal-head-pro p{
  max-width:720px !important;
}
.admin-mini-stats{
  min-width:320px !important;
}
.admin-tools-row{
  position:sticky;
  top:0;
  z-index:4;
  box-shadow:0 10px 24px rgba(36,61,108,.06);
}
.admin-users-scroll{
  flex:1 1 auto;
  max-height:none !important;
  height:100%;
  min-height:320px;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  padding:14px !important;
  border-radius:24px !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}
.admin-user-list{
  padding-right:4px;
}
.admin-user-row{
  border-radius:24px !important;
  box-shadow:0 14px 28px rgba(20,45,86,.06) !important;
}
.admin-user-row:not(:last-child){
  margin-bottom:2px;
}
.admin-user-control{
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}
.admin-scroll-hint{
  white-space:nowrap;
  font-size:12px;
}
@media (max-width:960px){
  .auth-modal{
    padding:10px;
  }
  .auth-card-wide{
    width:min(100vw - 12px, 940px) !important;
    max-height:94vh !important;
  }
  .admin-modal-pro{
    grid-template-rows:auto auto minmax(0,1fr);
  }
  .admin-mini-stats{
    min-width:0 !important;
  }
}
@media (max-width:620px){
  .auth-card-wide{
    width:calc(100vw - 10px) !important;
    max-height:95vh !important;
    padding:12px !important;
    border-radius:22px !important;
  }
  .auth-card-wide .auth-tabs{
    position:static;
  }
  .admin-modal-pro{
    gap:12px !important;
  }
  .admin-tools-row{
    position:static;
  }
  .admin-users-scroll{
    min-height:260px;
    padding:10px !important;
  }
}
body[data-theme="dark"].auth-modal-open{
  overflow:hidden !important;
}

/* v66 wider game cards + more professional community info copy */
#screen-community .community-info-bar{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  max-width:1180px !important;
  margin:0 auto 16px !important;
  gap:14px !important;
}
#screen-community .community-info-chip{
  padding:16px 18px !important;
  border-radius:20px !important;
  background:linear-gradient(180deg,#fffdfa 0%,#fff7e8 100%) !important;
  border:1px solid #ead9a8 !important;
  box-shadow:0 12px 24px rgba(165,131,40,.08) !important;
}
#screen-community .community-info-chip strong{
  font-size:15px !important;
  color:#6d4f00 !important;
  margin-bottom:4px !important;
}
#screen-community .community-info-chip span{
  color:#6a7389 !important;
  line-height:1.5 !important;
}

body[data-active-screen="game"] .content{
  padding-left:4px !important;
  padding-right:4px !important;
}
.di-game-embed-shell{
  width:min(1420px, calc(100vw - 8px)) !important;
  max-width:1420px !important;
  padding:clamp(8px, 1vw, 14px) !important;
}
#diMonsterGameRoot{
  width:100% !important;
  max-width:1380px !important;
  min-height:clamp(780px, calc(100svh - 72px), 960px) !important;
}
#diMonsterGameRoot .di-game-app{
  width:min(100%, 1360px) !important;
  padding:clamp(12px, 1.2vw, 18px) !important;
}
#diMonsterGameRoot .select-wrap{
  padding-inline:4px !important;
}
#diMonsterGameRoot .category-panel{
  width:min(1300px, 100%) !important;
  padding:clamp(64px, 6.4vh, 84px) clamp(14px, 2vw, 26px) clamp(28px, 3vh, 36px) !important;
}
#diMonsterGameRoot .category-grid{
  grid-template-columns:repeat(4, minmax(0,1fr)) !important;
  gap:clamp(12px, 1.4vw, 16px) !important;
}
#diMonsterGameRoot .category-card{
  min-height:clamp(172px, 18vw, 204px) !important;
  padding:14px 10px 15px !important;
  border-radius:30px !important;
}
#diMonsterGameRoot .category-name{
  font-size:clamp(16px, 1.35vw, 22px) !important;
  line-height:1.04 !important;
}
#diMonsterGameRoot .category-subtitle{
  font-size:clamp(10px, .8vw, 12px) !important;
}
#diMonsterGameRoot .category-progress{
  width:min(112px, 74%) !important;
}
#diMonsterGameRoot .nav-left{
  left:10px !important;
}
#diMonsterGameRoot .nav-right{
  right:10px !important;
}
@media (max-width:1180px){
  .di-game-embed-shell{
    width:min(1180px, calc(100vw - 10px)) !important;
  }
  #diMonsterGameRoot{
    max-width:1180px !important;
    min-height:820px !important;
  }
  #diMonsterGameRoot .category-panel{
    width:min(1120px, 100%) !important;
    padding-inline:14px !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-columns:repeat(4, minmax(0,1fr)) !important;
    gap:12px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height:158px !important;
  }
}
@media (max-width:900px){
  #screen-community .community-info-bar{
    grid-template-columns:1fr !important;
  }
  .di-game-embed-shell{
    width:min(980px, calc(100vw - 10px)) !important;
  }
  #diMonsterGameRoot{
    min-height:790px !important;
  }
  #diMonsterGameRoot .category-panel{
    width:min(940px,100%) !important;
    padding:52px 12px 22px !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
    gap:12px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height:148px !important;
  }
}
@media (max-width:520px){
  body[data-active-screen="game"] .content{
    padding-left:2px !important;
    padding-right:2px !important;
  }
  .di-game-embed-shell{
    width:calc(100vw - 4px) !important;
    padding:2px !important;
  }
  #diMonsterGameRoot{
    min-height:736px !important;
  }
  #diMonsterGameRoot .category-panel{
    padding:48px 10px 18px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height:130px !important;
  }
}

/* v67 route-refresh + compact game + single-scroll admin fixes */
html,
body,
.app-shell,
.content{
  max-width:100%;
  overflow-x:hidden;
}
body[data-active-screen="game"] .content{
  width:100%;
  max-width:100vw;
  padding-left:clamp(4px, .8vw, 12px) !important;
  padding-right:clamp(4px, .8vw, 12px) !important;
  overflow-x:hidden !important;
}
#screen-game{
  width:100%;
  max-width:100%;
  min-height:calc(100svh - 92px);
  padding:4px 0 12px !important;
  overflow-x:hidden !important;
}
.di-game-embed-shell{
  width:min(1180px, calc(100vw - 16px)) !important;
  max-width:1180px !important;
  margin:0 auto !important;
  padding:clamp(4px, .75vw, 10px) !important;
}
#diMonsterGameRoot{
  width:100% !important;
  max-width:1160px !important;
  min-height:clamp(640px, calc(100svh - 104px), 820px) !important;
  border-radius:clamp(22px, 2.4vw, 32px) !important;
  overflow:hidden !important;
}
#diMonsterGameRoot .di-game-app{
  width:100% !important;
  max-width:1130px !important;
  padding:clamp(8px, .9vw, 14px) !important;
}
#diMonsterGameRoot .top-card,
#diMonsterGameRoot .game-header,
#diMonsterGameRoot .play-board,
#diMonsterGameRoot .game-footer,
#diMonsterGameRoot .category-panel,
#diMonsterGameRoot .result-card{
  border-width:4px !important;
}
#diMonsterGameRoot .top-card{
  min-height:60px !important;
  padding:8px 72px 8px 12px !important;
  border-radius:22px !important;
}
#diMonsterGameRoot .sound-toggle{
  width:44px !important;
  height:44px !important;
  top:12px !important;
  right:14px !important;
  border-width:4px !important;
  border-radius:14px !important;
  font-size:20px !important;
}
#diMonsterGameRoot .select-title{
  width:min(500px, calc(100% - 96px)) !important;
  min-height:clamp(52px, 5.4vw, 68px) !important;
  margin:0 auto -22px !important;
  font-size:clamp(25px, 3.4vw, 44px) !important;
  border-width:4px !important;
  border-radius:30px !important;
  box-shadow:0 0 0 3px #cad9ea, 0 4px 0 rgba(107,125,159,.16) !important;
}
#diMonsterGameRoot .category-panel{
  width:min(1080px, 100%) !important;
  min-height:0 !important;
  padding:clamp(42px, 5vh, 58px) clamp(14px, 2vw, 28px) clamp(16px, 2.5vh, 26px) !important;
  border-radius:30px !important;
}
#diMonsterGameRoot .category-grid{
  grid-template-columns:repeat(4, minmax(0,1fr)) !important;
  grid-template-rows:repeat(2, minmax(112px, 1fr)) !important;
  gap:clamp(9px, 1vw, 13px) !important;
}
#diMonsterGameRoot .category-card{
  min-height:clamp(112px, 11vw, 146px) !important;
  padding:9px 8px 10px !important;
  border-width:4px !important;
  border-radius:22px !important;
}
#diMonsterGameRoot .category-icon{
  font-size:clamp(28px, 3.8vh, 42px) !important;
}
#diMonsterGameRoot .category-name{
  font-size:clamp(13px, 1.25vw, 18px) !important;
  min-height:24px !important;
  line-height:1.08 !important;
}
#diMonsterGameRoot .category-subtitle,
#diMonsterGameRoot .category-meta{
  font-size:10px !important;
}
#diMonsterGameRoot .category-progress{
  width:min(92px, 70%) !important;
  height:6px !important;
}
#diMonsterGameRoot .nav-arrow{
  width:48px !important;
  height:48px !important;
  border-width:4px !important;
  font-size:40px !important;
}
#diMonsterGameRoot .nav-left{left:6px !important;}
#diMonsterGameRoot .nav-right{right:6px !important;}
#diMonsterGameRoot .di-game-screen-game{
  grid-template-rows:auto 10px minmax(0, 1fr) auto !important;
  gap:8px !important;
}
#diMonsterGameRoot .game-header{
  min-height:64px !important;
  padding:7px 72px 7px 12px !important;
  gap:9px !important;
  border-radius:22px !important;
}
#diMonsterGameRoot .back-btn{
  width:42px !important;
  height:42px !important;
  border-width:4px !important;
  border-radius:14px !important;
  font-size:24px !important;
}
#diMonsterGameRoot .mini-logo.di-owl-logo{
  width:36px !important;
  height:36px !important;
  border-radius:12px !important;
}
#diMonsterGameRoot .game-copy h1{
  font-size:clamp(24px, 2.9vw, 36px) !important;
  line-height:.98 !important;
}
#diMonsterGameRoot .game-copy p{
  font-size:clamp(12px, 1.15vw, 14px) !important;
  margin-top:2px !important;
}
#diMonsterGameRoot .score-cluster{gap:7px !important;}
#diMonsterGameRoot .score-pill{
  height:44px !important;
  min-width:68px !important;
  border-width:3px !important;
  border-radius:15px !important;
}
#diMonsterGameRoot .score-pill span{font-size:9px !important;}
#diMonsterGameRoot .score-pill b{font-size:19px !important;}
#diMonsterGameRoot .progress-track{height:10px !important; border-radius:999px !important;}
#diMonsterGameRoot .play-board{
  grid-template-columns:minmax(230px, 32%) minmax(0,1fr) !important;
  gap:10px !important;
  padding:10px !important;
  border-radius:24px !important;
  max-height:none !important;
}
#diMonsterGameRoot .prompt-column{gap:9px !important;}
#diMonsterGameRoot .monster-box{
  min-height:clamp(130px, 20vh, 190px) !important;
  border-width:4px !important;
  border-radius:22px !important;
}
#diMonsterGameRoot .monster-bubble{width:clamp(96px, 16vh, 130px) !important;}
#diMonsterGameRoot .monster{font-size:clamp(48px, 8vh, 70px) !important;}
#diMonsterGameRoot .word-box{
  padding:9px 10px !important;
  border-width:4px !important;
  border-radius:20px !important;
}
#diMonsterGameRoot .word-box p{font-size:clamp(12px, 1.1vw, 15px) !important; margin-bottom:5px !important;}
#diMonsterGameRoot .word-box strong,
#diMonsterGameRoot .di-game-screen-game[data-mode="picture"] .word-box strong,
#diMonsterGameRoot .di-game-screen-game[data-mode="meaning"] .word-box strong,
#diMonsterGameRoot .di-game-screen-game[data-mode="match"] .word-box strong{
  font-size:clamp(22px, 2.4vw, 32px) !important;
  line-height:1.05 !important;
}
#diMonsterGameRoot .listen-btn{
  min-height:38px !important;
  padding:8px 12px !important;
  border-width:3px !important;
  border-radius:14px !important;
  font-size:13px !important;
}
#diMonsterGameRoot .options-grid{
  gap:9px !important;
  grid-template-rows:repeat(2, minmax(96px, 1fr)) !important;
}
#diMonsterGameRoot .answer-card{
  min-height:96px !important;
  padding:8px !important;
  border-width:4px !important;
  border-radius:20px !important;
  gap:5px !important;
}
#diMonsterGameRoot .answer-emoji,
#diMonsterGameRoot .di-game-screen-game[data-mode="picture"] .answer-card .answer-emoji{font-size:clamp(34px, 6vh, 58px) !important;}
#diMonsterGameRoot .answer-main,
#diMonsterGameRoot .answer-card.mode-translation .answer-main{font-size:clamp(17px, 2.2vw, 26px) !important; line-height:1.05 !important;}
#diMonsterGameRoot .answer-sub,
#diMonsterGameRoot .picture-label{font-size:clamp(10px, 1vw, 12px) !important; line-height:1.2 !important;}
#diMonsterGameRoot .game-footer{
  min-height:54px !important;
  padding:8px 10px !important;
  border-radius:22px !important;
}
#diMonsterGameRoot .feedback-copy strong{font-size:14px !important;}
#diMonsterGameRoot .feedback-copy p{font-size:12px !important;}
#diMonsterGameRoot .next-btn{
  min-height:40px !important;
  min-width:92px !important;
  padding:8px 12px !important;
  border-width:3px !important;
  border-radius:14px !important;
}
#diMonsterGameRoot .options-grid.match-grid{gap:9px !important;}
#diMonsterGameRoot .match-object,
#diMonsterGameRoot .drop-zone{
  border-width:4px !important;
  border-radius:18px !important;
  min-height:64px !important;
  padding:7px !important;
}
#diMonsterGameRoot .options-grid.match-grid .match-object .match-emoji{font-size:clamp(30px, 5vh, 48px) !important;}
#diMonsterGameRoot .drop-zone .target-word,
#diMonsterGameRoot .options-grid.match-grid .drop-zone .target-word{font-size:clamp(16px, 2vw, 24px) !important;}

.auth-modal[data-active-auth-tab="admin"]{overflow:hidden !important;}
.auth-modal[data-active-auth-tab="admin"] .auth-card-wide{
  width:min(1080px, calc(100vw - 24px)) !important;
  max-height:calc(100svh - 24px) !important;
  overflow:hidden !important;
  grid-template-rows:auto auto minmax(0,1fr) auto !important;
}
.auth-modal[data-active-auth-tab="admin"] .auth-panel.active{
  min-height:0 !important;
  max-height:none !important;
  overflow:hidden !important;
  padding-right:0 !important;
}
.auth-modal[data-active-auth-tab="admin"] #authAdminPanel{
  min-height:0 !important;
  height:100% !important;
  overflow:hidden !important;
  display:grid !important;
}
.auth-modal[data-active-auth-tab="admin"] .admin-modal-pro{
  min-height:0 !important;
  height:100% !important;
  overflow:hidden !important;
  grid-template-rows:auto auto minmax(0,1fr) !important;
  gap:10px !important;
}
.auth-modal[data-active-auth-tab="admin"] .admin-modal-head-pro{gap:12px !important;}
.auth-modal[data-active-auth-tab="admin"] .admin-modal-head-pro h4{font-size:1.12rem !important; margin:2px 0 !important;}
.auth-modal[data-active-auth-tab="admin"] .admin-modal-head-pro p{font-size:12px !important; line-height:1.35 !important;}
.auth-modal[data-active-auth-tab="admin"] .admin-tools-row{padding:9px !important; position:static !important;}
.auth-modal[data-active-auth-tab="admin"] .admin-users-scroll{
  min-height:0 !important;
  height:100% !important;
  max-height:none !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  scrollbar-gutter:stable !important;
}
.auth-modal[data-active-auth-tab="admin"] .admin-users-scroll::-webkit-scrollbar{width:10px !important;}
.auth-modal[data-active-auth-tab="admin"] .admin-user-row{
  grid-template-columns:minmax(190px,1.05fr) minmax(150px,.68fr) minmax(190px,.9fr) minmax(220px,.95fr) !important;
  gap:10px !important;
  padding:12px !important;
}
.auth-modal[data-active-auth-tab="admin"] .admin-user-metrics,
.auth-modal[data-active-auth-tab="admin"] .admin-user-status{gap:7px !important;}
.auth-modal[data-active-auth-tab="admin"] .admin-mini-stats span{padding:9px 11px !important;}
.auth-modal[data-active-auth-tab="admin"] .admin-mini-stats strong{font-size:19px !important;}

@media (max-width:1180px){
  .di-game-embed-shell{width:min(1040px, calc(100vw - 12px)) !important;}
  #diMonsterGameRoot{max-width:1030px !important; min-height:clamp(630px, calc(100svh - 104px), 780px) !important;}
  #diMonsterGameRoot .category-grid{grid-template-columns:repeat(4, minmax(0,1fr)) !important;}
  #diMonsterGameRoot .category-card{min-height:118px !important;}
}
@media (max-width:940px){
  #screen-game{min-height:auto; padding-bottom:calc(84px + env(safe-area-inset-bottom)) !important;}
  .di-game-embed-shell{width:calc(100vw - 10px) !important; padding:4px !important;}
  #diMonsterGameRoot{min-height:auto !important; border-radius:22px !important;}
  #diMonsterGameRoot .di-game-app{padding:8px !important;}
  #diMonsterGameRoot .category-panel{padding:42px 10px 16px !important; border-radius:24px !important;}
  #diMonsterGameRoot .category-grid{grid-template-columns:repeat(2, minmax(0,1fr)) !important; grid-template-rows:repeat(4, 104px) !important; gap:9px !important;}
  #diMonsterGameRoot .category-card{min-height:104px !important; border-radius:18px !important;}
  #diMonsterGameRoot .category-icon{font-size:30px !important;}
  #diMonsterGameRoot .category-name{font-size:13px !important;}
  #diMonsterGameRoot .di-game-screen-game{grid-template-rows:auto 8px auto auto !important;}
  #diMonsterGameRoot .game-header{grid-template-columns:auto auto minmax(0,1fr); grid-template-areas:"back logo copy" "score score score"; padding:7px 10px !important;}
  #diMonsterGameRoot .score-cluster{grid-area:score; display:flex; justify-content:space-between;}
  #diMonsterGameRoot .score-pill{height:40px !important;}
  #diMonsterGameRoot .play-board{grid-template-columns:1fr !important; overflow:visible !important;}
  #diMonsterGameRoot .prompt-column{grid-template-columns:minmax(110px, .35fr) minmax(0, .65fr) !important; grid-template-rows:auto !important; align-items:stretch;}
  #diMonsterGameRoot .monster-box{min-height:112px !important;}
  #diMonsterGameRoot .word-box{min-height:112px !important;}
  #diMonsterGameRoot .options-grid{grid-template-rows:repeat(2, 104px) !important;}
  #diMonsterGameRoot .answer-card{min-height:104px !important;}
  #diMonsterGameRoot .game-footer{display:flex; align-items:center; justify-content:space-between; gap:8px;}
  .auth-modal[data-active-auth-tab="admin"] .admin-modal-head-pro{display:grid !important;}
  .auth-modal[data-active-auth-tab="admin"] .admin-mini-stats{min-width:0 !important; grid-template-columns:repeat(3, minmax(0,1fr)) !important;}
  .auth-modal[data-active-auth-tab="admin"] .admin-user-row{grid-template-columns:1fr !important;}
}
@media (max-width:560px){
  body[data-active-screen="game"] .content{padding-left:0 !important; padding-right:0 !important;}
  .di-game-embed-shell{width:calc(100vw - 4px) !important; padding:2px !important;}
  #diMonsterGameRoot{border-radius:18px !important;}
  #diMonsterGameRoot .top-card{width:calc(100% - 54px) !important; min-height:52px !important; padding:6px 8px !important; justify-self:start !important;}
  #diMonsterGameRoot .sound-toggle{width:40px !important; height:40px !important; right:7px !important; top:8px !important; font-size:18px !important;}
  #diMonsterGameRoot .brand-text strong{font-size:17px !important;}
  #diMonsterGameRoot .brand-text span{font-size:10px !important;}
  #diMonsterGameRoot .menu-btn{font-size:12px !important; padding:7px 8px !important;}
  #diMonsterGameRoot .select-title{width:calc(100% - 52px) !important; min-height:48px !important; font-size:24px !important; margin-bottom:-18px !important;}
  #diMonsterGameRoot .category-panel{padding:36px 8px 14px !important;}
  #diMonsterGameRoot .category-grid{grid-template-rows:repeat(4, 94px) !important; gap:7px !important;}
  #diMonsterGameRoot .category-card{min-height:94px !important; padding:6px !important; border-width:3px !important; border-radius:16px !important;}
  #diMonsterGameRoot .category-count{min-width:22px !important; height:22px !important; font-size:10px !important; right:6px !important; top:6px !important;}
  #diMonsterGameRoot .category-icon{font-size:26px !important;}
  #diMonsterGameRoot .category-name{font-size:12px !important; min-height:20px !important;}
  #diMonsterGameRoot .category-subtitle{font-size:9px !important;}
  #diMonsterGameRoot .nav-arrow{width:38px !important; height:38px !important; font-size:32px !important;}
  #diMonsterGameRoot .page-dots{height:18px !important;}
  #diMonsterGameRoot .game-copy h1{font-size:22px !important;}
  #diMonsterGameRoot .game-copy p{font-size:11px !important;}
  #diMonsterGameRoot .prompt-column{grid-template-columns:1fr !important;}
  #diMonsterGameRoot .monster-box{min-height:90px !important;}
  #diMonsterGameRoot .word-box{min-height:auto !important;}
  #diMonsterGameRoot .monster-bubble{width:82px !important;}
  #diMonsterGameRoot .monster{font-size:44px !important;}
  #diMonsterGameRoot .word-box strong{font-size:22px !important;}
  #diMonsterGameRoot .options-grid{grid-template-rows:repeat(2, 92px) !important; gap:7px !important;}
  #diMonsterGameRoot .answer-card{min-height:92px !important; border-width:3px !important; border-radius:16px !important;}
  #diMonsterGameRoot .answer-emoji{font-size:32px !important;}
  #diMonsterGameRoot .answer-main{font-size:16px !important;}
  #diMonsterGameRoot .game-footer{padding:7px !important;}
  #diMonsterGameRoot .feedback-copy p{display:none !important;}
  .auth-modal{padding:6px !important;}
  .auth-modal[data-active-auth-tab="admin"] .auth-card-wide{width:calc(100vw - 12px) !important; max-height:calc(100svh - 12px) !important; padding:10px !important; border-radius:18px !important; gap:8px !important;}
  .auth-modal[data-active-auth-tab="admin"] .admin-mini-stats{grid-template-columns:1fr !important; gap:6px !important;}
  .auth-modal[data-active-auth-tab="admin"] .admin-tools-row{gap:8px !important; padding:7px !important;}
  .auth-modal[data-active-auth-tab="admin"] .admin-scroll-hint{display:none !important;}
  .auth-modal[data-active-auth-tab="admin"] .admin-users-scroll{padding:8px !important;}
}

/* v67.1 admin panel stretch guard */
.auth-modal[data-active-auth-tab="admin"] .auth-panel.active{
  align-content:stretch !important;
  grid-template-rows:minmax(0,1fr) !important;
}


/* v68 guest-alert box + single-scroll admin + smaller game content cards */
#screen-community .community-account-card.guest-state{
  background:linear-gradient(135deg,#fff0f1 0%,#ffd9dd 100%) !important;
  border:1px solid #f0a6af !important;
  box-shadow:0 14px 28px rgba(188,66,84,.12) !important;
}
#screen-community .community-account-card.guest-state .small-label,
#screen-community .community-account-card.guest-state h3{
  color:#b42318 !important;
}
#screen-community .community-account-card.guest-state p{
  color:#7a3140 !important;
}
#screen-community .community-account-card.guest-state .profile-frame{
  background:rgba(255,255,255,.88) !important;
  border:1px solid #f4bcc5 !important;
  box-shadow:0 10px 20px rgba(188,66,84,.08) !important;
}
#screen-community .community-account-card.guest-state .profile-avatar{
  background:linear-gradient(135deg,#ff8da1,#db2777) !important;
}
#screen-community .community-account-card.guest-state #communityLoginBtn{
  background:linear-gradient(135deg,#fff,#fff5f6) !important;
  border:1px solid #eeadb8 !important;
  color:#8f2131 !important;
  font-weight:900 !important;
}

.auth-modal[data-active-auth-tab="admin"],
.auth-modal[data-active-auth-tab="admin"] .auth-card-wide,
.auth-modal[data-active-auth-tab="admin"] .auth-panel.active,
.auth-modal[data-active-auth-tab="admin"] #authAdminPanel,
.auth-modal[data-active-auth-tab="admin"] .admin-modal-pro{
  overflow:hidden !important;
  scrollbar-width:none !important;
}
.auth-modal[data-active-auth-tab="admin"]::-webkit-scrollbar,
.auth-modal[data-active-auth-tab="admin"] .auth-card-wide::-webkit-scrollbar,
.auth-modal[data-active-auth-tab="admin"] .auth-panel.active::-webkit-scrollbar,
.auth-modal[data-active-auth-tab="admin"] #authAdminPanel::-webkit-scrollbar,
.auth-modal[data-active-auth-tab="admin"] .admin-modal-pro::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
}
.auth-modal[data-active-auth-tab="admin"] .admin-users-scroll{
  overflow-y:auto !important;
  overflow-x:hidden !important;
  scrollbar-width:thin !important;
}
.auth-modal[data-active-auth-tab="admin"] .admin-users-scroll::-webkit-scrollbar{
  width:10px !important;
  height:10px !important;
}

#diMonsterGameRoot .category-panel{
  width:min(960px, 100%) !important;
  padding:clamp(34px, 4.2vh, 44px) clamp(10px, 1.4vw, 16px) clamp(12px, 1.8vh, 18px) !important;
}
#diMonsterGameRoot .category-grid{
  grid-template-columns:repeat(4, minmax(0,1fr)) !important;
  grid-template-rows:repeat(2, minmax(96px, 1fr)) !important;
  gap:8px !important;
}
#diMonsterGameRoot .category-card{
  min-height:96px !important;
  padding:7px 6px 8px !important;
  border-radius:18px !important;
}
#diMonsterGameRoot .category-icon{
  font-size:clamp(24px, 2.4vw, 34px) !important;
}
#diMonsterGameRoot .category-name{
  font-size:clamp(12px, .95vw, 15px) !important;
  min-height:18px !important;
}
#diMonsterGameRoot .category-subtitle,
#diMonsterGameRoot .category-meta{
  font-size:9px !important;
}
#diMonsterGameRoot .category-count{
  min-width:22px !important;
  height:22px !important;
  font-size:10px !important;
}
#diMonsterGameRoot .category-progress{
  width:min(76px, 64%) !important;
  height:5px !important;
}
@media (max-width:940px){
  #diMonsterGameRoot .category-grid{
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
    grid-template-rows:repeat(4, 92px) !important;
    gap:8px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height:92px !important;
    padding:7px 6px !important;
  }
}
@media (max-width:560px){
  #diMonsterGameRoot .category-panel{
    width:100% !important;
    padding:34px 8px 12px !important;
  }
  #diMonsterGameRoot .category-grid{
    grid-template-rows:repeat(4, 84px) !important;
    gap:6px !important;
  }
  #diMonsterGameRoot .category-card{
    min-height:84px !important;
    padding:6px 5px !important;
    border-radius:14px !important;
  }
  #diMonsterGameRoot .category-icon{
    font-size:24px !important;
  }
  #diMonsterGameRoot .category-name{
    font-size:11px !important;
    min-height:16px !important;
  }
  #diMonsterGameRoot .category-subtitle,
  #diMonsterGameRoot .category-meta{
    font-size:8px !important;
  }
  #diMonsterGameRoot .category-progress{
    width:min(62px, 60%) !important;
  }
}


/* v69 auth/admin overlap fix + clear close button */
.auth-card-head{
  position:sticky;
  top:0;
  z-index:7;
  background:linear-gradient(180deg,#ffffff 0%,#fcfdff 100%);
  padding-bottom:6px;
}
#authCloseBtn{
  min-width:46px;
  min-height:46px;
  border-radius:14px;
  border:1px solid #d7e1f0;
  background:#fff;
  font-size:22px;
  font-weight:900;
  color:#1f3658;
}
.auth-footer-bar{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:10px;
  padding-top:2px;
}
.auth-close-footer-btn{
  min-width:120px;
  min-height:48px;
  font-weight:900;
}
.auth-card-wide{
  grid-template-rows:auto auto minmax(0,1fr) auto auto !important;
}
.auth-card-wide .auth-panel.active{
  min-height:0 !important;
  overflow:auto !important;
  padding-right:4px;
}
.auth-card-wide .auth-panel.active::-webkit-scrollbar{
  width:8px;
}
.auth-card-wide .auth-panel.active::-webkit-scrollbar-thumb{
  background:#cad7ea;
  border-radius:999px;
}

#authAdminPanel{
  min-height:0;
  display:grid;
}
.auth-modal[data-active-auth-tab="admin"] .auth-card-wide{
  grid-template-rows:auto auto minmax(0,1fr) auto auto !important;
}
.auth-modal[data-active-auth-tab="admin"] .auth-panel.active{
  overflow:hidden !important;
  padding-right:0 !important;
}
.auth-modal[data-active-auth-tab="admin"] #authAdminPanel{
  height:100% !important;
  overflow:hidden !important;
}
.auth-modal[data-active-auth-tab="admin"] .admin-modal-pro{
  height:100% !important;
  overflow:hidden !important;
}
.auth-modal[data-active-auth-tab="admin"] .admin-user-row,
.admin-user-row{
  grid-template-columns:minmax(240px,1.05fr) minmax(260px,.95fr) !important;
  grid-template-areas:
    "main control"
    "metrics status" !important;
  align-items:start !important;
  gap:12px !important;
}
.admin-user-main{grid-area:main; min-width:0;}
.admin-user-metrics{grid-area:metrics; grid-template-columns:repeat(3,minmax(0,1fr)) !important; min-width:0;}
.admin-user-status{grid-area:status; grid-template-columns:repeat(3,minmax(0,1fr)) !important; min-width:0;}
.admin-user-control{
  grid-area:control;
  grid-template-columns:1fr !important;
  align-items:stretch !important;
  min-width:0;
}
.admin-user-control label,
.admin-user-control input,
.admin-temp-pass{
  min-width:0;
  width:100%;
}
.admin-actions-pro,
.admin-table-actions.admin-actions-pro{
  display:grid !important;
  grid-template-columns:1fr 1fr;
  gap:10px;
  width:100%;
}
.admin-user-metrics span,
.admin-user-status > div{
  min-width:0;
  overflow:hidden;
}
.admin-user-metrics strong,
.admin-user-status .status-badge,
.admin-user-status small{
  overflow-wrap:anywhere;
  word-break:break-word;
}
.admin-user-copy,
.admin-user-email,
.admin-user-title{
  min-width:0;
  overflow-wrap:anywhere;
  word-break:break-word;
}

@media (max-width:980px){
  .auth-card-wide{
    width:min(100vw - 16px, 920px) !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-row,
  .admin-user-row{
    grid-template-columns:1fr !important;
    grid-template-areas:
      "main"
      "metrics"
      "status"
      "control" !important;
  }
}
@media (max-width:640px){
  .auth-card-head{
    padding-bottom:4px;
  }
  #authCloseBtn{
    min-width:42px;
    min-height:42px;
    font-size:20px;
  }
  .auth-close-footer-btn{
    min-width:100%;
  }
  .auth-footer-bar{
    justify-content:stretch;
  }
  .admin-user-metrics,
  .admin-user-status,
  .admin-actions-pro,
  .admin-table-actions.admin-actions-pro{
    grid-template-columns:1fr !important;
  }
}
body[data-theme="dark"] #authCloseBtn{
  background:#14233c;
  border-color:rgba(132,174,255,.25);
  color:#eef4ff;
}
body[data-theme="dark"] .auth-footer-bar{
  background:transparent;
}


/* v70 remove mobile sidebar horizontal scroll + smaller account heading */
html,body{
  overflow-x:hidden !important;
}
.sidebar,
.menu.menu-v2,
.sidebar-topline,
.brand,
.menu-item,
.menu-copy,
.menu-copy strong,
.menu-copy small{
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
}
.sidebar{
  overflow-x:hidden !important;
  overscroll-behavior-x:none;
}
.sidebar::-webkit-scrollbar:horizontal,
.menu.menu-v2::-webkit-scrollbar:horizontal{
  height:0 !important;
  display:none !important;
}
.menu.menu-v2{
  overflow-x:hidden !important;
}
.menu-item{
  width:100% !important;
  grid-template-columns:44px minmax(0,1fr) 14px !important;
  overflow:hidden !important;
}
.menu-copy{
  overflow:hidden !important;
}
.menu-copy strong,
.menu-copy small{
  overflow-wrap:anywhere !important;
  word-break:break-word !important;
}
.menu-arrow{
  justify-self:end;
}

.auth-card-head{
  align-items:center !important;
}
.auth-card-head .small-label{
  font-size:12px !important;
  color:#6b7b93 !important;
  letter-spacing:0 !important;
  margin-bottom:2px !important;
}
.auth-card-head h3{
  font-size:clamp(22px, 2vw, 30px) !important;
  line-height:1.12 !important;
  letter-spacing:-.02em !important;
  margin:0 !important;
  color:#1d3252 !important;
}
.auth-card-wide{
  border-radius:24px !important;
}
@media (max-width:640px){
  .sidebar{
    padding-bottom:104px !important;
  }
  .menu-item{
    grid-template-columns:42px minmax(0,1fr) 12px !important;
    padding:13px 12px !important;
  }
  .menu-copy strong{
    font-size:14px !important;
  }
  .menu-copy small{
    font-size:11px !important;
  }
  .auth-card-head h3{
    font-size:20px !important;
  }
  .auth-card-head .small-label{
    font-size:11px !important;
  }
}
body[data-theme="dark"] .auth-card-head h3{
  color:#eef4ff !important;
}
body[data-theme="dark"] .auth-card-head .small-label{
  color:#a9bad8 !important;
}



/* v72 progress activities: logged-in sound quiz + practice tasks */
.progress-activities-mount{
  margin:18px 0 20px;
}
.progress-activity-shell{
  display:grid;
  gap:16px;
  padding:18px;
  border:1px solid #dfe8f7;
  border-radius:28px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);
  box-shadow:0 18px 36px rgba(22,38,70,.07);
}
.progress-activity-hero{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:16px;
  align-items:center;
  padding:16px;
  border-radius:24px;
  background:linear-gradient(135deg,#eef5ff 0%,#fff 52%,#fff7dc 100%);
  border:1px solid #dce7f6;
}
.progress-activity-hero h3{
  margin:4px 0 8px;
  font-size:clamp(24px,2.2vw,34px);
  line-height:1.08;
  letter-spacing:-.025em;
  color:#172947;
}
.progress-activity-hero p{
  margin:0;
  max-width:760px;
  color:#586b83;
  line-height:1.65;
  font-weight:700;
}
.activity-stat-row{
  display:grid;
  grid-template-columns:repeat(4,minmax(84px,1fr));
  gap:10px;
  min-width:min(100%,440px);
}
.activity-stat-chip{
  display:grid;
  gap:3px;
  justify-items:start;
  padding:12px 14px;
  border-radius:18px;
  border:1px solid #d8e5f7;
  background:#fff;
  box-shadow:0 10px 20px rgba(24,45,88,.05);
}
.activity-stat-chip strong{
  font-size:24px;
  line-height:1;
  color:#17365f;
}
.activity-stat-chip span{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.04em;
  font-weight:900;
  color:#6a7890;
}
.progress-activity-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(320px,.86fr);
  gap:16px;
  align-items:start;
}
.listen-quiz-card,
.progress-mini-activities,
.extra-runner-card{
  border:1px solid #dbe6f6;
  border-radius:24px;
  background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%);
  padding:16px;
  box-shadow:0 14px 28px rgba(24,45,88,.06);
}
.listen-card-head{
  display:flex;
  gap:14px;
  align-items:flex-start;
  margin-bottom:14px;
}
.listen-card-head h4,
.progress-mini-activities h4,
.extra-runner-card h4{
  margin:4px 0 6px;
  color:#172947;
  font-size:22px;
  line-height:1.15;
}
.listen-card-head p{
  margin:0;
  color:#607188;
  font-weight:700;
}
.listen-emoji{
  width:58px;
  height:58px;
  border-radius:18px;
  display:grid;
  place-items:center;
  font-size:30px;
  background:linear-gradient(135deg,#2563eb,#22c55e);
  box-shadow:0 12px 24px rgba(37,99,235,.20);
}
.listen-action-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin:10px 0 14px;
}
.activity-play-sound.is-playing,
.activity-mini-sound.is-playing{
  opacity:.78;
  transform:scale(.98);
}
.activity-choice-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.activity-choice{
  min-height:58px;
  padding:12px 14px;
  border-radius:18px;
  border:1px solid #d8e3f2;
  background:linear-gradient(180deg,#fff 0%,#f7faff 100%);
  color:#203653;
  font-weight:900;
  text-align:left;
  cursor:pointer;
  transition:.16s ease;
  box-shadow:0 8px 16px rgba(24,45,88,.04);
}
.activity-choice:hover{
  transform:translateY(-1px);
  border-color:#b7caee;
}
.activity-choice.correct{
  background:linear-gradient(135deg,#e7f9ed,#c8f3d7) !important;
  border-color:#55c879 !important;
  color:#135f2a !important;
}
.activity-choice.wrong{
  background:linear-gradient(135deg,#fff0f0,#ffdada) !important;
  border-color:#ef8c8c !important;
  color:#9a1f1f !important;
}
.activity-choice:disabled{
  cursor:default;
}
.activity-feedback{
  margin-top:12px;
  padding:12px 14px;
  border-radius:18px;
  background:#f5f8fd;
  border:1px solid #e0e8f5;
  color:#52657e;
  font-weight:800;
  line-height:1.55;
}
.activity-feedback.good{
  background:#edfbf2;
  border-color:#b8ebc9;
  color:#176631;
}
.activity-feedback.bad{
  background:#fff2f2;
  border-color:#ffc7c7;
  color:#9a1f1f;
}
.mini-activity-grid{
  display:grid;
  gap:10px;
  margin-top:12px;
}
.mini-activity-card{
  display:grid;
  grid-template-columns:48px minmax(0,1fr);
  gap:10px 12px;
  align-items:center;
  width:100%;
  text-align:left;
  padding:12px;
  border-radius:20px;
  border:1px solid #dbe6f6;
  background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);
  cursor:pointer;
  color:#1d3252;
  box-shadow:0 10px 18px rgba(24,45,88,.04);
}
.mini-activity-card span{
  grid-row:span 2;
  width:48px;
  height:48px;
  border-radius:16px;
  display:grid;
  place-items:center;
  background:#eef5ff;
  font-size:25px;
}
.mini-activity-card strong{
  font-size:16px;
}
.mini-activity-card small{
  color:#607188;
  font-weight:800;
}
.extra-activity-runner{
  margin-top:14px;
}
.extra-runner-empty{
  padding:14px;
  border-radius:18px;
  border:1px dashed #c9d8ed;
  color:#667891;
  background:#f9fbff;
  font-weight:800;
  line-height:1.55;
}
.progress-activity-message{
  padding:12px 14px;
  border-radius:18px;
  background:linear-gradient(135deg,#fff7dc,#fffdf3);
  border:1px solid #ead883;
  color:#725300;
  font-weight:900;
}
.progress-login-required{
  background:linear-gradient(135deg,#fff5f5,#fff 50%,#eef5ff);
}
@media (max-width:1100px){
  .progress-activity-hero,
  .progress-activity-grid{
    grid-template-columns:1fr;
  }
  .activity-stat-row{
    min-width:0;
  }
}
@media (max-width:680px){
  .progress-activity-shell{
    padding:12px;
    border-radius:22px;
  }
  .progress-activity-hero{
    padding:14px;
    border-radius:20px;
  }
  .activity-stat-row,
  .activity-choice-grid{
    grid-template-columns:1fr;
  }
  .listen-card-head{
    flex-direction:column;
  }
  .listen-action-row .primary-btn,
  .listen-action-row .secondary-btn,
  .progress-login-required .primary-btn{
    width:100%;
    justify-content:center;
  }
}
body[data-theme="dark"] .progress-activity-shell,
body[data-theme="dark"] .listen-quiz-card,
body[data-theme="dark"] .progress-mini-activities,
body[data-theme="dark"] .extra-runner-card{
  background:linear-gradient(180deg,#14233c 0%,#0e1a30 100%) !important;
  border-color:rgba(132,174,255,.24) !important;
}
body[data-theme="dark"] .progress-activity-hero,
body[data-theme="dark"] .activity-stat-chip,
body[data-theme="dark"] .activity-choice,
body[data-theme="dark"] .mini-activity-card,
body[data-theme="dark"] .extra-runner-empty{
  background:linear-gradient(180deg,#182945 0%,#101d34 100%) !important;
  border-color:rgba(132,174,255,.24) !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] .progress-activity-hero h3,
body[data-theme="dark"] .listen-card-head h4,
body[data-theme="dark"] .progress-mini-activities h4,
body[data-theme="dark"] .extra-runner-card h4,
body[data-theme="dark"] .activity-stat-chip strong{
  color:#eef4ff !important;
}
body[data-theme="dark"] .progress-activity-hero p,
body[data-theme="dark"] .mini-activity-card small,
body[data-theme="dark"] .listen-card-head p{
  color:#a9bad8 !important;
}


/* v69 mobile admin readable + progress polish */
@media (max-width: 640px){
  .auth-modal[data-active-auth-tab="admin"] .admin-users-scroll{
    max-height:44svh !important;
    padding:10px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-list{
    display:grid !important;
    gap:10px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-row{
    display:grid !important;
    grid-template-columns:1fr !important;
    grid-template-areas:
      "main"
      "metrics"
      "status"
      "control" !important;
    gap:10px !important;
    align-items:stretch !important;
    overflow:visible !important;
    padding:12px !important;
    border-radius:20px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-main,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-control,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status{
    min-width:0 !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-title{
    display:flex !important;
    flex-wrap:wrap !important;
    gap:8px !important;
    align-items:center !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-email{
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
    line-height:1.35 !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics span,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status > div{
    min-height:64px !important;
    padding:10px 8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-control{
    grid-template-columns:1fr !important;
    gap:10px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-temp-pass{
    width:100% !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-actions-pro{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-actions-pro .secondary-btn{
    width:100% !important;
    min-width:0 !important;
  }
}
@media (max-width: 420px){
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status,
  .auth-modal[data-active-auth-tab="admin"] .admin-actions-pro{
    grid-template-columns:1fr !important;
  }
}


/* v70 admin modal dark polish + mobile list scroll fix */
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .auth-card-wide{
  background:linear-gradient(180deg,#07172c 0%,#081a32 52%,#091d36 100%) !important;
  border:1px solid rgba(80,126,204,.32) !important;
  box-shadow:0 28px 60px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.03) !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .auth-card-head,
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .auth-card-head > div,
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .auth-card-head > *{
  background:transparent !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .auth-card-head{
  padding:2px 2px 8px !important;
  border-bottom:1px solid rgba(90,130,199,.22) !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .auth-tabs{
  background:rgba(255,255,255,.06) !important;
  border:1px solid rgba(116,156,224,.16) !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .auth-tab{
  color:#d7e5fb !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .auth-tab.active{
  background:linear-gradient(135deg,#facc15,#fde047) !important;
  color:#4a3300 !important;
  box-shadow:0 10px 18px rgba(250,204,21,.22) !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-modal-head-pro h4,
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-modal-head-pro p,
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-modal-head-pro .small-label{
  color:#eef4ff !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-tools-row{
  background:linear-gradient(180deg,#0f2342,#102746) !important;
  border-color:#274875 !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-search-wrap{
  background:linear-gradient(180deg,#11233f,#132845) !important;
  border-color:#2f4f7f !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-search-wrap input{
  background:#0d1d35 !important;
  border-color:#33527e !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-search-wrap input::placeholder{
  color:#9bb0d0 !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-users-scroll{
  background:linear-gradient(180deg,#0e2140,#0c1c36) !important;
  border-color:#26456f !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-row{
  background:linear-gradient(180deg,#102544,#0d1f3a) !important;
  border-color:#2d4d7a !important;
  box-shadow:0 14px 28px rgba(0,0,0,.24) !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-row.is-admin-row{
  background:linear-gradient(135deg,#2f2508,#111f38 52%,#0f203a 100%) !important;
  border-color:rgba(236,197,78,.55) !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-title,
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-email,
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-copy,
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-row strong,
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-row small,
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-row label{
  color:#eef4ff !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics span,
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-status > div,
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-temp-pass,
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-control input{
  background:#0f213d !important;
  border-color:#2f4f7f !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics span:nth-child(1){background:linear-gradient(135deg,#3d2b06,#513906) !important;border-color:#a67a16 !important;}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics span:nth-child(2){background:linear-gradient(135deg,#132744,#17355d) !important;border-color:#3b82f6 !important;}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics span:nth-child(3){background:linear-gradient(135deg,#12341f,#14532d) !important;border-color:#22c55e !important;}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-status > div:nth-child(1){background:linear-gradient(135deg,#3d2b06,#513906) !important;border-color:#a67a16 !important;}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-status > div:nth-child(2){background:linear-gradient(135deg,#132744,#17355d) !important;border-color:#3b82f6 !important;}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .admin-user-status > div:nth-child(3){background:linear-gradient(135deg,#12341f,#14532d) !important;border-color:#22c55e !important;}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .auth-footer-bar{
  background:linear-gradient(180deg,#08172c,#08192f) !important;
  border-top:1px solid rgba(90,130,199,.2) !important;
  padding-top:10px !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .auth-close-footer-btn{
  background:linear-gradient(180deg,#102544,#10213d) !important;
  border-color:#2d4d7a !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] .auth-modal[data-active-auth-tab="admin"] .auth-note{
  background:linear-gradient(180deg,#0d1f39,#0d1d35) !important;
  border-color:#284771 !important;
  color:#d4e1f4 !important;
}

.auth-modal[data-active-auth-tab="admin"] .admin-users-scroll{
  -webkit-overflow-scrolling:touch !important;
  overscroll-behavior:contain !important;
  touch-action:pan-y !important;
}

@media (max-width: 640px){
  .auth-modal[data-active-auth-tab="admin"] .auth-card-wide{
    grid-template-rows:auto auto minmax(0,1fr) auto auto !important;
  }
  .auth-modal[data-active-auth-tab="admin"] #authAdminPanel,
  .auth-modal[data-active-auth-tab="admin"] .admin-modal-pro{
    min-height:0 !important;
    height:100% !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-modal-pro{
    grid-template-rows:auto auto minmax(180px,1fr) !important;
    gap:8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-modal-head-pro{
    gap:8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-users-scroll{
    height:100% !important;
    max-height:none !important;
    min-height:220px !important;
    padding:8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-row{
    gap:8px !important;
    padding:10px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-main{
    gap:8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-title{
    font-size:15px !important;
    line-height:1.2 !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-email,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-copy{
    font-size:13px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics span,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status > div{
    min-height:56px !important;
    padding:8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics strong,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status strong{
    font-size:16px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-control{
    gap:8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-temp-pass{
    min-height:48px !important;
    padding:10px 12px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-actions-pro{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-actions-pro .secondary-btn,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-control .secondary-btn{
    min-height:44px !important;
    padding:10px 12px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .auth-close-footer-btn{
    min-height:46px !important;
  }
}
@media (max-width: 420px){
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}


/* v71 community + account dark mode polish and mobile admin visibility */
body[data-theme="dark"] #screen-community .panel,
body[data-theme="dark"] #screen-community .community-account-card,
body[data-theme="dark"] #screen-community .community-user-summary,
body[data-theme="dark"] #screen-community .community-thread-panel,
body[data-theme="dark"] #screen-community .community-post,
body[data-theme="dark"] #screen-community .community-composer,
body[data-theme="dark"] #screen-community .community-stat-card{
  background:linear-gradient(180deg,#10213d 0%,#0d1c34 100%) !important;
  border-color:#29496f !important;
  box-shadow:0 16px 32px rgba(0,0,0,.22) !important;
}
body[data-theme="dark"] #screen-community .profile-frame,
body[data-theme="dark"] #screen-community .compact-profile-frame,
body[data-theme="dark"] #screen-community .profile-frame-rich{
  background:linear-gradient(180deg,#132744 0%,#10213a 100%) !important;
  border-color:#31537f !important;
}
body[data-theme="dark"] #screen-community .community-head-clean h2,
body[data-theme="dark"] #screen-community .community-account-card h3,
body[data-theme="dark"] #screen-community .community-user-summary h3,
body[data-theme="dark"] #screen-community .community-post strong,
body[data-theme="dark"] #screen-community .community-stat-card strong,
body[data-theme="dark"] #screen-community .profile-frame-copy h3,
body[data-theme="dark"] #screen-community .profile-frame-copy p,
body[data-theme="dark"] #screen-community .community-account-card p,
body[data-theme="dark"] #screen-community .community-user-summary p,
body[data-theme="dark"] #screen-community .community-post p,
body[data-theme="dark"] #screen-community .community-post span,
body[data-theme="dark"] #screen-community .community-stat-card span{
  color:#eef4ff !important;
}
body[data-theme="dark"] #screen-community .community-composer select,
body[data-theme="dark"] #screen-community .community-composer input,
body[data-theme="dark"] #screen-community .composer-tool-btn,
body[data-theme="dark"] #screen-community .composer-send-btn{
  background:#0e1f39 !important;
  border-color:#2e4d7a !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] .auth-card,
body[data-theme="dark"] .auth-card-shell,
body[data-theme="dark"] .auth-card-wide{
  background:linear-gradient(180deg,#0a1a31 0%,#0a1b33 100%) !important;
  border-color:#29496f !important;
}
body[data-theme="dark"] .auth-tabs{
  background:rgba(255,255,255,.06) !important;
  border:1px solid rgba(116,156,224,.16) !important;
}
body[data-theme="dark"] .auth-tab{
  color:#d7e5fb !important;
}
body[data-theme="dark"] .auth-tab.active{
  background:linear-gradient(135deg,#facc15,#fde047) !important;
  color:#4a3300 !important;
}
body[data-theme="dark"] .auth-panel input,
body[data-theme="dark"] .auth-panel select,
body[data-theme="dark"] .auth-search,
body[data-theme="dark"] .auth-note,
body[data-theme="dark"] .auth-alert,
body[data-theme="dark"] .auth-inline-banner{
  background:#0e1f39 !important;
  border-color:#2f4f7f !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] .auth-panel input::placeholder{color:#9bb0d0 !important;}
body[data-theme="dark"] .auth-card-head h3,
body[data-theme="dark"] .auth-card-head .small-label,
body[data-theme="dark"] .auth-note,
body[data-theme="dark"] .auth-alert{
  color:#eef4ff !important;
}

@media (max-width: 640px){
  .auth-modal[data-active-auth-tab="admin"] .admin-mini-stats{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-mini-stats span{
    min-height:72px !important;
    padding:8px 8px !important;
    border-radius:16px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-mini-stats strong{
    font-size:18px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-mini-stats small{
    font-size:11px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-tools-row{
    padding:8px !important;
    gap:8px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-search-wrap{
    padding:8px !important;
    border-radius:18px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-search-wrap input{
    min-height:48px !important;
    padding:12px 14px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-users-scroll{
    min-height:280px !important;
    max-height:48svh !important;
    height:auto !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-row{
    padding:9px !important;
    gap:7px !important;
    border-radius:18px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-main{
    display:grid !important;
    grid-template-columns:56px minmax(0,1fr) !important;
    gap:10px !important;
    align-items:center !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-main .avatar,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-main .profile-avatar,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-main .avatar-frame{
    width:56px !important;
    height:56px !important;
    min-width:56px !important;
    min-height:56px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-title{
    font-size:14px !important;
    gap:6px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-email,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-copy{
    font-size:12px !important;
    line-height:1.28 !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics span,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status > div{
    min-height:50px !important;
    padding:7px 6px !important;
    border-radius:14px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics strong,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status strong{
    font-size:15px !important;
    line-height:1 !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics small,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status small,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics span,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status > div{
    font-size:10px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-temp-pass{
    min-height:44px !important;
    padding:10px 12px !important;
    font-size:14px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-actions-pro .secondary-btn,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-control .secondary-btn{
    min-height:40px !important;
    font-size:13px !important;
    border-radius:14px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .auth-footer-bar{
    padding-top:6px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .auth-note{
    display:none !important;
  }
}
@media (max-width: 420px){
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}


/* v31 final: dark account settings + community thread/reply contrast */
body[data-theme="dark"] .auth-modal .auth-card,
body[data-theme="dark"] .auth-modal .auth-card-wide{
  background:linear-gradient(180deg,#07182f 0%,#091d38 100%) !important;
  border:1px solid #2e4d78 !important;
  box-shadow:0 28px 70px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04) !important;
}
body[data-theme="dark"] .auth-card-head{
  background:transparent !important;
  border-bottom:1px solid rgba(110,151,220,.22) !important;
}
body[data-theme="dark"] .auth-card-head h3,
body[data-theme="dark"] .auth-card-head .small-label{
  color:#f2f7ff !important;
  opacity:1 !important;
}
body[data-theme="dark"] .auth-tabs{
  background:#10213d !important;
  border:1px solid #2c4a78 !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04) !important;
}
body[data-theme="dark"] .auth-tab{
  color:#cfe0fb !important;
}
body[data-theme="dark"] .auth-tab.active{
  background:linear-gradient(135deg,#facc15,#fde047) !important;
  color:#422b00 !important;
}
body[data-theme="dark"] .auth-panel,
body[data-theme="dark"] .auth-panel.active,
body[data-theme="dark"] #authAccountPanel,
body[data-theme="dark"] #authAdminPanel{
  background:transparent !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] .auth-panel p,
body[data-theme="dark"] .auth-panel span,
body[data-theme="dark"] .auth-panel label,
body[data-theme="dark"] .auth-panel strong{
  color:#eef4ff !important;
}
body[data-theme="dark"] .auth-panel input,
body[data-theme="dark"] .auth-panel select,
body[data-theme="dark"] .auth-panel textarea{
  background:#0e203d !important;
  border:1px solid #375b8f !important;
  color:#f2f7ff !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04) !important;
}
body[data-theme="dark"] .auth-panel input::placeholder,
body[data-theme="dark"] .auth-panel textarea::placeholder{
  color:#a9bddb !important;
}
body[data-theme="dark"] .auth-note,
body[data-theme="dark"] .auth-alert,
body[data-theme="dark"] .auth-inline-banner{
  background:linear-gradient(180deg,#10213d,#0e1e38) !important;
  border:1px solid #33527e !important;
  color:#e2ecfb !important;
}
body[data-theme="dark"] .auth-footer-bar{
  background:linear-gradient(180deg,#08172c,#07162b) !important;
  border-top:1px solid rgba(110,151,220,.2) !important;
}
body[data-theme="dark"] .auth-close-footer-btn,
body[data-theme="dark"] #authCloseBtn{
  background:#10213d !important;
  border:1px solid #33527e !important;
  color:#f2f7ff !important;
}
body[data-theme="dark"] .auth-close-footer-btn:hover,
body[data-theme="dark"] #authCloseBtn:hover{
  background:#17325b !important;
}

/* Community dark contrast */
body[data-theme="dark"] #screen-community .panel{
  background:linear-gradient(180deg,#07182f 0%,#091d38 100%) !important;
}
body[data-theme="dark"] #screen-community .community-thread-panel,
body[data-theme="dark"] #screen-community .thread-card,
body[data-theme="dark"] #screen-community .thread-head,
body[data-theme="dark"] #screen-community .thread-comment-item,
body[data-theme="dark"] #screen-community .thread-reply-item{
  background:linear-gradient(180deg,#10213d,#0e1f3a) !important;
  border:1px solid #2e4d78 !important;
  color:#f2f7ff !important;
}
body[data-theme="dark"] #screen-community .community-thread-panel h3,
body[data-theme="dark"] #screen-community .community-thread-panel p,
body[data-theme="dark"] #screen-community .community-thread-panel strong,
body[data-theme="dark"] #screen-community .community-thread-panel span,
body[data-theme="dark"] #screen-community .thread-comment-top,
body[data-theme="dark"] #screen-community .thread-comment-top strong,
body[data-theme="dark"] #screen-community .thread-comment-top span{
  color:#f2f7ff !important;
}
body[data-theme="dark"] #screen-community .thread-empty,
body[data-theme="dark"] #screen-community .community-empty{
  background:#f8fbff !important;
  border:1px solid #dce7f6 !important;
  color:#64748b !important;
}
body[data-theme="dark"] #screen-community .thread-comment-box,
body[data-theme="dark"] #screen-community .reply-composer,
body[data-theme="dark"] #screen-community .fb-composer-shell,
body[data-theme="dark"] #screen-community .thread-main-fb-shell{
  background:#f8fbff !important;
  border:1px solid #dce7f6 !important;
  box-shadow:0 14px 28px rgba(0,0,0,.22) !important;
}
body[data-theme="dark"] #screen-community .thread-comment-box input,
body[data-theme="dark"] #screen-community .reply-composer input,
body[data-theme="dark"] #screen-community #threadCommentInput{
  background:#0f213d !important;
  border:1px solid #33527e !important;
  color:#f2f7ff !important;
}
body[data-theme="dark"] #screen-community .thread-comment-box input::placeholder,
body[data-theme="dark"] #screen-community .reply-composer input::placeholder,
body[data-theme="dark"] #screen-community #threadCommentInput::placeholder{
  color:#9fb3d2 !important;
}
body[data-theme="dark"] #screen-community .composer-tool-btn,
body[data-theme="dark"] #screen-community .composer-send-btn{
  background:#10213d !important;
  border:1px solid #33527e !important;
  color:#f2f7ff !important;
}
body[data-theme="dark"] #screen-community .composer-send-btn{
  background:linear-gradient(135deg,#1f4d9f,#2563eb) !important;
}
body[data-theme="dark"] #screen-community .secondary-btn{
  background:#10213d !important;
  border-color:#33527e !important;
  color:#f2f7ff !important;
}

/* mobile admin/account list: make scroll area usable and content visible */
@media (max-width:640px){
  .auth-modal[data-active-auth-tab="admin"] .auth-card-wide{
    max-height:calc(100svh - 10px) !important;
    height:calc(100svh - 10px) !important;
    grid-template-rows:auto auto minmax(0,1fr) auto !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .auth-panel.active,
  .auth-modal[data-active-auth-tab="admin"] #authAdminPanel,
  .auth-modal[data-active-auth-tab="admin"] .admin-modal-pro{
    min-height:0 !important;
    height:100% !important;
    overflow:hidden !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-modal-pro{
    grid-template-rows:auto auto minmax(0,1fr) !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-users-scroll{
    min-height:0 !important;
    height:100% !important;
    max-height:none !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    -webkit-overflow-scrolling:touch !important;
    padding-bottom:18px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-row{
    display:grid !important;
    grid-template-columns:1fr !important;
    grid-template-areas:"main" "metrics" "status" "control" !important;
    gap:8px !important;
    padding:10px !important;
    margin:0 !important;
    overflow:visible !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-main{
    grid-area:main !important;
    display:grid !important;
    grid-template-columns:52px minmax(0,1fr) !important;
    gap:10px !important;
    align-items:center !important;
    min-width:0 !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics{grid-area:metrics !important;}
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status{grid-area:status !important;}
  .auth-modal[data-active-auth-tab="admin"] .admin-user-control{grid-area:control !important;}
  .auth-modal[data-active-auth-tab="admin"] .admin-user-email,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-title{
    min-width:0 !important;
    overflow-wrap:anywhere !important;
    word-break:break-word !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px !important;
  }
  .auth-modal[data-active-auth-tab="admin"] .admin-user-metrics span,
  .auth-modal[data-active-auth-tab="admin"] .admin-user-status > div{
    min-height:48px !important;
    padding:7px 6px !important;
  }
}


/* v32 community final dark cleanup + colorful boxes */
body[data-theme="dark"] #screen-community .panel,
body[data-theme="dark"] #screen-community .panel-soft,
body[data-theme="dark"] #screen-community .community-account-card,
body[data-theme="dark"] #screen-community .community-user-summary,
body[data-theme="dark"] #screen-community .community-thread-panel,
body[data-theme="dark"] #screen-community .thread-card,
body[data-theme="dark"] #screen-community .thread-placeholder,
body[data-theme="dark"] #screen-community .community-post,
body[data-theme="dark"] #screen-community .community-stat-card,
body[data-theme="dark"] #screen-community .summary-chip{
  color:#eef4ff !important;
}
body[data-theme="dark"] #screen-community .community-head-clean h2,
body[data-theme="dark"] #screen-community .community-head-clean p,
body[data-theme="dark"] #screen-community .community-account-card h3,
body[data-theme="dark"] #screen-community .community-account-card p,
body[data-theme="dark"] #screen-community .community-user-summary h3,
body[data-theme="dark"] #screen-community .community-user-summary p,
body[data-theme="dark"] #screen-community .community-user-summary span,
body[data-theme="dark"] #screen-community .community-post strong,
body[data-theme="dark"] #screen-community .community-post p,
body[data-theme="dark"] #screen-community .community-post span,
body[data-theme="dark"] #screen-community .thread-card h3,
body[data-theme="dark"] #screen-community .thread-card p,
body[data-theme="dark"] #screen-community .thread-card strong,
body[data-theme="dark"] #screen-community .thread-card span,
body[data-theme="dark"] #screen-community .community-stat-card strong,
body[data-theme="dark"] #screen-community .community-stat-card span,
body[data-theme="dark"] #screen-community .summary-chip strong,
body[data-theme="dark"] #screen-community .summary-chip span{
  color:#eef4ff !important;
}
body[data-theme="dark"] #screen-community .community-account-card{background:linear-gradient(180deg,#102745,#0d1f39) !important;border-color:#31527f !important;}
body[data-theme="dark"] #screen-community .community-user-summary{background:linear-gradient(180deg,#142b4b,#0f223d) !important;border-color:#355986 !important;}
body[data-theme="dark"] #screen-community .summary-chip{background:linear-gradient(180deg,#10213d,#0d1d36) !important;border-color:#2f4f7f !important;}
body[data-theme="dark"] #screen-community .summary-post-limit{background:linear-gradient(135deg,#16365f,#1c4a80) !important;border-color:#4d88e8 !important;}
body[data-theme="dark"] #screen-community .summary-reply-limit{background:linear-gradient(135deg,#16391f,#1f5a2d) !important;border-color:#39b86b !important;}
body[data-theme="dark"] #screen-community .community-stat-card.stat-posts{background:linear-gradient(135deg,#132744,#183d6a) !important;border-color:#4c8cf0 !important;}
body[data-theme="dark"] #screen-community .community-stat-card.stat-questions{background:linear-gradient(135deg,#3b2910,#5a3b12) !important;border-color:#f2b04c !important;}
body[data-theme="dark"] #screen-community .community-stat-card.stat-wins{background:linear-gradient(135deg,#143720,#1b5b32) !important;border-color:#34d072 !important;}
body[data-theme="dark"] #screen-community .community-stat-card.stat-comments{background:linear-gradient(135deg,#2a2047,#43307a) !important;border-color:#9c7cf0 !important;}
body[data-theme="dark"] #screen-community .community-post{box-shadow:0 14px 28px rgba(0,0,0,.24) !important;}
body[data-theme="dark"] #screen-community .community-post.topic-tip{background:linear-gradient(135deg,#25193f,#34235e) !important;border-color:#9f7cf0 !important;}
body[data-theme="dark"] #screen-community .community-post.topic-goal{background:linear-gradient(135deg,#132b44,#183e63) !important;border-color:#65acee !important;}
body[data-theme="dark"] #screen-community .community-post.topic-question{background:linear-gradient(135deg,#402b10,#5b3d14) !important;border-color:#f0b256 !important;}
body[data-theme="dark"] #screen-community .community-post.topic-win{background:linear-gradient(135deg,#173a20,#205a30) !important;border-color:#59d07e !important;}
body[data-theme="dark"] #screen-community .community-topic-pill.topic-tip{background:#b896ff !important;color:#1f133f !important;border-color:#c4a7ff !important;}
body[data-theme="dark"] #screen-community .community-topic-pill.topic-goal{background:#7ec6ff !important;color:#082845 !important;border-color:#a5dbff !important;}
body[data-theme="dark"] #screen-community .community-topic-pill.topic-question{background:#ffd28a !important;color:#4c2f00 !important;border-color:#ffdba6 !important;}
body[data-theme="dark"] #screen-community .community-topic-pill.topic-win{background:#95ef9b !important;color:#143515 !important;border-color:#b4f6b6 !important;}
body[data-theme="dark"] #screen-community .open-thread-btn,
body[data-theme="dark"] #screen-community .secondary-btn,
body[data-theme="dark"] #screen-community .load-more-btn{background:#10213d !important;border-color:#33527e !important;color:#eef4ff !important;}
body[data-theme="dark"] #screen-community .main-composer,
body[data-theme="dark"] #screen-community .fb-composer-shell,
body[data-theme="dark"] #screen-community .reply-fb-shell,
body[data-theme="dark"] #screen-community .thread-comment-box,
body[data-theme="dark"] #screen-community .reply-composer,
body[data-theme="dark"] #screen-community .compact-thread-box{background:linear-gradient(180deg,#10213d,#0d1d36) !important;border:1px solid #33527e !important;box-shadow:0 12px 28px rgba(0,0,0,.24) !important;}
body[data-theme="dark"] #screen-community .fb-composer-shell input,
body[data-theme="dark"] #screen-community .reply-fb-shell input,
body[data-theme="dark"] #screen-community .thread-comment-box input,
body[data-theme="dark"] #screen-community .reply-composer input,
body[data-theme="dark"] #screen-community #communityPostInput,
body[data-theme="dark"] #screen-community #threadCommentInput,
body[data-theme="dark"] #screen-community select{background:#0a1a31 !important;border:1px solid #33527e !important;color:#eef4ff !important;}
body[data-theme="dark"] #screen-community .fb-composer-shell input::placeholder,
body[data-theme="dark"] #screen-community .reply-fb-shell input::placeholder,
body[data-theme="dark"] #screen-community .thread-comment-box input::placeholder,
body[data-theme="dark"] #screen-community #communityPostInput::placeholder,
body[data-theme="dark"] #screen-community #threadCommentInput::placeholder{color:#9db3d3 !important;}
body[data-theme="dark"] #screen-community .composer-tool-btn{background:#10213d !important;border-color:#33527e !important;color:#ffd46c !important;}
body[data-theme="dark"] #screen-community .composer-send-btn{background:linear-gradient(135deg,#2f62d9,#4387ff) !important;border-color:#74a7ff !important;color:#fff !important;}
body[data-theme="dark"] #screen-community .thread-empty,
body[data-theme="dark"] #screen-community .community-empty{background:#10213d !important;border:1px solid #33527e !important;color:#d7e5fb !important;border-radius:18px !important;}
body[data-theme="dark"] #screen-community .thread-comment-item{background:linear-gradient(180deg,#10213d,#0e1f39) !important;border-color:#32527e !important;}
body[data-theme="dark"] #screen-community .thread-reply-item{background:linear-gradient(180deg,#142846,#10213d) !important;border-color:#375986 !important;}
body[data-theme="dark"] #screen-community .reply-parent-preview{background:rgba(255,255,255,.05) !important;border-color:rgba(116,156,224,.2) !important;color:#d9e7fb !important;}
body[data-theme="dark"] #screen-community .community-inline-message{color:#8ee39b !important;}
body[data-theme="dark"] #screen-community .community-inline-message.error{color:#ff8f8f !important;}


/* v37 progress guest + home path/challenge dark colorful polish */
body[data-theme="dark"] #screen-progress .progress-top-grid .stat-shell,
body[data-theme="dark"] #screen-home .mini-progress-grid .mini-progress-card{
  border-width:1px !important;
  box-shadow:0 14px 30px rgba(0,0,0,.22) !important;
}
body[data-theme="dark"] #screen-progress .progress-top-grid .stat-shell:nth-child(1),
body[data-theme="dark"] #screen-home .mini-progress-grid .mini-progress-card:nth-child(1){
  background:linear-gradient(135deg,#16345f,#1f4f86) !important;
  border-color:#68a6ff !important;
}
body[data-theme="dark"] #screen-progress .progress-top-grid .stat-shell:nth-child(2),
body[data-theme="dark"] #screen-home .mini-progress-grid .mini-progress-card:nth-child(2){
  background:linear-gradient(135deg,#17361f,#205b31) !important;
  border-color:#59d07e !important;
}
body[data-theme="dark"] #screen-progress .progress-top-grid .stat-shell:nth-child(3),
body[data-theme="dark"] #screen-home .mini-progress-grid .mini-progress-card:nth-child(3){
  background:linear-gradient(135deg,#403012,#5f4314) !important;
  border-color:#f0b35b !important;
}
body[data-theme="dark"] #screen-progress .progress-top-grid .stat-shell:nth-child(4){
  background:linear-gradient(135deg,#2c2450,#45357d) !important;
  border-color:#a98bff !important;
}
body[data-theme="dark"] #screen-progress .progress-top-grid .stat-shell strong,
body[data-theme="dark"] #screen-progress .progress-top-grid .stat-shell span,
body[data-theme="dark"] #screen-home .mini-progress-grid .mini-progress-card strong,
body[data-theme="dark"] #screen-home .mini-progress-grid .mini-progress-card span{
  color:#f8fbff !important;
}

body[data-theme="dark"] #screen-progress .progress-login-required,
body[data-theme="dark"] #screen-progress .progress-activity-shell.progress-login-required{
  background:linear-gradient(135deg,#2c1d58,#0f2140) !important;
  border:1px solid #785ee6 !important;
  box-shadow:0 18px 34px rgba(0,0,0,.24) !important;
}
body[data-theme="dark"] #screen-progress .progress-login-required .progress-activity-hero{
  background:linear-gradient(135deg,#17325b,#10213d) !important;
  border-color:#4277c7 !important;
}
body[data-theme="dark"] #screen-progress .progress-login-required h3,
body[data-theme="dark"] #screen-progress .progress-login-required p,
body[data-theme="dark"] #screen-progress .progress-login-required .small-label{
  color:#f3f8ff !important;
}
body[data-theme="dark"] #screen-progress .progress-login-required .primary-btn{
  background:linear-gradient(135deg,#f59e0b,#ff8c1a) !important;
  border-color:#ffbd66 !important;
  color:#2f1d00 !important;
}

body[data-theme="dark"] #screen-progress .progress-roadmap-grid > .panel,
body[data-theme="dark"] #screen-home .home-upgrade-grid > .panel,
body[data-theme="dark"] #screen-home .upgrade-panel{
  background:linear-gradient(180deg,#091c35 0%,#08182d 100%) !important;
  border-color:#27476f !important;
}
body[data-theme="dark"] #screen-progress .section-head h3,
body[data-theme="dark"] #screen-progress .section-head p,
body[data-theme="dark"] #screen-home .section-head h3,
body[data-theme="dark"] #screen-home .section-head p{
  color:#eef4ff !important;
}

body[data-theme="dark"] #screen-progress .pathway-step,
body[data-theme="dark"] #screen-home .pathway-step{
  box-shadow:0 12px 26px rgba(0,0,0,.22) !important;
}
body[data-theme="dark"] #screen-progress .pathway-step:nth-child(1),
body[data-theme="dark"] #screen-home .pathway-step:nth-child(1){
  background:linear-gradient(135deg,#183964,#214f88) !important;
  border-color:#6aa7ff !important;
}
body[data-theme="dark"] #screen-progress .pathway-step:nth-child(2),
body[data-theme="dark"] #screen-home .pathway-step:nth-child(2){
  background:linear-gradient(135deg,#16345f,#255fa3) !important;
  border-color:#77b7ff !important;
}
body[data-theme="dark"] #screen-progress .pathway-step:nth-child(3),
body[data-theme="dark"] #screen-home .pathway-step:nth-child(3){
  background:linear-gradient(135deg,#183a23,#206036) !important;
  border-color:#67d38d !important;
}
body[data-theme="dark"] #screen-progress .pathway-step:nth-child(4),
body[data-theme="dark"] #screen-home .pathway-step:nth-child(4){
  background:linear-gradient(135deg,#453114,#61451a) !important;
  border-color:#f1b868 !important;
}
body[data-theme="dark"] #screen-progress .pathway-step h4,
body[data-theme="dark"] #screen-progress .pathway-step p,
body[data-theme="dark"] #screen-progress .pathway-step span,
body[data-theme="dark"] #screen-home .pathway-step h4,
body[data-theme="dark"] #screen-home .pathway-step p,
body[data-theme="dark"] #screen-home .pathway-step span{
  color:#f6faff !important;
}
body[data-theme="dark"] #screen-progress .pathway-step .primary-btn,
body[data-theme="dark"] #screen-home .pathway-step .primary-btn{
  background:linear-gradient(135deg,#4b7dff,#2f62d9) !important;
  border-color:#8eb5ff !important;
  color:#fff !important;
}

body[data-theme="dark"] #screen-progress .challenge-card,
body[data-theme="dark"] #screen-home .challenge-card{
  background:linear-gradient(135deg,#172b4a,#203d67) !important;
  border-color:#5a8fe2 !important;
  box-shadow:0 12px 26px rgba(0,0,0,.22) !important;
}
body[data-theme="dark"] #screen-progress .challenge-card.done,
body[data-theme="dark"] #screen-home .challenge-card.done{
  background:linear-gradient(135deg,#17361f,#205b31) !important;
  border-color:#62d589 !important;
}
body[data-theme="dark"] #screen-progress .challenge-card .step-kicker,
body[data-theme="dark"] #screen-progress .challenge-card h4,
body[data-theme="dark"] #screen-progress .challenge-card p,
body[data-theme="dark"] #screen-home .challenge-card .step-kicker,
body[data-theme="dark"] #screen-home .challenge-card h4,
body[data-theme="dark"] #screen-home .challenge-card p{
  color:#f4f8ff !important;
}
body[data-theme="dark"] #screen-progress .challenge-card .primary-btn,
body[data-theme="dark"] #screen-home .challenge-card .primary-btn{
  background:linear-gradient(135deg,#4f82ff,#2d60d8) !important;
  border-color:#8cb2ff !important;
  color:#fff !important;
}
body[data-theme="dark"] #screen-progress .challenge-card .secondary-btn,
body[data-theme="dark"] #screen-home .challenge-card .secondary-btn{
  background:#10213d !important;
  border-color:#34527d !important;
  color:#eef4ff !important;
}


/* v38 simplify progress tab for logout/guest */
#screen-progress.guest-progress-view .progress-insight-grid,
#screen-progress.guest-progress-view .progress-bottom-grid{
  display:none !important;
}
#screen-progress.guest-progress-view .progress-roadmap-grid{
  margin-top:18px !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:18px !important;
}
#screen-progress.guest-progress-view .progress-roadmap-grid > .panel-soft{
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%) !important;
  border:1px solid rgba(120,120,160,.16) !important;
  box-shadow:0 14px 28px rgba(31,55,100,.08) !important;
}
#screen-progress.guest-progress-view .progress-roadmap-grid .section-head h3,
#screen-progress.guest-progress-view .progress-roadmap-grid .section-head p,
#screen-progress.guest-progress-view .pathway-step h4,
#screen-progress.guest-progress-view .pathway-step p,
#screen-progress.guest-progress-view .pathway-step .step-kicker,
#screen-progress.guest-progress-view .challenge-card .step-kicker,
#screen-progress.guest-progress-view .challenge-card h4,
#screen-progress.guest-progress-view .challenge-card p{
  color:inherit !important;
}
#screen-progress.guest-progress-view .pathway-steps,
#screen-progress.guest-progress-view .daily-challenge-box{
  display:grid !important;
  gap:12px !important;
}
#screen-progress.guest-progress-view .pathway-step,
#screen-progress.guest-progress-view .challenge-card{
  min-height:unset !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid > .panel-soft{
  background:linear-gradient(180deg,#091c35 0%,#08182d 100%) !important;
  border-color:#27476f !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .section-head h3,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .section-head p,
body[data-theme="dark"] #screen-progress.guest-progress-view .pathway-step h4,
body[data-theme="dark"] #screen-progress.guest-progress-view .pathway-step p,
body[data-theme="dark"] #screen-progress.guest-progress-view .pathway-step .step-kicker,
body[data-theme="dark"] #screen-progress.guest-progress-view .challenge-card .step-kicker,
body[data-theme="dark"] #screen-progress.guest-progress-view .challenge-card h4,
body[data-theme="dark"] #screen-progress.guest-progress-view .challenge-card p{
  color:#f3f8ff !important;
}
@media (max-width: 1100px){
  #screen-progress.guest-progress-view .progress-roadmap-grid{grid-template-columns:1fr !important;}
}


/* v39 colorful home slider grammar cards + progress study path polish */
.hero-slide-grammar .hero-mini-posts{align-items:stretch}
.grammar-demo-card,.hero-demo-post.grammar-demo-card{
  position:relative;
  overflow:hidden;
  border-radius:24px !important;
  border-width:1px !important;
  box-shadow:0 16px 32px rgba(31,55,100,.10) !important;
  transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.grammar-demo-card::before{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(circle at top right, rgba(255,255,255,.72), transparent 44%);
  pointer-events:none;
}
.grammar-demo-card small,
.hero-demo-post.grammar-demo-card small{
  display:inline-flex;
  align-items:center;
  width:max-content;
  padding:7px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.72);
  border:1px solid rgba(255,255,255,.78);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}
.grammar-demo-card strong,.hero-demo-post.grammar-demo-card strong{font-size:21px !important;line-height:1.08}
.grammar-demo-card span,.hero-demo-post.grammar-demo-card span{font-weight:700;color:#48607a !important}
.grammar-demo-card.articles{
  background:linear-gradient(135deg,#eff8ff 0%,#dff0ff 55%,#f9fdff 100%) !important;
  border-color:#9fd2ff !important;
}
.grammar-demo-card.tense{
  background:linear-gradient(135deg,#eefdf3 0%,#daf7e6 55%,#fbfffd 100%) !important;
  border-color:#9fe0b7 !important;
}
.grammar-demo-card.order{
  background:linear-gradient(135deg,#f7f1ff 0%,#ebddff 55%,#fcfbff 100%) !important;
  border-color:#c8afff !important;
}
.grammar-demo-card.articles strong{color:#143f73 !important}
.grammar-demo-card.tense strong{color:#175536 !important}
.grammar-demo-card.order strong{color:#4b2f7d !important}
.grammar-demo-card:hover,.hero-demo-post.grammar-demo-card:hover{
  transform:translateY(-4px);
  box-shadow:0 22px 36px rgba(31,55,100,.14) !important;
}

#screen-progress .pathway-step,
#screen-home .pathway-step{
  border-radius:22px !important;
  padding:16px 16px !important;
  box-shadow:0 14px 26px rgba(31,55,100,.08) !important;
  position:relative;
  overflow:hidden;
}
#screen-progress .pathway-step::before,
#screen-home .pathway-step::before{
  content:"";
  position:absolute;
  top:0;right:0;
  width:90px;height:90px;
  background:radial-gradient(circle, rgba(255,255,255,.52), transparent 62%);
  pointer-events:none;
}
#screen-progress .pathway-step:nth-child(1),
#screen-home .pathway-step:nth-child(1){
  background:linear-gradient(135deg,#eef7ff 0%,#dcecff 58%,#f8fbff 100%) !important;
  border-color:#9fc3ff !important;
}
#screen-progress .pathway-step:nth-child(2),
#screen-home .pathway-step:nth-child(2){
  background:linear-gradient(135deg,#eefeff 0%,#dbf5ff 58%,#f8fdff 100%) !important;
  border-color:#8ed9ff !important;
}
#screen-progress .pathway-step:nth-child(3),
#screen-home .pathway-step:nth-child(3){
  background:linear-gradient(135deg,#effdf3 0%,#dcf8e5 58%,#fbfffd 100%) !important;
  border-color:#98dfb0 !important;
}
#screen-progress .pathway-step:nth-child(4),
#screen-home .pathway-step:nth-child(4){
  background:linear-gradient(135deg,#fff7eb 0%,#ffe7c7 58%,#fffdf8 100%) !important;
  border-color:#f6c67a !important;
}
#screen-progress .pathway-step .step-kicker,
#screen-home .pathway-step .step-kicker{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.76);
  border:1px solid rgba(255,255,255,.78);
  margin-bottom:8px;
  font-size:11px !important;
  letter-spacing:.04em;
}
#screen-progress .pathway-step h4,
#screen-home .pathway-step h4{font-size:24px;margin-bottom:6px !important}
#screen-progress .pathway-step p,
#screen-home .pathway-step p{font-weight:700;line-height:1.5;color:#4f6279 !important}
#screen-progress .pathway-step:nth-child(1) h4,
#screen-home .pathway-step:nth-child(1) h4{color:#173f74 !important}
#screen-progress .pathway-step:nth-child(2) h4,
#screen-home .pathway-step:nth-child(2) h4{color:#155474 !important}
#screen-progress .pathway-step:nth-child(3) h4,
#screen-home .pathway-step:nth-child(3) h4{color:#1b5a36 !important}
#screen-progress .pathway-step:nth-child(4) h4,
#screen-home .pathway-step:nth-child(4) h4{color:#7a4a12 !important}
#screen-progress .pathway-step .primary-btn,
#screen-home .pathway-step .primary-btn{
  min-width:94px;
  box-shadow:0 12px 22px rgba(47,98,217,.18);
}

body[data-theme="dark"] .hero-demo-post.grammar-demo-card,
body[data-theme="dark"] .grammar-demo-card{
  color:#f4f8ff !important;
  box-shadow:0 18px 34px rgba(0,0,0,.26) !important;
}
body[data-theme="dark"] .grammar-demo-card small,
body[data-theme="dark"] .hero-demo-post.grammar-demo-card small{
  background:rgba(255,255,255,.12) !important;
  border-color:rgba(255,255,255,.16) !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] .grammar-demo-card.articles{
  background:linear-gradient(135deg,#15355e 0%,#1d4f86 58%,#17345a 100%) !important;
  border-color:#63a5ff !important;
}
body[data-theme="dark"] .grammar-demo-card.tense{
  background:linear-gradient(135deg,#173a22 0%,#215d35 58%,#183824 100%) !important;
  border-color:#62d48c !important;
}
body[data-theme="dark"] .grammar-demo-card.order{
  background:linear-gradient(135deg,#2e2351 0%,#47317a 58%,#2c234c 100%) !important;
  border-color:#b191ff !important;
}
body[data-theme="dark"] .grammar-demo-card strong,
body[data-theme="dark"] .hero-demo-post.grammar-demo-card strong,
body[data-theme="dark"] .grammar-demo-card span,
body[data-theme="dark"] .hero-demo-post.grammar-demo-card span,
body[data-theme="dark"] .grammar-demo-card small,
body[data-theme="dark"] .hero-demo-post.grammar-demo-card small{
  color:#f4f8ff !important;
}
body[data-theme="dark"] #screen-progress .pathway-step,
body[data-theme="dark"] #screen-home .pathway-step{
  box-shadow:0 16px 30px rgba(0,0,0,.24) !important;
}
body[data-theme="dark"] #screen-progress .pathway-step::before,
body[data-theme="dark"] #screen-home .pathway-step::before{
  background:radial-gradient(circle, rgba(255,255,255,.12), transparent 62%);
}
body[data-theme="dark"] #screen-progress .pathway-step .step-kicker,
body[data-theme="dark"] #screen-home .pathway-step .step-kicker{
  background:rgba(255,255,255,.10) !important;
  border-color:rgba(255,255,255,.14) !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] #screen-progress .pathway-step p,
body[data-theme="dark"] #screen-home .pathway-step p{
  color:#e4eefc !important;
}
@media (max-width: 900px){
  #screen-progress .pathway-step h4,
  #screen-home .pathway-step h4{font-size:20px !important}
}


/* v40 progress study path + guest stat boxes colorful (light and dark) */
#screen-progress .progress-roadmap-grid .pathway-step{
  border-radius:22px !important;
  padding:16px 16px !important;
  box-shadow:0 14px 28px rgba(31,55,100,.09) !important;
  position:relative;
  overflow:hidden;
}
#screen-progress .progress-roadmap-grid .pathway-step::before{
  content:"";
  position:absolute;
  top:0; right:0;
  width:88px; height:88px;
  background:radial-gradient(circle, rgba(255,255,255,.55), transparent 62%);
  pointer-events:none;
}
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(1){
  background:linear-gradient(135deg,#eef7ff 0%,#dbecff 60%,#f9fcff 100%) !important;
  border-color:#9ec4ff !important;
}
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(2){
  background:linear-gradient(135deg,#eefeff 0%,#dbf6ff 60%,#f8fdff 100%) !important;
  border-color:#8fdcff !important;
}
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(3){
  background:linear-gradient(135deg,#effdf3 0%,#dcf8e5 60%,#fbfffd 100%) !important;
  border-color:#97dfb0 !important;
}
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(4){
  background:linear-gradient(135deg,#fff7ea 0%,#ffe7c8 60%,#fffdf8 100%) !important;
  border-color:#f4c777 !important;
}
#screen-progress .progress-roadmap-grid .pathway-step .step-kicker{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.76);
  border:1px solid rgba(255,255,255,.8);
  font-size:11px !important;
  letter-spacing:.04em;
  margin-bottom:8px;
}
#screen-progress .progress-roadmap-grid .pathway-step h4{font-size:23px !important; margin-bottom:6px !important;}
#screen-progress .progress-roadmap-grid .pathway-step p{font-weight:700; line-height:1.5; color:#50657d !important;}
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(1) h4{color:#173f74 !important;}
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(2) h4{color:#125671 !important;}
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(3) h4{color:#1a5b36 !important;}
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(4) h4{color:#7a4a14 !important;}
#screen-progress .progress-roadmap-grid .pathway-step .primary-btn{
  background:linear-gradient(135deg,#4f82ff,#2e63da) !important;
  border-color:#8fb4ff !important;
  color:#fff !important;
  box-shadow:0 12px 22px rgba(47,98,217,.18);
}

/* guest/logout top stats colorful in light mode */
#screen-progress.guest-progress-view .progress-top-grid .stat-shell{
  border-radius:20px !important;
  box-shadow:0 12px 24px rgba(31,55,100,.08) !important;
}
#screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(1){
  background:linear-gradient(135deg,#eef7ff,#dcecff) !important;
  border-color:#9fc4ff !important;
}
#screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(2){
  background:linear-gradient(135deg,#effdf3,#dcf8e5) !important;
  border-color:#98dfb1 !important;
}
#screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(3){
  background:linear-gradient(135deg,#fff7ea,#ffe7c8) !important;
  border-color:#f4c777 !important;
}
#screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(4){
  background:linear-gradient(135deg,#f6f0ff,#ebddff) !important;
  border-color:#c7adff !important;
}
#screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(1) strong,
#screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(1) span{color:#173f74 !important;}
#screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(2) strong,
#screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(2) span{color:#1a5b36 !important;}
#screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(3) strong,
#screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(3) span{color:#8a4d0f !important;}
#screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(4) strong,
#screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(4) span{color:#55348c !important;}

/* dark mode stronger colorful recommended study path */
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step{
  box-shadow:0 16px 30px rgba(0,0,0,.24) !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step::before{
  background:radial-gradient(circle, rgba(255,255,255,.12), transparent 62%);
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step:nth-child(1){
  background:linear-gradient(135deg,#183964 0%,#21508a 60%,#17365e 100%) !important;
  border-color:#69a6ff !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step:nth-child(2){
  background:linear-gradient(135deg,#143760 0%,#1d5f85 60%,#123353 100%) !important;
  border-color:#74cfff !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step:nth-child(3){
  background:linear-gradient(135deg,#173a22 0%,#215d35 60%,#15341f 100%) !important;
  border-color:#63d48d !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step:nth-child(4){
  background:linear-gradient(135deg,#463115 0%,#63461a 60%,#3c2911 100%) !important;
  border-color:#f0b45d !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step h4,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step p,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step span{color:#f4f8ff !important;}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step .step-kicker{
  background:rgba(255,255,255,.11) !important;
  border-color:rgba(255,255,255,.16) !important;
  color:#eef4ff !important;
}


/* v41 fix: progress dark mode text visibility for guest stats + study path */
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-top-grid .stat-shell{
  border-radius:20px !important;
  box-shadow:0 16px 30px rgba(0,0,0,.25) !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(1){
  background:linear-gradient(135deg,#173a67,#22518d) !important;
  border-color:#6ba8ff !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(2){
  background:linear-gradient(135deg,#183a22,#225f37) !important;
  border-color:#64d78f !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(3){
  background:linear-gradient(135deg,#4a3314,#68491a) !important;
  border-color:#f2b55f !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-top-grid .stat-shell:nth-child(4){
  background:linear-gradient(135deg,#34295a,#4b3784) !important;
  border-color:#b091ff !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-top-grid .stat-shell strong,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-top-grid .stat-shell span,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-top-grid .stat-shell small,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-top-grid .stat-shell p,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-top-grid .stat-shell *{
  color:#f8fbff !important;
  opacity:1 !important;
}

body[data-theme="dark"] #screen-progress .progress-roadmap-grid > .panel-soft,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid > .panel{
  background:linear-gradient(180deg,#091c35 0%,#08182d 100%) !important;
  border-color:#27476f !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .section-head h3,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .section-head p,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .section-head span,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .section-head *{
  color:#eef4ff !important;
  opacity:1 !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step{
  box-shadow:0 18px 32px rgba(0,0,0,.26) !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step:nth-child(1){
  background:linear-gradient(135deg,#173a67 0%,#22518d 60%,#17345b 100%) !important;
  border-color:#6ca9ff !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step:nth-child(2){
  background:linear-gradient(135deg,#15405d 0%,#1a6585 60%,#113551 100%) !important;
  border-color:#78d2ff !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step:nth-child(3){
  background:linear-gradient(135deg,#173a22 0%,#225f37 60%,#15341f 100%) !important;
  border-color:#67d891 !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step:nth-child(4){
  background:linear-gradient(135deg,#4a3314 0%,#68491a 60%,#402c12 100%) !important;
  border-color:#f1b661 !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step h4,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step p,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step span,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step strong,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step small,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step *{
  color:#f7fbff !important;
  opacity:1 !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step .step-kicker{
  background:rgba(255,255,255,.14) !important;
  border-color:rgba(255,255,255,.18) !important;
  color:#f7fbff !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step .primary-btn{
  background:linear-gradient(135deg,#5b8cff,#3568e1) !important;
  border-color:#98bbff !important;
  color:#fff !important;
}


/* v42 final: progress recommended study path Block 1-4 colorful + visible */
#screen-progress .progress-roadmap-grid .pathway-step{
  position: relative;
  overflow: hidden;
  border-radius: 24px !important;
  padding: 18px 18px !important;
  min-height: 132px;
  align-items: center !important;
  box-shadow: 0 16px 30px rgba(31,55,100,.10) !important;
}
#screen-progress .progress-roadmap-grid .pathway-step::before{
  content: "";
  position: absolute;
  top: -10px;
  right: -10px;
  width: 110px;
  height: 110px;
  background: radial-gradient(circle, rgba(255,255,255,.60), transparent 64%);
  pointer-events: none;
}
#screen-progress .progress-roadmap-grid .pathway-step .step-kicker,
#screen-progress .progress-roadmap-grid .pathway-step small.step-kicker,
#screen-progress .progress-roadmap-grid .pathway-step .block-label{
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.76) !important;
  border: 1px solid rgba(255,255,255,.82) !important;
  color: #24364d !important;
  font-weight: 800 !important;
  letter-spacing: .03em;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
#screen-progress .progress-roadmap-grid .pathway-step h4,
#screen-progress .progress-roadmap-grid .pathway-step .step-title{
  font-size: 23px !important;
  line-height: 1.08 !important;
  margin: 6px 0 !important;
  font-weight: 900 !important;
}
#screen-progress .progress-roadmap-grid .pathway-step p,
#screen-progress .progress-roadmap-grid .pathway-step .step-copy,
#screen-progress .progress-roadmap-grid .pathway-step span:not(.step-kicker):not(.primary-btn){
  color: #4c6179 !important;
  font-weight: 700 !important;
  opacity: 1 !important;
}
#screen-progress .progress-roadmap-grid .pathway-step .primary-btn{
  background: linear-gradient(135deg,#4f82ff,#2f62d9) !important;
  border-color: #8fb4ff !important;
  color: #ffffff !important;
  box-shadow: 0 12px 22px rgba(47,98,217,.18);
}

/* Light mode colorful blocks */
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(1){
  background: linear-gradient(135deg,#eff7ff 0%,#dcecff 58%,#f9fcff 100%) !important;
  border-color: #9ec5ff !important;
}
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(2){
  background: linear-gradient(135deg,#eefeff 0%,#d8f5ff 58%,#f8fdff 100%) !important;
  border-color: #86ddff !important;
}
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(3){
  background: linear-gradient(135deg,#effdf3 0%,#d9f7e2 58%,#fbfffd 100%) !important;
  border-color: #93dfae !important;
}
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(4){
  background: linear-gradient(135deg,#fff7eb 0%,#ffe5c1 58%,#fffdf8 100%) !important;
  border-color: #f4c16b !important;
}
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(1) h4{ color:#163f74 !important; }
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(2) h4{ color:#14596e !important; }
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(3) h4{ color:#1c5d37 !important; }
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(4) h4{ color:#7c4a11 !important; }
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(1) p,
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(1) span:not(.step-kicker):not(.primary-btn){ color:#46617d !important; }
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(2) p,
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(2) span:not(.step-kicker):not(.primary-btn){ color:#3f687a !important; }
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(3) p,
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(3) span:not(.step-kicker):not(.primary-btn){ color:#446a55 !important; }
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(4) p,
#screen-progress .progress-roadmap-grid .pathway-step:nth-child(4) span:not(.step-kicker):not(.primary-btn){ color:#7a6547 !important; }

/* Dark mode colorful blocks */
body[data-theme="dark"] #screen-progress .progress-roadmap-grid > .panel-soft,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid > .panel{
  background: linear-gradient(180deg,#091c35 0%,#08182d 100%) !important;
  border-color: #27476f !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .section-head h3,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .section-head p,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .section-head span{
  color: #eef4ff !important;
  opacity: 1 !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step{
  box-shadow: 0 18px 34px rgba(0,0,0,.28) !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step::before{
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 64%);
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step:nth-child(1){
  background: linear-gradient(135deg,#173b68 0%,#22538f 58%,#17355d 100%) !important;
  border-color: #6eabff !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step:nth-child(2){
  background: linear-gradient(135deg,#16435f 0%,#1b6887 58%,#133651 100%) !important;
  border-color: #7dd5ff !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step:nth-child(3){
  background: linear-gradient(135deg,#183c23 0%,#226138 58%,#16341f 100%) !important;
  border-color: #69db94 !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step:nth-child(4){
  background: linear-gradient(135deg,#4a3515 0%,#6a4a1a 58%,#3f2c11 100%) !important;
  border-color: #f1b662 !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step h4,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step .step-title,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step p,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step .step-copy,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step span:not(.step-kicker):not(.primary-btn),
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step strong{
  color: #f8fbff !important;
  opacity: 1 !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step .step-kicker,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step small.step-kicker,
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step .block-label{
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.16) !important;
  color: #f8fbff !important;
}
body[data-theme="dark"] #screen-progress .progress-roadmap-grid .pathway-step .primary-btn{
  background: linear-gradient(135deg,#5c8cff,#3568e2) !important;
  border-color: #9abcff !important;
  color: #fff !important;
}


/* v43 guest/logout progress recommended study path final fix */
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step{
  position:relative;
  overflow:hidden;
  border-radius:24px !important;
  padding:18px !important;
  min-height:132px !important;
  box-shadow:0 16px 30px rgba(31,55,100,.10) !important;
}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step::before{
  content:"";
  position:absolute;
  top:-10px; right:-10px;
  width:110px; height:110px;
  background:radial-gradient(circle, rgba(255,255,255,.60), transparent 64%);
  pointer-events:none;
}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step .step-kicker,
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step small.step-kicker,
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step .block-label{
  display:inline-flex;
  align-items:center;
  width:max-content;
  padding:7px 11px;
  border-radius:999px;
  background:rgba(255,255,255,.78) !important;
  border:1px solid rgba(255,255,255,.84) !important;
  color:#24364d !important;
  font-weight:800 !important;
  letter-spacing:.03em;
  line-height:1;
}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step h4,
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step .step-title{
  font-size:23px !important;
  line-height:1.08 !important;
  margin:6px 0 !important;
  font-weight:900 !important;
}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step p,
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step .step-copy,
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step span:not(.step-kicker):not(.primary-btn),
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step small:not(.step-kicker){
  font-weight:700 !important;
  opacity:1 !important;
}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(1){
  background:linear-gradient(135deg,#eff7ff 0%,#dcecff 58%,#f9fcff 100%) !important;
  border-color:#9ec5ff !important;
}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(2){
  background:linear-gradient(135deg,#eefeff 0%,#d8f5ff 58%,#f8fdff 100%) !important;
  border-color:#86ddff !important;
}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(3){
  background:linear-gradient(135deg,#effdf3 0%,#d9f7e2 58%,#fbfffd 100%) !important;
  border-color:#93dfae !important;
}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(4){
  background:linear-gradient(135deg,#fff7eb 0%,#ffe5c1 58%,#fffdf8 100%) !important;
  border-color:#f4c16b !important;
}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(1) h4{color:#163f74 !important;}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(2) h4{color:#14596e !important;}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(3) h4{color:#1c5d37 !important;}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(4) h4{color:#7c4a11 !important;}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(1) p,
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(1) span:not(.step-kicker):not(.primary-btn),
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(1) small:not(.step-kicker){color:#48617d !important;}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(2) p,
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(2) span:not(.step-kicker):not(.primary-btn),
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(2) small:not(.step-kicker){color:#3f687a !important;}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(3) p,
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(3) span:not(.step-kicker):not(.primary-btn),
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(3) small:not(.step-kicker){color:#446a55 !important;}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(4) p,
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(4) span:not(.step-kicker):not(.primary-btn),
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(4) small:not(.step-kicker){color:#7a6547 !important;}
#screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step .primary-btn{
  background:linear-gradient(135deg,#4f82ff,#2f62d9) !important;
  border-color:#8fb4ff !important;
  color:#fff !important;
}

body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid > .panel-soft,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid > .panel{
  background:linear-gradient(180deg,#091c35 0%,#08182d 100%) !important;
  border-color:#27476f !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .section-head h3,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .section-head p,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .section-head span{
  color:#eef4ff !important;
  opacity:1 !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step{
  box-shadow:0 18px 34px rgba(0,0,0,.28) !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step::before{
  background:radial-gradient(circle, rgba(255,255,255,.14), transparent 64%);
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(1){
  background:linear-gradient(135deg,#173b68 0%,#22538f 58%,#17355d 100%) !important;
  border-color:#6eabff !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(2){
  background:linear-gradient(135deg,#16435f 0%,#1b6887 58%,#133651 100%) !important;
  border-color:#7dd5ff !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(3){
  background:linear-gradient(135deg,#183c23 0%,#226138 58%,#16341f 100%) !important;
  border-color:#69db94 !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step:nth-child(4){
  background:linear-gradient(135deg,#4a3515 0%,#6a4a1a 58%,#3f2c11 100%) !important;
  border-color:#f1b662 !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step h4,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step .step-title,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step p,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step .step-copy,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step span:not(.step-kicker):not(.primary-btn),
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step small:not(.step-kicker),
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step strong{
  color:#f8fbff !important;
  opacity:1 !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step .step-kicker,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step small.step-kicker,
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step .block-label{
  background:rgba(255,255,255,.12) !important;
  border-color:rgba(255,255,255,.16) !important;
  color:#f8fbff !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view .progress-roadmap-grid .pathway-step .primary-btn{
  background:linear-gradient(135deg,#5c8cff,#3568e2) !important;
  border-color:#9abcff !important;
  color:#fff !important;
}


/* v44 actual fix: guest/logout progress roadmap-step blocks */
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step{
  position:relative;
  overflow:hidden;
  display:flex !important;
  justify-content:space-between !important;
  align-items:center !important;
  gap:16px !important;
  border-radius:24px !important;
  padding:18px !important;
  min-height:128px !important;
  box-shadow:0 16px 30px rgba(31,55,100,.10) !important;
}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step::before{
  content:"";
  position:absolute;
  top:-10px; right:-10px;
  width:110px; height:110px;
  background:radial-gradient(circle, rgba(255,255,255,.58), transparent 64%);
  pointer-events:none;
}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step .step-copy,
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step .step-actions{
  position:relative;
  z-index:1;
}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step .step-copy{display:grid;gap:6px;min-width:0;flex:1 1 auto;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step .step-kicker{
  display:inline-flex;
  align-items:center;
  width:max-content;
  padding:7px 11px;
  border-radius:999px;
  background:rgba(255,255,255,.78) !important;
  border:1px solid rgba(255,255,255,.84) !important;
  color:#24364d !important;
  font-weight:800 !important;
  letter-spacing:.03em;
  line-height:1;
}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step h4{
  font-size:23px !important;
  line-height:1.08 !important;
  margin:0 !important;
  font-weight:900 !important;
}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step p{
  margin:0 !important;
  font-weight:700 !important;
  line-height:1.45 !important;
  opacity:1 !important;
}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step .primary-btn{
  background:linear-gradient(135deg,#4f82ff,#2f62d9) !important;
  border-color:#8fb4ff !important;
  color:#fff !important;
  min-width:138px;
  box-shadow:0 12px 22px rgba(47,98,217,.18);
}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1){background:linear-gradient(135deg,#eff7ff 0%,#dcecff 58%,#f9fcff 100%) !important;border-color:#9ec5ff !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2){background:linear-gradient(135deg,#eefeff 0%,#d8f5ff 58%,#f8fdff 100%) !important;border-color:#86ddff !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3){background:linear-gradient(135deg,#effdf3 0%,#d9f7e2 58%,#fbfffd 100%) !important;border-color:#93dfae !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4){background:linear-gradient(135deg,#fff7eb 0%,#ffe5c1 58%,#fffdf8 100%) !important;border-color:#f4c16b !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1) h4{color:#163f74 !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2) h4{color:#14596e !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3) h4{color:#1c5d37 !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4) h4{color:#7c4a11 !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1) p{color:#48617d !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2) p{color:#3f687a !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3) p{color:#446a55 !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4) p{color:#7a6547 !important;}

body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step{
  box-shadow:0 18px 34px rgba(0,0,0,.28) !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step::before{
  background:radial-gradient(circle, rgba(255,255,255,.14), transparent 64%);
}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step .step-kicker{
  background:rgba(255,255,255,.12) !important;
  border-color:rgba(255,255,255,.16) !important;
  color:#f8fbff !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1){background:linear-gradient(135deg,#173b68 0%,#22538f 58%,#17355d 100%) !important;border-color:#6eabff !important;}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2){background:linear-gradient(135deg,#16435f 0%,#1b6887 58%,#133651 100%) !important;border-color:#7dd5ff !important;}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3){background:linear-gradient(135deg,#183c23 0%,#226138 58%,#16341f 100%) !important;border-color:#69db94 !important;}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4){background:linear-gradient(135deg,#4a3515 0%,#6a4a1a 58%,#3f2c11 100%) !important;border-color:#f1b662 !important;}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step h4,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step p,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step strong,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step span:not(.step-kicker):not(.primary-btn){
  color:#f8fbff !important;
  opacity:1 !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step .primary-btn{
  background:linear-gradient(135deg,#5c8cff,#3568e2) !important;
  border-color:#9abcff !important;
  color:#fff !important;
}
@media (max-width: 720px){
  #screen-progress.guest-progress-view #roadmapSteps .roadmap-step{flex-direction:column !important;align-items:flex-start !important;}
  #screen-progress.guest-progress-view #roadmapSteps .roadmap-step .primary-btn{width:100%;min-width:0;}
}


/* v45 guest/logout roadmap colors exact mapping: 1 yellow, 2 green, 3 blue, 4 red */
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1){
  background:linear-gradient(135deg,#fff8cf 0%,#ffe98a 58%,#fffdf0 100%) !important;
  border-color:#e6b800 !important;
}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2){
  background:linear-gradient(135deg,#edfdf1 0%,#c8f2d3 58%,#f8fffa 100%) !important;
  border-color:#39b96c !important;
}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3){
  background:linear-gradient(135deg,#eef5ff 0%,#cfe0ff 58%,#f8fbff 100%) !important;
  border-color:#4f82ff !important;
}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4){
  background:linear-gradient(135deg,#fff0f0 0%,#ffcaca 58%,#fff8f8 100%) !important;
  border-color:#e05a5a !important;
}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1) .step-kicker,
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2) .step-kicker,
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3) .step-kicker,
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4) .step-kicker{
  box-shadow:0 1px 0 rgba(255,255,255,.5) inset;
}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1) h4{color:#6f5200 !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2) h4{color:#155a34 !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3) h4{color:#1f4eb3 !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4) h4{color:#9f1f1f !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1) p{color:#76642a !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2) p{color:#3c6f51 !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3) p{color:#486090 !important;}
#screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4) p{color:#8a5555 !important;}

body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1){
  background:linear-gradient(135deg,#4e3e06 0%,#6f5600 58%,#3c3006 100%) !important;
  border-color:#f4cf43 !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2){
  background:linear-gradient(135deg,#12371f 0%,#18512b 58%,#102c19 100%) !important;
  border-color:#58d68d !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3){
  background:linear-gradient(135deg,#14305d 0%,#1a4586 58%,#12294d 100%) !important;
  border-color:#7fb0ff !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4){
  background:linear-gradient(135deg,#4a1919 0%,#6a2323 58%,#3a1313 100%) !important;
  border-color:#ff8e8e !important;
}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1) h4,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1) p,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1) strong,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(1) span:not(.primary-btn){color:#fff8d0 !important;}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2) h4,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2) p,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2) strong,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(2) span:not(.primary-btn){color:#e6fff0 !important;}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3) h4,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3) p,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3) strong,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(3) span:not(.primary-btn){color:#eef4ff !important;}
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4) h4,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4) p,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4) strong,
body[data-theme="dark"] #screen-progress.guest-progress-view #roadmapSteps .roadmap-step:nth-child(4) span:not(.primary-btn){color:#ffe9e9 !important;}


/* v47 mini leaderboard under daily challenge for login + logout */
#dailyChallengeBox{display:grid;gap:14px;align-content:start;}
#screen-progress .mini-leaderboard-card{
  display:grid;gap:12px;padding:16px;border-radius:22px;border:1px solid #d8e2f1;
  background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);box-shadow:0 14px 28px rgba(31,55,100,.08);
}
#screen-progress .mini-leaderboard-card .compact-head{display:grid;gap:2px;}
#screen-progress .mini-leaderboard-card .compact-head h3{margin:0;font-size:20px;color:#1f3764;}
#screen-progress .mini-leaderboard-card .compact-head p{margin:0;color:#607089;font-weight:700;}
#screen-progress .mini-leaderboard-list{display:grid;gap:10px;}
#screen-progress .mini-leaderboard-item{
  display:grid;grid-template-columns:54px minmax(0,1fr) auto;align-items:center;gap:12px;
  padding:12px 14px;border-radius:18px;border:1px solid #dce6f4;background:linear-gradient(135deg,#f9fbff 0%,#eef5ff 100%);
}
#screen-progress .mini-leaderboard-item:nth-child(1){background:linear-gradient(135deg,#fff8dc 0%,#ffefaa 100%);border-color:#f0c54a;}
#screen-progress .mini-leaderboard-item:nth-child(2){background:linear-gradient(135deg,#f3f6fb 0%,#e2e8f0 100%);border-color:#c8d2df;}
#screen-progress .mini-leaderboard-item:nth-child(3){background:linear-gradient(135deg,#fff3eb 0%,#ffd8bf 100%);border-color:#f4b183;}
#screen-progress .mini-leaderboard-item.you{box-shadow:0 0 0 2px rgba(79,130,255,.18) inset;}
#screen-progress .mini-leaderboard-rank{display:grid;place-items:center;width:42px;height:42px;border-radius:999px;background:#1f3764;color:#fff;font-weight:900;}
#screen-progress .mini-leaderboard-meta{min-width:0;display:grid;gap:2px;}
#screen-progress .mini-leaderboard-meta strong{font-size:16px;color:#1f3764;}
#screen-progress .mini-leaderboard-meta span{font-size:12px;color:#607089;font-weight:700;}
#screen-progress .mini-leaderboard-score{font-weight:900;color:#1f3764;white-space:nowrap;}
body[data-theme="dark"] #screen-progress .mini-leaderboard-card{
  background:linear-gradient(180deg,#0c1a31 0%,#0d213d 100%);border-color:#29496f;box-shadow:0 16px 30px rgba(0,0,0,.24);
}
body[data-theme="dark"] #screen-progress .mini-leaderboard-card .compact-head h3,
body[data-theme="dark"] #screen-progress .mini-leaderboard-card .compact-head p{color:#eef4ff;}
body[data-theme="dark"] #screen-progress .mini-leaderboard-item{border-color:#35507b;background:linear-gradient(135deg,#122540 0%,#10203a 100%);}
body[data-theme="dark"] #screen-progress .mini-leaderboard-item:nth-child(1){background:linear-gradient(135deg,#4e3f06 0%,#6b550b 100%);border-color:#f2ca59;}
body[data-theme="dark"] #screen-progress .mini-leaderboard-item:nth-child(2){background:linear-gradient(135deg,#303a4b 0%,#46556a 100%);border-color:#aab6c7;}
body[data-theme="dark"] #screen-progress .mini-leaderboard-item:nth-child(3){background:linear-gradient(135deg,#5b3417 0%,#7a4720 100%);border-color:#f2b07e;}
body[data-theme="dark"] #screen-progress .mini-leaderboard-item:nth-child(n+4){background:linear-gradient(135deg,#122540 0%,#10203a 100%);}
body[data-theme="dark"] #screen-progress .mini-leaderboard-item.you{box-shadow:0 0 0 2px rgba(110,171,255,.22) inset;}
body[data-theme="dark"] #screen-progress .mini-leaderboard-rank{background:#244f8f;color:#fff;}
body[data-theme="dark"] #screen-progress .mini-leaderboard-meta strong,
body[data-theme="dark"] #screen-progress .mini-leaderboard-score,
body[data-theme="dark"] #screen-progress .mini-leaderboard-meta span{color:#eef4ff;}
@media (max-width: 720px){
  #screen-progress .mini-leaderboard-item{grid-template-columns:44px minmax(0,1fr);}
  #screen-progress .mini-leaderboard-score{grid-column:2;}
}


/* v49 header alignment + typography polish */
.topbar-premium{
  display:flex !important;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:16px 18px !important;
  min-height:104px;
  font-family: Inter, "Segoe UI", "SF Pro Display", system-ui, sans-serif;
}
.topbar-left-cluster{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
  flex:1 1 auto;
}
.topbar-brand-panel{
  flex:1 1 auto;
  max-width:560px;
  padding:0 !important;
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
}
.topbar-brand-row{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
  padding:14px 18px;
  border-radius:26px;
  background:linear-gradient(135deg,#ffffff 0%,#f7f9ff 55%,#eef7f6 100%);
  border:1px solid #dbe5f2;
  box-shadow:0 14px 28px rgba(31,55,100,.08), inset 0 1px 0 rgba(255,255,255,.9);
}
.topbar-brand-logo{
  width:62px;
  height:62px;
  border-radius:20px;
  flex:0 0 62px;
  display:grid;
  place-items:center;
  font-size:23px;
  font-weight:1000;
  letter-spacing:-.05em;
  color:#fff;
  background:linear-gradient(135deg,#8b3dff,#2563eb 60%,#22c55e);
  box-shadow:0 14px 26px rgba(79,130,255,.24);
}
.topbar-brand-copy{
  min-width:0;
  display:grid;
  gap:4px;
}
.topbar-brand-badge{
  display:inline-flex;
  align-items:center;
  width:max-content;
  max-width:100%;
  padding:7px 12px;
  border-radius:999px;
  background:linear-gradient(135deg,#f3e8ff,#ede9fe);
  border:1px solid #d8b4fe;
  color:#7c3aed;
  font-weight:900;
  font-size:13px;
}
.topbar-premium .small-label{
  color:#8b3dff !important;
  font-size:14px !important;
  font-weight:900 !important;
  margin:0;
}
.topbar-premium .main-label{
  color:#24364d !important;
  font-size:clamp(20px,2vw,28px) !important;
  line-height:1.12 !important;
  font-weight:1000 !important;
  letter-spacing:-.04em;
  margin:0;
}
.topbar-actions-premium{
  display:flex !important;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex:0 0 auto;
  margin-left:auto;
  padding:6px;
  white-space:nowrap;
}
.topbar-actions-premium > *{margin:0 !important;}
.topbar-actions-premium .auth-pill{order:1;min-height:52px;padding:0 18px !important;font-size:16px !important;}
.topbar-actions-premium #themeToggle,
.topbar-actions-premium .theme-toggle{order:2;}
.topbar-actions-premium .auth-open-icon-btn,
.topbar-actions-premium .profile-chip,
.topbar-actions-premium .user-chip,
.topbar-actions-premium .icon-btn:last-child{order:3;}
.topbar-actions-premium .icon-btn,
.topbar-actions-premium .theme-toggle,
.topbar-actions-premium .auth-open-icon-btn,
.topbar-actions-premium .profile-chip,
.topbar-actions-premium .user-chip{
  min-width:58px;
  min-height:58px;
}
.topbar-premium .topbar-back-btn{
  min-height:52px;
  padding:0 16px !important;
}
@media (max-width: 1180px){
  .topbar-premium{padding:14px 16px !important;}
  .topbar-brand-row{padding:12px 14px;}
  .topbar-brand-logo{width:56px;height:56px;flex-basis:56px;font-size:21px;}
  .topbar-premium .main-label{font-size:clamp(18px,2vw,24px) !important;}
}
@media (max-width: 900px){
  .topbar-premium{align-items:flex-start;}
  .topbar-left-cluster{gap:10px;}
  .topbar-brand-panel{max-width:none;}
  .topbar-brand-row{padding:12px;gap:12px;border-radius:22px;}
  .topbar-actions-premium{padding:4px;gap:8px;}
  .topbar-actions-premium .auth-pill{padding:0 14px !important;font-size:15px !important;}
}
@media (max-width: 760px){
  .topbar-premium{
    flex-direction:column;
    align-items:stretch;
    gap:12px;
    min-height:auto;
    padding:12px !important;
    border-radius:22px !important;
  }
  .topbar-left-cluster{
    display:grid;
    grid-template-columns:48px minmax(0,1fr);
    gap:10px;
    align-items:start;
  }
  .topbar-menu-btn{grid-column:1;grid-row:1;align-self:start;}
  .topbar-premium .topbar-back-btn{display:none !important;}
  .topbar-brand-panel{grid-column:2;}
  .topbar-brand-row{padding:12px;gap:10px;border-radius:20px;}
  .topbar-brand-logo{width:48px;height:48px;flex-basis:48px;border-radius:16px;font-size:18px;}
  .topbar-brand-badge{padding:5px 10px;font-size:11px;}
  .topbar-premium .small-label{font-size:12px !important;}
  .topbar-premium .main-label{font-size:16px !important;line-height:1.18 !important;}
  .topbar-actions-premium{
    justify-content:flex-start;
    margin-left:0;
    width:100%;
    padding:0;
    background:transparent;
    border:none;
    box-shadow:none;
    gap:8px;
    flex-wrap:wrap;
  }
  .topbar-actions-premium .auth-pill{
    flex:1 1 160px;
    justify-content:center;
    min-height:50px;
  }
  .topbar-actions-premium .icon-btn,
  .topbar-actions-premium .theme-toggle,
  .topbar-actions-premium .auth-open-icon-btn,
  .topbar-actions-premium .profile-chip,
  .topbar-actions-premium .user-chip{
    min-width:50px;
    min-height:50px;
  }
}
body[data-theme="dark"] .topbar-brand-row{
  background:linear-gradient(135deg,#122540 0%,#10203a 55%,#0f2d28 100%);
  border-color:#2f4b73;
  box-shadow:0 16px 30px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.03);
}
body[data-theme="dark"] .topbar-brand-logo{
  background:linear-gradient(135deg,#7c3aed,#2563eb 62%,#22c55e);
  box-shadow:0 14px 26px rgba(0,0,0,.24);
}
body[data-theme="dark"] .topbar-premium .main-label{color:#eef4ff !important;}
body[data-theme="dark"] .topbar-premium .small-label{color:#c68cff !important;}
body[data-theme="dark"] .topbar-brand-badge{background:linear-gradient(135deg,#31204d,#241b41);border-color:#6b46c1;color:#eadcff;}
body[data-theme="dark"] .topbar-actions-premium{
  background:linear-gradient(135deg,rgba(17,35,63,.84),rgba(15,28,51,.96));
  border:1px solid #2c4974;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}
@media (max-width:760px){
  body[data-theme="dark"] .topbar-actions-premium{background:transparent;border:none;box-shadow:none;}
}


/* v50 mobile header cleanup + progress quick cards */
.roadmap-quick-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-top:16px;
}
.roadmap-quick-card{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:16px;
  border-radius:22px;
  border:1px solid #d8e4f2;
  background:linear-gradient(135deg,#ffffff,#f7fbff);
  box-shadow:0 14px 28px rgba(31,55,100,.08);
}
.roadmap-quick-card .roadmap-quick-icon{
  width:44px;height:44px;border-radius:14px;display:grid;place-items:center;
  font-size:22px;font-weight:900;flex:0 0 44px;background:rgba(255,255,255,.78);border:1px solid rgba(255,255,255,.76);
}
.roadmap-quick-copy{display:grid;gap:4px;min-width:0;}
.roadmap-quick-copy .small-label{font-size:12px !important;font-weight:900 !important;letter-spacing:.03em;}
.roadmap-quick-copy h5{margin:0;font-size:18px;line-height:1.18;color:#1f3764;font-weight:900;}
.roadmap-quick-copy p{margin:0;color:#607089;font-weight:700;line-height:1.35;}
.roadmap-quick-card.level{background:linear-gradient(135deg,#fff8cf 0%,#ffe98a 58%,#fffdf0 100%);border-color:#e6b800;}
.roadmap-quick-card.level h5{color:#6f5200;}.roadmap-quick-card.level p,.roadmap-quick-card.level .small-label{color:#866917 !important;}
.roadmap-quick-card.badges{background:linear-gradient(135deg,#edfdf1 0%,#c8f2d3 58%,#f8fffa 100%);border-color:#39b96c;}
.roadmap-quick-card.badges h5{color:#155a34;}.roadmap-quick-card.badges p,.roadmap-quick-card.badges .small-label{color:#3c6f51 !important;}
.roadmap-quick-card.leaderboard{background:linear-gradient(135deg,#eef5ff 0%,#cfe0ff 58%,#f8fbff 100%);border-color:#4f82ff;}
.roadmap-quick-card.leaderboard h5{color:#1f4eb3;}.roadmap-quick-card.leaderboard p,.roadmap-quick-card.leaderboard .small-label{color:#486090 !important;}

#screen-progress .progress-bottom-grid{display:none !important;}

@media (max-width: 900px){
  .roadmap-quick-grid{grid-template-columns:1fr;}
}

@media (max-width: 760px){
  .topbar-menu-btn{display:none !important;}
  .topbar-premium{
    padding:12px !important;
  }
  .topbar-left-cluster{
    display:block !important;
  }
  .topbar-brand-panel{grid-column:auto !important;max-width:none;}
  .topbar-brand-row{
    padding:10px 12px !important;
    gap:10px;
    border-radius:18px;
  }
  .topbar-brand-logo{width:44px;height:44px;flex-basis:44px;border-radius:14px;font-size:16px;}
  .topbar-premium .main-label{font-size:15px !important;line-height:1.15 !important;}
  .topbar-premium .small-label{font-size:11px !important;}
  .topbar-brand-badge{font-size:10px;padding:4px 8px;}
  .topbar-actions-premium{
    width:100%;
    justify-content:flex-start;
    gap:8px;
    flex-wrap:nowrap;
    overflow-x:auto;
    padding-bottom:2px;
  }
  .topbar-actions-premium::-webkit-scrollbar{display:none;}
  .topbar-actions-premium .auth-pill{
    flex:0 0 auto;
    min-height:42px;
    padding:0 12px !important;
    font-size:14px !important;
  }
  .topbar-actions-premium .icon-btn,
  .topbar-actions-premium .theme-toggle,
  .topbar-actions-premium .auth-open-icon-btn,
  .topbar-actions-premium .profile-chip,
  .topbar-actions-premium .user-chip{
    min-width:42px;
    min-height:42px;
    width:42px;
    height:42px;
  }
}

body[data-theme="dark"] .roadmap-quick-card{
  box-shadow:0 16px 30px rgba(0,0,0,.22);
}
body[data-theme="dark"] .roadmap-quick-card.level{background:linear-gradient(135deg,#4e3e06 0%,#6f5600 58%,#3c3006 100%);border-color:#f4cf43;}
body[data-theme="dark"] .roadmap-quick-card.badges{background:linear-gradient(135deg,#12371f 0%,#18512b 58%,#102c19 100%);border-color:#58d68d;}
body[data-theme="dark"] .roadmap-quick-card.leaderboard{background:linear-gradient(135deg,#14305d 0%,#1a4586 58%,#12294d 100%);border-color:#7fb0ff;}
body[data-theme="dark"] .roadmap-quick-card.level h5, body[data-theme="dark"] .roadmap-quick-card.level p, body[data-theme="dark"] .roadmap-quick-card.level .small-label{color:#fff8d0 !important;}
body[data-theme="dark"] .roadmap-quick-card.badges h5, body[data-theme="dark"] .roadmap-quick-card.badges p, body[data-theme="dark"] .roadmap-quick-card.badges .small-label{color:#e6fff0 !important;}
body[data-theme="dark"] .roadmap-quick-card.leaderboard h5, body[data-theme="dark"] .roadmap-quick-card.leaderboard p, body[data-theme="dark"] .roadmap-quick-card.leaderboard .small-label{color:#eef4ff !important;}


/* v51 mobile app-style header compact + hard hide hamburger */
@media (max-width: 820px){
  #menuToggle,
  .topbar-menu-btn,
  .topbar-premium #menuToggle,
  .topbar-premium .topbar-menu-btn,
  button#menuToggle.icon-btn,
  button#menuToggle{
    display:none !important;
    visibility:hidden !important;
    opacity:0 !important;
    width:0 !important;
    height:0 !important;
    min-width:0 !important;
    min-height:0 !important;
    max-width:0 !important;
    max-height:0 !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    overflow:hidden !important;
    pointer-events:none !important;
  }
  .topbar-premium{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:8px !important;
    min-height:auto !important;
    padding:10px 10px !important;
    border-radius:20px !important;
    margin:0 0 10px !important;
    overflow:visible !important;
  }
  .topbar-left-cluster{
    display:block !important;
    width:100% !important;
    min-width:0 !important;
  }
  .topbar-brand-panel{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }
  .topbar-brand-row{
    width:100% !important;
    display:grid !important;
    grid-template-columns:40px minmax(0,1fr) !important;
    gap:9px !important;
    align-items:center !important;
    padding:9px 10px !important;
    border-radius:17px !important;
  }
  .topbar-brand-logo{
    width:40px !important;
    height:40px !important;
    min-width:40px !important;
    flex-basis:40px !important;
    border-radius:13px !important;
    font-size:15px !important;
    box-shadow:0 8px 16px rgba(79,130,255,.20) !important;
  }
  .topbar-brand-copy{
    min-width:0 !important;
    gap:2px !important;
  }
  .topbar-brand-badge{
    font-size:9px !important;
    line-height:1 !important;
    padding:4px 7px !important;
    max-width:120px !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
  }
  .topbar-premium .small-label{
    font-size:11px !important;
    line-height:1.05 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }
  .topbar-premium .main-label{
    font-size:15px !important;
    line-height:1.08 !important;
    letter-spacing:-.03em !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }
  .topbar-actions-premium{
    width:100% !important;
    display:grid !important;
    grid-template-columns:minmax(74px,1fr) 48px 48px !important;
    align-items:center !important;
    gap:7px !important;
    padding:0 !important;
    margin:0 !important;
    overflow:visible !important;
    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
  }
  .topbar-actions-premium .auth-pill{
    width:100% !important;
    min-width:0 !important;
    height:44px !important;
    min-height:44px !important;
    padding:0 10px !important;
    border-radius:15px !important;
    font-size:13px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }
  .topbar-actions-premium .theme-toggle,
  .topbar-actions-premium #themeToggle{
    width:48px !important;
    min-width:48px !important;
    max-width:48px !important;
    height:44px !important;
    min-height:44px !important;
    border-radius:15px !important;
    padding:0 !important;
    background:linear-gradient(135deg,#17325b,#0f213d) !important;
    border:1px solid #2f5a95 !important;
    box-shadow:0 10px 20px rgba(31,55,100,.18) !important;
  }
  .topbar-actions-premium .theme-toggle-track{
    padding:0 5px !important;
  }
  .topbar-actions-premium .theme-icon{
    font-size:14px !important;
  }
  .topbar-actions-premium .theme-toggle-thumb{
    width:32px !important;
    height:32px !important;
    left:5px !important;
    background:linear-gradient(135deg,#2563eb,#1f3764) !important;
    box-shadow:0 8px 16px rgba(0,0,0,.20) !important;
  }
  .topbar-actions-premium .theme-toggle.dark .theme-toggle-thumb,
  .topbar-actions-premium .theme-toggle[aria-pressed="true"] .theme-toggle-thumb{
    transform:translate(6px,-50%) !important;
    background:linear-gradient(135deg,#0f172a,#334155) !important;
  }
  .topbar-actions-premium .auth-open-icon-btn,
  .topbar-actions-premium .profile-chip,
  .topbar-actions-premium .user-chip,
  .topbar-actions-premium .icon-btn:last-child{
    width:48px !important;
    min-width:48px !important;
    max-width:48px !important;
    height:44px !important;
    min-height:44px !important;
    border-radius:15px !important;
    padding:0 !important;
    display:grid !important;
    place-items:center !important;
    font-size:22px !important;
    background:linear-gradient(135deg,#22c55e,#16a34a) !important;
    border:1px solid #86efac !important;
    box-shadow:0 10px 20px rgba(34,197,94,.18) !important;
  }
  .topbar-actions-premium > *{transform:none !important;}
}
@media (max-width: 420px){
  .topbar-premium{padding:8px !important;border-radius:18px !important;gap:7px !important;}
  .topbar-brand-row{grid-template-columns:36px minmax(0,1fr) !important;padding:8px 9px !important;}
  .topbar-brand-logo{width:36px !important;height:36px !important;min-width:36px !important;font-size:14px !important;}
  .topbar-premium .main-label{font-size:14px !important;}
  .topbar-actions-premium{grid-template-columns:minmax(64px,1fr) 44px 44px !important;gap:6px !important;}
  .topbar-actions-premium .auth-pill,
  .topbar-actions-premium .theme-toggle,
  .topbar-actions-premium #themeToggle,
  .topbar-actions-premium .auth-open-icon-btn,
  .topbar-actions-premium .profile-chip,
  .topbar-actions-premium .user-chip,
  .topbar-actions-premium .icon-btn:last-child{
    height:40px !important;
    min-height:40px !important;
    border-radius:14px !important;
  }
  .topbar-actions-premium .theme-toggle,
  .topbar-actions-premium #themeToggle,
  .topbar-actions-premium .auth-open-icon-btn,
  .topbar-actions-premium .profile-chip,
  .topbar-actions-premium .user-chip,
  .topbar-actions-premium .icon-btn:last-child{
    width:44px !important;
    min-width:44px !important;
    max-width:44px !important;
  }
}
body[data-theme="dark"] .topbar-actions-premium .theme-toggle,
body[data-theme="dark"] .topbar-actions-premium #themeToggle{
  background:linear-gradient(135deg,#0b1729,#132847) !important;
  border-color:#3a5f95 !important;
  box-shadow:0 10px 20px rgba(0,0,0,.22) !important;
}
body[data-theme="dark"] .topbar-actions-premium .auth-open-icon-btn,
body[data-theme="dark"] .topbar-actions-premium .profile-chip,
body[data-theme="dark"] .topbar-actions-premium .user-chip,
body[data-theme="dark"] .topbar-actions-premium .icon-btn:last-child{
  background:linear-gradient(135deg,#16a34a,#15803d) !important;
  border-color:#4ade80 !important;
  color:#ecfdf5 !important;
}


/* v52 stories dark contrast + responsive story menu polish */
#screen-stories .lesson-layout,
#screen-stories .story-layout,
#screen-stories .story-layout-v2{
  gap:20px !important;
}
#screen-stories .panel,
#screen-stories .panel-soft{
  overflow:hidden;
}
#screen-stories .lesson-nav,
#screen-stories #storySidebar,
#screen-stories .story-sidebar,
#screen-stories .story-menu,
#screen-stories .story-list{
  display:grid;
  gap:12px;
}
#screen-stories .lesson-nav-btn,
#screen-stories .story-nav-btn,
#screen-stories .story-card,
#screen-stories .story-part{
  border-radius:22px !important;
  border:1px solid #dbe6f4 !important;
  background:linear-gradient(135deg,#ffffff 0%,#f7fbff 100%) !important;
  box-shadow:0 12px 24px rgba(31,55,100,.07) !important;
  color:#1f3764 !important;
}
#screen-stories .lesson-nav-btn.active,
#screen-stories .story-nav-btn.active,
#screen-stories .story-card.active,
#screen-stories .story-part.active{
  background:linear-gradient(135deg,#eef7ff 0%,#dcecff 100%) !important;
  border-color:#89b6ff !important;
  box-shadow:0 16px 30px rgba(79,130,255,.16) !important;
}
#screen-stories .story-control-bar,
#screen-stories .story-control-bar-upgraded,
#screen-stories .story-player-shell,
#screen-stories .story-progress-wrap{
  background:linear-gradient(135deg,#ffffff 0%,#f7fbff 100%) !important;
  border:1px solid #dbe6f4 !important;
  box-shadow:0 14px 28px rgba(31,55,100,.08) !important;
}
#screen-stories .story-control,
#screen-stories .story-mini-btn,
#screen-stories .story-jump-row .play-btn,
#screen-stories .jump-select{
  border-radius:18px !important;
}
#screen-stories .story-line-list{
  gap:14px !important;
}
#screen-stories .story-line-row{
  border-radius:22px !important;
  padding:18px 20px !important;
  background:linear-gradient(135deg,#ffffff 0%,#f7fbff 100%) !important;
  border:1px solid #dbe6f4 !important;
  box-shadow:0 10px 22px rgba(31,55,100,.07) !important;
}
#screen-stories .story-line-row.active{
  background:linear-gradient(135deg,#fff8cf 0%,#fff0a6 100%) !important;
  border-color:#f2c94c !important;
}
#screen-stories .story-line-label{
  background:#eef5ff !important;
  color:#2558a7 !important;
}
#screen-stories .story-line-it{
  color:#173252 !important;
  font-weight:900 !important;
  letter-spacing:.01em;
}
#screen-stories .story-line-en{
  color:#4f647d !important;
  font-weight:800 !important;
}
#screen-stories .story-it{
  background:linear-gradient(135deg,#ecfdf3 0%,#dcfce7 100%) !important;
  border:1px solid #86efac !important;
}
#screen-stories .story-en{
  background:linear-gradient(135deg,#eff6ff 0%,#dbeafe 100%) !important;
  border:1px solid #93c5fd !important;
}
#screen-stories .story-it *,
#screen-stories .story-en *{
  opacity:1 !important;
}

body[data-theme="dark"] #screen-stories .panel,
body[data-theme="dark"] #screen-stories .panel-soft,
body[data-theme="dark"] #screen-stories .story-stage,
body[data-theme="dark"] #screen-stories .story-segment{
  background:linear-gradient(180deg,#07182f 0%,#091d38 100%) !important;
  border-color:#29496f !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] #screen-stories .section-head h2,
body[data-theme="dark"] #screen-stories .section-head h3,
body[data-theme="dark"] #screen-stories .section-head p,
body[data-theme="dark"] #screen-stories h2,
body[data-theme="dark"] #screen-stories h3,
body[data-theme="dark"] #screen-stories h4,
body[data-theme="dark"] #screen-stories p,
body[data-theme="dark"] #screen-stories span,
body[data-theme="dark"] #screen-stories strong,
body[data-theme="dark"] #screen-stories .small-label{
  color:#eef4ff !important;
  opacity:1 !important;
}
body[data-theme="dark"] #screen-stories .lesson-nav-btn,
body[data-theme="dark"] #screen-stories .story-nav-btn,
body[data-theme="dark"] #screen-stories .story-card,
body[data-theme="dark"] #screen-stories .story-part{
  background:linear-gradient(135deg,#10213d 0%,#0d1d36 100%) !important;
  border-color:#31527f !important;
  color:#eef4ff !important;
  box-shadow:0 14px 28px rgba(0,0,0,.22) !important;
}
body[data-theme="dark"] #screen-stories .lesson-nav-btn.active,
body[data-theme="dark"] #screen-stories .story-nav-btn.active,
body[data-theme="dark"] #screen-stories .story-card.active,
body[data-theme="dark"] #screen-stories .story-part.active{
  background:linear-gradient(135deg,#173a67 0%,#22518d 100%) !important;
  border-color:#6ba8ff !important;
  box-shadow:0 18px 34px rgba(0,0,0,.26) !important;
}
body[data-theme="dark"] #screen-stories .story-control-bar,
body[data-theme="dark"] #screen-stories .story-control-bar-upgraded,
body[data-theme="dark"] #screen-stories .story-player-shell,
body[data-theme="dark"] #screen-stories .story-progress-wrap,
body[data-theme="dark"] #screen-stories .story-jump-row{
  background:linear-gradient(135deg,#10213d 0%,#0d1d36 100%) !important;
  border-color:#31527f !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] #screen-stories .story-control,
body[data-theme="dark"] #screen-stories .story-mini-btn,
body[data-theme="dark"] #screen-stories .story-jump-row .play-btn,
body[data-theme="dark"] #screen-stories .jump-select{
  background:linear-gradient(135deg,#132744 0%,#10203a 100%) !important;
  border:1px solid #3a5b8d !important;
  color:#eef4ff !important;
  box-shadow:0 10px 22px rgba(0,0,0,.18) !important;
}
body[data-theme="dark"] #screen-stories .story-control:hover,
body[data-theme="dark"] #screen-stories .story-mini-btn:hover{
  border-color:#74a7ff !important;
  background:linear-gradient(135deg,#17345e 0%,#132744 100%) !important;
}
body[data-theme="dark"] #screen-stories .story-it{
  background:linear-gradient(135deg,#12371f 0%,#18512b 100%) !important;
  border:1px solid #58d68d !important;
  color:#e6fff0 !important;
}
body[data-theme="dark"] #screen-stories .story-en{
  background:linear-gradient(135deg,#14305d 0%,#1a4586 100%) !important;
  border:1px solid #7fb0ff !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] #screen-stories .story-it *,
body[data-theme="dark"] #screen-stories .story-en *{
  color:inherit !important;
  opacity:1 !important;
}
body[data-theme="dark"] #screen-stories .story-line-row{
  background:linear-gradient(135deg,#132744 0%,#10203a 100%) !important;
  border:1px solid #3a5b8d !important;
  box-shadow:0 14px 28px rgba(0,0,0,.24) !important;
}
body[data-theme="dark"] #screen-stories .story-line-row.active{
  background:linear-gradient(135deg,#4e3e06 0%,#6f5600 100%) !important;
  border-color:#f4cf43 !important;
}
body[data-theme="dark"] #screen-stories .story-line-row.done{
  background:linear-gradient(135deg,#12371f 0%,#102c19 100%) !important;
  border-color:#58d68d !important;
}
body[data-theme="dark"] #screen-stories .story-line-label{
  background:rgba(255,255,255,.12) !important;
  border:1px solid rgba(255,255,255,.14) !important;
  color:#f8fbff !important;
}
body[data-theme="dark"] #screen-stories .story-line-it,
body[data-theme="dark"] #screen-stories .story-line-it .word{
  color:#f8fbff !important;
  opacity:1 !important;
  text-shadow:none !important;
}
body[data-theme="dark"] #screen-stories .story-line-en{
  color:#d7e5fb !important;
  opacity:1 !important;
}
body[data-theme="dark"] #screen-stories .story-line-it .word.active{
  background:#ffd84d !important;
  color:#1d1d1d !important;
}
body[data-theme="dark"] #screen-stories .story-now-kicker,
body[data-theme="dark"] #screen-stories .segment-kicker,
body[data-theme="dark"] #screen-stories .story-chip{
  background:linear-gradient(135deg,#4e3e06,#6f5600) !important;
  border:1px solid #f4cf43 !important;
  color:#fff8d0 !important;
}
body[data-theme="dark"] #screen-stories .story-now-line,
body[data-theme="dark"] #screen-stories .story-now-sub,
body[data-theme="dark"] #screen-stories .story-progress-text,
body[data-theme="dark"] #screen-stories .story-timeline-note{
  color:#eef4ff !important;
  opacity:1 !important;
}
body[data-theme="dark"] #storySeekBar{
  background:#1a2d4d !important;
}

@media (max-width: 900px){
  #screen-stories .lesson-layout,
  #screen-stories .story-layout,
  #screen-stories .story-layout-v2{
    grid-template-columns:1fr !important;
  }
  #screen-stories .lesson-nav,
  #screen-stories #storySidebar,
  #screen-stories .story-sidebar,
  #screen-stories .story-menu,
  #screen-stories .story-list{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  #screen-stories .story-control-bar,
  #screen-stories .story-control-bar-upgraded{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px !important;
  }
}
@media (max-width: 560px){
  #screen-stories .panel,
  #screen-stories .panel-soft,
  #screen-stories .story-stage,
  #screen-stories .story-segment{
    border-radius:22px !important;
    padding:14px !important;
  }
  #screen-stories .lesson-nav,
  #screen-stories #storySidebar,
  #screen-stories .story-sidebar,
  #screen-stories .story-menu,
  #screen-stories .story-list{
    grid-template-columns:1fr !important;
  }
  #screen-stories .story-line-row{
    padding:14px !important;
    border-radius:18px !important;
  }
  #screen-stories .story-line-it{
    font-size:15px !important;
    line-height:1.65 !important;
  }
  #screen-stories .story-line-en{
    font-size:13px !important;
    line-height:1.55 !important;
  }
  #screen-stories .story-control-bar,
  #screen-stories .story-control-bar-upgraded{
    grid-template-columns:1fr 1fr !important;
    padding:10px !important;
    border-radius:18px !important;
  }
  #screen-stories .story-control,
  #screen-stories .story-mini-btn{
    min-height:48px !important;
    padding:10px 12px !important;
    font-size:13px !important;
  }
}

/* v53 home mobile cards + light mobile menu visibility */
@media (max-width: 760px){
  #screen-home .stats{
    gap:12px !important;
  }
  #screen-home .stats .stat{
    min-height:154px !important;
    padding:16px 14px !important;
    border-radius:26px !important;
    border:1px solid rgba(31,55,100,.10) !important;
    box-shadow:0 16px 30px rgba(31,55,100,.10), inset 0 1px 0 rgba(255,255,255,.55) !important;
    align-content:space-between !important;
    overflow:hidden;
    position:relative;
  }
  #screen-home .stats .stat::before{
    content:"";
    position:absolute;
    inset:-20% -10% auto auto;
    width:130px;
    height:130px;
    border-radius:999px;
    background:rgba(255,255,255,.55);
    filter:blur(2px);
    pointer-events:none;
  }
  #screen-home .stats .stat > *{position:relative;z-index:1;}
  #screen-home .stats .stat strong{
    font-size:clamp(24px,7vw,34px) !important;
    line-height:1.05 !important;
    color:#10233b !important;
    letter-spacing:-.04em !important;
  }
  #screen-home .stats .stat > span:not(.stat-emoji):not(.stat-chip){
    color:#42566f !important;
    font-weight:900 !important;
    line-height:1.25 !important;
  }
  #screen-home .stat-emoji{
    width:56px !important;
    height:56px !important;
    border-radius:18px !important;
    display:grid !important;
    place-items:center !important;
    font-size:26px !important;
    box-shadow:0 10px 20px rgba(31,55,100,.10) !important;
  }
  #screen-home .stat-chip{
    padding:8px 14px !important;
    border-radius:999px !important;
    background:rgba(255,255,255,.66) !important;
    border:1px solid rgba(255,255,255,.72) !important;
    font-weight:900 !important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.7) !important;
  }
  #screen-home .stat-videos{
    background:linear-gradient(135deg,#ff9ec1 0%,#ffd1dc 45%,#ffe8a8 100%) !important;
    border-color:#ff8bb4 !important;
  }
  #screen-home .stat-lessons{
    background:linear-gradient(135deg,#93c5fd 0%,#d9ecff 45%,#dcd7ff 100%) !important;
    border-color:#86b9ff !important;
  }
  #screen-home .stat-community{
    background:linear-gradient(135deg,#c4b5fd 0%,#eadcff 45%,#ffd5ea 100%) !important;
    border-color:#b7a0ff !important;
  }
  #screen-home .stat-translator{
    background:linear-gradient(135deg,#ffd08a 0%,#ffe4b5 45%,#d9f7ee 100%) !important;
    border-color:#ffc268 !important;
  }
  #screen-home .stat-videos .stat-chip{color:#8d174d !important;}
  #screen-home .stat-lessons .stat-chip{color:#184c9a !important;}
  #screen-home .stat-community .stat-chip{color:#5b2f9c !important;}
  #screen-home .stat-translator .stat-chip{color:#8a560f !important;}

  /* Light mode bottom menu/dock visibility */
  .mobile-dock{
    background:rgba(255,255,255,.96) !important;
    border:1px solid rgba(207,220,240,.98) !important;
    box-shadow:0 18px 36px rgba(31,55,100,.18), inset 0 1px 0 rgba(255,255,255,.85) !important;
  }
  .mobile-dock-item{
    color:#1f3764 !important;
    background:transparent !important;
    opacity:1 !important;
    text-shadow:none !important;
    font-weight:900 !important;
  }
  .mobile-dock-item span{
    filter:none !important;
    text-shadow:none !important;
  }
  .mobile-dock-item small{
    color:#1f3764 !important;
    opacity:1 !important;
    text-shadow:none !important;
    font-weight:900 !important;
  }
  .mobile-dock-item.active,
  .mobile-dock-item:active,
  .mobile-dock-menu{
    background:linear-gradient(135deg,#eaf3ff,#dbeafe) !important;
    color:#102f5f !important;
    box-shadow:0 10px 18px rgba(37,99,235,.12) !important;
  }
  .mobile-dock-menu small,
  .mobile-dock-menu span{color:#102f5f !important;}

  .sidebar{
    background:rgba(255,255,255,.98) !important;
    border:1px solid #d9e5f4 !important;
    box-shadow:0 24px 50px rgba(31,55,100,.22) !important;
  }
  .menu-item{
    background:linear-gradient(135deg,#ffffff,#f7fbff) !important;
    border:1px solid #dce7f6 !important;
    color:#1f3764 !important;
    text-shadow:none !important;
  }
  .menu-item strong,.menu-item small,.menu-arrow{
    color:#1f3764 !important;
    opacity:1 !important;
    text-shadow:none !important;
  }
}

body[data-theme="dark"] #screen-home .stat-videos{
  background:linear-gradient(135deg,#5b1836 0%,#8d2859 45%,#5f420e 100%) !important;
  border-color:#ff79ad !important;
}
body[data-theme="dark"] #screen-home .stat-lessons{
  background:linear-gradient(135deg,#15345f 0%,#1e4f8f 45%,#28205d 100%) !important;
  border-color:#79b4ff !important;
}
body[data-theme="dark"] #screen-home .stat-community{
  background:linear-gradient(135deg,#35205e 0%,#5b35a4 45%,#5a1d3d 100%) !important;
  border-color:#b792ff !important;
}
body[data-theme="dark"] #screen-home .stat-translator{
  background:linear-gradient(135deg,#5f3b0d 0%,#986118 45%,#18483e 100%) !important;
  border-color:#ffc46e !important;
}
body[data-theme="dark"] #screen-home .stats .stat strong,
body[data-theme="dark"] #screen-home .stats .stat > span:not(.stat-emoji):not(.stat-chip){
  color:#f8fbff !important;
  opacity:1 !important;
}
body[data-theme="dark"] #screen-home .stat-chip{
  background:rgba(255,255,255,.12) !important;
  border-color:rgba(255,255,255,.16) !important;
  color:#f8fbff !important;
}
body[data-theme="dark"] #screen-home .stat-emoji{
  background:rgba(255,255,255,.12) !important;
  box-shadow:0 10px 20px rgba(0,0,0,.18) !important;
}


/* v54 compact slider indicator/menu polish */
.hero-slider-nav,
.hero-slider-nav-dots-only{
  top:12px !important;
  right:12px !important;
  left:auto !important;
  bottom:auto !important;
  width:auto !important;
  max-width:max-content !important;
  padding:0 !important;
  margin:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  border:0 !important;
}
.hero-dots,
#heroDots{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:6px !important;
  width:auto !important;
  min-width:0 !important;
  padding:6px 8px !important;
  border-radius:999px !important;
  background:rgba(255,255,255,.76) !important;
  border:1px solid rgba(219,229,242,.9) !important;
  box-shadow:0 8px 16px rgba(31,55,100,.08), inset 0 1px 0 rgba(255,255,255,.78) !important;
  backdrop-filter:blur(10px) !important;
}
.hero-dot,
#heroDots .hero-dot{
  width:8px !important;
  height:8px !important;
  min-width:8px !important;
  min-height:8px !important;
  padding:0 !important;
  border:0 !important;
  border-radius:999px !important;
  background:#cbd8ea !important;
  box-shadow:none !important;
  opacity:1 !important;
  transition:width .18s ease, background .18s ease, transform .18s ease !important;
}
.hero-dot.active,
#heroDots .hero-dot.active{
  width:26px !important;
  min-width:26px !important;
  height:8px !important;
  background:linear-gradient(135deg,#3468d8,#1f55bd) !important;
}
.hero-dot:hover,
#heroDots .hero-dot:hover{transform:scale(1.08) !important;}
body[data-theme="dark"] .hero-dots,
body[data-theme="dark"] #heroDots{
  background:rgba(15,28,51,.82) !important;
  border-color:rgba(64,90,130,.8) !important;
  box-shadow:0 8px 18px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.04) !important;
}
body[data-theme="dark"] .hero-dot,
body[data-theme="dark"] #heroDots .hero-dot{
  background:#425672 !important;
}
body[data-theme="dark"] .hero-dot.active,
body[data-theme="dark"] #heroDots .hero-dot.active{
  background:linear-gradient(135deg,#6ea2ff,#3568e2) !important;
}
@media (max-width:760px){
  .hero-slider-nav,
  .hero-slider-nav-dots-only{
    top:10px !important;
    right:10px !important;
    position:absolute !important;
    margin:0 !important;
  }
  .hero-dots,
  #heroDots{
    gap:5px !important;
    padding:5px 7px !important;
  }
  .hero-dot,
  #heroDots .hero-dot{
    width:7px !important;
    height:7px !important;
    min-width:7px !important;
    min-height:7px !important;
  }
  .hero-dot.active,
  #heroDots .hero-dot.active{
    width:22px !important;
    min-width:22px !important;
    height:7px !important;
  }
  .hero-panel,.hero-slider{
    padding-top:42px !important;
  }
}

/* v54 compact monster/game page dots too */
#diMonsterGameRoot .page-dots{
  height:16px !important;
  gap:5px !important;
  margin:4px auto !important;
}
#diMonsterGameRoot .page-dots .dot{
  width:7px !important;
  height:7px !important;
  border-radius:999px !important;
}
#diMonsterGameRoot .page-dots .dot.active{
  width:22px !important;
  height:7px !important;
}

/* v55 word preview cards + mobile menu button dark-mode polish */
.hero-slide-wordbank .wordbank-preview-cards .hero-mini-card.hero-mini-word{
  position:relative;
  overflow:hidden;
  border-radius:28px !important;
  padding:20px !important;
  min-height:190px !important;
  border-width:1.5px !important;
  box-shadow:0 18px 34px rgba(31,55,100,.14), inset 0 1px 0 rgba(255,255,255,.88) !important;
  transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.hero-slide-wordbank .wordbank-preview-cards .hero-mini-card.hero-mini-word::before{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(circle at 86% 18%, rgba(255,255,255,.75), transparent 34%),
             radial-gradient(circle at 8% 88%, rgba(255,255,255,.45), transparent 30%);
  pointer-events:none;
}
.hero-slide-wordbank .wordbank-preview-cards .hero-mini-card.hero-mini-word > *{position:relative;z-index:1;}
.hero-slide-wordbank .wordbank-preview-cards .hero-mini-card.hero-mini-word.green{
  background:linear-gradient(135deg,#ecfdf3 0%,#d7f7e3 50%,#f7fffb 100%) !important;
  border-color:#7bdd9d !important;
}
.hero-slide-wordbank .wordbank-preview-cards .hero-mini-card.hero-mini-word.blue{
  background:linear-gradient(135deg,#eff6ff 0%,#dbeafe 50%,#f8fbff 100%) !important;
  border-color:#93c5fd !important;
}
.hero-slide-wordbank .wordbank-preview-cards .hero-mini-card.hero-mini-word.purple{
  background:linear-gradient(135deg,#f5f0ff 0%,#e9ddff 50%,#fcfbff 100%) !important;
  border-color:#c4b5fd !important;
}
.hero-slide-wordbank .hero-mini-word-top strong{
  font-size:clamp(22px,2vw,28px) !important;
  letter-spacing:-.04em !important;
  line-height:1.05 !important;
  color:#102544 !important;
}
.hero-slide-wordbank .hero-mini-card.green .hero-mini-word-top strong{color:#14532d !important;}
.hero-slide-wordbank .hero-mini-card.blue .hero-mini-word-top strong{color:#1d4ed8 !important;}
.hero-slide-wordbank .hero-mini-card.purple .hero-mini-word-top strong{color:#5b21b6 !important;}
.hero-slide-wordbank .hero-mini-flags{
  display:flex !important;
  align-items:center;
  gap:10px !important;
  margin-top:4px;
}
.hero-slide-wordbank .mini-flag-pill{
  width:38px;
  height:28px;
  border-radius:9px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.68);
  border:1px solid rgba(255,255,255,.8);
  box-shadow:0 8px 16px rgba(31,55,100,.08);
}
.hero-slide-wordbank .mini-flag-pill .flag-badge{
  width:30px !important;
  height:20px !important;
  border-radius:5px !important;
}
.hero-slide-wordbank .hero-mini-play{
  width:48px !important;
  height:48px !important;
  border-radius:17px !important;
  font-size:17px !important;
  background:linear-gradient(135deg,#5c8cff,#3468f0) !important;
  border:1px solid rgba(255,255,255,.45) !important;
  box-shadow:0 14px 28px rgba(52,104,240,.26) !important;
}
.hero-slide-wordbank .hero-mini-card.green .hero-mini-play{background:linear-gradient(135deg,#22c55e,#16a34a) !important;box-shadow:0 14px 28px rgba(22,163,74,.24) !important;}
.hero-slide-wordbank .hero-mini-card.blue .hero-mini-play{background:linear-gradient(135deg,#60a5fa,#2563eb) !important;box-shadow:0 14px 28px rgba(37,99,235,.25) !important;}
.hero-slide-wordbank .hero-mini-card.purple .hero-mini-play{background:linear-gradient(135deg,#a78bfa,#7c3aed) !important;box-shadow:0 14px 28px rgba(124,58,237,.25) !important;}
.hero-slide-wordbank .hero-mini-card span:last-child{
  color:#475569 !important;
  font-size:17px !important;
  font-weight:900 !important;
  line-height:1.3 !important;
}

/* bottom mobile menu button visibility + dark mode */
.mobile-dock-menu,
.mobile-dock .mobile-dock-menu{
  background:linear-gradient(135deg,#eaf3ff,#dbeafe) !important;
  border:1px solid #b7cdf5 !important;
  color:#173b68 !important;
  box-shadow:0 10px 22px rgba(31,55,100,.12) !important;
}
.mobile-dock-menu span,
.mobile-dock-menu small{color:#173b68 !important;opacity:1 !important;text-shadow:none !important;}
body[data-theme="dark"] .mobile-dock-menu,
body[data-theme="dark"] .mobile-dock .mobile-dock-menu{
  background:linear-gradient(135deg,#24457f,#162b52) !important;
  border-color:#6ea8ff !important;
  box-shadow:0 14px 26px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.08) !important;
}
body[data-theme="dark"] .mobile-dock-menu span,
body[data-theme="dark"] .mobile-dock-menu small{
  color:#f8fbff !important;
  opacity:1 !important;
}
body[data-theme="dark"] .mobile-dock-menu span{
  background:rgba(255,255,255,.10);
  border-radius:12px;
}

body[data-theme="dark"] .hero-slide-wordbank .wordbank-preview-cards .hero-mini-card.hero-mini-word{
  box-shadow:0 18px 34px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.06) !important;
}
body[data-theme="dark"] .hero-slide-wordbank .wordbank-preview-cards .hero-mini-card.hero-mini-word::before{
  background:radial-gradient(circle at 86% 18%, rgba(255,255,255,.12), transparent 34%),
             radial-gradient(circle at 8% 88%, rgba(255,255,255,.07), transparent 30%);
}
body[data-theme="dark"] .hero-slide-wordbank .wordbank-preview-cards .hero-mini-card.hero-mini-word.green{
  background:linear-gradient(135deg,#0f3823 0%,#155532 52%,#0f2d1d 100%) !important;
  border-color:#45d17d !important;
}
body[data-theme="dark"] .hero-slide-wordbank .wordbank-preview-cards .hero-mini-card.hero-mini-word.blue{
  background:linear-gradient(135deg,#122a52 0%,#1d4f91 52%,#102747 100%) !important;
  border-color:#75aefe !important;
}
body[data-theme="dark"] .hero-slide-wordbank .wordbank-preview-cards .hero-mini-card.hero-mini-word.purple{
  background:linear-gradient(135deg,#2b1f55 0%,#4b2e88 52%,#271d4b 100%) !important;
  border-color:#b79aff !important;
}
body[data-theme="dark"] .hero-slide-wordbank .hero-mini-card.green .hero-mini-word-top strong,
body[data-theme="dark"] .hero-slide-wordbank .hero-mini-card.blue .hero-mini-word-top strong,
body[data-theme="dark"] .hero-slide-wordbank .hero-mini-card.purple .hero-mini-word-top strong,
body[data-theme="dark"] .hero-slide-wordbank .hero-mini-word-top strong{
  color:#f8fbff !important;
}
body[data-theme="dark"] .hero-slide-wordbank .hero-mini-card span:last-child{
  color:#e6eefc !important;
}
body[data-theme="dark"] .hero-slide-wordbank .mini-flag-pill{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.14);
  box-shadow:0 8px 16px rgba(0,0,0,.18);
}

@media (max-width: 760px){
  .hero-slide-wordbank .wordbank-preview-cards{
    grid-template-columns:1fr !important;
    gap:12px !important;
  }
  .hero-slide-wordbank .wordbank-preview-cards .hero-mini-card.hero-mini-word{
    min-height:148px !important;
    padding:16px !important;
    border-radius:24px !important;
  }
  .hero-slide-wordbank .hero-mini-word-top strong{
    font-size:24px !important;
  }
  .hero-slide-wordbank .hero-mini-play{
    width:44px !important;
    height:44px !important;
    border-radius:15px !important;
  }
  .hero-slide-wordbank .hero-mini-card span:last-child{
    font-size:16px !important;
  }
}

/* Fix: keep the play button visible on the 3rd home preview card on desktop/PC */
.hero-slide-wordbank .hero-mini-word-top{
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:10px !important;
  width:100% !important;
}
.hero-slide-wordbank .hero-mini-word-top strong{
  min-width:0 !important;
  max-width:calc(100% - 58px) !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
}
.hero-slide-wordbank .hero-mini-play{
  flex:0 0 48px !important;
  display:grid !important;
  place-items:center !important;
  margin-left:auto !important;
  padding:0 !important;
  line-height:1 !important;
  position:relative !important;
  z-index:5 !important;
}
@media (max-width:760px){
  .hero-slide-wordbank .hero-mini-play{flex-basis:44px !important;}
  .hero-slide-wordbank .hero-mini-word-top strong{max-width:calc(100% - 54px) !important;}
}

/* v56: Premium lesson submenu + fixed mobile dark-mode icon */
#screen-lessons #lessonSidebar.lesson-menu-premium{
  --lesson-accent:#4f82ff;
  position:sticky;
  top:126px;
  align-self:start;
  display:grid !important;
  gap:14px !important;
  padding:18px !important;
  border-radius:30px !important;
  overflow:hidden !important;
  background:
    radial-gradient(circle at 14% 0%, rgba(79,130,255,.18), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(34,197,94,.14), transparent 32%),
    linear-gradient(180deg,#ffffff 0%,#f6f9ff 100%) !important;
  border:1px solid rgba(196,211,235,.95) !important;
  box-shadow:0 22px 48px rgba(31,55,100,.12), inset 0 1px 0 rgba(255,255,255,.88) !important;
}
#screen-lessons #lessonSidebar.lesson-menu-premium::after{
  content:"";
  position:absolute;
  inset:auto -40px -54px auto;
  width:150px;
  height:150px;
  border-radius:999px;
  background:linear-gradient(135deg,rgba(139,61,255,.13),rgba(79,130,255,.05));
  pointer-events:none;
}
#screen-lessons .lesson-menu-head{
  position:relative;
  z-index:1;
  display:grid;
  gap:8px;
  padding:16px 16px 14px;
  border-radius:24px;
  background:linear-gradient(135deg,#1f3764 0%,#315fc2 58%,#20b96d 100%);
  color:#fff;
  box-shadow:0 18px 34px rgba(49,95,194,.24), inset 0 1px 0 rgba(255,255,255,.15);
}
#screen-lessons .lesson-menu-kicker{
  display:inline-flex;
  align-items:center;
  width:max-content;
  max-width:100%;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.16);
  color:#eef6ff !important;
  font-size:12px;
  font-weight:1000;
  letter-spacing:.03em;
  text-transform:uppercase;
}
#screen-lessons .lesson-menu-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
#screen-lessons .lesson-menu-title-row strong{
  color:#fff !important;
  font-size:24px;
  line-height:1.05;
  letter-spacing:-.04em;
}
#screen-lessons .lesson-menu-title-row span{
  flex:0 0 auto;
  color:#1f3764 !important;
  background:#fff;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:1000;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.45);
}
#screen-lessons .lesson-menu-head small{
  color:#dcecff !important;
  font-weight:800;
  line-height:1.35;
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
#screen-lessons .lesson-menu-list{
  position:relative;
  z-index:1;
  display:grid;
  gap:10px;
  max-height:calc(100dvh - 260px);
  overflow:auto;
  padding:2px 2px 4px;
  scrollbar-width:thin;
  scrollbar-color:rgba(79,130,255,.45) transparent;
}
#screen-lessons .lesson-menu-list::-webkit-scrollbar{width:7px;height:7px;}
#screen-lessons .lesson-menu-list::-webkit-scrollbar-thumb{background:rgba(79,130,255,.35);border-radius:999px;}
#screen-lessons .lesson-nav-pro{
  --lesson-accent:#4f82ff;
  --lesson-soft:#eef5ff;
  --lesson-text:#1f3764;
  position:relative;
  width:100%;
  min-height:86px;
  display:grid !important;
  grid-template-columns:30px 48px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:14px 14px 14px 12px !important;
  border-radius:24px !important;
  border:1px solid #dce7f7 !important;
  background:linear-gradient(135deg,rgba(255,255,255,.96) 0%,rgba(247,251,255,.98) 100%) !important;
  box-shadow:0 12px 24px rgba(31,55,100,.07) !important;
  color:var(--lesson-text) !important;
  text-align:left;
  overflow:hidden;
  isolation:isolate;
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
#screen-lessons .lesson-nav-pro::before{
  content:"";
  position:absolute;
  left:0;
  top:14px;
  bottom:14px;
  width:5px;
  border-radius:0 999px 999px 0;
  background:var(--lesson-accent);
  opacity:.78;
}
#screen-lessons .lesson-nav-pro::after{
  content:"";
  position:absolute;
  inset:-45% -24% auto auto;
  width:120px;
  height:120px;
  border-radius:999px;
  background:radial-gradient(circle, color-mix(in srgb, var(--lesson-accent) 24%, transparent), transparent 68%);
  opacity:.65;
  z-index:-1;
}
#screen-lessons .lesson-nav-pro:hover{
  transform:translateY(-2px);
  border-color:color-mix(in srgb, var(--lesson-accent) 48%, #dce7f7) !important;
  box-shadow:0 18px 34px rgba(31,55,100,.12) !important;
}
#screen-lessons .lesson-nav-pro.active{
  background:linear-gradient(135deg,var(--lesson-soft) 0%,#ffffff 100%) !important;
  border-color:color-mix(in srgb, var(--lesson-accent) 68%, #dce7f7) !important;
  box-shadow:0 20px 38px color-mix(in srgb, var(--lesson-accent) 24%, transparent) !important;
}
#screen-lessons .lesson-nav-index{
  color:#8aa1bd !important;
  font-size:12px;
  font-weight:1000;
  letter-spacing:-.03em;
  writing-mode:vertical-rl;
  transform:rotate(180deg);
}
#screen-lessons .lesson-nav-icon{
  width:48px;
  height:48px;
  border-radius:17px;
  display:grid;
  place-items:center;
  font-size:24px;
  background:linear-gradient(135deg,#ffffff,#f2f7ff);
  border:1px solid rgba(255,255,255,.75);
  box-shadow:0 10px 20px rgba(31,55,100,.08);
}
#screen-lessons .lesson-nav-copy{
  min-width:0;
  display:grid;
  gap:5px;
}
#screen-lessons .lesson-nav-copy strong{
  color:var(--lesson-text) !important;
  font-size:17px !important;
  line-height:1.1 !important;
  letter-spacing:-.02em;
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
#screen-lessons .lesson-nav-copy .mini{
  color:#637793 !important;
  font-size:12px !important;
  font-weight:800;
  line-height:1.35;
  display:-webkit-box !important;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
#screen-lessons .lesson-nav-side{
  display:grid;
  justify-items:end;
  gap:8px;
  align-items:center;
}
#screen-lessons .lesson-count{
  padding:6px 9px;
  border-radius:999px;
  background:rgba(255,255,255,.78);
  border:1px solid rgba(214,226,244,.9);
  color:#31516e !important;
  font-size:11px;
  font-weight:1000;
  white-space:nowrap;
}
#screen-lessons .lesson-arrow{
  width:28px;
  height:28px;
  border-radius:999px;
  display:grid;
  place-items:center;
  color:#fff !important;
  background:var(--lesson-accent);
  font-size:22px;
  font-weight:900;
  line-height:1;
  box-shadow:0 10px 18px color-mix(in srgb, var(--lesson-accent) 32%, transparent);
}
#screen-lessons .lesson-color-green{--lesson-accent:#22c55e;--lesson-soft:#e9fff2;--lesson-text:#14532d;}
#screen-lessons .lesson-color-blue{--lesson-accent:#3b82f6;--lesson-soft:#edf6ff;--lesson-text:#1d4ed8;}
#screen-lessons .lesson-color-purple{--lesson-accent:#8b5cf6;--lesson-soft:#f4efff;--lesson-text:#5b21b6;}
#screen-lessons .lesson-color-orange{--lesson-accent:#f97316;--lesson-soft:#fff5eb;--lesson-text:#9a3412;}
#screen-lessons .lesson-color-red{--lesson-accent:#ef4444;--lesson-soft:#fff0f1;--lesson-text:#991b1b;}
#screen-lessons .lesson-nav-pro.active .lesson-nav-index,
#screen-lessons .lesson-nav-pro.active .lesson-nav-copy .mini{color:color-mix(in srgb, var(--lesson-text) 82%, #64748b) !important;}

body[data-theme="dark"] #screen-lessons #lessonSidebar.lesson-menu-premium{
  background:
    radial-gradient(circle at 14% 0%, rgba(110,162,255,.16), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(34,197,94,.11), transparent 32%),
    linear-gradient(180deg,#0d1b31 0%,#101f36 100%) !important;
  border-color:#29496f !important;
  box-shadow:0 22px 48px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.04) !important;
}
body[data-theme="dark"] #screen-lessons .lesson-menu-head{
  background:linear-gradient(135deg,#102442 0%,#1e4288 58%,#147743 100%);
  box-shadow:0 18px 34px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08);
}
body[data-theme="dark"] #screen-lessons .lesson-nav-pro{
  background:linear-gradient(135deg,#122540 0%,#10203a 100%) !important;
  border-color:#2f4b73 !important;
  box-shadow:0 12px 24px rgba(0,0,0,.22) !important;
}
body[data-theme="dark"] #screen-lessons .lesson-nav-pro.active{
  background:linear-gradient(135deg,color-mix(in srgb, var(--lesson-accent) 18%, #122540) 0%,#10203a 100%) !important;
  border-color:color-mix(in srgb, var(--lesson-accent) 62%, #2f4b73) !important;
  box-shadow:0 20px 38px color-mix(in srgb, var(--lesson-accent) 22%, transparent) !important;
}
body[data-theme="dark"] #screen-lessons .lesson-nav-copy strong{color:#f4f8ff !important;}
body[data-theme="dark"] #screen-lessons .lesson-nav-copy .mini{color:#c9d8ef !important;}
body[data-theme="dark"] #screen-lessons .lesson-nav-index{color:#9db5d6 !important;}
body[data-theme="dark"] #screen-lessons .lesson-nav-icon{
  background:linear-gradient(135deg,#1a2f51,#10233f);
  border-color:#35537c;
  box-shadow:0 10px 20px rgba(0,0,0,.22);
}
body[data-theme="dark"] #screen-lessons .lesson-count{
  background:rgba(255,255,255,.08);
  border-color:rgba(255,255,255,.14);
  color:#edf5ff !important;
}

@media (max-width: 1100px){
  #screen-lessons #lessonSidebar.lesson-menu-premium{
    position:relative;
    top:auto;
  }
}
@media (max-width: 900px){
  #screen-lessons #lessonSidebar.lesson-menu-premium{
    position:sticky;
    top:8px;
    z-index:12;
    padding:12px !important;
    border-radius:24px !important;
    margin-bottom:14px;
  }
  #screen-lessons .lesson-menu-head{
    padding:12px 13px;
    border-radius:20px;
    gap:5px;
  }
  #screen-lessons .lesson-menu-title-row strong{font-size:20px;}
  #screen-lessons .lesson-menu-head small{font-size:12px;}
  #screen-lessons .lesson-menu-list{
    display:flex;
    gap:10px;
    max-height:none;
    overflow-x:auto;
    overflow-y:hidden;
    padding:2px 2px 6px;
    scroll-snap-type:x proximity;
  }
  #screen-lessons .lesson-nav-pro{
    flex:0 0 min(82vw, 310px);
    min-height:78px;
    grid-template-columns:42px minmax(0,1fr) auto;
    gap:10px;
    padding:12px !important;
    scroll-snap-align:start;
  }
  #screen-lessons .lesson-nav-pro::before{top:12px;bottom:12px;width:4px;}
  #screen-lessons .lesson-nav-index{display:none !important;}
  #screen-lessons .lesson-nav-icon{width:42px;height:42px;border-radius:15px;font-size:21px;}
  #screen-lessons .lesson-nav-copy strong{font-size:16px !important;}
  #screen-lessons .lesson-nav-copy .mini{-webkit-line-clamp:1;}
  #screen-lessons .lesson-count{font-size:10px;padding:5px 7px;}
  #screen-lessons .lesson-arrow{width:26px;height:26px;font-size:20px;}
}
@media (max-width: 420px){
  #screen-lessons #lessonSidebar.lesson-menu-premium{padding:10px !important;border-radius:21px !important;}
  #screen-lessons .lesson-menu-kicker{font-size:10px;padding:5px 8px;}
  #screen-lessons .lesson-menu-title-row strong{font-size:18px;}
  #screen-lessons .lesson-nav-pro{flex-basis:min(84vw, 286px);}
  #screen-lessons .lesson-nav-side{gap:5px;}
}

@media (max-width: 820px){
  .topbar-premium > .auth-dock,
  .topbar > .auth-dock{
    width:100% !important;
    margin-left:0 !important;
    display:grid !important;
    grid-template-columns:minmax(72px,1fr) 46px 46px !important;
    align-items:center !important;
    gap:7px !important;
    flex-wrap:nowrap !important;
  }
  .topbar-premium > .auth-dock .auth-pill,
  .topbar > .auth-dock .auth-pill{
    width:100% !important;
    min-width:0 !important;
    height:42px !important;
    min-height:42px !important;
    padding:0 10px !important;
    border-radius:15px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
    font-size:13px !important;
  }
  .topbar-premium > .auth-dock .theme-toggle,
  .topbar > .auth-dock .theme-toggle,
  .topbar-premium > .auth-dock #themeToggle,
  .topbar > .auth-dock #themeToggle{
    width:46px !important;
    min-width:46px !important;
    max-width:46px !important;
    height:42px !important;
    min-height:42px !important;
    border-radius:15px !important;
    padding:0 !important;
    position:relative !important;
    overflow:hidden !important;
    background:linear-gradient(135deg,#f8fbff 0%,#e7f0ff 100%) !important;
    border:1px solid #b9cff3 !important;
    box-shadow:0 10px 20px rgba(31,55,100,.14), inset 0 1px 0 rgba(255,255,255,.92) !important;
  }
  .topbar-premium > .auth-dock .theme-toggle-track,
  .topbar > .auth-dock .theme-toggle-track{
    width:100% !important;
    height:100% !important;
    padding:0 !important;
    display:grid !important;
    place-items:center !important;
  }
  .topbar-premium > .auth-dock .theme-toggle-thumb,
  .topbar > .auth-dock .theme-toggle-thumb{
    display:none !important;
  }
  .topbar-premium > .auth-dock .theme-icon,
  .topbar > .auth-dock .theme-icon{
    position:absolute !important;
    inset:0 !important;
    display:grid !important;
    place-items:center !important;
    width:100% !important;
    height:100% !important;
    opacity:0 !important;
    transform:scale(.72) rotate(-8deg) !important;
    transition:opacity .18s ease, transform .18s ease !important;
    font-size:18px !important;
    line-height:1 !important;
    filter:drop-shadow(0 2px 4px rgba(15,23,42,.18));
  }
  body:not([data-theme="dark"]) .topbar-premium > .auth-dock .theme-icon.moon,
  body:not([data-theme="dark"]) .topbar > .auth-dock .theme-icon.moon,
  body[data-theme="dark"] .topbar-premium > .auth-dock .theme-icon.sun,
  body[data-theme="dark"] .topbar > .auth-dock .theme-icon.sun{
    opacity:1 !important;
    transform:scale(1) rotate(0deg) !important;
  }
  body[data-theme="dark"] .topbar-premium > .auth-dock .theme-toggle,
  body[data-theme="dark"] .topbar > .auth-dock .theme-toggle,
  body[data-theme="dark"] .topbar-premium > .auth-dock #themeToggle,
  body[data-theme="dark"] .topbar > .auth-dock #themeToggle{
    background:linear-gradient(135deg,#0f1c32 0%,#18345f 100%) !important;
    border-color:#4772ad !important;
    box-shadow:0 10px 20px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.07) !important;
  }
  .topbar-premium > .auth-dock .auth-open-icon-btn,
  .topbar > .auth-dock .auth-open-icon-btn{
    width:46px !important;
    min-width:46px !important;
    max-width:46px !important;
    height:42px !important;
    min-height:42px !important;
    border-radius:15px !important;
  }
}

/* v57: lessons tab polish - full submenu text, stable scroll, dark-mode lesson note, mobile icon spacing */
#screen-lessons #lessonTip.help-note{
  display:block !important;
  min-height:0 !important;
  grid-template-columns:none !important;
  padding:14px 16px !important;
  border-radius:20px !important;
  font-size:15px !important;
  line-height:1.55 !important;
  font-weight:900 !important;
  color:#213a5b !important;
  background:linear-gradient(135deg,#f8fbff 0%,#eef6ff 100%) !important;
  border:1px solid #d7e5fb !important;
  box-shadow:0 12px 24px rgba(31,55,100,.07) !important;
  overflow:visible !important;
}
#screen-lessons #lessonTip.help-note::before,
#screen-lessons #lessonTip.help-note::after{
  display:none !important;
  content:none !important;
}
#screen-lessons #lessonTip.help-note.green{background:linear-gradient(135deg,#ecfff4,#f7fffb) !important;border-color:#b7efcc !important;color:#14532d !important;}
#screen-lessons #lessonTip.help-note.blue{background:linear-gradient(135deg,#eef6ff,#f8fbff) !important;border-color:#bfdbfe !important;color:#1d4ed8 !important;}
#screen-lessons #lessonTip.help-note.purple{background:linear-gradient(135deg,#f5f0ff,#fbf8ff) !important;border-color:#ddd0ff !important;color:#5b21b6 !important;}
#screen-lessons #lessonTip.help-note.orange{background:linear-gradient(135deg,#fff4e8,#fffaf4) !important;border-color:#fed7aa !important;color:#9a3412 !important;}
#screen-lessons #lessonTip.help-note.red{background:linear-gradient(135deg,#fff1f2,#fff8f8) !important;border-color:#fecdd3 !important;color:#991b1b !important;}

#screen-lessons .lesson-menu-head small{
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
}
#screen-lessons .lesson-nav-copy strong,
#screen-lessons .lesson-nav-copy .mini{
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:clip !important;
  display:block !important;
  -webkit-line-clamp:unset !important;
  -webkit-box-orient:initial !important;
  overflow-wrap:anywhere !important;
}
#screen-lessons .lesson-nav-pro{
  min-height:96px !important;
  align-items:center !important;
}
#screen-lessons .lesson-nav-copy strong{
  line-height:1.18 !important;
}
#screen-lessons .lesson-nav-copy .mini{
  line-height:1.34 !important;
}

body[data-theme="dark"] #screen-lessons #lessonTip.help-note,
body[data-theme="dark"] #screen-lessons #lessonTip.help-note.green,
body[data-theme="dark"] #screen-lessons #lessonTip.help-note.blue,
body[data-theme="dark"] #screen-lessons #lessonTip.help-note.purple,
body[data-theme="dark"] #screen-lessons #lessonTip.help-note.orange,
body[data-theme="dark"] #screen-lessons #lessonTip.help-note.red{
  color:#eef6ff !important;
  background:linear-gradient(135deg,#10213a 0%,#142846 100%) !important;
  border-color:#35577f !important;
  box-shadow:0 16px 30px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.04) !important;
}
body[data-theme="dark"] #screen-lessons .lesson-main{
  background:linear-gradient(180deg,#0d1b31 0%,#101f36 100%) !important;
  border-color:#29496f !important;
}
body[data-theme="dark"] #screen-lessons .lesson-banner{
  background:linear-gradient(135deg,#102442 0%,#152b4d 100%) !important;
  border:1px solid #2b4b72 !important;
  border-radius:24px !important;
  padding:16px !important;
}
body[data-theme="dark"] #screen-lessons .lesson-banner p,
body[data-theme="dark"] #screen-lessons .lesson-intro{
  color:#c9d8ef !important;
}
body[data-theme="dark"] #screen-lessons .lesson-badge{
  background:linear-gradient(135deg,#1a2f51,#10233f) !important;
  border:1px solid #35537c !important;
}

@media (max-width:900px){
  #screen-lessons #lessonSidebar.lesson-menu-premium{
    position:relative !important;
    top:auto !important;
    overflow:hidden !important;
  }
  #screen-lessons .lesson-menu-list{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
    max-height:min(58vh,520px) !important;
    overflow-y:auto !important;
    overflow-x:hidden !important;
    scroll-snap-type:none !important;
    padding:3px 4px 8px !important;
  }
  #screen-lessons .lesson-nav-pro{
    width:100% !important;
    flex:initial !important;
    min-height:104px !important;
    grid-template-columns:30px 44px minmax(0,1fr) !important;
    gap:10px !important;
    padding:13px 13px 13px 12px !important;
    scroll-snap-align:none !important;
  }
  #screen-lessons .lesson-nav-index{
    display:block !important;
  }
  #screen-lessons .lesson-nav-icon{
    width:44px !important;
    height:44px !important;
    border-radius:16px !important;
  }
  #screen-lessons .lesson-nav-side{
    grid-column:2 / -1 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:10px !important;
    width:100% !important;
    margin-top:2px !important;
  }
  #screen-lessons .lesson-count{
    font-size:11px !important;
    padding:5px 8px !important;
  }
  #screen-lessons .lesson-arrow{
    width:30px !important;
    height:30px !important;
    font-size:22px !important;
  }
  #screen-lessons .lesson-nav-copy strong{
    font-size:16px !important;
  }
  #screen-lessons .lesson-nav-copy .mini{
    font-size:12px !important;
  }
}
@media (max-width:420px){
  #screen-lessons .lesson-nav-pro{
    grid-template-columns:28px 42px minmax(0,1fr) !important;
    min-height:108px !important;
    padding:12px !important;
  }
  #screen-lessons .lesson-menu-title-row strong{font-size:19px !important;}
  #screen-lessons .lesson-menu-title-row span{font-size:11px !important;padding:5px 9px !important;}
}

@media (max-width:820px){
  .topbar-premium > .auth-dock,
  .topbar > .auth-dock{
    gap:6px !important;
    grid-template-columns:minmax(68px,1fr) 44px 44px !important;
    max-width:100% !important;
    overflow:visible !important;
  }
  .topbar-premium > .auth-dock .theme-toggle,
  .topbar > .auth-dock .theme-toggle,
  .topbar-premium > .auth-dock #themeToggle,
  .topbar > .auth-dock #themeToggle,
  .topbar-premium > .auth-dock .auth-open-icon-btn,
  .topbar > .auth-dock .auth-open-icon-btn{
    width:44px !important;
    min-width:44px !important;
    max-width:44px !important;
    height:40px !important;
    min-height:40px !important;
    margin:0 !important;
  }
  .topbar-premium > .auth-dock .theme-icon,
  .topbar > .auth-dock .theme-icon{
    inset:0 !important;
    width:100% !important;
    height:100% !important;
    display:grid !important;
    place-items:center !important;
    font-size:17px !important;
    line-height:1 !important;
    z-index:3 !important;
  }
}
@media (max-width:380px){
  .topbar-premium > .auth-dock,
  .topbar > .auth-dock{
    grid-template-columns:minmax(54px,1fr) 40px 40px !important;
    gap:5px !important;
  }
  .topbar-premium > .auth-dock .theme-toggle,
  .topbar > .auth-dock .theme-toggle,
  .topbar-premium > .auth-dock #themeToggle,
  .topbar > .auth-dock #themeToggle,
  .topbar-premium > .auth-dock .auth-open-icon-btn,
  .topbar > .auth-dock .auth-open-icon-btn{
    width:40px !important;
    min-width:40px !important;
    max-width:40px !important;
  }
}


/* v58: restore old mobile swipe lesson menu; remove button subtitles; keep click position stable */
#screen-lessons .lesson-nav-copy .mini{
  display:none !important;
}
#screen-lessons .lesson-nav-copy strong{
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  display:block !important;
  -webkit-line-clamp:unset !important;
  -webkit-box-orient:initial !important;
  overflow-wrap:normal !important;
  word-break:normal !important;
  max-width:100% !important;
}
#screen-lessons .lesson-nav-pro{
  min-height:76px !important;
}
#screen-lessons .lesson-nav-copy{
  min-width:0 !important;
}
#screen-lessons .lesson-menu-list{
  scroll-behavior:smooth;
  -webkit-overflow-scrolling:touch;
}
@media (max-width:900px){
  #screen-lessons #lessonSidebar.lesson-menu-premium{
    position:sticky !important;
    top:8px !important;
    z-index:12 !important;
    overflow:hidden !important;
    padding:12px !important;
    border-radius:24px !important;
    margin-bottom:14px !important;
  }
  #screen-lessons .lesson-menu-list{
    display:flex !important;
    flex-wrap:nowrap !important;
    gap:10px !important;
    max-height:none !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    padding:2px 2px 8px !important;
    scroll-snap-type:x proximity !important;
    scrollbar-width:thin !important;
  }
  #screen-lessons .lesson-nav-pro{
    flex:0 0 min(84vw, 310px) !important;
    width:auto !important;
    min-height:76px !important;
    grid-template-columns:42px minmax(0,1fr) auto !important;
    align-items:center !important;
    gap:10px !important;
    padding:12px !important;
    scroll-snap-align:start !important;
  }
  #screen-lessons .lesson-nav-pro::before{
    top:12px !important;
    bottom:12px !important;
    width:4px !important;
  }
  #screen-lessons .lesson-nav-index{
    display:none !important;
  }
  #screen-lessons .lesson-nav-icon{
    width:42px !important;
    height:42px !important;
    border-radius:15px !important;
    font-size:21px !important;
  }
  #screen-lessons .lesson-nav-copy strong{
    font-size:16px !important;
    line-height:1.18 !important;
  }
  #screen-lessons .lesson-nav-side{
    grid-column:auto !important;
    display:grid !important;
    justify-items:end !important;
    align-items:center !important;
    gap:6px !important;
    width:auto !important;
    margin-top:0 !important;
  }
  #screen-lessons .lesson-count{
    font-size:10px !important;
    padding:5px 7px !important;
  }
  #screen-lessons .lesson-arrow{
    width:26px !important;
    height:26px !important;
    font-size:20px !important;
  }
  body[data-theme="dark"] #screen-lessons .lesson-menu-list::-webkit-scrollbar-thumb{
    background:rgba(98,145,255,.65) !important;
  }
}
@media (max-width:420px){
  #screen-lessons #lessonSidebar.lesson-menu-premium{
    padding:10px !important;
    border-radius:21px !important;
  }
  #screen-lessons .lesson-menu-kicker{
    font-size:10px !important;
    padding:5px 8px !important;
  }
  #screen-lessons .lesson-menu-title-row strong{
    font-size:18px !important;
  }
  #screen-lessons .lesson-nav-pro{
    flex-basis:min(84vw, 286px) !important;
    min-height:74px !important;
  }
}


/* v59: improve lesson menu titles readability on mobile */
#screen-lessons .lesson-nav-copy strong{
  letter-spacing:-.01em !important;
}
@media (max-width:900px){
  #screen-lessons .lesson-menu-list{
    gap:12px !important;
  }
  #screen-lessons .lesson-nav-pro{
    flex:0 0 min(90vw, 338px) !important;
    padding:12px 11px 12px 12px !important;
    grid-template-columns:40px minmax(0,1fr) auto !important;
    gap:9px !important;
  }
  #screen-lessons .lesson-nav-icon{
    width:40px !important;
    height:40px !important;
    font-size:20px !important;
  }
  #screen-lessons .lesson-nav-copy strong{
    font-size:15px !important;
  }
  #screen-lessons .lesson-nav-side{
    gap:5px !important;
  }
  #screen-lessons .lesson-count{
    font-size:10px !important;
    padding:4px 7px !important;
  }
}
@media (max-width:420px){
  #screen-lessons .lesson-nav-pro{
    flex-basis:min(92vw, 332px) !important;
  }
  #screen-lessons .lesson-nav-copy strong{
    font-size:14px !important;
  }
  #screen-lessons .lesson-count{
    font-size:9px !important;
    padding:4px 6px !important;
  }
}


/* v60: show lesson button text more fully on mobile */
@media (max-width:900px){
  #screen-lessons .lesson-nav-pro{
    flex:0 0 min(96vw, 360px) !important;
    grid-template-columns:36px minmax(0,1fr) auto !important;
    gap:8px !important;
    padding:12px 10px 12px 12px !important;
    min-height:84px !important;
  }
  #screen-lessons .lesson-nav-icon{
    width:36px !important;
    height:36px !important;
    border-radius:13px !important;
    font-size:18px !important;
  }
  #screen-lessons .lesson-nav-copy{
    padding-right:2px !important;
  }
  #screen-lessons .lesson-nav-copy strong{
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    display:-webkit-box !important;
    -webkit-box-orient:vertical !important;
    -webkit-line-clamp:2 !important;
    line-clamp:2 !important;
    font-size:15px !important;
    line-height:1.12 !important;
    word-break:normal !important;
    overflow-wrap:break-word !important;
    max-width:none !important;
  }
  #screen-lessons .lesson-nav-side{
    min-width:66px !important;
    gap:4px !important;
  }
  #screen-lessons .lesson-count{
    font-size:9px !important;
    padding:4px 6px !important;
  }
  #screen-lessons .lesson-arrow{
    width:24px !important;
    height:24px !important;
    font-size:18px !important;
  }
}
@media (max-width:420px){
  #screen-lessons .lesson-nav-pro{
    flex-basis:min(97vw, 352px) !important;
    grid-template-columns:34px minmax(0,1fr) auto !important;
    padding:11px 9px 11px 11px !important;
  }
  #screen-lessons .lesson-nav-icon{
    width:34px !important;
    height:34px !important;
    font-size:17px !important;
  }
  #screen-lessons .lesson-nav-copy strong{
    font-size:14px !important;
  }
  #screen-lessons .lesson-nav-side{
    min-width:62px !important;
  }
  #screen-lessons .lesson-count{
    font-size:8px !important;
    padding:4px 5px !important;
  }
}


/* v61: mobile swipe snap + desktop full lesson names */
@media (max-width:900px){
  #screen-lessons .lesson-menu-list{
    scroll-snap-type:x mandatory !important;
    scroll-padding-inline:2px !important;
    scroll-behavior:smooth !important;
  }
  #screen-lessons .lesson-nav-pro{
    flex:0 0 calc(100% - 4px) !important;
    width:calc(100% - 4px) !important;
    max-width:calc(100% - 4px) !important;
    min-width:calc(100% - 4px) !important;
    scroll-snap-align:start !important;
    scroll-snap-stop:always !important;
    grid-template-columns:36px minmax(0,1fr) auto !important;
    gap:8px !important;
    padding:12px 10px 12px 12px !important;
    min-height:82px !important;
  }
  #screen-lessons .lesson-nav-copy strong{
    white-space:normal !important;
    display:-webkit-box !important;
    -webkit-box-orient:vertical !important;
    -webkit-line-clamp:2 !important;
    line-clamp:2 !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    font-size:15px !important;
    line-height:1.12 !important;
  }
}
@media (min-width:901px){
  #screen-lessons .lesson-layout{
    grid-template-columns:360px minmax(0,1fr) !important;
  }
  #screen-lessons #lessonSidebar.lesson-menu-premium{
    padding:18px !important;
  }
  #screen-lessons .lesson-nav-pro{
    min-height:90px !important;
    grid-template-columns:30px 46px minmax(0,1fr) auto !important;
  }
  #screen-lessons .lesson-nav-copy strong{
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    display:-webkit-box !important;
    -webkit-box-orient:vertical !important;
    -webkit-line-clamp:2 !important;
    line-clamp:2 !important;
    line-height:1.14 !important;
  }
  #screen-lessons .lesson-nav-side{
    min-width:92px !important;
  }
}


/* v62 community guest/login card dark mode fix */
body[data-theme="dark"] #screen-community .community-account-card.guest-state{
  background:linear-gradient(135deg,#2a1520 0%,#351a27 58%,#24121c 100%) !important;
  border:1px solid #8a4154 !important;
  box-shadow:0 16px 32px rgba(0,0,0,.28) !important;
}
body[data-theme="dark"] #screen-community .community-account-card.guest-state .small-label,
body[data-theme="dark"] #screen-community .community-account-card.guest-state h3{
  color:#ffb4be !important;
}
body[data-theme="dark"] #screen-community .community-account-card.guest-state p,
body[data-theme="dark"] #screen-community .community-account-card.guest-state span{
  color:#ffe4e8 !important;
}
body[data-theme="dark"] #screen-community .community-account-card.guest-state .profile-frame,
body[data-theme="dark"] #screen-community .community-account-card.guest-state .compact-profile-frame,
body[data-theme="dark"] #screen-community .community-account-card.guest-state .profile-frame-rich{
  background:linear-gradient(180deg,#42202d 0%,#341925 100%) !important;
  border:1px solid #995469 !important;
  box-shadow:0 12px 24px rgba(0,0,0,.18) !important;
}
body[data-theme="dark"] #screen-community .community-account-card.guest-state .profile-avatar{
  background:linear-gradient(135deg,#ff7c9b,#c91f67) !important;
  box-shadow:0 12px 24px rgba(201,31,103,.26) !important;
}
body[data-theme="dark"] #screen-community .community-account-card.guest-state #communityLoginBtn{
  background:linear-gradient(135deg,#4a2633,#5d2d3d) !important;
  border:1px solid #a66176 !important;
  color:#fff1f4 !important;
  box-shadow:none !important;
}
body[data-theme="dark"] #screen-community .community-account-card.guest-state #communityLoginBtn:hover{
  background:linear-gradient(135deg,#5a3040,#70384b) !important;
  border-color:#c67c92 !important;
  color:#ffffff !important;
}


/* v63 grammar sidebar menu same style as lessons */
#screen-grammar #grammarSidebar.grammar-menu-premium{
  --lesson-accent:#4f82ff;
  position:sticky;
  top:126px;
  align-self:start;
  display:grid !important;
  gap:14px !important;
  padding:18px !important;
  border-radius:30px !important;
  overflow:hidden !important;
  background:
    radial-gradient(circle at 14% 0%, rgba(79,130,255,.18), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(139,92,246,.14), transparent 32%),
    linear-gradient(180deg,#ffffff 0%,#f6f9ff 100%) !important;
  border:1px solid rgba(196,211,235,.95) !important;
  box-shadow:0 22px 48px rgba(31,55,100,.12), inset 0 1px 0 rgba(255,255,255,.88) !important;
}
#screen-grammar #grammarSidebar.grammar-menu-premium::after{
  content:"";
  position:absolute;
  inset:auto -40px -54px auto;
  width:150px;height:150px;border-radius:999px;
  background:linear-gradient(135deg,rgba(139,61,255,.13),rgba(79,130,255,.05));
  pointer-events:none;
}
#screen-grammar .grammar-menu-head{
  position:relative;z-index:1;display:grid;gap:8px;
  padding:16px 16px 14px;border-radius:24px;
  background:linear-gradient(135deg,#1f3764 0%,#315fc2 58%,#7c3aed 100%);
  color:#fff;box-shadow:0 18px 34px rgba(49,95,194,.24), inset 0 1px 0 rgba(255,255,255,.15);
}
#screen-grammar .grammar-menu-kicker{
  display:inline-flex;align-items:center;width:max-content;max-width:100%;padding:6px 10px;border-radius:999px;
  background:rgba(255,255,255,.16);color:#eef6ff !important;font-size:12px;font-weight:1000;letter-spacing:.03em;text-transform:uppercase;
}
#screen-grammar .grammar-menu-title-row{display:flex;align-items:center;justify-content:space-between;gap:10px;}
#screen-grammar .grammar-menu-title-row strong{color:#fff !important;font-size:24px;line-height:1.05;letter-spacing:-.04em;}
#screen-grammar .grammar-menu-title-row span{flex:0 0 auto;color:#1f3764 !important;background:#fff;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:1000;box-shadow:inset 0 0 0 1px rgba(255,255,255,.45);}
#screen-grammar .grammar-menu-head small{color:#dcecff !important;font-weight:800;line-height:1.35;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#screen-grammar .grammar-menu-list{position:relative;z-index:1;display:grid;gap:10px;max-height:calc(100dvh - 260px);overflow:auto;padding:2px 2px 4px;scrollbar-width:thin;scrollbar-color:rgba(79,130,255,.45) transparent;}
#screen-grammar .grammar-menu-list::-webkit-scrollbar{width:7px;height:7px;}
#screen-grammar .grammar-menu-list::-webkit-scrollbar-thumb{background:rgba(79,130,255,.35);border-radius:999px;}
#screen-grammar .grammar-nav-pro{min-height:90px !important;grid-template-columns:30px 48px minmax(0,1fr) auto !important;}
#screen-grammar .grammar-nav-copy{min-width:0;display:grid;gap:5px;}
#screen-grammar .grammar-nav-copy strong{
  color:var(--lesson-text) !important;font-size:17px !important;line-height:1.12 !important;letter-spacing:-.02em;
  white-space:normal !important;overflow:visible !important;text-overflow:clip !important;
  display:-webkit-box !important;-webkit-box-orient:vertical !important;-webkit-line-clamp:2 !important;line-clamp:2 !important;
}
#screen-grammar .grammar-nav-side{min-width:96px !important;}
#screen-grammar .grammar-count{white-space:nowrap !important;}
body[data-theme="dark"] #screen-grammar #grammarSidebar.grammar-menu-premium{
  background:
    radial-gradient(circle at 14% 0%, rgba(110,162,255,.16), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(139,92,246,.14), transparent 32%),
    linear-gradient(180deg,#0d1b31 0%,#101f36 100%) !important;
  border-color:#29496f !important;
  box-shadow:0 22px 48px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.04) !important;
}
body[data-theme="dark"] #screen-grammar .grammar-menu-head{
  background:linear-gradient(135deg,#102442 0%,#1e4288 58%,#5b21b6 100%);
  box-shadow:0 18px 34px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08);
}
body[data-theme="dark"] #screen-grammar .grammar-nav-copy strong{color:#f4f8ff !important;}
@media (max-width:1100px){
  #screen-grammar #grammarSidebar.grammar-menu-premium{position:relative;top:auto;}
}
@media (max-width:900px){
  #screen-grammar #grammarSidebar.grammar-menu-premium{
    position:sticky !important;top:8px !important;z-index:12 !important;overflow:hidden !important;
    padding:12px !important;border-radius:24px !important;margin-bottom:14px !important;
  }
  #screen-grammar .grammar-menu-head{padding:12px 13px !important;border-radius:20px !important;gap:5px !important;}
  #screen-grammar .grammar-menu-title-row strong{font-size:20px !important;}
  #screen-grammar .grammar-menu-head small{font-size:12px !important;}
  #screen-grammar .grammar-menu-list{
    display:flex !important;flex-wrap:nowrap !important;gap:10px !important;max-height:none !important;
    overflow-x:auto !important;overflow-y:hidden !important;padding:2px 2px 8px !important;
    scroll-snap-type:x mandatory !important;scroll-padding-inline:2px !important;scroll-behavior:smooth !important;
    -webkit-overflow-scrolling:touch;
  }
  #screen-grammar .grammar-nav-pro{
    flex:0 0 calc(100% - 4px) !important;width:calc(100% - 4px) !important;max-width:calc(100% - 4px) !important;min-width:calc(100% - 4px) !important;
    min-height:82px !important;grid-template-columns:36px minmax(0,1fr) auto !important;gap:8px !important;padding:12px 10px 12px 12px !important;
    scroll-snap-align:start !important;scroll-snap-stop:always !important;
  }
  #screen-grammar .grammar-nav-pro::before{top:12px !important;bottom:12px !important;width:4px !important;}
  #screen-grammar .grammar-nav-index{display:none !important;}
  #screen-grammar .grammar-nav-icon{width:36px !important;height:36px !important;border-radius:13px !important;font-size:18px !important;}
  #screen-grammar .grammar-nav-copy strong{font-size:15px !important;line-height:1.12 !important;}
  #screen-grammar .grammar-nav-side{min-width:78px !important;gap:4px !important;}
  #screen-grammar .grammar-count{font-size:9px !important;padding:4px 6px !important;}
  #screen-grammar .grammar-arrow{width:24px !important;height:24px !important;font-size:18px !important;}
  body[data-theme="dark"] #screen-grammar .grammar-menu-list::-webkit-scrollbar-thumb{background:rgba(98,145,255,.65) !important;}
}
@media (max-width:420px){
  #screen-grammar #grammarSidebar.grammar-menu-premium{padding:10px !important;border-radius:21px !important;}
  #screen-grammar .grammar-menu-kicker{font-size:10px !important;padding:5px 8px !important;}
  #screen-grammar .grammar-menu-title-row strong{font-size:18px !important;}
  #screen-grammar .grammar-nav-copy strong{font-size:14px !important;}
  #screen-grammar .grammar-nav-side{min-width:70px !important;}
  #screen-grammar .grammar-count{font-size:8px !important;padding:4px 5px !important;}
}
@media (min-width:901px){
  #screen-grammar .lesson-layout.grammar-layout-v2{grid-template-columns:360px minmax(0,1fr) !important;}
}


/* v64 grammar guide colorful UI refresh (light + dark) */
#screen-grammar .grammar-main-panel{
  background:
    radial-gradient(circle at 0% 0%, rgba(79,130,255,.10), transparent 28%),
    radial-gradient(circle at 100% 18%, rgba(34,197,94,.10), transparent 24%),
    linear-gradient(180deg,#ffffff 0%,#f7faff 100%) !important;
  border-color:#d7e3f4 !important;
  box-shadow:0 24px 50px rgba(31,55,100,.10) !important;
}
#screen-grammar .grammar-banner{
  background:linear-gradient(135deg,#2b57b8 0%,#1fa0c9 52%,#22c55e 100%) !important;
  border:1px solid rgba(255,255,255,.18) !important;
  box-shadow:0 20px 40px rgba(43,87,184,.22) !important;
}
#screen-grammar .grammar-banner h2,
#screen-grammar .grammar-banner p,
#screen-grammar .grammar-banner .small-label{color:#ffffff !important;}
#screen-grammar .grammar-banner .lesson-badge{
  background:rgba(255,255,255,.16) !important;
  color:#ffffff !important;
  border:1px solid rgba(255,255,255,.22) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.2) !important;
}
#screen-grammar #grammarFocusNote{
  background:linear-gradient(180deg,#ffffff 0%,#f9fbff 100%) !important;
  border:1px solid #dce8f7 !important;
  box-shadow:0 14px 28px rgba(31,55,100,.08) !important;
}
#screen-grammar #grammarFocusNote .focus-pill{
  min-height:96px !important;
}
#screen-grammar #grammarFocusNote .focus-pill:nth-child(1){background:linear-gradient(135deg,#edfdf3 0%,#ffffff 100%) !important;}
#screen-grammar #grammarFocusNote .focus-pill:nth-child(2){background:linear-gradient(135deg,#edf5ff 0%,#ffffff 100%) !important;}
#screen-grammar #grammarFocusNote .focus-pill:nth-child(3){background:linear-gradient(135deg,#f6efff 0%,#ffffff 100%) !important;}
#screen-grammar #grammarFocusNote .focus-pill:nth-child(4){background:linear-gradient(135deg,#fff4e8 0%,#ffffff 100%) !important;}
#screen-grammar #grammarFocusNote .focus-emoji{
  box-shadow:0 10px 20px rgba(31,55,100,.10) !important;
}
#screen-grammar .practice-launch-row{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
  flex-wrap:wrap !important;
  margin:2px 0 2px !important;
}
#screen-grammar .practice-launch-row .page-indicator{
  background:linear-gradient(135deg,#102c58,#173a72) !important;
  border:1px solid #315e9d !important;
  color:#f1f6ff !important;
  font-weight:800 !important;
  box-shadow:0 8px 18px rgba(16,44,88,.18) !important;
}
#screen-grammar .practice-launch-row .primary-btn{
  background:linear-gradient(135deg,#4f82ff 0%,#3b5bfd 55%,#22c55e 100%) !important;
  color:#ffffff !important;
  border:none !important;
  box-shadow:0 14px 26px rgba(79,130,255,.28) !important;
}
#screen-grammar .practice-launch-row .primary-btn:hover{
  transform:translateY(-1px);
}
#screen-grammar #grammarSubmenu,
#screen-grammar .grammar-submenu{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:14px !important;
}
#screen-grammar #grammarSubmenu .grammar-tab,
#screen-grammar .grammar-submenu .grammar-tab{
  min-height:78px !important;
  border-radius:22px !important;
  box-shadow:0 12px 24px rgba(20,35,65,.08) !important;
  border:1px solid #d5e3f7 !important;
  display:flex !important;
  justify-content:flex-start !important;
  align-items:center !important;
  text-align:left !important;
  padding:16px 18px !important;
  white-space:normal !important;
}
#screen-grammar #grammarSubmenu .grammar-tab:nth-child(1){background:linear-gradient(135deg,#eef5ff,#ffffff) !important;color:#2c5ac2 !important;}
#screen-grammar #grammarSubmenu .grammar-tab:nth-child(2){background:linear-gradient(135deg,#f5efff,#ffffff) !important;color:#8446dc !important;}
#screen-grammar #grammarSubmenu .grammar-tab:nth-child(3){background:linear-gradient(135deg,#eefdf3,#ffffff) !important;color:#18884a !important;}
#screen-grammar #grammarSubmenu .grammar-tab:nth-child(4){background:linear-gradient(135deg,#fff4ea,#ffffff) !important;color:#d06916 !important;}
#screen-grammar #grammarSubmenu .grammar-tab:nth-child(5){background:linear-gradient(135deg,#fff1f2,#ffffff) !important;color:#cf3746 !important;}
#screen-grammar #grammarSubmenu .grammar-tab.active,
#screen-grammar .grammar-submenu .grammar-tab.active{
  transform:translateY(-2px) !important;
  box-shadow:0 16px 30px rgba(20,35,65,.14) !important;
  border-color:transparent !important;
  color:#ffffff !important;
}
#screen-grammar #grammarSubmenu .grammar-tab.active:nth-child(1){background:linear-gradient(135deg,#3b82f6,#2557d6) !important;}
#screen-grammar #grammarSubmenu .grammar-tab.active:nth-child(2){background:linear-gradient(135deg,#8b5cf6,#6d28d9) !important;}
#screen-grammar #grammarSubmenu .grammar-tab.active:nth-child(3){background:linear-gradient(135deg,#22c55e,#15803d) !important;}
#screen-grammar #grammarSubmenu .grammar-tab.active:nth-child(4){background:linear-gradient(135deg,#fb923c,#ea580c) !important;}
#screen-grammar #grammarSubmenu .grammar-tab.active:nth-child(5){background:linear-gradient(135deg,#ef4444,#dc2626) !important;}
#screen-grammar .grammar-summary-strip{gap:14px !important;}
#screen-grammar .grammar-mini-box{
  border-radius:22px !important;
  border:1px solid #dbe8f8 !important;
  box-shadow:0 12px 24px rgba(31,55,100,.08) !important;
}
#screen-grammar .grammar-mini-box span{
  text-transform:uppercase !important;
  font-size:12px !important;
  letter-spacing:.04em !important;
  color:#6a7e98 !important;
  font-weight:900 !important;
}
#screen-grammar .grammar-mini-box strong{
  font-size:18px !important;
  color:#17355d !important;
}
#screen-grammar .grammar-mini-box:nth-child(1){background:linear-gradient(135deg,#edf6ff,#ffffff) !important;}
#screen-grammar .grammar-mini-box:nth-child(2){background:linear-gradient(135deg,#eefdf3,#ffffff) !important;}
#screen-grammar .grammar-mini-box:nth-child(3){background:linear-gradient(135deg,#fff4ea,#ffffff) !important;}
#screen-grammar .grammar-section-card,
#screen-grammar .grammar-point,
#screen-grammar .example-card,
#screen-grammar .quick-tip-box,
#screen-grammar .grammar-quick-check-card,
#screen-grammar .grammar-audio-now,
#screen-grammar .side-table-card,
#screen-grammar .learn-card{
  border:1px solid #d7e4f4 !important;
  box-shadow:0 16px 30px rgba(31,55,100,.08) !important;
}
#screen-grammar .overview-main-card{background:linear-gradient(135deg,#ffffff 0%,#f8fbff 100%) !important;}
#screen-grammar .side-table-card{background:linear-gradient(135deg,#f2f8ff 0%,#ffffff 100%) !important;}
#screen-grammar .learn-card{background:linear-gradient(135deg,#f3fff7 0%,#ffffff 100%) !important;}
#screen-grammar .quick-tip-box{background:linear-gradient(135deg,#fff8ef 0%,#ffffff 100%) !important;}
#screen-grammar .grammar-audio-now{background:linear-gradient(135deg,#eef4ff 0%,#ffffff 100%) !important;}
#screen-grammar .grammar-card-chip{
  background:linear-gradient(135deg,#edf5ff,#ffffff) !important;
  border:1px solid #cfe0f8 !important;
  color:#29509a !important;
  font-weight:900 !important;
}
#screen-grammar .overview-feature{
  border:1px solid #d7e4f7 !important;
  border-radius:22px !important;
  box-shadow:0 12px 22px rgba(31,55,100,.08) !important;
}
#screen-grammar .overview-feature.tone-1{background:linear-gradient(135deg,#edf5ff 0%,#ffffff 100%) !important;}
#screen-grammar .overview-feature.tone-2{background:linear-gradient(135deg,#fff3ea 0%,#ffffff 100%) !important;}
#screen-grammar .overview-feature.tone-3{background:linear-gradient(135deg,#eefdf3 0%,#ffffff 100%) !important;}
#screen-grammar .overview-feature.tone-4{background:linear-gradient(135deg,#f7efff 0%,#ffffff 100%) !important;}
#screen-grammar .overview-icon{
  box-shadow:0 8px 18px rgba(31,55,100,.10) !important;
}
#screen-grammar .grammar-point:nth-child(4n+1){background:linear-gradient(135deg,#eef5ff 0%,#ffffff 100%) !important;}
#screen-grammar .grammar-point:nth-child(4n+2){background:linear-gradient(135deg,#eefdf3 0%,#ffffff 100%) !important;}
#screen-grammar .grammar-point:nth-child(4n+3){background:linear-gradient(135deg,#fff4ea 0%,#ffffff 100%) !important;}
#screen-grammar .grammar-point:nth-child(4n+4){background:linear-gradient(135deg,#f7efff 0%,#ffffff 100%) !important;}
#screen-grammar .check-item{
  background:linear-gradient(135deg,#f8fbff,#ffffff) !important;
  border:1px solid #dce7f6 !important;
  border-radius:16px !important;
  box-shadow:0 8px 16px rgba(31,55,100,.06) !important;
}
#screen-grammar .overview-table-wrap{
  background:rgba(255,255,255,.65) !important;
  border-radius:18px !important;
  border:1px solid #d7e3f4 !important;
}
#screen-grammar .overview-table thead th{
  background:linear-gradient(135deg,#294e8f,#1f3764) !important;
  color:#ffffff !important;
}
#screen-grammar .overview-table tbody tr:nth-child(even){background:rgba(79,130,255,.04) !important;}
#screen-grammar .example-card.colorful:nth-child(3n+1){background:linear-gradient(135deg,#eef5ff,#ffffff) !important;}
#screen-grammar .example-card.colorful:nth-child(3n+2){background:linear-gradient(135deg,#eefdf3,#ffffff) !important;}
#screen-grammar .example-card.colorful:nth-child(3n+3){background:linear-gradient(135deg,#fff4ea,#ffffff) !important;}
#screen-grammar .example-index{
  box-shadow:0 8px 16px rgba(31,55,100,.10) !important;
}
body[data-theme="dark"] #screen-grammar .grammar-main-panel{
  background:
    radial-gradient(circle at 0% 0%, rgba(79,130,255,.16), transparent 28%),
    radial-gradient(circle at 100% 16%, rgba(34,197,94,.10), transparent 24%),
    linear-gradient(180deg,#07182d 0%,#081628 100%) !important;
  border-color:#234365 !important;
  box-shadow:0 24px 52px rgba(0,0,0,.34) !important;
}
body[data-theme="dark"] #screen-grammar .grammar-banner{
  background:linear-gradient(135deg,#13366f 0%,#145b8d 52%,#0f7a57 100%) !important;
  border-color:#2d5e91 !important;
  box-shadow:0 20px 40px rgba(0,0,0,.26) !important;
}
body[data-theme="dark"] #screen-grammar #grammarFocusNote{
  background:linear-gradient(180deg,#0d213d 0%,#0c1c34 100%) !important;
  border-color:#27496d !important;
  box-shadow:0 16px 30px rgba(0,0,0,.24) !important;
}
body[data-theme="dark"] #screen-grammar #grammarFocusNote .focus-pill{border-color:#284869 !important;}
body[data-theme="dark"] #screen-grammar #grammarFocusNote .focus-pill:nth-child(1){background:linear-gradient(135deg,#143222 0%,#0f2237 100%) !important;}
body[data-theme="dark"] #screen-grammar #grammarFocusNote .focus-pill:nth-child(2){background:linear-gradient(135deg,#102a4d 0%,#0f2237 100%) !important;}
body[data-theme="dark"] #screen-grammar #grammarFocusNote .focus-pill:nth-child(3){background:linear-gradient(135deg,#2a1f4a 0%,#0f2237 100%) !important;}
body[data-theme="dark"] #screen-grammar #grammarFocusNote .focus-pill:nth-child(4){background:linear-gradient(135deg,#4b2f11 0%,#0f2237 100%) !important;}
body[data-theme="dark"] #screen-grammar #grammarFocusNote .focus-pill strong{color:#ffffff !important;}
body[data-theme="dark"] #screen-grammar #grammarFocusNote .focus-pill small{color:#cfdbef !important;}
body[data-theme="dark"] #screen-grammar #grammarFocusNote .focus-emoji{
  background:rgba(255,255,255,.08) !important;
  border-color:rgba(255,255,255,.12) !important;
}
body[data-theme="dark"] #screen-grammar .practice-launch-row .page-indicator{
  background:linear-gradient(135deg,#0d2340,#17345f) !important;
  border-color:#33598a !important;
  color:#eff5ff !important;
}
body[data-theme="dark"] #screen-grammar #grammarSubmenu .grammar-tab,
body[data-theme="dark"] #screen-grammar .grammar-submenu .grammar-tab{
  border-color:#284668 !important;
  box-shadow:0 14px 26px rgba(0,0,0,.20) !important;
}
body[data-theme="dark"] #screen-grammar #grammarSubmenu .grammar-tab:nth-child(1){background:linear-gradient(135deg,#14335d,#0f2138) !important;color:#9fc3ff !important;}
body[data-theme="dark"] #screen-grammar #grammarSubmenu .grammar-tab:nth-child(2){background:linear-gradient(135deg,#31204f,#0f2138) !important;color:#d3b2ff !important;}
body[data-theme="dark"] #screen-grammar #grammarSubmenu .grammar-tab:nth-child(3){background:linear-gradient(135deg,#143b2b,#0f2138) !important;color:#9ee0b0 !important;}
body[data-theme="dark"] #screen-grammar #grammarSubmenu .grammar-tab:nth-child(4){background:linear-gradient(135deg,#4a2b14,#0f2138) !important;color:#ffc48a !important;}
body[data-theme="dark"] #screen-grammar #grammarSubmenu .grammar-tab:nth-child(5){background:linear-gradient(135deg,#4b1d26,#0f2138) !important;color:#ffb1bd !important;}
body[data-theme="dark"] #screen-grammar #grammarSubmenu .grammar-tab.active{color:#ffffff !important;}
body[data-theme="dark"] #screen-grammar .grammar-mini-box,
body[data-theme="dark"] #screen-grammar .grammar-section-card,
body[data-theme="dark"] #screen-grammar .grammar-point,
body[data-theme="dark"] #screen-grammar .example-card,
body[data-theme="dark"] #screen-grammar .quick-tip-box,
body[data-theme="dark"] #screen-grammar .grammar-quick-check-card,
body[data-theme="dark"] #screen-grammar .grammar-audio-now,
body[data-theme="dark"] #screen-grammar .side-table-card,
body[data-theme="dark"] #screen-grammar .learn-card{
  border-color:#27496d !important;
  box-shadow:0 16px 30px rgba(0,0,0,.22) !important;
}
body[data-theme="dark"] #screen-grammar .grammar-mini-box:nth-child(1){background:linear-gradient(135deg,#14335d,#0d2139) !important;}
body[data-theme="dark"] #screen-grammar .grammar-mini-box:nth-child(2){background:linear-gradient(135deg,#173827,#0d2139) !important;}
body[data-theme="dark"] #screen-grammar .grammar-mini-box:nth-child(3){background:linear-gradient(135deg,#4a3014,#0d2139) !important;}
body[data-theme="dark"] #screen-grammar .grammar-mini-box span{color:#b8cae5 !important;}
body[data-theme="dark"] #screen-grammar .grammar-mini-box strong{color:#f4f8ff !important;}
body[data-theme="dark"] #screen-grammar .overview-main-card{background:linear-gradient(135deg,#102746 0%,#0d1f39 100%) !important;}
body[data-theme="dark"] #screen-grammar .side-table-card{background:linear-gradient(135deg,#122d52 0%,#0d1f39 100%) !important;}
body[data-theme="dark"] #screen-grammar .learn-card{background:linear-gradient(135deg,#173524 0%,#0d1f39 100%) !important;}
body[data-theme="dark"] #screen-grammar .quick-tip-box{background:linear-gradient(135deg,#4b3214 0%,#0d1f39 100%) !important;}
body[data-theme="dark"] #screen-grammar .grammar-audio-now{background:linear-gradient(135deg,#1f2b52 0%,#0d1f39 100%) !important;}
body[data-theme="dark"] #screen-grammar .grammar-card-chip{
  background:rgba(255,255,255,.08) !important;
  border-color:rgba(255,255,255,.12) !important;
  color:#e7f0ff !important;
}
body[data-theme="dark"] #screen-grammar .overview-feature.tone-1{background:linear-gradient(135deg,#12335d 0%,#0d2138 100%) !important;}
body[data-theme="dark"] #screen-grammar .overview-feature.tone-2{background:linear-gradient(135deg,#4a3014 0%,#0d2138 100%) !important;}
body[data-theme="dark"] #screen-grammar .overview-feature.tone-3{background:linear-gradient(135deg,#173827 0%,#0d2138 100%) !important;}
body[data-theme="dark"] #screen-grammar .overview-feature.tone-4{background:linear-gradient(135deg,#32214f 0%,#0d2138 100%) !important;}
body[data-theme="dark"] #screen-grammar .overview-feature,
body[data-theme="dark"] #screen-grammar .grammar-point,
body[data-theme="dark"] #screen-grammar .example-card{border-color:#28496d !important;}
body[data-theme="dark"] #screen-grammar .grammar-point:nth-child(4n+1){background:linear-gradient(135deg,#12335d 0%,#0d2138 100%) !important;}
body[data-theme="dark"] #screen-grammar .grammar-point:nth-child(4n+2){background:linear-gradient(135deg,#173827 0%,#0d2138 100%) !important;}
body[data-theme="dark"] #screen-grammar .grammar-point:nth-child(4n+3){background:linear-gradient(135deg,#4a3014 0%,#0d2138 100%) !important;}
body[data-theme="dark"] #screen-grammar .grammar-point:nth-child(4n+4){background:linear-gradient(135deg,#32214f 0%,#0d2138 100%) !important;}
body[data-theme="dark"] #screen-grammar .check-item{
  background:linear-gradient(135deg,#0f223c,#102846) !important;
  border-color:#2a4a6e !important;
  color:#eef4ff !important;
}
body[data-theme="dark"] #screen-grammar .overview-table-wrap{
  background:rgba(8,22,40,.65) !important;
  border-color:#28496d !important;
}
body[data-theme="dark"] #screen-grammar .overview-table thead th{
  background:linear-gradient(135deg,#18365f,#214a82) !important;
}
body[data-theme="dark"] #screen-grammar .overview-table tbody tr:nth-child(even){background:rgba(255,255,255,.03) !important;}
body[data-theme="dark"] #screen-grammar .example-card.colorful:nth-child(3n+1){background:linear-gradient(135deg,#12335d,#0d2138) !important;}
body[data-theme="dark"] #screen-grammar .example-card.colorful:nth-child(3n+2){background:linear-gradient(135deg,#173827,#0d2138) !important;}
body[data-theme="dark"] #screen-grammar .example-card.colorful:nth-child(3n+3){background:linear-gradient(135deg,#4a3014,#0d2138) !important;}
body[data-theme="dark"] #screen-grammar .grammar-section-card h3,
body[data-theme="dark"] #screen-grammar .grammar-section-card p,
body[data-theme="dark"] #screen-grammar .grammar-point strong,
body[data-theme="dark"] #screen-grammar .grammar-point p,
body[data-theme="dark"] #screen-grammar .example-card h4,
body[data-theme="dark"] #screen-grammar .example-card p,
body[data-theme="dark"] #screen-grammar .overview-feature strong,
body[data-theme="dark"] #screen-grammar .overview-feature span,
body[data-theme="dark"] #screen-grammar .learn-item,
body[data-theme="dark"] #screen-grammar .grammar-audio-now,
body[data-theme="dark"] #screen-grammar .quick-tip-box,
body[data-theme="dark"] #screen-grammar .grammar-card-title-row h3{
  color:#eef4ff !important;
}
@media (max-width:900px){
  #screen-grammar .practice-launch-row{align-items:stretch !important;}
  #screen-grammar .practice-launch-row .page-indicator,
  #screen-grammar .practice-launch-row .primary-btn{width:100% !important;justify-content:center !important;}
  #screen-grammar #grammarSubmenu,
  #screen-grammar .grammar-submenu{
    display:flex !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    flex-wrap:nowrap !important;
    gap:10px !important;
    padding-bottom:6px !important;
    scroll-snap-type:x mandatory !important;
  }
  #screen-grammar #grammarSubmenu .grammar-tab,
  #screen-grammar .grammar-submenu .grammar-tab{
    flex:0 0 86% !important;
    min-width:86% !important;
    scroll-snap-align:start !important;
  }
  #screen-grammar .grammar-summary-strip{grid-template-columns:1fr !important;}
}


/* v65 grammar audio/quick-check + lessons + wordbank colorful polish */
#screen-grammar .grammar-audio-now{
  background:linear-gradient(135deg,#eef5ff 0%,#ffffff 100%) !important;
  border:1px solid #cfe0f8 !important;
  border-radius:22px !important;
  box-shadow:0 14px 26px rgba(31,55,100,.08) !important;
}
#screen-grammar .grammar-audio-head{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:10px !important;
  flex-wrap:wrap !important;
  margin-bottom:10px !important;
}
#screen-grammar .grammar-audio-now strong,
#screen-grammar #grammarAudioNowText{
  color:#17355d !important;
}
#screen-grammar #grammarAudioNowText{
  display:block !important;
  font-size:15px !important;
  line-height:1.7 !important;
  font-weight:800 !important;
}
#screen-grammar .grammar-quick-check-card{
  background:linear-gradient(135deg,#fff8ef 0%,#ffffff 100%) !important;
  border:1px solid #f4d3aa !important;
  border-radius:24px !important;
  box-shadow:0 14px 28px rgba(122,87,28,.08) !important;
}
#screen-grammar .grammar-quick-check-intro,
#screen-grammar .grammar-check-progress,
#screen-grammar .grammar-check-feedback,
#screen-grammar .grammar-check-result p{
  color:#5f5b45 !important;
}
#screen-grammar .grammar-check-question-wrap h4,
#screen-grammar .grammar-quick-check-card h3,
#screen-grammar .grammar-check-score{
  color:#7a4a11 !important;
}
#screen-grammar .grammar-check-option{
  background:linear-gradient(135deg,#ffffff 0%,#fff8ef 100%) !important;
  border:1px solid #f2d4a9 !important;
  color:#5f4118 !important;
  box-shadow:0 8px 16px rgba(122,87,28,.06) !important;
}
#screen-grammar .grammar-check-option.correct{
  background:linear-gradient(135deg,#ecfbf2 0%,#ffffff 100%) !important;
  border-color:#8fd7ab !important;
  color:#17753c !important;
}
#screen-grammar .grammar-check-option.wrong{
  background:linear-gradient(135deg,#fff1f1 0%,#ffffff 100%) !important;
  border-color:#f0a4a4 !important;
  color:#a33d3d !important;
}
#screen-grammar .grammar-check-result{
  background:rgba(255,255,255,.55) !important;
  border:1px dashed #f2d4a9 !important;
  border-radius:18px !important;
  padding:16px !important;
}
body[data-theme="dark"] #screen-grammar .grammar-audio-now{
  background:linear-gradient(135deg,#17345f 0%,#0f2138 100%) !important;
  border-color:#3d6aaa !important;
  box-shadow:0 16px 30px rgba(0,0,0,.24) !important;
}
body[data-theme="dark"] #screen-grammar .grammar-audio-now strong{color:#aecdff !important;}
body[data-theme="dark"] #screen-grammar #grammarAudioNowText{
  color:#eef4ff !important;
}
body[data-theme="dark"] #screen-grammar .grammar-quick-check-card{
  background:linear-gradient(135deg,#4a3014 0%,#0d1f39 100%) !important;
  border-color:#8e6935 !important;
  box-shadow:0 16px 30px rgba(0,0,0,.24) !important;
}
body[data-theme="dark"] #screen-grammar .grammar-quick-check-intro,
body[data-theme="dark"] #screen-grammar .grammar-check-progress,
body[data-theme="dark"] #screen-grammar .grammar-check-feedback,
body[data-theme="dark"] #screen-grammar .grammar-check-result p{
  color:#f3dfb9 !important;
}
body[data-theme="dark"] #screen-grammar .grammar-check-question-wrap h4,
body[data-theme="dark"] #screen-grammar .grammar-quick-check-card h3,
body[data-theme="dark"] #screen-grammar .grammar-check-score{
  color:#ffd69a !important;
}
body[data-theme="dark"] #screen-grammar .grammar-check-option{
  background:linear-gradient(135deg,#5b3a17 0%,#33210d 100%) !important;
  border-color:#9a7440 !important;
  color:#fff0d6 !important;
  box-shadow:0 8px 16px rgba(0,0,0,.18) !important;
}
body[data-theme="dark"] #screen-grammar .grammar-check-option.correct{
  background:linear-gradient(135deg,#183b24 0%,#102818 100%) !important;
  border-color:#4eb67a !important;
  color:#dfffea !important;
}
body[data-theme="dark"] #screen-grammar .grammar-check-option.wrong{
  background:linear-gradient(135deg,#4b2222 0%,#2d1515 100%) !important;
  border-color:#cf7777 !important;
  color:#ffe7e7 !important;
}
body[data-theme="dark"] #screen-grammar .grammar-check-result{
  background:rgba(255,255,255,.04) !important;
  border:1px dashed #8e6935 !important;
}

/* Lessons colorful cards */
#screen-lessons .lesson-banner{
  background:linear-gradient(135deg,#edf7ff 0%,#ffffff 46%,#eefdf3 100%) !important;
  border:1px solid #d8e8f6 !important;
  box-shadow:0 18px 36px rgba(31,55,100,.08) !important;
}
#screen-lessons .lesson-badge{
  background:linear-gradient(135deg,#ffffff,#eef5ff) !important;
  border:1px solid #d6e4f7 !important;
  box-shadow:0 12px 22px rgba(31,55,100,.08) !important;
}
#screen-lessons .lesson-item,
#screen-lessons .extra-card{
  border-width:1px !important;
  box-shadow:0 16px 28px rgba(31,55,100,.08) !important;
}
#screen-lessons .lesson-item:nth-child(4n+1){background:linear-gradient(135deg,#eefdf3 0%,#ffffff 100%) !important;border-color:#bfe8cf !important;}
#screen-lessons .lesson-item:nth-child(4n+2){background:linear-gradient(135deg,#eef5ff 0%,#ffffff 100%) !important;border-color:#c8dbff !important;}
#screen-lessons .lesson-item:nth-child(4n+3){background:linear-gradient(135deg,#f7efff 0%,#ffffff 100%) !important;border-color:#dbc9fb !important;}
#screen-lessons .lesson-item:nth-child(4n+4){background:linear-gradient(135deg,#fff4ea 0%,#ffffff 100%) !important;border-color:#f5d0a6 !important;}
#screen-lessons .lesson-item:nth-child(4n+1) .lesson-name .emoji{background:linear-gradient(135deg,#22c55e,#16a34a) !important;color:#fff !important;}
#screen-lessons .lesson-item:nth-child(4n+2) .lesson-name .emoji{background:linear-gradient(135deg,#60a5fa,#2563eb) !important;color:#fff !important;}
#screen-lessons .lesson-item:nth-child(4n+3) .lesson-name .emoji{background:linear-gradient(135deg,#a78bfa,#7c3aed) !important;color:#fff !important;}
#screen-lessons .lesson-item:nth-child(4n+4) .lesson-name .emoji{background:linear-gradient(135deg,#fb923c,#ea580c) !important;color:#fff !important;}
#screen-lessons .lesson-item .lesson-item-top{border-bottom-color:rgba(31,55,100,.10) !important;}
#screen-lessons .lesson-item .lesson-name h4{color:#17355d !important;}
#screen-lessons .lesson-item .lesson-name p,
#screen-lessons .lesson-item .ex-line{color:#42546a !important;}
#screen-lessons .lesson-chip{background:linear-gradient(135deg,#eef5ff,#ffffff) !important;border:1px solid #d6e4f8 !important;color:#29509a !important;}
#screen-lessons .lesson-chip.soft{background:linear-gradient(135deg,#fff3e8,#ffffff) !important;border:1px solid #f0d5b0 !important;color:#b56216 !important;}
#screen-lessons .lesson-item .ex-box.it{background:linear-gradient(135deg,#eefdf3 0%,#ffffff 100%) !important;border:1px solid #c0e7cd !important;}
#screen-lessons .lesson-item .ex-box.en{background:linear-gradient(135deg,#eef5ff 0%,#ffffff 100%) !important;border:1px solid #c8dbff !important;}
#screen-lessons .extra-card:nth-child(4n+1){background:linear-gradient(135deg,#eef5ff,#ffffff) !important;border-color:#c8dbff !important;}
#screen-lessons .extra-card:nth-child(4n+2){background:linear-gradient(135deg,#eefdf3,#ffffff) !important;border-color:#bfe8cf !important;}
#screen-lessons .extra-card:nth-child(4n+3){background:linear-gradient(135deg,#fff4ea,#ffffff) !important;border-color:#f5d0a6 !important;}
#screen-lessons .extra-card:nth-child(4n+4){background:linear-gradient(135deg,#f7efff,#ffffff) !important;border-color:#dbc9fb !important;}
#screen-lessons .extra-card strong{color:#17355d !important;}
body[data-theme="dark"] #screen-lessons .lesson-banner{
  background:linear-gradient(135deg,#102746 0%,#0d1f39 48%,#173524 100%) !important;
  border-color:#29496f !important;
  box-shadow:0 20px 38px rgba(0,0,0,.24) !important;
}
body[data-theme="dark"] #screen-lessons .lesson-banner h2,
body[data-theme="dark"] #screen-lessons .lesson-banner p,
body[data-theme="dark"] #screen-lessons .lesson-intro,
body[data-theme="dark"] #screen-lessons .extra-card,
body[data-theme="dark"] #screen-lessons .extra-card div,
body[data-theme="dark"] #screen-lessons .lesson-item .lesson-name h4,
body[data-theme="dark"] #screen-lessons .lesson-item .lesson-name p,
body[data-theme="dark"] #screen-lessons .lesson-item .ex-line{
  color:#eef4ff !important;
}
body[data-theme="dark"] #screen-lessons .lesson-badge{
  background:rgba(255,255,255,.08) !important;
  border-color:rgba(255,255,255,.12) !important;
  color:#ffffff !important;
}
body[data-theme="dark"] #screen-lessons .lesson-item:nth-child(4n+1){background:linear-gradient(135deg,#173827 0%,#0d2139 100%) !important;border-color:#2e6b44 !important;}
body[data-theme="dark"] #screen-lessons .lesson-item:nth-child(4n+2){background:linear-gradient(135deg,#12335d 0%,#0d2139 100%) !important;border-color:#355f9f !important;}
body[data-theme="dark"] #screen-lessons .lesson-item:nth-child(4n+3){background:linear-gradient(135deg,#32214f 0%,#0d2139 100%) !important;border-color:#6d49aa !important;}
body[data-theme="dark"] #screen-lessons .lesson-item:nth-child(4n+4){background:linear-gradient(135deg,#4a3014 0%,#0d2139 100%) !important;border-color:#a96d22 !important;}
body[data-theme="dark"] #screen-lessons .lesson-chip{background:rgba(255,255,255,.08) !important;border-color:rgba(255,255,255,.12) !important;color:#dce9ff !important;}
body[data-theme="dark"] #screen-lessons .lesson-chip.soft{background:rgba(255,186,110,.10) !important;border-color:rgba(255,186,110,.22) !important;color:#ffd9ac !important;}
body[data-theme="dark"] #screen-lessons .lesson-item .ex-box.it{background:linear-gradient(135deg,#143222 0%,rgba(255,255,255,.02) 100%) !important;border-color:#356d48 !important;}
body[data-theme="dark"] #screen-lessons .lesson-item .ex-box.en{background:linear-gradient(135deg,#14335d 0%,rgba(255,255,255,.02) 100%) !important;border-color:#4069a9 !important;}
body[data-theme="dark"] #screen-lessons .extra-card:nth-child(4n+1){background:linear-gradient(135deg,#12335d,#0d2139) !important;border-color:#355f9f !important;}
body[data-theme="dark"] #screen-lessons .extra-card:nth-child(4n+2){background:linear-gradient(135deg,#173827,#0d2139) !important;border-color:#2e6b44 !important;}
body[data-theme="dark"] #screen-lessons .extra-card:nth-child(4n+3){background:linear-gradient(135deg,#4a3014,#0d2139) !important;border-color:#a96d22 !important;}
body[data-theme="dark"] #screen-lessons .extra-card:nth-child(4n+4){background:linear-gradient(135deg,#32214f,#0d2139) !important;border-color:#6d49aa !important;}
body[data-theme="dark"] #screen-lessons .extra-card strong{color:#ffffff !important;}

/* Word bank colorful cards */
#screen-wordbank .panel,
#screen-wordbank .word-card{
  box-shadow:0 16px 28px rgba(31,55,100,.08) !important;
}
#screen-wordbank .word-card:nth-child(4n+1){background:linear-gradient(135deg,#eefdf3 0%,#ffffff 100%) !important;border-color:#bfe8cf !important;}
#screen-wordbank .word-card:nth-child(4n+2){background:linear-gradient(135deg,#eef5ff 0%,#ffffff 100%) !important;border-color:#c8dbff !important;}
#screen-wordbank .word-card:nth-child(4n+3){background:linear-gradient(135deg,#f7efff 0%,#ffffff 100%) !important;border-color:#dbc9fb !important;}
#screen-wordbank .word-card:nth-child(4n+4){background:linear-gradient(135deg,#fff4ea 0%,#ffffff 100%) !important;border-color:#f5d0a6 !important;}
#screen-wordbank .word-card:nth-child(4n+1) .word-emoji{background:linear-gradient(135deg,#22c55e,#16a34a) !important;color:#fff !important;}
#screen-wordbank .word-card:nth-child(4n+2) .word-emoji{background:linear-gradient(135deg,#60a5fa,#2563eb) !important;color:#fff !important;}
#screen-wordbank .word-card:nth-child(4n+3) .word-emoji{background:linear-gradient(135deg,#a78bfa,#7c3aed) !important;color:#fff !important;}
#screen-wordbank .word-card:nth-child(4n+4) .word-emoji{background:linear-gradient(135deg,#fb923c,#ea580c) !important;color:#fff !important;}
#screen-wordbank .word-meta h3{color:#17355d !important;}
#screen-wordbank .word-meta p,
#screen-wordbank .word-example,
#screen-wordbank .word-example-lines{color:#42546a !important;}
#screen-wordbank .word-pair.it{background:linear-gradient(135deg,#eefdf3 0%,#ffffff 100%) !important;border:1px solid #c0e7cd !important;color:#195431 !important;}
#screen-wordbank .word-pair.en{background:linear-gradient(135deg,#eef5ff 0%,#ffffff 100%) !important;border:1px solid #c8dbff !important;color:#1d4f9c !important;}
#screen-wordbank .word-example{
  background:rgba(255,255,255,.45) !important;
  border:1px dashed #d7e3f4 !important;
  border-radius:18px !important;
  padding:12px 14px !important;
}
body[data-theme="dark"] #screen-wordbank .panel{
  background:linear-gradient(180deg,#08182d 0%,#081628 100%) !important;
  border-color:#234365 !important;
}
body[data-theme="dark"] #screen-wordbank .word-card:nth-child(4n+1){background:linear-gradient(135deg,#173827 0%,#0d2139 100%) !important;border-color:#2e6b44 !important;}
body[data-theme="dark"] #screen-wordbank .word-card:nth-child(4n+2){background:linear-gradient(135deg,#12335d 0%,#0d2139 100%) !important;border-color:#355f9f !important;}
body[data-theme="dark"] #screen-wordbank .word-card:nth-child(4n+3){background:linear-gradient(135deg,#32214f 0%,#0d2139 100%) !important;border-color:#6d49aa !important;}
body[data-theme="dark"] #screen-wordbank .word-card:nth-child(4n+4){background:linear-gradient(135deg,#4a3014 0%,#0d2139 100%) !important;border-color:#a96d22 !important;}
body[data-theme="dark"] #screen-wordbank .word-meta h3,
body[data-theme="dark"] #screen-wordbank .word-meta p,
body[data-theme="dark"] #screen-wordbank .word-example,
body[data-theme="dark"] #screen-wordbank .word-example-lines{
  color:#eef4ff !important;
}
body[data-theme="dark"] #screen-wordbank .word-pair.it{background:linear-gradient(135deg,#143222 0%,rgba(255,255,255,.02) 100%) !important;border-color:#356d48 !important;color:#dfffea !important;}
body[data-theme="dark"] #screen-wordbank .word-pair.en{background:linear-gradient(135deg,#14335d 0%,rgba(255,255,255,.02) 100%) !important;border-color:#4069a9 !important;color:#dfeeff !important;}
body[data-theme="dark"] #screen-wordbank .word-example{
  background:rgba(255,255,255,.04) !important;
  border-color:#28496d !important;
}


/* v66 desktop auth stray square fix + colorful wordbank tabs */
.topbar > .topbar-actions.topbar-actions-clean.topbar-actions-premium:empty,
.topbar-premium > .topbar-actions.topbar-actions-clean.topbar-actions-premium:empty{
  display:none !important;
  width:0 !important;
  min-width:0 !important;
  max-width:0 !important;
  height:0 !important;
  min-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  box-shadow:none !important;
  overflow:hidden !important;
  flex:0 0 0 !important;
}

#screen-wordbank #wordTabs{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:12px !important;
}
#screen-wordbank #wordTabs .tab-btn{
  min-height:58px !important;
  padding:14px 22px !important;
  border-radius:20px !important;
  font-size:15px !important;
  font-weight:900 !important;
  letter-spacing:-.01em !important;
  box-shadow:0 12px 22px rgba(31,55,100,.08) !important;
  border-width:1px !important;
}
#screen-wordbank #wordTabs .tab-btn:nth-child(5n+1){
  background:linear-gradient(135deg,#eefdf3 0%,#ffffff 100%) !important;
  border-color:#bfe8cf !important;
  color:#195431 !important;
}
#screen-wordbank #wordTabs .tab-btn:nth-child(5n+2){
  background:linear-gradient(135deg,#eef5ff 0%,#ffffff 100%) !important;
  border-color:#c8dbff !important;
  color:#1d4f9c !important;
}
#screen-wordbank #wordTabs .tab-btn:nth-child(5n+3){
  background:linear-gradient(135deg,#f7efff 0%,#ffffff 100%) !important;
  border-color:#dbc9fb !important;
  color:#6b38c4 !important;
}
#screen-wordbank #wordTabs .tab-btn:nth-child(5n+4){
  background:linear-gradient(135deg,#fff4ea 0%,#ffffff 100%) !important;
  border-color:#f5d0a6 !important;
  color:#b56216 !important;
}
#screen-wordbank #wordTabs .tab-btn:nth-child(5n+5){
  background:linear-gradient(135deg,#fff1f2 0%,#ffffff 100%) !important;
  border-color:#f6c0c7 !important;
  color:#c23648 !important;
}
#screen-wordbank #wordTabs .tab-btn:hover{
  transform:translateY(-2px) !important;
  box-shadow:0 16px 28px rgba(31,55,100,.12) !important;
}
#screen-wordbank #wordTabs .tab-btn.active{
  color:#ffffff !important;
  border-color:transparent !important;
  box-shadow:0 16px 30px rgba(31,55,100,.16) !important;
}
#screen-wordbank #wordTabs .tab-btn.active:nth-child(5n+1){background:linear-gradient(135deg,#22c55e,#15803d) !important;}
#screen-wordbank #wordTabs .tab-btn.active:nth-child(5n+2){background:linear-gradient(135deg,#60a5fa,#2563eb) !important;}
#screen-wordbank #wordTabs .tab-btn.active:nth-child(5n+3){background:linear-gradient(135deg,#a78bfa,#7c3aed) !important;}
#screen-wordbank #wordTabs .tab-btn.active:nth-child(5n+4){background:linear-gradient(135deg,#fb923c,#ea580c) !important;}
#screen-wordbank #wordTabs .tab-btn.active:nth-child(5n+5){background:linear-gradient(135deg,#fb7185,#e11d48) !important;}

body[data-theme="dark"] #screen-wordbank #wordTabs .tab-btn{
  box-shadow:0 14px 26px rgba(0,0,0,.20) !important;
}
body[data-theme="dark"] #screen-wordbank #wordTabs .tab-btn:nth-child(5n+1){
  background:linear-gradient(135deg,#173827 0%,#0d2139 100%) !important;
  border-color:#2e6b44 !important;
  color:#c9f5d6 !important;
}
body[data-theme="dark"] #screen-wordbank #wordTabs .tab-btn:nth-child(5n+2){
  background:linear-gradient(135deg,#12335d 0%,#0d2139 100%) !important;
  border-color:#355f9f !important;
  color:#dbeafe !important;
}
body[data-theme="dark"] #screen-wordbank #wordTabs .tab-btn:nth-child(5n+3){
  background:linear-gradient(135deg,#32214f 0%,#0d2139 100%) !important;
  border-color:#6d49aa !important;
  color:#eadcff !important;
}
body[data-theme="dark"] #screen-wordbank #wordTabs .tab-btn:nth-child(5n+4){
  background:linear-gradient(135deg,#4a3014 0%,#0d2139 100%) !important;
  border-color:#a96d22 !important;
  color:#ffe0bc !important;
}
body[data-theme="dark"] #screen-wordbank #wordTabs .tab-btn:nth-child(5n+5){
  background:linear-gradient(135deg,#4b1d26 0%,#0d2139 100%) !important;
  border-color:#a94d64 !important;
  color:#ffd4dc !important;
}
body[data-theme="dark"] #screen-wordbank #wordTabs .tab-btn.active{
  color:#ffffff !important;
  border-color:transparent !important;
  box-shadow:0 16px 32px rgba(0,0,0,.26) !important;
}
body[data-theme="dark"] #screen-wordbank #wordTabs .tab-btn.active:nth-child(5n+1){background:linear-gradient(135deg,#1fa54d,#15803d) !important;}
body[data-theme="dark"] #screen-wordbank #wordTabs .tab-btn.active:nth-child(5n+2){background:linear-gradient(135deg,#3b82f6,#1d4ed8) !important;}
body[data-theme="dark"] #screen-wordbank #wordTabs .tab-btn.active:nth-child(5n+3){background:linear-gradient(135deg,#8b5cf6,#6d28d9) !important;}
body[data-theme="dark"] #screen-wordbank #wordTabs .tab-btn.active:nth-child(5n+4){background:linear-gradient(135deg,#f59e0b,#ea580c) !important;}
body[data-theme="dark"] #screen-wordbank #wordTabs .tab-btn.active:nth-child(5n+5){background:linear-gradient(135deg,#f43f5e,#be123c) !important;}

@media (max-width:900px){
  #screen-wordbank #wordTabs{
    flex-wrap:nowrap !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    padding-bottom:6px !important;
    scroll-snap-type:x proximity !important;
  }
  #screen-wordbank #wordTabs .tab-btn{
    flex:0 0 auto !important;
    min-height:52px !important;
    padding:12px 18px !important;
    border-radius:18px !important;
    scroll-snap-align:start !important;
    white-space:nowrap !important;
  }
}


/* v67 word bank mobile swipe snap */
@media (max-width:900px){
  #screen-wordbank #wordTabs{
    display:flex !important;
    flex-wrap:nowrap !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    gap:10px !important;
    padding:2px 2px 8px !important;
    scroll-snap-type:x mandatory !important;
    scroll-padding-inline:2px !important;
    scroll-behavior:smooth !important;
    -webkit-overflow-scrolling:touch !important;
  }
  #screen-wordbank #wordTabs .tab-btn{
    flex:0 0 calc(100% - 4px) !important;
    width:calc(100% - 4px) !important;
    min-width:calc(100% - 4px) !important;
    max-width:calc(100% - 4px) !important;
    min-height:58px !important;
    justify-content:flex-start !important;
    text-align:left !important;
    scroll-snap-align:start !important;
    scroll-snap-stop:always !important;
    white-space:nowrap !important;
    padding:14px 18px !important;
  }
  #screen-wordbank .tabs + .pager,
  #screen-wordbank #wordTabs + .pager{
    margin-top:8px !important;
  }
}


/* v70 grammar playing text small play button */
#screen-grammar .grammar-audio-head{
  align-items:flex-start !important;
}
#screen-grammar .grammar-audio-actions{
  margin-left:auto !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:flex-end !important;
  gap:8px !important;
}
#screen-grammar .grammar-current-play-btn{
  min-height:36px !important;
  padding:8px 12px !important;
  border-radius:14px !important;
  font-size:13px !important;
  line-height:1 !important;
}
body[data-theme="dark"] #screen-grammar .grammar-current-play-btn{
  color:#eef4ff !important;
}
@media (max-width:700px){
  #screen-grammar .grammar-audio-head{
    flex-direction:column !important;
    align-items:stretch !important;
    gap:10px !important;
  }
  #screen-grammar .grammar-audio-actions{
    width:100% !important;
    align-items:stretch !important;
  }
  #screen-grammar .grammar-current-play-btn,
  #screen-grammar .grammar-refresh-btn{
    width:100% !important;
    justify-content:center !important;
  }
}


/* v71 grammar mobile layout fix: remove blank side, summary swipe cards */
@media (max-width: 900px){
  html, body{
    overflow-x:hidden !important;
  }
  #screen-grammar,
  #screen-grammar .panel,
  #screen-grammar .grammar-main-panel,
  #screen-grammar .grammar-layout-v2,
  #screen-grammar .grammar-detail-body,
  #screen-grammar .overview-main-card,
  #screen-grammar .overview-side-stack,
  #screen-grammar .side-table-card,
  #screen-grammar .learn-card,
  #screen-grammar .grammar-section-card,
  #screen-grammar .quick-tip-box,
  #screen-grammar .grammar-audio-now,
  #screen-grammar .grammar-quick-check-card{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }
  #screen-grammar .grammar-layout-v2,
  #screen-grammar .grammar-detail-body,
  #screen-grammar .grammar-detail-body.tab-overview,
  #screen-grammar .grammar-detail-body.tab-pattern,
  #screen-grammar .grammar-detail-body.tab-examples,
  #screen-grammar .grammar-detail-body.tab-practice,
  #screen-grammar .grammar-detail-body.tab-exercises{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:14px !important;
    overflow:visible !important;
  }
  #screen-grammar .grammar-detail-body > *,
  #screen-grammar .grammar-detail-body.tab-overview > *,
  #screen-grammar .overview-side-stack > *{
    grid-column:1 / -1 !important;
    min-width:0 !important;
  }
  #screen-grammar .grammar-summary-strip{
    display:flex !important;
    flex-wrap:nowrap !important;
    gap:10px !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    padding:2px 2px 8px !important;
    margin:0 0 4px !important;
    scroll-snap-type:x mandatory !important;
    scroll-padding-inline:2px !important;
    -webkit-overflow-scrolling:touch !important;
  }
  #screen-grammar .grammar-summary-strip::-webkit-scrollbar{display:none !important;}
  #screen-grammar .grammar-mini-box{
    flex:0 0 calc(100% - 4px) !important;
    width:calc(100% - 4px) !important;
    min-width:calc(100% - 4px) !important;
    max-width:calc(100% - 4px) !important;
    min-height:84px !important;
    scroll-snap-align:start !important;
    scroll-snap-stop:always !important;
    padding:16px 18px !important;
    border-radius:22px !important;
  }
  #screen-grammar .grammar-mini-box span{
    font-size:11px !important;
  }
  #screen-grammar .grammar-mini-box strong{
    font-size:18px !important;
    line-height:1.15 !important;
    overflow-wrap:anywhere !important;
  }
  #screen-grammar .overview-feature-grid,
  #screen-grammar .grammar-examples-grid,
  #screen-grammar .grammar-points.compact,
  #screen-grammar .practice-boxes,
  #screen-grammar .grammar-practice-checklist{
    grid-template-columns:minmax(0,1fr) !important;
  }
  #screen-grammar .overview-table-wrap{
    overflow-x:auto !important;
    max-width:100% !important;
  }
  #screen-grammar .overview-table{
    min-width:560px !important;
  }
  #screen-grammar .grammar-audio-head{
    flex-direction:column !important;
    align-items:stretch !important;
    gap:10px !important;
  }
  #screen-grammar .grammar-audio-actions{
    width:100% !important;
    align-items:stretch !important;
  }
  #screen-grammar .grammar-refresh-btn,
  #screen-grammar .grammar-current-play-btn{
    width:100% !important;
    justify-content:center !important;
  }
  #screen-grammar .grammar-audio-line{
    display:grid !important;
    grid-template-columns:auto minmax(0,1fr) !important;
    align-items:start !important;
    gap:10px !important;
  }
  #screen-grammar .grammar-audio-line strong,
  #screen-grammar .grammar-audio-line span{
    min-width:0 !important;
    overflow-wrap:anywhere !important;
    word-break:normal !important;
  }
}
@media (max-width: 520px){
  #screen-grammar .grammar-main-panel{
    padding:12px !important;
  }
  #screen-grammar .grammar-section-card,
  #screen-grammar .quick-tip-box,
  #screen-grammar .grammar-audio-now,
  #screen-grammar .grammar-quick-check-card,
  #screen-grammar .side-table-card,
  #screen-grammar .learn-card{
    padding:16px !important;
    border-radius:22px !important;
  }
  #screen-grammar .grammar-audio-line{
    grid-template-columns:24px minmax(0,1fr) !important;
  }
  #screen-grammar .grammar-audio-line strong,
  #screen-grammar .grammar-audio-line span{
    font-size:14px !important;
    line-height:1.6 !important;
  }
}


/* v72 grammar playing-text spacing desktop + horizontal text mobile */
#screen-grammar .grammar-audio-head{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:10px !important;
  flex-wrap:wrap !important;
  margin-bottom:8px !important;
}
#screen-grammar .grammar-audio-actions{
  margin-left:auto !important;
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  gap:8px !important;
}
#screen-grammar .grammar-audio-actions .mini-sound-btn{
  margin:0 !important;
}
#screen-grammar #grammarAudioNowText{
  margin-top:0 !important;
}
#screen-grammar .grammar-audio-line{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  flex-wrap:nowrap !important;
}
#screen-grammar .grammar-audio-line > .flag-badge{
  flex:0 0 auto !important;
}
#screen-grammar .grammar-audio-line > span:not(.flag-badge):first-of-type,
#screen-grammar .grammar-audio-line > .flag-badge + span{
  flex:0 0 auto !important;
  white-space:nowrap !important;
  font-weight:800 !important;
}
#screen-grammar .grammar-audio-line > strong,
#screen-grammar .grammar-audio-line > span:last-child{
  flex:1 1 auto !important;
  min-width:0 !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
}

@media (max-width:900px){
  #screen-grammar .grammar-audio-head{
    align-items:stretch !important;
    gap:9px !important;
  }
  #screen-grammar .grammar-audio-actions{
    width:100% !important;
    margin-left:0 !important;
    justify-content:flex-start !important;
    flex-wrap:wrap !important;
  }
  #screen-grammar .grammar-refresh-btn,
  #screen-grammar .grammar-current-play-btn{
    flex:1 1 160px !important;
    width:auto !important;
  }
  #screen-grammar .grammar-audio-line{
    display:flex !important;
    align-items:flex-start !important;
    gap:8px !important;
    flex-wrap:wrap !important;
  }
  #screen-grammar .grammar-audio-line > .flag-badge + span{
    flex:0 0 auto !important;
    white-space:nowrap !important;
  }
  #screen-grammar .grammar-audio-line > strong,
  #screen-grammar .grammar-audio-line > span:last-child{
    flex:1 1 180px !important;
    min-width:0 !important;
  }
}
@media (max-width:520px){
  #screen-grammar .grammar-audio-actions{
    flex-direction:column !important;
    align-items:stretch !important;
  }
  #screen-grammar .grammar-refresh-btn,
  #screen-grammar .grammar-current-play-btn{
    width:100% !important;
    flex:1 1 auto !important;
  }
  #screen-grammar .grammar-audio-line{
    gap:8px !important;
  }
  #screen-grammar .grammar-audio-line > strong,
  #screen-grammar .grammar-audio-line > span:last-child{
    flex:1 1 160px !important;
  }
}


/* v73 colorful unique grammar playing-text box (light + dark) */
#screen-grammar .grammar-audio-now{
  position:relative !important;
  overflow:hidden !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(79,130,255,.16), transparent 28%),
    radial-gradient(circle at 100% 18%, rgba(168,85,247,.12), transparent 24%),
    radial-gradient(circle at 82% 100%, rgba(34,197,94,.10), transparent 22%),
    linear-gradient(135deg,#eef6ff 0%, #f8f3ff 48%, #eefdf6 100%) !important;
  border:1px solid #cfe0f7 !important;
  border-radius:26px !important;
  box-shadow:0 18px 34px rgba(31,55,100,.10), inset 0 1px 0 rgba(255,255,255,.85) !important;
}
#screen-grammar .grammar-audio-now::before{
  content:"";
  position:absolute;
  inset:auto -18px -26px auto;
  width:118px;
  height:118px;
  border-radius:999px;
  background:linear-gradient(135deg, rgba(79,130,255,.10), rgba(168,85,247,.08));
  pointer-events:none;
}
#screen-grammar .grammar-audio-now::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(255,255,255,.22), transparent 46%);
  pointer-events:none;
}
#screen-grammar .grammar-audio-head,
#screen-grammar #grammarAudioNowText{
  position:relative;
  z-index:1;
}
#screen-grammar .grammar-audio-head > strong{
  display:inline-flex !important;
  align-items:center !important;
  gap:8px !important;
  padding:8px 12px !important;
  border-radius:999px !important;
  background:rgba(255,255,255,.52) !important;
  color:#17355d !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8) !important;
}
#screen-grammar .grammar-audio-actions .mini-sound-btn{
  border:1px solid #d8e5f8 !important;
  background:rgba(255,255,255,.48) !important;
  color:#295bd0 !important;
  box-shadow:0 10px 20px rgba(31,55,100,.08), inset 0 1px 0 rgba(255,255,255,.85) !important;
}
#screen-grammar .grammar-audio-actions .mini-sound-btn:hover{
  transform:translateY(-1px);
}
#screen-grammar .grammar-audio-line strong,
#screen-grammar .grammar-audio-line span:last-child{
  color:#17355d !important;
}
#screen-grammar .grammar-audio-line > .flag-badge + span{
  color:#5a6d86 !important;
}

body[data-theme="dark"] #screen-grammar .grammar-audio-now{
  background:
    radial-gradient(circle at 0% 0%, rgba(79,130,255,.18), transparent 28%),
    radial-gradient(circle at 100% 18%, rgba(168,85,247,.15), transparent 24%),
    radial-gradient(circle at 82% 100%, rgba(34,197,94,.10), transparent 22%),
    linear-gradient(135deg,#112746 0%, #27173e 48%, #123325 100%) !important;
  border-color:#315987 !important;
  box-shadow:0 20px 38px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.05) !important;
}
body[data-theme="dark"] #screen-grammar .grammar-audio-now::before{
  background:linear-gradient(135deg, rgba(79,130,255,.16), rgba(168,85,247,.12));
}
body[data-theme="dark"] #screen-grammar .grammar-audio-head > strong{
  background:rgba(255,255,255,.08) !important;
  color:#eef4ff !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06) !important;
}
body[data-theme="dark"] #screen-grammar .grammar-audio-actions .mini-sound-btn{
  background:rgba(255,255,255,.08) !important;
  border-color:rgba(255,255,255,.12) !important;
  color:#dbe9ff !important;
  box-shadow:0 10px 20px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.04) !important;
}
body[data-theme="dark"] #screen-grammar .grammar-audio-line strong,
body[data-theme="dark"] #screen-grammar .grammar-audio-line span:last-child{
  color:#f4f8ff !important;
}
body[data-theme="dark"] #screen-grammar .grammar-audio-line > .flag-badge + span{
  color:#b9cae3 !important;
}


/* v74 grammar playing-text play button blue default + green/red active */
#screen-grammar .grammar-current-play-btn{
  background:linear-gradient(135deg,#4f82ff 0%, #2f63e0 100%) !important;
  border:1px solid #2f63e0 !important;
  color:#ffffff !important;
  box-shadow:0 10px 22px rgba(47,99,224,.24) !important;
  transition:transform .18s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease !important;
}
#screen-grammar .grammar-current-play-btn:hover{
  background:linear-gradient(135deg,#5b8dff 0%, #3d72ee 100%) !important;
  box-shadow:0 14px 26px rgba(47,99,224,.30) !important;
}
#screen-grammar .grammar-current-play-btn.audio-active,
#screen-grammar .grammar-current-play-btn.is-speaking,
#screen-grammar .grammar-current-play-btn[aria-pressed="true"]{
  background:linear-gradient(135deg,#35c56a 0%, #17934a 100%) !important;
  border-color:#17934a !important;
  color:#ffffff !important;
  box-shadow:0 0 0 6px rgba(53,197,106,.15), 0 16px 28px rgba(23,147,74,.26) !important;
  animation:grammarPlayPulseLight 1.2s ease-in-out infinite !important;
}
#screen-grammar .grammar-current-play-btn.audio-active::after,
#screen-grammar .grammar-current-play-btn.is-speaking::after,
#screen-grammar .grammar-current-play-btn[aria-pressed="true"]::after{
  content:"";
  position:absolute;
  inset:-6px;
  border-radius:18px;
  border:2px solid rgba(53,197,106,.28);
  animation:grammarPlayRingLight 1.15s ease-out infinite;
  pointer-events:none;
}
@keyframes grammarPlayPulseLight{
  0%,100%{transform:translateY(0) scale(1);}
  50%{transform:translateY(-1px) scale(1.03);}
}
@keyframes grammarPlayRingLight{
  0%{opacity:.8; transform:scale(.96);}
  100%{opacity:0; transform:scale(1.12);}
}
body[data-theme="dark"] #screen-grammar .grammar-current-play-btn{
  background:linear-gradient(135deg,#4f82ff 0%, #2f63e0 100%) !important;
  border-color:#3d72ee !important;
  color:#ffffff !important;
  box-shadow:0 10px 22px rgba(47,99,224,.30) !important;
}
body[data-theme="dark"] #screen-grammar .grammar-current-play-btn:hover{
  background:linear-gradient(135deg,#6797ff 0%, #4175f0 100%) !important;
}
body[data-theme="dark"] #screen-grammar .grammar-current-play-btn.audio-active,
body[data-theme="dark"] #screen-grammar .grammar-current-play-btn.is-speaking,
body[data-theme="dark"] #screen-grammar .grammar-current-play-btn[aria-pressed="true"]{
  background:linear-gradient(135deg,#ff5c68 0%, #d92f3f 100%) !important;
  border-color:#d92f3f !important;
  color:#ffffff !important;
  box-shadow:0 0 0 6px rgba(255,92,104,.15), 0 16px 28px rgba(217,47,63,.28) !important;
  animation:grammarPlayPulseDark 1.2s ease-in-out infinite !important;
}
body[data-theme="dark"] #screen-grammar .grammar-current-play-btn.audio-active::after,
body[data-theme="dark"] #screen-grammar .grammar-current-play-btn.is-speaking::after,
body[data-theme="dark"] #screen-grammar .grammar-current-play-btn[aria-pressed="true"]::after{
  border-color:rgba(255,92,104,.30) !important;
  animation:grammarPlayRingDark 1.15s ease-out infinite !important;
}
@keyframes grammarPlayPulseDark{
  0%,100%{transform:translateY(0) scale(1);}
  50%{transform:translateY(-1px) scale(1.03);}
}
@keyframes grammarPlayRingDark{
  0%{opacity:.85; transform:scale(.96);}
  100%{opacity:0; transform:scale(1.12);}
}
