/* Sheen Desk design tokens and components (research/03-brand-system.md).
   Bootstrap is not loaded on app pages; only the Identity account pages that still use its classes load it (App.razor). */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/inter-latin-wght.woff2") format("woff2"); /* SIL OFL 1.1, fonts/Inter-OFL.txt */
}

:root {
    --brand-accent: #F68A2B;
    --brand-primary: #B4530F;
    --brand-primary-hover: #9A3F08;
    --on-primary: #FFFFFF;
    --shell-bg: #1A1A1A;
    --shell-raised: #262626;
    --shell-line: #3F3F46;
    --shell-text: #FFFFFF;
    --shell-text-2: #D4D4D8;
    --surface-page: #FAFAFA;
    --surface-card: #FFFFFF;
    --surface-sunken: #F4F4F5;
    --text-1: #111111;
    --text-2: #4B5563;
    --text-muted: #6B6B74; /* 4.8:1 on surface-sunken, 5.3:1 on white (WCAG 1.4.3; was #71717A, 4.4:1 on sunken rows) */
    --border-subtle: #E4E4E7;
    --border-strong: #D4D4D8;
    --border-control: #71717A;
    --danger: #B91C1C;      --danger-bg: #FEF2F2;
    --success: #15803D;     --success-bg: #F0FDF4;
    --info: #1D4ED8;        --info-bg: #EFF6FF;
    --warning: #B45309;
    --private-tint: #FFFBEB; --private-line: #FDE68A; --private-text: #92400E; --private-tag: #FEF3C7;
    --st-open: #1D4ED8;      --st-open-bg: #EFF6FF;
    --st-hold: #6D28D9;      --st-hold-bg: #F5F3FF;
    --st-esc: #B91C1C;       --st-esc-bg: #FEF2F2;
    --st-closed: #15803D;    --st-closed-bg: #F0FDF4;
    --radius-sm: 4px; --radius-md: 6px; --radius-lg: 10px;
    --elev-1: 0 1px 2px rgb(0 0 0 / 6%);
    --elev-2: 0 4px 12px rgb(0 0 0 / 10%);
    --elev-3: 0 12px 32px rgb(0 0 0 / 16%);
    --font-ui: Inter, system-ui, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
    --control-h: 34px;
    --topbar-h: 52px;
    --ease: 120ms ease-out;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --brand-primary: #FDBA74; --brand-primary-hover: #FED7AA; --on-primary: #111111;
        --shell-bg: #0D0D0D; --shell-raised: #1F1F22; --shell-line: #2E2E33;
        --surface-page: #121212; --surface-card: #1C1C1F; --surface-sunken: #18181B;
        --text-1: #F4F4F5; --text-2: #A1A1AA; --text-muted: #A1A1AA;
        --border-subtle: #27272A; --border-strong: #3F3F46;
        --danger: #F87171;  --danger-bg: #2A1215;
        --success: #4ADE80; --success-bg: #0F2417;
        --info: #60A5FA;    --info-bg: #111C33;
        --warning: #FBBF24;
        --private-tint: #221D10; --private-line: #4A3B12; --private-text: #FCD34D; --private-tag: #3A2F0E;
        --st-open: #93C5FD; --st-open-bg: #172554;
        --st-hold: #C4B5FD; --st-hold-bg: #2E1065;
        --st-esc: #FCA5A5;  --st-esc-bg: #450A0A;
        --st-closed: #86EFAC; --st-closed-bg: #052E16;
        --elev-1: 0 1px 2px rgb(0 0 0 / 40%);
        --elev-2: 0 6px 16px rgb(0 0 0 / 50%);
        --elev-3: 0 16px 40px rgb(0 0 0 / 60%);
        color-scheme: dark;
    }
    .topbar { border-bottom: 1px solid var(--shell-line); }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--surface-page); color: var(--text-1);
    font-family: var(--font-ui); font-size: 14px; line-height: 1.45;
    font-feature-settings: "cv11", "ss03"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand-primary); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 20px; font-weight: 600; margin: 0 0 16px; letter-spacing: -0.01em; }
h1:focus { outline: none; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
p { margin: 0 0 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: inline-block; }
:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; box-shadow: 0 0 0 4px rgb(246 138 43 / 40%); border-radius: var(--radius-sm); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .92em; }
.muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { flex-shrink: 0; vertical-align: -3px; }
.text-danger { color: var(--danger); }

/* Shell: ink top bar (03 §3, B1) */
.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h); background: var(--shell-bg); color: var(--shell-text);
    display: flex; align-items: center; gap: 12px; padding: 0 16px;
}
.topbar a { color: var(--shell-text-2); text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--shell-text) !important; font-size: 15px; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: #FFFFFF; }
.brand-mark img { width: 22px; height: 22px; }
.brand-name { font-weight: 600; letter-spacing: -0.01em; }
.brand-name span { font-weight: 400; color: var(--shell-text-2); }
.tenant { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--shell-raised); color: var(--shell-text-2); font-size: 13px; white-space: nowrap; }
.topbar nav { display: flex; height: 100%; margin-inline-start: 8px; }
.topbar nav a { display: flex; align-items: center; gap: 7px; padding: 0 12px; font-weight: 500; border-bottom: 2px solid transparent; border-top: 2px solid transparent; transition: color var(--ease); }
.topbar nav a:hover { color: var(--shell-text); }
.topbar nav a.active { color: var(--shell-text); border-bottom-color: var(--brand-accent); }
.topbar .spacer { flex: 1; }
.topbar-search { position: relative; margin: 0; }
.topbar-search .icon { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: #A1A1AA; pointer-events: none; }
.topbar-search input {
    width: 260px; height: 32px; padding-block: 0 0; padding-inline: 32px 10px; border-radius: var(--radius-md);
    border: 1px solid var(--shell-line); background: var(--shell-raised); color: var(--shell-text); transition: border-color var(--ease), width var(--ease);
}
.topbar-search input::placeholder { color: #A1A1AA; }
.topbar-search input:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgb(246 138 43 / 25%); }
.topbar .btn-primary { height: 32px; }
.topbar .setup-link { color: var(--shell-text-2); height: 32px; width: 32px; }
.topbar .setup-link:hover { background: var(--shell-raised); color: var(--shell-text); }
.topbar .bell { position: relative; }
.bell-count { position: absolute; top: -2px; inset-inline-end: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--brand-accent); color: #111; font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); }
.notes li:last-child { border-bottom: 0; }
.notes li:hover { background: var(--surface-sunken); }
.notes .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--brand-accent); }
.notes li.read .dot { background: transparent; }
.notes li.read .title { color: var(--text-2); font-weight: 400; }
.notes .title { font-weight: 600; color: var(--text-1); text-decoration: none; }
.notes .title::after { content: ""; position: absolute; inset: 0; }
.notes .sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* Account menu: <details> works without JavaScript on the static layout. */
.account { position: relative; }
.account summary { list-style: none; display: flex; align-items: center; gap: 4px; cursor: pointer; padding: 3px; border-radius: 999px; color: var(--shell-text-2); }
.account summary::-webkit-details-marker { display: none; }
.account summary:hover { background: var(--shell-raised); }
.account .menu {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: 240px; z-index: 40;
    background: var(--surface-card); color: var(--text-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--elev-2); padding: 6px;
}
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 6px; }
.menu-head div { min-width: 0; }
/* Only the name and address lines: the avatar is a span too and must keep its own centered layout. */
.menu-head div strong, .menu-head div span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head div span { color: var(--text-muted); font-size: 12px; }
.menu a, .menu button {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--radius-md);
    background: none; color: var(--text-1) !important; text-align: start; cursor: pointer; text-decoration: none;
}
.menu a:hover, .menu button:hover { background: var(--surface-sunken); }
.menu form { margin: 0; }

/* App frame: left panel + main */
.app { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.side {
    width: 232px; flex-shrink: 0; background: var(--surface-card); border-inline-end: 1px solid var(--border-subtle);
    padding: 16px 10px; position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
}
.side h3 { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 16px 10px 6px; font-weight: 600; }
.side h3:first-child { margin-top: 0; }
.side a {
    display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-md);
    color: var(--text-2); text-decoration: none; font-weight: 500; transition: background var(--ease), color var(--ease);
}
.side a .icon { color: var(--text-muted); }
.side a .trail { margin-inline-start: auto; }
.side a:hover { background: var(--surface-sunken); color: var(--text-1); }
.side a.active { background: var(--surface-sunken); color: var(--text-1); font-weight: 600; box-shadow: inset var(--start-edge, 3px) 0 0 var(--brand-accent); }
.side a.active .icon { color: var(--text-1); }
.main { flex: 1; min-width: 0; padding: 24px 32px 48px; }
.main.narrow { max-width: 880px; margin: 0 auto; }

/* Page header and toolbar */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.count { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; background: var(--surface-sunken); border: 1px solid var(--border-subtle); color: var(--text-2); font-size: 12px; font-weight: 500; }
.search-field { position: relative; margin: 0; }
.search-field .icon { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-field .input { padding-inline-start: 32px; width: 260px; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-h); padding: 0 14px;
    border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--surface-card); color: var(--text-1);
    font-weight: 500; line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.btn:hover { background: var(--surface-sunken); }
.btn-primary { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--brand-primary-hover); border-color: var(--brand-primary-hover); color: var(--on-primary); }
.topbar .btn-primary { color: var(--on-primary); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-sunken); color: var(--text-1); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-icon { width: var(--control-h); padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn-block { width: 100%; height: 40px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-link { background: none; border: 0; padding: 0; color: var(--brand-primary); cursor: pointer; text-decoration: underline; }

/* Form controls */
.input, select.input, textarea.input {
    width: 100%; height: var(--control-h); padding: 0 10px;
    border: 1px solid var(--border-control); border-radius: var(--radius-md); background: var(--surface-card); color: var(--text-1);
    transition: border-color var(--ease), box-shadow var(--ease);
}
.input::placeholder { color: var(--text-muted); }
.input:hover:not(:disabled) { border-color: var(--text-2); }
.input:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgb(246 138 43 / 30%); }
.input:disabled { background: var(--surface-sunken); color: var(--text-2); cursor: not-allowed; }
select.input {
    appearance: none; padding-inline-end: 30px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
}
textarea.input { height: auto; min-height: 104px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input.invalid, .input[aria-invalid="true"] { border-color: var(--danger); }
input[type="checkbox"] { accent-color: var(--brand-primary); width: 16px; height: 16px; margin: 0; }
.field { margin-bottom: 16px; }
.field > label, label.label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; }
.field .req { color: var(--danger); }
.field .hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.field-error, .validation-message { color: var(--danger); font-size: 13px; margin-top: 6px; display: flex; gap: 4px; align-items: center; }
.checkbox { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; align-items: center; padding-top: 16px; margin-top: 4px; border-top: 1px solid var(--border-subtle); }
.form-actions + .field { margin-top: 16px; }

/* Cards, banners, toasts */
.card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--elev-1); padding: 20px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; margin: 0 0 16px; }
.banner, .alert { border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; border: 1px solid transparent; }
.banner .btn { margin-inline-start: auto; }
.banner-error, .alert-danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.banner-info, .alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-warning { background: var(--private-tint); color: var(--private-text); border-color: var(--private-line); }
.toast {
    position: fixed; inset-inline-start: 16px; bottom: 16px; z-index: 50; display: flex; gap: 12px; align-items: center;
    background: var(--shell-bg); color: var(--shell-text); padding: 10px 14px; border-radius: 8px; box-shadow: var(--elev-3);
    animation: toast-in 160ms ease-out;
}
.toast .icon { color: #4ADE80; }
.toast button { background: none; border: none; color: var(--brand-accent); font-weight: 600; cursor: pointer; padding-block: 0 0; padding-inline: 4px 0; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* Status chips: icon + color + label (03 §2) */
.chip {
    display: inline-flex; align-items: center; gap: 5px; padding-block: 2px 2px; padding-inline: 7px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}
.chip svg { width: 12px; height: 12px; }
.chip-open { color: var(--st-open); background: var(--st-open-bg); }
.chip-onhold { color: var(--st-hold); background: var(--st-hold-bg); }
.chip-escalated { color: var(--st-esc); background: var(--st-esc-bg); }
.chip-closed { color: var(--st-closed); background: var(--st-closed-bg); }
.chip-closed svg path { stroke: var(--st-closed-bg); }

/* Priority: dot + label, never color alone */
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.prio::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.prio-None { color: var(--text-muted); }
.prio-None::before { background: transparent; border: 1px dashed currentColor; }
.prio-Low { color: var(--text-2); }
.prio-Medium { color: var(--warning); }
.prio-High { color: var(--danger); font-weight: 600; }

/* Avatars */
.avatar {
    --avatar-size: 24px;
    display: inline-grid; place-items: center; flex-shrink: 0; width: var(--avatar-size); height: var(--avatar-size); border-radius: 50%;
    font-size: calc(var(--avatar-size) * .42); font-weight: 600; letter-spacing: .02em; line-height: 1;
}
.avatar-0 { background: #FFEDD5; color: #9A3412; }
.avatar-1 { background: #DBEAFE; color: #1E40AF; }
.avatar-2 { background: #DCFCE7; color: #166534; }
.avatar-3 { background: #EDE9FE; color: #5B21B6; }
.avatar-4 { background: #FCE7F3; color: #9D174D; }
.avatar-5 { background: #E0F2FE; color: #075985; }
@media (prefers-color-scheme: dark) {
    .avatar-0 { background: #431407; color: #FDBA74; }
    .avatar-1 { background: #172554; color: #93C5FD; }
    .avatar-2 { background: #052E16; color: #86EFAC; }
    .avatar-3 { background: #2E1065; color: #C4B5FD; }
    .avatar-4 { background: #500724; color: #F9A8D4; }
    .avatar-5 { background: #082F49; color: #7DD3FC; }
}
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pager under paged lists (F-0) */
.pager { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 4px 0; color: var(--text-2); font-size: 13px; }
.pager-range { font-variant-numeric: tabular-nums; }
.pager-size { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.pager-size .input { width: auto; padding-block: 4px; }
.pager-buttons { display: inline-flex; align-items: center; gap: 6px; }
.pager-note { flex-basis: 100%; color: var(--text-3, var(--text-2)); font-size: 12px; }
.pager-page { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }

/* Tags (F-10) */
.tag-list { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-inline-start: 8px; vertical-align: middle; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; border-radius: 999px; background: var(--surface-sunken); border: 1px solid var(--border-subtle); color: var(--text-2); font-size: 11.5px; line-height: 18px; white-space: nowrap; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.tag button { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; display: inline-flex; }
.value-picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.composer-mentions { padding: 6px 12px; border-top: 1px solid var(--border-subtle); }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form .input { width: auto; min-width: 0; flex: 1 1 160px; }

/* Bulk selection (F-1): checkboxes sit above the row link's click area */
.row-select { position: relative; z-index: 2; width: 16px; height: 16px; margin: 0; accent-color: var(--brand-primary); cursor: pointer; }
.table .select-col { width: 36px; padding-inline-end: 0; }
.rows-select-all { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin: 0 0 8px; padding-inline-start: 16px; }
.table tbody tr.selected, .ticket-rows li.selected { background: var(--surface-selected, var(--surface-sunken)); }
.ticket-rows.selectable li { grid-template-columns: 20px 112px minmax(0, 1fr) auto; }
.bulk-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 12px;
    background: var(--surface-card); border: 1px solid var(--brand-primary); border-radius: var(--radius-lg); box-shadow: var(--elev-1); }
.bulk-bar .input { width: auto; }
.bulk-bar .lookup { min-width: 160px; }
.bulk-skips { margin: 4px 0 0; padding-inline-start: 18px; font-size: 13px; }

/* KB organize (F-2) */
.kb-org-card { padding: 4px 0; margin-bottom: 12px; }
.kb-org-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 12px; border-bottom: 1px solid var(--border-subtle); }
.kb-org-row:last-child { border-bottom: 0; }
.kb-org-category { padding-block: 10px; }
.kb-org-name { flex: 1 1 200px; min-width: 0; display: inline-flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.kb-org-actions { display: inline-flex; gap: 2px; margin-inline-start: auto; }

/* Contact duplicates (F-3) */
.dup-group { border: 1px solid var(--border-subtle); margin: 0 0 16px; padding: 12px; min-width: 0; }
.dup-match { font-weight: 600; padding: 0 6px; overflow-wrap: anywhere; }
.dup-group .form-actions { margin-top: 10px; }

/* Global search (F-11) */
.rate-choice { border: 0; padding: 0; margin: 0 0 16px; display: flex; gap: 10px; }
.rate-option { flex: 1; display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); cursor: pointer; }
.rate-option:has(input:checked) { border-color: var(--brand-primary); background: var(--surface-sunken); }
.rating { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.rating-good { color: var(--success, #15803D); }
.rating-bad { color: var(--danger); }
.props-group { grid-column: 1 / -1; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border-subtle); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.eta-approval { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
/* MR-014: approval states are full labels; the short limit for user tags must not clip them. */
.eta-approval .tag { max-width: 100%; white-space: normal; }
/* MR-034: the Azure panel's Awaiting confirmation state is a full label too. */
.azure-link .tag { max-width: 100%; white-space: normal; }
.eta-approval .input { flex: 1 1 140px; min-width: 0; }
.eta-form { display: flex; flex-wrap: wrap; gap: 6px; }
.eta-form .input { flex: 1 1 140px; min-width: 0; }
.eta-history { margin-top: 6px; font-size: 12.5px; }
.eta-history ul { margin: 4px 0 0; padding-inline-start: 16px; }
.lookup-card { margin-bottom: 16px; }
.lookup-list { list-style: none; margin: 0 0 12px; padding: 0; }
.lookup-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border-subtle); }
.lookup-list li.inactive .lookup-name { color: var(--text-muted); text-decoration: line-through; }
.lookup-actions { margin-inline-start: auto; display: inline-flex; gap: 4px; }
.area-title { display: inline-flex; align-items: center; gap: 6px; color: #F68A2B; font-size: 13px; font-weight: 600; letter-spacing: .02em; padding-inline: 6px; border-inline-start: 1px solid #3F3F46; }

/* Show/hide password button inside password fields (js/password-toggle.js) */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-inline-end: 42px; }
.pw-toggle { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: 0; border-radius: var(--radius-md); background: none; color: var(--text-2); cursor: pointer; }
.pw-toggle:hover { color: var(--text-1); background: var(--surface-sunken); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 1px; }

/* Password guidance (account pages) */
.password-tips { margin-top: 8px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--surface-sunken); font-size: 13px; color: var(--text-2); }
.password-tips strong { color: var(--text-1); font-weight: 600; }
.password-tips ul { margin: 6px 0; padding-inline-start: 18px; }
.password-tips li { margin-bottom: 2px; }

/* Operations view (M10 D3) */
.kpis.ops-kpis { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kpi-danger .kpi-value { color: var(--danger); }
.kpi-warn .kpi-value { color: var(--warning); }
.ops-teams { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -8px 0 16px; font-size: 13px; }
.ops-teams .tag { text-decoration: none; }
.ops-load, .ops-queue { margin-bottom: 16px; }
.gauge { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.gauge-track { height: 10px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.gauge-fill { display: block; height: 100%; background: var(--brand-primary); }
.gauge-fill.near { background: var(--warning); }
.gauge-fill.over { background: var(--danger); }
.gauge-value { font-variant-numeric: tabular-nums; }
.bench { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; }
.bench-track { width: 70px; height: 8px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.bench-fill { display: block; height: 100%; }
.bench-0 { background: #15803D; }
.bench-1 { background: #D97706; }
.bench-2 { background: #DC2626; }
.bench-3 { background: #111827; }
:root[data-theme="dark"] .bench-3 { background: #F4F4F5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bench-3 { background: #F4F4F5; } }
.tag-urgent { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); margin-inline-start: 6px; }

/* Management dashboard (M10 D2) */
.kpis.mgmt-kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.mgmt-help { margin: 12px 0 16px; padding: 10px 14px; font-size: 13px; }
.mgmt-help ul { margin: 8px 0 0; padding-inline-start: 18px; color: var(--text-2); }
.mgmt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.mgmt-wide { grid-column: 1 / -1; }
.month-bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; margin: 8px 0; }
.month-bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; min-width: 0; }
.month-bar .stack { width: 100%; display: flex; flex-direction: column; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 2px; }
.month-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.seg-client { background: var(--brand-primary); }
.seg-business { background: #2563EB; }
.seg-other { background: var(--border-strong, #A1A1AA); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--text-2); }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.risk-list { margin: 0; padding-inline-start: 18px; font-size: 13.5px; }
.risk-list li { margin-bottom: 4px; }
.search-backdrop { position: fixed; inset: 0; z-index: 40; }
.search-pop { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 41; width: min(440px, 92vw); max-height: 70vh; overflow-y: auto;
    background: var(--surface-card); color: var(--text-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--elev-2, var(--elev-1)); padding: 6px; }
.search-pop h3 { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 8px 8px 4px; }
.search-pop a { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: var(--radius-md); color: var(--text-1); text-decoration: none; min-width: 0; }
.search-pop a:hover, .search-pop a:focus-visible { background: var(--surface-sunken); }
.search-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.search-pop .search-all { border-top: 1px solid var(--border-subtle); margin-top: 6px; border-radius: 0; color: var(--brand-primary); }
.search-empty { margin: 8px; }
.search-link { display: none; }
.search-page-form { margin-bottom: 16px; max-width: 560px; }
/* Only on phones, where the side panel is hidden (see the 768 px block). */
.phone-pickers { display: none; }
/* The ticket group reuses the full ticket table, which needs more than the narrow 880 px column. */
.main.narrow.search-page { max-width: 1200px; }
.search-group { display: flex; align-items: baseline; gap: 12px; font-size: 15px; margin: 20px 0 8px; }
.search-group a { font-size: 13px; font-weight: 500; }

/* Tables (one list pattern for every module, 03 §1) */
.table-card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--elev-1); overflow: hidden; overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: start; font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--surface-sunken);
    padding: 9px 16px; border-bottom: 1px solid var(--border-subtle); white-space: nowrap;
}
.table td { padding: 11px 16px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { position: relative; transition: background var(--ease); }
.table tbody tr:hover { background: var(--surface-sunken); }
.table .key { color: var(--text-muted); white-space: nowrap; }
.table .subject { font-weight: 600; color: var(--text-1); text-decoration: none; }
.table .subject:hover { color: var(--brand-primary); }
/* Whole row opens the ticket; the link stays the one focusable element. */
.table .row-link::after { content: ""; position: absolute; inset: 0; }
.table .row-link:focus-visible { box-shadow: none; outline: none; }
.table tbody tr:has(.row-link:focus-visible) { outline: 2px solid var(--brand-primary); outline-offset: -2px; }
.table .time { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 56px 16px; color: var(--text-2); }
.empty .empty-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface-sunken); color: var(--text-muted); margin-bottom: 12px; }
.empty strong { display: block; color: var(--text-1); font-size: 15px; margin-bottom: 4px; }
.empty p { margin: 0 0 16px; }
.loading-row { height: 44px; border-bottom: 1px solid var(--border-subtle); background: linear-gradient(90deg, transparent, var(--surface-sunken), transparent) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Ticket detail */
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 500; margin-bottom: 12px; }
.crumb:hover { color: var(--text-1); }
.detail-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.detail-head h1 { margin: 0; font-size: 22px; }
.detail-head form { flex: 1; display: flex; gap: 8px; min-width: 280px; }
.key-badge { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 2px 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-2); font-size: 13px; margin-bottom: 20px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta .icon { color: var(--text-muted); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.detail aside { position: sticky; top: calc(var(--topbar-h) + 16px); }
.subnav { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 16px; }
.subnav a { padding: 8px 2px; font-size: 14px; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--text-1); }
.subnav a.active { color: var(--text-1); border-bottom-color: var(--brand-primary); font-weight: 600; }
.oncall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.oncall-card { border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px 12px; font-size: 13px; background: var(--surface-card); }
.oncall-card.empty-team { border-color: var(--danger); }
.oncall-card h3 { margin: 0 0 4px; font-size: 13px; }
.oncall-card .warn { color: var(--danger); font-weight: 600; }
.share-bar { display: inline-block; height: 8px; border-radius: 999px; background: var(--brand-primary); vertical-align: middle; min-width: 2px; }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 16px; }
.tabs button {
    display: inline-flex; align-items: center; gap: 6px; background: none; border: none; border-bottom: 2px solid transparent;
    padding: 10px 2px; margin-bottom: -1px; font-weight: 500; color: var(--text-2); cursor: pointer;
}
.tabs button:hover { color: var(--text-1); }
.tabs button[aria-selected="true"] { color: var(--text-1); border-bottom-color: var(--brand-primary); }
.tabs .count { padding: 0 6px; font-size: 11px; }
.composer { background: var(--private-tint); border: 1px solid var(--private-line); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 12px; }
.composer-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.composer textarea.input { background: var(--surface-card); min-height: 88px; }
.composer-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.hint { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; margin: 0 0 16px; }
.msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 10px; }
.msg.private { background: var(--private-tint); border-color: var(--private-line); }
.msg-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.msg-meta strong { color: var(--text-1); font-weight: 600; }
.msg-meta time { margin-inline-start: auto; color: var(--text-muted); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.tag-private { font-size: 11px; font-weight: 600; color: var(--private-text); background: var(--private-tag); border-radius: var(--radius-sm); padding: 2px 6px; display: inline-flex; gap: 4px; align-items: center; }
.props h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 4px; }
.props dl { margin: 0; }
.props dt { font-size: 12px; font-weight: 500; color: var(--text-2); margin-top: 14px; margin-bottom: 6px; }
.props dt label { font: inherit; }
.props dd { margin: 0; }
.props .contact { display: flex; gap: 10px; align-items: flex-start; }
.props .contact div { min-width: 0; }
.props .contact div > span { display: block; color: var(--text-muted); font-size: 13px; overflow-wrap: anywhere; }
.props .props-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-block: 0 18px; padding-inline: 24px 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface-card); border: 2px solid var(--border-strong); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 8px; top: 18px; bottom: 0; width: 1px; background: var(--border-subtle); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.key-event::before { border-color: var(--brand-accent); }
.timeline .what { color: var(--text-1); }
.timeline .who { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* Comfortable ticket rows (VQ-6) */
.ticket-rows { list-style: none; margin: 0; padding: 0; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--elev-1); overflow: hidden; }
.ticket-rows li { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); transition: background var(--ease); }
.ticket-rows li:last-child { border-bottom: 0; }
.ticket-rows li > .chip { justify-self: start; }
.ticket-rows li:hover { background: var(--surface-sunken); }
.ticket-rows .subject { display: block; font-weight: 600; color: var(--text-1); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-rows .subject:hover { color: var(--brand-primary); }
.ticket-rows .row-link::after { content: ""; position: absolute; inset: 0; }
.ticket-rows .row-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.ticket-rows .row-owner { font-size: 13px; }
.ticket-rows li:has(.row-link:focus-visible) { outline: 2px solid var(--brand-primary); outline-offset: -2px; }
.layout-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-md); overflow: hidden; }
.layout-toggle button { display: inline-flex; align-items: center; gap: 6px; height: calc(var(--control-h) - 2px); padding: 0 10px; border: 0; background: var(--surface-card); color: var(--text-2); cursor: pointer; font-weight: 500; }
.layout-toggle button + button { border-inline-start: 1px solid var(--border-strong); }
.layout-toggle button[aria-pressed="true"] { background: var(--surface-sunken); color: var(--text-1); }

/* Record pages: contact and account share one layout (CA-3) */
.record-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.record-head h1 { margin: 0; font-size: 22px; }
.record-head .sub { color: var(--text-2); font-size: 13px; margin-top: 2px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.record-head .sub a { color: var(--text-2); }
.record-head .actions { margin-inline-start: auto; display: flex; gap: 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--elev-1); color: var(--text-1); text-decoration: none; }
a.kpi:hover { border-color: var(--border-strong); }
.kpi-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-label { color: var(--text-2); font-size: 13px; }
.props dd.plain { overflow-wrap: anywhere; }
.props .none { color: var(--text-muted); }

/* Rich text editor (Quill snow theme mapped to 03 tokens) and rendered rich text */
.rte { background: var(--surface-card); border: 1px solid var(--border-control); border-radius: var(--radius-md); }
.rte:focus-within { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgb(246 138 43 / 30%); }
.rte[aria-invalid="true"] { border-color: var(--danger); }
.rte .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--border-subtle); padding: 6px 8px; font-family: var(--font-ui); }
.rte .ql-container.ql-snow { border: 0; font-family: var(--font-ui); font-size: 14px; }
.rte .ql-editor { min-height: 120px; max-height: 420px; overflow-y: auto; padding: 10px 12px; line-height: 1.5; color: var(--text-1); }
.rte .ql-editor.ql-blank::before { color: var(--text-muted); font-style: normal; inset-inline-start: 12px; }
.rte .ql-snow .ql-stroke { stroke: var(--text-2); }
.rte .ql-snow .ql-fill { fill: var(--text-2); }
.rte .ql-snow button:hover .ql-stroke, .rte .ql-snow button.ql-active .ql-stroke { stroke: var(--brand-primary); }
.rte .ql-snow button:hover .ql-fill, .rte .ql-snow button.ql-active .ql-fill { fill: var(--brand-primary); }
.rte .ql-snow .ql-tooltip { background: var(--surface-card); color: var(--text-1); border-color: var(--border-subtle); box-shadow: var(--elev-2); border-radius: var(--radius-md); z-index: 5; }
.rte .ql-snow .ql-tooltip input[type=text] { background: var(--surface-card); color: var(--text-1); border-color: var(--border-control); }
.rich { overflow-wrap: anywhere; }
.rich > :first-child { margin-top: 0; }
.rich > :last-child { margin-bottom: 0; }
.rich p { margin: 0 0 8px; }
.rich ul, .rich ol { margin: 0 0 8px; padding-inline-start: 22px; }
.rich blockquote { margin: 0 0 8px; padding-block: 2px 2px; padding-inline: 12px 0; border-inline-start: 3px solid var(--border-strong); color: var(--text-2); }
.rich pre, .rich code { font-family: var(--font-mono); font-size: 13px; background: var(--surface-sunken); border-radius: var(--radius-sm); }
.rich pre { padding: 8px 10px; overflow-x: auto; white-space: pre-wrap; }
.rich code { padding: 1px 4px; }
.rich img { max-width: 100%; height: auto; }

/* Composer: Reply / Private comment (screens §8) */
.composer.reply { background: var(--surface-card); border-color: var(--border-subtle); }
.mode-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-md); overflow: hidden; }
.mode-toggle label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; cursor: pointer; font-weight: 500; color: var(--text-2); background: var(--surface-card); }
.mode-toggle label + label { border-inline-start: 1px solid var(--border-strong); }
.mode-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.mode-toggle label:has(input:checked) { background: var(--surface-sunken); color: var(--text-1); }
.mode-toggle label:has(input:focus-visible) { outline: 2px solid var(--brand-primary); outline-offset: -2px; }
.envelope { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px 10px; align-items: center; margin-bottom: 10px; }
.envelope > label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.envelope .row { display: flex; gap: 8px; align-items: center; }
.composer-foot { gap: 8px; align-items: center; }
.composer-foot .hint { margin-block: 0 0; margin-inline: 0 auto; }
.delivery { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; }
.delivery-Queued { color: var(--text-muted); }
.delivery-Sent { color: var(--success); }
.delivery-Failed, .delivery-Bounced { color: var(--danger); }
.msg-envelope { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.msg.system { background: var(--surface-sunken); padding: 8px 12px; grid-template-columns: 20px minmax(0, 1fr); font-size: 13px; color: var(--text-2); }
.quoted-toggle { margin-top: 6px; }

/* Attachments */
.files { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.files li { display: inline-flex; align-items: center; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-card); }
.files a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; color: var(--text-1); text-decoration: none; font-size: 13px; max-width: 320px; }
.files a:hover { color: var(--brand-primary); }
.files .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .risky { color: var(--warning); }
.file-remove { border: 0; background: none; color: var(--text-muted); cursor: pointer; padding-block: 4px 4px; padding-inline: 0 6px; display: inline-flex; }
.file-remove:hover { color: var(--danger); }
.attach-button { cursor: pointer; }
.draft-state { font-size: 12px; color: var(--text-muted); }

/* Views: star, chips, filter drawer, builder (screens §5–§7) */
.star { font-size: 18px; color: var(--text-muted); }
.star.on { color: var(--brand-accent); }
.btn-active { border-color: var(--brand-primary); color: var(--brand-primary); }
.side-add { color: var(--text-muted) !important; font-weight: 400 !important; }
.side .trail.count { padding: 0 7px; font-size: 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 14px; }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; padding-block: 3px 3px; padding-inline: 10px 4px; border-radius: 999px; background: var(--surface-card); border: 1px solid var(--border-strong); font-size: 13px; }
.filter-chip button { border: 0; background: none; color: var(--text-muted); cursor: pointer; display: inline-flex; padding: 2px; border-radius: 50%; }
.filter-chip button:hover { color: var(--danger); background: var(--surface-sunken); }
.drawer-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 25%); z-index: 60; }
.drawer { position: fixed; top: 0; inset-inline-start: 0; bottom: 0; width: min(340px, 100vw); z-index: 61; background: var(--surface-card); box-shadow: var(--elev-3); display: flex; flex-direction: column; animation: drawer-in 160ms ease-out; }
@keyframes drawer-in { from { transform: translateX(-16px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); }
.drawer-head h2 { margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.drawer-body fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.drawer-body legend, legend.label { font-weight: 600; font-size: 13px; margin-bottom: 8px; padding: 0; }
.drawer-body .checkbox { margin-bottom: 6px; }
.date-range { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.date-range .input { min-width: 0; flex: 1; }
.drawer-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-subtle); }
fieldset.field { border: 0; padding: 0; }
.match-toggle { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--text-2); }
.condition { display: grid; grid-template-columns: 180px 170px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px; margin-bottom: 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-sunken); }
.condition.invalid { border-color: var(--danger); }
.value-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-top: 6px; }
.value-checks .checkbox { margin: 0; }
@media (max-width: 768px) { .condition { grid-template-columns: 1fr; } }

/* SLA badges (03 §2 overdue modifier) */
.sla { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--text-2); }
.sla-soon { color: var(--warning); }
.sla-late { color: var(--danger); font-weight: 600; }
.sla-paused { color: var(--st-hold); }
.sla-ok .icon { color: var(--text-muted); }
dd.sla-panel { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }

/* Setup: business hours, holidays */
.setup-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.setup-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--text-1); text-decoration: none; font-weight: 500; }
.setup-links a:hover { color: var(--brand-primary); }
.hours-grid { display: grid; gap: 6px; }
.hours-day { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border-subtle); }
.hours-blocks { display: flex; flex-wrap: wrap; gap: 8px; }
.hours-block { display: inline-flex; align-items: center; gap: 4px; }
/* MR-046: 12-hour locales need room for AM/PM, so the time fields size to their value. */
.hours-block .input { width: auto; min-width: 110px; }
.holiday-row { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 768px) { .hours-day, .holiday-row { grid-template-columns: 1fr; } }

/* Knowledge base (screens §12) */
.kb-tree h3 { text-transform: none; letter-spacing: 0; font-size: 12px; }
.kb-add-link { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 10px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; }
.kb-add { display: grid; gap: 6px; padding: 6px 10px; }
.article { max-width: 760px; }
.article h1 { font-size: 26px; }
.article .rich { font-size: 15px; line-height: 1.65; }
.article .rich h2 { font-size: 18px; margin: 18px 0 8px; }
.suggest { margin-top: 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); padding: 8px 10px; }
.suggest-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.suggest-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border-subtle); }
.suggest-item:first-of-type { border-top: 0; }
.suggest-item .snippet { color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Contact lookup */
.lookup { position: relative; }
.lookup-results {
    position: absolute; z-index: 10; inset-inline-start: 0; inset-inline-end: 0; top: calc(100% + 4px); padding: 4px;
    background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: 8px; box-shadow: var(--elev-2); max-height: 280px; overflow: auto;
}
.lookup-results button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: start; background: none; border: none; border-radius: var(--radius-md); padding: 7px 8px; color: var(--text-1); cursor: pointer; }
.lookup-results button:hover, .lookup-results button:focus, .lookup-results button.active { background: var(--surface-sunken); }
.lookup-results button.active { box-shadow: inset var(--start-edge, 3px) 0 0 var(--brand-accent); }
.lookup-results .new { border-top: 1px solid var(--border-subtle); border-radius: 0 0 var(--radius-md) var(--radius-md); color: var(--brand-primary); font-weight: 500; }
.picked { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--border-control); border-radius: var(--radius-md); padding-block: 4px 4px; padding-inline: 8px 4px; min-height: var(--control-h); }
.subcard { background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px; }

/* Auth: ink brand panel beside the form */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--surface-page); }
.auth-aside { background: var(--shell-bg); color: var(--shell-text); padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; width: 520px; height: 520px; inset-inline-end: -180px; bottom: -200px; transform: rotate(45deg); border-radius: 48px; background: linear-gradient(135deg, rgb(246 138 43 / 22%), rgb(246 138 43 / 0%)); }
.auth-aside .brand { font-size: 17px; }
.auth-aside h2 { font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; max-width: 420px; margin: 0 0 12px; color: var(--shell-text); }
.auth-aside p { color: var(--shell-text-2); max-width: 400px; margin: 0; }
.auth-aside small { color: #A1A1AA; position: relative; z-index: 1; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 16px; position: relative; }
.auth-language { position: absolute; top: 16px; inset-inline-end: 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .lead { color: var(--text-2); margin-bottom: 24px; }
.auth-brand { display: none; }
.auth-links { margin: 16px 0 0; text-align: center; font-size: 13px; }
.landing { max-width: 460px; margin: 72px auto; padding: 0 16px; }
.landing-card { margin: 0 auto; }
.workspace-form { display: grid; gap: 12px; margin: 16px 0 8px; }
.workspace-field { display: flex; align-items: center; border: 1px solid var(--border-strong, var(--border-subtle)); border-radius: var(--radius-md); background: var(--surface-card); overflow: hidden; }
.workspace-field .input { border: 0; box-shadow: none; flex: 1; min-width: 0; }
.workspace-field:focus-within { outline: 2px solid var(--brand-primary); outline-offset: 1px; }
.workspace-suffix { padding-inline: 10px; color: var(--text-2); font-size: 14px; white-space: nowrap; background: var(--surface-sunken); align-self: stretch; display: flex; align-items: center; }
.landing h1 { display: flex; align-items: center; gap: 10px; }

/* Narrow screens (03 §3) */
@media (max-width: 1100px) {
    .topbar-search input { width: 180px; }
    .detail { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 860px) {
    .tenant, .topbar-search { display: none; }
    .search-link { display: inline-flex; }
    .topbar nav .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .detail { grid-template-columns: minmax(0, 1fr); }
    .detail aside { position: static; order: -1; }
    .tabs { overflow-x: auto; gap: 14px; }
    .tabs button { white-space: nowrap; }
    .composer-head { flex-wrap: wrap; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 24px; }
}
@media (max-width: 768px) {
    .ticket-rows li { grid-template-columns: minmax(0, 1fr) auto; }
    .ticket-rows.selectable li { grid-template-columns: 20px minmax(0, 1fr) auto; }
    .ticket-rows.selectable li > .chip { grid-column: 2 / -1; }
    .ticket-rows.selectable li > .row-main { grid-column: 2; }
    .layout-toggle .hide-sm { display: none; }
    .ticket-rows li > .chip { grid-column: 1 / -1; justify-self: start; }
    .record-head .actions { margin-inline-start: 0; width: 100%; }
    .topbar { gap: 8px; padding: 0 12px; }
    .brand-name { display: none; }
    .topbar .btn-primary .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .topbar .btn-primary { width: 32px; padding: 0; }
    .side { display: none; }
    .phone-pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; margin-bottom: 12px; }
    .main { padding: 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .search-field, .search-field .input { width: 100%; }
    .page-head .actions { margin-inline-start: 0; width: 100%; }
    .table .hide-sm { display: none; }
    .table th, .table td { padding-inline-start: 12px; padding-inline-end: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

#blazor-error-ui { background: #FEF3C7; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); display: none; inset-inline-start: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; color: #111; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; inset-inline-end: 0.75rem; top: 0.5rem; }

/* Dashboard and reports (DB-1/DB-2): charts have equivalent data tables. */
.reporting { min-width: 0; }
.report-filters { display:flex; flex-wrap:wrap; align-items:end; gap:12px; margin-bottom:20px; }
.report-filters .field { flex:1 1 160px; margin:0; min-width:0; }
.report-grid,.report-catalog { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.report-catalog a { color:var(--text-1); text-decoration:none; }
.report-section { min-width:0; margin:16px 0; }
.report-section h2 { font-size:17px; margin:0 0 16px; }
.report-scroll { max-width:100%; overflow:auto; }
.report-scroll td { overflow-wrap:anywhere; }
.trend-chart { height:180px; display:flex; gap:3px; align-items:end; border-bottom:1px solid var(--border-subtle); }
.trend-chart>div { display:flex; align-items:end; gap:2px; flex:1; height:100%; }
.trend-chart i { display:block; width:50%; background:var(--brand-primary); min-height:1px; }
.trend-chart i.closed { background:var(--success); }
.report-metrics { display:grid; grid-template-columns:1fr auto; gap:16px; }
.report-metrics dd { margin:0; font-weight:600; }
.report-bars { display:grid; gap:6px; margin-bottom:16px; }
.report-bars>div { display:flex; align-items:center; gap:8px; font-size:12px; }
.report-bars span { flex:0 0 120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.report-bars i { height:8px; background:var(--brand-primary); max-width:65%; }
@media(max-width:768px) { .report-grid,.report-catalog { grid-template-columns:1fr; } .reporting .kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:430px) { .topbar nav { gap:0; } .topbar nav a { padding-inline:6px; } .topbar { gap:4px; padding-inline:8px; } }

/* Account settings (/Account/Manage) */
.banner-warning { background: color-mix(in srgb, var(--warning) 10%, var(--surface-card)); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.banner p { margin: 0; }
.banner p + p { margin-top: 6px; }
.account-manage .banner:has(p) { display: block; }
.account-manage .card { margin-bottom: 16px; }
.account-manage .card h2 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.account-manage .card .muted { margin: 0 0 12px; }
.account-manage .form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.account-manage .form-actions form { margin: 0; }
.account-manage form + form { margin-top: 8px; }
.account-manage > div:has(> form) { margin-top: 8px; }
.validation-summary ul, ul.validation-errors { margin: 0 0 12px; padding-block: 10px 10px; padding-inline: 28px 12px; border-radius: var(--radius-md); background: var(--danger-bg); color: var(--danger); }
.validation-summary:empty, ul.validation-errors:empty { display: none; }
.avatar-img { object-fit: cover; padding: 0; background: var(--surface-sunken); }
.avatar-edit { display: flex; gap: 20px; align-items: flex-start; }
.avatar-edit > div { display: grid; gap: 8px; min-width: 0; }
.avatar-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.avatar-upload input[type=file] { max-width: 100%; font: inherit; font-size: 13px; color: var(--text-2); }
.avatar-upload input[type=file]::file-selector-button { font: inherit; border: 1px solid var(--border-strong); background: var(--surface-card); color: var(--text-1); border-radius: var(--radius-md); padding: 6px 10px; margin-inline-end: 8px; cursor: pointer; }
.status-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.status-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-sunken); color: var(--text-muted); flex-shrink: 0; }
.status-icon.on { background: color-mix(in srgb, var(--brand-accent) 14%, var(--surface-card)); color: var(--brand-accent); }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding-inline-start: 64px; }
.steps > li::before { content: counter(step); position: absolute; inset-inline-start: 20px; top: 20px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-sunken); font-weight: 600; font-size: 13px; }
.qr-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr { width: 168px; height: 168px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-subtle); background: #fff; }
.qr svg { width: 100%; height: 100%; display: block; }
.secret-key { display: inline-block; font-family: var(--font-mono, ui-monospace, monospace); font-size: 14px; letter-spacing: .04em; padding: 8px 10px; border-radius: var(--radius-md); background: var(--surface-sunken); word-break: break-all; }
.recovery-codes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.recovery-codes code { display: block; text-align: center; padding: 8px; border-radius: var(--radius-md); background: var(--surface-sunken); font-size: 14px; }
.account-tabs { display: none; }
@media (max-width: 640px) {
    .account-tabs { display: flex; gap: 4px; overflow-x: auto; margin: -8px 0 16px; border-bottom: 1px solid var(--border-subtle); }
    .account-tabs a { padding: 8px 10px; white-space: nowrap; color: var(--text-2); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; }
    .account-tabs a.active { color: var(--text-1); border-bottom-color: var(--brand-accent); }
    .avatar-edit { flex-direction: column; }
    .steps > li { padding-inline-start: 20px; }
    .steps > li::before { position: static; margin-bottom: 8px; }
}

/* Setup layout (screens §15): tree, breadcrumbs, scope note; the tree becomes a dropdown on phones. */
.setup-main { max-width: 1040px; }
.setup-tree .setup-switch { position: relative; margin: 0 4px 6px; }
.setup-switch summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); cursor: pointer; background: var(--surface-card); }
.setup-switch summary::-webkit-details-marker { display: none; }
.setup-switch summary:hover { border-color: var(--border-strong); }
.setup-switch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.setup-switch .menu { position: absolute; inset-inline-start: 0; inset-inline-end: 0; top: calc(100% + 4px); z-index: 40; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--elev-2); padding: 6px; }
.setup-switch .menu a { box-shadow: none; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.breadcrumbs a { color: var(--text-2); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text-1); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--text-1); font-weight: 500; }
.scope-note { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; font-size: 13px; color: var(--text-2); background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: 999px; padding: 3px 10px; }
.scope-note .icon { color: var(--text-muted); }
.setup-mobile { display: none; }
@media (max-width: 768px) {
    .setup-mobile { display: block; position: relative; margin-bottom: 12px; }
    .setup-mobile > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface-card); cursor: pointer; font-weight: 500; }
    .setup-mobile > summary span { flex: 1; }
    .setup-mobile > summary::-webkit-details-marker { display: none; }
    .setup-mobile-menu { position: absolute; inset-inline-start: 0; inset-inline-end: 0; top: calc(100% + 4px); z-index: 45; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--elev-2); padding: 10px; max-height: 70vh; overflow-y: auto; }
    .setup-mobile-menu h3 { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 10px 8px 4px; font-weight: 600; }
    .setup-mobile-menu > a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: var(--radius-md); color: var(--text-1); text-decoration: none; }
    .setup-mobile-menu > a.active { background: var(--surface-sunken); font-weight: 600; }
    .setup-mobile-menu .setup-switch summary { min-height: 40px; }
    .setup-mobile-menu .setup-switch .menu { position: static; box-shadow: none; margin-top: 4px; }
}

/* Confirmation dialog (screens §3). */
.dialog-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 40%); z-index: 70; }
.dialog { position: fixed; z-index: 71; left: 50%; top: 18vh; transform: translateX(-50%); width: min(480px, calc(100vw - 32px)); background: var(--surface-card); color: var(--text-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--elev-3); padding: 20px; }
.dialog h2 { margin: 0 0 8px; font-size: 18px; }
.dialog-body { color: var(--text-2); }
.dialog-body p { margin: 0 0 10px; }
.dialog .form-actions { margin-top: 16px; }
.dialog-wide { width: min(640px, calc(100vw - 32px)); top: 8vh; max-height: 84vh; overflow-y: auto; }

/* Setup lists and status pills. */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.pill-active { color: var(--success); background: var(--success-bg); }
.pill-invited { color: var(--info); background: var(--info-bg); }
.pill-muted { color: var(--text-2); background: var(--surface-sunken); border-color: var(--border-subtle); }
.pill-danger { color: var(--danger); background: var(--danger-bg); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table td .sub { display: block; color: var(--text-muted); font-size: 12px; }
.grant-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 640px) { .grant-row { grid-template-columns: 1fr 1fr; } }
.role-summary { columns: 2; column-gap: 24px; padding: 0; margin: 8px 0 0; list-style: none; font-size: 13px; }
.role-summary li { display: flex; gap: 6px; align-items: center; padding: 2px 0; break-inside: avoid; }
.role-summary .no { color: var(--text-muted); text-decoration: line-through; }
@media (max-width: 640px) { .role-summary { columns: 1; } }
.setup-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 24px; }
.setup-cards a { display: flex; gap: 10px; align-items: flex-start; padding: 14px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); text-decoration: none; color: var(--text-1); }
.setup-cards a:hover { border-color: var(--border-strong); box-shadow: var(--elev-1); }
.setup-cards a span { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.setup-cards .icon { color: var(--brand-primary); margin-top: 2px; flex-shrink: 0; }
.role-select { height: 30px; width: auto; min-width: 110px; padding-block: 0; }
.role-lines { display: flex; flex-direction: column; font-size: 13px; white-space: nowrap; }
.avatar-placeholder { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 999px; border: 1px dashed var(--border-strong); color: var(--text-muted); flex-shrink: 0; }
.row-actions .btn { white-space: nowrap; }
.add-member { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; }
.add-member .field { margin: 0; }
@media (max-width: 640px) { .add-member { grid-template-columns: 1fr; } }
.member-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; margin-bottom: 6px; }
.avatar-stack { display: inline-flex; vertical-align: middle; }
.avatar-stack > * + * { margin-inline-start: -3px; }
.avatar-stack > * { box-shadow: 0 0 0 2px var(--surface-card); border-radius: 999px; }

/* Tenant picker (screens §4.3). */
.tenant-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.tenant-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--surface-card); color: var(--text-1); text-decoration: none; }
.tenant-card:hover { border-color: var(--border-strong); box-shadow: var(--elev-1); }
.tenant-card .sub { display: block; color: var(--text-muted); font-size: 12px; }
.tenant-card.disabled { opacity: .6; }
.tenant-initial { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--shell-bg); color: var(--brand-accent); font-weight: 700; flex-shrink: 0; }
.tenant-go { margin-inline-start: auto; transform: rotate(-90deg); color: var(--text-muted); }
.support-banner { background: var(--danger); color: #fff; padding: 6px 16px; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; justify-content: center; }
.status-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Branding (screens §15.11). The preview imitates an email client, so it stays light in dark mode. */
.branding-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .branding-grid { grid-template-columns: 1fr; } }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 40px; height: var(--control-h); padding: 2px; border: 1px solid var(--border-control); border-radius: var(--radius-md); background: var(--surface-card); }
.logo-row { margin: 4px 0 8px; }
.logo-thumb { max-height: 40px; max-width: 200px; display: block; }
.email-preview { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; background: #FFFFFF; color: #111111; }
.email-preview-head { padding: 10px 14px; border-bottom: 1px solid #E4E4E7; font-size: 12px; background: #FAFAFA; color: #111111; }
.email-preview-head .muted { color: #71717A; }
.email-preview-body { padding: 16px; font-family: "Segoe UI", Roboto, Arial, sans-serif; font-size: 14px; line-height: 1.5; }
.field label.upload-btn { display: inline-flex; width: auto; margin-block: 0 0; margin-inline: 0 6px; }
.retention-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.retention-row .input { max-width: 320px; }
.grant-form { display: grid; grid-template-columns: 1.2fr .6fr 1.6fr auto; gap: 12px; align-items: start; }
.grant-form > .btn { margin-top: 22px; }
.grant-form .field { margin: 0; }
@media (max-width: 900px) { .grant-form { grid-template-columns: 1fr; } }
.platform-main { max-width: 1200px; margin: 0 auto; }
.platform-pill { color: var(--brand-accent); }
.slug-row { display: flex; gap: 6px; align-items: center; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 0; }
.facts dt { font-size: 12px; color: var(--text-muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; } /* long values (email addresses) wrap instead of running into the next column */
.table tr.selected td { background: var(--surface-sunken); }
.audit-filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.audit-filters .field { margin: 0; }
.platform-signout { margin: 0; display: flex; }
.platform-signout .btn { color: var(--shell-text-2); }

/* Notifications bell panel (screens §1). */
.bell-menu { position: relative; }
.bell-backdrop { position: fixed; inset: 0; z-index: 39; }
.bell-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 40; width: min(380px, calc(100vw - 24px)); background: var(--surface-card); color: var(--text-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--elev-2); overflow: hidden; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); }
.bell-panel .notes { max-height: 360px; overflow-y: auto; }
.bell-panel .notes li { grid-template-columns: 10px minmax(0, 1fr); padding: 10px 12px; }
.bell-panel .notes .title { font-size: 13px; }
.bell-empty { padding: 20px 12px; margin: 0; color: var(--text-muted); text-align: center; }
.bell-all { display: block; padding: 10px 12px; border-top: 1px solid var(--border-subtle); text-align: center; font-size: 13px; color: var(--text-2); text-decoration: none; }
.bell-all:hover { background: var(--surface-sunken); color: var(--text-1); }
@media (max-width: 640px) { .bell-panel { position: fixed; inset-inline-start: 12px; inset-inline-end: 12px; top: calc(var(--topbar-h) + 4px); width: auto; } }
.notify-prefs td:not(:first-child), .notify-prefs th:not(:first-child) { width: 80px; text-align: center; }
.topbar .bell-panel a.bell-all { color: var(--text-2); }

/* Skip link (WCAG 2.4.1): hidden until focused. */
.skip-link { position: absolute; inset-inline-start: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: var(--radius-md); background: var(--surface-card); color: var(--text-1); box-shadow: var(--elev-2); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }
#main-content:focus { outline: none; }

/* Status menu (TR-4): searchable, icon + color + label for every status. */
.status-menu { position: relative; }
.status-menu-button { display: inline-flex; align-items: center; gap: 6px; min-height: var(--control-h); padding: 0 8px; border: 1px solid var(--border-control); border-radius: var(--radius-md); background: var(--surface-card); color: var(--text-1); cursor: pointer; }
.status-menu-button:disabled { opacity: .6; cursor: not-allowed; }
.status-menu-backdrop { position: fixed; inset: 0; z-index: 39; }
.status-menu-panel { position: absolute; inset-inline-start: 0; top: calc(100% + 4px); z-index: 40; width: 220px; padding: 8px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--elev-2); }
.status-menu-panel ul { list-style: none; margin: 6px 0 0; padding: 0; }
.status-menu-panel li { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; border-radius: var(--radius-md); cursor: pointer; }
.status-menu-panel li.active { background: var(--surface-sunken); box-shadow: inset var(--start-edge, 3px) 0 0 var(--brand-accent); }
.status-menu-empty { color: var(--text-muted); cursor: default !important; }
.version-body { max-height: 50vh; overflow-y: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 12px 16px; }

/* Contact card on New ticket (TC-4). */
.contact-card { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 10px 12px; background: var(--surface-card); }
.contact-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contact-card-head .sub { display: block; color: var(--text-muted); font-size: 12px; }
.contact-card-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 10px 0 6px; }
.contact-card-facts dt { font-size: 12px; color: var(--text-muted); }
.contact-card-facts dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-card-link { font-size: 13px; }

/* Ticket queue beside the ticket (TR-1): wide screens only. */
.ticket-split { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.ticket-split > .main { flex: 1; min-width: 0; }
.ticket-queue { display: none; }
@media (min-width: 1280px) {
    .ticket-queue { display: block; width: 280px; flex-shrink: 0; background: var(--surface-card); border-inline-end: 1px solid var(--border-subtle);
        position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
}
.ticket-queue h3 { display: flex; align-items: center; gap: 6px; margin: 0; padding: 14px 14px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.ticket-queue ul { list-style: none; margin: 0; padding: 0 6px 12px; }
.ticket-queue li a { display: block; padding: 8px 10px; border-radius: var(--radius-md); color: var(--text-1); text-decoration: none; }
.ticket-queue li a:hover { background: var(--surface-sunken); }
.ticket-queue li.current a { background: var(--surface-sunken); box-shadow: inset var(--start-edge, 3px) 0 0 var(--brand-accent); }
.queue-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.queue-row .key { font-size: 12px; color: var(--text-2); }
.queue-subject { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.queue-meta { display: block; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Right-to-left (Arabic, NFR-9): layout uses logical properties; these flip what CSS can't express logically. */
[dir="rtl"] { --start-edge: -3px; }
[dir="rtl"] .crumb .icon, [dir="rtl"] .icon-directional { transform: scaleX(-1); }
[dir="rtl"] .tenant-go { transform: rotate(90deg); }
[dir="rtl"] .drawer { animation-name: drawer-in-rtl; }
@keyframes drawer-in-rtl { from { transform: translateX(16px); opacity: 0; } }
/* Customer-written text (subjects, messages, articles) keeps its own direction inside the Arabic layout. */
[dir="rtl"] .rich :is(p, li, div, blockquote), [dir="rtl"] :is(h1, h2, h3) { unicode-bidi: plaintext; }

/* M10 D5: CSV menu and the executive summary card */
.export-menu { position: relative; display: inline-block; }
.export-menu summary { list-style: none; cursor: pointer; }
.export-menu summary::-webkit-details-marker { display: none; }
.export-menu ul { position: absolute; z-index: 20; inset-inline-end: 0; margin: 4px 0 0; padding: 6px; list-style: none; min-width: 240px; max-height: 60vh; overflow: auto;
    background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--elev-2, 0 8px 24px rgba(0,0,0,.15)); }
.export-menu li a { display: block; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-1); text-decoration: none; font-size: 13px; }
.export-menu li a:hover, .export-menu li a:focus-visible { background: var(--surface-sunken); }
.summary-card .summary-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.summary-card textarea { width: 100%; min-height: 120px; }

/* M10 D2: resolution-time line chart */
.line-chart { width: 100%; max-width: 760px; height: auto; }
.line-chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.line-chart .grid { stroke-dasharray: 3 3; }
.line-chart .line { stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .line-avg, .line-avg-dot { stroke: var(--brand-primary); background: var(--brand-primary); }
.line-chart .line-median, .line-median-dot { stroke: #2563EB; background: #2563EB; }
.line-chart .tick { font-size: 9px; fill: var(--text-muted); }
.line-chart .dot-avg { fill: var(--brand-primary); }
.line-chart .dot-median { fill: #2563EB; }
.azure-panel { border-top: 1px solid var(--border); margin-block-start: 1.5rem; padding-block-start: 1rem; overflow-wrap: anywhere; }
.azure-panel h2 { margin-block: 0 .75rem; }
.azure-link { display: grid; gap: .35rem; border: 1px solid var(--border); border-radius: 10px; padding: .75rem; margin-block: .75rem; }
.azure-link .field { margin-block: .35rem 0; }
.azure-dialog-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgb(0 0 0 / 55%); display: grid; place-items: center; padding: 1rem; }
.azure-dialog { width: min(100%, 620px); max-height: calc(100vh - 2rem); overflow: auto; }
.azure-dialog fieldset { border: 1px solid var(--border); border-radius: 8px; margin-block: 1rem; }
.azure-dialog fieldset label { display: block; margin-block: .4rem; }
.azure-search-result { display: grid; gap: .25rem; border-block-end: 1px solid var(--border); padding-block: .65rem; }

/* Setup → Azure Boards */
.az-cards { display: grid; gap: 20px; }
.az-card-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 16px; }
.az-card-head .card-title { margin-bottom: 4px; }
.az-card-head p, .az-card-head .card-title:only-child { margin-bottom: 0; }
.az-card-head > .btn { flex: none; }
.az-note { font-size: 13px; margin: 4px 0 0; }
.az-cards .field .hint { margin-bottom: 0; }
.az-status { display: grid; gap: 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.az-test { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; overflow-wrap: anywhere; }
.az-status .checkbox, .az-options .checkbox:last-child, .az-map-body .checkbox { margin-bottom: 0; }
.az-options .checkbox { margin-bottom: 12px; }
.az-options { padding-top: 4px; }
.az-maps { display: grid; gap: 12px; }
.az-map { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px 16px; }
.az-map.is-open { border-color: var(--border-strong); background: var(--surface-sunken); }
.az-map-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); align-items: center; gap: 8px 16px; }
.az-map-head label { font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.az-map-body { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.az-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.az-state-group + .az-state-group { margin-top: 20px; }
.az-group-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 4px; }
.az-state-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); align-items: center; gap: 6px 16px; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.az-state-row label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-weight: 500; overflow-wrap: anywhere; }
.az-state-row label .muted { font-size: 12px; font-weight: 400; }
.az-queue { list-style: none; margin: 0; padding: 0; }
.az-queue li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.az-queue li > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
    .az-map-head, .az-types, .az-state-row { grid-template-columns: 1fr; }
    .az-map { padding: 12px; }
    .az-queue li { flex-direction: column; align-items: stretch; }
}

/* Customer portal (research/customer-portal-plan.md D2): the workspace's look, Sheen's tokens underneath. */
.side-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.portal-panel .portal-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.portal-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; padding: 2px 8px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-2); }
.portal-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.portal-state-active { color: var(--success); background: var(--success-bg); }
.portal-state-invited { color: var(--info); background: var(--info-bg); }
.portal-state-disabled, .portal-state-invitationexpired { color: var(--danger); background: var(--danger-bg); }
.portal { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface-page); }
.portal-top { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 24px; background: var(--surface-card); border-bottom: 1px solid var(--border-subtle); border-top: 3px solid var(--portal-accent, var(--brand-accent)); flex-wrap: wrap; }
.portal-top .spacer { flex: 1; }
.portal-top form { margin: 0; }
.portal-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--text-1); text-decoration: none; }
.portal-brand img { max-height: 32px; width: auto; }
.portal-brand-sub { color: var(--text-muted); font-weight: 500; }
.portal-top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.portal-top nav a { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-md); color: var(--text-2); text-decoration: none; font-weight: 500; }
.portal-top nav a:hover { background: var(--surface-sunken); color: var(--text-1); }
.portal-top nav a.active { color: var(--brand-primary); background: var(--surface-sunken); }
.portal-user { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.portal-main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 16px 40px; }
.portal-foot { text-align: center; color: var(--text-muted); font-size: 12px; padding: 16px; }
.portal-auth { max-width: 420px; margin: 24px auto; }
.portal-auth h1 { font-size: 22px; margin-bottom: 6px; }
.portal-auth .lead { color: var(--text-2); margin-bottom: 20px; }
.portal-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border-subtle); }
.portal-tabs a { padding: 8px 12px; color: var(--text-2); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.portal-tabs a.active { color: var(--text-1); border-bottom-color: var(--portal-accent, var(--brand-accent)); }
.portal-table .key { font-size: 12px; margin-top: 2px; }
.portal-thread { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.portal-msg { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px 16px; }
.portal-msg.from-team { border-inline-start: 3px solid var(--portal-accent, var(--brand-accent)); }
.portal-msg-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.portal-msg-meta strong { color: var(--text-1); }
.portal-msg-meta time { margin-inline-start: auto; color: var(--text-muted); }
.portal-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.portal-files a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 8px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); text-decoration: none; color: var(--text-1); }
.portal-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-size: 13px; margin-bottom: 8px; }
.portal-article { max-width: 760px; }
.portal-search { display: flex; gap: 8px; margin-bottom: 16px; }
.portal-search .input { flex: 1; }
.portal-articles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.portal-articles li { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px 16px; }
.portal-articles a { font-weight: 600; text-decoration: none; }
.portal-articles p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
@media (max-width: 640px) {
    .portal-top { padding: 8px 16px; }
    .portal-top nav .nav-label { display: none; }
}
.field > label.portal-attach { display: inline-flex; align-items: center; gap: 6px; width: auto; margin-bottom: 0; cursor: pointer; }
.portal-picked { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.portal-picked li { display: flex; align-items: center; gap: 6px; }
.portal-rate { margin-bottom: 16px; }
.portal-article h1 { margin-bottom: 4px; }

/* Searchable dropdown (SearchSelect): a select-looking button that opens a search panel */
.ss { position: relative; }
.ss-button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: start; cursor: pointer; }
.ss-button:disabled { opacity: .6; cursor: not-allowed; }
.ss-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-panel { position: absolute; inset-inline-start: 0; top: calc(100% + 4px); z-index: 40; min-width: 100%; width: max(100%, 240px); padding: 8px; background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--elev-2); }
.ss-panel ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.ss-panel li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: var(--radius-md); cursor: pointer; }
.ss-panel li.active { background: var(--surface-sunken); box-shadow: inset var(--start-edge, 3px) 0 0 var(--brand-accent); }

/* Platform admin: overview, tenant page */
.plain-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.bar-table { width: 100%; }
.bar-table th { font-weight: 500; text-align: start; width: 90px; white-space: nowrap; color: var(--text-2); }
.bar-table .bar-cell { width: 100%; }
.bar-table .bar { display: block; height: 10px; min-width: 2px; border-radius: 5px; background: var(--brand-accent); }
.bar-table .num { text-align: end; font-variant-numeric: tabular-nums; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }

/* Email templates editor */
.tpl-layout { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.tpl-list { display: grid; gap: 2px; }
.tpl-list h3 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.tpl-list h3:first-child { margin-top: 0; }
.tpl-list button { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; text-align: start; background: none; border: 0; border-radius: var(--radius-md); padding: 7px 10px; color: var(--text-1); cursor: pointer; }
.tpl-list button:hover { background: var(--surface-sunken); }
.tpl-list button.active { background: var(--surface-sunken); box-shadow: inset var(--start-edge, 3px) 0 0 var(--brand-accent); font-weight: 600; }
.tpl-source { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.tpl-source.own { color: var(--brand-primary); font-weight: 600; }
.tpl-lang { display: flex; gap: 6px; margin: 8px 0; }
.tpl-state { margin: 4px 0 12px; }
.tpl-body { min-height: 220px; line-height: 1.45; }
.tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tpl-vars .tag { cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; max-width: none; overflow: visible; }
@media (max-width: 860px) { .tpl-layout { grid-template-columns: minmax(0, 1fr); } .tpl-list { max-height: 40vh; overflow-y: auto; } .tpl-list button { flex-wrap: wrap; } .tpl-source { white-space: normal; } }
.tpl-editor { min-width: 0; }
.tpl-editor .form-actions { flex-wrap: wrap; }
