/* Small visible icons, generous touch targets. Keep primary code actions labelled. */
:is(.ann-chapter, .ann-lesson, .nb-topbar) button.nb-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  box-shadow: none;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
:is(.ann-chapter, .ann-lesson, .nb-topbar) button.nb-icon-action svg {
  display: block;
  width: 20px;
  min-width: 20px;
  height: 20px;
  flex: none;
}
:is(.ann-chapter, .ann-lesson, .nb-topbar) button.nb-icon-action:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
:is(.ann-chapter, .ann-lesson, .nb-topbar) button.nb-icon-action:disabled { opacity: .4; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  :is(.ann-chapter, .ann-lesson, .nb-topbar) button.nb-icon-action:hover:not(:disabled) {
    color: var(--al-accent, var(--ch-accent));
  }
}
.ch-visual-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ch-visual-heading h4 { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.ann-chapter .ch-recorded-figure .ch-controls { gap: 4px; margin-bottom: 0; }
.ann-chapter .ch-top { flex-wrap: nowrap; }
.ann-chapter .ch-top > span { min-width: 0; overflow-wrap: anywhere; }

/* The chapter's generic button styles must not inflate the nested replay. */
.ann-lesson .al-controls { gap: 8px 12px; margin-block: 16px; }
.al-playback { display: flex; flex: none; gap: 2px; }
.ann-lesson .al-controls label { flex-wrap: wrap; font-size: 13px; line-height: 1.4; }
.ann-lesson select { max-width: 100%; font-size: 14px; line-height: 1.4; }
.ann-lesson .al-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 4px 10px;
}
.ann-lesson .al-sections button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: 500 14px/1.4 system-ui, sans-serif;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.al-step-number { flex: 0 0 22px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--al-muted); }
.ann-lesson .al-sections button[aria-pressed=true] { background: var(--nb-selected); border-color: var(--al-accent); }
.ann-lesson .al-explanation label { flex-wrap: wrap; }
.ann-lesson .al-explanation { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .ann-chapter .ann-lesson { padding: 0; border-radius: 0; }
  .ann-lesson .al-explanation { padding: 0; }
  .ann-lesson .al-graphs { gap: 12px; }
  .ann-lesson .al-graphs figure { padding: 10px; }
  .ann-lesson .al-notice { padding-left: 10px; }
}
