/* LearnWise Practice Hub - stylesheet. Teal-blue and green on white. */
:root {
  --teal: #0b6e7a;
  --teal-dark: #084e57;
  --green: #1b7f4b;
  --green-dark: #146339;
  --ink: #17262e;
  --muted: #4a5b66;
  --line: #d3e0e4;
  --bg-alt: #f1f8f8;
  --white: #ffffff;
  --bad: #a4262c;
  --radius: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif; color: var(--ink); background: var(--white); line-height: 1.6; font-size: 1rem; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { color: var(--teal-dark); }
:focus-visible { outline: 3px solid #f2a900; outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--teal-dark); margin: 0 0 .6em; }
h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3.5vw, 1.8rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; margin-left: auto; margin-right: auto; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none; }
.small { font-size: .9rem; color: var(--muted); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--teal-dark); color: #fff; padding: 10px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* Header */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo { width: 42px; height: 42px; border-radius: 10px; background: linear-gradient(135deg, var(--teal), var(--green)); color: #fff; font-weight: 800; font-size: 1.5rem; display: grid; place-items: center; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; font-size: 1.05rem; }
.brand-text strong { color: var(--teal-dark); }
.brand-text small { color: var(--muted); font-size: .75rem; }
.nav-toggle { display: none; margin-left: auto; background: var(--white); border: 2px solid var(--teal); color: var(--teal-dark); border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 8px 10px; text-decoration: none; color: var(--ink); border-radius: 8px; font-weight: 500; }
.site-nav a:hover { background: var(--bg-alt); color: var(--teal-dark); }
.header-search { margin-left: auto; display: flex; gap: 6px; }
.header-search input { width: 170px; }
.header-search button { background: var(--teal); color: #fff; border: 0; border-radius: 8px; padding: 0 14px; font: inherit; font-weight: 600; cursor: pointer; }
.header-search button:hover { background: var(--teal-dark); }
input[type="text"], input[type="search"], input[type="email"], select, textarea { font: inherit; padding: 9px 11px; border: 1.5px solid #8aa3ab; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
@media (max-width: 860px) {
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; width: 100%; order: 3; }
  .js .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .header-search { order: 4; width: 100%; margin-left: 0; }
  .header-search input { width: 100%; flex: 1; }
  .brand { flex: 1; }
}

/* Buttons */
.btn { display: inline-block; background: var(--teal); color: #fff; border: 2px solid var(--teal); padding: 10px 18px; border-radius: 10px; text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; text-align: center; min-height: 44px; }
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn-green { background: var(--green); border-color: var(--green); }
.btn-green:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-outline { background: #fff; color: var(--teal-dark); }
.btn-outline:hover { background: var(--bg-alt); color: var(--teal-dark); }
.btn-lg { padding: 13px 24px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Hero */
.hero { background: linear-gradient(135deg, #e6f4f3 0%, #eaf7ee 100%); border-bottom: 1px solid var(--line); padding: 40px 0; }
.hero-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: center; }
.eyebrow { color: var(--green-dark); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; margin-bottom: .4em; }
.lead { font-size: 1.1rem; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hero-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; }
.hero-stat { display: flex; align-items: baseline; gap: 12px; }
.hero-stat strong { font-size: 2rem; color: var(--teal); min-width: 3ch; }
.hero-stat span { color: var(--muted); }
@media (max-width: 760px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding: 28px 0; } }

/* Sections and cards */
.section { padding: 36px 0; }
.section.alt { background: var(--bg-alt); }
.page-head { padding-top: 24px; padding-bottom: 8px; }
.class-grid, .subject-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.class-grid { grid-template-columns: repeat(5, 1fr); }
.subject-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .class-grid { grid-template-columns: repeat(3, 1fr); } .subject-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .class-grid { grid-template-columns: repeat(2, 1fr); } }
.class-card { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 18px 10px; border: 2px solid var(--line); border-radius: var(--radius); text-decoration: none; background: #fff; color: var(--ink); height: 100%; }
.class-card:hover { border-color: var(--teal); }
.class-num { width: 54px; height: 54px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; font-size: 1.5rem; display: grid; place-items: center; }
.class-label { font-weight: 700; margin-top: 6px; color: var(--teal-dark); }
.class-meta { font-size: .85rem; color: var(--muted); }
.subject-card { display: block; border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; text-decoration: none; color: var(--ink); height: 100%; }
a.subject-card:hover { border-color: var(--green); }
.subject-card.disabled { background: #f6f8f9; color: var(--muted); }
.badge { display: inline-block; background: #fff3d1; color: #5c4400; border: 1px solid #e3c36a; border-radius: 999px; padding: 1px 10px; font-size: .8rem; font-weight: 700; margin-right: 6px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .card-grid { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.card p { color: var(--muted); }
.card .btn { margin-top: auto; align-self: flex-start; }
.tag { display: inline-block; background: #e1f1f3; color: var(--teal-dark); border-radius: 6px; padding: 2px 8px; font-size: .8rem; font-weight: 700; margin-bottom: 6px; }
.tag-green { background: #e0f3e8; color: var(--green-dark); }

/* Filters and results */
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr auto; gap: 12px; align-items: end; margin-bottom: 12px; }
.filters label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .9rem; }
@media (max-width: 860px) { .filters { grid-template-columns: 1fr 1fr; } .filters > div:first-child { grid-column: 1 / -1; } }
.status { color: var(--muted); min-height: 1.6em; }
.results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 700px) { .results { grid-template-columns: 1fr; } }
.result { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 4px; }
.result a { font-weight: 700; font-size: 1.05rem; }
.result-desc { color: var(--muted); font-size: .92rem; }
.table-wrap { overflow-x: auto; }
.topic-table { width: 100%; border-collapse: collapse; background: #fff; }
.topic-table th, .topic-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.topic-table thead th { background: var(--teal); color: #fff; }
.topic-table tbody th { font-weight: 700; color: var(--teal-dark); }
.steps { padding-left: 1.3em; } .steps li { margin-bottom: .7em; }
details { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 700; color: var(--teal-dark); }
details p { margin: 10px 0 0; }
.notice, .curriculum-note { background: #fff8e1; border-left: 4px solid #e3a600; padding: 10px 14px; border-radius: 6px; color: #3d2f00; font-size: .95rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 12px; font-size: .9rem; }
.breadcrumbs li + li::before { content: "/"; margin-right: 4px; color: var(--muted); }
.plain { padding-left: 1.2em; }
.legal h2 { margin-top: 1.4em; font-size: 1.25rem; }

/* Footer */
.site-footer { background: var(--teal-dark); color: #e8f3f4; padding: 28px 0 14px; margin-top: 20px; }
.site-footer a { color: #fff; }
.site-footer .small { color: #cfe3e5; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.footer-brand { font-weight: 800; font-size: 1.1rem; margin-bottom: .2em; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.copy { margin-top: 14px; border-top: 1px solid rgba(255,255,255,.2); padding-top: 12px; }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }

/* Contact form */
.contact-form p { margin-bottom: 14px; }
.contact-form label { display: block; font-weight: 600; margin-bottom: 4px; }

/* Quiz */
.quiz-card, .quiz-results { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.quiz-progress { font-weight: 700; color: var(--teal-dark); margin-bottom: 4px; }
progress { width: 100%; height: 10px; accent-color: var(--green); margin-bottom: 10px; }
.q-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.q-dot { min-width: 40px; min-height: 40px; border: 2px solid var(--line); background: #fff; border-radius: 8px; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.q-dot.answered { background: #e0f3e8; border-color: var(--green); }
.q-dot.current { outline: 3px solid var(--teal); outline-offset: 1px; }
.q-fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
.q-fieldset legend { padding: 0; margin-bottom: 8px; }
.q-text { font-size: 1.2rem; margin: 0; color: var(--ink); }
.q-text:focus { outline: none; }
.opt { display: flex; align-items: center; gap: 12px; border: 2px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; cursor: pointer; min-height: 48px; }
.opt:hover { border-color: var(--teal); }
.opt:has(input:checked) { border-color: var(--teal); background: #e9f5f6; }
.opt input { width: 20px; height: 20px; flex: none; accent-color: var(--teal); }
.opt-letter { font-weight: 800; color: var(--teal-dark); min-width: 1.2em; }
.opt-text { flex: 1; overflow-wrap: anywhere; }
.quiz-msg { min-height: 1.5em; color: var(--muted); font-size: .95rem; }
.quiz-actions { display: flex; justify-content: space-between; gap: 10px; }
.quiz-actions .btn { flex: 1; max-width: 220px; }
.quiz-results h3 { font-size: 1.5rem; }
.result-msg { font-size: 1.05rem; }
.review-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.review-item { border: 1px solid var(--line); border-left-width: 6px; border-radius: 8px; padding: 12px 14px; }
.review-item p { margin: 0 0 6px; }
.review-item.correct { border-left-color: var(--green); background: #f4fbf7; }
.review-item.incorrect { border-left-color: var(--bad); background: #fdf5f5; }
.review-status { font-weight: 800; }
.correct .review-status { color: var(--green-dark); }
.incorrect .review-status { color: var(--bad); }
.review-q { font-weight: 600; }
.review-expl { color: var(--ink); }

/* Worksheet (screen) */
.print-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.worksheet-sheet { background: #fff; border: 1px solid #9db4ba; border-radius: 6px; padding: 24px; margin: 18px 0; }
.ws-site { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.ws-head h2 { font-size: 1.4rem; border-bottom: 3px solid var(--teal); padding-bottom: 6px; }
.ws-fields { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 10px 0; }
.ws-fields p { margin: 0; }
.blank { display: inline-block; border-bottom: 1.5px solid #000; width: 8em; height: 1.1em; vertical-align: baseline; }
.blank.long { width: 14em; } .blank.short { width: 3em; }
.ws-inst { font-style: italic; color: var(--muted); }
.ws-list { padding-left: 2.3em; margin: 0; }
.ws-q { margin-bottom: 14px; padding-left: 4px; }
.ws-qtext { font-weight: 600; margin-bottom: 4px; }
.ws-opts { list-style: none; padding: 0; margin: 0 0 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; }
.opt-letter { font-weight: 800; }
.ws-work { margin: 4px 0 0; font-size: .85rem; color: var(--muted); }
.ws-lines i { display: block; height: 1.9em; border-bottom: 1px solid #7d949b; }
.ws-ans { margin: 6px 0 0; }
.ws-foot { font-size: .8rem; color: var(--muted); text-align: center; margin: 12px 0 0; }
@media (max-width: 520px) { .ws-opts { grid-template-columns: 1fr; } .worksheet-sheet { padding: 14px; } }
.answer-key { margin-bottom: 24px; }
.key-list li { margin-bottom: 12px; }
.key-list p { margin: 0 0 4px; }

/* Print: clean A4 output without navigation or buttons */
@page { size: A4; margin: 14mm; }
@media print {
  html, body { background: #fff !important; color: #000 !important; font-size: 11.5pt; }
  .site-header, .site-footer, .skip-link, .no-print, .breadcrumbs, .section, .curriculum-note, .nav-toggle { display: none !important; }
  main, .wrap { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .worksheet-sheet { border: 0; padding: 0; margin: 0; }
  .ws-q { break-inside: avoid; page-break-inside: avoid; }
  .ws-head h2 { color: #000; border-color: #000; }
  .ws-lines i { border-bottom-color: #666; }
  a { color: #000; text-decoration: none; }
  body[data-print="worksheet"] .answer-key { display: none !important; }
  body[data-print="key"] .worksheet-sheet { display: none !important; }
  .answer-key { page-break-before: always; break-before: page; }
  body[data-print="key"] .answer-key { page-break-before: auto; break-before: auto; }
  .key-list li { break-inside: avoid; page-break-inside: avoid; }
  details { border: 0; padding: 0; }
  details > summary { display: none; }
}
