.hm-card {
  min-width: 0;
  padding: clamp(14px, 2.4vw, 28px);
  background: #fbfaf5;
  color: #283d4b;
  border: 1px solid #dce2df;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.hm-card *, .hm-card *::before, .hm-card *::after { box-sizing: border-box; }
.hm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; }
.hm-card .hm-title { margin: 0; font-size: clamp(19px, 2vw, 25px); line-height: 1.45; font-weight: 660; color: #253c4d; }
.hm-card .hm-subtitle { margin: .3rem 0 0; font-size: .875rem; line-height: 1.5; color: #536776; }
.hm-ranges { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); width: min(100%, 354px); gap: 1px; border: 1px solid #d2dcdF; border-radius: 6px; padding: 3px; }
.hm-ranges button, .hm-zoom { background: transparent; color: #455f71; border: 0; border-radius: 4px; padding: .4rem .65rem; font-family: inherit; font-size: .875rem; line-height: 1.35; cursor: pointer; white-space: nowrap; }
.hm-ranges button[aria-pressed="true"] { color: white; background: #24547a; }
.hm-ranges button { padding: .45rem .15rem; }
.hm-ranges button:hover:enabled:not([aria-pressed="true"]), .hm-zoom:hover { background: #e6edf0; }
.hm-card button:focus-visible, .hm-card select:focus-visible, .hm-canvas:focus-visible { outline: 2px solid #194f84; outline-offset: -2px; }
.hm-tools { display: flex; align-items: center; gap: .7rem; margin: 1rem 0 .45rem; flex-wrap: wrap; }
.hm-axis-title, .hm-card .hm-horizontal-title { font-size: .81rem; line-height: 1.45; color: #526879; }
.hm-card .hm-horizontal-title { margin: .25rem 0 0; text-align: center; }
.hm-legend { display: grid; width: clamp(112px, 20vw, 200px); gap: 3px; margin: 0 0 0 auto; font: .72rem/1.15 system-ui, sans-serif; color: #526879; }
.hm-legend i { display: block; height: 7px; border-radius: 2px; background: linear-gradient(90deg,#aa375b,#cf547e 13%,#f3bacc 27%,#fbf1df 42%,#b4dcb9 50%,#77c19e 63%,#35917d 77%,#1b5853); }
.hm-legend-ticks { position: relative; display: flex; justify-content: space-between; }
.hm-legend-title { font-weight: 550; letter-spacing: .01em; }
.hm-legend-ticks span:nth-child(2) { position: absolute; left: 42%; transform: translateX(-50%); }

.hm-stage { position: relative; }
.hm-tip { position: absolute; z-index: 2; display: grid; gap: 2px; padding: 5px 9px; border: 1px solid #beccd3; border-radius: 5px; background: #fffefb; color: #405768; box-shadow: 0 2px 9px #20394b1c; pointer-events: none; white-space: nowrap; font-size: .75rem; line-height: 1.5; }
.hm-tip[hidden] { display: none; }
.hm-tip strong { font-size: .9rem; font-variant-numeric: tabular-nums; }
.hm-zoom { border: 1px solid #c4d3da; padding: .25rem .55rem; font-size: .8rem; }
.hm-view { position: relative; width: 100%; min-width: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #97aebb #f0f2ee; }
.hm-sheet { position: relative; min-width: 100%; }
.hm-canvas { position: sticky; top: 0; left: 0; display: block; cursor: crosshair; touch-action: pan-x pan-y; }
.hm-choices { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; border-top: 1px solid #d6dfdf; padding-top: .85rem; margin-top: .75rem; }
.hm-chooser { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; color: #506573; font-size: .86rem; }
.hm-chooser select { background: #fff; border: 1px solid #c8d6dd; border-radius: 4px; color: #263f51; padding: .3rem .35rem; font: inherit; }
.hm-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .7rem; margin: .55rem 0; }
.hm-details strong { font: 650 1.15rem/1.4 ui-monospace, monospace; }
.hm-loss { color: #a03661; }
.hm-profit { color: #116c54; }
.hm-selected-prices, .hm-card .hm-method { color: #516674; font-size: .8125rem; line-height: 1.65; }
.hm-card .hm-method { margin: 0; }
.hm-method a { color: #194f84; text-decoration: underline; text-underline-offset: .18em; }
@media (max-width: 620px) {
  .hm-card { padding: 13px 10px; }
  .hm-ranges button { min-height: 36px; }
  .hm-legend { width: clamp(88px,29vw,140px); }
  .hm-tools { gap: .4rem; }
  .hm-selected-prices { width: 100%; }
}
.hm-card .hm-coverage { margin: .7rem 0 0; border-left: 2px solid #9bb5c8; padding: .25rem .55rem; background: #edf3f6; color: #365773; font-size: .82rem; }
@media (max-width: 600px) {
  .hm-ranges { order: -1; }
  .hm-head { gap: .4rem; }
  .hm-tools { margin-top: .6rem; }
}
@media (max-width: 365px) {
  .hm-card { padding: 9px 7px; }
  .hm-ranges button { min-height: 32px; }
  .hm-tools { gap: .25rem; }
  .hm-legend { width: 89px; font-size: .65rem; }
  .hm-axis-title { font-size: .73rem; }
  .hm-zoom { padding: .24rem .32rem; font-size: .75rem; }
}
.hm-label-toggle { display: inline-flex; align-items: center; gap: .4rem; min-height: 32px; padding: .24rem .55rem; border: 1px solid #bdcdd8; border-radius: 5px; background: #fff; color: #284d69; font-size: .85rem; font-weight: 550; cursor: pointer; white-space: nowrap; }
.hm-label-toggle[hidden], .hm-card .hm-scroll-hint[hidden] { display: none; }
.hm-label-toggle:has(:checked) { background: #eaf2f7; border-color: #8aaac2; }
.hm-label-toggle input { width: 1rem; height: 1rem; margin: 0; accent-color: #194f84; cursor: pointer; }
.hm-label-toggle:focus-within { outline: 2px solid #194f84; outline-offset: 2px; }
.hm-card .hm-scroll-hint { margin: 0 0 .4rem; color: #526879; font-size: .78rem; }
@media (max-width: 620px) {
  .hm-tools:has(.hm-label-toggle:not([hidden])) { display: grid; grid-template-columns: minmax(0,1fr) auto; }
  .hm-label-toggle { grid-row: 1; grid-column: 1; justify-self: start; }
  .hm-tools:has(.hm-label-toggle:not([hidden])) .hm-zoom { grid-row: 1; grid-column: 2; }
  .hm-tools:has(.hm-label-toggle:not([hidden])) .hm-axis-title { grid-row: 2; grid-column: 1; }
  .hm-tools:has(.hm-label-toggle:not([hidden])) .hm-legend { grid-row: 2; grid-column: 2; }
}
