/* Preview-only tag settings and chips use projected, authorized assignments. */
#stg-watch[hidden],#stg-conversation[hidden],#stg-conversation-toggle[hidden],#ts-tags[hidden]{display:none!important}
.stg-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.stg-heading h2{margin:0}
#stg-watch{padding-top:10px;border-top:1px solid #dce4ed;margin-top:10px;font-size:12px;color:#243247}#stg-watch label{display:grid;gap:4px;margin:8px 0}#stg-watch input,#stg-watch select,#stg-conversation input,#stg-conversation select,.stg-color-control select{min-width:0;min-height:36px;font:inherit;padding:6px;border:1px solid #becbd9;border-radius:5px;background:#fff;color:#243247}#stg-watch input,#stg-watch select,#stg-conversation select{width:100%}#stg-watch p,.stg-hint{font-size:11px;line-height:1.4;margin:6px 0}#stg-watch button{font-size:11px;padding:6px 8px}#stg-watch-status,#stg-status,#stg-conversation-status{white-space:pre-line;font-size:12px}
.stg-create{display:flex;align-items:end;gap:10px;margin-top:14px}.stg-create .ts-field{flex:1;margin:0!important}.stg-create button{flex-shrink:0;margin-bottom:0}#stg-tag-list{list-style:none;padding:0;margin:16px 0}#stg-tag-list li{display:flex;align-items:center;gap:8px;padding:10px 0;border-top:1px solid #e1e7ee}#stg-tag-list input{min-width:0;flex:1;padding:8px;border:1px solid #c8d2df;border-radius:6px;font:inherit;color:#243247}.stg-tag-name{flex:1;overflow-wrap:anywhere}.stg-row-actions{display:flex;gap:5px;flex-wrap:wrap}.stg-row-actions button{padding:6px 9px!important;font-size:12px!important}.stg-archived{color:#68798c}.stg-color-control{display:grid;gap:4px;font-size:12px}.stg-color-control>span{display:flex;align-items:center;gap:6px}.stg-color-dot{display:inline-block;width:18px;height:18px;border:2px solid var(--stg-ink);border-radius:50%;background:var(--stg-fill);flex-shrink:0}
[data-stg-color="blue"]{--stg-fill:#dbeafe;--stg-ink:#1e3a8a}[data-stg-color="green"]{--stg-fill:#dcfce7;--stg-ink:#14532d}[data-stg-color="amber"]{--stg-fill:#fef3c7;--stg-ink:#78350f}[data-stg-color="rose"]{--stg-fill:#ffe4e6;--stg-ink:#881337}[data-stg-color="purple"]{--stg-fill:#f3e8ff;--stg-ink:#581c87}[data-stg-color="slate"]{--stg-fill:#e2e8f0;--stg-ink:#334155}
.stg-chip{display:inline-block;max-width:100%;padding:3px 7px;border:1px solid var(--stg-ink);border-radius:999px;background:var(--stg-fill);color:var(--stg-ink);font-size:11px;font-weight:600;line-height:1.35;white-space:normal;overflow-wrap:anywhere;vertical-align:middle}.stg-list-chip{margin-left:6px;max-width:120px;font-size:10px;padding:2px 6px}.tr-person-name:has(.stg-list-chip){white-space:normal!important;overflow:visible!important;text-overflow:clip!important}.tr-person-line:has(.stg-list-chip){align-items:flex-start}
#stg-name-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}#stg-name-row h2{margin:0;max-width:100%;overflow-wrap:anywhere}#stg-header-tags{display:contents}#stg-conversation-toggle{flex:0 0 auto;padding:4px 8px;min-height:28px;font-size:11px}#tr-comms .tr-identity>div{min-width:0}#tr-comms .tr-header:has(#stg-conversation){position:relative;z-index:12}
#stg-conversation{position:absolute;top:calc(100% - 2px);left:12px;z-index:30;width:min(430px,calc(100% - 24px));max-height:min(430px,52dvh);overflow:auto;overscroll-behavior:contain;padding:12px;border:1px solid #a9b9cb;border-radius:8px;background:#fff;box-shadow:0 10px 30px #24324733;color:#243247;font-size:12px;box-sizing:border-box}.stg-conversation-content{padding-top:10px}.stg-add-row{display:grid;grid-template-columns:minmax(100px,1fr) minmax(86px,.6fr) auto;gap:8px;align-items:end}.stg-add-row label{display:grid;gap:4px}.stg-assigned-row{display:flex;align-items:center;gap:8px;margin-bottom:8px}.stg-assigned-row .stg-chip{flex:1}.stg-assigned-row select{max-width:110px!important}.stg-assigned-row button{flex:0 0 auto}
#tr-comms[data-tags-view="true"] .tr-list-filter{display:none!important}#tr-comms[data-tags-view="true"] #tr-inbox{min-height:0;max-height:100%;overflow:auto;overscroll-behavior:contain}
@media(max-width:650px),(max-width:950px) and (max-height:500px) and (pointer:coarse){#stg-watch input,#stg-watch select,#ts-tags input,#stg-conversation select,.stg-color-control select{font-size:16px;min-height:44px}#stg-watch button,#ts-tags button,#stg-conversation button,#stg-conversation-toggle{min-height:44px}#stg-tag-list li{flex-wrap:wrap}#stg-tag-list input{flex-basis:100%}.stg-row-actions{margin-left:auto}.stg-create{align-items:stretch;flex-direction:column}.stg-create .stg-color-control>span{max-width:170px}.stg-edit-color{margin-right:auto}.stg-add-row{grid-template-columns:minmax(100px,1fr) minmax(95px,.7fr)}.stg-add-row button{grid-column:1/-1}.stg-assigned-row{flex-wrap:wrap}.stg-assigned-row .stg-chip{min-width:70px}#stg-conversation{left:8px;width:calc(100% - 16px);max-height:48dvh}.stg-list-chip{max-width:110px}#stg-name-row{gap:5px}#tr-comms[data-tags-view="true"] #tr-inbox{flex:1 1 0;min-height:0;overflow:auto}}
/* A watchlist selection only filters contacts; it never assigns a tag. */
#stg-watch .stg-watch-option{display:flex;align-items:center;gap:12px;min-height:46px;padding:7px 2px;margin:0;border-bottom:1px solid #e1e7ee;cursor:pointer}#stg-watch .stg-watch-option .stg-chip{max-width:calc(100% - 44px)}#stg-watch .stg-watch-option input{width:22px;height:22px;min-height:22px;padding:0;margin:0 0 0 auto;flex:0 0 22px;accent-color:#294f7a;cursor:pointer}.stg-watch-option:focus-within{outline:2px solid #2563eb;outline-offset:2px}.stg-nav-icon{width:20px;height:20px;flex:0 0 20px;vertical-align:middle}[data-phone-view="tags"],[data-phone-view="following"]{display:inline-flex;align-items:center;gap:6px}
#tr-sidebar .tr-nav-button .stg-nav-icon{color:#fff}

/* Outline paths override the shared navigation glyph fill rule. */
#tr-comms #tr-sidebar .tr-nav-button .stg-nav-icon,#tr-comms #tr-sidebar .tr-nav-button .stg-nav-icon path,#tr-comms #tr-sidebar .tr-nav-button .stg-nav-icon circle{fill:none;stroke:currentColor}
/* Reserve one complete row for the name and first tag at narrow inbox widths. */
#tr-comms .tr-person-line:has(.stg-list-chip){display:flex;flex-wrap:wrap;align-items:center;gap:4px}
#tr-comms .tr-person-name:has(.stg-list-chip){display:flex;align-items:center;flex:1 1 100%;gap:6px;min-width:0;max-width:100%;white-space:nowrap!important;overflow:hidden!important}
#tr-comms .stg-list-customer{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#tr-comms .tr-person-name .stg-list-chip{flex:0 1 auto;min-width:0;max-width:50%;margin-left:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#tr-comms .tr-person-line:has(.stg-list-chip)>time{flex:1 1 100%;min-width:0}

/* New color choices preserve every legacy color value above. */
[data-stg-color="blue-bold"]{--stg-fill:#2563eb;--stg-ink:#fff}[data-stg-color="green-bold"]{--stg-fill:#15803d;--stg-ink:#fff}[data-stg-color="yellow-bold"]{--stg-fill:#eab308;--stg-ink:#422006}[data-stg-color="red-bold"]{--stg-fill:#dc2626;--stg-ink:#fff}[data-stg-color="orange-bold"]{--stg-fill:#f97316;--stg-ink:#431407}[data-stg-color="olive"]{--stg-fill:#868603;--stg-ink:#111827}[data-stg-color="leaf"]{--stg-fill:#4e943e;--stg-ink:#111827}[data-stg-color="emerald"]{--stg-fill:#129676;--stg-ink:#111827}[data-stg-color="teal"]{--stg-fill:#0d9298;--stg-ink:#111827}[data-stg-color="cyan"]{--stg-fill:#068cb9;--stg-ink:#111827}[data-stg-color="lavender"]{--stg-fill:#8070ca;--stg-ink:#080c14}[data-stg-color="orchid"]{--stg-fill:#a363b3;--stg-ink:#080c14}[data-stg-color="pink"]{--stg-fill:#ba5b8b;--stg-ink:#080c14}[data-stg-color="slate-bold"]{--stg-fill:#394860;--stg-ink:#fff}
/* Compact applied rows share the same three columns as the blank Add row. */
#stg-conversation .stg-add-row,#stg-conversation .stg-assigned-row{display:grid;grid-template-columns:minmax(0,1fr) 92px 74px;gap:6px;align-items:center}
#stg-conversation .stg-add-row{align-items:end}
#stg-conversation .stg-add-row>button{grid-column:auto;padding:7px 5px;white-space:nowrap}
#stg-conversation .stg-assigned-row{padding:6px 0;margin:0;border-bottom:1px solid #e1e7ee}
#stg-assigned-list:not(:empty){margin-bottom:10px}
#stg-conversation .stg-assigned-row select{width:100%;max-width:none!important}
.stg-applied-name{display:flex;align-items:center;gap:3px;min-width:0}
#stg-conversation .stg-applied-name .stg-chip{min-width:0;flex:0 1 auto}
#stg-conversation .stg-reorder-handle{flex:0 0 24px;width:24px;padding:0;min-height:32px;border:0;border-radius:4px;background:transparent;color:#52637c;font-size:22px;line-height:1;cursor:grab;touch-action:manipulation}
#stg-conversation .stg-reorder-handle:active{cursor:grabbing}
#stg-conversation .stg-reorder-handle:disabled{opacity:.4;cursor:default}
#stg-conversation .stg-remove{padding:7px 4px;font-size:11px}
#stg-conversation .stg-move-controls{display:flex;grid-column:1/-1;gap:6px;padding:2px 0 6px}
#stg-conversation .stg-move-controls button{font-size:12px;padding:6px 10px}
#stg-conversation-status:empty{display:none}
/* Customer names lead; tag chips retain their compact size. */
#tr-comms #stg-name-row #tr-customer-name{font-size:24px;font-weight:700;line-height:1.2;flex:0 0 auto;max-width:100%;overflow-wrap:anywhere}
#tr-comms .tr-person-name{font-size:14px;font-weight:600}
#tr-comms .tr-person-name .stg-list-chip{max-width:42%}
@media(max-width:650px),(max-width:950px) and (max-height:500px) and (pointer:coarse){#tr-comms #stg-name-row #tr-customer-name{font-size:22px}}
@media(max-width:650px),(max-width:950px) and (max-height:500px) and (pointer:coarse){#stg-conversation .stg-reorder-handle{flex-basis:36px;width:36px;min-height:44px}#stg-conversation .stg-add-row,#stg-conversation .stg-assigned-row{grid-template-columns:minmax(0,1fr) 92px 66px}#stg-conversation .stg-add-row>button{font-size:11px;padding:7px 3px}#stg-conversation .stg-remove{font-size:11px;padding:7px 2px}}

/* Known street and city sit below the name; missing address parts stay omitted. */
#tr-comms .stg-list-address{display:block;max-width:100%;margin-top:3px;font-size:12px;font-weight:400;line-height:1.4;color:#52637c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#tr-comms #tr-customer-address{display:block;font-size:13px;font-weight:400;line-height:1.4;color:#52637c;max-width:100%;overflow-wrap:anywhere}
#tr-comms #tr-customer-address[hidden]{display:none}
/* Equal heading typography and an optically balanced navigation icon column. */
#tr-comms #tr-sidebar .tr-nav-label{font-family:inherit;font-size:12px;font-weight:700;line-height:1.4;letter-spacing:1.1px;text-transform:uppercase}
#tr-comms #tr-sidebar .tr-nav-button .tr-nav-icon,#tr-comms #tr-phone-filters .stg-nav-icon{width:16px;height:16px;flex:0 0 16px;vertical-align:middle}
#tr-comms #tr-sidebar .tr-nav-button [data-stg-nav-icon="sales"]{width:14px;height:14px;flex-basis:14px;margin-inline:1px}
#tr-comms #tr-sidebar .tr-nav-button [data-stg-nav-icon="following"],#tr-comms #tr-phone-filters [data-stg-nav-icon="following"]{width:18px;height:18px;flex-basis:18px;margin-inline:-1px}
#tr-comms #tr-sidebar-toggle .tr-collapse-arrow{width:16px;height:16px}
