/* ============================================================
   Math Practice — tool-specific styles
   ============================================================ */

.panel-title { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin: 0 0 0.8rem; }

.math-layout {
  display: grid; grid-template-columns: 340px 1fr; gap: 1rem; margin-top: 1rem;
}

/* ---- Controls ---- */
.difficulty-note { font-size: 0.8rem; color: var(--muted); margin: 0.5rem 0.2rem 0; min-height: 1.2em; }

.segmented {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.35rem;
  background: var(--brand-softer); border: 1px solid #d3ece5;
  padding: 0.35rem; border-radius: 999px;
}
.seg-btn {
  font: inherit; font-weight: 800; font-size: 0.9rem; cursor: pointer;
  border: none; background: transparent; color: var(--muted);
  border-radius: 999px; padding: 0.55rem 0.4rem; transition: all 0.15s ease;
}
.seg-btn[aria-pressed="true"] { background: var(--brand); color: #fff; box-shadow: 0 3px 8px rgba(15,118,110,0.3); }

.op-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.op-btn {
  font: inherit; cursor: pointer; display: flex; align-items: center; gap: 0.55rem;
  border: 1.5px solid var(--line); background: #fff; border-radius: var(--r-md);
  padding: 0.55rem 0.7rem; font-size: 0.82rem; font-weight: 700; color: var(--muted);
  transition: all 0.15s ease; text-align: left;
}
.op-btn .op-sym {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: var(--r-sm);
  background: #e0f2fe; color: #075985; display: grid; place-items: center; font-size: 1.15rem; font-weight: 800;
}
.op-btn[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.op-btn[aria-pressed="false"] { opacity: 0.55; }

.reset-btn { margin-top: 1.2rem; }

/* ---- Practice stage ---- */
.practice-panel { display: flex; flex-direction: column; }

.score-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.2rem; }

.question-stage {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.2rem; padding: 1rem 0.5rem;
  background: repeating-linear-gradient(-45deg, #fbfaf3, #fbfaf3 18px, #f6f4e8 18px, #f6f4e8 36px);
  border: 1.5px dashed var(--line); border-radius: var(--r-lg);
}
.question-text {
  margin: 0; font-size: clamp(2.6rem, 9vw, 4rem); font-weight: 850; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; color: var(--ink); text-align: center;
}
.answer-input {
  width: min(220px, 70vw); text-align: center; font: inherit;
  font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums;
  padding: 0.6rem 0.8rem; border-radius: var(--r-md);
  border: 2.5px solid var(--line); background: #fff; color: var(--ink);
}
.answer-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(15,118,110,0.18); }
.answer-input::-webkit-outer-spin-button,
.answer-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.answer-input { -moz-appearance: textfield; }

.feedback { margin: 1rem 0 0; }

.action-row { display: flex; gap: 0.7rem; margin-top: 1rem; flex-wrap: wrap; }
.action-row .btn { flex: 1; min-width: 160px; }

@media (max-width: 900px) {
  .math-layout { grid-template-columns: 1fr; }
}
