/* Readable matter cards and compact close controls across activity dialogs. */
#accueil .choices.subjects > button {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  color: #263645 !important;
  -webkit-text-fill-color: #263645 !important;
}
#accueil .choices.subjects > button:not(.all-subjects) > span {
  display: block !important;
  max-width: 100% !important;
  margin: 0 !important;
  color: #263645 !important;
  -webkit-text-fill-color: #263645 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  overflow-wrap: anywhere !important;
  opacity: 1 !important;
  visibility: visible !important;
}
#accueil .choices.subjects > button.all-subjects {
  color: #40566d !important;
  -webkit-text-fill-color: #40566d !important;
}
#accueil .choices.subjects > button.all-subjects > span {
  display: block !important;
  margin: 0 !important;
  color: #40566d !important;
  -webkit-text-fill-color: #40566d !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  line-height: 1.25 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Keep unselected calculation choices readable against their light surface. */
#tablesDialog .operation-picker > button:not(.selected) {
  border-color: #dce3ea !important;
  background: #f7f9fb !important;
  color: #40566d !important;
  -webkit-text-fill-color: #40566d !important;
}
#tablesDialog .operation-picker > button:not(.selected) :is(span, strong) {
  color: #40566d !important;
  -webkit-text-fill-color: #40566d !important;
}

/* Reduce the visible X while keeping a predictable, separate tap target. */
body dialog :is(button.close, button[aria-label*="fermer" i]):not(.correct):not(.wrong):not(.danger):not(.delete) {
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  border: 1px solid #dce3ea !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: #40566d !important;
  -webkit-text-fill-color: #40566d !important;
  font: 600 22px/1 Arial, sans-serif !important;
  outline: none !important;
  box-shadow: 0 1px 5px rgba(31,49,54,.12) !important;
}
body dialog :is(button.close, button[aria-label*="fermer" i]):not(.correct):not(.wrong):not(.danger):not(.delete):focus-visible {
  outline: 2px solid rgba(73,107,139,.35) !important;
  outline-offset: 2px !important;
}

@media (max-width: 650px) {
  #accueil .choices.subjects > button:not(.all-subjects) {
    min-height: 96px !important;
  }
  #accueil .choices.subjects > button:not(.all-subjects) > span {
    font-size: 13px !important;
  }
}
