/* Multi-column flashcard study UI - bright palette */

.page-learn-play {
 --ln-violet: #0071e3;
 --ln-blue: #3b82f6;
 --ln-teal: #14b8a6;
 --ln-green: #22c55e;
 --ln-amber: #f59e0b;
 --ln-coral: #fb7185;
 --ln-pink: #ec4899;
 --ln-indigo: #0071e3;

 height: 100dvh;
 overflow: hidden;
 padding-top: 56px;
 background:
  radial-gradient(ellipse at 0% 0%, rgba(0, 113, 227, 0.14) 0%, transparent 50%),
  radial-gradient(ellipse at 100% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 45%),
  radial-gradient(ellipse at 100% 100%, rgba(20, 184, 166, 0.1) 0%, transparent 50%),
  #eef0f8;
 display: flex;
 flex-direction: column;
}
[data-theme="dark"].page-learn-play {
 background:
  radial-gradient(ellipse at 0% 0%, rgba(0, 113, 227, 0.12) 0%, transparent 50%),
  #121218;
}
.page-learn-play.ln-session-done {
 height: auto;
 min-height: 100dvh;
 overflow: auto;
 background: var(--bg);
}

.ln-wrap {
 flex: 1;
 min-height: 0;
 max-width: 1280px;
 width: 100%;
 margin: 0 auto;
 padding: 0.4rem 0.75rem 0.5rem;
 display: flex;
 flex-direction: column;
 overflow: hidden;
}

/* ── Top bar (full width) ── */
.ln-topbar {
 flex-shrink: 0;
 background: rgba(255, 255, 255, 0.82);
 backdrop-filter: blur(8px);
 border: 1px solid rgba(0, 113, 227, 0.12);
 border-radius: 14px;
 padding: 0.5rem 0.85rem 0.55rem;
 margin-bottom: 0.45rem;
 box-shadow: 0 4px 16px rgba(0, 113, 227, 0.08);
}
[data-theme="dark"] .ln-topbar {
 background: rgba(30, 30, 38, 0.9);
 border-color: var(--border);
}
.ln-breadcrumb {
 font-size: 0.72rem;
 color: var(--muted);
 margin-bottom: 0.25rem;
}
.ln-breadcrumb a { color: var(--muted); text-decoration: none; }
.ln-breadcrumb span { margin: 0 0.25rem; }
.ln-topbar-main {
 display: flex;
 align-items: flex-start;
 justify-content: space-between;
 gap: 0.5rem;
 margin-bottom: 0.4rem;
}
.ln-title {
 font-size: clamp(0.95rem, 2vw, 1.15rem);
 font-weight: 800;
 margin: 0.1rem 0 0;
 color: #2e3856;
 line-height: 1.2;
}
[data-theme="dark"] .ln-title { color: var(--text); }
.ln-head-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; flex-shrink: 0; }
.ln-pill {
 display: inline-flex;
 align-items: center;
 gap: 0.25rem;
 font-size: 0.68rem;
 font-weight: 700;
 border-radius: 999px;
 padding: 0.15rem 0.55rem;
}
.ln-pill--violet { background: rgba(0, 113, 227, 0.15); color: #005bb5; }
.ln-pill--blue { background: rgba(59, 130, 246, 0.15); color: #2563eb; }

.ln-progress-bar {
 height: 6px;
 border-radius: 999px;
 background: rgba(0, 0, 0, 0.06);
 overflow: hidden;
}
.ln-progress-fill {
 height: 100%;
 width: 0%;
 border-radius: 999px;
 background: linear-gradient(90deg, var(--ln-violet), var(--ln-blue), var(--ln-teal));
 transition: width 0.4s ease;
}
.ln-progress-text {
 font-size: 0.72rem;
 font-weight: 600;
 color: #586380;
 margin: 0.25rem 0 0;
 text-align: center;
}

/* ── 3-column layout ── */
.ln-layout {
 flex: 1;
 min-height: 0;
 display: grid;
 grid-template-columns: 240px 1fr 220px;
 gap: 0.65rem;
 overflow: hidden;
}
@media (max-width: 991.98px) {
 .ln-layout { grid-template-columns: 1fr; }
}

.ln-col {
 min-height: 0;
 display: flex;
 flex-direction: column;
 gap: 0.55rem;
 overflow: hidden;
}
.ln-col--left,
.ln-col--right {
 overflow-y: auto;
}
.ln-col--center {
 min-width: 0;
}

/* Side panels */
.ln-panel {
 border-radius: 14px;
 padding: 0.75rem 0.85rem;
 border: 1px solid transparent;
 flex-shrink: 0;
}
.ln-panel-title {
 font-size: 0.72rem;
 font-weight: 800;
 text-transform: uppercase;
 letter-spacing: 0.05em;
 margin: 0 0 0.55rem;
 display: flex;
 align-items: center;
 gap: 0.35rem;
}
.ln-panel--violet {
 background: linear-gradient(145deg, rgba(0, 113, 227, 0.18), rgba(0, 113, 227, 0.06));
 border-color: rgba(0, 113, 227, 0.22);
 color: #5b43e6;
}
.ln-panel--violet .ln-panel-title { color: #005bb5; }
.ln-panel--teal {
 background: linear-gradient(145deg, rgba(20, 184, 166, 0.18), rgba(20, 184, 166, 0.05));
 border-color: rgba(20, 184, 166, 0.22);
}
.ln-panel--teal .ln-panel-title { color: #0d9488; }
.ln-panel--blue {
 background: linear-gradient(145deg, rgba(59, 130, 246, 0.16), rgba(59, 130, 246, 0.05));
 border-color: rgba(59, 130, 246, 0.2);
}
.ln-panel--blue .ln-panel-title { color: #2563eb; }
.ln-panel--amber {
 background: linear-gradient(145deg, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0.05));
 border-color: rgba(245, 158, 11, 0.22);
 flex: 1;
 min-height: 0;
 display: flex;
 flex-direction: column;
}
.ln-panel--amber .ln-panel-title { color: #d97706; }

.ln-panel-topic {
 font-size: 0.95rem;
 font-weight: 800;
 color: #2e3856;
 margin: 0 0 0.15rem;
 line-height: 1.3;
}
[data-theme="dark"] .ln-panel-topic { color: var(--text); }
.ln-panel-sub {
 font-size: 0.78rem;
 color: #586380;
 margin: 0 0 0.5rem;
}
.ln-panel-img {
 border-radius: 10px;
 overflow: hidden;
 margin-bottom: 0.5rem;
 max-height: 90px;
}
.ln-panel-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ln-panel-desc {
 font-size: 0.76rem;
 line-height: 1.45;
 color: #586380;
 margin: 0 0 0.55rem;
}
.ln-panel-link {
 font-size: 0.78rem;
 font-weight: 700;
 color: var(--ln-violet);
 text-decoration: none;
 display: inline-flex;
 align-items: center;
 gap: 0.3rem;
}
.ln-panel-link:hover { text-decoration: underline; }

.ln-action-btn {
 display: flex;
 align-items: center;
 gap: 0.45rem;
 width: 100%;
 padding: 0.5rem 0.65rem;
 border-radius: 10px;
 font-size: 0.8rem;
 font-weight: 700;
 text-decoration: none;
 margin-bottom: 0.4rem;
 transition: transform 0.12s, box-shadow 0.12s;
}
.ln-action-btn:last-child { margin-bottom: 0; }
.ln-action-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.ln-action-btn--amber { background: rgba(245, 158, 11, 0.2); color: #b45309; border: 1px solid rgba(245, 158, 11, 0.35); }
.ln-action-btn--pink { background: rgba(236, 72, 153, 0.15); color: #db2777; border: 1px solid rgba(236, 72, 153, 0.3); }

.ln-live-stats {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 0.4rem;
}
.ln-live-stat {
 border-radius: 10px;
 padding: 0.55rem 0.5rem;
 text-align: center;
 border: 1px solid transparent;
}
.ln-live-stat span {
 display: block;
 font-size: 1.35rem;
 font-weight: 800;
 line-height: 1;
}
.ln-live-stat small {
 font-size: 0.62rem;
 font-weight: 700;
 text-transform: uppercase;
 letter-spacing: 0.03em;
 opacity: 0.85;
}
.ln-live-stat--green {
 background: rgba(34, 197, 94, 0.18);
 border-color: rgba(34, 197, 94, 0.3);
 color: #15803d;
 grid-column: 1 / -1;
}
.ln-live-stat--coral {
 background: rgba(251, 113, 133, 0.18);
 border-color: rgba(251, 113, 133, 0.3);
 color: #e11d48;
}
.ln-live-stat--violet {
 background: rgba(0, 113, 227, 0.15);
 border-color: rgba(0, 113, 227, 0.28);
 color: #005bb5;
}

.ln-mobile-context {
 flex-shrink: 0;
 background: rgba(255, 255, 255, 0.85);
 border: 1px solid rgba(0, 113, 227, 0.15);
 border-radius: 10px;
 padding: 0.35rem 0.6rem;
 font-size: 0.78rem;
 margin-bottom: 0.3rem;
}
.ln-mobile-context summary { font-weight: 700; color: var(--ln-violet); cursor: pointer; list-style: none; }
.ln-swipe-hint {
 text-align: center;
 font-size: 0.65rem;
 color: var(--muted);
 margin: 0 0 0.25rem;
 flex-shrink: 0;
}

/* ── Center deck ── */
.ln-deck-shell {
 flex: 1;
 min-height: 0;
 display: grid;
 grid-template-columns: auto 1fr auto;
 align-items: stretch;
 gap: 0.4rem;
}
@media (max-width: 575.98px) {
 .ln-deck-shell { grid-template-columns: 1fr; }
 .ln-arrow--side { display: none; }
}

.ln-main {
 min-height: 0;
 display: flex;
 flex-direction: column;
 overflow: hidden;
}

.ln-arrow {
 width: 46px;
 height: 46px;
 border-radius: 50%;
 border: 2px solid rgba(0, 113, 227, 0.2);
 background: var(--card-bg);
 color: var(--ln-violet);
 font-size: 1.2rem;
 display: flex;
 align-items: center;
 justify-content: center;
 cursor: pointer;
 box-shadow: 0 4px 14px rgba(0, 113, 227, 0.15);
 transition: all 0.15s;
 align-self: center;
 flex-shrink: 0;
}
.ln-arrow:hover:not(:disabled) {
 background: var(--ln-violet);
 color: #fff;
 transform: scale(1.06);
}
.ln-arrow:disabled { opacity: 0.3; cursor: default; }

.ln-deck {
 flex: 1;
 min-height: 0;
 position: relative;
 perspective: 1400px;
}
.ln-slide { display: none; width: 100%; height: 100%; }
.ln-slide.is-active { display: block; }

.ln-flashcard {
 width: 100%;
 height: 100%;
 min-height: 0;
 max-width: 100%;
 margin: 0 auto;
 cursor: pointer;
}
.ln-flashcard.is-rated { cursor: default; }

.ln-flashcard-inner {
 width: 100%;
 height: 100%;
 min-height: 0;
 position: relative;
 transform-style: preserve-3d;
 transition: transform 0.45s cubic-bezier(0.4, 0.15, 0.2, 1);
}
.ln-flashcard.is-flipped .ln-flashcard-inner { transform: rotateX(180deg); }

.ln-flashcard-face {
 position: absolute;
 inset: 0;
 backface-visibility: hidden;
 -webkit-backface-visibility: hidden;
 border-radius: 18px;
 background: var(--card-bg);
 display: flex;
 flex-direction: column;
 overflow: hidden;
 border: 2px solid transparent;
 box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .ln-flashcard-face {
 background: var(--card-bg);
 box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.ln-flashcard-back { transform: rotateX(180deg); }

/* Card accent colors */
.ln-fc-accent-0 .ln-flashcard-front { border-top: 4px solid var(--ln-violet); border-color: rgba(0, 113, 227, 0.25); border-top-color: var(--ln-violet); }
.ln-fc-accent-1 .ln-flashcard-front { border-top: 4px solid var(--ln-blue); border-color: rgba(59, 130, 246, 0.25); border-top-color: var(--ln-blue); }
.ln-fc-accent-2 .ln-flashcard-front { border-top: 4px solid var(--ln-teal); border-color: rgba(20, 184, 166, 0.25); border-top-color: var(--ln-teal); }
.ln-fc-accent-3 .ln-flashcard-front { border-top: 4px solid var(--ln-amber); border-color: rgba(245, 158, 11, 0.28); border-top-color: var(--ln-amber); }
.ln-fc-accent-0 .ln-fc-side-label { color: var(--ln-violet); }
.ln-fc-accent-1 .ln-fc-side-label { color: var(--ln-blue); }
.ln-fc-accent-2 .ln-fc-side-label { color: var(--ln-teal); }
.ln-fc-accent-3 .ln-fc-side-label { color: var(--ln-amber); }
.ln-fc-accent-0 .ln-show-answer-btn { background: var(--ln-violet); }
.ln-fc-accent-1 .ln-show-answer-btn { background: var(--ln-blue); }
.ln-fc-accent-2 .ln-show-answer-btn { background: var(--ln-teal); }
.ln-fc-accent-3 .ln-show-answer-btn { background: var(--ln-amber); color: #422006; }

.ln-fc-side-label {
 flex-shrink: 0;
 text-align: center;
 font-size: 0.72rem;
 font-weight: 800;
 text-transform: uppercase;
 letter-spacing: 0.08em;
 padding: 0.85rem 1rem 0;
}
.ln-fc-content {
 flex: 1;
 min-height: 0;
 display: flex;
 align-items: center;
 justify-content: center;
 padding: 0.65rem 1.15rem;
 overflow-y: auto;
}
.ln-fc-question {
 font-size: clamp(1rem, 2.5vw, 1.4rem);
 font-weight: 700;
 line-height: 1.45;
 margin: 0;
 color: #2e3856;
 text-align: center;
 width: 100%;
}
.ln-show-answer-btn {
 flex-shrink: 0;
 margin: 0 1.15rem 1.1rem;
 padding: 0.7rem 1rem;
 border: none;
 border-radius: 999px;
 color: #fff;
 font-size: 0.92rem;
 font-weight: 800;
 cursor: pointer;
 transition: transform 0.12s, filter 0.12s;
}
.ln-show-answer-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

.ln-fc-back-scroll {
 flex: 1;
 min-height: 0;
 overflow-y: auto;
 padding: 0.2rem 1.1rem 0.45rem;
 text-align: center;
}
.ln-fc-answer-big {
 font-size: clamp(0.95rem, 2.4vw, 1.25rem);
 font-weight: 700;
 line-height: 1.45;
 color: #2e3856;
 margin: 0 0 0.65rem;
}
.ln-fc-answer-letter {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 width: 1.65rem;
 height: 1.65rem;
 border-radius: 8px;
 background: rgba(34, 197, 94, 0.22);
 color: #15803d;
 font-weight: 800;
 font-size: 0.9rem;
 margin-right: 0.3rem;
 vertical-align: middle;
}
.ln-fc-choices-fold { text-align: left; margin-bottom: 0.55rem; font-size: 0.76rem; }
.ln-fc-choices-fold summary { cursor: pointer; color: var(--ln-blue); font-weight: 700; }
.ln-fc-choices { list-style: none; margin: 0; padding: 0; }
.ln-fc-choice {
 padding: 0.3rem 0.45rem;
 border-radius: 7px;
 margin-bottom: 0.2rem;
 font-size: 0.78rem;
 display: flex;
 gap: 0.35rem;
 color: #586380;
}
.ln-fc-choice.is-correct { background: rgba(34, 197, 94, 0.15); color: #15803d; font-weight: 700; }
.ln-fc-choice-letter { font-weight: 800; }
.ln-fc-explain {
 font-size: 0.82rem;
 line-height: 1.48;
 text-align: left;
 margin: 0 0 0.45rem;
 padding: 0.55rem 0.65rem;
 background: rgba(59, 130, 246, 0.1);
 border-left: 3px solid var(--ln-blue);
 border-radius: 0 8px 8px 0;
 color: #374151;
}
.ln-fc-funfact {
 font-size: 0.8rem;
 font-style: italic;
 text-align: left;
 margin: 0 0 0.45rem;
 padding: 0.5rem 0.6rem;
 background: rgba(245, 158, 11, 0.12);
 border-left: 3px solid var(--ln-amber);
 border-radius: 0 8px 8px 0;
 color: #92400e;
}
.ln-fc-ref {
 display: block;
 font-size: 0.7rem;
 color: var(--ln-violet);
 word-break: break-all;
}

.ln-rate-bar {
 flex-shrink: 0;
 display: grid;
 grid-template-columns: 1fr 1fr;
 border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.ln-rate {
 border: none;
 background: transparent;
 padding: 0.8rem 0.45rem;
 font-size: 0.8rem;
 font-weight: 800;
 cursor: pointer;
 display: flex;
 align-items: center;
 justify-content: center;
 gap: 0.3rem;
 transition: background 0.12s;
}
.ln-rate--learning {
 color: #e11d48;
 border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.ln-rate--learning:hover { background: rgba(251, 113, 133, 0.15); }
.ln-rate--know { color: #15803d; }
.ln-rate--know:hover { background: rgba(34, 197, 94, 0.15); }
.ln-rate-bar.is-rated .ln-rate { pointer-events: none; }

/* Dots - multi-column grid on right panel */
.ln-foot-dots--grid {
 display: grid;
 grid-template-columns: repeat(5, 1fr);
 gap: 6px;
 flex: 1;
 min-height: 0;
 overflow-y: auto;
 align-content: start;
 padding: 0.15rem 0;
}
.ln-foot-dots--mobile {
 display: flex;
 flex-wrap: wrap;
 gap: 5px;
 justify-content: center;
 max-height: 2rem;
 overflow-y: auto;
 margin-top: 0.25rem;
}
.ln-dot {
 width: 100%;
 aspect-ratio: 1;
 max-width: 28px;
 max-height: 28px;
 border-radius: 8px;
 background: rgba(0, 113, 227, 0.15);
 border: none;
 padding: 0;
 cursor: pointer;
 transition: transform 0.12s, background 0.12s;
}
.ln-foot-dots--mobile .ln-dot {
 width: 9px;
 height: 9px;
 max-width: none;
 max-height: none;
 border-radius: 50%;
 aspect-ratio: auto;
}
.ln-dot.is-current {
 background: var(--ln-violet);
 transform: scale(1.08);
 box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.35);
}
.ln-dot.is-know { background: var(--ln-green); }
.ln-dot.is-learning { background: var(--ln-coral); }
.ln-dot.is-flipped-only { background: var(--ln-blue); opacity: 0.65; }

.ln-foot--center {
 flex-shrink: 0;
 text-align: center;
 padding: 0.3rem 0 0.1rem;
}
.ln-counter {
 font-size: 0.9rem;
 font-weight: 800;
 color: #586380;
 margin: 0;
}
.ln-keyboard-hint {
 font-size: 0.65rem;
 color: #586380;
 margin: 0.45rem 0 0;
 text-align: center;
 opacity: 0.85;
}

.ln-complete {
 flex: 1;
 overflow-y: auto;
 text-align: center;
 background: var(--card-bg);
 border-radius: 16px;
 padding: 1.5rem 1rem;
 border: 1px solid var(--border);
}
.ln-complete-stats {
 display: flex;
 justify-content: center;
 gap: 0.65rem;
 margin-bottom: 1rem;
 flex-wrap: wrap;
}
.ln-stat {
 min-width: 82px;
 padding: 0.65rem;
 border-radius: 12px;
 border: 1px solid transparent;
}
.ln-stat span { display: block; font-size: 1.45rem; font-weight: 800; }
.ln-stat small { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; }
.ln-stat--ok { background: rgba(34, 197, 94, 0.15); border-color: rgba(34, 197, 94, 0.3); }
.ln-stat--ok span { color: #15803d; }
.ln-stat--bad { background: rgba(251, 113, 133, 0.15); border-color: rgba(251, 113, 133, 0.3); }
.ln-stat--bad span { color: #e11d48; }
.ln-stat--pct { background: rgba(0, 113, 227, 0.12); border-color: rgba(0, 113, 227, 0.25); }
.ln-stat--pct span { color: var(--ln-violet); }
.ln-complete-actions {
 display: flex;
 flex-wrap: wrap;
 gap: 0.4rem;
 justify-content: center;
}

.page-learn-play .learn-hero-eyebrow { color: var(--ln-violet); font-weight: 700; }
.page-learn-play.ln-session-active .site-footer { display: none; }

/* ── Mobile: flashcard study ── */
@media (max-width: 991.98px) {
  .ln-layout {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .ln-col--center {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .ln-deck-shell {
    flex: 1;
    min-height: 0;
  }
  .ln-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .ln-deck {
    flex: 1;
    min-height: 180px;
  }
}

@media (max-width: 767.98px) {
  .page-learn-play {
    padding-top: 56px;
  }
  .ln-wrap {
    padding: 0.3rem 0.5rem 0.4rem;
  }
  .ln-topbar {
    padding: 0.4rem 0.65rem 0.45rem;
    margin-bottom: 0.3rem;
    border-radius: 12px;
  }
  .ln-topbar-main {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
  }
  .ln-topbar-main .learn-hero-eyebrow {
    display: none;
  }
  .ln-title {
    font-size: 0.92rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .ln-head-meta {
    flex-shrink: 0;
    flex-wrap: nowrap;
    gap: 0.25rem;
  }
  .ln-pill {
    font-size: 0.6rem;
    padding: 0.12rem 0.45rem;
    white-space: nowrap;
  }
  .ln-pill--violet {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ln-progress-bar {
    height: 5px;
  }
  .ln-progress-text {
    font-size: 0.68rem;
    margin-top: 0.15rem;
  }
  .ln-mobile-context {
    padding: 0.3rem 0.55rem;
    font-size: 0.72rem;
    margin-bottom: 0.2rem;
  }
  .ln-swipe-hint {
    display: none;
  }
  .ln-fc-side-label {
    padding: 0.55rem 0.75rem 0;
    font-size: 0.65rem;
  }
  .ln-fc-content {
    padding: 0.45rem 0.85rem;
  }
  .ln-fc-question {
    font-size: 1rem;
    line-height: 1.4;
  }
  .ln-show-answer-btn {
    min-height: 48px;
    margin: 0 0.75rem 0.75rem;
    font-size: 0.88rem;
  }
  .ln-fc-back-scroll {
    padding: 0.15rem 0.75rem 0.35rem;
  }
  .ln-fc-answer-big {
    font-size: 0.95rem;
  }
  .ln-rate {
    min-height: 48px;
    padding: 0.7rem 0.4rem;
    font-size: 0.78rem;
  }
  .ln-foot--center {
    flex-shrink: 0;
    padding: 0.25rem 0 calc(0.15rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(238, 240, 248, 0.98) 65%, transparent);
  }
  [data-theme="dark"] .ln-foot--center {
    background: linear-gradient(to top, rgba(18, 18, 24, 0.98) 65%, transparent);
  }
  .ln-counter {
    font-size: 0.82rem;
  }
  .ln-foot-dots--mobile {
    max-height: 1.25rem;
    margin-top: 0.2rem;
  }
  .ln-flashcard-face {
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
 .ln-flashcard-inner { transition: none; }
}

/* ── Server-step learn (landing + link controls) ── */
body.page-learn-landing {
  height: auto;
  min-height: 100dvh;
  overflow: auto;
}

body.page-learn-landing .ln-wrap {
  overflow: visible;
  min-height: auto;
}

body.page-learn-landing .ln-layout--landing {
  min-height: 360px;
}

.ln-landing-start {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  margin-top: 0.5rem;
}
[data-theme="dark"] .ln-landing-start {
  background: rgba(30, 30, 38, 0.92);
}

.ln-landing-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--ln-indigo), var(--ln-blue));
}

a.ln-arrow {
  text-decoration: none;
  color: inherit;
}

a.ln-dot {
  display: block;
  text-decoration: none;
}

.ln-rate-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  margin: 0;
}

.ln-rated-pill {
  margin: 0 1rem 1rem;
  padding: 0.65rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}
.ln-rated-pill--know {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
.ln-rated-pill--learning {
  background: rgba(251, 113, 133, 0.15);
  color: #e11d48;
}

.ln-complete.is-visible {
  display: block;
  margin: 2rem auto;
  max-width: 520px;
}

.tq-guest-modal {
  border-radius: 20px;
  background: var(--card-bg, #fff);
}
.tq-guest-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ln-indigo), var(--ln-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: #fff;
  font-size: 1.75rem;
}
#stepGuestModal { z-index: 1065; }

/* ═══════════════════════════════════════════════════════════
   Learn v2 - catalog / quiz aligned theme
   ═══════════════════════════════════════════════════════════ */
body.ln-v2 {
  --ln-v2-purple: #0071e3;
  --ln-v2-purple-dark: #005bb5;
  --ln-v2-purple-light: #e8f4fc;
  --ln-v2-teal: #0d9488;
  --ln-v2-gutter: clamp(0.85rem, 2.8vw, 2.75rem);
  --ln-v2-toolbar-h: 52px;
  --ln-v2-session-bar-h: 44px;
}

body.ln-v2.page-learn-landing {
  height: auto;
  min-height: 100dvh;
  overflow: auto;
  padding-top: 56px;
  background: var(--bg, #f8fafc);
}
[data-theme="dark"] body.ln-v2.page-learn-landing {
  background: var(--bg);
}

body.ln-v2.ln-session-active {
  padding-top: calc(56px + var(--ln-v2-toolbar-h) + var(--ln-v2-session-bar-h));
  background: var(--bg, #f8fafc);
}
[data-theme="dark"] body.ln-v2.ln-session-active {
  background: var(--bg);
}

.ln-v2-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(0.75rem, 1.5vw, 1.25rem) var(--ln-v2-gutter) clamp(2rem, 3vw, 2.5rem);
}

.ln-v2-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.ln-v2-crumb a {
  color: var(--ln-v2-purple);
  font-weight: 600;
  text-decoration: none;
}
.ln-v2-crumb a:hover { text-decoration: underline; }

.ln-v2-resume {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: var(--ln-v2-purple-light);
  border: 1px solid rgba(0, 113, 227, 0.2);
  font-size: 0.85rem;
  font-weight: 600;
}
.ln-v2-resume > i { color: var(--ln-v2-purple); }
.ln-v2-resume-btn {
  margin-left: auto;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--ln-v2-purple);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}
.ln-v2-resume-btn:hover { background: var(--ln-v2-purple-dark); color: #fff; }

.ln-v2-layout {
  display: grid;
  grid-template-columns: minmax(200px, 15rem) minmax(0, 1fr) minmax(240px, 17rem);
  gap: clamp(1rem, 1.5vw, 1.5rem);
  align-items: start;
}
@media (max-width: 1099.98px) {
  .ln-v2-layout { grid-template-columns: minmax(180px, 13rem) minmax(0, 1fr); }
  .ln-v2-side--right {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
  }
}
@media (max-width: 899.98px) {
  .ln-v2-side--right { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .ln-v2-layout { grid-template-columns: 1fr; }
  .ln-v2-side--left { order: 2; }
  .ln-v2-main { order: 1; }
  .ln-v2-side--right { order: 3; grid-template-columns: 1fr; }
}

.ln-v2-main {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem 1.35rem 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 113, 227, 0.06);
  min-width: 0;
}
[data-theme="dark"] .ln-v2-main { background: var(--card-bg); }

.ln-v2-page-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.ln-v2-page-head-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--ln-v2-purple-light);
  color: var(--ln-v2-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.ln-v2-eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ln-v2-teal);
}
.ln-v2-page-title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ln-v2-page-lead {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.ln-v2-mode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
}
.ln-v2-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.ln-v2-mode-pill--active {
  background: var(--ln-v2-purple);
  border-color: var(--ln-v2-purple);
  color: #fff;
}
.ln-v2-mode-pill:not(.ln-v2-mode-pill--active):hover {
  border-color: var(--ln-v2-purple);
  color: var(--ln-v2-purple);
  text-decoration: none;
}

.ln-v2-start-card {
  display: grid;
  grid-template-columns: minmax(120px, 200px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  padding: 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.04), rgba(255, 255, 255, 0.9));
}
@media (max-width: 575.98px) {
  .ln-v2-start-card { grid-template-columns: 1fr; text-align: center; }
}
.ln-v2-start-visual {
  aspect-ratio: 1;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 113, 227, 0.25);
}
.ln-v2-start-body h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
}
.ln-v2-start-body > p {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}
.ln-v2-start-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.ln-v2-start-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.ln-v2-start-list i { color: var(--ln-v2-teal); flex-shrink: 0; margin-top: 0.1rem; }
.ln-v2-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 200px;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: var(--ln-v2-purple);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 113, 227, 0.32);
  transition: background 0.15s, transform 0.12s;
}
.ln-v2-start-btn:hover {
  background: var(--ln-v2-purple-dark);
  transform: translateY(-1px);
}
@media (max-width: 575.98px) {
  .ln-v2-start-btn { width: 100%; min-width: 0; }
}

.ln-v2-panel {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid transparent;
}
.ln-v2-panel:last-child { margin-bottom: 0; }
.ln-v2-panel-title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.ln-v2-panel--purple {
  background: var(--ln-v2-purple-light);
  border-color: rgba(0, 113, 227, 0.15);
  color: var(--ln-v2-purple-dark);
}
.ln-v2-panel--topic {
  background: var(--card-bg);
  border-color: var(--border);
  border-left: 4px solid var(--topic-from, var(--ln-v2-purple));
}
.ln-v2-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.ln-v2-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}
.ln-v2-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ln-v2-purple);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ln-v2-topic-img {
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.55rem;
}
.ln-v2-topic-img img { width: 100%; height: auto; display: block; }
.ln-v2-topic-name {
  margin: 0 0 0.15rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.ln-v2-topic-sub {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.ln-v2-topic-desc {
  margin: 0 0 0.55rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
}
.ln-v2-panel-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ln-v2-purple);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.ln-v2-panel-link:hover { text-decoration: underline; }

.ln-v2-info {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid transparent;
}
.ln-v2-info:last-child { margin-bottom: 0; }
.ln-v2-info h3 {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.ln-v2-info p {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}
.ln-v2-info--purple { background: var(--ln-v2-purple-light); border-color: rgba(0, 113, 227, 0.12); }
.ln-v2-info--amber { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.2); }
.ln-v2-info--blue { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); }
.ln-v2-info--green { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.2); }
.ln-v2-info-icon { font-size: 1.5rem; color: var(--ln-v2-purple); margin-bottom: 0.35rem; }
.ln-v2-info-btn {
  display: inline-flex;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ln-v2-purple);
  text-decoration: none;
}
.ln-v2-info-btn:hover { background: var(--ln-v2-purple-light); text-decoration: none; }
.ln-v2-info-link {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ln-v2-purple);
  text-decoration: none;
}

.ln-v2-trust {
  margin-top: 1.5rem;
  width: calc(100% + 2 * var(--ln-v2-gutter));
  margin-left: calc(-1 * var(--ln-v2-gutter));
  margin-right: calc(-1 * var(--ln-v2-gutter));
  padding: 1rem var(--ln-v2-gutter);
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .ln-v2-trust { background: var(--card-bg); }
.ln-v2-trust-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 1400px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.ln-v2-trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.ln-v2-trust-list i { color: var(--ln-v2-purple); font-size: 1rem; }
.ln-v2-trust-list strong { display: block; color: var(--text); font-size: 0.82rem; }
@media (max-width: 767.98px) {
  .ln-v2-trust-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 479.98px) {
  .ln-v2-trust-list { grid-template-columns: 1fr; }
}

/* Session toolbar */
.ln-v2-toolbar {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 1020;
  height: var(--ln-v2-toolbar-h);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 var(--ln-v2-gutter);
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
[data-theme="dark"] .ln-v2-toolbar { background: rgba(24, 24, 30, 0.95); }
.ln-v2-toolbar-back,
.ln-v2-toolbar-exit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
}
.ln-v2-toolbar-back:hover,
.ln-v2-toolbar-exit:hover {
  border-color: var(--ln-v2-purple);
  color: var(--ln-v2-purple);
  text-decoration: none;
}
.ln-v2-toolbar-center {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ln-v2-toolbar-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ln-v2-toolbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.12);
  color: var(--ln-v2-teal);
  font-size: 0.68rem;
  font-weight: 800;
}

.ln-v2-session-bar {
  position: fixed;
  top: calc(56px + var(--ln-v2-toolbar-h));
  left: 0;
  right: 0;
  z-index: 1019;
  height: var(--ln-v2-session-bar-h);
  padding: 0.35rem var(--ln-v2-gutter) 0.45rem;
  background: var(--bg, #f8fafc);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .ln-v2-session-bar { background: var(--bg); }
.ln-v2-session-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.12);
  overflow: hidden;
}
.ln-v2-session-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ln-v2-purple), #42a5f5);
  transition: width 0.35s ease;
}
.ln-v2-session-text {
  margin: 0.2rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

body.ln-v2.ln-session-active .ln-wrap.ln-v2-session-wrap {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.5rem var(--ln-v2-gutter) 0.65rem;
  height: calc(100dvh - 56px - var(--ln-v2-toolbar-h) - var(--ln-v2-session-bar-h));
  overflow: hidden;
}
body.ln-v2.ln-session-active .ln-layout {
  grid-template-columns: minmax(200px, 15rem) minmax(0, 1fr) minmax(220px, 16rem);
  gap: clamp(0.65rem, 1vw, 1rem);
}
@media (max-width: 991.98px) {
  body.ln-v2.ln-session-active .ln-layout { grid-template-columns: 1fr; }
}

.ln-action-btn--violet {
  background: rgba(0, 113, 227, 0.12);
  color: var(--ln-v2-purple);
  border: 1px solid rgba(0, 113, 227, 0.28);
}

body.ln-v2.ln-session-active .ln-flashcard {
  border-color: rgba(0, 113, 227, 0.2);
  box-shadow: 0 12px 36px rgba(0, 113, 227, 0.12);
}
body.ln-v2.ln-session-active .ln-show-answer-btn {
  background: var(--ln-v2-purple);
}
body.ln-v2.ln-session-active .ln-show-answer-btn:hover {
  background: var(--ln-v2-purple-dark);
}
body.ln-v2.ln-session-active .ln-arrow {
  border-color: rgba(0, 113, 227, 0.25);
  color: var(--ln-v2-purple);
}
body.ln-v2.ln-session-active .ln-arrow:hover {
  background: var(--ln-v2-purple);
  color: #fff;
}

@media (max-width: 767.98px) {
  body.ln-v2.page-learn-landing { --ln-v2-gutter: 0.75rem; }
  .ln-v2-side--left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .ln-v2-main { padding: 1rem 0.85rem; }
  .ln-v2-mode-pills { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .ln-v2-mode-pills::-webkit-scrollbar { display: none; }
  .ln-v2-mode-pill { flex-shrink: 0; }
}
@media (max-width: 479.98px) {
  .ln-v2-side--left { grid-template-columns: 1fr; }
}
