.app-header {
  display: block;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 18px 5px;
}
.app-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.app-brand { color: #285b49; font-size: .82rem; font-weight: 800; text-decoration: none; }
.app-track { color: #486754; font-size: .69rem; font-weight: 700; white-space: nowrap; }
.app-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  border-bottom: 1px solid #dbe2d4;
}
.app-nav a, .app-nav a:last-child {
  min-height: 40px;
  display: grid;
  place-items: center;
  color: #4a6654;
  text-decoration: none;
  font-size: .76rem;
  font-weight: 700;
  border-radius: 9px 9px 0 0;
}
.app-nav a[aria-current="page"] { background: #e1ebdb; color: #234f3b; }
.app-nav a:hover { background: #e8eee3; }
#game-mock-link[hidden] { display: none; }
.mock-replay .questpath { display: flex; flex-wrap: wrap; gap: 0 3px; }
.mock-replay .questpath:has(span:nth-child(6)) { font-size: .84rem; }
.app-title { font-size: 1.3rem; line-height: 1.3; margin: 7px 0 3px; }
.app-summary { font-size: .8rem; margin: 0 0 8px; }
.game-actions { display: grid; gap: 6px; }
.game-menu .game-actions .primary, .game-menu .game-actions .secondary { min-height: 44px; margin: 0; padding: 9px 12px; font-size: .87rem; }
.game-menu .game-actions #resume:empty { display: none; }
.game-menu .game-actions #resume button { margin: 0; }
.game-menu details.game-settings { margin: 10px 0 0; }
.game-settings summary { padding: 10px 0; color: #355a46; font-weight: 700; }
.game-settings label { margin: 8px 0 4px; }
#practice-brief { font-size: .78rem; margin: 8px 0; }
.app-lower-links { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 12px 0; font-size: .75rem; }
.app-lower-links a { padding: 4px 0; }
.garden-filter { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: end; margin: 8px 0 2px; }
.garden-filter div { min-width: 0; }
.garden-filter label { margin: 0 0 4px; font-size: .72rem; }
.garden-filter select, .garden-main .garden-filter input { font-size: 16px; min-height: 40px; padding: 7px; }
.app-header + .research-main { margin-top: 8px; }
.progress-toolbar { display: flex; justify-content: space-between; margin-top: 6px; }
.progress-toolbar button { padding: 5px 8px; min-height: 32px; font-size: .73rem; background: transparent; color: #395e48; text-decoration: underline; }
#goal-review-link { color: inherit; text-decoration: none; }
#goal-review-link:hover span { text-decoration: underline; }
#progress-field { margin-top: 8px; }
@media(max-width: 640px) {
  .learn-app .app-header, .quest-app .app-header { padding: 8px 16px 4px; }
  .quest-app .game-menu h1 { font-size: 1.3rem; }
  .game-menu .journey { display: none; }
  .app-header:has(+ main #play:not([hidden])) .app-head-top,
  .app-header:has(+ main #lesson-view:not([hidden])) .app-head-top { display: none; }
}

.lesson-practice { padding: 9px 6px; font-size: .8rem; }
@media(max-height: 630px) {
  .progress-app .app-head-top { display: none; }
  .progress-toolbar { margin: 1px 0; }
  .progress-app .goal-tabs { margin: 4px 0; }
  .progress-app .goal-tabs button { min-height: 34px; }
}

.guided-game #result .eyebrow { display: none; }
.guided-learn .guided-points { margin: 8px 0; padding-left: 19px; font-size: .83rem; line-height: 1.55; color: #344d40; }
.guided-learn .guided-points li + li { margin-top: 5px; }
.guided-learn .lesson-card details { margin-top: 7px; }
.guided-game #explanation h3 { margin: 3px 0 6px; }
.guided-learn #lesson-count, .guided-learn footer, .guided-game footer { display: none; }
.guided-learn .guided-intro { margin: 6px 0 10px; color: #355346; font-size: .9rem; line-height: 1.6; }
.guided-learn .guided-question { font-size: 1rem; line-height: 1.6; }
.guided-learn .guided-feedback { border-left: 3px solid #729377; padding: 4px 9px; background: #ecf2e7; }
.guided-learn .guided-feedback.wrong { border-color: #a87c45; background: #fbf0df; }
.guided-learn .guided-feedback h3, .guided-learn .guided-feedback p { margin: 4px 0; line-height: 1.6; }
