/* Document layout only: all colors, type and surfaces come from the current theme. */
button.document-card-action{appearance:none;width:100%;font:inherit;color:inherit;background:transparent;text-align:left;cursor:pointer;border:0;border-bottom:1px solid var(--line);border-radius:0;display:flex;align-items:center;gap:10px;padding:12px 0}
button.document-card-action .docmain,button.document-card-action .grow{display:block;min-width:0;flex:1}
button.document-card-action .doctitle,button.document-card-action .docmeta{display:block}
button.document-card-action>.status{flex-shrink:0;max-width:35%;white-space:normal;text-align:center}
.document-action-icon{width:20px;height:20px;flex:none;display:block}
button.document-card-action>.document-action-icon{width:16px;color:var(--muted)}
button.document-card-action:focus-visible,.modalback.detail-action-panel .btn:focus-visible{outline:2px solid var(--green);outline-offset:3px}
button.document-card-action:hover .doctitle{color:var(--green)}
.modalback.detail-action-panel{padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
.modalback.detail-action-panel .modal{max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overscroll-behavior:contain;overflow-x:hidden}
.modalback.detail-action-panel .modalhead{align-items:flex-start;gap:12px}
.modalback.detail-action-panel .modalhead>div{min-width:0;overflow-wrap:anywhere}
.modalback.detail-action-panel .detail-panel-close{min-height:44px;flex:none}
.detail-summary-body .detail-kv{grid-template-columns:65px minmax(0,1fr);padding:6px 0;gap:8px;font-size:12px}
.detail-summary-body .detail-value>.small{margin-top:0!important}
.detail-summary-body .detail-value{overflow-wrap:anywhere;min-width:0}
.detail-summary-body .doc-detail-status{padding:9px;margin:8px 0}
.detail-summary-body .doc-detail-status .small{display:none}
.document-action-group{margin-top:16px;min-width:0}
.document-action-group h4{font-size:13px;margin:0 0 8px}
.document-primary-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.modalback.detail-action-panel .document-primary-actions .btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:10px 4px;min-height:70px;min-width:0;font-size:12px;overflow-wrap:anywhere}
.document-action-list{display:grid;gap:4px}
.modalback.detail-action-panel .document-action-row{display:flex;align-items:center;gap:10px;text-align:left;min-height:44px;width:100%;padding:9px 12px;font-size:13px}
.document-action-row>span{flex:1;min-width:0;overflow-wrap:anywhere}
.document-action-row>.document-action-icon:last-child{width:15px}
.document-delete-action{border-top:1px solid var(--line);margin-top:16px;padding-top:12px}
body:has(.modalback:not(.hidden)) #helpInboxButton{display:none}
@media(max-width:320px){.document-primary-actions{grid-template-columns:1fr}.modalback.detail-action-panel .document-primary-actions .btn{flex-direction:row;min-height:44px}button.document-card-action{gap:6px}}

/* Sibling controls keep weapon management separate from document expansion. */
.weapon-doc-group-header{display:flex;align-items:stretch}
.weapon-doc-group-header .weapon-doc-group-head{flex:1;min-width:0;width:auto;gap:8px}
.weapon-doc-group-head .grow{min-width:0}
.weapon-doc-group-head .weapon-doc-group-title,.weapon-doc-group-head .weapon-doc-group-meta,.weapon-doc-group-head .weapon-doc-group-next,.weapon-doc-group-head .file-summary{display:block;overflow-wrap:anywhere}
.weapon-doc-group-toggle{appearance:none;border:0;border-left:1px solid var(--line);background:transparent;color:var(--green);width:48px;min-width:44px;min-height:44px;cursor:pointer}
.weapon-doc-group-head .document-action-icon{width:16px;color:var(--muted)}
.weapon-doc-group-header button:focus-visible{outline:2px solid var(--green);outline-offset:-3px}
#weaponManagementBody.detail-summary-body .detail-kv{grid-template-columns:95px minmax(0,1fr)}
#weaponManagementBody .detail-value{white-space:pre-wrap}
#weaponManagementDocs .document-card-action{padding:10px 0}
@media(max-width:360px){.weapon-doc-group-header .weapon-doc-group-head{flex-wrap:wrap}.weapon-doc-group-head .weapon-doc-group-side{margin-left:0}.weapon-doc-group-head .grow{flex-basis:100%}}
