#welcome-dialog {width:min(680px,calc(100vw - 24px));padding:24px}
.welcome-heading,.tag-heading {display:flex;align-items:start;gap:12px;justify-content:space-between}
.welcome-heading h2 {font-size:24px;line-height:1.3;margin:0}
.welcome-heading button {flex-shrink:0}
.welcome-steps {display:grid;gap:12px;padding-inline-start:24px;margin:20px 0}
.welcome-steps li {padding-inline-start:4px;line-height:1.5}
.welcome-steps strong,.welcome-steps span {display:block}
.welcome-steps span {font-size:14px;color:var(--md-sys-color-on-surface-variant)}
.welcome-example-note {background:var(--md-sys-color-secondary-container);padding:16px;border-radius:12px;font-size:14px;line-height:1.5}
#welcome-dialog .dialog-actions {flex-wrap:wrap;justify-content:flex-start}
#tags-dialog {width:min(1000px,calc(100vw - 24px));padding:24px}
.tag-heading h2 {margin:4px 0;font-size:20px;overflow-wrap:anywhere}
#tags-dialog section,#tags-dialog details {margin-top:16px;border-top:1px solid var(--md-sys-color-outline-variant);padding-top:16px}
#tags-dialog h3 {font-size:16px;margin:0 0 12px}
#tags-dialog summary {cursor:pointer;min-height:44px;padding:12px 0;font-weight:650}
.tag-checkboxes {display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.tag-checkboxes label {display:flex;align-items:center;gap:8px;min-height:44px;padding:6px 10px;border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;font-size:14px;overflow-wrap:anywhere}
.tag-checkboxes input {width:20px;min-height:20px;margin:0;flex-shrink:0}
.tag-filter-grid {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}
.tag-history,.tag-view-row {display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.tag-view-row>button:first-child {flex:1;text-align:left;justify-content:flex-start;min-width:160px}
.tag-catalog-row {display:grid;grid-template-columns:minmax(120px,1fr) auto auto auto;gap:8px;align-items:center;margin:8px 0;font-size:13px}
#tags-create-form {grid-template-columns:minmax(0,1fr) auto;align-items:end;margin-bottom:12px}
#tags-create-form label {grid-column:1/-1}
#tags-error,#reference-limit {color:var(--md-sys-color-error);overflow-wrap:anywhere}
#reference-dialog {width:min(1400px,calc(100vw - 16px));height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);padding:16px}
#reference-dialog[open] {display:flex;flex-direction:column;gap:8px}
#reference-note {margin:0}
#reference-stage {flex:1;min-height:160px;overflow:auto;border:1px solid var(--md-sys-color-outline-variant);border-radius:12px;overscroll-behavior:contain}
#reference-world {position:relative;min-width:100%;min-height:100%}
#reference-inner {position:absolute;transform-origin:top left}
.reference-card {position:absolute;width:224px;min-height:64px;padding:12px;text-align:left;border:1px solid var(--md-sys-color-outline-variant);border-radius:12px;background:var(--md-sys-color-surface-container-lowest);white-space:normal;overflow-wrap:anywhere;display:flex;flex-direction:column;align-items:stretch;gap:8px;font-size:14px;line-height:1.5}
.reference-card strong {font-weight:600}.reference-card span {font-size:12px}
.reference-root {background:var(--md-sys-color-secondary-container)}
.reference-edges {position:absolute;pointer-events:none;overflow:visible}
.reference-edges path {fill:none;stroke:var(--md-sys-color-outline);stroke-width:2}
.reference-controls {display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.reference-controls button {font-size:13px;padding:8px}
#reference-zoom {min-width:48px;text-align:center;font-size:13px}
@media(max-width:599px){
 #welcome-dialog,#tags-dialog {padding:16px}.welcome-heading h2 {font-size:21px}
 #welcome-dialog .dialog-actions button {width:100%}
 .tag-filter-grid {grid-template-columns:minmax(0,1fr)}
 .tag-catalog-row {grid-template-columns:minmax(0,1fr) auto}.tag-catalog-row input {grid-column:1/-1}
 .tag-catalog-row span {grid-column:1/-1}
 #tags-create-form {grid-template-columns:minmax(0,1fr)}
 #tags-dialog input,#tags-dialog select {font-size:16px}
 #reference-kinds label {font-size:13px;padding:4px 6px}
}
/* Tag workspace and compact object badges share local icon assets. */
.tags-panel {overflow:auto;min-height:0;flex:1;padding:0 24px 32px;overscroll-behavior:contain}
#tags-content {width:100%;max-width:1120px;margin:auto;min-width:0}
#tags-content section {margin:20px 0;padding:16px;border:1px solid var(--md-sys-color-outline-variant);border-radius:12px;background:var(--md-sys-color-surface-container-lowest)}
#tags-content h3 {margin:0 0 14px}#tags-content h4 {margin:16px 0 8px}
#tags-content input,#tags-content select {min-width:0;width:100%}
#tags-content input[type=checkbox] {width:20px;min-height:20px;margin:0;flex-shrink:0}
#tags-create-form {display:grid;grid-template-columns:minmax(0,1fr) minmax(120px,180px) auto;gap:8px;align-items:end}
#tags-create-form label {display:block}
.tag-catalog-row {grid-template-columns:24px minmax(100px,1fr) minmax(110px,160px) auto auto auto}
.tag-filter-grid {grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr)}
.tag-object-list {max-height:440px;overflow:auto;overscroll-behavior:contain;border-block:1px solid var(--md-sys-color-outline-variant)}
.tag-object-row {display:flex;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--md-sys-color-outline-variant)}
.tag-object-row>label {display:flex;align-items:center;gap:12px;min-width:0;flex:1;cursor:pointer;font-size:14px}
.tag-object-row>label>span {display:flex;flex-direction:column;gap:4px;overflow-wrap:anywhere;min-width:0}
.tag-object-row small {color:var(--md-sys-color-on-surface-variant);font-size:12px}.tag-object-row>button {font-size:13px;flex-shrink:0}
.object-tag-icons {display:flex;gap:5px;align-items:center;flex-wrap:nowrap;min-height:20px;max-width:100%;font-size:11px;margin-top:4px}
.tag-badge {display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;flex-shrink:0;border-radius:6px;color:var(--md-sys-color-on-secondary-container);background:var(--md-sys-color-secondary-container)}
.tag-badge[data-icon]::before {width:16px;height:16px}.tag-overflow {font-size:11px;white-space:nowrap}

#tags-merge-form {max-width:700px}#tags-merge-preview {overflow-wrap:anywhere;font-size:14px}
@media(max-width:900px){.tag-catalog-row {grid-template-columns:24px minmax(80px,1fr) minmax(100px,140px)}.tag-catalog-row>button {font-size:12px}.tag-catalog-row>button:nth-child(4){grid-column:1/2}.tag-catalog-row>button:nth-child(5){grid-column:2/3}.tag-catalog-row>button:nth-child(6){grid-column:3/4}}
@media(max-width:599px){.tags-panel {padding:0 12px 24px}#tags-content section {padding:12px;margin:12px 0}.tag-filter-grid,#tags-create-form {grid-template-columns:minmax(0,1fr)}.tag-catalog-row input {grid-column:auto}.tag-catalog-row {grid-template-columns:24px minmax(0,1fr)}.tag-catalog-row select {grid-column:2}.tag-catalog-row>button:nth-child(4){grid-column:1/-1}.tag-catalog-row>button:nth-child(5){grid-column:1/-1}.tag-catalog-row>button:nth-child(6){grid-column:1/-1}.tag-object-row {align-items:stretch;flex-direction:column;gap:4px}.tag-object-row>button {align-self:flex-end}.tag-checkboxes label {max-width:100%;font-size:13px}#tags-content input,#tags-content select {font-size:16px}.sidebar nav {grid-template-columns:repeat(7,minmax(0,1fr))!important}.sidebar .nav-label {font-size:10px}.sidebar .nav-item {min-width:0;padding-inline:0}}
@media(max-width:599px){
 .tag-catalog-row {grid-template-columns:24px minmax(0,1fr) minmax(0,1fr);gap:8px;padding:12px 0;border-bottom:1px solid var(--md-sys-color-outline-variant)}
 .tag-catalog-row>.tag-badge {grid-column:1}
 .tag-catalog-row>input,.tag-catalog-row>select {grid-column:2/-1}
 .tag-catalog-row>button:nth-child(4) {grid-column:1/-1}
 .tag-catalog-row>button:nth-child(5) {grid-column:1/3}
 .tag-catalog-row>button:nth-child(6) {grid-column:3/4}
}

[data-tag-color="teal"] {--tag-ink:#175d54;--tag-background:#dff3ee}
[data-tag-color="blue"] {--tag-ink:#1c54a5;--tag-background:#e5efff}
[data-tag-color="green"] {--tag-ink:#216e39;--tag-background:#e3f4e8}
[data-tag-color="amber"] {--tag-ink:#805b00;--tag-background:#fff4cc}
[data-tag-color="orange"] {--tag-ink:#a34112;--tag-background:#ffedd5}
[data-tag-color="red"] {--tag-ink:#b42318;--tag-background:#fee4e2}
[data-tag-color="pink"] {--tag-ink:#b42368;--tag-background:#fce7f3}
[data-tag-color="purple"] {--tag-ink:#7035a0;--tag-background:#f3e8ff}
[data-tag-color="slate"] {--tag-ink:#465362;--tag-background:#e9eef3}
/* Direct, keyboard-accessible icon tiles and color swatches. */
.tag-badge {color:var(--tag-ink,var(--md-sys-color-on-secondary-container));background:var(--tag-background,var(--md-sys-color-secondary-container))}
.tag-number {font-weight:750;font-size:15px;font-variant-numeric:tabular-nums}
.tag-progress {display:block;width:16px;height:16px;border:1.5px solid currentColor;border-radius:50%;background:conic-gradient(currentColor var(--tag-progress),transparent 0)}
.tag-style-label {display:block;font-size:14px}
.tag-style-trigger {padding:4px;min-width:48px;min-height:48px;width:48px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center}
.tag-style-trigger>.tag-badge {width:30px;height:30px}.tag-style-trigger .tag-badge::before {width:21px;height:21px}
.tag-catalog-row {grid-template-columns:48px minmax(120px,1fr) auto auto auto}
.tag-catalog-row>.tag-style-trigger {grid-column:1}.tag-catalog-row>input {grid-column:2}.tag-catalog-row>button:nth-child(n+3){grid-column:auto}
#tags-create-form {grid-template-columns:minmax(0,1fr) 110px auto}
.tag-style-dialog {width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:20px;border-radius:16px;overflow:hidden}
.tag-style-dialog[open] {display:flex;flex-direction:column;gap:10px}
.tag-style-dialog h2 {font-size:21px;margin:0}.tag-style-dialog h3 {font-size:13px;margin:8px 0;color:var(--md-sys-color-on-surface-variant)}
.tag-style-dialog .tag-heading {margin:0;flex-shrink:0}.tag-style-dialog .dialog-actions {margin:0;flex-shrink:0}
.tag-style-preview {display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px;border:1px solid var(--md-sys-color-outline-variant);border-radius:10px}
.tag-style-preview>.tag-badge {width:36px;height:36px}.tag-style-preview .tag-badge::before {width:25px;height:25px}.tag-style-preview .tag-number {font-size:23px}.tag-style-preview .tag-progress {width:24px;height:24px}
.tag-color-grid {display:grid;grid-template-columns:repeat(9,44px);gap:6px}
.tag-icon-choices {min-height:100px;overflow:auto;overscroll-behavior:contain;flex:1;padding:4px}
.tag-icon-grid {display:grid;grid-template-columns:repeat(6,44px);gap:8px;margin-bottom:12px}
.tag-icon-choice,.tag-color-choice {width:44px;height:44px;min-width:44px;min-height:44px;padding:4px;border:1px solid var(--md-sys-color-outline-variant);border-radius:10px;background:var(--md-sys-color-surface-container-lowest);display:flex;align-items:center;justify-content:center}
.tag-icon-choice>.tag-badge {width:30px;height:30px}.tag-icon-choice .tag-badge::before {width:22px;height:22px}.tag-icon-choice .tag-number {font-size:21px}.tag-icon-choice .tag-progress {width:22px;height:22px}
.tag-color-swatch {display:block;width:24px;height:24px;border-radius:50%;background:var(--tag-ink);border:2px solid var(--tag-background)}
.tag-icon-choice[aria-checked=true],.tag-color-choice[aria-checked=true] {outline:2px solid var(--md-sys-color-primary);outline-offset:1px;border-color:var(--md-sys-color-primary)}
.tag-color-choice[aria-checked=true] .tag-color-swatch::after {content:'✓';display:block;text-align:center;color:white;font-size:15px;line-height:20px;font-weight:750}
@media(max-width:900px){.tag-catalog-row {grid-template-columns:48px minmax(0,1fr) auto}.tag-catalog-row>button:nth-child(3){grid-column:3}.tag-catalog-row>button:nth-child(4){grid-column:2}.tag-catalog-row>button:nth-child(5){grid-column:3}}
@media(max-width:599px){
 #tags-create-form {grid-template-columns:minmax(0,1fr) auto}#tags-create-form>button {grid-column:1/-1}
 .tag-catalog-row {grid-template-columns:48px minmax(0,1fr) minmax(0,1fr)}
 .tag-catalog-row>input {grid-column:2/-1}.tag-catalog-row>.tag-style-trigger {grid-column:1}
 .tag-catalog-row>button:nth-child(3){grid-column:1/-1}.tag-catalog-row>button:nth-child(4){grid-column:1/3}.tag-catalog-row>button:nth-child(5){grid-column:3}
 .tag-style-dialog {padding:16px;gap:8px}.tag-color-grid {grid-template-columns:repeat(5,44px)}.tag-icon-grid {grid-template-columns:repeat(5,44px);gap:8px}
 #tag-style-query {font-size:16px}.tag-style-preview {gap:6px;padding:8px}.tag-style-preview>span:last-child {font-size:12px}
}
@media(forced-colors:active){.tag-badge {color:CanvasText;background:Canvas}.tag-color-swatch {forced-color-adjust:none}.tag-icon-choice[aria-checked=true],.tag-color-choice[aria-checked=true] {outline:3px solid Highlight}}
.tag-style-preview strong {min-width:0;max-width:100%;overflow-wrap:anywhere}

/* Object tags always occupy their own top-right header, never overlaying text. */
.has-object-tags {display:flex;flex-direction:column;align-items:stretch}
.object-tag-icons {position:static;display:flex;justify-content:flex-end;align-items:center;align-self:stretch;gap:4px;width:100%;min-width:0;max-width:100%;height:24px;min-height:24px;flex-shrink:0;margin:0 0 6px;white-space:nowrap;line-height:1}
.object-tag-icons>.tag-badge {width:24px;height:24px;font-size:15px;line-height:1;flex-shrink:0}
.object-tag-icons>.tag-badge[data-icon]::before {width:16px;height:16px}
.object-tag-icons .tag-progress {width:16px;height:16px}
.object-tag-icons>.tag-overflow {min-width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;font-size:11px;border-radius:6px;background:var(--md-sys-color-surface-container-high);color:var(--md-sys-color-on-surface)}
#outline button.has-object-tags {display:flex;flex-direction:column;align-items:stretch;gap:4px}
#outline .object-title {display:inline-flex;align-items:center;gap:8px;overflow-wrap:anywhere;white-space:pre-wrap}
.requirement-card.has-object-tags,.library-card.has-object-tags,.reference-card.has-object-tags {gap:8px}
.requirement-card>.object-tag-icons,.library-card>.object-tag-icons,.reference-card>.object-tag-icons {margin-bottom:0}
.tag-object-row.has-object-tags {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px}
.tag-object-row>.object-tag-icons {grid-column:1/-1;margin:0}
.tag-object-row.has-object-tags>label {grid-column:1}.tag-object-row.has-object-tags>button {grid-column:2}
.process-node.has-object-tags {padding:8px 18px;gap:4px;align-items:stretch;justify-content:flex-start}
.process-node>.object-tag-icons {position:static;max-width:100%;margin:0;overflow:visible}
.process-node.has-object-tags>.process-type,.process-node.has-object-tags>strong {padding-inline-end:30px}
.process-node.has-object-tags[data-type=start],.process-node.has-object-tags[data-type=end] {padding-inline:24px}
.process-node-group:has(.process-subprocess-open) .process-node.has-object-tags {padding-top:6px;gap:2px}
.process-node-group:has(.process-subprocess-open) .process-node.has-object-tags>strong {-webkit-line-clamp:1}
.process-node-group:has(.process-subprocess-open):has(.process-layer) .process-node.has-object-tags>strong {padding-inline-start:38px;padding-inline-end:0}
@media(max-width:599px){.tag-object-row.has-object-tags {grid-template-columns:minmax(0,1fr)}.tag-object-row.has-object-tags>button {grid-column:1;justify-self:end}}

#nodes .node.has-object-tags,#probe.has-object-tags {padding-right:17px}
#nodes .node.has-object-tags.selected {padding-right:16px}
.tag-condition-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:12px}.tag-condition-grid fieldset {min-width:0;margin:0;padding:8px;border:1px solid var(--md-sys-color-outline-variant);border-radius:10px}.tag-condition-grid legend {font-size:13px;font-weight:650}.tag-condition-grid .tag-checkboxes {max-height:210px;overflow:auto;margin:4px 0;align-content:start}
#tag-work-form {display:flex;flex-wrap:wrap;gap:8px;align-items:end}#tag-work-form>div {flex:1;min-width:180px}#tag-work-form label {display:block}
#tags-content .tag-inline-check {display:flex;align-items:center;gap:8px;min-height:48px;align-self:end}#tags-filter-reset {align-self:end}#tags-filter-warning {color:var(--md-sys-color-error);font-size:14px}
#tags-filter-details>summary {cursor:pointer;min-height:44px;padding:12px 0;font-weight:650}#tag-work-state,#tags-filter-summary {overflow-wrap:anywhere}
@media(max-width:700px){.tag-condition-grid {grid-template-columns:minmax(0,1fr)}#tag-work-form>div,#tag-work-form>button {width:100%}.tag-condition-grid .tag-checkboxes {max-height:160px}}
/* Direct object actions keep card buttons valid and retain the shared tag header. */
[data-tag-object] [data-tag-action] {cursor:pointer;touch-action:manipulation;outline-offset:2px}
[data-tag-object] [data-tag-action]:hover {outline:2px solid var(--md-sys-color-primary)}
.object-tags-dialog {width:min(720px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:20px;overflow:auto;border-radius:16px}
.object-tags-dialog h2 {font-size:22px;margin:0}.object-tags-dialog h3 {font-size:16px;margin:12px 0}.object-tags-dialog .tag-heading {margin:0}
.object-tags-dialog>p {overflow-wrap:anywhere}.object-tag-choices {display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.object-tag-choices>button {gap:8px;white-space:normal;overflow-wrap:anywhere}
.object-tag-choices>button[aria-pressed=true] {outline:2px solid var(--md-sys-color-primary);outline-offset:1px}
.object-tags-dialog .tag-history>button[aria-pressed=true] {background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}
.object-tags-dialog input[type=search] {width:100%;min-width:0}.object-tags-dialog .tag-checkboxes {max-height:340px;overflow:auto;align-content:start}.object-tags-dialog .tag-checkboxes label {max-width:100%}
.object-tag-usages {display:grid;gap:8px;margin-top:12px;max-height:300px;overflow:auto;overscroll-behavior:contain}.object-tag-usages>button {display:flex;flex-direction:column;align-items:stretch;text-align:left;gap:6px;white-space:normal;overflow-wrap:anywhere}
@media(max-width:599px){.object-tags-dialog {padding:16px}.object-tags-dialog input[type=search] {font-size:16px}.object-tags-dialog .tag-history>button {flex:1;font-size:13px}.object-tag-choices>button {font-size:13px}.object-tags-dialog .tag-badge {width:24px;min-width:24px}.object-tag-usages {max-height:260px}}
.tag-work-link {display:flex;align-items:center;flex:1;min-width:160px;min-height:48px;padding:10px 16px;border:1px solid var(--md-sys-color-outline-variant);border-radius:12px;color:var(--md-sys-color-on-surface);background:var(--md-sys-color-surface-container-lowest);text-decoration:none;font-weight:600;overflow-wrap:anywhere}
.tag-work-link:hover {background:var(--md-sys-color-surface-container-low)}
.tag-view-row[data-active=true]>.tag-work-link {border-color:var(--md-sys-color-primary);background:var(--md-sys-color-secondary-container);box-shadow:inset 4px 0 var(--md-sys-color-primary)}
.tag-work-link[aria-current=page]::before {content:'✓';margin-right:8px;font-weight:750}
@media(max-width:599px){.tag-work-link {flex-basis:100%}.tag-view-row>button {flex:1}}
