/* Mobile reading uses two sticky rows: navigation, then the current actions. */
.reader-settings { display: none; }

@media (max-width: 699px) {
  body.compact-reader { --whole-action-top: 48px; }
  body.compact-reader .topbar { display: none; }
  body.compact-reader .reader-toolbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px 88px;
    align-items: center;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 45;
    height: 48px;
    min-height: 48px;
    padding: 0 8px;
  }
  body.compact-reader .reader-toolbar > button {
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0;
  }
  body.compact-reader #backLibrary {
    display: grid;
    place-items: center;
    font-size: 0;
  }
  body.compact-reader #backLibrary > span { font: 22px/1 var(--sans); }
  body.compact-reader .breadcrumb-divider { display: none; }
  body.compact-reader .reading-context {
    min-width: 0;
    width: 100%;
    text-align: center;
  }
  body.compact-reader #breadcrumbTitle {
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
    letter-spacing: 0;
  }
  body.compact-reader .reader-toolbar .contents-button {
    display: flex;
    margin: 0;
    gap: 0;
    font-size: 0;
  }
  body.compact-reader .contents-button svg { width: 20px; height: 20px; }
  body.compact-reader .reader-settings {
    display: flex;
    align-items: center;
    gap: 0;
  }
  body.compact-reader .reader-settings > button {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 10px;
    border: 0;
    margin: 0;
    font-size: 18px;
  }
  body.compact-reader .lesson-actions,
  body.compact-reader .practice-toolbar {
    top: 48px;
    margin-left: -16px;
    margin-right: -16px;
    padding: 4px 8px;
    gap: 6px;
  }
  body.compact-reader .lesson-actions { margin-bottom: 16px; }
  body.compact-reader .lesson-actions button { min-height: 44px; padding: 8px 6px; }
  body.compact-reader .practice-toolbar {
    grid-template-columns: minmax(0, 1fr) 64px;
    align-items: stretch;
    margin-bottom: 12px;
  }
  body.compact-reader .practice-toolbar .level-buttons {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-radius: 7px;
  }
  body.compact-reader .practice-toolbar .level-buttons button {
    min-width: 0;
    min-height: 44px;
    padding: 0 2px;
    border: 0;
    border-right: 1px solid var(--line);
  }
  body.compact-reader .practice-toolbar .level-buttons button:last-child { border-right: 0; }
  body.compact-reader .practice-toolbar > button { min-height: 46px; padding: 0 4px; }
  body.compact-reader .practice-toolbar [data-compact-label] {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    white-space: nowrap;
  }
  body.compact-reader .practice-toolbar [data-compact-label]::after {
    content: attr(data-compact-label);
    font: 500 13px/1.4 var(--sans);
    white-space: nowrap;
  }
  body.compact-reader .practice-toolbar .active::after { font-weight: 600; }
}
