:root {
  color-scheme: light;
  --background: #ffffff;
  --sheet: #ffffff;
  --toolbar: #f7f7f8;
  --ink: #202124;
  --muted: #6f737a;
  --line: #e3e4e7;
  --line-strong: #c9cbd0;
  --accent: #e93242;
  --accent-hover: #c91f32;
  --accent-wash: #fff0f2;
  --success: #18794e;
  --error: #bf2435;
  --error-wash: #fff1f2;
  --field: #ffffff;
  --selection: #e3e4e7;
  --selection-soft: #f0f1f2;
  --accent-active: #ffe2e6;
  --button-on-accent: #ffffff;
  --sans: "Avenir Next", Avenir, "Nunito Sans", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #18181a;
    --sheet: #18181a;
    --toolbar: #222225;
    --ink: #f1f1f3;
    --muted: #aaaab1;
    --line: #35353a;
    --line-strong: #4b4b52;
    --accent: #ff5362;
    --accent-hover: #ff7180;
    --accent-wash: #381f24;
    --success: #6ed6a4;
    --error: #ff7b88;
    --error-wash: #351f23;
    --field: #18181a;
    --selection: #55565d;
    --selection-soft: #38383e;
    --accent-active: #4a242b;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #18181a;
  --sheet: #18181a;
  --toolbar: #222225;
  --ink: #f1f1f3;
  --muted: #aaaab1;
  --line: #35353a;
  --line-strong: #4b4b52;
  --accent: #ff5362;
  --accent-hover: #ff7180;
  --accent-wash: #381f24;
  --success: #6ed6a4;
  --error: #ff7b88;
  --error-wash: #351f23;
  --field: #18181a;
  --selection: #55565d;
  --selection-soft: #38383e;
  --accent-active: #4a242b;
}

:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

html {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: visible;
  overscroll-behavior-x: none;
}

body {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: visible;
  overscroll-behavior-x: none;
  background: var(--background);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

button { font: inherit; }

.site-header {
  display: flex;
  width: calc(100% - 48px);
  max-width: 1040px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 25px 0 20px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.025em;
  text-decoration: none;
}

.wordmark-symbol {
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-style: italic;
  font-weight: 700;
  line-height: .8;
}

.header-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 20px;
}

.site-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  display: inline-grid;
  width: 36px;
  min-width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--toolbar);
  color: var(--ink);
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.theme-icon {
  grid-area: 1 / 1;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.theme-icon-sun,
.theme-toggle[aria-pressed="true"] .theme-icon-moon { display: none; }
.theme-toggle[aria-pressed="true"] .theme-icon-sun { display: block; }

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent-hover);
  outline: none;
}

.github-star {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--toolbar);
  color: var(--ink);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  touch-action: manipulation;
}

.github-star svg {
  fill: none;
  stroke: currentcolor;
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.github-star:hover,
.github-star:focus-visible {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent-hover);
  outline: none;
}

.workspace {
  width: calc(100% - 48px);
  max-width: 920px;
  margin: 0 auto 96px;
}

.workspace,
.site-header,
.problem-panel,
.solution-panel,
#solve-form,
.math-input-shell,
.math-toolbar,
.tool-row,
.problem-actions,
.solution-heading > div,
.step > div,
.step-notes,
.step-note,
.step-transformation { min-width: 0; }

.problem-panel,
.solution-panel,
#solve-form,
.math-input-shell,
.math-toolbar,
.problem-actions,
.solution-heading,
.step,
.steps { max-width: 100%; }

.problem-panel,
.solution-panel {
  background: var(--sheet);
}

.problem-heading { padding: 58px 0 25px; }

h1,
h2,
h3,
p { margin-top: 0; }

h1,
.solution-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(29px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.12;
}

.problem-heading p {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

#solve-form { padding: 0; }

.math-input-shell {
  position: relative;
  contain: inline-size;
}

.field-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.field-label {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .035em;
}

.math-keyboard-button {
  display: none;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--field);
  color: var(--ink);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.math-keyboard-button svg {
  flex: 0 0 auto;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.math-keyboard-button:hover,
.math-keyboard-button:focus-visible,
.math-keyboard-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
  outline: none;
}

math-field {
  --primary: var(--accent);
  --caret-color: var(--accent);
  --selection-color: var(--ink);
  --selection-background-color: var(--selection);
  --contains-highlight-color: var(--ink);
  --contains-highlight-background-color: var(--selection-soft);
  --smart-fence-color: var(--ink);
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  outline: none;
  color: var(--ink);
}

.primary-math-field {
  contain: inline-size;
  min-height: 120px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background: var(--field);
  padding: 26px 4px 30px;
  font-size: clamp(31px, 5vw, 48px);
  transition: border-color 140ms ease;
}

.primary-math-field:focus-within,
.primary-math-field.is-mobile-editing { border-color: var(--accent); }

.primary-math-field::part(virtual-keyboard-toggle) { display: none; }

.mobile-keyboard-proxy {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 0;
  width: 2px;
  height: 2px;
  min-height: 0;
  margin: 0;
  border: 0;
  opacity: .01;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  resize: none;
}

.math-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-top: 0;
  border-bottom: 1px solid var(--line);
  background: var(--toolbar);
  contain: inline-size;
}

.tool-group { min-width: 0; padding: 17px 18px 19px; }
.tool-group:first-child { padding-left: 0; }
.tool-group:last-child { padding-right: 0; }
.tool-group + .tool-group { border-left: 1px solid var(--line); }

.tool-group h2 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .035em;
}

.tool-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 4px; }

.tool-group-calculus .tool-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.symbol-key {
  display: grid;
  min-width: 43px;
  min-height: 43px;
  overflow: hidden;
  place-items: center;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 5px 9px 4px;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.symbol-key-wide {
  width: 100%;
  min-width: 0;
  min-height: 59px;
  padding-block: 7px 6px;
}

.symbol-key math-field {
  width: auto;
  max-width: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  padding: 0;
  pointer-events: none;
  user-select: none;
  font-size: 17px;
}

.symbol-key-wide math-field { font-size: 18px; }
.symbol-key-system { min-width: 76px; }
.symbol-key-system math-field { font-size: 14px; }

.symbol-key:hover,
.symbol-key:focus-visible {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent-hover);
  outline: none;
}

.symbol-key:active { background: var(--accent-active); }

.problem-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 24px;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 15px;
  color: var(--muted);
  font-size: 13px;
}

.example {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 3px 0;
  cursor: pointer;
  font-weight: 600;
}

.example:hover,
.example:focus-visible { color: var(--accent); outline: none; text-decoration: underline; text-underline-offset: 4px; }

.random-problem {
  border: 0;
  border-left: 1px solid var(--line-strong);
  background: transparent;
  color: var(--accent);
  padding: 3px 0 3px 15px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.random-problem:hover,
.random-problem:focus-visible {
  color: var(--accent-hover);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.solve-action {
  display: flex;
  min-width: 190px;
  align-items: center;
  justify-content: flex-end;
}

.solve-button {
  min-width: 180px;
  min-height: 58px;
  border: 0;
  border-radius: 3px;
  background: var(--accent);
  color: var(--button-on-accent);
  padding: 17px 36px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.solve-button:hover,
.solve-button:focus-visible {
  background: var(--accent-hover);
  outline: none;
  transform: translateY(-1px);
}

.solve-button:disabled { cursor: wait; opacity: .58; transform: none; }

.solver-progress {
  margin-top: 34px;
  border-top: 1px solid var(--line);
  padding: 28px 0 4px;
}

.solver-progress-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.solver-progress-heading h3 {
  margin-bottom: 7px;
  font-size: 17px;
}

#solver-progress-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

#runtime-status-text {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}

.solver-progress progress {
  display: block;
  width: 100%;
  height: 5px;
  margin-bottom: 20px;
  border: 0;
  border-radius: 0;
  background: var(--line);
  color: var(--accent);
  accent-color: var(--accent);
}

.solver-progress progress::-webkit-progress-bar { background: var(--line); }
.solver-progress progress::-webkit-progress-value { background: currentcolor; }
.solver-progress progress::-moz-progress-bar { background: currentcolor; }

.runtime-steps {
  display: grid;
  margin: 0;
  padding-left: 24px;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.runtime-steps li::marker { color: var(--muted); font-weight: 700; }
.runtime-steps .is-complete { color: var(--success); }
.runtime-steps .is-complete::marker { content: "✓  "; color: var(--success); }
.runtime-steps .is-current { color: var(--ink); font-weight: 700; }
.runtime-steps .is-current::marker { color: var(--accent); }

.solution-panel {
  margin-top: 64px;
  padding: 54px 0 0;
  border-top: 5px solid var(--accent);
}

@media (min-width: 1100px) {
  .solution-panel {
    width: min(1600px, calc(100vw - 64px));
    max-width: none;
    margin-left: 50%;
    padding-right: clamp(32px, 3vw, 52px);
    padding-left: clamp(32px, 3vw, 52px);
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    transform: translateX(-50%);
  }
}

.solution-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.solution-heading h2 { margin-bottom: 7px; }

.status-text {
  margin: 0;
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}

.status-text::before { content: "✓"; margin-right: 6px; }
.status-text:empty::before { content: none; }
.status-text.is-error { color: var(--error); }
.status-text.is-error::before { content: "×"; }

.answer-block { padding: 34px 0 38px; border-bottom: 1px solid var(--line); }
.answer-block h3,
.working-block > h3 {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .035em;
}

.math-viewport {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
  contain: inline-size;
}

.math-viewport:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.math-viewport > math-field {
  display: inline-block;
  width: max-content;
  max-width: none;
  min-width: 100%;
  overflow: visible;
  pointer-events: none;
  user-select: none;
}

.result-viewport { padding: 5px 0 12px; }

.result-math {
  min-height: 56px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: clamp(31px, 5vw, 46px);
}

.working-block { padding-top: 37px; }
.steps { counter-reset: solution-step; }

.step {
  counter-increment: solution-step;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 18px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.step:first-child { padding-top: 5px; border-top: 0; }

.step-number {
  color: var(--accent);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.step h3 { margin: 0 0 7px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.step p { max-width: 720px; margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.65; }

.step-explanation-math {
  display: inline-flex;
  margin: 0;
  color: inherit;
  font-size: 1.08em;
  line-height: 1;
  white-space: nowrap;
  vertical-align: -.12em;
}

.step-notes {
  display: grid;
  gap: 14px;
  margin: 20px 0 24px;
  padding-left: 18px;
  border-left: 3px solid var(--accent);
}

.step-constraints {
  display: grid;
  min-width: 0;
  gap: 11px;
  margin: 20px 0 24px;
  padding-left: 16px;
  border-left: 3px solid var(--error);
}

.step-constraints h4 {
  margin: 0;
  color: var(--error);
  font-size: 12px;
  font-weight: 800;
}

.step-constraint {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(120px, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.step-constraint p { margin: 0; }

.step-constraint-math {
  width: max-content;
  min-width: 100%;
  min-height: 34px;
  border: 0;
  background: transparent;
  padding: 2px 0;
  font-size: 19px;
}

.step-note {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 3px 0;
}

.step-note.is-wide {
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.step-note-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .025em;
}

.step-note-math {
  width: max-content;
  min-width: 100%;
  min-height: 35px;
  border: 0;
  background: transparent;
  padding: 2px 0;
  font-size: 19px;
}

.derivative-table {
  width: 100%;
  min-width: 360px;
  border-collapse: collapse;
  color: var(--ink);
}

.derivative-table caption {
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.derivative-table th,
.derivative-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.derivative-table thead th {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .035em;
}

.derivative-table tbody th {
  width: 88px;
  color: var(--muted);
  font-size: 12px;
}

.step-transformation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 17px 0;
}

.step-math {
  min-height: 58px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  padding: 12px 4px;
  font-size: 21px;
}

.step-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--accent);
}

.step-arrow-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.step-math-after { border-bottom: 2px solid var(--accent); background: linear-gradient(to top, var(--accent-wash), transparent 65%); }

.step-verification { margin-top: 13px; color: var(--muted); font-size: 12px; }
.step-verification summary { width: fit-content; cursor: pointer; font-weight: 600; }
.step-verification summary:hover { color: var(--accent); }
.step-verification p { margin: 9px 0 0; font-size: 12px; }

.ascii-panel { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 20px; }
.ascii-panel summary { width: fit-content; color: var(--muted); font-size: 12px; cursor: pointer; }
pre { overflow-x: auto; color: var(--muted); font: 12px/1.65 var(--mono); white-space: pre-wrap; }

.error-box {
  margin-top: 26px;
  border-left: 4px solid var(--error);
  background: var(--error-wash);
  color: var(--error);
  padding: 15px 18px;
  font-size: 14px;
}

.hidden { display: none; }

@media (max-width: 980px) {
  .math-toolbar { grid-template-columns: 1fr 1fr; }
  .tool-group:first-child { padding-left: 18px; }
  .tool-group-calculus { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0 !important; }
  .tool-group-calculus { padding-right: 18px; }
  .step-transformation { grid-template-columns: minmax(0, 1fr); }
  .step-arrow { transform: rotate(90deg); }
}

@media (max-width: 680px) {
  .site-header {
    width: auto;
    max-width: none;
    overflow-x: hidden;
    margin-right: 12px;
    margin-left: 12px;
  }
  .workspace {
    --mobile-inset-left: max(12px, env(safe-area-inset-left, 0px));
    --mobile-inset-right: max(12px, env(safe-area-inset-right, 0px));
    width: auto;
    max-width: none;
    overflow-x: hidden;
    margin-right: 0;
    margin-left: 0;
  }
  .site-header { align-items: flex-start; gap: 10px; padding-top: 19px; }
  .header-copy { align-items: flex-start; flex-direction: column; gap: 2px; }
  .site-header p { font-size: 12px; }
  .github-star { min-height: 34px; padding: 6px 8px; }
  .theme-toggle { width: 34px; min-width: 34px; height: 34px; }
  .problem-heading {
    padding: 36px var(--mobile-inset-right) 19px var(--mobile-inset-left);
  }
  .problem-heading p { font-size: 14px; }
  .field-heading,
  .math-input-shell,
  .problem-actions,
  .solution-heading {
    padding-right: var(--mobile-inset-right);
    padding-left: var(--mobile-inset-left);
  }
  .primary-math-field {
    min-height: 92px;
    padding: 17px 2px 21px;
    font-size: clamp(27px, 9vw, 38px);
  }
  .math-toolbar { display: block; }
  .tool-group,
  .tool-group:first-child,
  .tool-group:last-child {
    padding: 15px var(--mobile-inset-right) 17px var(--mobile-inset-left);
  }
  .tool-group + .tool-group { border-top: 1px solid var(--line); border-left: 0; }
  .tool-row,
  .tool-group-calculus .tool-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
    padding: 0 2px 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .symbol-key { flex: 0 0 47px; min-width: 47px; min-height: 47px; }
  .symbol-key-wide { flex-basis: 92px; width: 92px; min-height: 57px; }
  .symbol-key-system { flex-basis: 88px; }
  .problem-actions { align-items: stretch; flex-direction: column; }
  .solve-action { width: 100%; align-items: stretch; }
  .solve-button { width: 100%; }
  .solution-panel { margin-top: 48px; padding-top: 32px; }
  .answer-block {
    padding: 27px var(--mobile-inset-right) 30px var(--mobile-inset-left);
  }
  .result-math { min-height: 45px; font-size: clamp(25px, 8vw, 34px); }
  .working-block {
    padding: 30px var(--mobile-inset-right) 0 var(--mobile-inset-left);
  }
  .error-box {
    margin-right: var(--mobile-inset-right);
    margin-left: var(--mobile-inset-left);
  }
  .solver-progress {
    margin-right: var(--mobile-inset-right);
    margin-left: var(--mobile-inset-left);
  }
  .step { grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 25px 0; }
  .step-number { font-size: 15px; }
  .step h3 { font-size: 16px; }
  .step p { font-size: 13px; line-height: 1.55; }
  .step-notes { overflow-x: auto; margin-block: 17px 20px; padding-left: 12px; }
  .step-note { grid-template-columns: 1fr; gap: 6px; }
  .step-constraint { grid-template-columns: 1fr; gap: 3px; }
  .step-math { min-height: 50px; padding: 10px 2px; font-size: 18px; }
  .step-verification summary { padding-block: 5px; }
}

@media (max-width: 430px) {
  .site-header {
    margin-right: 10px;
    margin-left: 10px;
  }
  .workspace {
    --mobile-inset-left: max(10px, env(safe-area-inset-left, 0px));
    --mobile-inset-right: max(10px, env(safe-area-inset-right, 0px));
    margin-right: 0;
    margin-left: 0;
  }
  .examples { gap: 7px 12px; }
  .github-star span { display: none; }
  .solution-heading h2 { font-size: 30px; }
}

@media (hover: none) and (pointer: coarse) {
  .primary-math-field { pointer-events: none; }

  .math-viewport { touch-action: pan-y pinch-zoom; }

  .math-keyboard-button { display: inline-flex; }

  .mobile-keyboard-proxy {
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    font-size: 16px;
    pointer-events: auto;
    touch-action: manipulation;
  }
}
