.hbae-panel {
  --hbae-ink: #20262e;
  --hbae-muted: #68717d;
  --hbae-line: #d5dadf;
  --hbae-line-strong: #b9c2ca;
  --hbae-header: #243746;
  --hbae-stripe: #f8f9fa;
  --hbae-hover: #f0f6fc;
  --hbae-selected: #e3f0ff;
  --hbae-accent: #a9442c;
  --hbae-focus: #a85d00;
  --hbae-sticky-top: 0px;
  box-sizing: border-box;
  width: min(1180px, calc(100% - 32px));
  max-width: 1180px;
  margin: clamp(1.5rem, 3vw, 2.5rem) auto;
  color: var(--hbae-ink);
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
  scroll-margin-top: var(--hbae-sticky-top);
}

.hbae-panel *,
.hbae-panel *::before,
.hbae-panel *::after { box-sizing: border-box; }
.hbae-panel button,
.hbae-panel select,
.hbae-panel input { font: inherit; }
.hbae-panel button,
.hbae-panel select,
.hbae-panel input[type="search"] {
  min-height: 40px;
  border: 1px solid var(--hbae-line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--hbae-ink);
}
.hbae-panel button { padding: .5rem .8rem; cursor: pointer; }
.hbae-panel button:hover:not(:disabled) { border-color: var(--hbae-ink); }
.hbae-panel button:disabled { cursor: not-allowed; opacity: .55; }
.hbae-panel button:focus-visible,
.hbae-panel select:focus-visible,
.hbae-panel input:focus-visible {
  outline: 3px solid var(--hbae-focus);
  outline-offset: 2px;
}
.hbae-status { min-height: 1.5rem; color: var(--hbae-muted); font-size: 13px; }
.hbae-view-toolbar,
.hbae-query-form,
.hbae-results-controls { min-width: 0; }
.hbae-view-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem;
  margin: 1rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hbae-line);
}
.hbae-control-group { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.hbae-control-label,
.hbae-field-label { font-size: 13px; font-weight: 700; color: var(--hbae-muted); }
.hbae-segmented { display: inline-flex; flex-wrap: wrap; gap: 0; }
.hbae-segmented button { border-radius: 0; margin-left: -1px; }
.hbae-segmented button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.hbae-segmented button:last-child { border-radius: 0 6px 6px 0; }
.hbae-segmented button.is-active,
.hbae-segmented button[aria-checked="true"] { background: var(--hbae-ink); border-color: var(--hbae-ink); color: #fff; }
.hbae-back-button { margin-left: auto; }
.hbae-comparison-back-top { margin-left: auto; }
.hbae-comparison-back-top[hidden] { display: none !important; }
.hbae-query-form {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr);
  gap: 1rem;
  align-items: stretch;
  margin: 1rem 0;
}
.hbae-search-group { min-width: 0; }
.hbae-field-label { display: grid; gap: .35rem; }
.hbae-query-form input[type="search"] { width: 100%; padding: .55rem .75rem; }
.hbae-category-group { min-width: 0; }
.hbae-category-buttons { display: flex; flex-wrap: wrap; gap: .4rem; }
.hbae-category-buttons button.is-active,
.hbae-results-controls button.is-active { background: var(--hbae-ink); border-color: var(--hbae-ink); color: #fff; }
.hbae-results-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0 1rem;
  padding: 1rem 0;
  border-block: 1px solid var(--hbae-line);
}
.hbae-selection-controls,
.hbae-display-controls { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.hbae-selection-controls { flex: 0 0 auto; }
.hbae-display-controls { flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; }
.hbae-results-controls label { display: inline-flex; align-items: center; gap: .5rem; color: var(--hbae-muted); font-size: 13px; font-weight: 700; }
.hbae-results-controls .hbae-select-control { min-width: 0; }
.hbae-results-controls select { min-width: 10rem; padding: .45rem .65rem; }
.hbae-results-status { margin: .75rem 0; color: var(--hbae-muted); font-size: 13px; }

.hbae-table-wrap { overflow: visible; }
.hbae-record-table,
.hbae-table { width: 100%; border-spacing: 0; border-collapse: separate; background: #fff; }
.hbae-table th { background: var(--hbae-header); color: #fff; }
.hbae-record-table { table-layout: fixed; }
.hbae-col-compare { width: 8%; }
.hbae-col-name { width: 37%; }
.hbae-col-bullet { width: 12%; }
.hbae-col-weight { width: 13%; }
.hbae-col-velocity { width: 14%; }
.hbae-col-energy { width: 16%; }
.hbae-record-table th,
.hbae-record-table td,
.hbae-table th,
.hbae-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hbae-line);
  text-align: left;
  vertical-align: middle;
}
.hbae-record-table thead th {
  position: sticky;
  top: var(--hbae-sticky-top);
  z-index: 3;
  background: var(--hbae-header);
  border-bottom: 2px solid var(--hbae-line-strong);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.hbae-record-table thead th.hbae-compare-column { padding: 6px 4px; text-align: center; }
.hbae-record-table thead [data-hbae-compare] {
  min-height: 32px;
  padding: .25rem .45rem;
  border-color: #fff;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.hbae-record-table thead [data-hbae-compare]:hover:not(:disabled) { border-color: #fff; background: rgb(255 255 255 / 14%); }
.hbae-record-table thead [data-hbae-compare]:disabled { color: rgb(255 255 255 / 72%); }
.hbae-record-table tbody tr:nth-child(even) { background: var(--hbae-stripe); }
.hbae-record-table tbody tr:hover { background: var(--hbae-hover); }
.hbae-record-table tbody tr.is-selected,
.hbae-record-table tbody tr.is-selected:hover { background: var(--hbae-selected); }
.hbae-record-table tbody td { font-size: 14px; }
.hbae-record-table tbody th { min-width: 0; font-size: 15px; font-weight: 600; }
.hbae-numeric-column { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbae-record-table .hbae-compare-column { width: 52px; padding-inline: 4px; text-align: center !important; white-space: nowrap; }
.hbae-checkbox-hit { display: inline-grid; width: 44px; height: 44px; place-items: center; cursor: pointer; }
.hbae-checkbox-hit input { width: 20px; height: 20px; margin: 0; accent-color: var(--hbae-accent); }
.hbae-name-control { min-height: 40px; padding: .25rem 0; border: 0 !important; background: transparent !important; color: var(--hbae-ink) !important; text-align: left; font-size: 15px; font-weight: 600; }
.hbae-name-control:hover { text-decoration: underline; text-underline-offset: 3px; }
.hbae-tooltip { position: fixed; z-index: 20; display: block; max-width: min(28rem, calc(100vw - 2rem)); padding: .65rem .75rem; border-radius: 6px; background: #20262e; box-shadow: 0 4px 16px rgb(0 0 0 / 24%); color: #fff; white-space: pre-line; pointer-events: none; }
.hbae-tooltip[hidden] { display: none !important; }
.hbae-empty-row td { padding: 2rem 1rem; color: var(--hbae-muted); text-align: center; }

@media (min-width: 701px) {
  .hbae-record-table tbody > tr:not(.hbae-empty-row) > th,
  .hbae-record-table tbody > tr:not(.hbae-empty-row) > td { padding-block: 0; }
  .hbae-record-table tbody .hbae-checkbox-hit {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline: auto;
  }
}

.hbae-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; list-style: none; margin: 1.25rem 0; padding: 0; }
.hbae-pagination a,
.hbae-pagination span { display: grid; min-width: 40px; min-height: 40px; place-items: center; padding: .35rem .65rem; border: 1px solid var(--hbae-line-strong); border-radius: 6px; color: var(--hbae-ink); text-decoration: none; }
.hbae-pagination a:hover { background: var(--hbae-hover); }
.hbae-pagination a:focus-visible { outline: 3px solid var(--hbae-focus); outline-offset: 2px; }
.hbae-pagination span[aria-current] { border-color: var(--hbae-ink); background: var(--hbae-ink); color: #fff; font-weight: 700; }

.hbae-mobile-comparison-control { display: none; }

.hbae-comparison-view[hidden] { display: none !important; }
.hbae-comparison-title { margin-bottom: .75rem; font-size: 1.35rem; font-weight: 700; }
.hbae-comparison-view table { width: 100%; margin-bottom: 1rem; border-spacing: 0; border-collapse: separate; }
.hbae-comparison-view th,
.hbae-comparison-view td { padding: .65rem; border: 1px solid var(--hbae-line); text-align: left; }
.hbae-comparison-view th { background: var(--hbae-header); color: #fff; }
.hbae-comparison-back-bottom { display: flex; justify-content: flex-end; margin-top: 1rem; }
.hbae-graph-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.hbae-graph-grid > div { min-width: 0; padding: .75rem; border: 1px solid var(--hbae-line); }
.hbae-graph-grid > div::before { display: block; margin-bottom: .5rem; font-weight: 700; }
.hbae-graph-grid > div:first-child::before { content: '銃口初速比較'; }
.hbae-graph-grid > div:last-child::before { content: 'マズルエナジー比較'; }
.hbae-graph-row { display: grid; grid-template-columns: minmax(7rem, 1fr) minmax(4rem, 2fr) auto; gap: .5rem; align-items: center; margin: .4rem 0; font-size: 13px; }
.hbae-graph-track { height: .8rem; overflow: hidden; border-radius: 99px; background: #edf1f4; }
.hbae-graph-track i { display: block; height: 100%; background: var(--hbae-accent); }
.hbae-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

body.admin-bar .hbae-panel { --hbae-sticky-top: 32px; }
@media (max-width: 782px) { body.admin-bar .hbae-panel { --hbae-sticky-top: 46px; } }
@media (max-width: 899px) {
  .hbae-panel { width: calc(100% - 24px); }
  .hbae-record-table th,
  .hbae-record-table td { padding-inline: 8px; }
  .hbae-query-form { grid-template-columns: minmax(260px, 1fr) minmax(0, 1.5fr); }
}
@media (max-width: 700px) {
  .hbae-panel { width: calc(100% - 20px); margin-block: 1rem; font-size: 14px; }
  .hbae-view-toolbar { align-items: stretch; gap: .75rem; }
  .hbae-view-toolbar .hbae-control-group { width: 100%; }
  .hbae-segmented { display: flex; }
  .hbae-segmented button { flex: 1 1 0; }
  .hbae-back-button { width: 100%; margin-left: 0; }
  .hbae-comparison-back-top { width: 100%; }
  .hbae-query-form { grid-template-columns: 1fr; gap: .75rem; }
  .hbae-category-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hbae-category-buttons button { width: 100%; }
  .hbae-results-controls { align-items: stretch; gap: .75rem; }
  .hbae-selection-controls,
  .hbae-display-controls { width: 100%; }
  .hbae-selection-controls { flex-direction: column; align-items: stretch; }
  .hbae-clear-button { width: 100%; margin-right: 0; }
  .hbae-display-controls { flex-direction: column; align-items: stretch; gap: .75rem; }
  .hbae-display-controls .hbae-unique-names-control { align-items: center; }
  .hbae-display-controls .hbae-select-control { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: .25rem; width: 100%; }
  .hbae-results-controls select { width: 100%; }
  .hbae-table-wrap { overflow-x: visible; }
  .hbae-record-table { display: block; table-layout: auto; }
  .hbae-record-table colgroup { display: none; }
  .hbae-record-table thead { display: none; }
  .hbae-record-table tbody { display: grid; gap: .75rem; }
  .hbae-record-table tbody tr { display: grid; grid-template-columns: 44px minmax(0, 1fr); padding: .75rem; border: 1px solid var(--hbae-line-strong); border-radius: 10px; background: #fff; }
  .hbae-record-table tbody tr:nth-child(even),
  .hbae-record-table tbody tr:hover,
  .hbae-record-table tbody tr.is-selected,
  .hbae-record-table tbody tr.is-selected:hover { background: var(--hbae-stripe); }
  .hbae-record-table tbody tr:hover { border-color: #9faab5; }
  .hbae-record-table tbody tr.is-selected,
  .hbae-record-table tbody tr.is-selected:hover { border-color: #79a9d8; background: var(--hbae-selected); }
  .hbae-record-table tbody td,
  .hbae-record-table tbody th { min-width: 0; padding: .55rem 0; border: 0; }
  .hbae-record-table tbody .hbae-compare-column { grid-column: 1; grid-row: 1; width: 44px; padding: 0; }
  .hbae-record-table tbody th { grid-column: 2; grid-row: 1; align-self: center; font-size: 15px; }
  .hbae-record-table tbody td[data-label] { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; border-top: 1px solid var(--hbae-line); }
  .hbae-record-table tbody td[data-label]::before { content: attr(data-label); color: var(--hbae-muted); font-size: 13px; font-weight: 600; }
  .hbae-record-table tbody td[data-label].hbae-numeric-column { text-align: right !important; }
  .hbae-record-table tbody td[data-label].hbae-numeric-column > span { text-align: right; }
  .hbae-name-control { width: 100%; min-height: 44px; padding-inline: .25rem; overflow-wrap: anywhere; }
  .hbae-empty-row { display: block !important; }
  .hbae-empty-row td { display: block !important; padding: 1.5rem .5rem !important; }
  .hbae-mobile-comparison-control { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .75rem 0 1rem; padding: .65rem .75rem; border: 1px solid var(--hbae-line); border-radius: 8px; background: var(--hbae-stripe); color: var(--hbae-muted); font-size: 13px; font-weight: 700; }
  .hbae-mobile-comparison-control [data-hbae-compare] { flex: 0 0 auto; min-width: 6rem; background: #fff; color: var(--hbae-ink); font-weight: 700; }
  .hbae-graph-grid { grid-template-columns: 1fr; }
  .hbae-graph-row { grid-template-columns: minmax(5rem, 1fr) minmax(3rem, 1.5fr) auto; }
  .hbae-comparison-view { min-width: 0; }
  .hbae-comparison-view table { display: block; overflow-x: auto; }
}
