.tags-toolbar,.tag-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin:12px 0; }
.tags-toolbar select { min-width:130px; max-width:260px; }
.file-tags { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; min-width:0; }
.file-tag { display:inline-block; max-width:100%; padding:3px 9px; border-radius:7px; font-size:12px; font-weight:600; overflow-wrap:anywhere; background:#eef2f6; color:#344054; border:1px solid #d7dee7; }
.tag-blue { background:#eef4ff; color:#234ea0; border-color:#c9dafe; }
.tag-green { background:#ecfdf3; color:#17633e; border-color:#b7e6cc; }
.tag-amber { background:#fffaeb; color:#805500; border-color:#f3dfa6; }
.tag-red { background:#fff1f0; color:#a42a24; border-color:#f6c7c2; }
.tag-purple { background:#f6f0ff; color:#6941a5; border-color:#dfcdf7; }
.tags-dialog { width:min(740px, calc(100vw - 24px)); max-height:90vh; padding:0; }
.tags-scroll { padding:0 24px 24px; overflow:auto; max-height:calc(90vh - 110px); }
.tags-dialog h2 { overflow-wrap:anywhere; }
.tag-choices { border:1px solid #d7dee7; border-radius:12px; padding:12px; margin:16px 0; }
.tag-choice-group { display:flex; flex-wrap:wrap; gap:8px; }
.tag-choice-group p { flex-basis:100%; margin:8px 0 0; font-size:13px; color:#596579; }
.tag-choice { display:flex; align-items:center; gap:6px; cursor:pointer; min-height:40px; }
.tag-choice input { width:18px; height:18px; }
.tag-create { display:grid; grid-template-columns:minmax(0,1fr) minmax(100px,140px); gap:8px 12px; margin:20px 0; }
.tag-create h3,.tag-create button { grid-column:1/-1; }
.tag-create label[for=file-tag-color] { grid-column:2; grid-row:2; }
.tag-create #file-tag-color { grid-column:2; grid-row:3; }
.tag-create input,.tag-manage-row input { min-width:0; width:100%; }
.tag-manage-row { display:grid; grid-template-columns:minmax(0,1fr) 100px auto auto; gap:8px; border-top:1px solid #e0e5ec; padding:14px 0; }
.tag-manage-row p { grid-column:1/-1; margin:0; }
.tags-dialog button:focus-visible,.tag-choice input:focus-visible { outline:3px solid #769cf4; outline-offset:3px; }
@media(max-width:600px) {
  .tags-scroll { padding:0 14px 18px; }
  .tag-manage-row { grid-template-columns:minmax(0,1fr) 100px; }
  .tags-toolbar select { flex:1; max-width:100%; }
  .tag-actions button { width:100%; }
}

.tag-combination { margin:12px 0; padding:12px; border:1px solid #d7dee7; border-radius:10px; }
.tag-combination summary { cursor:pointer; min-height:30px; font-weight:600; }
.tag-picker { min-width:0; margin:12px 0; }
.tag-picker > label { display:block; font-size:13px; margin-bottom:6px; }
.tag-picker input[type=search],.tag-combination select { width:100%; min-width:0; }
.tag-picker-list { display:flex; flex-wrap:wrap; gap:6px 12px; max-height:210px; overflow:auto; margin-top:8px; }
.tag-picker-list .tag-choice { max-width:100%; }
.tag-choice input { flex-shrink:0; }
#file-tags-search { width:100%; }
#saved-views-host { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.views-dialog { width:min(660px,calc(100vw - 24px)); max-height:90vh; padding:0; overflow:auto; }
.views-body { padding:0 24px 24px; }
.views-body > label { display:block; margin:12px 0 6px; }
.views-body > input,.views-body > select { width:100%; min-width:0; }
.views-body p { overflow-wrap:anywhere; }
#upload-scope-dialog { max-height:90vh; overflow:auto; }
@media (max-width:420px) { .views-body { padding:0 14px 16px; } .tag-actions .button { flex:1 1 130px; } }
