.database-view-tabs.signed-history-hide-tabs{display:none!important}
#databaseSummaryCards.hidden,#databaseViewStatus.hidden{display:none!important}
.signed-history-shell,.signed-history-detail{display:flex;min-height:0;flex:1;flex-direction:column;gap:12px}
.signed-history-heading{margin:0;padding:0 0 12px}
.signed-history-heading h3{margin:0 0 5px;font-size:20px;color:#062f50}
.signed-history-heading p{margin:0;color:#557084;font-size:13px}
.signed-history-metrics{grid-template-columns:repeat(5,minmax(140px,1fr));margin:0}
.signed-history-query{display:grid;grid-template-columns:minmax(130px,.7fr) minmax(150px,.8fr) minmax(190px,1fr) minmax(260px,1.5fr) auto auto;align-items:end;gap:10px;padding:12px;border:1px solid #d7e4eb;border-radius:10px;background:#f8fbfc}
.signed-history-query label{display:flex;min-width:0;flex-direction:column;gap:5px;color:#31566e;font-size:12px;font-weight:650}
.signed-history-query input,.signed-history-query select{box-sizing:border-box;width:100%;height:36px;border:1px solid #c8d9e3;border-radius:5px;background:#fff;padding:0 10px;color:#173c57}
.signed-history-query button{width:auto;min-width:72px;height:36px;margin:0;padding:0 13px}
.signed-history-table-wrap{flex:1;min-height:260px;max-height:none;border:1px solid #d7e4eb;border-radius:10px}
.signed-history-table{min-width:1420px}
.signed-history-table tbody tr{cursor:pointer}
.signed-history-table tbody tr:hover,.signed-history-table tbody tr:focus{background:#eef9f8;outline:none}
.signed-history-table td strong{display:block;color:#0b3b5b;font-weight:700}
.signed-history-table td small{display:block;margin-top:3px;color:#688092;font-size:11px;line-height:1.35}
.signed-history-badge{display:inline-flex;align-items:center;white-space:nowrap;border-radius:999px;padding:4px 9px;background:#edf2f6;color:#4a6374;font-size:12px;font-weight:700}
.signed-history-badge.is-current{background:#dff5ef;color:#087668}
.signed-history-badge.is-past{background:#fff1da;color:#9b6100}
.signed-history-pagination{justify-content:flex-start;gap:9px;margin:0}
.signed-history-error{border-left:3px solid #d92d20;background:#fff2f0;padding:9px 12px;color:#9d241a;font-size:13px}
.signed-history-empty{display:flex;min-height:84px;align-items:center;justify-content:center;color:#6a8190}
.signed-history-detail-header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:14px;padding:14px;border:1px solid #d7e4eb;border-radius:10px;background:linear-gradient(135deg,#f1fbfa,#f8fbfd)}
.signed-history-detail-header button{width:auto;height:34px;margin:0}
.signed-history-detail-header span{color:#168d8c;font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.signed-history-detail-header h3{margin:4px 0;color:#073653;font-size:23px}
.signed-history-detail-header p{display:flex;align-items:center;gap:8px;margin:0;color:#5a7487}
.signed-history-detail-id{color:#577083;font-size:12px;font-weight:700}
.signed-history-detail-tabs{display:flex;gap:4px;overflow-x:auto;border-bottom:1px solid #d5e2e9}
.signed-history-detail-tabs button{width:auto;min-width:max-content;margin:0;border:0;border-bottom:3px solid transparent;background:transparent;padding:10px 13px;color:#48677a;font-weight:650}
.signed-history-detail-tabs button.active{border-bottom-color:#159898;color:#087b7b}
.signed-history-detail-content{min-height:300px;overflow:auto;padding:2px 0 12px}
.signed-history-field-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.signed-history-field-grid>div{min-height:62px;border:1px solid #dce7ed;border-radius:8px;background:#fff;padding:10px 12px}
.signed-history-field-grid>div.is-wide{grid-column:span 2}
.signed-history-field-grid span{display:block;margin-bottom:5px;color:#6b8190;font-size:11px}
.signed-history-field-grid strong{display:block;white-space:pre-wrap;word-break:break-word;color:#143f5a;font-size:14px}
.signed-history-snapshot-pair,.signed-history-event-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.signed-history-snapshot-pair article,.signed-history-json-card,.signed-history-event,.signed-history-event-pair section{border:1px solid #dce7ed;border-radius:8px;background:#fff;padding:12px}
.signed-history-snapshot-pair h4,.signed-history-json-card h4,.signed-history-detail-content>h4{margin:0 0 9px;color:#133f5a}
.signed-history-json-card{margin-bottom:10px}
.signed-history-detail pre{max-height:420px;overflow:auto;margin:0;border-radius:6px;background:#f6f9fb;padding:10px;color:#28485c;font:12px/1.55 Consolas,"Courier New",monospace;white-space:pre-wrap;word-break:break-word}
.signed-history-events{display:flex;flex-direction:column;gap:8px}
.signed-history-event-summary{margin-bottom:8px;color:#668092;font-size:12px}
.signed-history-event-more{display:flex;justify-content:center;padding:12px 0}
.signed-history-event-more button{width:auto;margin:0}
.signed-history-event header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.signed-history-event header strong{display:block;color:#103e5b}
.signed-history-event header span,.signed-history-event time,.signed-history-event p{color:#6b8190;font-size:11px}
.signed-history-event p{margin:6px 0}
.signed-history-event details summary{cursor:pointer;color:#168786;font-size:12px;font-weight:700}
.signed-history-event h5{margin:0 0 7px;color:#35566c}
.signed-history-contract-load{display:flex;min-height:220px;align-items:center;justify-content:center;flex-direction:column;gap:12px;border:1px dashed #b9ccd7;border-radius:10px;background:#f8fbfc;color:#557084}
.signed-history-contract-load button{width:auto;margin:0}
@media(max-width:1280px){.signed-history-metrics{grid-template-columns:repeat(3,minmax(140px,1fr))}.signed-history-query{grid-template-columns:repeat(3,minmax(160px,1fr))}.signed-history-query button{justify-self:start}.signed-history-field-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.signed-history-metrics,.signed-history-query,.signed-history-field-grid,.signed-history-snapshot-pair,.signed-history-event-pair{grid-template-columns:1fr}.signed-history-field-grid>div.is-wide{grid-column:auto}.signed-history-detail-header{grid-template-columns:1fr}.signed-history-detail-header button{justify-self:start}}

/* R2-041: scoped archive workbench, with independent table scrolling. */
#databaseManagementView:not(.hidden) .signed-history-shell.signed-archive-workspace{height:100%;min-height:0;min-width:0;flex:1 1 0;gap:8px;overflow:hidden}
.signed-archive-workspace .signed-history-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0;flex-wrap:wrap}
.signed-archive-workspace .signed-history-heading p{font-size:12px;color:#617789;margin:0}
.signed-archive-workspace button{width:auto;margin:0;flex:0 0 auto}
.signed-archive-tabs{display:flex;flex:0 0 auto;gap:4px;overflow-x:auto;border-bottom:1px solid #d7e4eb}
.signed-archive-tabs button{min-width:max-content;min-height:40px;padding:8px 16px;border:1px solid transparent;border-bottom:3px solid transparent;background:transparent;color:#476175;font-size:14px;font-weight:600;border-radius:5px 5px 0 0}
.signed-archive-tabs button.active{background:#e8f5f4;border-color:#cde9e6;border-bottom-color:#159898;color:#087b7b}
.signed-archive-tabs button:focus-visible,.signed-archive-workspace button:focus-visible{outline:2px solid #158b91;outline-offset:1px}
#databaseManagementView:not(.hidden) .signed-archive-query{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px;border-radius:6px}
.signed-archive-query label,.signed-archive-profile-query label{display:flex;align-items:center;flex-direction:row;gap:8px;white-space:nowrap}
.signed-archive-query label input{width:180px}
.signed-archive-query label select{width:160px}
.signed-archive-query .signed-history-keyword input{width:clamp(240px,25vw,420px)}
.signed-archive-query button{min-width:64px;height:36px}
.signed-archive-loading{font-size:12px;color:#587285;line-height:1.5}
#databaseManagementView:not(.hidden) .signed-archive-profile-query{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:8px;border-radius:6px}
.signed-archive-profile-query select{width:190px}
.signed-archive-profile-query>span{font-size:12px;color:#617789}
.signed-archive-workspace .signed-archive-metrics{grid-template-columns:repeat(4,minmax(0,1fr));max-width:920px;width:100%;gap:8px}
.signed-archive-metrics>article{min-width:0;padding:10px 12px}
.signed-archive-metrics strong{font-size:22px}
#databaseManagementView:not(.hidden) .signed-archive-workspace>.signed-history-table-wrap{flex:1 1 0;min-height:0;max-height:none;overflow:auto;border-radius:6px}
.signed-archive-workspace .signed-history-table-wrap table{width:100%;border-collapse:collapse}
.signed-archive-workspace .signed-history-table-wrap thead th{position:sticky;top:0;z-index:1;background:#f1f6f9;white-space:nowrap}
.signed-archive-workspace .signed-history-table-wrap :is(th,td){padding:10px 12px;font-size:12px;border-bottom:1px solid #e3ebf0;text-align:left;vertical-align:top}
.signed-archive-workspace .signed-history-table-wrap table:has(.signed-history-empty){height:100%}
.signed-archive-workspace .signed-history-table-wrap td:has(>.signed-history-empty){vertical-align:middle;text-align:center}
.signed-archive-customers{min-width:1560px}
.signed-archive-customers .signed-archive-name{min-width:210px;max-width:330px;white-space:normal;overflow-wrap:anywhere}
.signed-archive-customers .signed-archive-long{min-width:145px;max-width:250px;white-space:normal;overflow-wrap:anywhere}
.signed-archive-customers button,.signed-archive-changes button{padding:5px 9px;min-height:30px;white-space:nowrap;font-size:12px}
.signed-archive-profile-table table{min-width:760px}
.signed-archive-profile-table .signed-archive-field-source{max-width:520px;white-space:normal;overflow-wrap:anywhere}
.signed-archive-profile-table td small{display:block;color:#708395;margin-top:3px}
.signed-archive-changes{min-width:1100px}
.signed-archive-changes .signed-archive-long{max-width:380px;white-space:normal;overflow-wrap:anywhere}
.signed-archive-workspace .signed-history-pagination{display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:8px;margin:0;padding:0;flex:0 0 auto}
.signed-history-pagination label{display:flex;align-items:center;gap:5px;font-size:12px;white-space:nowrap}
.signed-history-pagination :is(input,select){height:32px;width:64px;border:1px solid #c8d9e3;background:#fff;border-radius:4px;padding:3px 6px}
.signed-history-pagination button{height:32px;padding:5px 12px}
.signed-archive-footer{font-size:12px;color:#687e8e;line-height:32px}
.signed-archive-drawer-overlay{position:fixed;inset:0;z-index:1600;display:flex;justify-content:flex-end;background:rgba(10,28,42,.3)}
.signed-archive-drawer{display:flex;flex-direction:column;gap:8px;width:min(900px,82vw);height:100dvh;min-height:0;padding:16px;background:#fff;box-shadow:-8px 0 25px rgba(15,40,60,.15);box-sizing:border-box}
.signed-archive-drawer header{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;flex:0 0 auto}
.signed-archive-drawer h3{font-size:18px;margin:0 0 5px;color:#123e5c}
.signed-archive-drawer p{margin:0;font-size:12px;color:#687e8e;overflow-wrap:anywhere}
#databaseManagementView .signed-archive-drawer>.foundation-table-scroll{flex:1 1 0;min-height:0;max-height:none;overflow:auto;border:1px solid #d7e4eb;border-radius:6px}
.signed-archive-drawer table{table-layout:fixed;width:100%;border-collapse:collapse}
.signed-archive-drawer th:first-child{width:20%}
.signed-archive-drawer :is(th,td){padding:10px;border-bottom:1px solid #e3ebf0;vertical-align:top;font-size:12px;text-align:left;overflow-wrap:anywhere}
.signed-archive-drawer thead th{position:sticky;top:0;background:#f1f6f9}
.signed-archive-change-value{white-space:pre-wrap;overflow-wrap:anywhere}
.signed-archive-drawer footer{display:flex;justify-content:flex-end;flex:0 0 auto}
.signed-archive-drawer button{width:auto;min-height:34px;margin:0}
@media(max-width:760px){
  #databaseManagementView:not(.hidden) .signed-history-shell.signed-archive-workspace{height:auto;min-height:100%;overflow:visible}
  #databaseManagementView:not(.hidden) .signed-archive-workspace>.signed-history-table-wrap{flex:1 0 320px;min-height:320px;max-height:65dvh}
  .signed-archive-tabs button{padding:8px 10px;font-size:13px}
  .signed-archive-query .signed-history-keyword{width:100%}
  .signed-archive-query .signed-history-keyword input{flex:1;min-width:0;width:100%}
  .signed-archive-workspace .signed-archive-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .signed-archive-drawer{width:100vw;padding:8px}
}
