/* Manual page layout and navigation. The app examples use app.css and the app's shared tokens. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: default; opacity: .45; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 12px; background: var(--panel); }
button:hover:enabled { background: var(--hover); }
a { color: inherit; text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--orange); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
input, textarea { min-width: 0; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); color: var(--text); padding: 8px 10px; }
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }
input[type="checkbox"] { accent-color: var(--orange); width: 14px; height: 14px; }
code, pre, kbd { font-family: var(--font-mono); }
kbd { font-size: 11px; border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; color: var(--text-3); white-space: nowrap; }
svg { flex-shrink: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; transform: translateY(-180%); z-index: 200; background: var(--primary-bg); color: var(--primary-fg); padding: 10px; border-radius: 6px; }
.skip-link:focus { transform: none; }
.site-head { height: 64px; padding: 0 max(24px, calc((100vw - 1280px) / 2)); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--chrome); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.site-head nav { display: flex; align-items: center; gap: 24px; font-size: 12px; }
.site-head nav a { text-decoration: none; color: var(--text-2); }
.plain-button { font-size: 12px; background: none; }
.manual { width: min(1280px, calc(100% - 48px)); margin: auto; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding: 48px 0 30px; }
.eyebrow { font: 11px/1.5 var(--font-mono); color: var(--text-3); margin-bottom: 8px; }
h1 { font-size: clamp(30px, 3.8vw, 46px); line-height: 1.08; letter-spacing: -.035em; font-weight: 650; margin-bottom: 14px; }
.intro p:not(.eyebrow) { color: var(--text-2); }
.intro .example-note { font-size: 12px; flex-shrink: 0; padding-bottom: 3px; line-height: 1.8; }
.contents { border-block: 1px solid var(--line-2); }
.contents summary { padding: 13px 4px; font-weight: 500; font-size: 13px; }
.contents summary span { color: var(--text-3); margin-left: 12px; font-weight: 400; }
.contents-body { padding: 4px 4px 22px; }
.topic-search { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--text-3); margin: 0 0 16px; }
.topic-search input { width: min(100%, 320px); height: 34px; }
#topics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.topic-group { display: flex; flex-direction: column; align-items: start; }
.topic-group h2 { font-size: 11px; font-weight: 500; color: var(--text-3); margin-bottom: 6px; }
.topic-group a { width: 100%; display: flex; gap: 8px; text-decoration: none; color: var(--text-2); font-size: 12px; line-height: 1.45; padding: 7px 9px; border-radius: 6px; }
.topic-group a span { color: var(--text-3); font: 10px/1.8 var(--font-mono); }
.topic-group a:hover { background: var(--hover); color: var(--text); }
.topic-group a[aria-current="page"] { background: var(--active); color: var(--text); box-shadow: inset 2px 0 var(--orange); }
#lesson { padding-top: 32px; outline: none; }
.lesson-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lesson-heading h2 { font-size: 26px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
.lesson-paging { display: flex; gap: 6px; }
.lesson-paging button { width: 34px; height: 34px; padding: 0; }
#lesson-description { margin-top: 12px; color: var(--text-2); max-width: 90ch; }
.reach { margin-top: 6px; color: var(--text-3); font-size: 12px; }
.practice { margin-top: 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 12px; }
.practice p::before { content: "Try it · "; color: var(--orange); }
.practice button { flex-shrink: 0; font-size: 11px; padding: 4px 8px; }
.lesson-more { display: grid; gap: 12px; margin-top: 22px; max-width: 90ch; color: var(--text-2); font-size: 13px; }
.lesson-more .caption { font-size: 12px; color: var(--text-3); }
.feedback { min-height: 46px; padding-top: 12px; color: var(--text-2); font-size: 12px; }
.feedback:empty { padding: 0; min-height: 24px; }
.site-foot { width: min(1280px, calc(100% - 48px)); margin: 16px auto 0; padding: 24px 0 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12px; }
.reading { padding: 28px 0; max-width: 80ch; }
.reading p { margin: 12px 0; }
.reading dt { margin-top: 16px; font-weight: 600; }
.reading dd { margin: 4px 0 0; color: var(--text-2); }
#picture-viewer { width: min(96vw, 1440px); max-width: 96vw; max-height: 95dvh; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); color: var(--text); padding: 12px; }
#picture-viewer::backdrop { background: #000b; }
#picture-viewer form { position: sticky; top: 0; display: flex; justify-content: end; margin-bottom: 10px; }
#picture-viewer img { display: block; max-width: 100%; height: auto; margin: auto; }
@media (max-width: 900px) {
  .intro { align-items: start; flex-direction: column; gap: 20px; padding-top: 28px; }
  .intro .example-note br { display: none; }
  #topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .site-head { padding-inline: 16px; gap: 12px; }
  .site-head nav { gap: 12px; }
  .site-head nav > a:first-child { display: none; }
  .brand { font-size: 13px; gap: 7px; }
  .brand img { width: 24px; height: 24px; }
  .manual, .site-foot { width: calc(100% - 24px); }
  #topics { gap: 14px 8px; }
  .topic-group a { font-size: 11px; padding-inline: 5px; }
  .topic-search { align-items: start; flex-direction: column; gap: 5px; }
  .practice { align-items: start; gap: 10px; }
  .practice button { max-width: 70px; }
  .lesson-heading h2 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  button, input, textarea, .app-window, .card, .topic-group a[aria-current] { border: 1px solid ButtonText; }
}
.check-line { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
