/* Global tags: tags.js draws them; tags.py keeps them. */
.tag-chips { display: inline-flex; flex-wrap: wrap; gap: .25rem; vertical-align: middle; }
.tag-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .08rem .5rem; border: 1px solid #c7d7fe;
  border-radius: 999px; background: #eef4ff; color: #2f3a8f; font-size: .78rem; font-weight: 600; line-height: 1.5;
  white-space: nowrap; }
button.tag-chip { cursor: pointer; font-family: inherit; }
button.tag-chip:hover { border-color: var(--accent); background: #e0e9ff; }
.tag-chip.inherited { border-style: dashed; background: #f5f7fb; color: #475467; cursor: default; }
.tag-chip > button { border: 0; background: none; padding: 0 0 0 .1rem; color: inherit; font-size: .72rem; cursor: pointer; opacity: .65; }
.tag-chip > button:hover { opacity: 1; color: #b42318; }
.tag-field { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: .5rem 0 .7rem; padding: .45rem .7rem;
  border: 1px solid var(--line); border-radius: .55rem; background: #f9fafb; font-size: .9rem; }
.tag-field > strong { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tag-field .select-search { width: 11rem; }
.tag-field .link-button { margin-left: auto; font-size: .84rem; white-space: nowrap; }

.tags-dialog { width: min(46rem, calc(100% - 2rem)); max-height: calc(100% - 3rem); padding: 1.5rem 1.6rem 1.3rem; border: 0;
  border-radius: .8rem; color: var(--ink); background: var(--card); box-shadow: 0 18px 50px rgba(12,54,84,.25); }
.tags-dialog::backdrop { background: rgba(12,54,84,.4); }
.tags-dialog h2 { margin: 0 2rem .4rem 0; font-size: 1.2rem; }
.tags-dialog h3 { margin: 1rem 0 .4rem; font-size: 1rem; }
.tags-dialog .dialog-close { position: absolute; top: .8rem; right: .9rem; }
.tags-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1rem; }
.tags-head h3 { margin: 0 auto 0 0; }
.tags-head .user-search { width: 12rem; }
.tags-list { max-height: 22rem; overflow-y: auto; }
.tag-table { width: 100%; }
.tag-table td { vertical-align: middle; white-space: normal; }
.tag-table td small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.35; }
.tag-table .row-actions { text-align: right; white-space: nowrap; }
.tag-table .row-actions .link-button { margin-left: .7rem; }
.tag-table tr.tag-focus td { background: #fffaeb; }
.tags-note { margin: .5rem 0 0; padding: .4rem .7rem; border-radius: .45rem; background: #ecfdf3; color: #05603a; font-size: .9rem; }
.tags-note.error { background: #fef3f2; color: #b42318; }
.tags-dialog form label { display: block; margin-bottom: .6rem; }
.tags-dialog form input, .tags-dialog form textarea { width: 100%; box-sizing: border-box; }
.role-function { display: flex; align-items: flex-start; gap: .5rem; padding: .35rem .2rem; border-top: 1px solid var(--line); cursor: pointer; }
.role-function input { width: auto; margin-top: .2rem; }
.role-function small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.25; }
