/* Trang "Học ngoại ngữ giao tiếp" — 4 bộ hội thoại IT support (Anh/Trung/Nhật/Hàn),
   CSS được gộp lại từ 4 trang hội thoại gốc, dùng chung 1 layout + biến font riêng từng ngôn ngữ. */
:root {
  --hnn-bg: #f7f5ee;
  --hnn-surface: #ffffff;
  --hnn-surface-2: #f0ede3;
  --hnn-ink: #1e211f;
  --hnn-muted: #6f756e;
  --hnn-line: #e4e0d2;
  --hnn-accent: #2f6f66;
  --hnn-accent-ink: #f3faf8;
  --hnn-accent-soft: #e3f0ec;
  --hnn-user-tag: #3a5a8c;
  --hnn-user-soft: #e7edf6;
  --hnn-it-tag: #a6512f;
  --hnn-it-soft: #f5e9e0;
  --hnn-shadow: 0 1px 2px rgba(30, 33, 31, .06), 0 8px 24px -12px rgba(30, 33, 31, .18);
  --hnn-font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --hnn-font-ui: "Inter", -apple-system, "Segoe UI", sans-serif;
  --hnn-font-en: -apple-system, "Segoe UI", Roboto, sans-serif;
  --hnn-font-zh: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Heiti SC", sans-serif;
  --hnn-font-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  --hnn-font-ko: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-hnn-theme="light"]) {
    --hnn-bg: #12151a;
    --hnn-surface: #1b1f26;
    --hnn-surface-2: #20252d;
    --hnn-ink: #ece9df;
    --hnn-muted: #9aa19a;
    --hnn-line: #2b313a;
    --hnn-accent: #63b3a7;
    --hnn-accent-ink: #0d1613;
    --hnn-accent-soft: #1c2d29;
    --hnn-user-tag: #8fb3e6;
    --hnn-user-soft: #1c2836;
    --hnn-it-tag: #e0a377;
    --hnn-it-soft: #332420;
    --hnn-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -14px rgba(0, 0, 0, .6);
  }
}
:root[data-hnn-theme="dark"] {
  --hnn-bg: #12151a;
  --hnn-surface: #1b1f26;
  --hnn-surface-2: #20252d;
  --hnn-ink: #ece9df;
  --hnn-muted: #9aa19a;
  --hnn-line: #2b313a;
  --hnn-accent: #63b3a7;
  --hnn-accent-ink: #0d1613;
  --hnn-accent-soft: #1c2d29;
  --hnn-user-tag: #8fb3e6;
  --hnn-user-soft: #1c2836;
  --hnn-it-tag: #e0a377;
  --hnn-it-soft: #332420;
  --hnn-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 28px -14px rgba(0, 0, 0, .6);
}

.hnn-wrap {
  max-width: 760px;
  margin: 0 auto;
  background: var(--hnn-bg);
  color: var(--hnn-ink);
  font-family: var(--hnn-font-ui);
  padding: 16px 16px 32px;
  border-radius: 12px;
}
.hnn-wrap a { color: var(--hnn-accent); }

/* ---- language tabs ---- */
.hnn-langtabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 14px;
}
.hnn-langtabs::-webkit-scrollbar { display: none; }
.hnn-langtab {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 700;
  font-size: .86rem;
  border: 1px solid var(--hnn-line);
  background: var(--hnn-surface);
  color: var(--hnn-muted);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.hnn-langtab:hover { border-color: var(--hnn-accent); color: var(--hnn-ink); }
.hnn-langtab.active { background: var(--hnn-accent); color: var(--hnn-accent-ink); border-color: var(--hnn-accent); }
.hnn-langtab .flag { font-size: 1.1rem; }

/* ---- header ---- */
.hnn-top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--hnn-bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  padding-block: 4px 10px;
  border-bottom: 1px solid var(--hnn-line);
  margin-bottom: 18px;
}
.hnn-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hnn-wrap h2#hnnTitle {
  font-family: var(--hnn-font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 4.2vw, 1.55rem);
  margin: 0;
  letter-spacing: -0.01em;
}
.hnn-subtitle { color: var(--hnn-muted); font-size: .82rem; margin-top: 2px; }
.hnn-stat-pill {
  font-variant-numeric: tabular-nums;
  font-size: .72rem;
  color: var(--hnn-muted);
  border: 1px solid var(--hnn-line);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.hnn-controls { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.hnn-search {
  flex: 1 1 180px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--hnn-surface);
  border: 1px solid var(--hnn-line);
  border-radius: 10px;
  padding: 8px 10px;
}
.hnn-search input {
  border: none; background: transparent; outline: none; color: var(--hnn-ink);
  font-family: var(--hnn-font-ui); font-size: .88rem; width: 100%;
}
.hnn-search svg { flex: none; color: var(--hnn-muted); }
.hnn-rate-control {
  display: flex; align-items: center; gap: 6px;
  background: var(--hnn-surface); border: 1px solid var(--hnn-line); border-radius: 10px;
  padding: 6px 10px; font-size: .78rem; color: var(--hnn-muted);
}
.hnn-rate-control input[type=range] { width: 70px; accent-color: var(--hnn-accent); }
.hnn-rate-val { font-variant-numeric: tabular-nums; color: var(--hnn-ink); width: 2.4em; text-align: right; }
.hnn-theme-btn {
  background: var(--hnn-surface); border: 1px solid var(--hnn-line); border-radius: 10px;
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; color: var(--hnn-ink);
  flex: none;
}
.hnn-theme-btn svg { width: 16px; height: 16px; }

.hnn-chips { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; scrollbar-width: none; }
.hnn-chips::-webkit-scrollbar { display: none; }
.hnn-chip {
  flex: none; font-size: .74rem; font-weight: 600;
  border: 1px solid var(--hnn-line); background: var(--hnn-surface); color: var(--hnn-muted);
  border-radius: 999px; padding: 5px 11px; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.hnn-chip:hover { border-color: var(--hnn-accent); color: var(--hnn-ink); }
.hnn-chip.active { background: var(--hnn-accent); color: var(--hnn-accent-ink); border-color: var(--hnn-accent); }

.hnn-voice-note { font-size: .72rem; color: var(--hnn-muted); margin: 2px 2px 0; }
.hnn-voice-note.warn { color: var(--hnn-it-tag); }

.hnn-section-head { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 10px; scroll-margin-top: 150px; }
.hnn-section-head .num { font-family: var(--hnn-font-display); font-weight: 600; font-size: 1.4rem; color: var(--hnn-accent); flex: none; }
.hnn-section-head .txt { font-family: var(--hnn-font-display); font-weight: 600; font-size: 1rem; }
.hnn-section-head .range { color: var(--hnn-muted); font-size: .75rem; font-variant-numeric: tabular-nums; margin-left: auto; }
.hnn-section-play {
  flex: none; border: 1px solid var(--hnn-line); background: var(--hnn-surface); color: var(--hnn-ink);
  border-radius: 8px; padding: 5px 10px; font-size: .72rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
}
.hnn-section-play:hover { border-color: var(--hnn-accent); color: var(--hnn-accent); }

.hnn-exchange { background: var(--hnn-surface); border: 1px solid var(--hnn-line); border-radius: 14px; box-shadow: var(--hnn-shadow); padding: 12px; margin-bottom: 12px; scroll-margin-top: 150px; }
.hnn-exchange.hidden-filtered { display: none; }
.hnn-ex-num { font-variant-numeric: tabular-nums; font-size: .7rem; color: var(--hnn-muted); font-weight: 600; letter-spacing: .02em; margin-bottom: 6px; }
.hnn-turn { display: flex; gap: 10px; padding: 9px 4px; border-radius: 10px; align-items: flex-start; }
.hnn-turn + .hnn-turn { border-top: 1px dashed var(--hnn-line); margin-top: 2px; }
.hnn-turn.playing { background: var(--hnn-accent-soft); }
.hnn-play-btn {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hnn-line);
  background: var(--hnn-surface-2); color: var(--hnn-ink); cursor: pointer; display: grid; place-items: center;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.hnn-play-btn:hover { border-color: var(--hnn-accent); color: var(--hnn-accent); }
.hnn-play-btn:active { transform: scale(.94); }
.hnn-play-btn svg { width: 14px; height: 14px; }
.hnn-play-btn.playing { background: var(--hnn-accent); border-color: var(--hnn-accent); color: var(--hnn-accent-ink); }
.hnn-turn-body { flex: 1; min-width: 0; }
.hnn-speaker-tag { display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 5px; padding: 1px 7px; margin-bottom: 5px; }
.hnn-speaker-tag.User { background: var(--hnn-user-soft); color: var(--hnn-user-tag); }
.hnn-speaker-tag.IT { background: var(--hnn-it-soft); color: var(--hnn-it-tag); }

.hnn-text { font-size: 1.14rem; line-height: 1.55; margin-bottom: 3px; word-break: break-word; }
.hnn-lang-en .hnn-text { font-family: var(--hnn-font-en); font-weight: 600; }
.hnn-lang-zh .hnn-text { font-family: var(--hnn-font-zh); }
.hnn-lang-ja .hnn-text { font-family: var(--hnn-font-ja); }
.hnn-lang-ko .hnn-text { font-family: var(--hnn-font-ko); }
.hnn-phonetic { color: var(--hnn-accent); font-size: .86rem; margin-bottom: 4px; font-style: italic; }
.hnn-lang-en .hnn-phonetic { font-family: "Charis SIL", "Doulos SIL", "Segoe UI", serif; font-style: normal; }
.hnn-vi { color: var(--hnn-muted); font-size: .86rem; line-height: 1.4; }
.hnn-empty-state { text-align: center; color: var(--hnn-muted); padding: 40px 10px; font-size: .9rem; }

.hnn-tips { margin-top: 26px; border-top: 1px solid var(--hnn-line); padding-top: 16px; color: var(--hnn-muted); font-size: .82rem; line-height: 1.6; }
.hnn-tips h2 { font-family: var(--hnn-font-display); font-size: .95rem; color: var(--hnn-ink); margin: 0 0 8px; }

.hnn-back-top {
  position: fixed; right: 16px; bottom: 16px; width: 42px; height: 42px; border-radius: 50%;
  background: var(--hnn-accent); color: var(--hnn-accent-ink); border: none; display: grid; place-items: center;
  box-shadow: var(--hnn-shadow); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30;
}
.hnn-back-top.show { opacity: 1; pointer-events: auto; }
.hnn-back-top svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  .hnn-wrap * { transition: none !important; }
}
