/* English Platform — Shared Platform Design System */

*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}

/* Skip link */
.skip-link{
  position:absolute;
  top:-100%;left:16px;
  background:var(--fg);color:var(--bg);
  padding:8px 16px;
  border-radius:0 0 8px 8px;
  font-size:13px;font-weight:600;
  z-index:500;
  text-decoration:none;
  transition:top .15s;
}
.skip-link:focus{top:0}

html{color-scheme:light}

:root{
  /* ── Backgrounds: clean light ── */
  --bg:#f4f6fb;
  --bg-2:#ffffff;
  --bg-3:#eef0f7;

  /* ── Text ── */
  --fg:#0f1726;
  --muted:#4b5668;
  --muted-2:#5d6b80;

  /* ── Borders ── */
  --line:rgba(0,0,0,0.09);
  --line-2:rgba(0,0,0,0.045);

  /* ── Brand accent: warm teal ── */
  --teal:#4ecdc4;
  --teal-ink:#0f766e;   /* teal as text on light surfaces (5:1); the bright teal stays for fills */
  /* ── Indigo (adaptive/video-linked) ── */
  --indigo:#6366f1;
  --indigo-dim:rgba(99,102,241,0.10);
  --indigo-border:rgba(99,102,241,0.22);
  --teal-dim:rgba(78,205,196,0.12);
  --teal-border:rgba(78,205,196,0.28);

  /* ── Semantic ── */
  --red:#f87171;
  --red-dim:rgba(248,113,113,0.12);
  --amber:#fbbf24;
  --amber-dim:rgba(251,191,36,0.12);
  --green:#34d399;
  --green-dim:rgba(52,211,153,0.12);

  /* ── Layout ── */
  --sidebar-w:240px;
  --topbar-h:60px;
  --radius:12px;
  --ease:cubic-bezier(0.16,1,0.3,1);
}

html,body{height:100%}
body{
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  background:var(--bg);
  color:var(--fg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overflow-x:hidden;
  line-height:1.5;
}

a{color:inherit;text-decoration:none}

/* LAYOUT */
.platform{display:flex;min-height:100vh;background:var(--bg)}

/* SIDEBAR */
.sidebar{
  width:var(--sidebar-w);
  flex-shrink:0;
  background:#fff;
  border-right:1px solid var(--line);
  box-shadow:1px 0 8px rgba(0,0,0,0.06);
  display:flex;
  flex-direction:column;
  position:fixed;
  top:0;left:0;bottom:0;
  z-index:100;
  overflow-y:auto;
  overflow-x:hidden;
}
.sidebar::-webkit-scrollbar{width:3px}
.sidebar::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.1);border-radius:2px}

.sidebar-logo{
  padding:20px 20px 16px;
  border-bottom:1px solid var(--line);
  flex-shrink:0;
}
.sidebar-logo a{
  display:flex;flex-direction:column;gap:5px;
  text-decoration:none;
  transition:opacity .15s;
}
.sidebar-logo a:hover{opacity:.8}
.sidebar-logo a:focus-visible{outline:2px solid var(--teal);outline-offset:4px;border-radius:4px}

/* Logo wordmark components */
.logo-wordmark{
  display:flex;align-items:center;gap:6px;
  font-family:'Archivo',system-ui,sans-serif;
  font-weight:800;font-size:16px;letter-spacing:-0.03em;
  color:var(--teal-ink);
}
.logo-bridge-icon{
  width:26px;height:18px;flex-shrink:0;
  stroke:var(--teal);
}
.logo-sub{
  display:flex;align-items:center;gap:6px;
  font-size:9px;font-weight:600;letter-spacing:0.1em;
  color:var(--muted-2);
}
.logo-rule{flex:1;height:1px;background:var(--line)}

.sidebar-section{padding:8px 0}
.sidebar-label{
  font-size:11px;
  font-weight:600;
  color:var(--muted-2);
  padding:14px 20px 4px;
}
.sidebar-link{
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 20px;
  font-size:13.5px;
  font-weight:500;
  color:var(--muted);
  text-decoration:none;
  transition:color .15s,background .15s;
  position:relative;
  cursor:pointer;
}
.sidebar-link:hover{color:var(--fg);background:rgba(0,0,0,0.04)}
.sidebar-link.active{color:var(--fg);background:var(--teal-dim)}
.sidebar-link.active::before{
  content:'';
  position:absolute;left:0;top:0;bottom:0;
  width:2.5px;
  background:var(--teal);
  border-radius:0 2px 2px 0;
}
.sidebar-icon{width:16px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.sidebar-icon svg{width:15px;height:15px;display:block;flex-shrink:0}
.sidebar-logout{display:flex;align-items:center;justify-content:center;width:24px;height:24px}
.sidebar-logout svg{width:15px;height:15px;display:block}
.notif-btn svg{width:15px;height:15px;display:block}
.sidebar-badge{
  margin-left:auto;
  background:var(--teal);
  color:#060910;
  font-size:10px;
  font-weight:700;
  padding:2px 7px;
  border-radius:999px;
  min-width:18px;
  text-align:center;
}

.sidebar-footer{
  margin-top:auto;
  padding:16px 20px;
  border-top:1px solid var(--line);
  flex-shrink:0;
}
.sidebar-user{display:flex;align-items:center;gap:10px}
.sidebar-avatar{
  width:32px;height:32px;
  border-radius:50%;
  background:var(--teal-dim);
  border:1px solid var(--teal-border);
  display:flex;align-items:center;justify-content:center;
  font-size:11px;font-weight:700;
  color:var(--teal-ink);
  flex-shrink:0;
  font-family:'Inter',sans-serif;
}
.sidebar-user-info{flex:1;min-width:0}
.sidebar-user-name{font-size:12.5px;font-weight:600;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-user-role{font-size:11px;color:var(--muted-2)}
.sidebar-logout{
  color:var(--muted-2);
  font-size:15px;
  text-decoration:none;
  padding:4px;
  border-radius:4px;
  transition:color .15s;
  cursor:pointer;
  background:none;
  border:none;
}
.sidebar-logout:hover{color:var(--red)}
.sidebar-logout:focus-visible{outline:2px solid var(--teal);outline-offset:2px;border-radius:4px}

/* MAIN */
.main{
  margin-left:var(--sidebar-w);
  flex:1;
  display:flex;
  flex-direction:column;
  min-height:100vh;
  min-width:0;
}

/* TOPBAR */
.topbar{
  height:var(--topbar-h);
  background:#fff;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 28px;
  position:sticky;
  top:0;
  z-index:50;
  flex-shrink:0;
}
.topbar-left{display:flex;flex-direction:column;gap:1px}
.topbar-title{font-family:'Archivo',system-ui,sans-serif;font-weight:700;font-size:15px;color:var(--fg);margin:0;padding:0;line-height:inherit}
.topbar-sub{font-size:12px;color:var(--muted-2)}
.topbar-right{display:flex;align-items:center;gap:10px}
.topbar-hamburger{display:none}

/* CONTENT */
.content{padding:28px 32px;flex:1}

/* CARDS */
.card{
  background:var(--bg-2);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:22px 24px;
  box-shadow:0 1px 4px rgba(0,0,0,0.06);
}

/* STAT GRID */
.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.stat-card{
  background:var(--bg-2);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px 22px;
  box-shadow:0 1px 4px rgba(0,0,0,0.06);
}
.stat-label{font-size:11px;font-weight:600;color:var(--muted-2);margin-bottom:8px}
.stat-value{font-family:'Archivo',system-ui,sans-serif;font-weight:800;font-size:1.85rem;letter-spacing:-0.04em;color:var(--fg);line-height:1}
.stat-value em{color:var(--teal-ink);font-style:normal}
.stat-change,.stat-sub{font-size:11.5px;color:var(--muted-2);margin-top:5px}
.stat-change.positive{color:var(--green)}
.stat-change.negative{color:var(--red)}

/* SECTION HEADER */
.section-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.section-title{font-family:'Archivo',system-ui,sans-serif;font-weight:700;font-size:14.5px;color:var(--fg)}
.section-sub{font-size:12.5px;color:var(--muted-2);margin-top:2px}

/* GRID HELPERS */
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.grid-auto{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}

/* PROGRESS BAR */
.progress-bar{height:4px;background:rgba(0,0,0,0.08);border-radius:999px;overflow:hidden}
.progress-fill{height:100%;background:var(--teal);border-radius:999px;transition:width .6s var(--ease)}

/* BADGES */
.badge{display:inline-flex;align-items:center;font-size:11px;font-weight:600;padding:3px 9px;border-radius:999px;white-space:nowrap}
.badge-teal{background:var(--teal-dim);color:var(--teal-ink);border:1px solid var(--teal-border)}
.badge-red{background:var(--red-dim);color:var(--red);border:1px solid rgba(248,113,113,0.22)}
.badge-amber{background:var(--amber-dim);color:var(--amber);border:1px solid rgba(251,191,36,0.22)}
.badge-green{background:var(--green-dim);color:var(--green);border:1px solid rgba(52,211,153,0.22)}
.badge-muted{background:rgba(0,0,0,0.05);color:var(--muted);border:1px solid var(--line)}

/* BUTTONS */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  font-family:'Inter',system-ui,sans-serif;
  font-size:13.5px;
  font-weight:600;
  padding:9px 18px;
  border-radius:8px;
  border:none;
  cursor:pointer;
  transition:background .15s,transform .1s,box-shadow .15s,color .15s;
  text-decoration:none;
  white-space:nowrap;
  line-height:1;
  touch-action:manipulation;
}
.btn:active{transform:scale(.97)}
.btn:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.notif-btn:focus-visible,.theme-toggle:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.btn-teal{background:var(--teal);color:#060910}
.btn-teal:hover{background:#7de8ea;box-shadow:0 4px 16px rgba(95,212,214,0.3)}
.btn-primary{background:var(--fg);color:#fff}
.btn-primary:hover{background:#1a2d4d;box-shadow:0 4px 16px rgba(0,0,0,0.18)}
.btn-ghost{background:rgba(0,0,0,0.04);color:var(--muted);border:1px solid var(--line)}
.btn-ghost:hover{background:rgba(0,0,0,0.07);color:var(--fg)}
.btn-danger{background:var(--red-dim);color:var(--red);border:1px solid rgba(248,113,113,0.22)}
.btn-danger:hover{background:rgba(248,113,113,0.18)}
.btn-sm{font-size:12px;padding:6px 13px;border-radius:6px}
.btn-lg{font-size:15px;padding:13px 28px;border-radius:10px}
.btn:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}

/* INPUTS */
.input{
  background:var(--bg-3);
  border:1px solid var(--line);
  border-radius:8px;
  padding:10px 14px;
  font-size:14px;
  font-family:'Inter',system-ui,sans-serif;
  color:var(--fg);
  transition:border-color .2s,box-shadow .2s;
  width:100%;
}
.input:focus{outline:none;border-color:var(--teal);box-shadow:0 0 0 3px rgba(95,212,214,0.1)}
.input:focus-visible{outline:none;border-color:var(--teal);box-shadow:0 0 0 3px rgba(95,212,214,0.1)}
.tab:focus-visible,.sidebar-link:focus-visible{outline:2px solid var(--teal);outline-offset:2px;border-radius:4px}
.input::placeholder{color:var(--muted-2)}
.input:disabled{opacity:.5;cursor:not-allowed}
textarea.input{resize:vertical;min-height:100px;line-height:1.65}
select.input{cursor:pointer;appearance:none}

/* TABS */
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);margin-bottom:24px}
.tab{
  padding:10px 16px;
  font-size:13.5px;
  font-weight:500;
  color:var(--muted);
  cursor:pointer;
  border-bottom:2px solid transparent;
  margin-bottom:-1px;
  transition:color .15s,border-color .15s;
  text-decoration:none;
  background:none;
  border-top:none;
  border-left:none;
  border-right:none;
  font-family:inherit;
  white-space:nowrap;
}
.tab:hover{color:var(--fg)}
.tab.active{color:var(--fg);border-bottom-color:var(--teal)}

/* NOTIFICATION BUTTON */
.notif-btn{
  position:relative;
  background:rgba(0,0,0,0.04);
  border:1px solid var(--line);
  border-radius:8px;
  width:36px;height:36px;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  font-size:15px;
  transition:background .15s;
  color:var(--muted);
}
.notif-btn:hover{background:rgba(0,0,0,0.07);color:var(--fg)}
.notif-dot{
  position:absolute;
  top:7px;right:7px;
  width:6px;height:6px;
  border-radius:50%;
  background:var(--teal);
  border:1.5px solid var(--bg-2);
}

/* TABLE */
.table-wrap{overflow-x:auto;border-radius:var(--radius);border:1px solid var(--line)}
table{width:100%;border-collapse:collapse}
th{
  font-size:10.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted-2);
  padding:11px 14px;
  text-align:left;
  background:rgba(0,0,0,0.02);
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}
td{
  font-size:13.5px;
  color:var(--fg);
  padding:12px 14px;
  border-bottom:1px solid var(--line-2);
}
tr:last-child td{border-bottom:none}
tr:hover td{background:rgba(0,0,0,0.02)}

/* EMPTY STATE — upgraded to friendly look while keeping the .empty markup */
.empty{
  text-align:center;padding:44px 28px;color:var(--muted-2);
  background:var(--bg-2);
  border:1px dashed var(--line);
  border-radius:20px;
}
.empty > div:first-child{
  background:linear-gradient(135deg,#f3eeff 0%,#fbf7ff 100%) !important;
  border-radius:20px !important;
  opacity:1 !important;
  color:#7a5fd9 !important;
  width:60px !important;height:60px !important;
  margin:0 auto 16px !important;
}
.empty > div:first-child svg{width:26px !important;height:26px !important;stroke:currentColor !important}
.empty-icon{font-size:38px;margin-bottom:12px;opacity:.4;display:block}
.empty-title{font-family:'Archivo',system-ui,sans-serif;font-weight:700;font-size:17px;color:var(--fg);margin-bottom:8px;letter-spacing:-0.01em}
.empty-sub{font-size:13.5px;line-height:1.65;max-width:42ch;margin:0 auto;color:var(--muted)}
html.dark .empty{background:var(--bg-2);border-color:var(--line)}
html.dark .empty > div:first-child{background:linear-gradient(135deg,#1d1a32 0%,#141328 100%) !important;color:#b8a4ff !important}

/* DIVIDER */
.divider{height:1px;background:var(--line);margin:20px 0;border:none}

/* SCROLL ANIMATIONS */
.reveal{
  opacity:0;
  transform:translateY(18px);
  transition:opacity 550ms var(--ease),transform 550ms var(--ease);
}
.reveal.visible{opacity:1;transform:none}

.stagger-child{
  opacity:0;
  transform:translateY(18px);
  transition:opacity 480ms var(--ease),transform 480ms var(--ease);
  transition-delay:calc(var(--i,0) * 55ms);
}
.stagger-child.visible{opacity:1;transform:none}

@media(prefers-reduced-motion:reduce){
  .reveal,.stagger-child{opacity:1!important;transform:none!important;transition:none!important}
}

/* NOTIFICATION PANEL */
#notif-panel{
  position:fixed;
  z-index:400;
  width:360px;
  background:var(--bg-2);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:0 12px 40px rgba(0,0,0,0.15);
  opacity:0;
  visibility:hidden;
  transform:translateY(-8px) scale(.97);
  pointer-events:none;
  transition:opacity .18s var(--ease),transform .18s var(--ease),visibility 0s .18s;
}
#notif-panel.np-open{opacity:1;visibility:visible;transform:none;pointer-events:all;transition:opacity .18s var(--ease),transform .18s var(--ease),visibility 0s}
.np-header{display:flex;align-items:center;justify-content:space-between;padding:16px 18px 12px;border-bottom:1px solid var(--line)}
.np-title{font-family:'Archivo',sans-serif;font-weight:700;font-size:14px;color:var(--fg)}
.np-mark-all{font-size:12px;color:var(--teal-ink);background:none;border:none;cursor:pointer;font-family:inherit;padding:0}
.np-mark-all:hover{text-decoration:underline}
.np-mark-all:focus-visible{outline:2px solid var(--teal);outline-offset:2px;border-radius:3px}
.np-list{max-height:340px;overflow-y:auto}
.np-list::-webkit-scrollbar{width:3px}
.np-list::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.1);border-radius:2px}
.np-item{display:flex;align-items:flex-start;gap:12px;padding:13px 18px;cursor:pointer;transition:background .12s;position:relative}
.np-item:hover{background:rgba(0,0,0,0.03)}
.np-item+.np-item{border-top:1px solid var(--line-2)}
.np-unread{background:rgba(78,205,196,0.06)}
.np-icon{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.np-icon svg{width:14px;height:14px}
.np-icon-teal{background:var(--teal-dim);color:var(--teal-ink)}
.np-icon-green{background:var(--green-dim);color:var(--green)}
.np-icon-amber{background:var(--amber-dim);color:var(--amber)}
.np-body{flex:1;min-width:0}
.np-item-title{font-size:13px;font-weight:600;color:var(--fg);margin-bottom:2px}
.np-item-body{font-size:12px;color:var(--muted-2);line-height:1.45}
.np-item-time{font-size:11px;color:var(--muted-2);margin-top:4px}
.np-dot{width:7px;height:7px;border-radius:50%;background:var(--teal);flex-shrink:0;margin-top:4px}
.np-footer{padding:12px 18px;border-top:1px solid var(--line);text-align:center}
.np-all-link{font-size:12.5px;color:var(--teal-ink);text-decoration:none;font-weight:500}
.np-all-link:hover{text-decoration:underline}
.np-all-link:focus-visible{outline:2px solid var(--teal);outline-offset:2px;border-radius:3px}

/* ── RESPONSIVE / MOBILE ── */
@media(max-width:768px){
  :root{--sidebar-w:0px}

  /* Sidebar hides off-screen; toggled open via .sidebar-open on body */
  .sidebar{
    transform:translateX(-100%);
    transition:transform .25s cubic-bezier(0.16,1,0.3,1);
    z-index:200;
    width:260px;
  }
  body.sidebar-open .sidebar{transform:translateX(0)}

  /* Overlay when sidebar is open */
  body.sidebar-open::before{
    content:'';
    position:fixed;inset:0;
    background:rgba(0,0,0,0.35);
    z-index:199;
  }

  .main{margin-left:0}

  /* Topbar: add hamburger space */
  .topbar{padding:0 16px}
  .topbar-hamburger{
    display:flex;
    align-items:center;
    justify-content:center;
    width:44px;height:44px;
    background:none;border:none;
    cursor:pointer;color:var(--muted);
    border-radius:8px;
    flex-shrink:0;
    margin-right:4px;
  }
  .topbar-hamburger svg{width:18px;height:18px;display:block}
  .topbar-hamburger:hover{background:rgba(0,0,0,0.05);color:var(--fg)}
  .topbar-hamburger:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
  html.dark .topbar-hamburger:hover{background:rgba(255,255,255,0.07)}

  /* Content padding */
  .content{padding:20px 16px}

  /* Stat grid: 2-col on mobile */
  .stat-grid{grid-template-columns:repeat(2,1fr)}

  /* Two-col grids collapse to 1 */
  .grid-2,.grid-3{grid-template-columns:1fr}

  /* Tables: allow horizontal scroll */
  .table-wrap{border-radius:8px}

  /* Topbar breadcrumbs compact */
  .topbar-sub{display:none}
}

@media(max-width:480px){
  .stat-grid{grid-template-columns:1fr 1fr}
  .topbar-title{font-size:14px}
}

/* ══════════════════════════════════════════════════════════════════
   MOBILE OVERRIDES (≤768px) — page-specific layout collapses
   ══════════════════════════════════════════════════════════════════ */
@media(max-width:768px){
  /* Tabs scroll horizontally instead of squishing */
  .tabs{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    flex-wrap:nowrap;
    scrollbar-width:none;
  }
  .tabs::-webkit-scrollbar{display:none}
  .tab{flex-shrink:0;white-space:nowrap}

  /* Topbar */
  .topbar{padding:0 12px;gap:8px}
  .topbar-title{font-size:15px;line-height:1.2}
  .topbar-right{gap:6px}
  .topbar-right .btn{padding:6px 10px;font-size:12px}

  /* ── Dashboard ── */
  .content{padding:16px 12px !important}
  /* dashboard.html inlines: .content{grid-template-columns:1fr 290px} */
  body[class*=""] .content[style*="grid-template-columns"],
  body .content{
    grid-template-columns:1fr !important;
    gap:14px !important;
    padding:16px 12px !important;
  }
  .db-chips{grid-template-columns:1fr !important;gap:10px}
  .db-banner{padding:20px 18px 18px}
  .db-banner h1{font-size:19px;max-width:none}
  .db-banner-deco,.db-banner-deco2{display:none}
  .db-courses{
    display:flex !important;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    gap:12px;
    scroll-snap-type:x mandatory;
    scrollbar-width:none;
    padding-bottom:4px;
  }
  .db-courses::-webkit-scrollbar{display:none}
  .db-course{flex:0 0 78%;scroll-snap-align:start}
  .db-carousel-nav{display:none !important}
  /* Recent-lessons table head 4-col → stack header/values inline scroll */
  .db-table-head,.db-table-row{
    grid-template-columns:1fr !important;
    gap:6px;
  }
  .db-table-head{display:none !important}
  .db-table-row{padding:12px 14px;border:1px solid var(--line);border-radius:10px;margin-bottom:8px}
  .db-table-row > div{justify-self:start}
  .db-ring{width:120px;height:120px}
  .db-section-head h2{font-size:15px}

  /* ── Calendar ── */
  .cal-layout{grid-template-columns:1fr !important;gap:14px}
  .cal-cell{min-height:54px;padding:4px}
  .cal-num{font-size:11px}
  .cal-pill{font-size:9px;padding:1px 3px}
  .day-panel{position:static !important;padding:16px}

  /* ── Courses ── */
  .grid-auto{grid-template-columns:1fr !important;gap:14px}
  .course-card{max-width:none}
  .lesson-row{flex-wrap:wrap;gap:8px}
  .day-divider{margin:14px 0 8px}

  /* ── Homework ── */
  .hw-card{flex-direction:column;align-items:stretch;gap:12px;padding:16px}
  .hw-actions{justify-content:flex-end;width:100%}
  .hw-actions .btn{flex:1}
  .hw-type-icon{width:36px;height:36px}
  .hw-section-sep{margin:18px 0 10px}
  .adaptive-block{padding:16px}
  .adaptive-ex{flex-direction:column;align-items:stretch;gap:8px}
  .adaptive-ex-action .btn{width:100%}

  /* ── Live sessions ── */
  .session-card{flex-direction:column;align-items:stretch;gap:10px;padding:16px}
  .session-date-block{display:flex;align-items:center;gap:8px;text-align:left}
  .session-date-block .ses-day{font-size:1.6rem;line-height:1}
  .session-actions{flex-direction:row;justify-content:flex-end;flex-wrap:wrap}
  .session-actions .btn{flex:1}
  .rec-card{flex-wrap:wrap;gap:10px}

  /* ── Tests ── */
  .level-grid{grid-template-columns:1fr 1fr !important;gap:8px}
  .level-card{padding:14px 12px}
  .level-card .level-desc{display:none}
  .pt-card{flex-direction:column;align-items:stretch;gap:10px;padding:14px}
  .pt-actions{width:100%}
  .pt-actions .btn{flex:1}
  .quiz-wrap{padding:18px}

  /* ── Settings / Account ── */
  .settings-layout{
    grid-template-columns:1fr !important;
    gap:14px;
  }
  .settings-nav{
    position:static !important;
    display:flex;
    flex-direction:row;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .settings-nav::-webkit-scrollbar{display:none}
  .settings-nav-item{
    flex-shrink:0;
    border-left:none !important;
    border-bottom:2px solid transparent;
    padding:12px 16px !important;
  }
  .settings-nav-item.active{border-bottom-color:var(--teal) !important}
  .form-row{grid-template-columns:1fr !important;gap:10px}
  .avatar-upload{flex-direction:column;align-items:flex-start;gap:14px}
  .notif-row{flex-wrap:wrap;gap:10px}

  /* ── Progress ── */
  .level-history,.week-grid{height:auto}
  .skill-row{flex-wrap:wrap;gap:8px}
  .skill-name-col{width:100%}
  .skill-change{width:auto;margin-left:auto}

  /* ── Lesson page ── */
  .lesson-layout{grid-template-columns:1fr !important;display:flex !important;flex-direction:column}
  .lesson-main,.lesson-side{width:100%;min-width:0}
  .video-area{aspect-ratio:16/9;height:auto}

  /* ── Admin panel ── */
  /* exercise builder: 320px sidebar + main → stack */
  #tab-ex > div[style*="grid-template-columns:320px"],
  #tab-ex > div[style*="grid-template-columns: 320px"]{
    grid-template-columns:1fr !important;
    gap:14px !important;
  }
  .tier-grid{grid-template-columns:1fr 1fr !important;gap:10px}
  .tier-count{font-size:1.7rem}
  .qtype-row{flex-wrap:wrap}
  .qtype-btn{font-size:11px;padding:5px 8px}
  .cat-row{flex-wrap:wrap}
  .pool-row{flex-direction:column}
  .pool-btn{width:100%}

  /* Generic: any inline 2-col grid collapses */
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"]{
    grid-template-columns:1fr !important;
  }
  /* But keep stat-grid as 2-col (override above with stronger selector) */
  .stat-grid{grid-template-columns:1fr 1fr !important}

  /* Tables that don't fit — horizontal scroll */
  .table-wrap{overflow-x:auto}
  .table-wrap table{min-width:520px}

  /* Modal sizing */
  .jitsi-modal{width:100% !important;height:100% !important;border-radius:0 !important;margin:0 !important}

  /* Buttons easier to tap */
  .btn{min-height:40px}
  .btn-sm{min-height:34px}

  /* Recorder controls */
  .rec-controls{flex-direction:column;gap:10px}
  .rec-btn-main{width:64px;height:64px}
}

@media(max-width:420px){
  .level-grid{grid-template-columns:1fr !important}
  .tier-grid{grid-template-columns:1fr !important}
  .stat-grid{grid-template-columns:1fr 1fr !important}
  .topbar-title{font-size:14px}
  .db-course{flex:0 0 86%}
  .cal-cell{min-height:44px}
  .cal-pill{display:none}
  .cal-cell.has-event::after{width:6px;height:6px}
}

/* DAY LOCK (courses / schedule) */
.day-lock{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;color:var(--muted-2)}
.day-lock svg{width:12px;height:12px;flex-shrink:0}

/* ── SKELETON SHIMMER ── */
@keyframes shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}
.skeleton{
  background:linear-gradient(90deg,var(--bg-3) 25%,var(--bg) 50%,var(--bg-3) 75%);
  background-size:200% 100%;
  animation:shimmer 1.4s ease-in-out infinite;
  border-radius:6px;
}
@media(prefers-reduced-motion:reduce){.skeleton{animation:none;background:var(--bg-3)}}

/* ── TOAST NOTIFICATIONS ── */
#toast-container{
  position:fixed;
  bottom:24px;right:24px;
  z-index:600;
  display:flex;flex-direction:column;gap:10px;
  pointer-events:none;
}
.toast{
  background:var(--fg);
  color:var(--bg-2);
  padding:13px 18px;
  border-radius:10px;
  font-size:13.5px;
  font-weight:500;
  line-height:1.5;
  box-shadow:0 8px 28px rgba(0,0,0,0.2);
  opacity:0;
  transform:translateY(10px);
  transition:opacity .22s var(--ease),transform .22s var(--ease);
  pointer-events:auto;
  max-width:320px;
}
.toast.toast-visible{opacity:1;transform:none}
.toast.toast-success{background:#0d2016;color:#d1fae5;border:1px solid rgba(52,211,153,0.25)}
.toast.toast-error{background:#200d0d;color:#fde8e8;border:1px solid rgba(248,113,113,0.25)}
html.dark .toast{background:var(--bg-3);color:var(--fg)}
@media(prefers-reduced-motion:reduce){.toast{transition:none}}

/* ── DARK THEME ── */
html.dark{color-scheme:dark;
  --bg:#0e1726;
  --bg-2:#141f33;
  --bg-3:#1a2640;
  --fg:#e8edf5;
  --muted:#8a97aa;
  --muted-2:#8a97aa;
  --teal-ink:#4ecdc4;
  --line:rgba(255,255,255,0.08);
  --line-2:rgba(255,255,255,0.04);
}
html.dark .sidebar{background:var(--bg-2);box-shadow:1px 0 8px rgba(0,0,0,0.3)}
html.dark .topbar{background:var(--bg-2)}
html.dark .sidebar-link:hover{background:rgba(255,255,255,0.05)}
html.dark .btn-ghost{background:rgba(255,255,255,0.05)}
html.dark .btn-ghost:hover{background:rgba(255,255,255,0.09)}
html.dark .btn-primary{color:#0e1726}
html.dark .notif-btn{background:rgba(255,255,255,0.05)}
html.dark .notif-btn:hover{background:rgba(255,255,255,0.09)}
html.dark .notif-dot{border-color:var(--bg-2)}
html.dark .badge-muted{background:rgba(255,255,255,0.06)}
html.dark .progress-bar{background:rgba(255,255,255,0.08)}
html.dark #notif-panel{box-shadow:0 12px 40px rgba(0,0,0,0.5)}
html.dark th{background:rgba(255,255,255,0.02)}
html.dark tr:hover td{background:rgba(255,255,255,0.02)}
html.dark .np-item:hover{background:rgba(255,255,255,0.03)}
html.dark .np-unread{background:rgba(78,205,196,0.08)}
html.dark .np-list::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.1)}
html.dark .sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.1)}
html.dark .input{background:var(--bg-3)}

/* THEME TOGGLE BUTTON */
.theme-toggle{
  position:relative;
  background:rgba(0,0,0,0.04);
  border:1px solid var(--line);
  border-radius:8px;
  width:36px;height:36px;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
  transition:background .15s,color .15s;
  color:var(--muted);
}
.theme-toggle:hover{background:rgba(0,0,0,0.07);color:var(--fg)}
html.dark .theme-toggle{background:rgba(255,255,255,0.05)}
html.dark .theme-toggle:hover{background:rgba(255,255,255,0.09)}
.theme-toggle svg{width:15px;height:15px;display:block}

/* ══════════════════════════════════════════════════════════════════
   DESIGN LAYER v2 — additive only, all existing rules preserved
   Soft palette extension + reusable primitives
   ══════════════════════════════════════════════════════════════════ */
:root{
  --sky:#7cc4ff;       --sky-soft:rgba(124,196,255,0.12);   --sky-edge:rgba(124,196,255,0.32);
  --lilac:#b8a4ff;     --lilac-soft:rgba(184,164,255,0.13); --lilac-edge:rgba(184,164,255,0.32);
  --sunshine:#ffd166;  --sun-soft:rgba(255,209,102,0.16);   --sun-edge:rgba(255,209,102,0.4);
  --mint:#8fe3b7;      --mint-soft:rgba(143,227,183,0.14);  --mint-edge:rgba(143,227,183,0.34);
  --coral:#ff8a7a;     --coral-soft:rgba(255,138,122,0.14); --coral-edge:rgba(255,138,122,0.34);
  --bg-warm:#fafbff;
  --grad-sky:linear-gradient(135deg,#eaf4ff 0%,#f5f8ff 100%);
  --grad-lilac:linear-gradient(135deg,#f3eeff 0%,#fbf7ff 100%);
  --grad-mint:linear-gradient(135deg,#e8f8ef 0%,#f4fbf7 100%);
  --grad-sun:linear-gradient(135deg,#fff5dc 0%,#fffaee 100%);
  --grad-teal:linear-gradient(135deg,#e4f8f7 0%,#f3fcfb 100%);
  --shadow-sm:0 1px 2px rgba(15,23,38,0.04),0 1px 3px rgba(15,23,38,0.04);
  --shadow-md:0 2px 6px rgba(15,23,38,0.05),0 8px 20px rgba(15,23,38,0.05);
  --shadow-lift:0 4px 14px rgba(15,23,38,0.07),0 18px 40px rgba(15,23,38,0.08);
  --r-soft:16px;
  --r-card:20px;
  --r-pill:999px;
}
html.dark{
  --sky-soft:rgba(124,196,255,0.10);
  --lilac-soft:rgba(184,164,255,0.10);
  --sun-soft:rgba(255,209,102,0.10);
  --mint-soft:rgba(143,227,183,0.10);
  --coral-soft:rgba(255,138,122,0.10);
  --bg-warm:#0e1726;
  --grad-sky:linear-gradient(135deg,#152135 0%,#101a2d 100%);
  --grad-lilac:linear-gradient(135deg,#1d1a32 0%,#141328 100%);
  --grad-mint:linear-gradient(135deg,#0f2418 0%,#0d1a14 100%);
  --grad-sun:linear-gradient(135deg,#2b2516 0%,#1d190f 100%);
  --grad-teal:linear-gradient(135deg,#0f2624 0%,#0c1a19 100%);
  --shadow-sm:0 1px 2px rgba(0,0,0,0.25);
  --shadow-md:0 2px 6px rgba(0,0,0,0.3),0 8px 20px rgba(0,0,0,0.25);
  --shadow-lift:0 4px 14px rgba(0,0,0,0.35),0 18px 40px rgba(0,0,0,0.4);
}

/* Softer card hover — lifts the whole platform without markup changes */
.card,.stat-card{transition:transform .2s var(--ease),box-shadow .2s var(--ease),border-color .2s var(--ease)}
.card:hover,.stat-card:hover{transform:translateY(-1px);box-shadow:var(--shadow-md);border-color:rgba(0,0,0,0.12)}
html.dark .card:hover,html.dark .stat-card:hover{border-color:rgba(255,255,255,0.14)}

/* ── Feature card (landing + dashboard "what you can do") ── */
.feature-card{
  position:relative;
  background:var(--bg-2);
  border:1px solid var(--line);
  border-radius:var(--r-card);
  padding:24px 22px 22px;
  box-shadow:var(--shadow-sm);
  transition:transform .25s var(--ease),box-shadow .25s var(--ease),border-color .25s var(--ease);
  overflow:hidden;
}
.feature-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-lift)}
.feature-card .fc-icon{
  width:44px;height:44px;
  border-radius:13px;
  display:flex;align-items:center;justify-content:center;
  margin-bottom:14px;
}
.feature-card .fc-icon svg{width:20px;height:20px}
.feature-card .fc-title{
  font-family:'Archivo',sans-serif;font-weight:700;font-size:16px;
  letter-spacing:-0.01em;color:var(--fg);margin-bottom:6px;
}
.feature-card .fc-desc{font-size:13.5px;color:var(--muted);line-height:1.55;margin:0}
.feature-card.fc-teal  .fc-icon{background:var(--teal-dim);color:var(--teal-ink)}
.feature-card.fc-sky   .fc-icon{background:var(--sky-soft);color:var(--sky)}
.feature-card.fc-lilac .fc-icon{background:var(--lilac-soft);color:var(--lilac)}
.feature-card.fc-mint  .fc-icon{background:var(--mint-soft);color:#3aa775}
.feature-card.fc-sun   .fc-icon{background:var(--sun-soft);color:#c89200}
.feature-card.fc-coral .fc-icon{background:var(--coral-soft);color:#d65a4a}

/* ── Continue-learning card (dashboard hero / "pick up where you left off") ── */
.continue-card{
  position:relative;
  background:var(--grad-teal);
  border:1px solid var(--teal-border);
  border-radius:var(--r-card);
  padding:26px 28px;
  display:grid;
  grid-template-columns:1fr auto;
  gap:24px;
  align-items:center;
  overflow:hidden;
  box-shadow:var(--shadow-sm);
}
.continue-card::after{
  content:'';position:absolute;inset:auto -40px -60px auto;
  width:200px;height:200px;border-radius:50%;
  background:radial-gradient(circle,var(--teal-soft,rgba(78,205,196,0.18)) 0%,transparent 70%);
  pointer-events:none;
}
.continue-card .cc-eyebrow{font-size:11.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--teal-ink);margin-bottom:6px}
.continue-card .cc-title{font-family:'Archivo',sans-serif;font-weight:800;font-size:1.55rem;letter-spacing:-0.025em;color:var(--fg);margin:0 0 6px;line-height:1.15}
.continue-card .cc-sub{font-size:13.5px;color:var(--muted);margin:0 0 16px;max-width:46ch}
.continue-card .cc-actions{display:flex;gap:10px;flex-wrap:wrap}
@media(max-width:640px){
  .continue-card{grid-template-columns:1fr;padding:20px}
  .continue-card .cc-title{font-size:1.3rem}
}

/* ── Trust strip (exam logos / teacher badge) ── */
.trust-strip{
  background:var(--bg-2);
  border:1px solid var(--line);
  border-radius:var(--r-soft);
  padding:18px 22px;
  display:flex;align-items:center;gap:24px;flex-wrap:wrap;
  box-shadow:var(--shadow-sm);
}
.trust-strip .ts-label{
  font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;
  color:var(--muted-2);
}
.trust-strip .ts-items{
  display:flex;align-items:center;gap:22px;flex-wrap:wrap;flex:1;
  font-family:'Archivo',sans-serif;font-weight:800;letter-spacing:-0.02em;
  color:var(--muted);font-size:15px;
}
.trust-strip .ts-items span{opacity:.75;transition:opacity .15s}
.trust-strip .ts-items span:hover{opacity:1;color:var(--fg)}
.trust-strip .ts-teacher{
  display:inline-flex;align-items:center;gap:8px;
  font-size:12.5px;font-weight:600;color:var(--fg);
  padding:6px 12px 6px 6px;border-radius:999px;
  background:var(--mint-soft);border:1px solid var(--mint-edge);
}
.trust-strip .ts-teacher .ts-dot{width:8px;height:8px;border-radius:50%;background:#3aa775}

/* ── Friendly empty state ── */
.empty-friendly{
  text-align:center;padding:48px 24px;
  background:var(--bg-2);border:1px dashed var(--line);
  border-radius:var(--r-card);
}
.empty-friendly .ef-art{
  width:64px;height:64px;border-radius:20px;
  background:var(--grad-lilac);
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 16px;color:var(--lilac);
}
.empty-friendly .ef-art svg{width:28px;height:28px}
.empty-friendly .ef-title{font-family:'Archivo',sans-serif;font-weight:700;font-size:17px;color:var(--fg);margin-bottom:6px;letter-spacing:-0.01em}
.empty-friendly .ef-sub{font-size:13.5px;color:var(--muted);max-width:42ch;margin:0 auto 16px;line-height:1.55}

/* ── Section title (with optional eyebrow) ── */
.section-eyebrow{
  display:inline-block;
  font-size:11px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;
  color:var(--teal-ink);margin-bottom:8px;
}
.section-headline{
  font-family:'Archivo',sans-serif;font-weight:800;
  font-size:clamp(1.5rem,3vw,2.1rem);letter-spacing:-0.03em;
  color:var(--fg);line-height:1.1;margin:0 0 10px;
}
.section-lede{font-size:15px;color:var(--muted);line-height:1.55;margin:0 0 28px;max-width:60ch}

/* ── Soft gradient surfaces (drop on any container) ── */
.surf-sky{background:var(--grad-sky)}
.surf-lilac{background:var(--grad-lilac)}
.surf-mint{background:var(--grad-mint)}
.surf-sun{background:var(--grad-sun)}
.surf-teal{background:var(--grad-teal)}

/* ── Pill button variant (CTA-grade) ── */
.btn-pill{border-radius:var(--r-pill);padding:11px 22px}
.btn-lg.btn-pill{padding:14px 30px;font-size:15px}

/* Slightly bigger radius on primary btn for the friendlier feel */
.btn{border-radius:10px}
.btn-lg{border-radius:14px}

/* Reduced-motion safety for new hover lifts */
@media(prefers-reduced-motion:reduce){
  .card,.stat-card,.feature-card{transition:none}
  .card:hover,.stat-card:hover,.feature-card:hover{transform:none}
}

/* ══════════════════════════════════════════════════════════════════
   BUBBLY REFRESH — colourful, friendly, Duolingo-flavoured (not childish)
   Applies to the whole logged-in platform via shared components.
   ══════════════════════════════════════════════════════════════════ */
:root{
  --chunk-teal:#2fb3aa;
  --chunk-indigo:#4f46c9;
  --chunk-amber:#d98a06;
  --r-bubble:18px;
}

/* Warm, alive background instead of flat grey */
body{
  background:
    radial-gradient(1100px 620px at 6% -10%, rgba(95,212,214,0.12), transparent 58%),
    radial-gradient(1000px 560px at 102% -4%, rgba(139,124,246,0.10), transparent 55%),
    radial-gradient(900px 520px at 50% 118%, rgba(251,191,36,0.07), transparent 60%),
    var(--bg);
  background-attachment:fixed;
}

/* ── Chunky, pressable buttons (the Duolingo signature) ── */
.btn{border-radius:12px;font-weight:700}
.btn-lg{border-radius:16px}
.btn-teal,.btn-primary,.btn-danger{font-weight:800;letter-spacing:.005em}
.btn-teal{background:var(--teal);color:#063f3b;
  box-shadow:0 4px 0 var(--chunk-teal),0 7px 16px rgba(78,205,196,0.24)}
.btn-teal:hover{background:#5fdad2;box-shadow:0 4px 0 var(--chunk-teal),0 9px 22px rgba(78,205,196,0.30)}
.btn-teal:active{transform:translateY(4px);box-shadow:0 0 0 var(--chunk-teal)}
.btn-primary{background:var(--indigo);color:#fff;
  box-shadow:0 4px 0 var(--chunk-indigo),0 7px 16px rgba(99,102,241,0.26)}
.btn-primary:hover{background:#7c7ff5;box-shadow:0 4px 0 var(--chunk-indigo),0 9px 22px rgba(99,102,241,0.32)}
.btn-primary:active{transform:translateY(4px);box-shadow:0 0 0 var(--chunk-indigo)}
.btn-pill{box-shadow:0 4px 0 var(--chunk-teal),0 7px 16px rgba(78,205,196,0.22)}
.btn-pill:active{transform:translateY(4px);box-shadow:0 0 0 var(--chunk-teal)}

/* ── Rounder cards with a gentle lift ── */
.card,.stat-card{
  border-radius:var(--r-bubble);
  box-shadow:0 2px 4px rgba(15,42,68,0.04),0 10px 26px rgba(15,42,68,0.05);
  transition:transform .16s var(--ease),box-shadow .16s var(--ease),border-color .16s;
}
.card:hover,.stat-card:hover{
  transform:translateY(-3px);
  box-shadow:0 4px 8px rgba(15,42,68,0.05),0 16px 36px rgba(15,42,68,0.10);
}
.stat-value em{color:#4f46e5}
html.dark .stat-value em{color:#a5b4fc}

/* ── Colourful, gamified sidebar nav ── */
.sidebar-link{margin:3px 10px;border-radius:14px;padding:8px 12px;gap:12px;font-weight:600}
.sidebar-link:hover{background:rgba(99,102,241,0.07);color:var(--fg)}
.sidebar-link.active{
  background:linear-gradient(135deg,rgba(78,205,196,0.16),rgba(99,102,241,0.12));
  color:var(--fg);font-weight:800;
}
.sidebar-link.active::before{display:none}

/* Each icon becomes a coloured game-chip */
.sidebar-icon{
  width:32px;height:32px;border-radius:10px;
  background:color-mix(in srgb, var(--c,#6366f1) 15%, transparent);
  color:var(--c,#6366f1);
  transition:transform .18s cubic-bezier(.34,1.56,.64,1), background .18s, box-shadow .18s, color .18s;
}
.sidebar-icon svg{width:17px;height:17px}
.sidebar-link:hover .sidebar-icon{
  background:var(--c,#6366f1);color:#fff;
  transform:scale(1.1) rotate(-4deg);
  box-shadow:0 5px 12px color-mix(in srgb, var(--c,#6366f1) 42%, transparent);
}
.sidebar-link.active .sidebar-icon{
  background:var(--c,#6366f1);color:#fff;
  box-shadow:0 5px 14px color-mix(in srgb, var(--c,#6366f1) 45%, transparent);
}
.sidebar-link.active:hover .sidebar-icon{transform:scale(1.08) rotate(-3deg)}

/* Per-item colour palette (data-icon on the chip) */
.sidebar-icon[data-icon="dashboard"]{--c:#3b82f6}   /* blue  */
.sidebar-icon[data-icon="courses"]{--c:#f97316}     /* orange*/
.sidebar-icon[data-icon="homework"]{--c:#ef4444}    /* red   */
.sidebar-icon[data-icon="exercises"]{--c:#14b8a6}   /* teal  */
.sidebar-icon[data-icon="mocks"]{--c:#8b5cf6}       /* purple*/
.sidebar-icon[data-icon="live"]{--c:#ec4899}        /* pink  */
.sidebar-icon[data-icon="schedule"]{--c:#06b6d4}    /* cyan  */
.sidebar-icon[data-icon="progress"]{--c:#22c55e}    /* green */
.sidebar-icon[data-icon="analytics"]{--c:#f59e0b}   /* amber */
.sidebar-icon[data-icon="settings"]{--c:#64748b}    /* slate */

/* Give the two "mocks" entries distinct hues by position */
.sidebar-link[href="diagnostic.html"] .sidebar-icon{--c:#e11d48}  /* rose  */

/* Coloured badge pop */
.sidebar-badge{background:#ef4444;color:#fff;font-weight:800;box-shadow:0 2px 6px rgba(239,68,68,.35)}

/* ── Pill tabs instead of underline ── */
.tabs{border-bottom:none;gap:6px;flex-wrap:wrap}
.tab{border:none;border-bottom:none;border-radius:999px;padding:8px 16px;font-weight:700;color:var(--muted-2)}
.tab:hover{color:var(--fg);background:rgba(0,0,0,0.04)}
.tab.active{background:var(--teal-dim);color:var(--teal-ink);border-bottom:none}

/* ── Vibrant progress + rounder badges ── */
.progress-bar{height:8px;background:rgba(15,23,38,0.07)}
.progress-fill{background:linear-gradient(90deg,var(--teal),#7de8ea)}
.badge{font-weight:700;padding:4px 11px}

/* ── Soft coloured icon tiles pop a little more ── */
.mobile-tabbar .mtab.is-active svg{transform:scale(1.08);transition:transform .15s var(--ease)}

/* ── Colourful skill/category tiles (exercises picker) — the Duolingo look ── */
.cat-card{border-radius:16px;transition:transform .15s var(--ease),border-color .15s,box-shadow .15s}
.cat-card:hover{transform:translateY(-3px)}
.cat-card .cat-icon{width:44px;height:44px;border-radius:13px;transition:transform .18s var(--ease)}
.cat-card:hover .cat-icon{transform:scale(1.08) rotate(-5deg)}
.cat-card:nth-child(6n+1) .cat-icon{background:var(--teal-dim);color:var(--teal-ink)}
.cat-card:nth-child(6n+2) .cat-icon{background:rgba(99,102,241,0.14);color:var(--indigo)}
.cat-card:nth-child(6n+3) .cat-icon{background:rgba(249,115,22,0.16);color:#f97316}
.cat-card:nth-child(6n+4) .cat-icon{background:rgba(16,185,129,0.16);color:#10b981}
.cat-card:nth-child(6n+5) .cat-icon{background:rgba(236,72,153,0.14);color:#ec4899}
.cat-card:nth-child(6n+6) .cat-icon{background:rgba(251,191,36,0.20);color:#d97706}

/* ── Exercise / lesson list number chips get a friendly teal ── */
.ex-card .ex-num:not(.done){background:var(--teal-dim);color:var(--teal-ink);border-color:var(--teal-border)}

/* ── Course thumbnails: rounder, playful hover ── */
.course-card{border-radius:16px}
.course-card:hover .course-thumb{transform:scale(1.02)}
.course-thumb{transition:transform .2s var(--ease)}

@media(prefers-reduced-motion:reduce){
  .btn-teal:active,.btn-primary:active,.btn-pill:active{transform:none}
  .cat-card:hover,.course-card:hover .course-thumb{transform:none}
  .cat-card:hover .cat-icon{transform:none}
}

/* ══════════════════════════════════════════════════════════════════
   APP-STYLE MOBILE SHELL — bottom tab bar, sticky topbar, safe areas
   Makes the platform feel like a native app on phones and inside a
   webview wrapper (notch + home-indicator safe insets honoured).
   ══════════════════════════════════════════════════════════════════ */
.mobile-tabbar{
  display:none;
  position:fixed;left:0;right:0;bottom:0;z-index:180;
  background:#fff;border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom,0px);
  box-shadow:0 -2px 14px rgba(15,23,38,0.06);
}
.mobile-tabbar .mtab{
  flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  padding:8px 2px 6px;min-height:52px;
  background:none;border:none;cursor:pointer;
  color:var(--muted-2);font:600 10px/1 'Inter',system-ui,sans-serif;
  text-decoration:none;-webkit-tap-highlight-color:transparent;
}
.mobile-tabbar .mtab svg{width:22px;height:22px}
.mobile-tabbar .mtab.is-active{color:var(--teal-ink)}
.mobile-tabbar .mtab:active{background:rgba(0,0,0,0.04)}
html.dark .mobile-tabbar{background:var(--bg-2);border-top-color:rgba(255,255,255,0.08)}

@media(max-width:768px){
  .mobile-tabbar{display:flex}
  body.has-tabbar .main{padding-bottom:calc(58px + env(safe-area-inset-bottom,0px))}

  /* Sticky single-row topbar; title truncates instead of colliding */
  .topbar{
    position:sticky;top:0;z-index:150;
    min-height:52px;height:auto;
    padding-top:env(safe-area-inset-top,0px);
    overflow:hidden;
  }
  .topbar-left{flex:1 1 auto;min-width:0;flex-direction:row;align-items:center;gap:8px}
  .topbar-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .topbar-right{flex:0 0 auto;gap:6px}
  .topbar-right .btn{white-space:nowrap;max-width:44vw;overflow:hidden;text-overflow:ellipsis}
  /* On tab-bar pages the bottom bar already labels the section, so the topbar
     title is redundant and gets crushed by page CTAs - hide it. Focus pages
     (lesson etc.) keep their title since it names the current lesson. */
  body.has-tabbar .topbar-title{display:none}

  /* Comfortable tap targets */
  .btn,.opt,.sidebar-link,.tab,.pool-btn,.cat-card,.ex-card{min-height:44px}
  a,button{-webkit-tap-highlight-color:transparent}

  /* When the drawer opens on mobile, the More tab triggers body.sidebar-open;
     make the drawer clear the tab bar */
  body.sidebar-open .sidebar{padding-bottom:calc(58px + env(safe-area-inset-bottom,0px))}

  /* On tab-bar pages the real animated mascot stays visible — platform.js
     docks her small above the tab bar (same engine as desktop, just pinned
     and scaled down) instead of swapping in a static button. */
}

/* ── Readability & touch floor (app store pass) ──────────────────────────────
   Text never drops below 12px; empty counters disappear; on phones every
   control is at least 44px tall so it can be hit with a thumb. */
[hidden]{display:none!important}
.sidebar-badge:empty{display:none}
.sidebar-badge,.badge,.sidebar-label,.sidebar-user-role,.stat-label,.stat-sub,.np-item-time,
.qtype-btn,.cal-num,.cal-pill,.day-lock,.skill-tag,.logo-sub,.sidebar-avatar,th{font-size:12px}
.mobile-tabbar .mtab{font-size:11px}
@media (max-width:768px),(pointer:coarse){
  .notif-btn,.theme-toggle,.topbar .sidebar-avatar,.topbar-hamburger{min-width:44px;min-height:44px}
  .btn,.tab,.ls-tab,.qtype-btn{min-height:44px}
  .input,select.input,textarea.input{min-height:44px;font-size:16px}
  .db-see-all,.np-all-link,.np-mark-all{display:inline-flex;align-items:center;min-height:44px;padding:0 4px}
}
