.legal-shell{max-width:960px;margin:auto;padding:36px 24px 100px}.legal-shell h1,.legal-shell h2,.legal-shell h3,.legal-dialog h2{letter-spacing:normal;word-spacing:.04em;text-wrap:pretty;line-height:1.25}.legal-shell h1{font-size:clamp(2rem,7vw,3.5rem)}.legal-shell h2{font-size:1.65rem}.legal-shell h3{font-size:1.15rem}.legal-shell p,.legal-dialog p{line-height:1.65}.legal-shell a,.legal-shell p,.legal-shell label,.legal-dialog a,.legal-dialog p{overflow-wrap:anywhere}.legal-card,.legal-permission{padding:20px;border:1px solid #d4dbce;border-radius:14px;margin:16px 0;background:#fafbf7}.legal-notice{padding:16px;border-left:4px solid #816b35;background:#f3eedc}.legal-small{font-size:.92rem;color:#536357}.legal-status{min-height:1.5em;white-space:pre-wrap}.legal-status[data-error=true]{color:#9d3030}.legal-form{display:grid;gap:12px}.legal-form label:not(.legal-check){display:grid;gap:8px}.legal-form input:not([type=checkbox]),.legal-form textarea,.legal-form select{font:inherit;width:100%;min-width:0;box-sizing:border-box;padding:12px;border:1px solid #a9b6a6;border-radius:8px;background:white;color:#203529;font-size:16px}.legal-form textarea{resize:vertical;min-height:110px}.legal-form button,.legal-actions button,.legal-actions a{min-height:44px}.legal-check{display:flex;gap:12px;align-items:flex-start;line-height:1.5}.legal-check input{flex:none;width:22px;height:22px;margin:2px 0;accent-color:#225944}.legal-actions,.legal-dialog-head{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}.legal-dialog{background:#f6f5ef;color:#22332a;border:1px solid #b1bba9;border-radius:18px;width:min(640px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:24px;box-sizing:border-box;overscroll-behavior:contain}.legal-dialog::backdrop{background:#11261dc9}.legal-dialog h2{font-size:1.6rem;margin:0}.legal-dialog .legal-permission{margin:0}.legal-document-text{white-space:pre-wrap;max-height:260px;overflow:auto}.legal-list{padding:0;list-style:none}.legal-list>li{margin:12px 0}.legal-state{display:inline-block;padding:5px 10px;border:1px solid #b4b7a5;border-radius:8px;color:#4f523d;background:#efefdf;font-size:.9rem}.legal-state[data-state=expired],.legal-state[data-state=overdue]{background:#f8eadc;color:#774117}.legal-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.legal-history{white-space:pre-wrap}.legal-data-counts{display:flex;gap:20px;flex-wrap:wrap}.legal-data-counts div{min-width:140px}.legal-data-counts dd{margin:8px 0;font-size:1.3rem}.legal-form summary,.legal-permission summary{padding:12px 0;cursor:pointer}.legal-entry{margin-top:14px}.legal-owner-row{scroll-margin:20px}.legal-shell [hidden],.legal-dialog [hidden]{display:none!important}@media(max-width:600px){.legal-shell{padding:24px 16px 96px}.legal-grid{grid-template-columns:1fr}.legal-card{padding:16px}.legal-dialog{padding:16px}.legal-dialog-head{align-items:flex-start}.legal-dialog-head button{padding-left:0}.legal-actions{align-items:stretch}.legal-actions>button,.legal-actions>a{flex:1 1 100%}.legal-dialog .primary{width:100%;white-space:normal}.legal-check{gap:9px}}
/* A fieldset otherwise keeps its intrinsic minimum width on narrow screens. */
.legal-form fieldset{min-width:0;max-width:100%;box-sizing:border-box;border:1px solid #c8d0c2;border-radius:10px;padding:12px}.legal-form legend{max-width:100%;white-space:normal;overflow-wrap:anywhere}.legal-form select{width:100%;max-width:100%}.legal-card>form{min-width:0}.legal-card summary{overflow-wrap:anywhere}

.legal-list li{overflow-wrap:anywhere}.legal-form label{min-width:0;grid-template-columns:minmax(0,1fr)}
/* WebKit's native select can paint its long option text outside the sized control.
   Keep that internal overflow within the label while leaving room for the focus ring. */
.legal-form label:has(select){overflow-x:clip;overflow-clip-margin:8px}
