 

.hm-root { display: none; }

@media (max-width: 600px) {
  .hist-filters, .hist-table-wrap { display: none !important; }
  .hm-root { display: block; }

  .hm-toolbar {
    display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .hm-toolbar::-webkit-scrollbar { display: none; }
  .hm-pill {
    font: inherit; font-size: 0.78rem; font-weight: 600; white-space: nowrap;
    border: 1px solid var(--border, #dde3ef); background: #fff; color: inherit;
    border-radius: 999px; padding: 5px 11px; flex: 0 0 auto; cursor: pointer;
  }
  .hm-pill-on, .hm-bf-pill.hm-pill-on { background: var(--accent, #4f7ef8); color: #fff; border-color: var(--accent, #4f7ef8); }
  .hm-pill-group { display: inline-flex; gap: 4px; flex: 0 0 auto; }
  .hm-arrow { font-size: 0.85em; }

  .hm-search-row { padding: 0 0 8px; }
  .hm-search-input {
    width: 100%; box-sizing: border-box; font: inherit; font-size: 0.85rem;
    padding: 7px 10px; border: 1px solid var(--border, #dde3ef); border-radius: 8px;
  }

  .hm-count {
    font-size: 0.74rem; color: var(--muted, #6b7a99); display: flex;
    justify-content: space-between; gap: 8px; padding: 0 2px 8px;
  }

  .hm-feed { display: block; }
  .hm-empty { color: var(--muted, #6b7a99); font-size: 0.85rem; padding: 16px 4px; text-align: center; }

  .hm-card {
    background: #fff; border: 1px solid var(--border, #dde3ef); border-radius: 12px;
    padding: 9px 11px; margin-bottom: 8px;
  }
  .hm-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
  .hm-t {
    font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; flex: 1 1 auto; min-width: 0;
  }
  .hm-card.hm-open .hm-t { white-space: normal; overflow: visible; }
  .hm-d { color: var(--muted, #6b7a99); font-size: 0.72rem; white-space: nowrap; flex: 0 0 auto; }
  .hm-c {
    color: var(--muted, #6b7a99); font-size: 0.74rem; margin: 1px 0 6px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .hm-row { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
  .hm-chip {
    display: inline-block; font-size: 0.7rem; font-weight: 700; border-radius: 999px;
    padding: 1px 7px; background: #eef1f6; color: var(--muted, #6b7a99); white-space: nowrap;
  }
  .hm-chip-cat { background: #e8eefd; color: #2b4fb3; }

  .hm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 7px; }
  .hm-st { background: #f6f8fc; border-radius: 8px; padding: 4px 6px; text-align: center; min-width: 0; }
  .hm-st b { display: block; font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hm-st small { font-size: 0.62rem; color: var(--muted, #6b7a99); text-transform: uppercase; letter-spacing: 0.03em; }

  .hm-more { display: none; }
  .hm-card.hm-open .hm-more {
    display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; margin-top: 8px;
    padding-top: 8px; border-top: 1px dashed var(--border, #dde3ef); font-size: 0.74rem;
  }
  .hm-more span { display: flex; justify-content: space-between; gap: 6px; min-width: 0; }
  .hm-more span i { color: var(--muted, #6b7a99); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hm-tap { font-size: 0.7rem; color: var(--accent, #4f7ef8); margin-top: 6px; text-align: center; }

  #hm-more {
    display: block; width: 100%; margin: 4px 0 12px; padding: 9px; font: inherit;
    font-size: 0.82rem; border: 1px solid var(--border, #dde3ef); border-radius: 10px;
    background: #fff; cursor: pointer;
  }
  #hm-more[hidden] { display: none; }

   
  body.hm-doc-scroll { overflow: visible; }
  body.hm-doc-scroll #panel-history { overflow: visible; }
}

 
.hm-sort-pop {
  position: fixed; z-index: 1000; background: #fff; border: 1px solid var(--border, #dde3ef);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(20,30,60,.18); padding: 6px;
  max-height: 280px; overflow-y: auto; min-width: 170px; font-size: 0.8rem;
}
.hm-sort-opt {
  display: flex; justify-content: space-between; gap: 10px; width: 100%; box-sizing: border-box;
  font: inherit; font-size: 0.8rem; text-align: left; background: none; border: none;
  border-radius: 5px; padding: 5px 7px; cursor: pointer; color: inherit;
}
.hm-sort-opt:hover { background: #f4f6fb; }
.hm-sort-opt-on { font-weight: 700; color: var(--accent, #4f7ef8); }
