/* Wide screens (laptops and up): a slim side menu on the left, and a wider page
   with lesson cards in 2 or 3 columns. Phones and tablets keep the single column.
   Screen only, so printed notes and worksheets are not affected. */
.side { display: none; }

@media screen and (min-width: 1000px) {
  :root { --side-w: 250px; }

  body > header .wrap { max-width: none; padding-inline: 24px; }

  .side {
    display: block; position: fixed; left: 0; bottom: 0; top: var(--head-h, 58px); width: var(--side-w);
    overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border-right: 2px solid var(--line);
    padding: 18px 12px 40px; font-size: 0.92rem; line-height: 1.35; z-index: 4;
  }
  .side a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
  .side a:hover { background: var(--pen-soft); color: var(--ink); }
  .side a[aria-current="page"] { background: var(--ink); color: var(--paper); font-weight: 700; }
  .side summary { cursor: pointer; list-style: none; padding: 7px 10px; border-radius: 8px; font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
  .side summary::-webkit-details-marker { display: none; }
  .side summary::after { content: "\25B8"; color: var(--ink-2); transition: transform .15s ease; }
  .side details[open] > summary::after { transform: rotate(90deg); }
  .side summary:hover { background: var(--pen-soft); }
  .side .lvl > summary { font-size: 1.05rem; }
  .side .term > summary { font-weight: 400; color: var(--ink-2); }
  .side .term[open] > summary { color: var(--ink); font-weight: 700; }
  .side-sub { margin: 2px 0 6px 12px; padding-left: 8px; border-left: 2px solid var(--line); }

  #app, footer .wrap { margin-left: var(--side-w); max-width: none; }
  #app { display: grid; grid-template-columns: minmax(0, 1080px); justify-content: center; align-content: start; padding-inline: 40px; min-height: calc(100vh - var(--head-h, 58px) - 60px); }
  #app > .back, #app > .count { justify-self: start; }
  /* Reading pages (notes, worksheets, quiz cards) stay a comfortable width. */
  #app:has(.card) { grid-template-columns: minmax(0, 860px); }
  footer .wrap { padding-inline: 40px; }

  .choices, .list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: stretch; }
  .choice { height: 100%; }
  .finder .results { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .papers { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); }
  .papers .yr { grid-column: 1 / -1; }
}
.tally{vertical-align:middle;display:inline-block}

/* Year 8 Accelerated: lessons opened from it hide the Sparx codes (a different scheme of work). */
html[data-acc="1"] .sparx, html[data-acc="1"] .codes, html[data-acc="1"] .finder { display: none !important; }
/* Year 8 Accelerated: subtopic headings on a topic page */
.y8a-sub { font-size: 1.05rem; margin: 18px 0 8px; }
