.hb-top h1 { margin-top: 10px; }
.hb-search { margin-top: 22px; display: grid; gap: 12px; max-width: 760px; }
.hb-field { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 54px; border: 1px solid #d4b47b55; border-radius: 4px; background: #121a15; }
.hb-field:focus-within { border-color: var(--gold); }
.hb-field svg { color: var(--gold); width: 20px; height: 20px; }
.hb-field input { flex: 1; min-width: 0; height: 52px; border: 0; outline: none; background: none; font-size: 17px; }
.hb-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hb-chips { display: flex; gap: 6px; }
.hb-chip input { position: absolute; opacity: 0; pointer-events: none; }
.hb-chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 20px; font-size: 13px; color: var(--muted); cursor: pointer; }
.hb-chip input:checked + span { color: #182017; background: var(--gold); border-color: var(--gold); }
.hb-chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.hb-filters select { min-height: 40px; border: 1px solid var(--line); background: #121a15; }
.hb-search[data-filter="item"] select { display: none; }

.hb-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 32px; align-items: start; padding: 26px 0 40px; }
.hb-body:has(> .hb-detail[hidden]) { grid-template-columns: minmax(0, 1fr); }
.hb-list { min-width: 0; }
.hb-status, .hb-count { color: var(--muted); font-size: 13px; padding: 6px 0 12px; }
.hb-rows { display: grid; border-top: 1px solid var(--line); }
.hb-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); min-height: 48px; }
.hb-row:hover { background: #1b261f; }
.hb-row-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.hb-name { font-weight: 600; }
.hb-row small, .hb-card h2 small, .hb-ref small { color: var(--muted); font-size: 12px; font-weight: 400; }
.hb-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.hb-more { margin-top: 16px; }
.hb-saved { margin-bottom: 28px; }
.hb-saved h2 { font-size: 22px; margin-bottom: 10px; }
.hb-saved-head { display: flex; justify-content: space-between; align-items: baseline; }
.hb-text-button { border: 0; color: var(--gold); font-size: 12px; min-height: 40px; padding: 0 4px; }
.hb-browse { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hb-browse a { padding: 12px 14px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); font-size: 14px; }
.hb-browse a:hover { border-color: var(--gold); color: var(--gold); }
.hb-error { padding: 18px; border: 1px solid #d4b47b55; border-radius: 4px; background: #d4b47b0a; }
.hb-error p { margin-bottom: 12px; }

.hb-detail { position: sticky; top: 100px; max-height: calc(100vh - 116px); overflow-y: auto; overscroll-behavior: contain; }
.hb-detail-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.hb-back, .hb-fav { border: 1px solid var(--line); border-radius: 3px; min-height: 40px; padding: 0 14px; font-size: 13px; color: var(--muted); }
.hb-back:hover, .hb-fav:hover, .hb-fav.is-on { color: var(--gold); border-color: #d4b47b66; }
.hb-card { padding: 18px 18px 14px; border: 1px solid #d4b47b40; border-radius: 6px; background: linear-gradient(160deg, #0d1420, #101713); box-shadow: 0 10px 40px #0006; }
.hb-card h2 { font-family: var(--sans); font-size: 19px; line-height: 1.35; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.hb-line { font-size: 14px; line-height: 1.55; color: #e9e9e2; }
.hb-card .hb-line + .hb-line { margin-top: 0; }
.hb-page .hb-card h2, .hb-page .hb-card h2 small { font-family: var(--sans); }
.hb-split { display: flex; justify-content: space-between; gap: 16px; }
.hb-stat { color: #f0f0e8; }
.hb-effect { color: #6fd36a; }
.hb-card .hb-line + .hb-effect, .hb-card .hb-line + .hb-set, .hb-card .hb-line + .hb-desc { margin-top: 4px; }
.hb-set, .hb-desc { color: #ffd100; }
.hb-dim { color: var(--muted); font-size: 13px; }
.hb-note { margin-top: 10px; font-size: 12px; color: var(--muted); border-left: 2px solid #d4b47b66; padding-left: 10px; }
.hb-compare, .hb-source { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.hb-compare { display: grid; gap: 2px; }
.hb-compare strong { font-weight: 600; color: var(--text); }
.hb-compare .hb-cmp-new { color: #6fd36a; }
.hb-compare .hb-cmp-changed { color: var(--gold); }
.hb-source { margin-top: 6px; padding-top: 0; border: 0; }
.hb-sub { font-size: 12px; letter-spacing: .4px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.hb-skills { display: grid; gap: 6px; margin: 4px 0 6px; }
.hb-skill { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; }
.hb-skill span { padding: 2px 8px; border-radius: 10px; background: #ffffff0d; }
.hb-sk-orange { color: #ff8040; }
.hb-sk-yellow { color: #ffff00; }
.hb-sk-grey { color: #9d9d9d; }
.hb-related { margin-top: 18px; }
.hb-related h3 { font-size: 13px; letter-spacing: .4px; color: var(--gold); margin-bottom: 6px; font-weight: 600; }
.hb-ref-list { list-style: none; margin: 0; padding: 0; display: grid; }
.hb-ref-list li + li { border-top: 1px solid var(--line); }
.hb-ref { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 9px 2px; min-height: 42px; }
.hb-ref:hover .hb-name { text-decoration: underline; }
.hb-ref .hb-meta { margin-left: auto; }
.hb-qty { color: var(--muted); font-weight: 500; min-width: 2.4em; }
.hb-acq { margin: 0; padding-left: 18px; font-size: 13px; }
.hb-acq a { color: var(--gold); }
.hb-coin-g { color: #ffd100; } .hb-coin-s { color: #c7c7cf; } .hb-coin-c { color: #c8834f; }
.hb-q0 { color: #9d9d9d; } .hb-q1 { color: #ffffff; } .hb-q2 { color: #1eff00; } .hb-q3 { color: #0070dd; } .hb-q4 { color: #a335ee; } .hb-q5 { color: #ff8000; } .hb-q6, .hb-q7 { color: #e6cc80; }
.hb-card .hb-q3, .hb-row .hb-q3, .hb-ref .hb-q3 { color: #3d9bff; }

.hb-notes { padding: 24px 0 56px; border-top: 1px solid var(--line); }
.hb-notes h2 { font-size: 22px; margin-bottom: 10px; }
.hb-notes ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.hb-notes li + li { margin-top: 6px; }
.hb-notes p { color: var(--muted); font-size: 13px; margin-top: 12px; }
.hb-notes .source-link { margin-top: 0; }

@media (max-width: 899px) {
  .hb-body { grid-template-columns: minmax(0, 1fr); padding-top: 18px; }
  /* Full screen below the sticky site header, so language, menu and site search stay reachable. */
  .hb-detail { position: fixed; inset: 84px 0 0; z-index: 15; max-height: none; padding: 12px 16px 32px; background: var(--bg); overflow-y: auto; }
  html.hb-open, html.hb-open body { overflow: hidden; }
  .hb-field input { font-size: 16px; }
  .hb-filters select { flex: 1 1 140px; }
  .hb-row { flex-wrap: wrap; }
  .hb-meta { white-space: normal; }
}
@media (max-width: 700px) {
  .hb-detail { top: 72px; }
}
