/* =====================================================================
   LearnBisaya Online · layout + components
   Dashboard layout in the style of an admin template: fixed sidebar,
   fixed header, light page, white bordered cards.
   Restyle here: change the tokens in :root first, then the components.
   ===================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  --font: "Jost", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;

  /* Pastel palette: blush, coral, mint, lilac, butter, sky */
  --bg: #fdf8f7;            /* page background (soft blush) */
  --surface: #ffffff;       /* cards, sidebar, header */
  --surface-2: #fbf2f1;     /* table headers, subtle fills */
  --border: #f3e6e4;
  --border-strong: #ead6d3;
  --text: #3d3a44;          /* headings */
  --text-2: #5e5966;        /* body text */
  --muted: #8f8994;
  --faint: #b3adb6;

  --primary: #e8838f;  --primary-hover: #d96c79;  --primary-soft: #fdeef0;  --primary-line: #f6cdd2;  --primary-text: #d0606e;
  --success: #8fcfc0;  --success-soft: #e8f6f2;  --success-line: #c3e8de;  --success-text: #3f9c87;
  --warning: #f2d58a;  --warning-soft: #fdf6e3;  --warning-line: #f4e3b5;  --warning-text: #a8822a;
  --danger:  #e07fa3;  --danger-soft:  #fbe9f0;  --danger-line:  #f3c5d6;  --danger-text:  #c9557f;
  --info:    #b9a3d3;  --info-soft:    #f3eef9;  --info-line:    #ddd0ec;  --info-text:    #8a6bb3;
  --sky:     #9ccbe0;  --sky-soft:     #eaf4f9;  --sky-line:     #cbe3ee;  --sky-text:     #4f8fab;
  --gray-soft: #f4eceb;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 2px 6px rgba(140, 90, 90, .04);
  --shadow-lg: 0 10px 30px rgba(140, 90, 90, .10);

  --sidebar-w: 250px;
  --sidebar-w-collapsed: 80px;
  --header-h: 66px;
  --gutter: 30px;
}

:root[data-theme="dark"] {
  --bg: #0d0e12;
  --surface: #111217;
  --surface-2: #15171c;
  --border: #1e2027;
  --border-strong: #2b2d36;
  --text: #f5f5f5;
  --text-2: #c4c6d0;
  --muted: #808290;
  --faint: #636674;
  --primary-soft: #172331;  --primary-line: #1b3a5f;
  --success-soft: #1f212a;  --success-line: #1f3a2b;
  --warning-soft: #242320;  --warning-line: #3d3317;
  --danger-soft:  #302024;  --danger-line:  #4d2430;
  --info-soft:    #2f264f;  --info-line:    #3e2f6b;
  --gray-soft: #1e2027;
  --sky-soft: #1c2a31;  --sky-line: #27414d;
  --shadow: none;
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .4);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text-2);
  font-family: var(--font); line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { color: var(--text); line-height: 1.3; margin: 0; font-weight: 600; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
img { max-width: 100%; }
svg.i { width: 1.15em; height: 1.15em; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .86rem; }
.xs { font-size: .78rem; }
.strong { font-weight: 600; color: var(--text); }
.lead { color: var(--muted); }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 3. App shell ---------- */
.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; transition: width .25s ease, transform .25s ease;
}
.sidebar-header { height: var(--header-h); display: flex; align-items: center; padding: 0 24px; position: relative; flex-shrink: 0; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.08rem; white-space: nowrap; }
.logo:hover { color: var(--text); }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: .95rem;
}
.logo-text span { color: var(--primary-text); }
.sidebar-toggle {
  position: absolute; right: -15px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
  display: grid; place-items: center; cursor: pointer; z-index: 2;
}
.sidebar-toggle:hover { color: var(--primary); }
.sidebar-toggle svg { transition: transform .25s; }
.sidebar-body { flex: 1; overflow-y: auto; padding: 8px 16px 20px; }
.menu-heading { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 18px 10px 8px; white-space: nowrap; }
.menu-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: .93rem; white-space: nowrap; border: 1px solid transparent;
}
.menu-link svg.i { color: var(--faint); width: 19px; height: 19px; }
.menu-link:hover { color: var(--primary); background: var(--surface-2); }
.menu-link:hover svg.i { color: var(--primary); }
.menu-link.active { color: var(--primary); background: var(--surface-2); border-color: var(--border); font-weight: 600; }
.menu-link.active svg.i { color: var(--primary); }
.menu-link .badge { margin-left: auto; }
.menu-sub { padding-left: 31px; margin: 2px 0 4px; border-left: 1px solid var(--border); margin-left: 19px; }
.menu-sub .menu-link { padding: 6px 10px; font-size: .88rem; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
.sidebar-footer .callout { background: var(--primary-soft); border: 1px solid var(--primary-line); border-radius: var(--radius); padding: 14px; font-size: .85rem; }

/* Collapsed sidebar (desktop) */
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .sidebar .logo-text,
body.sidebar-collapsed .sidebar .menu-heading,
body.sidebar-collapsed .sidebar .menu-link span,
body.sidebar-collapsed .sidebar .menu-link .badge,
body.sidebar-collapsed .sidebar .menu-sub,
body.sidebar-collapsed .sidebar .sidebar-footer { display: none; }
body.sidebar-collapsed .sidebar .menu-link { justify-content: center; }
body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
body.sidebar-collapsed .wrapper { padding-left: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .header { left: var(--sidebar-w-collapsed); }

/* Main wrapper */
.wrapper { flex: 1; min-width: 0; padding-left: var(--sidebar-w); padding-top: var(--header-h); display: flex; flex-direction: column; transition: padding-left .25s ease; }
.header {
  position: fixed; top: 0; right: 0; left: var(--sidebar-w); z-index: 20; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); transition: left .25s ease;
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 16px; padding: 0 var(--gutter); }
.header-mobile-logo { display: none; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); min-width: 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .current { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb svg.i { width: 14px; height: 14px; color: var(--faint); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; width: 240px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--faint);
}
.search input { border: 0; outline: 0; background: transparent; font: inherit; font-size: .88rem; color: var(--text); width: 100%; }
.search kbd { font-family: var(--font); font-size: .7rem; border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 5px; color: var(--faint); }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--primary); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px var(--surface); }
.icon-btn.menu-btn { display: none; }

.content { flex: 1; padding: 26px var(--gutter) 40px; width: 100%; max-width: 1440px; margin: 0 auto; }
.footer { padding: 18px var(--gutter); font-size: .85rem; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; max-width: 1440px; width: 100%; margin: 0 auto; }
.footer nav { display: flex; gap: 16px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }

.overlay { display: none; }

/* ---------- 4. Page toolbar (title row under the header) ---------- */
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.toolbar h1 { font-size: 1.35rem; }
.toolbar .subtitle { color: var(--muted); font-size: .92rem; margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 5. Grid helpers ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.span-2 { grid-column: span 2; }
.layout-main-side { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap-gap { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 30px; }
.mb-0 { margin-bottom: 0; }
.sticky-side { position: sticky; top: calc(var(--header-h) + 20px); }

/* ---------- 6. Card ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 12px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-title { font-size: 1rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-title svg.i { color: var(--primary); }
.card-toolbar { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; flex: 1; }
.card-body > :last-child { margin-bottom: 0; }
.card-body.flush { padding: 0; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: center; }
.card-footer a { font-weight: 500; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
a.card { color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card:hover { border-color: var(--primary-line); box-shadow: var(--shadow-lg); transform: translateY(-2px); color: inherit; }
.card.accent { background: var(--primary-soft); border-color: var(--primary-line); }

/* ---------- 7. Buttons, badges, avatars ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-size: .88rem; font-weight: 500;
  cursor: pointer; white-space: nowrap; background: var(--primary); color: #fff; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--primary-hover); color: #fff; }
.btn-light { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
.btn-light:hover { background: var(--surface-2); color: var(--primary); }
.btn-soft { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-line); }
.btn-soft:hover { background: var(--primary); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: .82rem; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px;
  font-size: .76rem; font-weight: 500; line-height: 1; white-space: nowrap; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text-2);
}
a.badge:hover { filter: brightness(.97); }
.badge-sm { height: 20px; padding: 0 6px; font-size: .7rem; }
.badge-pill { border-radius: 999px; }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-primary, .role-main { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary-line); }
.badge-success, .role-friend { background: var(--success-soft); color: var(--success-text); border-color: var(--success-line); }
.badge-warning, .role-rival { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-line); }
.badge-danger, .role-partner { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-line); }
.badge-info, .role-family { background: var(--info-soft); color: var(--info-text); border-color: var(--info-line); }
.role-supporting { background: var(--sky-soft); color: var(--sky-text); border-color: var(--sky-line); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; overflow: hidden;
  font-weight: 600; font-size: .85rem; border: 0; background: var(--primary-soft); color: var(--primary-text);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: .72rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.15rem; }
.avatar-xl { width: 88px; height: 88px; font-size: 1.5rem; }
.avatar.role-main { background: var(--primary-soft); color: var(--primary-text); }
.avatar.role-friend { background: var(--success-soft); color: var(--success-text); }
.avatar.role-rival { background: var(--warning-soft); color: var(--warning-text); }
.avatar.role-partner { background: var(--danger-soft); color: var(--danger-text); }
.avatar.role-family { background: var(--info-soft); color: var(--info-text); }
.avatar.role-supporting { background: var(--sky-soft); color: var(--sky-text); }
.avatar-group { display: flex; }
.avatar-group .avatar { box-shadow: 0 0 0 2px var(--surface); margin-left: -8px; }
.avatar-group .avatar:first-child { margin-left: 0; }
.avatar-more { background: var(--surface-2) !important; color: var(--muted) !important; }

.icon-box {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-line);
}
.icon-box svg.i { width: 22px; height: 22px; }
.icon-box.success { background: var(--success-soft); color: var(--success-text); border-color: var(--success-line); }
.icon-box.warning { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-line); }
.icon-box.danger  { background: var(--danger-soft);  color: var(--danger-text);  border-color: var(--danger-line); }
.icon-box.info    { background: var(--info-soft);    color: var(--info-text);    border-color: var(--info-line); }

/* ---------- 8. Progress ---------- */
.progress { height: 6px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.progress.success > span { background: var(--success); }
.progress.warning > span { background: var(--warning); }
.progress.info > span { background: var(--info); }
.progress-lg { height: 10px; }
.ring {
  --value: 0; --size: 120px; --color: var(--primary);
  width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--color) calc(var(--value) * 1%), var(--gray-soft) 0);
}
.ring::before { content: ""; grid-area: 1 / 1; width: calc(var(--size) - 22px); height: calc(var(--size) - 22px); border-radius: 50%; background: var(--surface); }
.ring > * { grid-area: 1 / 1; position: relative; text-align: center; }
.ring .ring-value { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1; }

/* ---------- 9. Reusable cards ---------- */
/* Stat card */
.stat-card .card-body { display: flex; flex-direction: column; gap: 14px; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { color: var(--muted); font-size: .88rem; }
.stat-foot { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* Lesson card */
.lesson-card { overflow: hidden; }
.lesson-cover {
  position: relative; height: 120px; padding: 16px 18px; display: flex; flex-direction: column; justify-content: space-between;
  background: var(--primary-soft); color: var(--primary-text);
}
.lesson-cover.c2 { background: var(--success-soft); color: var(--success-text); }
.lesson-cover.c3 { background: var(--info-soft); color: var(--info-text); }
.lesson-cover.c4 { background: var(--sky-soft); color: var(--sky-text); }
.lesson-cover::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.45); }
.lesson-cover .num { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.lesson-cover .big { font-size: 2.4rem; font-weight: 800; line-height: 1; opacity: .95; }
.lesson-cover .badge { background: rgba(255,255,255,.7); border-color: transparent; color: inherit; align-self: flex-start; }
.lesson-card .card-body { display: flex; flex-direction: column; gap: 10px; }
.lesson-card h3 { font-size: 1.05rem; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--muted); }
.lesson-meta span { display: inline-flex; align-items: center; gap: 5px; }
.lesson-card .card-footer { justify-content: space-between; align-items: center; }
.lesson-card.locked { opacity: .65; }
.lesson-card.locked .lesson-cover { background: var(--gray-soft); color: var(--muted); }

/* Character card */
.character-card .card-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding-top: 26px; }
.character-card h3 { font-size: 1.02rem; margin-top: 6px; }
.character-card .facts { display: flex; justify-content: center; gap: 0; width: 100%; margin-top: 10px; border-top: 1px dashed var(--border-strong); padding-top: 12px; }
.character-card .facts > div { flex: 1; font-size: .78rem; color: var(--muted); }
.character-card .facts strong { display: block; color: var(--text); font-size: .88rem; font-weight: 600; }
.character-card .facts > div + div { border-left: 1px dashed var(--border-strong); }

/* Compact list rows (cast list, activity, etc.) */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
a.list-item { color: inherit; }
a.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { color: var(--text); font-weight: 500; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .sub { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Word of the day */
.word-card .word { font-size: 1.9rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.word-card .meaning { font-size: 1rem; color: var(--text-2); }

/* Timeline (activity placeholder) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 34px; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 0; border-left: 1px dashed var(--border-strong); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--muted); }
.timeline .dot svg.i { width: 13px; height: 13px; }

/* Empty state */
.empty { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 36px 20px; text-align: center; color: var(--muted); }

/* Tabs (page nav) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 500; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs a:hover, .tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- 10. Tables ---------- */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); color: var(--muted); font-weight: 500; font-size: .8rem; white-space: nowrap; }
td { color: var(--text-2); }
td strong { color: var(--text); }
tr:last-child td { border-bottom: 0; }
.table-bordered { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.table-middle td { vertical-align: middle; }
table.kv th { width: 120px; background: transparent; font-size: .86rem; padding-left: 0; }
table.kv td { padding-left: 0; }

/* ---------- 11. Lesson content ---------- */
.prose { color: var(--text-2); font-size: .98rem; line-height: 1.7; }
.prose p { margin: 0 0 1em; }
.prose ul { margin: 0 0 1em; padding-left: 1.2em; }
.prose strong { color: var(--text); }
.part-label { display: inline-flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--primary-text); margin: 10px 0 12px; }
.section-heading { font-size: 1.15rem; margin-bottom: 10px; }
h3.scene { color: var(--info-text); font-size: 1rem; }
.rule { background: var(--warning-soft); border: 1px solid var(--warning-line); border-left: 4px solid var(--warning); border-radius: var(--radius-sm); padding: 14px 18px; margin: 16px 0; color: var(--text-2); }
.rule .label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--warning-text); margin-bottom: 4px; }
.rule strong { color: var(--text); }
.formula { display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: .88rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; padding: 4px 10px; font-weight: 600; color: var(--text); }
.dissection { border: 1px solid var(--border); border-radius: var(--radius); margin: 18px 0; overflow: hidden; }
.dissection-head { padding: 14px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.dissection-head .label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; }
.sentence { font-size: 1.12rem; font-weight: 600; color: var(--text); margin: 0; }
.dissection-notes { padding: 12px 18px; font-size: .9rem; border-top: 1px solid var(--border); }
.dissection-notes p:last-child { margin: 0; }
.dialogue .line { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.dialogue .line:last-child { border-bottom: 0; }
.dialogue .narrator { background: var(--surface-2); }
.dialogue .narrator .bis { color: var(--muted); font-style: italic; }
.dialogue .bis { font-weight: 500; color: var(--text); }
audio { width: 100%; max-width: 340px; height: 36px; margin-top: 8px; display: block; }
.toc a { display: flex; align-items: center; gap: 8px; padding: 7px 20px; font-size: .88rem; color: var(--text-2); border-left: 2px solid transparent; }
.toc a:hover { color: var(--primary); border-left-color: var(--primary); background: var(--surface-2); }
.toc .toc-sub { padding-left: 34px; font-size: .84rem; color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
section[id], div[id] { scroll-margin-top: calc(var(--header-h) + 70px); }

/* Voice players (used by static/js/voices.js) */
.speedbar { position: sticky; top: calc(var(--header-h) + 10px); z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px 14px; margin-bottom: 20px; font-size: .88rem; }
.speedbar button { font: inherit; font-size: .82rem; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 6px; padding: 3px 12px; cursor: pointer; }
.speedbar button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.speedbar .hint { font-size: .8rem; margin-left: 6px; }
.w.spoken { cursor: pointer; border-radius: 4px; transition: background .08s; }
.w.spoken:hover { text-decoration: underline dotted; }
.w.lit { background: var(--warning); color: #3d3a44; box-shadow: 0 0 0 2px var(--warning); }

/* ---------- 12. Forms / exercises ---------- */
input[type=text], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: .92rem; background: var(--surface); color: var(--text);
}
input[type=text]:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.question { margin-bottom: 16px; }
.question .q-label { display: block; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); margin-bottom: 6px; cursor: pointer; }
.choice:hover { border-color: var(--primary); }
.question.right { border-color: var(--success-line); background: var(--success-soft); }
.question.wrong { border-color: var(--danger-line); background: var(--danger-soft); }

/* ---------- 13. UI kit page ---------- */
.swatch { height: 56px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.kit-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 30px 0 12px; }

/* ---------- 14. Responsive ---------- */
@media (max-width: 1280px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-main-side { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 1024px) {
  :root { --gutter: 16px; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar-toggle { display: none; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .overlay { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(61, 58, 68, .35); }
  .wrapper, body.sidebar-collapsed .wrapper { padding-left: 0; }
  .header, body.sidebar-collapsed .header { left: 0; }
  body.sidebar-collapsed .sidebar { width: var(--sidebar-w); }
  body.sidebar-collapsed .sidebar .logo-text, body.sidebar-collapsed .sidebar .menu-heading,
  body.sidebar-collapsed .sidebar .menu-link span, body.sidebar-collapsed .sidebar .sidebar-footer { display: revert; }
  .icon-btn.menu-btn { display: grid; }
  .header-mobile-logo { display: flex; }
  .breadcrumb { display: none; }
  .search { display: none; }
  .layout-main-side, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .sticky-side { position: static; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .dialogue .line { grid-template-columns: 1fr; gap: 6px; }
  .toolbar { align-items: flex-start; }
}

/* Fixes */
.search input[type=search] { border: 0; height: auto; padding: 0; box-shadow: none; background: transparent; }
.character-card .facts strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }

/* Pastel tweaks */
h1, h2, h3, h4 { font-weight: 500; letter-spacing: .01em; }
.toolbar h1 { font-size: 1.6rem; }
.btn { border-radius: 999px; }
.lesson-cover::after { display: none; }
.card-title svg.i, .menu-link.active svg.i, .menu-link:hover svg.i { color: var(--primary-text); }
.menu-link.active, .menu-link:hover { color: var(--primary-text); background: var(--primary-soft); border-color: transparent; }
.word-card { background: var(--warning-soft); border-color: var(--warning-line); }
.word-card .card-header { border-color: var(--warning-line); }

/* ---------- Characters page: self-introductions ---------- */
.intro-card .intro-head { align-items: flex-start; gap: 14px; }
.intro-card .intro-head .grow { flex: 1; min-width: 0; }
.intro-card h3 { font-size: 1.1rem; margin: 0; }
.intro-card h3 a { color: var(--text); }
.intro-card audio { width: 100%; height: 36px; }
.intro-lines { border-top: 1px dashed var(--border-strong); padding-top: 12px; }
.intro-line { margin: 0 0 10px; line-height: 1.5; }
.intro-line:last-child { margin-bottom: 0; }
.intro-line .bis { display: block; color: var(--text); font-weight: 500; }
.intro-line .tr { display: block; color: var(--muted); font-style: italic; font-size: .9rem; }

/* =====================================================================
   TOP NAVIGATION LAYOUT + LARGE, CALM TEXT (replaces the sidebar)
   Made for comfortable reading: big type, lots of space, one column.
   ===================================================================== */
html { font-size: 19px; }
body { line-height: 1.65; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
.small { font-size: .95rem; }
.xs { font-size: .85rem; }
.badge { height: auto; padding: 4px 10px; font-size: .82rem; }
.badge-sm { padding: 3px 9px; font-size: .78rem; }
.btn { height: auto; min-height: 48px; padding: 10px 24px; font-size: 1rem; }
.btn-sm { min-height: 40px; padding: 6px 18px; font-size: .92rem; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; min-height: 76px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.topbar .logo { font-size: 1.25rem; }
.topbar .logo-mark { width: 42px; height: 42px; font-size: 1rem; border-radius: 12px; }
.topnav { margin-left: auto; display: flex; gap: 6px; }
.topnav a { padding: 10px 18px; border-radius: 999px; color: var(--text-2); font-size: 1.05rem; font-weight: 500; }
.topnav a:hover { background: var(--primary-soft); color: var(--primary-text); }
.topnav a.active { background: var(--primary); color: #fff; }
.topbar .menu-btn { display: none; margin-left: auto; width: 48px; height: 48px; }
.topbar .menu-btn svg.i { width: 26px; height: 26px; }

/* Page */
.page { max-width: 1100px; margin: 0 auto; padding: 44px 24px 64px; width: 100%; }
.footer { max-width: 1100px; padding: 24px; font-size: .9rem; border-top: 1px solid var(--border); }
.toolbar { margin-bottom: 32px; }
.toolbar h1 { font-size: 2rem; }
.toolbar .subtitle { font-size: 1.05rem; margin-top: 6px; }
.grid { gap: 28px; }
.card-body { padding: 28px; }
.card-header { padding: 16px 28px; min-height: 64px; }
.card-title { font-size: 1.15rem; }
.list-item { padding: 16px 28px; }
.list-item .title { font-size: 1.05rem; }
.list-item .sub { font-size: .92rem; }
.prose { font-size: 1.08rem; line-height: 1.8; }
th, td { padding: 14px 18px; }
th { font-size: .9rem; }
table { font-size: 1rem; }
.sentence { font-size: 1.3rem; }
.formula { font-size: 1rem; }
.section-heading { font-size: 1.45rem; margin-bottom: 14px; }
.reading { max-width: 820px; margin: 0 auto; }
.stack { gap: 28px; }
.speedbar { top: 90px; font-size: 1rem; }
.speedbar button { font-size: 1rem; padding: 6px 16px; }
audio { height: 44px; max-width: 420px; }
.empty { font-size: 1.05rem; padding: 44px 24px; }
input[type=text] { height: 52px; font-size: 1.05rem; }
.question .q-label { font-size: 1.1rem; }
.choice { padding: 14px 16px; font-size: 1.05rem; }

/* Simple lesson list rows */
.lesson-row { display: flex; align-items: center; gap: 22px; padding: 24px 28px; }
.lesson-row .num { width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-text); font-size: 1.5rem; font-weight: 600; }
.lesson-row h3 { font-size: 1.3rem; }
.lesson-row .grow { flex: 1; min-width: 0; }
.dialogue .line { grid-template-columns: 150px 1fr; padding: 18px 28px; }
.dialogue .bis { font-size: 1.1rem; }

@media (max-width: 860px) {
  html { font-size: 18px; }
  .topbar .menu-btn { display: grid; }
  .topnav { display: none; width: 100%; flex-direction: column; padding-bottom: 14px; margin-left: 0; }
  .topnav.open { display: flex; }
  .topnav a { padding: 14px 18px; font-size: 1.15rem; }
  .page { padding: 28px 16px 48px; }
  .topbar-inner { padding: 0 16px; }
  .lesson-row { flex-wrap: wrap; padding: 20px; }
  .card-body { padding: 22px; }
  .dialogue .line { grid-template-columns: 1fr; }
  .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
}
.toolbar.reading { margin-bottom: 32px; }
:root { --muted: #6f6975; --text-2: #4e4956; }

/* ---------- Buttons: Duolingo-style size (compact, bold, chunky 3D edge) ---------- */
.btn {
  min-height: 0; height: auto; padding: 10px 20px; border-radius: 14px;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.3;
  border: 2px solid transparent; box-shadow: 0 4px 0 var(--primary-hover);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { background: var(--primary); filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: none; }
.btn svg.i { width: 1.1em; height: 1.1em; }
.btn-light { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); box-shadow: 0 4px 0 var(--border-strong); }
.btn-light:hover { background: var(--surface-2); color: var(--primary-text); filter: none; }
.btn-soft { background: var(--primary-soft); color: var(--primary-text); border-color: var(--primary-line); box-shadow: 0 3px 0 var(--primary-line); }
.btn-soft:hover { background: var(--primary-soft); color: var(--primary-text); filter: brightness(.98); }
.btn-sm { padding: 7px 14px; font-size: .7rem; border-radius: 12px; }
.btn-sm:active { transform: translateY(3px); }

/* Top menu: smaller, rounded tabs like the buttons */
.topnav a { padding: 7px 14px; font-size: .9rem; font-weight: 600; border-radius: 12px; }
.topnav a.active { background: var(--primary-soft); color: var(--primary-text); box-shadow: inset 0 0 0 2px var(--primary-line); }
.topbar-inner { min-height: 68px; }
.topbar .logo-mark { width: 38px; height: 38px; }
.lesson-row .num { width: 54px; height: 54px; font-size: 1.3rem; border-radius: 14px; }
.speedbar button { font-size: .85rem; padding: 4px 12px; border-radius: 10px; }

/* Lesson voices: one play button per line, with its own speed choice */
.play { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; }
.play audio { display: none; }
.play-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.play-btn:hover { filter: brightness(.95); }
.play-btn .i-pause, .play.playing .play-btn .i-play { display: none; }
.play.playing .play-btn .i-pause { display: block; }
.play .rates { display: inline-flex; gap: 4px; }
.play .rates button { font: inherit; font-size: .78rem; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 6px; padding: 2px 9px; cursor: pointer; }
.play .rates button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
td .play { margin-top: 4px; }

/* ---------- Pure grammar (blog-style topic cards + articles) ---------- */
.g-group { margin-bottom: 48px; }
.g-group h2 { font-size: 1.5rem; margin-bottom: 6px; }
.g-group-blurb { color: var(--muted); font-size: 1.05rem; margin-bottom: 18px; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.g-grid-1 { grid-template-columns: minmax(0, 1fr); }
.g-card { display: flex; gap: 20px; align-items: center; padding: 20px; background: var(--surface); border: 2px solid var(--border); border-radius: 18px; color: var(--text-2); transition: border-color .15s, transform .15s, box-shadow .15s; }
a.g-card:hover { border-color: var(--primary-line); transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--text-2); }
.g-card.soon { opacity: .6; border-style: dashed; }
.g-pic { width: 104px; height: 104px; border-radius: 16px; flex: none; display: grid; place-items: center; overflow: hidden; }
.g-pic span.long { font-size: 1.2rem; }
.g-pic img { width: 100%; height: 100%; object-fit: cover; }
.g-pic span { font-size: 1.7rem; font-weight: 700; letter-spacing: -.01em; }
.g-coral  { background: var(--primary-soft); color: var(--primary-text); }
.g-mint   { background: var(--success-soft); color: var(--success-text); }
.g-lilac  { background: var(--info-soft);    color: var(--info-text); }
.g-butter { background: var(--warning-soft); color: var(--warning-text); }
.g-sky    { background: var(--sky-soft);     color: var(--sky-text); }
.g-text { min-width: 0; }
.g-level { font-size: .9rem; color: var(--muted); margin-bottom: 2px; }
.g-card h3 { font-size: 1.3rem; margin-bottom: 6px; }
.g-card p { margin: 0; font-size: 1.02rem; line-height: 1.5; }

.g-article h1 { font-size: 2.4rem; line-height: 1.2; margin: 6px 0 14px; }
.g-crumbs { color: var(--muted); font-size: 1rem; }
.g-lead { font-size: 1.25rem; line-height: 1.6; color: var(--text-2); margin-bottom: 14px; }
.g-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 1rem; margin-bottom: 28px; }
.g-toc { padding: 22px 26px; margin-bottom: 32px; }
.g-toc-title { font-weight: 600; font-size: 1.15rem; color: var(--text); margin-bottom: 8px; }
.g-toc ol { margin: 0; padding-left: 1.3em; font-size: 1.08rem; line-height: 1.9; }
.g-intro { margin-bottom: 12px; }
.g-section { padding-top: 12px; margin-bottom: 26px; scroll-margin-top: 90px; }
.g-section h2 { font-size: 1.6rem; margin-bottom: 12px; }
.g-table { margin: 16px 0; }
.g-table table { font-size: 1.05rem; }
.g-more { margin-top: 44px; }
.g-more h2 { font-size: 1.4rem; margin-bottom: 16px; }
.g-back { margin-top: 32px; }
@media (max-width: 860px) {
  .g-grid { grid-template-columns: minmax(0, 1fr); }
  .g-pic { width: 76px; height: 76px; }
  .g-pic span { font-size: 1.3rem; }
  .g-article h1 { font-size: 1.8rem; }
}
.g-examples { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.g-examples li { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; font-size: 1.1rem; line-height: 1.6; }
.g-examples strong { font-weight: 500; color: var(--text); }
.g-examples strong strong { font-weight: 700; color: var(--primary-text); }
.g-en { color: var(--muted); }

/* Character personality line (Characters page + character detail) */
.personality { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft, #fdeef0); color: var(--text); line-height: 1.5; }

/* ---------- Lesson intro: colour-coded Verb / Subject / Object example ---------- */
.vso-example { background: var(--surface-2, var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin: 4px 0 20px; }
.vso-example .label { margin-bottom: 4px; }
.vso-sentence { font-size: 1.2rem; font-weight: 600; line-height: 1.7; margin: 0; color: var(--text); }
.vso-english { font-size: 1rem; line-height: 1.7; margin: 6px 0 0; color: var(--text-2); }
.vso { border-radius: 6px; padding: 1px 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.vso-verb    { background: var(--primary-soft); color: var(--primary-text); box-shadow: inset 0 -2px 0 var(--primary); }
.vso-subject { background: var(--sky-soft);     color: var(--sky-text);     box-shadow: inset 0 -2px 0 var(--sky); }
.vso-object  { background: var(--success-soft); color: var(--success-text); box-shadow: inset 0 -2px 0 var(--success); }
.vso-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .92rem; color: var(--text-2); }
.vso-key { display: inline-flex; align-items: center; gap: 6px; }
.vso-key .dot { width: 12px; height: 12px; border-radius: 50%; padding: 0; display: inline-block; }
.vso-example .play { margin-top: 6px; }

/* ---------- Practice player (tap tiles, no typing) ---------- */
.practice { display: flex; flex-direction: column; gap: 18px; }
.pr-bar { height: 16px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; }
.pr-bar i { display: block; height: 100%; width: 0; background: var(--success); border-radius: 999px; transition: width .4s; }
.pr-title { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.pr-instr { font-size: 1.1rem; color: var(--muted); margin-top: 2px; }
.pr-body { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.pr-speaker { display: inline-block; font-size: .95rem; font-weight: 600; color: var(--primary-text); background: var(--primary-soft); border: 1px solid var(--primary-line); border-radius: 999px; padding: 4px 14px; }
.pr-prompt { font-size: 1.7rem; font-weight: 600; color: var(--text); line-height: 1.35; }
.pr-listen { font: inherit; font-size: 1.25rem; font-weight: 600; min-height: 60px; padding: 0 28px; border-radius: 16px; cursor: pointer;
  background: var(--sky-soft); color: var(--sky-text); border: 2px solid var(--sky-line); border-bottom-width: 5px; }
.pr-options { display: grid; gap: 12px; width: 100%; }
.pr-option, .pr-tile { font: inherit; font-size: 1.35rem; font-weight: 500; color: var(--text); cursor: pointer; background: var(--surface);
  border: 2px solid var(--border-strong); border-bottom-width: 5px; border-radius: 16px; transition: transform .08s, background .15s, border-color .15s; }
.pr-option { min-height: 64px; padding: 10px 20px; text-align: left; width: 100%; }
.pr-option:hover, .pr-tile:hover { background: var(--surface-2); }
.pr-option:active, .pr-tile:active { transform: translateY(2px); }
.pr-option.sel { background: var(--sky-soft); border-color: var(--sky); color: var(--sky-text); }
.pr-option.right { background: var(--success-soft); border-color: var(--success); color: var(--success-text); }
.pr-option.wrong { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); }
.pr-answer { width: 100%; min-height: 78px; display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; padding: 8px 0 12px;
  border-bottom: 3px solid var(--border-strong); }
.pr-bank { display: flex; flex-wrap: wrap; gap: 12px; }
.pr-tile { min-height: 60px; padding: 6px 22px; }
.pr-tile.used { color: transparent; background: var(--gray-soft); border-color: var(--gray-soft); pointer-events: none; }
.pr-feedback { display: none; border-radius: 16px; padding: 16px 20px; font-size: 1.15rem; }
.pr-feedback.show { display: block; }
.pr-feedback.right { background: var(--success-soft); color: var(--success-text); border: 2px solid var(--success-line); }
.pr-feedback.wrong { background: var(--danger-soft); color: var(--danger-text); border: 2px solid var(--danger-line); }
.pr-verdict { font-size: 1.35rem; font-weight: 700; }
.pr-correct { font-size: 1.35rem; font-weight: 600; color: var(--text); margin-top: 4px; }
.pr-why { margin-top: 6px; color: var(--text-2); }
.pr-foot { display: flex; justify-content: flex-end; }
.pr-check { font: inherit; font-size: 1.3rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; min-height: 62px; min-width: 220px;
  padding: 0 32px; border-radius: 16px; cursor: pointer; color: #fff; background: var(--primary); border: none; box-shadow: 0 5px 0 var(--primary-hover); }
.pr-check:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--primary-hover); }
.pr-check:disabled { background: var(--gray-soft); color: var(--faint); box-shadow: 0 5px 0 var(--border-strong); cursor: default; }
.pr-done { text-align: center; width: 100%; font-size: 1.2rem; }
.pr-big { font-size: 3.5rem; }
@media (max-width: 640px) { .pr-check { width: 100%; } .pr-prompt { font-size: 1.45rem; } }
.g-lessons { font-size: 1.05rem; margin: -14px 0 28px; color: var(--text-2); }
a.badge-primary:hover { color: var(--primary-hover); }

/* =====================================================================
   2026-11-14: original pastel coral palette kept (Anton prefers it).
   Bigger reading text, reading progress bar, back-to-top button, and the
   student dashboard on the home page.
   ===================================================================== */
html { font-size: 18px; }
h1 { font-size: 2.1rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.topnav a { padding: 9px 16px; font-size: .95rem; }
.btn { font-size: .82rem; padding: 12px 22px; }
.btn-sm { font-size: .74rem; padding: 8px 16px; }
.play-btn { width: 40px; height: 40px; }

/* Reading progress bar: a thin line at the very top of long pages */
.read-progress { position: fixed; top: 0; left: 0; height: 5px; width: 0; z-index: 40; background: var(--primary); border-radius: 0 999px 999px 0; transition: width .1s linear; pointer-events: none; }

/* Back to top: a big round button, bottom right */
.to-top { position: fixed; right: 24px; bottom: 24px; z-index: 35; width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 1.6rem; font-weight: 700; box-shadow: 0 4px 0 var(--primary-hover), var(--shadow-lg);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-hover); }

/* ---------- Student dashboard (home) ---------- */
.dash { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: stretch; }
.dash-next .card-body { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; justify-content: center; }
.dash-next h2 { font-size: 1.7rem; line-height: 1.25; }
.dash-next p { font-size: 1.05rem; margin: 0; }
.dash-next .btn { margin-top: 10px; font-size: .95rem; padding: 16px 30px; }
.dash-label { font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--primary-text); }
.dash-progress .card-body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.dash-progress .ring { --size: 150px; --color: var(--success); }
.dash-progress .ring .ring-value { font-size: 2rem; }
.dash-count { font-size: 1.1rem; color: var(--text); font-weight: 600; }
.bar { height: 16px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; width: 100%; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--success); transition: width .4s; }
.dash-h { font-size: 1.3rem; margin: 40px 0 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dash-h a { font-size: 1rem; font-weight: 600; }
.tiles { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--surface); border: 2px solid var(--border); border-radius: 18px; color: var(--text-2); transition: border-color .15s, transform .15s, box-shadow .15s; }
.tile:hover { border-color: var(--primary-line); transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--text-2); }
.tile .icon-box { width: 56px; height: 56px; border-radius: 16px; }
.tile .icon-box svg.i { width: 28px; height: 28px; }
.tile strong { font-size: 1.25rem; color: var(--text); font-weight: 600; }
.tile span.t { font-size: .95rem; color: var(--muted); line-height: 1.4; }

/* Lesson rows: done / next markers */
.lesson-row.done .num { background: var(--success-soft); color: var(--success-text); }
.lesson-row.done .num svg.i { width: 28px; height: 28px; }
.lesson-row.next { background: var(--primary-soft); }
.lesson-status { font-size: .85rem; font-weight: 600; color: var(--success-text); }
.list-progress { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.list-progress .bar { flex: 1; }
.list-progress b { color: var(--text); white-space: nowrap; }

/* Finish-lesson box at the bottom of a lesson */
.finish { text-align: center; padding: 32px 24px; display: block; }
.finish h2 { font-size: 1.5rem; margin-bottom: 6px; }
.finish p { color: var(--muted); margin-bottom: 18px; }
.finish .btn { font-size: 1rem; padding: 18px 34px; }
.finish.is-done { background: var(--success-soft); border-color: var(--success-line); }
.finish .undo { display: inline-block; margin-top: 14px; background: none; border: 0; font: inherit; font-size: .9rem; color: var(--muted); text-decoration: underline; cursor: pointer; }

@media (max-width: 860px) {
  html { font-size: 17px; }
  h1 { font-size: 1.75rem; }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) { .tiles { grid-template-columns: minmax(0, 1fr); } }

/* ---------- White-dominant page, three accents: coral, mint, sky ---------- */
:root { --bg: #ffffff; --surface-2: #fbf7f6; --border: #efe6e4; --gray-soft: #f1eceb; }
.topbar { background: #fff; }
.card { box-shadow: 0 1px 3px rgba(60, 40, 40, .05); }
.card.accent { background: var(--primary-soft); border-color: var(--primary-line); }
.icon-box.sky { background: var(--sky-soft); color: var(--sky-text); border-color: var(--sky-line); }
.tone-coral { --tone: var(--primary); --tone-soft: var(--primary-soft); --tone-line: var(--primary-line); --tone-text: var(--primary-text); }
.tone-mint  { --tone: var(--success); --tone-soft: var(--success-soft); --tone-line: var(--success-line); --tone-text: var(--success-text); }
.tone-sky   { --tone: var(--sky);     --tone-soft: var(--sky-soft);     --tone-line: var(--sky-line);     --tone-text: var(--sky-text); }

/* ---------- Book: parts > chapters > lessons ---------- */
.parts { display: flex; flex-direction: column; gap: 18px; }
.part-card { display: flex; align-items: center; gap: 24px; padding: 24px 28px; background: var(--surface); border: 2px solid var(--border); border-radius: 20px; color: var(--text-2); transition: border-color .15s, transform .15s, box-shadow .15s; }
a.part-card:hover { border-color: var(--tone-line); transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--text-2); }
.part-card.current { border-color: var(--tone); }
.part-card.soon { opacity: .6; border-style: dashed; }
.part-num { width: 76px; height: 76px; border-radius: 20px; flex: none; display: grid; place-items: center; background: var(--tone-soft); color: var(--tone-text); font-size: 2rem; font-weight: 700; }
.part-num svg.i { width: 34px; height: 34px; }
.part-card .grow { flex: 1; min-width: 0; }
.part-kicker { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tone-text, var(--muted)); }
.part-kicker .here { margin-left: 8px; padding: 3px 10px; border-radius: 999px; background: var(--tone); color: #fff; letter-spacing: .03em; }
.part-card h2 { font-size: 1.45rem; margin: 4px 0; }
.part-card p { margin: 0; color: var(--muted); font-size: 1rem; }
.part-foot { display: flex; align-items: center; gap: 14px; margin-top: 12px; color: var(--muted); font-weight: 600; font-size: .95rem; }
.part-foot .bar { flex: 1; max-width: 320px; height: 12px; }
.part-foot .bar > span, .tone-coral .list-progress .bar > span, .tone-mint .list-progress .bar > span, .tone-sky .list-progress .bar > span { background: var(--tone); }
.part-foot b { color: var(--text); white-space: nowrap; }
.part-go { color: var(--faint); flex: none; }
.part-go svg.i { width: 30px; height: 30px; }

.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: .95rem; font-weight: 600; margin-bottom: 12px; color: var(--muted); }
.crumb:hover { color: var(--primary-text); }
.chapter { margin-top: 36px; }
.chapter-h { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; font-size: 1rem; }
.chapter-tag { padding: 6px 16px; border-radius: 999px; background: var(--tone-soft); color: var(--tone-text); font-size: 1.05rem; font-weight: 700; }
.chapter-range { color: var(--muted); font-weight: 500; }
.soon-row { color: var(--muted); font-style: italic; justify-content: center; }
.chapter .lesson-row .num { background: var(--tone-soft); color: var(--tone-text); }
.chapter .lesson-row.done .num { background: var(--success-soft); color: var(--success-text); }
.chapter .lesson-row.next { background: var(--tone-soft); }
.chapter .lesson-row.next .num { background: #fff; }

.dash-part { font-size: 1rem; font-weight: 600; color: var(--muted); }
.dash-partlink { font-size: .95rem; font-weight: 600; color: var(--sky-text); }
.dash-progress .dash-label { color: var(--success-text); }

@media (max-width: 640px) {
  .part-card { padding: 20px; gap: 16px; align-items: flex-start; }
  .part-num { width: 56px; height: 56px; font-size: 1.5rem; border-radius: 16px; }
  .part-go { display: none; }
}

/* ---------- Profile pictures (cartoon faces) + voice player on character pages ---------- */
.avatar { overflow: hidden; }
.avatar:has(img) { background: none !important; }
.avatar-lg { width: 96px; height: 96px; }
.avatar-xl { width: 150px; height: 150px; }
.intro-head { gap: 20px; align-items: center; }
.intro-card h3 { font-size: 1.4rem; }
.voice-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; border-radius: 14px; background: var(--sky-soft); }
.voice-row .voice-label { font-weight: 600; color: var(--sky-text); }
.voice-row .play { margin-top: 0; }
.play-btn { width: 44px; height: 44px; }
.play .rates button { font-size: .85rem; padding: 4px 11px; border-radius: 8px; }
@media (max-width: 640px) { .avatar-lg { width: 76px; height: 76px; } }

/* ---------- Lesson tiles: a picture per lesson ---------- */
.lesson-tiles { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.lesson-tile { display: flex; flex-direction: column; background: var(--surface); border: 2px solid var(--border); border-radius: 20px; overflow: hidden; color: var(--text-2); transition: border-color .15s, transform .15s, box-shadow .15s; }
.lesson-tile:hover { border-color: var(--tone-line, var(--primary-line)); transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--text-2); }
.lesson-tile.next { border-color: var(--tone, var(--primary)); }
.lesson-tile-pic { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--tone-soft, var(--primary-soft)); overflow: hidden; }
.lesson-tile-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lesson-tile-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3rem; font-weight: 700; color: var(--tone-text, var(--primary-text)); }
.lesson-tile-flag { position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; font-size: .85rem; font-weight: 700; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.lesson-tile-flag.done { background: var(--success-text); }
.lesson-tile-flag.next { background: var(--primary); }
.lesson-tile-text { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px 20px; }
.lesson-tile-kicker { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tone-text, var(--primary-text)); }
.lesson-tile strong { font-size: 1.2rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.dash-next { overflow: hidden; }
.dash-pic { display: block; aspect-ratio: 16 / 6; overflow: hidden; }
.dash-pic img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; display: block; }
@media (max-width: 560px) { .lesson-tiles { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Practice: count, chances (strikes) and points ---------- */
.pr-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pr-top .pr-bar { flex: 1; min-width: 140px; }
.pr-count { font-weight: 600; color: var(--muted); white-space: nowrap; }
.pr-lives { display: inline-flex; gap: 6px; }
.pr-lives i { width: 20px; height: 20px; border-radius: 50%; background: var(--primary); display: block; transition: background .2s, transform .2s; }
.pr-lives i.lost { background: var(--gray-soft); transform: scale(.8); box-shadow: inset 0 0 0 2px var(--border-strong); }
.pr-points { font-weight: 600; color: var(--sky-text); background: var(--sky-soft); border: 1px solid var(--sky-line); border-radius: 999px; padding: 4px 14px; white-space: nowrap; }
.pr-points b { font-size: 1.15rem; }
.pr-foot { justify-content: space-between; align-items: center; gap: 12px; }
.pr-skip { font: inherit; font-size: 1.05rem; font-weight: 600; min-height: 56px; padding: 0 24px; border-radius: 16px; cursor: pointer; background: none; color: var(--muted); border: 2px solid var(--border-strong); }
.pr-skip:hover { background: var(--surface-2); color: var(--text); }
.pr-foot .pr-check { margin-left: auto; }
.pr-best { color: var(--success-text); font-weight: 600; min-height: 1.2em; }
@media (max-width: 640px) { .pr-count { width: 100%; } .pr-foot { flex-wrap: wrap; } .pr-skip { order: 2; width: 100%; } }

/* Longer brand name (LearnFilipinoOnline.com): keep the top bar on one line */
.topbar .logo { font-size: 1.1rem; }
.topbar-inner { gap: 12px; }
.topnav a { padding: 9px 13px; }
