/* ===================================================================
   JAPANESE FROM SCRATCH - CLEAN & SIMPLE STUDY PORTAL
   Aesthetic: Clean Reference Style (Inspired by reference.html)
   Palette: Fresh Slate, Crisp White Cards, Indigo Gradients & SVGs
   100% Responsive Across Mobile, Tablet, & Desktop Devices
   Zero Scrollbar Intrusion Across All Devices
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;600;700;800&family=Poppins:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* Color Palette - Clean & Bright */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-tr-even: #fafafa;
  --bg-tr-hover: #f1f5f9;
  
  /* Brand Gradients & Accents */
  --primary-indigo: #4f46e5;
  --cyan-accent: #06b6d4;
  --header-gradient: linear-gradient(135deg, #4f46e5, #06b6d4);
  
  /* Text Colors */
  --text-heading: #0f172a;
  --text-body: #1e293b;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  /* Column Accents */
  --color-romaji: #2563eb;
  --color-pronounce: #7c3aed;
  --bg-pronounce: #f5f3ff;
  --border-pronounce: #ddd6fe;
  
  --color-hindi: #0284c7;
  --bg-hindi: #f0f9ff;
  --border-hindi: #bae6fd;
  
  --color-meaning: #334155;
  
  /* Alert / Special */
  --badge-red-text: #dc2626;
  --badge-red-bg: #fef2f2;
  --badge-red-border: #fecdd3;
  
  /* Borders & Shadows */
  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.03);
  --shadow-header: 0 4px 16px rgba(79, 70, 229, 0.16);
  
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --transition: all 0.2s ease;
}

/* ===================================================================
   1. RESET & ZERO SCROLLBAR (ALL BROWSERS & ALL DEVICES)
   =================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

/* Hide vertical and horizontal scrollbars from all browsers */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

body {
  font-family: 'Poppins', 'Noto Sans JP', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.5;
  min-height: 100vh;
  padding: 24px 16px 60px;
  overflow-x: hidden;
  width: 100%;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
}

/* ===================================================================
   2. HEADER WITH SEARCH & BRANDING (MOBILE OPTIMIZED)
   =================================================================== */
.main-header {
  padding: 24px 26px;
  background: var(--header-gradient);
  color: #ffffff;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-header);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  overflow: hidden;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.brand-icon-box {
  width: 44px;
  height: 44px;
  min-width: 44px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 22px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-sizing: border-box;
}

.brand-title-wrap {
  min-width: 0;
  flex: 1;
}

.brand-title-wrap h1 {
  font-size: clamp(18px, 3.5vw, 24px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: #ffffff;
  word-break: break-word;
}

.brand-title-wrap p {
  font-size: clamp(11.5px, 2vw, 13px);
  opacity: 0.92;
  font-weight: 400;
  line-height: 1.35;
  margin-top: 2px;
}

.brand-kicker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.sakura-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.38);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
  user-select: none;
}

.header-flower-deco {
  position: absolute;
  pointer-events: none;
  opacity: 0.12;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.header-flower-deco.deco-top-right {
  top: -15px;
  right: -15px;
  width: 110px;
  height: 110px;
}

.main-header:hover .header-flower-deco {
  opacity: 0.22;
  transform: rotate(20deg) scale(1.06);
}

/* Header Controls & Universal Mute Toggle */
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  max-width: 500px;
  width: 100%;
  justify-content: flex-end;
}

.universal-mute-btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  background: #ffffff;
  color: #15803d;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  white-space: nowrap;
}

.universal-mute-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  background: #f0fdf4;
  border-color: #86efac;
}

.universal-mute-btn:active {
  transform: translateY(0);
}

.universal-mute-btn.is-muted {
  background: #fff1f2;
  color: #be123c;
  border-color: #fda4af;
}

.universal-mute-btn.is-muted:hover {
  background: #ffe4e6;
  border-color: #f43f5e;
}

.universal-mute-btn svg {
  flex-shrink: 0;
}

/* Search Box Inside Header */
.search-container {
  position: relative;
  width: 100%;
  max-width: 360px;
  flex-shrink: 0;
}

.search-icon-svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #4f46e5;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: #ffffff;
  color: var(--text-heading);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  box-sizing: border-box;
}

.search-input::placeholder {
  color: #94a3b8;
}

.search-input:focus {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.header-banner-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.4;
}

.header-banner-pill svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.header-banner-pill span {
  flex: 1;
  min-width: 0;
}

/* ===================================================================
   2B. VOCABULARY & GRAMMAR TOP HUB (DEDICATED LESSONS CARD)
   =================================================================== */
.vocab-top-hub-card {
  background: #ffffff;
  border: 1px solid #e0e7ff;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.06);
  position: relative;
  overflow: hidden;
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.vocab-top-hub-card.is-collapsed {
  padding-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  border-color: #e2e8f0;
}

.vocab-top-hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
}

.vocab-top-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.vocab-top-hub-card.is-collapsed .vocab-top-hub-header {
  margin-bottom: 0;
}

.vocab-top-hub-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vocab-hub-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4f46e5;
  transition: transform 0.25s ease;
}

.vocab-top-hub-card:hover .vocab-hub-icon-badge {
  transform: scale(1.04);
}

.vocab-hub-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #4f46e5;
  margin-bottom: 2px;
}

.vocab-hub-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

/* Pro Action Controls & Buttons */
.vocab-top-hub-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.vocab-hub-quick-link {
  display: none;
  align-items: center;
  gap: 7px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  text-decoration: none;
  color: #15803d;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
}

.vocab-hub-quick-link:hover {
  background: #dcfce7;
  border-color: #86efac;
  transform: translateY(-1px);
  color: #14532d;
}

.vocab-hub-quick-link .quick-pill {
  background: #15803d;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.vocab-top-hub-card.is-collapsed .vocab-hub-quick-link {
  display: inline-flex;
}

.vocab-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 13px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  user-select: none;
}

.vocab-toggle-btn:hover {
  background: #eef2ff;
  color: #4338ca;
  border-color: #a5b4fc;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.12);
}

.vocab-toggle-btn:active {
  transform: translateY(0);
}

.vocab-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chevron-svg {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.vocab-top-hub-card.is-collapsed .chevron-svg {
  transform: rotate(180deg);
}

/* Super Smooth Collapsible Grid Transition */
.vocab-hub-collapsible {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.vocab-top-hub-card.is-collapsed .vocab-hub-collapsible {
  grid-template-rows: 0fr;
}

.vocab-hub-collapsible-inner {
  overflow: hidden;
  min-height: 0;
  opacity: 1;
  transition: opacity 0.22s ease-out;
}

.vocab-top-hub-card.is-collapsed .vocab-hub-collapsible-inner {
  opacity: 0;
  pointer-events: none;
}

.vocab-hub-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 14px;
}

.vocab-lesson-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  width: 100%;
}

.vocab-lesson-btn {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  min-height: 135px;
}

.vocab-lesson-btn.is-active {
  background: #ffffff;
  border-color: #818cf8;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.1);
  cursor: pointer;
  position: relative;
}

.vocab-lesson-btn.is-active:hover {
  transform: translateY(-2px);
  border-color: #4f46e5;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.16);
}

.vocab-lesson-btn.is-next {
  background: #fffbeb;
  border-color: #fde68a;
  cursor: default;
}

.vocab-lesson-btn.is-locked {
  background: #f8fafc;
  border-color: #e2e8f0;
  opacity: 0.85;
  cursor: default;
}

.vbtn-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.vbtn-tag-active {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #4f46e5;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 4px;
}

.vbtn-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #e2e8f0;
  color: #475569;
  padding: 3px 8px;
  border-radius: 4px;
}

.vbtn-status-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vbtn-status-pill.open {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.vbtn-status-pill.pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.vbtn-status-pill.upcoming {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.vbtn-heading {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 5px;
  line-height: 1.3;
}

.vbtn-summary {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 12px;
  flex: 1;
}

.vbtn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #4f46e5;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

.vbtn-cta.locked {
  color: #94a3b8;
  font-weight: 600;
}

.vbtn-cta.locked svg {
  color: #94a3b8;
}

@media (max-width: 640px) {
  .vocab-top-hub-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  .vocab-top-hub-controls {
    margin-left: auto;
  }
  .vocab-lesson-buttons {
    grid-template-columns: 1fr;
  }
  .vocab-top-hub-card {
    padding: 14px 12px;
  }
}

@media (max-width: 480px) {
  .vocab-top-hub-header {
    gap: 8px;
  }
  .vocab-hub-icon-badge {
    width: 34px;
    height: 34px;
  }
  .vocab-hub-title {
    font-size: 15px;
  }
  .vocab-toggle-btn {
    padding: 5px 10px;
    font-size: 11px;
  }
}

/* ===================================================================
   3. NAVIGATION TABS BAR
   =================================================================== */
.tabs-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
  scrollbar-width: none;
}

.tabs-scroll-wrap::-webkit-scrollbar {
  display: none;
}

.tabs-container {
  display: inline-flex;
  background: #ffffff;
  padding: 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  gap: 4px;
  min-width: max-content;
}

.nav-tab-btn {
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: var(--primary-indigo);
  background: #f1f5f9;
}

.nav-tab-btn.active {
  background: var(--primary-indigo);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.nav-tab-btn svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ===================================================================
   4. LESSON CARD (CLEAN & COMPACT)
   =================================================================== */
.lesson-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.lesson-card.hidden {
  display: none !important;
}

.lesson-title {
  font-size: 17px;
  font-weight: 700;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.lesson-title svg {
  flex-shrink: 0;
}

.flower-icon {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lesson-card:hover .flower-icon,
.vocab-top-hub-card:hover .flower-icon,
.brand-wrap:hover .flower-icon {
  transform: scale(1.18) rotate(15deg);
}

/* Card Theme Accents */
.theme-rose { color: #e11d48; border-color: #fecdd3; }
.theme-sky { color: #0284c7; border-color: #bae6fd; }
.theme-amber { color: #d97706; border-color: #fde68a; }
.theme-emerald { color: #059669; border-color: #a7f3d0; }
.theme-indigo { color: #4f46e5; border-color: #c7d2fe; }
.theme-purple { color: #7c3aed; border-color: #ddd6fe; }

.category-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 8px 0;
  padding: 4px 8px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Pro-Tip Box */
.tip-banner {
  background: #fffbeb;
  border-left: 3.5px solid #f59e0b;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 10px 14px;
  margin: 10px 0 14px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #92400e;
  font-size: 12.5px;
  line-height: 1.45;
}

.tip-banner svg {
  flex-shrink: 0;
  display: block;
}

.tip-banner strong {
  color: #78350f;
}

/* ===================================================================
   5. TABLES (SMOOTH HORIZONTAL TOUCH SCROLL ON MOBILE)
   =================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  box-sizing: border-box;
  scrollbar-width: none;
}

.table-wrap::-webkit-scrollbar {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
  box-sizing: border-box;
}

th {
  background-color: #f8fafc;
  color: #64748b;
  text-align: left;
  padding: 8px 8px;
  font-weight: 600;
  border-bottom: 1.5px solid #cbd5e1;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-sizing: border-box;
}

td {
  padding: 8px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

tr:nth-child(even) td {
  background-color: var(--bg-tr-even);
}

tr:hover td {
  background-color: var(--bg-tr-hover);
  cursor: pointer;
}

/* ===================================================================
   5B. HIRAGANA MATRIX 5-VOWEL GRID TABLE
   =================================================================== */
.matrix-table {
  min-width: 600px;
  text-align: center;
}

.matrix-table th {
  text-align: center;
  background-color: #f1f5f9;
  font-size: 11.5px;
  padding: 9px 8px;
}

.matrix-table th:first-child {
  text-align: left;
  width: 110px;
}

.row-label {
  font-weight: 700;
  color: #334155;
  background-color: #f8fafc;
  font-size: 12px;
  white-space: nowrap;
  text-align: left !important;
}

.grid-cell {
  text-align: center;
  padding: 8px 6px;
  transition: var(--transition);
  vertical-align: top;
  border: 1px solid #f1f5f9;
  cursor: pointer;
}

.grid-cell:hover {
  background-color: #f5f3ff !important;
  border-color: #c7d2fe;
}

.char-jp {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  display: block;
  line-height: 1.15;
}

.char-romaji {
  font-family: 'Poppins', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-romaji);
  display: block;
  margin-top: 2px;
}

.char-pronounce {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: var(--color-pronounce);
  background: var(--bg-pronounce);
  border: 1px solid var(--border-pronounce);
  padding: 1px 4px;
  border-radius: 3px;
  display: inline-block;
  margin-top: 2px;
  white-space: nowrap;
}

.char-hindi {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-hindi);
  display: block;
  margin-top: 2px;
}

.char-empty {
  color: #cbd5e1;
  text-align: center;
  font-size: 16px;
  vertical-align: middle;
}


/* Cell Column Types */
.hiragana {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

.romaji {
  font-family: 'Poppins', sans-serif;
  color: var(--color-romaji);
  font-weight: 500;
  word-break: break-word;
}

.pronounce {
  color: var(--color-pronounce);
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-pronounce);
  border: 1px solid var(--border-pronounce);
  padding: 2px 5px;
  border-radius: 4px;
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.35;
  word-break: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

.hindi-cue {
  color: var(--color-hindi);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-hindi);
  border: 1px solid var(--border-hindi);
  padding: 2px 5px;
  border-radius: 4px;
  display: inline-block;
}

.english {
  color: var(--color-meaning);
  font-weight: 400;
  line-height: 1.4;
  word-break: break-word;
}

.badge {
  font-size: 9.5px;
  background: var(--badge-red-bg);
  color: var(--badge-red-text);
  border: 1px solid var(--badge-red-border);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  margin-left: 4px;
  display: inline-block;
  white-space: nowrap;
}

/* Audio Button inside Table */
.col-audio {
  width: 6% !important;
  min-width: 48px !important;
  text-align: center !important;
  padding: 6px 2px !important;
  white-space: nowrap !important;
  vertical-align: middle;
}

th.col-audio {
  text-align: center !important;
  font-size: 10px !important;
  letter-spacing: 0.2px;
  padding: 8px 2px !important;
}

.audio-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #4f46e5;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  margin: 0 auto;
}

tr:hover .audio-btn,
.audio-btn:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
  transform: scale(1.08);
}

/* ===================================================================
   6. INTERACTIVE FLASHCARD WIDGET
   =================================================================== */
.flashcard-panel {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.flashcard-display-box {
  width: 100%;
  max-width: 380px;
  min-height: 140px;
  margin: 10px auto;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  box-sizing: border-box;
}

.flashcard-display-box:hover {
  border-color: var(--primary-indigo);
  background: #f1f5f9;
}

.btn-primary-clean {
  background: #4f46e5;
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  transition: var(--transition);
}

.btn-primary-clean svg {
  display: block;
  flex-shrink: 0;
}

.btn-primary-clean:hover {
  background: #4338ca;
}

.btn-outline-clean {
  background: #ffffff;
  color: var(--text-body);
  border: 1px solid var(--border-light);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
  transition: var(--transition);
}

.btn-outline-clean svg {
  display: block;
  flex-shrink: 0;
}

.btn-outline-clean:hover {
  background: #f1f5f9;
}

/* ===================================================================
   7. FOOTER
   =================================================================== */
.site-footer {
  text-align: center;
  padding: 20px 14px 10px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border-light);
  margin-top: 20px;
}

.footer-tags {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.footer-tag {
  background: #ffffff;
  border: 1px solid var(--border-light);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

/* ===================================================================
   8. TOAST NOTIFICATION (PERFECT VERTICAL ALIGNMENT)
   =================================================================== */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.35);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 999;
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

#toastIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#toastIcon svg {
  display: block;
  width: 15px;
  height: 15px;
  stroke: #38bdf8;
}

#toastText {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  white-space: nowrap;
}

/* ===================================================================
   9. COMPREHENSIVE RESPONSIVE MEDIA QUERIES
   =================================================================== */
@media (max-width: 768px) {
  body {
    padding: 12px 10px 40px;
  }
  
  .main-header {
    padding: 18px 16px;
    gap: 14px;
    border-radius: var(--radius-md);
  }
  
  .header-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .search-container {
    max-width: 100%;
  }

  .lesson-card {
    padding: 15px 14px;
    border-radius: var(--radius-md);
  }

  .lesson-title {
    font-size: 16px;
  }

  .tip-banner {
    padding: 8px 12px;
    font-size: 12px;
  }

  .toast-notice {
    left: 16px;
    right: 16px;
    bottom: 16px;
    justify-content: center;
  }

  table:not(.matrix-table) {
    table-layout: auto;
    min-width: 580px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 8px 6px 30px;
  }

  .main-header {
    padding: 16px 12px;
    gap: 12px;
  }

  .brand-wrap {
    gap: 10px;
  }

  .brand-icon-box {
    width: 38px;
    height: 38px;
    min-width: 38px;
    font-size: 19px;
  }

  .brand-title-wrap h1 {
    font-size: 17px;
    line-height: 1.2;
  }

  .brand-title-wrap p {
    font-size: 11px;
  }

  .search-input {
    height: 38px;
    font-size: 12.5px;
    padding-left: 36px;
  }

  .header-banner-pill {
    padding: 7px 10px;
    font-size: 11.5px;
  }

  .lesson-card {
    padding: 14px 10px;
  }

  .category-title {
    font-size: 11px;
    padding: 3px 6px;
  }

  th {
    padding: 6px 8px;
    font-size: 10px;
  }

  td {
    padding: 6px 8px;
    font-size: 12px;
  }

  .mute-label {
    display: none;
  }

  .universal-mute-btn {
    padding: 0 11px;
    height: 38px;
  }
}

