/* ======================================================
   UGC NET Practice Hub — style.css
   MOBILE-FIRST: base = phone, scale up via min-width
   ====================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0b14;
  --surface:   #111320;
  --surface2:  #181b2e;
  --border:    #242846;
  --border2:   #2e3360;
  --accent:    #6c63ff;
  --accent2:   #a78bfa;
  --accent3:   #38bdf8;
  --green:     #22c55e;
  --green-bg:  rgba(34,197,94,.13);
  --red:       #ef4444;
  --red-bg:    rgba(239,68,68,.13);
  --yellow:    #f59e0b;
  --text1:     #f1f5f9;
  --text2:     #94a3b8;
  --text3:     #64748b;
  --radius:    14px;
  --radius-sm: 10px;
  /* safe area insets for notched phones */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text1);
  min-height: 100vh;
  min-height: 100dvh;   /* dynamic viewport for mobile browsers */
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Pages ── */
.page { display: none; }
.page.active { display: block; }

/* ── Particles (desktop only — skip on mobile for perf) ── */
.particles { display: none; }
@media (min-width: 769px) {
  .particles {
    display: block;
    position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  }
}
.particle {
  position: absolute; border-radius: 50%; background: var(--accent2);
  opacity: 0; animation: float-up linear infinite;
}
@keyframes float-up {
  0%   { transform: translateY(0) scale(0); opacity: 0; }
  10%  { opacity: .6; }
  90%  { opacity: .2; }
  100% { transform: translateY(-100vh) scale(1.5); opacity: 0; }
}

/* ── Hero BG ── */
.hero-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 100% 50% at 20% 0%, rgba(108,99,255,.2) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 80% 90%, rgba(56,189,248,.12) 0%, transparent 60%),
    var(--bg);
}

/* ═══════════════════════════════════════
   SITE HEADER
   ═══════════════════════════════════════ */
.site-header {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  background: rgba(10,11,20,.88);
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1rem; }
.logo-icon { font-size: 1.2rem; filter: drop-shadow(0 0 8px var(--accent)); }
.accent { color: var(--accent2); }
.header-badge { display: none; } /* shown on tablet+ */

/* ═══════════════════════════════════════
   INDEX PAGE — MOBILE BASE
   ═══════════════════════════════════════ */
.index-main {
  position: relative; z-index: 5;
  padding: 24px 16px calc(40px + var(--safe-bottom));
  max-width: 700px; margin: 0 auto;
}

/* Hero */
.hero { text-align: center; margin-bottom: 28px; }
.hero-tag {
  display: inline-block;
  font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent3); background: rgba(56,189,248,.1);
  border: 1px solid rgba(56,189,248,.25);
  padding: 4px 12px; border-radius: 99px; margin-bottom: 14px;
}
.hero-title {
  font-size: clamp(1.55rem, 6vw, 2.8rem);
  font-weight: 800; line-height: 1.18; letter-spacing: -.02em; margin-bottom: 14px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 50%, var(--accent3) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub { font-size: .9rem; color: var(--text2); line-height: 1.65; }

/* ─── Folder connect ─── */
.folder-section { margin-bottom: 16px; }
.folder-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color .2s;
}
.folder-card-left { display: flex; align-items: flex-start; gap: 12px; }
.folder-icon { font-size: 1.8rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.folder-title {
  font-size: .9rem; font-weight: 700; color: var(--text1);
  margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.folder-sub  { font-size: .78rem; color: var(--text3); line-height: 1.55; }
.folder-sub code { font-family: 'JetBrains Mono', monospace; color: var(--accent2); font-size: .75rem; }
.folder-name-chip {
  font-family: 'JetBrains Mono', monospace; font-size: .72rem; font-weight: 600;
  background: rgba(108,99,255,.15); border: 1px solid rgba(108,99,255,.3);
  color: var(--accent2); padding: 2px 8px; border-radius: 99px;
}

.btn-connect {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 13px 20px; font-size: .9rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: opacity .2s, transform .15s;
  box-shadow: 0 4px 20px rgba(108,99,255,.4); min-height: 48px;
}
.btn-connect svg { width: 18px; height: 18px; }
.btn-connect:active { opacity: .85; transform: scale(.98); }

.btn-refresh {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; background: rgba(108,99,255,.1); border: 1.5px solid rgba(108,99,255,.25);
  color: var(--accent2); border-radius: var(--radius-sm);
  padding: 11px 16px; font-size: .85rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all .2s; min-height: 44px;
}
.btn-refresh svg { width: 16px; height: 16px; }
.btn-refresh:active { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-refresh.spinning svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── File picker (mobile primary CTA) ─── */
.file-cta {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px;
}
.btn-open-file {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 15px 20px; font-size: .95rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: opacity .2s, transform .15s;
  box-shadow: 0 4px 24px rgba(108,99,255,.45); min-height: 52px;
}
.btn-open-file svg { width: 20px; height: 20px; }
.btn-open-file:active { opacity: .85; transform: scale(.98); }
.btn-open-file-sub { font-size: .75rem; color: var(--text3); text-align: center; }

/* ─── Papers list ─── */
.papers-section { margin-bottom: 16px; }
.papers-list {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.papers-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: .85rem; color: var(--text2);
}
.papers-hint { font-size: .72rem; color: var(--text3); font-weight: 400; }
.papers-empty {
  padding: 36px 16px; text-align: center;
  color: var(--text3); font-size: .88rem;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.papers-empty-icon { font-size: 2.2rem; opacity: .4; }
.papers-empty.hidden { display: none; }

.paper-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
  -webkit-user-select: none; user-select: none;
  min-height: 64px;
}
.paper-item:last-child { border-bottom: none; }
.paper-item:active { background: rgba(108,99,255,.09); }

.paper-item-icon {
  width: 40px; height: 40px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(108,99,255,.2), rgba(56,189,248,.15));
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.paper-item-info { flex: 1; min-width: 0; }
.paper-item-name {
  font-weight: 600; font-size: .9rem; color: var(--text1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.paper-item-meta { font-size: .72rem; color: var(--text3); margin-top: 2px; }
.paper-item-arrow {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  background: rgba(108,99,255,.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent2); font-size: .9rem;
}

/* slide-in animation */
@keyframes slide-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.paper-item { animation: slide-in .25s ease; }

/* ─── Paste JSON panel ─── */
.paste-section { margin-bottom: 32px; }

.paste-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; font-family: inherit; transition: border-color .2s;
  color: var(--text1); text-align: left; min-height: 60px;
}
.paste-toggle[aria-expanded="true"] {
  border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-color: var(--accent);
}
.paste-toggle-left { display: flex; align-items: center; gap: 12px; }
.paste-toggle-icon {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 8px;
  background: linear-gradient(135deg, rgba(108,99,255,.2), rgba(56,189,248,.15));
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center; color: var(--accent2);
}
.paste-toggle-icon svg { width: 18px; height: 18px; }
.paste-toggle-title { display: block; font-weight: 700; font-size: .9rem; }
.paste-toggle-sub   { display: block; font-size: .72rem; color: var(--text3); margin-top: 2px; }
.paste-toggle-chevron { color: var(--text3); flex-shrink: 0; transition: transform .25s; }
.paste-toggle-chevron svg { width: 18px; height: 18px; display: block; }
.paste-toggle[aria-expanded="true"] .paste-toggle-chevron { transform: rotate(180deg); }

/* Panel body */
.paste-panel {
  max-height: 0; overflow: hidden;
  transition: max-height .35s cubic-bezier(.4,0,.2,1);
  background: var(--surface);
  border: 1px solid var(--accent); border-top: none;
  border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius);
}
.paste-panel.open { max-height: 1200px; }
.paste-panel-inner { padding: 16px; display: flex; flex-direction: column; gap: 14px; }

.paste-field { display: flex; flex-direction: column; gap: 6px; }
.paste-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text3);
}
.paste-filename-wrap { display: flex; align-items: center; }
.paste-filename-input {
  flex: 1; background: var(--surface2); border: 1.5px solid var(--border);
  border-right: none; border-radius: 9px 0 0 9px;
  padding: 10px 12px; font-family: 'JetBrains Mono', monospace;
  font-size: .85rem; color: var(--text1); outline: none;
  transition: border-color .2s; min-height: 44px;
}
.paste-filename-input:focus { border-color: var(--accent); }
.filename-ext {
  background: var(--surface); border: 1.5px solid var(--border); border-left: none;
  border-radius: 0 9px 9px 0; padding: 10px 10px;
  font-family: 'JetBrains Mono', monospace; font-size: .8rem; color: var(--text3);
}
.paste-hint-text { font-size: .78rem; color: var(--text3); line-height: 1.55; margin: 0; }
.paste-hint-text code { font-family: 'JetBrains Mono', monospace; color: var(--accent2); font-size: .75rem; }

.paste-textarea-wrap { position: relative; }
.paste-textarea {
  width: 100%; min-height: 190px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 9px; padding: 12px 44px 12px 12px;
  font-family: 'JetBrains Mono', monospace; font-size: .78rem;
  color: var(--text1); outline: none; resize: vertical;
  line-height: 1.6; transition: border-color .2s;
}
.paste-textarea:focus { border-color: var(--accent); }
.paste-textarea::placeholder { color: var(--text3); }

.btn-paste-clear {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  color: var(--text3); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.btn-paste-clear svg { width: 13px; height: 13px; }
.btn-paste-clear:active { background: var(--red-bg); border-color: var(--red); color: var(--red); }

/* Status */
.paste-status {
  font-size: .82rem; border-radius: 8px; padding: 0;
  overflow: hidden; max-height: 0; transition: max-height .25s, padding .25s;
}
.paste-status.show { max-height: 100px; padding: 10px 14px; }
.paste-status.ok   { background: var(--green-bg); border: 1px solid rgba(34,197,94,.3); color: var(--green); }
.paste-status.err  { background: var(--red-bg);   border: 1px solid rgba(239,68,68,.3); color: var(--red); }
.paste-status.info { background: rgba(56,189,248,.1); border: 1px solid rgba(56,189,248,.25); color: var(--accent3); }

/* Actions */
.paste-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-paste-validate {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: transparent; border: 1.5px solid var(--border2);
  color: var(--text2); border-radius: 9px;
  padding: 12px 18px; font-size: .88rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all .2s; min-height: 48px;
}
.btn-paste-validate svg { width: 15px; height: 15px; }
.btn-paste-validate:active { border-color: var(--accent2); color: var(--accent2); }

.btn-paste-save {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  border: none; color: #fff; border-radius: 9px;
  padding: 13px 20px; font-size: .9rem; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: opacity .2s, transform .15s;
  box-shadow: 0 4px 18px rgba(108,99,255,.4); min-height: 50px;
}
.btn-paste-save svg { width: 16px; height: 16px; }
.btn-paste-save:active:not(:disabled) { opacity: .85; transform: scale(.98); }
.btn-paste-save:disabled { opacity: .35; cursor: default; box-shadow: none; }

/* Features grid */
.features {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 14px;
}
.feature-icon { font-size: 1.5rem; margin-bottom: 8px; }
.feature-card h3 { font-size: .85rem; font-weight: 700; margin-bottom: 6px; }
.feature-card p { font-size: .75rem; color: var(--text3); line-height: 1.55; }

/* ═══════════════════════════════════════
   QUIZ PAGE — MOBILE BASE
   ═══════════════════════════════════════ */

/* Top bar */
.quiz-topbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(10,11,20,.94); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: calc(10px + var(--safe-top)) 14px 0;
}
.topbar-row1 { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; }
.quiz-progress-wrap {
  height: 3px; background: var(--border); overflow: hidden;
}
.quiz-progress-bar {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent3) 100%);
  transition: width .4s ease; width: 0%;
}

.back-btn {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text2); border-radius: 8px;
  padding: 8px 12px; font-size: .82rem; font-family: inherit;
  cursor: pointer; transition: all .2s; white-space: nowrap; flex-shrink: 0;
  min-height: 40px;
}
.back-btn svg { width: 14px; height: 14px; }

.quiz-meta-bar { flex: 1; min-width: 0; }
.qb-title {
  font-weight: 700; font-size: .82rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.qb-count { font-size: .7rem; color: var(--text3); display: block; margin-top: 1px; }
.qb-sep { display: none; }

/* Paper info strip */
.paper-info-strip {
  display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap; scrollbar-width: none;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 14px;
}
.paper-info-strip::-webkit-scrollbar { display: none; }
.pi-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px 10px 0; border-right: 1px solid var(--border);
  margin-right: 14px; flex-shrink: 0;
}
.pi-item:last-child { border-right: none; }
.pi-label { font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); font-weight: 600; }
.pi-value { font-size: .82rem; font-weight: 700; }
.pi-diff  { color: var(--yellow); }

/* Questions container */
.questions-container { padding: 20px 14px calc(90px + var(--safe-bottom)); }

.question-card { display: none; animation: fade-in .3s ease; }
.question-card.active { display: block; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Question header */
.q-header {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px;
}
.q-number {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  color: var(--accent2); background: rgba(108,99,255,.15);
  border: 1px solid rgba(108,99,255,.25);
  padding: 3px 10px; border-radius: 99px; align-self: flex-start;
}
.q-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.q-tag { font-size: .68rem; padding: 3px 9px; border-radius: 99px; font-weight: 500; }
.tag-topic { background: rgba(56,189,248,.12); border: 1px solid rgba(56,189,248,.2); color: var(--accent3); }
.tag-diff  { border: 1px solid transparent; }
.tag-diff.easy     { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.2);  color: var(--green); }
.tag-diff.moderate { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.2); color: var(--yellow); }
.tag-diff.hard     { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.2);  color: var(--red); }

.q-text {
  font-size: .97rem; font-weight: 500; line-height: 1.72;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  margin-bottom: 16px;
}

/* Options */
.q-options { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }

.option-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 11px; padding: 13px 14px;
  cursor: pointer; transition: border-color .15s, background .15s;
  font-family: inherit; font-size: .92rem; color: var(--text1);
  min-height: 54px; /* large touch target */
  -webkit-tap-highlight-color: transparent;
}
.option-btn:active:not(:disabled) { border-color: var(--accent); background: rgba(108,99,255,.07); }
.option-btn:disabled { cursor: default; }

.option-key {
  min-width: 34px; height: 34px; border-radius: 7px;
  border: 1.5px solid var(--border2); background: rgba(255,255,255,.04);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem; flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace; transition: all .15s;
}
.option-text { flex: 1; line-height: 1.45; }
.option-result-icon { font-size: 1.1rem; margin-left: auto; flex-shrink: 0; opacity: 0; transition: opacity .15s; }

/* Correct / Wrong */
.option-btn.correct { border-color: var(--green) !important; background: var(--green-bg) !important; }
.option-btn.correct .option-key { background: var(--green); border-color: var(--green); color: #fff; }
.option-btn.correct .option-result-icon { opacity: 1; }
.option-btn.wrong   { border-color: var(--red) !important; background: var(--red-bg) !important; }
.option-btn.wrong .option-key   { background: var(--red); border-color: var(--red); color: #fff; }
.option-btn.wrong .option-result-icon { opacity: 1; }
.option-btn.dimmed  { opacity: .42; }

/* Result banner */
.result-banner {
  display: none; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: 11px;
  font-weight: 600; font-size: .9rem; margin-bottom: 14px;
  animation: pop .28s ease;
}
.result-banner.show { display: flex; }
.result-banner.correct-banner { background: var(--green-bg); border: 1.5px solid rgba(34,197,94,.3); color: var(--green); }
.result-banner.wrong-banner   { background: var(--red-bg);   border: 1.5px solid rgba(239,68,68,.3);  color: var(--red); }
@keyframes pop {
  0%  { transform: scale(.94); opacity: 0; }
  65% { transform: scale(1.02); }
  100%{ transform: scale(1);   opacity: 1; }
}
.result-icon { font-size: 1.3rem; }
.result-text { flex: 1; }
.correct-answer-text { font-size: .8rem; color: var(--text2); font-weight: 400; margin-top: 2px; }

/* Explanation */
.explanation-wrap { margin-bottom: 16px; }
.btn-explain {
  display: flex; align-items: center; gap: 7px;
  background: transparent; border: 1.5px solid var(--border2);
  border-radius: 9px; padding: 10px 14px;
  font-family: inherit; font-size: .85rem; font-weight: 600;
  color: var(--text2); cursor: pointer; transition: all .2s;
  min-height: 44px; width: 100%; justify-content: space-between;
}
.btn-explain:active { border-color: var(--accent2); color: var(--accent2); }
.btn-explain svg { width: 15px; height: 15px; transition: transform .2s; flex-shrink: 0; }
.btn-explain.open svg:last-child { transform: rotate(180deg); }

.explanation-body {
  display: none; margin-top: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
  animation: slide-down .22s ease;
}
.explanation-body.show { display: block; }
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.explanation-body p { color: var(--text2); font-size: .86rem; line-height: 1.72; }
.pyq-ref {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
  font-size: .74rem; color: var(--accent3);
  background: rgba(56,189,248,.08); border: 1px solid rgba(56,189,248,.15);
  padding: 3px 10px; border-radius: 99px;
}

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(10,11,20,.96); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 10px 14px calc(10px + var(--safe-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.btn-nav {
  display: flex; align-items: center; justify-content: center; gap: 0;
  background: var(--surface2); border: 1.5px solid var(--border);
  color: var(--text1); border-radius: 10px;
  padding: 0; width: 48px; height: 48px;
  font-size: 0; /* hide text on mobile */ font-family: inherit;
  cursor: pointer; transition: all .2s; flex-shrink: 0;
}
.btn-nav svg { width: 20px; height: 20px; }
.btn-nav:active:not(:disabled) { border-color: var(--accent); color: var(--accent2); }
.btn-nav:disabled { opacity: .3; cursor: default; }
.btn-next {
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  border-color: transparent; box-shadow: 0 3px 14px rgba(108,99,255,.4);
}
.btn-next:active:not(:disabled) { opacity: .85; }

.nav-center { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.nav-indicator { font-size: .8rem; font-weight: 700; color: var(--text2); font-family: 'JetBrains Mono', monospace; }
.jump-wrap { display: flex; align-items: center; gap: 5px; }
.jump-input {
  width: 62px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 8px;
  font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: var(--text1);
  text-align: center; outline: none; transition: border-color .2s; min-height: 34px;
}
.jump-input:focus { border-color: var(--accent); }
.jump-input::-webkit-inner-spin-button,
.jump-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.btn-jump {
  background: rgba(108,99,255,.18); border: 1px solid rgba(108,99,255,.3);
  color: var(--accent2); border-radius: 7px;
  padding: 6px 10px; font-size: .78rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all .2s; min-height: 34px;
}
.btn-jump:active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ══════════════════════════════════════════════
   TABLET  ≥ 600px
   ══════════════════════════════════════════════ */
@media (min-width: 600px) {

  .site-header { padding: calc(14px + var(--safe-top)) 24px 14px; }
  .header-badge {
    display: inline-block;
    font-size: .72rem; font-weight: 600; letter-spacing: .07em;
    padding: 5px 12px; border-radius: 99px;
    background: rgba(108,99,255,.15); border: 1px solid rgba(108,99,255,.3);
    color: var(--accent2);
  }

  .index-main { padding: 40px 24px 60px; }
  .hero { margin-bottom: 36px; }
  .hero-sub { font-size: 1rem; }

  /* Folder card — horizontal on tablet */
  .folder-card { flex-direction: row; align-items: center; padding: 18px 20px; }
  .btn-connect, .btn-refresh { width: auto; }

  /* Paste actions side-by-side */
  .paste-actions { flex-direction: row; }
  .btn-paste-validate { flex: 1; }
  .btn-paste-save     { flex: 2; }

  /* Features 2-col already, now try 4 */
  .features { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  /* Quiz */
  .quiz-topbar { padding: calc(12px + var(--safe-top)) 20px 0; }
  .questions-container { padding: 28px 20px calc(100px + var(--safe-bottom)); }
  .q-header { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .q-tags   { justify-content: flex-end; }
  .q-text   { font-size: 1.05rem; padding: 20px; }
  .option-btn { font-size: .95rem; }
  .btn-explain { width: auto; }

  /* Bottom nav — show text on tablet */
  .btn-nav { width: auto; font-size: .88rem; gap: 6px; padding: 0 18px; height: 48px; }
  .bottom-nav { padding: 12px 20px calc(12px + var(--safe-bottom)); }
}

/* ══════════════════════════════════════════════
   DESKTOP  ≥ 900px
   ══════════════════════════════════════════════ */
@media (min-width: 900px) {
  .index-main { padding: 60px 32px 80px; max-width: 1000px; }
  .hero-title { font-size: clamp(2rem, 4vw, 3.2rem); }
  .hero-sub { font-size: 1.05rem; }

  /* Paste 2-col filename row on desktop */
  .paste-panel-inner { padding: 24px; gap: 18px; }
  .paste-filename-row-desktop {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  }

  .features { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .feature-card { padding: 22px 18px; }
  .feature-icon { font-size: 1.8rem; }
  .feature-card h3 { font-size: .92rem; }
  .feature-card p  { font-size: .8rem; }

  /* Quiz */
  .quiz-topbar { padding: calc(14px + var(--safe-top)) 32px 0; }
  .questions-container { padding: 40px 24px calc(100px + var(--safe-bottom)); max-width: 820px; margin: 0 auto; }
  .q-text { font-size: 1.08rem; padding: 24px 26px; }
  .option-btn { font-size: .95rem; padding: 14px 20px; }
  .option-btn:hover:not(:disabled) { border-color: var(--accent); transform: translateX(4px); }

  /* Desktop hover states (no hover on mobile = no flicker) */
  .paper-item:hover { background: rgba(108,99,255,.07); }
  .paper-item:hover .paper-item-arrow { background: var(--accent); color: #fff; }
  .paste-toggle:hover { border-color: var(--border2); }
  .btn-refresh:hover  { background: var(--accent); color: #fff; border-color: var(--accent); }
  .btn-paste-validate:hover { border-color: var(--accent2); color: var(--accent2); }

  .bottom-nav { padding: 14px 32px calc(14px + var(--safe-bottom)); }
  .btn-nav { padding: 0 24px; height: 46px; }
  .paper-item-arrow { display: flex; }

  .qb-sep   { display: inline; color: var(--text3); }
  .qb-count { display: inline; font-size: .85rem; }
  .qb-title { font-size: .95rem; display: inline; }
  .quiz-meta-bar { display: flex; align-items: center; gap: 8px; }
}
