/* === R&K Kelas Jepang — Concatenated inline styles === */

  :root {
    /* v2 palette — calm, long-session friendly. Eye-strain reduced for 30-60min study */
    --sakura: #c07d8f;          /* softer rose pink (was e8588e) */
    --sakura-light: #fce8ef;    /* gentle blush background */
    --sakura-soft: #f5c5d5;     /* mid-tone */
    --sakura-dim: #b03866;      /* deeper for hover/active */
    --indigo: #5a4a6e;          /* warm muted purple (was 4a2b8b) */
    --indigo-soft: #7a6498;
    --indigo-dim: #3e2e58;
    --sky: #6fa8d8;             /* sky blue, calmer */
    --sky-light: #e5f0fa;
    --gold: #d4a854;            /* muted warm gold */
    --gold-light: #fdf3df;
    --mint: #6fb07c;             /* muted sage green */
    --mint-light: #e7f3ea;
    --coral: #e07a5f;            /* warm peach for warnings/accent */
    --white: #fff;
    --bg: #fdf8f6;              /* warm cream beige, less pinkish */
    --bg-soft: #faf6f3;          /* neutral cream for sections */
    --card-bg: #ffffff;
    --text: #2c2c34;             /* charcoal, not pure black */
    --text-soft: #5a5a66;
    --text-muted: #8e8e98;
    --border: #ece4e8;          /* subtle warm border */
    --shadow: 0 4px 16px rgba(90,68,120,0.06);   /* gentler shadow */
    --shadow-strong: 0 8px 24px rgba(90,68,120,0.1);
    --focus-ring: 0 0 0 3px rgba(209,70,124,0.35);
  }
  /* Reduce motion for users who prefer it */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  }
  /* Accessibility focus indicators */
  *:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 8px; }
  /* Skip link */
  .skip-link {
    position: absolute; top: -100px; left: 8px; z-index: 9999;
    background: var(--indigo); color: #fff; padding: 10px 18px;
    border-radius: 8px; text-decoration: none; font-weight: 600;
    transition: top 0.2s;
  }
  .skip-link:focus { top: 8px; }

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

  body {
    font-family: 'Nunito', 'Noto Sans JP', sans-serif;
    background: var(--bg);
    min-height: 100vh;
    min-height: 100dvh; /* dynamic viewport on mobile */
    overflow-x: hidden;
    /* iOS safe-area inset (notch/home-indicator) */
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    -webkit-tap-highlight-color: rgba(216,155,168,0.20);
    -webkit-text-size-adjust: 100%;
  }
  /* Better touch targets on mobile */
  @media (pointer: coarse) {
    .nav-btn { min-height: 38px; padding: 8px 16px; }
    .quiz-opt { min-height: 48px; }
    .play-btn { min-width: 36px; min-height: 36px; }
    .tab-btn { min-height: 36px; padding: 8px 18px; }
  }

  /* ====== SAKURA PETALS ====== */
  #petals { position: fixed; top:0; left:0; width:100%; height:100%; pointer-events:none; z-index:0; overflow:hidden; }
  .petal {
    position: absolute;
    width: 18px; height: 18px;
    background: radial-gradient(circle at 40% 40%, #ffb7d5, var(--sakura)88);
    border-radius: 150% 0 150% 0;
    opacity: 0;
    animation: fall linear infinite;
    filter: blur(0.5px);
  }
  @keyframes fall {
    0%   { transform: translateY(-20px) rotate(0deg) translateX(0); opacity: 0.85; }
    100% { transform: translateY(110vh) rotate(720deg) translateX(60px); opacity: 0; }
  }

  /* ====== HEADER ====== */
  .header {
    position: relative; z-index: 10;
    background: linear-gradient(135deg, #4a2b8b 0%, #a44b7d 100%); /* softer gradient */
    padding: 22px 20px 18px;
    text-align: center;
    box-shadow: 0 2px 16px rgba(74,43,139,0.18);
  }
  .header h1 { color: #fff; font-size: clamp(1.4rem,4vw,2rem); font-weight: 900; letter-spacing:1px; text-shadow: 0 2px 8px rgba(0,0,0,0.3); line-height:1.05; }
  .header p  { color: #ffd6e7; font-size: 0.9rem; margin-top: 4px; }
  .brand-row { display: inline-flex; align-items: center; gap: 14px; justify-content: center; }
  .brand-logo {
    width: 60px; height: 60px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
  }
  .brand-tag { color: #ffd6e7; font-size: 0.78rem; margin-top: 2px; text-align: left; }
  .header-sub { color: #ffd6e7; font-size: 0.85rem; margin-top: 8px; opacity: 0.9; }
  @media (max-width: 480px) {
    .brand-logo { width: 48px; height: 48px; }
    .header-sub { font-size: 0.78rem; }
    /* Stop user badge/logout from overlapping H1 title on mobile.
       Header-user-row dipindah ke atas, jadi tidak nabrak brand-row. */
    .header { padding-top: 12px !important; }
    .header-user-row {
      position: static !important;
      max-width: 100% !important;
      width: 100%;
      justify-content: flex-end !important;
      padding: 0 !important;
      margin: 0 0 10px 0 !important;
      gap: 6px !important;
    }
    .header-user-row #userBadge,
    .header-user-row #logoutBtnHdr,
    .header-user-row #authBtnsHdr button,
    .header-user-row #authBtnsHdr a {
      font-size: 0.72rem !important;
      padding: 5px 10px !important;
    }
  }
  @media (max-width: 360px) {
    .header h1 { font-size: 1.2rem !important; }
    .brand-row { gap: 10px !important; }
    .header-user-row #userBadge,
    .header-user-row #logoutBtnHdr {
      font-size: 0.68rem !important;
      padding: 4px 8px !important;
    }
  }

  .progress-bar-outer {
    background: rgba(255,255,255,0.2); border-radius: 99px;
    height: 10px; margin: 10px auto 0; max-width: 400px;
    overflow: hidden;
  }
  .progress-bar-inner {
    height: 100%; background: linear-gradient(90deg, var(--gold), var(--mint));
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(.4,2,.6,1);
    width: 0%;
  }
  .progress-label { color: #ffd6e7; font-size: 0.8rem; margin-top: 4px; }

  /* ====== QUICK NAV (7 items, no scroll) ====== */
  .quicknav {
    position: sticky; top: 0; z-index: 50;
    display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px;
    padding: 6px 6px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 16px rgba(90,68,120,0.08);
    border-bottom: 1px solid rgba(90,68,120,0.06);
  }
  .qn-btn {
    border: none; background: transparent;
    padding: 6px 1px; border-radius: 10px;
    font-family: 'Nunito', sans-serif;
    color: var(--indigo); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    transition: all 0.2s;
    min-height: 48px;
    text-decoration: none;
    overflow: hidden;
  }
  .qn-btn:hover { background: var(--sakura-light); }
  .qn-btn.active {
    background: linear-gradient(135deg, var(--sakura), var(--sakura-dim));
    color: #fff;
    box-shadow: 0 4px 12px rgba(168,90,125,0.20);
  }
  /* Blog link distinguishable (public, no login required) */
  .qn-btn.qn-link {
    color: var(--indigo);
    position: relative;
  }
  .qn-btn.qn-link::after {
    content: '';
    position: absolute;
    bottom: 4px; left: 50%;
    width: 4px; height: 4px;
    background: var(--gold);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 0 0 var(--gold);
    animation: pulseDot 2s infinite;
  }
  @keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(247,201,72,0.7); }
    50%      { box-shadow: 0 0 0 4px rgba(247,201,72,0); }
  }
  .qn-ico { font-size: 1.15rem; line-height: 1; }
  .qn-lbl { font-size: 0.7rem; font-weight: 700; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  @media (max-width: 768px) {
    .qn-ico { font-size: 1.05rem; }
    .qn-lbl { font-size: 0.62rem; }
  }
  @media (max-width: 540px) {
    .quicknav { padding: 5px 3px; gap: 2px; }
    .qn-btn { padding: 5px 1px; min-height: 46px; }
    .qn-ico { font-size: 0.98rem; }
    .qn-lbl { font-size: 0.55rem; }
  }
  @media (max-width: 380px) {
    .qn-ico { font-size: 0.9rem; }
    .qn-lbl { font-size: 0.5rem; }
  }

  /* ====== SUB-NAV (chip horizontal scroll, muncul saat kategori dipilih) ====== */
  .subnav {
    display: none;
    overflow-x: auto;
    background: linear-gradient(180deg, #fff5f8, #fff);
    padding: 10px 14px;
    border-bottom: 1px solid var(--sakura-light);
    gap: 6px;
    scrollbar-width: none;
    position: sticky; top: 76px; z-index: 49;
    box-shadow: 0 2px 8px rgba(58,28,113,0.04);
  }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav.open { display: flex; }
  .nav-btn {
    flex-shrink: 0;
    padding: 7px 14px; border-radius: 99px;
    border: 2px solid var(--sakura-light);
    background: var(--white); color: var(--indigo);
    font-family: 'Nunito', sans-serif;
    font-weight: 700; font-size: 0.82rem;
    cursor: pointer; transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 5px;
    white-space: nowrap;
    text-decoration: none;
  }
  .nav-btn:hover { background: var(--sakura-light); transform: translateY(-2px); }
  .nav-btn.active {
    background: linear-gradient(135deg, var(--sakura), var(--sakura-dim));
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 12px rgba(216,155,168,0.25);
  }
  .nav-btn.done::after { content: ' ✓'; }

  /* ====== DRAWER ====== */
  .drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(26, 13, 46, 0.65);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
  }
  .drawer-overlay.open { opacity: 1; pointer-events: auto; }

  .drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(360px, 88vw);
    background: #fff;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(.4,2,.4,1);
    display: flex; flex-direction: column;
    box-shadow: -16px 0 40px rgba(0,0,0,0.25);
    overflow: hidden;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .drawer.open { transform: translateX(0); }

  .drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--indigo), #9d8fb5);
    color: #fff;
  }
  .drawer-head h2 { font-size: 1.05rem; font-weight: 900; }
  .drawer-close {
    background: rgba(255,255,255,0.15); color: #fff; border: none;
    width: 36px; height: 36px; border-radius: 50%;
    font-size: 1.3rem; font-weight: 700; cursor: pointer;
    line-height: 1;
  }
  .drawer-close:hover { background: rgba(255,255,255,0.28); }

  .drawer-search {
    width: calc(100% - 24px); margin: 12px;
    padding: 10px 14px;
    border: 2px solid var(--sakura-light);
    border-radius: 12px;
    font-family: inherit; font-size: 0.9rem;
    outline: none; transition: border-color 0.2s;
  }
  .drawer-search:focus { border-color: var(--sakura); }

  .drawer-body {
    overflow-y: auto; padding: 4px 12px 20px;
    flex: 1;
  }
  .dgroup { margin-bottom: 14px; }
  .dgroup-title {
    font-size: 0.72rem; font-weight: 900;
    color: var(--sakura); letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 8px 6px 6px;
  }
  .ditem {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--indigo);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.92rem;
    transition: background 0.18s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
  }
  .ditem:hover { background: var(--sakura-light); }
  .ditem.active {
    background: linear-gradient(135deg, var(--sakura), var(--sakura-dim));
    color: #fff;
    box-shadow: 0 4px 12px rgba(255,107,157,0.35);
  }
  .ditem .ico { font-size: 1.3rem; flex-shrink: 0; width: 24px; text-align: center; }
  .ditem .lbl { flex: 1; }
  .ditem .arrow { color: #aaa; font-size: 0.85rem; }
  .ditem.active .arrow { color: rgba(255,255,255,0.8); }
  .ditem.hidden { display: none; }
  .dgroup.hidden { display: none; }
  .dno-result {
    text-align: center; padding: 24px;
    color: #aaa; font-size: 0.9rem;
  }

  /* ====== MAIN ====== */
  .main { position: relative; z-index: 5; padding: 20px 16px 80px; max-width: 760px; margin: 0 auto; }

  /* ====== SECTION ====== */
  .section { display: none; animation: fadeSlideIn 0.4s ease; }
  .section.active { display: block; }
  @keyframes fadeSlideIn { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

  .section-title {
    font-size: clamp(1.3rem,4vw,1.8rem);
    font-weight: 900; color: var(--indigo);
    margin-bottom: 6px;
    display: flex; align-items: center; gap: 10px;
  }
  .section-desc { color: #666; font-size: 0.9rem; margin-bottom: 20px; }

  /* ====== CARDS ====== */
  .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; margin-bottom: 24px; }
  .char-card {
    background: var(--card-bg);
    border-radius: 16px; padding: 14px 8px;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer; transition: all 0.22s;
    border: 2px solid transparent;
    position: relative; overflow: hidden;
  }
  .char-card::before {
    content:''; position:absolute; inset:0;
    background: linear-gradient(135deg, var(--sakura-light), transparent);
    opacity: 0; transition: opacity 0.2s;
  }
  .char-card:hover { transform: translateY(-4px) scale(1.04); border-color: var(--sakura); box-shadow: 0 12px 28px rgba(255,107,157,0.25); }
  .char-card:hover::before { opacity:1; }
  .char-card:active { transform: scale(0.96); }

  .char-main { font-size: 2rem; font-weight: 700; color: var(--indigo); line-height:1.1; position:relative;z-index:1; }
  .char-roman { font-size: 0.75rem; color: var(--sakura); font-weight: 700; margin-top: 4px; position:relative;z-index:1; }
  .char-indo { font-size: 0.68rem; color: #888; position:relative;z-index:1; }

  /* ====== LESSON CARD ====== */
  .lesson-block {
    background: var(--card-bg);
    border-radius: 20px; padding: 20px;
    box-shadow: var(--shadow); margin-bottom: 16px;
    border-left: 5px solid var(--sakura);
  }
  .lesson-block h3 { color: var(--indigo); font-size: 1.05rem; margin-bottom: 10px; }

  .phrase-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 12px;
    background: linear-gradient(135deg, #fff5f8, #fff);
    margin-bottom: 8px; cursor: pointer;
    border: 1.5px solid var(--sakura-light);
    transition: all 0.18s;
  }
  .phrase-row:hover { border-color: var(--sakura); transform: translateX(4px); background: var(--sakura-light); }
  .phrase-jp { font-size: 1.3rem; font-weight: 700; color: var(--indigo); min-width: 90px; }
  .phrase-rom { font-size: 0.82rem; color: var(--sakura); font-weight: 700; }
  .phrase-id { font-size: 0.85rem; color: #555; flex:1; }
  .play-btn {
    background: linear-gradient(135deg, var(--sakura), var(--sakura-dim));
    color: #fff; border: none; border-radius: 50%;
    width: 32px; height: 32px; font-size: 0.9rem;
    cursor: pointer; transition: transform 0.15s;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  .play-btn:hover { transform: scale(1.18); }

  /* ====== DAILY CHALLENGE WIDGET ====== */
  .rk-daily-card {
    background: linear-gradient(135deg, #fff5f8 0%, #fef9e7 50%, #fff5f8 100%);
    border: 2px solid var(--sakura-light, #ffe0e9);
    border-radius: 22px;
    padding: 18px 20px;
    margin: 16px 0 24px;
    box-shadow: 0 8px 24px rgba(255, 107, 157, 0.10);
    position: relative;
    overflow: hidden;
  }
  .rk-daily-card::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(247,201,72,0.18), transparent 70%);
    pointer-events: none;
  }
  .rk-daily-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; gap: 10px; position: relative; z-index: 1;
  }
  .rk-daily-badge { display: flex; align-items: center; gap: 10px; }
  .rk-daily-emoji {
    font-size: 1.8rem;
    animation: rkDailySway 3s ease-in-out infinite;
  }
  @keyframes rkDailySway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
  }
  .rk-daily-tag {
    font-size: 0.7rem; font-weight: 900; letter-spacing: 1.5px;
    color: var(--sakura, #c93570); text-transform: uppercase;
  }
  .rk-daily-date {
    font-size: 0.78rem; color: var(--text-soft, #888); font-weight: 700;
  }
  .rk-daily-streak {
    background: linear-gradient(135deg, #ff9800, #f57c00); color: #fff;
    padding: 6px 12px; border-radius: 99px;
    font-weight: 900; font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(245, 124, 0, 0.30);
  }
  .rk-daily-body {
    text-align: center; padding: 14px 8px; position: relative; z-index: 1;
  }
  .rk-daily-jp {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: clamp(3.2rem, 12vw, 5rem);
    font-weight: 900;
    color: var(--indigo, #6b5a7f);
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(58, 28, 113, 0.08);
    margin: 6px 0;
    letter-spacing: 2px;
  }
  .rk-daily-jp .speak-char {
    display: inline-block;
    transition: color 0.15s, background 0.15s, transform 0.15s;
    border-radius: 8px;
    padding: 0 2px;
  }
  .rk-daily-jp .speak-char.speak-active {
    background: linear-gradient(135deg, var(--gold, #f5b942), #ffd87a);
    color: #5b2a08;
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 4px 12px rgba(217, 148, 35, 0.45);
  }
  .rk-daily-romaji {
    font-size: 1.1rem; font-weight: 800;
    color: var(--sakura, #c93570);
    margin: 6px 0 8px;
    letter-spacing: 1px;
  }
  .rk-daily-id {
    font-size: 0.95rem; color: #444; font-weight: 700;
    max-width: 380px; margin: 0 auto;
    line-height: 1.5;
  }
  .rk-daily-cat {
    display: inline-block; margin-top: 8px;
    background: rgba(107, 90, 127, 0.10); color: var(--indigo, #6b5a7f);
    padding: 3px 12px; border-radius: 99px;
    font-size: 0.72rem; font-weight: 800;
    letter-spacing: 0.5px;
  }
  .rk-daily-actions {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px; margin-top: 14px; position: relative; z-index: 1;
  }
  .rk-daily-btn {
    padding: 11px 14px; border: none; border-radius: 12px;
    font-family: inherit; font-weight: 800; font-size: 0.85rem;
    cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
    background: #fff; color: var(--indigo, #6b5a7f);
    border: 1.5px solid rgba(107, 90, 127, 0.15);
  }
  .rk-daily-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.10);
    border-color: var(--sakura, #c93570);
  }
  .rk-daily-btn:active { transform: translateY(0); }
  .rk-daily-btn.primary {
    background: linear-gradient(135deg, var(--sakura, #c93570), #a82a5d);
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 12px rgba(201, 53, 112, 0.30);
  }
  .rk-daily-btn.done {
    background: linear-gradient(135deg, #43a047, #2e7d32);
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.30);
  }
  .rk-daily-btn.done.completed {
    background: #e8f9f0; color: #1a5c3a;
    box-shadow: none;
  }
  .rk-daily-btn.done.completed::before { content: '✓ '; }
  .rk-daily-btn.share {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.30);
  }
  .rk-daily-tip {
    margin-top: 12px;
    background: rgba(247, 201, 72, 0.15);
    border-left: 3px solid var(--gold, #f5b942);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.78rem; color: #a06000;
    line-height: 1.5; position: relative; z-index: 1;
  }
  @media (max-width: 480px) {
    .rk-daily-card { padding: 14px 14px; }
    .rk-daily-jp { letter-spacing: 1px; }
    .rk-daily-actions { grid-template-columns: 1fr 1fr; }
  }
  @media (prefers-reduced-motion: reduce) {
    .rk-daily-emoji { animation: none; }
  }

  /* Stroke writing button next to play (✍️ in phrase-row) */
  .stroke-btn-row {
    background: linear-gradient(135deg, var(--gold, #f5b942), #d99423);
    color: #fff; border: none; border-radius: 50%;
    width: 32px; height: 32px; font-size: 0.85rem;
    cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(217,148,35,0.30);
  }
  .stroke-btn-row:hover { transform: scale(1.18) rotate(-8deg); box-shadow: 0 5px 12px rgba(217,148,35,0.40); }
  .stroke-btn-row:active { transform: scale(0.94); }
  .stroke-btn-row:focus { outline: 2px solid var(--gold, #f5b942); outline-offset: 2px; }

  /* Karaoke-style highlight while TTS pronounces each char */
  .speak-char {
    display: inline-block;
    transition: color 0.15s, background 0.15s, transform 0.15s;
    border-radius: 4px;
    padding: 0 1px;
  }
  .speak-char.speak-active {
    background: linear-gradient(135deg, var(--gold, #f5b942), #ffd87a);
    color: #5b2a08;
    transform: translateY(-2px) scale(1.10);
    box-shadow: 0 3px 8px rgba(217,148,35,0.45);
  }
  @media (prefers-reduced-motion: reduce) {
    .speak-char, .speak-char.speak-active { transition: none; transform: none; }
  }

  /* ====== FLIP CARD ====== */
  .flip-area { perspective: 800px; margin-bottom: 24px; }
  .flip-card {
    width: 100%; max-width: 340px; height: 200px;
    margin: 0 auto; position: relative;
    cursor: pointer; transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(.4,2,.4,1);
  }
  .flip-card.flipped { transform: rotateY(180deg); }
  .flip-face {
    position: absolute; inset:0; border-radius: 24px;
    backface-visibility: hidden;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    box-shadow: var(--shadow);
  }
  .flip-front {
    background: linear-gradient(135deg, var(--indigo), #9d8fb5);
    color: #fff;
  }
  .flip-back {
    background: linear-gradient(135deg, var(--gold), var(--mint));
    transform: rotateY(180deg);
    color: var(--indigo);
  }
  .flip-char { font-size: 5rem; font-weight: 900; }
  .flip-hint { font-size: 0.85rem; opacity: 0.7; margin-top: 8px; }
  .flip-answer { font-size: 2rem; font-weight: 800; }
  .flip-nav { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; }
  .flip-nav button {
    padding: 9px 22px; border-radius: 99px; border: none;
    font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.9rem;
    cursor: pointer; transition: all 0.18s;
  }
  .btn-prev { background: var(--sakura-light); color: var(--indigo); }
  .btn-next { background: linear-gradient(135deg, var(--sakura), var(--sakura-dim)); color: #fff; box-shadow: 0 4px 12px rgba(255,107,157,0.35); }
  .btn-prev:hover, .btn-next:hover { transform: translateY(-2px); }
  .flip-counter { text-align: center; color: #aaa; font-size: 0.85rem; margin-bottom: 12px; }

  /* ====== QUIZ ====== */
  .quiz-box {
    background: var(--card-bg); border-radius: 20px; padding: 22px;
    box-shadow: var(--shadow); text-align: center;
  }
  .quiz-question { font-size: clamp(2.5rem,8vw,4rem); font-weight: 900; color: var(--indigo); margin-bottom: 8px; }
  .quiz-sub { font-size: 0.88rem; color: #999; margin-bottom: 20px; }
  .quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .quiz-opt {
    padding: 13px; border-radius: 14px; border: 2.5px solid var(--sakura-light);
    background: #fff; color: var(--indigo);
    font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.95rem;
    cursor: pointer; transition: all 0.18s;
  }
  .quiz-opt:hover { border-color: var(--sakura); background: var(--sakura-light); transform: scale(1.03); }
  .quiz-opt.correct { background: linear-gradient(135deg,var(--mint),var(--mint)); border-color: var(--mint); color: #1a5c3a; animation: pulse 0.4s ease; }
  .quiz-opt.wrong   { background: #ffe0e0; border-color: var(--sakura-dim); color: var(--sakura-dim); animation: shake 0.4s ease; }
  @keyframes pulse { 0%{transform:scale(1)} 50%{transform:scale(1.07)} 100%{transform:scale(1)} }
  @keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

  .quiz-feedback {
    margin-top: 14px; padding: 12px 16px; border-radius: 12px;
    font-weight: 700; font-size: 0.95rem; display: none;
  }
  .quiz-feedback.show { display: block; animation: fadeSlideIn 0.3s ease; }
  .quiz-feedback.ok  { background: #d4fce9; color: #1a5c3a; }
  .quiz-feedback.no  { background: #ffe0e0; color: var(--sakura-dim); }

  .btn-next-quiz {
    margin-top: 14px; padding: 11px 28px; border-radius: 99px;
    background: linear-gradient(135deg, var(--sakura), var(--sakura-dim));
    color: #fff; border: none; font-family: 'Nunito', sans-serif;
    font-weight: 700; font-size: 0.95rem; cursor: pointer;
    box-shadow: 0 4px 14px rgba(255,107,157,0.35);
    display: none; transition: all 0.18s;
  }
  .btn-next-quiz.show { display: inline-block; animation: fadeSlideIn 0.3s ease; }
  .btn-next-quiz:hover { transform: translateY(-2px); }

  /* ====== SCORE ====== */
  .score-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, var(--gold), var(--coral));
    color: #fff; padding: 6px 14px; border-radius: 99px;
    font-weight: 800; font-size: 0.9rem; margin-bottom: 16px;
    box-shadow: 0 3px 12px rgba(247,201,72,0.4);
  }

  /* ====== SPEAKING ====== */
  .speak-btn {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: var(--indigo); border: none;
    padding: 10px 22px; border-radius: 99px;
    font-family: 'Nunito', sans-serif; font-weight: 700;
    cursor: pointer; font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(79,172,254,0.35);
    transition: all 0.18s; display: inline-flex; align-items: center; gap: 6px;
  }
  .speak-btn:hover { transform: translateY(-2px) scale(1.03); }
  .speak-btn.speaking { animation: speakPulse 0.6s infinite alternate; }
  @keyframes speakPulse { from{box-shadow:0 4px 12px rgba(79,172,254,0.35)} to{box-shadow:0 4px 24px rgba(79,172,254,0.7)} }

  /* ====== CONFETTI ====== */
  .confetti-piece {
    position: fixed; width: 10px; height: 10px;
    pointer-events: none; z-index: 9999;
    animation: confettiFall 1.5s ease forwards;
    border-radius: 2px;
  }
  @keyframes confettiFall {
    0%   { transform: translateY(0) rotate(0) scale(1); opacity:1; }
    100% { transform: translateY(120vh) rotate(720deg) scale(0.5); opacity:0; }
  }

  /* ====== DENGAR & TULIS (Listening Dictation) ====== */
  .dt-mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 18px;
    background: #fff5f8;
    padding: 8px;
    border-radius: 16px;
    border: 2px solid var(--sakura-light);
  }
  .dt-mode-tabs button {
    background: transparent;
    color: var(--indigo);
    border: none;
    padding: 10px 8px;
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    line-height: 1.1;
  }
  .dt-mode-tabs button .ico { font-size: 1.4rem; line-height: 1; }
  .dt-mode-tabs button:hover { background: rgba(255,255,255,0.6); }
  .dt-mode-tabs button.active {
    background: linear-gradient(135deg, var(--sakura), var(--sakura-dim));
    color: #fff;
    box-shadow: 0 4px 12px rgba(216,155,168,0.25);
  }
  @media (max-width: 480px) {
    .dt-mode-tabs button { font-size: 0.7rem; padding: 8px 4px; }
    .dt-mode-tabs button .ico { font-size: 1.2rem; }
  }

  /* Read mode */
  .dt-read-display {
    background: linear-gradient(135deg, #fff5f8, #fff);
    border: 2px solid var(--sakura-light);
    border-radius: 22px;
    padding: 30px 20px;
    text-align: center;
    margin: 18px 0;
  }
  .dt-read-char {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: clamp(3rem, 12vw, 5.5rem);
    font-weight: 700;
    color: var(--indigo);
    line-height: 1.15;
    margin: 12px 0;
    text-shadow: 0 4px 12px rgba(58,28,113,0.12);
  }
  .dt-read-instruct {
    color: #666;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 14px;
  }
  .dt-reveal-card {
    background: linear-gradient(135deg, #fef9c3, #fffbe6);
    border-left: 5px solid var(--gold);
    border-radius: 14px;
    padding: 14px 18px;
    margin: 14px 0;
    animation: fadeSlideIn 0.4s ease;
  }
  .dt-rate-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
  }
  .dt-rate-btn {
    padding: 14px;
    border-radius: 14px;
    border: none;
    font-weight: 900;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.18s;
  }
  .dt-rate-btn:hover { transform: translateY(-2px); }
  .dt-rate-btn.yes { background: linear-gradient(135deg, var(--mint), var(--mint)); color: #1a5c3a; }
  .dt-rate-btn.no { background: linear-gradient(135deg, var(--coral), var(--sakura-dim)); color: #fff; }

  /* Draw mode */
  .dt-draw-area {
    background: linear-gradient(135deg, #fff5f8, #fff);
    border-radius: 22px;
    padding: 22px;
    margin-top: 18px;
    text-align: center;
    border: 2px dashed var(--sakura-light);
  }
  .dt-draw-area h4 {
    color: var(--indigo); font-size: 0.95rem;
    margin-bottom: 12px;
  }
  .dt-draw-canvas {
    display: inline-block;
    background: #fff;
    border-radius: 16px;
    border: 2px solid var(--sakura-light);
    width: 260px; height: 260px;
    margin: 8px auto 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    position: relative;
  }
  .dt-draw-canvas svg { display: block; margin: 0 auto; }
  .dt-draw-info {
    background: rgba(247,201,72,0.18);
    color: #5b2a08;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    margin: 4px 0 8px;
    display: inline-block;
  }
  .dt-draw-actions {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
    margin-top: 10px;
  }
  .dt-draw-actions button {
    background: var(--indigo); color: #fff; border: none;
    padding: 9px 14px; border-radius: 99px;
    font-weight: 800; font-size: 0.78rem; cursor: pointer;
    font-family: inherit; transition: transform 0.18s;
  }
  .dt-draw-actions button:hover { transform: translateY(-2px); }
  .dt-draw-actions button.show { background: var(--gold); color: #5b2a08; }
  .dt-draw-actions button.skip { background: var(--coral); color: #fff; }

  /* Leaderboard */
  .dt-lb-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 10px 0 14px;
  }
  .dt-lb-tabs button {
    background: #fff;
    color: var(--indigo);
    border: 2px solid var(--sakura-light);
    padding: 8px 4px;
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.74rem;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    line-height: 1.1;
  }
  .dt-lb-tabs button .ico { font-size: 1.2rem; }
  .dt-lb-tabs button:hover { background: var(--sakura-light); }
  .dt-lb-tabs button.active {
    background: linear-gradient(135deg, var(--indigo), #9d8fb5);
    color: #fff; border-color: transparent;
  }
  .dt-lb-list { display: grid; gap: 8px; }
  .dt-lb-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 12px;
    align-items: center;
    background: linear-gradient(135deg, #fff5f8, #fff);
    border: 2px solid var(--sakura-light);
    border-radius: 12px;
    padding: 10px 14px;
  }
  .dt-lb-row.gold { background: linear-gradient(135deg, #fef9c3, #fff); border-color: var(--gold); }
  .dt-lb-row.silver { background: linear-gradient(135deg, #f0f0f5, #fff); border-color: #c0c0c0; }
  .dt-lb-row.bronze { background: linear-gradient(135deg, #fef0e6, #fff); border-color: #cd7f32; }
  .dt-lb-rank {
    font-size: 1.8rem; line-height: 1;
    text-align: center;
  }
  .dt-lb-rank.num { color: #aaa; font-weight: 900; font-size: 1.2rem; }
  .dt-lb-info { line-height: 1.3; }
  .dt-lb-info .lvl {
    font-weight: 900; color: var(--indigo);
    font-size: 0.95rem;
  }
  .dt-lb-info .date {
    color: #888; font-size: 0.74rem;
    margin-top: 2px;
  }
  .dt-lb-pct {
    font-weight: 900;
    font-size: 1.3rem;
    text-align: right;
    line-height: 1;
  }
  .dt-lb-pct small { display: block; font-size: 0.65rem; color: #888; font-weight: 700; margin-top: 2px; }
  .dt-lb-empty {
    text-align: center; padding: 20px;
    color: #aaa; font-size: 0.85rem; line-height: 1.6;
  }

  /* Share leaderboard button */
  .dt-lb-share-row {
    display: flex; justify-content: center; margin-top: 14px;
    padding-top: 12px; border-top: 1px dashed var(--sakura-light);
  }
  .dt-lb-share-btn {
    background: linear-gradient(135deg, var(--indigo), #9d8fb5);
    color: #fff; border: none;
    padding: 10px 22px; border-radius: 99px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800; font-size: 0.82rem; cursor: pointer;
    box-shadow: 0 8px 20px rgba(58,28,113,0.3);
    transition: transform 0.18s;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .dt-lb-share-btn:hover { transform: translateY(-2px); }
  .dt-lb-share-btn:disabled { opacity: 0.6; cursor: wait; }

  /* ====== AUTH MODAL ====== */
  .auth-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(26, 13, 46, 0.78);
    backdrop-filter: blur(6px);
    z-index: 99999;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    overflow-y: auto;
  }
  .auth-modal-overlay.open { opacity: 1; pointer-events: auto; }
  .auth-modal {
    background: #fff;
    border-radius: 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.4);
    transform: scale(0.92);
    transition: transform 0.32s cubic-bezier(.4,2,.6,1);
    overflow: hidden;
  }
  .auth-modal-overlay.open .auth-modal { transform: scale(1); }
  .auth-modal-head {
    background: linear-gradient(135deg, #6b5a7f, #9d8fb5);
    color: #fff;
    padding: 26px 22px 22px;
    text-align: center;
    position: relative;
  }
  .auth-modal-head .emoji { font-size: 3rem; line-height: 1; margin-bottom: 6px; }
  .auth-modal-head h2 { font-size: 1.25rem; font-weight: 900; margin-bottom: 4px; }
  .auth-modal-head p { font-size: 0.85rem; opacity: 0.9; line-height: 1.5; }
  .auth-modal-close {
    position: absolute; top: 14px; right: 14px;
    background: rgba(255,255,255,0.22); color: #fff; border: none;
    width: 32px; height: 32px; border-radius: 50%;
    font-size: 1.3rem; cursor: pointer; line-height: 1; font-weight: 700;
  }
  .auth-modal-body { padding: 22px; }
  .auth-modal-body label {
    display: block; color: var(--indigo); font-weight: 800;
    font-size: 0.85rem; margin: 12px 0 4px;
  }
  .auth-modal-body input {
    width: 100%; padding: 12px 14px;
    border: 2px solid var(--sakura-light);
    border-radius: 10px;
    font-family: inherit; font-size: 0.95rem; font-weight: 600;
    color: var(--indigo); outline: none;
    transition: border-color 0.18s;
  }
  .auth-modal-body input:focus { border-color: var(--sakura); }
  .auth-submit-btn {
    width: 100%; background: linear-gradient(135deg, var(--indigo), #9d8fb5);
    color: #fff; border: none;
    padding: 13px; border-radius: 12px;
    font-family: inherit; font-weight: 900; font-size: 0.95rem;
    cursor: pointer; margin-top: 16px;
    box-shadow: 0 8px 20px rgba(58,28,113,0.3);
    transition: transform 0.18s;
  }
  .auth-submit-btn:hover { transform: translateY(-2px); }
  .auth-submit-btn:disabled { opacity: 0.6; cursor: wait; }
  .auth-err-box {
    background: #fef2f2; border-left: 4px solid var(--sakura-dim);
    border-radius: 10px; padding: 10px 12px;
    margin-top: 12px; color: var(--sakura-dim); font-size: 0.84rem;
    line-height: 1.5;
  }
  .auth-divider {
    text-align: center; margin: 18px 0 12px;
    position: relative; color: #999; font-size: 0.78rem;
  }
  .auth-divider::before {
    content: ''; position: absolute;
    top: 50%; left: 0; right: 0; height: 1px; background: #eee;
  }
  .auth-divider span {
    background: #fff; padding: 0 12px; position: relative;
  }
  .auth-register-link {
    display: block; text-align: center;
    background: var(--sakura-light); color: var(--indigo);
    padding: 12px; border-radius: 12px;
    text-decoration: none; font-weight: 800; font-size: 0.92rem;
    transition: background 0.18s;
  }
  .auth-register-link:hover { background: var(--sakura); color: #fff; }
  .auth-modal-footer {
    text-align: center; margin-top: 14px;
    color: #888; font-size: 0.78rem; line-height: 1.5;
  }
  .auth-modal-footer small { color: #aaa; }

  /* Certificate modal */
  .cert-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(26, 13, 46, 0.78);
    backdrop-filter: blur(6px);
    z-index: 99999;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    overflow-y: auto;
  }
  .cert-modal-overlay.open { opacity: 1; pointer-events: auto; }
  .cert-modal {
    background: #fff;
    border-radius: 22px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.4);
    transform: scale(0.92);
    transition: transform 0.32s cubic-bezier(.4,2,.6,1);
    overflow: hidden;
  }
  .cert-modal-overlay.open .cert-modal { transform: scale(1); }
  .cert-modal-head {
    background: linear-gradient(135deg, var(--gold), var(--coral));
    color: #5b2a08;
    padding: 24px 22px;
    text-align: center;
    position: relative;
  }
  .cert-modal-head .trophy {
    font-size: 3.5rem; display: block; margin-bottom: 6px;
    animation: bounceIco 0.6s ease infinite alternate;
  }
  .cert-modal-head h3 { font-size: 1.3rem; font-weight: 900; }
  .cert-modal-head p { font-size: 0.88rem; opacity: 0.88; margin-top: 4px; }
  .cert-modal-close {
    position: absolute; top: 14px; right: 14px;
    background: rgba(255,255,255,0.3); color: #5b2a08; border: none;
    width: 30px; height: 30px; border-radius: 50%;
    font-size: 1.2rem; cursor: pointer; line-height: 1;
  }
  .cert-modal-body { padding: 22px; }
  .cert-modal-body label {
    display: block; color: var(--indigo);
    font-weight: 800; font-size: 0.88rem; margin-bottom: 6px;
  }
  .cert-modal-body input {
    width: 100%; padding: 12px 16px;
    border: 2.5px solid var(--sakura-light);
    border-radius: 12px;
    font-family: inherit; font-size: 1rem; font-weight: 700;
    color: var(--indigo); outline: none;
    text-transform: capitalize;
    margin-bottom: 14px;
  }
  .cert-modal-body input:focus { border-color: var(--sakura); }
  .cert-modal-info {
    background: linear-gradient(135deg, #fef9c3, #fffbe6);
    border-left: 4px solid var(--gold);
    padding: 10px 14px; border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.85rem; line-height: 1.5;
  }
  .cert-modal-info b { color: var(--indigo); }
  .cert-modal-actions {
    display: flex; gap: 10px; flex-wrap: wrap;
  }
  .cert-modal-actions button {
    flex: 1; padding: 12px 16px; border-radius: 12px; border: none;
    font-family: inherit; font-weight: 800; font-size: 0.92rem;
    cursor: pointer; transition: transform 0.18s;
  }
  .cert-modal-actions button:hover { transform: translateY(-2px); }
  .cert-modal-actions .gen-btn {
    background: linear-gradient(135deg, var(--gold), var(--coral));
    color: #5b2a08;
    box-shadow: 0 8px 20px rgba(247,115,22,0.4);
  }
  .cert-modal-actions .cancel-btn {
    background: #eee; color: #666;
  }

  /* Cert ribbon button (shown on 100% result) */
  .cert-trigger-btn {
    background: linear-gradient(135deg, var(--gold), var(--coral));
    color: #5b2a08; border: none;
    padding: 14px 28px; border-radius: 99px;
    font-family: 'Nunito', sans-serif;
    font-weight: 900; font-size: 1rem;
    cursor: pointer; margin: 14px 6px 0;
    box-shadow: 0 12px 28px rgba(247,115,22,0.45);
    display: inline-flex; align-items: center; gap: 8px;
    animation: certPulse 1.6s ease-in-out infinite;
  }
  @keyframes certPulse {
    0%, 100% { box-shadow: 0 12px 28px rgba(247,115,22,0.45); }
    50%      { box-shadow: 0 12px 36px rgba(247,115,22,0.7), 0 0 0 8px rgba(247,201,72,0.18); }
  }

  /* Export drawing button */
  .dt-export-btn {
    background: linear-gradient(135deg, var(--indigo), #9d8fb5);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 99px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(58,28,113,0.35);
    margin-top: 8px;
    transition: transform 0.18s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .dt-export-btn:hover { transform: translateY(-2px) scale(1.03); }
  .dt-export-btn:disabled { opacity: 0.6; cursor: wait; }

  .dt-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  .dt-pick-card {
    background: linear-gradient(135deg, var(--indigo), #9d8fb5);
    color: #fff;
    border-radius: 16px;
    padding: 18px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
    box-shadow: 0 8px 20px rgba(58,28,113,0.25);
  }
  .dt-pick-card:hover { transform: translateY(-4px); }
  .dt-pick-card.n4 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
  .dt-pick-card.n3 { background: linear-gradient(135deg, #f5576c, #f093fb); }
  .dt-pick-card.n2 { background: linear-gradient(135deg, #9b51e0, #4361ee); }
  .dt-pick-card.n1 { background: linear-gradient(135deg, #2c3e50, #4a1c5e); }
  .dt-pick-card.all { background: linear-gradient(135deg, var(--gold), var(--coral)); color: #fff; }
  .dt-pick-card .lvl { font-size: 1.6rem; font-weight: 900; line-height: 1; }
  .dt-pick-card .desc { font-size: 0.78rem; opacity: 0.9; margin-top: 6px; line-height: 1.4; }
  .dt-pick-card .count { background: rgba(255,255,255,0.25); padding: 3px 10px; border-radius: 99px; font-size: 0.72rem; font-weight: 800; margin-top: 8px; display: inline-block; }

  .dt-session {
    background: #fff; border-radius: 22px; padding: 22px; box-shadow: var(--shadow);
  }
  .dt-session-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
  }
  .dt-session-head .lvl-badge {
    background: var(--indigo); color: #fff;
    padding: 5px 14px; border-radius: 99px;
    font-weight: 900; font-size: 0.82rem;
  }
  .dt-progress {
    background: #eee; border-radius: 99px; height: 8px; overflow: hidden;
  }
  .dt-progress > div { height: 100%; background: linear-gradient(90deg, var(--sakura), var(--sakura-dim)); border-radius: 99px; transition: width 0.4s; }
  .dt-score { color: var(--indigo); font-weight: 900; font-size: 0.95rem; }
  .dt-score b { color: var(--sakura); }

  .dt-audio-area {
    background: linear-gradient(135deg, var(--indigo), #9d8fb5);
    border-radius: 20px;
    padding: 30px 24px;
    text-align: center;
    color: #fff;
    margin: 18px 0;
    position: relative;
    overflow: hidden;
  }
  .dt-audio-area::before {
    content: '🎵'; position: absolute;
    font-size: 280px; opacity: 0.04;
    top: -60px; right: -40px; line-height: 1;
    pointer-events: none;
  }
  .dt-audio-area h3 {
    font-size: 1.05rem; margin-bottom: 14px; opacity: 0.9;
    position: relative;
  }
  .dt-audio-btn {
    background: var(--gold); color: var(--indigo);
    border: none; padding: 18px 32px;
    border-radius: 99px;
    font-weight: 900; font-size: 1.05rem;
    cursor: pointer; font-family: inherit;
    box-shadow: 0 10px 28px rgba(247,201,72,0.5);
    transition: transform 0.18s;
    margin: 4px; position: relative;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .dt-audio-btn:hover { transform: translateY(-3px) scale(1.03); }
  .dt-audio-btn.slow { background: rgba(255,255,255,0.25); color: #fff; font-size: 0.85rem; padding: 12px 20px; box-shadow: none; border: 2px solid rgba(255,255,255,0.4); }
  .dt-audio-btn .audio-pulse {
    display: inline-block;
    width: 12px; height: 12px;
    background: var(--indigo);
    border-radius: 50%;
    animation: dtAudioPulse 1s infinite;
  }
  @keyframes dtAudioPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.4; }
  }
  .dt-audio-info {
    margin-top: 14px; font-size: 0.82rem; opacity: 0.88;
    position: relative;
  }

  .dt-input-wrap {
    position: relative; margin: 18px 0;
  }
  .dt-input {
    width: 100%;
    padding: 16px 60px 16px 18px;
    border: 2.5px solid var(--sakura-light);
    border-radius: 14px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--indigo);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .dt-input:focus {
    border-color: var(--sakura);
    box-shadow: 0 0 0 4px rgba(255,107,157,0.15);
  }
  .dt-input.correct { border-color: var(--mint); background: #f0fcf5; }
  .dt-input.wrong { border-color: var(--sakura-dim); background: #fdf2f2; }
  .dt-submit-btn {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: linear-gradient(135deg, var(--sakura), var(--sakura-dim));
    color: #fff; border: none;
    width: 44px; height: 44px;
    border-radius: 50%;
    font-size: 1.2rem; cursor: pointer;
    box-shadow: 0 6px 16px rgba(216,155,168,0.25);
  }
  .dt-submit-btn:hover { transform: translateY(-50%) scale(1.08); }

  .dt-action-row {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
    margin-bottom: 12px;
  }
  .dt-action-btn {
    background: #f0f0f0; color: #666; border: none;
    padding: 9px 16px; border-radius: 99px;
    font-weight: 800; font-size: 0.82rem;
    cursor: pointer; font-family: inherit;
    transition: all 0.18s;
  }
  .dt-action-btn:hover { background: #e0e0e0; }
  .dt-action-btn.hint { background: var(--gold); color: #5b2a08; }
  .dt-action-btn.skip { background: #ffe0e0; color: var(--sakura-dim); }

  .dt-feedback {
    border-radius: 16px; padding: 18px;
    margin-top: 14px;
    animation: fadeSlideIn 0.3s ease;
  }
  .dt-feedback.correct { background: linear-gradient(135deg, #d4fce9, #fff); border-left: 5px solid var(--mint); }
  .dt-feedback.wrong { background: linear-gradient(135deg, #ffe0e0, #fff); border-left: 5px solid var(--sakura-dim); }
  .dt-feedback .result-title {
    font-size: 1.2rem; font-weight: 900;
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
  }
  .dt-feedback.correct .result-title { color: #1a5c3a; }
  .dt-feedback.wrong .result-title { color: var(--sakura-dim); }
  .dt-answer-row {
    background: rgba(255,255,255,0.6);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 4px 0;
    display: flex; align-items: center; gap: 10px;
    font-size: 0.92rem;
  }
  .dt-answer-row b { color: var(--indigo); min-width: 70px; }
  .dt-answer-row .jp { font-family: 'Noto Sans JP'; font-size: 1.1rem; font-weight: 700; color: var(--indigo); }
  .dt-feedback-actions { display: flex; gap: 8px; margin-top: 12px; }
  .dt-feedback-actions button {
    flex: 1; padding: 11px; border-radius: 12px; border: none;
    font-weight: 800; font-size: 0.92rem; cursor: pointer; font-family: inherit;
  }
  .dt-feedback-actions .next-btn {
    background: linear-gradient(135deg, var(--sakura), var(--sakura-dim)); color: #fff;
  }
  .dt-feedback-actions .finish-btn {
    background: linear-gradient(135deg, var(--indigo), #9d8fb5); color: #fff;
  }

  .dt-hint-display {
    background: var(--gold); color: #5b2a08;
    padding: 8px 14px; border-radius: 10px;
    font-weight: 700; font-size: 0.88rem;
    margin: 8px 0; text-align: center;
  }
  .dt-hint-display b { font-family: 'Noto Sans JP'; font-size: 1.2rem; }

  .dt-format-tabs {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin: 8px 0 0; font-size: 0.74rem;
  }
  .dt-format-tabs span {
    background: var(--sakura-light); color: var(--indigo);
    padding: 3px 10px; border-radius: 99px;
    font-weight: 700;
  }

  /* ====== SIMULASI PENULISAN ====== */
  .sim-input-wrap { position: relative; margin: 14px 0 18px; }
  .sim-input {
    width: 100%;
    padding: 14px 18px 14px 46px;
    border: 2.5px solid var(--sakura-light);
    border-radius: 14px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--indigo);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
  }
  .sim-input:focus {
    border-color: var(--sakura);
    box-shadow: 0 0 0 4px rgba(255,107,157,0.15);
  }
  .sim-input-icon {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    font-size: 1.2rem; pointer-events: none;
  }
  .sim-helper {
    color: #888; font-size: 0.78rem; margin-top: 6px;
    display: flex; gap: 6px; flex-wrap: wrap;
  }
  .sim-helper span {
    background: var(--sakura-light); color: var(--indigo);
    padding: 3px 10px; border-radius: 99px; font-weight: 700;
    cursor: pointer; transition: background 0.18s;
  }
  .sim-helper span:hover { background: var(--sakura); color: #fff; }

  .sim-results { display: grid; gap: 10px; margin-bottom: 18px; }
  .sim-result {
    background: linear-gradient(135deg, #fff5f8, #fff);
    border: 2px solid var(--sakura-light);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex; align-items: center; gap: 14px;
    cursor: pointer;
    transition: all 0.2s;
  }
  .sim-result:hover {
    border-color: var(--sakura);
    transform: translateX(6px);
    box-shadow: 0 8px 22px rgba(255,107,157,0.18);
  }
  .sim-result.active {
    background: linear-gradient(135deg, var(--sakura), var(--sakura-dim));
    border-color: transparent;
  }
  .sim-result.active .sim-jp,
  .sim-result.active .sim-rom,
  .sim-result.active .sim-key { color: #fff; }
  .sim-jp {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1.6rem; font-weight: 700;
    color: var(--indigo); line-height: 1.1;
    min-width: 60px;
  }
  .sim-info { flex: 1; }
  .sim-rom {
    color: var(--sakura); font-weight: 800;
    font-size: 0.92rem;
  }
  .sim-key {
    color: #888; font-size: 0.78rem;
    margin-top: 2px; font-style: italic;
  }

  .sim-empty {
    background: #fafafa;
    border: 2px dashed #ddd;
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    color: #888;
  }
  .sim-empty strong { color: var(--indigo); display: block; margin-bottom: 4px; }

  .sim-anim-section {
    background: var(--card-bg);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--shadow);
    margin-top: 18px;
  }
  .sim-anim-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
  }
  .sim-anim-header h3 { color: var(--indigo); font-size: 1rem; }
  .sim-anim-controls { display: flex; gap: 6px; flex-wrap: wrap; }
  .sim-ctrl-btn {
    background: var(--indigo); color: #fff; border: none;
    padding: 7px 12px; border-radius: 99px;
    font-weight: 800; font-size: 0.78rem; cursor: pointer;
    font-family: inherit; transition: transform 0.18s;
  }
  .sim-ctrl-btn:hover { transform: translateY(-2px); }
  .sim-ctrl-btn.sakura { background: var(--sakura); }
  .sim-ctrl-btn.mint { background: var(--mint); color: #1a5c3a; }
  .sim-ctrl-btn.gold { background: var(--gold); color: #5b2a08; }

  .sim-char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
  }
  .sim-char-card {
    background: linear-gradient(135deg, #fff5f8, #fff);
    border-radius: 16px;
    padding: 14px 10px;
    text-align: center;
    border: 2px solid var(--sakura-light);
  }
  .sim-char-canvas {
    background: #fff;
    border-radius: 12px;
    margin: 0 auto 8px;
    width: 120px; height: 120px;
    border: 1.5px solid #f0f0f0;
    position: relative;
  }
  .sim-char-canvas svg { display: block; margin: 0 auto; }
  .sim-char-label {
    font-family: 'Noto Sans JP';
    font-size: 1.5rem; font-weight: 700;
    color: var(--indigo);
    margin-bottom: 6px;
  }
  .sim-char-actions {
    display: flex; gap: 4px; justify-content: center; flex-wrap: wrap;
  }
  .sim-char-actions button {
    background: var(--indigo); color: #fff; border: none;
    padding: 4px 10px; border-radius: 99px;
    font-weight: 800; font-size: 0.7rem; cursor: pointer;
    font-family: inherit;
  }
  .sim-char-actions button.quiz { background: var(--gold); color: #5b2a08; }
  .sim-loading {
    text-align: center; padding: 20px;
    color: #888; font-size: 0.9rem;
  }
  .sim-loading::before {
    content: '⏳';
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-right: 6px;
  }

  /* ====== ROADMAP SUKSES ====== */
  .roadmap {
    background: linear-gradient(135deg, #fff5f8 0%, #fff 100%);
    border-radius: 22px;
    padding: 24px 20px 28px;
    margin: 22px 0 18px;
    border: 2px solid var(--sakura-light);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
  }
  .roadmap::before {
    content: '日本語';
    position: absolute;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 900;
    font-size: 200px;
    color: rgba(58,28,113,0.04);
    bottom: -80px; right: -40px;
    pointer-events: none;
    line-height: 1;
  }
  .rm-title {
    text-align: center;
    color: var(--indigo);
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 900;
    margin-bottom: 4px;
  }
  .rm-sub {
    text-align: center;
    color: #666;
    font-size: 0.88rem;
    margin-bottom: 22px;
    line-height: 1.55;
  }
  .rm-timeline {
    position: relative;
    padding-left: 44px;
  }
  .rm-timeline::before {
    content: '';
    position: absolute;
    left: 18px; top: 18px; bottom: 18px;
    width: 5px;
    background: linear-gradient(180deg,
      var(--mint) 0%, var(--mint) 14%,
      #4facfe 14%, #4facfe 28%,
      var(--gold) 28%, var(--gold) 42%,
      var(--coral) 42%, var(--coral) 56%,
      var(--sakura) 56%, var(--sakura) 70%,
      #9b51e0 70%, #9b51e0 84%,
      #6b5a7f 84%, #6b5a7f 100%
    );
    border-radius: 3px;
  }
  .rm-stage {
    position: relative;
    margin-bottom: 14px;
    background: #fff;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 4px 16px rgba(58,28,113,0.08);
    cursor: pointer;
    transition: all 0.22s;
    border-left: 5px solid var(--accent, var(--sakura));
  }
  .rm-stage:hover {
    transform: translateX(6px);
    box-shadow: 0 12px 28px rgba(58,28,113,0.15);
  }
  .rm-stage::before {
    content: attr(data-num);
    position: absolute;
    left: -38px; top: 14px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent, var(--sakura));
    color: #fff;
    font-weight: 900;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    z-index: 2;
  }
  .rm-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
    font-size: 0.78rem;
  }
  .rm-icon { font-size: 1.5rem; line-height: 1; }
  .rm-duration {
    background: var(--accent, var(--sakura-light));
    color: #fff;
    padding: 3px 10px;
    border-radius: 99px;
    font-weight: 800;
    font-size: 0.72rem;
  }
  .rm-level-tag {
    background: rgba(58,28,113,0.08);
    color: var(--indigo);
    padding: 3px 10px;
    border-radius: 99px;
    font-weight: 800;
    font-size: 0.72rem;
  }
  .rm-stage h4 {
    color: var(--indigo);
    font-size: 1rem;
    font-weight: 900;
    margin-bottom: 4px;
  }
  .rm-stage p {
    color: #555;
    font-size: 0.85rem;
    line-height: 1.55;
    margin-bottom: 10px;
  }
  .rm-modules {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
  }
  .rm-modules span {
    background: #fff5f8;
    color: var(--indigo);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid var(--sakura-light);
  }
  .rm-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent, var(--sakura));
    color: #fff;
    padding: 7px 16px;
    border-radius: 99px;
    font-weight: 800;
    font-size: 0.78rem;
    border: none;
    cursor: pointer;
    transition: transform 0.18s;
    font-family: 'Nunito', sans-serif;
  }
  .rm-cta:hover { transform: scale(1.05); }
  /* Overall progress di top roadmap */
  .rm-overall {
    background: linear-gradient(135deg, #fff, #fff5f8);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 18px;
    border: 2px solid var(--sakura-light);
    text-align: center;
  }
  .rm-progress-text { color: var(--indigo); font-weight: 800; font-size: 0.95rem; margin-bottom: 8px; }
  .rm-progress-text strong { color: var(--sakura); font-size: 1.1rem; }
  .rm-progress-bar {
    background: #ffeef5; border-radius: 99px; height: 12px; overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
  }
  .rm-progress-bar > div {
    height: 100%;
    background: linear-gradient(90deg, var(--mint) 0%, var(--gold) 50%, var(--sakura) 80%, #6b5a7f 100%);
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(.4,2,.6,1);
    position: relative;
  }
  .rm-progress-bar > div::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: shimmer 2s infinite;
  }
  @keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

  /* Progress badge per stage */
  .rm-status {
    position: absolute; top: -10px; right: 14px;
    font-size: 0.7rem; font-weight: 900;
    padding: 4px 10px; border-radius: 99px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    z-index: 3;
  }
  .rm-status.done { background: var(--mint); color: #1a5c3a; }
  .rm-status.partial { background: var(--gold); color: #854d0e; }
  .rm-status.locked { background: #e5e5e5; color: #888; }
  .rm-stage.completed {
    background: linear-gradient(135deg, #f0fcf5, #fff);
    border-color: var(--mint);
  }
  .rm-stage.completed::before {
    background: var(--mint) !important;
    box-shadow: 0 4px 14px rgba(67,233,123,0.4);
  }
  .rm-stage.partial {
    background: linear-gradient(135deg, #fffbe6, #fff);
  }

  .rm-final {
    text-align: center;
    margin-top: 14px;
    padding: 16px;
    background: linear-gradient(135deg, #6b5a7f, #9d8fb5);
    color: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(58,28,113,0.3);
  }
  .rm-final .trophy { font-size: 3rem; display: block; margin-bottom: 6px; }
  .rm-final h4 { font-size: 1.05rem; margin-bottom: 4px; }
  .rm-final p { color: #ffd6e7; font-size: 0.84rem; line-height: 1.5; }

  /* Share buttons */
  .rm-share {
    margin-top: 18px;
    padding: 18px;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 2px dashed var(--sakura-light);
  }
  .rm-share h4 { color: var(--indigo); font-size: 0.95rem; font-weight: 900; margin-bottom: 6px; }
  .rm-share p { color: #666; font-size: 0.8rem; margin-bottom: 12px; line-height: 1.5; }
  .rm-share-row {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  }
  .rm-share-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 99px; border: none;
    font-weight: 800; font-size: 0.82rem;
    cursor: pointer; font-family: 'Nunito', sans-serif;
    color: #fff; transition: transform 0.18s;
  }
  .rm-share-btn:hover { transform: translateY(-2px); }
  .rm-share-btn.wa { background: #25D366; }
  .rm-share-btn.tg { background: #229ED9; }
  .rm-share-btn.tw { background: #1DA1F2; }
  .rm-share-btn.fb { background: #1877F2; }
  .rm-share-btn.png { background: linear-gradient(135deg, var(--indigo), #9d8fb5); }
  .rm-share-btn.cp { background: #888; }
  .rm-share-btn.spinning .ico { display: inline-block; animation: spin 0.9s linear infinite; }

  /* ====== STREAK COUNTER ====== */
  .streak-badge {
    background: linear-gradient(135deg, var(--coral), var(--sakura-dim));
    color: #fff;
    border-radius: 18px;
    padding: 14px 18px;
    margin: 18px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 28px rgba(249,115,22,0.35);
    position: relative;
    overflow: hidden;
  }
  .streak-badge.cold {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    box-shadow: 0 6px 18px rgba(100,116,139,0.25);
  }
  .streak-badge::before {
    content: '🔥'; position: absolute;
    font-size: 240px; opacity: 0.06;
    bottom: -80px; right: -30px; line-height: 1;
    pointer-events: none;
  }
  .streak-fire {
    font-size: 2.6rem;
    line-height: 1;
    animation: fireDance 0.6s ease infinite alternate;
    filter: drop-shadow(0 0 10px rgba(255,200,100,0.8));
  }
  .streak-badge.cold .streak-fire { animation: none; filter: grayscale(1); opacity: 0.6; }
  @keyframes fireDance {
    from { transform: scale(1) rotate(-3deg); }
    to   { transform: scale(1.15) rotate(5deg); }
  }
  .streak-info { flex: 1; }
  .streak-num {
    font-size: 1.6rem; font-weight: 900; line-height: 1.05;
    text-shadow: 0 2px 6px rgba(0,0,0,0.3);
  }
  .streak-lbl {
    font-size: 0.8rem; opacity: 0.92; margin-top: 2px;
  }
  .streak-meta {
    background: rgba(255,255,255,0.18);
    color: #fff;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: right;
    line-height: 1.3;
  }
  .streak-meta b { display: block; font-size: 0.95rem; }

  /* ====== HEATMAP CALENDAR ====== */
  .heatmap {
    background: #fff;
    border-radius: 16px;
    padding: 16px 16px 14px;
    margin: 12px 0 18px;
    box-shadow: 0 6px 18px rgba(58,28,113,0.08);
    border: 2px solid var(--sakura-light);
  }
  .hm-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
  }
  .hm-header h3 {
    color: var(--indigo); font-size: 0.95rem; font-weight: 900;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .hm-stats { font-size: 0.74rem; color: #666; display: flex; gap: 12px; flex-wrap: wrap; }
  .hm-stats b { color: var(--indigo); font-weight: 900; }

  .hm-wrap {
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }
  .hm-wrap::-webkit-scrollbar { height: 6px; }
  .hm-wrap::-webkit-scrollbar-thumb { background: var(--sakura-light); border-radius: 3px; }

  .hm-months {
    display: grid;
    grid-template-columns: 28px repeat(16, 1fr);
    gap: 3px;
    font-size: 0.66rem;
    color: #888;
    font-weight: 700;
    margin-bottom: 4px;
    min-width: 360px;
  }
  .hm-months > div:first-child { /* placeholder for day labels column */ }
  .hm-months span { text-align: center; }

  .hm-grid-wrap {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 3px;
    min-width: 360px;
  }
  .hm-day-labels {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    gap: 3px;
    font-size: 0.62rem;
    color: #aaa;
    font-weight: 700;
  }
  .hm-day-labels span {
    display: flex; align-items: center; padding-right: 4px;
    min-height: 14px;
  }
  .hm-grid {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 3px;
    grid-auto-flow: column;
  }
  .hm-day {
    aspect-ratio: 1;
    background: #f0f0f0;
    border-radius: 3px;
    transition: all 0.15s;
    cursor: pointer;
    position: relative;
    min-width: 14px;
    min-height: 14px;
  }
  .hm-day.future { background: #fafafa; opacity: 0.5; cursor: default; }
  .hm-day.lvl1 { background: #fed7aa; }
  .hm-day.lvl2 { background: #fb923c; }
  .hm-day.lvl3 { background: #ea580c; box-shadow: 0 1px 4px rgba(234,88,12,0.35); }
  .hm-day.today { outline: 2px solid var(--indigo); outline-offset: 1px; }
  .hm-day:not(.future):hover { transform: scale(1.4); z-index: 2; outline: 2px solid var(--indigo); }

  .hm-share-row {
    display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--sakura-light);
  }
  .hm-share-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 12px; border-radius: 99px; border: none;
    font-weight: 800; font-size: 0.74rem;
    cursor: pointer; font-family: 'Nunito', sans-serif;
    color: #fff; transition: transform 0.18s;
  }
  .hm-share-btn:hover { transform: translateY(-2px); }
  .hm-share-btn.png { background: linear-gradient(135deg, var(--indigo), #9d8fb5); }
  .hm-share-btn.wa { background: #25D366; }
  .hm-share-btn.tg { background: #229ED9; }
  .hm-share-btn.tw { background: #1DA1F2; }
  .hm-share-btn.fb { background: #1877F2; }
  .hm-share-btn.cp { background: #888; }
  .hm-share-btn[disabled] { opacity: 0.6; cursor: wait; }

  .hm-legend {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 6px; margin-top: 10px;
    font-size: 0.72rem; color: #888; font-weight: 700;
  }
  .hm-legend-cells { display: flex; gap: 3px; }
  .hm-legend-cells > div {
    width: 12px; height: 12px; border-radius: 3px;
  }

  /* Detail Modal */
  .day-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(26,13,46,0.7);
    backdrop-filter: blur(4px);
    z-index: 99997;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .day-modal-overlay.open { opacity: 1; pointer-events: auto; }
  .day-modal {
    background: #fff;
    border-radius: 22px;
    max-width: 440px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.32s cubic-bezier(.4,2,.6,1);
  }
  .day-modal-overlay.open .day-modal { transform: scale(1) translateY(0); }
  .day-modal-head {
    background: linear-gradient(135deg, var(--indigo), #9d8fb5);
    color: #fff;
    padding: 18px 22px;
    display: flex; align-items: center; justify-content: space-between;
    border-radius: 22px 22px 0 0;
    position: sticky; top: 0; z-index: 2;
  }
  .day-modal-head h3 { font-size: 1.05rem; font-weight: 900; line-height: 1.2; }
  .day-modal-head .date-sub { font-size: 0.78rem; opacity: 0.9; margin-top: 2px; }
  .day-modal-close {
    background: rgba(255,255,255,0.2); color: #fff; border: none;
    width: 32px; height: 32px; border-radius: 50%;
    font-size: 1.2rem; cursor: pointer; line-height: 1;
  }
  .day-modal-body { padding: 18px 22px 22px; }
  .day-section { margin-bottom: 18px; }
  .day-section:last-child { margin-bottom: 0; }
  .day-section h4 {
    color: var(--sakura); font-size: 0.78rem; font-weight: 900;
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
  }
  .day-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .day-chip {
    background: var(--sakura-light); color: var(--indigo);
    padding: 6px 12px; border-radius: 99px;
    font-size: 0.82rem; font-weight: 800;
  }
  .day-mock-card {
    background: #f5f5fa; border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 6px;
    display: flex; align-items: center; gap: 10px;
  }
  .day-mock-card .badge {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--indigo); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 0.85rem;
    flex-shrink: 0;
  }
  .day-mock-card .info { flex: 1; }
  .day-mock-card .info b { color: var(--indigo); font-size: 0.92rem; display: block; }
  .day-mock-card .info small { color: #888; font-size: 0.75rem; }
  .day-mock-card .pct {
    font-size: 1.1rem; font-weight: 900;
  }
  .day-mock-card.pass .pct { color: #1a5c3a; }
  .day-mock-card.fail .pct { color: var(--sakura-dim); }
  .day-stat-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  }
  .day-stat {
    background: linear-gradient(135deg, #fff5f8, #fff);
    border: 2px solid var(--sakura-light);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
  }
  .day-stat b { display: block; font-size: 1.4rem; color: var(--indigo); font-weight: 900; }
  .day-stat small { color: #888; font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
  .day-empty {
    text-align: center; padding: 24px;
    color: #aaa; font-size: 0.9rem; line-height: 1.6;
  }
  .day-empty .emoji { font-size: 3rem; display: block; margin-bottom: 10px; }

  /* ====== STROKE ORDER MODAL — "Cara Tulis" per character ====== */
  .stroke-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(26,13,46,0.7);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
  }
  .stroke-modal-overlay.open { opacity: 1; pointer-events: auto; }
  .stroke-modal {
    background: #fff; border-radius: 22px;
    max-width: 460px; width: 100%;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.32s cubic-bezier(.4,2,.6,1);
  }
  .stroke-modal-overlay.open .stroke-modal { transform: scale(1) translateY(0); }
  .stroke-modal-head {
    background: linear-gradient(135deg, var(--indigo), #9d8fb5);
    color: #fff; padding: 18px 22px;
    display: flex; align-items: center; justify-content: space-between;
    border-radius: 22px 22px 0 0;
    position: sticky; top: 0; z-index: 5;
    box-shadow: 0 4px 12px rgba(58,28,113,0.18);
  }
  .stroke-modal-head h3 {
    font-size: 1.05rem; font-weight: 900; line-height: 1.2;
    display: flex; align-items: center; gap: 10px;
  }
  .stroke-modal-head h3 .ch {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1.6rem;
  }
  .stroke-modal-head .rom-sub {
    font-size: 0.78rem; opacity: 0.9; margin-top: 2px;
    font-weight: 700; color: var(--gold-light);
  }
  .stroke-modal-close {
    background: rgba(255,255,255,0.2); color: #fff; border: none;
    width: 32px; height: 32px; border-radius: 50%;
    font-size: 1.2rem; cursor: pointer; line-height: 1;
  }
  .stroke-modal-body { padding: 20px 22px 22px; }
  .stroke-canvas-grid {
    display: flex; flex-wrap: wrap; gap: 12px;
    justify-content: center; margin-bottom: 14px;
  }
  .stroke-canvas-wrap {
    background: #fff; border-radius: 14px;
    border: 2px dashed #e0d6e8;
    padding: 8px;
    position: relative;
  }
  .stroke-canvas {
    width: 180px; height: 180px;
    background:
      linear-gradient(to right, rgba(216,155,168,0.08) 1px, transparent 1px) center / 50% 100% no-repeat,
      linear-gradient(to bottom, rgba(216,155,168,0.08) 1px, transparent 1px) center / 100% 50% no-repeat;
    position: relative;
  }
  .stroke-canvas svg { display: block; width: 100%; height: 100%; }
  .stroke-loading {
    text-align: center; padding: 24px;
    color: #888; font-size: 0.9rem;
  }
  .stroke-loading::before {
    content: '⏳'; display: inline-block;
    animation: spin 1s linear infinite;
    margin-right: 6px;
  }
  .stroke-info {
    background: var(--sakura-light); color: var(--indigo);
    padding: 10px 14px; border-radius: 10px;
    font-size: 0.78rem; line-height: 1.5;
    margin-bottom: 14px;
  }
  .stroke-info .stroke-count {
    font-weight: 900; display: block; margin-bottom: 4px;
  }
  .stroke-actions {
    display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  }
  .stroke-actions button {
    background: var(--indigo); color: #fff; border: none;
    padding: 9px 16px; border-radius: 99px;
    font-weight: 800; font-size: 0.82rem; cursor: pointer;
    font-family: inherit; transition: transform 0.15s, box-shadow 0.15s;
  }
  .stroke-actions button.replay { background: var(--sakura); }
  .stroke-actions button.numbers { background: var(--gold); color: #5b2a08; }
  .stroke-actions button:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(58,28,113,0.20); }
  .stroke-actions button:active { transform: translateY(0); }
  .stroke-actions button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

  /* Small ✍️ stroke button on cards (char/vocab/anime/counter row/SRS) */
  .char-card .stroke-btn-mini,
  .vocab-item-card .stroke-btn-mini,
  .anime-item-card .stroke-btn-mini,
  .phrase-row .stroke-btn-mini {
    position: absolute; top: 6px; right: 6px;
    background: rgba(107,90,127,0.85); color: #fff;
    border: none; width: 26px; height: 26px;
    border-radius: 50%;
    font-size: 0.82rem; line-height: 1;
    cursor: pointer; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s, transform 0.15s, background 0.15s;
    padding: 0;
  }
  .char-card:hover .stroke-btn-mini,
  .vocab-item-card:hover .stroke-btn-mini,
  .anime-item-card:hover .stroke-btn-mini,
  .phrase-row:hover .stroke-btn-mini { opacity: 1; }
  .char-card .stroke-btn-mini:hover,
  .vocab-item-card .stroke-btn-mini:hover,
  .anime-item-card .stroke-btn-mini:hover,
  .phrase-row .stroke-btn-mini:hover { background: var(--sakura); transform: scale(1.12); }
  .char-card .stroke-btn-mini:focus,
  .vocab-item-card .stroke-btn-mini:focus,
  .anime-item-card .stroke-btn-mini:focus,
  .phrase-row .stroke-btn-mini:focus { opacity: 1; outline: 2px solid var(--sakura); outline-offset: 2px; }
  /* On touch devices that lack hover, keep the button visible at lower opacity */
  @media (hover: none) {
    .char-card .stroke-btn-mini,
    .vocab-item-card .stroke-btn-mini,
    .anime-item-card .stroke-btn-mini,
    .phrase-row .stroke-btn-mini { opacity: 0.75; }
  }

  /* Small ✍️ button inside conjugation/sifat tables */
  .conj-stroke {
    background: rgba(212,168,84,0.2); color: #a06000;
    border: none; width: 22px; height: 22px;
    border-radius: 50%; font-size: 0.72rem; line-height: 1;
    cursor: pointer; padding: 0; margin-left: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    vertical-align: middle;
    transition: background 0.15s, transform 0.15s;
  }
  .conj-stroke:hover { background: var(--gold, #f5b942); color: #fff; transform: scale(1.15); }
  .conj-stroke:focus { outline: 2px solid var(--gold, #f5b942); outline-offset: 1px; }

  /* Tooltip */
  .hm-tooltip {
    position: fixed;
    background: var(--indigo);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    pointer-events: none;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.15s;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    white-space: nowrap;
  }
  .hm-tooltip.show { opacity: 1; }
  .hm-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--indigo);
  }

  /* ====== ACHIEVEMENTS GALLERY ====== */
  .ach-section {
    background: linear-gradient(135deg, #fff, #fffaf3);
    border-radius: 22px;
    padding: 22px 20px;
    margin: 22px 0 18px;
    border: 2px solid #f7e8b8;
    box-shadow: 0 6px 20px rgba(247,201,72,0.12);
    position: relative;
    overflow: hidden;
  }
  .ach-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
  }
  .ach-title {
    color: var(--indigo); font-weight: 900; font-size: 1.1rem;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .ach-counter {
    background: linear-gradient(135deg, var(--gold), var(--coral));
    color: #fff; padding: 5px 14px; border-radius: 99px;
    font-weight: 900; font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(247,115,22,0.35);
  }
  .ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
  }
  .ach-card {
    background: #fff;
    border-radius: 16px;
    padding: 14px 10px 12px;
    text-align: center;
    border: 2px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.22s;
    position: relative;
    overflow: hidden;
  }
  .ach-card:hover { transform: translateY(-3px); }
  .ach-card.locked {
    background: #fafafa;
    border-color: #eee;
    filter: grayscale(1);
    opacity: 0.55;
  }
  .ach-card.unlocked {
    background: linear-gradient(135deg, #fffbe6, #fff);
    border-color: var(--gold);
    box-shadow: 0 6px 16px rgba(247,201,72,0.25);
  }
  .ach-card.unlocked::after {
    content: '✓';
    position: absolute; top: 6px; right: 8px;
    width: 18px; height: 18px;
    background: var(--mint); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 900;
  }
  .ach-card .ico {
    font-size: 2.2rem; line-height: 1;
    display: block; margin-bottom: 6px;
  }
  .ach-card.locked .ico { opacity: 0.4; }
  .ach-card.unlocked .ico {
    animation: achGlow 2s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 6px rgba(247,201,72,0.55));
  }
  @keyframes achGlow {
    from { transform: scale(1); }
    to   { transform: scale(1.05); filter: drop-shadow(0 0 12px rgba(247,201,72,0.85)); }
  }
  .ach-card .title {
    color: var(--indigo);
    font-weight: 800; font-size: 0.78rem;
    line-height: 1.2;
    margin-bottom: 4px;
  }
  .ach-card.locked .title { color: #888; }
  .ach-card .desc {
    color: #888; font-size: 0.68rem;
    line-height: 1.35;
  }

  /* Achievement unlock toast */
  .ach-toast {
    position: fixed;
    top: calc(env(safe-area-inset-top,0) + 90px);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, var(--gold), var(--coral));
    color: #5b2a08;
    padding: 14px 22px;
    border-radius: 99px;
    box-shadow: 0 16px 40px rgba(247,115,22,0.55);
    z-index: 99998;
    display: flex; align-items: center; gap: 12px;
    font-weight: 900; font-family: 'Nunito', sans-serif;
    opacity: 0;
    transition: all 0.4s cubic-bezier(.4,2,.6,1);
    max-width: 92vw;
    border: 2px solid #fff;
  }
  .ach-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  .ach-toast .ico {
    font-size: 2.2rem; line-height: 1;
    animation: bounceIco 0.55s ease infinite alternate;
  }
  .ach-toast strong { display: block; font-size: 0.95rem; }
  .ach-toast small { display: block; font-size: 0.78rem; opacity: 0.85; margin-top: 2px; }

  /* Celebration toast */
  .rm-celebrate-toast {
    position: fixed;
    top: calc(env(safe-area-inset-top,0) + 30px);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, var(--mint), var(--mint));
    color: #1a5c3a;
    padding: 14px 22px;
    border-radius: 99px;
    box-shadow: 0 16px 40px rgba(67, 233, 123, 0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 900;
    font-family: 'Nunito', sans-serif;
    opacity: 0;
    transition: all 0.4s cubic-bezier(.4,2,.6,1);
    max-width: 92vw;
    border: 2px solid #fff;
  }
  .rm-celebrate-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  .rm-celebrate-toast .ico {
    font-size: 2rem;
    animation: bounceIco 0.55s ease infinite alternate;
    line-height: 1;
  }
  @keyframes bounceIco {
    from { transform: scale(1) rotate(-8deg); }
    to   { transform: scale(1.15) rotate(15deg); }
  }
  .rm-celebrate-toast strong {
    display: block;
    font-size: 1rem;
    color: #1a5c3a;
    line-height: 1.1;
  }
  .rm-celebrate-toast small {
    display: block;
    font-size: 0.78rem;
    color: #2d6b48;
    margin-top: 2px;
    opacity: 0.85;
  }
  .rm-celebrate-toast.master {
    background: linear-gradient(135deg, var(--gold), var(--coral));
    color: #5b2a08;
    box-shadow: 0 18px 50px rgba(247, 115, 22, 0.55);
  }
  .rm-celebrate-toast.master strong { color: #5b2a08; }
  .rm-celebrate-toast.master small { color: #804419; }

  /* Stage "just completed" highlight */
  @keyframes justDone {
    0% { box-shadow: 0 4px 16px rgba(58,28,113,0.08); }
    30% { box-shadow: 0 0 0 6px rgba(67,233,123,0.4), 0 12px 28px rgba(67,233,123,0.35); }
    60% { box-shadow: 0 0 0 12px rgba(67,233,123,0.0), 0 12px 28px rgba(67,233,123,0.25); }
    100% { box-shadow: 0 4px 16px rgba(67,233,123,0.18); }
  }
  .rm-stage.just-done { animation: justDone 1.8s ease; }

  /* Reset progress link */
  .rm-reset {
    display: inline-block;
    margin-top: 10px;
    color: #aaa; font-size: 0.75rem;
    text-decoration: underline;
    cursor: pointer;
    background: none; border: none;
    font-family: 'Nunito', sans-serif;
  }
  .rm-reset:hover { color: var(--sakura-dim); }

  @media (max-width: 480px) {
    .roadmap { padding: 18px 14px 22px; }
    .rm-timeline { padding-left: 36px; }
    .rm-timeline::before { left: 14px; }
    .rm-stage::before { left: -32px; width: 30px; height: 30px; font-size: 0.85rem; }
    .rm-stage { padding: 14px; }
  }

  /* ====== FEATURED JOBS (always visible, public) ====== */
  .jobs-featured {
    background: #fff;
    border-radius: 22px;
    padding: 24px 22px 28px;
    margin: 24px 0;
    box-shadow: 0 6px 22px rgba(74,43,139,0.08);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
  }
  .jobs-featured::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #5dd089 0%, #5a9def 50%, var(--sakura) 100%);
  }
  .jf-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--border);
  }
  .jf-title {
    color: var(--indigo);
    font-size: 1.25rem;
    font-weight: 900;
    margin-bottom: 4px;
  }
  .jf-sub {
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.5;
  }
  .jf-all-btn {
    background: transparent;
    color: var(--sky);
    border: 2px solid #d6e9fb;
    padding: 9px 16px;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.82rem;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .jf-all-btn:hover {
    background: var(--sky);
    color: #fff;
    border-color: var(--sky);
  }
  .jf-status {
    display: flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, #f0fcf5, #fff);
    padding: 8px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 0.8rem;
    color: var(--text-soft);
    font-weight: 700;
    border-left: 3px solid var(--mint);
  }
  .jf-live-dot {
    width: 10px; height: 10px;
    background: var(--mint);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--mint);
    animation: pulseDot 1.6s infinite;
    flex-shrink: 0;
  }
  .jf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
  }
  .jf-card {
    background: linear-gradient(135deg, var(--bg) 0%, #fff 100%);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.22s;
    display: block;
    min-height: 120px;
  }
  .jf-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(74,43,139,0.12);
    border-color: var(--sky);
  }
  .jf-card .source-row {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 6px; font-size: 0.7rem;
    color: var(--text-muted); font-weight: 700;
  }
  .jf-card .source-tag {
    background: var(--sakura-light);
    color: var(--indigo);
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 800;
  }
  .jf-card .cat-tag {
    background: #e3f0fd;
    color: var(--sky);
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 800;
  }
  .jf-card h3 {
    color: var(--indigo);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 6px;
    /* clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .jf-card .meta {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
  }
  .jf-skeleton {
    background: linear-gradient(110deg, #f5f5fa 30%, #fafafa 50%, #f5f5fa 70%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.4s infinite linear;
    border: 1px solid var(--border);
    pointer-events: none;
  }
  @keyframes skeletonShimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
  }
  .jf-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px 14px;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
  }
  .jf-cta-row {
    text-align: center;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
  }
  .jf-cta-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--sky), var(--indigo));
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.92rem;
    box-shadow: 0 8px 20px rgba(90,157,239,0.3);
    transition: transform 0.18s;
  }
  .jf-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(90,157,239,0.4);
  }
  @media (max-width: 480px) {
    .jobs-featured { padding: 20px 18px; }
    .jf-grid { grid-template-columns: 1fr; }
    .jf-all-btn { width: 100%; text-align: center; }
  }

  /* ====== FEATURED BLOG ARTICLES (always visible, public) ====== */
  .blog-featured {
    background: #fff;
    border-radius: 22px;
    padding: 24px 22px 28px;
    margin: 24px 0;
    box-shadow: 0 6px 22px rgba(74,43,139,0.08);
    border: 1px solid var(--border);
  }
  .bf-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--border);
  }
  .bf-title {
    color: var(--indigo);
    font-size: 1.25rem;
    font-weight: 900;
    margin-bottom: 4px;
  }
  .bf-sub {
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.5;
  }
  .bf-all-btn {
    background: transparent;
    color: var(--sakura);
    border: 2px solid var(--sakura-light);
    padding: 9px 16px;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.82rem;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .bf-all-btn:hover {
    background: var(--sakura);
    color: #fff;
    border-color: var(--sakura);
  }
  .bf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
  }
  .bf-card {
    background: linear-gradient(135deg, var(--bg) 0%, #fff 100%);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 16px 18px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.22s;
    display: block;
    position: relative;
    overflow: hidden;
  }
  .bf-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px;
    height: 0;
    background: var(--sakura);
    transition: height 0.3s;
  }
  .bf-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(74,43,139,0.14);
    border-color: var(--sakura-soft);
  }
  .bf-card:hover::before { height: 100%; }
  .bf-tag {
    display: inline-block;
    background: var(--sakura-light);
    color: var(--sakura);
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 800;
    margin-bottom: 8px;
  }
  .bf-card h3 {
    color: var(--indigo);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 8px;
  }
  .bf-card p {
    color: var(--text-soft);
    font-size: 0.85rem;
    line-height: 1.55;
    margin-bottom: 8px;
  }
  .bf-meta {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
  }
  .bf-cta-row {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
  }
  .bf-cta-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--indigo), #c95e8a);
    color: #fff;
    padding: 12px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.92rem;
    box-shadow: 0 8px 20px rgba(74,43,139,0.25);
    transition: transform 0.18s;
  }
  .bf-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(74,43,139,0.35);
  }
  @media (max-width: 480px) {
    .blog-featured { padding: 20px 18px; }
    .bf-grid { grid-template-columns: 1fr; }
    .bf-all-btn { width: 100%; text-align: center; }
  }

  /* ====== SEO PREVIEW (always visible for crawler) ====== */
  .seo-preview {
    background: #fff;
    border-radius: 20px;
    padding: 26px 24px;
    margin: 24px 0;
    box-shadow: 0 6px 20px rgba(74,43,139,0.06);
    border: 1px solid var(--border);
  }
  .seo-preview-title {
    color: var(--indigo);
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 4px;
  }
  .seo-preview-sub {
    color: var(--text-soft);
    font-size: 0.92rem;
    margin-bottom: 22px;
    line-height: 1.55;
  }
  .seo-mini-title {
    color: var(--indigo);
    font-size: 1.05rem;
    font-weight: 800;
    margin: 22px 0 12px;
  }
  .seo-mini-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 12px;
  }
  .seo-mini-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 6px;
    text-align: center;
    transition: transform 0.18s, border-color 0.18s;
  }
  .seo-mini-card:hover {
    transform: translateY(-2px);
    border-color: var(--sakura);
  }
  .seo-mini-card .jp {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--indigo);
    line-height: 1.1;
  }
  .seo-mini-card .rom {
    color: var(--sakura);
    font-size: 0.78rem;
    font-weight: 800;
    margin-top: 4px;
  }
  .seo-phrase-list {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
  }
  .seo-phrase {
    background: var(--bg);
    border-left: 3px solid var(--sakura);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.92rem;
    color: var(--text);
    line-height: 1.6;
  }
  .seo-phrase b {
    color: var(--indigo);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1.05rem;
  }
  .seo-phrase em {
    color: var(--sakura);
    font-style: normal;
    font-weight: 700;
    font-size: 0.85rem;
    margin: 0 4px;
  }
  .seo-features-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
  }
  .seo-features-list li {
    padding: 7px 0;
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.55;
  }
  .seo-features-list li b { color: var(--indigo); }
  .seo-cta-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--indigo), #c95e8a);
    color: #fff;
    padding: 12px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 8px 20px rgba(74,43,139,0.3);
    transition: transform 0.18s, box-shadow 0.18s;
  }
  .seo-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(74,43,139,0.4);
  }
  @media (max-width: 480px) {
    .seo-mini-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
    .seo-mini-card { padding: 10px 4px; }
    .seo-mini-card .jp { font-size: 1.6rem; }
  }

  /* ====== START HERE CARD (first-time user CTA) ====== */
  .start-here-card {
    background: #fff;
    border-radius: 22px;
    padding: 28px 26px;
    margin: 24px auto 18px;
    max-width: 580px;
    box-shadow: 0 8px 28px rgba(74,43,139,0.10);
    border: 1px solid var(--border);
    text-align: left;
    position: relative;
    overflow: hidden;
  }
  .start-here-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #5dd089 0%, #e8b73e 50%, var(--sakura) 100%);
  }
  .sh-badge {
    display: inline-block;
    background: var(--sakura-light);
    color: var(--sakura);
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 10px;
  }
  .sh-title {
    color: var(--indigo);
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 14px;
  }
  .sh-steps {
    margin: 0 0 18px 22px;
    color: var(--text-soft);
    line-height: 1.8;
  }
  .sh-steps li { margin-bottom: 4px; font-size: 0.95rem; }
  .sh-steps strong { color: var(--indigo); }
  .sh-cta-row {
    display: flex; gap: 10px; flex-wrap: wrap;
    margin-bottom: 16px;
  }
  .sh-btn-primary {
    background: var(--indigo);
    color: #fff;
    border: none;
    padding: 13px 24px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(74,43,139,0.25);
    transition: transform 0.18s, box-shadow 0.18s;
    flex: 1;
    min-width: 200px;
  }
  .sh-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(74,43,139,0.35);
  }
  .sh-btn-secondary {
    background: transparent;
    color: var(--indigo);
    border: 2px solid var(--border);
    padding: 11px 22px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
  }
  .sh-btn-secondary:hover {
    background: var(--bg);
    border-color: var(--sakura);
    color: var(--sakura);
  }
  .sh-trust {
    display: flex; flex-wrap: wrap; gap: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
  }
  .sh-trust span { display: inline-flex; align-items: center; gap: 2px; }

  /* Collapsible section wrapper (for stats accordion) */
  .collapsible-section {
    background: #fff;
    border-radius: 16px;
    margin: 14px 0;
    box-shadow: 0 4px 14px rgba(74,43,139,0.06);
    border: 1px solid var(--border);
    overflow: hidden;
  }
  .collapsible-header {
    background: transparent;
    border: none;
    width: 100%;
    padding: 14px 18px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--indigo);
    font-family: inherit;
    font-weight: 800;
    font-size: 0.95rem;
    transition: background 0.15s;
  }
  .collapsible-header:hover { background: var(--bg); }
  .collapsible-header .arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: transform 0.22s;
  }
  .collapsible-section.open .collapsible-header .arrow {
    transform: rotate(180deg);
  }
  .collapsible-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }
  .collapsible-section.open .collapsible-body {
    max-height: 4000px;
  }
  .collapsible-inner { padding: 0 18px 18px; }

  /* ====== INTRO SCREEN ====== */
  .intro-hero {
    text-align: center; padding: 30px 0 10px;
    animation: fadeSlideIn 0.6s ease;
  }
  .intro-hero .big-emoji { font-size: 4rem; animation: bounce 1.5s infinite ease; display:inline-block; }
  @keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
  .intro-hero h2 { font-size: clamp(1.4rem,4vw,2rem); color: var(--indigo); font-weight: 900; margin: 12px 0 6px; }
  .intro-hero p { color: #666; line-height: 1.7; max-width: 480px; margin: 0 auto 20px; }

  .steps-map {
    display: grid; gap: 10px; margin-bottom: 20px;
  }
  .step-item {
    background: var(--card-bg); border-radius: 16px; padding: 14px 16px;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
    cursor: pointer; transition: all 0.2s; border: 2px solid transparent;
  }
  .step-item:hover { border-color: var(--sakura); transform: translateX(6px); }
  .step-icon { font-size: 1.8rem; flex-shrink:0; }
  .step-info h4 { color: var(--indigo); font-weight: 800; font-size: 0.98rem; }
  .step-info p  { color: #888; font-size: 0.8rem; }
  .step-level {
    margin-left: auto; padding: 4px 10px; border-radius: 99px;
    font-size: 0.72rem; font-weight: 700; flex-shrink:0;
  }
  .level-pemula { background: #d4fce9; color: #1a5c3a; }
  .level-dasar  { background: #fef9c3; color: #854d0e; }
  .level-menengah { background: #ffe4e6; color: #9f1239; }
  .level-mahir { background: var(--indigo); color: #fff; }

  /* ====== WRITING ====== */
  .stroke-guide {
    background: var(--card-bg); border-radius: 20px; padding: 20px;
    box-shadow: var(--shadow); margin-bottom: 16px; text-align: center;
  }
  .stroke-guide .big-char { font-size: 6rem; color: var(--indigo); font-weight: 700; display: block; line-height:1; }
  .stroke-guide .stroke-info { display: flex; gap: 16px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
  .stroke-stat { text-align: center; }
  .stroke-stat span { display: block; font-size: 0.75rem; color: #aaa; }
  .stroke-stat strong { font-size: 1.1rem; color: var(--indigo); }

  /* ====== GRAMMAR ====== */
  .grammar-rule {
    background: var(--card-bg); border-radius: 20px; padding: 20px;
    box-shadow: var(--shadow); margin-bottom: 14px;
    border-top: 4px solid var(--sky);
  }
  .grammar-rule h3 { color: var(--indigo); margin-bottom: 8px; }
  .grammar-example {
    background: linear-gradient(135deg, #f0f8ff, #fff);
    border-radius: 12px; padding: 12px; margin: 8px 0;
    border-left: 4px solid var(--sky);
  }
  .grammar-example .jp { font-size: 1.2rem; font-weight: 700; color: var(--indigo); }
  .grammar-example .rom { font-size: 0.8rem; color: var(--sky); font-weight: 700; }
  .grammar-example .id  { font-size: 0.85rem; color: #555; }

  /* ====== TABS ====== */
  .tab-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
  .tab-btn {
    padding: 7px 16px; border-radius: 99px; border: 2px solid var(--sakura-light);
    background: #fff; color: var(--indigo);
    font-family: 'Nunito',sans-serif; font-weight: 700; font-size: 0.82rem;
    cursor: pointer; transition: all 0.18s;
  }
  .tab-btn.active { background: var(--indigo); color: #fff; border-color: var(--indigo); }
  .tab-content { display: none; }
  .tab-content.active { display: block; animation: fadeSlideIn 0.3s ease; }

  /* ====== RESPONSIVE ====== */
  @media (max-width: 500px) {
    .quiz-options { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); }
  }

  /* ====== CELEBRATE ====== */
  .star-burst {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 4rem; z-index: 9999; pointer-events: none;
    animation: starBurst 0.8s ease forwards;
  }
  @keyframes starBurst { 0%{opacity:1;transform:translate(-50%,-50%) scale(0.5)} 50%{opacity:1;transform:translate(-50%,-50%) scale(1.5)} 100%{opacity:0;transform:translate(-50%,-50%) scale(1)} }

/* --- next style block --- */

  @keyframes rkWelcomePop {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }

/* --- next style block --- */

    #sec-testimonials { background: linear-gradient(135deg, var(--primary-light, #ede8f3) 0%, var(--accent-light, #f8f3e8) 100%); border-radius: 22px; padding: 30px 22px 26px; margin-top: 30px; }
    #sec-testimonials .ts-head { text-align: center; margin-bottom: 22px; }
    #sec-testimonials .ts-head h2 { color: var(--primary, #6b5a7f); font-size: clamp(1.2rem,3vw,1.55rem); font-weight: 900; margin-bottom: 4px; }
    #sec-testimonials .ts-head p { color: var(--text-secondary, #6a6a76); font-size: 0.92rem; }

    .ts-carousel { position: relative; max-width: 760px; margin: 0 auto 26px; min-height: 240px; }
    .ts-card {
      background: #fff; border-radius: 18px; padding: 24px 26px;
      box-shadow: 0 6px 22px rgba(107, 90, 127, 0.10);
      border: 1px solid var(--border-soft, #ede8e2);
      opacity: 0; transform: translateY(20px);
      transition: opacity 0.5s, transform 0.5s;
      position: absolute; inset: 0; display: flex; flex-direction: column;
      pointer-events: none;
    }
    .ts-card.active { opacity: 1; transform: translateY(0); pointer-events: auto; position: relative; }
    .ts-stars { color: #f0b840; font-size: 1.1rem; letter-spacing: 2px; margin-bottom: 10px; }
    .ts-stars .empty { color: #e3dcd2; }
    .ts-msg { color: var(--text, #2a2a30); font-size: 1.02rem; line-height: 1.65; flex: 1; margin-bottom: 18px; font-style: italic; position: relative; padding-left: 22px; }
    .ts-msg::before { content: '"'; position: absolute; left: -2px; top: -14px; font-size: 3.4rem; color: var(--secondary, #d89ba8); opacity: 0.6; font-family: Georgia, serif; line-height: 1; }
    .ts-author { display: flex; align-items: center; gap: 14px; }
    .ts-avatar {
      width: 48px; height: 48px; border-radius: 50%;
      background: linear-gradient(135deg, var(--primary, #6b5a7f), var(--secondary, #d89ba8));
      color: #fff; font-weight: 900; font-size: 1.15rem;
      display: flex; align-items: center; justify-content: center;
    }
    .ts-meta .name { font-weight: 900; color: var(--primary, #6b5a7f); font-size: 0.98rem; }
    .ts-meta .role { font-size: 0.78rem; color: var(--text-secondary, #6a6a76); font-weight: 700; }

    .ts-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
    .ts-dots button { width: 10px; height: 10px; border-radius: 50%; border: none; background: rgba(107, 90, 127, 0.25); cursor: pointer; transition: all 0.25s; padding: 0; }
    .ts-dots button.active { background: var(--secondary, #d89ba8); width: 28px; border-radius: 99px; }

    .ts-empty { text-align: center; color: var(--text-secondary, #6a6a76); padding: 30px 20px; font-size: 0.92rem; }
    .ts-empty span { display: block; font-size: 2rem; margin-bottom: 8px; }

    .ts-form-wrap { max-width: 620px; margin: 0 auto; background: #fff; border-radius: 18px; padding: 22px 24px; box-shadow: 0 4px 16px rgba(107, 90, 127, 0.06); border: 1px solid var(--border-soft, #ede8e2); }
    .ts-form-wrap h3 { color: var(--primary, #6b5a7f); font-size: 1.05rem; font-weight: 900; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
    .ts-form-wrap .ts-sub { color: var(--text-secondary, #6a6a76); font-size: 0.86rem; margin-bottom: 14px; }
    .ts-rating-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 14px; }
    .ts-rating-row label { font-weight: 800; color: var(--text, #2a2a30); font-size: 0.9rem; min-width: 70px; }
    .ts-star-pick { display: inline-flex; gap: 2px; }
    .ts-star-pick button { background: none; border: none; font-size: 1.55rem; cursor: pointer; padding: 4px; color: #e0d8cc; transition: color 0.15s, transform 0.15s; }
    .ts-star-pick button.on { color: #f0b840; }
    .ts-star-pick button:hover { transform: scale(1.15); }
    .ts-msg-input {
      width: 100%; min-height: 110px; resize: vertical;
      padding: 12px 14px; border: 2px solid var(--border, #e8dfd9); border-radius: 12px;
      font-family: inherit; font-size: 0.95rem; outline: none; transition: border-color 0.2s;
      background: var(--bg-soft, #faf8f6); color: var(--text, #2a2a30);
    }
    .ts-msg-input:focus { border-color: var(--secondary, #d89ba8); background: #fff; }
    .ts-char-count { font-size: 0.78rem; color: var(--text-muted, #a0a0a8); margin-top: 4px; text-align: right; }
    .ts-submit-btn {
      width: 100%; background: var(--primary, #6b5a7f); color: #fff; border: none;
      padding: 13px 18px; border-radius: 12px; font-weight: 800; font-size: 0.95rem;
      cursor: pointer; margin-top: 12px; font-family: inherit;
      box-shadow: 0 6px 16px rgba(107, 90, 127, 0.22); transition: transform 0.18s;
    }
    .ts-submit-btn:hover:not(:disabled) { transform: translateY(-2px); }
    .ts-submit-btn:disabled { background: #c5bcc8; cursor: not-allowed; box-shadow: none; }
    .ts-form-msg { text-align: center; padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; font-weight: 700; margin-top: 10px; display: none; }
    .ts-form-msg.ok { background: #e3f3da; color: #2d5e1a; display: block; }
    .ts-form-msg.err { background: #fce0e0; color: #9b3434; display: block; }

    .ts-login-cta { text-align: center; padding: 20px 16px; background: var(--bg-soft, #faf8f6); border-radius: 14px; border: 1.5px dashed var(--border, #e8dfd9); color: var(--text-secondary, #6a6a76); font-size: 0.9rem; }
    .ts-login-cta a { color: var(--primary, #6b5a7f); font-weight: 800; text-decoration: underline; }

    @media (max-width: 600px) {
      .ts-card { padding: 18px 18px; }
      .ts-msg { font-size: 0.95rem; }
      #sec-testimonials { padding: 22px 16px 20px; }
    }
  
/* --- next style block --- */

    .mod-progress {
      background: linear-gradient(135deg, rgba(216,155,168,0.08), rgba(201,165,96,0.08));
      border: 1px solid var(--border-soft, #ede8e2);
      border-radius: 12px;
      padding: 10px 14px;
      margin: 8px 0 18px;
      display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    }
    .mod-progress .lbl { font-size: 0.78rem; color: var(--text-secondary,#6a6a76); font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
    .mod-progress .bar-track { flex: 1; min-width: 120px; background: rgba(107,90,127,0.10); height: 8px; border-radius: 99px; overflow: hidden; }
    .mod-progress .bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent, #c9a560), var(--secondary, #d89ba8)); width: 0%; transition: width 0.6s ease; }
    .mod-progress .pct { font-weight: 900; color: var(--primary,#6b5a7f); font-size: 0.92rem; min-width: 42px; text-align: right; }
    .mod-progress.done .bar-fill { background: linear-gradient(90deg, #7a9d6d, #a8c597); }
    .mod-progress.done .pct::after { content: ' ✓'; }
  
/* --- next style block --- */

  .tab-btn { background:#fff;border:1px solid #e7d4dd;padding:8px 16px;border-radius:10px;cursor:pointer;font-size:0.9rem;color:#666;transition:all 0.2s }
  .tab-btn.active { background:linear-gradient(135deg,var(--sakura),#c93570);color:#fff;border-color:transparent }
  .tab-btn:hover { background:#fff5f8 }
  ruby rt { font-size:0.55em;color:#c93570;font-weight:500 }
  details summary::-webkit-details-marker { display: none; }
  details[open] > summary { border-bottom:1px solid #f5f0f3 }

/* ============================================================
 * SHARED PROGRESS BAR — Loading indicator
 * Dipakai di: stroke modal, sim-tulis, cetak latihan, canvas latihan
 * ============================================================ */
.rk-progress {
  padding: 20px 18px;
  background: linear-gradient(135deg, #fff8f5, #fff);
  border: 1px solid #e0d4ec;
  border-radius: 12px;
  margin: 8px 0;
}
.rk-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #6b5a7f;
}
.rk-progress-icon {
  display: inline-block;
  margin-right: 6px;
  animation: rk-spin 1.2s linear infinite;
}
@keyframes rk-spin {
  to { transform: rotate(360deg); }
}
.rk-progress-percent {
  background: linear-gradient(135deg, #7a5fa0, #c93570);
  color: #fff;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  min-width: 48px;
  text-align: center;
}
.rk-progress-track {
  width: 100%;
  height: 10px;
  background: rgba(122, 95, 160, 0.12);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.rk-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7a5fa0 0%, #c93570 50%, #c9a560 100%);
  background-size: 200% 100%;
  border-radius: 99px;
  width: 0%;
  transition: width 0.4s cubic-bezier(.4, 0, .2, 1);
  position: relative;
  overflow: hidden;
  animation: rk-progress-shimmer 1.8s ease infinite;
}
@keyframes rk-progress-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.rk-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.5) 50%,
    transparent 100%);
  animation: rk-progress-stripe 1.4s ease-in-out infinite;
}
@keyframes rk-progress-stripe {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.rk-progress-hint {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #888;
  text-align: center;
  line-height: 1.4;
}
.rk-progress-done .rk-progress-fill {
  background: linear-gradient(90deg, #7a9d6d, #5b8050);
  animation: none;
}
.rk-progress-done .rk-progress-fill::after {
  animation: none;
  background: none;
}
.rk-progress-done .rk-progress-percent {
  background: linear-gradient(135deg, #7a9d6d, #5b8050);
}
.rk-progress-error .rk-progress-fill {
  background: linear-gradient(90deg, #c92c2c, #8a1f1f);
  animation: none;
}
.rk-progress-error .rk-progress-fill::after { animation: none; background: none; }
.rk-progress-error .rk-progress-percent { background: #c92c2c; }

/* ============================================================
 * CANVAS LATIHAN — Interactive Drawing Practice
 * ============================================================ */
.canvas-controls-top {
  background: linear-gradient(135deg, #fff 0%, #f5eefa 100%);
  border: 1px solid #e0d4ec;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.canvas-search-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 10px;
}
.canvas-search-input {
  flex: 1; min-width: 200px;
  font-size: 1.6rem;
  font-family: 'Noto Sans JP', 'Nunito', sans-serif;
  border: 2px solid #d6c7e5;
  border-radius: 10px;
  padding: 10px 16px;
  text-align: center;
  background: #fff;
  transition: border-color 0.2s;
}
.canvas-search-input:focus {
  outline: none;
  border-color: #7a5fa0;
  box-shadow: 0 0 0 3px rgba(122,95,160,0.12);
}
.canvas-btn-primary, .canvas-btn-rand {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.canvas-btn-primary {
  background: linear-gradient(135deg, #7a5fa0, #5a4a6e);
  color: #fff;
}
.canvas-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(122,95,160,0.32); }
.canvas-btn-rand {
  background: linear-gradient(135deg, #c9a560, #b89045);
  color: #fff;
}
.canvas-btn-rand:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(201,165,96,0.35); }

.canvas-preset-row {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  margin-bottom: 6px;
}
.canvas-preset-label { font-size: 0.78rem; font-weight: 800; color: #6b5a7f; }
.canvas-preset-btn {
  background: #fff;
  border: 1px solid #d6c7e5;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-family: 'Noto Sans JP', 'Nunito', sans-serif;
  color: #2c2c34;
  cursor: pointer;
  transition: all 0.15s;
}
.canvas-preset-btn:hover { background: #f0e7fb; border-color: #7a5fa0; transform: translateY(-1px); }

.canvas-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 4px;
  margin-top: 10px;
  padding: 10px;
  background: #fff;
  border-radius: 10px;
  border: 1px dashed #d6c7e5;
  max-height: 200px;
  overflow-y: auto;
}
.canvas-picker-cell {
  background: #fafaff;
  border: 1px solid #e0d4ec;
  border-radius: 6px;
  padding: 6px 0;
  font-size: 1.4rem;
  font-family: 'Noto Sans JP', sans-serif;
  color: #2c2c34;
  cursor: pointer;
  transition: all 0.12s;
}
.canvas-picker-cell:hover { background: #7a5fa0; color: #fff; transform: scale(1.08); }

.canvas-msg {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.canvas-msg-err  { background: #fde8e8; color: #8a1f1f; border: 1px solid #f5c6c6; }
.canvas-msg-info { background: #e8f4fd; color: #1f5a8a; border: 1px solid #c6d6f5; }

.canvas-placeholder {
  background: #fafaff;
  border: 2px dashed #d6c7e5;
  border-radius: 14px;
  padding: 40px 20px;
  text-align: center;
  color: #2c2c34;
}

.canvas-stage {
  display: flex;
  gap: 18px;
  align-items: stretch;
  margin-top: 4px;
}
.canvas-left {
  flex: 0 0 auto;
  width: 440px;
  max-width: 100%;
  background: #fff;
  border: 1px solid #e0d4ec;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.canvas-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.canvas-char-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #d6c7e5;
}
.canvas-char-big {
  flex: 0 0 auto;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 3.4rem;
  font-weight: 700;
  color: #7a5fa0;
  line-height: 1;
  padding: 4px 12px;
  background: #f5eefa;
  border-radius: 10px;
  min-width: 70px;
  text-align: center;
}
.canvas-char-meta { flex: 1; min-width: 0; font-size: 0.88rem; line-height: 1.55; }
.canvas-meta-row { color: #2c2c34; margin-bottom: 2px; }
.canvas-meta-row strong { color: #6b5a7f; font-weight: 800; }

.canvas-stage-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 400px;
  margin: 0 auto;
  border: 2.5px solid #7a5fa0;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
/* Cross guidelines */
.canvas-stage-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 0; height: 100%;
  border-left: 1px dashed #e0d4ec;
  pointer-events: none;
  z-index: 0;
}
.canvas-stage-inner::after {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  height: 0; width: 100%;
  border-top: 1px dashed #e0d4ec;
  pointer-events: none;
  z-index: 0;
}

.canvas-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 12px;
  box-sizing: border-box;
  pointer-events: none; /* SVG outline doesn't catch events */
}
.canvas-bg-layer svg { width: 100%; height: 100%; display: block; }

.canvas-draw-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%; height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.canvas-mode-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  background: rgba(122, 95, 160, 0.92);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  pointer-events: none;
  letter-spacing: 0.4px;
}

.canvas-loading, .canvas-fail {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  text-align: center;
  font-size: 0.95rem;
  color: #6b5a7f;
  padding: 16px;
  box-sizing: border-box;
  background: #fafaff;
}
.canvas-fail { color: #8a1f1f; background: #fff5f5; }

.canvas-controls {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #d6c7e5;
}
.cv-btn {
  background: #fff;
  border: 1px solid #d6c7e5;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  color: #2c2c34;
  cursor: pointer;
  transition: all 0.15s;
}
.cv-btn:hover { background: #f5eefa; border-color: #7a5fa0; }
.cv-btn-anim:hover  { background: #f0e7fb; }
.cv-btn-trace:hover { background: #e8f9f0; border-color: #5fa07a; }
.cv-btn-quiz       { background: linear-gradient(135deg,#c93570,#a82a5f); color: #fff; border-color: transparent; }
.cv-btn-quiz:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(201,53,112,0.32); }
.cv-btn-clear:hover { background: #fde8e8; border-color: #c92c2c; color: #8a1f1f; }
.cv-btn-speak:hover { background: #fff8e8; border-color: #c9a560; }

.canvas-progress {
  margin-top: 10px;
  padding: 8px 12px;
  background: #fafaff;
  border-radius: 8px;
}
.canvas-prog-bar {
  width: 100%; height: 8px;
  background: #e8dff2;
  border-radius: 99px;
  overflow: hidden;
}
.canvas-prog-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #7a5fa0, #c93570);
  transition: width 0.3s ease, background 0.3s ease;
}
.canvas-prog-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #6b5a7f;
  margin-top: 5px;
  text-align: center;
}

/* ==== Right column cards ==== */
.canvas-tips-card, .canvas-rules-card, .canvas-examples-card {
  background: #fff;
  border: 1px solid #e0d4ec;
  border-radius: 12px;
  padding: 14px 16px;
}
.canvas-tips-card  { background: linear-gradient(135deg, #fff8f5, #fff); border-color: #f0d2b0; }
.canvas-rules-card { background: linear-gradient(135deg, #f5fff8, #fff); border-color: #b0e0c0; }
.canvas-examples-card { background: linear-gradient(135deg, #f8f5ff, #fff); border-color: #d0c0e8; }

.canvas-tips-title, .canvas-rules-title, .canvas-examples-title {
  font-size: 0.95rem;
  font-weight: 900;
  color: #2c2c34;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.canvas-tips-body { font-size: 0.86rem; line-height: 1.55; color: #2c2c34; }
.cv-tip-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: flex-start;
}
.cv-tip-row:last-child { margin-bottom: 0; }
.cv-tip-icon {
  flex: 0 0 auto;
  font-size: 1.15rem;
  line-height: 1.2;
}
.cv-tip-row div { flex: 1; }
.cv-tip-row strong { color: #6b5a7f; }

.canvas-rules-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #2c2c34;
}
.canvas-rules-list li { margin-bottom: 3px; }
.canvas-rules-list strong { color: #2d5e1a; }

.cv-example-item {
  font-family: 'Noto Sans JP', 'Nunito', sans-serif;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #2c2c34;
  padding: 2px 0;
}

@media (max-width: 880px) {
  .canvas-stage { flex-direction: column; }
  .canvas-left { width: 100%; }
}
@media (max-width: 480px) {
  .canvas-search-input { font-size: 1.3rem; }
  .canvas-char-big { font-size: 2.4rem; min-width: 56px; padding: 4px 8px; }
  .canvas-stage-inner { max-width: 320px; }
  .cv-btn { font-size: 0.78rem; padding: 6px 10px; }
}

/* ============================================================
 * CETAK LATIHAN — Print Practice Sheet Generator
 * ============================================================ */
.cetak-controls {
  background: linear-gradient(135deg, #fff 0%, #faf6ff 100%);
  border: 1px solid #e0d4ec;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}
.cetak-quick-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px;
}
.cetak-quick-label {
  font-size: 0.82rem; font-weight: 800; color: #6b5a7f;
}
.cetak-quick-btn {
  background: #fff;
  border: 1px solid #d6c7e5;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-family: 'Noto Sans JP', 'Nunito', sans-serif;
  color: #2c2c34;
  cursor: pointer;
  transition: all 0.15s;
}
.cetak-quick-btn:hover {
  background: #f0e7fb;
  border-color: #7a5fa0;
  transform: translateY(-1px);
}
.cetak-input-row { margin-bottom: 12px; }
.cetak-input {
  width: 100%;
  border: 2px solid #d6c7e5;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1.4rem;
  font-family: 'Noto Sans JP', 'Nunito', sans-serif;
  line-height: 1.6;
  resize: vertical;
  min-height: 56px;
  color: #2c2c34;
  background: #fff;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.cetak-input:focus {
  outline: none;
  border-color: #7a5fa0;
  box-shadow: 0 0 0 3px rgba(122,95,160,0.12);
}
.cetak-hint {
  font-size: 0.78rem;
  color: #6b5a7f;
  margin-top: 6px;
  line-height: 1.45;
}
.cetak-opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 14px;
  background: #fff;
  border: 1px dashed #d6c7e5;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.cetak-opt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: #2c2c34;
}
.cetak-opt span { font-weight: 700; color: #6b5a7f; }
.cetak-opt select {
  border: 1px solid #d6c7e5;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.88rem;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
}
.cetak-opt-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.cetak-opt-check input[type=checkbox] {
  width: 18px; height: 18px;
  accent-color: #7a5fa0;
  cursor: pointer;
}
.cetak-opt-check span { font-weight: 600; color: #2c2c34; }
.cetak-actions-top {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.cetak-btn-primary, .cetak-btn-ghost, .cetak-btn-print, .cetak-btn-secondary {
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.cetak-btn-primary {
  background: linear-gradient(135deg, #7a5fa0, #5a4a6e);
  color: #fff;
}
.cetak-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(122,95,160,0.35); }
.cetak-btn-ghost {
  background: #fff;
  color: #7a5fa0;
  border: 2px solid #d6c7e5;
}
.cetak-btn-ghost:hover { background: #f5eefa; border-color: #7a5fa0; }
.cetak-btn-print {
  background: linear-gradient(135deg, #c93570, #a82a5f);
  color: #fff;
}
.cetak-btn-print:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(201,53,112,0.35); }
.cetak-btn-secondary {
  background: #fff;
  color: #2c2c34;
  border: 1px solid #d6c7e5;
}
.cetak-btn-secondary:hover { background: #f5eefa; }

.cetak-msg {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.cetak-msg-err { background: #fde8e8; color: #8a1f1f; border: 1px solid #f5c6c6; }
.cetak-msg-info { background: #e8f4fd; color: #1f5a8a; border: 1px solid #c6d6f5; }

.cetak-sheet-wrap {
  background: #ece4f3;
  padding: 16px;
  border-radius: 14px;
  margin-top: 18px;
}
.cetak-actions-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #d6c7e5;
}
.cetak-tip {
  font-size: 0.78rem;
  color: #6b5a7f;
  margin-left: auto;
  max-width: 320px;
}
.cetak-loading {
  background: #fff;
  padding: 30px 20px;
  border-radius: 10px;
  text-align: center;
  font-size: 0.95rem;
  color: #6b5a7f;
}

/* ==== The actual printable sheet ==== */
.cetak-sheet {
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.cetak-sheet-inner {
  position: relative;
  padding: 28px 28px 22px;
  background: #fff;
  color: #2c2c34;
  font-family: 'Nunito', sans-serif;
  /* A4-ish proportions on screen */
  min-height: 1100px;
  overflow: hidden;
}
.cetak-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 3px solid #7a5fa0;
  padding-bottom: 12px;
  margin-bottom: 18px;
  position: relative;
  z-index: 2;
}
.cetak-page-head-left { flex: 1; }
.cetak-page-title {
  font-size: 1.45rem;
  font-weight: 900;
  color: #2c2c34;
  line-height: 1.2;
}
.cetak-page-sub {
  font-size: 0.85rem;
  color: #6b5a7f;
  margin-top: 4px;
  font-family: 'Noto Sans JP', 'Nunito', sans-serif;
}
.cetak-page-name {
  font-size: 0.88rem;
  margin-top: 10px;
  color: #2c2c34;
  letter-spacing: 0.3px;
}
.cetak-brand {
  text-align: right;
  flex: 0 0 auto;
}
.cetak-brand-logo {
  font-size: 1.8rem;
  font-weight: 900;
  color: #7a5fa0;
  letter-spacing: 1px;
  line-height: 1;
}
.cetak-brand-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #2c2c34;
  margin-top: 2px;
}
.cetak-brand-url {
  font-size: 0.7rem;
  color: #888;
  margin-top: 2px;
}

.cetak-body { position: relative; z-index: 2; }

.cetak-char-block {
  border: 1px solid #e0d4ec;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 18px;
  background: rgba(255,255,255,0.96);
  page-break-inside: avoid;
  break-inside: avoid;
}
.cetak-char-head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px dashed #d6c7e5;
  padding-bottom: 12px;
}
.cetak-ref-cell {
  flex: 0 0 130px;
  width: 130px; height: 130px;
  border: 2.5px solid #7a5fa0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafaff;
  position: relative;
  overflow: hidden;
}
.cetak-ref-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 0; height: 100%;
  border-left: 1px dashed #e0d4ec;
}
.cetak-ref-cell::after {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  height: 0; width: 100%;
  border-top: 1px dashed #e0d4ec;
}
.cetak-ref-svg {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  padding: 6px;
  box-sizing: border-box;
}
.cetak-ref-svg svg { width: 100%; height: 100%; }
.cetak-ref-fallback {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 84px;
  color: #2c2c34;
  font-weight: 400;
  line-height: 1;
}

.cetak-info-col { flex: 1; min-width: 0; }
.cetak-info-char {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: #7a5fa0;
  margin-bottom: 8px;
  line-height: 1;
}
.cetak-info-row {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 0.88rem;
  line-height: 1.4;
}
.cetak-info-label {
  font-weight: 800;
  color: #888;
  min-width: 64px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 0.72rem;
  padding-top: 2px;
}
.cetak-info-val { color: #2c2c34; font-family: 'Noto Sans JP', 'Nunito', sans-serif; }

.cetak-progression-wrap, .cetak-practice-wrap { margin-top: 12px; }
.cetak-progression-label, .cetak-practice-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #6b5a7f;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cetak-progression-row, .cetak-practice-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.cetak-stroke-cell {
  position: relative;
  width: 62px;
  height: 62px;
  border: 1.2px solid #d6c7e5;
  border-radius: 5px;
  background: #fafaff;
  flex: 0 0 auto;
}
.cetak-stroke-num {
  position: absolute;
  top: 2px; left: 4px;
  font-size: 0.65rem;
  font-weight: 900;
  color: #c0392b;
  z-index: 2;
  font-family: 'Nunito', sans-serif;
}
.cetak-stroke-svg {
  width: 100%; height: 100%;
  padding: 4px;
  box-sizing: border-box;
}
.cetak-stroke-svg svg { width: 100%; height: 100%; }

.cetak-box {
  width: 62px;
  height: 62px;
  border: 1.5px solid #c9b9d8;
  border-radius: 3px;
  background: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.cetak-box-grid::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 0; height: 100%;
  border-left: 1px dashed #ede5f5;
}
.cetak-box-grid::after {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  height: 0; width: 100%;
  border-top: 1px dashed #ede5f5;
}
.cetak-ghost-svg {
  width: 100%; height: 100%;
  opacity: 0.30;
  padding: 4px;
  box-sizing: border-box;
}
.cetak-ghost-svg svg { width: 100%; height: 100%; }
.cetak-ghost-fallback {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 42px;
  color: #d6c7e5;
  line-height: 1;
}
.cetak-svg-fallback {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 42px;
  color: #2c2c34;
  line-height: 1;
}

.cetak-page-footer {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 2px solid #7a5fa0;
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: #888;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
  gap: 8px;
}

.cetak-blank-intro {
  font-size: 0.88rem;
  color: #6b5a7f;
  padding: 10px 14px;
  background: #fafaff;
  border: 1px dashed #d6c7e5;
  border-radius: 8px;
  margin-bottom: 14px;
}
.cetak-blank-row {
  margin-bottom: 6px;
}

/* Watermark — diagonal repeating text in background */
.cetak-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.cetak-watermark span {
  transform: rotate(-28deg);
  font-size: 2.8rem;
  font-weight: 900;
  color: #7a5fa0;
  opacity: 0.06;
  letter-spacing: 8px;
  white-space: nowrap;
  font-family: 'Nunito', sans-serif;
}

/* ==== PRINT STYLES ==== */
@page {
  size: A4;
  margin: 12mm 10mm;
}

@media print {
  body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  /* Hide everything that's not the sheet */
  .header, .footer, footer, .quick-nav, .subnav, .progress-bar-outer,
  .drawer, .drawer-overlay,
  .cetak-controls, .cetak-actions-bar, .cetak-sheet-wrap > .cetak-actions-bar,
  .section-title, .section-desc,
  nav, #drawer, #drawerOverlay,
  .donate-fab, #rkSupport, #authModalOverlay,
  .modal, .modal-overlay,
  .toast, #toastRoot,
  .qn-btn, .nav-btn, .breadcrumb,
  .testimonials, .promo, .strip,
  .roadmap, .roadmap-wrap,
  .achievements, #achievements,
  .heatmap, .stats {
    display: none !important;
  }
  /* Show only the cetak section */
  .section:not(#sec-cetakLatihan) { display: none !important; }
  #sec-cetakLatihan {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  #sec-cetakLatihan > *:not(#cetakSheetWrap) { display: none !important; }
  #cetakSheetWrap {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }
  #cetakSheet {
    box-shadow: none !important;
    background: #fff !important;
  }
  .cetak-sheet-inner {
    padding: 6mm 4mm !important;
    min-height: auto !important;
    max-width: 100% !important;
    background: #fff !important;
  }
  .cetak-char-block {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    background: #fff !important;
  }
  /* Force colors for print */
  .cetak-stroke-num, .cetak-info-char, .cetak-brand-logo,
  .cetak-page-title, .cetak-page-footer, .cetak-page-header,
  .cetak-watermark span {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  .cetak-watermark {
    display: flex !important;
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: 0;
    inset: 0;
  }
  .cetak-watermark span { opacity: 0.07 !important; }
}

/* Body-class fallback (for browsers that don't honor section-display via media print) */
body.cetak-print-active * { visibility: hidden !important; }
body.cetak-print-active #sec-cetakLatihan,
body.cetak-print-active #sec-cetakLatihan #cetakSheetWrap,
body.cetak-print-active #sec-cetakLatihan #cetakSheetWrap *,
body.cetak-print-active #sec-cetakLatihan #cetakSheet,
body.cetak-print-active #sec-cetakLatihan #cetakSheet * { visibility: visible !important; }
body.cetak-print-active #cetakActions { display: none !important; }
body.cetak-print-active #sec-cetakLatihan {
  position: absolute; left: 0; top: 0; width: 100%;
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .cetak-char-head { flex-direction: column; align-items: stretch; }
  .cetak-ref-cell { width: 100px; height: 100px; flex: 0 0 100px; align-self: center; }
  .cetak-stroke-cell, .cetak-box { width: 52px; height: 52px; }
  .cetak-ghost-fallback { font-size: 34px; }
  .cetak-page-header { flex-direction: column; }
  .cetak-brand { text-align: left; }
  .cetak-page-title { font-size: 1.2rem; }
  .cetak-input { font-size: 1.2rem; }
}
