/* =========================================================================
   HB Ascension Planner  (page-ascension-planner.php)
   Dark + gold, khớp palette site. Scope toàn bộ trong #hb-planner & .hbp-modal.
   ========================================================================= */

/* Tokens + base text/font: áp cho cả #hb-planner VÀ .hbp-modal
   (modal nằm ngoài #hb-planner trong DOM nên phải khai báo riêng,
   nếu không sẽ mất biến -> nền trong suốt, chữ tối = "không thấy gì"). */
#hb-planner,
.hbp-modal{
  --hbp-bg:        #161922;
  --hbp-card:      #1f2330;
  --hbp-card-2:    #262b3a;
  --hbp-line:      #313748;
  --hbp-line-soft: #2a3040;
  --hbp-text:      #e9eefc;
  --hbp-muted:     #9aa3b8;
  --hbp-gold:      #f3c258;
  --hbp-gold-2:    #e3a93b;
  --hbp-danger:    #f47174;
  --hbp-radius:    14px;
  --hbp-thumb:     58px;

  color: var(--hbp-text);
  font-family: "Be Vietnam Pro","Open Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
#hb-planner{
  max-width: 1180px;
  margin: 0 auto 48px;
  -webkit-font-smoothing: antialiased;
}
#hb-planner *,
.hbp-modal *{ box-sizing: border-box; }

/* Theme (Flatsome) có rule toàn cục `img{height:auto!important;max-width:100%}`
   làm sập ảnh trong planner. Ghi đè lại cho RIÊNG ảnh của planner. */
#hb-planner img,
.hbp-modal img{ max-width: none; }
.hbp-entry__avatar img,
.hbp-pick__thumb img,
.hbp-chip__thumb img{ width: 100% !important; height: 100% !important; object-fit: cover; display: block; }
.hbp-tag img{ width: 15px !important; height: 15px !important; object-fit: contain; }

/* ---------- Page head ---------- */
.hbp-pagehead{ margin: 6px 0 22px; }
.hbp-pagetitle{
  font-size: clamp(26px,3.4vw,38px);
  line-height: 1.1; font-weight: 800; margin: 0 0 8px;
  background: linear-gradient(92deg,#fff 0%,var(--hbp-gold) 120%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hbp-pagesub{ margin: 0; color: var(--hbp-muted); font-size: 15px; max-width: 720px; }

/* ---------- Toolbar ---------- */
.hbp-toolbar{ display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.hbp-btn{
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1;
  padding: 11px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--hbp-line);
  background: var(--hbp-card-2); color: var(--hbp-text);
  transition: transform .12s ease, background .15s, border-color .15s, box-shadow .15s, color .15s, opacity .15s;
}
.hbp-btn:hover{ border-color: #404862; background: #2c3242; transform: translateY(-1px); }
.hbp-btn:active{ transform: translateY(0); }
.hbp-btn--primary{
  background: linear-gradient(180deg,var(--hbp-gold) 0%,var(--hbp-gold-2) 100%);
  border-color: var(--hbp-gold-2); color: #2a1f06; font-weight: 700;
  box-shadow: 0 6px 18px -8px rgba(243,194,88,.55);
}
.hbp-btn--primary:hover{ filter: brightness(1.05); border-color: var(--hbp-gold); }
.hbp-btn--ghost{ background: transparent; color: var(--hbp-muted); }
.hbp-btn--ghost:hover{ background: rgba(244,113,116,.10); border-color: rgba(244,113,116,.5); color: #ffb3b4; }
.hbp-btn__plus{ font-size: 18px; line-height: 0; font-weight: 700; margin-top: -1px; }
.hbp-btn.is-active{ background: var(--hbp-gold); color: #2a1f06; border-color: var(--hbp-gold-2); }

/* ---------- Section (Total) ---------- */
.hbp-total{
  background: var(--hbp-card);
  border: 1px solid var(--hbp-line);
  border-radius: var(--hbp-radius);
  margin-bottom: 26px; overflow: hidden;
}
.hbp-section__head{
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg,#242a39 0%,#1f2330 100%);
  border: 0; border-bottom: 1px solid var(--hbp-line);
  padding: 16px 18px; cursor: pointer; color: var(--hbp-text); text-align: left;
}
.hbp-section__title{ margin: 0; font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.hbp-section__title::after{ content: attr(data-count); }
.hbp-caret{ color: var(--hbp-gold); font-size: 13px; transition: transform .2s ease; }
.hbp-total.is-collapsed .hbp-caret{ transform: rotate(-90deg); }
.hbp-section__body{ padding: 18px; }
.hbp-total.is-collapsed .hbp-section__body{ display: none; }

/* empty state */
.hbp-empty{ margin: 4px 2px; color: var(--hbp-muted); font-size: 14.5px; }
.hbp-empty strong{ color: var(--hbp-text); }
.hbp-total:not([data-empty]) [data-role="total-empty"]{ display: none; }
.hbp-total[data-empty] [data-role="total-grid"]{ display: none; }

/* ---------- Material chip grid ---------- */
.hbp-mat-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px,1fr));
  gap: 12px;
}
.hbp-chip{ position: relative; text-align: center; }
.hbp-chip__thumb{
  position: relative; display: block;
  width: 100%; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden;
  background: #4b5563; border: 1px solid #2f3447;
}
/* icon nằm trên khung gradient, chừa lề để thấy nền theo sao (giống /nguyen-lieu) */
.hbp-chip__thumb img{ position: absolute; inset: 0; width: 100% !important; height: 100% !important; object-fit: contain !important; padding: 12%; box-sizing: border-box; }
.hbp-chip__qty{
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 2px 4px;
  background-image: linear-gradient(to top,rgba(0,0,0,.85),rgba(0,0,0,0));
  font-size: 12.5px; font-weight: 800; color: #fff; letter-spacing: .2px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.hbp-chip__name{
  display: block; margin-top: 5px; font-size: 10.5px; line-height: 1.25;
  color: var(--hbp-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* rarity backgrounds: khung theo sao bằng hình ảnh (giống /nguyen-lieu);
   màu đặc đứng sau làm fallback nếu ảnh khung lỗi */
.hbp-r1 .hbp-chip__thumb{ background: #2a2e3a url("/wp-content/uploads/1-sao-bg.webp") center/100% 100% no-repeat; border-color: #6b6b6b; }
.hbp-r2 .hbp-chip__thumb{ background: #20342a url("/wp-content/uploads/2-sao-bg.webp") center/100% 100% no-repeat; border-color: #5db365; }
.hbp-r3 .hbp-chip__thumb{ background: #1b2740 url("/wp-content/uploads/3-sao-bg.webp") center/100% 100% no-repeat; border-color: #4a90d9; }
.hbp-r4 .hbp-chip__thumb{ background: #2c1f40 url("/wp-content/uploads/4-star-bg.png") center/100% 100% no-repeat; border-color: #b06fd9; }
.hbp-r5 .hbp-chip__thumb{ background: #3a2410 url("/wp-content/uploads/5-star-bg.webp") center/100% 100% no-repeat; border-color: #e7b04b; }
/* credits: nền vàng + ảnh xu thật (fill qua .hbp-chip__thumb img) */
.hbp-chip--credits .hbp-chip__thumb{
  background: radial-gradient(circle at 35% 30%,#ffe08a 0%,#f3c258 45%,#c98f2a 100%);
}
.hbp-chip--credits .hbp-chip__thumb img{ padding: 6%; object-fit: contain; }
/* fallback: vẽ xu bằng CSS khi thiếu ảnh */
.hbp-chip--credits-css .hbp-chip__thumb{
  display: flex; align-items: center; justify-content: center;
}
.hbp-chip--credits-css .hbp-chip__thumb::before{
  content: ""; width: 64%; height: 64%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#fff3cf 0%,#f0bd55 60%,#d49a36 100%);
  box-shadow: inset 0 0 0 2px rgba(120,80,10,.45), inset 0 2px 4px rgba(255,255,255,.5);
}
.hbp-chip--credits-css .hbp-chip__thumb::after{
  content: "C"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; color: #7a531a; text-shadow: 0 1px 0 rgba(255,255,255,.45);
}

/* ---------- Entries ---------- */
.hbp-entries{ display: flex; flex-direction: column; gap: 16px; }

.hbp-entry{
  background: var(--hbp-card);
  border: 1px solid var(--hbp-line);
  border-radius: var(--hbp-radius);
  overflow: hidden;
  transition: opacity .15s, border-color .15s;
}
.hbp-entry.is-hidden{ opacity: .5; }
.hbp-entry.is-hidden .hbp-entry__body{ display: none; }

.hbp-entry__head{
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg,#242a39 0%,#1f2330 100%);
  border-bottom: 1px solid var(--hbp-line-soft);
}
.hbp-entry.is-hidden .hbp-entry__head{ border-bottom-color: transparent; }

.hbp-entry__avatar{
  flex: 0 0 auto; width: 58px; height: 58px; border-radius: 12px; overflow: hidden;
  position: relative; background: #2a3040; box-shadow: inset 0 0 0 2px rgba(255,255,255,.06);
}
.hbp-entry__avatar img{ width: 100%; height: 100%; object-fit: cover; }
.hbp-entry__avatar.is-5{ box-shadow: inset 0 0 0 2px var(--hbp-gold); }
.hbp-entry__avatar.is-4{ box-shadow: inset 0 0 0 2px #b083e6; }

.hbp-entry__meta{ flex: 1 1 auto; min-width: 0; }
.hbp-entry__name{
  margin: 0 0 6px; font-size: 17px; font-weight: 700; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hbp-entry__name a{ color: inherit; text-decoration: none; }
.hbp-entry__name a:hover{ color: var(--hbp-gold); }
.hbp-tags{ display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hbp-tag{
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 4px 8px; border-radius: 999px;
  background: var(--hbp-card-2); border: 1px solid var(--hbp-line); color: var(--hbp-muted);
}
.hbp-tag img{ width: 15px; height: 15px; object-fit: contain; }
.hbp-tag--star{ color: var(--hbp-gold); border-color: rgba(243,194,88,.4); background: rgba(243,194,88,.10); }
.hbp-tag--lc{ color: #8fb6ff; border-color: rgba(143,182,255,.35); background: rgba(143,182,255,.10); }

.hbp-entry__actions{ flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }
.hbp-iconbtn{
  width: 36px; height: 36px; min-height: 0; padding: 0; flex: 0 0 auto; border-radius: 9px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--hbp-card-2); border: 1px solid var(--hbp-line); color: var(--hbp-muted);
  font-size: 16px; line-height: 1; transition: background .15s, color .15s, border-color .15s;
}
.hbp-iconbtn:hover{ background: #303749; color: var(--hbp-text); border-color: #424a63; }
.hbp-iconbtn--del:hover{ background: rgba(244,113,116,.14); color: #ffb3b4; border-color: rgba(244,113,116,.5); }
.hbp-iconbtn[disabled]{ opacity: .35; cursor: default; }
.hbp-entry.is-hidden .hbp-iconbtn--eye{ color: var(--hbp-gold); border-color: rgba(243,194,88,.4); }

/* reorder handles hidden unless planner in reorder mode */
.hbp-iconbtn--move{ display: none; }
.hb-planner.is-reorder .hbp-iconbtn--move{ display: inline-flex; }
.hb-planner.is-reorder .hbp-entry{ border-color: #45506e; }

/* ---------- Entry body ---------- */
.hbp-entry__body{ padding: 16px; }
.hbp-controls{
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px 26px;
  padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px dashed var(--hbp-line-soft);
}
.hbp-ctl{ display: flex; align-items: center; gap: 9px; }
.hbp-ctl__label{ font-size: 13px; font-weight: 600; color: var(--hbp-muted); }
.hbp-select{
  font: inherit; font-size: 14px; font-weight: 600; color: var(--hbp-text);
  background: var(--hbp-card-2); border: 1px solid var(--hbp-line);
  border-radius: 9px; padding: 8px 30px 8px 11px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23f3c258' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.hbp-select:focus{ outline: none; border-color: var(--hbp-gold); }
.hbp-arrow{ color: var(--hbp-muted); font-weight: 700; }

/* toggle switch */
.hbp-switch{ display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.hbp-switch input{ position: absolute; opacity: 0; width: 0; height: 0; }
.hbp-switch__track{
  width: 40px; height: 22px; border-radius: 999px; background: var(--hbp-line);
  position: relative; transition: background .18s; flex: 0 0 auto;
}
.hbp-switch__track::after{
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #cfd6e4; transition: transform .18s, background .18s;
}
.hbp-switch input:checked + .hbp-switch__track{ background: var(--hbp-gold-2); }
.hbp-switch input:checked + .hbp-switch__track::after{ transform: translateX(18px); background: #fff6e2; }
.hbp-switch__text{ font-size: 13px; font-weight: 600; color: var(--hbp-muted); }
.hbp-switch input:checked ~ .hbp-switch__text{ color: var(--hbp-text); }

.hbp-entry__mats--empty{ color: var(--hbp-muted); font-size: 13.5px; margin: 2px; }

/* icon buttons giờ chứa <svg> -> cần ép kích thước (font-size không áp cho svg) */
.hbp-iconbtn svg{ width: 18px; height: 18px; flex: 0 0 auto; min-width: 18px; fill: currentColor; display: block; }

/* ---------- Entry body: level row ---------- */
.hbp-lvl{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.hbp-lvl__lbl{ font-size: 13px; font-weight: 600; color: var(--hbp-muted); }

/* ---------- Trace (Vết Tích) block ---------- */
.hbp-trace{
  border-top: 1px dashed var(--hbp-line-soft);
  padding-top: 16px; margin-bottom: 16px;
}
.hbp-trace__head{
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
.hbp-trace__lbl{ font-size: 14px; font-weight: 700; color: var(--hbp-text); letter-spacing: .2px; }
.hbp-trace__acts{ display: inline-flex; gap: 6px; }
.hbp-mini{
  font: inherit; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; min-height: 0;
  background: var(--hbp-card-2); border: 1px solid var(--hbp-line); color: var(--hbp-muted);
  text-transform: none; letter-spacing: normal; box-shadow: none;
  transition: background .15s, color .15s, border-color .15s;
}
.hbp-mini:hover{ background: #303749; color: var(--hbp-text); border-color: #424a63; }

/* ---------- Skills row (Đánh thường / Chiến kỹ / Tuyệt kỹ / Thiên phú …) ---------- */
.hbp-skills{ display: flex; flex-wrap: wrap; gap: 10px 12px; margin-bottom: 16px; }
.hbp-skill{
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--hbp-card-2); border: 1px solid var(--hbp-line);
  border-radius: 11px; padding: 6px 11px 6px 6px;
}
.hbp-skill__ic{
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px; overflow: hidden;
  background: #2a3040; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.hbp-skill__ic img{ width: 100%; height: 100%; object-fit: contain; }
.hbp-skill__rng{ display: inline-flex; align-items: center; gap: 6px; }
.hbp-skill__rng i{ font-style: normal; font-weight: 700; color: var(--hbp-muted); }
.hbp-lvsel{
  font: inherit; font-size: 13px; font-weight: 700; color: var(--hbp-text);
  background: var(--hbp-bg); border: 1px solid var(--hbp-line);
  border-radius: 7px; padding: 6px 22px 6px 9px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23f3c258' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 7px center;
}
.hbp-lvsel:focus{ outline: none; border-color: var(--hbp-gold); }

/* ---------- Trace tree (đồ thị node + đường nối SVG) ---------- */
.hbp-tree{ position: relative; margin: 2px 0; }
.hbp-tree__svg{ position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.hbp-edge{ stroke: var(--hbp-line); stroke-width: 2; stroke-linecap: round; transition: stroke .15s; }
.hbp-edge.is-on{ stroke: var(--hbp-gold-2); }
.hbp-node{
  position: absolute; width: 36px; height: 36px; min-height: 0; padding: 0;
  border-radius: 50%; cursor: pointer; overflow: hidden; opacity: .5;
  background: var(--hbp-card-2); border: 2px solid var(--hbp-line);
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-appearance: none; appearance: none; box-shadow: none;
  letter-spacing: normal; text-transform: none; line-height: 1;
  transition: opacity .15s, border-color .15s, box-shadow .15s, transform .12s;
}
.hbp-node img{ width: 72%; height: 72%; object-fit: contain; filter: grayscale(.45) brightness(.9); transition: filter .15s; }
.hbp-node:hover{ transform: scale(1.09); border-color: #4a5470; }
.hbp-node.is-on{
  opacity: 1; border-color: var(--hbp-gold);
  box-shadow: 0 0 0 1px rgba(243,194,88,.25), 0 4px 12px -5px rgba(243,194,88,.6);
}
.hbp-node.is-on img{ filter: none; }
/* node cộng chỉ số: bo vuông để phân biệt với node kỹ năng (tròn) */
.hbp-node--stat{ border-radius: 10px; }

/* ---------- Materials box (xếp gọn được) ---------- */
.hbp-matbox{ border-top: 1px dashed var(--hbp-line-soft); padding-top: 14px; }
.hbp-matbox__head{
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--hbp-text);
  background: transparent; border: 0; padding: 0; margin-bottom: 12px;
  cursor: pointer; letter-spacing: .2px; min-height: 0; text-transform: none; box-shadow: none;
}
.hbp-matbox__head:hover{ color: var(--hbp-gold); }
.hbp-matbox__head .hbp-caret{ transition: transform .2s ease; }
.hbp-matbox.is-collapsed .hbp-matbox__head .hbp-caret{ transform: rotate(-90deg); }
.hbp-matbox.is-collapsed .hbp-matbox__head{ margin-bottom: 0; }
.hbp-matbox.is-collapsed .hbp-matbox__body{ display: none; }

/* ---------- Modal picker ---------- */
.hbp-modal[hidden]{ display: none; }
.hbp-modal{
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.hbp-modal__backdrop{ position: absolute; inset: 0; background: rgba(6,8,14,.72); backdrop-filter: blur(3px); }
.hbp-modal__panel{
  position: relative; width: min(760px,100%); max-height: 84vh;
  display: flex; flex-direction: column;
  background: var(--hbp-card); border: 1px solid var(--hbp-line);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.7);
}
.hbp-modal__head{
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--hbp-line);
  background: linear-gradient(180deg,#242a39 0%,#1f2330 100%);
}
.hbp-modal__title{ margin: 0; font-size: 17px; font-weight: 700; }
.hbp-modal__close{
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 22px; line-height: 1;
  background: var(--hbp-card-2); border: 1px solid var(--hbp-line); color: var(--hbp-muted);
}
.hbp-modal__close:hover{ background: #303749; color: var(--hbp-text); }
.hbp-modal__search{ padding: 14px 18px 6px; }
.hbp-modal__search input{
  width: 100%; font: inherit; font-size: 15px; color: var(--hbp-text);
  background: var(--hbp-bg); border: 1px solid var(--hbp-line);
  border-radius: 10px; padding: 11px 14px;
}
.hbp-modal__search input:focus{ outline: none; border-color: var(--hbp-gold); }
.hbp-modal__search input::placeholder{ color: #6f788e; }
.hbp-modal__grid{
  padding: 14px 18px 20px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto;  /* vùng cuộn trong flex-column: cần min-height:0 */
  display: grid; grid-template-columns: repeat(auto-fill,minmax(96px,1fr)); gap: 12px;
  align-content: start;
}
.hbp-pick{
  -webkit-appearance: none; appearance: none;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 10px 6px; border-radius: 12px; cursor: pointer; text-align: center;
  background: var(--hbp-card-2); border: 1px solid var(--hbp-line);
  /* reset style nút toàn cục của Flatsome (font-size/line-height/transform...) */
  color: var(--hbp-text); font: inherit; line-height: 1.25; letter-spacing: normal;
  text-transform: none; min-height: auto; height: auto; min-width: 0; box-shadow: none;
  transition: transform .12s, border-color .15s, background .15s;
}
.hbp-pick:hover{ transform: translateY(-2px); border-color: var(--hbp-gold-2); background: #2c3242; }
.hbp-pick__thumb{
  flex: 0 0 auto;            /* .hbp-pick là flex column -> tránh co chiều cao thumb */
  width: 62px; height: 62px; min-height: 62px; border-radius: 11px; overflow: hidden; position: relative;
  background: #2a3040; box-shadow: inset 0 0 0 2px rgba(255,255,255,.06);
}
.hbp-pick__thumb.is-5{ box-shadow: inset 0 0 0 2px var(--hbp-gold); }
.hbp-pick__thumb.is-4{ box-shadow: inset 0 0 0 2px #b083e6; }
.hbp-pick__thumb img{ width: 100%; height: 100%; object-fit: cover; }
.hbp-pick__name{
  font-size: 11.5px !important; line-height: 1.3 !important; font-weight: 600;
  color: var(--hbp-text) !important; -webkit-text-fill-color: var(--hbp-text);
  max-width: 100%; word-break: break-word;
  /* clamp 2 dòng bằng block+max-height (không dùng -webkit-line-clamp:
     bug Chromium làm sập chiều cao về 0 khi tổ tiên có overflow:auto) */
  display: block; max-height: 2.6em; overflow: hidden;
}
.hbp-modal__none{ grid-column: 1/-1; text-align: center; color: var(--hbp-muted); padding: 30px 0; }

/* loading flash guard */
.hb-planner[data-loading] .hbp-entries,
.hb-planner[data-loading] .hbp-total{ opacity: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 640px){
  #hb-planner{ --hbp-thumb: 50px; }
  .hbp-entry__head{ flex-wrap: wrap; }
  .hbp-entry__actions{ order: 3; width: 100%; justify-content: flex-end; }
  .hbp-btn{ flex: 1 1 auto; justify-content: center; }
  .hbp-mat-grid{ grid-template-columns: repeat(auto-fill,minmax(62px,1fr)); gap: 9px; }
  .hbp-controls{ gap: 14px 18px; }
  /* cây vết tích có thể rộng hơn màn hình -> cho cuộn ngang riêng phần đồ thị */
  .hbp-tree{ max-width: 100%; overflow-x: auto; overflow-y: hidden; }
  .hbp-trace__head{ flex-wrap: wrap; }
}
