/* (c) 2026 Wayne State University. All rights reserved. */
.hb, .hb-sheet {
  --hb-bottom: 0px;
  --hb-pad-b: var(--tm-pad-bottom);
  --hb-pull-h: 44px;
}
:root.sl-tabbed .hb, :root.sl-tabbed .hb-sheet {
  --hb-bottom: calc(max(env(safe-area-inset-bottom, 0px), var(--sl-space-2)) + 64px);
  --hb-pad-b: var(--sl-space-1);
}
:root.sl-desk.sl-tabbed .hb, :root.sl-desk.sl-tabbed .hb-sheet { --hb-bottom: 0px; --hb-pad-b: var(--tm-pad-bottom); }
.hb {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--hb-bottom);
  z-index: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: calc(var(--tm-pad-top) + var(--sl-space-3)) max(var(--tm-pad-right), calc((100% - 560px) / 2))
    var(--hb-pad-b) max(var(--tm-pad-left), calc((100% - 560px) / 2));
  background-color: var(--sl-bg);
  box-shadow: var(--sl-shadow-2);
  touch-action: none;
  transition: transform var(--sl-dur) var(--sl-ease);
  will-change: transform;
}
.hb.is-dragging { transition: none; }
.hb.is-sheet { transform: translateY(var(--hb-open, -80vh)); }
.hb-body { display: flex; flex: 1; flex-direction: column; gap: var(--sl-space-3); min-height: 0; transition: opacity var(--sl-dur) var(--sl-ease); }
.hb.is-sheet .hb-body { opacity: 0; }
.hb.is-sheet.is-dragging .hb-body { opacity: 1; }
.hb .tm-head { margin-bottom: 0; align-items: center; }
.hb-star { padding: 0; font: inherit; cursor: pointer; color: var(--sl-text-2); }
.hb-star[aria-pressed="true"] { color: var(--sl-brand-gold); }
.hb-star[aria-pressed="true"] svg { fill: var(--sl-brand-gold); }

.hb-low { --hb-band: var(--sl-success-ink); --hb-tint: var(--sl-success-tint); }
.hb-medium { --hb-band: var(--sl-warning-ink); --hb-tint: var(--sl-warning-tint); }
.hb-high { --hb-band: var(--sl-danger-ink); --hb-tint: var(--sl-danger-tint); }

.hb-dial {
  position: relative;
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  padding: var(--sl-space-3) var(--sl-space-3) var(--sl-space-3);
  border: 1px solid var(--sl-border);
  border-radius: var(--sl-radius-card);
  background: var(--sl-surface);
  box-shadow: var(--sl-shadow-card);
}
.hb-dial__score, .hb-dial__risk, .hb-dial__band, .hb-dial__monitor { margin: 0; }
.hb-dial__arc { display: block; width: min(220px, 60%); height: auto; }
.hb-dial__track, .hb-dial__value { fill: none; stroke-width: 14; stroke-linecap: round; }
.hb-dial__track { stroke: var(--sl-border); }
.hb-dial__value { stroke: var(--hb-band); stroke-dasharray: 100 100; stroke-dashoffset: var(--hb-off, 97);
  transition: stroke-dashoffset calc(var(--sl-dur) * 4) cubic-bezier(0.22, 1, 0.36, 1), stroke calc(var(--sl-dur) * 3) var(--sl-ease); }
.hb-dial__risk, .hb-chip { transition: color calc(var(--sl-dur) * 3) var(--sl-ease), background-color calc(var(--sl-dur) * 3) var(--sl-ease); }
.hb-dial__score { margin-top: -58px; font-size: 44px; font-weight: 800; line-height: 1; color: var(--sl-text-1);
  font-variant-numeric: tabular-nums; }
.hb-roll { position: relative; display: inline-block; overflow: hidden; vertical-align: top; line-height: inherit; }
.hb-roll__sizer { visibility: hidden; }
.hb-roll__face { position: absolute; top: 0; right: 0; left: 0; text-align: center; }
.hb-in-up { animation: hb-in-up calc(var(--sl-dur) * 2) cubic-bezier(0.22, 1, 0.36, 1) both; }
.hb-out-up { animation: hb-out-up calc(var(--sl-dur) * 2) cubic-bezier(0.22, 1, 0.36, 1) both; }
.hb-in-down { animation: hb-in-down calc(var(--sl-dur) * 2) cubic-bezier(0.22, 1, 0.36, 1) both; }
.hb-out-down { animation: hb-out-down calc(var(--sl-dur) * 2) cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes hb-in-up { from { opacity: 0; transform: translateY(100%); } }
@keyframes hb-out-up { to { opacity: 0; transform: translateY(-100%); } }
@keyframes hb-in-down { from { opacity: 0; transform: translateY(-100%); } }
@keyframes hb-out-down { to { opacity: 0; transform: translateY(100%); } }
.hb-dial__max { font-size: var(--sl-fs-4); font-weight: 700; color: var(--sl-text-2); }
.hb-dial__risk { margin-top: var(--sl-space-2); font-size: var(--sl-fs-4); font-weight: 700; color: var(--hb-band); }
.hb-dial__band { margin-top: var(--sl-space-1); }
.hb-chip { display: inline-block; padding: 2px var(--sl-space-3); border-radius: var(--sl-radius-pill); background: var(--hb-tint);
  color: var(--hb-band); font-size: var(--sl-fs-1); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.hb-dial__monitor { margin-top: var(--sl-space-1); font-size: var(--sl-fs-2); color: var(--sl-text-2); text-align: center; }
.hb-clear { position: absolute; top: var(--sl-space-2); right: var(--sl-space-2); min-height: 32px; padding: 0 var(--sl-space-3);
  border: 1px solid var(--sl-border-control); border-radius: var(--sl-radius-pill); background: var(--sl-surface);
  color: var(--sl-text-2); font: inherit; font-size: var(--sl-fs-1); font-weight: 600; cursor: pointer; }
.hb-clear:focus-visible { outline: 2px solid var(--sl-focus); outline-offset: 2px; }

.hb-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: minmax(64px, 1fr);
  gap: var(--sl-space-2);
  min-height: 0;
  max-height: 360px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hb-grid li { display: flex; min-height: 0; }
.hb-square {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: var(--sl-space-2) var(--sl-space-3);
  border: 1px solid var(--sl-border);
  border-radius: var(--sl-radius-card);
  background: var(--sl-surface);
  box-shadow: var(--sl-shadow-card);
  color: var(--sl-text-1);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--sl-dur-fast) var(--sl-ease);
}
.hb-square:active { transform: scale(0.97); }
.hb-square:focus-visible { outline: 2px solid var(--sl-focus); outline-offset: 2px; }
.hb-square__title { font-size: var(--sl-fs-3); font-weight: 700; line-height: var(--sl-lh-1); }
.hb-square__foot { display: flex; align-items: center; gap: var(--sl-space-2); font-size: var(--sl-fs-1); color: var(--sl-text-3); }
.hb-square__letter { font-weight: 800; letter-spacing: .04em; }
.hb-square__pts { margin-left: auto; font-weight: 700; color: var(--sl-text-2); }
.hb-square[aria-pressed="true"] { border-color: var(--sl-wsu-green-edge); background: var(--sl-wsu-green); color: var(--sl-on-wsu-green); }
.hb-square[aria-pressed="true"] .hb-square__foot, .hb-square[aria-pressed="true"] .hb-square__pts { color: var(--sl-on-wsu-green); }

.hb-pull {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: var(--hb-pull-h);
  margin: var(--sl-space-1) 0 0;
  padding: 2px var(--sl-space-4) 0;
  border: 0;
  background: none;
  color: var(--sl-text-2);
  font: inherit;
  font-size: var(--sl-fs-1);
  font-weight: 600;
  cursor: pointer;
}
.hb-pull__grip { width: 40px; height: 5px; border-radius: var(--sl-radius-pill); background: var(--sl-border-control); }
.hb-pull:focus-visible { outline: 2px solid var(--sl-focus); outline-offset: 2px; }

.hb-sheet {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--hb-bottom);
  z-index: 0;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(var(--hb-strip, 96px) + var(--sl-space-3)) max(var(--tm-pad-right), calc((100% - 640px) / 2))
    calc(var(--hb-pad-b) + var(--sl-space-3)) max(var(--tm-pad-left), calc((100% - 640px) / 2));
  background: var(--sl-bg);
  -webkit-user-select: text;
  user-select: text;
}
.hb-sheet__title { margin: 0; font-size: var(--sl-fs-6); outline: none; }
.hb-sheet__title:focus-visible, :root.sl-desk .hb-sheet__title:focus { outline: none; }
.hb-sheet__sub { margin: 2px 0 0; font-size: var(--sl-fs-2); color: var(--sl-text-2); }
.hb-sheet__h { margin: var(--sl-space-5) 0 var(--sl-space-2); font-size: var(--sl-fs-4); }
.hb-sheet__note { margin: var(--sl-space-2) 0 0; font-size: var(--sl-fs-2); color: var(--sl-text-2); line-height: var(--sl-lh-3); }
.hb-items, .hb-ladder, .hb-bands, .hb-sources { margin: 0; padding: 0; list-style: none; }
.hb-items li { display: flex; align-items: flex-start; gap: var(--sl-space-3); padding: var(--sl-space-2) 0;
  border-top: 1px solid var(--sl-border); }
.hb-items li:first-child { border-top: 0; }
.hb-items__letter { display: grid; flex: none; place-items: center; min-width: 34px; height: 26px; padding: 0 6px;
  box-sizing: border-box; border-radius: var(--sl-radius-pill); background: var(--sl-brand-tint); color: var(--sl-brand);
  font-size: var(--sl-fs-1); font-weight: 800; }
.hb-items__text { display: flex; flex: 1; flex-direction: column; min-width: 0; font-size: var(--sl-fs-2); color: var(--sl-text-2); }
.hb-items__text strong { font-size: var(--sl-fs-3); color: var(--sl-text-1); }
.hb-items__pts { flex: none; font-size: var(--sl-fs-2); font-weight: 700; }
.hb-ladder { display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.hb-ladder li { display: grid; grid-template-columns: 36px 1fr 52px; align-items: center; gap: var(--sl-space-2);
  padding: 4px var(--sl-space-2); border-radius: var(--sl-radius-md); font-size: var(--sl-fs-2); }
.hb-ladder__n { font-weight: 700; }
.hb-ladder__bar { position: relative; height: 12px; overflow: hidden; border-radius: 6px; background: var(--sl-border); }
.hb-ladder__bar i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: color-mix(in srgb, var(--hb-band) 45%, transparent); }
.hb-ladder__pc { font-weight: 700; text-align: right; }
.hb-ladder li.is-on { background: var(--hb-tint); outline: 1.5px solid var(--hb-band); }
.hb-ladder li.is-on .hb-ladder__bar i { background: var(--hb-band); }
.hb-bands { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sl-space-2); }
.hb-bands li { display: flex; flex-direction: column; align-items: center; padding: var(--sl-space-2) 4px;
  border: 1px solid var(--sl-border); border-radius: var(--sl-radius-md); font-size: var(--sl-fs-1); color: var(--sl-text-2);
  text-align: center; }
.hb-bands strong { font-size: var(--sl-fs-3); color: var(--sl-text-1); }
.hb-bands li.is-on { border-color: var(--hb-band); background: var(--hb-tint); }
.hb-sources { display: flex; flex-direction: column; gap: var(--sl-space-2); font-size: var(--sl-fs-1); color: var(--sl-text-2);
  line-height: var(--sl-lh-3); }
.hb-sources a { color: var(--sl-link); overflow-wrap: anywhere; }
.hb-sheet .tm-foot { margin: var(--sl-space-5) 0 var(--sl-space-3); }

.hb-note { position: fixed; left: 50%; bottom: calc(var(--tm-pad-bottom) + var(--sl-space-3)); z-index: 45; margin: 0;
  padding: var(--sl-space-2) var(--sl-space-4); border-radius: var(--sl-radius-pill); background: var(--sl-text-1); color: var(--sl-bg);
  font-size: var(--sl-fs-2); font-weight: 600; white-space: nowrap; opacity: 0; pointer-events: none;
  transform: translate(-50%, 8px); transition: opacity var(--sl-dur) var(--sl-ease), transform var(--sl-dur) var(--sl-ease); }
.hb-note.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-height: 700px) {
  .hb-body { gap: var(--sl-space-2); }
  .hb-dial { padding: var(--sl-space-2); }
  .hb-dial__arc { width: min(170px, 50%); }
  .hb-dial__score { margin-top: -46px; font-size: 36px; }
}
:root.sl-desk .hb { padding-top: calc(var(--tm-pad-top) + var(--sl-space-4)); }
@media (prefers-reduced-motion: reduce) {
  .hb, .hb-square, .hb-note, .hb-dial__value, .hb-dial__risk, .hb-chip { transition: none; }
  .hb-roll__face { animation: none !important; }
}

.hb-disclaimer { max-width: 44ch; color: var(--sl-text-3); font-size: var(--sl-fs-1); font-weight: 500; line-height: 1.25; text-align: center; }
