@media screen {
  #appShell #stockHistoryButton{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;min-height:32px;padding:4px 6px;border:1px solid var(--fh-theme-border-strong,#cbd5e1);border-radius:5px;background:var(--fh-theme-surface,#fff);color:var(--fh-theme-copy,#172334);font-size:12px!important;line-height:20px!important;font-weight:700;white-space:nowrap}
  #appShell #stockHistoryButton[hidden],#appShell #stockHistoryButton:is(.hidden,.fh-role-hidden,.fh-permission-hidden){display:none!important}
  #appShell #stockHistoryButton.tab-active{background:#0f766e;color:#fff;border-color:#0f766e}
  #appShell #stockHistoryButton:focus-visible{outline:2px solid #0891b2;outline-offset:2px}
  #appShell #sview-central.cs-history-view:not(.hidden):not(.fh-permission-hidden){container:stock-history / inline-size;display:flex;flex-direction:column;height:var(--cs-history-height,calc(100dvh - 135px));min-height:260px;overflow:hidden}
  #appShell #sview-central.cs-history-view #csBody{display:flex;flex:1;flex-direction:column;min-height:0;gap:5px;overflow:hidden}
  #appShell .cs-history-view .cs-toolbar{flex:0 0 auto;margin-bottom:5px}
  #appShell .cs-history-view .cs-movement-search{display:flex;flex-wrap:wrap;align-items:end;gap:5px;padding:0;margin:0}
  #appShell .cs-history-view .cs-movement-search>label:first-child{flex:1 1 260px}
  #appShell .cs-history-view .cs-movement-search>label{flex:0 1 140px}
  #appShell .cs-history-view .cs-movement-periods{display:flex;gap:3px}
  #appShell .cs-history-view .cs-movement-periods [aria-pressed=true]{background:#0f766e;color:#fff;border-color:#0f766e}
  #appShell .cs-history-view :is(.cs-movement-search,.cs-history-filters,.cs-history-bulk) label{font-size:11px!important;line-height:16px!important;margin:0;min-width:0}
  #appShell .cs-history-view :is(.cs-movement-search,.cs-history-filters,.cs-history-bulk) :is(input:not([type=checkbox]),select,button){box-sizing:border-box;height:29px;min-height:29px;padding:3px 7px;font-size:12px!important;line-height:21px!important;margin:0;min-width:0}
  #appShell .cs-history-view :is(input[type=checkbox]){display:inline-block;flex:none;width:14px;height:14px;min-height:14px;padding:0;margin:0;vertical-align:middle}
  #appShell .cs-history-view .cs-history-filters{display:flex;align-items:end;flex-wrap:wrap;gap:5px}
  #appShell .cs-history-view .cs-history-filters>label{flex:1 1 150px}
  #appShell .cs-history-view #csMovementCount{padding:4px 0;margin-left:auto;font-size:11px;white-space:nowrap}
  #appShell .cs-history-view .cs-history-bulk{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:5px;border:1px solid var(--cs-border,#cbd5e1);border-radius:5px;background:var(--cs-soft,#f8fafc)}
  #appShell .cs-history-view .cs-history-check{display:flex;align-items:center;gap:5px;white-space:nowrap}
  #appShell .cs-history-view #csHistorySelectedCount{font-size:11px;color:var(--cs-muted,#475569)}
  #appShell .cs-history-view .cs-history-perform-label{margin-left:auto;flex:0 1 210px}
  #appShell .cs-history-view .cs-history-action-status{flex:none;margin:0;font-size:12px;color:var(--cs-ink,#111827)}
  #appShell .cs-history-view #csMovementRows{display:flex;flex:1;min-height:0;min-width:0}
  #appShell .cs-history-view .cs-movement-table-scroll{flex:1;width:100%;height:auto;max-height:none!important;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin}
  #appShell .cs-history-view .cs-movement-table{min-width:0!important;max-width:100%;width:100%;table-layout:fixed;font-size:12px!important}
  #appShell .cs-history-view .cs-movement-table :is(th,td){box-sizing:border-box;width:auto!important;min-width:0!important;max-width:none!important;padding:6px;vertical-align:top;font-size:12px!important;line-height:18px!important;overflow-wrap:anywhere;white-space:normal}
  #appShell .cs-history-view .cs-movement-table th{position:sticky;top:0;z-index:1;background:var(--cs-soft,#f1f5f9);font-size:11px!important}
  #appShell .cs-history-view .cs-movement-table td{position:static}
  #appShell .cs-history-view .cs-movement-table .cs-history-select{text-align:center}
  #appShell .cs-history-view .cs-movement-table td small{display:block;color:var(--cs-muted,#475569);font-size:10px!important;line-height:15px!important}
  #appShell .cs-history-view .cs-movement-table td strong{font-size:12px!important;line-height:18px!important}
  #appShell .cs-history-view .cs-movement-table .cs-history-route>span{display:block;margin-bottom:3px}
  #appShell .cs-history-view .cs-movement-table .cs-history-route>span>small{display:inline;margin-right:4px;font-weight:600}
  #appShell .cs-history-view .cs-history-status{display:inline-block;max-width:100%;padding:3px 5px;border:1px solid var(--cs-border,#cbd5e1);border-radius:4px;background:var(--cs-soft,#f8fafc);font-size:11px!important;line-height:16px!important;font-weight:600}
  #appShell .cs-history-view .cs-history-details{min-width:0;margin-top:3px}
  #appShell .cs-history-view .cs-history-details summary{cursor:pointer;font-size:11px!important;line-height:18px!important;color:var(--cs-accent,#0f766e);font-weight:600}
  #appShell .cs-history-view .cs-history-details dl{padding:5px;margin:4px 0 0;border:1px solid var(--cs-border,#cbd5e1);border-radius:4px;background:var(--cs-soft,#f8fafc)}
  #appShell .cs-history-view .cs-history-details dt{font-size:10px!important;line-height:15px!important;font-weight:600;color:var(--cs-muted,#475569)}
  #appShell .cs-history-view .cs-history-details dd{font-size:11px!important;line-height:16px!important;margin:0 0 5px;overflow-wrap:anywhere}
  #appShell .cs-history-view .cs-history-identity{display:block;margin-top:2px;font-size:10px!important;line-height:15px!important;color:var(--cs-muted,#475569)}
  #appShell .cs-history-view .cs-movement-table button{height:auto;min-height:25px;max-width:100%;padding:2px 7px;font-size:11px!important;line-height:19px!important;white-space:normal}
  #appShell .cs-history-view .cs-history-help{flex:none;margin:0;font-size:10px;line-height:16px;color:var(--cs-muted,#475569)}
  @container stock-history (max-width:760px){
    #appShell .cs-history-view .cs-movement-table{display:block}
    #appShell .cs-history-view .cs-movement-table :is(colgroup,thead){display:none}
    #appShell .cs-history-view .cs-movement-table tbody{display:block}
    #appShell .cs-history-view .cs-movement-table .cs-history-row{display:grid;grid-template-columns:26px minmax(0,1fr) minmax(0,1fr);border-bottom:1px solid var(--cs-border,#cbd5e1);gap:2px}
    #appShell .cs-history-view .cs-movement-table .cs-history-row td{display:block;border:0;padding:4px;min-width:0}
    #appShell .cs-history-view .cs-movement-table .cs-history-select{grid-column:1;grid-row:1 / span 3}
    #appShell .cs-history-view .cs-movement-table .cs-history-book{grid-column:2 / -1;grid-row:1}
    #appShell .cs-history-view .cs-movement-table .cs-history-action{grid-column:2 / -1}
    #appShell .cs-history-view .cs-movement-table td:not(.cs-history-select):not(.cs-history-book)::before{content:attr(data-history-label);display:block;color:var(--cs-muted,#475569);font-size:10px;line-height:15px;font-weight:600;margin-bottom:2px}
    #appShell .cs-history-view .cs-history-perform-label{margin-left:0}
  }
}
