/* Civil Defence portals: shared look. Loaded after MudBlazor.min.css. */
:root {
    --cd-red: #C8102E;
    --cd-navy: #0F2A44;
    --cd-border: #E5E9EF;
}

html, body { height: 100%; }
body { background: #F3F6F9; -webkit-font-smoothing: antialiased; }
.cd-ltr { direction: ltr; }
.cd-rtl { direction: rtl; }
/* On a MudBlazor field only the typed value turns LTR (phone, user name, plate...):
   the label, its notch in the outline and the adornment keep the page direction. */
.mud-input-control.cd-ltr, .mud-input-control.cd-rtl { direction: inherit; text-align: inherit; }
.mud-input-control.cd-ltr input, .mud-input-control.cd-ltr textarea { direction: ltr; }
.mud-input-control.cd-rtl input, .mud-input-control.cd-rtl textarea { direction: rtl; text-align: right; }
.cd-mono { font-family: Consolas, "Segoe UI Mono", monospace; letter-spacing: .02em; }
.cd-muted { color: #6B7280; }
.cd-page-title { line-height: 1.2; }
.cd-nowrap { white-space: nowrap; }
.cd-link { cursor: pointer; color: var(--cd-navy); text-decoration: none; font-weight: 600; }
.cd-link:hover { text-decoration: underline; }
.cd-chip { margin: 0 2px; }
.cd-stat { cursor: default; transition: box-shadow .15s; }
.cd-stat:hover { box-shadow: 0 6px 18px rgba(15, 42, 68, .08); }
.cd-clickable { cursor: pointer; }
.cd-clickable:hover { background: #F1F5F9; }

/* Navigation rail */
.cd-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
.cd-brand img { width: 36px; height: 36px; }
.cd-brand strong { display: block; color: #fff; font-size: .95rem; line-height: 1.15; }
.cd-brand small { display: block; color: #8FA3B8; font-size: .72rem; }
.cd-nav-label { padding: 12px 18px 4px; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: #6E8299; font-weight: 700; }
.mud-drawer .mud-nav-link { border-radius: 8px; margin: 1px 10px; }
.mud-drawer .mud-nav-link.active { background: rgba(200, 16, 46, .22) !important; }
.mud-drawer .mud-nav-link.active .mud-nav-link-text, .mud-drawer .mud-nav-link.active .mud-icon-root { color: #fff !important; }
.cd-appbar { border-bottom: 1px solid var(--cd-border); }
.cd-clock { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--cd-navy); }
.cd-badge-dot { position: absolute; top: 6px; inset-inline-end: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--cd-red); }

/* Login */
.cd-login-bg { position: fixed; inset: 0; background: radial-gradient(1200px 600px at 20% 10%, #1E3A5F 0%, #0F2A44 45%, #0A1A2B 100%); display: flex; align-items: center; justify-content: center; }
.cd-login-bg::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 48px 48px; }
.cd-login-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(200,16,46,.18), transparent 40%); }
.cd-login-wrap { min-height: 100vh; position: relative; }
.cd-login-card { backdrop-filter: blur(4px); }
.cd-login-logo img { width: 72px; height: 72px; filter: drop-shadow(0 6px 14px rgba(200,16,46,.35)); }
.cd-login-btn { height: 46px; font-size: 1rem; }

/* Loader */

/* Map */
.cd-map { width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--cd-border); background: #E8EEF3; z-index: 0; }
.cd-map .leaflet-popup-content { margin: 10px 12px; font-size: .82rem; line-height: 1.45; direction: ltr; }
.cd-map .leaflet-popup-content b { font-size: .9rem; }
.cd-pop-pr { color: #fff; padding: 1px 7px; border-radius: 999px; font-size: .7rem; font-weight: 700; }
.cd-pop-link { margin-top: 6px; color: var(--cd-navy); font-weight: 700; cursor: pointer; }
.cd-pop-link:hover { text-decoration: underline; }
.cd-inc { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; font-size: 16px; position: relative; }
.cd-inc-pulse::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid #D92D20; animation: cdPulse 1.4s ease-out infinite; }
@keyframes cdPulse { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.cd-veh { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 2px solid #12A150; border-radius: 999px; padding: 1px 7px 1px 4px; font-size: 11px; font-weight: 700; color: #111827; box-shadow: 0 2px 6px rgba(0,0,0,.25); white-space: nowrap; direction: ltr; position: relative; }
.cd-veh-g { font-size: 14px; }
.cd-veh-cs { font-family: Consolas, monospace; letter-spacing: 0; }
.cd-veh-dir { position: absolute; left: 50%; top: -14px; margin-left: -5px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid #3B6FE0; transform-origin: 50% 20px; }
.cd-v-avail { border-color: #12A150; }
.cd-v-busy { border-color: #3B6FE0; background: #EAF1FF; }
.cd-v-out { border-color: #D92D20; opacity: .7; }
.cd-v-maint { border-color: #E08A0B; opacity: .8; }
.cd-st { width: 22px; height: 22px; border-radius: 5px; background: #0F2A44; color: #fff; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,.3); }
.cd-s-partial { background: #E08A0B; }
.cd-s-limited { background: #D92D20; }
.cd-s-off { background: #4B5563; }
.cd-h { width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #0E7490; border: 2px solid #0E7490; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,.25); }
.cd-h-trauma { background: #0E7490; color: #fff; }
.cd-map-legend { background: rgba(255,255,255,.92); padding: 6px 10px; border-radius: 8px; font-size: .72rem; line-height: 1.7; box-shadow: 0 1px 4px rgba(0,0,0,.2); direction: ltr; }
.cd-lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.cd-lg-inc { background: #D92D20; } .cd-lg-veh { background: #12A150; } .cd-lg-st { background: #0F2A44; border-radius: 2px; } .cd-lg-h { background: #0E7490; }

/* Timeline */
.cd-timeline { position: relative; padding-inline-start: 26px; }
.cd-timeline::before { content: ""; position: absolute; inset-inline-start: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--cd-border); }
.cd-tl-item { position: relative; padding: 4px 0 12px; }
.cd-tl-dot { position: absolute; inset-inline-start: -26px; top: 4px; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; border: 2px solid var(--cd-border); }
.cd-tl-dot .mud-icon-root { font-size: 14px; }
.cd-tl-time { font-size: .72rem; color: #6B7280; font-variant-numeric: tabular-nums; }

/* Mission stage stepper */
.cd-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.cd-step { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #EAEFF4; font-size: .74rem; font-weight: 600; color: #6B7280; }
.cd-step.done { background: #DCFCE7; color: #166534; }
.cd-step.now { background: var(--cd-navy); color: #fff; }

/* Field app */
.cd-field-card { border-inline-start: 5px solid var(--cd-red); }
.cd-big-btn { height: 58px; font-size: 1.05rem; }

/* Triage band on patient rows */
.cd-triage-band { display: inline-block; width: 6px; align-self: stretch; border-radius: 3px; margin-inline-end: 8px; }

/* Tables */
.mud-table.cd-table .mud-table-cell { padding: 8px 10px; }
.cd-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: .84rem; }
.cd-kv > span:nth-child(odd) { color: #6B7280; }

/* Alerts strip */
.cd-alert-strip { background: #FFF1F0; border: 1px solid #FFD2CE; border-radius: 10px; padding: 8px 12px; }

@media print {
    .mud-drawer, .mud-appbar, .cd-no-print { display: none !important; }
    .mud-main-content { padding: 0 !important; }
}

/* Governorate / wilayat picker dialog */
.cd-geo-dialog .mud-dialog-content { padding: 14px 16px 18px; }
.cd-geo-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cd-geo-search { position: relative; flex: 1; display: flex; align-items: center; background: #F3F6F9; border: 1.5px solid transparent; border-radius: 14px; padding: 0 12px; height: 48px; transition: border-color .15s, background .15s, box-shadow .15s; }
.cd-geo-search:focus-within { background: #fff; border-color: var(--cd-red); box-shadow: 0 0 0 4px rgba(200,16,46,.10); }
.cd-geo-search-ic { color: #7B8494; flex: none; }
.cd-geo-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; padding: 0 10px; color: #111827; }
.cd-geo-x { border: 0; background: #E5E9EF; color: #4B5563; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cd-geo-current { display: flex; align-items: center; gap: 8px; background: #FFF1F0; border: 1px solid #FFD2CE; border-radius: 12px; padding: 6px 10px; margin-bottom: 12px; font-weight: 600; }
.cd-geo-govs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 58vh; overflow: auto; padding: 2px; }
.cd-geo-gov { border: 1px solid var(--cd-border); border-radius: 14px; background: #fff; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.cd-geo-gov:hover { box-shadow: 0 6px 18px rgba(15,42,68,.08); }
.cd-geo-gov.sel { border-color: var(--cd-red); }
.cd-geo-gov.open { grid-column: 1 / -1; border-color: var(--cd-navy); }
.cd-geo-gov-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: transparent; cursor: pointer; font: inherit; text-align: start; }
.cd-geo-gov-badge { font-family: Consolas, monospace; font-size: .68rem; font-weight: 700; color: #fff; background: var(--cd-navy); border-radius: 6px; padding: 2px 6px; flex: none; }
.cd-geo-gov-name { flex: 1; font-weight: 700; color: #111827; }
.cd-geo-gov-count { font-size: .72rem; color: #6B7280; background: #F3F6F9; border-radius: 999px; padding: 1px 8px; }
.cd-geo-wils { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px 12px; animation: cdFade .15s ease-out; }
@keyframes cdFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cd-geo-wil { border: 1px solid var(--cd-border); background: #F8FAFC; color: #111827; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; transition: all .12s; display: inline-flex; align-items: center; gap: 4px; }
.cd-geo-wil:hover { background: var(--cd-navy); color: #fff; border-color: var(--cd-navy); }
.cd-geo-wil.sel { background: var(--cd-red); color: #fff; border-color: var(--cd-red); }
.cd-geo-wil.ghost { background: transparent; border-style: dashed; color: #6B7280; }
.cd-geo-results { display: flex; flex-direction: column; gap: 4px; max-height: 58vh; overflow: auto; }
.cd-geo-result { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid transparent; background: #fff; border-radius: 12px; padding: 8px 10px; cursor: pointer; font: inherit; text-align: start; transition: background .12s; }
.cd-geo-result:hover, .cd-geo-result.on { background: #F1F5F9; border-color: var(--cd-border); }
.cd-geo-result.sel { border-color: var(--cd-red); }
.cd-geo-result-ic { width: 34px; height: 34px; border-radius: 10px; background: #F3F6F9; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.cd-geo-result-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.cd-geo-result-text small { color: #6B7280; font-size: .74rem; }
.cd-geo-empty { display: flex; align-items: center; gap: 8px; color: #6B7280; padding: 24px; justify-content: center; }
@media (max-width: 600px) { .cd-geo-govs { grid-template-columns: 1fr; } }

/* Call timer on the new-call form */
.cd-call-timer { display: flex; align-items: center; gap: 12px; border: 1px solid var(--cd-border); border-radius: 14px; padding: 10px 14px; background: #F8FAFC; transition: background .2s, border-color .2s; }
.cd-call-timer.live { background: #FFF5F5; border-color: #FFD2CE; }
.cd-call-dot { width: 12px; height: 12px; border-radius: 50%; background: #9CA3AF; flex: none; position: relative; }
.cd-call-timer.live .cd-call-dot { background: var(--cd-red); }
.cd-call-timer.live .cd-call-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--cd-red); animation: cdPulse 1.4s ease-out infinite; }
.cd-call-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cd-call-label { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6B7280; }
.cd-call-timer.live .cd-call-label { color: var(--cd-red); }
.cd-call-time { font-family: Consolas, "Segoe UI Mono", monospace; font-size: 1.7rem; font-weight: 700; line-height: 1.1; color: #111827; font-variant-numeric: tabular-nums; cursor: text; direction: ltr; display: inline-block; width: max-content; }
.cd-call-edit { display: inline-flex; align-items: center; gap: 6px; direction: ltr; }
.cd-call-edit input { width: 64px; height: 34px; border: 1px solid var(--cd-border); border-radius: 8px; padding: 0 8px; font: inherit; font-size: 1rem; font-weight: 700; text-align: center; }
.cd-call-edit small { color: #6B7280; }
.cd-call-actions { display: flex; align-items: center; gap: 4px; }

/* Alert bell: badge hugs the glyph, not the button box */
.cd-bell .mud-badge-root { display: inline-flex; }
.cd-bell .mud-badge { font-size: .62rem; min-width: 18px; height: 18px; padding: 0 4px; }

/* Governorate / wilayat tree */
.cd-tree { max-height: 60vh; overflow: auto; padding: 2px; }
.cd-tree-node { margin-bottom: 2px; }
.cd-tree-row { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; border-radius: 10px; padding: 8px 10px; cursor: pointer; font: inherit; text-align: start; color: #111827; transition: background .12s; }
.cd-tree-row:hover { background: #F1F5F9; }
.cd-tree-row.gov { font-weight: 700; }
.cd-tree-row.gov.sel .cd-tree-name { color: var(--cd-red); }
.cd-tree-row.wil { padding-inline-start: 34px; font-weight: 500; }
.cd-tree-row.wil.sel { background: #FFF1F0; color: var(--cd-red); font-weight: 700; }
.cd-tree-chev { color: #6B7280; transition: transform .15s; }
.cd-tree-chev.open { transform: rotate(90deg); }
[dir="rtl"] .cd-tree-chev.open { transform: rotate(-90deg); }
.cd-tree-ic { color: #7B8494; }
.cd-tree-row.gov .cd-tree-ic { color: var(--cd-navy); }
.cd-tree-row.wil .cd-tree-ic { color: var(--cd-red); }
.cd-tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-tree-name mark { background: #FDE68A; color: inherit; border-radius: 3px; padding: 0 1px; }
.cd-tree-count { font-size: .72rem; color: #6B7280; background: #F3F6F9; border-radius: 999px; padding: 1px 8px; }
.cd-tree-children { position: relative; animation: cdFade .15s ease-out; }
.cd-tree-children::before { content: ""; position: absolute; top: 4px; bottom: 8px; inset-inline-start: 19px; width: 2px; background: var(--cd-border); border-radius: 2px; }

/* Notification centre dialog */
.cd-alerts-dialog .mud-dialog-content { padding: 14px 16px 6px; }
.cd-alert-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; padding: 2px; }
.cd-alert-item { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--cd-border); border-inline-start-width: 4px; border-radius: 12px; padding: 8px 10px; background: #fff; }
.cd-alert-item.sev-2 { border-inline-start-color: #D92D20; background: #FFF7F6; }
.cd-alert-item.sev-1 { border-inline-start-color: #E08A0B; background: #FFFBF3; }
.cd-alert-item.sev-0 { border-inline-start-color: #3B6FE0; }
.cd-alert-item.done { opacity: .6; background: #F8FAFC; }
.cd-alert-ic { width: 32px; height: 32px; border-radius: 10px; background: #F3F6F9; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--cd-navy); }
.cd-alert-body { flex: 1; min-width: 0; }
.cd-alert-msg { font-size: .84rem; margin: 2px 0; }

/* People reported on a call: one civil-ID box that finds a known person or starts a new one */
.cd-person-search { position: relative; display: flex; align-items: center; gap: 8px; background: #F3F6F9; border: 1.5px solid transparent; border-radius: 14px; padding: 0 12px; height: 50px; transition: border-color .15s, background .15s, box-shadow .15s; }
.cd-person-search:focus-within { background: #fff; border-color: var(--cd-navy); box-shadow: 0 0 0 4px rgba(15,42,68,.10); }
.cd-person-search.found { background: #F0FDF4; border-color: #86EFAC; }
.cd-person-search.fresh:focus-within { border-color: var(--cd-red); box-shadow: 0 0 0 4px rgba(200,16,46,.10); }
.cd-person-search-ic { color: #7B8494; flex: none; }
.cd-person-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1.05rem; letter-spacing: .04em; color: #111827; }
.cd-person-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.cd-person-tag.found { background: #DCFCE7; color: #166534; }
.cd-person-tag.fresh { background: #FFF1F0; color: var(--cd-red); }
.cd-person-hits { margin-top: 6px; border: 1px solid var(--cd-border); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 10px 30px rgba(15,42,68,.10); animation: cdFade .15s ease-out; }
.cd-person-hit { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-bottom: 1px solid #F1F3F6; background: transparent; cursor: pointer; font: inherit; text-align: start; }
.cd-person-hit:last-child { border-bottom: 0; }
.cd-person-hit:hover { background: #F3F6F9; }
.cd-person-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cd-navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.cd-person-avatar.fresh { background: var(--cd-red); }
.cd-person-hit-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cd-person-hit-name { font-weight: 700; color: #111827; }
.cd-person-hit-meta { font-size: .78rem; color: #6B7280; }
.cd-person-hit-hist { font-size: .74rem; color: #B45309; }
.cd-person-history { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .8rem; color: #166534; background: #F0FDF4; border-radius: 10px; padding: 6px 10px; }
.cd-person-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cd-person-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--cd-border); border-radius: 14px; padding: 8px 10px; background: #fff; animation: cdFade .15s ease-out; }
.cd-person-card .cd-person-avatar { width: 32px; height: 32px; font-size: .85rem; }
.cd-person-empty { margin-top: 10px; text-align: center; color: #9CA3AF; font-size: .85rem; border: 1px dashed var(--cd-border); border-radius: 12px; padding: 12px; }

/* Missions page: stage tabs over a table */
.cd-mission-tabs { overflow: hidden; }
.cd-mission-tabs .mud-tabs-toolbar { border-bottom: 1px solid var(--cd-border); background: #F8FAFC; }
.cd-mission-tabs .mud-tab { text-transform: none; font-weight: 600; min-height: 52px; }
.cd-mission-tabs .mud-tab .mud-badge { margin-inline-start: 6px; }
.cd-mission-tabs .mud-table-container { border: 0; }
.cd-mission-tabs .mud-tab .mud-tab-badge { position: static; display: inline-flex; margin-inline-start: 8px; }
.cd-mission-tabs .mud-tab .mud-tab-badge .mud-badge-wrapper { position: static; display: inline-flex; }
.cd-mission-tabs .mud-tab .mud-tab-badge .mud-badge { position: static; transform: none; }

/* The one loader: sonar rings around the emblem, a sweeping arc, and a shimmering track */
.cd-loader { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 56px 16px; min-height: 240px; animation: cdFade .25s ease-out; }
.cd-loader.full { position: fixed; inset: 0; z-index: 2000; min-height: 100vh; overflow: hidden; background: #F6F8FB; }
.cd-loader.full::before, .cd-loader.full::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; }
.cd-loader.full::before { width: 60vmax; height: 60vmax; left: -15vmax; top: -20vmax; background: radial-gradient(circle, rgba(200,16,46,.55), rgba(200,16,46,0) 65%); animation: cdBlobA 14s ease-in-out infinite alternate; }
.cd-loader.full::after { width: 65vmax; height: 65vmax; right: -20vmax; bottom: -25vmax; background: radial-gradient(circle, rgba(15,42,68,.55), rgba(15,42,68,0) 65%); animation: cdBlobB 18s ease-in-out infinite alternate; }
.cd-loader.full > * { position: relative; z-index: 1; }
.cd-loader-grid { position: absolute; inset: 0; z-index: 0; background-image: linear-gradient(rgba(15,42,68,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(15,42,68,.06) 1px, transparent 1px); background-size: 36px 36px; -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 20%, transparent 75%); mask-image: radial-gradient(circle at 50% 45%, #000 20%, transparent 75%); animation: cdGridDrift 20s linear infinite; }
@keyframes cdBlobA { from { transform: translate(0, 0) scale(1); } to { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes cdBlobB { from { transform: translate(0, 0) scale(1.1); } to { transform: translate(-12vmax, -10vmax) scale(.95); } }
@keyframes cdGridDrift { from { background-position: 0 0, 0 0; } to { background-position: 36px 36px, 36px 36px; } }
.cd-loader-ring { position: relative; width: 112px; height: 112px; display: flex; align-items: center; justify-content: center; }
.cd-loader-ring img { width: 46px; height: 46px; position: relative; z-index: 2; filter: drop-shadow(0 6px 14px rgba(200,16,46,.25)); animation: cdLoaderBreathe 1.8s ease-in-out infinite; }
.cd-loader-ring::before, .cd-loader-ring::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; border: 2px solid var(--cd-red); opacity: 0; animation: cdLoaderSonar 2.4s ease-out infinite; }
.cd-loader-ring::after { animation-delay: 1.2s; border-color: var(--cd-navy); }
.cd-loader-arc { position: absolute; inset: 12px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 70%, rgba(200,16,46,.15) 85%, var(--cd-red) 100%); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); animation: cdLoaderSpin 1.3s linear infinite; }
.cd-loader-arc.two { inset: 2px; background: conic-gradient(from 180deg, transparent 0 80%, rgba(15,42,68,.12) 92%, var(--cd-navy) 100%); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px)); animation: cdLoaderSpin 2.2s linear infinite reverse; }
.cd-loader-arc::after { content: ""; position: absolute; top: -3px; left: calc(50% - 5px); width: 10px; height: 10px; border-radius: 50%; background: var(--cd-red); box-shadow: 0 0 12px 3px rgba(200,16,46,.45); }
.cd-loader-arc.two::after { width: 6px; height: 6px; top: -2px; left: calc(50% - 3px); background: var(--cd-navy); box-shadow: 0 0 8px 2px rgba(15,42,68,.35); }
.cd-loader-label { font-weight: 700; color: var(--cd-navy); letter-spacing: .02em; font-size: .95rem; }
.cd-loader-dots { position: relative; width: 160px; height: 4px; border-radius: 999px; background: #E5E9EF; overflow: hidden; }
.cd-loader-dots span { display: none; }
.cd-loader-dots::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 999px; background: linear-gradient(90deg, transparent, var(--cd-red), transparent); animation: cdLoaderTrack 1.4s ease-in-out infinite; }
@keyframes cdLoaderSpin { to { transform: rotate(360deg); } }
@keyframes cdLoaderBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes cdLoaderSonar { 0% { transform: scale(.8); opacity: .7; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes cdLoaderTrack { 0% { inset-inline-start: -40%; } 100% { inset-inline-start: 100%; } }

/* Role picker and permission matrix (user dialog) */
.cd-section-title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--cd-navy); margin: 6px 0 10px; font-size: .95rem; }
.cd-section-title::after { content: ""; flex: 1; height: 1px; background: var(--cd-border); }
.cd-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cd-role { position: relative; display: flex; align-items: center; gap: 10px; text-align: start; padding: 10px 12px; border: 1.5px solid var(--cd-border); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; transition: border-color .15s, box-shadow .15s, transform .12s; }
.cd-role:hover { border-color: #B9C3D0; box-shadow: 0 6px 18px rgba(15,42,68,.08); transform: translateY(-1px); }
.cd-role.sel { border-color: var(--cd-red); background: linear-gradient(135deg, #FFF5F4, #fff 60%); box-shadow: 0 0 0 3px rgba(200,16,46,.10); }
.cd-role-ic { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #F3F6F9; color: var(--cd-navy); flex: none; }
.cd-role.sel .cd-role-ic { background: var(--cd-red); color: #fff; }
.cd-role-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cd-role-name { font-weight: 700; color: #111827; line-height: 1.2; }
.cd-role-desc { font-size: .74rem; color: #6B7280; line-height: 1.3; margin-top: 2px; }
.cd-role-n { font-size: .7rem; font-weight: 700; color: #4B5563; background: #F3F6F9; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.cd-role.sel .cd-role-n { background: #FFE1DD; color: var(--cd-red); }
.cd-role-check { position: absolute; top: -8px; inset-inline-end: -8px; color: var(--cd-red); background: #fff; border-radius: 50%; }
.cd-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cd-perm-group { border: 1px solid var(--cd-border); border-radius: 14px; padding: 10px 12px; background: #FAFBFC; }
.cd-perm-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; color: var(--cd-navy); font-size: .85rem; margin-bottom: 8px; }
.cd-perm-head span { font-size: .72rem; color: #6B7280; background: #fff; border: 1px solid var(--cd-border); border-radius: 999px; padding: 1px 8px; }
.cd-perm-list { display: flex; flex-direction: column; gap: 5px; }
.cd-perm { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: #9CA3AF; transition: color .15s; }
.cd-perm.on { color: #111827; }
.cd-perm.on .mud-icon-root { color: #16A34A; }

/* Period filter: range picker in a dialog with presets */
.cd-daterange .mud-input-adornment { color: var(--cd-red); }
.mud-dialog.mud-picker-paper .mud-dialog { border-radius: 18px; overflow: hidden; }
.mud-dialog.mud-picker-paper .mud-picker-container { border-radius: 0; }
.mud-dialog.mud-picker-paper .mud-picker-toolbar { background: linear-gradient(135deg, var(--cd-red), #8E0A20); padding: 16px 20px; }
.mud-dialog.mud-picker-paper .mud-picker-calendar-header-day, .mud-dialog.mud-picker-paper .mud-picker-calendar-day { font-weight: 600; }
.mud-dialog.mud-picker-paper .mud-picker-calendar-day.mud-range-between { background: #FFF1F0; }
.mud-dialog.mud-picker-paper .mud-picker-calendar-day.mud-range-start-selected .mud-button-root, .mud-dialog.mud-picker-paper .mud-picker-calendar-day.mud-range-end-selected .mud-button-root { background: var(--cd-red) !important; color: #fff; }
.mud-dialog.mud-picker-paper .mud-picker-actions { padding: 10px 14px 14px; border-top: 1px solid var(--cd-border); background: #FAFBFC; }
.cd-daterange-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; width: 100%; }
.cd-daterange-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.cd-daterange-presets button { border: 1px solid var(--cd-border); background: #fff; color: var(--cd-navy); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; transition: all .12s; }
.cd-daterange-presets button:hover { background: var(--cd-navy); color: #fff; border-color: var(--cd-navy); }
@media (max-width: 700px) { .mud-dialog.mud-picker-paper .mud-picker-calendar-container { flex-direction: column; } }
.mud-picker.cd-daterange { width: 320px; max-width: 100%; flex: 0 0 auto; }
.mud-dialog.mud-picker-paper .mud-picker-toolbar .mud-typography-h4 { font-size: 1.3rem; line-height: 1.3; }
.mud-dialog.mud-picker-paper .mud-picker-toolbar .mud-typography-subtitle1 { opacity: .85; }
.cd-row-actions { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cd-row-actions .mud-button-root { border-radius: 999px; }

/* Communications: conversations on the side, bubbles in the middle, composer below */
.cd-chat { display: flex; height: calc(100vh - 178px); min-height: 480px; overflow: hidden; }
.cd-chat-side { width: 320px; flex: none; border-inline-end: 1px solid var(--cd-border); display: flex; flex-direction: column; background: #FAFBFC; }
.cd-chat-search { display: flex; align-items: center; gap: 8px; margin: 12px 12px 8px; background: #fff; border: 1.5px solid var(--cd-border); border-radius: 12px; padding: 0 10px; height: 40px; color: #7B8494; }
.cd-chat-search:focus-within { border-color: var(--cd-navy); }
.cd-chat-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: #111827; }
.cd-chat-channels { display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; }
.cd-chat-channels button { flex: none; border: 1px solid var(--cd-border); background: #fff; color: #4B5563; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .74rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cd-chat-channels button.on { background: var(--cd-navy); color: #fff; border-color: var(--cd-navy); }
.cd-chat-threads { flex: 1; overflow: auto; padding: 0 8px 8px; }
.cd-thread { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 14px; background: transparent; cursor: pointer; font: inherit; text-align: start; transition: background .12s; }
.cd-thread:hover { background: #F0F3F7; }
.cd-thread.on { background: #fff; box-shadow: 0 4px 14px rgba(15,42,68,.08); }
.cd-thread-avatar { width: 40px; height: 40px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: #E8EEF3; color: var(--cd-navy); font-family: Consolas, monospace; font-weight: 700; font-size: .85rem; }
.cd-thread-avatar.all { background: var(--cd-red); color: #fff; }
.cd-thread-avatar.gen { background: #F3F6F9; color: #6B7280; }
.cd-thread-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cd-thread-top { display: flex; align-items: baseline; gap: 8px; }
.cd-thread-title { flex: 1; font-weight: 700; color: #111827; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-thread-time { font-size: .7rem; color: #9CA3AF; white-space: nowrap; }
.cd-thread-last { font-size: .76rem; color: #6B7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-thread-badge { flex: none; min-width: 20px; height: 20px; border-radius: 999px; background: var(--cd-red); color: #fff; font-size: .7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.cd-chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.cd-chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--cd-border); }
.cd-chat-head-body { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: .9rem; }
.cd-chat-head-body .cd-muted { font-size: .74rem; }
.cd-chat-stream { flex: 1; overflow: auto; padding: 14px 16px; background: #F3F6F9 radial-gradient(circle at 1px 1px, rgba(15,42,68,.06) 1px, transparent 0) 0 0 / 18px 18px; display: flex; flex-direction: column; gap: 4px; }
.cd-chat-panel { display: flex; flex-direction: column; border: 1px solid var(--cd-border); border-radius: 14px; overflow: hidden; }
.cd-chat-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; color: #9CA3AF; }
.cd-chat-day { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; color: #6B7280; font-size: .72rem; font-weight: 600; }
.cd-chat-day::before, .cd-chat-day::after { content: ""; flex: 1; height: 1px; background: rgba(15,42,68,.12); }
.cd-chat-day span { background: #fff; border: 1px solid var(--cd-border); border-radius: 999px; padding: 2px 10px; }
.cd-bubble-row { display: flex; align-items: flex-end; gap: 8px; max-width: 78%; }
.cd-bubble-row.first { margin-top: 8px; }
.cd-bubble-row.them { align-self: flex-start; }
.cd-bubble-row.me { align-self: flex-end; flex-direction: row-reverse; }
.cd-bubble-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--cd-navy); color: #fff; font-size: .78rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; background-size: cover; background-position: center; }
.cd-bubble { position: relative; background: #fff; border: 1px solid var(--cd-border); border-radius: 16px; padding: 8px 12px 6px; box-shadow: 0 1px 2px rgba(15,42,68,.05); min-width: 120px; }
.cd-bubble-row.them .cd-bubble { border-start-start-radius: 4px; }
.cd-bubble-row.me .cd-bubble { background: #0F2A44; color: #fff; border-color: #0F2A44; border-start-end-radius: 4px; }
.cd-bubble.high { border-inline-start: 4px solid #F59E0B; }
.cd-bubble.critical { border-inline-start: 4px solid var(--cd-red); }
.cd-bubble-from { font-size: .74rem; font-weight: 700; color: var(--cd-red); margin-bottom: 2px; }
.cd-bubble-from span { font-weight: 500; color: #6B7280; margin-inline-start: 4px; }
.cd-bubble-row.me .cd-bubble-from { color: #FFD2CE; }
.cd-bubble-row.me .cd-bubble-from span { color: rgba(255,255,255,.7); }
.cd-bubble-body { white-space: pre-wrap; line-height: 1.45; font-size: .9rem; }
.cd-bubble-meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 4px; font-size: .68rem; color: #9CA3AF; }
.cd-bubble-row.me .cd-bubble-meta { color: rgba(255,255,255,.7); }
.cd-bubble-ch, .cd-bubble-ctx { border: 1px solid currentColor; border-radius: 999px; padding: 0 6px; opacity: .8; }
.cd-bubble-ctx { font-family: Consolas, monospace; }
.cd-ticks { color: #9CA3AF; }
.cd-bubble-row.me .cd-ticks { color: rgba(255,255,255,.75); }
.cd-bubble-row.me .cd-ticks.read { color: #4ADE80; }
.cd-chat-compose { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--cd-border); background: #fff; }
.cd-compose-pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--cd-border); background: #F8FAFC; color: var(--cd-navy); border-radius: 999px; padding: 6px 10px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cd-compose-pill:hover { background: #EEF2F6; }
.cd-prio-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-inline-end: 4px; }
.cd-compose-input { flex: 1; min-width: 0; height: 44px; border: 1.5px solid var(--cd-border); border-radius: 999px; padding: 0 16px; font: inherit; outline: 0; background: #F8FAFC; transition: border-color .15s, box-shadow .15s; }
.cd-compose-input:focus { background: #fff; border-color: var(--cd-navy); box-shadow: 0 0 0 4px rgba(15,42,68,.08); }
.cd-compose-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--cd-red); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; box-shadow: 0 6px 16px rgba(200,16,46,.3); transition: transform .12s, opacity .12s; }
.cd-compose-send:hover { transform: translateY(-1px); }
.cd-compose-send:disabled { opacity: .4; box-shadow: none; cursor: default; transform: none; }
@media (max-width: 900px) { .cd-chat { flex-direction: column; height: auto; } .cd-chat-side { width: 100%; max-height: 260px; border-inline-end: 0; border-bottom: 1px solid var(--cd-border); } .cd-chat-stream { min-height: 360px; } }

/* Mission tabs: text and a quiet count, nothing else */
.cd-mission-tabs .mud-tabs-toolbar { padding: 6px 10px 0; }
.cd-mission-tabs .mud-tab { padding: 0 16px; min-height: 48px; font-size: .9rem; color: #4B5563; }
.cd-mission-tabs .mud-tab.mud-tab-active { color: var(--cd-red); }
.cd-mission-tabs .mud-tab .mud-badge { background: #EEF2F6 !important; color: #374151 !important; box-shadow: none; height: 20px; min-width: 20px; font-size: .72rem; font-weight: 700; padding: 0 7px; }
.cd-mission-tabs .mud-tab.mud-tab-active .mud-badge { background: var(--cd-red) !important; color: #fff !important; }
.cd-mission-tabs .mud-tab-slider { height: 3px; border-radius: 3px 3px 0 0; }

/* Modal select: the field, and the searchable dialog it opens */
.cd-mselect { cursor: pointer; display: block; flex: 1 1 180px; min-width: 160px; max-width: 100%; }
.mud-grid-item > .cd-mselect, .mud-dialog-content > .cd-mselect { flex: none; width: 100%; }
.cd-mselect .mud-input-slot, .cd-mselect input { cursor: pointer !important; }
.cd-mselect .mud-input-adornment-end .mud-icon-root { color: #6B7280; }
.cd-pick-dialog .mud-dialog-content { padding: 12px 12px 14px; }
.cd-pick-dialog .mud-dialog { border-radius: 18px; }
.cd-pick-head { display: flex; align-items: center; gap: 8px; }
.cd-pick-head .cd-geo-search { height: 46px; }
.cd-pick-close { width: 34px; height: 34px; flex: none; }
.cd-pick-meta { display: flex; align-items: center; justify-content: space-between; margin: 10px 4px 6px; font-size: .74rem; color: #6B7280; }
.cd-pick-clear { border: 0; background: #FFF1F0; color: var(--cd-red); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.cd-pick-list { max-height: 56vh; overflow: auto; display: flex; flex-direction: column; gap: 3px; padding: 2px; }
.cd-pick-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; padding: 10px 12px; border: 1px solid transparent; border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: #111827; transition: background .12s, border-color .12s; }
.cd-pick-item:hover { background: #F3F6F9; }
.cd-pick-item.sel { background: #FFF5F4; border-color: #FFD2CE; font-weight: 700; }
.cd-pick-item mark { background: #FDE68A; border-radius: 3px; padding: 0 1px; }
.cd-pick-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cd-pick-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-pick-sub { font-size: .74rem; color: #6B7280; font-weight: 400; }
.cd-pick-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.cd-pick-ic { color: var(--cd-navy); }
.cd-pick-check { color: var(--cd-red); flex: none; }
.cd-mselect { position: relative; }
.cd-mselect.has-x .mud-input-adornment-end { visibility: hidden; }
.cd-mselect-x { position: absolute; top: 50%; inset-inline-end: 10px; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; border: 0; background: #E5E9EF; color: #4B5563; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1; }
.cd-mselect-x:hover { background: var(--cd-red); color: #fff; }
.cd-mselect .mud-input-helper-text ~ .cd-mselect-x { top: 20px; transform: none; }
/* An LTR input inside the RTL layout: MudBlazor zeroes the padding on the adornment side assuming LTR, so restore equal padding. */
.mud-input-control.cd-ltr .mud-input-outlined input { padding-left: 14px; padding-right: 14px; }

/* Mission stage bar: a card per stage, tinted in its own colour when open */
.cd-mission-tabs { overflow: hidden; }
.cd-stages { display: flex; gap: 10px; padding: 12px; background: linear-gradient(180deg, #F8FAFC, #fff); border-bottom: 1px solid var(--cd-border); overflow-x: auto; scrollbar-width: none; }
.cd-stage { flex: 1 1 0; min-width: 150px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--cd-border); border-radius: 14px; background: #fff; cursor: pointer; font: inherit; text-align: start; position: relative; transition: transform .15s, box-shadow .15s, border-color .15s, background .15s; }
.cd-stage:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15,42,68,.08); border-color: color-mix(in srgb, var(--stage) 40%, #fff); }
.cd-stage.on { background: color-mix(in srgb, var(--stage) 9%, #fff); border-color: var(--stage); box-shadow: 0 10px 24px color-mix(in srgb, var(--stage) 22%, transparent); }
.cd-stage.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--stage); }
.cd-stage.empty:not(.on) { opacity: .55; }
.cd-stage-ic { width: 38px; height: 38px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--stage) 12%, #fff); color: var(--stage); transition: background .15s, color .15s; }
.cd-stage.on .cd-stage-ic { background: var(--stage); color: #fff; }
.cd-stage-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.cd-stage-n { font-size: 1.25rem; font-weight: 800; color: #111827; font-variant-numeric: tabular-nums; }
.cd-stage.on .cd-stage-n { color: var(--stage); }
.cd-stage-t { font-size: .74rem; font-weight: 600; color: #6B7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-stage.on .cd-stage-t { color: #374151; }
/* compact sizing for the stage bar */
.cd-stages { gap: 6px; padding: 8px 10px; }
.cd-stage { flex: 0 1 auto; min-width: 0; gap: 7px; padding: 5px 10px 5px 6px; border-radius: 10px; }
.cd-stage.on::after { height: 2px; left: 10px; right: 10px; }
.cd-stage-ic { width: 26px; height: 26px; border-radius: 8px; }
.cd-stage-ic .mud-icon-root { font-size: 16px; }
.cd-stage-body { flex-direction: row; align-items: baseline; gap: 6px; }
.cd-stage-n { font-size: .95rem; font-weight: 800; }
.cd-stage-t { font-size: .78rem; }
/* every stage chip carries a thin line in its colour; the open one a thick, darker one */
.cd-stage::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--stage) 45%, #fff); transition: height .15s, background .15s; }
.cd-stage.on::after { height: 4px; background: var(--stage); left: 6px; right: 6px; }
.cd-stage.on .cd-stage-t, .cd-stage.on .cd-stage-n { font-weight: 800; }
.cd-stage.empty:not(.on) { opacity: .7; }

/* Location pin: drops in, breathes a pulse ring, hops when moved */
.cd-pin-wrap { background: transparent; border: 0; }
.cd-pin { position: relative; width: 36px; height: 48px; transform-origin: 50% 100%; animation: cdPinDrop .6s cubic-bezier(.2,.9,.3,1.25); filter: drop-shadow(0 10px 10px rgba(15,42,68,.28)); }
.cd-pin.bump { animation: cdPinBump .5s cubic-bezier(.2,.9,.3,1.2); }
.cd-pin-head { position: absolute; left: 4px; top: 2px; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: linear-gradient(145deg, #F0506A, #C8102E 60%, #9E0B22); border: 2.5px solid #fff; box-sizing: border-box; }
.cd-pin-head i { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #fff; box-shadow: inset 0 1px 2px rgba(0,0,0,.2); }
.cd-pin-ring { position: absolute; left: 50%; bottom: 0; width: 26px; height: 9px; margin-left: -13px; border-radius: 50%; border: 2px solid rgba(200,16,46,.55); background: rgba(200,16,46,.12); animation: cdPinPulse 1.8s ease-out infinite; }
.cd-pin-ring.two { animation-delay: .9s; }
@keyframes cdPinDrop { 0% { transform: translateY(-70px) scale(.5); opacity: 0; } 55% { transform: translateY(5px) scale(1.06); opacity: 1; } 75% { transform: translateY(-4px) scale(.98); } 100% { transform: none; } }
@keyframes cdPinBump { 0% { transform: none; } 35% { transform: translateY(-16px) scale(1.06); } 70% { transform: translateY(2px) scale(.98); } 100% { transform: none; } }
@keyframes cdPinPulse { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
/* flat stage chips: no borders, no boxes; their coloured underlines join into one continuous line */
.cd-stages { gap: 0; padding: 6px 10px 0; background: #fff; }
.cd-stage { border: 0; border-radius: 10px 10px 0 0; background: transparent; box-shadow: none; padding: 7px 14px 9px; margin: 0; }
.cd-stage:hover { transform: none; box-shadow: none; background: #F6F8FB; }
.cd-stage.on { background: color-mix(in srgb, var(--stage) 7%, #fff); box-shadow: none; border: 0; }
.cd-stage::after { left: 0; right: 0; bottom: 0; height: 2px; border-radius: 0; background: color-mix(in srgb, var(--stage) 55%, #fff); }
.cd-stage.on::after { height: 4px; left: 0; right: 0; background: var(--stage); }
/* one black line under all stages; the selected one is thicker and in its colour */
.cd-stage::after { background: #111827; height: 2px; }
.cd-stage.on::after { background: var(--stage); height: 4px; }
.cd-stage { padding: 8px 14px 13px; }

/* Picker dialog (period filter): compact one-line header, everything fits without scrolling */
.mud-dialog.mud-picker-paper { border-radius: 18px; overflow: hidden; max-height: none; }
.mud-dialog.mud-picker-paper .mud-dialog-content { overflow: visible; max-height: none; padding: 0; }
.mud-dialog.mud-picker-paper .mud-picker-toolbar { padding: 8px 16px; min-height: 0; height: auto; display: flex; align-items: center; gap: 10px; }
.mud-dialog.mud-picker-paper .mud-picker-toolbar .mud-button-year { padding: 0 6px; min-width: 0; opacity: .85; }
.mud-dialog.mud-picker-paper .mud-picker-toolbar .mud-button-year .mud-button-label { font-size: .85rem; }
.mud-dialog.mud-picker-paper .mud-picker-toolbar .mud-button-date { padding: 0 6px; min-width: 0; }
.mud-dialog.mud-picker-paper .mud-picker-toolbar .mud-typography-h4, .mud-dialog.mud-picker-paper .mud-picker-toolbar .mud-button-date .mud-button-label { font-size: 1.05rem; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.mud-dialog.mud-picker-paper .mud-picker-datepicker-toolbar { flex-direction: row; }
.mud-dialog.mud-picker-paper .mud-picker-container { height: auto; }
.mud-dialog.mud-picker-paper .mud-picker-actions { padding: 8px 12px 12px; }
.cd-daterange-actions { gap: 6px; }
.cd-daterange-presets button { padding: 4px 9px; font-size: .74rem; }

/* One scrollbar only: the page scrolls, the side menu keeps its own scrolling invisible and stays compact */
.mud-drawer .mud-drawer-content { overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.mud-drawer .mud-drawer-content::-webkit-scrollbar { display: none; }
.mud-drawer .mud-nav-link { min-height: 36px; margin: 0 10px; }
.mud-drawer .mud-nav-link .mud-nav-link-text { font-size: .86rem; }
.mud-drawer .mud-nav-link .mud-nav-link-icon { font-size: 1.2rem; }
.cd-nav-label { padding: 8px 18px 2px; }
.mud-drawer .mud-nav-menu.pb-6 { padding-bottom: 8px !important; }

/* Top bar: frosted glass, soft buttons, status pills */
.mud-appbar.cd-appbar { background: rgba(255,255,255,.82) !important; backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid rgba(15,42,68,.08); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 8px 24px rgba(15,42,68,.06); color: #111827; }
.cd-appbar .mud-toolbar { gap: 10px; min-height: 64px; height: 64px; padding-inline: 14px 18px; }
.cd-top-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid transparent; background: #F3F6F9; color: var(--cd-navy); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s; flex: none; }
.cd-top-btn:hover { background: #fff; border-color: var(--cd-border); box-shadow: 0 6px 16px rgba(15,42,68,.10); transform: translateY(-1px); }
.cd-top-btn.cd-bell.has { color: var(--cd-red); background: #FFF1F0; }
.cd-top-btn.cd-bell.has .mud-icon-root { animation: cdBellRing 2.4s ease-in-out infinite; transform-origin: 50% 0; }
.cd-top-badge { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--cd-red); color: #fff; font-size: .66rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(200,16,46,.35); }
@keyframes cdBellRing { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 80% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 90% { transform: rotate(-4deg); } }
.cd-top-greet { flex-direction: column; line-height: 1.2; min-width: 0; }
.cd-top-hello { font-size: .9rem; color: #111827; }
.cd-top-hello b { color: var(--cd-navy); }
.cd-top-role { font-size: .72rem; color: #6B7280; }
.cd-top-pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 999px; background: #F3F6F9; border: 1px solid transparent; color: #374151; font-size: .8rem; white-space: nowrap; }
.cd-top-clock .mud-icon-root { color: var(--cd-navy); }
.cd-top-time { font-family: Consolas, 'Segoe UI', monospace; font-weight: 700; font-size: .95rem; color: var(--cd-navy); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.cd-top-date { color: #6B7280; font-size: .76rem; padding-inline-start: 8px; border-inline-start: 1px solid #D9DFE7; }
.cd-api { gap: 7px; font-weight: 600; transition: background .3s, color .3s; }
.cd-api-dot { width: 9px; height: 9px; border-radius: 50%; background: #9CA3AF; flex: none; }
.cd-api.wait .cd-api-dot { animation: cdDotBlink .8s steps(2) infinite; }
.cd-api.good { background: #ECFDF5; color: #065F46; border-color: #BBF7D0; }
.cd-api.good .cd-api-dot { background: #10B981; animation: cdDotPulse 2s ease-out infinite; }
.cd-api.slow { background: #FFFBEB; color: #92400E; border-color: #FDE68A; }
.cd-api.slow .cd-api-dot { background: #F59E0B; animation: cdDotPulseAmber 1.4s ease-out infinite; }
.cd-api.down { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.cd-api.down .cd-api-dot { background: var(--cd-red); animation: cdDotBlink 1s steps(2) infinite; }
.cd-api-ms { font-family: Consolas, monospace; font-size: .74rem; opacity: .85; padding-inline-start: 7px; border-inline-start: 1px solid currentColor; font-variant-numeric: tabular-nums; }
@keyframes cdDotPulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.55); } 100% { box-shadow: 0 0 0 9px rgba(16,185,129,0); } }
@keyframes cdDotPulseAmber { 0% { box-shadow: 0 0 0 0 rgba(245,158,11,.55); } 100% { box-shadow: 0 0 0 9px rgba(245,158,11,0); } }
@keyframes cdDotBlink { to { opacity: .25; } }
.cd-top-user { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 2px 6px 2px 2px; border-radius: 999px; border: 1px solid transparent; background: transparent; cursor: pointer; color: #6B7280; transition: all .15s; }
.cd-top-user:hover { background: #F3F6F9; border-color: var(--cd-border); }
.cd-top-avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: .95rem; background: linear-gradient(135deg, var(--cd-navy), #1E4976); background-size: cover; background-position: center; box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(200,16,46,.55); }
/* the same pill on the login card */
.cd-login-api { margin: 12px auto 0; justify-content: center; height: 34px; font-size: .78rem; }

/* KPI tiles: compact, one row, slide show */
.cd-strip-wrap { position: relative; }
.cd-strip { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding: 4px 2px 8px; }
.cd-strip::-webkit-scrollbar { display: none; }
.cd-strip > * { scroll-snap-align: start; flex: 0 0 auto; }
.cd-strip-arrow { position: absolute; top: 50%; transform: translateY(-55%); width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--cd-border); background: rgba(255,255,255,.95); color: var(--cd-navy); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 12px rgba(15,42,68,.12); z-index: 2; opacity: 0; transition: opacity .15s, transform .15s; }
.cd-strip-arrow.prev { left: -6px; }
.cd-strip-arrow.next { right: -6px; }
.cd-strip-wrap:hover .cd-strip-arrow, .cd-strip-arrow.show { opacity: 1; }
.cd-strip-arrow:hover { transform: translateY(-55%) scale(1.08); }
.cd-strip-arrow[disabled] { opacity: 0 !important; pointer-events: none; }
.cd-stat { position: relative; display: flex; align-items: center; gap: 10px; width: 200px; height: 72px; padding: 0 12px; border: 1px solid var(--cd-border); border-radius: 14px; background: #fff; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; --stat: var(--cd-navy); }
.cd-stat.cd-clickable { cursor: pointer; }
.cd-stat:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(15,42,68,.10); border-color: color-mix(in srgb, var(--stat) 35%, #fff); }
.cd-stat-ic { width: 38px; height: 38px; border-radius: 11px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--stat) 85%, #fff), var(--stat)); box-shadow: 0 6px 14px color-mix(in srgb, var(--stat) 35%, transparent); }
.cd-stat-ic .mud-icon-root { font-size: 20px; }
.cd-stat-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; z-index: 1; }
.cd-stat-label { font-size: .7rem; font-weight: 600; color: #6B7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-stat-value { font-size: 1.25rem; font-weight: 800; color: #111827; font-variant-numeric: tabular-nums; }
.cd-stat-hint { font-size: .66rem; color: #9CA3AF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.cd-stat-glow { position: absolute; inset-inline-end: -26px; top: -26px; width: 80px; height: 80px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--stat) 16%, transparent), transparent 70%); pointer-events: none; }
.cd-stat-error { --stat: #C8102E; } .cd-stat-info { --stat: #2563EB; } .cd-stat-success { --stat: #16A34A; } .cd-stat-tertiary { --stat: #0E7490; }
.cd-stat-warning { --stat: #D97706; } .cd-stat-secondary { --stat: #0F2A44; } .cd-stat-primary { --stat: #C8102E; } .cd-stat-default { --stat: #6B7280; } .cd-stat-dark { --stat: #111827; }
.mud-grid-item > .cd-stat { width: 100%; }
.cd-strip-arrow.prev { left: auto; right: auto; inset-inline-start: -6px; }
.cd-strip-arrow.next { left: auto; right: auto; inset-inline-end: -6px; }
[dir="rtl"] .cd-strip-arrow .mud-icon-root { transform: scaleX(-1); }

/* Patient record inside the incident's patients tab */
.cd-patient-panel { margin-top: 12px; border: 1px solid var(--cd-border); border-radius: 16px; padding: 12px 14px 14px; background: #FAFBFC; animation: cdFade .2s ease-out; }
.cd-patient-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.cd-patient-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.cd-patient-title .cd-muted { font-size: .78rem; }
.mud-table-row.cd-row-sel { background: #FFF5F4 !important; box-shadow: inset 3px 0 0 var(--cd-red); }
[dir="rtl"] .mud-table-row.cd-row-sel { box-shadow: inset -3px 0 0 var(--cd-red); }
.cd-patient-dialog .mud-dialog-content { padding: 14px 16px 18px; background: #FAFBFC; }
.cd-patient-dialog { border-radius: 18px; }
a.cd-person-card { text-decoration: none; color: inherit; }
a.cd-person-card:hover { border-color: var(--cd-navy); }
.cd-person-card.now { border-color: var(--cd-red); background: #FFF5F4; }
.cd-pat-actions { gap: 0; }
.cd-pat-actions .mud-icon-button { width: 30px; height: 30px; padding: 4px; }
.cd-pat-actions { gap: 4px; flex-wrap: wrap; }
.cd-pat-actions .mud-button { padding: 2px 9px; min-width: 0; font-size: .72rem; height: 26px; border-radius: 999px; }
.cd-pat-actions .mud-button .mud-button-icon-start { margin-inline-end: 4px; }
.cd-pat-actions .mud-button .mud-icon-root { font-size: 15px; }

/* Mission card: stage stepper, fact tiles, crew chips */
.cd-stepper { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-start; overflow-x: auto; scrollbar-width: none; }
.cd-stepper li { position: relative; flex: 1 1 0; min-width: 86px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; padding: 0 4px; }
.cd-stepper li::before { content: ""; position: absolute; top: 14px; inset-inline-start: 50%; width: 100%; height: 3px; background: #E5E9EF; z-index: 0; }
.cd-stepper li:last-child::before { display: none; }
.cd-stepper li.done::before { background: #16A34A; }
.cd-sdot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 800; background: #fff; border: 2px solid #D5DCE5; color: #9CA3AF; transition: all .2s; }
.cd-stepper li.done .cd-sdot { background: #16A34A; border-color: #16A34A; color: #fff; }
.cd-stepper li.now .cd-sdot { background: var(--cd-red); border-color: var(--cd-red); color: #fff; box-shadow: 0 0 0 0 rgba(200,16,46,.45); animation: cdStepPulse 1.6s ease-out infinite; }
@keyframes cdStepPulse { 0% { box-shadow: 0 0 0 0 rgba(200,16,46,.45); } 100% { box-shadow: 0 0 0 10px rgba(200,16,46,0); } }
.cd-slabel { font-size: .74rem; font-weight: 600; color: #6B7280; line-height: 1.2; }
.cd-stepper li.done .cd-slabel { color: #166534; }
.cd-stepper li.now .cd-slabel { color: var(--cd-red); font-weight: 800; }
.cd-stime { font-size: .7rem; color: #9CA3AF; font-variant-numeric: tabular-nums; }
.cd-stepper li.now .cd-stime { color: var(--cd-red); }
.cd-mfacts { display: flex; flex-wrap: wrap; gap: 8px; }
.cd-mfact { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--cd-border); border-radius: 12px; background: #FAFBFC; min-width: 120px; }
.cd-mfact.metric { flex-direction: column; align-items: flex-start; gap: 0; min-width: 96px; }
.cd-mfact-ic { width: 30px; height: 30px; border-radius: 9px; background: #E8EEF3; color: var(--cd-navy); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cd-mfact-body { display: flex; flex-direction: column; line-height: 1.2; }
.cd-mfact-l { font-size: .68rem; color: #6B7280; font-weight: 600; }
.cd-mfact-v { font-size: .9rem; font-weight: 700; color: #111827; }
.cd-mfact-s { font-size: .68rem; color: #9CA3AF; }
.cd-mcrew { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cd-crew-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 2px; border-radius: 999px; background: #F3F6F9; border: 1px solid var(--cd-border); font-size: .76rem; font-weight: 600; color: #111827; }
.cd-crew-chip small { color: #6B7280; font-weight: 500; }
.cd-crew-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--cd-navy); color: #fff; font-size: .68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cd-stepper li.click { cursor: pointer; }
.cd-stepper li.click:hover .cd-sdot { border-color: var(--cd-navy); color: var(--cd-navy); transform: scale(1.08); }
.cd-stepper li.click:hover .cd-slabel { color: var(--cd-navy); }
.cd-stepper li.click.now:hover .cd-sdot { border-color: var(--cd-red); color: #fff; }
/* each stage in its own colour */
.cd-stepper li { --step: #6B7280; }
.cd-stepper li .cd-sdot { border-color: color-mix(in srgb, var(--step) 45%, #fff); color: var(--step); background: color-mix(in srgb, var(--step) 6%, #fff); }
.cd-stepper li .cd-slabel { color: color-mix(in srgb, var(--step) 70%, #374151); }
.cd-stepper li.done::before { background: var(--step); }
.cd-stepper li.done .cd-sdot { background: var(--step); border-color: var(--step); color: #fff; }
.cd-stepper li.done .cd-slabel { color: var(--step); }
.cd-stepper li.now .cd-sdot { background: var(--step); border-color: var(--step); color: #fff; animation: cdStepPulseVar 1.6s ease-out infinite; }
.cd-stepper li.now .cd-slabel, .cd-stepper li.now .cd-stime { color: var(--step); }
.cd-stepper li.click:hover .cd-sdot { border-color: var(--step); color: var(--step); transform: scale(1.08); }
.cd-stepper li.click:hover .cd-slabel { color: var(--step); }
.cd-stepper li.click.now:hover .cd-sdot, .cd-stepper li.click.done:hover .cd-sdot { color: #fff; }
@keyframes cdStepPulseVar { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--step) 45%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

/* API status pill v2: glass capsule, live dot, latency bars */
.cd-api2 { --c: #9CA3AF; display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 12px 0 10px; border-radius: 999px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 10%, #fff), #fff 70%); border: 1px solid color-mix(in srgb, var(--c) 35%, #fff); box-shadow: inset 0 1px 0 #fff, 0 2px 8px color-mix(in srgb, var(--c) 18%, transparent); color: #111827; font-size: .78rem; font-weight: 600; white-space: nowrap; transition: all .3s; }
.cd-api2.good { --c: #10B981; }
.cd-api2.slow { --c: #F59E0B; }
.cd-api2.down { --c: #C8102E; }
.cd-api2.wait { --c: #9CA3AF; }
.cd-api2-dot { position: relative; width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cd-api2-dot span { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff, 0 0 10px color-mix(in srgb, var(--c) 70%, transparent); }
.cd-api2-dot::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--c); opacity: 0; animation: cdApiRing 2s ease-out infinite; }
.cd-api2.down .cd-api2-dot::before { animation: none; }
.cd-api2.down .cd-api2-dot span { animation: cdDotBlink .9s steps(2) infinite; }
.cd-api2.wait .cd-api2-dot span { animation: cdDotBlink .8s steps(2) infinite; }
@keyframes cdApiRing { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }
.cd-api2-text { color: color-mix(in srgb, var(--c) 70%, #111827); }
.cd-api2-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; padding: 0 2px; }
.cd-api2-bars i { display: block; width: 3px; border-radius: 2px; background: color-mix(in srgb, var(--c) 45%, #fff); min-height: 2px; transition: height .4s; }
.cd-api2-bars i:last-child { background: var(--c); }
.cd-api2-ms { font-family: Consolas, 'Segoe UI', monospace; font-weight: 700; font-size: .8rem; color: #111827; background: color-mix(in srgb, var(--c) 14%, #fff); border-radius: 8px; padding: 2px 7px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: baseline; gap: 2px; direction: ltr; }
.cd-api2-ms small { font-size: .62rem; font-weight: 600; opacity: .7; }
.cd-login-api { margin: 12px auto 0; height: 34px; }
/* compact status pill */
.cd-api2 { gap: 6px; height: 32px; padding: 0 8px 0 8px; font-size: .74rem; }
.cd-api2-bars { gap: 1.5px; height: 12px; padding: 0 1px; }
.cd-api2-bars i { width: 2.5px; }
.cd-api2-ms { font-size: .74rem; padding: 1px 6px; }
.cd-api2-dot { width: 12px; height: 12px; }
.cd-api2-dot span { width: 7px; height: 7px; }
.cd-stepper li.click:hover .cd-sdot { box-shadow: 0 0 0 4px color-mix(in srgb, var(--step) 18%, transparent); }
.cd-stepper { padding: 12px 6px 4px; margin-top: 4px !important; }

/* Section dialogs: a clear toolbar with the action, and an inviting empty state */
.cd-sec-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -4px -4px 12px; padding: 8px 10px; border-radius: 12px; background: #F3F6F9; }
.cd-sec-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--cd-navy); }
.cd-sec-bar .mud-button { border-radius: 999px; padding: 6px 16px; box-shadow: 0 6px 16px rgba(200,16,46,.25); }
.cd-sec-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 12px; border: 1.5px dashed #D5DCE5; border-radius: 14px; color: #6B7280; text-align: center; }
.cd-sec-empty .mud-icon-root { font-size: 34px; color: #B9C3D0; }
.cd-sec-empty .mud-button { border-radius: 999px; }

/* Page banner */
.cd-page-head { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; padding: 16px 20px; border-radius: 18px; color: #fff; background: linear-gradient(120deg, #0F2A44 0%, #163A5C 55%, #1E4976 100%); box-shadow: 0 12px 30px rgba(15,42,68,.22); overflow: hidden; }
.cd-page-head::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 28px 28px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%); pointer-events: none; }
.cd-page-head::after { content: ""; position: absolute; inset-inline-start: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(200,16,46,.45), transparent 70%); pointer-events: none; }
.cd-ph-main { position: relative; display: flex; align-items: center; gap: 14px; flex: 1 1 320px; min-width: 0; }
.cd-ph-ic { width: 48px; height: 48px; border-radius: 14px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.2); color: #fff; }
.cd-ph-ic .mud-icon-root { font-size: 26px; }
.cd-ph-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cd-ph-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.cd-page-head .cd-page-title { margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; color: #fff; line-height: 1.2; }
.cd-ph-badges { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cd-ph-sub { font-size: .84rem; color: rgba(255,255,255,.75); }
.cd-ph-actions { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cd-ph-actions .mud-button-outlined, .cd-ph-actions .mud-button-text { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.06); }
.cd-ph-actions .mud-button-outlined:hover, .cd-ph-actions .mud-button-text:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.7); }
.cd-ph-actions .mud-button-filled.mud-button-filled-primary { box-shadow: 0 8px 18px rgba(200,16,46,.35); }
.cd-ph-actions .mud-icon-button { color: #fff; }
.cd-ph-actions .mud-input-control .mud-input-outlined .mud-input-outlined-border { border-color: rgba(255,255,255,.4); }
.cd-ph-actions .mud-input-control { background: rgba(255,255,255,.95); border-radius: 10px; }
.cd-ph-actions .mud-switch .mud-typography { color: #fff; }
.cd-ph-actions .cd-mselect { min-width: 170px; }
@media (max-width: 700px) { .cd-page-head { padding: 14px; } .cd-page-head .cd-page-title { font-size: 1.2rem; } }
/* chips inside the dark page banner: solid, readable */
.cd-ph-badges .mud-chip { background: rgba(255,255,255,.92) !important; color: #111827 !important; border: 0 !important; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.cd-ph-badges .mud-chip.mud-chip-color-error, .cd-ph-badges .mud-chip.mud-chip-filled.mud-chip-color-error { background: #FFE1DD !important; color: #9E0B22 !important; }
.cd-ph-badges .mud-chip.mud-chip-color-warning { background: #FDE68A !important; color: #78350F !important; }
.cd-ph-badges .mud-chip.mud-chip-color-success { background: #BBF7D0 !important; color: #14532D !important; }
.cd-ph-badges .mud-chip.mud-chip-color-info { background: #BFDBFE !important; color: #1E3A8A !important; }
.cd-ph-badges .mud-chip.mud-chip-color-primary { background: #FFE1DD !important; color: #9E0B22 !important; }
.cd-ph-badges .mud-chip .mud-icon-root { color: inherit !important; }
.cd-live { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; background: rgba(16,185,129,.18); border: 1px solid rgba(16,185,129,.5); color: #D1FAE5; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.cd-live i { width: 8px; height: 8px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: cdLivePulse 1.6s ease-out infinite; }
@keyframes cdLivePulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.6); } 100% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } }
/* timeline tab: tinted panel, limited height */
.cd-tl-wrap { background: linear-gradient(180deg, #F6F8FB, #FFFFFF); border: 1px solid var(--cd-border); border-radius: 14px; padding: 14px 16px 6px; max-height: 420px; overflow-y: auto; scrollbar-width: thin; }

/* Mission action toolbar */
.cd-mactions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-radius: 12px; background: #F3F6F9; }
.cd-mactions-gap { flex: 1; }
.cd-mactions .mud-button { border-radius: 999px; background: #fff; border-color: #D5DCE5; color: var(--cd-navy); font-weight: 600; padding: 4px 12px; min-width: 0; transition: all .15s; }
.cd-mactions .mud-button:hover { border-color: var(--cd-navy); box-shadow: 0 4px 12px rgba(15,42,68,.12); transform: translateY(-1px); }
.cd-mactions .mud-button .mud-button-icon-start { margin-inline-end: 6px; }
.cd-mactions .mud-button .mud-icon-root { font-size: 17px; color: var(--cd-red); }
.cd-mactions .mud-button.cd-mcancel { color: var(--cd-red); border-color: #FFD2CE; background: #FFF5F4; }
.cd-mactions .mud-button.cd-mcancel:hover { background: var(--cd-red); color: #fff; border-color: var(--cd-red); }
.cd-mactions .mud-button.cd-mcancel:hover .mud-icon-root { color: #fff; }
.cd-mactions { background: #fff; border: 1px solid var(--cd-border); }
.cd-mactions .mud-button { background: #F8FAFC; }
.cd-mactions .mud-button:hover { background: #fff; }

/* Patients tab: one card per patient with a uniform action bar */
.cd-pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.cd-pcard { border: 1px solid var(--cd-border); border-radius: 16px; background: #fff; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s; }
.cd-pcard:hover { box-shadow: 0 8px 22px rgba(15,42,68,.08); }
.cd-pcard-head { display: flex; align-items: center; gap: 10px; }
.cd-pcard-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.cd-pcard-title .cd-muted { font-size: .76rem; }
.cd-pcard-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .82rem; color: #111827; }
.cd-pcard-facts i { font-style: normal; color: #6B7280; margin-inline-end: 6px; font-size: .74rem; }
.cd-pcard-actions { padding: 6px; gap: 4px; }
.cd-pcard-actions .mud-button { padding: 3px 10px; font-size: .74rem; height: 28px; }
@media (max-width: 900px) { .cd-pcards { grid-template-columns: 1fr; } }

/* Patient card v2: triage edge, fact tiles, action tiles */
.cd-pcard { --tri: #9CA3AF; position: relative; padding: 14px 16px 14px; border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, #fff, #FBFCFD); }
.cd-pcard::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: var(--tri); }
.cd-pcard-avatar { width: 44px; height: 44px; border-radius: 14px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1.05rem; background: linear-gradient(145deg, color-mix(in srgb, var(--tri) 80%, #fff), var(--tri)); box-shadow: 0 6px 14px color-mix(in srgb, var(--tri) 35%, transparent); }
.cd-pfacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cd-pfact { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; background: #F3F6F9; min-width: 0; }
.cd-pfact span { font-size: .68rem; color: #6B7280; font-weight: 600; }
.cd-pfact b { font-size: .84rem; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-pacts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.cd-pact { --pc: var(--cd-navy); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 14px; border: 1px solid transparent; background: #F6F8FB; cursor: pointer; font: inherit; color: #374151; transition: all .15s; min-width: 0; }
.cd-pact .mud-icon-root { font-size: 22px; color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, #fff); border-radius: 10px; padding: 6px; box-sizing: content-box; transition: all .15s; }
.cd-pact span { font-size: .7rem; font-weight: 700; line-height: 1.15; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cd-pact:hover { background: #fff; border-color: color-mix(in srgb, var(--pc) 45%, #fff); box-shadow: 0 8px 18px color-mix(in srgb, var(--pc) 18%, transparent); transform: translateY(-2px); color: var(--pc); }
.cd-pact:hover .mud-icon-root { background: var(--pc); color: #fff; }
@media (max-width: 1100px) { .cd-pacts { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .cd-pfacts { grid-template-columns: 1fr; } }
.cd-pacts-title { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; color: #6B7280; margin: 2px 2px -4px; }
/* patient actions as solid buttons */
.cd-pact { flex-direction: row; justify-content: center; gap: 8px; padding: 0 10px; height: 40px; border-radius: 10px; border: 0; background: var(--pc); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--pc) 35%, transparent); }
.cd-pact .mud-icon-root { font-size: 18px; color: #fff; background: rgba(255,255,255,.18); padding: 4px; border-radius: 8px; }
.cd-pact span { font-size: .78rem; font-weight: 700; color: #fff; }
.cd-pact:hover { background: color-mix(in srgb, var(--pc) 85%, #000); border: 0; color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--pc) 45%, transparent); transform: translateY(-1px); }
.cd-pact:hover .mud-icon-root { background: rgba(255,255,255,.3); color: #fff; }
.cd-pact:active { transform: translateY(0); box-shadow: none; }
.cd-pacts { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cd-pacts-title { display: none; }
/* patient actions as explanatory rows */
.cd-pacts { grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cd-pact { flex-direction: row; justify-content: flex-start; gap: 10px; height: auto; padding: 8px 10px; border-radius: 12px; background: #fff; border: 1.5px solid #D5DCE5; color: #111827; box-shadow: none; text-align: start; }
.cd-pact .mud-icon-root { font-size: 20px; color: #fff; background: var(--pc); padding: 7px; border-radius: 10px; flex: none; }
.cd-pact-t { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.cd-pact-t b { font-size: .82rem; color: #111827; }
.cd-pact-t small { font-size: .68rem; color: #6B7280; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-pact .cd-pact-go { background: transparent; color: #9CA3AF; padding: 0; font-size: 20px; }
[dir="ltr"] .cd-pact .cd-pact-go { transform: scaleX(-1); }
.cd-pact:hover { background: color-mix(in srgb, var(--pc) 6%, #fff); border-color: var(--pc); box-shadow: 0 6px 16px color-mix(in srgb, var(--pc) 18%, transparent); transform: none; color: #111827; }
.cd-pact:hover .cd-pact-go { color: var(--pc); }
@media (max-width: 600px) { .cd-pacts { grid-template-columns: 1fr; } }
.cd-pname { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--cd-navy); text-decoration: none; }
.cd-pname b { font-size: .98rem; border-bottom: 1.5px dashed rgba(15,42,68,.35); }
.cd-pname .mud-icon-root { color: #9CA3AF; }
.cd-pname:hover b { color: var(--cd-red); border-bottom-color: var(--cd-red); }
.cd-pname:hover .mud-icon-root { color: var(--cd-red); }
.cd-pname { gap: 10px; flex-wrap: wrap; }
.cd-pname b { color: #1D4ED8; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; border-bottom: 0; }
.cd-pname-hint { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; color: #1D4ED8; background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 999px; padding: 2px 9px; }
.cd-pname-hint .mud-icon-root { color: #1D4ED8; }
.cd-pname:hover b, .cd-pname:hover .cd-pname-hint { color: var(--cd-red); }
.cd-pname:hover .cd-pname-hint { background: #FFF1F0; border-color: #FFD2CE; }
.cd-pname:hover .cd-pname-hint .mud-icon-root { color: var(--cd-red); }
.cd-sec-bar .mud-button:disabled, .cd-sec-bar .mud-button.mud-disabled { box-shadow: none; }
.cd-done-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: #DCFCE7; color: #166534; font-weight: 700; font-size: .82rem; border: 1px solid #BBF7D0; }
.cd-chipbtn { display: inline-flex; align-items: center; gap: 2px; border: 0; background: transparent; padding: 0; cursor: pointer; border-radius: 999px; }
.cd-chipbtn .mud-icon-root { font-size: 13px; color: #9CA3AF; opacity: 0; transition: opacity .15s; margin-inline-start: -2px; }
.cd-chipbtn:hover .mud-icon-root { opacity: 1; color: var(--cd-navy); }
.cd-chipbtn:hover .mud-chip { box-shadow: 0 0 0 2px rgba(15,42,68,.15); }
.cd-tab-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border-radius: 14px; background: #F3F6F9; }
.cd-tab-bar-title { display: flex; align-items: center; gap: 10px; }
.cd-tab-bar-title > div { display: flex; flex-direction: column; line-height: 1.2; }
.cd-tab-bar-title b { font-size: .95rem; color: var(--cd-navy); }
.cd-tab-bar-title span { font-size: .74rem; color: #6B7280; }
.cd-tab-bar-ic { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--cd-red); border: 1px solid var(--cd-border); }
.cd-tab-bar-btn { border-radius: 999px; padding: 8px 18px; box-shadow: 0 8px 18px rgba(200,16,46,.3); }
/* New call: pinned register button */
.cd-fixed-submit { position: fixed; left: 24px; bottom: 24px; z-index: 1200; }
.cd-fixed-submit .mud-button { border-radius: 999px; padding: 12px 28px; font-size: 1rem; box-shadow: 0 14px 34px rgba(200,16,46,.4); }
.cd-fixed-submit .mud-button:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(200,16,46,.45); }
@media (max-width: 700px) { .cd-fixed-submit { left: 12px; right: 12px; bottom: 12px; } .cd-fixed-submit .mud-button { width: 100%; } }
.cd-page-head::after { display: none; }
.cd-empty-big { padding: 36px 16px; gap: 8px; background: #FAFBFC; }
.cd-empty-big .mud-icon-root { font-size: 48px; }
.cd-empty-big b { font-size: 1rem; color: #111827; }
.cd-empty-big > span { max-width: 460px; font-size: .82rem; }
.cd-empty-big .mud-button { margin-top: 8px; }
.cd-ph-actions .mud-switch { margin: 0; padding: 2px 12px 2px 4px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); }
.cd-ph-actions .mud-switch .mud-typography, .cd-ph-actions .mud-switch .mud-switch-label-small { color: #fff !important; font-weight: 700; font-size: .84rem; }
.cd-ph-actions .mud-switch .mud-switch-track { background-color: rgba(255,255,255,.45); }
.cd-ph-actions .mud-switch .mud-switch-thumb { box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.cd-empty-big .mud-icon-root { font-size: inherit; }
.cd-empty-big > .mud-icon-root { font-size: 48px; }
.cd-empty-big .mud-button .mud-icon-root { font-size: 20px; }
.cd-empty-big .mud-button { padding: 8px 22px; font-size: .95rem; }

/* Filter dialog */
.cd-filter-btn { border-radius: 999px; }
.cd-filter-count { margin-inline-start: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--cd-red); color: #fff; font-size: .7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.cd-filter-dialog .mud-dialog-content { padding-top: 6px; }
.cd-filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cd-filter-grid > * { min-width: 0; }
.cd-filter-grid .cd-daterange, .cd-filter-grid .mud-picker { grid-column: 1 / -1; width: 100% !important; max-width: none; }
@media (max-width: 600px) { .cd-filter-grid { grid-template-columns: 1fr; } }
.cd-flow-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: 14px; background: #ECFDF5; border: 1px solid #BBF7D0; color: #166534; font-weight: 600; }

/* reports filter bar */
.cd-rep-bar { position: sticky; top: 0; z-index: 3; background: #fff; }
.cd-rep-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #475569; font-size: .85rem; }
.cd-rep-shown { font-size: .8rem; color: #64748b; background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 999px; padding: 4px 12px; direction: ltr; }
.cd-seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: #f1f5f9; }
.cd-seg-btn { border: 0; background: transparent; cursor: pointer; padding: 7px 14px; border-radius: 9px; font: inherit; font-size: .83rem; font-weight: 600; color: #475569; transition: all .15s; white-space: nowrap; }
.cd-seg-btn:hover { color: var(--cd-navy); }
.cd-seg-btn.on { background: #fff; color: var(--cd-navy); font-weight: 800; box-shadow: 0 1px 4px rgba(15,42,68,.14); }
@media print { .cd-rep-bar { display: none; } }

/* ── chat (internal messenger) ── */
.cd-nav-row { display: inline-flex; align-items: center; gap: 8px; }
.cd-nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--cd-red); color: #fff; font-size: .7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.cd-ch .cd-chat-side { width: 340px; }
.cd-ch-x { border: 0; background: transparent; color: #9CA3AF; cursor: pointer; display: inline-flex; padding: 4px; border-radius: 50%; }
.cd-ch-x:hover { background: #F0F3F7; color: var(--cd-navy); }
.cd-ch-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 10px; }
.cd-ch-tabs.wide { padding: 0 0 12px; }
.cd-ch-tabs button { flex: none; display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; background: transparent; color: #64748B; border-radius: 999px; padding: 4px 9px; font: inherit; font-size: .76rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .15s; }
.cd-ch-tabs button b { background: #E2E8F0; color: #334155; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; font-size: .68rem; display: inline-flex; align-items: center; justify-content: center; }
.cd-ch-tabs button:hover { background: #F0F3F7; color: var(--cd-navy); }
.cd-ch-tabs button.on { background: var(--cd-navy); color: #fff; border-color: var(--cd-navy); }
.cd-ch-tabs button.on b { background: var(--cd-red); color: #fff; }
.cd-ch-av { position: relative; width: 44px; height: 44px; border-radius: 14px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--cd-navy); color: #fff; font-weight: 800; font-size: 1rem; background-size: cover; background-position: center; }
.cd-ch-av.grp { background: linear-gradient(135deg, #0F2A44, #2563EB); }
.cd-ch-av.sm { width: 36px; height: 36px; border-radius: 11px; font-size: .85rem; }
.cd-ch-av.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.6rem; }
.cd-ch-on { position: absolute; inset-inline-end: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: #22C55E; border: 2px solid #fff; }
.cd-ch-item { position: relative; align-items: center; }
.cd-ch-item.unread .cd-thread-title { color: #0B1F33; }
.cd-ch-item.unread .cd-thread-last { color: #1F2937; font-weight: 600; }
.cd-ch-star { font-size: 14px !important; color: #F59E0B; vertical-align: -2px; }
.cd-ch-item-menu { position: absolute; inset-inline-end: 6px; top: 6px; opacity: 0; transition: opacity .12s; }
.cd-ch-item:hover .cd-ch-item-menu, .cd-ch-item.on .cd-ch-item-menu { opacity: 1; }
.cd-ch-item:hover .cd-thread-time { visibility: hidden; }
.cd-ch-side-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 16px; color: #9CA3AF; text-align: center; font-size: .85rem; }
.cd-ch-hero { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px; color: #475569; max-width: 420px; }
.cd-ch-hero-ic { width: 92px; height: 92px; border-radius: 28px; background: linear-gradient(135deg, #EEF2F7, #fff); border: 1px solid var(--cd-border); display: inline-flex; align-items: center; justify-content: center; color: var(--cd-navy); box-shadow: 0 12px 30px rgba(15,42,68,.10); margin-bottom: 6px; }
.cd-ch-hero-ic .mud-icon-root { font-size: 44px; }
.cd-ch-hero h3 { margin: 0; color: #0B1F33; font-size: 1.25rem; }
.cd-ch-hero p { margin: 0 0 8px; font-size: .9rem; }
.cd-ch-head .cd-ch-av { width: 40px; height: 40px; border-radius: 12px; font-size: .9rem; }
.cd-ch-hacts { display: flex; align-items: center; gap: 2px; }
.cd-ch-online { color: #16A34A; font-weight: 600; }
.cd-ch-sbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--cd-border); background: #FFFBEB; color: #92400E; }
.cd-ch-sbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: #111827; }
.cd-ch-hits { display: flex; flex-direction: column; border-bottom: 1px solid var(--cd-border); max-height: 220px; overflow: auto; background: #fff; }
.cd-ch-hits button { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: start; border: 0; border-bottom: 1px solid #F1F5F9; background: transparent; padding: 8px 14px; font: inherit; font-size: .8rem; cursor: pointer; }
.cd-ch-hits button:hover { background: #F8FAFC; }
.cd-ch-hits button span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #475569; }
.cd-ch-hits button small { color: #9CA3AF; }
.cd-ch-stream { scroll-behavior: smooth; overflow-x: hidden; }
.cd-ch-older { display: flex; justify-content: center; margin-bottom: 6px; }
.cd-ch-sys { display: flex; justify-content: center; margin: 8px 0; }
.cd-ch-sys span { background: rgba(15,42,68,.08); color: #475569; border-radius: 999px; padding: 3px 12px; font-size: .74rem; font-weight: 600; }
.cd-ch-bubble { max-width: 520px; }
.cd-ch-bubble.img { padding: 4px 4px 6px; }
.cd-ch-bubble.img .cd-bubble-meta { padding: 0 8px; }
.cd-ch-bubble.img .cd-bubble-body { padding: 4px 8px 0; }
.cd-ch-bubble .cd-bubble-body { white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.cd-ch-bubble .cd-bubble-body a { color: #2563EB; text-decoration: underline; }
.cd-bubble-row.me .cd-ch-bubble .cd-bubble-body a { color: #93C5FD; }
.cd-ch-bubble mark { background: #FDE68A; border-radius: 3px; padding: 0 2px; color: #111; }
.cd-ch-fwd { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-style: italic; opacity: .75; margin-bottom: 2px; }
.cd-ch-quote { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: start; border: 0; border-inline-start: 3px solid var(--cd-red); background: rgba(15,42,68,.06); border-radius: 8px; padding: 5px 10px; margin-bottom: 6px; font: inherit; cursor: pointer; }
.cd-bubble-row.me .cd-ch-quote { background: rgba(255,255,255,.14); border-inline-start-color: #FCA5A5; color: #fff; }
.cd-ch-quote b { font-size: .72rem; color: var(--cd-red); }
.cd-bubble-row.me .cd-ch-quote b { color: #FCA5A5; }
.cd-ch-quote span { font-size: .76rem; opacity: .8; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.cd-ch-deleted { display: inline-flex; align-items: center; gap: 6px; font-style: italic; opacity: .7; font-size: .85rem; }
.cd-ch-img { display: block; border-radius: 12px; overflow: hidden; max-width: 360px; }
.cd-ch-img img { display: block; max-width: 100%; max-height: 320px; object-fit: cover; }
.cd-ch-file, .cd-ch-loc { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; background: rgba(15,42,68,.05); border-radius: 12px; padding: 8px 10px; min-width: 220px; }
.cd-bubble-row.me .cd-ch-file, .cd-bubble-row.me .cd-ch-loc { background: rgba(255,255,255,.12); }
.cd-ch-file-ic { width: 40px; height: 40px; border-radius: 10px; background: #fff; color: var(--cd-navy); display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 1px 3px rgba(15,42,68,.12); }
.cd-ch-loc-map { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #DCFCE7, #BBF7D0); color: #15803D; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cd-ch-file-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cd-ch-file-t b { font-size: .84rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cd-ch-file-t small { font-size: .7rem; opacity: .75; }
.cd-ch-edited { font-style: italic; opacity: .75; }
.cd-ch-macts { position: absolute; top: 50%; transform: translateY(-50%); opacity: 0; transition: opacity .12s; }
.cd-bubble-row.me .cd-ch-macts { inset-inline-end: calc(100% + 6px); }
.cd-bubble-row.them .cd-ch-macts { inset-inline-start: calc(100% + 6px); }
.cd-ch-macts .mud-icon-button { width: 28px; height: 28px; padding: 0; background: #fff; color: var(--cd-navy); box-shadow: 0 2px 6px rgba(15,42,68,.18); border: 1px solid var(--cd-border); }
.cd-bubble-row:hover .cd-ch-macts { opacity: 1; }
.cd-ch-flash .cd-bubble, .cd-ch-flash span { animation: cdChFlash 1.5s ease; }
@keyframes cdChFlash { 0%, 40% { box-shadow: 0 0 0 4px rgba(245,158,11,.55); } 100% { box-shadow: none; } }
.cd-ch-compose { background: #fff; border-top: 1px solid var(--cd-border); }
.cd-ch-compose .cd-chat-compose { border-top: 0; }
.cd-ch-cbar { display: flex; align-items: center; gap: 10px; padding: 8px 14px 0; }
.cd-ch-cbar > div { flex: 1; min-width: 0; display: flex; flex-direction: column; border-inline-start: 3px solid var(--cd-red); padding-inline-start: 10px; }
.cd-ch-cbar b { font-size: .78rem; color: var(--cd-red); }
.cd-ch-cbar span { font-size: .8rem; color: #475569; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cd-ch-upload .mud-input-control { margin: 0; }
.cd-ch-dialog .mud-dialog-content { padding-top: 4px; }
.cd-ch-pick-label { font-size: .72rem; font-weight: 700; color: #64748B; text-transform: uppercase; letter-spacing: .06em; margin: 6px 0; }
.cd-ch-pick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cd-ch-pick-chips button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--cd-border); background: #fff; color: #334155; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.cd-ch-pick-chips button.on { background: var(--cd-navy); color: #fff; border-color: var(--cd-navy); }
.cd-ch-people { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow: auto; }
.cd-ch-person { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid transparent; background: transparent; border-radius: 12px; padding: 8px 10px; font: inherit; text-align: start; cursor: pointer; transition: background .12s; }
.cd-ch-person:hover { background: #F0F3F7; }
.cd-ch-person.on { background: #EFF6FF; border-color: #BFDBFE; }
.cd-ch-person.static { cursor: default; }
.cd-ch-person.static:hover { background: #F8FAFC; }
.cd-ch-person-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cd-ch-person-t b { font-size: .88rem; color: #0B1F33; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cd-ch-person-t small { font-size: .72rem; color: #64748B; }
.cd-ch-go { color: #9CA3AF; }
.cd-ch-tag { background: #FEF3C7; color: #92400E; border-radius: 999px; padding: 1px 8px; font-size: .66rem; font-weight: 700; margin-inline-start: 6px; vertical-align: 1px; }
.cd-ch-info-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cd-ch-info-head .mud-input-control { flex: 1; }
.cd-ch-readers-sum { display: flex; gap: 14px; font-size: .8rem; font-weight: 600; color: #64748B; margin-bottom: 10px; }
.cd-ch-readers-sum .ok { color: #16A34A; }
.cd-ch-readers-sum span { display: inline-flex; align-items: center; gap: 4px; }
.cd-ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.cd-ch-grid a { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #F1F5F9; }
.cd-ch-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.cd-ch-grid a:hover img { transform: scale(1.04); }
@media (max-width: 900px) { .cd-ch .cd-chat-side { width: 100%; } .cd-ch.cd-chat { flex-direction: column; height: auto; } .cd-ch .cd-chat-main { min-height: 60vh; } }

/* ── chat: photos, voice notes, calls ── */
.cd-ch-me { position: relative; border: 0; background: transparent; padding: 0; cursor: pointer; display: inline-flex; }
.cd-ch-me .cd-ch-av { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(255,255,255,.35); }
.cd-ch-me-ic { position: absolute; inset-inline-end: -4px; bottom: -4px; width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--cd-red); color: #fff; font-size: 12px !important; box-sizing: border-box; }
.cd-ch-av-btn { border: 0; cursor: pointer; font: inherit; }
.cd-ch-av-cam { position: absolute; inset-inline-end: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--cd-navy); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(15,42,68,.25); }
.cd-ch-photo { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0; text-align: center; }
.cd-ch-photo .cd-ch-av.lg { width: 112px; height: 112px; border-radius: 32px; font-size: 2.4rem; }
.cd-ch-callbtn { color: #16A34A !important; }
.cd-ch-voice { display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 4px 2px; cursor: pointer; user-select: none; }
.cd-vo-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--cd-red); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 4px 10px rgba(200,16,46,.3); }
.cd-bubble-row.me .cd-vo-btn { background: #fff; color: var(--cd-navy); box-shadow: none; }
.cd-vo-btn .pa { display: none; } .cd-ch-voice.playing .pa { display: inline-block; } .cd-ch-voice.playing .pl { display: none; }
.cd-vo-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cd-vo-bar { position: relative; height: 6px; border-radius: 999px; background: rgba(15,42,68,.15); overflow: hidden; }
.cd-bubble-row.me .cd-vo-bar { background: rgba(255,255,255,.25); }
.cd-vo-bar i { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 0; background: var(--cd-red); border-radius: 999px; transition: width .2s linear; }
.cd-bubble-row.me .cd-vo-bar i { background: #fff; }
.cd-vo-time { font-size: .72rem; opacity: .8; font-variant-numeric: tabular-nums; }
.cd-vo-ic { opacity: .5; font-size: 18px !important; }
.cd-compose-send.mic { background: var(--cd-navy); box-shadow: 0 6px 16px rgba(15,42,68,.3); }
.cd-ch-rec { background: #FFF1F2; }
.cd-ch-rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--cd-red); animation: cdRecPulse 1s ease-in-out infinite; }
.cd-ch-rec-time { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--cd-red); min-width: 44px; }
@keyframes cdRecPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.cd-ch-call { display: flex; align-items: center; gap: 10px; background: rgba(15,42,68,.05); border-radius: 12px; padding: 8px 10px; min-width: 220px; }
.cd-bubble-row.me .cd-ch-call { background: rgba(255,255,255,.12); }
.cd-ch-call-ic { width: 40px; height: 40px; border-radius: 10px; background: #DCFCE7; color: #15803D; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cd-ch-call.missed .cd-ch-call-ic, .cd-ch-call.declined .cd-ch-call-ic, .cd-ch-call.failed .cd-ch-call-ic { background: #FEE2E2; color: #B91C1C; }
.cd-ch-callback { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #16A34A; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
/* call screen */
.cd-call { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; background: radial-gradient(120% 70% at 50% 0%, #1E3A5F 0%, #0F2A44 55%, #071423 100%); color: #fff; animation: cdCallIn .25s ease-out; }
.cd-call.rv { background: transparent; pointer-events: none; }
.cd-call.rv .cd-call-card { pointer-events: auto; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0) 30%, rgba(0,0,0,0) 65%, rgba(0,0,0,.7)); }
.cd-call-card { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; }
.cd-call-kind { position: absolute; top: 26px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: rgba(255,255,255,.75); }
.cd-call-av { position: relative; width: 128px; height: 128px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; font-weight: 800; background: linear-gradient(135deg, var(--cd-red), #7f0a1d); box-shadow: 0 14px 40px rgba(0,0,0,.45); background-size: cover; background-position: center; }
.cd-call-av i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); opacity: 0; }
.cd-call.outgoing .cd-call-av i, .cd-call.incoming .cd-call-av i, .cd-call.connecting .cd-call-av i { animation: cdCallRing 2s ease-out infinite; }
.cd-call-av i + i { animation-delay: .7s !important; }
.cd-call.incoming .cd-call-av { animation: cdCallShake 1.4s ease-in-out infinite; }
.cd-call.rv .cd-call-av { display: none; }
.cd-call-name { font-size: 1.5rem; font-weight: 800; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.cd-call-status { font-size: 1rem; color: rgba(255,255,255,.85); min-height: 1.4em; font-variant-numeric: tabular-nums; }
.cd-call.rv .cd-call-name, .cd-call.rv .cd-call-status { position: absolute; top: 56px; }
.cd-call.rv .cd-call-status { top: 90px; font-size: .85rem; }
.cd-call-bar { position: absolute; bottom: 40px; display: flex; gap: 26px; align-items: flex-start; }
.cd-call.incoming .cd-call-bar { gap: 70px; }
.cd-call-b { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: #fff; font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; padding: 0; }
.cd-call-b span { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.16); transition: transform .15s, background .2s; }
.cd-call-b span .mud-icon-root { font-size: 28px; }
.cd-call-b:active span { transform: scale(.92); }
.cd-call-b.on span { background: #fff; color: var(--cd-navy); }
.cd-call-b.red span { background: #E53935; width: 68px; height: 68px; }
.cd-call-b.green span { background: #1E9E5A; width: 68px; height: 68px; animation: cdCallPulse 1.4s ease-in-out infinite; }
.cd-call.ended .cd-call-bar { visibility: hidden; }
#cd-call-media { display: none; }
#cd-call-media.on.rv-on { display: block; position: fixed; inset: 0; z-index: 2990; background: #000; }
#cd-call-media .rv { width: 100%; height: 100%; object-fit: cover; }
#cd-call-media .lv { display: none; position: fixed; inset-inline-start: 16px; bottom: 150px; width: 120px; height: 160px; object-fit: cover; border-radius: 16px; border: 2px solid rgba(255,255,255,.4); background: #111; transform: scaleX(-1); z-index: 3001; }
#cd-call-media.on.lv-on .lv { display: block; }
@keyframes cdCallIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
@keyframes cdCallRing { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.75); opacity: 0; } }
@keyframes cdCallPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(30,158,90,.55); } 50% { box-shadow: 0 0 0 14px rgba(30,158,90,0); } }
@keyframes cdCallShake { 0%, 60%, 100% { transform: rotate(0); } 66% { transform: rotate(-6deg); } 72% { transform: rotate(6deg); } 78% { transform: rotate(-4deg); } 84% { transform: rotate(3deg); } }

/* ── reports dropdown in the page banner ── */
.cd-rmenu-btn { border-radius: 999px !important; font-weight: 700 !important; }
.cd-rmenu-pop { border-radius: 16px !important; padding: 6px !important; min-width: 320px; box-shadow: 0 18px 44px rgba(15,42,68,.22) !important; border: 1px solid var(--cd-border); }
.cd-rmenu-pop .mud-list { padding: 0; }
.cd-rmenu-head { padding: 8px 12px 6px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #64748B; }
.cd-rmenu-item { border-radius: 12px !important; padding: 8px 10px !important; }
.cd-rmenu-item.on { background: #F1F5F9; }
.cd-rmenu-row { display: flex; align-items: center; gap: 12px; width: 100%; }
.cd-rmenu-ic { width: 40px; height: 40px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--c); box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 30%, transparent); }
.cd-rmenu-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cd-rmenu-t b { font-size: .9rem; color: #0B1F33; }
.cd-rmenu-t small { font-size: .74rem; color: #64748B; }
.cd-rmenu-go { color: #94A3B8; font-size: 18px !important; }

/* ── chat layout: the messenger's own full-window shell ── */
.cd-chl { height: 100vh; display: flex; flex-direction: column; overflow: hidden;
    background-color: #EEF2F7;
    background-image:
        radial-gradient(900px 520px at 88% -8%, rgba(15,42,68,.16), transparent 60%),
        radial-gradient(760px 520px at -6% 34%, rgba(200,16,46,.09), transparent 58%),
        radial-gradient(700px 480px at 55% 118%, rgba(37,99,235,.10), transparent 60%),
        linear-gradient(rgba(15,42,68,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,42,68,.045) 1px, transparent 1px);
    background-size: auto, auto, auto, 34px 34px, 34px 34px; }
.cd-chl-top { flex: none; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 18px; background: rgba(255,255,255,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--cd-border); }
.cd-chl-back { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--cd-navy); color: #fff; font-weight: 700; font-size: .84rem; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.cd-chl-back:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,42,68,.25); }
.cd-chl-back .mud-icon-root { font-size: 18px; }
.cd-chl-brand { display: flex; align-items: center; gap: 10px; margin-inline-start: 6px; }
.cd-chl-brand > div { display: flex; flex-direction: column; line-height: 1.2; }
.cd-chl-brand b { font-size: 1.05rem; color: #0B1F33; }
.cd-chl-brand small { font-size: .72rem; color: #64748B; }
.cd-chl-logo { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, var(--cd-red), #8F0B21); box-shadow: 0 8px 18px rgba(200,16,46,.28); }
.cd-chl-me { flex-direction: column; align-items: flex-start; line-height: 1.15; margin-inline: 8px 2px; }
.cd-chl-me b { font-size: .8rem; color: #0B1F33; }
.cd-chl-me small { font-size: .68rem; color: #64748B; }
.cd-chl-body { flex: 1; min-height: 0; padding: 16px; display: flex; justify-content: center; }
.cd-chl-body > .cd-chat { width: 100%; max-width: 1500px; height: 100%; min-height: 0; box-shadow: 0 24px 60px rgba(15,42,68,.14); border: 1px solid rgba(15,42,68,.08) !important; }
.cd-ch-side-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 4px; }
.cd-ch-side-head b { font-size: 1.05rem; color: #0B1F33; }
.cd-ch-side-head .cd-ch-me .cd-ch-av { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(15,42,68,.18); }
.cd-ch-new { width: 38px; height: 38px; border-radius: 12px; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: #E8EEF3; color: var(--cd-navy); transition: all .15s; }
.cd-ch-new:hover { background: var(--cd-navy); color: #fff; transform: translateY(-1px); }
.cd-ch-new.red { background: var(--cd-red); color: #fff; box-shadow: 0 6px 14px rgba(200,16,46,.28); }
.cd-ch-new .mud-icon-root { font-size: 20px; }
@media (max-width: 900px) { .cd-chl { height: auto; min-height: 100vh; overflow: visible; } .cd-chl-body { padding: 8px; } .cd-chl-body > .cd-chat { height: auto; } }

/* ── settings page: language ── */
.cd-set-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cd-set-head > div { display: flex; flex-direction: column; }
.cd-set-head b { font-size: 1rem; color: #0B1F33; }
.cd-set-head small { font-size: .78rem; color: #64748B; }
.cd-set-ic { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #E8EEF3; color: var(--cd-navy); flex: none; }
.cd-set-langs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cd-set-lang { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--cd-border); background: #fff; cursor: pointer; font: inherit; text-align: start; transition: all .15s; }
.cd-set-lang:hover { border-color: var(--cd-navy); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,42,68,.08); }
.cd-set-lang.on { border-color: var(--cd-navy); background: #F1F5F9; box-shadow: 0 0 0 3px rgba(15,42,68,.08); }
.cd-set-flag { width: 44px; height: 44px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--cd-navy); color: #fff; font-weight: 800; font-size: .9rem; letter-spacing: .04em; font-family: Consolas, monospace; }
.cd-set-lang:not(.on) .cd-set-flag { background: #E8EEF3; color: var(--cd-navy); }
.cd-set-lang-t { flex: 1; display: flex; flex-direction: column; }
.cd-set-lang-t b { font-size: .95rem; color: #0B1F33; }
.cd-set-lang-t small { font-size: .72rem; color: #64748B; }
.cd-set-check { color: #CBD5E1; }
.cd-set-lang.on .cd-set-check { color: #16A34A; }

/* narrower connection pill: dot, state, round trip */
.cd-api2 { gap: 5px; height: 30px; padding: 0 9px 0 7px; font-size: .72rem; }
.cd-api2-ms { background: transparent; padding: 0; font-size: .7rem; font-weight: 600; color: #6B7280; }
.cd-api2-ms small { font-size: .6rem; }

/* banner switches: the white field background is for text inputs only, never for toggles */
.cd-ph-actions .mud-input-control.mud-input-control-boolean-input { background: transparent; border-radius: 999px; width: auto; flex: none; }
.cd-ph-actions .mud-switch { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); padding: 2px 14px 2px 6px; }
.cd-ph-actions .mud-switch:has(.mud-checked) { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); }
.cd-ph-actions .mud-switch .mud-switch-base:not(.mud-checked) + .mud-switch-track { background-color: rgba(255,255,255,.35); opacity: 1; }
.cd-ph-actions .mud-switch .mud-checked + .mud-switch-track { background-color: #FCA5A5; opacity: 1; }

/* directional icons (send arrow) point with the writing direction */
[dir="rtl"] .cd-flip-rtl { transform: scaleX(-1); }
/* banner toggles: MudBlazor repeats the "mud-switch" class on the label text, so the pill belongs to the label element only */
.cd-ph-actions p.mud-switch, .cd-ph-actions .mud-typography.mud-switch { background: transparent !important; border: 0 !important; padding: 0 !important; margin: 0; }

/* ── chat: attach menu, upload card, map picker, camera (after the NCC chat) ── */
.cd-ch-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.cd-ch-attach { position: relative; flex: none; }
.cd-ch-attach-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: #64748B; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s; }
.cd-ch-attach-btn:hover, .cd-ch-attach-btn.on { background: #E8EEF3; color: var(--cd-navy); }
.cd-ch-attach-btn.on .mud-icon-root { transform: rotate(45deg); transition: transform .2s; }
.cd-ch-attach-btn:disabled { opacity: .4; cursor: default; }
.cd-ch-attach-back { position: fixed; inset: 0; z-index: 40; }
.cd-ch-attach-menu { position: absolute; bottom: calc(100% + 12px); inset-inline-start: 0; z-index: 41; display: flex; gap: 4px; padding: 10px; background: #fff; border-radius: 18px; border: 1px solid var(--cd-border); box-shadow: 0 18px 44px rgba(15,42,68,.22); animation: cdAttachIn .18s ease-out; width: max-content; max-width: calc(100vw - 32px); }
@keyframes cdAttachIn { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.cd-ch-attach-item { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 78px; padding: 9px 4px 8px; border-radius: 12px; cursor: pointer; border: 0; background: transparent; font: inherit; font-size: .72rem; font-weight: 700; color: #334155; text-align: center; transition: background .12s; }
.cd-ch-attach-item:hover { background: #F1F5F9; }
.cd-ch-attach-ic { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 4px 10px rgba(15,42,68,.16); }
.cd-ch-attach-ic.pic { background: linear-gradient(135deg, #1E8E54, #34C759); }
.cd-ch-attach-ic.doc { background: linear-gradient(135deg, #1D4ED8, #3B82F6); }
.cd-ch-attach-ic.cam { background: linear-gradient(135deg, #A30D26, #E0294A); }
.cd-ch-attach-ic.oth { background: linear-gradient(135deg, #6B7280, #9AA3B5); }
.cd-ch-attach-ic.loc { background: linear-gradient(135deg, #B45309, #F59E0B); }
.cd-ch-up { min-width: 260px; }
.cd-ch-upfile { display: flex; align-items: center; gap: 10px; }
.cd-ch-upicon { width: 42px; height: 42px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.18); color: #fff; }
.cd-ch-upicon.err { background: #FEE2E2; color: #B91C1C; }
.cd-ch-upthumb { position: relative; width: 46px; height: 46px; border-radius: 12px; overflow: hidden; flex: none; }
.cd-ch-upthumb img { width: 100%; height: 100%; object-fit: cover; }
.cd-ch-upthumb i { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.cd-ch-upthumb i::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: cdSpin .8s linear infinite; }
@keyframes cdSpin { to { transform: rotate(360deg); } }
.cd-ch-upmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cd-ch-upmeta b { font-size: .84rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 200px; }
.cd-ch-upmeta small { font-size: .7rem; opacity: .8; }
.cd-ch-uppct { font-weight: 800; font-variant-numeric: tabular-nums; font-size: .95rem; }
.cd-ch-uppct small { font-size: .65rem; opacity: .8; }
.cd-ch-upbar { position: relative; height: 5px; border-radius: 999px; background: rgba(255,255,255,.22); margin-top: 8px; overflow: hidden; }
.cd-ch-upbar span { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; background: #fff; border-radius: 999px; transition: width .2s; }
.cd-ch-upbar span.indet { width: 40%; animation: cdUpIndet 1.1s ease-in-out infinite; }
@keyframes cdUpIndet { 0% { inset-inline-start: -40%; } 100% { inset-inline-start: 100%; } }
.cd-bubble-row.me .cd-ch-up.err { background: #fff; color: #7F1D1D; border-color: #FECACA; }
.cd-ch-locmap { display: block; width: 280px; max-width: 100%; text-decoration: none; color: inherit; border-radius: 13px; overflow: hidden; background: #fff; transition: transform .15s, box-shadow .15s; }
.cd-ch-locmap:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,42,68,.18); }
.cd-ch-locmap img { display: block; width: 100%; height: 150px; object-fit: cover; }
.cd-ch-locmap-fb { height: 110px; display: flex; align-items: center; justify-content: center; color: var(--cd-red); background: repeating-linear-gradient(45deg, #EEF2F7, #EEF2F7 12px, #E2E8F0 12px, #E2E8F0 24px); }
.cd-ch-locmap-fb .mud-icon-root { font-size: 38px; }
.cd-ch-locmap-foot { display: flex; align-items: center; gap: 6px; padding: 7px 10px; color: #0B1F33; }
.cd-ch-locmap-foot .mud-icon-root { font-size: 16px; color: var(--cd-red); }
.cd-ch-locmap-foot b { font-size: .78rem; white-space: nowrap; }
.cd-ch-locmap-foot small { font-size: .68rem; color: #64748B; margin-inline-start: auto; white-space: nowrap; }
.cd-ch-bubble:has(.cd-ch-locmap) { padding: 4px 4px 6px; }
.cd-ch-bubble:has(.cd-ch-locmap) .cd-bubble-meta { padding: 0 8px; }
.cd-ch-locdlg .mud-dialog-content, .cd-ch-camdlg .mud-dialog-content { padding: 0 !important; }
.cd-ch-locwrap { position: relative; }
.cd-ch-locwrap .cd-map { border-radius: 0; border: 0; }
.cd-ch-locmy { position: absolute; bottom: 16px; inset-inline-start: 14px; z-index: 500; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; background: var(--cd-navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(15,42,68,.35); transition: transform .15s; }
.cd-ch-locmy:hover { transform: scale(1.07); }
.cd-ch-lochint { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 10px 16px 2px; font-size: .78rem; font-weight: 600; color: #64748B; }
.cd-ch-lochint .cd-mono { margin-inline-start: auto; color: #0B1F33; }
.cd-ch-cam { background: #000; display: flex; justify-content: center; }
.cd-ch-cam video { width: 100%; max-height: 60vh; display: block; }

/* chat layout without a top strip: the back link is a button in the list header */
a.cd-ch-new { text-decoration: none; flex: none; }

/* ── picture picker (profile + group photo): avatar, choose / remove, hint ── */
.cd-avp { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 8px 0 12px; text-align: center; }
.cd-avp.busy { opacity: .6; pointer-events: none; }
.cd-avp-av { position: relative; width: 112px; height: 112px; border-radius: 32px; display: inline-flex; align-items: center; justify-content: center; background-color: var(--cd-navy); background-size: cover; background-position: center; color: #fff; font-weight: 800; font-size: 2.4rem; cursor: pointer; box-shadow: 0 10px 24px rgba(15,42,68,.18); transition: transform .15s, box-shadow .15s; }
.cd-avp-av:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15,42,68,.26); }
.cd-avp-av.grp { background-image: linear-gradient(135deg, #0F2A44, #2563EB); }
.cd-avp-av > .mud-icon-root { font-size: 3rem; }
.cd-avp-cam { position: absolute; inset-inline-end: -6px; bottom: -6px; width: 36px; height: 36px; border-radius: 50%; background: var(--cd-red); color: #fff; display: inline-flex; align-items: center; justify-content: center; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(200,16,46,.3); }
.cd-avp-cam .mud-icon-root { font-size: 17px; }
.cd-avp-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cd-avp-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--cd-navy); color: #fff; font: inherit; font-weight: 700; font-size: .84rem; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.cd-avp-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,42,68,.22); }
.cd-avp-btn .mud-icon-root { font-size: 18px; }
.cd-avp-btn.danger { background: #FEE2E2; color: #B91C1C; }
.cd-avp-btn.danger:hover { box-shadow: 0 8px 18px rgba(185,28,28,.16); }
.cd-avp-name { text-align: center; margin-bottom: 14px; }

/* ── chat text appearance: the user's font, size and weight (cd-chat.js sets the variables) ── */
.cd-ch .cd-bubble-body, .cd-ch .cd-compose-input { font-family: var(--cd-ct-font, inherit); font-size: var(--cd-ct-size, inherit); font-weight: var(--cd-ct-weight, inherit); }
.cd-ch .cd-compose-input { color: var(--cd-ct-color, inherit); }
.cd-ch .cd-compose-input::placeholder { color: #94A3B8; font-weight: 400; }
/* coloured messages ("[c=red]…[/c]"): a strong colour on light bubbles, a soft tint on my own navy bubbles */
.cd-cc-red { color: #D32F2F; } .cd-cc-orange { color: #E8710A; } .cd-cc-gold { color: #B67807; } .cd-cc-green { color: #2E7D32; }
.cd-cc-teal { color: #00838F; } .cd-cc-blue { color: #1565C0; } .cd-cc-purple { color: #7B1FA2; } .cd-cc-gray { color: #6B7280; }
.cd-bubble-row.me .cd-cc-red { color: #FCA5A5; } .cd-bubble-row.me .cd-cc-orange { color: #FDBA74; } .cd-bubble-row.me .cd-cc-gold { color: #FCD34D; } .cd-bubble-row.me .cd-cc-green { color: #86EFAC; }
.cd-bubble-row.me .cd-cc-teal { color: #5EEAD4; } .cd-bubble-row.me .cd-cc-blue { color: #93C5FD; } .cd-bubble-row.me .cd-cc-purple { color: #D8B4FE; } .cd-bubble-row.me .cd-cc-gray { color: #CBD5E1; }
.cd-set-row { margin-bottom: 0; flex-wrap: wrap; }
.cd-set-row > div { flex: 1; min-width: 180px; }

/* ── reconnect card (App.razor): above everything, so its buttons are always reachable ── */
.cd-rc { display: none; position: fixed; inset: 0; z-index: 2147483000; align-items: center; justify-content: center; padding: 16px; background: rgba(11,31,51,.28); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); font-family: Cairo, 'Segoe UI', Tahoma, sans-serif; }
.cd-rc.components-reconnect-show, .cd-rc.components-reconnect-retrying, .cd-rc.components-reconnect-failed, .cd-rc.components-reconnect-rejected { display: flex; }
.cd-rc.components-reconnect-hide { display: none; }
.cd-rc-card { width: min(350px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 24px 18px 16px; border-radius: 22px; background: rgba(255,255,255,.98); border: 1px solid rgba(15,42,68,.10); box-shadow: 0 24px 60px rgba(11,31,51,.30), 0 2px 8px rgba(11,31,51,.10); animation: cd-rc-in .32s cubic-bezier(.22,.61,.36,1) both; }
@keyframes cd-rc-in { from { opacity: 0; transform: translateY(10px) scale(.95); } to { opacity: 1; transform: none; } }
/* language: both are in the markup, the page language picks one */
html[lang^="en"] .cd-rc .ar, html:not([lang^="en"]) .cd-rc .en { display: none; }
/* state switches: only the texts and the button of the current state show */
.cd-rc-s-show, .cd-rc-s-failed, .cd-rc-s-rejected { display: none; }
.cd-rc.components-reconnect-show .cd-rc-s-show, .cd-rc.components-reconnect-retrying .cd-rc-s-show, .cd-rc.components-reconnect-failed .cd-rc-s-failed, .cd-rc.components-reconnect-rejected .cd-rc-s-rejected { display: inline-flex; }
/* icon: a spinner while retrying, wifi-off when failed, a clock when the session ended */
.cd-rc-ic { position: relative; flex: 0 0 auto; width: 62px; height: 62px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #EEF2F7, #DCE5EE); color: #0F2A44; box-shadow: 0 8px 20px rgba(15,42,68,.14); }
.cd-rc-ic svg { width: 28px; height: 28px; display: none; }
.cd-rc-spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(15,42,68,.15); border-top-color: #C8102E; animation: cd-rc-rot .8s linear infinite; }
@keyframes cd-rc-rot { to { transform: rotate(360deg); } }
.cd-rc.components-reconnect-failed .cd-rc-spin, .cd-rc.components-reconnect-rejected .cd-rc-spin { display: none; }
.cd-rc.components-reconnect-failed .cd-rc-ic { background: linear-gradient(135deg, #FEE2E2, #FECACA); color: #B91C1C; }
.cd-rc.components-reconnect-failed .cd-rc-ic-off, .cd-rc.components-reconnect-rejected .cd-rc-ic-exp { display: block; }
.cd-rc-body { width: 100%; line-height: 1.45; }
.cd-rc-title { font-weight: 800; font-size: 1.02rem; color: #0B1F33; }
.cd-rc-title > span, .cd-rc-sub > span { justify-content: center; align-items: center; gap: 5px; }
.cd-rc.components-reconnect-failed .cd-rc-title { color: #B91C1C; }
.cd-rc-sub { font-size: .8rem; font-weight: 600; color: #64748B; margin-top: 3px; }
.cd-rc-sub b { color: #0F2A44; font-variant-numeric: tabular-nums; }
.cd-rc-actions { width: 100%; display: flex; gap: 8px; margin-top: 6px; }
/* buttons: tall pills, the icon in a round badge, a slow shine, lift on hover, press on tap */
.cd-rc-btn { position: relative; overflow: hidden; flex: 1; min-height: 46px; justify-content: center; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 6px 14px; font-family: inherit; font-weight: 800; font-size: .88rem; white-space: nowrap; cursor: pointer; color: #fff; background: linear-gradient(135deg, #0B1F33 0%, #0F2A44 55%, #1D4A75 100%); box-shadow: 0 10px 22px rgba(15,42,68,.30), inset 0 1px 0 rgba(255,255,255,.22); transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; -webkit-tap-highlight-color: transparent; }
.cd-rc-btn i { width: 30px; height: 30px; border-radius: 50%; flex: none; background: rgba(255,255,255,.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3-6.7'/%3E%3Cpath d='M21 3v6h-6'/%3E%3C/svg%3E") center / 16px 16px no-repeat; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.cd-rc-btn::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; pointer-events: none; background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent); transform: skewX(-18deg); animation: cd-rc-shine 3.2s ease-in-out infinite; }
@keyframes cd-rc-shine { 0% { left: -60%; } 55%, 100% { left: 140%; } }
.cd-rc-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.cd-rc-btn:active { transform: translateY(1px) scale(.97); }
.cd-rc-btn:focus-visible { outline: 3px solid rgba(15,42,68,.35); outline-offset: 2px; }
.cd-rc-btn.busy i { animation: cd-rc-rot .8s linear infinite; }
.cd-rc.components-reconnect-failed .cd-rc-btn { background: linear-gradient(135deg, #8F0B21 0%, #C8102E 55%, #E11D48 100%); box-shadow: 0 10px 22px rgba(200,16,46,.32), inset 0 1px 0 rgba(255,255,255,.3); }
/* MudBlazor ships its own "#components-reconnect-modal" rules (its layer, an opaque page background, dark button
   text, a grey hover). Ids outrank classes, so what matters is restated here with the id. */
#components-reconnect-modal.cd-rc { z-index: 2147483000 !important; background-color: rgba(11,31,51,.28) !important; }
#components-reconnect-modal .cd-rc-btn { color: #fff; padding: 6px 14px; font-size: .88rem; min-width: 0; margin: 0 !important; font-weight: 800; line-height: 1.2; border-radius: 999px; letter-spacing: 0; text-transform: none; transition: transform .15s ease, box-shadow .15s ease, filter .15s ease; }
#components-reconnect-modal .cd-rc-btn:hover { background-color: transparent; }
@media (prefers-reduced-motion: reduce) { .cd-rc-btn::after { animation: none; display: none; } }

/* chat pictures open the slide-show viewer (cd-chat.js, cdViewer) */
button.cd-ch-img { border: 0; padding: 0; background: none; cursor: zoom-in; font: inherit; }
.cd-ch-grid > button { border: 0; padding: 0; cursor: zoom-in; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #F1F5F9; }
.cd-ch-grid > button:hover img { transform: scale(1.04); }
