:root {
  --mm-runtime-surface: var(--surface-bg, #ffffff);
  --mm-runtime-surface-muted: #f9fafb;
  --mm-runtime-border: var(--card-border, #e5e7eb);
  --mm-runtime-border-strong: #d1d5db;
  --mm-runtime-text: var(--text-color, #111827);
  --mm-runtime-text-soft: var(--heading-color, #374151);
  --mm-runtime-focus: #155eef;
  --mm-runtime-key-bg: #edf4ff;
  --mm-runtime-key-bg-hover: #e1eeff;
  --mm-runtime-key-border: #bfcee6;
  --mm-runtime-key-text: #111827;
  --mm-runtime-key-operator-bg: color-mix(in srgb, var(--mm-runtime-focus) 18%, white);
  --mm-runtime-key-operator-border: color-mix(in srgb, var(--mm-runtime-focus) 42%, white);
  --mm-runtime-task-font-size: 14px;
  --mm-runtime-task-line-height: 1.5;
  --mm-runtime-input-font-size: var(--mm-runtime-task-font-size);

  --mm-runtime-success: #027a48;
  --mm-runtime-success-bg: color-mix(in srgb, var(--mm-runtime-success) 14%, white);
  --mm-runtime-danger: #b42318;
  --mm-runtime-danger-bg: color-mix(in srgb, var(--mm-runtime-danger) 12%, white);
  --mm-runtime-warning: #b54708;
  --mm-runtime-warning-bg: color-mix(in srgb, var(--mm-runtime-warning) 14%, white);
}


.mattemotor-studentview,
.task-math-engine-runtime {
  --mm-runtime-stack-gap: 12px;
}

.mattemotor-studentview [data-studentview-slot="task-text"],
.task-math-engine-runtime [data-studentview-slot="task-text"] {
  line-height: 1.45;
}

.mattemotor-studentview__task-text-fragment {
  color: var(--mm-runtime-text-soft);
}
.mattemotor-card {
  background: var(--mm-runtime-surface);
  border: 1px solid var(--mm-runtime-border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--mm-runtime-text) 8%, transparent);
  margin-bottom: 18px;
}

#panel-calculation .mattemotor-header,
.task-math-engine-runtime .mattemotor-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
  width: 100%;
}

.mattemotor-task-display,
.task-math-engine-runtime .mattemotor-task-display {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--mm-runtime-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: var(--mm-runtime-task-font-size);
  line-height: var(--mm-runtime-task-line-height);
  color: var(--mm-runtime-text);
  background: #fff;
  overflow-x: auto;
}

.mattemotor-task-display p,
.task-math-engine-runtime .mattemotor-task-display p {
  margin: 0 0 10px;
}

.mattemotor-task-display p:last-child,
.task-math-engine-runtime .mattemotor-task-display p:last-child {
  margin-bottom: 0;
}

.mattemotor-task-display .katex,
.task-math-engine-runtime .mattemotor-task-display .katex {
  display: inline-block;
  font-size: 1.05em;
}

.mattemotor-task-display .katex-display,
.task-math-engine-runtime .mattemotor-task-display .katex-display {
  overflow-x: auto;
  padding-bottom: 2px;
}

.mattemotor__inline-math {
  display: inline-block;
  min-width: 48px;
  margin-inline: 6px;
  border: none;
  background: transparent;
  padding: 0;
  min-height: 0;
  font-size: var(--mm-runtime-task-font-size);
}

.mattemotor__inline-math::part(content),
.mattemotor__inline-math::part(container),
.mattemotor__history-math::part(content),
.mattemotor__history-math::part(container) {
  font-size: var(--mm-runtime-task-font-size);
}

#history-list,
.task-math-engine-runtime__history {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 10px;
}

#history-list:empty,
.task-math-engine-runtime__history:empty {
  display: none;
  margin: 0;
}

.mattemotor__history-item {
  border: 1px solid var(--mm-runtime-border-strong);
  border-radius: 14px;
  padding: 12px;
  background: var(--mm-runtime-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}


.mattemotor__history-status {
  width: 34px;
  height: 34px;
  order: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mattemotor__history-status svg {
  width: 100%;
  height: 100%;
  display: block;
}


.mattemotor__history-status--grønt,
.mattemotor__step-feedback--grønt {
  color: var(--mm-runtime-success);
}

.mattemotor__history-status--rødt,
.mattemotor__step-feedback--rødt {
  color: var(--mm-runtime-danger);
}

.mattemotor__history-status--pokal,
.mattemotor__step-feedback--pokal {
  color: var(--mm-runtime-warning);
}

.mattemotor__history-status--key {
  color: #8a6f34;
}

.mattemotor__history-status svg circle,
.task-math-engine-runtime__feedback.mattemotor__step-feedback--icon svg circle {
  fill: color-mix(in srgb, currentColor 20%, white);
  stroke: currentColor;
  stroke-width: 2;
}

.mattemotor__history-status svg path,
.task-math-engine-runtime__feedback.mattemotor__step-feedback--icon svg path {
  stroke: currentColor;
}

.mattemotor__history-status--pokal svg path,
.task-math-engine-runtime__feedback.mattemotor__step-feedback--pokal svg path {
  fill: color-mix(in srgb, currentColor 45%, white);
}

.mattemotor__history-math {
  order: 1;
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--mm-runtime-task-font-size);
  line-height: var(--mm-runtime-task-line-height);
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.mattemotor__history-math:hover {
  background: color-mix(in srgb, var(--mm-runtime-focus) 9%, transparent);
}

.mattemotor__history-math:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--mm-runtime-focus) 14%, transparent);
  box-shadow: 0 0 0 2px var(--mm-runtime-focus);
}

.mattemotor__history-content {
  order: 1;
  flex: 1;
  min-width: 0;
  color: var(--mm-runtime-text);
  font-size: var(--mm-runtime-task-font-size);
  line-height: var(--mm-runtime-task-line-height);
}

.mattemotor__history-content > *:first-child {
  margin-top: 0;
}

.mattemotor__history-content > *:last-child {
  margin-bottom: 0;
}

.mattemotor__task-start-token {
  cursor: pointer;
  border-radius: 8px;
  pointer-events: auto;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.mattemotor__task-start-token * {
  pointer-events: none;
}

.mattemotor-task-display .math-vis-description-math.mattemotor__task-start-token,
.task-math-engine-runtime .mattemotor-task-display .math-vis-description-math.mattemotor__task-start-token {
  display: inline-flex;
  align-items: center;
  padding-inline: 4px;
  margin-inline: 2px;
}

.mattemotor__task-start-token:hover {
  background: color-mix(in srgb, var(--mm-runtime-focus) 10%, transparent);
}

.mattemotor__task-start-token:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--mm-runtime-focus) 14%, transparent);
  box-shadow: 0 0 0 2px var(--mm-runtime-focus);
}

#validation-feedback,
.task-math-engine-runtime__feedback {
  margin: 10px 0;
  min-height: 20px;
  font-weight: 600;
}

#validation-feedback:empty,
.task-math-engine-runtime__feedback:empty {
  display: none;
  margin: 0;
  min-height: 0;
}

#validation-feedback.mattemotor__step-feedback--icon,
.task-math-engine-runtime__feedback.mattemotor__step-feedback--icon {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#validation-feedback.mattemotor__step-feedback--icon svg,
.task-math-engine-runtime__feedback.mattemotor__step-feedback--icon svg {
  width: 40px;
  height: 40px;
  display: block;
}

.task-math-engine-runtime__solution-button {
  border: 2px solid #63a6d3;
  background: #f2f4f7;
  color: #111827;
  border-radius: 999px;
  min-height: 56px;
  min-width: 102px;
  padding: 10px 20px 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
  flex: 0 0 auto;
  white-space: nowrap;
}

.task-math-engine-runtime__solution-button:hover {
  border-color: #5298c9;
  background: #ebeff4;
}

.task-math-engine-runtime__solution-button:focus-visible {
  outline: 3px solid #0b74b5;
  outline-offset: 2px;
}

.task-math-engine-runtime__solution-button:disabled,
.task-math-engine-runtime__solution-button[disabled] {
  opacity: 0.46;
  cursor: default;
}

.task-math-engine-runtime__solution-icon {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  flex: 0 0 auto;
}

.task-math-engine-runtime__solution-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.task-math-engine-runtime__solution-count {
  font-size: 1.26rem;
  line-height: 1;
  font-weight: 780;
  letter-spacing: -0.03em;
}

.task-math-engine-runtime__solution-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--mm-runtime-border-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf7 0%, #f8f5ea 100%);
}

.task-math-engine-runtime__solution-panel[hidden] {
  display: none !important;
}

.task-math-engine-runtime__solution-list {
  display: grid;
  gap: 10px;
}

.task-math-engine-runtime__solution-step {
  align-items: center;
}

.task-math-engine-runtime__solution-step-content {
  min-width: 0;
}

.task-math-engine-runtime__solution-step .mattemotor__history-content {
  cursor: default;
}

.task-math-engine-runtime__symbol-bar {
  --mm-runtime-key-size: 30px;
  --mm-runtime-key-gap: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: var(--mm-runtime-key-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin: 8px 0 12px;
  padding: 6px 10px;
  border: none;
  border-radius: 10px;
  background: #070b15;
  box-shadow: none;
  scrollbar-width: thin;
}

.task-math-engine-runtime__symbol-bar::before {
  content: none;
}

.task-math-engine-runtime__symbol-button {
  appearance: none;
  flex: 0 0 auto;
  position: relative;
  min-width: var(--mm-runtime-key-size);
  height: var(--mm-runtime-key-size);
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #f8fafc;
  min-height: var(--mm-runtime-key-size);
  padding: 0 6px;
  font-weight: 650;
  font-size: 1.02rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: none;
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.task-math-engine-runtime__symbol-button:hover {
  background: color-mix(in srgb, white 14%, transparent);
  box-shadow: none;
}

.task-math-engine-runtime__symbol-button:active {
  transform: scale(0.98);
  box-shadow: none;
}

.task-math-engine-runtime__symbol-button:focus-visible {
  outline: 2px solid color-mix(in srgb, white 90%, var(--mm-runtime-focus) 10%);
  outline-offset: 1px;
}

.task-math-engine-runtime__symbol-button[data-symbol-key="fraction"],
.task-math-engine-runtime__symbol-button[data-symbol-key="vector"],
.task-math-engine-runtime__symbol-button[data-symbol-key="power"] {
  color: transparent;
}

.task-math-engine-runtime__symbol-button[data-symbol-key="fraction"]::after,
.task-math-engine-runtime__symbol-button[data-symbol-key="vector"]::after,
.task-math-engine-runtime__symbol-button[data-symbol-key="power"]::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(16px, calc(var(--mm-runtime-key-size) - 8px), 24px);
  height: clamp(16px, calc(var(--mm-runtime-key-size) - 8px), 24px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.task-math-engine-runtime__symbol-button[data-symbol-key="fraction"]::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='2.5' width='8' height='6' rx='1'/%3E%3Cline x1='4' y1='12' x2='20' y2='12'/%3E%3Crect x='8' y='15.5' width='8' height='6' rx='1'/%3E%3C/svg%3E");
}

.task-math-engine-runtime__symbol-button[data-symbol-key="vector"]::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='7' x2='20' y2='7'/%3E%3Cpath d='M16 3l4 4-4 4'/%3E%3Cpath d='M7 14l5 7 5-7'/%3E%3C/svg%3E");
}

.task-math-engine-runtime__symbol-button[data-symbol-key="power"]::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='11.5' width='9' height='9' rx='1.1'/%3E%3Crect x='13' y='3.5' width='7.5' height='7.5' rx='1.1'/%3E%3C/svg%3E");
}

body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-bar,
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-bar {
  --mm-runtime-key-size: 34px;
  --mm-runtime-key-gap: 5px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-rows: var(--mm-runtime-key-size);
  align-items: stretch;
  justify-content: stretch;
  margin: -2px 0 12px;
  padding: 8px 10px;
  border: none;
  border-radius: 12px;
  background: #101b4b;
  overflow-x: hidden;
  overflow-y: visible;
}

body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button,
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button {
  flex: initial;
  min-width: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #f8fafc;
  padding: 0 6px;
  font-weight: 700;
  font-size: 1rem;
}

body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button:hover,
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button:hover {
  background: color-mix(in srgb, white 14%, transparent);
}

body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button:focus-visible,
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button:focus-visible {
  outline: 2px solid var(--mm-runtime-focus);
  outline-offset: 2px;
}

body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="plus"],
body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="minus"],
body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="multiply"],
body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="multiply-dot"],
body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="divide-colon"],
body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="fraction"],
body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="equals"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="multiply-dot"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="divide-colon"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="plus"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="minus"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="multiply"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="fraction"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="equals"] {
  background: color-mix(in srgb, white 20%, transparent);
}

body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="sqrt"],
body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="integral"],
body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="vector"],
body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="power"],
body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="pi"],
body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="le"],
body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="ge"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="sqrt"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="integral"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="vector"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="power"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="pi"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="le"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-key="ge"] {
  background: color-mix(in srgb, #7dd3fc 20%, transparent);
}

body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-role="navigation"],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-role="navigation"] {
  background: color-mix(in srgb, #c7d2fe 24%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, white 18%, transparent);
  font-size: 1.08rem;
  font-weight: 800;
}

body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-role="navigation"]:hover,
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button[data-symbol-role="navigation"]:hover {
  background: color-mix(in srgb, #c7d2fe 34%, transparent);
}

@media (max-width: 620px) {
  .task-math-engine-runtime__symbol-bar {
    --mm-runtime-key-size: 27px;
    --mm-runtime-key-gap: 5px;
    padding: 5px 8px;
  }
  .task-math-engine-runtime__symbol-button {
    font-size: 0.94rem;
  }
  body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-bar,
  .task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-bar {
    --mm-runtime-key-size: 28px;
    --mm-runtime-key-gap: 4px;
    padding: 6px 7px 7px;
  }
  body[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button,
  .task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__symbol-button {
    font-size: 0.86rem;
  }
  .task-math-engine-runtime__check {
    min-width: 0;
  }
}

.task-math-engine-runtime__input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  container-type: inline-size;
}

.task-math-engine-runtime__input-row .task-math-engine-runtime__input-wrap,
.task-math-engine-runtime__input-row .mattemotor-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.mattemotor-input-wrap,
.task-math-engine-runtime__input-wrap {
  position: relative;
  margin-top: 8px;
  margin-bottom: 0;
}

.task-math-engine-runtime__input-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 12px;
  align-self: start;
  min-width: 0;
  margin-top: 8px;
}

.task-math-engine-runtime__check {
  width: auto;
  min-width: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

@container (max-width: 560px) {
  .task-math-engine-runtime__input-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .task-math-engine-runtime__input-actions {
    margin-top: 0;
  }
}

@media (max-width: 1100px) {
  body[data-runtime-device="ipad"] .task-math-engine-runtime__input-row,
  .task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__input-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  body[data-runtime-device="ipad"] .task-math-engine-runtime__input-actions,
  .task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__input-actions {
    margin-top: 0;
  }
}

.mattemotor-input-label,
.task-math-engine-runtime__input-label {
  position: absolute;
  left: 14px;
  top: -11px;
  background: var(--mm-runtime-surface);
  border: 1px solid color-mix(in srgb, var(--mm-runtime-border-strong) 78%, white);
  border-radius: 999px;
  padding: 2px 10px;
  color: var(--mm-runtime-success);
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.task-math-engine-runtime__input-label[data-device-label]::after,
.mattemotor-input-label[data-device-label]::after {
  content: attr(data-device-label);
  color: color-mix(in srgb, var(--mm-runtime-text-soft) 72%, white);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.task-math-engine-runtime__input-wrap.is-loading .task-math-engine-runtime__input-label,
.mattemotor-input-wrap.is-loading .mattemotor-input-label {
  color: color-mix(in srgb, var(--mm-runtime-text-soft) 70%, white);
  border-color: color-mix(in srgb, var(--mm-runtime-border-strong) 70%, white);
  background: var(--mm-runtime-surface-muted);
}

.task-math-engine-runtime__input,
#student-input.mattemotor-field {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 72px;
  box-sizing: border-box;
  border-style: solid;
  border-width: 2px;
  border-color: var(--mm-runtime-border-strong);
  border-radius: 12px 12px 8px 8px;
  font-size: var(--mm-runtime-input-font-size);
  line-height: 1.25;
}

.task-math-engine-runtime__input::part(content),
#student-input.mattemotor-field::part(content),
.task-math-engine-runtime__input::part(container),
#student-input.mattemotor-field::part(container) {
  font-size: var(--mm-runtime-input-font-size);
  border: none;
}

.task-math-engine-runtime__input:disabled,
#student-input.mattemotor-field:disabled,
.task-math-engine-runtime__input-wrap.is-loading .task-math-engine-runtime__input,
.mattemotor-input-wrap.is-loading #student-input.mattemotor-field {
  border-color: color-mix(in srgb, var(--mm-runtime-border-strong) 74%, white);
  background: var(--mm-runtime-surface-muted);
  color: color-mix(in srgb, var(--mm-runtime-text-soft) 72%, white);
  cursor: not-allowed;
  opacity: 1;
}

.task-math-engine-runtime__input-row + .task-math-engine-runtime__symbol-bar,
.task-math-engine-runtime__input-wrap + .task-math-engine-runtime__symbol-bar,
.mattemotor-input-wrap + .task-math-engine-runtime__symbol-bar {
  margin-top: 0;
}

.task-math-engine-runtime__input-wrap .task-math-engine-runtime__symbol-bar,
.mattemotor-input-wrap .task-math-engine-runtime__symbol-bar {
  width: 100%;
  max-width: 100%;
  margin-top: 8px;
}

body[data-host-mode="student-view"] :is(.task-math-engine-runtime[data-studentview-contract="mattemotor-v1"], #panel-calculation) :is(.task-math-engine-runtime__input-wrap, .mattemotor-input-wrap) > .task-math-engine-runtime__symbol-bar,
body[data-mode="student-view"] :is(.task-math-engine-runtime[data-studentview-contract="mattemotor-v1"], #panel-calculation) :is(.task-math-engine-runtime__input-wrap, .mattemotor-input-wrap) > .task-math-engine-runtime__symbol-bar,
body[data-app-mode="student"] :is(.task-math-engine-runtime[data-studentview-contract="mattemotor-v1"], #panel-calculation) :is(.task-math-engine-runtime__input-wrap, .mattemotor-input-wrap) > .task-math-engine-runtime__symbol-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  width: auto;
  max-width: none;
  margin: 0;
  z-index: 2;
}

.task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] :is(.task-math-engine-runtime__input-wrap, .mattemotor-input-wrap) > .task-math-engine-runtime__symbol-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  width: auto;
  max-width: none;
  margin: 0;
  z-index: 2;
}

.task-math-engine-runtime__input-actions + .task-math-engine-runtime__symbol-bar {
  margin-top: 0;
}

body[data-runtime-device="ipad"] .task-math-engine-runtime__input-row + .task-math-engine-runtime__symbol-bar,
body[data-runtime-device="ipad"] .task-math-engine-runtime__input-wrap + .task-math-engine-runtime__symbol-bar,
body[data-runtime-device="ipad"] .mattemotor-input-wrap + .task-math-engine-runtime__symbol-bar,
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__input-row + .task-math-engine-runtime__symbol-bar,
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__input-wrap + .task-math-engine-runtime__symbol-bar,
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__input-actions + .task-math-engine-runtime__symbol-bar,
.task-math-engine-runtime[data-runtime-device="ipad"] .mattemotor-input-wrap + .task-math-engine-runtime__symbol-bar {
  margin-top: 0;
}

body[data-host-mode="student-view"] .task-math-engine-runtime .mattemotor-input-label,
body[data-mode="student-view"] .task-math-engine-runtime .mattemotor-input-label,
body[data-app-mode="student"] .task-math-engine-runtime .mattemotor-input-label {
  display: none !important;
}

body[data-runtime-device="ipad"] .task-math-engine-runtime__input-row + .task-math-engine-runtime__symbol-bar[hidden],
body[data-runtime-device="ipad"] .task-math-engine-runtime__input-wrap + .task-math-engine-runtime__symbol-bar[hidden],
body[data-runtime-device="ipad"] .mattemotor-input-wrap + .task-math-engine-runtime__symbol-bar[hidden],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__input-row + .task-math-engine-runtime__symbol-bar[hidden],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__input-wrap + .task-math-engine-runtime__symbol-bar[hidden],
.task-math-engine-runtime[data-runtime-device="ipad"] .task-math-engine-runtime__input-actions + .task-math-engine-runtime__symbol-bar[hidden],
.task-math-engine-runtime[data-runtime-device="ipad"] .mattemotor-input-wrap + .task-math-engine-runtime__symbol-bar[hidden] {
  margin-top: 0;
  border-top: none;
  border-radius: 0;
}

.math-vis-shared-math-input::part(menu-toggle),
.math-vis-shared-math-input::part(virtual-keyboard-toggle),
.math-vis-shared-math-input::part(assistant),
.task-math-engine-runtime__input::part(menu-toggle),
.task-math-engine-runtime__input::part(virtual-keyboard-toggle),
.task-math-engine-runtime__input::part(assistant),
.mattemotor-field::part(menu-toggle),
.mattemotor-field::part(virtual-keyboard-toggle),
.mattemotor-field::part(assistant) {
  display: none !important;
}

.task-math-engine-runtime__input:focus,
#student-input.mattemotor-field:focus {
  outline: none;
  border-color: var(--mm-runtime-focus);
}

/* Legacy base.css still ships higher-specificity embedded Mattemotor rules.
   Reassert the shared task-core contract so integrated runtimes stay visible. */
body[data-host-mode="student-view"] .card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-wrap:not(:focus-within) #student-input.mattemotor-field,
body[data-mode="student-view"] .card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-wrap:not(:focus-within) #student-input.mattemotor-field,
body[data-app-mode="student"] .card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-wrap:not(:focus-within) #student-input.mattemotor-field {
  opacity: 1;
  border-color: var(--mm-runtime-border-strong);
  background: #fff;
  color: var(--mm-runtime-text);
  caret-color: auto;
}

body[data-host-mode="student-view"] .card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-wrap:not(:focus-within) .task-math-engine-runtime__symbol-bar:not([hidden]),
body[data-mode="student-view"] .card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-wrap:not(:focus-within) .task-math-engine-runtime__symbol-bar:not([hidden]),
body[data-app-mode="student"] .card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-wrap:not(:focus-within) .task-math-engine-runtime__symbol-bar:not([hidden]) {
  display: none !important;
}

body[data-runtime-device="ipad"][data-host-mode="student-view"] .card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-wrap:not(:focus-within) .task-math-engine-runtime__symbol-bar:not([hidden]),
body[data-runtime-device="ipad"][data-mode="student-view"] .card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-wrap:not(:focus-within) .task-math-engine-runtime__symbol-bar:not([hidden]),
body[data-runtime-device="ipad"][data-app-mode="student"] .card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-wrap:not(:focus-within) .task-math-engine-runtime__symbol-bar:not([hidden]),
.card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"][data-runtime-device="ipad"] .task-math-engine-runtime__input-wrap:not(:focus-within) .task-math-engine-runtime__symbol-bar:not([hidden]) {
  display: none !important;
}

.card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .mattemotor__history-status {
  border: none;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

.card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .mattemotor__history-status--grønt {
  color: var(--mm-runtime-success);
  background: transparent;
}

.card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .mattemotor__history-status--rødt {
  color: var(--mm-runtime-danger);
  background: transparent;
}

.card--examples .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .mattemotor__history-status--pokal {
  color: var(--mm-runtime-warning);
  background: transparent;
}

.task-math-engine-runtime__fallback {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--mm-runtime-danger) 30%, white);
  border-radius: 10px;
  background: var(--mm-runtime-danger-bg);
  color: var(--mm-runtime-danger);
  font-weight: 600;
}

/* MODE C CLEAN: behold kun hovedkort-rammen, fjern interne kort-rammer. */
body[data-host-mode="student-view"] .task-math-engine-runtime,
body[data-mode="student-view"] .task-math-engine-runtime,
body[data-app-mode="student"] .task-math-engine-runtime,
body[data-host-mode="student-view"] .mattemotor-studentview,
body[data-mode="student-view"] .mattemotor-studentview,
body[data-app-mode="student"] .mattemotor-studentview {
  --mm-runtime-task-font-size: var(--mv-student-font-base, 16px);
  --mm-runtime-task-line-height: var(--mv-student-line-height, 1.4);
  --mm-runtime-input-font-size: var(--mv-student-font-base, 16px);
  background: transparent;
  padding: 10px 0 0;
  border-radius: 0;
}

body[data-host-mode="student-view"] .task-math-engine-runtime .mattemotor-task-display,
body[data-mode="student-view"] .task-math-engine-runtime .mattemotor-task-display,
body[data-app-mode="student"] .task-math-engine-runtime .mattemotor-task-display,
body[data-host-mode="student-view"] .mattemotor-studentview .mattemotor-task-display,
body[data-mode="student-view"] .mattemotor-studentview .mattemotor-task-display,
body[data-app-mode="student"] .mattemotor-studentview .mattemotor-task-display {
  border: none;
  background: transparent;
  padding: 0;
  font-size: var(--mm-runtime-task-font-size);
  line-height: var(--mm-runtime-task-line-height);
}

body[data-host-mode="student-view"].app-layout .layout--sidebar > :not(.side):has(.task-math-engine-runtime.is-active),
body[data-mode="student-view"].app-layout .layout--sidebar > :not(.side):has(.task-math-engine-runtime.is-active),
body[data-app-mode="student"].app-layout .layout--sidebar > :not(.side):has(.task-math-engine-runtime.is-active) {
  min-height: 0;
  justify-content: flex-start;
}

body[data-host-mode="student-view"].app-layout .layout--sidebar > :not(.side):has(.task-math-engine-runtime.is-active) > .figure,
body[data-mode="student-view"].app-layout .layout--sidebar > :not(.side):has(.task-math-engine-runtime.is-active) > .figure,
body[data-app-mode="student"].app-layout .layout--sidebar > :not(.side):has(.task-math-engine-runtime.is-active) > .figure {
  margin-block: 0;
  justify-content: flex-start;
}

body[data-host-mode="student-view"] .task-math-engine-runtime .mattemotor__history-item,
body[data-mode="student-view"] .task-math-engine-runtime .mattemotor__history-item,
body[data-app-mode="student"] .task-math-engine-runtime .mattemotor__history-item {
  border: 1px solid var(--mm-runtime-border-strong);
  box-shadow: none;
  border-radius: 12px;
  background: var(--mm-runtime-surface);
  padding: 10px 12px;
  font-size: var(--mm-runtime-task-font-size);
  line-height: var(--mm-runtime-task-line-height);
  width: 100%;
}

body[data-host-mode="student-view"] .task-math-engine-runtime .mattemotor__history-math,
body[data-mode="student-view"] .task-math-engine-runtime .mattemotor__history-math,
body[data-app-mode="student"] .task-math-engine-runtime .mattemotor__history-math {
  font-size: var(--mm-runtime-task-font-size);
  line-height: var(--mm-runtime-task-line-height);
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"],
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"],
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
  padding-bottom: 0;
}

.task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] {
  min-height: 100%;
  padding-bottom: 0;
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #history-list,
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #history-list,
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #history-list {
  width: var(--mm-runtime-step-width, 100%);
  max-width: 100%;
  margin-left: auto;
  margin-bottom: 0;
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-panel,
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-panel,
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-panel {
  width: var(--mm-runtime-step-width, 100%);
  max-width: 100%;
  margin-left: auto;
  margin-top: 0;
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .mattemotor__history-item[data-code="grønt"],
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .mattemotor__history-item[data-code="grønt"],
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .mattemotor__history-item[data-code="grønt"] {
  border-color: color-mix(in srgb, #16a34a 28%, white);
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .mattemotor__history-item[data-code="pokal"],
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .mattemotor__history-item[data-code="pokal"],
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .mattemotor__history-item[data-code="pokal"] {
  border-color: color-mix(in srgb, #ca8a04 34%, white);
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] :is(.mattemotor__history-status--grønt, .mattemotor__step-feedback--grønt),
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] :is(.mattemotor__history-status--grønt, .mattemotor__step-feedback--grønt),
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] :is(.mattemotor__history-status--grønt, .mattemotor__step-feedback--grønt) {
  color: #16a34a;
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] :is(.mattemotor__history-status--pokal, .mattemotor__step-feedback--pokal),
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] :is(.mattemotor__history-status--pokal, .mattemotor__step-feedback--pokal),
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] :is(.mattemotor__history-status--pokal, .mattemotor__step-feedback--pokal) {
  color: #ca8a04;
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row .mattemotor-input-wrap,
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row .mattemotor-input-wrap,
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row .mattemotor-input-wrap {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row,
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row,
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row {
  position: sticky !important;
  left: auto !important;
  right: auto !important;
  bottom: 0 !important;
  display: grid !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  gap: 12px;
  width: 100% !important;
  max-width: 100% !important;
  margin-top: auto !important;
  padding-top: 14px !important;
  padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  z-index: 2;
}

.task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row {
  position: sticky !important;
  left: auto !important;
  right: auto !important;
  bottom: 0 !important;
  display: grid !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  gap: 12px;
  width: 100% !important;
  max-width: 100% !important;
  margin-top: auto !important;
  padding-top: 14px !important;
  padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  z-index: 2;
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-actions,
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-actions,
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-actions {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 12px;
  margin-top: 0;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row > *,
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row > *,
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row > * {
  min-width: 0;
  max-width: 100%;
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field,
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field,
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 56px;
  border-width: 1.5px;
  border-color: color-mix(in srgb, #454545 44%, white);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field::part(container),
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field::part(container),
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field::part(container) {
  border-radius: inherit;
  background: transparent;
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field:focus,
body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field:focus-within,
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field:focus,
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field:focus-within,
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field:focus,
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field:focus-within {
  outline: none;
  border-color: color-mix(in srgb, var(--mm-runtime-focus) 52%, #454545);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mm-runtime-focus) 10%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-button,
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-button,
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-button {
  min-width: 102px;
  min-height: 58px;
  padding: 10px 20px 10px 16px;
  border-width: 2px;
  border-color: #65a8d4;
  background: #f1f4f7;
  box-shadow: none;
}

body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-count,
body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-count,
body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-count {
  font-size: calc(var(--mv-student-font-base, 16px) * 1.12);
}

@media (max-width: 700px) {
  body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"],
  body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"],
  body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] {
    min-height: 100%;
  }

  .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] {
    min-height: 100%;
  }

  body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row .mattemotor-input-wrap,
  body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row .mattemotor-input-wrap,
  body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row .mattemotor-input-wrap {
    flex-basis: auto;
  }

  body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row,
  body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row,
  body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row,
  .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-row {
    padding-top: 10px !important;
    padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
  }

  body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-actions,
  body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-actions,
  body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__input-actions {
    justify-content: flex-end;
  }

  body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field,
  body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field,
  body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] #student-input.mattemotor-field,
  body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-button,
  body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-button,
  body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-button,
  body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__check,
  body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__check,
  body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__check {
    min-height: 50px;
  }

  body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-button,
  body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-button,
  body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-button {
    min-width: 92px;
    padding: 8px 16px 8px 14px;
  }

  body[data-host-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-count,
  body[data-mode="student-view"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-count,
  body[data-app-mode="student"] .task-math-engine-runtime[data-studentview-contract="mattemotor-v1"] .task-math-engine-runtime__solution-count {
    font-size: calc(var(--mv-student-font-base, 16px) * 0.85);
  }
}

body[data-host-mode="student-view"] #student-input.mattemotor-field,
body[data-mode="student-view"] #student-input.mattemotor-field,
body[data-app-mode="student"] #student-input.mattemotor-field,
body[data-host-mode="student-view"] .task-math-engine-runtime__input,
body[data-mode="student-view"] .task-math-engine-runtime__input,
body[data-app-mode="student"] .task-math-engine-runtime__input {
  border-style: solid;
  border-width: 2px;
  border-color: var(--mm-runtime-border-strong);
  background: #fff;
}
