/* =========================================================================
 * Chặng (#/sections, #/section/<mã>), sổ tay bài (#/guide/<số>), sự kiện bộ đồ (#/event),
 * công cụ sau câu trả lời trong màn học (giải thích, báo lỗi, lưu ảnh) và nút ở màn hoàn thành.
 * Chỉ dùng biến màu của tokens.css / themes.css (--line là màu tuyến của chặng / bài), nên tự theo
 * 8 bảng màu × ngày / đêm. Trên nền màu tuyến (biển tên, đầu trang) chữ là --hk-cream và Jyutping
 * bỏ màu thanh điệu cho dễ đọc.
 * ========================================================================= */

/* biển tên chặng trên đường học bấm được (mở #/sections) */
.pt-head-tx { color: inherit; text-decoration: none; }
.pt-head-tx:hover h2 { text-decoration: underline; text-underline-offset: 3px; }

/* biển hiệu màu tuyến: ban đêm trộn với nền (--plate-mix 55%) như biển hiệu khác của app, để chữ kem không chói */
.sec-card, .sec-detail { --plate: color-mix(in oklab, var(--line) var(--plate-mix, 100%), var(--bg)); }
.ev { --line: var(--l-purple); --plate: color-mix(in oklab, var(--l-purple) var(--plate-mix, 100%), var(--bg)); }

/* chữ kem + Jyutping không tô màu trên nền màu tuyến */
.sec-hero .toned span, .ev-head .toned span { color: inherit; }

/* nút mở / đóng gập: mũi tên bên phải, xoay khi mở; bỏ tam giác mặc định của trình duyệt */
.sec-levels > summary, .sec-g > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.sec-levels > summary::-webkit-details-marker, .sec-g > summary::-webkit-details-marker { display: none; }
.sec-chev { margin-left: auto; display: grid; place-items: center; flex: 0 0 auto; color: var(--muted); transition: transform .18s; }
.sec-chev svg { width: 18px; height: 18px; }
details[open] > summary .sec-chev { transform: rotate(180deg); }

/* một câu có loa: chữ Hán + Jyutping, nút nghe bên phải, nghĩa bên dưới */
.sec-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; margin: 10px 0; }
.sec-line .vi { grid-column: 1 / -1; color: var(--muted); font-size: .92rem; }

/* ================= CHỌN CHẶNG (#/sections) ================= */
.sec-list { display: flex; flex-direction: column; gap: 16px; max-width: 620px; margin: 0 auto; padding-bottom: 24px; }
.sec-card {
  border-radius: 18px; overflow: hidden; background: var(--surface);
  border: 2px solid color-mix(in srgb, var(--line) 28%, var(--border)); box-shadow: 0 4px 0 color-mix(in srgb, var(--line) 30%, var(--border));
}
.sec-card.is-current { border-color: var(--line); box-shadow: 0 4px 0 color-mix(in srgb, var(--line) 70%, #000); }
/* vùng hình: bong bóng câu mẫu bên trái, Tiểu Cường bên phải, nền nhạt màu tuyến */
.sec-art {
  display: flex; align-items: flex-end; gap: 4px; padding: 14px 10px 0 14px;
  background: color-mix(in srgb, var(--line) 16%, var(--surface)); border-bottom: 2px solid color-mix(in srgb, var(--line) 22%, var(--border));
}
.sec-art .sec-say { flex: 1 1 auto; min-width: 0; margin-bottom: 16px; }
.sec-fig { flex: 0 0 auto; width: 84px; display: flex; justify-content: center; }
.sec-fig .tc { width: 84px; height: auto; }
.sec-glyph { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 14px; border-radius: 50%; color: var(--hk-cream, var(--cream)); background: var(--plate); }
.sec-glyph svg { width: 30px; height: 30px; }
/* bong bóng: chữ canh trái, đuôi chỉ sang Tiểu Cường */
.sec-say { align-items: flex-start; text-align: left; max-width: none; padding: 10px 14px; gap: 4px; }
.sec-say .line-zh.sm { font-size: 1.12rem; line-height: 1.9; }
.sec-say small { font-size: .82rem; }
.sec-art .sec-say::after { left: auto; right: -9px; bottom: 18px; transform: rotate(-45deg); }
.sec-card.is-locked .sec-say { opacity: .62; }
.sec-card.is-locked .sec-fig { filter: grayscale(1); opacity: .55; }

.sec-body { padding: 14px 16px 16px; }
.sec-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sec-meta small { color: var(--muted); font-size: .84rem; }
.sec-lv {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; letter-spacing: .04em;
  color: var(--hk-cream, var(--cream)); background: var(--plate);
}
.sec-now { padding: 2px 9px; border-radius: 999px; font-size: .74rem; color: var(--line); background: color-mix(in srgb, var(--line) 14%, transparent); }
.sec-lock { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.sec-lock svg { width: 14px; height: 14px; }
.sec-body h2 { margin: 6px 0 0; font-size: 1.16rem; line-height: 1.3; }
.sec-body h2 a { color: inherit; text-decoration: none; }
.sec-body h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sec-body h2 span { font-weight: 700; }
.sec-prog { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.sec-prog .progress { flex: 1; height: 12px; }
.sec-prog .progress > i { background: var(--line); }
.sec-prog b { font-size: .88rem; font-variant-numeric: tabular-nums; }
.sec-cup { display: grid; place-items: center; color: var(--faint); }
.sec-cup svg { width: 20px; height: 20px; }
.sec-cup.on { color: var(--gold); }
.sec-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sec-acts .btn.primary { background: var(--plate); border-color: color-mix(in srgb, var(--line) 70%, #000); color: var(--hk-cream, var(--cream)); }
.sec-more { margin-left: auto; }
/* thẻ tự kiểm cuối khóa: không có vùng hình, biểu tượng nằm góc phải */
.sec-final .sec-body { position: relative; padding-right: 76px; }
.sec-final-ic { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: var(--hk-cream, var(--cream)); background: var(--plate); }
.sec-final-ic svg { width: 26px; height: 26px; }
.sec-final.is-locked .sec-final-ic { color: var(--muted); background: var(--surface-3); }
.sec-final-tx { margin: 6px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }

/* ================= CHI TIẾT CHẶNG (#/section/<mã>) ================= */
.sec-detail, .gb, .ev { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-bottom: 28px; }
.sec-hero {
  position: relative; display: flex; align-items: flex-end; gap: 10px; padding: 56px 16px 16px 18px; border-radius: 20px;
  color: var(--hk-cream, var(--cream)); background: var(--plate); box-shadow: 0 5px 0 color-mix(in srgb, var(--plate) 60%, #000);
}
.sec-hero h1, :root[data-theme] .sec-hero h1 { margin: 4px 0 10px; color: inherit; font-size: clamp(1.4rem, 6vw, 1.9rem); line-height: 1.2; }
.sec-back { position: absolute; top: 12px; left: 12px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: inherit; }
.sec-back:hover { background: color-mix(in srgb, #fff 14%, transparent); }
.sec-back svg { width: 24px; height: 24px; }
.sec-hero-tx { flex: 1; min-width: 0; }
.sec-kicker { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.sec-kicker svg { width: 14px; height: 14px; }
.sec-hero .sec-prog { margin-top: 0; }
.sec-hero .sec-prog .progress { background: color-mix(in srgb, #000 22%, transparent); border: 0; }
.sec-hero .sec-prog .progress > i { background: var(--hk-cream, var(--cream)); }
.sec-hero .sec-cup { color: inherit; opacity: .6; } .sec-hero .sec-cup.on { color: var(--gold); opacity: 1; }
.sec-hero-fig { flex: 0 0 auto; margin: -24px -2px -8px 0; }
.sec-hero-fig .tc { width: 96px; height: auto; }
.sec-hero-fig .sec-glyph { background: color-mix(in srgb, #000 20%, transparent); margin: 0; }
.sec-lead { margin: 0; font-size: 1.02rem; line-height: 1.6; }

.sec-block { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); border-bottom-width: 3px; }
.sec-block h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1.08rem; }
.sec-block h2 svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--line); }
.sec-block > p { margin: 0; line-height: 1.6; }
.sec-say.wide { width: 100%; margin: 4px 0 6px; }
.sec-say.wide::after { left: 26px; }
/* câu mẫu của mọi chặng: chặng đang xem đậm, chặng khác mờ */
.sec-levels { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; }
.sec-levels > summary { font-weight: 700; color: var(--line); padding: 4px 0; }
.sec-levels ol { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sec-levels li { padding: 8px 12px; border-radius: 12px; border-left: 4px solid var(--border); opacity: .55; }
.sec-levels li.is-me { opacity: 1; border-left-color: var(--line); background: color-mix(in srgb, var(--line) 9%, transparent); }
.sec-levels li b { font-size: .86rem; }
.sec-levels .sec-line { margin: 4px 0 0; }
/* việc làm được */
.sec-can { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sec-can li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.sec-can li:last-child { border-bottom: 0; }
.sec-can li > div { flex: 1; min-width: 0; }
.sec-can li b { line-height: 1.45; }
.sec-can-ic { flex: 0 0 auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--muted); background: var(--surface-3); }
.sec-can-ic svg { width: 16px; height: 16px; }
.sec-can li.ok .sec-can-ic { color: var(--hk-cream, var(--cream)); background: var(--ok); }
.sec-can .sec-line { margin: 6px 0 0; }
/* khuôn câu theo bài */
.sec-gl + .sec-gl { margin-top: 14px; }
.sec-gl h3 { margin: 0 0 6px; font-size: .95rem; }
.sec-gl h3 a { color: var(--line); }
.sec-g { margin: 6px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.sec-g > summary { padding: 10px 12px; font-weight: 700; line-height: 1.45; }
.sec-g[open] > summary { border-bottom: 1px dashed var(--border); }
.sec-g-body { padding: 4px 12px 8px; }
.sec-g-body > p { margin: 8px 0; line-height: 1.6; font-size: .95rem; }
.sec-cta, .gb-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.sec-cta .btn.big, .gb-cta .btn.big { flex: 1 1 220px; justify-content: center; }

/* ================= SỔ TAY BÀI (#/guide/<số>) ================= */
.gb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: -6px; }
.gb-where { font-weight: 800; font-size: .95rem; }
.gb-x { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.gb-x:hover { background: var(--surface-2); }
.gb-x svg { width: 22px; height: 22px; }
.gb-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--line); }
.gb-kicker svg { width: 16px; height: 16px; }
.gb-hero {
  padding: 18px 18px 14px; border-radius: 20px; border: 2px solid color-mix(in srgb, var(--line) 35%, var(--border));
  background: color-mix(in srgb, var(--line) 12%, var(--surface)); box-shadow: 0 4px 0 color-mix(in srgb, var(--line) 30%, var(--border));
}
.gb-hero h1 { margin: 6px 0 2px; font-size: clamp(1.45rem, 6vw, 1.9rem); line-height: 1.2; }
.gb-zh { margin: 0 0 10px; font-size: 1.05rem; }
.gb-goals { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.55; }
.gb-sec > .gb-kicker { margin-bottom: 4px; }
/* câu chính: hình người nói + bong bóng (lớp .bubble dùng chung với trang bài) */
.gb-line { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; }
.gb-who { flex: 0 0 auto; padding-top: 4px; }
.gb-bub.bubble { flex: 1 1 auto; max-width: none; padding: 10px 14px 10px; }
.gb-row { display: flex; gap: 8px; align-items: center; }
.gb-row .line-zh.sm { flex: 1; min-width: 0; line-height: 1.9; }
.gb-bub .vi { margin-top: 2px; color: var(--muted); }
.gb-say {
  flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid color-mix(in srgb, var(--line) 40%, var(--border));
  border-radius: 12px; background: var(--surface); color: var(--line); cursor: pointer;
}
.gb-say:hover { border-color: var(--line); }
.gb-say svg { width: 20px; height: 20px; }
.gb-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
/* từ chính: lưới ô bấm nghe */
.gb-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 6px; }
.gb-word {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border: 1px solid var(--border); border-bottom-width: 3px;
  border-radius: 14px; background: var(--surface); color: inherit; font: inherit; text-align: center; cursor: pointer;
}
.gb-word:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--border)); }
.gb-word .z { font-family: var(--font-zh); font-size: 1.3rem; font-weight: 700; }
.gb-word small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
/* khung mẹo, mẹo cho người Việt, văn hoá */
.gb-tip { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--line); }
.gb-tip h2 { margin: 6px 0 8px; font-size: 1.12rem; line-height: 1.4; }
.gb-tip p { margin: 0 0 8px; line-height: 1.65; }
.gb-tip ul { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.6; }
.gb-vn { border-left-color: var(--gold); } .gb-vn .gb-kicker { color: color-mix(in srgb, var(--gold) 70%, var(--text)); }
.gb-culture { border-left-color: var(--accent-2); } .gb-culture .gb-kicker { color: color-mix(in srgb, var(--accent-2) 75%, var(--text)); }
.gb-ex { display: flex; gap: 10px; align-items: center; margin: 8px 0 0; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.gb-ex > div { flex: 1; min-width: 0; }
.gb-ex .vi { color: var(--muted); font-size: .92rem; }

/* ================= SỰ KIỆN BỘ ĐỒ (#/event) ================= */
.ev-head {
  position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 56px 14px 16px 18px; border-radius: 20px; overflow: hidden;
  color: var(--hk-cream, var(--cream)); background: var(--plate); box-shadow: 0 5px 0 color-mix(in srgb, var(--plate) 60%, #000);
}
.ev-ht { flex: 1; min-width: 0; }
.ev-ht small { display: block; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: inherit; opacity: .85; }
.ev-head h1, :root[data-theme] .ev-head h1 { margin: 4px 0 2px; color: inherit; font-size: clamp(1.5rem, 6.5vw, 2rem); line-height: 1.15; }
.ev-zh { margin: 0 0 8px; font-size: 1.02rem; }
.ev-left { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 3px 10px; border-radius: 999px; font-size: .84rem; font-weight: 800; background: color-mix(in srgb, #000 22%, transparent); }
.ev-left svg { width: 16px; height: 16px; }
.ev-cast { flex: 0 0 auto; display: flex; align-items: flex-end; margin: -10px -6px -14px 0; }
.ev-cast .ev-img.cast { width: 62px; margin-left: -12px; }
.ev-cast .ev-img.cast:nth-child(2) { width: 72px; position: relative; z-index: 1; }
.ev-img { display: block; width: 100%; height: auto; }
span.ev-img { display: grid; place-items: center; aspect-ratio: 1; color: var(--muted); }
span.ev-img svg { width: 40%; height: 40%; }
.ev-how { margin: 6px 0 0; font-size: .92rem; line-height: 1.5; }
/* thanh điểm có vạch ở mốc từng bộ */
.ev-track { position: relative; margin: 16px 6px 30px; }
.ev-bar { display: block; height: 16px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border); overflow: hidden; }
.ev-bar i { display: block; height: 100%; border-radius: 99px; background: var(--l-purple); }
.ev-mark { position: absolute; top: 22px; left: var(--at); transform: translateX(-50%); font-size: .8rem; color: var(--muted); }
.ev-mark::before { content: ''; position: absolute; top: -22px; left: 50%; width: 2px; height: 16px; margin-left: -1px; background: color-mix(in srgb, var(--surface) 80%, transparent); }
.ev-mark:last-child::before { display: none; }
.ev-mark.on { color: var(--l-purple); }
.ev-tiles, .ev-shop { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 14px; }
.ev-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 10px; border-radius: 16px;
  border: 2px solid var(--border); border-bottom-width: 4px; background: var(--surface-2); color: inherit; text-align: center; text-decoration: none;
}
.ev-tile:hover { border-color: color-mix(in srgb, var(--l-purple) 45%, var(--border)); }
.ev-frame { display: block; width: 100%; max-width: 92px; }
.ev-state { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.ev-state svg { width: 15px; height: 15px; }
.ev-tile small { color: var(--muted); font-size: .76rem; line-height: 1.3; }
.ev-tile.is-locked .ev-img { filter: grayscale(1); opacity: .55; }
.ev-tile.is-locked .ev-state { color: var(--muted); }
.ev-tile.is-open { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.ev-tile.is-open .ev-state { color: var(--ok); }
.ev-tile.is-owned .ev-state { color: var(--ok); }
.ev-tile.is-rare { border-color: color-mix(in srgb, var(--l-purple) 60%, var(--border)); }
.ev-tile.is-rare.is-open { border-color: var(--ok); }
.ev-rare {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--hk-cream, var(--cream)); background: var(--plate);
}
.ev-tile .ev-rare { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); }
.ev-shop .ev-state { color: var(--text); }
.ev-shop .ev-state svg { color: var(--gold); }
/* chi tiết một bộ */
.ev-one { align-items: center; text-align: center; gap: 12px; }
.ev-one-top { position: relative; align-self: stretch; min-height: 40px; }
.ev-rare.big { font-size: .8rem; padding: 3px 14px; }
.ev-stage { position: relative; width: min(280px, 70vw); }
.ev-stage::before { content: ''; position: absolute; left: 12%; right: 12%; bottom: 2%; height: 10%; border-radius: 50%; background: color-mix(in srgb, var(--l-purple) 22%, transparent); filter: blur(6px); }
.ev-stage .ev-img { position: relative; }
.ev-img.dim { filter: grayscale(1); opacity: .55; }
.ev-name { margin: 0; font-size: 1.5rem; line-height: 1.3; }
.ev-name .ev-vi { display: block; font-size: 1.15rem; }
.ev-one-tx { margin: 0; max-width: 380px; line-height: 1.55; }
.ev-one-btns { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 380px; margin-top: 4px; }
/* thẻ sự kiện trên trang Nhiệm vụ */
.qp-event { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.qp-event:hover { border-color: color-mix(in srgb, var(--l-purple) 45%, var(--border)); }
.qp-ev-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.qp-ev-tx small { color: var(--muted); font-size: .78rem; font-weight: 700; }
.qp-ev-tx b { font-size: 1.02rem; }
.qp-ev-tx > span { display: inline-flex; align-items: center; gap: 5px; font-size: .86rem; color: var(--muted); }
.qp-ev-tx > span svg { width: 16px; height: 16px; color: var(--ok); }
.qp-ev-row { flex: 0 0 auto; display: flex; gap: 2px; }
.qp-ev-it { position: relative; width: 48px; }
.qp-ev-it img { display: block; width: 100%; height: auto; }
.qp-ev-it:not(.owned):not(.open) img { filter: grayscale(1); opacity: .55; }
.qp-ev-it i {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 2px; padding: 0 5px; border-radius: 999px;
  font-size: .68rem; font-weight: 800; font-style: normal; color: var(--muted); background: var(--surface); border: 1px solid var(--border); white-space: nowrap;
}
.qp-ev-it i svg { width: 11px; height: 11px; }

/* ================= CÔNG CỤ SAU CÂU TRẢ LỜI (màn học) ================= */
.ses-tools { margin-left: auto; display: inline-flex; gap: 2px; }
.ses-tool { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; opacity: .8; }
.ses-tool:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
.ses-tool svg { width: 20px; height: 20px; }
.ses-tool.on { opacity: 1; color: var(--gold); }
.ses-explain { margin-top: 8px; }
.ses-guide { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 700; }
.ses-guide svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* bảng bật từ dưới lên trên điện thoại */
@media (max-width: 560px) {
  .modal-wrap.as-sheet { place-items: end stretch; padding: 0; }
  .modal-wrap.as-sheet .modal { width: 100%; max-height: 88vh; border-radius: 20px 20px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); }
  :root:not([data-fx="less"]) .modal-wrap.as-sheet .modal { animation: rise-in .2s ease-out; }
}
/* giải thích đáp án */
.ex-top { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 44px 12px 0; }
.ex-top h2 { margin: 0; }
.ex-top .chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.ex-top .chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.ex-line { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.ex-line-tx { flex: 1; min-width: 0; }
.ex-line .line-zh.sm { line-height: 1.9; }
.ex-line .vi { color: var(--muted); font-size: .92rem; }
.ex-line.is-right { border-left: 5px solid var(--ok); }
.ex-line.is-chose { border-left: 5px solid var(--bad); }
.ex-card { margin: 12px 0 16px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.ex-card > p { margin: 10px 0; line-height: 1.6; }
.ex-swap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); font-weight: 700; line-height: 1.5; }
.ex-chose { color: var(--bad); text-decoration-thickness: 2px; }
.ex-right { color: var(--ok); }
.ex-gloss { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.ex-sub { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-weight: 700; font-size: .92rem; }
.ex-sub svg { width: 18px; height: 18px; color: var(--gold); }
.ex-vote { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ex-vote small { flex: 1; line-height: 1.4; }
.ex-vote .row { display: flex; gap: 6px; flex: 0 0 auto; }
.ex-vote .btn.on { color: var(--accent-2); border-color: currentColor; }
/* báo lỗi */
.rp-sheet h2 { display: flex; align-items: center; gap: 8px; margin: 0 44px 4px 0; }
.rp-sheet h2 svg { width: 22px; height: 22px; color: var(--bad); }
.rp-sheet > p { margin: 0 0 12px; }
.rp-list { display: flex; flex-direction: column; gap: 8px; }
.rp-opt {
  padding: 12px 14px; border: 1px solid var(--border); border-bottom-width: 3px; border-radius: 12px; background: var(--surface-2);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.rp-opt.on { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--surface-2)); }
.rp-opt:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
@media (hover: hover) { .rp-opt:hover { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)); } }
.rp-more textarea { display: block; width: 100%; min-height: 96px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: inherit; font: inherit; resize: vertical; }

/* màn hoàn thành: ba nút phụ (xem lại, lưu ảnh, sổ tay) xếp một hàng, biểu tượng trên chữ */
.ses-fin-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); align-items: stretch; gap: 8px; width: 100%; }
.ses-fin-more .btn { flex-direction: column; justify-content: center; gap: 4px; min-width: 0; padding: 10px 6px; font-size: .84rem; line-height: 1.25; text-align: center; white-space: normal; }
.ses-fin-more .btn svg { width: 22px; height: 22px; }
