 

.hm-root { display: none; }

@media (max-width: 600px) {
  .hist-filters, .hist-table-wrap { display: none !important; }
   
  .hist-paging-footer { 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: var(--fs-sm); font-weight: 600; white-space: nowrap;
    border: 1px solid var(--border); background: var(--card); color: inherit;
    border-radius: var(--radius-pill); padding: 5px 11px; flex: 0 0 auto; cursor: pointer;
  }
  .hm-pill-group { display: inline-flex; gap: 4px; flex: 0 0 auto; }
   
  .hm-bf-switch.on { background: var(--accent); color: var(--card); border-color: var(--accent); }
  .hm-bf-switch.off { opacity: 0.42; }
  .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: var(--fs-base);
    padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-md);
  }

  .hm-count {
    font-size: var(--fs-sm); color: var(--muted); display: flex;
    justify-content: space-between; gap: 8px; padding: 0 2px 8px;
  }

  .hm-feed { display: block; }
  .hm-empty { color: var(--muted); font-size: var(--fs-base); padding: 16px 4px; text-align: center; }

  .hm-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
    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); font-size: var(--fs-sm); white-space: nowrap; flex: 0 0 auto; }
  .hm-c {
    color: var(--muted); font-size: var(--fs-sm); 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: var(--fs-xs); font-weight: 700; border-radius: var(--radius-pill);
    padding: 1px 7px; background: var(--bg); color: var(--muted); white-space: nowrap;
  }
  .hm-chip-cat { background: var(--accent-soft); color: var(--accent-text); }

  .hm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 7px; }
  .hm-st { background: var(--card-2); border-radius: var(--radius-md); padding: 4px 6px; text-align: center; min-width: 0; }
  .hm-st b { display: block; font-size: var(--fs-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hm-st small { font-size: var(--fs-xs); color: var(--muted); 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); font-size: var(--fs-sm);
  }
  .hm-more span { display: flex; justify-content: space-between; gap: 6px; min-width: 0; }
  .hm-more span i { color: var(--muted); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hm-tap { font-size: var(--fs-xs); color: var(--accent); margin-top: 6px; text-align: center; }

   
  .hm-page-row { display: flex; gap: 8px; margin: 4px 0 12px; }
  .hm-page-row[hidden] { display: none; }
  .hm-page-row button {
    font: inherit; font-size: var(--fs-md); padding: 9px; border: 1px solid var(--border);
    border-radius: var(--radius-btn); background: var(--card); cursor: pointer;
  }
  #hm-more { flex: 1 1 auto; }
  #hm-all { flex: 0 0 auto; padding-left: 14px; padding-right: 14px; }

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

 
.hm-sort-pop {
  position: fixed; z-index: 1000; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-pop); padding: 6px;
  max-height: 280px; overflow-y: auto; min-width: 170px; font-size: var(--fs-md);
}
.hm-sort-opt {
  display: flex; justify-content: space-between; gap: 10px; width: 100%; box-sizing: border-box;
  font: inherit; font-size: var(--fs-md); text-align: left; background: none; border: none;
  border-radius: var(--radius-sm); padding: 5px 7px; cursor: pointer; color: inherit;
}
.hm-sort-opt:hover { background: var(--card-2); }
.hm-sort-opt-on { font-weight: 700; color: var(--accent); }
