﻿/* The Thinh Factor's Hub — design tokens + components
   Light is default; dark follows the OS unless the user picks a theme. */
:root {
  --bg: #F5F6FB;
  --surface: #FFFFFF;
  --surface-2: #EEF0F8;
  --text: #1B1F33;
  --muted: #5F6680;
  --border: #E1E4EF;
  --primary: #5552D9;
  --primary-ink: #FFFFFF;
  --primary-soft: #ECEBFD;
  --accent: #FF7A59;
  --accent-soft: #FFEDE7;
  --success: #0F9D72;
  --success-soft: #DFF6EE;
  --warn: #B7791F;
  --warn-soft: #FFF4D6;
  --danger: #D93F45;
  --danger-soft: #FDE9EA;
  --info: #1F74C8;
  --info-soft: #E2F0FC;
  --grammar-soft: #FCE7F2;
  --listening: #2389DB;
  --reading: #0F9D72;
  --writing: #7C4DEB;
  --speaking: #F06A45;
  --vocabulary: #C98A0C;
  --grammar: #D63E8C;
  --mark: #FFE58A;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 50, .05), 0 6px 18px rgba(20, 24, 50, .06);
  --font: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1220; --surface: #171B2C; --surface-2: #20253A; --text: #E7E9F4; --muted: #9AA1BE;
    --border: #2B3150; --primary: #8B89F6; --primary-ink: #11132A; --primary-soft: #262957;
    --accent: #FF9373; --accent-soft: #3A2620; --success: #3FCB9C; --success-soft: #16352B;
    --warn: #F0BE55; --warn-soft: #3A3018; --danger: #FF7A7F; --danger-soft: #3D1E22; --info: #5AAEF0; --info-soft: #182E45; --grammar-soft: #3A1D2E;
    --listening: #5AAEF0; --reading: #3FCB9C; --writing: #A889F7; --speaking: #FF9373;
    --vocabulary: #F0BE55; --grammar: #F27AB8; --mark: #6B5A12;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1220; --surface: #171B2C; --surface-2: #20253A; --text: #E7E9F4; --muted: #9AA1BE;
  --border: #2B3150; --primary: #8B89F6; --primary-ink: #11132A; --primary-soft: #262957;
  --accent: #FF9373; --accent-soft: #3A2620; --success: #3FCB9C; --success-soft: #16352B;
  --warn: #F0BE55; --warn-soft: #3A3018; --danger: #FF7A7F; --danger-soft: #3D1E22; --info: #5AAEF0; --info-soft: #182E45; --grammar-soft: #3A1D2E;
  --listening: #5AAEF0; --reading: #3FCB9C; --writing: #A889F7; --speaking: #FF9373;
  --vocabulary: #F0BE55; --grammar: #F27AB8; --mark: #6B5A12;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  color-scheme: dark;
}
/* Styles (playful, comic, notebook, pixel, neon, calm, glass) are in styles-look.css */

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--primary); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 .8em; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
/* 16px inputs stop iOS Safari from zooming on focus */
input, select, textarea { font-size: 16px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grow { flex: 1; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px;
  background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 800; line-height: 1.15; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 800; font-size: 1.05rem;
}
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .75rem; }
/* Student profile picture (initials until a photo is uploaded) */
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; overflow: hidden; text-decoration: none;
  background: linear-gradient(135deg, var(--primary), var(--accent)) center / cover no-repeat; color: #fff; font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); }
.avatar.has-photo { color: transparent; background-size: cover; background-position: center; }
.avatar.xl { width: 88px; height: 88px; font-size: 1.8rem; }
.topbar .avatar.brand-mini { width: 34px; height: 34px; font-size: .8rem; box-shadow: 0 0 0 2px var(--primary); }
.me-brand { color: var(--text); text-decoration: none; border-radius: 14px; padding: 8px 8px 16px; }
.me-brand:hover { background: var(--surface-2); }
.me-brand .me-name { display: block; font-size: 1.12rem; font-weight: 800; overflow-wrap: anywhere; }
.avatar-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.crop-frame.round { border-radius: 50%; margin-inline: auto; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-weight: 500;
}
.nav-link:hover { background: var(--surface-2); }
.nav-link.active { background: var(--primary); color: var(--primary-ink); font-weight: 700; box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 35%, transparent); }
.nav-link .ico { width: 22px; text-align: center; }
.nav-sep { margin: 12px 12px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 10px 24px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .title { font-weight: 700; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .brand-mini { display: none; }
.content { padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; flex: 1; }
.content.wide { max-width: 1500px; }
.bottom-nav { display: none; }
.demo-banner { background: var(--warn-soft); color: var(--warn); padding: 6px 24px; font-size: .82rem; font-weight: 600; text-align: center; }

@media (max-width: 899px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar .brand-mini { display: grid; }
  .content { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface);
    border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
    font-size: .68rem; color: var(--muted); text-decoration: none; font-weight: 600;
  }
  .bottom-nav a .ico { font-size: 1.2rem; }
  .bottom-nav a.active { color: var(--primary); }
  h1 { font-size: 1.35rem; }
}

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.tight { padding: 12px 14px; }
.card + .card { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
/* auto-fit: items share the full row instead of leaving empty columns */
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid > .card + .card { margin-top: 0; }
@media (max-width: 560px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid.cols-4 .card { padding: 12px 14px; }
  .stat .v { font-size: 1.3rem; }
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; min-height: 40px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  font-weight: 600; text-decoration: none; color: var(--text); white-space: nowrap; touch-action: manipulation;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.accent { background: var(--accent); color: #fff; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: .85rem; }
.btn.icon { padding: 6px; min-width: 40px; }
.btn.block { width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem;
  font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill.listening { background: color-mix(in srgb, var(--listening) 15%, transparent); color: var(--listening); }
.pill.reading { background: color-mix(in srgb, var(--reading) 15%, transparent); color: var(--reading); }
.pill.writing { background: color-mix(in srgb, var(--writing) 15%, transparent); color: var(--writing); }
.pill.speaking { background: color-mix(in srgb, var(--speaking) 15%, transparent); color: var(--speaking); }
.pill.vocabulary { background: color-mix(in srgb, var(--vocabulary) 15%, transparent); color: var(--vocabulary); }
.pill.grammar { background: color-mix(in srgb, var(--grammar) 15%, transparent); color: var(--grammar); }
.pill.ok { background: var(--success-soft); color: var(--success); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--primary-soft); color: var(--primary); }

.skill-bar { width: 4px; border-radius: 4px; align-self: stretch; flex: none; }
.task-card { display: flex; gap: 12px; text-decoration: none; color: inherit; }
.task-card:hover { border-color: var(--primary); }
.task-card .body { flex: 1; min-width: 0; }
.task-card h3 { margin: 4px 0 2px; }

label.field { display: block; }
label.field > span { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); min-height: 42px;
}
.input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
textarea.input { min-height: 90px; resize: vertical; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stat .l { font-size: .8rem; color: var(--muted); font-weight: 600; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabs a, .tabs button {
  padding: 10px 14px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap;
}
.tabs .active { color: var(--primary); border-bottom-color: var(--primary); }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.tbl th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.sticky, .tbl th.sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tbl th.sticky { background: var(--surface-2); z-index: 2; }
.cell { display: inline-block; min-width: 54px; text-align: center; padding: 3px 6px; border-radius: 8px; font-weight: 600; font-size: .82rem; }
.cell.done { background: var(--success-soft); color: var(--success); }
.cell.late { background: var(--warn-soft); color: var(--warn); }
.cell.over { background: var(--danger-soft); color: var(--danger); }
.cell.wait { background: var(--primary-soft); color: var(--primary); }
.cell.none { color: var(--muted); }

/* ---------- Section colours ----------
   One colour per kind of information, used the same way everywhere:
   red = overdue · amber = to do / due soon · violet = waiting for review
   blue = recent activity · green = classes, done · pink = practice · gold = XP & rankings */
.tone-red    { --tone: var(--danger);  --tone-soft: var(--danger-soft); }
.tone-amber  { --tone: var(--warn);    --tone-soft: var(--warn-soft); }
.tone-violet { --tone: var(--primary); --tone-soft: var(--primary-soft); }
.tone-blue   { --tone: var(--info);    --tone-soft: var(--info-soft); }
.tone-green  { --tone: var(--success); --tone-soft: var(--success-soft); }
.tone-pink   { --tone: var(--grammar); --tone-soft: var(--grammar-soft); }
.tone-gold   { --tone: var(--vocabulary); --tone-soft: var(--warn-soft); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border-top: 4px solid var(--tone, var(--border)); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: color-mix(in srgb, var(--tone-soft, var(--surface-2)) 70%, var(--surface)); border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 1rem; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.panel-head .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--tone); font-size: 1rem; flex: none; }
.panel-head .count { min-width: 26px; padding: 1px 9px; border-radius: 99px; background: var(--tone); color: var(--surface); font-size: .78rem; font-weight: 800; text-align: center; }
.panel-head a { font-size: .85rem; font-weight: 600; color: var(--tone); text-decoration: none; white-space: nowrap; }
.panel-head a:hover { text-decoration: underline; }
.panel-body { padding: 4px 16px 12px; }
.panel-body.pad { padding: 14px 16px 16px; }
.panel-body.flush { padding: 0; }
.panel-body.flush .tbl th { background: var(--surface); }
.panel-empty { padding: 18px 4px; text-align: center; color: var(--muted); font-size: .9rem; }
.panel-foot { padding: 8px 16px 12px; font-size: .8rem; color: var(--muted); }

/* Compact rows inside panels */
.lrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.lrow:last-child { border-bottom: 0; }
a.lrow:hover .lrow-title { color: var(--primary); }
.lrow-mark { width: 4px; align-self: stretch; border-radius: 4px; flex: none; background: var(--tone, var(--border)); }
.lrow-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; font-size: .85rem; background: var(--tone-soft, var(--surface-2)); color: var(--tone, var(--muted)); }
.lrow-main { flex: 1; min-width: 0; }
.lrow-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: .8rem; }

/* Stat tiles */
.stat-tile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: inherit; border-left: 4px solid var(--tone); }
a.stat-tile:hover { border-color: var(--tone); }
.stat-tile .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: var(--tone-soft); flex: none; }
.stat-tile .v { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--tone); letter-spacing: -.02em; }
.stat-tile .l { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }

/* Two-column page body: main + side */
.dash { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 1099px) { .dash { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-tile { padding: 10px 12px; gap: 10px; }
  .stat-tile .ico { width: 34px; height: 34px; font-size: 1rem; }
  .stat-tile .v { font-size: 1.2rem; }
  .panel-head, .panel-body { padding-left: 12px; padding-right: 12px; }
}

/* Class cards: coloured by level */
.class-card { display: block; text-decoration: none; color: inherit; border-top: 4px solid var(--tone); padding: 14px 16px; }
.class-card:hover { border-color: var(--tone); }
.class-card .progress > i { background: var(--tone); }
.pill.tone { background: var(--tone-soft); color: var(--tone); }
.filters > summary { list-style: none; display: none; margin-bottom: 10px; }
.filters > summary::-webkit-details-marker { display: none; }
@media (max-width: 560px) { .filters > summary { display: inline-flex; } .filter-bar { grid-template-columns: 1fr 1fr; } }
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.filter-bar .input { min-height: 38px; padding: 7px 10px; font-size: .9rem; }
.stack > .panel + .panel { margin-top: 18px; }
/* Weekly leaderboard podium */
.board + .board { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border); }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.board-head b { color: var(--text); }
.board-title { text-align: center; margin: 10px 0 4px; font-weight: 900; font-size: 1.2rem; letter-spacing: .02em;
  background: linear-gradient(90deg, #B8860B, #FFD54F, #B8860B); -webkit-background-clip: text; background-clip: text; color: transparent; }
.champ { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; max-width: 340px; margin: 6px auto 16px; padding: 10px 10px 0; }
.champ .pod-av { width: 120px; height: 120px; font-size: 2.4rem; background: linear-gradient(135deg, #FFE082, #FFB300 55%, #F57F17); position: relative;
  box-shadow: 0 0 0 6px #FFF8E1, 0 0 0 10px #FFC107, 0 14px 40px rgba(255, 179, 0, .6); animation: champ 2.6s ease-in-out infinite; text-shadow: 0 2px 4px rgba(0,0,0,.25); }
@keyframes champ { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1.04); } }
.champ::before { content: ""; position: absolute; top: 20px; left: 50%; width: 220px; height: 220px; transform: translateX(-50%); border-radius: 50%; z-index: -1;
  background: repeating-conic-gradient(from 0deg, rgba(255, 213, 79, .28) 0 12deg, transparent 12deg 24deg); animation: rays 14s linear infinite; }
@keyframes rays { to { transform: translateX(-50%) rotate(360deg); } }
.champ .crown { font-size: 2.8rem; line-height: 1; margin-bottom: -12px; position: relative; z-index: 2; animation: bob 2.6s ease-in-out infinite; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.champ .spark { position: absolute; font-size: 1.2rem; animation: twinkle 1.8s ease-in-out infinite; }
.champ .s1 { top: 22%; left: 10%; } .champ .s2 { top: 6%; right: 14%; animation-delay: .6s; } .champ .s3 { top: 52%; right: 6%; animation-delay: 1.1s; } .champ .s4 { top: 60%; left: 4%; animation-delay: 1.5s; }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.2); } }
.champ-name { font-weight: 900; font-size: 1.45rem; margin-top: 8px; }
.champ.me .champ-name { color: var(--primary); }
.champ-xp { color: #B8860B; font-weight: 800; }
.champ-step { width: 100%; height: 70px; margin-top: 8px; display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; color: #7A4F00;
  border-radius: 14px 14px 4px 4px; background: linear-gradient(180deg, #FFD54F, #FFA000); box-shadow: inset 0 -6px 0 rgba(0,0,0,.12); }
.my-rank { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--primary-soft); border: 2px solid var(--primary); }
.my-rank.lead { background: linear-gradient(90deg, #FFF3C4, #FFE082); border-color: #FFB300; color: #3E2C00; }
.mr-num { font-size: 1.9rem; font-weight: 900; color: var(--primary); line-height: 1; }
.my-rank.lead .mr-num { color: #B8860B; }
.mr-num small { font-size: .8rem; color: var(--muted); font-weight: 700; margin-left: 2px; }
.board-rest { margin-top: 10px; }
.board-row { display: flex; gap: 10px; margin: 2px 0; padding: 6px 10px; border-radius: 8px; font-size: .9rem; }
.board-row span:first-child { width: 30px; color: var(--muted); font-weight: 700; }
.board-row.me { background: var(--primary-soft); font-weight: 700; }
.tbl td.nowrap, .tbl th.nowrap { white-space: nowrap; }
.tbl td.clip { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty { padding: 28px; text-align: center; color: var(--muted); border: 1.5px dashed var(--border); border-radius: var(--radius); }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--text); font-size: .9rem; }
.notice.warn { background: var(--warn-soft); }
.notice.bad { background: var(--danger-soft); }
.notice.ok { background: var(--success-soft); }

/* ---------- Task player ---------- */
.player-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); }
.timer.low { background: var(--danger-soft); color: var(--danger); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.split > .pane { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
@media (max-width: 899px) { .split { grid-template-columns: 1fr; } .split > .pane { position: static; max-height: none; } }
.passage { font-size: 1rem; line-height: 1.8; }
.passage p { margin-bottom: 1em; }
.passage mark, .transcript mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 3px; }
.passage .para-label { font-weight: 800; color: var(--primary); margin-right: 6px; }
.q { padding: 14px 0; border-bottom: 1px solid var(--border); }
.q:last-child { border-bottom: 0; }
.q-num { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: .85rem; margin-right: 8px; }
.q-type { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.q-prompt { display: flex; align-items: flex-start; margin: 6px 0 10px; }
.choices { display: grid; gap: 6px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; background: var(--surface);
}
.choice:hover { border-color: var(--primary); }
.choice input { accent-color: var(--primary); width: 18px; height: 18px; margin-top: 2px; flex: none; }
.choice.correct { border-color: var(--success); background: var(--success-soft); }
.choice.wrong { border-color: var(--danger); background: var(--danger-soft); }
.chip-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-choices .choice { padding: 8px 14px; }
.result-box { margin-top: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .92rem; }
.result-box.ok { background: var(--success-soft); }
.result-box.bad { background: var(--danger-soft); }
.score-ring { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; flex: none;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); }
.score-ring span { position: relative; }

textarea.writing-area { width: 100%; min-height: 420px; font-size: 1.02rem; line-height: 1.75; padding: 14px; }
.wc { font-variant-numeric: tabular-nums; font-weight: 700; }
.chart-slot { border: 2px dashed var(--border); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted); }
.audio-box { padding: 16px; border-radius: var(--radius); background: var(--surface-2); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.big-play { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--listening); color: #fff; font-size: 1.3rem; cursor: pointer; flex: none; }
.big-play:disabled { opacity: .45; cursor: not-allowed; }
.rec-btn { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 1.6rem; cursor: pointer; box-shadow: 0 0 0 6px var(--danger-soft); }
.rec-btn.on { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px var(--danger-soft); } }
.cue { border-left: 4px solid var(--speaking); background: var(--surface-2); padding: 14px 16px; border-radius: var(--radius-sm); }
.cue ul { margin: 6px 0 0; padding-left: 20px; }
.video-wrap { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vocab-table input { width: 100%; min-width: 120px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; background: var(--surface); }
.translatable .w { cursor: help; border-radius: 3px; }
.translatable .w:hover { background: var(--primary-soft); }
#translate-pop {
  position: fixed; z-index: 90; max-width: 280px; padding: 10px 12px; background: var(--text); color: var(--bg);
  border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow);
}
.feedback-crit { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.feedback-crit .card { padding: 12px; }
.band { font-size: 1.4rem; font-weight: 800; color: var(--primary); }

/* ---------- Toast / modal ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
@media (min-width: 900px) { #toast { bottom: 24px; } }
.modal-back { position: fixed; inset: 0; background: rgba(10, 12, 25, .5); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal {
  background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 640px; max-height: calc(100vh - 32px);
  overflow-y: auto; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); -webkit-overflow-scrolling: touch;
}
.modal.lg { max-width: 920px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; }
.modal-head h2 { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: 100%; max-width: 440px; padding: 28px; }
.auth-hero { text-align: center; margin-bottom: 20px; }
.auth-hero .brand-mark { width: 60px; height: 60px; font-size: 1.5rem; margin: 0 auto 12px; border-radius: 18px; }
.auth .card.auth-card { max-width: 460px; }
.input.big { min-height: 50px; font-size: 1.05rem; }
.btn.big { min-height: 52px; font-size: 1.05rem; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 90px; }
.pw-wrap .btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); }
.auth-switch { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: .9rem; }
.auth-switch .btn { margin-top: 8px; }
.auth-demo { margin-top: 16px; font-size: .9rem; }
.auth-demo summary { cursor: pointer; color: var(--muted); text-align: center; font-weight: 600; }

/* ---------- Simple student home: one clear next step ---------- */
.focus { max-width: 760px; margin: 0 auto; }
.focus-hello { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.focus-hello h1 { margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: .85rem; text-decoration: none; color: var(--text); }
.next-card { position: relative; padding: 22px; border-radius: calc(var(--radius) + 4px); background: var(--surface); border: 2px solid var(--tone); box-shadow: var(--shadow); }
.next-card .label { display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tone); margin-bottom: 8px; }
.next-card h2 { font-size: 1.35rem; margin: 6px 0 4px; }
.next-card .due { font-weight: 700; color: var(--tone); margin-bottom: 16px; }
.next-card .btn.go { min-height: 56px; font-size: 1.1rem; padding: 12px 28px; background: var(--tone); color: #fff; border-color: transparent; }
.also { margin-top: 14px; }
.also-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-weight: 700; color: var(--muted); font-size: .9rem; }
.big-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.big-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 108px; padding: 14px 8px; text-align: center;
  border-radius: var(--radius); background: var(--tone-soft); color: var(--text); text-decoration: none; font-weight: 700; border: 2px solid transparent; position: relative; }
.big-tile:hover, .big-tile:focus-visible { border-color: var(--tone); }
.big-tile .ico { font-size: 2rem; line-height: 1; }
.big-tile .badge-n { position: absolute; top: 8px; right: 10px; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--tone); color: #fff; font-size: .75rem; font-weight: 800; }
@media (max-width: 560px) { .big-tiles { grid-template-columns: 1fr 1fr; } .next-card { padding: 18px; } .next-card .btn.go { width: 100%; } }

/* ---------- Games ---------- */
.src-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-q.on { background: var(--info); color: #fff; border-color: transparent; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 12px; margin-top: 14px; }
.game-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 16px; min-height: 120px;
  border-radius: var(--radius); border: 2px solid transparent; background: var(--tone-soft); color: var(--text); cursor: pointer; font: inherit; }
.game-card:hover:not(:disabled), .game-card:focus-visible { border-color: var(--tone); }
.game-card:disabled { opacity: .45; cursor: not-allowed; }
.game-card .g-ico { font-size: 2rem; line-height: 1; margin-bottom: 4px; }
.game-card b { font-size: 1.02rem; }
.g-best { position: absolute; top: 10px; right: 12px; font-size: .78rem; font-weight: 800; }
.game-screen { max-width: 640px; }
.game-stage { padding: 22px; min-height: 260px; }
.g-sentence { font-size: 1.25rem; line-height: 1.6; text-align: center; margin: 10px 0 18px; font-weight: 600; }
.g-blank { display: inline-block; min-width: 70px; border-bottom: 3px solid var(--primary); color: var(--primary); }
.g-word { font-size: 2rem; font-weight: 800; }
.g-meaning { font-size: 1.15rem; font-weight: 600; }
.g-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g-options.four { grid-template-columns: repeat(4, 1fr); }
.g-options.stack-opts { grid-template-columns: 1fr; }
.g-opt { min-height: 56px; padding: 10px 14px; border-radius: var(--radius-sm); border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 1.02rem; cursor: pointer; text-align: center; }
.g-options.stack-opts .g-opt { text-align: left; }
.g-opt:hover:not(:disabled) { border-color: var(--primary); }
.g-opt.right { border-color: var(--success); background: var(--success-soft); }
.g-opt.wrong { border-color: var(--danger); background: var(--danger-soft); }
.g-feedback { margin-top: 16px; }
.flip { perspective: 900px; cursor: pointer; outline: none; }
.flip-in { position: relative; min-height: 190px; transition: transform .45s; transform-style: preserve-3d; }
.flip.flipped .flip-in { transform: rotateY(180deg); }
.flip-front, .flip-back { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18px;
  border-radius: var(--radius); background: var(--info-soft); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-back { transform: rotateY(180deg); background: var(--success-soft); }
#g-judge { margin-top: 14px; }
.match-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.match-grid > div { display: flex; flex-direction: column; gap: 8px; }
.g-tile { min-height: 48px; padding: 8px 10px; border-radius: var(--radius-sm); border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.g-tile.def { font-weight: 500; font-size: .88rem; }
.g-tile.sel { border-color: var(--primary); background: var(--primary-soft); }
.g-tile.right { border-color: var(--success); background: var(--success-soft); opacity: .6; }
.g-tile.wrong { border-color: var(--danger); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.g-built { min-height: 64px; padding: 10px; border: 2px dashed var(--primary); border-radius: var(--radius-sm); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.g-bank { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.g-chip { padding: 9px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.g-chip.in { background: var(--primary-soft); border-color: var(--primary); }
@media (max-width: 560px) { .g-options.four { grid-template-columns: 1fr 1fr; } .match-grid { grid-template-columns: 1fr 1fr; } .game-stage { padding: 16px; } .g-sentence { font-size: 1.1rem; } }

/* ---------- Learning trail (trail.js) ---------- */
.ipa { font-family: "Segoe UI", "Lucida Sans Unicode", "Arial Unicode MS", "Noto Sans", sans-serif; color: var(--primary); font-weight: 600; letter-spacing: .02em; }
.t-head { padding: 18px; border-radius: calc(var(--radius) + 4px); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 18px; }
.t-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 10px; text-align: center; }
.t-stats div { padding: 8px; border-radius: 12px; background: var(--primary-soft); }
.t-stats b { display: block; font-size: 1.4rem; color: var(--primary); }
.t-stats span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.stamps { display: flex; justify-content: space-between; gap: 4px; margin-top: 12px; }
.stamp { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1.05rem; background: var(--surface-2); filter: grayscale(1); opacity: .45; }
.stamp.on { filter: none; opacity: 1; background: var(--warn-soft); box-shadow: 0 0 0 2px var(--vocabulary); }
.trail { position: relative; border-radius: calc(var(--radius) + 6px); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }

:root { --skyAmt: 100%; --sky-ink: #1B1F33; }
:root[data-theme="dark"] { --skyAmt: 38%; --sky-ink: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --skyAmt: 38%; --sky-ink: var(--text); } }
.t-place { position: relative; padding: 16px 14px 22px; color: var(--sky-ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--sky2) var(--skyAmt), var(--surface)), color-mix(in srgb, var(--sky1) var(--skyAmt), var(--surface))); }
.t-place + .t-place { border-top: 2px solid color-mix(in srgb, var(--surface) 60%, transparent); }
.t-place-name { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--text); box-shadow: var(--shadow); }
.t-place-name .t-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; background: var(--surface); }
.t-place-name b { display: block; line-height: 1.1; }
.t-place-name span { font-size: .78rem; color: var(--muted); }
.t-stamp { margin-left: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--success); color: #fff !important; font-weight: 800; font-size: .8rem !important; }
.t-nodes { display: flex; flex-direction: column; gap: 22px; margin-top: 16px; }
.t-node { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; width: 44%; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.t-node.left { flex-direction: row-reverse; text-align: right; margin-right: auto; padding-right: 0; }
.t-node.right { margin-left: auto; }
.t-node.left .t-dot { margin-right: 0; }
.t-node.right .t-dot { margin-left: 0; }
.t-dot { position: relative; flex: none; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem;
  background: var(--surface); border: 4px solid var(--primary); box-shadow: 0 6px 16px rgba(0,0,0,.15); transition: transform .15s; }
.t-dot i { position: absolute; bottom: -6px; right: -6px; min-width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; font-style: normal; font-size: .78rem; font-weight: 800; background: var(--primary); color: var(--primary-ink); border: 2px solid var(--surface); }
.t-node:hover .t-dot { transform: scale(1.06); }
.t-node.done .t-dot { border-color: var(--success); background: var(--success-soft); }
.t-node.done .t-dot i { background: var(--success); color: #fff; }
.t-node.locked { cursor: not-allowed; }
.t-node.locked .t-dot { border-color: var(--border); background: var(--surface-2); filter: grayscale(1); font-size: 1.3rem; }
.t-node.locked .t-label { opacity: .55; }
.t-node.here .t-dot { animation: nodepop .5s both, tpulse 1.6s .6s infinite; background: var(--primary-soft); }
@keyframes tpulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 50%, transparent); } 50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--primary) 0%, transparent); } }
.t-me { position: absolute; top: -36px; left: 50%; transform: translateX(-50%); white-space: nowrap; z-index: 3; padding: 2px 10px; border-radius: 99px; background: var(--accent); color: #fff; font-weight: 800; font-size: .78rem; box-shadow: 0 3px 8px rgba(0,0,0,.2); }
.t-me::after { content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--accent); border-bottom: 0; }
.t-label { display: flex; flex-direction: column; min-width: 0; padding: 6px 10px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--text); }
.t-label b { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.t-label span { font-size: .88rem; font-weight: 600; line-height: 1.3; }
.t-stars { color: #F5B800 !important; font-size: 1rem !important; letter-spacing: 2px; }
.t-stars s { text-decoration: none; color: var(--border); }
.t-goal, .t-start { position: relative; z-index: 2; text-align: center; font-weight: 800; padding: 12px; background: var(--surface); color: var(--text); }
.t-goal { background: linear-gradient(90deg, var(--primary), var(--accent)); color: #fff; }
.t-steps { display: flex; gap: 6px; margin: 10px 0 16px; flex-wrap: wrap; }
.t-steps span { padding: 4px 12px; border-radius: 99px; font-size: .82rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.t-steps span.on { background: var(--primary); color: var(--primary-ink); }
.word-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.word-card { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--primary); box-shadow: var(--shadow); }
.wc-word { font-size: 1.3rem; font-weight: 800; }
.wc-ipa { font-size: 1.05rem; margin: 2px 0 6px; }
.wc-meaning { font-weight: 600; }
.wc-ex { margin-top: 8px; font-size: .92rem; color: var(--muted); }
.wc-ex b { color: var(--text); }
.t-talk { margin-top: 14px; background: var(--primary-soft); border-color: transparent; }
.t-talk b { color: var(--primary); }
.g-rule ul { margin: 6px 0 0; padding-left: 20px; }
.g-rule li { margin: 4px 0; font-weight: 600; }
.t-scene .bubble { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 8px 0; border-radius: 14px; background: var(--surface-2); }
.t-scene .bubble b { flex: none; color: var(--primary); }
.t-scene .bubble span { flex: 1; }
.ex-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ex-line:last-child { border-bottom: 0; }
.g-explain { min-height: 22px; font-size: .88rem; text-align: center; margin: -4px 0 10px; color: var(--success); font-weight: 600; }
.t-bigstars { font-size: 3rem; letter-spacing: 6px; }
.t-bigstars span { color: var(--border); display: inline-block; }
.t-bigstars span.on { color: #F5B800; animation: starpop .5s both; }
@keyframes starpop { 0% { transform: scale(0); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
@media (max-width: 560px) {
  .t-dot { width: 60px; height: 60px; font-size: 1.5rem; }
  .t-node { width: 47%; gap: 8px; } .t-node.left .t-dot { margin-right: 0; } .t-node.right .t-dot { margin-left: 0; }
  .t-label span { font-size: .8rem; }
  .stamp { width: 28px; height: 28px; font-size: .9rem; }
}

/* ---------- Trail animation ---------- */
.t-path { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none; overflow: visible; }
.t-path path { fill: none; stroke-linecap: round; }
.t-path .base { stroke: color-mix(in srgb, var(--surface) 70%, transparent); stroke-width: 10; stroke-dasharray: 2 16; }
.t-path .done { stroke: var(--primary); stroke-width: 8; filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--primary) 50%, transparent)); }
.t-dot { animation: nodepop .5s both; }
@keyframes nodepop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
.t-walker { position: absolute; z-index: 4; transform: translate(-50%, calc(-100% - 30px)); display: flex; flex-direction: column; align-items: center; pointer-events: none;
  transition: left 1.5s ease-in-out, top 1.5s ease-in-out; }
.t-walker .t-person { font-size: 2rem; line-height: 1; filter: drop-shadow(0 3px 3px rgba(0,0,0,.3)); animation: idle 2.2s ease-in-out infinite; }
.t-walker.walking .t-person { animation: walk .35s ease-in-out infinite; }
.t-walker .t-me { position: static; transform: none; margin-bottom: 2px; }
@keyframes idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes walk { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-7px) rotate(6deg); } }
.t-cloud { position: absolute; left: -15%; z-index: 0; font-size: 2.2rem; opacity: .75; animation: drift linear infinite; pointer-events: none; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(130vw); } }
.t-deco { position: absolute; z-index: 0; font-size: 1.9rem; opacity: .9; animation: bob 3.5s ease-in-out infinite; pointer-events: none; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
.t-place.stamped .t-place-name { box-shadow: 0 0 0 3px var(--success), var(--shadow); }
@media (prefers-reduced-motion: reduce) { .t-cloud, .t-deco, .t-walker .t-person, .t-dot { animation: none !important; } }

/* Journey tabs */
.j-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.j-tab { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 2px solid var(--border); color: var(--text); text-decoration: none; box-shadow: var(--shadow); cursor: pointer; }
.j-tab.on { border-color: var(--primary); background: var(--primary-soft); }
.j-tab.locked { opacity: .55; filter: grayscale(.7); }
.j-tab .j-ico { font-size: 1.6rem; flex: none; }
.j-tab b { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.j-tab small { display: block; font-weight: 700; font-size: .85rem; line-height: 1.2; }
.j-tab > span:nth-child(2) { flex: 1; min-width: 0; }
.j-bar { display: block; height: 5px; margin-top: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; font-style: normal; }
.j-bar > i { display: block; height: 100%; background: var(--success); }
.j-done { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--success); color: #fff; font-weight: 800; font-size: .8rem; }
@media (max-width: 560px) { .j-tabs { gap: 6px; } .j-tab { flex-direction: column; text-align: center; padding: 8px 6px; gap: 4px; } .j-tab small { font-size: .72rem; } }
/* Illustrated scenery: a row of trees / buildings on a ground strip at the bottom of each place */
.t-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 26%; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 20% 100%, color-mix(in srgb, #4CAF50 calc(var(--skyAmt) * .55), transparent) 0 60%, transparent 61%),
              radial-gradient(120% 90% at 85% 100%, color-mix(in srgb, #2E7D32 calc(var(--skyAmt) * .5), transparent) 0 60%, transparent 61%); }
.t-scenery { position: absolute; left: 0; right: 0; bottom: 4px; z-index: 0; display: flex; justify-content: space-around; align-items: flex-end;
  font-size: clamp(2rem, 7vw, 3.1rem); letter-spacing: .4em; line-height: 1; opacity: .85; pointer-events: none; white-space: nowrap; overflow: hidden; filter: saturate(1.1); }
.dh-scenery { position: absolute; left: 0; right: 0; bottom: 32px; z-index: 0; text-align: center; font-size: 2.6rem; letter-spacing: .5em; opacity: .9; white-space: nowrap; overflow: hidden; }
/* Band inputs on the review form: 4 criteria + the automatic overall */
.band-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.band-overall output { display: flex; align-items: center; font-weight: 800; color: var(--primary); background: var(--primary-soft); border-color: transparent; white-space: nowrap; }
.band-overall small { font-weight: 600; color: var(--muted); text-transform: none; }
@media (max-width: 560px) { .band-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Rewrite / re-record */
.rewrite-cta { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; border: 2px dashed var(--primary); background: var(--primary-soft); }
.rewrite-cta p { margin: 2px 0 0; }
.rw-ico { font-size: 2rem; }
.rw-item { border-top: 1px solid var(--border); padding: 10px 0; }
.rw-item summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; cursor: pointer; }
.rw-item .sub-text { margin-top: 10px; }
.rw-audio { margin-top: 10px; }
.rw-reply-view { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--success); font-size: .92rem; }
.rw-reply { margin-top: 10px; }
.rw-check { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; flex: none; }
.rw-check input { width: 18px; height: 18px; accent-color: var(--success); }
.rw-fixes .hl-item:has(.rw-check input:checked) { opacity: .5; }
.rw-fixes .hl-item:has(.rw-check input:checked) .hl-quote { text-decoration: line-through; }
/* Drawn landscapes (art.js) behind each place and in the destination scene */
.t-land { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; z-index: 0; pointer-events: none; opacity: .95; }
.dh-land { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; z-index: 0; pointer-events: none; }
.art-land { display: block; width: 100%; height: 100%; }
.j-need { display: block; font-size: .72rem; font-weight: 800; color: var(--warn); font-style: normal; }
/* Illustration + tips beside speaking / writing tasks on wide screens */
.task-art-layout { display: block; }
.task-art { display: none; }
@media (min-width: 1200px) {
  .task-art-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
  .task-art-layout > .stack { max-width: none !important; }
  .task-art { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
}
.art-fig { display: block; width: 100%; height: auto; border-radius: 20px; box-shadow: var(--shadow); }
.art-tips ul { margin: 6px 0 0; padding-left: 18px; font-size: .9rem; line-height: 1.45; }
.art-tips li + li { margin-top: 6px; }
.art-waves { animation: waves 1.8s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes waves { 0%, 100% { opacity: .35; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }
.art-bubble { animation: bob 3.2s ease-in-out infinite; transform-box: fill-box; }
.art-pencil { animation: scribble 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom left; }
@keyframes scribble { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(6px, 1px) rotate(-3deg); } 50% { transform: translate(12px, -1px) rotate(2deg); } 75% { transform: translate(5px, 2px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .art-waves, .art-bubble, .art-pencil { animation: none; } }
.wc-range { font-weight: 700; color: var(--muted); }
.wc-range.ok { color: var(--success); } .wc-range.bad { color: var(--warn); }

/* Next-destination scene at the top of the trail */
.dest-hero { position: relative; height: 270px; border-radius: 22px; overflow: hidden; margin-bottom: 18px; box-shadow: 0 14px 34px rgba(0,0,0,.18);
  background: linear-gradient(180deg, var(--sky2) 0%, var(--sky1) 70%); }
.dh-sun { position: absolute; top: 26px; right: 40px; width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle, #FFF6B0 0%, #FFD54F 55%, rgba(255,213,79,0) 72%); animation: sunglow 4s ease-in-out infinite; }
@keyframes sunglow { 50% { transform: scale(1.12); } }
.dh-cloud { position: absolute; left: -12%; font-size: 2.6rem; opacity: .9; animation: drift linear infinite; }
.dh-cloud.c1 { top: 22px; animation-duration: 34s; } .dh-cloud.c2 { top: 70px; font-size: 1.9rem; animation-duration: 48s; animation-delay: -20s; }
.dh-bird { position: absolute; top: 46px; left: -8%; font-size: 1.2rem; animation: fly 16s linear infinite; }
@keyframes fly { 0% { transform: translate(0, 0); } 25% { transform: translate(30vw, -14px); } 50% { transform: translate(60vw, 6px); } 100% { transform: translate(130vw, -10px); } }
.dh-hill { position: absolute; border-radius: 50%; }
.dh-hill.h1 { left: -20%; right: 30%; bottom: -150px; height: 260px; background: color-mix(in srgb, #4CAF50 70%, var(--sky1)); }
.dh-hill.h2 { left: 25%; right: -25%; bottom: -170px; height: 280px; background: color-mix(in srgb, #2E7D32 75%, var(--sky1)); }
.dh-road { position: absolute; left: 0; right: 0; bottom: 18px; height: 18px; background: repeating-linear-gradient(90deg, #F5E6C8 0 26px, #E8D3A8 26px 40px); border-radius: 9px; opacity: .95; }
.dh-place { position: absolute; right: 9%; bottom: 30px; display: flex; align-items: flex-end; gap: 4px; }
.dh-big { font-size: 5.2rem; line-height: 1; filter: drop-shadow(0 8px 10px rgba(0,0,0,.25)); animation: bob 3.2s ease-in-out infinite; }
.dh-d { font-size: 2rem; animation: bob 3.2s ease-in-out infinite; } .dh-d.d1 { animation-delay: .5s; } .dh-d.d2 { animation-delay: 1.1s; }
.dh-walker { position: absolute; bottom: 30px; left: 0; width: 100%; pointer-events: none; }
.dh-walker span { position: absolute; left: 4%; font-size: 2.3rem; display: inline-block; transform: scaleX(-1); animation: herowalk 9s linear infinite; }
@keyframes herowalk { 0% { left: 2%; opacity: 0; } 8% { opacity: 1; } 80% { opacity: 1; } 92% { left: 70%; opacity: 0; } 100% { left: 70%; opacity: 0; } }
.dh-text { position: absolute; left: 22px; top: 22px; max-width: 58%; color: #1B1F33; }
.dh-kicker { display: inline-block; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.7); font-weight: 800; font-size: .8rem; letter-spacing: .04em; }
.dh-text h2 { font-size: 2rem; margin: 6px 0 2px; text-shadow: 0 2px 8px rgba(255,255,255,.7); }
.dh-text p { margin: 0 0 12px; font-weight: 600; text-shadow: 0 1px 6px rgba(255,255,255,.8); }
.t-saved { font-size: .72rem !important; font-weight: 800 !important; color: var(--accent) !important; }
.t-skip { font-size: .72rem !important; font-weight: 800 !important; color: var(--muted) !important; }
.t-node.skipped .t-dot { opacity: .75; filter: saturate(.6); border-style: dashed; }

/* ---------- Journey picker: swipeable picture cards ---------- */
.jp { margin-bottom: 16px; }
.jp-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.jp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.jp-chip { border: 2px solid var(--band); color: var(--band); background: var(--surface); border-radius: 99px; padding: 3px 11px; font-weight: 800; font-size: .78rem; cursor: pointer; }
.jp-chip:hover { background: var(--band); color: #fff; }
.jp-chip.later { opacity: .45; border-style: dashed; }
.jp-band { display: inline-block; padding: 2px 9px; border-radius: 99px; background: var(--band, var(--primary)); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .04em; vertical-align: middle; }
.jp-band.sm { font-size: .7rem; padding: 2px 8px; }
.jp-wrap { position: relative; }
.jp-rail { position: relative; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 12px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.jp-card { position: relative; flex: 0 0 min(230px, 72vw); scroll-snap-align: center; border-radius: 18px; overflow: hidden; background: var(--surface); border: 2px solid var(--border); box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s; }
.jp-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0,0,0,.14); }
.jp-card.on { border-color: var(--band); box-shadow: 0 0 0 3px color-mix(in srgb, var(--band) 30%, transparent), var(--shadow); }
.jp-card.locked { cursor: not-allowed; }
.jp-card.locked .jp-art { filter: grayscale(.85) brightness(.9); }
.jp-art { position: relative; height: 112px; background: linear-gradient(180deg, var(--sky2, #C7D2FE), var(--sky1, #E0E7FF)); overflow: hidden; }
.jp-land { position: absolute; inset: auto 0 0 0; height: 70%; }
.jp-land .art-land { width: 100%; height: 100%; }
.jp-icons { position: absolute; left: 8px; right: 8px; top: 8px; display: flex; justify-content: space-between; font-size: 1.1rem; }
.jp-icons span { animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); }
.jp-big { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); font-size: 2.6rem; filter: drop-shadow(0 6px 8px rgba(0,0,0,.25)); animation: bob 3.4s ease-in-out infinite; }
.jp-here { position: absolute; right: 8px; bottom: 8px; background: #fff; color: #1B1F33; font-weight: 800; font-size: .7rem; padding: 3px 8px; border-radius: 99px; box-shadow: 0 3px 8px rgba(0,0,0,.2); animation: pulse-here 1.6s ease-in-out infinite; }
@keyframes pulse-here { 50% { transform: scale(1.08); } }
.jp-body { padding: 10px 12px 12px; }
.jp-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.jp-row b { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--band); }
.jp-title { font-weight: 800; font-size: 1rem; margin: 2px 0 4px; line-height: 1.2; }
.jp-meta, .jp-need { font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.jp-need { color: var(--warn); font-weight: 800; }
.jp-card .j-bar > i { background: var(--band); }
.jp-card .j-done { top: 8px; right: 8px; }
.jp-card.more { border-style: dashed; cursor: default; }
.jp-card.more .jp-art { display: grid; place-items: center; background: linear-gradient(135deg, #1E1B4B, #6D28D9 60%, #EC4899); }
.jp-inf { color: #fff; font-size: 3.4rem; font-weight: 800; animation: inf-glow 2.4s ease-in-out infinite; }
@keyframes inf-glow { 50% { text-shadow: 0 0 22px rgba(255,255,255,.9); transform: scale(1.1); } }
.jp-arrow { position: absolute; top: 40%; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--text); }
.jp-arrow.l { left: -12px; } .jp-arrow.r { right: -12px; }
@media (max-width: 700px), (pointer: coarse) { .jp-arrow { display: none; } }

/* ---------- Placement test: movie intro ---------- */
.movie { position: fixed; inset: 0; z-index: 90; overflow: hidden; background: #050816; color: #fff; }
.mv-sky { position: absolute; inset: 0; background: linear-gradient(180deg, #0B1033 0%, #2A1B5C 45%, #F58A6B 85%, #FFC98A 100%); animation: mv-dawn 9s ease-in-out forwards; background-size: 100% 220%; background-position: 0 0; }
@keyframes mv-dawn { to { background-position: 0 100%; } }
.mv-stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; animation: mv-twinkle 2.4s ease-in-out infinite, mv-fade 7s ease-in forwards; }
@keyframes mv-twinkle { 50% { opacity: .2; } }
@keyframes mv-fade { to { opacity: 0; } }
.mv-sun { position: absolute; left: 50%; bottom: -120px; width: 160px; height: 160px; margin-left: -80px; border-radius: 50%; background: radial-gradient(circle, #FFF6B0, #FFB347 60%, rgba(255,179,71,0) 72%); animation: mv-rise 8s ease-out 1s forwards; }
@keyframes mv-rise { to { bottom: 34%; } }
.mv-land { position: absolute; left: -10%; right: -10%; bottom: 0; }
.mv-land .art-land { width: 100%; height: 100%; }
.mv-land.far { height: 46%; opacity: .55; filter: hue-rotate(200deg) brightness(.7); animation: mv-pan 14s linear forwards; }
.mv-land.near { height: 34%; animation: mv-pan 9s ease-out forwards; }
@keyframes mv-pan { from { transform: translateX(6%) scale(1.15); } to { transform: translateX(-4%) scale(1); } }
.mv-walker { position: absolute; bottom: 14%; left: -6%; font-size: 2.6rem; transform: scaleX(-1); animation: mv-walk 9s linear 1.5s forwards; }
@keyframes mv-walk { to { left: 46%; } }
.mv-bar { position: absolute; left: 0; right: 0; height: 0; background: #000; z-index: 3; animation: mv-bars 1.2s ease-out forwards; }
.mv-bar.top { top: 0; } .mv-bar.bottom { bottom: 0; }
@keyframes mv-bars { to { height: 9vh; } }
.mv-titles { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; pointer-events: none; text-align: center; }
.mv-t { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); width: 92%; opacity: 0; text-shadow: 0 4px 24px rgba(0,0,0,.6); }
.mv-t.t1 { font-size: clamp(.8rem, 2.6vw, 1.1rem); letter-spacing: .4em; text-transform: uppercase; animation: mv-title 3s ease-in-out .8s forwards; }
.mv-t.t2 { font-size: clamp(2rem, 8vw, 4.4rem); font-weight: 800; letter-spacing: .02em; animation: mv-title-stay 2.4s ease-out 3.6s forwards; }
.mv-t.t3 { top: calc(30% + clamp(3rem, 10vw, 5.4rem)); font-size: clamp(.95rem, 3vw, 1.3rem); letter-spacing: .12em; animation: mv-title-stay 1.6s ease-out 5.4s forwards; }
@keyframes mv-title { 0% { opacity: 0; transform: translateX(-50%) scale(.96); } 30%, 70% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) scale(1.04); } }
@keyframes mv-title-stay { from { opacity: 0; transform: translateX(-50%) scale(1.15); filter: blur(6px); } to { opacity: 1; transform: translateX(-50%) scale(1); filter: blur(0); } }
.mv-cta { position: absolute; left: 50%; bottom: 13vh; transform: translateX(-50%); width: min(460px, 90%); z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; opacity: 0; animation: mv-in .8s ease-out 7s forwards; }
.mv-cta p { margin: 0; font-weight: 600; text-shadow: 0 2px 10px rgba(0,0,0,.7); }
.mv-cta .btn.ghost { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(0,0,0,.25); }
@keyframes mv-in { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.mv-skip { position: absolute; right: 14px; top: calc(9vh + 10px); z-index: 6; background: rgba(0,0,0,.4); color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 99px; padding: 6px 14px; font: inherit; font-size: .82rem; cursor: pointer; }
.movie.fast *, .movie.fast { animation-duration: .01s !important; animation-delay: 0s !important; }
.movie.fast .mv-t.t1, .movie.fast .mv-skip { display: none; }
@media (prefers-reduced-motion: reduce) { .movie *, .movie { animation-duration: .01s !important; animation-delay: 0s !important; } .mv-t.t1 { display: none; } }

/* ---------- Placement test: the climb ---------- */
.pl-mountain { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 14px 6px; border-radius: 18px;
  background: linear-gradient(180deg, #E0E7FF, #C7D2FE); }
.pl-path { position: absolute; left: 24px; right: 24px; top: 50%; height: 6px; border-radius: 3px; background: rgba(255,255,255,.7); }
.pl-path > i { display: block; height: 100%; border-radius: 3px; background: var(--primary); transition: width .6s; }
.pl-flag { position: relative; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; font-size: 1.2rem; box-shadow: 0 3px 8px rgba(0,0,0,.15); }
.pl-flag i { position: absolute; bottom: -16px; font-style: normal; font-size: .7rem; font-weight: 800; color: #3730A3; }
.pl-flag.on { transform: scale(1.2); box-shadow: 0 0 0 4px var(--primary); animation: bob 2s ease-in-out infinite; }
.pl-flag.done { background: #DCFCE7; }
.pl-result { overflow: hidden; padding: 0; }
.pl-res-art { position: relative; height: 160px; background: linear-gradient(180deg, var(--sky2), var(--sky1)); }
.pl-res-art .art-land { position: absolute; bottom: 0; width: 100%; height: 100%; }
.pl-res-ico { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: 4rem; animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(0,0,0,.25)); }

/* Netlify's "Powered by Netlify" badge: kept, but small, faded and out of the way */
.host-badge { transform: scale(.6) !important; transform-origin: bottom right !important; opacity: .55 !important; transition: opacity .2s; }
.host-badge:hover { opacity: 1 !important; }
@media (max-width: 899px) { .host-badge { bottom: calc(70px + env(safe-area-inset-bottom)) !important; right: 4px !important; transform: scale(.5) !important; } }
body.focus-mode .host-badge { opacity: .35 !important; }
.resume-card { text-align: center; padding: 30px 20px; }
@media (max-width: 560px) { .dest-hero { height: 250px; } .dh-text { max-width: 70%; } .dh-text h2 { font-size: 1.5rem; } .dh-big { font-size: 4rem; } .dh-place { right: 5%; } }

/* ---------- Word-by-word learning ---------- */
.learn-wrap { max-width: 560px; margin: 0 auto; }
.learn-dots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.learn-dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--border); transition: .3s; font-size: 0; }
.learn-dots span.on { width: 30px; border-radius: 6px; background: var(--primary); }
.learn-dots span.done { background: var(--success); }
.learn-dots span:last-child:not(.wide) { font-size: .7rem; width: auto; height: auto; padding: 0 4px; background: none; }
.learn-dots span.wide { width: auto; height: auto; padding: 4px 12px; border-radius: 99px; font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.learn-dots span.wide.on { color: var(--primary-ink); background: var(--primary); }
.learn-dots span.wide.done { color: #fff; background: var(--success); }
.learn-card { padding: 26px 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 12px 30px color-mix(in srgb, var(--primary) 18%, transparent); text-align: center; position: relative; overflow: hidden; }
.learn-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.learn-card.left { text-align: left; }
.pop { animation: cardin .45s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes cardin { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.lc-count { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lc-word { font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 800; margin: 8px 0 2px; background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lc-ipa { font-size: 1.3rem; }
.lc-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 16px 0 6px; }
.lc-heard { min-height: 22px; font-size: .9rem; font-weight: 600; }
.lc-heard.ok { color: var(--success); } .lc-heard.bad { color: var(--warn); }
.lc-reveal { margin-top: 12px; }
.lc-more { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); animation: cardin .4s both; }
.lc-meaning { font-size: 1.2rem; font-weight: 700; }
.lc-ex { margin-top: 10px; font-size: 1.02rem; }
.lc-ex b { color: var(--primary); }
.lc-scene { font-size: 3.2rem; text-align: center; animation: bob 3s ease-in-out infinite; }
.lc-talk { font-size: 1.08rem; line-height: 1.8; text-align: left; }
.lc-talk b { color: var(--primary); cursor: pointer; border-bottom: 2px dotted var(--primary); }
.lc-rule { list-style: none; padding: 0; margin: 4px 0 12px; }
.lc-rule li { padding: 9px 12px; margin: 6px 0; border-radius: 10px; background: var(--primary-soft); font-weight: 700; animation: cardin .4s both; }
.lc-expl { font-size: 1.02rem; }
.learn-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
/* Dialogue bubbles: the speaker's name on its own small line above what they say */
.bubble { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 10px 14px; margin: 8px 0; border-radius: 14px; background: var(--surface-2); max-width: 92%; }
.bubble > b { flex-basis: 100%; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); }
.bubble > span { flex: 1; min-width: 0; }
.bubble.right { margin-left: auto; text-align: right; background: var(--primary-soft); }
.bubble.right > span { order: 2; } .bubble.right > button { order: 1; }

/* ---------- Game rewards ---------- */
.confetti { position: fixed; z-index: 120; width: 9px; height: 13px; border-radius: 2px; pointer-events: none; animation: confetti 1.05s ease-out forwards; }
@keyframes confetti { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }
.score-pop { position: fixed; z-index: 120; transform: translateX(-50%); font-weight: 800; color: var(--success); font-size: 1.2rem; pointer-events: none; animation: scorepop .9s ease-out forwards; text-shadow: 0 2px 6px rgba(0,0,0,.15); }
@keyframes scorepop { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -60px; } }
.shake { animation: shake .4s; }
.chip.combo { background: linear-gradient(90deg, #FF9F45, #FF6B6B); color: #fff; border-color: transparent; }
.game-stage.enter { animation: cardin .4s both; }
.g-opt { transition: transform .12s, border-color .15s, background .15s; }
.g-opt:active:not(:disabled) { transform: scale(.97); }
.g-opt.right { animation: correct .5s; }
@keyframes correct { 50% { transform: scale(1.05); } }

/* ---------- Teacher "Today" ---------- */
.today-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.action-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--tone); box-shadow: var(--shadow); }
.action-card .n { font-size: 2rem; font-weight: 800; color: var(--tone); line-height: 1; }
.action-card .what { font-weight: 700; }
.action-card .btn { margin-top: auto; align-self: flex-start; }
@media (max-width: 560px) {
  .today-actions { gap: 10px; }
  .action-card { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 12px 14px; gap: 4px 12px; border-top-width: 1px; border-left: 4px solid var(--tone); }
  .action-card .n { font-size: 1.6rem; min-width: 34px; }
  .action-card .what { flex: 1; font-size: .92rem; }
  .action-card .btn { margin: 0; min-height: 36px; padding: 6px 12px; font-size: .88rem; }
  .action-card .small { flex-basis: 100%; padding-left: 46px; }
}
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.class-line { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.class-line:last-child { border-bottom: 0; }
.class-line:hover b { color: var(--primary); }
.class-line .bar { flex: 0 0 140px; }
@media (max-width: 560px) { .class-line .bar { flex-basis: 70px; } }
details.more-details { margin-top: 22px; }
details.more-details > summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 10px 0; list-style: none; }
details.more-details > summary::-webkit-details-marker { display: none; }
details.more-details > summary::before { content: "▸ "; }
details.more-details[open] > summary::before { content: "▾ "; }

/* ---------- Personal colour + background (look.js) ---------- */
.sidebar { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 16%, var(--surface)) 0%, var(--surface) 55%); }
.topbar { border-bottom: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); }
.bottom-nav a.active .ico { background: var(--primary); color: var(--primary-ink); border-radius: 10px; padding: 0 10px; }
body { background-image: radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--primary) 10%, transparent) 0, transparent 40%),
  radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--accent) 10%, transparent) 0, transparent 40%); background-attachment: fixed; }
.focus-hello { padding: 18px 20px; border-radius: calc(var(--radius) + 4px); color: #fff; background: linear-gradient(120deg, var(--primary), var(--accent)); box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 30%, transparent); }
.focus-hello .chip { background: rgba(255,255,255,.22); border-color: transparent; color: #fff; }
#bg-layer { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
#bg-dim { position: absolute; inset: 0; background: var(--bg); opacity: 0; transition: opacity .2s; }
/* Theme packs: a full-screen picture (img/themes/<theme>.jpg) */
#bg-layer { background-attachment: fixed; }
.theme-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.theme-tile { position: relative; height: 92px; border-radius: 14px; border: 3px solid transparent; cursor: pointer; padding: 0; display: flex; align-items: flex-end; font: inherit; overflow: hidden; box-shadow: var(--shadow); background-size: cover !important; transition: transform .15s; }
.theme-tile:hover { transform: translateY(-2px); }
.theme-tile.none { background: var(--surface-2); color: var(--text); align-items: center; justify-content: center; }
.theme-tile.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow); }
.theme-tile b { width: 100%; padding: 14px 8px 6px; font-size: .8rem; color: #fff; text-align: left; background: linear-gradient(180deg, transparent, rgba(0,0,0,.6)); }
.theme-tile.none b { color: var(--text); background: none; text-align: center; padding: 0; }

/* ---------- Pronunciation check (learn words) ---------- */
.pron { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px auto 4px; padding: 10px 14px; border-radius: 16px; background: var(--surface-2); flex-wrap: wrap; max-width: 440px; }
.pron.done { background: var(--success-soft, #DCFCE7); }
.pron .lc-heard { flex-basis: 100%; text-align: center; min-height: 0; }
.pron-btn { width: 62px; height: 62px; font-size: 1.6rem; }
.pron-btn.on { animation: pulse-rec 1s ease-in-out infinite; }
@keyframes pulse-rec { 50% { box-shadow: 0 0 0 10px rgba(229,57,53,.25); } }

/* ---------- Grammar: one rule at a time + guided practice ---------- */
.rule-big { font-size: 1.35rem; font-weight: 800; line-height: 1.35; padding: 18px 16px; border-radius: 16px; background: var(--primary-soft); border-left: 6px solid var(--primary); margin: 8px 0 12px; }
.gp-hint { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #FEF9C3; color: #713F12; font-weight: 600; }

/* ---------- "Use it" stop, AI debate, picture match, story quest ---------- */
.use-mode { display: inline-block; margin-bottom: 8px; padding: 3px 12px; border-radius: 99px; font-weight: 800; font-size: .78rem; background: #FEF3C7; color: #92400E; }
.use-mode.talk { background: #DCFCE7; color: #166534; } .use-mode.debate { background: #EDE9FE; color: #5B21B6; }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.wchip { padding: 3px 10px; border-radius: 99px; border: 1.5px dashed var(--border); font-size: .82rem; font-weight: 700; color: var(--muted); transition: all .2s; }
.wchip.on { border-style: solid; border-color: var(--success); background: var(--success); color: #fff; }
.debate-head { text-align: center; margin-bottom: 8px; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; padding: 6px 2px 10px; }
.bubble.ai { align-self: flex-start; background: #EDE9FE; color: #1B1F33; }
.bubble.you { align-self: flex-end; background: var(--primary); color: var(--primary-ink); }
.bubble.typing span { animation: blink-dots 1s steps(3) infinite; }
@keyframes blink-dots { 50% { opacity: .3; } }
.pic-frame { margin: 0 auto 12px; max-width: 360px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface-2); position: relative; }
.pic-frame img { display: block; width: 100%; height: 230px; object-fit: cover; }
.pic-frame figcaption { position: absolute; right: 8px; bottom: 6px; font-size: .68rem; background: rgba(0,0,0,.5); color: #fff; padding: 2px 8px; border-radius: 99px; }
.pic-frame figcaption a { color: #fff; }
.quest-path { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.q-step { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 2px solid var(--border); font-size: .85rem; font-weight: 800; position: relative; }
.q-step + .q-step::before { content: ""; position: absolute; right: 100%; width: 6px; height: 3px; background: var(--border); }
.q-step.done { background: var(--success); border-color: var(--success); color: #fff; }
.q-step.on { border-color: var(--primary); background: var(--primary-soft); animation: bob 1.6s ease-in-out infinite; }
.q-step.goal { width: 38px; height: 38px; font-size: 1.2rem; background: #FEF3C7; border-color: #F59E0B; }
.q-step.goal.near { animation: pulse-here 1.2s ease-in-out infinite; }
.quest-line { font-size: 1.15rem; }
.quest-story { margin-bottom: 10px; padding: 12px; border-radius: 12px; background: #FEF3C7; color: #451A03; }
.quest-story p { margin: 6px 0; line-height: 1.6; }
.t-place.three .t-nodes { gap: 6px; }
.lay { display: grid; gap: 10px; }
.lay-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; }
.lay-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.lay-opt.on { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
@media (max-width: 560px) { .lay-row { grid-template-columns: 1fr; gap: 4px; } }
/* Layout: spacing and text size */
:root[data-density="compact"] .content { padding: 14px; }
:root[data-density="compact"] .card { padding: 12px; }
:root[data-density="compact"] .stack { gap: 10px; }
:root[data-density="compact"] .nav-link { padding: 7px 10px; }
:root[data-text-size="large"] { font-size: 112%; }
:root[data-text-size="xl"] { font-size: 124%; }
/* Optional IELTS stops on the trail */
.t-node.bonus .t-dot { background: linear-gradient(135deg, #FDE68A, #F59E0B); border-color: #F59E0B; }
.t-node.bonus .t-label b { color: #B45309 !important; }
.bonus-btn { border-color: #F59E0B; color: #B45309; }
body.has-bg { background: transparent; }
body.has-bg .sidebar, body.has-bg .topbar, body.has-bg .bottom-nav { background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
body.has-bg .page-head h1, body.has-bg .page-head p, body.has-bg .section-head h2 { text-shadow: 0 1px 8px color-mix(in srgb, var(--bg) 85%, transparent); }
/* With a theme or background picture, the page sits on a frosted panel so text never sinks into the picture
   (the cards on it stay solid, so the picture can show through the panel itself) */
body.has-bg .content { background: color-mix(in srgb, var(--bg) 60%, transparent); backdrop-filter: blur(var(--panel-blur, 18px)) saturate(1.15); -webkit-backdrop-filter: blur(var(--panel-blur, 18px)) saturate(1.15);
  border-radius: 24px; margin-top: 14px; margin-bottom: 14px; box-shadow: 0 12px 34px rgba(0,0,0,.14); border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent); }
body.has-bg .page-head p, body.has-bg .muted { color: color-mix(in srgb, var(--text) 72%, var(--bg)); }
@media (max-width: 899px) { body.has-bg .content { margin: 8px; width: auto; border-radius: 18px; } }

/* Writing worksheet (writing course) */
.ws-body p { margin: 4px 0; line-height: 1.6; }
.ws-h { margin: 14px 0 4px; color: var(--primary); font-size: .95rem; }
.ws-img { display: block; max-width: 100%; max-height: 460px; width: auto; margin: 10px auto; cursor: zoom-in; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.ws-table { margin: 8px 0; font-size: .88rem; }
.ws-table td, .ws-table th { vertical-align: top; }
.ws-blank { display: inline-block; min-width: 80px; border-bottom: 1.5px dotted var(--muted); margin: 0 3px; }
.ws-sec.essay { border-left: 4px solid var(--writing, var(--primary)); }
.ws-answer textarea { margin-top: 6px; }
.ws-intro summary, .ws-key summary { cursor: pointer; }
.ws-key { border-left: 4px solid var(--success); }
.ws-key .ws-body { max-height: 70vh; overflow-y: auto; margin-top: 10px; }
.ic-list { display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: 12px; }
/* My voice vs the model */
.compare { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: var(--info-soft, #E0F2FE); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 66px; padding: 6px 2px; border: 2px solid transparent; border-radius: 12px; background: none; cursor: pointer; color: var(--text); font: inherit; font-size: .72rem; font-weight: 600; }
.swatch i { width: 34px; height: 34px; border-radius: 50%; background: var(--sw); box-shadow: 0 3px 8px color-mix(in srgb, var(--sw) 45%, transparent); }
.swatch.on { border-color: var(--sw); background: color-mix(in srgb, var(--sw) 12%, transparent); }
.scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.scene { height: 64px; border-radius: 12px; border: 3px solid transparent; cursor: pointer; display: flex; align-items: flex-end; padding: 4px 6px; font: inherit; font-size: .74rem; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); background-size: cover !important; }
.scene[data-scene="none"], .scene.upload { color: var(--text); text-shadow: none; border-color: var(--border); }
.scene.upload { border-style: dashed; align-items: center; justify-content: center; background: var(--surface); }
.scene.on { border-color: var(--primary) !important; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }

.crop-shapes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.crop-frame { position: relative; width: 100%; margin: 0 auto; overflow: hidden; border-radius: 14px; background: #111; touch-action: none; cursor: grab; user-select: none; box-shadow: inset 0 0 0 2px var(--primary); }
.crop-frame:active { cursor: grabbing; }
.crop-frame img { position: absolute; top: 0; left: 0; max-width: none; pointer-events: none; }
.crop-grid { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size: 33.33% 33.33%; background-position: -1px -1px; }

/* ---------- Study tools (study.js) ---------- */
@media (min-width: 900px) {
  .split.resizable { grid-template-columns: minmax(0, var(--split-a, 1fr)) 14px minmax(0, var(--split-b, 1fr)); gap: 6px; }
}
.split-handle { display: none; }
@media (min-width: 900px) {
  .split.resizable > .split-handle { display: flex; align-self: stretch; justify-content: center; cursor: col-resize; touch-action: none; position: sticky; top: 76px; height: calc(100vh - 110px); }
  .split-handle span { width: 6px; border-radius: 3px; background: var(--border); transition: background .15s; position: relative; }
  .split-handle span::after { content: "⋮"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 18px; height: 40px; border-radius: 9px;
    display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 900; box-shadow: var(--shadow); }
  .split-handle:hover span, .split-handle:focus span, body.resizing .split-handle span { background: var(--primary); }
}
body.resizing { cursor: col-resize; user-select: none; }
mark.uhl { color: inherit; border-radius: 3px; padding: 0 1px; cursor: pointer; }
mark.uhl-y { background: #FFE566; } mark.uhl-g { background: #A8F0B8; } mark.uhl-p { background: #FFC1DD; }
:root[data-theme="dark"] mark.uhl { color: #1B1F33; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) mark.uhl { color: #1B1F33; } }
/* Compact colour picker that sits right on top of the tapped highlight */
.mk-bar { position: fixed; z-index: 96; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.mk-bar::after { content: ""; position: absolute; left: calc(var(--arrow-x, 50%) - 5px); bottom: -5px; width: 10px; height: 10px; background: var(--surface); border: 1px solid var(--border); border-top: 0; border-left: 0; transform: rotate(45deg); }
.mk-bar.below::after { bottom: auto; top: -5px; transform: rotate(-135deg); }
.mk-bar[hidden] { display: none; }
.mk-c { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.mk-c.on { box-shadow: 0 0 0 2px var(--text); }
.mk-y { background: #FFE566; } .mk-g { background: #A8F0B8; } .mk-p { background: #FFC1DD; }
.mk-x { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: .7rem; font-weight: 800; }
mark.uhl.picked { outline: 2px solid var(--primary); outline-offset: 1px; }
.mk-tr { width: 26px; height: 22px; padding: 0; border: 0; border-radius: 99px; background: var(--surface-2); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.mk-tr:hover { background: var(--primary-soft); color: var(--primary); }
@media (pointer: coarse) { .mk-c, .mk-x { width: 28px; height: 28px; } .mk-tr { width: 32px; height: 28px; } }
.dnd-bank { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin: 10px 0; border-radius: 12px; background: var(--primary-soft); border: 1px dashed color-mix(in srgb, var(--primary) 45%, transparent); }
.dnd-bank > .small { flex-basis: 100%; }
.inline-bank { background: var(--surface-2); border-color: var(--border); margin-top: 6px; }
.dnd-chip { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: grab; box-shadow: 0 2px 6px rgba(0,0,0,.08); text-align: left; }
.dnd-chip:hover { border-color: var(--primary); }
.dnd-chip.dragging { opacity: .5; }
.dnd-chip.picked { border-color: var(--primary); background: var(--primary); color: var(--primary-ink); }
.dnd-chip.used { opacity: .5; }
.dz { display: flex; align-items: center; min-height: 46px; max-width: 520px; padding: 8px 14px; border: 2px dashed var(--border); border-radius: 12px; color: var(--muted); font-weight: 600; cursor: pointer; transition: .15s; }
.dz.inline { display: inline-flex; min-height: 0; min-width: 120px; padding: 2px 10px; margin: 0 4px; vertical-align: middle; border-radius: 8px; font-size: .92em; }
.dz.over, .dnd-picking .dz { border-color: var(--primary); background: var(--primary-soft); }
.dz.filled { border-style: solid; border-color: var(--primary); color: var(--text); background: var(--surface); }

/* ---------- Focus mode: doing homework / practice / a game ---------- */
body.focus-mode .shell { grid-template-columns: 1fr; }
body.focus-mode .sidebar, body.focus-mode .bottom-nav, body.focus-mode .demo-banner { display: none; }
body.focus-mode .topbar { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; }
body.focus-mode .topbar .brand-mini { display: none; }
body.focus-mode .bell .bell-label { display: none; }
body.focus-mode .content { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.exit-btn { font-weight: 700; }
@media (max-width: 560px) { body.focus-mode .lang-btn { display: none; } }

/* Unfinished homework: the top bar blinks; colour and speed follow the nearest deadline (alerts.js → data-hw-tier)
   over = dark red, fast · today = red · tomorrow = orange · in 2–3 days = gold · later = calm indigo */
body[data-hw-tier="over"]     { --bar1: #6D0000; --bar2: #B71C1C; --bar3: #E53935; --bar-ink: #fff; --blink: .7s;  --glow: rgba(183, 28, 28, .8); }
body[data-hw-tier="today"]    { --bar1: #B71C1C; --bar2: #E53935; --bar3: #FF7043; --bar-ink: #fff; --blink: 1s;   --glow: rgba(229, 57, 53, .7); }
body[data-hw-tier="tomorrow"] { --bar1: #E65100; --bar2: #FB8C00; --bar3: #FFB300; --bar-ink: #fff; --blink: 1.5s; --glow: rgba(251, 140, 0, .65); }
body[data-hw-tier="soon"]     { --bar1: #C79100; --bar2: #F2C200; --bar3: #FFE36E; --bar-ink: #3B2A00; --blink: 2.2s; --glow: rgba(242, 194, 0, .6); }
body[data-hw-tier="later"]    { --bar1: #303F9F; --bar2: #5C6BC0; --bar3: #7E57C2; --bar-ink: #fff; --blink: 3.5s; --glow: rgba(92, 107, 192, .5); }
body.hw-alert .topbar { position: sticky; background: linear-gradient(90deg, var(--bar1), var(--bar2) 55%, var(--bar3)); color: var(--bar-ink); border-bottom-color: var(--bar3);
  animation: barpulse var(--blink) ease-in-out infinite; }
body.hw-alert .topbar::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; animation: barflash var(--blink) steps(1, end) infinite;
  background: linear-gradient(90deg, var(--bar3), color-mix(in srgb, var(--bar3) 60%, #fff)); }
/* The whole bar switches between its dark and its bright colour */
@keyframes barflash { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }
@keyframes barpulse { 0%, 100% { box-shadow: 0 0 0 transparent; } 50% { box-shadow: 0 4px 24px var(--glow); } }
body.hw-alert .topbar > * { position: relative; }
body.hw-alert .topbar .title { color: var(--bar-ink); }
body.hw-alert .topbar .btn:not(.bell) { background: rgba(255,255,255,.2); color: var(--bar-ink); border-color: rgba(255,255,255,.4); }
body.hw-alert .bell, body.hw-alert .bell.ring { background: #fff; color: var(--bar1); border-color: #fff; }
.hw-signal { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 2px solid currentColor; background: rgba(255,255,255,.18);
  color: var(--bar-ink, #fff); font: inherit; font-weight: 800; font-size: .85rem; cursor: pointer; white-space: nowrap; }
/* 3+ days to go: a calm, steady bar — no blinking */
body[data-hw-tier="later"].hw-alert .topbar, body[data-hw-tier="later"].hw-alert .topbar::before { animation: none; }
@media (prefers-reduced-motion: reduce) { body.hw-alert .topbar, body.hw-alert .topbar::before { animation: none; } }@media (max-width: 560px) { .hw-signal span { display: none; } }

/* ---------- Notifications (alerts.js) ---------- */
.bell { position: relative; gap: 6px; padding: 6px 14px; font-weight: 700; border-color: transparent; background: var(--surface-2); }
.bell .bell-ico { font-size: 1.25rem; display: inline-block; transform-origin: 50% 0; }
.bell.ring { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.bell.ring .bell-ico { animation: ring 2.4s ease-in-out infinite; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(18deg); } 80% { transform: rotate(-16deg); } 85% { transform: rotate(12deg); } 90% { transform: rotate(-8deg); } }
.bell .dot { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--danger); color: #fff; font-size: .78rem; font-weight: 800; display: grid; place-items: center; padding: 0 6px; box-shadow: 0 0 0 3px var(--surface); }
@media (max-width: 700px) { .bell .bell-label { display: none; } .bell { padding: 6px 10px; } }
.lang-btn { font-weight: 700; }
.drawer-back { position: fixed; inset: 0; z-index: 85; background: rgba(10, 12, 25, 0); transition: background .25s; }
.drawer-back.open { background: rgba(10, 12, 25, .45); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); overflow-y: auto; padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
  background: var(--bg); box-shadow: -10px 0 40px rgba(0,0,0,.25); transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.9,.3,1); }
.drawer-back.open .drawer { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.drawer-head h2 { margin: 0; font-size: 1.4rem; }
.drawer-sec { margin: 16px 0 8px; font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.alert-card { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--tone, var(--info)); box-shadow: var(--shadow); }
.alert-card.over { --tone: var(--danger); background: color-mix(in srgb, var(--danger-soft) 60%, var(--surface)); }
.alert-card.soon { --tone: var(--warn); background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); }
.alert-card.todo { --tone: var(--info); }
.alert-card .ac-ico { font-size: 1.6rem; flex: none; }
.alert-card .ac-tag { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--tone); }
.alert-card .btn { flex: none; background: var(--tone); }
.note-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; margin-bottom: 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; border-left: 4px solid var(--border); }
.note-card:hover { border-color: var(--primary); }
.note-card.over { border-left-color: var(--danger); } .note-card.soon { border-left-color: var(--warn); }
.note-card.feedback { border-left-color: var(--success); } .note-card.homework { border-left-color: var(--info); }
.note-card.unread { font-weight: 700; background: var(--primary-soft); }
.note-card .nc-ico { font-size: 1.3rem; }
.note-card .nc-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); margin-top: 6px; }
.nudge { position: fixed; z-index: 90; right: 20px; bottom: 20px; width: min(420px, calc(100vw - 24px)); display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: 18px; background: var(--surface); border: 2px solid var(--tone, var(--info)); box-shadow: 0 18px 50px rgba(0,0,0,.3); transform: translateY(140%); transition: transform .45s cubic-bezier(.2,1.2,.3,1); flex-wrap: wrap; }
.nudge.show { transform: none; }
.nudge.over { --tone: var(--danger); } .nudge.soon { --tone: var(--warn); } .nudge.todo { --tone: var(--info); }
.nudge-ico { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; background: color-mix(in srgb, var(--tone) 18%, var(--surface)); animation: ring 2s ease-in-out infinite; }
.nudge b { color: var(--tone); }
.nudge-actions { display: flex; gap: 6px; margin-left: auto; }
.nudge-actions .btn.primary { background: var(--tone); }
@media (max-width: 899px) { .nudge { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* ---------- Lessons & materials library (library.js) ---------- */
.lib-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.lib-toolbar .input { flex: 1; min-width: 200px; max-width: 420px; }
.lib-tabs { display: none; }
.lib-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.lib-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.lib-col > header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 800; font-size: 1.02rem; color: #fff; }
.lib-col.docs > header { background: linear-gradient(90deg, #D24726, #F28A3B); }
.lib-col.recs > header { background: linear-gradient(90deg, #C4302B, #8E24AA); }
.lib-col > header .count { margin-left: auto; min-width: 28px; text-align: center; padding: 1px 9px; border-radius: 99px; background: rgba(255,255,255,.25); font-size: .8rem; }
.lib-list { padding: 4px 12px 12px; max-height: 70vh; overflow-y: auto; }
.lib-month { position: sticky; top: 0; z-index: 1; padding: 8px 4px 4px; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
.lib-item { display: flex; gap: 12px; padding: 10px; margin: 4px 0; border-radius: 12px; transition: background .15s; }
.lib-item:hover { background: var(--surface-2); }
.lib-item.flash { animation: libflash 1.4s; }
@keyframes libflash { 0%, 60% { box-shadow: 0 0 0 3px var(--primary); background: var(--primary-soft); } }
.lib-thumb { flex: none; width: 104px; height: 64px; border-radius: 10px; display: grid; place-items: center; position: relative; overflow: hidden; }
.lib-thumb.doc { background: color-mix(in srgb, var(--fc) 14%, var(--surface)); border: 2px solid color-mix(in srgb, var(--fc) 40%, transparent); }
.lib-thumb.doc i { font-style: normal; font-weight: 900; font-size: .85rem; letter-spacing: .05em; color: #fff; background: var(--fc); padding: 4px 8px; border-radius: 6px; }
.lib-thumb.video { background: #111 center / cover no-repeat; }
.lib-thumb.video.plain { background: linear-gradient(135deg, #C4302B, #8E24AA); }
.lib-thumb.video b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; }
.lib-body { flex: 1; min-width: 0; }
.lib-title { font-weight: 700; line-height: 1.3; }
.lib-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mat-add summary { cursor: pointer; list-style: none; }
.mat-add summary::-webkit-details-marker { display: none; }
@media (max-width: 760px) {
  .lib-tabs { display: flex; width: 100%; padding: 4px; border-radius: 12px; background: var(--surface-2); }
  .lib-tabs button { flex: 1; padding: 9px 6px; border: 0; border-radius: 9px; background: none; font: inherit; font-weight: 700; font-size: .85rem; color: var(--muted); cursor: pointer; }
  .lib-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
  .lib-cols { grid-template-columns: 1fr; }
  .lib-cols[data-show="docs"] .lib-col.recs, .lib-cols[data-show="recs"] .lib-col.docs { display: none; }
  .lib-list { max-height: none; }
  .lib-thumb { width: 84px; height: 54px; }
}

/* ---------- Class levels: one colour per level (Classes page) ---------- */
.lv-found { --lv: #0E9F6E; } .lv-pre { --lv: #0891B2; } .lv-inter { --lv: #2563EB; } .lv-b2 { --lv: #7C4DEB; } .lv-adv { --lv: #DB2777; }
:root[data-theme="dark"] .lv-found { --lv: #34D399; } :root[data-theme="dark"] .lv-pre { --lv: #22D3EE; } :root[data-theme="dark"] .lv-inter { --lv: #60A5FA; }
:root[data-theme="dark"] .lv-b2 { --lv: #A78BFA; } :root[data-theme="dark"] .lv-adv { --lv: #F472B6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lv-found { --lv: #34D399; } :root:not([data-theme="light"]) .lv-pre { --lv: #22D3EE; }
  :root:not([data-theme="light"]) .lv-inter { --lv: #60A5FA; } :root:not([data-theme="light"]) .lv-b2 { --lv: #A78BFA; } :root:not([data-theme="light"]) .lv-adv { --lv: #F472B6; } }
.lv-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 16px; }
.lv-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 3px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); }
.lv-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--lv); }
.class-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.class-tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.class-tile:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--lv), var(--shadow); }
.ct-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: color-mix(in srgb, var(--lv) 14%, var(--surface)); border-bottom: 3px solid var(--lv); }
.ct-head h3 { margin: 0; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-level { font-size: .8rem; font-weight: 700; color: var(--lv); }
.ct-badge { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--lv); color: #fff; font-weight: 800; font-size: .95rem; }
.ct-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 14px 16px 6px; }
.ct-facts div { display: flex; flex-direction: column; min-width: 0; }
.ct-facts span { font-size: .74rem; color: var(--muted); font-weight: 600; }
.ct-facts b { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-bars { padding: 8px 16px 4px; }
.ct-bars .progress > i { background: var(--lv); }
.ct-bars .progress > i.hw { background: var(--success); }
.ct-foot { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 14px; margin-top: auto; }
.class-tile.archived { filter: grayscale(.85); opacity: .75; }
.class-tile.archived:hover { filter: none; opacity: 1; }

/* ---------- Feedback highlights: 4 error colours ----------
   yellow = grammar · red = spelling · blue = word choice · green = ideas
   Each also has its own underline style, so they differ without colour too. */
:root {
  --hl-grammar: #FFE066; --hl-grammar-line: #C99A00;
  --hl-spelling: #FFB3B8; --hl-spelling-line: #D93F45;
  --hl-word: #B5DBFF; --hl-word-line: #1F74C8;
  --hl-idea: #FFC999; --hl-idea-line: #E0761B;
  --hl-good: #B4EFC8; --hl-good-line: #0F9D72;
}
:root[data-theme="dark"] {
  --hl-grammar: rgba(255, 214, 10, .32); --hl-grammar-line: #FFD60A;
  --hl-spelling: rgba(255, 99, 110, .32); --hl-spelling-line: #FF7A7F;
  --hl-word: rgba(90, 174, 240, .34); --hl-word-line: #5AAEF0;
  --hl-idea: rgba(255, 150, 60, .32); --hl-idea-line: #FF9A3C;
  --hl-good: rgba(63, 203, 156, .32); --hl-good-line: #3FCB9C;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --hl-grammar: rgba(255, 214, 10, .32); --hl-grammar-line: #FFD60A;
  --hl-spelling: rgba(255, 99, 110, .32); --hl-spelling-line: #FF7A7F;
  --hl-word: rgba(90, 174, 240, .34); --hl-word-line: #5AAEF0;
  --hl-idea: rgba(255, 150, 60, .32); --hl-idea-line: #FF9A3C;
  --hl-good: rgba(63, 203, 156, .32); --hl-good-line: #3FCB9C;
} }
.hl-grammar { --hl: var(--hl-grammar); --hl-line: var(--hl-grammar-line); --hl-style: solid; }
.hl-spelling { --hl: var(--hl-spelling); --hl-line: var(--hl-spelling-line); --hl-style: wavy; }
.hl-word { --hl: var(--hl-word); --hl-line: var(--hl-word-line); --hl-style: dotted; }
.hl-idea { --hl: var(--hl-idea); --hl-line: var(--hl-idea-line); --hl-style: double; }
.hl-good { --hl: var(--hl-good); --hl-line: var(--hl-good-line); --hl-style: solid; }

.anno-text { white-space: pre-wrap; line-height: 1.95; font-size: 1.02rem; margin: 0; font-family: inherit; }
.anno-text.editable { cursor: text; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface); }
mark.hl { background: var(--hl); color: inherit; border-radius: 3px; padding: 1px 1px; cursor: pointer;
  text-decoration: underline var(--hl-style) var(--hl-line) 2px; text-underline-offset: 4px; transition: box-shadow .2s; }
mark.hl::after { content: attr(data-n); font-size: .62rem; font-weight: 800; vertical-align: super; margin-left: 2px; padding: 0 4px; border-radius: 6px; background: var(--hl-line); color: #fff; text-decoration: none; display: inline-block; line-height: 1.4; }
mark.hl:hover, mark.hl:focus-visible, mark.hl.editing, mark.hl.flash { box-shadow: 0 0 0 2px var(--hl-line); outline: none; }
[data-hl-only="grammar"] mark.hl:not(.hl-grammar), [data-hl-only="spelling"] mark.hl:not(.hl-spelling),
[data-hl-only="word"] mark.hl:not(.hl-word), [data-hl-only="idea"] mark.hl:not(.hl-idea), [data-hl-only="good"] mark.hl:not(.hl-good) { background: none; text-decoration: none; }
[data-hl-only="grammar"] mark.hl:not(.hl-grammar)::after, [data-hl-only="spelling"] mark.hl:not(.hl-spelling)::after,
[data-hl-only="word"] mark.hl:not(.hl-word)::after, [data-hl-only="idea"] mark.hl:not(.hl-idea)::after, [data-hl-only="good"] mark.hl:not(.hl-good)::after { display: none; }
[data-hl-only="grammar"] .hl-item:not(.hl-grammar), [data-hl-only="spelling"] .hl-item:not(.hl-spelling),
[data-hl-only="word"] .hl-item:not(.hl-word), [data-hl-only="idea"] .hl-item:not(.hl-idea), [data-hl-only="good"] .hl-item:not(.hl-good) { display: none; }

.hl-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.hl-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: .82rem; font-weight: 600; color: var(--text); white-space: nowrap; }
button.hl-chip { cursor: pointer; }
.hl-chip i { width: 14px; height: 14px; border-radius: 4px; background: var(--hl); border-bottom: 2px solid var(--hl-line); flex: none; }
.hl-chip.dim { opacity: .45; }
.hl-chip.on { border-color: var(--hl-line); box-shadow: 0 0 0 1px var(--hl-line); }

.hl-list { list-style: none; padding: 0; margin: 6px 0 0; }
.hl-item { display: flex; gap: 10px; padding: 9px 10px; border-left: 4px solid var(--hl-line); background: color-mix(in srgb, var(--hl) 35%, var(--surface)); border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.hl-item:hover, .hl-item.active { box-shadow: 0 0 0 2px var(--hl-line); }
.hl-num { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--hl-line); color: #fff; font-size: .72rem; font-weight: 800; }
.hl-type { color: var(--hl-line); }
.hl-quote { color: var(--muted); }
.hl-fix { font-size: .88rem; margin-top: 2px; }
.hl-fix s { color: var(--danger); }
.hl-comment { font-size: .9rem; margin-top: 2px; }

.anno-bar, .anno-pop { position: fixed; z-index: 95; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.anno-bar { display: flex; gap: 4px; padding: 5px; }
.anno-bar[hidden], .anno-pop[hidden] { display: none; }
.hl-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--text); }
.hl-btn:hover { background: var(--hl); }
.hl-btn i { width: 14px; height: 14px; border-radius: 4px; background: var(--hl); border-bottom: 2px solid var(--hl-line); }
.hl-btn kbd { font: inherit; font-size: .7rem; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.anno-pop { width: 360px; max-width: calc(100vw - 16px); padding: 12px 14px; overflow-y: auto; }
.anno-pop.sheet { max-height: 58vh; }
.anno-pop .field > span { font-size: .78rem; }
.hl-types { display: flex; flex-wrap: wrap; gap: 4px; }
.hl-quick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.chip-q { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 99px; padding: 3px 9px; font-size: .78rem; cursor: pointer; }
.chip-q:hover { border-color: var(--primary); }
.anno-bar.sheet, .anno-pop.sheet { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); top: auto; width: auto; }
@media (max-width: 599px) { .content:has(.anno-text) { padding-bottom: 55vh; } } /* room to scroll the last lines above the sheet */
.anno-bar.sheet { flex-wrap: wrap; justify-content: center; }
.anno-bar.sheet .hl-btn { flex: 1 1 45%; justify-content: center; padding: 10px; }
.anno-bar.sheet kbd, .anno-pop.sheet .hide-sm { display: none; }
.hl-panel { margin: 4px 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.hl-panel .hl-list { max-height: 38vh; overflow-y: auto; }
.anno-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); margin: 6px 0 10px; }

.lang-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lang-pick button { padding: 20px 10px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 700; font-size: 1rem; }
.lang-pick button:hover { border-color: var(--primary); }
.lang-pick .flag { font-size: 2rem; display: block; margin-bottom: 6px; }

.badge-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.badge { width: 92px; text-align: center; font-size: .75rem; font-weight: 600; }
.badge .b-ico { width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; background: var(--warn-soft); }
.badge.locked { opacity: .35; filter: grayscale(1); }
.notif { padding: 10px 0; border-bottom: 1px solid var(--border); }
.notif.unread { font-weight: 600; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .65rem; display: grid; place-items: center; padding: 0 4px; }
.peer { border-left: 3px solid var(--primary); }
pre.sub-text { white-space: pre-wrap; font-family: inherit; margin: 0; line-height: 1.7; }

/* ---------- Interactive worksheet (writing course) ---------- */
.ix-nav { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--border); box-shadow: var(--shadow); width: fit-content; max-width: 100%; }
.ix-nav a { min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 999px; background: var(--surface-2, var(--bg)); color: var(--text); font-weight: 800; font-size: .85rem; text-decoration: none; border: 2px solid transparent; }
.ix-nav a.done { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.ix-part { scroll-margin-top: 120px; }
.ix-blk { margin-top: 14px; }
.ix-blk + .ix-blk { padding-top: 14px; border-top: 1px dashed var(--border); }
.ix-q { font-weight: 700; margin: 0 0 10px; }
.ix-info { background: var(--info-soft); border-radius: var(--radius-sm); padding: 10px 14px; }
.ix-info.reminder { background: var(--warn-soft); }
.ix-info .ws-body > :first-child { margin-top: 0; }
.ix-fold { background: var(--surface-2, var(--bg)); border-radius: var(--radius-sm); padding: 10px 14px; }
.ix-fold summary { cursor: pointer; font-weight: 700; }
.ix-given { background: var(--surface-2, var(--bg)); border-left: 4px solid var(--primary); border-radius: 8px; padding: 8px 12px; margin: 4px 0 8px; line-height: 1.55; }
.ix-given mark, .ix-ctext mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 3px; font-weight: 700; }
/* chips + drop zones */
.ix-chip { display: inline-flex; align-items: center; padding: 7px 13px; border-radius: 999px; background: var(--primary-soft); color: var(--text); border: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); font-weight: 700; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; line-height: 1.2; }
.ix-chip:hover { border-color: var(--primary); }
.ix-chip.ix-picked { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.ix-chip.ix-dragging, .ix-oi.ix-dragging { opacity: .35; }
.ix-ghost { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; opacity: .95; box-shadow: 0 12px 30px rgba(0,0,0,.25); transform-origin: center; }
.ix-bank { display: flex; flex-wrap: wrap; gap: 8px; min-height: 48px; padding: 10px; border-radius: var(--radius-sm); border: 2px dashed var(--border); background: var(--surface-2, var(--bg)); margin-bottom: 12px; }
.ix-bank:empty::before { content: "✓ All placed"; color: var(--muted); font-size: .85rem; align-self: center; }
.ix-slot { display: inline-flex; align-items: center; min-height: 40px; min-width: 140px; padding: 3px; border-radius: 999px; border: 2px dashed color-mix(in srgb, var(--primary) 40%, var(--border)); background: var(--surface); vertical-align: middle; }
.ix-slot:empty::before { content: attr(data-ph); color: var(--muted); font-size: .8rem; padding: 0 12px; }
.ix-gap { min-width: 92px; min-height: 36px; margin: 2px 2px; }
.ix-over { border-color: var(--primary) !important; background: var(--primary-soft) !important; }
.ix-picking .ix-slot, .ix-picking .ix-bin, .ix-picking .ix-oi { border-color: var(--primary); }
.ix-match { display: grid; gap: 8px; }
.ix-mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(150px, 1.3fr); align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface-2, var(--bg)); }
.ix-mleft { font-weight: 600; }
.ix-arrow { color: var(--muted); }
.ix-bins { display: grid; grid-template-columns: repeat(var(--bins), minmax(0, 1fr)); gap: 10px; }
.ix-bin { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 8px; min-height: 120px; background: var(--surface); }
.ix-bin-h { font-weight: 800; margin-bottom: 8px; text-align: center; }
.ix-bin-body { display: flex; flex-wrap: wrap; gap: 6px; }
.ix-gaps { padding-left: 22px; display: grid; gap: 10px; margin: 0; line-height: 2.1; }
.ix-gin { font: inherit; padding: 4px 8px; border: 2px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); min-width: 90px; }
.ix-gin:focus { outline: none; border-color: var(--primary); }
/* choices */
.ix-choices { display: grid; gap: 8px; }
.ix-crow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2, var(--bg)); border: 2px solid transparent; }
.ix-ctext { flex: 1 1 240px; }
.ix-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.ix-opt { font: inherit; font-weight: 700; font-size: .9rem; text-align: left; line-height: 1.3; padding: 7px 13px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.ix-opt:hover { border-color: var(--primary); }
.ix-opt.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.ix-pick { margin: 6px 0 8px; }
/* ordering */
.ix-order { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ix-oi { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); border: 2px solid var(--border); cursor: grab; user-select: none; -webkit-user-select: none; }
.ix-oi.ix-picked { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent); }
.ix-oslot { font-size: .75rem; font-weight: 800; color: var(--primary); background: var(--primary-soft); padding: 4px 8px; border-radius: 8px; width: 112px; box-sizing: border-box; line-height: 1.2; }
.ix-onum { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); font-weight: 800; color: var(--primary); }
.ix-ograb { font-size: 1.3rem; color: var(--muted); touch-action: none; padding: 4px; cursor: grab; }
.ix-obtns { display: flex; flex-direction: column; gap: 2px; }
.ix-obtns .btn { padding: 0 8px; min-height: 22px; line-height: 1; font-size: .7rem; }
/* tap the reference */
.ix-refs { display: grid; gap: 10px; }
.ix-rrow { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2, var(--bg)); line-height: 2; }
.ix-rn { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); font-weight: 800; margin-top: 4px; }
.ix-tok { cursor: pointer; border-radius: 6px; padding: 2px 3px; border-bottom: 2px dotted color-mix(in srgb, var(--primary) 40%, transparent); }
.ix-tok:hover { background: var(--primary-soft); }
.ix-tok.on { background: var(--primary); color: var(--primary-ink); border-bottom-color: transparent; }
.ix-ref { background: var(--mark); color: inherit; padding: 2px 6px; border-radius: 6px; font-weight: 800; }
/* tables, writing, essays */
.ix-grid td, .ix-grid th { vertical-align: middle; }
.ix-grid .ix-cell { min-width: 140px; padding: 7px 9px; }
.ix-given-cell { font-weight: 600; }
.ix-witems { display: grid; gap: 12px; }
.ix-witem { display: grid; gap: 6px; }
.ix-wp { font-weight: 700; font-size: .92rem; }
.ix-field { display: grid; gap: 4px; }
.ix-field > span { font-size: .8rem; font-weight: 700; color: var(--muted); }
.ix-field textarea { min-height: 0; resize: vertical; }
.ix-witems.joined .ix-witem { padding-left: 12px; border-left: 3px solid var(--primary-soft); }
.ix-joined { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--success-soft); }
.ix-joined p { margin: 6px 0 0; line-height: 1.6; }
.ix-essay .ix-hint { margin: 4px 0 8px; }
.ix-essay .row { gap: 8px; }
/* checking */
.ix-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.ix-ok { border-color: var(--success) !important; background: var(--success-soft) !important; color: var(--text) !important; }
.ix-bad { border-color: var(--danger) !important; background: var(--danger-soft) !important; color: var(--text) !important; }
.ix-opt.ix-ok { background: var(--success) !important; color: #fff !important; }
.ix-opt.ix-bad { background: var(--danger) !important; color: #fff !important; }
.ix-tok.ix-ok { background: var(--success) !important; color: #fff !important; }
.ix-tok.ix-bad { background: var(--danger) !important; color: #fff !important; }
.ix-sc .check { padding: 6px 8px; border-radius: 8px; }
.ix-nudge { animation: ixNudge .9s ease 2; background: var(--danger-soft); }
@keyframes ixNudge { 0%,100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.ix-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
#w-submit.locked { opacity: .55; filter: grayscale(.4); }
@media (max-width: 640px) {
  .ix-mrow { grid-template-columns: 1fr; gap: 6px; }
  .ix-arrow { display: none; }
  .ix-slot { width: 100%; }
  .ix-gap { width: auto; }
  .ix-bins { grid-template-columns: 1fr; }
  .ix-oi { grid-template-columns: auto 1fr auto; }
  .ix-oslot { grid-column: 1 / -1; max-width: none; }
  .ix-nav { top: 58px; border-radius: 16px; }
}
/* How see-through the page panel is over a theme picture (Settings → Page panel) */
body.has-bg .content { background: color-mix(in srgb, var(--bg) var(--panel-p, 60%), transparent); }
body.has-bg.panel-clear .page-head h1, body.has-bg.panel-clear .page-head p, body.has-bg.panel-clear .content > h1, body.has-bg.panel-clear .content > h2,
body.has-bg.panel-clear .content > .stack > h2, body.has-bg.panel-clear .section-head h2 { text-shadow: 0 1px 3px var(--bg), 0 0 14px var(--bg), 0 0 24px var(--bg); }
body.has-bg.panel-clear .content { box-shadow: none; border-color: transparent; text-shadow: 0 0 4px var(--bg), 0 0 10px var(--bg), 0 0 18px var(--bg); font-weight: 500; }
body.has-bg.panel-clear .content :is(.card, [class*="card"], .btn, button, input, textarea, select, .pill, .tile, .modal) { text-shadow: none; }
/* Worksheet width + two-column parts (prompt / chart on the left, the work on the right) */
.ws.ix { max-width: 1320px; margin-left: auto; margin-right: auto; width: 100%; }
.ws.ix .ix-part:not(.has-split), .ws.ix .ws-intro, .ws.ix .ix-sc { max-width: 960px; width: 100%; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.ws.ix .ix-nav { margin-left: auto; margin-right: auto; }
.ws.ix .ix-submit { max-width: 960px; width: 100%; margin: 0 auto; }
.ix-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 14px; }
.ix-split + .ix-split, .ix-blk + .ix-split, .ix-split + .ix-blk { border-top: 1px dashed var(--border); padding-top: 16px; }
.ix-prompt { position: sticky; top: 124px; max-height: calc(100vh - 140px); overflow: auto; border-radius: var(--radius-sm); }
.ix-prompt .ix-blk { margin-top: 0; }
.ix-prompt .ix-info { background: var(--surface-2, var(--bg)); border: 1px solid var(--border); }
.ix-prompt .ws-img { display: block; width: 100%; max-height: none; height: auto; margin: 8px auto; border-radius: 8px; background: #fff; }
.ix-work > .ix-blk:first-child { margin-top: 0; }
@media (max-width: 960px) {
  .ix-split { grid-template-columns: 1fr; }
  .ix-prompt { position: static; max-height: none; }
}
.ix .ws-img { cursor: zoom-in; }
/* ---------- Speaking worksheet activities ---------- */
.sx-vocab { display: grid; gap: 8px; }
.sx-vrow { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2, var(--bg)); border: 2px solid transparent; }
.sx-vrow.ok { border-color: var(--success); }
.sx-ex { font-weight: 700; font-size: 1.02rem; }
.sx-stress { color: var(--primary); }
.sx-eg { font-style: italic; margin-top: 2px; }
.sx-vbtns { display: flex; gap: 6px; }
.sx-vbtns .btn.on { background: var(--danger); color: #fff; }
.sx-vcmp { grid-column: 1 / -1; }
.sx-vcmp:empty { display: none; }
.ok-text { color: var(--success); font-weight: 700; } .bad-text { color: var(--danger); font-weight: 700; }
.sx-mtitle { font-weight: 800; margin: 4px 0 8px; }
.sx-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; position: sticky; top: 118px; z-index: 3; padding: 6px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 94%, transparent); }
.sx-how { margin: 4px 0 8px; }
.sx-text { line-height: 2.5; font-size: 1.05rem; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2, var(--bg)); user-select: none; -webkit-user-select: none; }
.sx-w { cursor: pointer; border-radius: 5px; padding: 2px 1px; position: relative; }
.sx-w:hover { background: var(--primary-soft); }
.sx-w.st { font-weight: 800; color: var(--primary); }
.sx-w.un { text-decoration: underline 3px var(--accent); text-underline-offset: 4px; }
.sx-w.lab { background: var(--warn-soft); }
.sx-lab { position: absolute; top: -1.05em; left: 0; font-size: .62rem; font-weight: 800; color: #fff; background: var(--warn); border-radius: 4px; padding: 0 3px; line-height: 1.4; }
.sx-snd { font-size: .7rem; font-weight: 800; color: var(--info); margin-left: 1px; }
.sx-g { display: inline-block; min-width: 9px; text-align: center; color: var(--danger); font-weight: 900; border-radius: 4px; }
.sx-g.tap { cursor: pointer; min-width: 14px; }
.sx-g.tap:hover { background: var(--danger-soft); }
.sx-g.l { color: var(--info); }
.sx-g.i b { color: var(--success); font-size: .9rem; margin: 0 2px; }
.sx-w.ix-ok, .sx-g.ix-ok { background: var(--success-soft) !important; }
.sx-w.ix-bad, .sx-g.ix-bad { background: var(--danger-soft) !important; outline: 1px solid var(--danger); }
.sx-key { margin-top: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--success-soft); font-size: .92rem; line-height: 1.6; }
.sx-read { margin-top: 10px; display: grid; gap: 8px; }
.sx-rec { display: flex; gap: 12px; align-items: flex-start; margin-top: 6px; }
.sx-live { font-style: italic; margin-top: 4px; }
.sx-card { display: grid; gap: 8px; }
.sx-rlabel { font-weight: 800; }
.sx-cue { margin: 0; }
.sx-try { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pp-group { border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; margin-bottom: 6px; }
.pp-group summary { cursor: pointer; list-style: none; }
@media (max-width: 640px) { .sx-vrow { grid-template-columns: 1fr; } .sx-text { font-size: 1rem; } .sx-tools { top: 108px; } }
/* Tips and guided questions from the lessons */
.guide-card h3 { font-size: 1rem; }
.guide-tips { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.guide-q { margin-top: 10px; background: var(--surface-2, var(--bg)); border-radius: var(--radius-sm); padding: 8px 12px; }
.guide-q summary { cursor: pointer; font-weight: 700; }
.guide-q h4 { margin: 12px 0 4px; color: var(--primary); font-size: .92rem; }
.guide-q ul { margin: 0; padding-left: 20px; }
/* Homework due today / overdue: only "I understood" closes it */
.must-read { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px; background: rgba(10, 12, 30, .72); backdrop-filter: blur(4px); opacity: 0; transition: opacity .25s; }
.must-read.show { opacity: 1; }
.mr-card { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); color: var(--text); border-radius: 22px; padding: 26px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.35); text-align: center; border-top: 6px solid var(--danger); animation: mrPop .35s ease; }
.mr-ico { font-size: 3rem; animation: mrShake 1.2s ease 2; }
.mr-card h2 { margin: 6px 0; }
.mr-list { display: grid; gap: 8px; margin: 14px 0 18px; text-align: left; }
.mr-item { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); border-left: 4px solid var(--warn); }
.mr-item.over { background: var(--danger-soft); border-left-color: var(--danger); }
.mr-tag { font-size: .72rem; font-weight: 800; text-transform: uppercase; color: var(--danger); }
@keyframes mrPop { from { transform: scale(.85); } to { transform: none; } }
@keyframes mrShake { 0%,100% { transform: none; } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } }
/* Hints behind two confirmations */
.hints-box { margin: 0 0 12px; }
/* deliberately quiet: a small text link, so students try on their own first */
.hint-btn { background: none; border: 0; box-shadow: none; padding: 2px 4px; min-height: 0; font-size: .8rem; font-weight: 500; color: var(--muted); opacity: .55; text-decoration: underline dotted; text-underline-offset: 3px; }
.hint-btn:hover, .hint-btn:focus-visible { opacity: .9; background: none; }
.hint-btn.used { opacity: .8; }
.task-art .hints-box { margin: 6px 0 0; text-align: right; }
.task-art .hints-panel { text-align: left; margin-top: 6px; }
.hints-panel { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); border-left: 4px solid var(--warn); }
.hints-panel h4 { margin: 12px 0 4px; color: var(--warn); }
.hints-panel ul { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.hint-ask { text-align: center; padding: 10px 6px; }
.hint-ico { font-size: 3rem; }
/* Vocabulary packs */
.vp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.vp-pack { display: grid; gap: 6px; padding: 16px; border-radius: 18px; background: linear-gradient(160deg, color-mix(in srgb, var(--pc) 18%, var(--surface)), var(--surface)); border: 2px solid color-mix(in srgb, var(--pc) 40%, transparent); color: var(--text); text-decoration: none; transition: transform .15s; }
.vp-pack:hover { transform: translateY(-3px); }
.vp-big { font-size: 2.6rem; line-height: 1; }
.vp-bar, .vp-progress { display: block; height: 8px; border-radius: 99px; background: var(--surface-2, var(--bg)); overflow: hidden; }
.vp-bar i, .vp-progress i { display: block; height: 100%; background: var(--pc, var(--primary)); border-radius: 99px; transition: width .3s; }
.vp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vp-head h1 { margin: 0; }
.vp-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.vp-step { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--surface); border: 2px solid var(--border); color: var(--text); text-decoration: none; font-weight: 700; font-size: .88rem; }
.vp-step span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2, var(--bg)); font-size: .75rem; }
.vp-step.on { border-color: var(--primary); background: var(--primary-soft); }
.vp-step.done span { background: var(--success); color: #fff; }
.vp-stage { max-width: 760px; margin: 0 auto; border-top: 6px solid var(--pc); }
.vp-card { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 10px 0; }
.vp-emo-big { font-size: 5rem; line-height: 1.1; text-align: center; animation: mrPop .35s ease; }
.vp-mean { font-size: 1.1rem; font-weight: 700; margin: 0; }
.vp-ex { font-style: italic; }
.vp-ex.big { font-size: 1.15rem; text-align: center; font-style: normal; margin: 14px 0; }
.vp-blank { display: inline-block; min-width: 90px; border-bottom: 3px solid var(--primary); color: transparent; }
.vp-match { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.vp-match > div, .vp-opts { display: grid; gap: 8px; }
.vp-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
.vp-tile { font: inherit; font-weight: 700; padding: 12px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-align: left; }
.vp-tile.mean { font-weight: 500; font-size: .9rem; }
.vp-tile.on { border-color: var(--primary); background: var(--primary-soft); }
.vp-tile.ok { border-color: var(--success); background: var(--success-soft); }
.vp-tile.bad { border-color: var(--danger); background: var(--danger-soft); animation: ixNudge .4s; }
.vp-input { max-width: 320px; text-align: center; font-size: 1.2rem; }
.vp-done { text-align: center; padding: 20px 0; }
.vp-word { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface-2, var(--bg)); }
.vp-emo { font-size: 1.8rem; }
.vp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.vp-after { border-top: 6px solid var(--pc); margin-top: 16px; }
.vp-use { display: grid; gap: 6px; margin-bottom: 12px; }
@media (max-width: 640px) { .vp-match { grid-template-columns: 1fr; } .vp-opts { grid-template-columns: 1fr; } }
/* Grammar by function */
.fn-card { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--success-soft); display: grid; gap: 8px; }
.fn-use { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--surface); }
.fn-when { font-weight: 700; font-size: .9rem; }
.fn-ex { grid-column: 1; font-style: italic; color: var(--muted); }
.fn-use .btn { grid-row: 1 / span 2; grid-column: 2; }

/* ---------- 🕹️ pixel arcade ---------- */
.arc { display: flex; flex-direction: column; gap: 8px; }
.arc-hud { display: flex; justify-content: space-between; align-items: center; font: 11px "Press Start 2P", ui-monospace, monospace; background: #111827; color: #facc15; padding: 8px 10px; border: 3px solid #facc15; image-rendering: pixelated; }
.arc-prompt { font-size: 1.05rem; font-weight: 600; line-height: 1.45; text-align: center; padding: 10px 12px; background: var(--surface-2, #f3f4f6); border-radius: 10px; min-height: 2.6em; }
.arc-prompt .g-blank { color: var(--accent, #7c3aed); }
.arc-show { margin-top: 6px; color: #15803d; font-weight: 700; }
.arc-spell { font: 16px "Press Start 2P", ui-monospace, monospace; letter-spacing: 4px; margin-top: 8px; color: #16a34a; }
.arc-cv { width: 100%; height: auto; display: block; image-rendering: pixelated; border: 4px solid #111827; border-radius: 4px; touch-action: none; cursor: crosshair; background: #0b1026; }
.arc-pad { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 48px); gap: 6px; justify-content: center; }
.arc-pad button { font-size: 1.2rem; border: 3px solid #111827; background: #facc15; border-radius: 6px; cursor: pointer; }
.arc-pad [data-d="up"] { grid-column: 2; grid-row: 1; }
.arc-pad [data-d="left"] { grid-column: 1; grid-row: 2; }
.arc-pad [data-d="down"] { grid-column: 2; grid-row: 2; }
.arc-pad [data-d="right"] { grid-column: 3; grid-row: 2; }
.arc-type { display: block; width: min(360px, 100%); margin: 8px auto 0; padding: 10px 12px; font: 600 1.1rem ui-monospace, monospace; text-align: center; letter-spacing: 2px; border: 3px solid #111827; border-radius: 6px; background: #fef3c7; color: #111827; }
.arc-type.shake { animation: shake .35s; }
/* 🏁 Full IELTS tests */
.ft-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; text-decoration: none; color: inherit; border: 2px solid var(--primary); background: linear-gradient(90deg, var(--primary-soft), transparent); }
.ft-banner .ft-ico { font-size: 2rem; }
.ft-mini { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .85rem; }
.ft-sec { margin-bottom: 14px; border-top: 4px solid var(--c); }
.ft-sec h2 { margin: 0 0 8px; font-size: 1.15rem; }
.ft-band { font-weight: 800; color: var(--c); font-size: 1.1rem; }
.ft-part { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); margin-top: 8px; text-decoration: none; color: inherit; transition: background .15s; }
a.ft-part:hover { background: var(--primary-soft); }
.ft-part .ft-n { min-width: 84px; font-weight: 700; color: var(--c); }
.ft-part .ty-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ft-part.done { border-color: color-mix(in srgb, var(--c) 50%, var(--line)); }
.ft-part .ft-go { font-weight: 800; color: var(--c); }
.ft-part.locked { opacity: .6; }
.ft-step { max-width: 620px; margin: 30px auto; text-align: center; padding: 28px 22px; display: grid; gap: 14px; justify-items: center; }
.ft-step h1 { font-size: 1.35rem; margin: 0; }
.ft-step-ico { font-size: 3rem; }
.ft-track { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ft-track span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); opacity: .45; }
.ft-track span.on { opacity: 1; border-color: var(--ok, #22c55e); background: color-mix(in srgb, #22c55e 15%, transparent); }
.ft-track span.now { opacity: 1; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ft-banners { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.ft-banners .ft-banner { margin-bottom: 0; }
/* 🖼️ Sign-in screen designer */
.auth-logo { width: 72px; height: 72px; border-radius: 20px; object-fit: cover; display: block; margin: 0 auto 12px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.ll-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ll-photo { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; background: center / cover no-repeat var(--surface-2); border: 2px solid var(--border); }
.ll-photo.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ll-photo .btn { position: absolute; top: 4px; right: 4px; padding: 2px 7px; }
.ll-photo.add { display: grid; place-items: center; cursor: pointer; color: var(--muted); font-weight: 700; border-style: dashed; }
.ll-preview { position: fixed; inset: 0; z-index: 900; overflow: auto; }
.ll-preview .ll-dim { position: fixed; inset: 0; background: #000; pointer-events: none; }
.ll-preview .auth { position: relative; }
.ll-preview .ll-close { position: fixed; top: 14px; right: 14px; z-index: 2; }
@media (max-width: 560px) { .ft-part { flex-wrap: wrap; } .ft-part .ft-n { min-width: 0; } }
.arc-help { margin: 0; }
.arcade-grid .game-card { font-family: inherit; border-style: dashed; }
.arcade-grid .game-card b { letter-spacing: .02em; }
/* the homework picture (img/writing/<id>.jpg) */
.w-cover { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; margin-bottom: 12px; border: 1px solid var(--border); }
/* task bank: my homework first, then the practice library folded by group */
.bank-h { display: flex; align-items: center; gap: 8px; margin: 22px 0 12px; font-size: 1.15rem; }
.bank-group { margin-bottom: 10px; padding: 12px 16px; }
.bank-group > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; list-style: none; }
.bank-group > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.bank-group[open] > summary::before { transform: rotate(90deg); }
/* Bloom's taxonomy ladder: stages from remember (base) to create (top) */
.bloom-ladder { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; margin: 0 0 14px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.bl-step { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; font-size: .82rem; font-weight: 700; text-decoration: none; color: #1F2937; }
.bl-n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.65); font-size: .7rem; }
.bl-arrow { color: var(--muted); font-size: .8rem; }
.bl-remember { background: #B9C3DB; } .bl-understand { background: #9FD8EE; } .bl-apply { background: #9FDDBB; }
.bl-analyze { background: #CFE8A8; } .bl-evaluate { background: #F8E08E; } .bl-create { background: #F6B39A; }
.bloom-stage { margin: 22px 0 6px; padding: 12px 14px; border-radius: 12px; border-left: 6px solid rgba(0,0,0,.18); color: #1F2937; scroll-margin-top: 80px; }
.bloom-stage .muted { color: #374151; opacity: .85; }
.bl-head { display: flex; align-items: center; gap: 10px; }
.bl-badge { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.6); font-size: 1.2rem; }
.bl-title { font-weight: 800; font-size: 1.02rem; }
.bl-task { margin: 8px 0 0; font-weight: 600; }
/* vocabulary packs by level (A1 → C2) */
.vp-levels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
.vp-lv { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; position: relative; }
.vp-lv b { font-size: 1.15rem; }
.vp-lv span { font-size: .72rem; color: var(--muted); }
.vp-lv i { position: absolute; top: 4px; right: 6px; font-style: normal; font-size: .68rem; color: var(--success); font-weight: 700; }
.vp-lv.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.vp-lv.on span { color: rgba(255,255,255,.85); }
.vp-pack { position: relative; }
.vp-lvtag { position: absolute; top: 8px; right: 8px; font-size: .7rem; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: var(--pc, var(--primary)); color: #fff; }
.vp-lvtag.inline { position: static; vertical-align: middle; font-size: .8rem; }
.vp-lvswitch { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.vp-lvswitch a { padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border); font-size: .8rem; font-weight: 700; text-decoration: none; color: var(--text); }
.vp-lvswitch a.on { background: var(--pc, var(--primary)); border-color: transparent; color: #fff; }
@media (max-width: 560px) { .vp-levels { grid-template-columns: repeat(3, 1fr); } }
/* 💬 idioms */
.idiom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.idiom-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); position: relative; transition: transform .12s; }
.idiom-card:hover { transform: translateY(-2px); }
.idiom-card b { font-size: 1.05rem; padding-right: 36px; }
.idiom-card.done { border-color: var(--success); }
.idiom-play { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: .9rem; }
.idiom-page { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.idiom-video video, .idiom-yt { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #000; display: block; }
.idiom-yt iframe { width: 100%; height: 100%; border: 0; border-radius: 10px; }
.idiom-watch { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.idiom-watch .vp-progress { flex: 1; margin: 0; }
.idiom-info p { margin: 4px 0; }
.idiom-c { padding: 10px 0; border-bottom: 1px solid var(--border); }
.idiom-c:last-child { border-bottom: 0; }
.idiom-c.me b { color: var(--primary); }
.idiom-c p { margin: 4px 0 6px; }
.idiom-reply { margin-left: 14px; padding: 6px 10px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 6px; font-size: .9rem; }
/* 🔲 box see-through: cards and tiles over the background picture (buttons, inputs and menus stay solid) */
body.has-bg.boxes-clear :is(.card, .look-card, .vp-pack, .idiom-card, .game-card, .task-card, .bank-group, .theme-tile.none, .notice, .stat, .tile, .vp-lv:not(.on)) {
  background: color-mix(in srgb, var(--surface) var(--card-p, 100%), transparent) !important;
  backdrop-filter: blur(var(--card-blur, 0px)) saturate(1.1); -webkit-backdrop-filter: blur(var(--card-blur, 0px)) saturate(1.1);
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
}
body.has-bg.boxes-faint :is(.card, .look-card, .vp-pack, .idiom-card, .game-card, .task-card, .bank-group) { text-shadow: 0 0 3px var(--surface), 0 0 8px var(--surface); }
body.has-bg.boxes-faint :is(.card, .look-card) :is(.btn, button, input, textarea, select, .pill, .chip-q) { text-shadow: none; }
/* the library installing in the background */
.lib-chip { position: fixed; right: 16px; bottom: 16px; z-index: 90; padding: 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: .85rem; font-weight: 600; }
/* 📁 My materials */
.mm-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.mm-tools .input { max-width: 420px; }
.mm-folder { margin-bottom: 12px; }
.mm-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mm-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer; }
.mm-row:hover { background: var(--surface-2); }
.mm-row.on { border-color: var(--primary); background: var(--primary-soft); }
.mm-row input[type=checkbox] { width: 18px; height: 18px; flex: none; }
.mm-row .lib-thumb { flex: none; }
.mm-title { font-weight: 600; }
.mm-sent { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px; }
.mm-bar { position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 12px; padding: 10px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--primary); box-shadow: var(--shadow); }
.mm-bar b { margin-right: auto; }
.mm-send-list { max-height: 160px; overflow: auto; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
/* 🔎 detailed explanations on the results page */
.ex { margin-top: 8px; padding-top: 8px; border-top: 1px dashed color-mix(in srgb, currentColor 25%, transparent); font-size: .93rem; }
.ex p { margin: 6px 0; }
.ex-h { font-weight: 600; margin-bottom: 4px; }
.ex-ev { margin: 8px 0; padding: 8px 12px; border-left: 4px solid var(--success); background: color-mix(in srgb, var(--success) 8%, var(--surface)); border-radius: 0 8px 8px 0; font-style: italic; }
.ex-ev mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 3px; font-style: normal; }
.ex-wrong { margin: 8px 0; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.ex-tip { padding: 6px 10px; border-radius: 8px; background: var(--primary-soft); }
.hints-box .hints-panel { text-align: left; }
.hints-box { margin: 6px 0 10px; }
.ty-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 6px; }
.ty-chip { font-size: .7rem; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ---------- 📏 Band descriptors (AI feedback, teacher's feedback, marking form) ---------- */
.bd-line { margin: 8px 0 0; font-size: .82rem; color: var(--muted); line-height: 1.45; }
.bd-line b { color: var(--text); }
.bd-next { margin-top: 8px; padding: 7px 10px; border-radius: 8px; font-size: .84rem; background: color-mix(in srgb, var(--primary) 9%, var(--surface)); border-left: 3px solid var(--primary); }
.bd-teacher { margin-top: 8px; }
.bd-live:empty { display: none; }
.bd-live .bd-line:empty { display: none; }
.bd-details { margin-top: 12px; }
.bd-details > summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.bd-wrap { overflow-x: auto; margin-top: 8px; -webkit-overflow-scrolling: touch; }
.bd-table { border-collapse: collapse; font-size: .76rem; line-height: 1.4; min-width: 640px; width: 100%; }
.bd-table th, .bd-table td { border: 1px solid var(--border); padding: 6px 8px; vertical-align: top; text-align: left; }
.bd-table thead th { background: var(--surface-2); font-size: .78rem; }
.bd-table tbody th { width: 42px; text-align: center; font-size: 1rem; background: var(--surface-2); }
.bd-table td.on { background: color-mix(in srgb, var(--primary) 16%, var(--surface)); outline: 2px solid var(--primary); outline-offset: -2px; font-weight: 600; }
.bd-limits { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
/* ---------- Phones and tablets: room at the bottom so nothing (e.g. a host's corner badge) covers the last buttons ---------- */
@media (max-width: 1024px) {
  .content { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important; }
  .auth { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
/* the sign-in box: a light blur only, so the see-through setting really shows the picture */
body.has-bg .auth .card.auth-card { backdrop-filter: blur(var(--auth-blur, 0px)) saturate(1.05); -webkit-backdrop-filter: blur(var(--auth-blur, 0px)) saturate(1.05); }
/* Netlify's own "Powered by Netlify" badge: keep it above the phone/tablet menu bar */
@media (max-width: 899px) {
  body:has(.bottom-nav) #nl-badge-frame { bottom: calc(64px + env(safe-area-inset-bottom)) !important; }
  .content { padding-bottom: calc(140px + env(safe-area-inset-bottom)) !important; }
  body.focus-mode #nl-badge-frame { bottom: 0 !important; }
}
/* Tailored hints: method applied to this task + topic vocabulary */
.ht h4 { margin: 14px 0 6px; }
.ht-list { margin: 0 0 6px; padding-left: 20px; }
.ht-list li { margin: 4px 0; line-height: 1.5; }
.ht-list li.ht-sub { list-style: none; margin-left: 4px; color: var(--muted); font-size: .95em; }
.ht-list li b { color: var(--text); background: color-mix(in srgb, var(--accent, var(--primary)) 18%, transparent); border-radius: 4px; padding: 0 3px; }
.ht-vocab { width: 100%; border-collapse: collapse; font-size: .95em; }
.ht-vocab td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ht-vocab td:first-child { width: 42%; }
.ht-method { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 8px; }
.ht-method summary { cursor: pointer; font-weight: 600; }
@media (max-width: 600px) { .ht-vocab td { display: block; width: auto !important; border-bottom: 0; padding: 2px 4px; } .ht-vocab tr { display: block; border-bottom: 1px solid var(--border); padding: 6px 0; } }
/* ---------- 🏅 Badges: progress towards locked badges, and the celebration ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 10px; }
.badge { width: auto; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.badge.locked { opacity: 1; filter: none; color: var(--muted); }
.badge.locked .b-ico { filter: grayscale(1); opacity: .45; }
.badge .b-how { font-size: .68rem; font-weight: 500; line-height: 1.25; color: var(--muted); }
.badge .b-bar { width: 70%; height: 4px; border-radius: 9px; background: var(--border); overflow: hidden; margin-top: 2px; }
.badge .b-bar i { display: block; height: 100%; background: var(--primary); border-radius: 9px; }
.badge-party .bp-ico { font-size: 3.4rem; line-height: 1.2; animation: bp-pop .6s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes bp-pop { from { transform: scale(.3) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 🖼️ Sign-in box on the right (wide screens), so the picture's words show ---------- */
@media (min-width: 900px) {
  .auth:has(.auth-card) { place-items: center end; padding-right: max(32px, 7vw); }
  .auth.pos-center:has(.auth-card) { place-items: center; padding-right: 20px; }
  .auth.pos-left:has(.auth-card) { place-items: center start; padding-left: max(32px, 7vw); padding-right: 20px; }
}
/* ---------- 📱 Sign-in screen: a picture set per device, and phone / tablet previews in a frame ---------- */
.ll-dev { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 14px; }
.ll-dev .row.between { gap: 8px; flex-wrap: wrap; }
.ll-photos-tablet .ll-photo { aspect-ratio: 3 / 4; }
.ll-photos-phone { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.ll-photos-phone .ll-photo { aspect-ratio: 9 / 19.5; }
.ll-preview.ll-frame { inset: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 28px; border: 8px solid #111; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .75); background-size: cover !important; background-position: center !important; }
.ll-preview.dev-phone { width: min(390px, 94vw); height: min(800px, 92vh); }
.ll-preview.dev-tablet { width: min(600px, 94vw); height: min(800px, 92vh); }
.ll-preview.ll-frame .ll-dim { position: absolute; }
.ll-preview.ll-frame .auth { place-items: center !important; padding: 16px !important; min-height: 100%; }
.ll-preview.ll-frame .ll-close { position: fixed; top: 10px; right: 10px; }
/* sign-up hints: a little air between each box and the note under it */
.field-hint{margin:2px 2px 6px;line-height:1.45}

/* 🎧 Foundation course: the listening player of a worksheet */
.lx-player{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 14px;border:1px dashed var(--border);border-radius:var(--radius-sm,10px);background:var(--surface-2)}

/* ♿ Accessibility: a clear focus ring for keyboard users everywhere, and calmer motion for people who ask for it */
:where(a, button, input, select, textarea, summary, [tabindex], [role=button]):focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.flip:focus-visible, .ix-gin:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 9999; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 10px; font-weight: 700; }
.skip-link:focus { top: 8px; }

/* ✍️ Live writing — a calm, card-based class page */
.lw-bar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 14px; margin: -4px 0 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.lw-bar-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lw-bar-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.lw-bar-meta span { font-size: .82rem; color: var(--text-muted, #9aa0b4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-live { font-size: .72rem; font-weight: 800; letter-spacing: .08em; color: #fff; background: #e5484d; padding: 4px 9px; border-radius: 999px; animation: lwpulse 1.8s ease-in-out infinite; white-space: nowrap; }
.lw-live.off { background: var(--text-muted, #8a8fa3); animation: none; }
@keyframes lwpulse { 50% { box-shadow: 0 0 0 6px rgba(229,72,77,.18); } }
.lw-clock { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; padding: 2px 16px; border-radius: 12px; background: var(--surface-2, rgba(127,127,127,.08)); }
.lw-clock.low { color: #f5a524; } .lw-clock.over { color: #e5484d; } .lw-clock.off { font-size: 1rem; color: var(--text-muted, #8a8fa3); }
.lw-bar-r { display: flex; justify-content: flex-end; align-items: center; gap: 6px; flex-wrap: wrap; }
.lw-act { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: inherit; border-radius: 10px; padding: 7px 11px; font: inherit; font-weight: 600; cursor: pointer; transition: transform .12s, background .12s; }
.lw-act:hover { transform: translateY(-1px); border-color: var(--primary); }
.lw-act.on { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); border-color: var(--primary); }
.lw-act.end { background: #e5484d; border-color: #e5484d; color: #fff; }
.lw-saved-pill { font-weight: 700; color: var(--success); }
.lw-task { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 10px 14px; }
.lw-task summary { cursor: pointer; font-weight: 700; color: var(--text-muted, #9aa0b4); font-size: .85rem; }
.lw-prompt { white-space: pre-wrap; margin-top: 6px; font-weight: 600; font-size: 1.05rem; line-height: 1.55; }
.lw-msg { margin-bottom: 12px; padding: 12px 16px; border-radius: 14px; background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 26%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); }
.lw-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.lw-stat { display: flex; align-items: baseline; gap: 2px; padding: 8px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; }
.lw-stat b { font-size: 1.25rem; } .lw-stat.g b { color: var(--success); } .lw-stat.y b { color: #f5a524; } .lw-stat.b b { color: var(--primary); } .lw-stat.p b { color: #e5484d; }
.lw-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.lw-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); flex-wrap: wrap; }
.lw-seg button { border: 0; background: none; color: inherit; font: inherit; font-size: .88rem; padding: 6px 12px; border-radius: 9px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.lw-seg button b { font-size: .75rem; opacity: .7; }
.lw-seg button.on { background: var(--primary); color: #fff; }
.lw-sort { font-size: .88rem; color: var(--text-muted, #9aa0b4); }
.lw-sort select { margin-left: 6px; background: var(--surface); color: inherit; border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; font: inherit; }
.lw-legend { margin-bottom: 10px; }
.lw-list { display: grid; gap: 14px; }
.lw-list.lw-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.lw-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; box-shadow: 0 2px 10px rgba(0,0,0,.06); transition: border-color .15s, box-shadow .15s; min-width: 0; }
.lw-card:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: 0 6px 22px rgba(0,0,0,.1); }
.lw-card.waiting { opacity: .55; }
.lw-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.lw-av { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: hsl(var(--h) 55% 52%); }
.lw-who { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.lw-chip { font-style: normal; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; width: fit-content; }
.lw-chip.writing { background: color-mix(in srgb, var(--success) 20%, transparent); color: var(--success); }
.lw-chip.idle { background: rgba(245,165,36,.18); color: #f5a524; }
.lw-chip.waiting, .lw-chip.done { background: rgba(127,127,127,.15); color: var(--text-muted, #9aa0b4); }
.lw-wc { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 110px; }
.lw-wn { font-weight: 700; font-variant-numeric: tabular-nums; } .lw-wn small { opacity: .6; font-weight: 600; } .lw-wn.ok { color: var(--success); }
.lw-meter { width: 110px; height: 6px; border-radius: 6px; background: rgba(127,127,127,.18); overflow: hidden; }
.lw-meter i { display: block; height: 100%; border-radius: 6px; background: var(--primary); transition: width .4s; } .lw-meter i.done { background: var(--success); }
.lw-card-b { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 34%); gap: 16px; }
.lw-grid .lw-card-b { grid-template-columns: 1fr; }
.lw-col-text { min-width: 0; }
.lw-text { min-height: 2.2em; font-size: 1rem; }
.lw-col-fb { border-left: 1px dashed var(--border); padding-left: 14px; min-width: 0; }
.lw-grid .lw-col-fb { border-left: 0; padding-left: 0; border-top: 1px dashed var(--border); padding-top: 10px; }
.lw-fb-h { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted, #9aa0b4); margin-bottom: 8px; }
.lw-fb .hl-list { margin: 0; } .lw-fb .hl-item { margin-bottom: 6px; border-radius: 10px; }
.hl-item.lw-gone { opacity: .55; cursor: default; }
.lw-tip { margin-top: 12px; font-size: .88rem; color: var(--text-muted, #9aa0b4); }
.lw-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none; gap: 10px; }
.lw-item:hover { border-color: var(--primary); }
/* student */
.lw-mywc { display: flex; align-items: center; gap: 10px; }
.lw-saved { font-size: .8rem; color: var(--success); }
.lw-me { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 32%); gap: 14px; align-items: start; }
.lw-mine { border: 2px solid color-mix(in srgb, var(--primary) 55%, var(--border)); }
.lw-myfb-card { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; }
.lw-empty { color: var(--text-muted, #9aa0b4); font-size: .9rem; margin: 4px 0; }
.lw-class { margin-top: 22px; }
.lw-class-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1.05rem; }
.lw-peer .lw-text { font-size: .95rem; }
.lw-peerfb { margin-top: 8px; } .lw-peerfb summary { cursor: pointer; font-size: .85rem; color: var(--text-muted, #9aa0b4); margin-bottom: 6px; }
/* the student's own box: highlights drawn behind a see-through text box, lined up character for character */
.lw-edit { position: relative; }
.lw-back, .lw-ta { font-family: inherit; font-size: 1.05rem; line-height: 1.95; letter-spacing: normal; padding: 12px 14px; margin: 0; border: 1px solid transparent; box-sizing: border-box; width: 100%;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; }
.lw-back { position: absolute; inset: 0; color: transparent; pointer-events: none; overflow: hidden; }
.lw-back mark.hl { color: transparent; padding: 0; border-radius: 2px; }
.lw-back mark.hl::after { content: none; }
.lw-ta { position: relative; display: block; background: transparent; color: var(--text); caret-color: var(--primary); resize: none; overflow: hidden; min-height: 260px;
  border-color: var(--border); border-radius: 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.lw-ta:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.lw-banner { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60; background: var(--primary); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-weight: 700; text-decoration: none; box-shadow: 0 10px 28px rgba(0,0,0,.28); animation: lwpulse 1.8s ease-in-out infinite; }
@media (max-width: 900px) {
  .lw-bar { grid-template-columns: 1fr auto; } .lw-bar-r { grid-column: 1 / -1; justify-content: flex-start; }
  .lw-card-b, .lw-me { grid-template-columns: 1fr; }
  .lw-col-fb { border-left: 0; padding-left: 0; border-top: 1px dashed var(--border); padding-top: 10px; }
  .lw-myfb-card { position: static; max-height: none; }
  .lw-list.lw-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .lw-act span { display: none; } .lw-clock { font-size: 1.4rem; } .lw-wc { min-width: 80px; } .lw-meter { width: 80px; } }
/* ✍️ Homework the teacher sent back for corrections */
.task-card.must-fix { outline: 2px solid #8b5cf6; outline-offset: -2px; }
.rewrite-cta.must-fix { border: 2px solid #8b5cf6; background: color-mix(in srgb, #8b5cf6 12%, var(--surface)); }
.rw-fixes .hl-item.rw-auto .hl-quote { text-decoration: line-through; }

/* 👥 Class page: students × homework grid, easier to read */
.mx-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.mx-legend { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.mx-wrap { border: 1px solid var(--border); border-radius: 16px; overflow: auto; max-height: calc(100vh - 260px); }
.tbl.mx th { text-transform: none; letter-spacing: 0; z-index: 1; }
.tbl.mx th.sticky { z-index: 3; }
.mx-sh { vertical-align: bottom; font-size: .8rem; }
.mx-h { min-width: 128px; max-width: 150px; vertical-align: top; white-space: normal; }
.mx-hh { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: .8rem; }
.mx-hh b { background: var(--primary-soft); color: var(--primary); padding: 1px 7px; border-radius: 6px; }
.mx-due { margin-left: auto; color: var(--muted); font-weight: 600; font-size: .72rem; }
.mx-ht { margin-top: 4px; font-size: .8rem; font-weight: 600; color: var(--text); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mx-prog { margin-top: 6px; height: 4px; border-radius: 4px; background: var(--border); overflow: hidden; }
.mx-prog i { display: block; height: 100%; background: var(--success); border-radius: 4px; }
.tbl.mx tbody tr:hover td { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.tbl.mx tbody tr:hover td.sticky { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.mx-c { text-align: center; }
.mx-c .cell { min-width: 58px; padding: 6px 8px; border-radius: 10px; text-decoration: none; }
.mx-c a.cell:hover { outline: 2px solid currentColor; outline-offset: 1px; }
.cell.fix { background: color-mix(in srgb, #8b5cf6 18%, transparent); color: #8b5cf6; }
.cell.none { color: var(--border); }
.mx-name a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 170px; }
.mx-name a:hover b { color: var(--primary); }
.mx-name span { display: flex; flex-direction: column; line-height: 1.25; }
.mx-name .lw-av { width: 32px; height: 32px; font-size: .85rem; }
.mx-over { color: var(--danger); font-weight: 600; }

/* ✍️ Live writing inside the class + the board */
.lw-start { border: 2px solid color-mix(in srgb, var(--primary) 40%, var(--border)); }
.lw-start h2 { margin-top: 0; }
.lw-now { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; text-decoration: none; color: inherit;
  background: color-mix(in srgb, #e5484d 10%, var(--surface)); border: 2px solid color-mix(in srgb, #e5484d 45%, var(--border)); }
.lw-history { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.lw-hcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: inherit; text-decoration: none; }
.lw-hcard:hover { border-color: var(--primary); }
.lw-hdate { display: grid; place-items: center; width: 48px; height: 52px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); line-height: 1; flex: none; }
.lw-hdate b { font-size: 1.3rem; } .lw-hdate span { font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.lw-hline { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lw-back-link { display: inline-block; margin-bottom: 8px; font-size: .9rem; color: var(--muted); text-decoration: none; }
.lw-back-link:hover { color: var(--primary); }
.lw-imgs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.lw-imgs a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); cursor: zoom-in; }
.lw-imgs img { display: block; max-height: 320px; max-width: min(100%, 560px); object-fit: contain; }
.lb-drop { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; margin: 10px 0; border: 2px dashed var(--border); border-radius: 14px; cursor: pointer; color: var(--muted); text-align: center; }
.lb-drop:hover, .lb-drop.over { border-color: var(--primary); color: var(--primary); }
.lb-drop.busy { opacity: .6; pointer-events: none; }
.lb-imgs { display: flex; gap: 10px; flex-wrap: wrap; }
.lb-img { position: relative; } .lb-img img { height: 110px; border-radius: 10px; border: 1px solid var(--border); display: block; }
.lb-img button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; cursor: pointer; }

/* 🎤 speaking feedback colours: Pronunciation (purple) and Fluency (teal) */
:root { --hl-pron: #E3D4FF; --hl-pron-line: #7C4DDB; --hl-fluency: #BFEFF2; --hl-fluency-line: #0E8F99; }
:root[data-theme="dark"] { --hl-pron: rgba(160, 120, 255, .32); --hl-pron-line: #B79BFF; --hl-fluency: rgba(40, 200, 210, .30); --hl-fluency-line: #45D3DC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hl-pron: rgba(160, 120, 255, .32); --hl-pron-line: #B79BFF; --hl-fluency: rgba(40, 200, 210, .30); --hl-fluency-line: #45D3DC; } }
.hl-pron { --hl: var(--hl-pron); --hl-line: var(--hl-pron-line); --hl-style: dashed; }
.hl-fluency { --hl: var(--hl-fluency); --hl-line: var(--hl-fluency-line); --hl-style: dotted; }
[data-hl-only="pron"] mark.hl:not(.hl-pron), [data-hl-only="fluency"] mark.hl:not(.hl-fluency) { background: none; text-decoration: none; }
[data-hl-only="pron"] mark.hl:not(.hl-pron)::after, [data-hl-only="fluency"] mark.hl:not(.hl-fluency)::after { display: none; }
[data-hl-only="pron"] .hl-item:not(.hl-pron), [data-hl-only="fluency"] .hl-item:not(.hl-fluency) { display: none; }

/* 🎙 teacher voice notes */
.hl-voicerow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.hl-rec { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hl-voice-play { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--primary); font: inherit; font-size: .85rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.hl-voice-play:hover { border-color: var(--primary); }
.hl-voice-play.on { background: var(--primary); color: #fff; }
.hl-rec .hl-voice-play { margin-top: 0; }
.hl-recording { animation: hlrec 1s ease-in-out infinite; }
@keyframes hlrec { 50% { box-shadow: 0 0 0 5px rgba(229,72,77,.25); } }

/* ---------- 👨‍🏫 Marking a worksheet: the student's work as they did it ---------- */
.split.rv-split { grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); }
@media (max-width: 1000px) { .split.rv-split { grid-template-columns: 1fr; } .split.rv-split > .pane { position: static; max-height: none; } }
.rv-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.rv-stat { flex: 1 1 110px; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.rv-stat b { font-size: 1.35rem; line-height: 1.1; }
.rv-stat span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.rv-stat.ok { border-color: var(--success); background: var(--success-soft); } .rv-stat.ok b { color: var(--success); }
.rv-stat.bad b { color: var(--danger, #c0392b); } .rv-stat.warn { border-color: var(--warning, #d68910); }
.rv-ws-top { padding: 10px 14px; }
.rv-ws-top .anno-hint { margin: 0 0 8px; }
.rv-nav { top: 64px; z-index: 6; border-radius: 14px; width: auto; padding: 5px; gap: 4px; }
.rv-nav a { width: auto; height: 28px; padding: 0 10px; gap: 5px; display: inline-flex; align-items: center; font-size: .78rem; }
.rv-nav a span { font-weight: 600; color: var(--muted); max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-nav a:hover { border-color: var(--accent, var(--primary)); }
.rv-key { padding: 0 6px; border-radius: 6px; font-weight: 700; }
.rv-key.ok { background: var(--success-soft); color: var(--success); } .rv-key.bad { background: color-mix(in srgb, var(--danger, #c0392b) 14%, transparent); color: var(--danger, #c0392b); }
.rv-ws .ix-part { scroll-margin-top: 130px; }
.rv-ws .ix-prompt { top: 120px; }
@media (max-width: 1500px) { .rv-ws .ix-split { grid-template-columns: 1fr; } .rv-ws .ix-prompt { position: static; max-height: none; } }
/* read-only: nothing to drag, tick or type */
.rv-ws [data-chip], .rv-ws .ix-opt, .rv-ws .ix-tok, .rv-ws .sx-w, .rv-ws .sx-g, .rv-ws input, .rv-ws select, .rv-ws .check, .rv-ws [data-vsay], .rv-ws [data-vpick], .rv-ws [data-mv], .rv-ws .ix-ograb { pointer-events: none; }
.rv-ws [data-mv], .rv-ws .ix-ograb { display: none; }
.rv-ws .ix-opt:not(.on) { opacity: .45; }
.rv-ws .ix-bank.ix-left { opacity: .7; }
.rv-ws .ix-bank.ix-left::before { content: "Not used:"; font-size: .75rem; font-weight: 700; color: var(--muted); margin-right: 6px; align-self: center; }
.rv-ws .ix-slot:empty::after, .rv-ws .ix-slot:not(:has([data-chip]))::after { content: "— empty —"; color: var(--muted); font-size: .8rem; }
.rv-ws .ix-ro { white-space: pre-wrap; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2, var(--bg)); border: 1px solid var(--border); line-height: 1.7; }
.rv-ws .ix-ro.empty { color: var(--muted); font-style: italic; }
.rv-ws .ix-ans { background: var(--surface); border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); border-width: 1.5px; }
.rv-ws .ix-ans:hover { border-style: solid; }
.rv-ws .ix-ans-label { font-size: .85rem; font-weight: 700; margin: 10px 0 4px; }
.rv-ws .ix-foot { justify-content: flex-end; }
.rv-ws img.ws-img, .rv-ws .ws-body img { max-height: 340px; width: auto; max-width: 100%; cursor: zoom-in; display: block; margin: 0 auto; }

/* Foundation feedback colours (grammar / vocabulary / reading lessons) — each set of five stays distinct */
:root { --hl-tense: #FFC2E8; --hl-tense-line: #C2338F; --hl-structure: #CDD0FF; --hl-structure-line: #4A50D0; --hl-colloc: #DDF39A; --hl-colloc-line: #5E8000;
  --hl-form: #EBD5BA; --hl-form-line: #8A5A2B; --hl-meaning: #FFD39A; --hl-meaning-line: #D9822B; --hl-para: #FFC2E8; --hl-para-line: #C2338F; }
:root[data-theme="dark"] { --hl-tense: rgba(240, 90, 180, .32); --hl-tense-line: #F27BC4; --hl-structure: rgba(120, 128, 255, .34); --hl-structure-line: #9DA3FF; --hl-colloc: rgba(170, 220, 40, .30); --hl-colloc-line: #B5E04A;
  --hl-form: rgba(200, 150, 100, .32); --hl-form-line: #D9A877; --hl-meaning: rgba(255, 170, 70, .32); --hl-meaning-line: #FFB257; --hl-para: rgba(240, 90, 180, .32); --hl-para-line: #F27BC4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hl-tense: rgba(240, 90, 180, .32); --hl-tense-line: #F27BC4; --hl-structure: rgba(120, 128, 255, .34); --hl-structure-line: #9DA3FF; --hl-colloc: rgba(170, 220, 40, .30); --hl-colloc-line: #B5E04A;
  --hl-form: rgba(200, 150, 100, .32); --hl-form-line: #D9A877; --hl-meaning: rgba(255, 170, 70, .32); --hl-meaning-line: #FFB257; --hl-para: rgba(240, 90, 180, .32); --hl-para-line: #F27BC4; } }
.hl-tense { --hl: var(--hl-tense); --hl-line: var(--hl-tense-line); --hl-style: double; }
.hl-structure { --hl: var(--hl-structure); --hl-line: var(--hl-structure-line); --hl-style: dashed; }
.hl-colloc { --hl: var(--hl-colloc); --hl-line: var(--hl-colloc-line); --hl-style: double; }
.hl-form { --hl: var(--hl-form); --hl-line: var(--hl-form-line); --hl-style: dashed; }
.hl-meaning { --hl: var(--hl-meaning); --hl-line: var(--hl-meaning-line); --hl-style: double; }
.hl-para { --hl: var(--hl-para); --hl-line: var(--hl-para-line); --hl-style: dashed; }
[data-hl-only="tense"] mark.hl:not(.hl-tense) { background: none; text-decoration: none; } [data-hl-only="tense"] mark.hl:not(.hl-tense)::after { display: none; } [data-hl-only="tense"] .hl-item:not(.hl-tense) { display: none; }
[data-hl-only="structure"] mark.hl:not(.hl-structure) { background: none; text-decoration: none; } [data-hl-only="structure"] mark.hl:not(.hl-structure)::after { display: none; } [data-hl-only="structure"] .hl-item:not(.hl-structure) { display: none; }
[data-hl-only="colloc"] mark.hl:not(.hl-colloc) { background: none; text-decoration: none; } [data-hl-only="colloc"] mark.hl:not(.hl-colloc)::after { display: none; } [data-hl-only="colloc"] .hl-item:not(.hl-colloc) { display: none; }
[data-hl-only="form"] mark.hl:not(.hl-form) { background: none; text-decoration: none; } [data-hl-only="form"] mark.hl:not(.hl-form)::after { display: none; } [data-hl-only="form"] .hl-item:not(.hl-form) { display: none; }
[data-hl-only="meaning"] mark.hl:not(.hl-meaning) { background: none; text-decoration: none; } [data-hl-only="meaning"] mark.hl:not(.hl-meaning)::after { display: none; } [data-hl-only="meaning"] .hl-item:not(.hl-meaning) { display: none; }
[data-hl-only="para"] mark.hl:not(.hl-para) { background: none; text-decoration: none; } [data-hl-only="para"] mark.hl:not(.hl-para)::after { display: none; } [data-hl-only="para"] .hl-item:not(.hl-para) { display: none; }
.rv-colours { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem; }
.rv-colours select { width: auto; padding: 4px 8px; min-height: 0; font-size: .85rem; }
.rv-set { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.rv-set > b { font-size: .8rem; min-width: 118px; }

/* the first unfinished activity when a student tries to submit too early */
.ix-blk.ix-todo { animation: ixTodo 1.6s ease 2; border-radius: var(--radius-sm); }
@keyframes ixTodo { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 55%, transparent); } }
