/* Pythagoras workbook design safety layer.
   IMPORTANT: this file must never change workbook geometry or decorate content heuristically.
   Color mode preserves the source workbook exactly; mono mode is a non-structural grayscale view.
*/

/* ---------- CONTENT SAFETY ---------- */
:is(.book-theme-color,.book-theme-mono) .fallback{
  -webkit-print-color-adjust:exact;
  print-color-adjust:exact;
}

:is(.book-theme-color,.book-theme-mono) .fallback *{
  box-sizing:border-box;
}

:is(.book-theme-color,.book-theme-mono) .fallback :where(h1,h2,h3,h4,h5,h6){
  break-after:avoid;
  page-break-after:avoid;
}

:is(.book-theme-color,.book-theme-mono) .fallback :where(svg,figure,table){
  break-inside:avoid;
  page-break-inside:avoid;
}

/* Color mode is intentionally source-preserving. No backgrounds, borders, side bars,
   shadows, spacing, sizing, typography or diagram colors are overridden here. */
.book-theme-color .fallback{
  filter:none!important;
}

/* Black-and-white is intentionally non-structural: preserve all source geometry and
   convert appearance only. */
.book-theme-mono .fallback{
  filter:grayscale(1)!important;
}

/* Legacy semantic classes were injected by the previous design enhancer. The JS layer
   removes them from live pages. These rules are a fail-safe so stale DOM can never show
   the former one-sided blue/teal/black accents while cleanup is running. */
:is(.book-theme-color,.book-theme-mono) .fallback :where(
  .ped-question,.ped-question-group,.ped-concept,.ped-example,.ped-hint,.ped-solution,
  .ped-formula,.ped-answer,.ped-diagram,.ped-action,.ped-card,.ped-bullet,.ped-footer,
  .ped-page-title,.ped-section-title,.ped-subtitle,.ped-grid-line,.ped-helper-line,.ped-relation
){
  box-shadow:none!important;
}

/* Never add one-sided emphasis to workbook boxes/cards. */
:is(.book-theme-color,.book-theme-mono) .fallback :where(
  .ped-question,.ped-concept,.ped-hint,.ped-action
){
  border-inline-start-color:inherit!important;
  border-inline-end-color:inherit!important;
}

@media print{
  :is(.book-theme-color,.book-theme-mono) .fallback a{
    color:inherit!important;
    text-decoration:none!important;
  }
}
@media(max-width:430px){
}
@media(max-width:340px){
}
@media(prefers-reduced-motion:reduce){
}
