.area-dashboard { padding-left: 240px; --bg-left: 240px; }
.dash-sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 240px; background: var(--surface); border-right: 1px solid var(--line); padding: 1.25rem .9rem; display: flex; flex-direction: column; gap: .2rem; }
.dash-sidebar .brand { margin: 0 .4rem 1.5rem; }
.dash-sidebar__item { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; }
.dash-sidebar__item:hover { background: var(--surface-2); color: var(--ink); }
.dash-sidebar__item.is-active { background: var(--primary-soft); color: var(--primary); }
.q-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.q-layout--single { grid-template-columns: minmax(0, 1fr); max-width: 720px; margin: 0 auto; width: 100%; }
.page-question .q-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.page-question .draw-bar { left: calc(240px + .75rem); }
/* The answer sheet starts beside the sidebar instead of covering it. */
.area-dashboard .feedback--sheet { left: var(--bg-left, 0px); }

/* Learn player: both columns end on the same line. The shorter side stretches: the step card grows
   (controls stay at its bottom) or the plane's card grows with the plane centred inside it. */
.learn-player .q-layout:not(.q-layout--single) { align-items: stretch; }
.learn-player .q-layout:not(.q-layout--single) > .q-visual { justify-content: center; background: var(--surface); border: 2px solid var(--line); border-radius: 24px; box-shadow: 0 5px 0 var(--edge); }
.learn-player .q-layout:not(.q-layout--single) > .q-visual .plane { border: 0; box-shadow: none; background: transparent; }
.learn-player .q-answer { display: flex; flex-direction: column; }
.learn-player .q-answer > .learn-steps { flex: 1; }
.learn-player .learn-steps .learn-controls { margin-top: auto; }
/* Desktop keeps the formula row reserved so the layout does not jump between steps. */
.learn-player .learn-steps__math.is-empty { display: block; visibility: hidden; }
.learn-player .learn-steps__math.is-empty::before { content: "0"; }
.learn-player .learn-steps__text { min-height: 2.9em; min-height: 2lh; }

/* Narrow desktop windows (e.g. half a laptop screen): icon-only sidebar, then a single question column. */
@media (max-width: 960px) {
  .area-dashboard { padding-left: 80px; --bg-left: 80px; }
  .dash-sidebar { width: 80px; padding: 1.25rem .6rem; align-items: center; }
  .dash-sidebar .brand { margin: 0 0 1.5rem; }
  .dash-sidebar .brand__text,
  .dash-sidebar__item > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .dash-sidebar__item { justify-content: center; padding: .7rem; }
  .page-question .draw-bar { left: calc(80px + .75rem); }
}
@media (max-width: 820px) {
  .q-layout,
  .page-question .q-layout { grid-template-columns: minmax(0, 1fr); }
}
/* Settings: device authorizing and the class card share a row. */
.settings-pair { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch; }
/* Narrow window: the header keeps only the logo (the same buttons are big in the page right below), and the page's
   main buttons fill the width one under the other. */
@media (max-width: 640px) {
  .site-header > .btn { display: none; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { width: 100%; justify-content: center; }
}
