.hbc { max-width: 820px; display: flex; flex-direction: column; color: #27331f; }
.hbc-section { margin-bottom: 26px; }
.hbc-h { margin: 0 0 12px; font-size: 15.5px; font-weight: 700; color: #27331f; }
.hbc-hidden { display: none; }

.hbc input, .hbc select {
  padding: 9px 11px; font-size: 14.5px; border: 1px solid #d9e0d4; border-radius: 6px; background: #fff; color: #27331f;
  font-family: inherit;
}
.hbc input:focus, .hbc select:focus { outline: 2px solid #19616a; outline-offset: 1px; }
.hbc label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: #27331f; margin-bottom: 10px; }
.hbc-hint { margin: 6px 0 0; font-size: 12.5px; color: #5b6b56; }

/* Tabs */
.hbc-tabs { display: flex; gap: 6px; margin-bottom: 22px; border-bottom: 1px solid #d9e0d4; }
.hbc-tab-btn {
  padding: 10px 16px; font-size: 13.5px; font-weight: 700; border: 1px solid transparent; border-bottom: none;
  background: transparent; color: #5b6b56; cursor: pointer; border-radius: 6px 6px 0 0; margin-bottom: -1px;
}
.hbc-tab-btn:hover { color: #19616a; }
.hbc-tab-active { color: #19616a; background: #fff; border-color: #d9e0d4; border-bottom: 1px solid #fff; }

/* Parent cards */
.hbc-parents { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 10px; }
.hbc-parent-card { padding: 14px; background: #f3f4f8; border: 1px solid #d9e0d4; border-radius: 8px; }
.hbc-parent-h { margin: 0 0 12px; font-size: 13.5px; font-weight: 700; color: #19616a; }
.hbc-clamp-hint { min-height: 15px; margin: 2px 0 0; font-size: 12px; font-weight: 700; color: #c0392b; }

.hbc-run-btn {
  margin-top: 6px; padding: 10px 18px; font-size: 14px; font-weight: 700; border: 1px solid #19616a;
  border-radius: 6px; background: #19616a; color: #fff; cursor: pointer;
}
.hbc-run-btn:hover { background: #144e55; border-color: #144e55; }

/* Outlook */
.hbc-outlook { display: flex; flex-direction: column; gap: 12px; }
.hbc-outlook-grade {
  display: flex; align-items: center; gap: 14px; padding: 14px; background: #f3f4f8; border: 1px solid #d9e0d4;
  border-radius: 8px;
}
.hbc-outlook-tier {
  flex: 0 0 auto; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; border-radius: 10px; color: #fff; background: #19616a;
}
.hbc-tier-S { background: #19616a; }
.hbc-tier-A { background: #2f8f5b; }
.hbc-tier-B { background: #5b6b56; }
.hbc-tier-C { background: #b9862f; }
.hbc-tier-D { background: #c0392b; }
.hbc-outlook-tier-text { display: flex; flex-direction: column; gap: 2px; }
.hbc-outlook-tier-label { font-size: 15px; font-weight: 700; color: #27331f; }
.hbc-outlook-tier-sub { font-size: 12.5px; color: #5b6b56; }
.hbc-outlook-joint {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; background: #fff; border: 1px solid #d9e0d4; border-radius: 8px;
}
.hbc-outlook-joint-label { font-size: 13px; font-weight: 700; color: #27331f; }
.hbc-outlook-joint-value { font-size: 20px; font-weight: 700; color: #19616a; white-space: nowrap; }

/* Per-stat result cards */
.hbc-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hbc-stat-card { padding: 12px 14px; background: #f3f4f8; border: 1px solid #d9e0d4; border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.hbc-stat-h { margin: 0 0 4px; font-size: 13.5px; font-weight: 700; color: #27331f; display: flex; align-items: baseline; gap: 6px; }
.hbc-stat-unit { font-size: 11.5px; font-weight: 400; color: #5b6b56; }
.hbc-stat-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; }
.hbc-stat-tag { color: #5b6b56; font-weight: 700; }
.hbc-stat-val { color: #19616a; font-weight: 700; }
.hbc-stat-worst + .hbc-stat-val, .hbc-stat-row .hbc-stat-worst { color: #c0392b; }
.hbc-stat-best { color: #2f8f5b; }
.hbc-stat-beat { border-top: 1px solid #d9e0d4; padding-top: 6px; margin-top: 2px; }

/* Prose */
.hbc-prose p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.6; color: #27331f; }
.hbc-prose p:last-child { margin-bottom: 0; }
.hbc-prose code { font-family: ui-monospace, monospace; font-size: 12.5px; background: #f3f4f8; border: 1px solid #d9e0d4; border-radius: 4px; padding: 1px 5px; color: #19616a; }
.hbc-formula-list { margin: 0 0 14px; padding-left: 20px; font-size: 13.5px; line-height: 1.8; color: #27331f; }
.hbc-formula-list code { font-family: ui-monospace, monospace; font-size: 12.5px; background: #f3f4f8; border: 1px solid #d9e0d4; border-radius: 4px; padding: 1px 5px; color: #19616a; }

/* Reference table */
.hbc-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.hbc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hbc-table th, .hbc-table td { text-align: left; padding: 8px 9px; border: 1px solid #d9e0d4; vertical-align: top; }
.hbc-table th { background: #f3f4f8; color: #27331f; font-weight: 700; white-space: nowrap; }
.hbc-table td { color: #27331f; }
.hbc-table tbody tr:nth-child(even) td { background: #f3f4f8; }
.hbc-table .hbc-ref-name { font-weight: 700; white-space: nowrap; }

.hbc-note { margin-top: 4px; font-size: 13px; color: #5b6b56; }

@media (max-width: 640px) {
  .hbc-parents { grid-template-columns: 1fr; }
  .hbc-result { grid-template-columns: 1fr; }
  .hbc-outlook-grade { flex-wrap: wrap; }
}
