/* Shared control geometry: text must fit inside the border at every reading size. */
html select:not([multiple]):not([size]){box-sizing:border-box;height:auto!important;min-height:calc(1.5em + 20px)!important;line-height:1.5!important;padding-top:9px!important;padding-bottom:9px!important;text-indent:0;vertical-align:middle}
html .field input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]){box-sizing:border-box;height:auto!important;min-height:calc(1.5em + 20px)!important;line-height:1.5;padding:9px 12px}
html .field textarea{box-sizing:border-box;line-height:1.6;padding:11px 12px}
html select option{background:var(--surface);color:var(--text)}
.att-count{display:inline-flex;gap:5px;align-items:center;vertical-align:middle;white-space:nowrap}.att-count svg,.att-heading svg,.att-drop svg{width:16px;height:16px;flex-shrink:0}
.task-title .att-count{margin-top:5px}.na-history-item .att-count{margin-left:auto}.na-history-item{flex-wrap:wrap}
.att-editor{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}
.att-heading{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-bottom:14px;flex-wrap:wrap}.att-heading strong{display:flex;align-items:center;gap:7px;font-size:14px}.att-heading strong span{font-size:11px;padding:3px 7px;border-radius:7px;background:var(--surface-soft);color:var(--muted)}.att-heading small{font-size:11px;color:var(--muted)}
.att-file{display:flex;gap:12px;align-items:center;border:1px solid var(--line);border-radius:11px;background:var(--surface-soft);padding:12px;margin-bottom:9px;min-width:0}
.att-file-type{font-size:10px;font-weight:750;letter-spacing:.05em;color:var(--nhs);background:var(--v9-accent-soft);border-radius:8px;min-width:43px;padding:12px 6px;text-align:center}
.att-file-info{flex:1;min-width:0;font-size:13px;overflow-wrap:anywhere}.att-file-info strong{display:block;font-size:13px;line-height:1.5}.att-file-info small{display:block;color:var(--muted);font-size:11px;margin-top:3px}
.att-file-actions{display:flex;gap:5px;align-items:center;flex-wrap:wrap}.att-file-actions a{text-decoration:none}.att-empty{color:var(--muted);font-size:12px;padding:10px 0}
.att-drop{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:17px;border:1px dashed var(--line);border-radius:12px;background:var(--surface);transition:border-color var(--motion-fast),background var(--motion-fast)}.att-drop.dragover{border-color:var(--nhs);background:var(--v9-accent-soft)}.att-drop>span{font-size:11px;color:var(--muted);flex-basis:100%;margin-top:4px}
.att-drop label{position:relative;display:inline-flex;align-items:center;gap:7px;cursor:pointer;overflow:hidden}.att-file-input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.att-drop label:focus-within{outline:3px solid var(--v9-focus);outline-offset:2px}
.att-existing{display:flex;gap:8px;margin-top:10px}.att-existing select{min-width:0;flex:1;max-width:100%}
.att-status{font-size:11px;line-height:1.6;color:var(--muted);margin:11px 0}.att-status.busy::before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--nhs);margin-right:7px;animation:att-upload 1.2s ease-in-out infinite}
.att-errors{font-size:12px;line-height:1.6;color:#ad3244;padding:11px;background:color-mix(in srgb,#df5060 8%,var(--surface));border-radius:8px}:is([data-theme=dark],[data-tone="dark"]) .att-errors{color:#ffb0bd}
.att-removed{margin-top:15px;padding-top:12px;border-top:1px solid var(--line)}.att-removed summary{font-size:12px;color:var(--muted);cursor:pointer;margin-bottom:10px}
.att-event-files{padding:16px;font-size:12px;color:var(--muted)}.att-event-files .att-file{flex-wrap:wrap}.att-event-files .att-file-info{flex-basis:100%}
.att-library{padding:22px}.att-library-head{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:12px}.att-library-head input{min-height:42px;padding:10px 12px;max-width:100%}.att-library-list{margin-top:20px}.att-linked-records{display:flex;gap:4px;flex-wrap:wrap;font-size:11px;color:var(--muted);margin-top:8px}.att-linked-records .btn{white-space:normal;text-align:left}
.att-backup-notice{padding:15px 18px;margin:0 0 18px;background:var(--v9-accent-soft);color:var(--text);border:1px solid var(--line);border-radius:12px;font-size:13px;line-height:1.6}
/* Add-a-file zone on the Files page — same dashed affordance as the in-record
   drop zone, so uploading here reads the same as uploading anywhere else. */
.att-lib-upload{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:16px 18px;margin-bottom:16px;border:1px dashed var(--line);border-radius:12px;background:var(--surface);transition:border-color var(--motion-fast),background var(--motion-fast)}
.att-lib-upload.dragover{border-color:var(--nhs);background:var(--v9-accent-soft)}
.att-lib-upload label{position:relative;display:inline-flex;align-items:center;gap:7px;cursor:pointer;overflow:hidden}
.att-lib-upload label svg{width:16px;height:16px;flex-shrink:0}
.att-lib-hint{font-size:11.5px;color:var(--muted)}
.att-lib-status{flex-basis:100%;margin:6px 0 0;font-size:11.5px;color:var(--muted)}
.att-lib-status.busy::before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--nhs);margin-right:7px;animation:att-upload 1.2s ease-in-out infinite}
.att-assign{white-space:nowrap}
@keyframes att-upload{50%{opacity:.35}}
@media(max-width:700px){.att-file{flex-wrap:wrap;gap:9px}.att-file-actions{width:100%;justify-content:flex-end}.att-drop .btn{min-height:42px}.att-heading small{flex-basis:100%}.att-existing{flex-wrap:wrap}.att-existing select{flex-basis:100%;font-size:16px}.att-library{padding:14px}.att-library-head input{width:100%;font-size:16px}.att-count{white-space:normal}.info-row>.att-count{max-width:90px;font-size:10px}.att-file-info strong{font-size:14px}}
@media(prefers-reduced-motion:reduce){.att-status.busy::before{animation:none}}
/* Rename an original in place (9 Oct): the ending sits beside the box and cannot be typed over */
.att-rename-form{display:grid;gap:8px;margin-top:2px}.att-rename-actions{display:flex;gap:6px}
.att-rename-row{display:flex;align-items:center;gap:8px}.att-rename-row input{flex:1;min-width:0}.att-rename-row span{color:var(--muted);font-weight:700;white-space:nowrap}
@media(max-width:700px){.att-rename-row input{font-size:16px}}
.att-file-actions[hidden]{display:none!important}
