.typed-problem-unit {
  width: min(760px, 100%);
  margin: 0 auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.typed-problem-head {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  margin-bottom: .75rem;
}

.typed-problem-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: .95rem;
  color: var(--text);
}

.typed-problem-scope,
.typed-problem-help {
  color: var(--text-dim);
  font-size: .78rem;
}

.typed-problem-input-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .6rem;
}

.typed-problem-input {
  width: 100%;
  min-height: 74px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  padding: .45rem 0;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  outline: none;
}

.typed-problem-input:empty::before {
  content: attr(data-placeholder);
  color: rgba(201, 209, 217, .52);
  pointer-events: none;
}

.typed-problem-input:focus {
  box-shadow: none;
}

.math-token {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 .1rem;
}

.math-editable {
  display: inline-block;
  min-width: .9ch;
  min-height: 1.05em;
  outline: none;
  white-space: nowrap;
}

.math-editable:empty::before {
  content: '\00A0';
}

.frac-token .frac-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 1.8ch;
}

.frac-token .frac-line {
  width: 100%;
  border-top: 1px solid rgba(201, 209, 217, .85);
  margin: .08rem 0;
}

.frac-token .frac-num,
.frac-token .frac-den {
  text-align: center;
  padding: 0 .14rem;
}

.pow-token {
  vertical-align: super;
  margin-left: .03rem;
}

.pow-token .pow-exp {
  font-size: .78rem;
}

.sqrt-token {
  align-items: flex-start;
}

.sqrt-token .sqrt-symbol {
  font-size: 1.12rem;
  line-height: 1;
  margin-right: .03rem;
}

.sqrt-token .sqrt-radicand {
  border-top: 1px solid rgba(201, 209, 217, .85);
  padding: .02rem .2rem 0;
  min-width: 1.2ch;
}

.typed-problem-solve {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 1rem;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease;
  flex-shrink: 0;
}

.typed-problem-solve:hover {
  transform: scale(1.07);
  background: rgba(88,166,255,.22);
}

.typed-problem-solve:active {
  transform: scale(.93);
}

.typed-problem-symbols {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .7rem;
}

.typed-problem-symbol-btn {
  min-width: 40px;
  padding: .5rem .62rem;
}

.typed-problem-symbol-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.typed-problem-solution {
  display: none;
}

.typed-problem-solution.open {
  display: block;
}

.typed-problem-result {
  margin-bottom: .75rem;
  padding: .36rem .56rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--text-dim);
  background: var(--surface2);
}

.typed-problem-result.pass {
  color: var(--green);
  border-color: rgba(63,185,80,.45);
  background: var(--green-glow);
}

.typed-problem-result.fail {
  color: var(--red);
  border-color: rgba(248,81,73,.45);
  background: rgba(248,81,73,.14);
}

.typed-problem-result.info {
  color: var(--orange);
  border-color: rgba(210,153,34,.45);
  background: var(--orange-glow);
}

.typed-problem-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  color: var(--text);
  font-size: .84rem;
}

.typed-problem-step {
  margin: 0;
}

.typed-problem-step-text {
  font-family: 'KaTeX_Main', 'Times New Roman', serif;
}

@media (max-width: 768px) {
  .typed-problem-unit {
    width: 100%;
    padding: .85rem;
  }

  .typed-problem-input-wrap {
    align-items: flex-start;
  }
}





