/* The app's interface, re-created in HTML and CSS for the interactive demo on the landing page.
   It mirrors the app's own theme (src/renderer/src/theme/theme.css): white surface, near-black
   text and hairlines, one blue, a 6px radius. Green and red appear only in the quiz review.
   Everything is scoped under .sp so it cannot leak into the page around it.

   Sizes: the app sets its root font size to 18px, so everything in it is 1.125 times what the same
   numbers would give on a web page. The demo keeps the app's numbers and multiplies them by its own
   unit, --u: 1.125rem where the demo is wide enough to be the app's window, 1rem where it is a
   narrower column or a single piece. */

.sp {
  --sp-fg: #111111;
  --sp-muted: #5c5c5c;
  --sp-border: #cfcfcf;     /* the text colour at 20% over white */
  --sp-separator: #e3e3e3;  /* the text colour at 12% over white */
  --sp-default: #f0f0f0;    /* an unselected toggle */
  --sp-hover: #e8e8e8;
  --sp-row-hover: #f6f6f6;
  --sp-accent: #1d4ed8;
  --sp-accent-dark: #1e40af;
  --sp-accent-soft: #dde5f9; /* the selected subject, the selected toggle */
  --sp-success: #15803d;
  --sp-success-soft: #dcebe2;
  --sp-success-ink: #14532d;
  --sp-danger: #c81e1e;
  --sp-danger-soft: #f6dcdc;
  --sp-danger-ink: #7f1d1d;
  --sp-radius: 6px;
  container-type: inline-size;
  color: var(--sp-fg);
  line-height: 1.43;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

.sp > * {
  --u: 1rem;
  font-size: calc(0.875 * var(--u));
}

@container (min-width: 60rem) {
  .sp > * {
    --u: 1.125rem;
  }
}

.sp [hidden] {
  display: none !important;
}

.sp ul,
.sp ol {
  padding: 0;
}

[data-sp-outcome]:empty {
  display: none;
}

.sp h3,
.sp h4,
.sp h5,
.sp p,
.sp ul,
.sp ol {
  margin: 0;
  list-style: none;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: 0;
  color: inherit;
  text-align: left;
  text-wrap: wrap;
}

.sp button,
.sp textarea {
  font: inherit;
  color: inherit;
}

.sp :focus-visible {
  outline: 2px solid var(--sp-accent);
  outline-offset: 2px;
  border-radius: var(--sp-radius);
}

.sp-icon {
  flex: none;
  width: calc(1 * var(--u, 1rem));
  height: calc(1 * var(--u, 1rem));
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The whole app: sidebar and main area. */

.sp-app {
  /* The band at the top of the app's window: in the app it is where the window is dragged; here it is
     simply the calm top margin of both the sidebar and the screens. */
  --sp-strip: 40px;
  display: flex;
  min-height: calc(44 * var(--u, 1rem));
  background: #ffffff;
}

.sp-side {
  display: flex;
  flex: none;
  flex-direction: column;
  width: calc(15 * var(--u, 1rem));
  border-right: 1px solid var(--sp-separator);
}

.sp-brand {
  display: flex;
  align-items: center;
  gap: calc(0.5 * var(--u, 1rem));
  padding: var(--sp-strip) calc(1.25 * var(--u, 1rem)) calc(1.5 * var(--u, 1rem));
  font-size: calc(0.9375 * var(--u, 1rem)) !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em !important;
}

.sp-brand img {
  width: calc(1.875 * var(--u, 1rem));
  height: calc(1.625 * var(--u, 1rem));
}

.sp-side-label {
  padding: 0 calc(1.25 * var(--u, 1rem)) calc(0.375 * var(--u, 1rem));
  font-size: calc(0.75 * var(--u, 1rem)) !important;
  font-weight: 500 !important;
  color: var(--sp-muted) !important;
}

.sp-subjects {
  display: flex;
  flex-direction: column;
  gap: calc(0.125 * var(--u, 1rem));
  padding: 0 calc(0.5 * var(--u, 1rem)) !important;
}

.sp-subject {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(0.5 * var(--u, 1rem));
  width: 100%;
  height: calc(2.25 * var(--u, 1rem));
  padding: 0 calc(0.75 * var(--u, 1rem));
  border: 0;
  border-radius: var(--sp-radius);
  background: none;
  cursor: pointer;
  text-align: left;
}

.sp-subject:hover {
  background: var(--sp-default);
}

.sp-subject[aria-current="page"] {
  background: var(--sp-accent-soft);
  color: var(--sp-accent);
  font-weight: 600;
}

.sp-count {
  font-size: calc(0.75 * var(--u, 1rem));
  font-weight: 400;
  color: var(--sp-muted);
  font-variant-numeric: tabular-nums;
}

/* A row of the sidebar that is not a button here: New subject, Settings. */
.sp-side-row {
  display: flex;
  align-items: center;
  gap: calc(0.5 * var(--u, 1rem));
  height: calc(2.25 * var(--u, 1rem));
  margin: calc(0.25 * var(--u, 1rem)) calc(0.75 * var(--u, 1rem)) 0 !important;
  padding: 0 calc(0.75 * var(--u, 1rem)) !important;
  font-weight: 500 !important;
  color: var(--sp-muted) !important;
}

.sp-side-row--last {
  margin-top: auto !important;
  margin-bottom: calc(0.5 * var(--u, 1rem)) !important;
}

.sp-side-foot {
  padding: calc(0.75 * var(--u, 1rem)) calc(1.25 * var(--u, 1rem));
  border-top: 1px solid var(--sp-separator);
  font-size: calc(0.75 * var(--u, 1rem));
  line-height: 1.625;
}

.sp-side-foot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(0.75 * var(--u, 1rem));
  font-size: inherit !important;
  color: var(--sp-muted) !important;
}

.sp-side-path {
  margin-top: calc(0.25 * var(--u, 1rem)) !important;
  overflow: hidden;
  font-size: inherit !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-main {
  flex: 1;
  min-width: 0;
}

.sp-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: calc(56 * var(--u, 1rem));
  margin-inline: auto;
  padding: calc(var(--sp-strip) + 0.75 * var(--u, 1rem)) calc(2.5 * var(--u, 1rem)) calc(4 * var(--u, 1rem));
}

/* Page header: the way back, the title, one quiet line. */

.sp-back {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: calc(0.5 * var(--u, 1rem));
  max-width: 100%;
  min-height: calc(2 * var(--u, 1rem));
  margin: 0 0 calc(0.75 * var(--u, 1rem)) calc(-0.75 * var(--u, 1rem));
  padding: 0 calc(0.75 * var(--u, 1rem));
  border: 0;
  border-radius: var(--sp-radius);
  background: none;
  color: var(--sp-muted) !important;
  font-weight: 500 !important;
  cursor: pointer;
}

.sp-back:hover {
  background: var(--sp-default);
}

.sp-title {
  font-size: calc(1.5 * var(--u, 1rem)) !important;
  font-weight: 600 !important;
  line-height: calc(2 * var(--u, 1rem));
  letter-spacing: -0.025em !important;
  outline: none;
  overflow-wrap: anywhere;
}

.sp-detail {
  min-height: calc(1.25 * var(--u, 1rem));
  margin-top: calc(0.25 * var(--u, 1rem)) !important;
  color: var(--sp-muted) !important;
}

.sp-header {
  margin-bottom: calc(2 * var(--u, 1rem));
}

.sp-sections {
  display: flex;
  flex-direction: column;
  gap: calc(3 * var(--u, 1rem));
}

.sp-section {
  display: flex;
  flex-direction: column;
  gap: calc(0.75 * var(--u, 1rem));
}

.sp-section-title {
  display: flex;
  align-items: baseline;
  gap: calc(0.625 * var(--u, 1rem));
  min-height: calc(2.25 * var(--u, 1rem));
  padding-top: calc(0.375 * var(--u, 1rem)) !important;
  font-size: calc(1 * var(--u, 1rem)) !important;
  font-weight: 600 !important;
}

.sp-section-title span {
  font-size: calc(0.875 * var(--u, 1rem));
  font-weight: 400;
  color: var(--sp-muted);
}

/* Rows: files, results, materials. One hairline between each, the list reaching a little past the text. */

.sp-rows {
  margin-inline: calc(-1 * var(--u, 1rem)) !important;
  border-top: 1px solid var(--sp-separator);
}

.sp-rows > li {
  border-bottom: 1px solid var(--sp-separator);
}

.sp-row {
  display: grid;
  align-items: center;
  gap: calc(1.5 * var(--u, 1rem));
  width: 100%;
  min-height: calc(2.8125 * var(--u, 1rem));
  padding: calc(0.375 * var(--u, 1rem)) calc(1 * var(--u, 1rem));
  border: 0;
  background: none;
  text-align: left;
}

button.sp-row {
  cursor: pointer;
}

button.sp-row:hover {
  background: var(--sp-row-hover);
}

.sp-row--file {
  grid-template-columns: minmax(0, 1fr) calc(9 * var(--u, 1rem)) calc(4 * var(--u, 1rem));
}

.sp-row--result {
  grid-template-columns: minmax(0, 1fr) calc(11.5 * var(--u, 1rem)) calc(9.5 * var(--u, 1rem)) calc(9.5 * var(--u, 1rem));
}

.sp-row--material {
  grid-template-columns: minmax(0, 1fr) calc(9 * var(--u, 1rem)) calc(6 * var(--u, 1rem));
}

.sp-cell-name {
  display: flex;
  align-items: center;
  gap: calc(0.75 * var(--u, 1rem));
  min-width: 0;
}

.sp-cell-name .sp-icon {
  color: var(--sp-muted);
}

.sp-name {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-new {
  margin-left: calc(0.625 * var(--u, 1rem));
  font-size: calc(0.75 * var(--u, 1rem));
  font-weight: 500;
  color: var(--sp-accent);
}

.sp-thumbs {
  display: flex;
  flex: none;
  gap: calc(0.25 * var(--u, 1rem));
  margin-left: calc(0.25 * var(--u, 1rem));
}

.sp-thumbs img {
  display: block;
  width: calc(1.75 * var(--u, 1rem));
  height: calc(1.75 * var(--u, 1rem));
  border: 1px solid var(--sp-border);
  border-radius: 3px;
  object-fit: cover;
}

.sp-fact {
  color: var(--sp-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sp-end {
  text-align: right;
}

/* Buttons */

.sp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(0.5 * var(--u, 1rem));
  min-height: calc(2.25 * var(--u, 1rem));
  padding: 0 calc(1 * var(--u, 1rem));
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  background: #ffffff;
  font-weight: 500 !important;
  white-space: nowrap;
  cursor: pointer;
}

.sp-button:hover {
  background: var(--sp-row-hover);
}

.sp-button .sp-icon {
  color: var(--sp-muted);
}

.sp-button--primary {
  border-color: var(--sp-accent);
  background: var(--sp-accent);
  color: #ffffff !important;
}

.sp-button--primary:hover {
  border-color: var(--sp-accent-dark);
  background: var(--sp-accent-dark);
}

.sp-button--small {
  min-height: calc(2 * var(--u, 1rem));
  padding: 0 calc(0.75 * var(--u, 1rem));
}

.sp-button[disabled] {
  opacity: 0.5;
  cursor: default;
}

.sp-button--primary[disabled]:hover {
  border-color: var(--sp-accent);
  background: var(--sp-accent);
}

.sp-icon-button {
  display: inline-grid;
  place-items: center;
  width: calc(2.25 * var(--u, 1rem));
  height: calc(2.25 * var(--u, 1rem));
  border: 0;
  border-radius: var(--sp-radius);
  background: none;
  cursor: pointer;
}

.sp-icon-button:hover {
  background: var(--sp-default);
}

.sp-icon-button[disabled] {
  opacity: 0.4;
  cursor: default;
}

.sp-icon-button[disabled]:hover {
  background: none;
}

/* Make */

.sp-make {
  display: flex;
  flex-direction: column;
  gap: calc(1.25 * var(--u, 1rem));
}

.sp-kinds,
.sp-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: calc(0.5 * var(--u, 1rem));
}

.sp-sizes {
  gap: calc(0.375 * var(--u, 1rem));
}

/* The kinds stand in groups, each under a quiet label: Read, Learn, Test, Or ask. */
.sp-kinds {
  align-items: flex-end;
  gap: calc(0.75 * var(--u, 1rem)) calc(1.5 * var(--u, 1rem));
}

.sp-group {
  display: flex;
  flex-direction: column;
  gap: calc(0.375 * var(--u, 1rem));
}

.sp-group-label {
  font-size: calc(0.75 * var(--u, 1rem)) !important;
  font-weight: 500 !important;
  color: var(--sp-muted) !important;
}

.sp-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: calc(0.5 * var(--u, 1rem));
}

/* A second line under a result's title: how the practice test was asked for. */
.sp-name-block {
  display: block;
  min-width: 0;
}

.sp-name-block .sp-name {
  display: block;
}

.sp-sub {
  display: block;
  font-size: calc(0.75 * var(--u, 1rem));
  color: var(--sp-muted);
}

.sp-toggle {
  display: inline-flex;
  align-items: center;
  gap: calc(0.5 * var(--u, 1rem));
  min-height: calc(2.25 * var(--u, 1rem));
  padding: 0 calc(0.875 * var(--u, 1rem));
  border: 0;
  border-radius: var(--sp-radius);
  background: var(--sp-default);
  font-weight: 500 !important;
  white-space: nowrap;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.sp-toggle:hover {
  background: var(--sp-hover);
}

.sp-toggle[aria-pressed="true"] {
  background: var(--sp-accent-soft);
  color: var(--sp-accent-dark) !important;
}

.sp-toggle[disabled] {
  opacity: 0.5;
  cursor: default;
}

.sp-sizes .sp-toggle {
  min-height: calc(2 * var(--u, 1rem));
  padding: 0 calc(0.75 * var(--u, 1rem));
}

.sp-hint {
  margin-top: calc(-0.625 * var(--u, 1rem)) !important;
  line-height: 1.625;
  color: var(--sp-muted) !important;
}

.sp-size,
.sp-go {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(0.5 * var(--u, 1rem)) calc(1 * var(--u, 1rem));
}

.sp-size-label {
  font-weight: 500 !important;
}

.sp-with {
  color: var(--sp-muted) !important;
}

.sp-request {
  display: flex;
  flex-direction: column;
  gap: calc(0.375 * var(--u, 1rem));
  max-width: calc(40 * var(--u, 1rem));
}

.sp-request label {
  font-weight: 500;
}

.sp-request textarea {
  width: 100%;
  padding: calc(0.5 * var(--u, 1rem)) calc(0.75 * var(--u, 1rem));
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  font-size: calc(0.9375 * var(--u, 1rem));
  line-height: calc(1.5 * var(--u, 1rem));
  resize: vertical;
}

.sp-request p {
  font-size: calc(0.75 * var(--u, 1rem)) !important;
  color: var(--sp-muted) !important;
}

/* While something is being made: what is happening, a moving bar, a way to stop. */

.sp-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: calc(0.75 * var(--u, 1rem)) calc(1.25 * var(--u, 1rem));
}

.sp-progress-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: calc(0.125 * var(--u, 1rem));
  min-width: calc(14 * var(--u, 1rem));
}

.sp-progress-title {
  font-weight: 500 !important;
}

.sp-progress-message {
  min-height: calc(1.25 * var(--u, 1rem));
  color: var(--sp-muted) !important;
}

.sp-bar {
  height: 4px;
  margin-top: calc(0.375 * var(--u, 1rem));
  overflow: hidden;
  border-radius: 2px;
  background: var(--sp-default);
}

.sp-bar i {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 2px;
  background: var(--sp-accent);
  animation: sp-run 1.4s ease-in-out infinite;
}

@keyframes sp-run {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(250%);
  }
}

/* A notice: what happened, and one thing to do about it. */

.sp-notice {
  display: flex;
  align-items: flex-start;
  gap: calc(0.75 * var(--u, 1rem));
  padding: calc(0.875 * var(--u, 1rem)) calc(1 * var(--u, 1rem));
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
}

.sp-notice > .sp-icon {
  margin-top: calc(0.125 * var(--u, 1rem));
  color: var(--sp-muted);
}

.sp-notice-title {
  flex: 1;
  min-width: 0;
  font-weight: 500 !important;
  overflow-wrap: anywhere;
}

.sp-notice-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: calc(0.5 * var(--u, 1rem));
  margin-block: calc(-0.375 * var(--u, 1rem));
}

.sp-notice .sp-icon-button {
  width: calc(2 * var(--u, 1rem));
  height: calc(2 * var(--u, 1rem));
  color: var(--sp-muted);
}

/* What the demo leaves out, said in the demo's own place. Not part of the app. */
.sp-demo-note {
  color: var(--sp-muted) !important;
}

/* The summary reader */

.sp-prose {
  max-width: calc(37 * var(--u, 1rem));
  font-size: calc(1 * var(--u, 1rem));
  line-height: calc(1.75 * var(--u, 1rem));
}

.sp-prose p {
  margin-bottom: calc(1.25 * var(--u, 1rem)) !important;
}

.sp-prose h4 {
  margin: calc(3 * var(--u, 1rem)) 0 calc(1 * var(--u, 1rem)) !important;
  font-size: calc(1.25 * var(--u, 1rem)) !important;
  font-weight: 600 !important;
  line-height: calc(1.75 * var(--u, 1rem));
  letter-spacing: -0.025em !important;
}

.sp-prose ul {
  display: flex;
  flex-direction: column;
  gap: calc(0.5 * var(--u, 1rem));
  margin-bottom: calc(1.25 * var(--u, 1rem)) !important;
  padding-left: calc(1.5 * var(--u, 1rem)) !important;
  list-style: disc !important;
}

.sp-prose ul ul {
  margin: calc(0.5 * var(--u, 1rem)) 0 0 !important;
}

.sp-prose li {
  padding-left: calc(0.375 * var(--u, 1rem));
}

.sp-prose li::marker {
  color: var(--sp-muted);
}

.sp-prose strong {
  font-weight: 600;
  color: inherit;
}

/* Flashcards */

.sp-cards {
  display: flex;
  flex-direction: column;
  gap: calc(1.25 * var(--u, 1rem));
}

.sp-cards-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(1.5 * var(--u, 1rem));
  min-height: calc(2.25 * var(--u, 1rem));
}

.sp-cards-count {
  font-variant-numeric: tabular-nums;
}

.sp-cards-count b {
  font-weight: 500;
}

.sp-cards-count span {
  color: var(--sp-muted);
}

.sp-ghost-toggle {
  display: inline-flex;
  align-items: center;
  gap: calc(0.5 * var(--u, 1rem));
  min-height: calc(2 * var(--u, 1rem));
  padding: 0 calc(0.75 * var(--u, 1rem));
  border: 0;
  border-radius: var(--sp-radius);
  background: none;
  font-weight: 500 !important;
  cursor: pointer;
}

.sp-ghost-toggle:hover {
  background: var(--sp-default);
}

.sp-ghost-toggle[aria-pressed="true"] {
  background: var(--sp-accent-soft);
  color: var(--sp-accent-dark) !important;
}

.sp-meter {
  height: 4px;
  margin-top: calc(0.75 * var(--u, 1rem));
  overflow: hidden;
  border-radius: 2px;
  background: var(--sp-default);
}

.sp-meter i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--sp-accent);
}

.sp-face {
  display: flex;
  flex-direction: column;
  min-height: calc(20 * var(--u, 1rem));
  padding: calc(1.25 * var(--u, 1rem)) calc(2.5 * var(--u, 1rem)) calc(2.5 * var(--u, 1rem));
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.1s ease-out;
}

.sp-face:hover {
  border-color: var(--sp-fg);
}

.sp-face-top {
  display: flex;
  justify-content: space-between;
  gap: calc(1 * var(--u, 1rem));
  font-size: calc(0.75 * var(--u, 1rem));
  font-weight: 500;
  color: var(--sp-muted);
}

.sp-face-text {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding-top: calc(1.25 * var(--u, 1rem));
  font-size: calc(1.25 * var(--u, 1rem));
  line-height: calc(2 * var(--u, 1rem));
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.sp-face-text--front {
  font-size: calc(1.5 * var(--u, 1rem));
  font-weight: 600;
  line-height: calc(2.25 * var(--u, 1rem));
  letter-spacing: -0.025em;
}

.sp-cards-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(1 * var(--u, 1rem));
}

.sp-cards-marks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(0.75 * var(--u, 1rem));
}

.sp-cards-marks .sp-button {
  min-width: calc(7 * var(--u, 1rem));
}

.sp-cards-marks .sp-button--primary {
  min-width: calc(9 * var(--u, 1rem));
}

.sp-keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(0.5 * var(--u, 1rem)) calc(1.25 * var(--u, 1rem));
  font-size: calc(0.75 * var(--u, 1rem)) !important;
  color: var(--sp-muted) !important;
}

.sp-keys span {
  display: inline-flex;
  align-items: center;
  gap: calc(0.375 * var(--u, 1rem));
}

.sp-keys kbd {
  display: inline-grid;
  place-items: center;
  min-width: calc(1.25 * var(--u, 1rem));
  height: calc(1.25 * var(--u, 1rem));
  padding: 0 calc(0.375 * var(--u, 1rem));
  border-radius: 4px;
  background: var(--sp-default);
  font: inherit;
  font-weight: 500;
  color: var(--sp-fg);
}

.sp-round {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: calc(20 * var(--u, 1rem));
  padding: calc(2.5 * var(--u, 1rem));
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius);
}

.sp-round h4 {
  font-size: calc(1.5 * var(--u, 1rem)) !important;
  font-weight: 600 !important;
  line-height: calc(2.25 * var(--u, 1rem));
  letter-spacing: -0.025em !important;
  outline: none;
}

.sp-round p {
  margin-top: calc(0.5 * var(--u, 1rem)) !important;
  font-size: calc(0.9375 * var(--u, 1rem)) !important;
  color: var(--sp-muted) !important;
}

.sp-round-actions {
  display: flex;
  flex-wrap: wrap;
  gap: calc(0.75 * var(--u, 1rem));
  margin-top: calc(2 * var(--u, 1rem));
}

/* Quiz */

.sp-score {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: calc(1 * var(--u, 1rem)) calc(1.5 * var(--u, 1rem));
  outline: none;
}

.sp-score h4 {
  font-weight: 500 !important;
  color: var(--sp-muted) !important;
}

.sp-score-points {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 calc(0.75 * var(--u, 1rem));
  margin-top: calc(0.25 * var(--u, 1rem)) !important;
  font-size: calc(1 * var(--u, 1rem)) !important;
  color: var(--sp-muted) !important;
  font-variant-numeric: tabular-nums;
}

.sp-score-points b {
  font-size: calc(1.875 * var(--u, 1rem));
  font-weight: 600;
  line-height: calc(2.5 * var(--u, 1rem));
  letter-spacing: -0.025em;
  color: var(--sp-fg);
}

.sp-score-line {
  margin-top: calc(0.25 * var(--u, 1rem)) !important;
  color: var(--sp-muted) !important;
}

.sp-questions--ruled {
  margin-top: calc(2 * var(--u, 1rem)) !important;
  border-top: 1px solid var(--sp-separator);
}

.sp-question {
  display: flex;
  flex-direction: column;
  gap: calc(1 * var(--u, 1rem));
  padding: calc(2 * var(--u, 1rem)) 0 calc(2.25 * var(--u, 1rem));
  border-bottom: 1px solid var(--sp-separator);
}

.sp-questions:not(.sp-questions--ruled) > .sp-question:first-child {
  padding-top: 0;
}

.sp-question-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: calc(0.25 * var(--u, 1rem)) calc(1 * var(--u, 1rem));
  min-height: calc(1.5 * var(--u, 1rem));
}

.sp-question-number {
  font-size: calc(0.75 * var(--u, 1rem)) !important;
  font-weight: 500 !important;
  color: var(--sp-muted) !important;
  font-variant-numeric: tabular-nums;
}

.sp-prompt {
  max-width: 70ch;
  margin-top: calc(0.375 * var(--u, 1rem)) !important;
  font-size: calc(1 * var(--u, 1rem)) !important;
  font-weight: 600 !important;
  line-height: calc(1.75 * var(--u, 1rem));
}

.sp-chip {
  display: inline-flex;
  align-items: center;
  gap: calc(0.25 * var(--u, 1rem));
  padding: calc(0.125 * var(--u, 1rem)) calc(0.5 * var(--u, 1rem));
  border-radius: var(--sp-radius);
  font-size: calc(0.75 * var(--u, 1rem));
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.sp-chip .sp-icon {
  width: calc(0.875 * var(--u, 1rem));
  height: calc(0.875 * var(--u, 1rem));
}

.sp-chip--correct {
  background: var(--sp-success-soft);
  color: var(--sp-success-ink);
}

.sp-chip--wrong {
  background: var(--sp-danger-soft);
  color: var(--sp-danger-ink);
}

.sp-chip--none {
  background: var(--sp-default);
}

.sp-options {
  display: flex;
  flex-direction: column;
  gap: calc(0.125 * var(--u, 1rem));
  margin-inline: calc(-0.75 * var(--u, 1rem)) !important;
}

.sp-option {
  display: flex;
  align-items: flex-start;
  gap: calc(0.75 * var(--u, 1rem));
  padding: calc(0.375 * var(--u, 1rem)) calc(0.75 * var(--u, 1rem));
  border-radius: var(--sp-radius);
  font-size: calc(0.9375 * var(--u, 1rem));
  line-height: calc(1.5 * var(--u, 1rem));
}

label.sp-option {
  cursor: pointer;
}

label.sp-option:hover {
  background: var(--sp-row-hover);
}

.sp-option input {
  flex: none;
  width: calc(1 * var(--u, 1rem));
  height: calc(1 * var(--u, 1rem));
  margin: calc(0.25 * var(--u, 1rem)) 0 0;
  accent-color: var(--sp-accent);
}

.sp-option-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sp-option-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: calc(1 * var(--u, 1rem));
  height: calc(1 * var(--u, 1rem));
  margin-top: calc(0.25 * var(--u, 1rem));
  color: var(--sp-muted);
}

.sp-option-mark .sp-icon {
  stroke-width: 2.5;
}

.sp-option-mark i {
  width: calc(0.25 * var(--u, 1rem));
  height: calc(0.25 * var(--u, 1rem));
  border-radius: 50%;
  background: currentColor;
}

.sp-option-note {
  flex: none;
  font-size: calc(0.75 * var(--u, 1rem));
  font-weight: 500;
}

.sp-option--plain .sp-option-text {
  color: var(--sp-muted);
}

.sp-option--correct {
  background: var(--sp-success-soft);
}

.sp-option--correct .sp-option-text {
  font-weight: 500;
}

.sp-option--correct .sp-option-mark {
  color: var(--sp-success);
}

.sp-option--correct .sp-option-note {
  color: var(--sp-success-ink);
}

.sp-option--picked {
  background: var(--sp-danger-soft);
}

.sp-option--picked .sp-option-mark {
  color: var(--sp-danger);
}

.sp-option--picked .sp-option-note {
  color: var(--sp-danger-ink);
}

.sp-why {
  max-width: 70ch;
}

.sp-why h5 {
  font-size: calc(0.75 * var(--u, 1rem)) !important;
  font-weight: 500 !important;
  color: var(--sp-muted) !important;
}

.sp-why p {
  margin-top: calc(0.25 * var(--u, 1rem)) !important;
  font-size: calc(0.9375 * var(--u, 1rem)) !important;
  line-height: calc(1.5 * var(--u, 1rem));
}

.sp-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: calc(0.75 * var(--u, 1rem)) calc(1.5 * var(--u, 1rem));
  min-height: calc(4.5 * var(--u, 1rem));
  padding-block: calc(1 * var(--u, 1rem));
}

.sp-submit p {
  color: var(--sp-muted) !important;
  font-variant-numeric: tabular-nums;
}

.sp-submit p b {
  font-weight: 500;
  color: var(--sp-fg);
}

.sp-submit .sp-button {
  margin-left: auto;
}

.sp-retake {
  display: flex;
  margin-top: calc(2 * var(--u, 1rem));
}

/* A single piece of the app shown on its own in the page: framed like a picture of it. */

.sp-piece {
  padding: calc(1.5 * var(--u, 1rem)) calc(1.75 * var(--u, 1rem));
  border: 1px solid var(--line-strong, #d4d4d4);
  border-radius: var(--radius-large, 12px);
  background: #ffffff;
  box-shadow: var(--shot-shadow, none);
}

.sp-piece .sp-question {
  padding: 0;
  border: 0;
}

.sp-piece .sp-face {
  min-height: calc(15 * var(--u, 1rem));
}

/* Narrower: the demo re-flows like the app's window does; nothing is scaled down. */

@container (max-width: 60rem) {
  .sp-row--result {
    grid-template-columns: minmax(0, 1fr) calc(11.5 * var(--u, 1rem)) calc(9.5 * var(--u, 1rem));
  }

  .sp-maker {
    display: none;
  }
}

@container (max-width: 50rem) {
  .sp-side {
    display: none;
  }

  .sp-page {
    padding: calc(1.75 * var(--u, 1rem)) calc(1.75 * var(--u, 1rem)) calc(3 * var(--u, 1rem));
  }
}

@container (max-width: 36rem) {
  .sp-app {
    min-height: 0;
  }

  .sp-page {
    padding: calc(1.25 * var(--u, 1rem)) calc(1.25 * var(--u, 1rem)) calc(2 * var(--u, 1rem));
  }

  .sp-rows {
    margin-inline: calc(-0.5 * var(--u, 1rem)) !important;
  }

  .sp-row {
    gap: calc(0.75 * var(--u, 1rem));
    padding-inline: calc(0.5 * var(--u, 1rem));
  }

  .sp-row--result,
  .sp-row--material {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sp-row--file {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sp-date,
  .sp-size-cell {
    display: none;
  }

  .sp-name {
    white-space: normal;
  }

  .sp-row--file .sp-name {
    white-space: nowrap;
  }

  .sp-thumbs {
    display: none;
  }

  /* Fingers need more room than a pointer. */
  .sp-toggle,
  .sp-sizes .sp-toggle,
  .sp-button,
  .sp-back,
  .sp-ghost-toggle {
    min-height: calc(2.5 * var(--u, 1rem));
  }

  .sp-icon-button {
    width: calc(2.5 * var(--u, 1rem));
    height: calc(2.5 * var(--u, 1rem));
  }

  .sp-notice .sp-icon-button {
    width: calc(2.5 * var(--u, 1rem));
    height: calc(2.5 * var(--u, 1rem));
  }

  .sp-button--small,
  label.sp-option {
    min-height: calc(2.5 * var(--u, 1rem));
  }

  label.sp-option {
    align-items: center;
  }

  label.sp-option input {
    margin-top: 0;
  }

  .sp-row {
    min-height: calc(3 * var(--u, 1rem));
  }

  .sp-face {
    min-height: calc(15 * var(--u, 1rem));
    padding: calc(1 * var(--u, 1rem)) calc(1.25 * var(--u, 1rem)) calc(1.5 * var(--u, 1rem));
  }

  .sp-face-text--front {
    font-size: calc(1.25 * var(--u, 1rem));
    line-height: calc(1.875 * var(--u, 1rem));
  }

  .sp-face-text {
    font-size: calc(1.0625 * var(--u, 1rem));
    line-height: calc(1.75 * var(--u, 1rem));
  }

  .sp-round {
    padding: calc(1.5 * var(--u, 1rem));
  }

  .sp-keys {
    display: none !important;
  }

  .sp-option {
    flex-wrap: wrap;
    padding-block: calc(0.5 * var(--u, 1rem));
  }

  .sp-option-note {
    flex-basis: 100%;
    padding-left: calc(1.75 * var(--u, 1rem));
  }

  .sp-piece {
    padding: calc(1.125 * var(--u, 1rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp-bar i {
    width: 100%;
    animation: none;
  }

  .sp-face {
    transition: none;
  }
}
