:root {
  --hb-bg: #f2f1f5;
  --hb-surface: #ffffff;
  --hb-text: #2b2838;
  --hb-muted: #6b6780;
  --hb-faint: #8a869a;
  --hb-line: #e4e2ea;
  --hb-purple: #4b4361;
  --hb-purple-deep: #0e0e23;
  --hb-purple-soft: #f3f1f8;
  --hb-green: #9dad32;
  --hb-green-light: #cdd64b;
  --hb-green-dark: #6f7c1f;
  --hb-green-soft: #f6f7ec;
  --hb-amber: #b7791f;
  --hb-amber-soft: #fdf6e7;
  --hb-radius: 10px;
  --hb-top-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--hb-top-h) + 20px); }
body {
  margin: 0;
  background: var(--hb-bg);
  color: var(--hb-text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--hb-purple); text-underline-offset: 2px; }
a:hover { color: var(--hb-green-dark); }
img { max-width: 100%; height: auto; }

.hb-top {
  position: sticky; top: 0; z-index: 50;
  height: var(--hb-top-h);
  background: var(--hb-purple-deep);
  background-image: linear-gradient(120deg, #4b4361 0%, #0e0e23 75%);
  color: #fff;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
}
.hb-top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px;
  background: linear-gradient(90deg, var(--hb-green), var(--hb-green-light));
}
.hb-brand { display: flex; align-items: baseline; gap: 12px; color: #fff; text-decoration: none; white-space: nowrap; }
.hb-brand:hover { color: #fff; }
.hb-brand__name { font-size: 22px; font-weight: 800; letter-spacing: 6px; line-height: 1; }
.hb-brand__sub { font-size: 13px; color: var(--hb-green-light); letter-spacing: 1px; }
.hb-menu-btn {
  display: none; background: none; border: 1px solid rgba(255,255,255,.25); color: #fff;
  border-radius: 8px; width: 40px; height: 38px; cursor: pointer; font-size: 18px;
}
.hb-search { position: relative; margin-left: auto; width: min(420px, 45vw); }
.hb-search input {
  width: 100%; height: 40px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.1); color: #fff; padding: 0 14px 0 38px; font: inherit; font-size: 14px;
}
.hb-search input::placeholder { color: rgba(255,255,255,.6); }
.hb-search input:focus { outline: 2px solid var(--hb-green-light); outline-offset: 1px; background: rgba(255,255,255,.16); }
.hb-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; opacity: .7; pointer-events: none; }
.hb-results {
  position: absolute; top: 46px; left: 0; right: 0; background: #fff; color: var(--hb-text);
  border-radius: var(--hb-radius); box-shadow: 0 18px 50px rgba(14,14,35,.25); overflow: hidden;
  max-height: 70vh; overflow-y: auto; display: none;
}
.hb-results.is-open { display: block; }
.hb-results a { display: block; padding: 10px 14px; text-decoration: none; color: var(--hb-text); border-top: 1px solid var(--hb-line); }
.hb-results a:first-child { border-top: 0; }
.hb-results a:hover, .hb-results a.is-active { background: var(--hb-purple-soft); }
.hb-results__title { font-weight: 600; font-size: 14px; }
.hb-results__meta { font-size: 12px; color: var(--hb-faint); }
.hb-results__empty { padding: 14px; font-size: 14px; color: var(--hb-muted); }
.hb-top__site { color: rgba(255,255,255,.8); font-size: 13px; text-decoration: none; white-space: nowrap; }
.hb-top__site:hover { color: #fff; }

.hb-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  max-width: 1360px; margin: 0 auto; padding: 32px 20px 64px; gap: 32px;
}
@media (min-width: 1240px) { .hb-layout { grid-template-columns: 270px minmax(0, 1fr) 220px; } }

.hb-side { position: sticky; top: calc(var(--hb-top-h) + 32px); align-self: start; max-height: calc(100vh - var(--hb-top-h) - 96px); overflow-y: auto; font-size: 14px; padding-right: 4px; }
.hb-side__home { display: block; font-weight: 600; color: var(--hb-text); text-decoration: none; padding: 6px 10px; border-radius: 8px; margin-bottom: 10px; }
.hb-side__home:hover, .hb-side__home.is-current { background: var(--hb-surface); color: var(--hb-purple); }
.hb-side__chapter { margin-bottom: 14px; }
.hb-side__head { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--hb-green-dark); padding: 6px 10px 4px; }
.hb-side__head--soon { color: var(--hb-faint); }
.hb-side ul { list-style: none; margin: 0; padding: 0; }
.hb-side li a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--hb-text); text-decoration: none; border-left: 3px solid transparent; }
.hb-side li a:hover { background: var(--hb-surface); }
.hb-side li a.is-current { background: var(--hb-surface); color: var(--hb-purple); font-weight: 600; border-left-color: var(--hb-green); }
.hb-side__soon { display: block; padding: 4px 10px; color: var(--hb-faint); font-size: 13px; }

.hb-main { min-width: 0; }
.hb-card { background: var(--hb-surface); border-radius: 14px; padding: 40px 44px; box-shadow: 0 1px 2px rgba(14,14,35,.04); }
.hb-crumbs { font-size: 13px; color: var(--hb-faint); margin-bottom: 18px; }
.hb-crumbs a { color: var(--hb-faint); text-decoration: none; }
.hb-crumbs a:hover { color: var(--hb-purple); }
.hb-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--hb-green-dark); margin: 0 0 6px; }
.hb-main h1 { font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 14px; color: var(--hb-text); }
.hb-lead { font-size: 18px; color: var(--hb-muted); margin: 0 0 24px; max-width: 46rem; }
.hb-main h2 { font-size: 23px; line-height: 1.25; margin: 44px 0 12px; padding-top: 8px; color: var(--hb-text); letter-spacing: -0.01em; }
.hb-main h3 { font-size: 17px; margin: 28px 0 8px; color: var(--hb-purple); }
.hb-main p, .hb-main li { max-width: 46rem; }
.hb-main h2 .hb-anchor, .hb-main h3 .hb-anchor { opacity: 0; margin-left: 8px; color: var(--hb-faint); text-decoration: none; font-weight: 400; }
.hb-main h2:hover .hb-anchor, .hb-main h3:hover .hb-anchor { opacity: 1; }

.hb-roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.hb-role { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--hb-purple-soft); color: var(--hb-purple); }
.hb-role--ma { background: var(--hb-green-soft); color: var(--hb-green-dark); }
.hb-role--vg { background: #eef2fb; color: #3b5b9a; }
.hb-role--hr { background: var(--hb-purple-soft); color: var(--hb-purple); }

.hb-path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .92em; white-space: normal; }
.hb-path span { background: var(--hb-purple-soft); color: var(--hb-purple); border: 1px solid #ddd8ea; border-radius: 5px; padding: 0 7px; font-weight: 600; }
.hb-path span + span { position: relative; margin-left: 18px; }
.hb-path span + span::before { content: "→"; position: absolute; left: -16px; color: var(--hb-faint); font-weight: 400; }
.hb-ui { font-weight: 600; color: var(--hb-text); background: #f4f3f7; border-radius: 4px; padding: 0 5px; }
kbd { font-family: inherit; font-size: .85em; border: 1px solid #cfcbdb; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: #fff; }

.hb-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--hb-line); border-radius: 8px; overflow: hidden; font-size: 15px; margin: 14px 0 20px; }
.hb-table th { background: var(--hb-purple); color: #fff; text-align: left; padding: 10px 14px; font-weight: 600; }
.hb-table td { padding: 10px 14px; border-top: 1px solid var(--hb-line); vertical-align: top; }
.hb-table tr:nth-child(even) td { background: #fafafc; }
.hb-table-wrap { overflow-x: auto; }

.hb-steps { list-style: none; counter-reset: step; padding: 0; margin: 12px 0 22px; }
.hb-steps > li { counter-increment: step; position: relative; padding: 2px 0 10px 40px; }
.hb-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--hb-green); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center;
}
.hb-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 30px; bottom: 2px; width: 2px; background: #e6e9cf; }

.hb-list { list-style: none; padding: 0; margin: 10px 0 18px; }
.hb-list > li { position: relative; padding: 0 0 8px 22px; }
.hb-list > li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 9px; height: 9px; background: var(--hb-green); border-radius: 2px; }

.hb-box { border-radius: 8px; padding: 16px 20px; margin: 18px 0 22px; border-left: 4px solid; }
.hb-box > :first-child { margin-top: 0; }
.hb-box > :last-child { margin-bottom: 0; }
.hb-box__title { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin: 0 0 6px; }
.hb-box--note { background: var(--hb-purple-soft); border-color: var(--hb-purple); }
.hb-box--note .hb-box__title { color: var(--hb-purple); }
.hb-box--tip { background: var(--hb-green-soft); border-color: var(--hb-green); }
.hb-box--tip .hb-box__title { color: var(--hb-green-dark); }
.hb-box--warn { background: var(--hb-amber-soft); border-color: var(--hb-amber); }
.hb-box--warn .hb-box__title { color: var(--hb-amber); }

.hb-check { list-style: none; padding: 0; margin: 6px 0 0; }
.hb-check li { padding-left: 28px; position: relative; margin-bottom: 4px; }
.hb-check li::before { content: ""; position: absolute; left: 0; top: .3em; width: 16px; height: 16px; border: 2px solid var(--hb-green); border-radius: 4px; background: #fff; }

.hb-ribbon { border: 1px solid #d9d7e0; border-radius: 8px; overflow: hidden; font-size: 13px; margin: 14px 0 6px; max-width: 46rem; }
.hb-ribbon__tabs { display: flex; background: #edecf1; overflow-x: auto; }
.hb-ribbon__tab { padding: 8px 14px; color: var(--hb-faint); white-space: nowrap; }
.hb-ribbon__tab.is-active { background: #fff; color: var(--hb-text); font-weight: 700; border-bottom: 3px solid var(--hb-green); }
.hb-ribbon__body { background: #fff; padding: 12px 12px 6px; }
.hb-ribbon__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.hb-ribbon__btn { width: 96px; text-align: center; padding: 8px 6px; border-radius: 6px; line-height: 1.25; color: var(--hb-text); }
.hb-ribbon__btn.is-hl { background: var(--hb-green-soft); outline: 1px solid var(--hb-green-light); font-weight: 600; }
.hb-ribbon__ico { height: 32px; margin-bottom: 4px; display: flex; align-items: center; justify-content: center; }
.hb-ribbon__ico img { width: 32px; height: 32px; display: block; border: 0; border-radius: 0; }
.hb-ribbon__ico img.is-small { width: 16px; height: 16px; }
.hb-ribbon__group { color: var(--hb-faint); border-top: 1px solid #edecf1; margin-top: 8px; padding: 5px 4px 0; }
.hb-caption { font-size: 13px; color: var(--hb-faint); margin: 4px 0 18px; }
.hb-status { background: #2f3540; color: #fff; border-radius: 6px; padding: 8px 14px; font-size: 14px; max-width: 46rem; margin: 10px 0 4px; }
.hb-status em { color: #8c93a0; font-style: normal; }

.hb-figure { margin: 18px 0 22px; }
.hb-figure img { border-radius: 8px; border: 1px solid var(--hb-line); display: block; }
.hb-figure figcaption { font-size: 13px; color: var(--hb-faint); margin-top: 6px; }

.hb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 18px 0 8px; }
.hb-tile { display: block; background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: 12px; padding: 18px 18px 16px; text-decoration: none; color: var(--hb-text); transition: border-color .15s, box-shadow .15s, transform .15s; }
a.hb-tile:hover { border-color: var(--hb-green); box-shadow: 0 8px 24px rgba(75,67,97,.12); transform: translateY(-1px); color: var(--hb-text); }
.hb-tile__ico { height: 32px; margin-bottom: 10px; }
.hb-tile__ico img { width: 32px; height: 32px; display: block; filter: grayscale(1) brightness(0.72) contrast(0.9); }
.hb-tile__title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.hb-tile__text { font-size: 14px; color: var(--hb-muted); line-height: 1.5; }
.hb-tile--soon { opacity: .6; }
.hb-tile__badge { display: inline-block; margin-top: 10px; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--hb-faint); }
.hb-tile__badge--live { color: var(--hb-green-dark); }

.hb-quick { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.hb-quick a { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; border-radius: 8px; background: var(--hb-surface); border: 1px solid var(--hb-line); text-decoration: none; color: var(--hb-text); }
.hb-quick a::before { content: "→"; color: var(--hb-green); font-weight: 700; }
.hb-quick a:hover { border-color: var(--hb-green); }

.hb-hero { background: var(--hb-purple-deep); background-image: linear-gradient(135deg, #4b4361 0%, #0e0e23 100%); color: #fff; border-radius: 14px; padding: 40px 44px; margin-bottom: 22px; }
.hb-hero h1 { color: #fff; }
.hb-hero .hb-eyebrow { color: var(--hb-green-light); }
.hb-hero .hb-lead { color: #d9d6e4; }

.hb-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--hb-line); }
.hb-pager a { display: block; max-width: 48%; padding: 12px 16px; border: 1px solid var(--hb-line); border-radius: 10px; text-decoration: none; color: var(--hb-text); }
.hb-pager a:hover { border-color: var(--hb-green); }
.hb-pager small { display: block; color: var(--hb-faint); font-size: 12px; }
.hb-pager__next { margin-left: auto; text-align: right; }
.hb-meta { margin-top: 18px; font-size: 13px; color: var(--hb-faint); }

.hb-toc { position: sticky; top: calc(var(--hb-top-h) + 32px); align-self: start; font-size: 13px; display: none; }
@media (min-width: 1240px) { .hb-toc { display: block; } }
.hb-toc__title { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--hb-faint); margin: 6px 0 8px; }
.hb-toc a { display: block; color: var(--hb-muted); text-decoration: none; padding: 4px 0 4px 12px; border-left: 2px solid var(--hb-line); }
.hb-toc a:hover { color: var(--hb-purple); }
.hb-toc a.is-active { color: var(--hb-purple); border-left-color: var(--hb-green); font-weight: 600; }

.hb-backdrop { display: none; }
@media (max-width: 960px) {
  .hb-layout { grid-template-columns: minmax(0, 1fr); padding: 20px 16px 48px; }
  .hb-menu-btn { display: inline-grid; place-items: center; }
  .hb-side {
    position: fixed; top: 0; left: 0; bottom: 0; width: 290px; max-height: none;
    background: var(--hb-bg); padding: calc(var(--hb-top-h) + 22px) 12px 18px; z-index: 45; transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 8px 0 30px rgba(14,14,35,.2);
  }
  body.hb-nav-open .hb-side { transform: none; }
  body.hb-nav-open .hb-backdrop { display: block; position: fixed; inset: 0; background: rgba(14,14,35,.35); z-index: 30; }
  .hb-card, .hb-hero { padding: 26px 20px; }
  .hb-main h1 { font-size: 27px; }
  .hb-top__site { display: none; }
}
@media (max-width: 600px) {
  .hb-top { gap: 10px; padding: 0 12px; }
  .hb-brand__sub { display: none; }
  .hb-brand__name { font-size: 18px; letter-spacing: 4px; }
  .hb-search { width: auto; flex: 1; }
  .hb-results { position: fixed; top: calc(var(--hb-top-h) + 6px); left: 8px; right: 8px; }
  .hb-pager { flex-direction: column; }
  .hb-pager a { max-width: none; }
}

@media print {
  .hb-top, .hb-side, .hb-toc, .hb-pager, .hf, .cookie-consent { display: none !important; }
  .hb-layout { display: block; padding: 0; }
  .hb-card { box-shadow: none; padding: 0; }
  body { background: #fff; }
}
.hb-card > :first-child { margin-top: 0; padding-top: 0; }
.hb-entity { font-size: 13px; color: var(--hb-muted); border-left: 3px solid var(--hb-green); padding: 4px 0 4px 12px; margin: 0 0 18px; max-width: 46rem; }
.hb-intro { font-size: 16px; color: var(--hb-text); background: var(--hb-purple-soft); border-radius: 8px; padding: 14px 18px; margin: 0 0 8px; max-width: 46rem; }
