/* Tampilan HP (<=700px), animasi kelopak sakura, dan indikator menu aktif
   - dulu disisipkan app-shell.js sebagai <style> saat halaman berjalan.
   Dipindah ke file supaya CSP bisa melarang blok <style> inline
   (style-src-elem tanpa 'unsafe-inline', lihat vercel.json).
   WAJIB dimuat PALING AKHIR (setelah CSS halaman) di setiap HTML: dulu
   blok ini menempel setelah semua CSS, jadi aturannya harus tetap menang
   atas aturan setara di file lain. */
.mobile-nav {
  display: none;
}
@media (max-width: 700px) {
  .top {
    height: 58px;
    padding: 0 18px;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 30;
  }
  .brand {
    font-size: 16px;
    min-width: 0;
  }
  .brand span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .brand small,
  .topnav,
  .identity {
    display: none;
  }
  .account-box {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    gap: 6px;
  }
  .account-box span {
    max-width: 88px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .account-box small,
  .account-box .install-app-btn {
    display: none;
  }
  .layout {
    display: block;
  }
  .main {
    padding: 20px 15px 92px;
    background-attachment: scroll;
  }
  .head h1 {
    font-size: 25px;
  }
  .overview {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .metric b {
    font-size: 23px;
  }
  .card {
    padding: 16px;
  }
  .dashboard-grid,
  .flash-layout,
  .kana-grid,
  .memory-routes {
    grid-template-columns: 1fr;
  }
  .mobile-nav {
    position: fixed;
    z-index: 50;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: 64px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    background: #142945f5;
    border: 1px solid #caa45d55;
    border-radius: 17px;
    box-shadow: 0 12px 28px #0b162b55;
    padding: 4px;
  }
  .mobile-nav button {
    border: 0;
    background: transparent;
    color: #cbd4df;
    font: 600 10px "DM Sans";
    display: grid;
    gap: 3px;
    place-items: center;
    padding: 6px 1px;
  }
  .mobile-nav button span {
    font: 700 18px "Zen Kaku Gothic New";
  }
  .mobile-nav button.active {
    color: #f7dfad;
  }
  .flashcard {
    height: 270px;
  }
  .face .kana {
    font-size: 58px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .sakura-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
  }
  .sakura-layer .petal {
    position: absolute;
    top: -40px;
    line-height: 1;
    opacity: 0;
    animation: sakura-fall linear infinite;
    will-change: transform, opacity;
  }
  @keyframes sakura-fall {
    0% {
      transform: translate(0, 0) rotate(0deg);
      opacity: 0;
    }
    8% {
      opacity: 0.28;
    }
    92% {
      opacity: 0.22;
    }
    100% {
      transform: translate(var(--drift, 40px), 112vh) rotate(340deg);
      opacity: 0;
    }
  }
  .topnav {
    position: relative;
  }
  .topnav button.active {
    border-bottom: 2px solid transparent;
  }
  .nav-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    left: 0;
    width: 0;
    transition:
      left 0.32s cubic-bezier(0.22, 0.75, 0.25, 1),
      width 0.32s cubic-bezier(0.22, 0.75, 0.25, 1);
  }
  .kana-table .kana-cell {
    opacity: 0;
    transform: translateY(8px);
    animation: stagger-in 0.38s ease forwards;
  }
  .kana-table .kana-cell:nth-child(1) {
    animation-delay: 0ms;
  }
  .kana-table .kana-cell:nth-child(2) {
    animation-delay: 45ms;
  }
  .kana-table .kana-cell:nth-child(3) {
    animation-delay: 90ms;
  }
  .kana-table .kana-cell:nth-child(4) {
    animation-delay: 135ms;
  }
  .kana-table .kana-cell:nth-child(5) {
    animation-delay: 180ms;
  }
  @keyframes stagger-in {
    to {
      opacity: 1;
      transform: none;
    }
  }
}
/* Bilah "Versi baru aplikasi sudah siap" (js/pwa.js, showUpdateBar). Di HP
   diangkat di atas .mobile-nav. */
.app-update-bar {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 10px 12px 10px 16px;
  background: var(--navy);
  color: #f7f2e6;
  border: 1px solid #caa45d77;
  border-radius: 12px;
  box-shadow: 0 10px 26px #0b162b55;
  font: 600 13px "DM Sans";
}
.app-update-bar button {
  border: 0;
  border-radius: 8px;
  padding: 7px 12px;
  font: 700 12px "DM Sans";
  cursor: pointer;
  background: var(--gold);
  color: #fff;
}
.app-update-bar .app-update-later {
  background: transparent;
  color: #cbd4df;
  padding: 7px 8px;
}
@media (max-width: 700px) {
  .app-update-bar {
    bottom: 86px;
    width: calc(100% - 32px);
    justify-content: space-between;
  }
}

/* Siswa yang sedang belajar (js/hadir.js, khusus Sensei/Operator):
   tombol di header + daftar, dan pemberitahuan kecil di pojok bawah. */
.hadir-bell-wadah {
  position: relative;
}
.account-box .hadir-bell {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hadir-titik {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8794a6;
}
.hadir-bell.ada .hadir-titik,
.hadir-panel .hadir-titik,
.hadir-toast .hadir-titik,
.monitor-live-chip .hadir-titik,
.monitor-sedang .hadir-titik {
  background: var(--green);
  animation: hadir-denyut 1.8s infinite;
}
@keyframes hadir-denyut {
  0% { box-shadow: 0 0 0 0 #2d9d7999; }
  70%, 100% { box-shadow: 0 0 0 7px #2d9d7900; }
}
@media (prefers-reduced-motion: reduce) {
  .hadir-titik { animation: none !important; }
}
.hadir-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 270px;
  max-height: 60vh;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 30px #10203733;
  color: var(--ink);
  white-space: normal;
}
.hadir-panel a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
.hadir-panel a:hover {
  background: var(--wash);
}
.hadir-panel b {
  display: block;
  color: var(--navy);
}
.hadir-panel em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}
.hadir-panel p {
  margin: 8px;
  color: var(--muted);
}
.hadir-toast-wadah {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: grid;
  gap: 8px;
  width: min(320px, calc(100% - 32px));
}
.hadir-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 10px 28px #10203726;
  color: var(--ink);
  font-size: 13px;
  animation: hadir-masuk 0.3s ease-out;
}
.hadir-toast small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
@keyframes hadir-masuk {
  from { transform: translateY(12px); opacity: 0; }
}
@media (max-width: 700px) {
  .hadir-toast-wadah {
    bottom: 86px;
  }
  .hadir-panel {
    position: fixed;
    top: 64px;
    right: 12px;
    width: min(300px, calc(100% - 24px));
  }
}
