.hero-guide { container: hero-guide / inline-size; display: grid; gap: 12px; color: var(--text); margin: 2px 0 16px; font-size: 14px; line-height: 1.6; }
.hero-guide *, .hero-guide *::before, .hero-guide *::after { box-sizing: border-box; }
.hg-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; border: 1px solid var(--blue-border, #d4e1ff); border-radius: 14px; background: linear-gradient(115deg, var(--blue-soft, #f1f6ff), var(--panel)); }
.hg-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.hg-portrait { position: relative; display: grid; place-items: center; flex: 0 0 64px; width: 64px; height: 64px; overflow: hidden; border: 2px solid var(--blue-border, #d4e1ff); border-radius: 50%; background: var(--panel); }
.hg-portrait img, .hg-relation-portrait img, .hg-artifact-image img, .hg-set-icon img, .hg-stat-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hg-image-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); font-size: 24px; font-weight: 700; background: var(--panel-soft); }
.hg-image-fallback[hidden] { display: none; }
.hg-header-copy { min-width: 0; }
.hg-eyebrow { color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.hg-hero-name { margin: 4px 0; color: var(--text); font-size: 20px; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }
.hg-classification, .hg-context { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.hg-rates { display: flex; gap: 22px; margin: 0; }
.hg-rate { display: grid; gap: 3px; }
.hg-rate dt { color: var(--muted); font-size: 10px; }
.hg-rate dd { margin: 0; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hg-blue { color: var(--blue); }.hg-green { color: var(--green); }.hg-red { color: var(--red); }
.hg-header.hg-assessed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(124px, auto); gap: 12px 18px; padding: 18px; background: var(--panel); }
.hg-assessed .hg-eyebrow { font-size: 11px; }
.hg-assessment-result { display: grid; gap: 4px; justify-items: end; align-self: start; min-width: 0; text-align: right; }
.hg-assessment-action { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 9px; border-radius: 6px; font-size: 13px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.hg-tone-keep { color: var(--green); background: var(--green-soft); }
.hg-tone-hold { color: var(--amber); background: var(--amber-soft); }
.hg-tone-stop { color: var(--red); background: var(--red-soft); }
.hg-assessment-value { color: var(--blue); font-size: 30px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hg-assessment-label { color: var(--muted); font-size: 11px; line-height: 1.5; }
.hg-assessment-meta, .hg-assessment-reason, .hg-assessment-notices { grid-column: 1 / -1; min-width: 0; margin: 0; }
.hg-assessment-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0; list-style: none; color: var(--muted); font-size: 12px; line-height: 1.6; }
.hg-assessment-meta li { min-width: 0; overflow-wrap: anywhere; }
.hg-assessment-reason { color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.hg-assessment-notices { padding: 0; list-style: none; border-top: 1px solid var(--line); }
.hg-assessment-notice { min-width: 0; padding-top: 12px; }
.hg-assessment-notice + .hg-assessment-notice { margin-top: 12px; border-top: 1px solid var(--line); }
.hg-notice-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.hg-notice-title { color: var(--text); font-size: 14px; }
.hg-notice-caution .hg-notice-title { color: var(--amber); }
.hg-notice-danger .hg-notice-title { color: var(--red); }
.hg-notice-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; min-width: 0; margin: 0; }
.hg-notice-facts > div { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.hg-notice-facts dt { color: var(--muted); font-size: 12px; }
.hg-notice-facts dd { margin: 0; color: var(--text); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hg-notice-text { margin: 5px 0 0; color: var(--text); font-size: 14px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.hg-assessed .hg-rates { grid-column: 1 / -1; flex-wrap: wrap; gap: 5px 18px; padding-top: 10px; border-top: 1px solid var(--line); }
.hg-assessed .hg-rate { display: flex; align-items: baseline; gap: 5px; }
.hg-assessed .hg-rate dt { font-size: 12px; }
.hg-assessed .hg-rate dd { color: var(--muted); font-size: 12px; font-weight: 600; }
.hg-overview, .hg-relations-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.hg-section { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.hg-section-title { margin: 0 0 12px; color: var(--text); font-size: 14px; line-height: 1.5; }
.hg-section-caption { margin: -6px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.hg-stats { width: 100%; border-collapse: collapse; border-spacing: 0; font-size: 14px; }
.hg-stats th { padding: 0 8px 8px; color: var(--muted); font-size: 10px; font-weight: 400; text-align: left; border-bottom: 1px solid var(--line); }
.hg-stats th:last-child { text-align: right; }
.hg-stats td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.hg-stats tr:last-child td { border-bottom: 0; }
.hg-stat-label { width: 40%; color: var(--muted); white-space: nowrap; }
.hg-stat-icon { display: inline-block; width: 15px; height: 15px; margin-right: 6px; vertical-align: middle; }
.hg-stat-icon img, .hg-set-icon img { object-fit: contain; }
.hg-stat-icon .hg-image-fallback { font-size: 10px; }
.hg-stat-value { text-align: right; font-variant-numeric: tabular-nums; }
.hg-stat-target { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.hg-stat-target strong { color: var(--text); font-size: 14px; font-weight: 700; }
.hg-stat-range { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; white-space: normal; }
.hg-priority { padding: 1px 4px; border-radius: 4px; color: var(--blue); background: var(--blue-soft); font-size: 9px; }
.hg-important { background: color-mix(in srgb, var(--blue-soft) 65%, var(--panel)); }
.hg-important .hg-stat-label, .hg-important .hg-stat-target strong { color: var(--blue); }
.hg-weight-3 { background: color-mix(in srgb, var(--green-soft) 65%, var(--panel)); }
.hg-weight-3 .hg-stat-label, .hg-weight-3 .hg-stat-target strong, .hg-weight-3 .hg-priority { color: var(--green); }
.hg-weight-3 .hg-priority { background: var(--green-soft); }
.hg-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.hg-distributions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.hg-distributions > summary { color: var(--blue); cursor: pointer; font-size: 11px; line-height: 1.7; }
.hg-distributions > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.hg-distribution { margin-top: 16px; }
.hg-distribution h5 { margin: 0; color: var(--text); font-size: 11px; }
.hg-distribution > .hg-note { margin-top: 4px; }
.hg-distribution-bins { display: grid; gap: 4px; padding: 0; margin: 8px 0 0; list-style: none; }
.hg-distribution-bin { display: grid; grid-template-columns: minmax(82px, 1fr) minmax(35px, 1fr) minmax(35px, auto); align-items: center; gap: 6px; padding: 4px; border-radius: 4px; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.hg-distribution-bin.is-quantile { background: var(--blue-soft); color: var(--blue); }
.hg-distribution-label { overflow-wrap: anywhere; }
.hg-distribution-count { text-align: right; white-space: nowrap; }
.hg-distribution-bar { width: 100%; min-width: 0; height: 10px; border: 0; background: var(--panel-soft); color: var(--blue); }
.hg-distribution-bar::-webkit-meter-bar { border: 0; border-radius: 4px; background: var(--panel-soft); }
.hg-distribution-bar::-webkit-meter-optimum-value { border-radius: 4px; background: var(--blue); }
.hg-distribution-bar::-moz-meter-bar { border-radius: 4px; background: var(--blue); }
.hg-sets, .hg-artifacts, .hg-relation-list { padding: 0; margin: 0; list-style: none; }
.hg-sets { display: grid; gap: 5px; }
.hg-set-button { display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 6px; width: 100%; padding: 9px 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.hg-set-button:hover { background: var(--panel-soft); }
.hg-set-button.is-selected { border-color: var(--blue-border); background: var(--blue-soft); }
.hg-set-button:focus-visible, .hg-retry-button:focus-visible, .hg-relation-name:focus-visible, .hg-source-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.hg-rank { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.hg-set-tokens { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.hg-set-token { display: inline-flex; align-items: center; gap: 3px; color: var(--blue); font-size: 12px; font-weight: 600; white-space: nowrap; }
.hg-set-icon { display: inline-block; flex: 0 0 18px; width: 18px; height: 18px; }
.hg-set-icon .hg-image-fallback { font-size: 10px; }
.hg-set-rates { display: grid; gap: 3px; justify-items: end; font-size: 12px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.hg-set-rates strong { color: var(--blue); font-weight: 600; }
.hg-set-rates small { color: var(--green); font-size: 9px; white-space: nowrap; }
.hg-artifacts { display: grid; grid-template-columns: repeat(5, minmax(90px, 1fr)); gap: 9px; overflow-x: auto; padding-bottom: 5px; scrollbar-width: thin; }
.hg-artifact { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); }
.hg-artifact-image { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--panel-soft); }
.hg-artifact-image .hg-image-fallback { font-size: 32px; background: linear-gradient(145deg, var(--blue-soft), var(--panel-soft)); }
.hg-artifact-badges { position: absolute; top: 6px; left: 5px; right: 5px; display: flex; justify-content: space-between; align-items: center; gap: 3px; pointer-events: none; }
.hg-artifact-rank { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #162238d9; color: #fff; font-size: 10px; font-weight: 700; }
.hg-artifact-use { padding: 3px 5px; border-radius: 12px; color: #fff; background: #3569dfe8; font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hg-artifact-name { display: block; padding: 8px 7px 0; color: var(--text); font-size: 10px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
.hg-artifact-win { display: block; padding: 3px 7px 8px; color: var(--muted); font-size: 9px; }
.hg-artifact-name:last-child { padding-bottom: 8px; }
.hg-artifact-source { display: inline-block; margin-top: 11px; font-size: 10px; }
.hg-synergies { border-color: var(--blue-border); }
.hg-synergies .hg-section-title { color: var(--blue); }
.hg-counters { border-color: var(--red-border); }
.hg-counters .hg-section-title { color: var(--red); }
.hg-relation-list { display: grid; gap: 11px; }
.hg-relation { display: grid; grid-template-columns: 12px 28px minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.hg-relation-portrait { display: block; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: var(--panel-soft); }
.hg-relation-portrait .hg-image-fallback { font-size: 12px; }
.hg-relation-name { color: var(--text); font-size: 11px; font-weight: 600; line-height: 1.5; text-decoration: none; overflow-wrap: anywhere; }
.hg-relation-name:hover { text-decoration: underline; }
.hg-relation-rate { color: var(--blue); font-size: 11px; font-variant-numeric: tabular-nums; }
.hg-counters .hg-relation-rate { color: var(--red); }
.hg-empty, .hg-loading { margin: 0; padding: 16px 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.hg-retry { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--panel-soft); color: var(--muted); font-size: 11px; }
.hg-retry-button { padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--blue); font: inherit; cursor: pointer; }
.hg-retry-button:disabled { opacity: .6; cursor: wait; }
.hg-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 0 2px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.hg-source-link { color: var(--blue); text-decoration: none; }.hg-source-link:hover { text-decoration: underline; }
.hero-evaluation-evidence { padding: 10px 12px; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--panel); }
.hero-evaluation-evidence > summary { cursor: pointer; color: var(--muted); font-size: 11px; }
.hero-evaluation-evidence > .evidence-title { margin-top: 16px; }
@container hero-guide (min-width: 580px) {
  .hg-overview { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}
@container hero-guide (min-width: 450px) {
  .hg-relations-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container hero-guide (max-width: 440px) {
  .hg-header.hg-assessed { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 15px; }
  .hg-assessed .hg-portrait { flex-basis: 52px; width: 52px; height: 52px; }
  .hg-assessment-result { width: 100%; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'score action' 'label label'; align-items: center; justify-items: start; text-align: left; column-gap: 12px; }
  .hg-assessment-action { grid-area: action; justify-self: end; }
  .hg-assessment-value { grid-area: score; }
  .hg-assessment-label { grid-area: label; }
  .hg-assessed .hg-rates { justify-content: flex-start; gap: 5px 14px; }
}
@container hero-guide (max-width: 360px) {
  .hg-header { padding: 15px; }.hg-hero-name { font-size: 18px; }.hg-section { padding: 12px; }
  .hg-rates { width: 100%; justify-content: space-around; padding-top: 4px; }
  .hg-assessed .hg-rates { justify-content: flex-start; padding-top: 10px; }
  .hg-stats td { padding-right: 4px; padding-left: 4px; }
}

/* An opened assessed guide owns the full evaluation; keep its summary as a
   compact collapse control. Rows without that guide retain the normal summary. */
.recommendation-toggle[open]:has(.hg-assessed) > .recommendation-summary {
  grid-template-columns: minmax(0, 1fr) 18px;
  grid-template-rows: auto;
  gap: 0 12px;
  min-height: 0;
  padding: 10px 0;
}
.recommendation-toggle[open]:has(.hg-assessed) > .recommendation-summary > * {
  grid-column: auto;
  grid-row: auto;
}
.recommendation-toggle[open]:has(.hg-assessed) > .recommendation-summary > .recommendation-identity {
  grid-column: 1;
  grid-row: 1;
  gap: 0;
}
.recommendation-toggle[open]:has(.hg-assessed) > .recommendation-summary > .recommendation-chevron {
  grid-column: 2;
  grid-row: 1;
}
.recommendation-toggle[open]:has(.hg-assessed) > .recommendation-summary > .recommendation-sets,
.recommendation-toggle[open]:has(.hg-assessed) > .recommendation-summary > .fit-score,
.recommendation-toggle[open]:has(.hg-assessed) > .recommendation-summary > .recommendation-status,
.recommendation-toggle[open]:has(.hg-assessed) > .recommendation-summary .hero-avatar,
.recommendation-toggle[open]:has(.hg-assessed) > .recommendation-summary .hero-build {
  display: none;
}
