:root {
  --bg: #fbf7ef;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #ece4d6;
  --brand: #e8703a;      /* cam đất */
  --brand-soft: #fdece2;
  --green: #2f9e6f;      /* bộ thủ */
  --green-soft: #e6f5ee;
  --on: #2563eb;         /* âm ON */
  --on-soft: #eef3fb;
  --kun: #d9457a;        /* âm KUN */
  --kun-soft: #fbeef3;
  --example-soft: #f1f4f2;   /* nền block ví dụ (xám xanh nhạt) */
  --example-ink: #4b7a63;
  --shadow: 0 6px 22px rgba(60, 45, 20, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic",
    "Noto Sans JP", "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ============ TOPBAR ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 247, 239, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.brand-mark { font-size: 22px; }
.brand-name { font-size: 17px; letter-spacing: .2px; }
.grade-tabs { display: flex; gap: 6px; margin-left: auto; }
.grade-tab {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.grade-tab small { font-size: 11px; font-weight: 600; opacity: .8; }
.grade-tab.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: var(--shadow);
}
.progress-pill {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  min-width: 64px;
  text-align: center;
}

/* ============ STAGE ============ */
.stage {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px 40px;
}

/* ============ BĂNG HỌC: dải trái · ‹ · chữ Kanji + nghĩa · › · dải phải ==== */
.learnbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 2px 0 8px;
}
.strip {
  flex: 1 1 0;
  min-width: 0;
  max-width: 276px;          /* ~6 chữ mỗi bên */
  display: flex;
  gap: 6px;
  overflow: hidden;
  padding: 3px 0;
}
.strip-left {
  justify-content: flex-end;
  margin-right: 22px;        /* dải cách nút xa hơn */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 56px);
  mask-image: linear-gradient(to right, transparent, #000 56px);
}
.strip-right {
  justify-content: flex-start;
  margin-left: 22px;
  -webkit-mask-image: linear-gradient(to left, transparent, #000 56px);
  mask-image: linear-gradient(to left, transparent, #000 56px);
}
.pick-cell {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .12s;
}
.pick-cell:hover { border-color: var(--brand); transform: translateY(-1px); }

/* Khối giữa: độ rộng CỐ ĐỊNH (đủ cho nghĩa dài nhất) → nút ‹ › không nhảy */
.current {
  flex: 0 0 auto;
  width: 268px;             /* CỐ ĐỊNH (đủ cho nghĩa dài, wrap) → nút không nhảy */
  height: 98px;
  margin: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.cur-kanji {
  flex: 0 0 auto;
  font-size: 82px;
  line-height: 1;
  font-weight: 500;
  color: var(--ink);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}
.cur-meta { width: 154px; text-align: left; line-height: 1.25; }
.hanviet {
  font-size: 21px;
  font-weight: 800;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.meaning { display: block; font-size: 15px; color: var(--muted); margin-top: 3px; }
.nav-arrow {
  flex: 0 0 auto;
  width: 46px;
  height: 70px;              /* khung nền HÌNH CHỮ NHẬT (đứng) */
  border-radius: 15px;
  border: 1px solid transparent;
  background: rgba(160, 150, 130, .12);   /* mờ mờ khi bình thường */
  color: var(--brand);
  cursor: pointer;
  box-shadow: none;
  opacity: .5;
  transition: .18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.nav-arrow svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-arrow:hover {                          /* rê chuột vào → rõ lên */
  opacity: 1;
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: var(--shadow);
}
.nav-arrow:disabled { opacity: .18; cursor: default; }
.nav-arrow:disabled:hover { background: rgba(160, 150, 130, .12); color: var(--brand); box-shadow: none; }

/* SPLIT 2 cột */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.panel {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 9px;              /* viền ảnh↔mép block hẹp lại (trước 14px) */
  display: flex;
  flex-direction: column;
}
.panel-head {
  font-weight: 800;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stroke-count { color: var(--brand); font-weight: 800; }
.illust-box, .stroke-box {
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border-radius: 12px;
  aspect-ratio: 1 / 1;       /* ô ảnh HÌNH VUÔNG */
  /* CO THEO MÀN HÌNH: ô vuông không vượt quá chiều cao còn trống của khung nhìn.
     Màn THẤP → ô tự nhỏ lại (không phải cuộn); màn cao → tối đa 452px. */
  max-width: clamp(150px, calc(100vh - 300px), 452px);
  max-height: 452px;
  overflow: hidden;
}
.illust-box { position: relative; }
.illust-box img { width: 100%; height: 100%; object-fit: cover; }

/* Vẽ tự do lên ảnh (bút đỏ) — đổi chữ tự xoá, KHÔNG lưu */
.draw-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  touch-action: none;         /* chặn cuộn khi vẽ bằng ngón tay */
  cursor: crosshair;
}
.draw-canvas[hidden] { display: none; }
.draw-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e0322f;             /* bút ĐỎ */
  transition: .12s;
  padding: 0;
}
.draw-toggle .ic { width: 20px; height: 20px; display: block; }
.draw-toggle:hover { border-color: #e0322f; }
.draw-toggle[aria-pressed="true"] {
  background: #e0322f;
  border-color: #e0322f;
  color: #fff;
}
.draw-clear {
  position: absolute;
  top: 58px;                  /* ngay dưới nút bút */
  right: 10px;
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: .12s;
  padding: 0;
}
.draw-clear[hidden] { display: none; }
.draw-clear .ic { width: 20px; height: 20px; display: block; }
.draw-clear:hover { border-color: #e0322f; color: #e0322f; }
.illust-fallback {
  display: none;
  font-size: clamp(90px, 20vw, 200px);
  font-weight: 500;
  color: #c9beA6;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
}
.illust-box.is-empty .illust-fallback { display: block; }
.illust-desc {
  margin: 12px 2px 0;
  font-size: 16.5px;
  line-height: 1.6;
  letter-spacing: .4px;       /* giãn chữ cho đỡ co cụm */
  word-spacing: 2px;
  color: var(--muted);
  text-align: center;         /* căn giữa 2 dòng */
  min-height: 3em;            /* luôn chừa chỗ 2 dòng như app */
}
.illust-desc:empty { display: none; }
.desc-line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;    /* dòng quá dài thì … */
}

.stroke-box { position: relative; }
.fx-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.stroke-target { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.stroke-target svg { max-width: 100%; max-height: 100%; }
.stroke-controls { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ctrl-btn {
  flex: 1;
  min-width: 90px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: .12s;
}
.ctrl-btn:hover { border-color: var(--brand); }
.ctrl-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.ctrl-btn[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }

/* ====== DETAIL: ON/KUN + Ví dụ (1 block) | Từ vựng ====== */
.detail {
  display: grid;
  grid-template-columns: 1fr 1.08fr;   /* hộp từ vựng rộng hơn chút */
  gap: 20px;
  margin-bottom: 18px;
  align-items: stretch;                /* 2 block cao bằng nhau */
}
.info-card, .vocab-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.info-card { display: flex; flex-direction: column; gap: 12px; }

.reading-row { border-radius: 14px; padding: 12px 20px; }
.reading-on  { background: var(--on-soft); }
.reading-kun { background: var(--kun-soft); }
.reading-head { font-size: 14px; font-weight: 800; }
.reading-head small { font-weight: 600; opacity: .75; }
.reading-on .reading-head  { color: var(--on); }
.reading-kun .reading-head { color: var(--kun); }

.reading-line { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.reading-value {
  flex: 1;
  min-width: 0;
  font-size: clamp(22px, 3.2vw, 28px);
  font-weight: 500;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  letter-spacing: 1px;
}

.example-block {
  flex: 1;                        /* lấp khoảng trống, cân đối block */
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--example-soft);
  border-radius: 14px;
  padding: 14px 20px;
}
.example-block .card-title { color: var(--example-ink); margin-bottom: 8px; }
.example-block .reading-line { margin-top: 4px; align-items: flex-start; }
.example-ja {
  flex: 1;
  min-width: 0;
  font-size: 25px;
  font-weight: 400;
  line-height: 2.5;               /* giãn furigana khỏi dòng kanji */
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}
.example-ja rt {
  font-size: .5em;
  color: var(--muted);           /* furigana XÁM, không đỏ */
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0;
}
.example-vi { font-size: 15px; color: var(--muted); margin-top: 10px; }

/* Nút loa + mic — icon 2D, xếp DỌC, nhỏ */
.sound-tools, .vocab-tools { flex: 0 0 auto; display: flex; flex-direction: column; gap: 5px; }
.vocab-tools { margin-left: 8px; }
.tool-btn {
  position: relative;   /* neo chip chấm điểm mic */
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .12s;
  padding: 0;
}
.tool-btn .ic { width: 15px; height: 15px; fill: currentColor; display: block; }
.tool-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.tool-btn.playing { background: var(--brand); border-color: var(--brand); }
.tool-btn.listening { background: var(--kun-soft); border-color: var(--kun); animation: micpulse 1s infinite; }
.tool-btn.ok  { background: var(--green-soft); border-color: var(--green); }
.tool-btn.bad { background: #fdecec; border-color: #e05656; }
@keyframes micpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.14); } }

.card-title { font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.vocab-card { display: flex; flex-direction: column; }
.vocab-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;                            /* trải đều 5 dòng cho cao bằng block bên cạnh */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.vocab-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px dashed var(--line);
}
.vocab-list li:last-child { border-bottom: 0; }
.vocab-word {
  flex: 0 0 auto;
  font-size: 22px;               /* kanji to hơn */
  font-weight: 500;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}
.vocab-word rt {
  font-size: .4em;
  color: var(--muted);           /* furigana XÁM, ở trên (ruby) */
  font-weight: 400;
}
.vocab-mean { flex: 1; text-align: center; font-size: 14px; color: var(--muted); }

/* RADICAL */
.radical {
  background: var(--green-soft);
  border: 1px solid #cdeadd;
  border-radius: var(--radius);
  padding: 18px;
}
.radical-head { font-weight: 800; font-size: 16px; color: var(--green); margin-bottom: 14px; }

/* Trái (nửa màn hình): chữ đang học + mô tả · Phải (nửa còn lại): 3 bộ thành phần */
.rad-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.rad-current {
  border-radius: 14px;
  border: 1px solid #cdeadd;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 16px;
}
.rad-current .rc-kanji {
  font-size: clamp(110px, 15vw, 180px);
  line-height: 1;
  color: var(--ink);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}
.rad-current .rc-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.rc-desc {
  text-align: center;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 92%;
}

/* Các bộ thủ thành phần (tối đa 3 thẻ, XẾP CHỒNG DỌC, ảnh vuông) */
.rad-comp-list {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;   /* ít bộ → xếp từ TRÊN xuống, không căn giữa */
  gap: 12px;                     /* cao tự nhiên theo số thẻ (không ép 3 thẻ → 1 bộ khỏi dư trống) */
}
.rad-comp { flex: 0 0 auto; }
.rad-comp {
  min-width: 168px;
  min-height: 124px;         /* mỗi thẻ cao cố định */
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #cdeadd;
  border-radius: 14px;
  padding: 10px;
}
.rad-comp-img {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;             /* ảnh bộ HÌNH VUÔNG */
  border-radius: 12px;
  overflow: hidden;
  background: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rad-comp-img img { width: 100%; height: 100%; object-fit: cover; }
.rad-comp-img.is-char {
  font-size: 60px;
  color: var(--green);
  background: #eef6f1;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
}
.rad-comp-info { min-width: 0; align-self: center; }
.rad-comp-name { font-size: 19px; font-weight: 700; color: var(--ink); }
.rad-comp-read { font-size: 13px; color: var(--green); font-weight: 600; margin-top: 4px; }
.rad-comp-mean { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

/* LOADING */
.loading {
  max-width: 1200px;
  margin: 40px auto;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* ====== DESKTOP: giãn các khối ra + kẻ mảnh NGẮN ở giữa (đỡ dính nhau) ====== */
@media (min-width: 761px) {
  .split   { margin-bottom: 0; }
  .detail  { margin-top: 76px; margin-bottom: 0; position: relative; }
  .radical { margin-top: 76px; position: relative; }
  /* đường kẻ ngắn, mảnh, canh giữa khoảng trống giữa 2 khối */
  .detail::before,
  .radical::before {
    content: "";
    position: absolute;
    top: -39px;
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 2px;
    border-radius: 2px;
    background: var(--line);
  }
}

/* Màn THẤP (máy học sinh chiều cao ngắn): thu khoảng cách DỌC để ảnh/chữ + chữ đọc
   nằm gọn trong 1 màn, ô ảnh đã tự co theo 100vh (clamp ở trên). */
@media (max-height: 760px) {
  .panel { padding: 7px; }
  .panel-head { margin-bottom: 6px; font-size: 14px; }
  /* GIỮ 2 cột BẰNG NHAU (ô ảnh & ô chữ luôn VUÔNG, cùng cỡ). Chỉ thu cả cụm về GIỮA,
     giới hạn bề rộng ~ 2 ô để khỏi hở 2 bên khi màn rộng-mà-thấp. */
  .split {
    gap: 14px; margin-bottom: 12px;
    max-width: calc(clamp(150px, 100vh - 300px, 452px) * 2 + 80px);
    margin-left: auto; margin-right: auto;
  }
}
@media (min-width: 761px) and (max-height: 760px) {
  .detail  { margin-top: 40px; }
  .radical { margin-top: 40px; }
  .detail::before, .radical::before { top: -21px; }
}
@media (max-height: 620px) {
  .panel { padding: 5px; }
  .illust-box, .stroke-box { border-radius: 10px; }
  .illust-desc { margin-top: 6px; }
}

/* ============ RESPONSIVE (mobile = tự học) ============ */
@media (max-width: 760px) {
  .brand-name { display: none; }
  .split, .detail { grid-template-columns: 1fr; }
  .panel { padding: 8px; }
  .strip { max-width: 92px; }        /* ~2 chữ mỗi bên trên mobile */
  .strip-left { margin-right: 10px; }
  .strip-right { margin-left: 10px; }
  .current { width: auto; height: 96px; gap: 10px; margin: 0 4px; }
  .cur-meta { width: 124px; }
  .cur-kanji { font-size: 64px; }
  .nav-arrow { width: 42px; height: 66px; border-radius: 13px; }
  .nav-arrow svg { width: 26px; height: 26px; }
  .rad-layout { flex-direction: column; align-items: stretch; }
  .rad-current { width: 100%; flex-direction: row; gap: 14px; }
  .rad-current .rc-kanji { font-size: 56px; }
  .rad-eq { display: none; }
  .rad-comp { flex: 1 1 100%; }
  .stage { padding: 8px 12px 48px; }
}

/* ============ NÚT NGÔN NGỮ (giống tg2, header sáng) ============ */
.lang-wrap { position: relative; margin-left: 8px; }
.lang-btn {
  appearance: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 12px;
  font-weight: 700; cursor: pointer; transition: background .15s, transform .15s;
}
.lang-btn:hover { background: var(--brand-soft); }
.lang-btn:active { transform: scale(.96); }
.lang-btn .lang-flag { font-size: 16px; line-height: 1; }
.lang-btn .lang-code { font-size: 11px; letter-spacing: .3px; }
.lang-btn .lang-caret { font-size: 9px; opacity: .6; transition: transform .15s; }
.lang-btn[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: max-content;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 4px; z-index: 40;
  display: flex; flex-direction: column;
}
.lang-menu[hidden] { display: none; }
.lang-option {
  appearance: none; border: 0; background: transparent; display: flex;
  align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px;
  cursor: pointer; color: var(--ink); font: inherit; font-size: 13px;
  text-align: left; width: 100%; white-space: nowrap;
}
.lang-option:hover { background: var(--brand-soft); }
.lang-option.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.lang-option .lang-flag { font-size: 16px; line-height: 1; }

/* ============ FOOTER ============ */
.site-footer {
  margin-top: 32px; border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(232,112,58,.05));
}
.footer-inner {
  max-width: 1080px; margin: 0 auto; padding: 28px 20px 36px;
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.footer-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer-logo { width: 56px; height: 56px; object-fit: contain; }
.footer-tagline { margin: 0; color: var(--muted); font-size: 13px; max-width: 420px; }
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px;
}
.footer-links a {
  color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 600;
  padding: 4px 2px; border-bottom: 1.5px solid transparent; transition: color .15s, border-color .15s;
}
.footer-links a:hover { color: var(--brand); border-bottom-color: var(--brand); }
.footer-copy { color: var(--muted); font-size: 12px; }

/* ============ CHẤM ĐIỂM MIC (chip nổi + màu nút theo mức) ============ */
.tool-btn.mic-good { color: var(--green); background: var(--green-soft); }
.tool-btn.mic-ok   { color: #2563eb; background: var(--on-soft); }
.tool-btn.mic-warn { color: #d98a2a; background: #fdf1e2; }
.tool-btn.mic-bad  { color: #d9457a; background: var(--kun-soft); }
.mic-score {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; color: #fff; box-shadow: var(--shadow);
  z-index: 50; pointer-events: none; animation: micPop .22s ease-out;
}
.mic-score::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: inherit;
}
.mic-score.lv-good { background: var(--green); }
.mic-score.lv-ok   { background: #2563eb; }
.mic-score.lv-warn { background: #d98a2a; }
.mic-score.lv-bad  { background: #d9457a; }
@keyframes micPop { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
