/* Fujisan.AI - Design Guideline Style CSS v19.10.8 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Brand Colors - Design Guideline v1.0 */
  --primary: #667EEA;  /* 藤紫 */
  --primary-dark: #5569d6; 
  --primary-light: rgba(102, 126, 234, 0.12);
  --accent: #764BA7;   /* 桜鼠 */
  --accent-light: rgba(118, 75, 167, 0.12);
  --bg: #FAFAFA;       /* 絹 */
  --card: #FFFFFF;
  --text: #1A1A2E;     /* 墨 */
  --text-light: #6B7080;
  --text-secondary: #6B7080; /* 鈍色 */
  --text-tertiary: #999999;
  --success: #4CAF50;  /* 若竹 */
  --success-light: rgba(76, 175, 80, 0.12);
  --warning: #FFD700;  /* 金茶 */
  --error: #FF6B6B;    /* 珊瑚 */
  --error-light: rgba(255, 107, 107, 0.12);
  --border: #E5E5EA;   /* 灰白 */
  --separator: #C6C6C8;
  /* Level Colors */
  --n5: #34C759; --n5-light: rgba(52, 199, 89, 0.15);
  --n4: #007AFF; --n4-light: rgba(0, 122, 255, 0.15);
  --n3: #AF52DE; --n3-light: rgba(175, 82, 222, 0.15);
  --n2: #005BAC; --n2-light: rgba(0, 91, 172, 0.15);
  --n1: #FF3B30; --n1-light: rgba(255, 59, 48, 0.15);
  /* Active level theme (default N5) */
  --level-color: var(--n5);
  --level-light: var(--n5-light);
  --level-shadow: rgba(52, 199, 89, 0.35);
  --space-xs: 4px; --space-sm: 8px; --space-md: 16px; --space-lg: 24px; --space-xl: 32px;
  --font-xs: 11px; --font-sm: 13px; --font-md: 15px; --font-lg: 17px; --font-xl: 20px; --font-xxl: 28px; --font-title: 34px;
  --bronze: #CD7F32; --silver: #C0C0C0; --gold: #FFD700; --diamond: #B9F2FF;
}

body { font-family: 'Inter', 'Montserrat', 'Noto Sans JP', -apple-system, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; min-height: 100dvh; -webkit-font-smoothing: antialiased; font-size: var(--font-md); line-height: 1.4; }

/* Accessibility: focus-visible for keyboard users */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Level Theme Classes - changes --level-color on hover/select */
[data-theme="N5"] { --level-color: var(--n5); --level-light: var(--n5-light); --level-shadow: rgba(52, 199, 89, 0.35); }
[data-theme="N4"] { --level-color: var(--n4); --level-light: var(--n4-light); --level-shadow: rgba(0, 122, 255, 0.35); }
[data-theme="N3"] { --level-color: var(--n3); --level-light: var(--n3-light); --level-shadow: rgba(175, 82, 222, 0.35); }
[data-theme="N2"] { --level-color: var(--n2); --level-light: var(--n2-light); --level-shadow: rgba(0, 91, 172, 0.35); }
[data-theme="N1"] { --level-color: var(--n1); --level-light: var(--n1-light); --level-shadow: rgba(255, 59, 48, 0.35); }

/* Level theme applies to level selector buttons only */
.level-select-btn.active { background: var(--level-color); box-shadow: 0 4px 12px var(--level-shadow); }
.category-btn.selected { border: 2px solid var(--border); background: white; }

/* Animations - Apple-style smooth easing */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes bounceIn { 
  0% { transform: scale(0.9); opacity: 0; } 
  60% { transform: scale(1.03); opacity: 1; } 
  100% { transform: scale(1); opacity: 1; } 
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes checkmark { 
  0% { transform: scale(0); opacity: 0; } 
  60% { transform: scale(1.15); opacity: 1; } 
  100% { transform: scale(1); opacity: 1; } 
}
@keyframes successPop { 
  0% { transform: scale(1); } 
  40% { transform: scale(1.08); } 
  100% { transform: scale(1); } 
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Apple-style easing curves */
:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Screen Layout */
.screen { display: none; width: 100%; height: 100vh; height: 100dvh; max-width: 480px; margin: 0 auto; padding: var(--space-md); overflow-y: auto; overflow-x: hidden; }
.screen.active { display: flex; flex-direction: column; animation: fadeIn 0.35s var(--ease-out-expo); }

/* Screens that should not scroll (drill/quiz keep fixed layout) */
#screen-drill, #screen-quiz { overflow-y: auto; }
#screen-mock, #screen-ai, #screen-settings { overflow-y: auto; }

/* Header */
.header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-sm) 0 var(--space-md); position: relative; z-index: 100; flex-shrink: 0; }
.header-right { display: flex; align-items: center; gap: var(--space-sm); }
.logo { font-size: var(--font-xl); font-weight: 700; color: var(--primary); letter-spacing: -0.5px; }
.logo span { color: var(--text); }
.logo-icon { display: inline-block; margin-right: 4px; vertical-align: middle; }
.header-btn { width: 44px; height: 44px; border: none; border-radius: 50%; background: var(--card); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,0.08); transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo); }
.header-btn:active { transform: scale(0.92); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.lang-selector { background: var(--card); border: none; border-radius: 10px; padding: var(--space-sm) 12px; font-size: var(--font-sm); font-weight: 500; color: var(--text); cursor: pointer; outline: none; box-shadow: 0 2px 8px rgba(0,0,0,0.08); transition: transform 0.25s var(--ease-out-expo); }
.lang-selector:active { transform: scale(0.96); }

/* Navigation Bar */
.nav-bar { display: flex; gap: 4px; background: rgba(255,255,255,0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 12px; padding: 4px; margin-bottom: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); flex-shrink: 0; position: relative; z-index: 50; }
.nav-bar-3 { margin-bottom: 8px; }
.nav-btn { flex: 1; padding: 8px 6px; border: none; border-radius: 8px; background: transparent; font-size: 11px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.3s var(--ease-out-expo); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nav-btn:active { transform: scale(0.95); }
.nav-btn.active { background: white; color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); border: 2px solid var(--border); }
.nav-icon { font-size: 16px; }
.ai-nav-icon { width: 18px; height: 18px; background: radial-gradient(circle at 30% 30%, #FFB74D, #FF9800, #F57C00); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
.nav-btn.active .ai-nav-icon { background: radial-gradient(circle at 30% 30%, #FFCC80, #FFB74D, #FF9800); }

/* Dashboard Layout - Compact for single screen */
.dashboard-fixed { padding: var(--space-sm) var(--space-md) !important; }
.dashboard-fixed .header { padding: 4px 0 8px; }
.dashboard-fixed .header .logo-img { height: 100px !important; }
.dashboard-fixed .nav-bar { margin-bottom: 8px; }
.dashboard-content { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative; z-index: 1; }

/* Level Selector - Compact */
.dash-level-row { display: flex; gap: 4px; flex-shrink: 0; margin: 0 16px 12px; background: rgba(118, 118, 128, 0.12); padding: 3px; border-radius: 10px; }
.level-select-btn { flex: 1; padding: 10px 6px; border: none; border-radius: 8px; background: transparent; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.25s var(--ease-out-expo); position: relative; }
.level-select-btn:active { transform: scale(0.95); }
.level-select-btn:hover:not(.active) { background: rgba(0,0,0,0.04); }
.level-select-btn[data-level="N5"]:hover:not(.active) { background: var(--n5-light); color: var(--n5); }
.level-select-btn[data-level="N4"]:hover:not(.active) { background: var(--n4-light); color: var(--n4); }
.level-select-btn[data-level="N3"]:hover:not(.active) { background: var(--n3-light); color: var(--n3); }
.level-select-btn[data-level="N2"]:hover:not(.active) { background: var(--n2-light); color: var(--n2); }
.level-select-btn[data-level="N1"]:hover:not(.active) { background: var(--n1-light); color: var(--n1); }
.level-select-btn.active { color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08); transform: none; font-weight: 700; }
.level-select-btn[data-level="N5"].active { background: var(--n5); box-shadow: 0 2px 8px rgba(52, 199, 89, 0.35), 0 1px 2px rgba(52, 199, 89, 0.2); }
.level-select-btn[data-level="N4"].active { background: var(--n4); box-shadow: 0 2px 8px rgba(0, 122, 255, 0.35), 0 1px 2px rgba(0, 122, 255, 0.2); }
.level-select-btn[data-level="N3"].active { background: var(--n3); box-shadow: 0 2px 8px rgba(175, 82, 222, 0.35), 0 1px 2px rgba(175, 82, 222, 0.2); }
.level-select-btn[data-level="N2"].active { background: var(--n2); box-shadow: 0 2px 8px rgba(30, 58, 95, 0.35), 0 1px 2px rgba(30, 58, 95, 0.2); }
.level-select-btn[data-level="N1"].active { background: var(--n1); box-shadow: 0 2px 8px rgba(255, 59, 48, 0.35), 0 1px 2px rgba(255, 59, 48, 0.2); }

/* Level Grid for Mock */
.level-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-sm); margin-bottom: var(--space-sm); flex-shrink: 0; }
.level-btn { padding: var(--space-sm) var(--space-xs); border: 2px solid var(--border); border-radius: 12px; background: var(--card); font-size: var(--font-sm); font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; }
.level-btn:active { transform: scale(0.95); }
.level-btn.active { color: white; border-color: transparent; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.level-btn[data-level="N5"].active { background: var(--n5); }
.level-btn[data-level="N4"].active { background: var(--n4); }
.level-btn[data-level="N3"].active { background: var(--n3); }
.level-btn[data-level="N2"].active { background: var(--n2); }
.level-btn[data-level="N1"].active { background: var(--n1); }

/* Unit Grid - Compact */
.dash-unit-section { background: var(--card); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; min-height: 120px; box-shadow: 0 0.5px 0 0 rgba(0,0,0,0.04), 0 1px 3px 0 rgba(0,0,0,0.04), 0 4px 8px 0 rgba(0,0,0,0.04); border: 0.5px solid rgba(0,0,0,0.04); overflow: hidden; }
.dash-unit-section .unit-grid { flex: 1; display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; align-content: start; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.unit-grid-section { margin-bottom: var(--space-sm); flex-shrink: 0; }
.unit-grid-header { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 8px 4px; }
.unit-grid-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.unit-grid-count { font-size: 13px; font-weight: 600; color: var(--level-color, var(--primary)); }
.unit-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.dashboard-unit-grid { background: var(--card); padding: var(--space-md); border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.section-title { font-size: var(--font-sm); font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-sm); flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.5px; }
.unit-cell { width: 100%; aspect-ratio: 1; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; cursor: pointer; transition: all 0.25s var(--ease-out-expo); border: 2px solid transparent; position: relative; }
.unit-cell:active:not(.locked) { transform: scale(0.9); }
.unit-cell.locked { background: var(--border); color: var(--text-tertiary); cursor: not-allowed; }
.unit-cell.available { background: var(--bg); color: var(--text-secondary); border-color: var(--border); }
.unit-cell.in-progress { color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.unit-cell .unit-num { font-size: 11px; font-weight: 700; line-height: 1; }
.unit-cell .unit-percent { font-size: 8px; font-weight: 500; opacity: 0.8; line-height: 1; margin-top: 1px; }
.unit-cell.complete { color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.unit-cell.complete::after { content: '✓'; font-size: 11px; animation: checkmark 0.4s var(--ease-out-expo) forwards; }
.unit-cell:not(.locked):hover { transform: scale(1.15); box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 10; }
.unit-grid[data-level="N5"] .unit-cell.complete { background: var(--n5); }
.unit-grid[data-level="N4"] .unit-cell.complete { background: var(--n4); }
.unit-grid[data-level="N3"] .unit-cell.complete { background: var(--n3); }
.unit-grid[data-level="N2"] .unit-cell.complete { background: var(--n2); }
.unit-grid[data-level="N1"] .unit-cell.complete { background: var(--n1); }

/* Category Buttons - Compact */
.category-row { display: flex; gap: 8px; flex-shrink: 0; padding-bottom: 8px; }
.category-btn { flex: 1; padding: 12px 8px; border: none; border-radius: 14px; background: var(--card); cursor: pointer; text-align: center; transition: all 0.25s var(--ease-out-expo); box-shadow: 0 0.5px 0 0 rgba(0,0,0,0.04), 0 1px 3px 0 rgba(0,0,0,0.04), 0 4px 8px 0 rgba(0,0,0,0.04); border: 0.5px solid rgba(0,0,0,0.04); display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 70px; }
.category-btn:active { transform: scale(0.96); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.category-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.category-icon { font-size: 22px; margin-bottom: 0; }
.category-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }

/* Quiz Screen */
.quiz-screen { flex-direction: column; height: calc(100vh - 32px); height: calc(100dvh - 32px); overflow-y: auto; padding: var(--space-md) !important; }
.quiz-screen.active { display: flex; }
.quiz-screen[data-level="N5"] { --quiz-color: var(--n5); --quiz-light: var(--n5-light); }
.quiz-screen[data-level="N4"] { --quiz-color: var(--n4); --quiz-light: var(--n4-light); }
.quiz-screen[data-level="N3"] { --quiz-color: var(--n3); --quiz-light: var(--n3-light); }
.quiz-screen[data-level="N2"] { --quiz-color: var(--n2); --quiz-light: var(--n2-light); }
.quiz-screen[data-level="N1"] { --quiz-color: var(--n1); --quiz-light: var(--n1-light); }
.q-header { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); flex-shrink: 0; flex-wrap: wrap; }
.back-btn { width: 40px; height: 40px; border: none; border-radius: 50%; background: var(--card); font-size: 20px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: all 0.2s; flex-shrink: 0; }
.back-btn:active { transform: scale(0.9); }
.q-title { font-size: var(--font-lg); font-weight: 600; }
.q-progress { margin-left: auto; font-size: var(--font-sm); font-weight: 600; color: var(--text-secondary); background: var(--bg); padding: 6px 12px; border-radius: 20px; }
.skill-badge { padding: 6px 12px; border-radius: 20px; font-size: var(--font-xs); font-weight: 600; color: white; display: flex; align-items: center; gap: 4px; }
.skill-badge.listening { background: linear-gradient(135deg, #667EEA, #764BA2); }
.skill-badge.reading { background: linear-gradient(135deg, #F093FB, #F5576C); }
.skill-badge.meaning { background: linear-gradient(135deg, #4FACFE, #00F2FE); }
.skill-badge.writing { background: linear-gradient(135deg, #43E97B, #38F9D7); }
.review-header-btn { padding: 6px 12px; background: var(--warning); color: white; border: none; border-radius: 20px; font-size: var(--font-xs); font-weight: 600; cursor: pointer; margin-left: auto; transition: all 0.2s; }
.review-header-btn:active { transform: scale(0.95); }
.q-card { background: var(--card); border-radius: 20px; padding: var(--space-lg); margin-bottom: var(--space-md); box-shadow: 0 4px 16px rgba(0,0,0,0.08); text-align: center; flex-shrink: 0; border-top: 4px solid var(--quiz-color, var(--primary)); animation: scaleIn 0.35s var(--ease-out-expo); }
.q-card.compact { padding: var(--space-md); }
.q-word { font-size: var(--font-title); font-weight: 700; margin-bottom: var(--space-xs); letter-spacing: -0.5px; }
.q-reading { font-size: var(--font-md); color: var(--text-secondary); margin-bottom: var(--space-sm); }
.q-prompt { font-size: var(--font-sm); color: var(--text-tertiary); margin-bottom: var(--space-sm); text-transform: uppercase; letter-spacing: 0.5px; }
.audio-btn { padding: var(--space-sm) var(--space-md); border: none; border-radius: 20px; background: var(--quiz-color, var(--primary)); color: white; font-size: var(--font-sm); font-weight: 600; cursor: pointer; margin: var(--space-sm) auto 0; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.audio-btn:active { transform: scale(0.95); }
.audio-btn.playing { background: #4285f4; animation: pulse-speaker 1.5s ease-in-out infinite; }

/* Answer Options */
.options { display: flex; flex-direction: column; gap: var(--space-sm); flex-shrink: 0; }
.options.compact .option-btn { padding: 14px var(--space-md); }
.option-btn { padding: var(--space-md) var(--space-lg); background: var(--card); border: 2px solid var(--border); border-radius: 14px; font-size: var(--font-md); font-weight: 500; cursor: pointer; text-align: left; transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.option-btn:active:not(:disabled) { transform: scale(0.98); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.option-btn.selected { border-color: var(--primary); background: rgba(0, 91, 172, 0.08); }
.option-btn.correct { border-color: var(--success); background: var(--success-light); animation: successPop 0.3s ease; }
.option-btn.incorrect { border-color: var(--error); background: var(--error-light); }
.option-btn:disabled { pointer-events: none; }
.option-btn.emoji-option { text-align: center; font-size: 2.5rem; padding: 16px; min-height: 70px; display: flex; align-items: center; justify-content: center; }
.options.emoji-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.options.emoji-grid .option-btn { text-align: center; }

/* Feedback Area */
.feedback-area { background: var(--card); border-radius: 20px; padding: var(--space-md); margin-top: var(--space-sm); box-shadow: 0 4px 16px rgba(0,0,0,0.08); flex-shrink: 0; display: flex; flex-direction: column; animation: slideUp 0.3s ease; }
.feedback-result { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); flex-shrink: 0; }
.feedback-icon { font-size: 24px; }
.feedback-text { font-size: var(--font-lg); font-weight: 700; }
.feedback-result.correct .feedback-icon::before { content: '✓'; color: var(--success); }
.feedback-result.correct .feedback-text { color: var(--success); }
.feedback-result.incorrect .feedback-icon::before { content: '✗'; color: var(--error); }
.feedback-result.incorrect .feedback-text { color: var(--error); }
.feedback-answer { font-size: var(--font-sm); color: var(--text); margin-bottom: var(--space-sm); padding: var(--space-sm) var(--space-md); background: var(--bg); border-radius: 10px; flex-shrink: 0; font-weight: 600; }
.feedback-ai-section { margin: 0 0 var(--space-sm) 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.feedback-ai-comment { font-size: var(--font-sm); line-height: 1.6; color: var(--text); padding: var(--space-md); background: linear-gradient(135deg, #F8F9FF 0%, #F0F4FF 100%); border-radius: 14px; border-left: 4px solid #667EEA; margin-bottom: var(--space-sm); flex: 1; overflow-y: auto; max-height: 100px; }
.ai-comment-loading { color: #667EEA; font-style: italic; }
.ask-more-btn { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 16px; font-size: 13px; color: #667EEA; cursor: pointer; margin-top: 8px; transition: all 0.2s; }
.ask-more-btn:hover { background: #f0f0ff; border-color: #667EEA; }
.feedback-followup { display: flex; gap: var(--space-sm); flex-shrink: 0; margin-top: 8px; }
.followup-input { flex: 1; padding: var(--space-sm) var(--space-md); border: 2px solid var(--border); border-radius: 12px; font-size: var(--font-sm); outline: none; transition: border-color 0.2s; }
.followup-input:focus-visible { border-color: #667EEA; outline: none; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15); }
.followup-btn { width: 40px; height: 40px; border: none; border-radius: 12px; background: linear-gradient(135deg, #667EEA, #764BA2); color: white; font-size: var(--font-lg); font-weight: 700; cursor: pointer; flex-shrink: 0; transition: all 0.2s; }
.followup-btn:active { transform: scale(0.9); }
.followup-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.followup-response { font-size: var(--font-sm); line-height: 1.5; padding: var(--space-sm) var(--space-md); background: white; border-radius: 10px; border: 1px solid var(--border); margin-top: var(--space-sm); max-height: 60px; overflow-y: auto; }
.feedback-next-btn { width: calc(100% - 32px); padding: var(--space-md); background: var(--level-color); color: white; border: none; border-radius: 14px; font-size: var(--font-md); font-weight: 600; cursor: pointer; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.15); transition: all 0.2s; position: fixed; bottom: 16px; left: 16px; z-index: 100; }
.feedback-next-btn:active { transform: scale(0.98); }

/* Result Screen */
.result-card { background: var(--card); border-radius: 24px; padding: var(--space-xl); text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.1); margin-bottom: var(--space-lg); transition: all 0.3s; animation: bounceIn 0.4s ease; }
.result-icon { font-size: 72px; margin-bottom: var(--space-md); }
.result-score { font-size: 56px; font-weight: 700; color: var(--primary); letter-spacing: -2px; }
.result-label { font-size: var(--font-xl); font-weight: 600; color: var(--text); margin-bottom: var(--space-xs); }
.result-praise { font-size: var(--font-md); margin-bottom: var(--space-lg); font-weight: 500; }
.result-stats { display: flex; justify-content: center; gap: var(--space-xl); margin-bottom: var(--space-lg); }
.result-stat { text-align: center; }
.result-stat-value { font-size: var(--font-xxl); font-weight: 700; }
.result-stat-label { font-size: var(--font-xs); color: var(--text-secondary); text-transform: uppercase; }
.result-actions { display: flex; flex-direction: column; gap: var(--space-sm); }

/* AI Feedback Card (Result Screen) - HIG compliant */
.ai-feedback-card {
  background: #F2F2F7;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideUp 0.3s ease;
}
.ai-feedback-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.ai-feedback-text {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
}

/* Buttons */
.btn-primary { width: 100%; padding: var(--space-md); background: var(--primary); color: white; border: none; border-radius: 14px; font-size: var(--font-md); font-weight: 600; cursor: pointer; margin-bottom: var(--space-sm); box-shadow: 0 4px 12px rgba(0, 91, 172, 0.3); transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.btn-primary:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(0, 91, 172, 0.3); }
.btn-secondary { width: 100%; padding: var(--space-md); background: var(--card); color: var(--text); border: none; border-radius: 14px; font-size: var(--font-md); font-weight: 500; cursor: pointer; margin-bottom: var(--space-sm); box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: all 0.2s; }
.btn-secondary:active { transform: scale(0.98); background: var(--bg); }

/* Mock Test Screen */
/* Mock Screen - Apple-style Compact Design */
.mock-screen-compact { overflow-y: auto !important; }
.mock-content { flex: 1; display: flex; flex-direction: column; gap: var(--space-md); }

/* Quick Start Card */
.mock-quick-card {
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  border-radius: 20px;
  padding: var(--space-lg);
  color: white;
  box-shadow: 0 8px 32px rgba(0, 91, 172, 0.25);
}
.mock-quick-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.mock-quick-level {
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: var(--font-sm);
  font-weight: 700;
}
.mock-quick-title {
  font-size: var(--font-xl);
  font-weight: 700;
  letter-spacing: -0.5px;
}
.mock-quick-stats {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}
.mock-quick-stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.mock-stat-num {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
}
.mock-stat-label {
  font-size: var(--font-sm);
  opacity: 0.8;
  text-transform: uppercase;
}
.mock-quick-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.3);
}
.mock-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 14px;
  background: white;
  color: var(--primary);
  border: none;
  border-radius: 14px;
  font-size: var(--font-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
}
.mock-start-btn:hover { transform: scale(1.02); box-shadow: 0 4px 16px rgba(255,255,255,0.3); }
.mock-start-btn:active { transform: scale(0.98); }

/* Options Card */
.mock-options {
  background: var(--card);
  border-radius: 16px;
  padding: var(--space-md);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.mock-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
}
.mock-option-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}
.mock-option-label {
  font-size: var(--font-md);
  font-weight: 500;
  color: var(--text);
}
.mock-option-toggle {
  display: flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 3px;
}
.mock-toggle-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
}
.mock-toggle-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.mock-set-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}
.mock-set-select:focus-visible {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Section Pills */
.mock-section-select { padding: var(--space-sm) 0; }
.mock-section-pills {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}
.mock-pill {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
}
.mock-pill:active { transform: scale(0.95); }
.mock-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Recent Score */
.mock-recent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: 14px;
  padding: var(--space-md);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.mock-recent-label {
  font-size: var(--font-sm);
  color: var(--text-secondary);
}
.mock-recent-score {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--success);
}

/* New Mock Dashboard Styles */
.mock-hero {
  background: var(--card);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}
.mock-hero-level {
  font-size: 14px;
  font-weight: 600;
  color: white;
  background: var(--level-color, var(--primary));
  padding: 4px 12px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 12px;
}
.mock-hero-title {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.mock-hero-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Mock Set List */
.mock-set-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mock-set-item {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.mock-set-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.mock-set-item.active {
  border: 2px solid var(--level-color, var(--primary));
  box-shadow: 0 2px 12px var(--level-shadow, rgba(102, 126, 234, 0.2));
}
.mock-set-num {
  width: 40px;
  height: 40px;
  background: var(--bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
  flex-shrink: 0;
}
.mock-set-item.completed .mock-set-num {
  background: var(--level-color, var(--primary));
  color: white;
}
.mock-set-info {
  flex: 1;
  min-width: 0;
}
.mock-set-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.mock-set-meta {
  font-size: 13px;
  color: var(--text-tertiary);
}
.mock-set-score {
  font-size: 18px;
  font-weight: 600;
  color: var(--success);
  flex-shrink: 0;
}
.mock-set-score.not-attempted {
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 400;
}

/* Legacy Mock Styles (for quiz screen) */
.mock-info { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: 24px; padding: var(--space-xl); color: white; text-align: center; margin-bottom: var(--space-lg); box-shadow: 0 8px 32px rgba(0, 91, 172, 0.3); }
.mock-title { font-size: var(--font-xxl); font-weight: 700; margin-bottom: var(--space-sm); letter-spacing: -0.5px; }
.mock-desc { font-size: var(--font-md); opacity: 0.9; margin-bottom: var(--space-lg); }
.mock-details { display: flex; justify-content: center; gap: var(--space-xl); }
.mock-detail-value { font-size: var(--font-title); font-weight: 700; }
.mock-detail-label { font-size: var(--font-xs); opacity: 0.8; text-transform: uppercase; }
.mock-mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-sm); margin-bottom: var(--space-md); }
.mock-mode-btn { padding: var(--space-md) var(--space-sm); border: none; border-radius: 16px; background: var(--card); cursor: pointer; text-align: center; transition: all 0.25s var(--ease-out-expo); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.mock-mode-btn:active { transform: scale(0.96); }
.mock-mode-btn.active { background: var(--primary); color: white; box-shadow: 0 4px 16px rgba(0, 91, 172, 0.3); }
.mock-mode-icon { font-size: 28px; margin-bottom: var(--space-xs); }
.mock-mode-title { font-size: var(--font-sm); font-weight: 600; margin-bottom: 2px; }
.mock-mode-desc { font-size: var(--font-xs); color: var(--text-secondary); }
.mock-mode-btn.active .mock-mode-desc { color: rgba(255,255,255,0.8); }
.mock-section-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.mock-section-btn { display: flex; justify-content: space-between; align-items: center; padding: var(--space-md); border: none; border-radius: 14px; background: var(--card); cursor: pointer; transition: all 0.25s var(--ease-out-expo); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.mock-section-btn:active { transform: scale(0.98); }
.mock-section-btn.active { background: var(--primary); color: white; }
.mock-section-name { font-size: var(--font-md); font-weight: 600; }
.mock-section-info { font-size: var(--font-sm); color: var(--text-secondary); }
.mock-section-btn.active .mock-section-info { color: rgba(255,255,255,0.8); }
.mock-set-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--space-sm); }
.mock-set-btn { padding: var(--space-sm); border: none; border-radius: 10px; background: var(--card); cursor: pointer; font-size: var(--font-sm); font-weight: 600; transition: all 0.25s var(--ease-out-expo); box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.mock-set-btn:active { transform: scale(0.95); }
.mock-set-btn.active { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(0, 91, 172, 0.3); }
.mock-section-header { background: var(--card); border-radius: 16px; padding: var(--space-md); margin-bottom: var(--space-md); text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.mock-section-current { font-size: var(--font-md); font-weight: 600; color: var(--primary); }
.mock-subsection-current { font-size: var(--font-sm); color: var(--text-secondary); margin-top: 2px; }
.mock-q-card { padding: var(--space-lg); }
.mock-q-instruction { font-size: var(--font-sm); color: var(--text-secondary); margin-bottom: var(--space-md); line-height: 1.6; background: var(--bg); padding: var(--space-md); border-radius: 12px; }
.mock-q-text { font-size: var(--font-md); line-height: 1.8; white-space: pre-wrap; }
.mock-q-text u { text-decoration: underline; font-weight: 600; }
.mock-audio-btn { display: flex; align-items: center; justify-content: center; gap: var(--space-sm); width: 100%; padding: var(--space-md); background: linear-gradient(135deg, #667EEA, #764BA2); color: white; border: none; border-radius: 14px; font-size: var(--font-md); font-weight: 600; cursor: pointer; margin-top: var(--space-md); box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4); transition: all 0.2s; }
.mock-audio-btn:active { transform: scale(0.98); }
.mock-audio-btn.playing { background: #4285f4; animation: pulse-speaker 1.5s ease-in-out infinite; }
.mock-options { display: flex; flex-direction: column; gap: var(--space-sm); }
.mock-nav-btns { display: flex; gap: var(--space-sm); margin-top: var(--space-md); padding-bottom: var(--space-lg); }
.mock-nav-btn { flex: 1; padding: var(--space-md); border: none; border-radius: 14px; background: var(--card); font-size: var(--font-md); font-weight: 500; cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.mock-nav-btn:active:not(:disabled) { transform: scale(0.98); }
.mock-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mock-timer-bar { height: 4px; background: var(--border); border-radius: 2px; margin-bottom: var(--space-md); overflow: hidden; }
.mock-timer-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 1s linear; }
.mock-result-summary { background: var(--card); border-radius: 20px; padding: var(--space-lg); margin-bottom: var(--space-md); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.mock-result-header { text-align: center; margin-bottom: var(--space-lg); }
.mock-result-score { font-size: 56px; font-weight: 700; color: var(--primary); }
.mock-result-label { font-size: var(--font-md); color: var(--text-secondary); }
.mock-result-sections { display: flex; flex-direction: column; gap: var(--space-sm); }
.mock-result-section { display: flex; justify-content: space-between; align-items: center; padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); }
.mock-result-section:last-child { border-bottom: none; }
.mock-result-section-name { font-size: var(--font-md); font-weight: 500; }
.mock-result-section-score { font-size: var(--font-md); font-weight: 600; color: var(--primary); }
.mock-history-section { background: var(--card); border-radius: 16px; padding: var(--space-md); margin-top: var(--space-md); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.mock-history-title { font-size: var(--font-sm); font-weight: 600; color: var(--text-secondary); margin-bottom: var(--space-sm); text-transform: uppercase; }
.mock-history-list { display: flex; flex-direction: column; gap: var(--space-xs); max-height: 150px; overflow-y: auto; }
.mock-history-row { display: grid; grid-template-columns: 1fr 60px 50px; gap: var(--space-sm); padding: var(--space-sm); font-size: var(--font-sm); border-radius: 8px; }
.mock-history-row:nth-child(odd) { background: var(--bg); }
.mock-history-row.header { font-weight: 600; color: var(--text-secondary); font-size: var(--font-xs); text-transform: uppercase; background: transparent; }

/* Progress Components */
.progress-overview { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-radius: 20px; padding: var(--space-lg); color: white; margin-bottom: var(--space-md); box-shadow: 0 8px 32px rgba(0, 91, 172, 0.3); }
.progress-title { font-size: var(--font-md); opacity: 0.9; margin-bottom: var(--space-sm); }
.progress-main { display: flex; align-items: baseline; gap: var(--space-sm); margin-bottom: var(--space-md); }
.progress-percent { font-size: 56px; font-weight: 700; letter-spacing: -2px; }
.progress-label { font-size: var(--font-md); opacity: 0.8; }
.progress-bar-bg { background: rgba(255,255,255,0.3); border-radius: 8px; height: 8px; }
.progress-bar-fill { background: white; border-radius: 8px; height: 100%; transition: width 0.5s ease; }
.stats-row { display: flex; gap: var(--space-md); margin-bottom: var(--space-md); }
.stat-box { flex: 1; background: var(--card); border-radius: 16px; padding: var(--space-md); text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.stat-value { font-size: var(--font-xxl); font-weight: 700; color: var(--primary); }
.stat-label { font-size: var(--font-xs); color: var(--text-secondary); margin-top: var(--space-xs); text-transform: uppercase; }
.level-progress { background: var(--card); border-radius: 16px; padding: var(--space-md); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.level-progress-title { font-size: var(--font-md); font-weight: 600; margin-bottom: var(--space-md); }
.level-row { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-sm); }
.level-badge { width: 44px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-size: var(--font-xs); font-weight: 600; }
.level-bar { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.level-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.level-percent { font-size: var(--font-sm); color: var(--text-secondary); width: 40px; text-align: right; font-weight: 600; }
.progress-card { background: var(--card); border-radius: 16px; padding: var(--space-md); margin: var(--space-sm) 0; box-shadow: 0 2px 12px rgba(0,0,0,0.06); flex-shrink: 0; }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-sm); }
.progress-level { font-size: var(--font-lg); font-weight: 700; color: var(--primary); }
.progress-bar-container { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-detail { font-size: var(--font-xs); color: var(--text-secondary); margin-top: var(--space-sm); text-align: center; }

/* Wrong Answers */
.wrong-answers-section { background: var(--card); border-radius: 16px; padding: var(--space-md); margin-bottom: var(--space-md); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.wrong-answers-title { font-size: var(--font-md); font-weight: 600; color: var(--text); margin-bottom: var(--space-md); }
.wrong-answer-card { background: var(--bg); border-radius: 12px; padding: var(--space-md); margin-bottom: var(--space-sm); }
.wrong-answer-q { font-size: var(--font-lg); font-weight: 600; margin-bottom: var(--space-sm); }
.wrong-answer-info { display: flex; flex-direction: column; gap: var(--space-xs); font-size: var(--font-sm); }
.wrong-answer-your { color: var(--error); }
.wrong-answer-correct { color: var(--success); font-weight: 600; }
.ai-explanation { margin-top: var(--space-sm); padding: var(--space-md); background: linear-gradient(135deg, #F8F9FF 0%, #F0F4FF 100%); border-radius: 12px; border-left: 4px solid #667EEA; }
.ai-explanation-loading { display: flex; align-items: center; gap: var(--space-sm); color: #667EEA; }
.spinner { width: 16px; height: 16px; border: 2px solid #667EEA; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }

/* AI Screen */
.ai-card { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 20px; padding: var(--space-lg); color: white; text-align: center; margin-bottom: var(--space-md); box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4); }
.ai-title { font-size: var(--font-xl); font-weight: 700; margin-bottom: var(--space-sm); }
.ai-desc { font-size: var(--font-sm); opacity: 0.9; margin-bottom: var(--space-md); line-height: 1.5; }
.ai-badge { display: inline-block; background: rgba(255,255,255,0.2); padding: 6px 16px; border-radius: 20px; font-size: var(--font-xs); font-weight: 600; }
.ai-features { display: flex; flex-direction: column; gap: var(--space-sm); }
.ai-feature { display: flex; gap: var(--space-md); padding: var(--space-md); background: var(--card); border-radius: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.ai-feature-icon { font-size: 28px; }
.ai-feature-text { flex: 1; }
.ai-feature-title { font-size: var(--font-md); font-weight: 600; margin-bottom: 2px; }
.ai-feature-desc { font-size: var(--font-xs); color: var(--text-secondary); }
.ai-chat-container { flex: 1; display: flex; flex-direction: column; background: var(--card); border-radius: 20px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.ai-chat-messages { flex: 1; overflow-y: auto; padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm); }
.ai-message { max-width: 85%; padding: var(--space-sm) var(--space-md); border-radius: 18px; font-size: var(--font-md); line-height: 1.5; animation: slideUp 0.2s ease; }
.ai-message.user { align-self: flex-end; background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.ai-message.assistant { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 4px; }
.ai-chat-input-area { display: flex; gap: var(--space-sm); padding: var(--space-md); border-top: 1px solid var(--border); background: var(--card); }
.ai-chat-input { flex: 1; padding: var(--space-sm) var(--space-md); border: none; border-radius: 20px; background: var(--bg); font-size: var(--font-md); outline: none; }
.ai-chat-send { width: 40px; height: 40px; border: none; border-radius: 50%; background: var(--primary); color: white; font-size: var(--font-lg); cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.ai-chat-send:active { transform: scale(0.9); }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: var(--space-md); animation: fadeIn 0.2s ease; }
.modal { background: var(--card); border-radius: 20px; padding: var(--space-lg); max-width: 340px; width: 100%; text-align: center; box-shadow: 0 16px 48px rgba(0,0,0,0.2); animation: scaleIn 0.3s ease; }
.modal-icon { font-size: 48px; margin-bottom: var(--space-md); }
.modal-title { font-size: var(--font-xl); font-weight: 700; margin-bottom: var(--space-sm); }
.modal-text { font-size: var(--font-md); color: var(--text-secondary); margin-bottom: var(--space-lg); line-height: 1.5; }
.modal-btns { display: flex; gap: var(--space-sm); }
.modal-btns .btn-primary, .modal-btns .btn-secondary { flex: 1; margin-bottom: 0; }
.pass-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: var(--space-md); }
.pass-modal-content { background: var(--card); border-radius: 24px; padding: var(--space-xl); max-width: 380px; width: 100%; text-align: center; box-shadow: 0 24px 64px rgba(0,0,0,0.25); animation: bounceIn 0.4s ease; }

/* Settings */
.settings-fixed { padding: var(--space-md) !important; }
.settings-header { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm) 0; flex-shrink: 0; }
.settings-title { font-size: var(--font-xl); font-weight: 700; }
.settings-content { flex: 1; display: flex; flex-direction: column; gap: var(--space-md); overflow-y: auto; }
.settings-section { background: var(--card); border-radius: 16px; padding: var(--space-md); flex-shrink: 0; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.settings-section-title { font-size: var(--font-xs); font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--space-sm); }
.setting-item { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); }
.setting-item:last-child { border-bottom: none; padding-bottom: 0; }
.setting-item:first-of-type { padding-top: 0; }
.setting-icon { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; }
.setting-info { flex: 1; min-width: 0; }
.setting-title { font-size: var(--font-md); font-weight: 500; }
.setting-desc { font-size: var(--font-xs); color: var(--text-secondary); margin-top: 2px; }
.setting-select { padding: var(--space-sm) var(--space-md); border: none; border-radius: 10px; font-size: var(--font-sm); background: var(--bg); cursor: pointer; font-weight: 500; }
.setting-action-btn { padding: var(--space-sm) var(--space-md); background: var(--primary); color: white; border: none; border-radius: 10px; font-size: var(--font-sm); font-weight: 600; cursor: pointer; transition: all 0.2s; }
.setting-action-btn:active { transform: scale(0.95); }
.setting-arrow { font-size: 20px; color: var(--text-tertiary); }
.setting-toggle { position: relative; width: 51px; height: 31px; flex-shrink: 0; }
.setting-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--border); border-radius: 31px; transition: 0.3s; }
.toggle-slider:before { position: absolute; content: ""; height: 27px; width: 27px; left: 2px; bottom: 2px; background: white; border-radius: 50%; transition: 0.3s; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.setting-toggle input:checked + .toggle-slider { background: var(--success); }
.setting-toggle input:checked + .toggle-slider:before { transform: translateX(20px); }
.settings-footer { text-align: center; padding: var(--space-md) 0; flex-shrink: 0; }
.app-version { font-size: var(--font-sm); color: var(--text-secondary); margin-bottom: var(--space-xs); }
.app-links { font-size: var(--font-xs); }
.app-links a { color: var(--primary); text-decoration: none; font-weight: 500; }

/* AI Explanation Button */
.ai-explain-btn { display: flex; align-items: center; justify-content: center; gap: var(--space-sm); width: 100%; padding: var(--space-md) var(--space-lg); margin-top: var(--space-md); background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%); color: white; border: none; border-radius: 14px; font-size: var(--font-md); font-weight: 600; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4); }
.ai-explain-btn:active { transform: scale(0.98); }
.ai-explain-btn:disabled { opacity: 0.7; cursor: wait; }
.ai-explain-btn .ai-amoeba-icon { width: 24px; height: 24px; }
.ai-explanation-panel { background: var(--card); border-radius: 20px; padding: var(--space-md); margin-top: var(--space-md); box-shadow: 0 4px 20px rgba(0,0,0,0.1); animation: slideUp 0.3s ease; }
.ai-explanation-header { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); font-weight: 600; color: #667EEA; }
.ai-explanation-content { font-size: var(--font-md); line-height: 1.6; color: var(--text); margin-bottom: var(--space-md); }
.ai-explanation-continue { display: flex; align-items: center; justify-content: center; width: 100%; padding: var(--space-md); background: var(--primary); color: white; border: none; border-radius: 12px; font-size: var(--font-md); font-weight: 600; cursor: pointer; }
.ai-explanation-continue:active { transform: scale(0.98); }

/* Misc */
.pass-bonuses { margin-top: var(--space-md); }
.pass-bonus { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md); background: rgba(255,255,255,0.1); border-radius: 12px; margin-bottom: var(--space-sm); }
.pass-bonus-icon { font-size: 32px; }
.pass-bonus-text { flex: 1; }
.pass-bonus-title { font-size: var(--font-md); font-weight: 600; }
.pass-bonus-desc { font-size: var(--font-sm); opacity: 0.9; }
.mode-grid-2 { grid-template-columns: repeat(2, 1fr); }
.sf-icon { display: inline-flex; align-items: center; justify-content: center; width: 1em; height: 1em; vertical-align: -0.125em; }
.sf-icon svg { width: 100%; height: 100%; fill: currentColor; }

/* Hidden utility */
.hidden { display: none !important; }

/* Pass Report Modal */
.pass-modal-box { background: var(--card); border-radius: 20px; padding: var(--space-lg); max-width: 400px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,0.25); }
.pass-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-md); }
.pass-modal-title { font-size: var(--font-xl); font-weight: 700; }
.pass-modal-close { width: 32px; height: 32px; border: none; border-radius: 50%; background: var(--bg); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pass-form-group { margin-bottom: var(--space-md); }
.pass-form-label { display: block; font-size: var(--font-sm); font-weight: 600; margin-bottom: var(--space-xs); }
.pass-form-input, .pass-form-select { width: 100%; padding: var(--space-sm) var(--space-md); border: 1px solid var(--border); border-radius: 10px; font-size: var(--font-md); background: var(--card); }
.pass-form-textarea { width: 100%; padding: var(--space-sm) var(--space-md); border: 1px solid var(--border); border-radius: 10px; font-size: var(--font-md); min-height: 80px; resize: vertical; }
.pass-upload-area { border: 2px dashed var(--border); border-radius: 12px; padding: var(--space-lg); text-align: center; cursor: pointer; transition: border-color 0.2s; }
.pass-upload-area:hover { border-color: var(--primary); }
.pass-upload-icon { font-size: 32px; margin-bottom: var(--space-xs); }
.pass-upload-text { font-size: var(--font-sm); color: var(--text-secondary); }
.pass-preview { max-width: 100%; max-height: 150px; border-radius: 8px; margin-top: var(--space-sm); }
.pass-submit-btn { width: 100%; padding: var(--space-md); background: var(--primary); color: white; border: none; border-radius: 14px; font-size: var(--font-md); font-weight: 600; cursor: pointer; }
.pass-submit-btn:active { transform: scale(0.98); }

/* Subscription Modal */
.subscription-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: var(--space-md); }
.subscription-content { background: var(--card); border-radius: 24px; padding: var(--space-xl); max-width: 380px; width: 100%; box-shadow: 0 24px 64px rgba(0,0,0,0.25); animation: bounceIn 0.4s ease; }
.plan-card { background: var(--bg); border-radius: 16px; padding: var(--space-md); margin-bottom: var(--space-sm); cursor: pointer; border: 2px solid transparent; transition: all 0.2s; }
.plan-card.selected { border-color: var(--primary); background: rgba(0, 91, 172, 0.05); }
.plan-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-sm); }
.plan-name { font-size: var(--font-lg); font-weight: 700; }
.plan-badge { background: var(--success); color: white; padding: 2px 8px; border-radius: 10px; font-size: var(--font-xs); font-weight: 600; }
.plan-price { font-size: var(--font-xxl); font-weight: 700; color: var(--primary); }
.plan-price span { font-size: var(--font-sm); font-weight: 400; color: var(--text-secondary); }
.plan-features { font-size: var(--font-sm); color: var(--text-secondary); list-style: none; padding: 0; }
.plan-features li { padding: var(--space-xs) 0; }
.plan-features li::before { content: '✓ '; color: var(--success); }

/* Modal Box Styles */
.modal-box { background: var(--card); border-radius: 20px; padding: var(--space-lg); max-width: 400px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(0,0,0,0.25); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-md); }
.modal-close { width: 36px; height: 36px; border: none; border-radius: 50%; background: var(--bg); font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text); transition: all 0.2s; }
.modal-close:hover { background: var(--border); }
.modal-close:active { transform: scale(0.9); }

/* SF Symbols Style Icons */
.sf-icon { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  width: 1em; 
  height: 1em; 
  fill: currentColor;
  transition: transform 0.2s var(--ease-out-expo);
}
.sf-icon svg { width: 100%; height: 100%; }

/* Continue Button Style */

/* Swipe hint animation */
.swipe-hint {
  display: none;
  text-align: center;
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  padding: var(--space-xs);
  animation: float 2s ease-in-out infinite;
}
@media (hover: none) and (pointer: coarse) {
  .swipe-hint { display: block; }
}

/* ========== ONBOARDING ========== */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #003d73 0%, #005BAC 100%);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-lg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.onboarding-container {
  width: 100%;
  max-width: 400px;
  text-align: center;
  color: white;
  margin: auto 0;
  padding: var(--space-lg) 0;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: var(--space-xl);
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: all 0.3s var(--ease-out-expo);
}

.onboarding-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--primary);
}

.onboarding-step {
  display: none;
  animation: fadeIn 0.4s var(--ease-out-expo);
}

.onboarding-step.active {
  display: block;
}

.onboarding-icon {
  font-size: 64px;
  margin-bottom: var(--space-lg);
  animation: float 3s ease-in-out infinite;
}

.onboarding-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: var(--space-md);
  letter-spacing: -0.5px;
}

.onboarding-desc {
  font-size: var(--font-md);
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

/* Level Selection */
.onboarding-levels {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.onboarding-level-btn {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: var(--space-md);
  background: rgba(255,255,255,0.1);
  border: 2px solid transparent;
  border-radius: 14px;
  color: white;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  position: relative;
}

.onboarding-level-btn:hover {
  background: rgba(255,255,255,0.15);
  transform: translateX(4px);
}

.onboarding-level-btn.selected {
  border-color: var(--primary);
  background: rgba(0, 91, 172, 0.2);
}

.level-info-hint {
  margin-left: auto;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
}

.level-tag {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: var(--font-sm);
  font-weight: 700;
}

.level-tag.n5 { background: var(--n5); }
.level-tag.n4 { background: var(--n4); }
.level-tag.n3 { background: var(--n3); }
.level-tag.n2 { background: var(--n2); }
.level-tag.n1 { background: var(--n1); }

.level-name {
  font-size: var(--font-md);
  font-weight: 500;
}

/* Features */
.onboarding-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  text-align: left;
}

.onboarding-feature {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: rgba(255,255,255,0.08);
  border-radius: 14px;
}

.feature-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
}

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-text strong {
  font-size: var(--font-md);
}

.feature-text span {
  font-size: var(--font-sm);
  color: rgba(255,255,255,0.6);
}

/* AI Features Step (Step 4) */
.onboarding-ai-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  margin-top: var(--space-md);
}

.ai-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  transition: background 0.2s ease;
}

.ai-feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  flex-shrink: 0;
}

.ai-feature-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.ai-feature-content strong {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.ai-feature-content span {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
}

.ai-feature-item.highlight {
  background: rgba(255, 149, 0, 0.15);
  border: 1px solid rgba(255, 149, 0, 0.3);
}

.ai-feature-note {
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(102, 126, 234, 0.15);
  border-radius: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

/* Tip */
.onboarding-tip {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 12px;
  padding: var(--space-md);
  font-size: var(--font-sm);
  color: #FFC107;
  margin-top: var(--space-lg);
}

/* Unit Demo */
.onboarding-unit-demo {
  margin-top: var(--space-lg);
  text-align: center;
}
.unit-demo-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.unit-demo-box {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  transition: all 0.2s;
}
.unit-demo-box:first-child {
  background: var(--primary);
  border-color: var(--primary);
  animation: pulse-unit 1.5s ease-in-out infinite;
}
@keyframes pulse-unit {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(102,126,234,0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(102,126,234,0); }
}
.unit-demo-arrow {
  margin: 8px 0;
  animation: bounce-arrow 1s ease-in-out infinite;
}
@keyframes bounce-arrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
.unit-demo-label {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  margin-top: 12px;
}

/* Navigation */
.onboarding-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
}

.onboarding-skip {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: var(--font-md);
  cursor: pointer;
  padding: var(--space-sm) var(--space-md);
  transition: color 0.2s;
}

.onboarding-skip:hover {
  color: rgba(255,255,255,0.8);
}

.onboarding-next {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: var(--font-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
}

.onboarding-next:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 91, 172, 0.4);
}

.onboarding-next:active {
  transform: scale(0.98);
}

/* AI Mock Report Styles */
.ai-report {
  font-size: var(--font-sm);
  line-height: 1.7;
  color: var(--text);
}

.ai-report h4 {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--primary);
  margin: 16px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.ai-report strong {
  color: var(--text);
  font-weight: 600;
}

.ai-report br + • {
  display: inline-block;
  margin-left: 8px;
}

/* Mock Set Dropdown - Completed indicator */
.mock-set-select option[style*="color: rgb(52, 199, 89)"] {
  font-weight: 600;
}

.mock-set-select option[style*="color: rgb(255, 149, 0)"] {
  font-weight: 500;
}

/* ========== Today's Focus Styles (Apple-style) ========== */
.today-focus-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
}

.today-focus-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.today-focus-item:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .today-focus-item:hover {
    background: rgba(0, 0, 0, 0.04);
  }
}

.today-focus-item.due {
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.08) 0%, rgba(255, 204, 0, 0.08) 100%);
}

.today-focus-item.due .today-focus-item-icon {
  color: #ff9500;
}

.today-focus-item.mistakes {
  background: linear-gradient(135deg, rgba(88, 86, 214, 0.08) 0%, rgba(94, 92, 230, 0.08) 100%);
}

.today-focus-item.mistakes .today-focus-item-icon {
  color: #5856d6;
}

.today-focus-item.progress {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.08) 0%, rgba(10, 132, 255, 0.08) 100%);
}

.today-focus-item.progress .today-focus-item-icon {
  color: #007aff;
}

.today-focus-item.empty {
  background: linear-gradient(135deg, rgba(52, 199, 89, 0.08) 0%, rgba(48, 209, 88, 0.08) 100%);
  cursor: default;
}

.today-focus-item.empty .today-focus-item-icon {
  color: #34c759;
}

.today-focus-item.empty:active {
  transform: none;
}

.today-focus-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.today-focus-item-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.today-focus-item-text {
  flex: 1;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.today-focus-item-arrow {
  color: var(--secondary);
  opacity: 0.5;
  display: flex;
  align-items: center;
}

/* Dark mode adjustments for Today's Focus */
@media (prefers-color-scheme: dark) {
  .today-focus-item {
    background: rgba(255, 255, 255, 0.06);
  }
  
  @media (hover: hover) {
    .today-focus-item:hover {
      background: rgba(255, 255, 255, 0.1);
    }
  }
  
  .today-focus-item.due {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.15) 0%, rgba(255, 204, 0, 0.1) 100%);
  }
  
  .today-focus-item.mistakes {
    background: linear-gradient(135deg, rgba(255, 69, 58, 0.15) 0%, rgba(255, 69, 58, 0.1) 100%);
  }
  
  .today-focus-item.progress {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.15) 0%, rgba(10, 132, 255, 0.1) 100%);
  }
  
  .today-focus-item.empty {
    background: linear-gradient(135deg, rgba(48, 209, 88, 0.15) 0%, rgba(48, 209, 88, 0.1) 100%);
  }
}

/* SRS Review Header Badge */
.review-header-btn #review-header-count {
  transition: background 0.3s ease;
}

/* ===== AI Coach Card (Adaptive Learning) ===== */
.ai-coach-card {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(118, 75, 162, 0.06) 100%);
  border: none;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 0 16px 12px;
  box-shadow: 
    0 0.5px 0 0 rgba(102, 126, 234, 0.1),
    0 1px 3px 0 rgba(102, 126, 234, 0.06),
    0 4px 8px 0 rgba(102, 126, 234, 0.04);
}

.ai-coach-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #667eea;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.ai-coach-header svg {
  flex-shrink: 0;
}

.ai-coach-refresh {
  margin-left: auto;
  background: none;
  border: none;
  color: #667eea;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.3s;
}

.ai-coach-refresh:hover {
  opacity: 1;
}

.ai-coach-refresh.spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ai-coach-focus {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.ai-coach-reason {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ai-coach-expand {
  font-size: 12px;
  color: #667eea;
  cursor: pointer;
  margin-top: 10px;
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
}

.ai-coach-expand:hover {
  background: rgba(102, 126, 234, 0.1);
}

.ai-coach-expand.expanded {
  margin-bottom: 12px;
}

.ai-coach-details {
  padding-top: 12px;
  border-top: 1px solid rgba(102, 126, 234, 0.15);
}

.ai-coach-celebrate {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 165, 0, 0.15) 100%);
  border: 1px solid rgba(255, 165, 0, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #b8860b;
  font-weight: 500;
}

.ai-coach-skills {
  margin-bottom: 12px;
}

.skill-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.skill-bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease-out;
}

.skill-bar-fill.receptive {
  background: linear-gradient(90deg, #34C759, #30D158);
}

.skill-bar-fill.productive {
  background: linear-gradient(90deg, #667eea, #764ba2);
}

.ai-coach-insight {
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.6);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.ai-coach-units {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-coach-unit-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.ai-coach-unit-tag.recommended {
  background: rgba(102, 126, 234, 0.15);
  color: #667eea;
}

.ai-coach-unit-tag.review {
  background: rgba(255, 149, 0, 0.15);
  color: #FF9500;
}

.ai-coach-encouragement {
  font-size: 13px;
  color: var(--text);
  font-style: italic;
  text-align: center;
  padding: 8px;
  background: rgba(52, 199, 89, 0.1);
  border-radius: 10px;
}

/* Unit grid recommended highlight */
.unit-btn.ai-recommended {
  position: relative;
}

.unit-btn.ai-recommended::after {
  content: '★';
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 10px;
  color: #667eea;
}

.unit-btn.ai-review::after {
  content: '↻';
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 10px;
  color: #FF9500;
}

/* AI Coach Onboarding Questionnaire */
.ai-coach-onboarding {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.onboarding-question label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.onboarding-question select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.onboarding-question select:focus-visible {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.coach-roadmap {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
}

.roadmap-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 10px;
}

.roadmap-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.roadmap-weekly {
  background: white;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.weekly-label {
  font-size: 11px;
  font-weight: 600;
  color: #667eea;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.weekly-focus {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.roadmap-milestone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.milestone-icon {
  font-size: 14px;
}

.btn-start-journey {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-start-journey:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Target Level Selection Buttons */
.target-level-btns {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.target-level-btn {
  flex: 1;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: white;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.target-level-btn:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

.target-level-btn.active {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Roadmap target badge */
.roadmap-target {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.target-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
}

/* Coach Name Input */
.coach-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: white;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.coach-input:focus-visible {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.coach-input::placeholder {
  color: var(--text-secondary);
}

/* Roadmap Icons */
.roadmap-icon {
  stroke: #667eea;
}

.milestone-svg {
  stroke: #667eea;
  flex-shrink: 0;
}

/* ===== Study Habit Tracker ===== */
.habit-tracker {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin: 0 16px 12px;
  /* iOS 17+ style subtle shadow */
  box-shadow: 
    0 0.5px 0 0 rgba(0,0,0,0.04),
    0 1px 3px 0 rgba(0,0,0,0.04),
    0 4px 8px 0 rgba(0,0,0,0.04);
  border: 0.5px solid rgba(0,0,0,0.04);
}

.habit-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.habit-icon {
  stroke: var(--primary);
}

.habit-header span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ===== Pass Probability Section ===== */
.pass-probability {
  margin-top: 14px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border-radius: 12px;
}

.pass-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pass-header svg {
  stroke: var(--primary);
}

.pass-header span:first-of-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.pass-pct {
  margin-left: auto;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.pass-bar {
  height: 8px;
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}

.pass-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease, background 0.3s;
}

.pass-bar-fill.high { background: linear-gradient(90deg, #34C759, #30D158); }
.pass-bar-fill.medium { background: linear-gradient(90deg, #FF9500, #FFCC00); }
.pass-bar-fill.low { background: linear-gradient(90deg, #FF3B30, #FF6B6B); }

.pass-threshold {
  position: absolute;
  left: 60%;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--text);
  opacity: 0.3;
}

.pass-sections {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.pass-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 6px 10px;
  background: white;
  border-radius: 6px;
}

.pass-section-name {
  color: var(--text-secondary);
}

.pass-section-pct {
  font-weight: 600;
}

.pass-section-pct.high { color: #34C759; }
.pass-section-pct.medium { color: #FF9500; }
.pass-section-pct.low { color: #FF3B30; }

.pass-recommendation {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.05);
}

/* ===== SRS Review Section ===== */
.srs-review-prompt {
  margin-top: 14px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.1) 0%, rgba(255, 204, 0, 0.1) 100%);
  border-radius: 12px;
}

.srs-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.srs-header svg {
  stroke: #FF9500;
}

.srs-header span:first-of-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.srs-count {
  margin-left: auto;
  background: #FF9500;
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.srs-breakdown {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 11px;
}

.srs-level {
  display: flex;
  align-items: center;
  gap: 4px;
}

.srs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.srs-dot.urgent { background: #FF3B30; }
.srs-dot.soon { background: #FF9500; }
.srs-dot.later { background: #34C759; }

.srs-start-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(135deg, #FF9500 0%, #FF6B00 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.srs-start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
}

.srs-start-btn svg {
  stroke: white;
}

/* ========== MOBILE COMPACT - FIT SINGLE SCREEN ========== */
@media screen and (max-height: 700px) {
  .dashboard-fixed { padding: 6px 12px !important; }
  .dashboard-fixed .header { padding: 2px 0 4px; }
  .dashboard-fixed .header .logo-img { height: 80px !important; }
  .dashboard-fixed .nav-bar { margin-bottom: 6px; }
  .nav-btn { padding: 6px 4px; font-size: 10px; }
  .dash-level-row { margin-bottom: 6px; padding: 3px; }
  .level-select-btn { padding: 6px 2px; font-size: 12px; }
  .ai-coach-card { padding: 8px 10px; margin-bottom: 6px; }
  .ai-coach-header { font-size: 11px; margin-bottom: 4px; }
  .today-focus-content { gap: 4px; margin: 6px 0; }
  .today-focus-item { padding: 8px 10px; font-size: 13px; }
  .today-focus-item-icon { width: 24px; height: 24px; }
  .today-focus-item-icon svg { width: 16px; height: 16px; }
  .dash-unit-section { padding: 8px; }
  .category-row { gap: 6px; }
  .category-btn { padding: 8px 6px; gap: 2px; }
  .category-icon { font-size: 18px; }
  .category-name { font-size: 11px; }
}

@media screen and (max-height: 600px) {
  .dashboard-fixed .header .logo-img { height: 60px !important; }
  .nav-btn { padding: 5px 3px; }
  .nav-icon { font-size: 14px; }
  .ai-nav-icon { width: 14px; height: 14px; }
  .dash-level-row { padding: 2px; }
  .level-select-btn { padding: 5px 2px; font-size: 11px; }
  .ai-coach-card { padding: 6px 8px; }
  .today-focus-content { gap: 3px; margin: 4px 0; }
  .today-focus-item { padding: 6px 8px; font-size: 12px; gap: 8px; }
  .today-focus-item-icon { width: 20px; height: 20px; }
  .today-focus-item-icon svg { width: 14px; height: 14px; }
  .category-btn { padding: 6px 4px; }
  .category-icon { font-size: 16px; }
  .category-name { font-size: 10px; }
}

/* ========== AUTH MODAL ========== */
#authModal .modal-box {
  padding: 24px;
}

.auth-form-group {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-google:hover {
  background: var(--bg);
  border-color: var(--text-tertiary);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  padding: 0 12px;
}

.auth-checkbox-group {
  margin-bottom: 20px;
}

.auth-checkbox-group label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  cursor: pointer;
}

.auth-checkbox-group input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.auth-checkbox-group a {
  color: var(--primary);
  text-decoration: underline;
}

.auth-links {
  margin-top: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-links a {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.auth-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ========== PLAN SELECTION ========== */
.billing-toggle {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.billing-toggle.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.plan-select-card {
  position: relative;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.plan-select-card:hover {
  border-color: var(--primary);
  background: rgba(102, 126, 234, 0.03);
}

.plan-select-card.featured {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(102,126,234,0.05), rgba(118,75,162,0.05));
}

.plan-select-card.featured:hover {
  background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
}

/* Auth Plan Selection */
.auth-plan-section {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

.auth-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.auth-billing-toggle {
  display: flex;
  gap: 4px;
  background: var(--card);
  padding: 3px;
  border-radius: 8px;
}

.auth-billing-btn {
  padding: 4px 10px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-billing-btn.active {
  background: var(--primary);
  color: white;
}

.auth-plan-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-plan-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.auth-plan-option:hover {
  border-color: var(--border);
}

.auth-plan-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(102, 126, 234, 0.05);
}

.auth-plan-option.recommended {
  border-color: rgba(102, 126, 234, 0.3);
}

.auth-plan-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.auth-plan-badge {
  position: absolute;
  top: -8px;
  right: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
}

.auth-plan-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-plan-name {
  font-weight: 600;
  font-size: 13px;
}

.auth-plan-desc {
  font-size: 11px;
  color: var(--text-tertiary);
}

.auth-plan-price {
  text-align: right;
  font-weight: 600;
  font-size: 13px;
  color: var(--primary);
}

.auth-plan-price small {
  font-weight: 400;
  font-size: 10px;
  color: var(--text-tertiary);
}

/* Referral Banner on Dashboard */
.referral-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  margin-top: 8px;
}
.referral-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
.referral-banner:active {
  transform: scale(0.98);
}
.referral-banner-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.referral-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.referral-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.referral-banner-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}
.referral-banner-arrow {
  font-size: 18px;
  color: white;
  opacity: 0.8;
  flex-shrink: 0;
}

/* ===== SIMPLE DASHBOARD (案A) ===== */
.dashboard-simple {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.dashboard-simple .header {
  padding: 8px 0 12px;
  flex-shrink: 0;
}
.simple-dashboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 20px;
}

/* Progress Summary Card */
.progress-summary-card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.progress-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.progress-level {
  font-size: 18px;
  font-weight: 700;
  color: var(--level-color, var(--primary));
}
.progress-percent {
  font-size: 24px;
  font-weight: 800;
  color: var(--level-color, var(--primary));
}
.progress-bar-container {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--level-color, var(--primary));
  border-radius: 4px;
  transition: width 0.5s var(--ease-out-expo);
}
.progress-stats {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Habit Tracker Compact */
.habit-tracker-compact {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.habit-week-compact {
  display: flex;
  gap: 6px;
}
.habit-week-compact .habit-day {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-tertiary);
}
.habit-week-compact .habit-day.active {
  background: var(--success);
  color: white;
}
.habit-week-compact .habit-day.today {
  border: 2px solid var(--primary);
}
.habit-streak-compact {
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Category Cards (Main Actions) */
.category-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: none;
  border-radius: 16px;
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  text-align: left;
}
.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.category-card:active {
  transform: scale(0.98);
}
.category-card-icon {
  width: 48px;
  height: 48px;
  background: var(--level-light, var(--primary-light));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--level-color, var(--primary));
  flex-shrink: 0;
}
.category-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.category-card-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}
.category-card-progress {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
.category-card-arrow {
  font-size: 24px;
  color: var(--text-tertiary);
  font-weight: 300;
}

/* Secondary Actions (Mock Test, AI Tutor) */
.secondary-actions {
  display: flex;
  gap: 10px;
}
.action-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: none;
  border-radius: 16px;
  padding: 16px 12px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  text-align: center;
}
.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.action-card:active {
  transform: scale(0.98);
}
.action-card-icon {
  font-size: 32px;
}
.action-card-icon.ai-glow {
  animation: pulse 2s ease-in-out infinite;
}
.action-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.action-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.action-card-desc {
  font-size: 12px;
  color: var(--text-tertiary);
}
.action-card-arrow {
  display: none;
}

/* Referral Banner (Updated) */
.referral-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  margin-top: auto;
}
.referral-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
.referral-banner:active {
  transform: scale(0.98);
}
.referral-banner-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.referral-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.referral-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: white;
}
.referral-banner-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}
.referral-banner-arrow {
  font-size: 18px;
  color: white;
  opacity: 0.8;
  flex-shrink: 0;
}

/* ===== AI Greeting & Recommendation ===== */
.ai-greeting {
  padding: 4px 0 12px;
  text-align: left;
}
.ai-greeting-text {
  display: block;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}
.ai-greeting-sub {
  display: block;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* AI Recommendation Card */
.ai-recommend-card {
  background: linear-gradient(135deg, var(--level-light) 0%, white 100%);
  border: 1px solid var(--level-color);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}
.ai-recommend-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--level-color);
}
.ai-recommend-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-recommend-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--level-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ai-recommend-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-recommend-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.ai-recommend-meta {
  font-size: 13px;
  color: var(--text-secondary);
}
.ai-recommend-btn {
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--level-color);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-expo);
}
.ai-recommend-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.ai-recommend-btn:active {
  transform: scale(0.98);
}

/* Progress Message (Encouraging) */
.progress-message {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 8px;
}

/* AI Tutor Icon (pulsing globe) */
.ai-tutor-icon {
  color: var(--primary);
}
.ai-tutor-icon svg {
  animation: pulse-soft 3s ease-in-out infinite;
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Updated Habit Streak (no emoji) */
.habit-streak-compact span::before {
  content: none;
}

/* ===== 90-POINT DASHBOARD DESIGN ===== */
.dashboard-90 {
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  padding-bottom: 80px; /* Footer space */
}

/* Header 90 */
.header-90 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  flex-shrink: 0;
}
.logo-90 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.header-right-90 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-btn-90 {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}
.header-btn-90:hover {
  background: var(--bg);
}

/* Streak Badge - HIG compliant, minimal */
.streak-badge {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  background: rgba(255, 149, 0, 0.12);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #FF9500;
}
.streak-badge.hidden {
  display: none;
}
.streak-fire {
  font-size: 12px;
  animation: fireFlicker 2s ease-in-out infinite;
}
@keyframes fireFlicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(-3deg); }
  50% { transform: scale(1) rotate(0deg); }
  75% { transform: scale(1.1) rotate(3deg); }
}
.streak-count {
  min-width: 14px;
  text-align: center;
}
/* Hide streak badge when streak is 0 */
.streak-badge[data-streak="0"] {
  display: none;
}

/* ===== Streak Progress Card ===== */
.streak-progress-card {
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.08) 0%, rgba(255, 200, 100, 0.08) 100%);
  border: 1px solid rgba(255, 149, 0, 0.15);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.streak-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.streak-progress-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.streak-progress-title .streak-fire-lg {
  font-size: 20px;
  animation: fireFlicker 2s ease-in-out infinite;
}
.streak-progress-days {
  font-size: 14px;
  color: #FF9500;
  font-weight: 600;
}
.streak-progress-bar-wrap {
  background: rgba(255, 149, 0, 0.15);
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.streak-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF9500 0%, #FFD700 100%);
  border-radius: 8px;
  transition: width 0.5s ease;
}
.streak-progress-hint {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}
.streak-progress-hint strong {
  color: #FF9500;
}
.streak-progress-card.hidden {
  display: none;
}

/* Lang Selector Mini */
.lang-selector-mini {
  background: var(--bg);
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
}

/* Level Selector Row (inside content) */
.level-selector-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 8px 0;
}
.level-pill {
  background: var(--bg);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}
.level-pill.active {
  background: var(--level-color, var(--primary));
  color: white;
  box-shadow: 0 2px 8px var(--level-shadow, rgba(102, 126, 234, 0.35));
}
.level-pill:hover:not(.active) {
  background: var(--border);
}

/* Ticket Badge Mini (for header) */
.ticket-badge-mini {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #B8860B;
  cursor: pointer;
  transition: background 0.2s;
}
.ticket-badge-mini:hover {
  background: rgba(255, 215, 0, 0.25);
}
.ticket-count-mini {
  min-width: 14px;
  text-align: center;
}

/* Main Content 90 */
.main-content-90 {
  flex: 1;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0; /* Important for flex children to shrink */
}

/* AI Hero Card (Primary CTA) */
/* Sakura Speak Button (shared) */
.sakura-speak-btn {
  background: rgba(118, 75, 167, 0.15);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.sakura-speak-btn svg {
  width: 18px;
  height: 18px;
  fill: var(--accent);
}
.sakura-speak-btn:hover {
  background: rgba(118, 75, 167, 0.25);
  transform: scale(1.05);
}
.sakura-speak-btn:active {
  transform: scale(0.95);
}
.sakura-speak-btn.playing {
  animation: speakPulse 0.5s ease-in-out infinite;
}
@keyframes speakPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* AI Recommend Meta */
.ai-recommend-meta {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}
.ai-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--level-color, var(--primary));
  color: white;
  border: none;
  border-radius: 14px;
  padding: 16px 48px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px var(--level-shadow, rgba(102, 126, 234, 0.35));
}
.ai-start-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px var(--level-shadow, rgba(102, 126, 234, 0.4));
}
.ai-start-btn:active {
  transform: scale(0.98);
}

/* Progress Row (Subtle) */
.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--card);
  border-radius: 14px;
}
.progress-level-90 {
  font-size: 15px;
  font-weight: 600;
  color: var(--level-color, var(--primary));
  min-width: 28px;
}
.progress-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill-90 {
  height: 100%;
  background: var(--level-color, var(--primary));
  border-radius: 3px;
  transition: width 0.5s var(--ease-out-expo);
}
.progress-percent-90 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: right;
}

/* Category Links (Text, subtle) */
.category-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 8px 0;
}
.category-link {
  font-size: 15px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.category-link:hover {
  color: var(--level-color, var(--primary));
  border-bottom-color: var(--level-color, var(--primary));
}
.category-link-pct {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* Habit Row (Compact) */
.habit-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  color: var(--text-tertiary);
  font-size: 13px;
}
.habit-days {
  display: flex;
  gap: 4px;
}
.habit-day {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.habit-day.active {
  background: var(--level-color, var(--primary));
  color: white;
}
.habit-day.today {
  border: 2px solid var(--level-color, var(--primary));
}
.habit-streak-text {
  font-weight: 500;
}

/* Footer Navigation */
.footer-nav-90 {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 max(20px, env(safe-area-inset-bottom));
  z-index: 100;
}
.footer-btn-90 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: color 0.2s;
}
.footer-btn-90 svg {
  width: 24px;
  height: 24px;
}
.footer-btn-90.active {
  color: var(--level-color, var(--primary));
}
.footer-btn-90:hover:not(.active) {
  color: var(--text-secondary);
}

/* Language Swiper - Simple Style */
/* Feedback Link Row */
.feedback-link-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  margin: 8px 16px 16px;
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(102, 126, 234, 0.15);
}
.feedback-link-row:hover {
  background: linear-gradient(135deg, #667eea25 0%, #764ba225 100%);
}
.feedback-link-icon {
  font-size: 16px;
}
.feedback-link-text {
  font-size: 13px;
  font-weight: 500;
  color: #667eea;
}
.feedback-ticket-badge {
  background: linear-gradient(135deg, #667eea, #764ba7);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  animation: ticketPulseMini 2s infinite;
}
@keyframes ticketPulseMini {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Feedback Modal */
.feedback-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}
.feedback-modal.hidden {
  display: none;
}
.feedback-modal-box {
  background: #fff;
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.feedback-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 0;
}
.feedback-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
}
.feedback-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}
.feedback-modal-desc {
  font-size: 13px;
  color: #666;
  padding: 8px 20px 16px;
}
#feedbackForm {
  padding: 0 20px 20px;
}
.feedback-form-group {
  margin-bottom: 16px;
}
.feedback-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}
.feedback-stars {
  display: flex;
  gap: 8px;
  font-size: 32px;
}
.feedback-star {
  color: #ddd;
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}
.feedback-star:hover,
.feedback-star.active {
  color: #ffc107;
  transform: scale(1.1);
}
.feedback-form-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.feedback-form-textarea:focus-visible {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.feedback-form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.feedback-form-input:focus-visible {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.feedback-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
}
.feedback-checkbox-label input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
}
.feedback-submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.feedback-submit-btn:hover {
  opacity: 0.9;
}
.feedback-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== LEVEL DETAIL MODAL ===== */
.level-detail-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.level-detail-modal.active {
  opacity: 1;
}
.level-detail-content {
  background: var(--bg-card);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.level-detail-modal.active .level-detail-content {
  transform: translateY(0);
}
.level-detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.level-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.level-tag-large {
  font-size: 24px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 12px;
  color: white;
}
.level-tag-large.n5 { background: #34c759; }
.level-tag-large.n4 { background: #007aff; }
.level-tag-large.n3 { background: #af52de; }
.level-tag-large.n2 { background: #1e3a5f; }
.level-tag-large.n1 { background: #ff3b30; }
.level-detail-title-area h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.level-official-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.level-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.level-stat {
  background: var(--bg);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
}
.level-stat-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--level-color);
}
.level-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.level-detail-section {
  margin-bottom: 20px;
}
.level-detail-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.level-detail-section p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.cando-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cando-list li {
  font-size: 13px;
  color: var(--text);
  padding: 8px 0 8px 24px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.cando-list li:last-child {
  border-bottom: none;
}
.cando-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--level-color);
  font-weight: 600;
}
.level-content-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.level-content-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}
.content-count {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--level-color);
}
.content-label {
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.level-detail-start-btn {
  width: 100%;
  padding: 16px;
  background: var(--level-color);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.level-detail-start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.level-detail-start-btn:active {
  transform: translateY(0);
}

/* ===== UNIT PREVIEW MODAL ===== */
.unit-preview-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.unit-preview-modal.active {
  opacity: 1;
}
.unit-preview-content {
  background: var(--bg-card);
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.unit-preview-modal.active .unit-preview-content {
  transform: translateY(0);
}
.unit-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.unit-preview-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.unit-number {
  font-size: 24px;
  font-weight: 700;
  color: white;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.unit-preview-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.unit-progress-text {
  font-size: 13px;
  color: var(--text-secondary);
}
.unit-preview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.unit-stat {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.unit-stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--level-color);
}
.unit-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.unit-preview-samples {
  margin-bottom: 20px;
}
.unit-preview-samples h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.sample-category {
  margin-bottom: 12px;
}
.sample-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.sample-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sample-item {
  background: var(--bg);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
}
.sample-item.kanji {
  font-size: 20px;
  padding: 8px 16px;
}
.sample-item.grammar {
  font-size: 13px;
  color: var(--level-color);
}
.unit-preview-start-btn {
  width: 100%;
  padding: 14px;
  background: var(--level-color);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.unit-preview-start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.unit-preview-start-btn:active {
  transform: translateY(0);
}

/* ========== TALK SCREEN ========== */
.talk-welcome {
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Talk Level Badge Row */
.talk-level-badge-row {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}
.talk-level-badge {
  background: var(--level-color, var(--primary));
  color: white;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--level-shadow, rgba(102, 126, 234, 0.35));
}

/* Sakura Card (shared style) */
.sakura-card {
  background: linear-gradient(135deg, rgba(118, 75, 167, 0.08) 0%, rgba(102, 126, 234, 0.08) 100%);
  border: 1px solid rgba(118, 75, 167, 0.15);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
}
.sakura-card-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.sakura-card-message {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.sakura-card-sub {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Home Sakura Card specific */
.home-sakura-card {
  text-align: left;
  padding: 24px;
}
.home-sakura-card .sakura-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.home-sakura-card .sakura-card-icon {
  font-size: 24px;
  margin-bottom: 0;
}
.home-sakura-card .sakura-card-label {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.home-sakura-card .sakura-speak-btn {
  background: rgba(118, 75, 167, 0.15);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.home-sakura-card .sakura-speak-btn:hover {
  background: rgba(118, 75, 167, 0.25);
}
.home-sakura-card .sakura-speak-btn svg {
  fill: var(--accent);
}
.home-sakura-card .sakura-card-message {
  font-size: 20px;
  margin-bottom: 12px;
  text-align: left;
}
.sakura-card-recommend {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.sakura-card-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.home-sakura-card .ai-start-btn {
  width: 100%;
}

/* Talk Sakura Card specific */
.talk-sakura-card {
  margin-bottom: 4px;
}

/* Unit-linked Mode Card */
.talk-unit-card {
  width: 100%;
  background: linear-gradient(135deg, var(--level-color, #667eea) 0%, color-mix(in srgb, var(--level-color, #667eea) 80%, #000) 100%);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.talk-unit-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.talk-unit-icon svg { fill: white; }
.talk-unit-info {
  flex: 1;
}
.talk-unit-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
}
.talk-unit-info p {
  font-size: 13px;
  opacity: 0.9;
  margin: 0;
}
.talk-unit-btn {
  background: white;
  color: var(--level-color, #667eea);
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.talk-unit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.talk-unit-btn svg { fill: var(--level-color, #667eea); }

/* Evaluation Mode Toggle */
.talk-evaluation-toggle {
  width: 100%;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.evaluation-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1a1a2e;
  font-size: 14px;
  font-weight: 500;
}
.evaluation-toggle-label svg {
  fill: #667eea;
}
.evaluation-toggle-switch {
  display: flex;
  background: #e5e5ea;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
}
.evaluation-toggle-switch .toggle-on,
.evaluation-toggle-switch .toggle-off {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s;
  border: none;
}
/* Default state: both grey */
.evaluation-toggle-switch .toggle-on {
  background: transparent;
  color: #aaa;
}
.evaluation-toggle-switch .toggle-off {
  background: transparent;
  color: #aaa;
}
/* Active = ON is highlighted green */
.evaluation-toggle-switch.active .toggle-on {
  background: #4CAF50;
  color: white;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}
.evaluation-toggle-switch.active .toggle-off {
  background: transparent;
  color: #aaa;
}
/* Inactive = OFF is highlighted red */
.evaluation-toggle-switch:not(.active) .toggle-off {
  background: #ff6b6b;
  color: white;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
}
.evaluation-toggle-switch:not(.active) .toggle-on {
  background: transparent;
  color: #aaa;
}

/* Feedback Banner */
.feedback-banner {
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba7 100%);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  color: white;
}
.feedback-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}
.feedback-banner-icon {
  font-size: 20px;
}
.feedback-banner-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}
.feedback-banner-reward {
  background: rgba(255,255,255,0.25);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  animation: rewardPulse 2s infinite;
}
@keyframes rewardPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.feedback-banner.hidden {
  display: none;
}

/* Free Theme Section */
.talk-theme-section {
  width: 100%;
  margin-top: 8px;
}
.talk-theme-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.talk-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.talk-theme-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.talk-theme-card:hover {
  background: var(--primary-light, #e8f4fc);
  border-color: var(--level-color, var(--primary));
  transform: translateY(-2px);
}
.talk-theme-card svg {
  fill: var(--level-color, var(--primary));
}
.talk-theme-card span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
}

/* API Setup */
.talk-api-setup {
  width: 100%;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.talk-api-icon svg { fill: #856404; }
.talk-api-setup p {
  font-size: 14px;
  color: #856404;
  margin: 0;
}
.talk-api-btn {
  background: #ffc107;
  color: #856404;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* Talk Level Display (read-only) */
.talk-level-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 14px;
}
.talk-level-label {
  color: var(--text-secondary);
}
.talk-level-badge {
  background: var(--level-color, var(--primary));
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
}

/* Chat Screen */
.talk-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 320px);
  height: calc(100dvh - 320px); /* Dynamic viewport for mobile: header(130) + lang(40) + level(40) + footer(70) + padding */
  min-height: 250px;
  max-height: calc(100dvh - 280px);
  position: relative;
}
.talk-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.talk-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.talk-back-btn svg { fill: var(--text); }
.talk-chat-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.talk-chat-level {
  background: var(--level-color, var(--primary));
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* Messages */
.talk-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
  min-height: 0; /* Important for flex scroll */
}
.talk-message {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: talkFadeIn 0.3s ease;
}
@keyframes talkFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.talk-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.talk-message.ai {
  align-self: flex-start;
}
.talk-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.talk-message.ai .talk-avatar {
  background: transparent;
  position: relative;
}

/* Sakura Petals Animation */
.sakura-avatar {
  width: 40px;
  height: 40px;
  position: relative;
  overflow: visible;
  transition: transform 0.3s ease;
}
.sakura-avatar svg {
  width: 100%;
  height: 100%;
}
.sakura-flower {
  filter: drop-shadow(0 2px 4px rgba(255, 183, 197, 0.4));
}
.sakura-petals {
  transform-origin: 20px 20px;
}

/* Sakura emotion states - Happy spins! */
.sakura-avatar.sakura-happy {
  animation: sakuraHappySpin 2s ease-in-out infinite;
}
.sakura-avatar.sakura-very-happy {
  animation: sakuraVeryHappySpin 1.2s ease-in-out infinite;
}
.sakura-avatar.sakura-sad {
  animation: sakuraSadPulse 2.5s ease-in-out infinite;
  opacity: 0.7;
}
.sakura-avatar.sakura-lonely {
  animation: sakuraLonelyPulse 3s ease-in-out infinite;
  opacity: 0.6;
}
/* Happy - gentle spin with pulse */
@keyframes sakuraHappySpin {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(90deg); }
  50% { transform: scale(1.15) rotate(180deg); }
  75% { transform: scale(1.1) rotate(270deg); }
  100% { transform: scale(1) rotate(360deg); }
}
/* Very Happy - faster spin with bigger pulse */
@keyframes sakuraVeryHappySpin {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.2) rotate(90deg); }
  50% { transform: scale(1.25) rotate(180deg); }
  75% { transform: scale(1.2) rotate(270deg); }
  100% { transform: scale(1) rotate(360deg); }
}
@keyframes sakuraSadPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.92); }
}
@keyframes sakuraLonelyPulse {
  0%, 100% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(0.88); opacity: 0.7; }
}

.sakura-petal {
  fill: #ffb7c5;
  opacity: 0.95;
  transform-origin: 20px 20px;
  transition: fill 0.3s ease;
}
/* Happy state - brighter petals */
.sakura-avatar.sakura-happy .sakura-petal,
.sakura-avatar.sakura-very-happy .sakura-petal {
  fill: #ff9eb5;
  opacity: 1;
}
/* Sad/Lonely state - muted petals */
.sakura-avatar.sakura-sad .sakura-petal,
.sakura-avatar.sakura-lonely .sakura-petal {
  fill: #d4a5ae;
  opacity: 0.6;
}
.sakura-center {
  transition: fill 0.3s ease;
}
/* Gentle breathing animation for idle state */
.sakura-avatar:not(.sakura-happy):not(.sakura-very-happy):not(.sakura-sad):not(.sakura-lonely) {
  animation: sakuraBreathing 3s ease-in-out infinite;
}
@keyframes sakuraBreathing {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Legacy ai-orb support - redirect to sakura */
.talk-message.ai .talk-avatar .ai-orb {
  width: 36px;
  height: 36px;
  position: relative;
  display: none; /* Hide old orb */
}
.talk-message.ai .talk-avatar .ai-orb-core,
.talk-message.ai .talk-avatar .ai-orb-ring,
.talk-message.ai .talk-avatar .ai-orb-ring2,
.talk-message.ai .talk-avatar .ai-orb-glow {
  display: none;
}

@keyframes orbPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.15); }
}
@keyframes orbRing {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.3; }
}
@keyframes orbGlow {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}
.talk-message.ai .talk-avatar svg { fill: white; }
.talk-message.user .talk-avatar {
  background: var(--level-color, var(--primary));
  color: white;
  font-size: 13px;
  font-weight: 600;
}
.talk-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.5;
}
.talk-message.ai .talk-bubble {
  background: var(--bg);
  border-bottom-left-radius: 4px;
}
.talk-message.user .talk-bubble {
  background: var(--level-color, var(--primary));
  color: white;
  border-bottom-right-radius: 4px;
}
.talk-bubble-ja {
  font-size: 15px;
  margin-bottom: 4px;
}
.talk-bubble-en,
.talk-bubble-translation {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.talk-message.user .talk-bubble-en,
.talk-message.user .talk-bubble-translation {
  color: rgba(255,255,255,0.8);
  border-top-color: rgba(255,255,255,0.2);
}
.talk-speak-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 220, 230, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 4px;
  transition: all 0.2s;
}
.talk-speak-btn:hover {
  background: rgba(255, 183, 197, 0.8);
}
.talk-speak-btn:hover svg { fill: white; }
.talk-speak-btn svg { fill: #FFB7C5; width: 16px; height: 16px; transition: fill 0.2s; }

/* Playing state - blue color */
.talk-speak-btn.playing {
  background: #4285f4;
  animation: pulse-speaker 1.5s ease-in-out infinite;
}
.talk-speak-btn.playing svg { fill: white; }

@keyframes pulse-speaker {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

/* Typing Indicator */
.talk-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}
.talk-typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: talkTypingBounce 1.4s infinite;
}
.talk-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.talk-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes talkTypingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

/* Suggestions */
.talk-suggestions {
  padding: 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.talk-suggestions:empty {
  display: none;
  padding: 0;
  border: none;
}
.talk-suggestion {
  padding: 10px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.talk-suggestion:hover {
  background: var(--primary-light, #e8f4fc);
  border-color: var(--level-color, var(--primary));
}
.talk-suggestion .jp {
  font-weight: 500;
}
.talk-suggestion .en {
  color: var(--text-secondary);
  font-size: 12px;
  margin-left: 6px;
}

/* Input Area - Fixed at bottom */
.talk-input-area {
  padding: 12px 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  align-items: flex-end;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.talk-voice-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.talk-voice-btn:hover {
  background: var(--level-color, var(--primary));
  border-color: var(--level-color, var(--primary));
}
.talk-voice-btn:hover svg { fill: white; }
.talk-voice-btn svg { fill: var(--text-secondary); }
.talk-voice-btn.recording {
  background: #ff3b30;
  border-color: #ff3b30;
  animation: talkPulse 1s infinite;
}
.talk-voice-btn.recording svg { fill: white; }
@keyframes talkPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
}
.talk-input-wrapper {
  flex: 1;
  position: relative;
}
.talk-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  background: var(--card);
}
.talk-input:focus-visible {
  outline: none;
  border-color: var(--level-color, var(--primary));
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.talk-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--level-color, var(--primary));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.talk-send-btn:disabled {
  background: var(--border);
  cursor: not-allowed;
}
.talk-send-btn:not(:disabled):hover {
  transform: scale(1.05);
}
.talk-send-btn svg { fill: white; }

/* Feedback Panel */
.talk-feedback {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 8px;
  animation: talkFadeIn 0.3s ease;
}
.talk-feedback-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #2e7d32;
  margin-bottom: 6px;
}
.talk-feedback-content {
  font-size: 14px;
  color: #1b5e20;
  line-height: 1.5;
}

/* ========== PRONUNCIATION EVALUATION ========== */
.pronunciation-score-card {
  background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
  border: 1px solid #e0e7ff;
  border-radius: 16px;
  padding: 16px;
  margin: 12px 0 12px 48px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
  animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.pronunciation-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #4f46e5;
  margin-bottom: 12px;
}

.pronunciation-header svg {
  flex-shrink: 0;
}

.pronunciation-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 18px;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.pronunciation-close:hover {
  background: #f3f4f6;
  color: #6b7280;
}

.pronunciation-overall {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.pronunciation-score-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid #34c759;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  flex-shrink: 0;
}

.pronunciation-score-number {
  font-size: 24px;
  font-weight: 700;
}

.pronunciation-stars {
  font-size: 20px;
  letter-spacing: 2px;
}

.pronunciation-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.pronunciation-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pronunciation-label {
  font-size: 12px;
  color: #6b7280;
  width: 80px;
  flex-shrink: 0;
}

.pronunciation-bar-container {
  flex: 1;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.pronunciation-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.pronunciation-value {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  width: 28px;
  text-align: right;
}

.pronunciation-highlights {
  background: #ecfdf5;
  color: #059669;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.pronunciation-feedback {
  background: #fef3c7;
  color: #92400e;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.pronunciation-word-analysis {
  background: #f0f9ff;
  color: #0369a1;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
  border-left: 3px solid #0ea5e9;
}

.pronunciation-practice {
  background: #faf5ff;
  color: #7c3aed;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
  font-weight: 500;
}

.pronunciation-listen-section {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
}

.pronunciation-listen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: #22c55e;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pronunciation-listen-btn:hover {
  background: #16a34a;
  transform: scale(1.02);
}

.pronunciation-listen-btn:active {
  transform: scale(0.98);
}

.pronunciation-listen-btn svg {
  flex-shrink: 0;
}

.pronunciation-listen-text {
  text-align: center;
  margin-top: 8px;
  font-size: 16px;
  color: #166534;
  font-weight: 500;
}

/* Grammar error display */
.pronunciation-grammar-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.grammar-error-header {
  font-weight: 600;
  color: #991b1b;
  margin-bottom: 8px;
  font-size: 13px;
}

.grammar-error-wrong {
  color: #dc2626;
  font-size: 14px;
  margin-bottom: 4px;
  text-decoration: line-through;
  opacity: 0.8;
}

.grammar-error-correct {
  color: #16a34a;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.grammar-error-explanation {
  color: #78716c;
  font-size: 12px;
  line-height: 1.4;
  padding-top: 6px;
  border-top: 1px solid #fecaca;
}

/* Main issue highlight */
.pronunciation-main-issue {
  background: #fff7ed;
  color: #c2410c;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
  border-left: 3px solid #f97316;
}

/* Vocabulary suggestion */
.pronunciation-vocab-suggestion {
  background: #f0fdf4;
  color: #166534;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Model sentence */
.pronunciation-model-sentence {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 2px solid #3b82f6;
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0;
  text-align: center;
}

.model-sentence-label {
  font-size: 12px;
  color: #3b82f6;
  font-weight: 600;
  margin-bottom: 6px;
}

.model-sentence-text {
  font-size: 18px;
  color: #1e40af;
  font-weight: 600;
  line-height: 1.5;
}

.pronunciation-next-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
}

.pronunciation-next-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.pronunciation-next-btn:active {
  transform: scale(0.98);
}

.pronunciation-next-btn svg {
  flex-shrink: 0;
}

.pronunciation-improvements {
  background: #f3f4f6;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.pronunciation-improvements-title {
  font-weight: 600;
  color: #374151;
  display: block;
  margin-bottom: 6px;
}

.pronunciation-improvements ul {
  margin: 0;
  padding-left: 20px;
  color: #4b5563;
}

.pronunciation-improvements li {
  margin-bottom: 4px;
  line-height: 1.4;
}

.pronunciation-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  margin: 8px 0 8px 48px;
  background: #f8f9ff;
  border-radius: 12px;
  font-size: 13px;
  color: #6366f1;
}

.pronunciation-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e0e7ff;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Pronunciation toggle button */
.pronunciation-toggle-btn {
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.pronunciation-toggle-btn:hover {
  background: #e5e7eb;
}

.pronunciation-toggle-btn.active {
  background: #ecfdf5;
  color: #059669;
}

.pronunciation-toggle-btn svg {
  width: 16px;
  height: 16px;
}

/* Evaluation Mode Toggle */
.evaluation-toggle-btn {
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s;
}

.evaluation-toggle-btn:hover {
  background: #e5e7eb;
}

.evaluation-toggle-btn.active {
  background: #eff6ff;
  color: #3b82f6;
}

.evaluation-toggle-btn svg {
  width: 20px;
  height: 20px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .pronunciation-score-card {
    margin-left: 8px;
    margin-right: 8px;
    padding: 12px;
  }
  
  .pronunciation-score-circle {
    width: 56px;
    height: 56px;
  }
  
  .pronunciation-score-number {
    font-size: 20px;
  }
  
  .pronunciation-stars {
    font-size: 16px;
  }
  
  .pronunciation-label {
    width: 60px;
    font-size: 11px;
  }
}

/* Feedback icon SVG replacement */
.feedback-icon-svg {
  fill: var(--text-secondary);
  vertical-align: middle;
  margin-right: 8px;
}

/* Talk API Key Input (inline) */
.talk-api-setup {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}
.talk-api-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.talk-api-header svg {
  fill: var(--text-secondary);
}
.talk-api-status {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 12px;
}
.talk-api-status.connected {
  background: #d1fae5;
  color: #065f46;
}
.talk-api-status.not-set {
  background: #fef3c7;
  color: #92400e;
}
.talk-api-input-row {
  display: flex;
  gap: 8px;
}
.talk-api-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: monospace;
  background: var(--bg);
}
.talk-api-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.talk-api-save-btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.talk-api-save-btn:hover {
  opacity: 0.9;
  transform: scale(1.02);
}
.talk-api-save-btn svg {
  fill: white;
}
.talk-api-save-btn.saved {
  background: #10b981;
}
.talk-api-hint {
  margin-top: 10px;
  font-size: 12px;
}
.talk-api-hint a {
  color: var(--primary);
  text-decoration: none;
}
.talk-api-hint a:hover {
  text-decoration: underline;
}

/* ========== COLLECTION SCREEN ========== */
.collection-header-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.collection-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.collection-count {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
}

/* Ticket Badge */
.ticket-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #333;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}
.ticket-badge svg {
  fill: #333;
}

/* Gacha Button */
.gacha-btn {
  width: 100%;
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
  color: white;
  border: none;
  padding: 16px 24px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
.gacha-btn:active {
  transform: scale(0.98);
}
.gacha-btn:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
}
.gacha-btn.no-tickets {
  background: linear-gradient(135deg, #999 0%, #bbb 100%);
  box-shadow: none;
}
.gacha-btn svg {
  fill: white;
}
.gacha-ticket-count {
  opacity: 0.9;
}

/* Collection Sets */
.collection-sets {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 100px;
}

/* Collection screen needs scrolling */
#screen-collection .main-content-90 {
  -webkit-overflow-scrolling: touch;
}
.collection-set-card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.collection-set-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.collection-set-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.collection-set-progress {
  font-size: 14px;
  color: var(--text-secondary);
}
.collection-set-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 12px;
  overflow: hidden;
}
.collection-set-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #667eea);
  border-radius: 3px;
  transition: width 0.3s;
}
.collection-set-reward {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}
.collection-sticker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.collection-sticker {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.collection-sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
.collection-sticker.locked {
  background: #e0e0e0;
  border: 2px dashed #ccc;
}
.collection-sticker.locked img {
  opacity: 0.15;
  filter: grayscale(1) blur(2px);
}
.collection-sticker.locked::after {
  content: '?';
  position: absolute;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-tertiary);
}
.collection-sticker.owned {
  background: white;
  border: 2px solid var(--border);
}
.sticker-rarity-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ========== GACHA MODAL ========== */
.gacha-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gacha-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
}
.gacha-modal-content {
  position: relative;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 24px;
  padding: 32px 24px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalSlideIn 0.3s ease-out;
}
@keyframes modalSlideIn {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.gacha-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #888;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}
.gacha-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.gacha-lantern {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gacha-lantern-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(255,200,100,0.5));
}
.gacha-lantern.shaking {
  animation: lanternShake 0.5s ease-in-out infinite;
}
@keyframes lanternShake {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}
.gacha-title {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}
.gacha-tickets {
  color: #ffd700;
  font-size: 18px;
  margin: 0;
}
.gacha-pull-btn {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
  color: white;
  border: none;
  padding: 16px 48px;
  border-radius: 30px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,107,107,0.5);
  transition: transform 0.2s;
}
.gacha-pull-btn:active {
  transform: scale(0.95);
}
.gacha-pulling-text {
  color: #fff;
  font-size: 24px;
  animation: pulsingText 0.5s ease-in-out infinite;
}
@keyframes pulsingText {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Result */
.gacha-result-sticker {
  width: 160px;
  height: 160px;
  background: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  animation: resultPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes resultPop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}
.gacha-result-sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gacha-result-sticker.rarity-common { border: 3px solid #9E9E9E; }
.gacha-result-sticker.rarity-uncommon { border: 3px solid #4CAF50; box-shadow: 0 0 20px rgba(76,175,80,0.5); }
.gacha-result-sticker.rarity-rare { border: 3px solid #2196F3; box-shadow: 0 0 30px rgba(33,150,243,0.6); }
.gacha-result-sticker.rarity-epic { border: 3px solid #9C27B0; box-shadow: 0 0 40px rgba(156,39,176,0.7); animation: resultPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), epicGlow 1s ease-in-out infinite; }
.gacha-result-sticker.rarity-legendary { border: 3px solid #FF9800; box-shadow: 0 0 50px rgba(255,152,0,0.8); animation: resultPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), legendaryGlow 0.5s ease-in-out infinite; }
@keyframes epicGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(156,39,176,0.5); }
  50% { box-shadow: 0 0 50px rgba(156,39,176,0.9); }
}
@keyframes legendaryGlow {
  0%, 100% { box-shadow: 0 0 40px rgba(255,152,0,0.6); }
  50% { box-shadow: 0 0 70px rgba(255,215,0,1); }
}
.gacha-result-name {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  margin: 8px 0 4px 0;
}
.gacha-result-rarity {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  padding: 4px 12px;
  border-radius: 12px;
}
.gacha-result-rarity.common { background: #9E9E9E; color: #fff; }
.gacha-result-rarity.uncommon { background: #4CAF50; color: #fff; }
.gacha-result-rarity.rare { background: #2196F3; color: #fff; }
.gacha-result-rarity.epic { background: #9C27B0; color: #fff; }
.gacha-result-rarity.legendary { background: linear-gradient(90deg, #FF9800, #FFD700); color: #333; }
.gacha-result-info {
  margin: 8px 0;
}
.gacha-result-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.gacha-again-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.gacha-again-btn:disabled {
  background: #555;
  cursor: not-allowed;
}
.gacha-done-btn {
  background: #333;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.gacha-duplicate-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #FF5722;
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 10px;
}

/* ========== SAKURA PETAL CELEBRATION ========== */
/* Falling petals animation for achievements */
.sakura-celebration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.falling-petal {
  position: absolute;
  width: 15px;
  height: 15px;
  background: radial-gradient(ellipse at 30% 30%, #ffb7c5 0%, #ff9eb5 50%, #ffa0b8 100%);
  border-radius: 150% 0 150% 0;
  opacity: 0.9;
  animation: petalFall linear forwards;
  filter: drop-shadow(0 2px 3px rgba(255, 150, 180, 0.3));
}

.falling-petal::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: inherit;
  border-radius: inherit;
  transform: rotate(90deg);
  opacity: 0.8;
}

@keyframes petalFall {
  0% {
    transform: translateY(-20px) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.6);
    opacity: 0;
  }
}

@keyframes petalSway {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(30px); }
}

/* ========== DAILY READING ========== */
/* Level Selector for Reading */
.level-selector-90 {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.level-btn-90 {
  background: var(--bg, #f5f5f5);
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #888);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.level-btn-90.active {
  background: var(--primary, #667eea);
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
}
.level-btn-90:hover:not(.active) {
  background: var(--border, #e0e0e0);
}

.reading-content { padding: 0 16px 16px; }

.reading-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  color: white;
  margin-bottom: 16px;
  position: relative;
}
.reading-hero-icon { margin-bottom: 8px; }
.reading-hero-title { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.reading-hero-desc { font-size: 13px; opacity: 0.85; margin: 0; }
.reading-level-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.25);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.reading-article-card {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}

.reading-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 0;
  color: #888;
  font-size: 14px;
}
.reading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #eee;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.reading-article-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.reading-article-topic {
  font-size: 13px;
  font-weight: 600;
  color: #667eea;
  text-transform: capitalize;
}
.reading-article-date {
  font-size: 12px;
  color: #999;
}
.reading-article-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.4;
}
.reading-article-excerpt {
  font-size: 14px;
  color: #666;
  margin: 0 0 12px;
  line-height: 1.6;
}
.reading-article-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
}
.reading-source-info {
  font-size: 12px;
  color: #aaa;
  margin: 0 0 16px;
  font-style: italic;
}
.reading-start-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.reading-start-btn:active { opacity: 0.9; }

/* Completed state */
.reading-completed {
  text-align: center;
  padding: 24px 0;
}
.reading-completed-icon { margin-bottom: 12px; }
.reading-completed-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.reading-completed-score {
  font-size: 32px;
  font-weight: 700;
  color: #4CAF50;
  margin-bottom: 4px;
}
.reading-completed-message {
  font-size: 14px;
  color: #667eea;
  margin-bottom: 8px;
}
.reading-comeback {
  font-size: 13px;
  color: #999;
}

/* Stats */
.reading-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.reading-stat {
  flex: 1;
  background: var(--card-bg, #fff);
  border-radius: 12px;
  padding: 16px 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.reading-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #667eea;
}
.reading-stat-label {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

/* ========== READING QUIZ SCREEN ========== */
.reading-quiz-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #eee);
  position: sticky;
  top: 0;
  background: var(--bg, #fff);
  z-index: 10;
}
.reading-back-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text, #333);
}
.reading-quiz-progress {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #667eea;
}

/* Article View */
.reading-article-view {
  padding: 20px 16px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}
.reading-full-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 16px;
}
.reading-full-body {
  font-size: 16px;
  line-height: 2;
  color: var(--text, #333);
}
.reading-full-body ruby { font-size: 16px; }
.reading-full-body rt { font-size: 10px; color: #888; }

.reading-translation-toggle {
  text-align: center;
  margin: 16px 0;
}
.reading-translation-btn {
  background: none;
  border: 1px solid #ddd;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  color: #666;
}
.reading-translation-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}
.reading-translation-content {
  background: #f8f8ff;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.8;
  color: #555;
  margin-bottom: 16px;
}
.reading-continue-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

/* Quiz View */
.reading-quiz-view { padding: 20px 16px; }
.reading-quiz-question {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 6px;
}
.reading-quiz-question-translation {
  font-size: 13px;
  color: #888;
  margin-bottom: 16px;
}
.reading-quiz-options { display: flex; flex-direction: column; gap: 10px; }
.reading-quiz-option {
  padding: 14px 16px;
  background: var(--card-bg, #fff);
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}
.reading-quiz-option:active { background: #f0f0f0; }
.reading-quiz-option.correct {
  border-color: #4CAF50;
  background: #e8f5e9;
  color: #2e7d32;
}
.reading-quiz-option.incorrect {
  border-color: #f44336;
  background: #ffebee;
  color: #c62828;
}
.reading-quiz-explanation {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-top: 12px;
  line-height: 1.5;
}
.reading-quiz-explanation.correct { background: #e8f5e9; color: #2e7d32; }
.reading-quiz-explanation.incorrect { background: #ffebee; color: #c62828; }
.reading-quiz-next-btn {
  width: 100%;
  padding: 14px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

/* Result View */
.reading-result-view {
  text-align: center;
  padding: 60px 20px;
}
.reading-result-icon { margin-bottom: 16px; }
.reading-result-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.reading-result-score { font-size: 48px; font-weight: 700; color: #667eea; margin-bottom: 12px; }
.reading-result-reward { font-size: 16px; color: #4CAF50; font-weight: 600; margin-bottom: 32px; }
.reading-done-btn {
  padding: 14px 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* ========== What's New Modal ========== */
#whats-new-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.whats-new-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); }
.whats-new-content { position: relative; background: #fff; border-radius: 20px; max-width: 380px; width: 90%; overflow: hidden; animation: whatsNewSlide 0.3s ease; }
@keyframes whatsNewSlide { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.whats-new-close { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,0.3); border: none; color: #fff; font-size: 18px; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; z-index: 1; }
.whats-new-header { background: linear-gradient(135deg, #7c3aed, #a855f7); padding: 28px 24px 20px; text-align: center; color: #fff; }
.whats-new-header h2 { margin: 8px 0 0; font-size: 20px; font-weight: 700; }
.whats-new-features { padding: 20px 24px; }
.whats-new-feature { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; color: #333; line-height: 1.4; }
.whats-new-feature:last-child { border-bottom: none; }
.whats-new-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.whats-new-cta { display: block; width: calc(100% - 48px); margin: 0 24px 12px; padding: 14px; background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; }
.whats-new-cta:active { opacity: 0.9; }
.whats-new-later { display: block; text-align: center; padding: 8px; margin-bottom: 16px; color: #999; font-size: 13px; cursor: pointer; text-decoration: none; }
