/* LearnPractice Shared Stylesheet (v2) */
:root {
    --primary: #2563eb; --primary-hover: #1d4ed8; --primary-light: #eff6ff;
    --dark: #0f172a; --light-bg: #f8fafc; --card-bg: #ffffff; --card-border: #e2e8f0;
    --text-main: #0f172a; --text-muted: #64748b; --nav-bg: rgba(255, 255, 255, 0.95);
    --tile-hover-shadow: rgba(37, 99, 235, 0.08); --touch-target: 44px;
    --highlight-border: #2563eb; --highlight-bg: #eff6ff;
    --svg-accent: #2563eb; --svg-track: #cbd5e1; --svg-box-bg: #f1f5f9;
    --container-padding: clamp(1rem, 3.5vw, 2rem);
}
[data-theme="dark"] {
    --primary: #3b82f6; --primary-hover: #60a5fa; --primary-light: rgba(59, 130, 246, 0.15);
    --dark: #f8fafc; --light-bg: #0b0f19; --card-bg: #111827; --card-border: #1f293d;
    --text-main: #f8fafc; --text-muted: #94a3b8; --nav-bg: rgba(17, 24, 39, 0.94);
    --tile-hover-shadow: rgba(0, 0, 0, 0.4); --highlight-border: #60a5fa;
    --highlight-bg: rgba(59, 130, 246, 0.2); --svg-accent: #38bdf8;
    --svg-track: #334155; --svg-box-bg: #1e293b;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { max-width: 100%; overflow-x: clip; }
body { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: var(--light-bg); color: var(--text-main); line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; transition: background-color 0.2s ease, color 0.2s ease; }
header { position: sticky; top: 0; z-index: 1000; background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--card-border); width: 100%; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0.7rem var(--container-padding); display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.nav-left, .nav-right { display: flex; align-items: center; gap: 0.65rem; }
.logo { font-size: clamp(1.2rem, 3vw, 1.45rem); font-weight: 800; letter-spacing: -0.025em; color: var(--text-main); text-decoration: none; white-space: nowrap; }
.logo span { color: var(--primary); }
.nav-link-btn { padding: 0.4rem 0.85rem; border-radius: 8px; border: 1px solid var(--card-border); background: var(--card-bg); color: var(--text-main); font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: all 0.15s ease; }
.nav-link-btn:hover { border-color: var(--primary); color: var(--primary); }
/* Unified Dark/Light Mode Emoji Button */
.icon-btn, #themeToggle { width: 38px; height: 38px; min-width: 38px; min-height: 38px; border-radius: 8px; border: 1px solid var(--card-border); background: var(--card-bg); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.15s ease; flex-shrink: 0; font-size: 1.15rem; line-height: 1; }
.icon-btn:hover, #themeToggle:hover { color: var(--primary); border-color: var(--primary); }
#themeEmoji { font-size: 1.15rem; line-height: 1; display: inline-block; pointer-events: none; }
/* Extracted SVG Diagrams */
.lp-diagram-svg { display: block; max-width: 100%; height: auto; margin: 0.75rem auto; border-radius: 10px; }
[data-theme="dark"] .lp-diagram-svg { background-color: #f8fafc; padding: 0.55rem; border: 1px solid #334155; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
/* Cross-Subject Differentiation Note */
.cross-link-note { margin: 0.75rem 0 1rem; padding: 0.65rem 0.95rem; border-radius: 9px; border: 1px solid var(--card-border); border-left: 4px solid var(--primary); background: var(--primary-light); color: var(--text-main); font-size: 0.88rem; line-height: 1.45; }
.cross-link-note a { color: var(--primary); font-weight: 700; text-decoration: none; }
.cross-link-note a:hover { text-decoration: underline; }
footer { background: var(--card-bg); border-top: 1px solid var(--card-border); padding: 2.2rem var(--container-padding) 1.5rem; margin-top: auto; width: 100%; }
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr)); gap: 1.75rem; margin-bottom: 1.5rem; }
.footer-brand h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.footer-brand h3 span { color: var(--primary); }
.footer-brand p { color: var(--text-muted); font-size: 0.86rem; max-width: 340px; }
.footer-col h4 { font-size: 0.86rem; font-weight: 700; margin-bottom: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-main); }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.footer-col a { color: var(--text-muted); text-decoration: none; font-size: 0.86rem; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding-top: 1.15rem; border-top: 1px solid var(--card-border); text-align: center; font-size: 0.84rem; color: var(--text-muted); }
img, svg, canvas, video { max-width: 100%; }
.sr-only-heading { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 768px) { .footer-container { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
    body { -webkit-text-size-adjust: 100%; }
    button, .opt-btn, .option-btn, .option-item, .opt-item, .choice-card { min-height: 44px; }
    .table-wrap, .table-wrapper, .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    pre, code, .q-text, .question-text, .explanation-text { overflow-wrap: break-word; word-wrap: break-word; }
    .footer-container { grid-template-columns: 1fr; }
}

/* WCAG AA Dark-Mode Contrast Polish for Correct/Success Badges & Interactive Buttons */
[data-theme="dark"] .option-btn.state-correct .option-prefix,
[data-theme="dark"] .option-item.correct-state .option-key,
[data-theme="dark"] .palette-btn.correct,
[data-theme="dark"] .btn-success,
[data-theme="dark"] .svg-option-btn.state-correct .opt-label,
[data-theme="dark"] .river-stone.completed,
[data-theme="dark"] .ladder-rung.step-complete .rung-num-badge {
    background-color: #15803d !important;
    color: #ffffff !important;
}
[data-theme="dark"] .f-dot.filled {
    background-color: #22c55e !important;
    color: #052e16 !important;
}
