/* Tra cứu video + trang chi tiết video kiểu WIN (gói 1, 06/10/2026 — chuyển từ bản giả lập đã duyệt) — chép thông số từ win-sonnetgroup/public/assets/app.css
   (.toolbar-v2, .pcard, .lib-card, .detail-layout, .dsection). Dùng biến màu sẵn có của theme.css. */
:root {
  --info: #3272C4; --info-soft: #E1EBFA;
  --new: #8355C9; --new-soft: #EEE5F9;
  --teal: #1F9C93; --teal-soft: #DCF4F1;
  --warn: #C98A12; --warn-soft: #FAEDD1;
}
:root[data-theme="dark"] {
  --info: #7CA6E3; --info-soft: #20293C;
  --new: #B79CE0; --new-soft: #2A2338;
  --teal: #5FC2B8; --teal-soft: #1A3230;
  --warn: #E3B655; --warn-soft: #382C14;
}

/* ---- Thanh lọc 2 tầng ---- */
.tc-toolbar { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; box-shadow: 0 3px 0 0 var(--btn-depth-soft); }
.tc-search { position: relative; }
.tc-search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: .6; }
.tc-search input { width: 100%; height: 46px; padding-left: 40px; font-size: 0.95rem; border-radius: 999px; }
.tc-filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding-top: 12px; border-top: 1px dashed var(--border); }
.tc-filter { display: flex; flex-direction: column; gap: 4px; flex: 1 1 150px; min-width: 140px; }
.tc-filter label { margin: 0; font-size: 0.7rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
button.tc-clear { background: none !important; box-shadow: none !important; border: 0 !important; color: var(--text-muted) !important; text-decoration: underline; height: 32px; padding: 0 6px; font-weight: 600; }

.tc-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 2px 14px; }
.tc-viewswitch { display: flex; padding: 4px; gap: 3px; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--border); }
button.tc-vbtn { height: 32px !important; padding: 0 14px !important; border-radius: 999px !important; border: 0 !important; background: none !important; color: var(--text-muted) !important; box-shadow: none !important; font-size: 0.82rem; }
button.tc-vbtn.active { background: var(--brand-gradient) !important; color: #fff !important; box-shadow: 0 3px 0 0 var(--btn-depth) !important; }

/* ---- Chip ---- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 99px; font-size: 0.74rem; font-weight: 700; line-height: 1.3; color: var(--muted-badge); background: var(--muted-soft); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.hook { color: var(--primary-hover); background: var(--primary-soft); }
.chip.dd { color: var(--info); background: var(--info-soft); }
.chip.nganh { color: var(--teal); background: var(--teal-soft); }
.chip.moi { color: var(--new); background: var(--new-soft); }
.chip.canh { color: var(--warn); background: var(--warn-soft); }

/* ---- Lưới thẻ ---- */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.vcard { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; text-align: left; box-shadow: 0 3px 0 0 var(--btn-depth-soft); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.vcard:hover { border-color: var(--text-faint); box-shadow: var(--shadow-soft-lg); transform: translateY(-3px); }
.vcard-top { display: flex; align-items: center; gap: 8px; }
.rank { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 9px; background: var(--brand-gradient); color: #fff; font-weight: 800; font-size: 0.8rem; box-shadow: 0 2px 0 0 var(--btn-depth); }
.score { margin-left: auto; text-align: right; line-height: 1.05; }
.score b { display: block; font-size: 1.15rem; font-weight: 800; color: var(--text); }
.score span { font-size: 0.66rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.vhook { font-size: 0.98rem; font-weight: 700; line-height: 1.45; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 4.3em; }
.vhook::before { content: "“"; color: var(--primary); font-weight: 900; margin-right: 2px; }
.vhook::after { content: "”"; color: var(--primary); font-weight: 900; margin-left: 2px; }
.vchips { display: flex; flex-wrap: wrap; gap: 6px; }
.vsp { font-size: 0.86rem; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vmeta { font-size: 0.76rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.vfoot { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; justify-content: space-between; align-items: center; }
.vfoot .xem { font-weight: 700; font-size: 0.84rem; color: var(--primary-hover); }

/* ---- Danh sách dòng ---- */
.vlist { display: flex; flex-direction: column; gap: 10px; }
.vrow { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 16px; display: grid; grid-template-columns: 48px minmax(0, 2.4fr) minmax(0, 1.4fr) 92px 92px 110px; gap: 14px; align-items: center; cursor: pointer; box-shadow: 0 2px 0 0 var(--btn-depth-soft); transition: border-color .15s ease, transform .15s ease; }
.vrow:hover { border-color: var(--text-faint); transform: translateY(-1px); }
.vrow .vhook { -webkit-line-clamp: 2; min-height: 0; font-size: 0.9rem; }
.vrow .num { text-align: right; font-weight: 800; font-size: 1rem; }
.vrow .num small { display: block; font-size: 0.66rem; color: var(--text-faint); font-weight: 700; text-transform: uppercase; }
.vrow-head { display: grid; grid-template-columns: 48px minmax(0, 2.4fr) minmax(0, 1.4fr) 92px 92px 110px; gap: 14px; padding: 0 16px 2px; font-size: 0.68rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.vrow-head span:nth-child(n+4) { text-align: right; }

/* ---- Trang chi tiết ---- */
button.back-btn { margin-bottom: 16px; }
.dhead { position: relative; overflow: hidden; border-radius: 24px; padding: 22px 120px 22px 24px; background: var(--brand-gradient); color: #fff; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(30,20,10,0.06), 0 8px 24px -8px rgba(30,20,10,0.16); }
.dhead h2 { all: unset; display: block; font-size: 1.45rem; font-weight: 900; letter-spacing: -0.01em; line-height: 1.25; }
.dhead p { margin: 6px 0 0; opacity: .9; font-size: 0.9rem; }
.dhead::after { content: ""; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); width: 64px; height: 52px; border-radius: 14px; background: #fff url(logo-sonnet.png) center / 40px no-repeat; box-shadow: 0 2px 10px rgba(0,0,0,0.22); }
#page-video-detail > h2 { display: none; }

.detail-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.dside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.dcard { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; box-shadow: 0 3px 0 0 var(--btn-depth-soft); }
.dcard h4 { margin: 0 0 10px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 800; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--bg-subtle); border-radius: 14px; padding: 10px 12px; }
.kpi b { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.kpi span { font-size: 0.72rem; color: var(--text-muted); }
dl.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 0.85rem; }
dl.kv dt { color: var(--text-muted); }
dl.kv dd { margin: 0; font-weight: 600; }
.dside .btn-full { width: 100%; }

.dmain { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dsection { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px 20px; box-shadow: 0 3px 0 0 var(--btn-depth-soft); }
.dsection-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dsection-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--brand-gradient); display: grid; place-items: center; font-size: 1rem; flex: none; box-shadow: 0 3px 0 0 var(--btn-depth); }
.dsection-title h3 { margin: 0; font-size: 1rem; font-weight: 800; }
.dsection-title p { margin: 2px 0 0; font-size: 0.76rem; color: var(--text-faint); }
.hookbig { font-size: 1.15rem; font-weight: 800; line-height: 1.45; padding: 14px 16px; border-radius: 14px; background: var(--primary-soft); color: var(--text); margin-bottom: 12px; }
.frames { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.frame { background: var(--bg-subtle); border-radius: 14px; padding: 10px 12px; font-size: 0.82rem; line-height: 1.45; }
.frame b { display: block; font-size: 0.7rem; color: var(--primary-hover); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tl { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.tl-row:last-child { border-bottom: 0; }
.tl-time { font-weight: 800; font-size: 0.82rem; color: var(--primary-hover); font-variant-numeric: tabular-nums; }
.tl-role { font-size: 0.72rem; font-weight: 700; color: var(--teal); margin-bottom: 4px; }
.tl-say { font-size: 0.92rem; line-height: 1.5; }
.tl-see { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.tl-see::before { content: "🎥 "; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cell { background: var(--bg-subtle); border-radius: 14px; padding: 10px 12px; font-size: 0.85rem; line-height: 1.5; }
.cell b { display: block; font-size: 0.7rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.overlay { display: flex; flex-wrap: wrap; gap: 6px; }
.overlay span { background: var(--bg-subtle); border-radius: 8px; padding: 4px 8px; font-size: 0.8rem; }
.overlay span i { font-style: normal; color: var(--text-faint); margin-right: 4px; font-size: 0.72rem; }
details.trans summary { cursor: pointer; font-weight: 700; color: var(--primary-hover); margin-top: 10px; }
.trans-body { font-size: 0.86rem; line-height: 1.7; margin-top: 8px; color: var(--text-muted); }
.trans-body i { font-style: normal; color: var(--text-faint); font-size: 0.74rem; margin-right: 4px; font-variant-numeric: tabular-nums; }


@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
  .dside { position: static; }
  .frames { grid-template-columns: 1fr 1fr; }
  .vrow, .vrow-head { grid-template-columns: 40px minmax(0, 1fr) 80px; }
  .vrow > :nth-child(3), .vrow > :nth-child(5), .vrow > :nth-child(6), .vrow-head > :nth-child(3), .vrow-head > :nth-child(5), .vrow-head > :nth-child(6) { display: none; }
}
@media (max-width: 600px) {
  .vgrid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .dhead { padding: 16px 84px 16px 16px; border-radius: 16px; }
  .dhead h2 { font-size: 1.15rem; }
  .dhead::after { width: 46px; height: 40px; right: 14px; background-size: 28px; }
  }

/* ---- Trang chi tiết bản 2 (đủ mục WIN) ---- */
.dside .dcard .dsection-title { margin-bottom: 10px; }
.dsection-icon.sm { width: 30px; height: 30px; font-size: 0.85rem; }
.dcard .dsection-title h3 { margin: 0; font-size: 0.95rem; font-weight: 800; }
.dhead-side { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.dtitle { margin: 0; font-size: 1.05rem; font-weight: 800; line-height: 1.3; word-break: break-word; }
.detail-id { font-size: 0.74rem; color: var(--text-faint); margin-top: 4px; line-height: 1.4; }
.dlinks { display: flex; flex-direction: column; gap: 10px; }
.dactions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.dsection-note { font-size: 0.76rem; color: var(--text-muted); margin: 14px 0 8px; font-weight: 600; }
.field-ro { margin-top: 10px; }
.field-ro > label { display: block; margin: 0 0 5px; font-size: 0.7rem; font-weight: 800; color: var(--primary-hover); text-transform: uppercase; letter-spacing: .05em; }
.field-ro .val { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; font-size: 0.86rem; line-height: 1.55; }
.field-ro .val .sub { font-size: 0.76rem; color: var(--success); margin-top: 4px; font-weight: 600; }
.val.ok { color: var(--success); font-weight: 600; }
.empty-field { border: 1px dashed var(--border); border-radius: 12px; padding: 9px 12px; font-size: 0.8rem; color: var(--text-faint); font-style: italic; background: transparent; }
.grid2 .field-ro, .grid3 .field-ro { margin-top: 0; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 10px; margin-top: 4px; }
.grid2 { gap: 12px; }
.frame-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; }
.frame-ph { flex: none; width: 92px; aspect-ratio: 9 / 16; border-radius: 12px; background: repeating-linear-gradient(135deg, var(--bg-subtle), var(--bg-subtle) 8px, var(--surface-3) 8px, var(--surface-3) 16px); border: 1px solid var(--border); display: flex; align-items: flex-end; justify-content: center; padding: 6px; }
.frame-ph.hook { outline: 3px solid #F4782E; outline-offset: -3px; }
.frame-ph span { font-size: 0.7rem; font-weight: 700; background: var(--surface); border-radius: 6px; padding: 2px 6px; }
.trans-box { max-height: 220px; overflow-y: auto; line-height: 1.8 !important; }
.trans-box .ts { font-size: 0.7rem; font-weight: 700; color: var(--text-faint); margin: 0 4px 0 2px; font-variant-numeric: tabular-nums; }
.overlay em { font-style: normal; color: var(--text-faint); font-size: 0.72rem; }
.tl-table { width: 100%; font-size: 0.85rem; }
.tl-table td { vertical-align: top; }
.tl-table td.stage { width: 22%; font-weight: 700; color: var(--teal); }
.tl-table td.time { width: 12%; white-space: nowrap; font-weight: 800; color: var(--primary-hover); font-variant-numeric: tabular-nums; }
.tl-table .say { line-height: 1.5; }
.tl-table .see { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }
.formula { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; line-height: 1.55; }
.formula b { color: var(--primary-hover); }
.chips-off { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip.off { opacity: .45; }
.warn-list { margin: 0; padding-left: 18px; font-size: 0.84rem; color: var(--warn); line-height: 1.6; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.74rem !important; word-break: break-all; }
@media (max-width: 900px) { .grid3 { grid-template-columns: 1fr; } .tl-table td.stage { width: auto; } }

/* Chữ chạy hết dòng (06/10): bỏ cột hẹp ép chữ xuống dòng sớm */
.hookrow { display: flex; gap: 10px; margin-top: 4px; }
.hookrow .field-ro { margin-top: 0; flex: 1 1 0; min-width: 0; }
.hookrow .field-ro:first-child { flex: 0 0 auto; }
.tl-table td.time { width: 1%; padding-right: 18px; }
.tl-table .stage { font-weight: 700; color: var(--teal); font-size: 0.8rem; margin-bottom: 3px; }
.dside dl.kv { grid-template-columns: auto 1fr; column-gap: 14px; }
@media (max-width: 600px) { .hookrow { flex-direction: column; } }
.tl-table th:first-child { white-space: nowrap; width: 1%; }

/* Dòng giải thích cho KOC + nhãn chế độ quản trị */
.koc-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: var(--info-soft); color: var(--text); font-size: 0.8rem; line-height: 1.55; }
.koc-note .i { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--info); color: #fff; display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; margin-top: 1px; }
.koc-note b { color: var(--info); }
.mode-tag { display: inline-block; margin: 0 0 14px 10px; padding: 6px 12px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: 0.78rem; }

.koc-note .t { flex: 1; min-width: 0; }

/* Khung hook cân đối (06/10): ô cùng hàng cao bằng nhau, ô giá trị giãn hết chiều cao */
.grid2, .hookrow { align-items: stretch; }
.grid2 > .field-ro, .hookrow > .field-ro { display: flex; flex-direction: column; margin-top: 0; }
.grid2 > .field-ro > .val, .grid2 > .field-ro > .empty-field,
.hookrow > .field-ro > .val, .hookrow > .field-ro > .empty-field { flex: 1; }
.dsection .grid2 + .koc-note { margin-top: 12px; }
.hookrow { margin-bottom: 4px; }

/* Bóc tách theo từng đoạn: thu gọn còn 4 đoạn đầu */
.tl-table.thu-gon tr.tl-them { display: none; }
button.tl-toggle { width: 100%; margin-top: 8px; height: 38px; }

/* Bóc tách từng đoạn dạng 1 dòng / đoạn, bấm để mở (06/10) */
.tl-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.tl-head label { margin: 0 !important; }
.tl-acc { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.tl-item + .tl-item { border-top: 1px solid var(--border); }
.tl-item summary { list-style: none; display: flex; align-items: baseline; gap: 14px; padding: 10px 14px; cursor: pointer; }
.tl-item summary::-webkit-details-marker { display: none; }
.tl-item summary:hover { background: var(--bg-subtle); }
.tl-item .t { flex: none; min-width: 92px; font-weight: 800; font-size: 0.82rem; color: var(--primary-hover); font-variant-numeric: tabular-nums; }
.tl-item .r { flex: 1; min-width: 0; font-weight: 600; font-size: 0.88rem; color: var(--teal); }
.tl-item .caret { flex: none; color: var(--text-faint); transition: transform .15s ease; }
.tl-item[open] .caret { transform: rotate(90deg); }
.tl-item[open] summary { background: var(--bg-subtle); }
.tl-body { padding: 4px 14px 12px 120px; font-size: 0.88rem; line-height: 1.55; background: var(--bg-subtle); }
.tl-body .see { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
details.trans-acc summary { cursor: pointer; font-weight: 700; color: var(--primary-hover); padding: 10px 14px; border: 1px dashed var(--border); border-radius: 12px; list-style: none; }
details.trans-acc summary::-webkit-details-marker { display: none; }
details.trans-acc[open] summary { margin-bottom: 8px; }
.trans-full { line-height: 1.85 !important; margin-bottom: 8px; }
.trans-full .ts { font-size: 0.7rem; font-weight: 700; color: var(--text-faint); margin: 0 4px 0 2px; }
@media (max-width: 600px) { .tl-body { padding-left: 14px; } .tl-item .t { min-width: 76px; } }
.tl-head label { display: block; font-size: 0.7rem; font-weight: 800; color: var(--primary-hover); text-transform: uppercase; letter-spacing: .05em; }

/* ===== Làm trang chi tiết rõ & sinh động hơn (06/10) ===== */
.dbanner { position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; padding: 22px 26px; margin-bottom: 18px; border-radius: 24px; background: var(--brand-gradient); color: #fff; box-shadow: 0 10px 28px -12px rgba(228,38,46,.55); }
.dbanner::before { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.10); }
.dbanner-main { position: relative; flex: 1; min-width: 0; }
.dbanner-kicker { font-size: 0.78rem; font-weight: 700; opacity: .9; text-transform: uppercase; letter-spacing: .05em; }
h2.dbanner-title { all: unset; display: block; font-size: 1.7rem; font-weight: 900; line-height: 1.2; margin: 4px 0 12px; letter-spacing: -0.01em; }
.dbanner-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.dbanner-badges .bb { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 5px 12px; font-size: 0.8rem; font-weight: 600; backdrop-filter: blur(4px); }
.dbanner-badges .bb b { font-size: 0.95rem; font-weight: 900; margin-right: 3px; }
.dbanner-logo { position: relative; flex: none; width: 74px; height: 60px; border-radius: 16px; background: #fff url(logo-sonnet.png) center / 46px no-repeat; box-shadow: 0 4px 14px rgba(0,0,0,.2); }

/* Khung có vạch màu trên đầu */
.dsection, .dcard { position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--border) 70%, #F4782E 30%); }
.dsection::before, .dcard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--brand-gradient); }
.dsection-title h3, .dcard .dsection-title h3 { font-size: 1.08rem; color: var(--text); }

/* Ô nội dung: nền trắng, viền rõ, chữ đậm hơn */
.field-ro .val { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid #F4782E; color: var(--text); font-size: 0.9rem; }
.field-ro > label, .tl-head label { color: var(--primary); }
.dside dl.kv dt { color: var(--text-muted); }
.dside dl.kv dd { color: var(--text); font-weight: 700; }

/* KPI có màu riêng */
.kpi { border: 1px solid transparent; }
.kpi b { font-size: 1.5rem; }
.kpi.k-hang { background: #FFF1E8; } .kpi.k-hang b { color: #E85D16; }
.kpi.k-dt { background: var(--success-bg); } .kpi.k-dt b { color: var(--success); }
.kpi.k-don { background: var(--info-soft); } .kpi.k-don b { color: var(--info); }
.kpi.k-view { background: var(--new-soft); } .kpi.k-view b { color: var(--new); }
.kpi.k-ngay { background: var(--teal-soft); } .kpi.k-ngay b { color: var(--teal); }
.kpi.k-dur { background: var(--warn-soft); } .kpi.k-dur b { color: var(--warn); }
:root[data-theme="dark"] .kpi.k-hang { background: #3a2416; }

/* Câu hook nổi hơn */
.hookbig { font-size: 1.3rem; background: linear-gradient(90deg, var(--primary-soft), transparent 120%); border-left: 5px solid #F4782E; }

/* Danh sách các đoạn: mốc thành huy hiệu, xen kẽ nền */
.tl-item:nth-child(even) summary { background: color-mix(in srgb, var(--bg-subtle) 60%, transparent); }
.tl-item .t { display: inline-block; text-align: center; padding: 3px 8px; border-radius: 8px; background: var(--primary-soft); color: var(--primary-hover); }
.tl-item .r { color: var(--text); font-weight: 700; }
.tl-item[open] summary .r { color: var(--primary-hover); }

/* Công thức: số thứ tự to, màu */
.formula li::marker { color: #F4782E; font-weight: 900; }
.formula b { color: var(--text); }

@media (max-width: 600px) { .dbanner { padding: 18px; border-radius: 18px; } h2.dbanner-title { font-size: 1.25rem; } .dbanner-logo { display: none; } }

/* ===== Thứ bậc / điểm nhấn (06/10): chỉ Hook + Công thức nổi bật, phần còn lại dịu xuống ===== */
/* dịu mặc định */
.dsection::before, .dcard::before { display: none; }
.dsection, .dcard { border-color: var(--border); }
.field-ro .val { border-left: 1px solid var(--border); background: var(--bg-subtle); }
.koc-note { background: transparent; padding: 4px 0 0; color: var(--text-muted); font-size: 0.76rem; }
.koc-note .i { background: var(--text-faint); width: 15px; height: 15px; font-size: 0.6rem; }
.koc-note b { color: var(--text); }

/* NHẤN 1: Câu hook & 3 giây đầu */
.dsection.nhan-hook { border: 2px solid #F4782E; background: linear-gradient(180deg, #FFF4EC 0%, var(--surface) 55%); box-shadow: 0 14px 34px -16px rgba(244,120,46,.55); }
.nhan-hook .dsection-title h3 { font-size: 1.3rem; }
.nhan-hook .hookbig { font-size: 1.55rem; line-height: 1.35; padding: 20px 22px; background: var(--surface); border: 0; border-left: 6px solid #F4782E; border-radius: 16px; box-shadow: 0 6px 18px -10px rgba(0,0,0,.25); }
.nhan-hook .field-ro .val { background: var(--surface); border-color: #F7C9AE; }
:root[data-theme="dark"] .dsection.nhan-hook { background: linear-gradient(180deg, #3a2416 0%, var(--surface) 55%); }

/* NHẤN 2: Công thức tái sử dụng — khung tối */
.dsection.nhan-cong-thuc { background: #1C1917; border-color: #1C1917; color: #F4F1EA; box-shadow: 0 16px 36px -18px rgba(0,0,0,.6); }
.nhan-cong-thuc .dsection-title h3 { color: #fff; font-size: 1.25rem; }
.nhan-cong-thuc .dsection-title p { color: #B3AB9C; }
.nhan-cong-thuc .koc-note { color: #B3AB9C; }
.nhan-cong-thuc .koc-note b { color: #FFB27A; }
.nhan-cong-thuc .formula { list-style: none; padding: 0; counter-reset: buoc; gap: 12px; font-size: 0.92rem; }
.nhan-cong-thuc .formula li { counter-increment: buoc; position: relative; padding: 10px 14px 10px 52px; border-radius: 14px; background: rgba(255,255,255,.06); }
.nhan-cong-thuc .formula li::before { content: counter(buoc); position: absolute; left: 12px; top: 9px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-gradient); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 0.85rem; }
.nhan-cong-thuc .formula b { color: #FFB27A; }
.nhan-cong-thuc .bo-bot { font-style: normal; color: #FFB27A; font-weight: 700; }
.nhan-cong-thuc .sub-note { margin-top: 4px; font-size: 0.76rem; color: #B3AB9C; }

/* Điểm đáng chú ý + Cấu trúc video (theo trang Phân tích video của WIN) */
.notable { display: flex; flex-wrap: wrap; gap: 8px; }
.nchip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; }
.nchip.yes { background: var(--success-bg); color: var(--success); }
.nchip.no { background: var(--bg-subtle); color: var(--text-faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flow-step { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid #F4782E; border-radius: 12px; padding: 8px 12px; font-size: 0.84rem; font-weight: 700; box-shadow: 0 2px 0 0 var(--btn-depth-soft); max-width: 100%; }
.flow-step i { font-style: normal; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--brand-gradient); color: #fff; display: grid; place-items: center; font-size: 0.72rem; }
.flow-step em { font-style: normal; font-weight: 600; font-size: 0.72rem; color: var(--text-faint); }
.flow-arrow { color: #F4782E; font-weight: 900; }

/* Cấu trúc video dạng lưới bước đều nhau (đọc trái→phải, trên→dưới) */
.flow { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; counter-reset: none; }
.flow-step { display: flex; align-items: flex-start; gap: 10px; border-left-width: 3px; padding: 10px 12px; min-height: 64px; }
.flow-step .fs-txt { flex: 1; min-width: 0; font-weight: 700; font-size: 0.84rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.flow-step em { flex: none; align-self: flex-start; background: var(--primary-soft); color: var(--primary-hover); border-radius: 6px; padding: 1px 6px; font-weight: 700; }
.flow-step:first-child { border-left-color: var(--success); }
.flow-step:last-child { border-left-color: #E4262E; }

/* Vạch ngăn "Đúc kết từ phân tích" giữa phần phân tích và phần kết luận */
.dk-sep { display: flex; align-items: center; gap: 12px; margin: 6px 0 -2px; color: var(--primary-hover); font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .08em; }
.dk-sep::before, .dk-sep::after { content: ""; flex: 1; height: 2px; background: var(--brand-gradient); opacity: .5; border-radius: 2px; }

/* Cấu trúc video = thanh thời lượng */
.dur-wrap { margin-top: 4px; }
.dur-bar { display: flex; height: 46px; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
button.seg { all: unset; box-sizing: border-box; height: 100%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.78rem; cursor: pointer; border-right: 2px solid var(--surface); transition: filter .12s ease, transform .12s ease; }
button.seg:last-child { border-right: 0; }
button.seg:hover, button.seg.on { filter: brightness(1.12) saturate(1.1); transform: scaleY(1.08); }
button.seg.on { box-shadow: inset 0 0 0 3px #1C1917; }
.dur-mk { position: relative; height: 26px; }
.mk { position: absolute; top: 2px; transform: translateX(-50%); }
.mk::before { content: ""; position: absolute; left: 50%; top: -8px; width: 2px; height: 8px; background: currentColor; }
.mk span { white-space: nowrap; font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.mk.sp { color: var(--success); } .mk.sp span { background: var(--success-bg); }
.mk.chot { color: #E4262E; } .mk.chot span { background: var(--primary-soft); }
.dur-axis { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-faint); font-weight: 700; }
.dur-info { margin-top: 8px; padding: 9px 12px; border-radius: 12px; background: var(--bg-subtle); font-size: 0.85rem; min-height: 38px; }
.dur-nx { margin: 12px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; line-height: 1.5; }
.dur-nx b { color: var(--primary-hover); }
.tl-item .so { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-gradient); color: #fff; font-size: 0.7rem; font-weight: 800; display: grid; place-items: center; align-self: center; }
.tl-body { padding-left: 156px; }
@media (max-width: 600px) { .tl-body { padding-left: 14px; } .mk span { font-size: 0.64rem; padding: 1px 6px; } }
.mk.le-trai { transform: none; } .mk.le-trai::before { left: 0; }
.mk.le-phai { transform: translateX(-100%); } .mk.le-phai::before { left: auto; right: 0; }

/* Cấu trúc video dạng Gantt */
.gantt { display: flex; flex-direction: column; gap: 4px; }
.g-row { display: grid; grid-template-columns: 26px minmax(140px, 34%) 1fr; gap: 10px; align-items: center; min-height: 28px; }
.g-so { width: 22px; height: 22px; border-radius: 50%; background: var(--bg-subtle); color: var(--text-muted); font-size: 0.7rem; font-weight: 800; display: grid; place-items: center; }
.g-ten { font-size: 0.84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.g-track { position: relative; height: 22px; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), var(--border) calc(25% - 1px) 25%); border-radius: 6px; }
.g-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: #F9B88A; }
.g-len { position: absolute; top: 50%; transform: translateY(-50%); font-size: 0.72rem; font-weight: 800; color: var(--text-muted); white-space: nowrap; }
.g-row.dai .g-bar { background: var(--brand-gradient); box-shadow: 0 2px 6px rgba(228,38,46,.35); }
.g-row.dai .g-so { background: var(--brand-gradient); color: #fff; }
.g-row.dai .g-ten, .g-row.dai .g-len { color: #E4262E; font-weight: 800; }
.g-vach { position: absolute; top: -3px; bottom: -3px; width: 2px; transform: translateX(-1px); }
.g-vach.sp { background: var(--success); } .g-vach.chot { background: #E4262E; }
.g-head .g-track, .g-legend .g-track { background: none; height: 20px; }
.g-axis span { position: absolute; transform: translateX(-50%); font-size: 0.7rem; font-weight: 700; color: var(--text-faint); }
.g-axis span:first-child { transform: none; } .g-axis span:last-child { transform: translateX(-100%); }
.g-lb { position: absolute; top: 0; font-size: 0.72rem; font-weight: 800; white-space: nowrap; padding: 2px 8px; border-radius: 999px; transform: translateX(-50%); }
.g-lb.sp { color: var(--success); background: var(--success-bg); } .g-lb.chot { color: #E4262E; background: var(--primary-soft); }
.g-legend { min-height: 40px; }
.g-legend .g-lb:first-child { transform: none; }
.g-legend .g-lb.chot { transform: translateX(-100%); }
@media (max-width: 600px) { .g-row { grid-template-columns: 22px 1fr; } .g-row .g-track { grid-column: 1 / -1; } .g-head .g-ten, .g-legend .g-ten { display: none; } }

/* ===== Khối riêng cho KOC ===== */
.dsection.tom-tat { border: 2px solid var(--success); background: linear-gradient(180deg, var(--success-bg), var(--surface) 70%); }
.tt-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; }
.tom-tat h3 { margin: 0 0 10px; font-size: 1.05rem; font-weight: 800; }
.tt-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; line-height: 1.5; }
.tt-list b { color: var(--success); }
.tt-luu-y { margin: 10px 0 0; font-size: 0.74rem; color: var(--text-faint); font-style: italic; }
.hop-wrap { display: flex; flex-direction: column; gap: 8px; }
.hop { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; font-size: 0.88rem; font-weight: 600; }
.tt-cta { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.tt-link { text-align: center; font-weight: 700; font-size: 0.86rem; color: var(--primary-hover); }
.kb-copy { margin-left: auto; align-self: center; }
#kbq { border: 2px solid #F4782E; }
#kbq .dsection-title { flex-wrap: wrap; }
.kb-list { display: flex; flex-direction: column; gap: 10px; }
.kb-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); cursor: pointer; margin: 0; transition: background .15s ease, opacity .15s ease; }
.kb-row:hover { background: var(--bg-subtle); }
.kb-chk { width: 20px !important; height: 20px !important; margin-top: 2px; accent-color: var(--success); flex: none; }
.kb-so { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-gradient); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 0.85rem; }
.kb-main { flex: 1; min-width: 0; }
.kb-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 0.95rem; }
.kb-t { flex: none; font-size: 0.76rem; font-weight: 700; color: var(--primary-hover); background: var(--primary-soft); padding: 2px 8px; border-radius: 6px; }
.kb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kb-quay, .kb-noi { border-radius: 12px; padding: 9px 11px; font-size: 0.86rem; line-height: 1.5; color: var(--text); }
.kb-quay { background: var(--info-soft); } .kb-noi { background: #FFF4EC; }
:root[data-theme="dark"] .kb-noi { background: #3a2416; }
.kb-quay i, .kb-noi i { display: block; font-style: normal; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; color: var(--text-muted); }
.kb-row.xong { opacity: .55; background: var(--success-bg); }
.kb-row.xong .kb-head b { text-decoration: line-through; }
.cb-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cb-row { display: grid; grid-template-columns: 20px auto 1fr; gap: 8px; align-items: start; padding: 9px 12px; border: 1px solid var(--border); border-radius: 12px; font-size: 0.86rem; margin: 0; cursor: pointer; }
.cb-row input { width: 18px !important; height: 18px !important; accent-color: var(--success); margin-top: 1px; }
.cb-row b { white-space: nowrap; } .cb-row span { color: var(--text-muted); }
.cb-row:has(input:checked) { background: var(--success-bg); }
details.chi-tiet { border: 1px dashed var(--border); border-radius: 18px; background: var(--surface); }
details.chi-tiet > summary { cursor: pointer; list-style: none; padding: 16px 18px; font-weight: 800; font-size: 1rem; }
details.chi-tiet > summary::-webkit-details-marker { display: none; }
details.chi-tiet > summary span { display: block; font-weight: 500; font-size: 0.78rem; color: var(--text-faint); margin-top: 3px; }
details.chi-tiet[open] > summary { border-bottom: 1px dashed var(--border); }
.chi-tiet-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) { .tt-grid, .kb-cols, .cb-list { grid-template-columns: 1fr; } }

/* Bước tiếp theo: viết kịch bản cho sản phẩm của KOC */
.dsection.viet-tiep { border: 2px solid #E4262E; background: linear-gradient(180deg, var(--primary-soft), var(--surface) 60%); }
.viet-tiep h3 { font-size: 1.15rem !important; }
.viet-tiep h3 u { text-decoration-color: #F4782E; text-decoration-thickness: 3px; text-underline-offset: 3px; }
.viet-tiep .dsection-title p { color: var(--text-muted); font-size: 0.84rem; line-height: 1.5; }
.vt-form { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.vt-lb { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 700; color: var(--text); margin: 0; }
.vt-lb input[type=text] { background: var(--surface); }
.vt-lb b { color: #E4262E; font-size: 1.05rem; }
#vtNghia { font-weight: 500; color: var(--text-muted); }
#vtRange { width: 100%; accent-color: #E4262E; height: auto; padding: 0; border: 0; background: none; box-shadow: none; }
.vt-thang { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-faint); font-weight: 700; margin-top: -6px; }
button.vt-btn { height: 48px !important; font-size: 1rem; }
.vt-note { margin: 0; font-size: 0.76rem; color: var(--text-faint); }
.tt-link.nhe { font-weight: 600; color: var(--text-muted); }

/* Phân tích chi tiết = khung xem trước gợi tò mò */
.dsection.ct-preview { border: 2px dashed #F4782E; background: linear-gradient(180deg, #FFF7F1, var(--surface) 70%); }
:root[data-theme="dark"] .dsection.ct-preview { background: linear-gradient(180deg, #2f1d12, var(--surface) 70%); }
.ct-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
button.ct-o { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto 1fr auto; column-gap: 10px; row-gap: 3px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 3px 0 0 var(--btn-depth-soft); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
button.ct-o:hover { transform: translateY(-2px); border-color: #F4782E; box-shadow: 0 10px 22px -12px rgba(244,120,46,.6); }
.ct-ic { grid-row: 1 / span 3; width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); display: grid; place-items: center; font-size: 1rem; }
.ct-t { font-weight: 800; font-size: 0.9rem; color: var(--text); }
.ct-v { font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; }
.ct-go { font-size: 0.76rem; font-weight: 800; color: var(--primary-hover); }
button.ct-all { margin-top: 12px; height: 44px !important; }
.ct-body { display: flex; flex-direction: column; gap: 16px; }
.ct-body[hidden] { display: none; }
.nhay > .dsection, .dsection.nhay { animation: nhay 1.5s ease; }
@keyframes nhay { 0%, 100% { box-shadow: 0 3px 0 0 var(--btn-depth-soft); } 25%, 60% { box-shadow: 0 0 0 4px rgba(244,120,46,.55); } }
@media (max-width: 900px) { .ct-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .ct-grid { grid-template-columns: 1fr; } }
@media (min-width: 901px) { .ct-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
