/* Section navigation */
#app:focus { outline: none; }
header { padding-inline: max(5vw, 18px); gap: 16px; }
header > small { margin-right: auto; }
.app-nav {
  display: flex; gap: 4px; padding: 4px; border: 1px solid #d8e3dc;
  border-radius: 15px; background: #f2f6f3;
}
.app-nav a {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 7px 17px; border-radius: 11px;
  color: #506563; text-decoration: none; font-size: .94rem; font-weight: 650;
}
.app-nav a[aria-current="page"] { background: white; color: #0d5e52; box-shadow: 0 1px 4px #143d3326; }
.nav-icon { display: inline-block; width: 18px; height: 16px; position: relative; flex: none; }
.icon-book::before, .icon-book::after {
  content: ''; position: absolute; top: 1px; width: 9px; height: 13px;
  border: 1.6px solid currentColor; border-radius: 2px 3px 2px 1px;
}
.icon-book::before { left: 0; transform: skewY(8deg); }
.icon-book::after { right: 0; transform: skewY(-8deg); }
.icon-stats {
  border-bottom: 1.6px solid currentColor;
  background: linear-gradient(currentColor, currentColor) 1px bottom / 3px 5px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 3px 10px no-repeat,
    linear-gradient(currentColor, currentColor) right 1px bottom / 3px 14px no-repeat;
}
.button-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px;
  padding: 11px 16px; border: 1px solid #cbd9d4; border-radius: 13px;
  background: white; font-weight: 600; text-decoration: none; color: inherit;
}
a:focus-visible, summary:focus-visible { outline: 3px solid #b67912; outline-offset: 3px; }
.storage-note, .local-note { color: #4b6260; font-size: .9rem; overflow-wrap: anywhere; }
.storage-note { background: #fff1d8; padding: 10px 14px; border-radius: 10px; color: #613f08; }
.study-extra { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.study-extra h2, .study-extra p { margin: 0; }
.study-extra button { flex-shrink: 0; }
.progress-page h1 { margin-bottom: 24px; }
.readiness {
  background: #123e40; color: #fff; padding: clamp(22px, 4vw, 34px); border-radius: 22px;
}
.readiness .eyebrow { margin: 0; color: #b9ded1; font-size: .9rem; font-weight: 650; }
.readiness h2 { color: white; font-size: clamp(1.65rem, 4vw, 2.3rem); line-height: 1.18; margin: 9px 0; }
.readiness p { margin: 0; max-width: 60ch; color: #e0ede7; }
.readiness .forecast { border-top: 1px solid #62847e; margin-top: 21px; padding-top: 16px; }
.forecast span, .forecast strong { display: block; }
.forecast span { font-size: .9rem; color: #cae3d7; }
.forecast strong { color: #d3f3b4; font-size: 1.1rem; margin-top: 3px; }
.forecast p { font-size: .91rem; margin-top: 5px; }
.readiness details { margin-top: 18px; font-size: .92rem; }
.readiness summary { width: fit-content; padding-block: 5px; cursor: pointer; font-weight: 650; }
.readiness details p { margin-top: 9px; }
.readiness a { color: #d1f1b8; text-underline-offset: 3px; }
.progress-page section + section { margin-top: 28px; }
.progress-page section > h2 { margin: 0 0 12px; }
.goal-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.goal-card, .history-card {
  border: 1px solid #d5e1d9; background: white; border-radius: 19px;
}
.goal-card { padding: 19px; min-width: 0; }
.goal-card h3 { margin: 0 0 17px; font-size: 1.18rem; }
.goal-row + .goal-row { margin-top: 17px; }
.measure { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; }
.measure span, .meter-caption, .goal-eta { color: #49615f; font-size: .88rem; }
.measure strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.meter { position: relative; margin-top: 6px; }
.meter progress {
  display: block; appearance: none; border: none; width: 100%; height: 8px; overflow: hidden;
  background: #e2ebe5; color: #1b7965; border-radius: 10px;
}
.meter progress::-webkit-progress-bar { background: #e2ebe5; border-radius: 10px; }
.meter progress::-webkit-progress-value { background: #1b7965; border-radius: 10px; }
.meter progress::-moz-progress-bar { background: #1b7965; border-radius: 10px; }
.target-mark { position: absolute; left: 90%; top: -2px; height: 12px; width: 2px; background: #263e3a; }
.meter-caption { display: block; margin-top: 5px; }
.goal-eta { margin: 12px 0 0; }
.history-card { overflow: hidden; }
.history-list { padding: 0; margin: 0; list-style: none; }
.history-list li + li { border-top: 1px solid #e1e9e4; }
.history-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 19px; color: inherit; text-decoration: none;
}
.history-link:hover { background: #f1f6f2; }
.history-link:focus-visible { outline-offset: -3px; }
.history-link strong, .history-link small { display: block; }
.history-link small { color: #506866; font-weight: 450; margin-top: 2px; }
.history-score { text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.history-score strong { color: #105f52; }
.history-empty { padding: 19px; margin: 0; color: #4b6260; }
.history-more { margin: 10px 19px 16px; }
.local-note { margin: 10px 0; }
@media(max-width: 620px) {
  header > small { margin: 0; }
  main { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  .app-nav {
    position: fixed; z-index: 4; left: 0; bottom: 0; width: 100%;
    justify-content: center; border-width: 1px 0 0; border-radius: 0;
    background: #fafcfb; padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .app-nav a { flex: 1; max-width: 210px; flex-direction: column; gap: 3px; min-height: 49px; padding: 4px 8px; font-size: .875rem; }
  .app-nav a[aria-current="page"] { background: #e0eee3; box-shadow: none; }
  .goal-grid { grid-template-columns: 1fr; }
  .progress-page h1 { margin-bottom: 18px; }
  .readiness { padding: 18px 20px; }
  .readiness .forecast { margin-top: 14px; padding-top: 12px; }
  .readiness details { margin-top: 10px; }
  .study-extra { flex-wrap: wrap; }
  .feedback, .opt { scroll-margin-block-end: 85px; }
}
@media(max-width: 360px) {
  header { gap: 5px; }
  header strong { font-size: 21px; }
  header > small { font-size: .85rem; }
}
.button-link.primary { background: #126b5e; color: white; border-color: #126b5e; }
.opt.button-link { justify-content: flex-start; }
