#sm-preferences {
  display: block;
  margin: .75rem auto;
  min-height: 44px;
  padding: .25rem .6rem;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: .85rem;
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
}
#sm-preferences[hidden], .sm-mesure-panneau[hidden], .sm-mesure-panneau [hidden] { display: none !important; }
.sm-mesure-panneau {
  position: fixed;
  z-index: 10001;
  inset: auto max(.625rem, env(safe-area-inset-right)) max(.625rem, env(safe-area-inset-bottom)) auto;
  width: min(24rem,calc(100% - 1.25rem));
  box-sizing: border-box;
  max-height: 65vh;
  max-height: 65dvh;
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: .45rem .9rem .72rem;
  background: #1c1728;
  color: #f7f3ff;
  color-scheme: dark;
  border: 1px solid #50435f;
  border-radius: 14px;
  box-shadow: 0 5px 24px #07051066;
  font: 400 .875rem/1.4 var(--font-body,system-ui),sans-serif;
  text-align: start;
  overflow-wrap: break-word;
}
.sm-mesure-panneau[data-vue="reglages"] { max-height: min(34rem,78vh); max-height: min(34rem,78dvh); }
.sm-entete-lecture { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.sm-mesure-panneau .sm-titre-lecture {
  margin: 0; padding: 0; color: inherit;
  font: 700 1.05rem/1.25 var(--font-body,system-ui),sans-serif; letter-spacing: -.012em; text-transform: none;
}
.sm-mesure-panneau button { font: inherit; cursor: pointer; }
.sm-mesure-panneau .sm-reglages {
  flex: none; min-height: 44px; min-width: 44px; padding: 0 .1rem;
  border: 0; background: transparent; color: #dfd6e6;
  font-size: .83rem; font-weight: 600; text-decoration: underline; text-underline-offset: .18em;
}
.sm-apercu-lecture p, .sm-mesure-panneau .sm-note-lecture {
  margin: 0 0 .55rem; color: #d7cede; font: inherit;
}
.sm-actions-lecture { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; }
.sm-actions-lecture button {
  min-height: 44px; padding: .4rem .35rem; border: 1px solid #897b94; border-radius: 8px;
  background: #282131; color: #f7f3ff; font-weight: 700; line-height: 1.25;
}
.sm-actions-lecture button:is(:hover,:focus-visible) { border-color: #efc76d; background: #342a3b; }
.sm-mesure-panneau :is(a,button,input):focus-visible { outline: 2px solid #ffcf47; outline-offset: 2px; }
.sm-detail-lecture fieldset { min-width: 0; margin: .2rem 0 .1rem; padding: 0; border: 0; }
.sm-detail-lecture legend { margin: 0 0 .15rem; padding: 0; color: #f7f3ff; font-weight: 700; }
.sm-detail-lecture label { display: flex; align-items: center; gap: .55rem; min-height: 44px; cursor: pointer; }
.sm-detail-lecture input { flex: none; margin: 0; width: 1.1rem; height: 1.1rem; accent-color: #ffcf47; }
.sm-option-google { border-top: 1px solid #51455a; font-weight: 700; }
.sm-mesure-panneau .sm-politique {
  display: inline-flex; min-height: 44px; align-items: center; color: #f7f3ff; text-decoration: underline; text-underline-offset: .18em;
}
@media (max-width: 480px) {
  .sm-mesure-panneau {
    left: max(.625rem,env(safe-area-inset-left)); right: max(.625rem,env(safe-area-inset-right));
    width: auto; padding: .25rem .8rem .65rem;
  }
}
@media (min-width: 600px) and (max-height: 500px) {
  .sm-mesure-panneau[data-vue="court"] {
    display: grid; grid-template-columns: minmax(0,1fr) 10rem; column-gap: 1rem; align-items: center;
    width: min(36rem,calc(100% - 2rem)); padding-block: .25rem .45rem;
  }
  .sm-mesure-panneau[data-vue="court"] .sm-apercu-lecture { display: contents; }
  .sm-mesure-panneau[data-vue="court"] .sm-entete-lecture { grid-area: 1 / 1; }
  .sm-mesure-panneau[data-vue="court"] .sm-apercu-lecture p { grid-area: 2 / 1; }
  .sm-mesure-panneau[data-vue="court"] .sm-actions-lecture { grid-area: 1 / 2 / span 2; }
}
/* Sur les écrans courts, la question et les réglages partagent la première ligne. */
@media (max-width: 480px) and (max-height: 650px) {
  .sm-mesure-panneau[data-vue="court"] {
    display: grid; grid-template-columns: minmax(0,1fr) auto;
    gap: 1px .45rem; align-items: center; padding: 2px .65rem 4px;
  }
  .sm-mesure-panneau[data-vue="court"] :is(.sm-entete-lecture,.sm-apercu-lecture) { display: contents; }
  .sm-mesure-panneau[data-vue="court"] .sm-titre-lecture {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
  }
  .sm-mesure-panneau[data-vue="court"] .sm-apercu-lecture p { grid-area: 1 / 1; margin: 0; }
  .sm-mesure-panneau[data-vue="court"] .sm-reglages { grid-area: 1 / 2; }
  .sm-mesure-panneau[data-vue="court"] .sm-actions-lecture { grid-area: 2 / 1 / auto / -1; }
}
