
    .dsn-history-page { padding-bottom: 2rem; }
    .history-page-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 1rem;
      margin-bottom: 1rem;
    }
    .history-page-head h1 { margin: 0 0 .25rem; }
    .history-page-head p { margin: 0; max-width: 760px; }
    .history-back-link { white-space: nowrap; }

    .history-controls {
      display: grid;
      grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
      gap: .75rem;
      align-items: end;
      margin-bottom: 1rem;
    }
    .history-controls .field { min-width: 0; }
    .history-controls .field span { display: block; margin-bottom: .3rem; }
    .history-controls select,
    .history-controls input { width: 100%; }
    .history-refresh { min-height: 40px; }

    .history-summary-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: .75rem;
      margin-bottom: 1rem;
    }
    .history-summary-card {
      padding: .8rem 1rem;
      border: 1px solid var(--border, rgba(255,255,255,.12));
      border-radius: 10px;
      background: rgba(255,255,255,.025);
    }
    .history-summary-card span { display: block; font-size: .78rem; opacity: .7; }
    .history-summary-card strong { display: block; margin-top: .15rem; font-size: 1.05rem; }

    .history-table .mission-cell strong { display: block; }
    .history-table .mission-cell small { display: block; margin-top: .2rem; opacity: .7; }
    .history-region { white-space: nowrap; }
    .history-count { white-space: nowrap; }
    .history-expand-button { min-width: 92px; }
    .history-detail-row > td { padding: 0 !important; }
    .history-detail-panel { padding: .75rem 1rem 1rem; background: rgba(255,255,255,.02); }
    .history-detail-panel .table-wrap { margin: 0; }
    .history-detail-table { width: 100%; }
    .history-detail-table td,
    .history-detail-table th { font-size: .84rem; }
    .history-loading, .history-empty { padding: 1rem; opacity: .75; }

    .history-detail-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: .75rem;
      margin: 0 0 .65rem;
    }
    .history-detail-count {
      font-size: .82rem;
      color: var(--muted, #9aa8bb);
    }
    .history-load-more {
      min-width: 112px;
      white-space: nowrap;
    }
    .history-status { min-height: 1.4em; margin: .5rem 0 0; }

    /* Keep the return link readable in both themes. */
    .history-back-link {
      color: #8fd3ff !important;
      border-color: rgba(89,195,255,.42) !important;
      background: rgba(21,101,192,.16) !important;
      text-decoration: none;
    }
    .history-back-link:hover,
    .history-back-link:focus-visible {
      color: #ffffff !important;
      border-color: rgba(89,195,255,.72) !important;
      background: rgba(21,101,192,.34) !important;
    }
    body[data-theme="light"] .history-back-link {
      color: #0b5ea8 !important;
      border-color: rgba(11,94,168,.32) !important;
      background: rgba(11,94,168,.08) !important;
    }

    /* Spacecraft thumbnail added from the same spacecraft catalogue used by Live DSN. */
    .history-mission-with-image {
      display: flex;
      align-items: center;
      gap: .7rem;
      min-width: 0;
    }
    .history-craft-thumb {
      width: 38px;
      height: 38px;
      flex: 0 0 38px;
      border-radius: 8px;
      overflow: hidden;
      border: 1px solid var(--border, rgba(255,255,255,.12));
      background: rgba(255,255,255,.04);
      display: grid;
      place-items: center;
    }
    .history-craft-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .history-craft-thumb.is-missing { display: none; }
    .history-mission-copy { min-width: 0; }

    @media (max-width: 900px) {
      .history-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .history-controls .search-field { grid-column: 1 / -1; }
      .history-refresh { width: 100%; }
      .history-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .history-page-head { display: block; }
      .history-back-link { display: inline-block; margin-top: .75rem; }
    }
    @media (max-width: 560px) {
      .history-controls { grid-template-columns: 1fr; }
      .history-controls .search-field { grid-column: auto; }
      .history-summary-grid { grid-template-columns: 1fr 1fr; }
    }
  
.history-filter-group{border:0;padding:0;margin:0 0 .85rem;min-width:0}
.history-filter-group legend{color:var(--muted);font-size:.85rem;margin-bottom:.4rem}
.history-chip-strip{display:flex;flex-wrap:wrap;gap:.45rem}
.history-chip-strip .activity-filter-chip{min-height:38px;font-size:.85rem}
.history-chip-strip .is-active{border-color:var(--accent);background:rgba(89,195,255,.16);color:var(--text)}
.history-search-tools{display:flex;gap:.75rem;align-items:end;flex-wrap:wrap;margin:.8rem 0}
.history-search-tools label{flex:1 1 220px}.history-search-tools input{width:100%;margin-top:.3rem}
.history-search-tools label span{display:block}.history-search-tools button{min-height:40px}
.history-pager{display:flex;gap:1rem;align-items:center;justify-content:flex-end;margin-top:1rem}
.history-page .history-table th,.history-page .history-table td{display:table-cell!important}
.history-page .history-table{min-width:760px}.history-page .table-wrap{overflow-x:auto}
.history-page button:focus-visible,.history-page a:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.history-page button:disabled{opacity:.55;cursor:default}
.history-page .history-status{color:var(--muted)}
.history-sort-button{border:0;background:none;color:inherit;font:inherit;cursor:pointer;padding:0;text-align:left}
@media(max-width:560px){.history-search-tools button{flex:1}.history-pager{justify-content:space-between}}
