/* ==========================================================================
   ReadFlow HIG — Apple Minimalist Design System (Google Stitch Reference)
   ========================================================================== */

:root {
  --bg-canvas: #ffffff;
  --bg-surface: #f5f5f7;
  --bg-surface-soft: #f6f3f5;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.86);

  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;

  --accent-blue: #0071e3;
  --accent-blue-hover: #0062c4;
  --accent-blue-soft: rgba(0, 113, 227, 0.1);
  --accent-blue-tint: #eef5ff;

  --accent-amber: #ff9500;
  --accent-amber-text: #a15500;
  --accent-amber-soft: rgba(255, 149, 0, 0.12);

  --accent-red: #ff3b30;
  --accent-red-text: #c62828;
  --accent-red-soft: rgba(255, 59, 48, 0.11);

  --accent-green: #248a3d;
  --accent-green-soft: rgba(52, 199, 89, 0.14);

  --border-hairline: rgba(0, 0, 0, 0.06);
  --border-subtle: rgba(0, 0, 0, 0.09);

  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-focus: 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-floating: 0 10px 34px rgba(0, 0, 0, 0.08);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Shell — Centered Apple Editorial Column */
.app-shell {
  max-width: 680px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 92px;
}

/* Top Frosted Navigation Bar */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border-hairline);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-nav-left,
.top-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.icon-btn {
  border: none;
  background: transparent;
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s ease;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.plan-toggle-pill {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.plan-toggle-pill.is-pro {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
}

/* Main Content Container */
.main-content {
  padding: 16px 18px 28px;
  flex: 1;
}

.page-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.page-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.muted-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Apple Segmented Control */
.segmented-control {
  background: #e9e9ee;
  padding: 3px;
  border-radius: 10px;
  display: flex;
  gap: 2px;
  margin-bottom: 14px;
}

.segment-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.segment-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Filter Pill Row */
.pill-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.pill-row::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  border: 1px solid var(--border-hairline);
  background: #ffffff;
  color: var(--text-secondary);
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.filter-pill.active {
  background: var(--text-primary);
  color: #ffffff;
  border-color: var(--text-primary);
}

/* Generic Apple Card */
.hig-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  margin-bottom: 14px;
}

.hig-card-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hig-card-clickable:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-focus);
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}

.badge-blue {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.badge-red {
  background: var(--accent-red-soft);
  color: var(--accent-red-text);
}

.badge-amber {
  background: var(--accent-amber-soft);
  color: var(--accent-amber-text);
}

.badge-green {
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.badge-gray {
  background: var(--bg-surface);
  color: var(--text-secondary);
}

/* Primary & Secondary Apple Buttons */
.btn-primary {
  border: none;
  background: var(--accent-blue);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-soft-blue {
  border: none;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

/* ==========================================================================
   Screen 1: Blind Step-by-Step Jikdokjikhae Training
   ========================================================================== */

.step-progress-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.step-dash {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: #e1e1e6;
  transition: background 0.2s ease;
}

.step-dash.done,
.step-dash.active {
  background: var(--accent-blue);
}

.completed-step-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  opacity: 0.72;
}

.completed-step-en {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 4px 0 6px;
}

.completed-step-ko {
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-surface);
  padding: 7px 10px;
  border-radius: 8px;
}

.active-chunk-card {
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  border-left: 4px solid var(--accent-blue);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-focus);
  margin-bottom: 14px;
}

.reading-en-serif {
  font-family: var(--font-serif);
  font-size: 18.5px;
  line-height: 1.56;
  color: var(--text-primary);
  letter-spacing: 0.005em;
  margin: 8px 0 6px;
}

.word-token {
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 1px;
  transition: background 0.12s ease;
}

.word-token:hover {
  background: var(--accent-blue-soft);
}

.word-token.bookmarked {
  background: var(--accent-amber-soft);
  border-bottom: 2px solid var(--accent-amber);
  color: var(--text-primary);
}

.upcoming-steps-blur {
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  color: var(--text-tertiary);
  user-select: none;
}

.upcoming-steps-blur .blurred-text {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.7;
  filter: blur(2.6px);
  opacity: 0.45;
  margin-top: 8px;
}

.typing-dock {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-floating);
}

.typing-textarea {
  width: 100%;
  min-height: 92px;
  border: 1.5px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  resize: vertical;
  outline: none;
  transition: all 0.15s ease;
}

.typing-textarea:focus {
  background: #ffffff;
  border-color: var(--accent-blue);
}

.typing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Screen 2: Deep Grading Report & Unknown Vocab Inference
   ========================================================================== */

.report-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.score-ring-wrap {
  position: relative;
  width: 82px;
  height: 82px;
  flex-shrink: 0;
}

.score-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-ring-num {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.score-ring-sub {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.diagnosis-box {
  background: var(--accent-blue-tint);
  border-radius: var(--radius-md);
  padding: 13px 15px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.inferred-vocab-card {
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}

.mistake-callout {
  margin-top: 10px;
  background: var(--accent-red-soft);
  color: #7c1919;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.mistake-callout.is-amber {
  background: var(--accent-amber-soft);
  color: #6b3b00;
}

.step-compare-box {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.65;
}

.step-compare-box.model {
  background: var(--accent-blue-tint);
}

.slash-highlight {
  color: var(--accent-blue);
  font-weight: 700;
  padding: 0 3px;
}

/* ==========================================================================
   Screen 3 & 5: Stats Grid, Search Input, Vocab Cards
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.stat-tile {
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.stat-tile-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.stat-tile-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.search-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border-hairline);
  border-radius: 11px;
  background: #eaeaf0;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  margin-bottom: 12px;
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--accent-blue);
}

.vocab-context-snippet {
  margin-top: 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-primary);
}

.masked-blur {
  filter: blur(6px);
  user-select: none;
  cursor: pointer;
}

/* ==========================================================================
   Screen 4: Pro Exclusive Quizlet-style Vocab Drill
   ========================================================================== */

.flashcard-stage {
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  border-radius: 26px;
  padding: 28px 22px;
  min-height: 310px;
  box-shadow: var(--shadow-floating);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.16s ease;
  margin-bottom: 16px;
}

.flashcard-stage:active {
  transform: scale(0.99);
}

.flashcard-word {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 600;
  text-align: center;
  margin: 18px 0 8px;
  letter-spacing: -0.02em;
}

.drill-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-dont-know {
  border: none;
  background: var(--accent-red-soft);
  color: var(--accent-red-text);
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.btn-know {
  border: none;
  background: var(--accent-blue);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.mcq-option {
  width: 100%;
  text-align: left;
  border: 1.5px solid var(--border-hairline);
  background: #ffffff;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.14s ease;
}

.mcq-option:hover {
  border-color: var(--accent-blue);
  background: var(--accent-blue-tint);
}

.mcq-option.correct {
  border-color: var(--accent-green);
  background: var(--accent-green-soft);
  color: var(--accent-green);
  font-weight: 700;
}

.mcq-option.wrong {
  border-color: var(--accent-red);
  background: var(--accent-red-soft);
  color: var(--accent-red-text);
}

.match-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.match-tile {
  background: #ffffff;
  border: 1.5px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.match-tile.selected {
  border-color: var(--accent-blue);
  background: var(--accent-blue-tint);
  color: var(--accent-blue);
}

.match-tile.matched {
  opacity: 0.25;
  pointer-events: none;
  border-color: var(--accent-green);
}

.match-tile.wrong-flash {
  border-color: var(--accent-red);
  background: var(--accent-red-soft);
}

.paywall-card {
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow-focus);
}

/* Bottom iOS Frosted Glass 4-Tab Bar */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 680px;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-hairline);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 6px 14px;
  z-index: 40;
}

.tab-item {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  padding: 4px 0;
}

.tab-item.active {
  color: var(--accent-blue);
}

.tab-pro-chip {
  position: absolute;
  top: -2px;
  right: 18%;
  background: var(--accent-amber);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 99px;
  letter-spacing: 0.03em;
}

/* Loading Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* ==========================================================================
   Social Auth Modal (Google / Kakao / Naver Only — Apple HIG Sheet)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-sheet {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 24px;
  padding: 26px 22px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16);
}

.social-btn {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.social-btn:active {
  transform: scale(0.985);
}

.social-btn-google {
  background: #ffffff;
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.social-btn-kakao {
  background: #fee500;
  color: #191919;
  border: none;
}

.social-btn-naver {
  background: #03c75a;
  color: #ffffff;
  border: none;
}

.account-chip {
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-primary);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ox-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.btn-ox-o {
  border: 1.5px solid var(--accent-blue);
  background: var(--accent-blue-tint);
  color: var(--accent-blue);
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.btn-ox-x {
  border: 1.5px solid var(--accent-red);
  background: var(--accent-red-soft);
  color: var(--accent-red-text);
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
}


/* ==========================================================================
   Production Launch Additions: Apple Sign-In, TTS, Paywall, Custom Paste, Mobile Keyboard
   ========================================================================== */
.social-btn-apple {
  background: #000000;
  color: #ffffff;
  border: 1px solid #000000;
}
.social-btn-apple:hover {
  background: #1c1c1e;
}

.tts-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  transition: transform 0.12s ease, background 0.15s ease;
}
.tts-btn:hover {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}
.tts-btn:active {
  transform: scale(0.92);
}

.tier-card {
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #ffffff;
}
.tier-card.is-active {
  border-color: var(--accent-blue);
  background: var(--accent-blue-tint);
}
.tier-card.is-featured {
  border-color: #1d1d1f;
}

.quota-banner {
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  box-shadow: var(--shadow-card);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: block;
}

.app-footer {
  margin-top: 24px;
  padding: 18px 14px 12px;
  text-align: center;
  border-top: 1px solid var(--border-hairline);
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.6;
}

.draft-banner {
  background: var(--accent-blue-tint);
  border: 1px solid rgba(0, 113, 227, 0.22);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.attribution-bar {
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.legal-links-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 12px;
}
.legal-links-row a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}
.legal-links-row a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.danger-btn {
  width: 100%;
  border: 1px solid rgba(255, 59, 48, 0.3);
  background: rgba(255, 59, 48, 0.06);
  color: var(--accent-red-text);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

/* Mobile visualViewport keyboard-aware sticky typing dock */
.keyboard-open .app-shell {
  padding-bottom: 16px;
}
.keyboard-open .typing-dock {
  position: sticky;
  bottom: var(--vv-bottom, 0px);
  z-index: 40;
  background: #ffffff;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.1);
}


/* ==========================================================================
   Mobile Fixed-Dock Reading UX + Monthly Calendar + Growth Chart
   ========================================================================== */
.training-scroll-space {
  padding-bottom: 36px;
}

.typing-dock-fixed {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: var(--vv-bottom, 0px);
  width: 100%;
  max-width: 680px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.07);
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
}

.typing-dock-fixed .typing-textarea {
  min-height: 68px;
  max-height: 112px;
  padding: 10px 12px;
  font-size: 15px;
  margin-bottom: 8px;
}

.completed-summary-btn {
  width: 100%;
  border: 1px solid var(--border-hairline);
  background: #ffffff;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  margin-bottom: 10px;
}

.upcoming-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.045);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
  margin-top: 10px;
}

/* Monthly Study Calendar */
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}
.cal-dow {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding-bottom: 4px;
}
.cal-cell {
  aspect-ratio: 1;
  max-height: 36px;
  margin: 0 auto;
  width: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.cal-cell.is-today {
  border: 1.5px solid var(--accent-blue);
  color: var(--accent-blue);
  font-weight: 700;
}
.cal-cell.has-study-1 {
  background: rgba(0, 113, 227, 0.16);
  color: var(--accent-blue);
  font-weight: 700;
}
.cal-cell.has-study-2 {
  background: var(--accent-blue);
  color: #ffffff;
  font-weight: 700;
}

/* Growth Chart */
.growth-chart-wrap {
  width: 100%;
  overflow: hidden;
}
.growth-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 8px;
}
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}


/* ==========================================================================
   Main Landing Page (HOME) — Apple Editorial Style
   ========================================================================== */
.brand-lockup-btn {
  border: none;
  background: transparent;
  padding: 2px 4px;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
}
.brand-lockup-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.landing-hero {
  text-align: center;
  padding: 12px 2px 18px;
}
.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.landing-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(25px, 6.2vw, 36px);
  font-weight: 800;
  line-height: 1.26;
  letter-spacing: -0.035em;
}
.landing-hero h1 span {
  color: var(--accent-blue);
}
.landing-hero p {
  margin: 0 auto 18px;
  max-width: 500px;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.landing-cta-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.landing-demo-card {
  margin-top: 22px;
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  border-radius: 20px;
  padding: 18px;
  text-align: left;
  box-shadow: var(--shadow-focus);
}
.landing-demo-en {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.6;
  margin: 8px 0 12px;
}
.landing-demo-mark {
  background: rgba(255, 149, 0, 0.16);
  color: #a15500;
  padding: 1px 5px;
  border-radius: 5px;
  font-weight: 600;
}
.landing-demo-ko {
  background: var(--accent-blue-tint);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
}
.landing-section {
  margin-top: 32px;
}
.landing-sec-title {
  margin: 4px 0 12px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.landing-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 560px) {
  .landing-compare-grid { grid-template-columns: 1fr; }
}
.landing-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.landing-step-card {
  background: #ffffff;
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 15px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}
.landing-step-num {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-blue);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.landing-exam-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.landing-final-banner {
  margin-top: 28px;
  background: #1d1d1f;
  color: #ffffff;
  border-radius: 20px;
  padding: 24px 18px;
  text-align: center;
}


/* ==========================================================================
   Dictionary Drawer, Vocab Bulk Import, Weakness Top 3
   ========================================================================== */
.dict-box {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.55;
}
.dict-pos {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  padding: 2px 7px;
  border-radius: 6px;
  margin: 6px 0 4px;
}
.weakness-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-size: 13px;
}


/* ==========================================================================
   English Inline Slash, Keyboard Focus Cursor, Long-Press & Mobile Touch Targets
   ========================================================================== */
.reading-en-serif.is-kbd-focused {
  outline: 2px solid rgba(0, 113, 227, 0.35);
  outline-offset: 6px;
  border-radius: 10px;
}

.word-token {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  display: inline;
  padding: 2px 2px;
  border-radius: 5px;
  cursor: pointer;
}

.word-token.en-cursor {
  background: rgba(0, 113, 227, 0.16);
  color: var(--accent-blue);
  box-shadow: 0 0 0 1.5px rgba(0, 113, 227, 0.45);
}

.en-inline-slash {
  color: var(--accent-blue);
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.92em;
  margin: 0 3px 0 4px;
  user-select: none;
}

.auth-error-banner {
  background: var(--accent-red-soft);
  border: 1px solid rgba(255, 59, 48, 0.25);
  color: var(--accent-red-text);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.recommend-card {
  background: linear-gradient(135deg, #ffffff 0%, #f2f7ff 100%);
  border: 1.5px solid rgba(0, 113, 227, 0.22);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.mistranslated-mark {
  background: rgba(255, 59, 48, 0.13);
  color: #b71c1c;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: underline wavy rgba(255, 59, 48, 0.55);
}

.diagnosis-box .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-right: 6px;
  border-color: rgba(0, 113, 227, 0.25);
  border-top-color: var(--accent-blue);
}

html.keyboard-open .main-content {
  padding-bottom: calc(var(--vv-bottom, 0px) + 24px);
}

/* Active translation chunk highlighting & completed chunk dimming */
.word-token.is-done-chunk {
  opacity: 0.52;
  transition: opacity 0.15s ease;
}

.word-token.is-active-chunk {
  background: rgba(0, 113, 227, 0.1);
  border-radius: 4px;
}

.word-token.bookmarked.is-active-chunk {
  background: var(--accent-amber-soft);
}

/* Recent login badge & multi-provider account linking */
.social-btn {
  position: relative;
}

.recent-login-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--accent-blue);
  color: #ffffff;
  letter-spacing: -0.01em;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.28);
}

.social-btn-naver .recent-login-badge,
.social-btn-apple .recent-login-badge {
  background: #ffffff;
  color: #1d1d1f;
}

.linked-providers-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.linked-provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--border-hairline);
  font-size: 13px;
}

.linked-provider-row:first-of-type {
  border-top: none;
}

.auth-notice-banner {
  background: var(--accent-green-soft);
  border: 1px solid rgba(36, 138, 61, 0.25);
  color: var(--accent-green);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Minimum 44px touch targets & compact reading typography on mobile */
@media (max-width: 680px) {
  .btn-primary,
  .btn-secondary,
  .btn-soft-blue,
  .segment-btn,
  .filter-pill,
  .tab-item {
    min-height: 44px;
  }

  .active-chunk-card {
    padding: 14px 15px;
  }

  .reading-en-serif {
    font-size: 17px;
    line-height: 1.48;
    margin: 6px 0 4px;
  }

  /* Split-view focus lock when mobile virtual keyboard is open */
  html.keyboard-open .training-scroll-space .step-progress-bar,
  html.keyboard-open .training-scroll-space .completed-summary-btn,
  html.keyboard-open .training-scroll-space .completed-step-card,
  html.keyboard-open .training-scroll-space .upcoming-pill,
  html.keyboard-open .training-scroll-space .attribution-bar,
  html.keyboard-open .reading-card-top-hint {
    display: none !important;
  }

  html.keyboard-open .main-content {
    padding-top: 6px;
    padding-bottom: calc(var(--vv-bottom, 0px) + 12px);
  }

  html.keyboard-open .training-scroll-space {
    padding-bottom: 4px;
  }

  html.keyboard-open .training-scroll-space .active-chunk-card {
    padding: 10px 13px;
    margin-bottom: 4px;
  }

  html.keyboard-open #reading-en-box {
    max-height: calc(var(--vv-height, 56vh) - 200px);
    min-height: 92px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    padding-right: 4px;
    margin: 2px 0 4px;
  }

  html.keyboard-open .reading-input-divider {
    margin-top: 8px !important;
    padding-top: 8px !important;
  }

  html.keyboard-open #step-chunk-input {
    min-height: 54px !important;
    max-height: 68px;
    padding: 8px 11px;
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 6px !important;
  }

  html.keyboard-open .training-scroll-space .typing-toolbar {
    margin-top: 4px;
  }

  html.keyboard-open .training-scroll-space .typing-toolbar button {
    min-height: 36px;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
}
