.load-more { text-align:center; padding: 12px; color:var(--text-dim); font-size:13px; cursor:pointer; }

/* Study card */
.study-wrap { display:flex; flex-direction:column; min-height: 62vh; }
.step-label { font-size:12px; color:var(--text-dim); text-transform:none; margin-bottom:8px; display:flex; align-items:center; justify-content:space-between;}
.dots { display:flex; gap:5px; }
.dot { width:7px;height:7px;border-radius:50%; background:var(--line); }
.dot.filled { background: var(--accent); }

.card {
  flex:1;
  background: var(--surface);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center;
  gap: 14px;
  min-height: 260px;
  cursor: pointer;
  position: relative;
}
.vi-text { font-size: 22px; font-weight: 600; line-height:1.4; }
.card-compact { min-height: 220px; }
.vi-text-compact { font-size: 18px; }
.word-text { font-family: var(--font-word); font-size: 30px; font-weight:700; color: var(--accent); }
.ipa-text { font-family: var(--font-ipa); font-size: 16px; color: var(--text-dim); }
.pos-badge { font-size: 11px; color: var(--text-dim); background: var(--surface-2); padding:3px 10px; border-radius:999px; }
.example-text { font-size: 13px; font-style: italic; color: var(--text-dim); line-height:1.5; max-width: 320px; }
.preview-sub-text { font-size: 16px; color: var(--text-dim); }
.flip-hint { position:absolute; bottom:14px; font-size:11px; color: var(--text-dim); }

.audio-btn {
  width: 52px; height:52px; border-radius:50%;
  background: var(--surface-2); border: 1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
  font-size:22px; cursor:pointer; color: var(--text);
}
.audio-btn:active { transform: scale(0.93); }

.answer-row { display:flex; gap:6px; flex-wrap:wrap; justify-content:center; min-height: 44px; margin: 6px 0; }
.slot {
  min-width: 40px; height: 44px; padding: 0 8px;
  border: 2px dashed var(--line); border-radius: 8px;
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-word); font-weight:600; font-size:16px;
  background: var(--surface-2);
}
.slot.filled { border-style: solid; border-color: var(--accent); background: var(--surface-3); }
.slot.editable { cursor: pointer; }
.slot.wrong { border-color: var(--coral); background: rgba(255,69,58,0.12); }
.slot.shake { animation: shake .3s; }
.pool-row { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; margin-top:14px; }
.chip {
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2); border:1px solid var(--line);
  font-family: var(--font-word); font-weight:600; font-size:16px;
  cursor:pointer; user-select:none;
}
.chip:active { transform: scale(0.94); }
.chip.shake { animation: shake .3s; border-color: var(--coral); }
.chip.used { visibility: hidden; pointer-events: none; }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-5px);} 75%{transform:translateX(5px);} }

.type-input {
  width:100%; padding: 14px 16px; font-size:18px; font-family: var(--font-word);
  border-radius: var(--radius-sm); border: 2px solid var(--line);
  background: var(--surface-2); color: var(--text); text-align:center;
  letter-spacing: 1px;
}
.type-input:focus { outline:none; border-color: var(--accent); }
.type-input.wrong { border-color: var(--coral); }
.type-input.right { border-color: var(--mint); }
.feedback { font-size: 13px; min-height: 18px; }
.feedback.err { color: var(--coral); }
.feedback.ok { color: var(--mint); }

.footer-actions { margin-top: 14px; }
.success-banner {
  background: var(--surface); border: 1px solid var(--mint); border-radius: var(--radius);
  padding: 30px 20px; text-align:center; display:flex; flex-direction:column; gap:12px; align-items:center;
}
.big-emoji { font-size: 46px; }

.top-mini-nav { display:flex; justify-content:space-between; align-items:center; margin-bottom: 10px; }
.page-heading { display:flex; align-items:center; gap:9px; font-size:20px; font-weight:800; margin-bottom: 16px; }
.link-btn { background:none; border:none; color: var(--text-dim); font-family: var(--font-ui); font-size:13px; cursor:pointer; padding:6px 2px; }
.kbd-hint { display:none; align-items:center; justify-content:center; min-width:18px; height:18px; padding:0 4px; margin-left:8px; border-radius:5px; background: var(--surface-3); color: var(--text-dim); font-size:11px; font-family: var(--font-ipa); vertical-align:1px; }

@media (max-width: 380px) {
  .word-text { font-size: 24px; }
  .vi-text { font-size: 19px; }
}

/* Bottom dock nav (mobile/tablet) */
.shell { display: block; }
.rail { display: contents; }
main#screen { flex: 1; min-width: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}
.dock-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: var(--text-dim); font-family: var(--font-ui);
  font-size: 10px; font-weight: 600; padding: 6px 2px; border-radius: 12px; cursor: pointer;
}
.dock-item.active { color: var(--accent); }
.sidebar { display: none; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.theme-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 2px solid var(--line); background: var(--surface-2); cursor: pointer; text-align: left;
  font-family: var(--font-ui); color: var(--text);
}
.theme-card.active { border-color: var(--accent); }
.theme-card .swatch-dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.15); }
.theme-card .name { font-size: 13px; font-weight: 700; }

@media (min-width: 720px) {
  body { background: var(--surface-2); }
  #app {
    max-width: 720px;
    margin: 28px auto 48px;
    background: var(--bg);
    border-radius: 28px;
    border: 1px solid var(--line);
    padding: 18px 28px 36px;
    box-shadow: 0 20px 60px -20px rgba(0,0,0,0.35);
  }
  header.topbar { position: static; padding: 14px 0 14px; }

  .word-list { display:grid; grid-template-columns: 1fr 1fr; gap:8px; }
  .load-more { grid-column: 1 / -1; }

  .study-wrap { max-width: 480px; margin: 0 auto; min-height: 56vh; }
  .home-wrap { max-width: 480px; margin: 0 auto; }

  .btn, .chip-filter, .word-row, .stat-box, .audio-btn, .mini-audio-btn, .chip {
    transition: transform .08s ease, opacity .15s ease, border-color .15s ease, background .15s ease;
  }
  .btn-primary:hover, .btn-secondary:hover { opacity: 0.88; }
  .word-row:hover, .stat-box:hover, .chip-filter:hover, .chip:hover { border-color: var(--accent); cursor:pointer; }
  .audio-btn:hover, .mini-audio-btn:hover { border-color: var(--accent); }
  .btn, .chip-filter, .word-row, .chip, .searchbox, .audio-btn, .mini-audio-btn { cursor: pointer; }
  .theme-card:hover { border-color: var(--accent); }
  .kbd-hint { display: inline-flex; }
}

/* Real desktop layout: full-bleed page, fixed left rail (brand + nav), scrolling content pane */
@media (min-width: 1040px) {
  body { background: var(--bg); }
  #app {
    max-width: none; margin: 0; padding: 0;
    background: none; border: none; border-radius: 0; box-shadow: none;
  }
  .shell { display: flex; align-items: stretch; }
  .rail {
    position: fixed; top: 0; left: 0; bottom: 0; width: 268px;
    display: flex; flex-direction: column;
    background: var(--surface); border-right: 1px solid var(--line);
    padding: 26px 18px; box-sizing: border-box;
    overflow-y: auto; z-index: 20;
  }
  header.topbar {
    position: static; transform: none;
    background: none; padding: 0 4px 18px; margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }
  .topbar-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  /* The theme button sits near the sidebar's left edge here (unlike mobile,
     where it's on the far right of a full-width row), so a right-anchored
     menu would overflow past the left edge of the screen. Anchor left instead. */
  /* Anchoring inside the narrow sidebar column makes the menu drop down over
     the nav list below it. Instead float it as a fixed panel just to the
     right of the sidebar, in the main content area, clear of the nav. */
  .theme-menu { position: fixed; top: 104px; left: 296px; right: auto; }
  .brand { font-size: 18px; }
  header.topbar .progress-chip { font-size: 12px; }
  header.topbar .bar-track { margin-top: 14px; }

  .dock { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 3px; width: 100%;
    position: static;
  }
  .sidebar-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
    background: none; border: none; color: var(--text-dim); font-family: var(--font-ui);
    font-weight: 600; font-size: 14.5px; cursor: pointer; text-align: left; width: 100%;
  }
  .sidebar-item.active { background: var(--accent); color: var(--accent-ink); }
  .sidebar-item:hover:not(.active) { background: var(--surface-2); color: var(--text); }

  main#screen {
    margin-left: 268px; max-width: 1180px;
    padding: 40px 48px 48px;
  }
  /* Desktop header lives in the fixed sidebar, not above main#screen, so the
     sticky toggle bar needs a small fixed offset instead of the mobile
     header's height (which it was overlapping into). */
  .sticky-bar { top: 20px; }

  .word-list { grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

  .study-wrap { max-width: 780px; }
  .home-wrap { max-width: 560px; }
  .card { min-height: 440px; padding: 56px 48px; gap: 26px; border-radius: 28px; }
  .card-compact { min-height: 380px; padding: 44px 48px; }
  .vi-text-compact { font-size: 27px; }
  .word-text { font-size: 48px; }
  .vi-text { font-size: 32px; }
  .ipa-text { font-size: 20px; }
  .example-text { font-size: 15px; max-width: 440px; }
  .preview-sub-text { font-size: 20px; }
  .level-row { display: grid; grid-template-columns: repeat(6, 1fr); overflow-x: visible; gap: 12px; margin-bottom: 20px; }
  .level-chip { padding: 14px 10px; border-radius: 16px; }
  .level-chip .lc-code { font-size: 18px; }
  .level-chip .lc-sub { font-size: 13px; }
  .pos-badge { font-size: 14px; padding: 6px 16px; }
  .flip-hint { font-size: 13px; bottom: 20px; }
  .audio-btn { width: 76px; height: 76px; }
  .audio-btn svg { width: 30px; height: 30px; }
  .type-input { font-size: 24px; padding: 20px 22px; letter-spacing: 1.5px; }
  .feedback { font-size: 15px; min-height: 22px; }
  .step-label { font-size: 14px; margin-bottom: 14px; }
  .dot { width: 9px; height: 9px; }
  .dots { gap: 7px; }
  .answer-row { gap: 12px; min-height: 62px; margin: 10px 0; }
  .slot { min-width: 56px; height: 60px; font-size: 22px; border-radius: 14px; padding: 0 12px; }
  .pool-row { gap: 12px; margin-top: 22px; }
  .chip { padding: 15px 22px; font-size: 21px; border-radius: 14px; }
  .kbd-hint { min-width: 22px; height: 22px; font-size: 12px; }
  main#screen .progress-chip { font-size: 14px; padding: 7px 14px; }
  .footer-actions { margin-top: 20px; }
  .footer-actions .btn { max-width: 380px; margin: 0 auto; }

  /* Scale up content typography & spacing to desktop proportions */
  .page-heading { font-size: 27px; margin-bottom: 22px; }
  .hero-card { padding: 32px 34px; border-radius: 24px; }
  .hero-stat { font-size: 58px; }
  .hero-sub { font-size: 15px; margin-top: 8px; }
  .btn { font-size: 16px; padding: 16px 26px; border-radius: 16px; }
  .btn-sm { font-size: 14px; padding: 11px 18px; }
  .btn-row { gap: 14px; margin-top: 14px; }

  .stat-grid { gap: 16px; margin: 20px 0 26px; }
  .stat-box { padding: 20px 16px; border-radius: 18px; }
  .stat-box .n { font-size: 30px; }
  .stat-box .l { font-size: 13px; margin-top: 4px; }

  .searchbox { font-size: 15px; padding: 14px 16px; }
  .search-wrap .searchbox { padding-left: 42px; }
  .section-label { font-size: 12.5px; margin: 6px 0 10px; }
  .filter-row { gap: 9px; margin-bottom: 16px; }
  .chip-filter { font-size: 13.5px; padding: 9px 17px; }
  .toggle-bar { padding: 6px; margin-bottom: 22px; }
  .toggle-btn { font-size: 13px; padding: 11px 14px; gap: 7px; }

  .word-row { padding: 16px 18px; border-radius: 16px; }
  .word-row .w { font-size: 16px; }
  .word-row .pos { font-size: 12.5px; }
  .mini-audio-btn { padding: 6px 9px; border-radius: 8px; }

  .roadmap-hero { padding: 32px 34px; border-radius: 24px; margin-bottom: 24px; }
  .roadmap-hero .hero-stat { font-size: 46px; }
  .roadmap-grid { gap: 16px; }
  .day-card { padding: 22px 22px 20px; border-radius: 22px; }
  .day-badge { width: 46px; height: 46px; border-radius: 14px; font-size: 17px; }
  .day-title { font-size: 17px; }
  .day-range { font-size: 12.5px; }
  .day-status-pill { font-size: 12px; padding: 5px 12px; }
  .day-progress-pct { font-size: 13px; }
  .day-card-actions { gap: 10px; }

  .theme-grid { gap: 14px; }
  .theme-card { padding: 14px 16px; border-radius: 16px; }
  .theme-card .swatch-dot { width: 28px; height: 28px; }
  .theme-card .name { font-size: 14.5px; }

  .link-btn { font-size: 14px; }
  .top-mini-nav { margin-bottom: 16px; }
}
