.automatismes-panel {
  scroll-margin-top: 6rem;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #d1dac6;
  border-radius: 1rem;
  background: #edf1e7;
  margin-block: 1rem 2rem;
}

.automatismes-panel h2,
.automatismes-panel h3 { margin: 0; }
.automatismes-panel p { margin-block: .5rem 1rem; }

.automatisme-resume { margin-block-end: 1rem; }
.automatisme-resume .button {
  min-block-size: 2.75rem;
  max-inline-size: 100%;
  white-space: normal;
  text-align: start;
}

.automatisme-replacement {
  max-inline-size: min(34rem, calc(100% - 2rem));
  padding: clamp(1rem, 4vw, 1.5rem);
  border: 1px solid #879b80;
  border-radius: .65rem;
  background: #fffdf8;
  color: inherit;
}
.automatisme-replacement::backdrop { background: rgb(32 56 48 / 45%); }
.automatisme-replacement .button { min-block-size: 2.75rem; }

.automatisme-modes {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1rem;
}

.automatisme-mode,
.automatisme-correction {
  padding: 1rem;
  border: 1px solid #d1dac6;
  border-radius: .65rem;
  background: #fffdf8;
  min-width: 0;
}

.automatisme-mode label {
  display: grid;
  gap: .35rem;
  font-weight: 650;
  min-width: 0;
}

.automatisme-mode select {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid #879b80;
  border-radius: .45rem;
  padding: .45rem .65rem;
  color: #203830;
  background: #fffdf8;
  font: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
}

.automatisme-mode h3,
.automatisme-mode label { margin-bottom: .7rem; }
.automatisme-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .65rem; }
.automatisme-heading,
.automatisme-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
}

.automatisme-actions { justify-content: flex-start; }
.automatisme-navigation { margin-top: 1rem; }
.automatisme-shared { margin-block-end: 1rem; }
.automatisme-paper-status:empty,
.automatisme-paper-reference:empty,
.automatisme-paper-link[hidden] { display: none; }
.automatisme-paper-reference { font-weight: 650; }
.automatisme-paper-link { display: grid; gap: .35rem; }
.automatisme-paper-link input {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  border: 1px solid #879b80;
  border-radius: .45rem;
  padding: .45rem .65rem;
  color: inherit;
  background: #fffdf8;
  font: inherit;
}
.automatisme-position { font-size: .95rem; }
.automatisme-report {
  font-size: .9em;
  text-decoration: underline;
  text-underline-offset: .17em;
}
.automatisme-question-report {
  text-align: end;
  font-weight: 650;
}
.automatisme-table { max-width: 100%; overflow-x: auto; margin-block: 1rem; }
.automatisme-table table { width: auto; min-width: min(100%, 22rem); border-collapse: collapse; background: #fffdf8; }
.automatisme-table :is(th, td) { padding: .5rem .75rem; border: 1px solid #aab8a3; text-align: center; }
.automatisme-figure { margin: 1rem 0; }
.automatisme-figure :is(img,svg) {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}
.automatisme-plot {
  inline-size: min(100%, 30rem);
  background: #fffdf8;
  border: 1px solid #d1dac6;
  border-radius: .6rem;
  color: #253b31;
  font: 17px system-ui, sans-serif;
}
.automatisme-plot text { fill: currentColor; }
.automatisme-grid path { stroke: #b8c7b4; stroke-width: 1; }
.automatisme-axes { fill: none; stroke: #253b31; stroke-width: 1.5; }
.automatisme-trace { fill: none; stroke: #265f52; stroke-width: 2.5; stroke-linejoin: round; }
.automatisme-point { fill: #265f52; }
.automatisme-response { max-width: 44rem; padding-block: .5rem; }
.automatisme-response > .automatisme-actions { margin-block-start: .75rem; }
.automatisme-correction { margin-bottom: .75rem; }

@media (max-width: 52rem) {
  .automatisme-modes { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 32rem) {
  .automatisme-filters { grid-template-columns: minmax(0, 1fr); }
}

[data-express-entry] > [hidden] { display: none !important; }

[data-express-choices] {
  margin-block: 1.5rem 2rem;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid #d1dac6;
  border-radius: 1rem;
  background: #edf1e7;
}

[data-express-choices] h2 { margin: 0 0 1rem; }

[data-express-choices] .exam-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin: 0;
}

[data-express-choices] button { min-height: 3rem; white-space: normal; }
[data-express-change] { margin-block: 1rem; }

@media (max-width: 32rem) {
  [data-express-choices] .exam-actions { grid-template-columns: minmax(0, 1fr); }
}
