/* ==========================================================
   Settings, permissions, templates, reports
   ========================================================== */
/* Toggle switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch.is-off, .switch input:disabled + span { opacity: .4; cursor: not-allowed; }
.color-input { width: 80px; height: 38px; padding: 2px; }
.logo-preview { margin-bottom: 8px; padding: 10px; background: var(--bg); border: 1px dashed var(--border); border-radius: 8px; display: inline-block; }
.logo-preview img { max-height: 60px; max-width: 240px; display: block; }

/* Branding in the shell */
.sidebar .brand { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.brand-logo { max-width: 60px; max-height: 40px; object-fit: contain; }
.login-logo { max-height: 34px; max-width: 160px; object-fit: contain; }
.sidebar.no-labels nav a span:not(.icon) { display: none; }
.sidebar.no-labels { width: 64px; }

/* Roles & permissions */
.role-list { list-style: none; padding: 0; margin: 8px 0 16px; display: flex; flex-direction: column; gap: 2px; }
.role-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; align-items: baseline; }
.role-list li.active { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.role-list li.active a { font-weight: 700; }
.role-list li.is-fixed { color: var(--text-muted); }
.perm-grid td, .perm-grid th { text-align: center; }
.perm-grid td:first-child, .perm-grid th:first-child { text-align: left; }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 16px; }
.cap-item code { font-size: 10.5px; color: var(--text-muted); margin-left: 4px; }
.access-grid td { vertical-align: middle; }
.access-select { width: auto; display: inline-block; font-size: 12.5px; padding: 4px 6px; }
.access-select.mode-allow { border-color: var(--good); color: var(--good); }
.access-select.mode-deny { border-color: var(--bad); color: var(--bad); }
.eff { display: inline-block; width: 22px; text-align: center; font-weight: 700; margin-left: 4px; }
.eff.yes { color: var(--good); } .eff.no { color: var(--bad); }

/* Templates */
.template-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 16px; }
.template-card { display: flex; flex-direction: column; gap: 4px; color: var(--text); padding: 12px 14px; }
.template-card:hover { text-decoration: none; border-color: var(--brand); }
.template-card.is-active { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.template-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; padding: 10px 14px; max-width: 900px; }
.template-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; }
.template-chip a.active { font-weight: 700; }

/* Reports */
.report-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.report-panel { position: sticky; top: 70px; }
.report-panel .form-group { margin-bottom: 10px; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.report-canvas { position: relative; margin-top: 10px; }
.report-total { font-size: 13px; color: var(--text-muted); }
.report-number { display: flex; flex-direction: column; align-items: center; padding: 40px 10px; }
.report-number span { font-size: 56px; font-weight: 800; color: var(--brand); line-height: 1; }
.report-number small { color: var(--text-muted); margin-top: 8px; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) { .report-layout { grid-template-columns: 1fr; } .report-panel { position: static; } }
@media print {
    .report-panel, .report-save, .tabs, .toolbar-actions { display: none !important; }
    .report-layout { grid-template-columns: 1fr; }
}

/* Email settings */
.provider-presets { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-top:10px; }
.test-send { display:inline-flex; gap:6px; align-items:center; }
.test-send .form-control { width:auto; min-width:220px; }
.tips { padding-left:18px; margin:8px 0; line-height:1.5; font-size:.9rem; }
.tips li { margin-bottom:6px; }

/* CAPTCHA */
.captcha-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.captcha-img { border:1px solid var(--border, #d0d5dd); border-radius:8px; background:#fff; max-width:100%; height:auto; }
.captcha-input { text-transform:uppercase; letter-spacing:.3em; font-family:ui-monospace, Consolas, monospace; max-width:200px; }
.captcha-box { margin-top:4px; }

/* Users & invitations */
.setup-choice { border:1px solid var(--border, #d0d5dd); border-radius:8px; padding:8px 12px; margin:0 0 14px; }
.setup-choice legend { font-weight:600; font-size:.9rem; padding:0 4px; }
.setup-choice .checkbox { display:block; margin:6px 0; }
.share-link { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.share-link .form-control { flex:1 1 320px; font-family:ui-monospace, Consolas, monospace; font-size:.8rem; }
.terms-box { max-height:160px; overflow:auto; border:1px solid var(--border, #d0d5dd); border-radius:8px; padding:10px; font-size:.85rem; margin-bottom:8px; }
.check-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:4px 12px; margin:8px 0 14px; }
.mono { font-family:ui-monospace, Consolas, monospace; }

/* Email template editor */
.tpl-layout { grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap:16px; }
@media (max-width: 900px) { .tpl-layout { grid-template-columns: 1fr; } }
.tpl-list { padding:8px; display:flex; flex-direction:column; }
.tpl-list a { padding:7px 10px; border-radius:6px; color:inherit; text-decoration:none; font-size:.9rem; display:flex; align-items:center; justify-content:space-between; gap:6px; }
.tpl-list a:hover { background:var(--hover, rgba(0,0,0,.05)); }
.tpl-list a.active { background:var(--brand, #2563eb); color:#fff; }
.tpl-group { font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted, #667085); padding:10px 10px 4px; }
.tpl-list .dot { width:8px; height:8px; border-radius:50%; background:#f59e0b; display:inline-block; flex:none; }
.placeholder-chips { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.placeholder-chips .chip { font-family:ui-monospace, Consolas, monospace; font-size:.78rem; padding:3px 8px; border-radius:999px; border:1px solid var(--border, #d0d5dd); background:transparent; color:inherit; cursor:pointer; }
.placeholder-chips .chip:hover { border-color:var(--brand, #2563eb); }
.email-frame { width:100%; height:720px; border:1px solid var(--border, #d0d5dd); border-radius:10px; background:#f2f4f7; }
.email-text-preview { white-space:pre-wrap; font-size:.82rem; background:var(--hover, rgba(0,0,0,.04)); padding:12px; border-radius:8px; max-height:360px; overflow:auto; }

/* ---------- Users & Access ---------- */
.sla-info { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.sla-paused { background: color-mix(in srgb, var(--text-muted, #64748b) 16%, transparent); color: var(--text-muted, #64748b); }
.sla-muted { background: color-mix(in srgb, var(--text-muted) 16%, transparent); color: var(--text-muted); }
.btn-link { background: transparent; color: var(--brand); border-color: transparent; }
.users-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.users-head .page-title { margin-bottom: 4px; }
.users-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.state-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.state-tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); text-decoration: none; font-size: 13px; }
.state-tabs a span { color: var(--text-muted); margin-left: 4px; font-weight: 600; }
.state-tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.state-tabs a.active span { color: rgba(255,255,255,.85); }
.users-card { padding: 0; overflow: hidden; }
.users-filter { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.users-filter input[type=search] { flex: 1 1 240px; max-width: 360px; }
.users-filter select { width: auto; min-width: 160px; }
.users-table td, .users-table th { vertical-align: middle; }
.users-table th:first-child, .users-table td:first-child { padding-left: 16px; }
.users-table .col-actions { text-align: right; padding-right: 16px; white-space: nowrap; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-name { font-weight: 600; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 700; color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, transparent); }
.pill-row { display: flex; flex-wrap: wrap; gap: 4px; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.share-link .share-hint { flex-basis: 100%; }
@media (max-width: 760px) { .users-table .col-actions { text-align: left; } .row-actions { justify-content: flex-start; } }

/* Modal dialogs */
dialog.modal { border: none; border-radius: 14px; padding: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
    background: var(--card-bg); color: var(--text); box-shadow: 0 20px 60px rgba(15, 20, 35, .35); }
dialog.modal::backdrop { background: rgba(15, 20, 35, .45); }
.modal-body { padding: 20px 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 16px; }
.modal-x { border: none; background: transparent; font-size: 24px; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.modal-x:hover { background: var(--bg); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.modal-section-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
    margin: 20px 0 8px; padding-top: 14px; border-top: 1px solid var(--border); }
form:first-of-type > .modal-section-title { border-top: none; padding-top: 0; margin-top: 4px; }
.action-list { display: flex; flex-direction: column; gap: 8px; }
.action-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin: 0; }
.action-item form { margin: 0; flex: none; }
.action-item .grow { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.setup-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 12px; }
@media (max-width: 620px) { .setup-options { grid-template-columns: 1fr; } }
.setup-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: normal; }
.setup-option:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.setup-option input { margin-top: 3px; }

/* ---------- Dashboard ---------- */
.dash-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-hero .page-title { margin: 2px 0 4px; font-size: 26px; }
.dash-date { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.dash-scope { color: var(--text-muted); font-size: 13.5px; }
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-link { font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; }
.dash-link:hover { text-decoration: underline; }

.dash-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.dash-filter { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 999px; background: var(--card-bg); padding: 0 4px 0 12px; font-size: 13px; margin: 0; }
.dash-filter span { color: var(--text-muted); font-weight: 600; margin-right: 4px; }
.dash-filter select { border: none; background: transparent; color: var(--text); font: inherit; font-weight: 600; padding: 7px 6px; cursor: pointer; max-width: 200px; }
.dash-filter select:focus { outline: none; }
.dash-filter:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi-grid-perf { margin-bottom: 20px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi { --tone: var(--brand); position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); color: var(--text); text-decoration: none; overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone); opacity: .85; }
a.kpi:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tone) 40%, var(--border)); box-shadow: 0 8px 22px rgba(16, 24, 40, .08); text-decoration: none; }
.kpi-danger { --tone: var(--bad); } .kpi-warn { --tone: var(--warn); } .kpi-good { --tone: var(--good); }
.kpi-icon { width: 38px; height: 38px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); }
.kpi-body { min-width: 0; flex: 1; }
.kpi-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.kpi-value { font-size: 28px; font-weight: 750; line-height: 1.15; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.kpi-sub .trend { font-size: 11.5px; }
.kpi-bar { display: block; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--tone) 14%, transparent); overflow: hidden; }
.kpi-bar span { display: block; height: 100%; background: var(--tone); border-radius: inherit; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 800px) { .dash-2col { grid-template-columns: 1fr; } }
.dash-card { margin: 0; padding: 16px 18px; }
.dash-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.dash-card-head strong { font-size: 14.5px; }
.chart-box { position: relative; width: 100%; }
.dash-table td, .dash-table th { vertical-align: middle; }
.dash-table td:first-child a { color: var(--text); font-weight: 600; text-decoration: none; }
.dash-table td:first-child a:hover { color: var(--brand); }
.req-id { color: var(--text-muted); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 2px; }
.due-over { color: var(--bad); font-weight: 600; font-size: 12.5px; }

.legend-list { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; }
.legend-list div { display: flex; align-items: center; gap: 8px; }
.legend-list b { margin-left: auto; font-variant-numeric: tabular-nums; }
.legend-list .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.hbar-list { display: flex; flex-direction: column; gap: 12px; }
.hbar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 5px; }
.hbar-top b { font-variant-numeric: tabular-nums; }
.hbar-track { height: 7px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.hbar-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.hbar.is-me .hbar-top span:first-child { font-weight: 700; }

.glance { list-style: none; margin: 0; padding: 0; }
.glance li + li { border-top: 1px solid var(--border); }
.glance a { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.glance a:hover { color: var(--brand); }
.glance b { font-size: 15px; font-variant-numeric: tabular-nums; }

.announce + .announce { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.announce-title { font-weight: 650; }
.announce-meta { color: var(--text-muted); font-size: 12px; margin: 2px 0 6px; }
.announce-body { font-size: 13.5px; line-height: 1.55; }

.dash-search { display: flex; align-items: center; gap: 10px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 6px 6px 6px 14px; margin-bottom: 18px; box-shadow: var(--shadow); color: var(--text-muted); }
.dash-search input { flex: 1; border: none; background: transparent; color: var(--text); font: inherit; font-size: 15px; padding: 8px 0; min-width: 0; }
.dash-search input:focus { outline: none; }
.dash-search:focus-within { border-color: var(--brand); }
.kpi-note { font-size: 11.5px; color: var(--text-muted); }

/* Mail accounts & routing */
.test-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; }
.test-row .form-control { width: auto; flex: 1 1 220px; }
.test-error { font-size: 11.5px; color: var(--bad); max-width: 260px; margin-top: 2px; }
.route-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 900px) { .route-grid { grid-template-columns: 1fr; } }
.route-table td { padding: 6px 8px; vertical-align: middle; }
.route-table td:last-child { width: 55%; }
.route-select { padding: 6px 8px; font-size: 13px; }
.route-select:has(option:checked:not([value=""])) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, var(--card-bg)); }
.btn-danger-text { color: var(--bad); }
.url-suggest { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -6px 0 12px; }
.reauth { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); max-width: 320px; }

/* ---------- Announcement banners ---------- */
.announce-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.announce-banner { --a: var(--brand); position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 14px 44px 14px 16px;
    border-radius: 12px; border: 1px solid color-mix(in srgb, var(--a) 35%, var(--border));
    background: linear-gradient(90deg, color-mix(in srgb, var(--a) 13%, var(--card-bg)), color-mix(in srgb, var(--a) 4%, var(--card-bg)));
    box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 14px color-mix(in srgb, var(--a) 10%, transparent); margin-bottom: 14px; }
.announce-stack .announce-banner { margin-bottom: 0; }
.announce-banner::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--a); }
.announce-banner.sev-success { --a: var(--good); }
.announce-banner.sev-warning { --a: var(--warn); }
.announce-banner.sev-critical { --a: var(--bad); border-width: 1.5px; }
.announce-icon { width: 38px; height: 38px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    color: #fff; background: var(--a); box-shadow: 0 4px 10px color-mix(in srgb, var(--a) 35%, transparent); }
.sev-critical .announce-icon { animation: announce-pulse 2.2s ease-in-out infinite; }
@keyframes announce-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--a) 45%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
@media (prefers-reduced-motion: reduce) { .sev-critical .announce-icon { animation: none; } }
.announce-content { min-width: 0; flex: 1; }
.announce-headline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 3px; }
.announce-kind { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--a); }
.sev-warning .announce-kind { color: color-mix(in srgb, var(--a) 70%, #7a4b00); }
.announce-new, .announce-pin { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.announce-new { background: var(--a); color: #fff; }
.announce-pin { background: color-mix(in srgb, var(--a) 16%, transparent); color: var(--text); }
.announce-title { flex-basis: 100%; font-size: 15.5px; line-height: 1.35; color: var(--text); }
.announce-text { font-size: 14px; line-height: 1.55; color: var(--text); }
.announce-text.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.announce-more summary { list-style: none; cursor: pointer; }
.announce-more summary::-webkit-details-marker { display: none; }
.announce-more[open] summary .announce-text { display: none; }
.announce-toggle { display: inline-block; margin-top: 3px; font-size: 13px; font-weight: 600; color: var(--brand); }
.announce-more[open] .announce-toggle { display: none; }
.announce-foot { margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.announce-dismiss { position: absolute; top: 8px; right: 8px; margin: 0; }
.announce-x { width: 28px; height: 28px; border: none; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 20px; line-height: 1; cursor: pointer; }
.announce-x:hover { background: color-mix(in srgb, var(--a) 16%, transparent); color: var(--text); }
.announce-overflow > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand); padding: 4px 2px; }
.announce-overflow[open] > summary { margin-bottom: 10px; }
.announce-overflow .announce-banner + .announce-banner { margin-top: 10px; }
/* Earlier (dismissed) list */
details.announce summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
details.announce summary::-webkit-details-marker { display: none; }
details.announce .announce-title { flex: 1; font-size: 13.5px; font-weight: 600; flex-basis: auto; }
details.announce .announce-meta { margin: 0; }
details.announce .announce-body { margin: 6px 0 0 16px; }
.sev-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--brand); }
.sev-dot.sev-success { background: var(--good); } .sev-dot.sev-warning { background: var(--warn); } .sev-dot.sev-critical { background: var(--bad); }
.numbering-table td { vertical-align: middle; } .numbering-table .num-prefix { max-width: 150px; } .numbering-table .num-digits { max-width: 80px; } .num-preview { font-weight: 700; }

/* ---------- Dashboard switch ---------- */
.dash-switch { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.dash-switch a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 9px; color: var(--text-muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.dash-switch a:hover { color: var(--text); background: var(--bg); }
.dash-switch a.active { background: var(--brand); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 35%, transparent); }

/* ---------- Projects dashboard ---------- */
.health-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.health-ok { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.health-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: color-mix(in srgb, var(--warn) 70%, #6b4400); }
.health-bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.health-done { background: color-mix(in srgb, var(--text-muted) 14%, transparent); color: var(--text-muted); }
.pf-progress { display: flex; align-items: center; gap: 8px; }
.pf-progress .hbar-track { flex: 1; position: relative; overflow: visible; }
.pf-progress .hbar-track span { border-radius: 999px; }
.pf-progress .hbar-track i { position: absolute; top: -3px; width: 2px; height: 13px; background: var(--text); opacity: .55; border-radius: 1px; }
.pf-progress b { font-size: 12.5px; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.portfolio td:first-child a { font-weight: 650; }
.colchart { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; height: 170px; align-items: end; padding-top: 6px; }
.colchart-col { display: flex; flex-direction: column; height: 100%; }
.colchart-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--border); }
.colchart-bars span { width: 38%; max-width: 18px; min-height: 2px; border-radius: 4px 4px 0 0; }
.c-done { background: var(--brand); } .c-created { background: color-mix(in srgb, var(--text-muted) 35%, transparent); }
.colchart-label { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 5px; white-space: nowrap; }
.legend-inline { display: flex; gap: 16px; margin-top: 10px; font-size: 12.5px; color: var(--text-muted); }
.legend-inline i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.task-mini, .milestone-list { list-style: none; margin: 0; padding: 0; }
.task-mini li + li, .milestone-list li + li { border-top: 1px solid var(--border); }
.task-mini a { display: flex; align-items: center; gap: 10px; padding: 9px 2px; color: var(--text); text-decoration: none; }
.task-mini a:hover .tm-title, .milestone-list a:hover .tm-title { color: var(--brand); }
.prio-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tm-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tm-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-due { font-size: 12px; white-space: nowrap; }
.milestone-list li { display: flex; gap: 12px; align-items: center; padding: 9px 0; }
.milestone-list a { display: flex; flex-direction: column; min-width: 0; color: var(--text); text-decoration: none; }
.ms-date { width: 42px; flex: none; text-align: center; border-radius: 9px; padding: 4px 0; font-size: 10.5px; text-transform: uppercase; font-weight: 700;
    color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); line-height: 1.1; }
.ms-date b { display: block; font-size: 17px; }
.ms-date.late { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }

/* ---------- Request > Project work ---------- */
.project-work .pw-project { padding: 10px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; }
.project-work .pw-project:first-of-type { border-top: none; padding-top: 4px; }
.pw-task { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 4px; padding: 7px 9px; border-radius: 8px; background: var(--bg); color: var(--text); text-decoration: none; font-size: 13px; }
.pw-task:hover { outline: 1px solid var(--brand); }
.pw-meta { flex-basis: 100%; font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.pw-add > summary { cursor: pointer; font-weight: 600; color: var(--brand); font-size: 13.5px; margin-top: 8px; }
.pw-form { margin-top: 10px; }
.pw-form .checkbox { display: block; margin: 4px 0; }
.pw-form:has(input[value="link"]:checked) .pw-task-fields { display: none; }

/* Bulk selection on Users & Access */
.col-check { width: 36px; padding-left: 16px !important; padding-right: 0 !important; }
.col-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--brand); }
.users-table th.col-check + th, .users-table td.col-check + td { padding-left: 8px; }
.bulk-bar.bulk-users { display: none; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; margin: 0;
    background: color-mix(in srgb, var(--brand) 8%, var(--card-bg)); border-bottom: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
    position: sticky; top: 0; z-index: 5; }
.bulk-bar.bulk-users.show { display: flex; }
.bulk-bar[hidden] { display: none !important; }
.bulk-bar .form-control { width: auto; min-width: 180px; padding: 6px 8px; font-size: 13px; }
.bulk-bar strong { font-size: 13.5px; margin-right: 4px; }
tr.row-selected td { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.danger-title { color: var(--bad); } .danger-item { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); background: color-mix(in srgb, var(--bad) 4%, transparent); }

/* ---------- Global search ---------- */
.global-search { position: relative; }
.global-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); background: var(--card-bg); }
.search-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; max-height: min(70vh, 560px); overflow-y: auto;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(15, 20, 35, .18); padding: 6px; }
.search-suggest.loading { opacity: .75; }
.ss-group { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); padding: 10px 10px 4px; }
.ss-item { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.ss-item:hover, .ss-item.active, .ss-all.active { background: color-mix(in srgb, var(--brand) 10%, transparent); text-decoration: none; }
.ss-top { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.ss-key { font-size: 12px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; flex: none; }
.ss-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-meta { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-exact { border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border)); background: color-mix(in srgb, var(--brand) 5%, transparent); }
.ss-empty { padding: 14px 10px; font-size: 13px; color: var(--text-muted); }
.ss-all { display: block; margin-top: 4px; padding: 9px 10px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--brand); text-decoration: none; border-radius: 0 0 8px 8px; }
.search-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .search-groups { grid-template-columns: 1fr; } }
.search-results li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.search-results li:last-child { border-bottom: none; }
.search-results a { font-weight: 600; }

/* ---------- Arcade ---------- */
.arcade-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; padding: 20px 22px; border-radius: 16px;
    background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 16%, var(--card-bg)), color-mix(in srgb, #8b5cf6 12%, var(--card-bg))); border: 1px solid var(--border); }
.arcade-me { display: flex; gap: 16px; align-items: center; min-width: 280px; flex: 1; }
.arcade-me .page-title { margin: 0 0 8px; }
.arcade-me-body { flex: 1; max-width: 420px; }
.arcade-level-name { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.arcade-avatar { --lv: #64748b; width: 64px; height: 64px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px;
    color: #fff; background: var(--lv); box-shadow: 0 0 0 4px var(--card-bg), 0 0 0 7px color-mix(in srgb, var(--lv) 55%, transparent); }
.lvl-0 { --lv: #64748b; } .lvl-1 { --lv: #16a34a; } .lvl-2 { --lv: #2563eb; } .lvl-3 { --lv: #8b5cf6; } .lvl-4 { --lv: #db2777; } .lvl-5, .lvl-6, .lvl-7 { --lv: #d97706; }
.arcade-progress { height: 9px; border-radius: 999px; background: color-mix(in srgb, var(--text-muted) 18%, transparent); overflow: hidden; margin-bottom: 6px; }
.arcade-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #8b5cf6); }
.arcade-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.arcade-stats div { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; min-width: 110px; text-align: center; }
.arcade-stats b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.arcade-stats span { font-size: 11.5px; color: var(--text-muted); }
.arcade-filters { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.arcade-filters .state-tabs a { display: inline-flex; gap: 5px; align-items: center; }
.level-chip { --lv: #64748b; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--lv); background: color-mix(in srgb, var(--lv) 14%, transparent); }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 200px)); justify-content: center; align-items: end; gap: 14px; margin: 18px 0 20px; }
.podium-spot { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.podium-name { font-weight: 700; margin-top: 6px; }
.podium-block { width: 100%; margin-top: 6px; border-radius: 12px 12px 4px 4px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; color: #fff; }
.podium-block b { font-size: 22px; }
.podium-block small { opacity: .85; font-size: 11px; }
/* A shiny metal disc (radial highlight + inset ring + drop shadow), not
   a flat translucent circle - so the "1/2/3" on the podium itself reads
   as an actual medal, colored to match its own block below it. */
.podium-rank { font-weight: 800; font-size: 13px; width: 26px; height: 26px; border-radius: 50%; color: #fff; display: inline-flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.55), 0 2px 5px rgba(0,0,0,.4); }
.place-1 .podium-rank { background: radial-gradient(circle at 35% 30%, #fef3c7, #f59e0b 55%, #b45309); width: 30px; height: 30px; font-size: 14px; }
.place-2 .podium-rank { background: radial-gradient(circle at 35% 30%, #f1f5f9, #94a3b8 55%, #475569); }
.place-3 .podium-rank { background: radial-gradient(circle at 35% 30%, #fdd8b8, #c2703d 55%, #7c3a12); }
.place-1 .podium-block { height: 150px; background: linear-gradient(180deg, #f59e0b, #d97706); }
.place-2 .podium-block { height: 120px; background: linear-gradient(180deg, #94a3b8, #64748b); }
.place-3 .podium-block { height: 96px; background: linear-gradient(180deg, #d97757, #b45309); }
.place-1 .arcade-avatar { width: 74px; height: 74px; }
.arcade-table .num { text-align: right; padding-right: 18px; }
.rank { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; background: var(--bg); color: var(--text-muted); }
/* Top 3 read as real medals, not just a tinted number - same gold/
   silver/bronze gradients the podium above already uses (so the small
   table badge and the big podium block are recognizably the same medal),
   plus a matching glow and a slightly larger size so 1st place is
   unmistakably the most prominent at a glance. */
.rank-1, .rank-2, .rank-3 { color: #fff; font-size: 14px; box-shadow: 0 0 0 2px var(--card-bg), 0 2px 6px rgba(0,0,0,.25); }
.rank-1 { width: 32px; height: 32px; background: linear-gradient(180deg, #fcd34d, #d97706); box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px color-mix(in srgb, #f59e0b 45%, transparent), 0 2px 6px rgba(0,0,0,.3); }
.rank-2 { width: 30px; height: 30px; background: linear-gradient(180deg, #cbd5e1, #64748b); }
.rank-3 { width: 30px; height: 30px; background: linear-gradient(180deg, #e0996b, #b45309); }
.arcade-badge { --b: #2563eb; position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; color: #fff;
    background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--b) 55%, #fff), var(--b)); box-shadow: 0 3px 8px color-mix(in srgb, var(--b) 40%, transparent), inset 0 0 0 2px rgba(255,255,255,.35); }
.arcade-badge i { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 10px; font-weight: 800; background: var(--card-bg); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 0 5px; }
.badge-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; }
.badge-wall div { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; font-weight: 600; }
.level-ladder { list-style: none; margin: 0; padding: 0; }
.level-ladder li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); opacity: .6; }
.level-ladder li.done, .level-ladder li.current { opacity: 1; }
.quest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.quest-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.quest-head { display: flex; gap: 12px; align-items: center; }
.quest-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.quest-done { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }
.quest-status { font-size: 12.5px; font-weight: 700; color: var(--good); }
.trophy-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.trophy { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px; background: var(--bg); font-size: 13px; }
.trophy-icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); margin-bottom: 4px; }
.trophy.won .trophy-icon { background: linear-gradient(180deg, #f59e0b, #d97706); color: #fff; }
.pts-plus { color: var(--good); font-variant-numeric: tabular-nums; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick label { margin: 0; cursor: pointer; position: relative; }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick span { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; }
.icon-pick input:checked + span { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.rule-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.rule-row label { font-weight: normal; margin: 0; }
.level-edit { display: grid; grid-template-columns: 1fr 110px; gap: 8px; margin-bottom: 6px; }
.arcade-profile-body { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.arcade-profile-body .grow { flex: 1; min-width: 200px; }
.badge-strip { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) { .podium { grid-template-columns: repeat(3, 1fr); } .podium-block b { font-size: 17px; } }

/* Sidebar stays in place while the page scrolls: brand pinned at the top, menu scrolls on its own if taller than the screen. */
@media (min-width: 761px) {
    .sidebar { position: sticky; top: 0; height: 100vh; overflow: hidden; z-index: 25; }
    .sidebar .brand { flex: none; }
    .sidebar nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
    .sidebar nav::-webkit-scrollbar { width: 6px; }
    .sidebar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }
}

/* ---------- Report builder panel ---------- */
.report-layout { grid-template-columns: minmax(300px, 340px) minmax(0, 1fr); gap: 18px; }
.report-panel { padding: 6px 16px 16px; max-height: calc(100vh - 90px); overflow-y: auto; scrollbar-width: thin; }
.report-panel .form-control, .report-panel select, .report-panel input { width: 100%; min-width: 0; box-sizing: border-box; }
.report-panel .form-group { margin-bottom: 10px; min-width: 0; }
.report-panel label, .rb-label { font-size: 12.5px; font-weight: 600; color: var(--text); display: block; margin-bottom: 4px; }
.rb-section { padding: 12px 0 4px; border-bottom: 1px solid var(--border); }
.rb-section:last-of-type { border-bottom: none; }
.rb-title { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.rb-title > span:first-child { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); font-size: 11px; letter-spacing: 0; }
.rb-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 96px); gap: 8px; }
.rb-dates { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.report-panel .filter-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin-bottom: 10px; padding: 8px; border: 1px dashed var(--border); border-radius: 10px; }
.report-panel .filter-row[hidden] { display: none; }
.rb-add-filter { padding-left: 0; }
.chart-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.chart-pick label { margin: 0; cursor: pointer; position: relative; font-weight: normal; }
.chart-pick input { position: absolute; opacity: 0; pointer-events: none; }
.chart-pick span { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-muted); background: var(--card-bg); }
.chart-pick small { font-size: 11px; line-height: 1.1; text-align: center; }
.chart-pick label:hover span { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); color: var(--text); }
.chart-pick input:checked + span { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--card-bg)); font-weight: 600; }
.chart-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.rb-actions { position: sticky; bottom: -16px; margin: 6px -16px -16px; padding: 12px 16px 14px; background: var(--card-bg); border-top: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 0 0 var(--radius) var(--radius); }
@media (max-width: 1000px) { .report-layout { grid-template-columns: minmax(0, 1fr); } .report-panel { max-height: none; overflow: visible; } .rb-actions { position: static; } }
@media (max-width: 760px) { .toolbar-actions { flex-wrap: wrap; } .toolbar-actions > * { max-width: 100%; } }

/* ---------- Projects dashboard charts ---------- */
.pd-chart-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pd-chart-pair > .card { margin-bottom: 0; }
.pd-chart-pair + .card { margin-top: 16px; }
.pd-donut { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; }
.pd-donut .legend-list { font-size: 12.5px; }
.pd-donut-stack { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) { .pd-chart-pair { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .pd-donut { grid-template-columns: minmax(0, 1fr); } }
/* ---------- Releases ---------- */
.rel-progress { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--border); gap: 2px; margin: 10px 0 8px; }
.rel-progress.sm { height: 7px; margin: 10px 0 6px; }
.rel-progress span { display: block; min-width: 4px; }
.rp-done { background: #10b981; } .rp-review { background: #8b5cf6; } .rp-in_progress { background: var(--brand); }
.rp-blocked { background: #dc2626; } .rp-todo { background: #94a3b8; } .rp-empty { background: transparent; }
.rel-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px; }
.rel-legend b { color: var(--text); }
.rel-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.rel-gate { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 6px 0 12px; }
.rel-gate ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.rel-gate li span { display: inline-flex; width: 18px; height: 18px; border-radius: 50%; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; margin-right: 6px; color: #fff; }
.rel-gate li.ok span { background: #10b981; } .rel-gate li.bad span { background: #dc2626; } .rel-gate li.warn span { background: #f59e0b; }
.rel-notes { margin-top: 12px; } .rel-notes summary { cursor: pointer; margin-bottom: 8px; }
.rel-notes textarea { font-family: Consolas, monospace; font-size: 12.5px; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rel-card { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.rel-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.rel-card-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.rel-card-links { display: flex; gap: 14px; font-size: 12.5px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.rel-chip { display: inline-block; margin-left: 6px; font-size: 11px; padding: 1px 7px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--border));
    color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); white-space: nowrap; text-decoration: none; }
/* ---------- Scheduled jobs ---------- */
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.job-card { margin: 0; }
.job-card .kv dd { overflow-wrap: anywhere; }
.code-block { background: var(--bg, #f5f7fa); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: Consolas, monospace; font-size: 12.5px;
    white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 12px; }
/* ---------- Ticket time / withdraw / approvals ---------- */
.time-form { display: grid; gap: 6px; margin-bottom: 10px; }
.time-row { display: grid; grid-template-columns: 64px 64px minmax(0, 1fr); gap: 6px; }
.time-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.time-list li { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; border-top: 1px solid var(--border); padding-top: 6px; }
.withdraw { margin-top: 10px; } .withdraw summary { list-style: none; display: inline-flex; cursor: pointer; } .withdraw summary::-webkit-details-marker { display: none; }
.section-title { font-size: 15px; margin: 18px 0 10px; }
/* ---------- Arcade level badges (23 levels) ---------- */
.lvl-0 { --lv: #64748b; } .lvl-1 { --lv: #16a34a; } .lvl-2 { --lv: #15803d; } .lvl-3 { --lv: #0f766e; } .lvl-4 { --lv: #0891b2; } .lvl-5 { --lv: #2563eb; } .lvl-6 { --lv: #4338ca; } .lvl-7 { --lv: #6d28d9; } .lvl-8 { --lv: #7e22ce; } .lvl-9 { --lv: #a21caf; } .lvl-10 { --lv: #be185d; } .lvl-11 { --lv: #be123c; } .lvl-12 { --lv: #b91c1c; } .lvl-13 { --lv: #c2410c; } .lvl-14 { --lv: #b45309; } .lvl-15 { --lv: #a16207; } .lvl-16 { --lv: #0369a1; } .lvl-17 { --lv: #d97706; } .lvl-18 { --lv: #dc2626; } .lvl-19 { --lv: #4f46e5; } .lvl-20 { --lv: #475569; } .lvl-21 { --lv: #ca8a04; } .lvl-22 { --lv: #c026d3; } 
.level-badge { flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); vertical-align: middle; }
.level-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 3px; }
.arcade-level-name { display: flex; align-items: center; gap: 8px; }
.arcade-avatar-wrap { position: relative; display: inline-flex; flex: none; }
.avatar-level-badge { position: absolute; right: -6px; bottom: -6px; line-height: 0; }
.level-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 560px; overflow-y: auto; scrollbar-width: thin; }
.level-ladder li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.level-ladder li.current { background: color-mix(in srgb, var(--brand) 10%, transparent); outline: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.level-ladder li.locked .level-badge { filter: grayscale(1) opacity(.45); }
.level-ladder li.locked .ladder-text b { color: var(--text-muted); }
.ladder-text { display: flex; flex-direction: column; line-height: 1.25; flex: 1; }
.ladder-done { color: #16a34a; font-weight: 800; }

/* ---------- Dashboard: Arcade progress ---------- */
.arc-dash { margin-bottom: 16px; padding: 16px 18px; background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--lv, var(--brand)) 16%, transparent), transparent 55%), var(--card-bg); }
.arc-dash-me { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.arc-dash-badge { line-height: 0; transition: transform .15s; } .arc-dash-badge:hover { transform: scale(1.05); }
.arc-dash-level { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.arc-dash-name { font-size: 22px; line-height: 1.1; }
.arc-dash-level .arcade-progress { height: 10px; }
.arc-next { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--text); }
.arc-dash-stats { display: grid; grid-template-columns: repeat(3, minmax(84px, auto)); gap: 10px; }
.arc-dash-stats div { text-align: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--card-bg); }
.arc-dash-stats b { display: block; font-size: 20px; } .arc-dash-stats span { font-size: 11.5px; color: var(--text-muted); }
.arc-dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.arc-dash-sub { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.arc-dash-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.arc-more { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; }
.arc-dash-quests { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.arc-dash-quests li, .arc-team-row { display: flex; gap: 10px; align-items: center; }
.arc-q-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.arc-q-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.arc-q-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arcade-progress.sm { height: 6px; display: block; }
.arc-dash-team { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.arc-team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 20px; }
.arc-team-row.is-me b { color: var(--brand); }
@media (max-width: 900px) {
    .arc-dash-me { grid-template-columns: auto minmax(0, 1fr); }
    .arc-dash-stats { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .arc-dash-grid { grid-template-columns: minmax(0, 1fr); }
}
/* ---------- Arcade: side card + top-bar level pill ---------- */
.arc-side-me { display: flex; gap: 12px; align-items: center; }
.arc-side-name { font-size: 16px; }
.arc-side-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 12px 0 10px; }
.arc-side-stats div { text-align: center; padding: 6px 4px; border: 1px solid var(--border); border-radius: 10px; }
.arc-side-stats b { display: block; font-size: 16px; } .arc-side-stats span { font-size: 11px; color: var(--text-muted); }
.arc-side-badges { margin-bottom: 10px; gap: 6px; }
.arc-side-quests { margin-bottom: 4px; }
.arc-side-team { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.arc-side-team summary { cursor: pointer; margin-bottom: 8px; }
.arc-side-team .arc-team-row { margin-bottom: 8px; }
.arc-side { background: radial-gradient(130% 90% at 0% 0%, color-mix(in srgb, var(--lv, var(--brand)) 14%, transparent), transparent 60%), var(--card-bg); }
.lvl-pill { position: relative; }
.lvl-pill > summary { list-style: none; display: flex; align-items: center; gap: 7px; cursor: pointer; padding: 3px 10px 3px 4px; border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--lv) 40%, var(--border)); background: color-mix(in srgb, var(--lv) 10%, transparent); }
.lvl-pill > summary::-webkit-details-marker { display: none; }
.lvl-pill-text { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; line-height: 1; }
.lvl-pill-bar { display: block; width: 64px; height: 4px; border-radius: 99px; background: var(--border); overflow: hidden; }
.lvl-pill-bar span { display: block; height: 100%; background: var(--lv); }
.lvl-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 280px; padding: 14px; border-radius: 14px; border: 1px solid var(--border);
    background: var(--card-bg); box-shadow: 0 12px 32px rgba(0,0,0,.25); }
.lvl-pop-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.lvl-pop-links { display: flex; justify-content: space-between; font-size: 13px; padding-top: 8px; border-top: 1px solid var(--border); }
@media (max-width: 760px) { .lvl-pill-text { display: none; } .lvl-pill > summary { padding: 2px; } .lvl-pop { right: -60px; } }
/* ---------- Team Chat ---------- */
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #dc2626; color: #fff; font-size: 10.5px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.sidebar.no-labels .nav-badge { position: absolute; top: 4px; right: 6px; }
.sidebar nav a { position: relative; }
.chat-app { display: grid; grid-template-columns: 270px minmax(0, 1fr) 260px; gap: 0; height: calc(100vh - 120px); min-height: 480px;
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card-bg); }
.chat-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 8px; }
.chat-filter { margin: 0 12px 8px; width: auto; }
#chat-convs { overflow-y: auto; flex: 1; padding: 0 6px 10px; scrollbar-width: thin; }
.chat-sec { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); padding: 10px 8px 4px; }
.chat-conv { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.chat-conv:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.chat-conv.active { background: color-mix(in srgb, var(--brand) 16%, transparent); font-weight: 700; }
.chat-conv-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-ico { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--border); position: relative; }
.chat-conv-ico.ico-desk, .chat-conv-ico.ico-project { border-radius: 2px; background: color-mix(in srgb, var(--brand) 55%, transparent); }
.chat-conv-ico.ico-record { border-radius: 2px; transform: rotate(45deg); background: #8b5cf6; }
.chat-conv-ico.online { background: #16a34a; }
.chat-unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.chat-unread.is-mention { background: #dc2626; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 10px 14px; scrollbar-width: thin; }
.chat-more { display: block; margin: 0 auto 10px; }
.chat-day { text-align: center; font-size: 11.5px; color: var(--text-muted); margin: 12px 0 6px; position: relative; }
.chat-msg { display: flex; gap: 10px; padding: 4px 6px; border-radius: 8px; position: relative; margin-top: 8px; }
.chat-msg.is-cont { margin-top: 0; } .chat-msg.is-cont .chat-av, .chat-msg.is-cont .chat-meta { visibility: hidden; height: 0; }
.chat-msg.is-cont .chat-av { height: 0; }
.chat-msg:hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.chat-msg.flash { background: color-mix(in srgb, #f59e0b 20%, transparent); transition: background .3s; }
.chat-msg.is-pinned { border-left: 3px solid #f59e0b; }
.chat-msg.is-system { justify-content: center; font-size: 12px; color: var(--text-muted); }
.chat-sys { font-weight: 700; }
.chat-av { flex: none; }
.chat-body { flex: 1; min-width: 0; }
.chat-meta b { font-size: 13.5px; }
.chat-pin-flag { font-size: 11px; color: #d97706; font-weight: 700; }
.chat-text { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.chat-text code { background: color-mix(in srgb, var(--text) 8%, transparent); padding: 0 4px; border-radius: 4px; font-size: 12.5px; }
.chat-text .mention, .mention { color: var(--brand); font-weight: 700; background: color-mix(in srgb, var(--brand) 10%, transparent); border-radius: 4px; padding: 0 2px; }
.chat-quote { font-size: 12.5px; color: var(--text-muted); border-left: 3px solid var(--border); padding: 2px 8px; margin: 2px 0 4px; cursor: pointer; }
.chat-att { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chat-file, .chat-file-chip { font-size: 12.5px; border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.chat-reacts { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.chat-react { border: 1px solid var(--border); background: transparent; border-radius: 99px; padding: 1px 8px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.chat-react.mine { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.chat-tools { position: absolute; top: -12px; right: 8px; display: none; gap: 2px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 2px; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.chat-msg:hover .chat-tools, .chat-msg:focus-within .chat-tools { display: flex; }
.chat-tool { background: transparent; border: 0; cursor: pointer; padding: 3px 6px; border-radius: 6px; color: var(--text); font-size: 13px; }
.chat-tool:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.chat-picker { position: absolute; top: 18px; right: 8px; z-index: 5; display: flex; gap: 2px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.chat-picker button { background: transparent; border: 0; font-size: 18px; cursor: pointer; padding: 2px 5px; border-radius: 6px; }
.chat-picker button:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.chat-compose { border-top: 1px solid var(--border); padding: 8px 12px 6px; position: relative; }
.chat-compose-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea { resize: none; min-height: 40px; max-height: 180px; }
.chat-attach { cursor: pointer; padding: 8px; border-radius: 8px; color: var(--text-muted); } .chat-attach:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.chat-reply-bar { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-muted); padding: 2px 4px 6px; }
.chat-files { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 6px; }
.chat-hint { font-size: 11px; margin-top: 4px; }
.chat-mention-pop { position: absolute; bottom: calc(100% - 4px); left: 50px; z-index: 10; min-width: 220px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); padding: 4px; }
.chat-mention-opt { padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.chat-mention-opt.active, .chat-mention-opt:hover { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.chat-side { border-left: 1px solid var(--border); padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.chat-ref { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 10px; }
.chat-side-sec strong { display: block; margin-bottom: 6px; }
.chat-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.chat-people li { display: flex; align-items: center; gap: 6px; } .chat-people li a { margin-left: auto; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex: none; display: inline-block; }
.online > .dot, .dot.online { background: #16a34a; }
.chat-pins { display: grid; gap: 6px; }
.chat-pin { text-align: left; background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; cursor: pointer; color: var(--text); max-height: 70px; overflow: hidden; }
.chat-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 200; font-size: 13px; }
.chat-empty { margin: auto; }
.new-chat-people { max-height: 320px; overflow-y: auto; display: grid; gap: 2px; margin: 10px 0; }
.new-chat-person { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; }
.chat-side-toggle { display: none; }
@media (max-width: 1100px) {
    .chat-app { grid-template-columns: 230px minmax(0, 1fr); }
    .chat-side { display: none; }
    .chat-app.side-open .chat-side { display: flex; position: absolute; right: 16px; top: 140px; bottom: 16px; width: 280px; z-index: 20; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
    .chat-side-toggle { display: inline-flex; }
}
@media (max-width: 760px) {
    .chat-app { grid-template-columns: minmax(0, 1fr); height: auto; }
    .chat-list { border-right: 0; border-bottom: 1px solid var(--border); max-height: 220px; }
    .chat-main { height: 70vh; }
}.chat-discuss { display: inline-flex; align-items: center; gap: 5px; }
.chat-count { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.chat-actions { display: grid; gap: 6px; margin-bottom: 12px; }
.ask-help > summary { list-style: none; } .ask-help > summary::-webkit-details-marker { display: none; }
.help-people { max-height: 200px; overflow-y: auto; display: grid; gap: 2px; margin-bottom: 6px; }
.help-people .checkbox { display: flex; align-items: center; gap: 6px; }.chat-app [hidden], .chat-compose [hidden] { display: none !important; }
.nav-badge[hidden], .chat-count[hidden] { display: none !important; }
.chat-embed { grid-template-columns: minmax(0, 1fr) 240px; height: 68vh; min-height: 420px; }
@media (max-width: 1100px) { .chat-embed { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Comment edit / remove ---------- */
.comment-tools { display: flex; gap: 12px; align-items: flex-start; margin-top: 4px; font-size: 12.5px; }
.comment-edit > summary { list-style: none; cursor: pointer; } .comment-edit > summary::-webkit-details-marker { display: none; }
.comment-edit[open] { flex: 1; } .comment-edit form { margin-top: 6px; }
.comment-removed { font-style: italic; }
.chat-readonly { padding: 12px 14px; }
/* ---------- Import ---------- */
.import-card { max-width: 980px; }
.import-cols { overflow-x: auto; margin: 8px 0 10px; border: 1px solid var(--border); border-radius: 10px; }
.import-cols .data-table { margin: 0; } .import-cols td, .import-cols th { font-size: 12.5px; }
.import-form { display: grid; gap: 10px; max-width: 640px; }
.import-opts { display: grid; gap: 4px; }
.import-report ul { margin: 6px 0 0 18px; max-height: 260px; overflow-y: auto; }/* ---------- Import history ---------- */
.import-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.import-errors { margin: 6px 0 0 18px; }
.import-summary { display: grid; gap: 12px; margin-bottom: 16px; }
.import-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.import-facts div { display: flex; flex-direction: column; gap: 2px; }
.import-facts span { font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.import-facts b { font-size: 14px; overflow-wrap: anywhere; }
.import-undo { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.import-undo .btn { justify-self: start; }
.imp-state { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.imp-new { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.imp-upd { background: color-mix(in srgb, var(--warn) 18%, transparent); color: color-mix(in srgb, var(--warn) 70%, var(--text)); }
.imp-gone { background: color-mix(in srgb, var(--text-muted) 16%, transparent); color: var(--text-muted); }
/* ---------- Arcade: Levels tab ---------- */
.lvl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lvl-card { display: grid; gap: 8px; align-content: start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-bg); }
.lvl-card.lvl-locked { opacity: .72; }
.lvl-card.lvl-locked .lvl-card-head svg { filter: grayscale(.85); }
.lvl-card.lvl-current { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.lvl-card-head { display: flex; gap: 10px; align-items: center; }
.lvl-card-head div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lvl-card-state { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.lvl-reach { margin-left: auto; }
.lvl-people { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lvl-person { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700;
    background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.lvl-person.is-me { background: var(--brand); color: #fff; }
.th-sub { display: block; font-size: 10.5px; font-weight: 500; text-transform: none; letter-spacing: 0; opacity: .75; }
/* ---------- Arcade level badges: leagues, shine, orbit ---------- */
.level-badge { flex: none; overflow: visible; }
.level-badge .lb-shine { animation: lb-shine 5.5s ease-in-out infinite; }
.level-badge .lb-orbit { animation: lb-spin 18s linear infinite; }
.level-badge .lb-spark { animation: lb-twinkle 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes lb-shine { 0%, 60% { transform: translateX(0) skewX(-20deg); } 90%, 100% { transform: translateX(160px) skewX(-20deg); } }
@keyframes lb-spin { to { transform: rotate(360deg); } }
@keyframes lb-twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .level-badge .lb-shine, .level-badge .lb-orbit, .level-badge .lb-spark { animation: none; } }
/* ---------- Arcade: Levels hero, leagues ---------- */
.lvl-hero { display: flex; align-items: center; gap: 22px; padding: 20px 24px; margin-bottom: 14px; flex-wrap: wrap;
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, var(--card-bg)), var(--card-bg) 60%); }
.lvl-hero-badge { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lvl-hero-badge.is-next { opacity: .92; }
.lvl-hero-badge.is-next svg { filter: saturate(.55) drop-shadow(0 0 0 transparent); }
.lvl-hero-cap { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.lvl-hero-body { flex: 1; min-width: 220px; display: grid; gap: 6px; }
.lvl-hero-body h2 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.lvl-hero-body p { margin: 0; color: var(--text-muted); }
.lvl-hero-bar { height: 10px; }
.lvl-league-tag { justify-self: start; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--lg-soft); color: var(--lg-ink); }
.lvl-league-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 20px 0 10px; padding-left: 10px; border-left: 4px solid var(--lg-ink); }
.lvl-league-head h3 { margin: 0; font-size: 16px; color: var(--lg-ink); }
.lg-bronze { --lg-ink: #b45a24; --lg-soft: #fbe2cf; }
.lg-silver { --lg-ink: #5b6b80; --lg-soft: #e5eaf1; }
.lg-gold { --lg-ink: #b07800; --lg-soft: #fff1c2; }
.lg-platinum { --lg-ink: #4f46e5; --lg-soft: #e0e4ff; }
.lg-mythic { --lg-ink: #9333ea; --lg-soft: #f3e1ff; }
:root[data-theme="dark"] .lg-bronze { --lg-ink: #f4a26b; --lg-soft: rgba(244,162,107,.16); }
:root[data-theme="dark"] .lg-silver { --lg-ink: #c3cedb; --lg-soft: rgba(195,206,219,.14); }
:root[data-theme="dark"] .lg-gold { --lg-ink: #ffd35a; --lg-soft: rgba(255,211,90,.15); }
:root[data-theme="dark"] .lg-platinum { --lg-ink: #a5b0ff; --lg-soft: rgba(165,176,255,.16); }
:root[data-theme="dark"] .lg-mythic { --lg-ink: #d8a8ff; --lg-soft: rgba(216,168,255,.16); }
.lvl-card.lvl-locked .lvl-card-head svg { filter: grayscale(.7); }
/* ---------- Arcade: level-up celebration ---------- */
.modal.lvl-up { max-width: 420px; overflow: hidden; text-align: center; }
.lvl-up-body { position: relative; display: grid; justify-items: center; gap: 8px; padding: 26px 24px 22px; }
.lvl-up-body h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.01em; }
.lvl-up-body p { margin: 0; }
.lvl-up-badge { animation: lvl-pop .7s cubic-bezier(.2, 1.4, .4, 1) both; margin: 4px 0; }
.lvl-up-actions { display: flex; gap: 8px; margin-top: 10px; }
.lvl-up-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lvl-up-confetti i { position: absolute; top: -12px; left: var(--x); width: 7px; height: 12px; border-radius: 2px; background: var(--c);
    animation: lvl-fall 2.4s ease-in var(--d) 2 both; }
@keyframes lvl-pop { from { transform: scale(.3) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lvl-fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(460px) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lvl-up-badge, .lvl-up-confetti i { animation: none; } .lvl-up-confetti { display: none; } }
/* ---------- Arcade: service desk switcher ---------- */
.desk-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 4px; }
.desk-switch > .text-muted-sm { margin-right: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.desk-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--card-bg); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; }
.desk-switch a:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.desk-switch a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.desk-count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, currentColor 14%, transparent); }
.desk-you { font-size: 10.5px; font-weight: 600; opacity: .8; }
/* ---------- Users: several service desks with a primary ---------- */
.form-group.span-all { grid-column: 1 / -1; }
.desk-picker { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px 10px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.desk-picker legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.desk-pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 8px; }
.desk-pick.on { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.desk-pick .checkbox { margin: 0; }
.desk-primary { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.desk-primary input:checked + span { color: var(--warn); font-weight: 700; }
/* ---------- Team Chat: members panel ---------- */
.chat-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.chat-rename { display: flex; gap: 6px; margin: 0 0 8px; }
.chat-rename .form-control { padding: 5px 8px; font-size: 13px; }
.chat-members .chat-member { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chat-member-name { font-weight: 600; }
.chat-role { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.chat-role-owner { background: color-mix(in srgb, var(--warn) 20%, transparent); color: color-mix(in srgb, var(--warn) 65%, var(--text)); }
.chat-role-helper { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.chat-member-tools { display: none; gap: 8px; margin-left: auto; font-size: 12px; }
.chat-member:hover .chat-member-tools, .chat-member:focus-within .chat-member-tools { display: inline-flex; }
@media (hover: none) { .chat-member-tools { display: inline-flex; } }
.link-button.danger { color: var(--bad); }
/* ---------- Team Chat: WhatsApp-style bubbles ---------- */
.chat-app { --bub-me: #d9fdd3; --bub-me-ink: #111b21; --bub-them: #ffffff; --bub-them-ink: #111b21; --bub-meta: #667781;
    --chat-wall: #efeae2; --chat-dot: rgba(17, 27, 33, .045); }
:root[data-theme="dark"] .chat-app { --bub-me: #005c4b; --bub-me-ink: #e9edef; --bub-them: #202c33; --bub-them-ink: #e9edef; --bub-meta: #8696a0;
    --chat-wall: #0b141a; --chat-dot: rgba(255, 255, 255, .03); }
.chat-scroll { background-color: var(--chat-wall); background-image: radial-gradient(var(--chat-dot) 1.2px, transparent 1.3px); background-size: 18px 18px; padding: 12px 6% 16px; }
.chat-day::before, .chat-day::after { content: none; }
.chat-day { display: block; margin: 14px auto 8px; width: fit-content; margin-left: auto; margin-right: auto; padding: 4px 12px; border-radius: 8px; background: var(--bub-them); color: var(--bub-meta);
    box-shadow: 0 1px .5px rgba(11, 20, 26, .13); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: 11.5px; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; padding: 0; margin-top: 10px; background: none !important; border: 0 !important; }
.chat-msg.is-cont { margin-top: 2px; }
.chat-msg.is-mine { justify-content: flex-end; }
.chat-msg .chat-av { width: 30px; height: 30px; font-size: 11px; margin-bottom: 2px; }
.chat-msg.is-cont .chat-av { visibility: hidden; height: 30px; }
.chat-body { flex: 0 1 auto; max-width: min(72%, 620px); min-width: 0; position: relative; }
.chat-bubble { position: relative; padding: 6px 9px 7px; border-radius: 10px; background: var(--bub-them); color: var(--bub-them-ink);
    box-shadow: 0 1px .5px rgba(11, 20, 26, .13); overflow-wrap: anywhere; }
.chat-msg.is-mine .chat-bubble { background: var(--bub-me); color: var(--bub-me-ink); }
/* tail on the first bubble of a run */
.chat-msg:not(.is-cont).is-theirs .chat-bubble { border-top-left-radius: 0; }
.chat-msg:not(.is-cont).is-mine .chat-bubble { border-top-right-radius: 0; }
.chat-msg:not(.is-cont).is-theirs .chat-bubble::before, .chat-msg:not(.is-cont).is-mine .chat-bubble::before {
    content: ''; position: absolute; top: 0; width: 9px; height: 13px; background: inherit; }
.chat-msg:not(.is-cont).is-theirs .chat-bubble::before { left: -8px; clip-path: polygon(100% 0, 0 0, 100% 100%); }
.chat-msg:not(.is-cont).is-mine .chat-bubble::before { right: -8px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.chat-author { font-size: 12.5px; font-weight: 700; margin-bottom: 2px; color: hsl(var(--h, 210) 55% 42%); }
:root[data-theme="dark"] .chat-author { color: hsl(var(--h, 210) 70% 68%); }
.chat-msg.is-cont .chat-author { display: none; }
.chat-text { font-size: 14.2px; line-height: 1.4; color: inherit; display: inline; }
.chat-text p { margin: 0; }
.chat-stamp { float: right; margin: 6px 0 -4px 12px; font-size: 11px; line-height: 1; color: var(--bub-meta); white-space: nowrap; position: relative; top: 4px; }
.chat-removed { color: var(--bub-meta); font-style: italic; }
.chat-bubble .chat-quote { display: flex; flex-direction: column; gap: 1px; margin: 0 0 5px; padding: 5px 8px; border-left: 4px solid #06cf9c; border-radius: 6px;
    background: rgba(11, 20, 26, .05); color: var(--bub-meta); font-size: 12.5px; cursor: pointer; }
.chat-bubble .chat-quote b { color: #06a37a; font-size: 12px; }
:root[data-theme="dark"] .chat-bubble .chat-quote { background: rgba(255, 255, 255, .06); }
.chat-bubble .chat-att { margin-top: 6px; }
.chat-bubble .chat-file { background: rgba(11, 20, 26, .05); border-color: transparent; color: inherit; }
.chat-reacts { margin: -6px 8px 0; position: relative; z-index: 1; }
.chat-msg.is-mine .chat-reacts { justify-content: flex-end; }
.chat-react { background: var(--bub-them); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(11, 20, 26, .15); padding: 1px 7px; }
.chat-msg.is-pinned .chat-bubble { box-shadow: 0 0 0 2px #f59e0b, 0 1px .5px rgba(11, 20, 26, .13); }
.chat-msg.flash .chat-bubble { box-shadow: 0 0 0 3px color-mix(in srgb, #f59e0b 60%, transparent); }
/* hover tools beside the bubble */
.chat-tools { top: -14px; right: auto; left: calc(100% - 40px); }
.chat-msg.is-mine .chat-tools { left: auto; right: calc(100% - 40px); }
.chat-msg.is-system { justify-content: center; margin: 10px 0; }
.chat-sys-pill { display: inline-block; max-width: 80%; text-align: center; padding: 5px 12px; border-radius: 8px; font-size: 12.5px;
    background: color-mix(in srgb, #ffeecd 85%, var(--bub-them)); color: #54656f; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
:root[data-theme="dark"] .chat-sys-pill { background: #182229; color: #8696a0; }
@media (max-width: 640px) { .chat-scroll { padding: 10px 8px 14px; } .chat-body { max-width: 86%; } }
.chat-bubble::after { content: ''; display: block; clear: both; }
.chat-stamp { top: 0; margin: 4px 0 -2px 12px; }
/* ---------- Team Chat: attachments (WhatsApp-style) ---------- */
.chat-attach-wrap { position: relative; display: flex; align-items: flex-end; }
.chat-attach { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform .15s, background .15s; }
.chat-attach:hover, .chat-attach[aria-expanded="true"] { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.chat-attach[aria-expanded="true"] svg { transform: rotate(45deg); transition: transform .15s; }
.chat-attach-menu { position: absolute; bottom: 48px; left: 0; z-index: 20; min-width: 210px; padding: 6px; border-radius: 14px; background: var(--card-bg); border: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22); display: grid; gap: 2px; animation: am-in .14s ease-out; }
.chat-attach-menu[hidden] { display: none !important; }
@keyframes am-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.chat-attach-menu button { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
.chat-attach-menu button:hover, .chat-attach-menu button:focus-visible { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.am-ico { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.am-doc { background: #7f66ff; } .am-media { background: #007bfc; } .am-cam { background: #ff2e74; } .am-voice { background: #ff7f00; } .am-contact { background: #009de2; } .am-poll { background: #ffb938; }
/* drop overlay */
.chat-main { position: relative; }
.chat-main.is-dropping::after { content: 'Drop files to send'; position: absolute; inset: 8px; z-index: 30; display: flex; align-items: center; justify-content: center;
    border: 3px dashed var(--brand); border-radius: 14px; background: color-mix(in srgb, var(--card-bg) 85%, transparent); color: var(--brand); font-size: 18px; font-weight: 700; pointer-events: none; }
/* pending files */
.chat-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 2px; }
.chat-file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 4px 8px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 8%, var(--card-bg)); border: 1px solid var(--border); font-size: 12.5px; }
.chat-file-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.chat-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* recording bar */
.chat-rec { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.chat-rec[hidden] { display: none; }
.chat-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: rec-blink 1s infinite; }
@keyframes rec-blink { 50% { opacity: .25; } }
/* media in bubbles */
.chat-media { display: grid; gap: 3px; margin: -2px -5px 4px; border-radius: 8px; overflow: hidden; width: min(330px, 62vw); }
.chat-media.n2, .chat-media.n4 { grid-template-columns: 1fr 1fr; }
.chat-media.n3 { grid-template-columns: 1fr 1fr; } .chat-media.n3 .chat-media-cell:first-child { grid-column: 1 / -1; }
.chat-media-cell { position: relative; display: block; background: rgba(0, 0, 0, .08); }
.chat-media-cell img, .chat-media-cell video { display: block; width: 100%; height: 100%; max-height: 330px; object-fit: cover; }
.chat-media.n1 .chat-media-cell img { object-fit: contain; max-height: 380px; background: rgba(0, 0, 0, .04); }
.chat-media:not(.n1) .chat-media-cell { aspect-ratio: 1; }
.chat-media-more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .45); color: #fff; font-size: 24px; font-weight: 700; }
.chat-voice { display: flex; align-items: center; gap: 8px; min-width: 250px; margin-bottom: 2px; }
.chat-voice-ico { width: 34px; height: 34px; border-radius: 50%; background: #00a884; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.chat-voice audio { width: 100%; min-width: 200px; height: 36px; }
.chat-doc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px -3px 4px; border-radius: 8px; background: rgba(11, 20, 26, .06); color: inherit; text-decoration: none; min-width: 230px; }
:root[data-theme="dark"] .chat-doc { background: rgba(255, 255, 255, .06); }
.chat-doc:hover { background: rgba(11, 20, 26, .1); }
.chat-doc-ext { flex: none; width: 38px; height: 44px; border-radius: 6px; background: #e74c3c; color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.chat-doc-text { display: grid; min-width: 0; } .chat-doc-text b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .chat-doc-text span { font-size: 11.5px; color: var(--bub-meta); }
/* contact card */
.chat-contact { display: flex; align-items: center; gap: 10px; padding: 4px 2px 8px; min-width: 230px; }
.chat-contact-av { width: 44px; height: 44px; font-size: 15px; }
.chat-contact div { display: grid; font-size: 12.5px; color: var(--bub-meta); } .chat-contact b { font-size: 14.5px; color: inherit; }
.chat-msg .chat-contact b { color: var(--bub-them-ink); } .chat-msg.is-mine .chat-contact b { color: var(--bub-me-ink); }
.chat-contact-actions { display: flex; border-top: 1px solid rgba(11, 20, 26, .1); margin: 0 -9px; }
.chat-contact-actions a { flex: 1; text-align: center; padding: 8px 4px 2px; font-size: 13.5px; font-weight: 600; color: #008069; text-decoration: none; }
:root[data-theme="dark"] .chat-contact-actions a { color: #53bdeb; }
/* poll */
.chat-poll { min-width: 260px; display: grid; gap: 6px; padding: 2px 0 4px; }
.chat-poll-q { font-weight: 700; font-size: 15px; }
.chat-poll-hint { font-size: 11.5px; color: var(--bub-meta); }
.chat-poll-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.chat-poll-check { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--bub-meta); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; }
.chat-poll-check.multi { border-radius: 5px; }
.chat-poll-opt.mine .chat-poll-check { background: #00a884; border-color: #00a884; }
.chat-poll-main { flex: 1; display: grid; gap: 4px; }
.chat-poll-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.chat-poll-row b { font-size: 12.5px; color: var(--bub-meta); }
.chat-poll-bar { height: 6px; border-radius: 99px; background: rgba(11, 20, 26, .1); overflow: hidden; }
:root[data-theme="dark"] .chat-poll-bar { background: rgba(255, 255, 255, .12); }
.chat-poll-bar span { display: block; height: 100%; background: #00a884; border-radius: 99px; transition: width .3s; }
.poll-options-edit { display: grid; gap: 6px; }
.poll-opt-row { display: flex; gap: 6px; align-items: center; }
.chat-compose { position: relative; z-index: 25; }
/* ---------- Team Chat: hover actions beside the bubble ---------- */
.chat-body { position: relative; }
.chat-tools { position: absolute; top: 50%; right: auto; left: calc(100% + 6px); transform: translateY(-50%); display: flex; gap: 0; padding: 3px;
    border-radius: 999px; background: var(--card-bg); border: 1px solid var(--border); box-shadow: 0 4px 14px rgba(11, 20, 26, .16);
    opacity: 0; pointer-events: none; transition: opacity .12s ease; z-index: 6; }
.chat-msg.is-mine .chat-tools { left: auto; right: calc(100% + 6px); }
/* invisible bridge so the pointer can travel from the bubble to the bar */
.chat-tools::before { content: ''; position: absolute; top: -8px; bottom: -8px; width: 10px; }
.chat-msg.is-theirs .chat-tools::before { left: -10px; } .chat-msg.is-mine .chat-tools::before { right: -10px; }
.chat-msg:hover .chat-tools, .chat-msg:focus-within .chat-tools, .chat-tools:has(.chat-picker) { display: flex; opacity: 1; pointer-events: auto; }
.chat-tool { width: 30px; height: 30px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0; }
.chat-tool:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.chat-tool.is-on { color: #d97706; }
.chat-tool.is-danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.chat-tools .chat-picker { position: absolute; top: auto; bottom: calc(100% + 6px); right: auto; left: 0; padding: 4px 6px; border-radius: 999px; gap: 2px; animation: am-in .12s ease-out; }
.chat-msg.is-mine .chat-tools .chat-picker { left: auto; right: 0; }
.chat-tools .chat-picker button { font-size: 20px; padding: 3px 5px; transition: transform .1s; }
.chat-tools .chat-picker button:hover { transform: scale(1.25); background: transparent; }
/* narrow windows: the bar sits just above the bubble; touch screens: it shows when the message is tapped */
.chat-scroll { overflow-x: hidden; }
@media (max-width: 900px) {
    .chat-tools { top: -34px; transform: none; left: 0; }
    .chat-msg.is-mine .chat-tools { left: auto; right: 0; }
    .chat-tools::before { top: auto; bottom: -10px; left: 0 !important; right: 0 !important; width: auto; height: 12px; }
}
@media (hover: none) {
    .chat-msg:hover .chat-tools { opacity: 0; pointer-events: none; }
    .chat-msg.tapped .chat-tools { opacity: 1; pointer-events: auto; }
}
/* reaction picker opens over the bubble side, so it never runs off the chat edge */
.chat-msg.is-theirs .chat-tools .chat-picker { left: auto; right: 0; }
.chat-msg.is-mine .chat-tools .chat-picker { right: auto; left: 0; }
/* ---------- Team Chat: reactions (WhatsApp-style pill) ---------- */
.chat-msg.has-reacts { margin-bottom: 14px; }
.chat-reacts { position: absolute; bottom: -15px; display: inline-flex; align-items: center; gap: 1px; margin: 0; padding: 1px 5px 1px 3px; z-index: 2;
    border-radius: 999px; background: var(--bub-them); border: 2px solid var(--chat-wall); box-shadow: 0 1px 2px rgba(11, 20, 26, .18); }
.chat-msg.is-theirs .chat-reacts { left: 8px; }
.chat-msg.is-mine .chat-reacts { right: 8px; left: auto; justify-content: flex-end; }
.chat-react { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0 !important; border-radius: 50%;
    background: transparent !important; box-shadow: none !important; font-size: 14px; line-height: 1; cursor: pointer; transition: transform .1s; }
.chat-react:hover { transform: scale(1.2); }
.chat-react.mine { background: color-mix(in srgb, #00a884 22%, transparent) !important; }
.chat-react-count { font-size: 12px; font-weight: 600; color: var(--bub-meta); padding: 0 1px 0 3px; }
/* reactions sit at the bubble's bottom-left, clear of the time in the right corner */
.chat-reacts { bottom: -19px; }
.chat-msg.is-theirs .chat-reacts, .chat-msg.is-mine .chat-reacts { left: 10px; right: auto; justify-content: flex-start; }
.chat-msg.has-reacts { margin-bottom: 18px; }
.chat-msg.has-reacts .chat-bubble { min-width: 92px; }
/* ---------- Team Chat: reaction details panel (WhatsApp-style) ---------- */
.chat-reacts { padding: 0; }
.chat-reacts-btn { display: inline-flex; align-items: center; gap: 1px; padding: 1px 6px 1px 3px; border: 0; border-radius: 999px; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.chat-reacts-btn:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.chat-reacts-btn .chat-react { width: 20px; height: 22px; cursor: pointer; }
.chat-rx { position: fixed; z-index: 1000; width: 320px; max-width: calc(100vw - 16px); border-radius: 14px; background: var(--card-bg); color: var(--text);
    border: 1px solid var(--border); box-shadow: 0 14px 38px rgba(0, 0, 0, .3); overflow: hidden; animation: am-in .14s ease-out; }
:root[data-theme="dark"] .chat-rx { background: #1d1f1f; border-color: #2c2f30; color: #e9edef; }
.chat-rx-head { padding: 14px 16px 8px; font-size: 14px; font-weight: 700; color: var(--text-muted); }
.chat-rx-tabs { display: flex; align-items: center; gap: 8px; padding: 0 12px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
:root[data-theme="dark"] .chat-rx-tabs { border-color: #2c2f30; }
.chat-rx-add { flex: none; position: relative; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text-muted);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.chat-rx-add span { position: absolute; top: 4px; right: 5px; font-size: 11px; font-weight: 800; line-height: 1; }
.chat-rx-add:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.chat-rx-tab { flex: none; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--text); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.chat-rx-tab:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.chat-rx-tab.on { background: color-mix(in srgb, #00a884 22%, transparent); border-color: color-mix(in srgb, #00a884 45%, transparent); }
.chat-rx-pick { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.chat-rx-pick button { border: 0; background: transparent; font-size: 22px; padding: 3px 5px; border-radius: 8px; cursor: pointer; transition: transform .1s; }
.chat-rx-pick button:hover { transform: scale(1.2); }
.chat-rx-list { max-height: 280px; overflow-y: auto; padding: 6px 0; }
.chat-rx-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: 0; background: transparent; color: inherit; text-align: left; font: inherit; }
button.chat-rx-row { cursor: pointer; } button.chat-rx-row:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.chat-rx-av { width: 40px; height: 40px; flex: none; font-size: 14px; }
.chat-rx-who { flex: 1; display: grid; min-width: 0; }
.chat-rx-who b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-rx-who span { font-size: 12.5px; color: var(--text-muted); }
.chat-rx-emoji { font-size: 22px; flex: none; }
/* =====================================================================
 * Team Chat: Microsoft Teams style (overrides the earlier bubble theme)
 * ===================================================================== */
.chat-app { --teams: #5b5fc7; --teams-soft: #e8ebfa; --bub-me: #e8ebfa; --bub-me-ink: #242424; --bub-them: #ffffff; --bub-them-ink: #242424;
    --bub-meta: #616161; --chat-wall: #f5f5f5; --chat-dot: transparent; }
:root[data-theme="dark"] .chat-app { --teams: #7f85f5; --teams-soft: #2f2f4a; --bub-me: #2f2f4a; --bub-me-ink: #ffffff; --bub-them: #292929; --bub-them-ink: #e8e8e8;
    --bub-meta: #adadad; --chat-wall: #1f1f1f; }
.chat-scroll { background: var(--chat-wall); background-image: none; padding: 14px 28px 18px; }
/* day divider: a line with the date in the middle */
.chat-day { display: flex !important; align-items: center; gap: 12px; width: auto; margin: 20px 0 10px; padding: 0; background: none; box-shadow: none; border-radius: 0;
    color: var(--bub-meta); font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.chat-day::before, .chat-day::after { content: '' !important; flex: 1; height: 1px; background: color-mix(in srgb, var(--bub-meta) 30%, transparent); }
/* rows */
.chat-msg { align-items: flex-start; gap: 10px; margin-top: 16px; }
.chat-msg.is-cont { margin-top: 3px; }
.chat-msg .chat-av { width: 32px; height: 32px; margin: 2px 0 0; font-size: 12px; border-radius: 50%; }
.chat-msg.is-cont .chat-av { visibility: hidden; height: 0; }
.chat-body { max-width: min(76%, 720px); }
/* card */
.chat-bubble { padding: 8px 14px 10px; border-radius: 6px !important; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
:root[data-theme="dark"] .chat-bubble { box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.chat-msg:not(.is-cont).is-theirs .chat-bubble::before, .chat-msg:not(.is-cont).is-mine .chat-bubble::before { content: none; }
.chat-bubble-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 3px; font-size: 12px; color: var(--bub-meta); }
.chat-msg.is-mine .chat-bubble-head { justify-content: flex-end; }
.chat-bubble-head .chat-author { font-size: 12.5px; font-weight: 600; color: var(--bub-them-ink); margin: 0; }
:root[data-theme="dark"] .chat-bubble-head .chat-author { color: var(--bub-them-ink); }
.chat-edited { font-style: italic; }
.chat-pinned-flag { color: #c47900; font-weight: 600; }
.chat-msg.is-cont .chat-bubble-head { display: none; }
.chat-msg.is-cont.is-pinned .chat-bubble-head, .chat-msg.is-cont .chat-bubble-head:has(.chat-edited) { display: flex; }
.chat-text { display: block; font-size: 14px; line-height: 1.45; }
.chat-text .mention, .chat-bubble .mention { color: var(--teams); background: color-mix(in srgb, var(--teams) 12%, transparent); font-weight: 600; }
.chat-msg.is-pinned .chat-bubble { box-shadow: inset 3px 0 0 #c47900, 0 1px 2px rgba(0, 0, 0, .08); }
.chat-msg.flash .chat-bubble { box-shadow: 0 0 0 2px var(--teams); }
/* quoted reply */
.chat-bubble .chat-quote { border-left: 3px solid var(--teams); border-radius: 4px; background: color-mix(in srgb, var(--bub-meta) 10%, transparent); color: var(--bub-meta); }
.chat-bubble .chat-quote b { color: var(--bub-them-ink); }
/* hover toolbar: top-right over the message, quick reactions + actions */
.chat-tools, .chat-msg.is-mine .chat-tools { top: -18px; bottom: auto; left: auto; right: 10px; transform: none; padding: 2px; border-radius: 6px; gap: 0;
    background: var(--card-bg); border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0, 0, 0, .14); }
.chat-tools::before { content: none !important; }
.chat-tool { width: 30px; height: 30px; border-radius: 4px; }
.chat-tool.chat-quick { font-size: 17px; line-height: 1; color: inherit; }
.chat-tool.chat-quick:hover { background: color-mix(in srgb, var(--teams) 12%, transparent); transform: scale(1.15); }
.chat-tool:hover { background: color-mix(in srgb, var(--teams) 12%, transparent); color: var(--teams); }
.chat-tool-sep { width: 1px; align-self: stretch; margin: 5px 3px; background: var(--border); }
.chat-tools .chat-picker, .chat-msg.is-mine .chat-tools .chat-picker, .chat-msg.is-theirs .chat-tools .chat-picker { left: auto; right: 0; bottom: calc(100% + 4px); border-radius: 8px; }
@media (max-width: 900px) { .chat-tools, .chat-msg.is-mine .chat-tools { top: -18px; left: auto; right: 6px; } }
/* reactions: bordered pills under the card */
.chat-msg.has-reacts { margin-bottom: 0; }
.chat-reacts { position: static; display: flex; margin: 4px 0 0; padding: 0; border: 0; background: none; box-shadow: none; }
.chat-msg.is-mine .chat-reacts { justify-content: flex-end; }
.chat-reacts-btn { gap: 4px; padding: 1px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--card-bg); }
.chat-reacts-btn:hover { border-color: var(--teams); background: var(--card-bg); }
.chat-reacts-btn:has(.chat-react.mine) { border-color: var(--teams); background: color-mix(in srgb, var(--teams) 10%, var(--card-bg)); }
.chat-reacts-btn .chat-react { width: auto; height: 22px; font-size: 14px; }
.chat-react.mine { background: transparent !important; }
.chat-react-count { color: var(--bub-them-ink); font-weight: 600; }
/* system notices: plain muted text */
.chat-msg.is-system { margin: 12px 0; }
.chat-sys-pill, :root[data-theme="dark"] .chat-sys-pill { background: none; box-shadow: none; padding: 0; color: var(--bub-meta); font-size: 12px; font-style: italic; }
/* media, polls, cards in Teams purple */
.chat-voice-ico, .chat-poll-opt.mine .chat-poll-check, .chat-poll-bar span { background: var(--teams); border-color: var(--teams); }
.chat-contact-actions a, :root[data-theme="dark"] .chat-contact-actions a { color: var(--teams); }
.chat-rx-tab.on { background: color-mix(in srgb, var(--teams) 16%, transparent); border-color: color-mix(in srgb, var(--teams) 45%, transparent); }
.chat-doc-ext { background: var(--teams); }
/* compose: Teams box with an accent line on focus and a purple send */
.chat-compose { background: var(--card-bg); }
.chat-compose #chat-input { border-radius: 6px; border-bottom: 2px solid transparent; }
.chat-compose #chat-input:focus { border-bottom-color: var(--teams); box-shadow: none; }
.chat-compose #chat-send { background: var(--teams); border-color: var(--teams); }
.chat-compose #chat-send:hover { filter: brightness(1.08); }
.chat-attach:hover, .chat-attach[aria-expanded="true"] { background: color-mix(in srgb, var(--teams) 12%, transparent); color: var(--teams); }
.chat-msg.is-theirs .chat-tools { left: 8px; right: auto; }
.chat-msg.is-theirs .chat-tools .chat-picker { left: 0; right: auto; }
@media (max-width: 900px) { .chat-msg.is-theirs .chat-tools { left: 4px; right: auto; } }
/* read receipts (Teams): Sending / Sent / Delivered / Seen, next to the time on your own messages */
.chat-receipt { display: inline-flex; align-items: center; gap: 3px; color: var(--bub-meta); line-height: 1; cursor: default; }
.chat-receipt svg { width: 14px; height: 14px; flex: none; }
.chat-receipt.is-delivered { color: color-mix(in srgb, var(--bub-meta) 80%, transparent); }
.chat-receipt.is-seen { color: var(--teams); }
.chat-receipt-label { font-size: 11.5px; font-weight: 600; }
.chat-msg.is-sending { opacity: .7; }
.chat-msg.is-sending .chat-receipt svg { animation: chat-spin 2s linear infinite; }
@keyframes chat-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .chat-msg.is-sending .chat-receipt svg { animation: none; } }
.chat-msg.is-cont.rc-last .chat-bubble-head { display: flex; }
/* "showing the records behind a dashboard figure" note on lists */
.alert-info { background: color-mix(in srgb, var(--brand) 8%, var(--card-bg)); color: var(--text); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }
/* .row-actions on a table cell must stay a table cell (flex on a <td> pulls it out of the row, so its
   borders and height no longer line up - seen on project tasks, module lists, automation, custom fields, report library) */
td.row-actions { display: table-cell; text-align: right; vertical-align: middle; white-space: nowrap; }
td.row-actions > * { display: inline-flex; vertical-align: middle; }
td.row-actions > * + * { margin-left: 8px; }
td.row-actions form { display: inline-flex; margin: 0; }
@media (max-width: 760px) { td.row-actions { text-align: left; } }
/* Projects page: summary cards are filters */
.proj-cards a.stat-tile-link.is-active { outline: 2px solid var(--brand); outline-offset: -2px; }
.proj-cards .stat-sub { margin-top: 4px; }
/* project page: sub-projects card */
.subprojects .rollup-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 6px 0 12px; }
.subprojects .rollup-bar { flex: 1 1 160px; max-width: 260px; }
/* projects list: sub-project tree */
.proj-tree-toggle { border: 0; background: none; color: var(--text-muted); cursor: pointer; padding: 0 4px; font-size: 12px; }
tr.proj-child td:first-child + td, tr.proj-child > td.proj-name { }
.proj-parent-hint { font-size: 12px; color: var(--text-muted); }
/* Chat: Discuss a topic */
.chat-list-actions { display: inline-flex; gap: 6px; }
.discuss-results { max-height: 50vh; overflow: auto; margin-top: 10px; }
.discuss-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 10px 0 4px; }
.discuss-item { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; padding: 7px 10px; border-radius: 6px; color: inherit; text-decoration: none; }
.discuss-item:hover, .discuss-item:focus { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.discuss-key { font-weight: 600; font-size: 12px; color: var(--brand); grid-row: span 2; align-self: center; min-width: 78px; }
.discuss-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Arcade: Celestial / Cosmic / Supreme leagues */
.level-badge .lb-orbit2 { animation: lb-spin 26s linear infinite reverse; }
@media (prefers-reduced-motion: reduce) { .level-badge .lb-orbit2 { animation: none; } }
.lg-celestial { --lg-ink: #0284c7; --lg-soft: #e0f2fe; }
.lg-cosmic { --lg-ink: #6d28d9; --lg-soft: #ede9fe; }
.lg-supreme { --lg-ink: #c2410c; --lg-soft: #ffedd5; }
:root[data-theme="dark"] .lg-celestial { --lg-ink: #7dd3fc; --lg-soft: rgba(125,211,252,.15); }
:root[data-theme="dark"] .lg-cosmic { --lg-ink: #c4b5fd; --lg-soft: rgba(196,181,253,.16); }
:root[data-theme="dark"] .lg-supreme { --lg-ink: #fdba74; --lg-soft: rgba(253,186,116,.16); }
.lvl-card-info { margin: 6px 0 0; font-size: 12.5px; line-height: 1.4; }
.lvl-card-why { margin: 3px 0 0; font-size: 12px; color: var(--text-muted); font-style: italic; }
.desk-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 10px 0 18px; }
.desk-level { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.desk-level b { display: block; }
/* Settings: section headings on schema tabs; approval banner */
.settings-section { font-size: 14px; margin: 18px 0 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.settings-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
.approval-banner { margin-bottom: 12px; }

/* ---------- Avatars (Profile > Avatar) ---------- */
.av-photo { padding: 0; overflow: hidden; background: color-mix(in srgb, var(--text-muted) 18%, transparent) !important; }
.av-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.av-emoji, .av-color { background: linear-gradient(135deg, var(--av1, var(--brand)), var(--av2, var(--av1, var(--brand)))) !important; color: #fff !important; }
.av-emoji { font-size: 1.35em; line-height: 1; font-weight: 400; }
.arcade-avatar.av-emoji { font-size: 34px; }
.avatar.avatar-xl { width: 88px; height: 88px; font-size: 30px; box-shadow: 0 6px 18px rgba(15, 23, 42, .18); }
.avatar.avatar-xl.av-emoji { font-size: 48px; }
.avatar.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-card-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.avatar-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: color-mix(in srgb, var(--text-muted) 10%, transparent); margin-bottom: 14px; }
.avatar-tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 7px; font: inherit; font-weight: 600; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.avatar-tabs button.is-active { background: var(--card-bg); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.avatar-pane { display: grid; gap: 14px; justify-items: start; }
.avatar-pane[hidden] { display: none; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; width: 100%; max-width: 560px; }
.avatar-opt input, .avatar-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-opt { position: relative; cursor: pointer; display: grid; place-items: center; padding: 3px; border-radius: 50%; }
.avatar-opt .avatar { width: 46px; height: 46px; font-size: 24px; transition: transform .12s; }
.avatar-opt:hover .avatar { transform: scale(1.08); }
.avatar-opt input:checked + .avatar { box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 5px var(--brand); }
.avatar-opt input:focus-visible + .avatar, .avatar-swatch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 3px; }
.avatar-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.avatar-swatch { position: relative; cursor: pointer; }
.avatar-swatch span { display: block; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.avatar-swatch input:checked + span { box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--text); }
.avatar-preview-row { display: flex; gap: 12px; align-items: center; }
.avatar-cropper { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.avatar-crop-stage { width: 200px; height: 200px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 4px var(--card-bg), 0 0 0 6px color-mix(in srgb, var(--brand) 40%, transparent); background: #111; }
.avatar-crop-stage canvas { width: 200px; height: 200px; display: block; cursor: grab; touch-action: none; }
.avatar-crop-stage canvas:active { cursor: grabbing; }
.avatar-crop-controls { display: grid; gap: 8px; max-width: 360px; }
.avatar-zoom { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.avatar-zoom input { flex: 1; }

/* ---------- Rating page (rate.php, from the satisfaction email) ---------- */
.rate-head { display: flex; gap: 14px; align-items: center; margin: 6px 0 14px; text-align: left; }
.rate-title { font-size: 20px; margin: 0 0 2px; }
.rate-stars { display: flex; flex-direction: row-reverse; justify-content: center; gap: 6px; margin: 8px 0 2px; }
.rate-stars input { position: absolute; opacity: 0; pointer-events: none; }
.rate-stars label { font-size: 44px; line-height: 1; color: color-mix(in srgb, var(--text-muted) 35%, transparent); cursor: pointer; transition: transform .1s, color .1s; }
.rate-stars label:hover, .rate-stars label:hover ~ label, .rate-stars input:checked ~ label { color: #f5b301; }
.rate-stars label:hover { transform: scale(1.12); }
.rate-stars input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.rate-label { text-align: center; margin: 0 0 12px; min-height: 18px; }
.rate-done { text-align: center; }
.rate-done-stars { font-size: 40px; color: #f5b301; letter-spacing: 4px; }
.rate-done-stars span { color: color-mix(in srgb, var(--text-muted) 30%, transparent); }
.podium-level { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-top: 1px; }
.podium-spot .arcade-avatar-wrap { margin-bottom: 4px; }

/* ---------- Email to Ticket: filters and processed-message actions ---------- */
.inbound-filters { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px 4px; margin: 6px 0 12px; }
.inbound-filters legend { font-weight: 700; font-size: 13px; padding: 0 6px; }
.inbound-filters textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.inbound-log-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.inbound-log-filter input[type=search] { flex: 1; min-width: 200px; }
.inbound-bulk { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 8px; border-radius: 8px; background: color-mix(in srgb, var(--bad, #dc2626) 6%, transparent); }
.inbound-row-actions { white-space: nowrap; }
.inbound-row-actions .link-button { font-size: 12px; margin-right: 8px; }
.inbound-filters textarea::placeholder { font-style: italic; opacity: .55; }

/* Form already sending (app.js): the button shows it is working. */
form[aria-busy="true"] [type="submit"], form[aria-busy="true"] button:not([type]) { opacity: .6; cursor: progress; }

/* ===== Pop-up notification alerts (assets/js/notify.js) ===== */
.toast-stack { position: fixed; right: 20px; top: 76px; z-index: 1200; display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
    width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { --toast-accent: var(--brand); --toast-ms: 8000ms; pointer-events: auto; position: relative; overflow: hidden; width: 100%;
    display: grid; grid-template-columns: 40px 1fr 24px; gap: 12px; align-items: start; padding: 14px 14px 16px 16px; cursor: pointer;
    background: color-mix(in srgb, var(--card-bg) 92%, transparent); color: var(--text);
    -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); border-radius: 14px;
    box-shadow: 0 18px 40px -12px rgba(15, 23, 42, .28), 0 4px 12px -4px rgba(15, 23, 42, .12);
    opacity: 0; transform: translateX(28px) scale(.97); transition: opacity .28s ease, transform .38s cubic-bezier(.2, 1.3, .4, 1), box-shadow .2s ease; }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--toast-accent); }
.toast.is-in { opacity: 1; transform: none; }
.toast.is-leaving { opacity: 0; transform: translateX(40px) scale(.96); transition: opacity .22s ease, transform .26s ease; }
.toast:hover, .toast:focus-visible { box-shadow: 0 22px 48px -12px rgba(15, 23, 42, .36), 0 6px 16px -4px rgba(15, 23, 42, .16); outline: none; }
.toast:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--toast-accent) 45%, transparent), 0 18px 40px -12px rgba(15, 23, 42, .3); }
.toast-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--toast-accent);
    background: color-mix(in srgb, var(--toast-accent) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--toast-accent) 22%, transparent); }
.toast-main { min-width: 0; }
.toast-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; font-size: 11.5px; line-height: 1.3; }
.toast-group { font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--toast-accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-time { color: var(--text-muted); white-space: nowrap; }
.toast-time::before { content: "\00b7"; margin-right: 8px; }
.toast-title { font-weight: 650; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toast-body { margin-top: 3px; font-size: 13px; line-height: 1.4; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toast-close { width: 24px; height: 24px; border: 0; border-radius: 7px; display: grid; place-items: center; background: transparent; color: var(--text-muted);
    cursor: pointer; opacity: 0; transition: opacity .15s ease, background .15s ease; }
.toast:hover .toast-close, .toast:focus-within .toast-close { opacity: 1; }
.toast-close:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.toast-bar { position: absolute; left: 4px; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--toast-accent) 55%, transparent);
    transform-origin: left; animation: toast-countdown var(--toast-ms) linear forwards; }
.toast.is-paused .toast-bar { animation-play-state: paused; }
@keyframes toast-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast-more { pointer-events: auto; align-self: stretch; text-align: center; font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 10px;
    color: var(--text); text-decoration: none; background: color-mix(in srgb, var(--card-bg) 92%, transparent); border: 1px solid var(--border);
    box-shadow: 0 8px 20px -10px rgba(15, 23, 42, .3); }
.toast-more:hover { color: var(--brand); }
/* one colour per kind */
.toast-ticket { --toast-accent: #2563eb; }
.toast-task { --toast-accent: #7c3aed; }
.toast-approval { --toast-accent: #d97706; }
.toast-chat { --toast-accent: #5b5fc7; }
.toast-reminder { --toast-accent: #ea580c; }
.toast-watch { --toast-accent: #0891b2; }
.toast-automation { --toast-accent: #db2777; }
.toast-general { --toast-accent: var(--brand); }
:root[data-theme="dark"] .toast { box-shadow: 0 18px 44px -12px rgba(0, 0, 0, .7), 0 4px 14px -4px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .toast-ticket { --toast-accent: #60a5fa; }
:root[data-theme="dark"] .toast-task { --toast-accent: #a78bfa; }
:root[data-theme="dark"] .toast-approval { --toast-accent: #fbbf24; }
:root[data-theme="dark"] .toast-chat { --toast-accent: #8b8ff0; }
:root[data-theme="dark"] .toast-reminder { --toast-accent: #fb923c; }
:root[data-theme="dark"] .toast-watch { --toast-accent: #22d3ee; }
:root[data-theme="dark"] .toast-automation { --toast-accent: #f472b6; }
@media (max-width: 600px) { .toast-stack { right: 12px; left: 12px; width: auto; } .toast-close { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.is-leaving { transition: opacity .2s ease; transform: none; } .toast-bar { animation: none; } }
/* the bell gives a small nudge when the count changes */
.bell.bell-ring svg { animation: bell-ring .7s ease; transform-origin: 50% 10%; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-11deg); } 60% { transform: rotate(7deg); } 80% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .bell.bell-ring svg { animation: none; } }
/* Notifications page: alert settings */
.notif-alerts { margin-bottom: 14px; display: grid; gap: 10px; }
.notif-alerts-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.notif-alerts .switch-line { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.notif-alerts .switch-line input { margin-top: 4px; }
