/**
 * Compact (embedded) mode of the better pages (see embed.js). Everything is under html.embed, so the normal pages are
 * not touched. Sizes are in rem/em like the better styles.
 */
/* The modal already has a title, so the logo and the tagline go, and the page uses the room for the test */
html.embed header.brand,
html.embed .panel {
  display: none;
}

html.embed body {
  padding: 0.5rem 0.75rem 1rem;
  font-size: 0.9em;
  background: var(--bg);
}

/* The target of the ping (stability page) is only on the full page; ?target=1 shows it here */
html.embed:not([data-target]) #targetArea {
  display: none;
}

html.embed #testWrapper {
  max-width: 100%;
}

/* The accessibility bar: one centered line at the top, with a line under it to set it apart from the page */
.a11y-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4em 1em;
  margin: 0 0 0.75em;
  padding: 0.3em 0.5em;
  font-size: 0.75em;
  border-bottom: 0.0625rem solid var(--border);
}

.a11y-group {
  display: inline-flex;
  gap: 0.25em;
}

.a11y-btn {
  font: inherit;
  min-width: 2.2em;
  padding: 0.15em 0.6em;
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius-button);
  background: none;
  color: var(--text);
  cursor: pointer;
}

.a11y-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.a11y-btn[aria-checked="true"],
.a11y-btn[aria-pressed="true"]:not([data-text-size="reset"]) {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.a11y-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* The test history in a modal (a11y-bar.js moves #historySection into it) */
.history-modal {
  box-sizing: border-box;
  width: calc(100% - 1.5rem);
  max-width: 42em;
  max-height: calc(100% - 1.5rem);
  margin: auto;
  padding: 1em;
  overflow: auto;
  color: var(--text);
  background: var(--bg);
  border: 0.0625rem solid var(--border);
  border-radius: var(--radius-card);
}

.history-modal::backdrop {
  background: rgb(0 0 0 / 0.55);
}

.history-modal #historySection {
  margin: 0;
}

/* The modal has its own title: the heading is not a collapse button here */
.history-modal #historyToggle {
  pointer-events: none;
}

.history-modal .history-caret {
  display: none;
}

.history-modal-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 1;
  padding: 0 0.4em;
  font: inherit;
  font-size: 1.4em;
  line-height: 1.3;
  color: var(--muted);
  background: var(--bg);
  border: 0;
  cursor: pointer;
}

.history-modal-close:hover {
  color: var(--primary);
}

.a11y-bar[hidden],
.a11y-btn[hidden] {
  display: none;
}
