.hiq-app,
.hiq-app * {
  box-sizing: border-box;
}

.hiq-app {
  --hiq-pink: #ff6fa9;
  --hiq-pink-dark: #db3f7c;
  --hiq-pink-light: #fff0f6;
  --hiq-ink: #2f2a35;
  --hiq-muted: #716a78;
  --hiq-line: #eadde4;
  --hiq-good: #168457;
  --hiq-bad: #c83f4d;
  width: 100%;
  max-width: 760px;
  margin: 24px auto;
  color: var(--hiq-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  line-height: 1.6;
}

.hiq-shell {
  overflow: hidden;
  border: 1px solid var(--hiq-line);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 16px 45px rgba(73, 37, 56, 0.12);
}

.hiq-header {
  position: relative;
  padding: 22px 24px 18px;
  background: linear-gradient(135deg, #fff7fb, #fff 58%, #fff0f6);
  border-bottom: 1px solid var(--hiq-line);
}

.hiq-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hiq-mascot,
.hiq-mascot-fallback {
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  border-radius: 22px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #f1d9e4;
  padding: 5px;
}

.hiq-mascot-fallback {
  display: grid;
  place-items: center;
  font-size: 34px;
  background: var(--hiq-pink-light);
}

.hiq-title {
  margin: 0;
  font-size: clamp(21px, 4vw, 30px);
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.hiq-subtitle {
  margin: 5px 0 0;
  color: var(--hiq-muted);
  font-size: 14px;
}

.hiq-main {
  padding: clamp(18px, 4vw, 30px);
}

.hiq-section-title {
  margin: 0 0 10px;
  font-size: 16px;
}

.hiq-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.hiq-choice,
.hiq-primary,
.hiq-secondary,
.hiq-key,
.hiq-link-button {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.hiq-choice {
  min-height: 68px;
  padding: 11px 13px;
  text-align: left;
  color: var(--hiq-ink);
  border: 2px solid var(--hiq-line);
  border-radius: 16px;
  background: #fff;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.hiq-choice:hover,
.hiq-choice:focus-visible {
  border-color: #f2a6c5;
  transform: translateY(-1px);
  outline: none;
}

.hiq-choice.is-selected {
  border-color: var(--hiq-pink);
  background: var(--hiq-pink-light);
  box-shadow: 0 0 0 3px rgba(255,111,169,.12);
}

.hiq-choice strong,
.hiq-choice small {
  display: block;
}

.hiq-choice strong {
  font-size: 15px;
}

.hiq-choice small {
  margin-top: 2px;
  color: var(--hiq-muted);
  font-size: 12px;
  line-height: 1.45;
}

.hiq-primary,
.hiq-secondary {
  width: 100%;
  min-height: 52px;
  border-radius: 15px;
  font-weight: 700;
}

.hiq-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--hiq-pink), var(--hiq-pink-dark));
  box-shadow: 0 8px 18px rgba(219,63,124,.25);
}

.hiq-primary:hover,
.hiq-primary:focus-visible {
  filter: brightness(.98);
  outline: 3px solid rgba(255,111,169,.22);
}

.hiq-secondary {
  color: var(--hiq-pink-dark);
  background: #fff;
  border: 2px solid #efb8ce;
}

.hiq-topbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.hiq-progress {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2e9ee;
}

.hiq-progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9bc2, var(--hiq-pink-dark));
  transition: width .25s ease;
}

.hiq-counter,
.hiq-timer {
  color: var(--hiq-muted);
  font-size: 13px;
  white-space: nowrap;
}

.hiq-question-card {
  padding: 22px 16px;
  text-align: center;
  border: 1px solid var(--hiq-line);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #fff9fc);
}

.hiq-level-label {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--hiq-pink-dark);
  background: var(--hiq-pink-light);
  font-size: 12px;
  font-weight: 700;
}

.hiq-expression {
  margin: 8px 0 18px;
  font-size: clamp(35px, 9vw, 56px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.hiq-answer-wrap {
  max-width: 330px;
  margin: 0 auto 12px;
}

.hiq-answer {
  width: 100%;
  height: 62px;
  padding: 4px 15px;
  color: var(--hiq-ink);
  text-align: center;
  border: 2px solid #e8cad7;
  border-radius: 16px;
  background: #fff;
  font: 800 30px/1.2 inherit;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.hiq-answer:focus {
  border-color: var(--hiq-pink);
  box-shadow: 0 0 0 4px rgba(255,111,169,.14);
}

.hiq-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 330px;
  margin: 0 auto;
}

.hiq-key {
  min-height: 50px;
  color: var(--hiq-ink);
  border-radius: 13px;
  background: #f7f3f5;
  font-size: 19px;
  font-weight: 700;
}

.hiq-key:hover,
.hiq-key:focus-visible {
  background: #eee6ea;
  outline: none;
}

.hiq-key--accent {
  color: #fff;
  background: var(--hiq-pink-dark);
}

.hiq-key--accent:hover,
.hiq-key--accent:focus-visible {
  background: #c7346e;
}

.hiq-feedback {
  min-height: 80px;
  margin-top: 15px;
  padding: 13px 15px;
  text-align: left;
  border-radius: 15px;
  background: #f8f5f7;
}

.hiq-feedback.is-correct {
  color: #0f6945;
  background: #ecfaf4;
}

.hiq-feedback.is-wrong {
  color: #9e2632;
  background: #fff0f1;
}

.hiq-feedback strong {
  display: block;
  margin-bottom: 3px;
}

.hiq-number-line {
  position: relative;
  margin: 13px 7px 3px;
  padding-top: 19px;
}

.hiq-number-line-track {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: #d4c7cd;
}

.hiq-number-line-point {
  position: absolute;
  top: -5px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--hiq-pink-dark);
  box-shadow: 0 0 0 1px #d6b5c3;
}

.hiq-number-line-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--hiq-muted);
  font-size: 10px;
}

.hiq-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 17px;
}

.hiq-action-row .hiq-primary,
.hiq-action-row .hiq-secondary {
  min-height: 48px;
}

.hiq-summary {
  text-align: center;
}

.hiq-score-ring {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  margin: 8px auto 18px;
  border-radius: 50%;
  background: conic-gradient(var(--hiq-pink-dark) calc(var(--hiq-rate) * 1%), #f1e8ed 0);
  box-shadow: inset 0 0 0 12px #fff;
}

.hiq-score-ring span {
  display: block;
  font-size: 28px;
  font-weight: 800;
}

.hiq-score-ring small {
  display: block;
  color: var(--hiq-muted);
  font-size: 12px;
  font-weight: 500;
}

.hiq-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 17px 0;
}

.hiq-stat {
  padding: 12px 6px;
  border-radius: 14px;
  background: #f8f4f6;
}

.hiq-stat strong,
.hiq-stat small {
  display: block;
}

.hiq-stat strong {
  font-size: 21px;
}

.hiq-stat small {
  color: var(--hiq-muted);
  font-size: 11px;
}

.hiq-mistakes {
  margin: 16px 0;
  padding: 14px;
  text-align: left;
  border-radius: 16px;
  background: #fff7fa;
  border: 1px solid #f3d8e3;
}

.hiq-mistakes h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.hiq-mistakes ul {
  margin: 0;
  padding-left: 1.25em;
}

.hiq-record-card {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--hiq-line);
  border-radius: 16px;
  background: #fff;
}

.hiq-record-card h3 {
  margin: 0 0 9px;
  font-size: 15px;
}

.hiq-record-list {
  display: grid;
  gap: 7px;
}

.hiq-record-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed var(--hiq-line);
  font-size: 12px;
}

.hiq-record-row:last-child {
  border-bottom: 0;
}

.hiq-empty {
  padding: 14px;
  color: var(--hiq-muted);
  text-align: center;
  border-radius: 14px;
  background: #f8f5f7;
}

.hiq-mini-note {
  margin: 10px 0 0;
  color: var(--hiq-muted);
  font-size: 12px;
  text-align: center;
}

.hiq-link-button {
  padding: 3px 0;
  color: var(--hiq-pink-dark);
  background: transparent;
  text-decoration: underline;
  font-size: 12px;
}

.hiq-toast {
  margin-top: 12px;
  padding: 9px 12px;
  color: #7c5d69;
  text-align: center;
  border-radius: 12px;
  background: #fff5f9;
  font-size: 12px;
}

@media (max-width: 520px) {
  .hiq-app { margin: 12px auto; }
  .hiq-shell { border-radius: 19px; }
  .hiq-header { padding: 17px 16px 14px; }
  .hiq-main { padding: 16px 13px 19px; }
  .hiq-mascot,
  .hiq-mascot-fallback { width: 60px; height: 60px; flex-basis: 60px; border-radius: 18px; }
  .hiq-choice-grid { grid-template-columns: 1fr; gap: 8px; }
  .hiq-choice { min-height: 60px; }
  .hiq-question-card { padding: 18px 10px; }
  .hiq-topbar { grid-template-columns: 1fr auto; }
  .hiq-timer { grid-column: 2; grid-row: 2; }
  .hiq-progress { grid-column: 1 / -1; }
  .hiq-action-row { grid-template-columns: 1fr; }
}
