/* DIRA design tokens ------------------------------------------------------ */
:root {
  /* Brick red and white. Green is kept only for "resolved" and "online". */
  --paper: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #FAF6F5;
  --ink: #2A1F1C;
  --ink-2: #5C4B46;
  --ink-3: #8A7A75;
  --line: #EDE4E1;
  --line-strong: #D9CBC6;

  --brand: #A33B2B;         /* brick red */
  --brand-deep: #7C2A1E;
  --brand-tint: #FBEDEA;
  --oxide: #8E1B10;         /* critical incidents: a deeper red than the brand */
  --oxide-deep: #6E140B;
  --oxide-tint: #F8E1DC;
  --ok: #2F7A4F;
  --ok-tint: #E4F1E8;
  --amber: #A86C12;
  --amber-tint: #F7EDDA;
  --sky: #2D5B86;
  --sky-tint: #E3ECF4;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow-lift: 0 1px 2px rgba(70, 28, 20, .06), 0 8px 24px -12px rgba(70, 28, 20, .18);

  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
/* Purely mobile: on tablets and computers the app stays a phone-width column in the middle of the screen. */
:root { --phone: 480px; --fx: max(0px, calc((100vw - var(--phone)) / 2)); }
@media (min-width: 481px) {
  html { background: #E9E2DF; }
  body { max-width: var(--phone); margin: 0 auto !important; min-height: 100dvh; box-shadow: 0 0 0 1px rgba(60,30,20,.06), 0 10px 40px rgba(60,30,20,.12); }
}
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.5 var(--font); font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 26px; letter-spacing: -0.02em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.code { font-variant-numeric: tabular-nums; letter-spacing: .06em; font-weight: 700; }
.muted { color: var(--ink-3); }
.sub { color: var(--ink-2); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.sw { color: var(--ink-3); font-weight: 400; font-style: italic; }
.stack > * + * { margin-top: var(--gap, 12px); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 26px; height: 26px; }

/* App shell -------------------------------------------------------------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 50px;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: rgba(243, 245, 242, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.wordmark { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.wordmark b { font-size: 18px; letter-spacing: .02em; }
.wordmark span { font-size: 12px; color: var(--ink-3); }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; flex: none; }
.logo svg { width: 20px; height: 20px; }
.topbar .spacer { flex: 1; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--brand-deep);
}
.main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 16px calc(var(--nav-h) + var(--safe-b) + 28px); }

.bottomnav {
  position: fixed; left: var(--fx); right: var(--fx); bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--surface); border-top: 1px solid var(--line);
}
.navitem {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0;
  font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-decoration: none; position: relative;
}
.navitem.active { color: var(--brand); }
.navitem .badge { position: absolute; top: 4px; left: calc(50% + 6px); }
.navreport { display: grid; place-items: center; text-decoration: none; }
.navreport span {
  width: 52px; height: 52px; border-radius: 16px; background: var(--brand); color: #fff;
  display: grid; place-items: center; margin-top: -18px; box-shadow: 0 6px 16px -6px rgba(163, 56, 31, .6);
}
.navreport span .icon { width: 26px; height: 26px; stroke-width: 2.2; }


/* Generic surfaces --------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.panel.flush { padding: 0; overflow: hidden; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head a, .linkbtn { font-size: 14px; font-weight: 600; color: var(--brand); text-decoration: none; background: none; border: 0; padding: 0; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.list > * + * { border-top: 1px solid var(--line); }
.pagehead { padding: 10px 0 18px; }
.pagehead p { margin-top: 6px; color: var(--ink-2); max-width: 60ch; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; background: none; border: 0; padding: 4px 0; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--r-md); border: 1px solid transparent;
  font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-deep); }
.btn.urgent { background: var(--brand); color: #fff; }
.btn.urgent:hover { background: var(--brand-deep); }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink-3); }
.btn.quiet { background: transparent; color: var(--brand); padding: 0 10px; }
.btn.danger { background: var(--surface); color: var(--oxide); border-color: #EBC9C1; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: var(--r-sm); }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); position: relative; }
.iconbtn:hover { background: rgba(23, 33, 29, .06); }

/* Forms ------------------------------------------------------------------ */
.field { display: block; }
.field > .label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field > .hint { display: block; font-size: 13px; color: var(--ink-3); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2347554F' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 92, 71, .15); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.formerror { background: var(--oxide-tint); color: var(--oxide-deep); border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; font-weight: 500; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #F3ECEA; padding: 4px; border-radius: var(--r-md); gap: 4px; }
.seg button { border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.choice { display: grid; gap: 8px; }
.choice label {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .tile-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--brand); flex: none; }
.choice label:has(input:checked) .tile-icon { background: var(--surface); }
.choice .t { font-weight: 600; }
.choice .s { font-size: 13px; color: var(--ink-3); }

.sevpick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sevpick label { flex-direction: column; align-items: flex-start; gap: 2px; padding: 11px 12px; }
.sevpick .t { display: flex; align-items: center; gap: 8px; }

.toggle { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; }
.toggle input { appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--line-strong); position: relative; flex: none; margin: 0; transition: background .15s; cursor: pointer; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked { background: var(--brand); }
.toggle input:checked::after { transform: translateX(18px); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; font-size: 20px; color: var(--brand); }
.stepper output { min-width: 40px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Chips, badges, severity ------------------------------------------------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line-strong); background: var(--surface); padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n { margin-left: 4px; opacity: .7; font-variant-numeric: tabular-nums; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.sev::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.sev.critical { color: var(--oxide); }
.sev.high { color: #B4541B; }
.sev.medium { color: var(--amber); }
.sev.low { color: var(--ink-3); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill.reported { background: var(--brand-tint); color: var(--brand-deep); border-color: transparent; }
.pill.under_review { background: var(--sky-tint); color: var(--sky); border-color: transparent; }
.pill.dispatched { background: var(--amber-tint); color: #7A4E0C; border-color: transparent; }
.pill.resolved, .pill.closed { background: var(--ok-tint); color: var(--ok); border-color: transparent; }
.pill.staff { background: var(--brand); color: #fff; border-color: transparent; }

/* The case progress track: the signature element ------------------------- */
.track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.track .seg-bar { height: 6px; border-radius: 3px; background: var(--line); }
.track .seg-bar.done { background: var(--brand); }
.track .seg-bar.now { background: linear-gradient(90deg, var(--brand) 0 50%, var(--line) 50%); }
.track.resolved .seg-bar.done, .track.closed .seg-bar.done { background: var(--ok); }
.track-labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 7px; font-size: 12px; color: var(--ink-3); }
.track-labels span.on { color: var(--ink); font-weight: 700; }
.track.mini { gap: 3px; width: 72px; }
.track.mini .seg-bar { height: 4px; }

/* Case rows ---------------------------------------------------------------- */
.caserow { display: flex; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit; align-items: flex-start; }
.caserow:hover { background: var(--surface-2); }
.case-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.case-ic.critical { background: var(--oxide-tint); color: var(--oxide); border-color: transparent; }
.case-ic.high { background: #FAEADF; color: #B4541B; border-color: transparent; }
.caserow .t { font-weight: 600; }
.caserow .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.caserow .right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }

/* Home: report call-to-action -------------------------------------------- */
.reportcta {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 22px 20px 20px;
  background: var(--brand); color: #fff;
}
.reportcta::after { /* contour lines evoking Kitui hills */
  content: ""; position: absolute; inset: auto -40px -60px auto; width: 260px; height: 200px; opacity: .14; pointer-events: none;
  background: repeating-radial-gradient(ellipse at 70% 80%, transparent 0 14px, #fff 14px 15px);
}
.reportcta h1 { font-size: 24px; max-width: 18ch; }
.reportcta p { color: #F6DCD5; margin-top: 8px; max-width: 42ch; }
.reportcta .actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; position: relative; z-index: 1; }
.reportcta .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.reportcta .btn.urgent, .landing .brand .btn.urgent { background: #fff; color: var(--brand-deep); }
.reportcta .btn.urgent:hover, .landing .brand .btn.urgent:hover { background: var(--brand-tint); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.stat { padding: 14px 16px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-3); }
.stats.four { grid-template-columns: repeat(2, 1fr); }
.stats.four .stat:nth-child(3) { border-left: 0; }
.stats.four .stat:nth-child(n+3) { border-top: 1px solid var(--line); }

/* Hotspot bars */
.hot { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; font-size: 14px; }
.hot .bar { height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.hot .bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.hot .bar i.hi { background: var(--oxide); }

/* Map */
.mapwrap { position: relative; background: #F6F1EF; border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; }
.mapwrap svg { display: block; width: 100%; height: auto; }
.maplegend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.maplegend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* Chart */
.weekchart { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.weekchart div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.weekchart i { display: block; width: 100%; max-width: 26px; background: var(--brand); border-radius: 4px 4px 2px 2px; min-height: 2px; }
.weekchart div.cur i { background: var(--oxide); }
.weekchart small { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Report wizard ------------------------------------------------------------ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 20px; }
.steps div { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.steps div::before { content: ""; display: block; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 7px; }
.steps div.on { color: var(--ink); }
.steps div.on::before, .steps div.done::before { background: var(--brand); }
.wizard-foot { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b)); background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 0 8px; display: flex; gap: 10px; }
.gpsbox { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px dashed var(--line-strong); }
.gpsbox.ok { border-style: solid; border-color: var(--brand); background: var(--brand-tint); }
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.photos .ph { aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; position: relative; background: var(--surface-2); border: 1px solid var(--line); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.photos .add { aspect-ratio: 1; border-radius: var(--r-sm); border: 1.5px dashed var(--line-strong); display: grid; place-items: center; color: var(--ink-3); cursor: pointer; background: var(--surface); }
.review dt { font-size: 13px; color: var(--ink-3); }
.review dd { margin: 2px 0 12px; font-weight: 500; }

/* Ticket stub for the tracking code */
.stub {
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-align: center; padding: 26px 20px 22px; position: relative;
}
.stub .tear { border-top: 2px dashed var(--line-strong); margin: 20px -20px 18px; position: relative; }
.stub .tear::before, .stub .tear::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); }
.stub .tear::before { left: -11px; } .stub .tear::after { right: -11px; }
.stub .bigcode { font-size: 32px; letter-spacing: .1em; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); margin-top: 6px; }
.success-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }

/* Case detail ------------------------------------------------------------- */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 14.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; }
.timeline { position: relative; }
.timeline .ev { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline .ev::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline .ev:last-child::before { display: none; }
.timeline .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); display: grid; place-items: center; }
.timeline .dot.status { border-color: var(--brand); background: var(--brand-tint); }
.timeline .dot.internal { border-style: dashed; }
.timeline .when { font-size: 12.5px; color: var(--ink-3); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.stars { display: flex; gap: 4px; }
.stars button { border: 0; background: none; padding: 4px; color: var(--line-strong); }
.stars button.on { color: #C98A12; }
.stars svg { width: 30px; height: 30px; fill: currentColor; stroke: none; }

/* Messages ---------------------------------------------------------------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 80px; }
.msg { max-width: 82%; }
.msg .bubble { background: var(--surface); border: 1px solid var(--line); padding: 10px 13px; border-radius: 16px 16px 16px 4px; white-space: pre-wrap; word-wrap: break-word; }
.msg.me { align-self: flex-end; }
.msg.me .bubble { background: var(--brand); color: #fff; border-color: transparent; border-radius: 16px 16px 4px 16px; }
.msg .who { font-size: 12.5px; color: var(--ink-3); margin: 0 0 4px 4px; display: flex; gap: 6px; align-items: center; }
.msg.me .who { justify-content: flex-end; margin: 0 4px 4px 0; }
.composer {
  position: fixed; left: var(--fx); right: var(--fx); bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 15;
  background: var(--paper); border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 8px;
}
.composer .input { border-radius: 999px; }
.composer .btn { border-radius: 999px; width: 46px; padding: 0; }
.daybreak { text-align: center; font-size: 12px; color: var(--ink-3); margin: 8px 0; }

/* Auth / landing ---------------------------------------------------------- */
.landing { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.landing .brand {
  background: var(--brand); color: #fff; padding: 16px 18px 18px; position: relative; overflow: hidden;
}
.landing .brand::after {
  content: ""; position: absolute; right: -80px; bottom: -120px; width: 380px; height: 300px; opacity: .12;
  background: repeating-radial-gradient(ellipse at 60% 70%, transparent 0 16px, #fff 16px 17px);
}
.landing .brand h1 { font-size: 19px; margin-top: 12px; max-width: 24ch; line-height: 1.2; position: relative; z-index: 1; }
.landing .brand p { color: #F6DCD5; margin-top: 12px; max-width: 40ch; }
.landing .brand .org { font-size: 13px; color: #EBC3B8; }
.landing .brand .wordmark { color: #fff; }
.landing .brand .wordmark span { color: #EBC3B8; }
.landing .brand .logo { background: #fff; color: var(--brand); }
.landing .quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; position: relative; z-index: 1; }
.landing .quick .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.landing .formside { padding: 24px 20px 40px; max-width: 460px; width: 100%; margin: 0 auto; }

/* Overlays ------------------------------------------------------------------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 25, 20, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out; }
.sheet { background: var(--surface); width: 100%; max-width: var(--phone); max-height: 90dvh; overflow: auto; border-radius: 20px 20px 0 0; padding: 8px 20px calc(20px + var(--safe-b)); animation: rise .2s ease-out; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 14px; }
.menu a, .menu button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 4px; border: 0; background: none; text-align: left; text-decoration: none; color: var(--ink); font-weight: 600; }
.menu a + a, .menu a + button, .menu button + a { border-top: 1px solid var(--line); }
.menu .icon { color: var(--ink-2); }
.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: 14px; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-md); font-weight: 500; font-size: 14px; box-shadow: var(--shadow-lift); animation: drop .2s ease-out; display: flex; gap: 10px; align-items: center; }
.toast.error { background: var(--oxide-deep); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(30px); opacity: .4; } }
@keyframes drop { from { transform: translateY(-10px); opacity: 0; } }

.empty { text-align: center; padding: 34px 20px; }
.empty .icon { width: 34px; height: 34px; color: var(--ink-3); margin-bottom: 10px; }
.empty p { color: var(--ink-2); margin: 6px auto 16px; max-width: 36ch; }
.skeleton { background: linear-gradient(90deg, #F2ECEA, #FAF7F6, #F2ECEA); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-md); height: 72px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.offline { background: var(--amber-tint); color: #6B460B; font-size: 13px; font-weight: 600; text-align: center; padding: 6px; }

/* Admin table */
.usertable { width: 100%; border-collapse: collapse; font-size: 14px; }
.usertable th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.usertable td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.usertable tr:last-child td { border-bottom: 0; }
.usertable .select { min-height: 36px; padding: 6px 30px 6px 10px; font-size: 13.5px; }
.usertable thead { display: none; }
  .usertable tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .usertable td { display: block; padding: 3px 0; border: 0; }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Conversations ------------------------------------------------------------ */
.avatar { position: relative; flex: none; }
.avatar.channel { background: var(--brand-tint); color: var(--brand-deep); border-color: transparent; }
.avatar .online { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #2E9E5B; border: 2px solid var(--surface); }
.threadrow { display: flex; gap: 12px; align-items: center; padding: 13px 16px; text-decoration: none; color: inherit; }
.threadrow:hover { background: var(--surface-2); }
.threadrow .avatar { width: 44px; height: 44px; font-size: 14px; }
.threadrow .t { font-weight: 600; }
.threadrow .prev { font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.threadrow .prev.strong { color: var(--ink); font-weight: 600; }
.threadrow .row { gap: 8px; }
.callchip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--brand); margin-top: 2px; }
.livedot { width: 8px; height: 8px; border-radius: 50%; background: #2E9E5B; flex: none; box-shadow: 0 0 0 0 rgba(46,158,91,.5); animation: livepulse 1.8s infinite; }
@keyframes livepulse { 70% { box-shadow: 0 0 0 7px rgba(46,158,91,0); } 100% { box-shadow: 0 0 0 0 rgba(46,158,91,0); } }
.personrow { display: flex; align-items: center; gap: 10px; padding: 10px 2px; }
.peoplelist { max-height: 56dvh; overflow: auto; margin: 0 -4px; }
.peoplelist .iconbtn { color: var(--brand); }

.threadhead {
  position: sticky; top: 56px; z-index: 12; display: flex; align-items: center; gap: 10px;
  margin: -8px -16px 8px; padding: 10px 12px; background: var(--paper); border-bottom: 1px solid var(--line);
}
.threadhead h2 { font-size: 17px; }
.threadhead .iconbtn { color: var(--brand); }
.callbanner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 10px; border-radius: var(--r-md); background: var(--brand-tint); color: var(--brand-deep); font-size: 14px; font-weight: 600; }
.callrow { align-self: center; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: 13.5px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; margin: 4px 0; }
.callrow.missed { color: var(--oxide); }
.callrow .btn { min-height: 30px; padding: 0 12px; }

.msg.rich { max-width: min(82%, 340px); }
.msg .bubble.att { padding: 6px; }
.msg.me .bubble.att, .msg.me .bubble.loc { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.att-img { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 11px; }
.att-audio { width: 260px; max-width: 100%; display: block; }
.att-video { width: 100%; max-height: 320px; border-radius: 11px; background: #000; display: block; }
.filecard { display: flex; align-items: center; gap: 10px; padding: 6px 8px; text-decoration: none; color: inherit; min-width: 220px; }
.fileicon { position: relative; width: 38px; height: 44px; display: grid; place-items: center; color: var(--brand); flex: none; }
.fileicon .icon { width: 38px; height: 44px; stroke-width: 1.3; }
.fileicon b { position: absolute; bottom: 7px; left: 0; right: 0; text-align: center; font-size: 8.5px; letter-spacing: .04em; color: var(--brand-deep); }
.fname { display: block; font-weight: 600; font-size: 14px; word-break: break-word; }
.fmeta { display: block; font-size: 12.5px; color: var(--ink-3); }
.caption { padding: 6px 8px 2px; white-space: pre-wrap; }
.progress { display: block; height: 4px; border-radius: 2px; background: var(--line); margin-top: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.msg.pending { opacity: .8; }

.bubble.loc { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.radar { width: 72px; height: 72px; flex: none; color: var(--brand); background: var(--brand-tint); border-radius: 12px; }
.radar .ping { transform-origin: 40px 40px; animation: ping 2s ease-out infinite; }
@keyframes ping { from { transform: scale(.6); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
.locbody { min-width: 0; }
.locbody .small { color: var(--ink-2); }
.locbody .tiny { color: var(--ink-3); margin-top: 2px; }
.bubble.loc.live { border-color: #9FD0B3 !important; }

.composer { align-items: flex-end; }
.composer textarea.input { border-radius: 22px; min-height: 46px; max-height: 120px; resize: none; line-height: 1.4; padding: 12px 16px; }
.composer .iconbtn { flex: none; color: var(--ink-2); height: 46px; width: 42px; }

.livebar {
  position: fixed; z-index: 40; left: calc(var(--fx) + 12px); right: calc(var(--fx) + 12px); bottom: calc(var(--nav-h) + var(--safe-b) + 76px);
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 14px;
  background: var(--brand-deep); color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lift);
  max-width: 520px; margin: 0 auto;
}
.livebar .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }

/* Calls: a deliberately dark stage, like any call screen, so faces and video stand out */
.callscreen {
  --c-bg: #1C1110; --c-tile: #2A1A17; --c-line: rgba(255,255,255,.1); --c-text: #F7EEEB; --c-sub: #C9AAA2;
  position: fixed; top: 0; bottom: 0; left: var(--fx); right: var(--fx); z-index: 70; background: var(--c-bg); color: var(--c-text);
  display: grid; grid-template-rows: auto 1fr auto;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.callscreen.min { inset: auto; background: none; padding: 0; display: block; }
.callhead { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.calltitle { font-size: 18px; font-weight: 700; }
.callsub { font-size: 13.5px; color: var(--c-sub); margin-top: 2px; }
.iconbtn.light { color: var(--c-text, #fff); }
.iconbtn.light:hover { background: rgba(255,255,255,.1); }
.stage { position: relative; display: grid; gap: 8px; padding: 0 8px; min-height: 0; align-content: center; }
.stage.solo { grid-template-columns: 1fr; }
.stage.grid4 { grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(0, 1fr); align-content: stretch; }
.stage.grid9 { grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(0, 1fr); align-content: stretch; }
.stage.grid9 { grid-template-columns: repeat(2, 1fr); }

.tile { position: relative; background: var(--c-tile); border-radius: 16px; overflow: hidden; display: grid; place-items: center; min-height: 140px; }
.stage.solo > .tile:not(.local) { height: 100%; min-height: 50dvh; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.tile video.mirror { transform: scaleX(-1); }
.tile.has-video { background: #000; }
.tile-avatar { width: 84px; height: 84px; border-radius: 50%; background: #4A2A23; color: #F2D9D2; display: grid; place-items: center; font-size: 28px; font-weight: 700; }
.tile-avatar.big { width: 112px; height: 112px; font-size: 36px; }
.tile-name { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.45); font-size: 13px; font-weight: 600; max-width: calc(100% - 20px); }
.tile-name .icon { color: #F2A18D; }
.tile-state { color: var(--c-sub); font-weight: 500; }
.tile.waiting { gap: 16px; align-content: center; min-height: 50dvh; background: transparent; }
.tile-wait { color: var(--c-sub); }
/* Your own picture floats in the corner of a one-to-one call */
.stage.solo > .tile.local { position: absolute; right: 16px; bottom: 12px; width: 112px; height: 150px; min-height: 0; border: 2px solid var(--c-line); z-index: 2; }
.stage.solo > .tile.local .tile-avatar { width: 52px; height: 52px; font-size: 18px; }
.stage.solo > .tile.local .tile-name { font-size: 11px; left: 6px; bottom: 6px; padding: 2px 7px; }
.callbar { display: flex; justify-content: center; gap: 14px; padding: 16px 12px 22px; flex-wrap: wrap; }
.cbtn { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: var(--c-text, #fff); font-size: 12px; font-weight: 600; min-width: 62px; }
.cbtn .icon { width: 54px; height: 54px; padding: 15px; border-radius: 50%; background: rgba(255,255,255,.12); box-sizing: border-box; }
.cbtn:hover .icon { background: rgba(255,255,255,.2); }
.cbtn.on .icon { background: #F7EEEB; color: #1C1110; }
.cbtn.danger .icon { background: #C2412A; color: #fff; }
.cbtn.answer .icon { background: #2E9E5B; color: #fff; }
.cbtn.big .icon { width: 64px; height: 64px; padding: 18px; }
.keepalive { position: fixed; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.callpill {
  position: fixed; z-index: 70; right: calc(var(--fx) + 14px); bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 10px 16px; border-radius: 999px; border: 0;
  background: #1C1110; color: #F7EEEB; font-weight: 600; font-size: 14px; box-shadow: 0 10px 28px -10px rgba(0,0,0,.5);
}
.ringsheet {
  position: fixed; top: 0; bottom: 0; left: var(--fx); right: var(--fx); z-index: 80; background: #1C1110; color: #F7EEEB; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px;
  --c-text: #F7EEEB; --c-sub: #C9AAA2;
}
.ringsheet .tile-avatar { margin-bottom: 12px; }
.ringactions { display: flex; gap: 28px; margin-top: 48px; flex-wrap: wrap; justify-content: center; }
.pulse { animation: ringpulse 1.6s infinite; }
@keyframes ringpulse { 0% { box-shadow: 0 0 0 0 rgba(46,158,91,.45); } 70% { box-shadow: 0 0 0 26px rgba(46,158,91,0); } 100% { box-shadow: 0 0 0 0 rgba(46,158,91,0); } }
.invite {
  position: fixed; z-index: 65; top: 12px; left: 12px; right: 12px; max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: 14px; background: #1C1110; color: #F7EEEB; box-shadow: var(--shadow-lift);
  --c-text: #F7EEEB;
}
.invite .small { color: #C9AAA2; }

/* Map ------------------------------------------------------------------------ */
.gmap {
  position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; outline-offset: -3px;
  background: radial-gradient(ellipse at 50% 45%, #FBF7F6 0%, #F1E9E6 100%); border: 1px solid var(--line); border-radius: var(--r-lg); cursor: grab;
}
.gmap.dragging { cursor: grabbing; }
.gmap-world { position: absolute; left: 0; top: 0; will-change: transform; }
.gmap-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; opacity: 0; transition: opacity .25s; pointer-events: none;
  /* Muted base map so the red case markers carry the colour. */
  filter: grayscale(.8) sepia(.12) contrast(.92) brightness(1.04); }
.gmap-tile.in { opacity: 1; }
.gmap-markers { position: absolute; left: 0; top: 0; }
.gmap-marker { position: absolute; transform: translate(-50%, -50%); border: 0; padding: 0; background: none; cursor: pointer; }
.gmap-controls { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.gmap-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); display: grid; place-items: center; box-shadow: 0 1px 3px rgba(70,28,20,.12); }
.gmap-btn:hover { background: var(--surface-2); }
.gmap-btn .minus { width: 12px; height: 2px; background: currentColor; border-radius: 1px; }
.gmap-attrib { position: absolute; right: 0; bottom: 0; z-index: 2; font-size: 10.5px; color: var(--ink-2); background: rgba(255,255,255,.8); padding: 1px 6px; border-top-left-radius: 6px; }
.gmap:not(.has-tiles) .gmap-attrib { display: none; }
.gmap-card {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 4; max-width: 420px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 44px 14px 14px; box-shadow: 0 10px 30px -10px rgba(70,28,20,.35);
  cursor: default; user-select: text; -webkit-user-select: text; animation: rise .16s ease-out;
}
.gmap-close { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; }
.gmap-label { position: absolute; transform: translate(-50%, -190%); font-size: 11px; font-weight: 700; color: #A8968F; text-transform: uppercase; letter-spacing: .06em; letter-spacing: .02em; white-space: nowrap; pointer-events: none; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.gmap.has-tiles .gmap-label { display: none; }
.gmap-note { position: absolute; left: 10px; top: 10px; z-index: 2; font-size: 12px; color: var(--ink-2); background: rgba(255,255,255,.9); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }
.gmap.has-tiles .gmap-note { display: none; }

/* Case markers */
.pin { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(70,28,20,.45); transition: transform .12s; }
.pin.critical { background: var(--oxide); width: 18px; height: 18px; }
.pin.high { background: #C2570C; }
.pin.medium { background: var(--amber); }
.pin.low { background: #8A7A75; }
.pin.done { background: var(--ok); width: 13px; height: 13px; opacity: .85; }
.pin.mine { outline: 3px solid rgba(163,59,43,.35); outline-offset: 1px; }
.pin.approx { border-style: dashed; }
.gmap-marker:hover .pin, .gmap-marker.sel .pin { transform: scale(1.35); }
.gmap-marker.sel .pin { box-shadow: 0 0 0 4px rgba(163,59,43,.3), 0 1px 4px rgba(70,28,20,.45); }
.cluster {
  display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums;
  background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 7px rgba(163,59,43,.18), 0 2px 6px rgba(70,28,20,.35);
}
.cluster.done { background: var(--ok); box-shadow: 0 0 0 7px rgba(47,122,79,.16), 0 2px 6px rgba(20,40,30,.3); }
.cluster.hot { background: var(--oxide); box-shadow: 0 0 0 9px rgba(142,27,16,.2), 0 2px 6px rgba(70,28,20,.4); }

/* People markers */
.person { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 12px; font-weight: 800;
  background: #fff; color: var(--ink); border: 2.5px solid var(--ink-2); box-shadow: 0 1px 4px rgba(70,28,20,.4); }
.person.super { background: var(--brand); color: #fff; border-color: #fff; }
.person.me { outline: 3px solid rgba(45,91,134,.45); outline-offset: 1px; }
.person.stale { opacity: .55; }
.person .online { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: #2E9E5B; border: 2px solid #fff; }
.person-cluster { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; font-size: 13px; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }

/* Home ----------------------------------------------------------------------- */
.home-report {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--r-lg);
  background: var(--brand); color: #fff; position: relative; overflow: hidden;
}
.home-report::after { content: ""; position: absolute; inset: auto -50px -80px auto; width: 240px; height: 180px; opacity: .13; pointer-events: none;
  background: repeating-radial-gradient(ellipse at 70% 80%, transparent 0 14px, #fff 14px 15px); }
.home-report h1 { font-size: 21px; max-width: 22ch; }
.home-report p { color: #F6DCD5; font-size: 14px; margin-top: 4px; }
.home-report .actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.home-report .btn.light { background: #fff; color: var(--brand-deep); }
.home-report .btn.light:hover { background: var(--brand-tint); }
.home-report .btn.outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.assigned-strip { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--brand-tint); color: var(--brand-deep); font-weight: 600; text-decoration: none; margin-top: 12px; }
.mapsection { margin-top: 20px; }
.mapsection.top { margin-top: 0; }
.mapsection .section-head h1.h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.home-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.home-actions .btn.primary { flex: 1 1 200px; justify-content: center; }
.home-note { margin-top: 10px; }
.casemap { height: min(62dvh, 560px); min-height: 360px; }
.mapstats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.mapstats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }

/* Consent ---------------------------------------------------------------------- */
.consent { max-width: 560px; margin: 0 auto; padding: 28px 20px 40px; }
.consent .mark { width: 56px; height: 56px; border-radius: 16px; background: var(--brand); color: #fff; display: grid; place-items: center; margin-bottom: 18px; }
.consent h1 { font-size: 26px; }
.consent dl { margin: 20px 0; display: grid; gap: 14px; }
.consent dt { font-weight: 700; font-size: 14.5px; }
.consent dd { margin: 3px 0 0; color: var(--ink-2); font-size: 14.5px; }
.consent .actions { display: grid; gap: 10px; margin-top: 8px; }
.consent .fine { font-size: 13px; color: var(--ink-3); margin-top: 14px; }
.consentrow { display: flex; gap: 12px; align-items: flex-start; }

/* People list & escalate picker */
.peoplerow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.peoplerow .avatar { width: 40px; height: 40px; }
.peoplerow .avatar.super { background: var(--brand); color: #fff; border-color: transparent; }
.pickrow { display: flex; align-items: center; gap: 12px; padding: 12px 4px; cursor: pointer; border-radius: var(--r-sm); }
.pickrow:has(input:checked) { background: var(--brand-tint); }
.pickrow input { accent-color: var(--brand); width: 18px; height: 18px; flex: none; }
.pill.esc { background: var(--oxide-tint); color: var(--oxide-deep); border-color: transparent; }
.toast a { color: #fff; font-weight: 700; margin-left: auto; white-space: nowrap; }

/* Reports */
.datechips { display: flex; flex-wrap: wrap; gap: 8px; }
.exportbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.exportbar .btn { min-height: 54px; }
.reportprev .stats { margin: 0 -18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* One-page report form --------------------------------------------------------- */
.reportform { max-width: 640px; margin: 0 auto; }
.reportpanel { padding: 4px 18px 0; }
.frow { padding: 14px 0; border-bottom: 1px solid var(--line); }
.frow.split { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.flabel { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.typechips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.typechip { display: flex; align-items: center; gap: 9px; text-align: left; padding: 9px 10px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); min-height: 50px; }
.typechip .icon { color: var(--brand); flex: none; }
.typechip b { display: block; font-size: 13.5px; line-height: 1.25; }
.typechip small { display: block; font-size: 11.5px; color: var(--ink-3); }
.typechip.on { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.sevrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sevbtn { padding: 9px 4px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.sevbtn.on { color: #fff; border-color: transparent; }
.sevbtn.critical.on { background: var(--oxide); } .sevbtn.high.on { background: #C2570C; } .sevbtn.medium.on { background: var(--amber); } .sevbtn.low.on { background: #8A7A75; }
.descwrap { position: relative; }
.descwrap .textarea { min-height: 88px; padding-right: 50px; }
.descmic { position: absolute; right: 8px; bottom: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; }
.descmic.on { background: var(--brand); color: #fff; animation: ringpulse 1.6s infinite; }
.gpsstrip { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--ink-2); }
.gpsstrip.ok { background: var(--ok-tint); border: 1px solid #BFE0CB; color: var(--ok); }
.gpsstrip.ok b { color: var(--ok); }
.photorow { display: flex; gap: 8px; flex-wrap: wrap; }
.photorow .ph { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid var(--line); }
.photorow .ph img { width: 100%; height: 100%; object-fit: cover; }
.photorow .ph button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.addph { height: 56px; min-width: 56px; padding: 0 12px; border-radius: 10px; border: 1.5px dashed var(--line-strong); background: var(--surface); color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.conf { display: flex; gap: 10px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.conf input { width: 20px; height: 20px; accent-color: var(--brand); margin-top: 1px; flex: none; }
.conf small { color: var(--ink-3); font-size: 13px; }
.reportpanel > .grid2 { padding: 12px 0; border-bottom: 1px solid var(--line); }
.more { padding: 12px 0; }
.more summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--brand); }
.sendbar { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b)); background: linear-gradient(transparent, var(--surface) 35%); padding: 16px 0 16px; margin: 0 -2px; }
.sendbar .btn { min-height: 52px; font-size: 16px; }
.reportpanel .formerror { margin-top: 14px; }

/* Home: greeting and photo --------------------------------------------------- */
.av { position: relative; display: inline-grid; place-items: center; border-radius: 50%; overflow: visible; flex: none; color: #fff; font-weight: 700; background: var(--surface-2); }
.av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.av .partners img { object-fit: contain; border-radius: 0; }
.av-initials { letter-spacing: .02em; }
.av .online { position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; min-width: 10px; min-height: 10px; border-radius: 50%; background: #2E9E5B; border: 2px solid var(--surface); }
.avbtn { border: 0; background: none; padding: 0; border-radius: 50%; display: grid; }
.greet { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.greet-av { position: relative; border: 0; background: none; padding: 0; border-radius: 50%; }
.greet-hi { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.photobadge { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; border: 2px solid var(--surface); }
.photobadge .icon { width: 12px; height: 12px; }
.photopanel { display: flex; align-items: center; gap: 18px; }
.photobtn { position: relative; border: 0; background: none; padding: 0; border-radius: 50%; }
.photobtn .photobadge { width: 30px; height: 30px; }
.photobtn .photobadge .icon { width: 15px; height: 15px; }
.tile-avatar.av { width: 84px; height: 84px; }

/* Chats (WhatsApp-style) -------------------------------------------------------- */
:root { --chat-wall: #F2EAE6; --bub-me: #FBDCD2; --bub-them: #FFFFFF; --tick-read: #2F8FDB; }
.chatlayout { display: grid; grid-template-columns: 1fr; }
.chatempty { display: none; }
.shell.in-thread .topbar, .shell.in-thread .bottomnav { display: none; }
.shell.in-thread .main { padding: 0; max-width: none; }
.chatlayout:not(.listonly) { height: 100dvh; }
.chatlayout:not(.listonly) .chatlist { display: none; }
.chatlist { position: relative; background: var(--surface); }
.cl-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 10px; }
.cl-head h1 { font-size: 24px; }
.cl-search { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 9px 12px; background: var(--surface-2); border-radius: 12px; color: var(--ink-3); }
.cl-search input { border: 0; background: transparent; outline: none; flex: 1; font-size: 15px; min-width: 0; }
.cl-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; text-decoration: none; color: inherit; border-radius: 12px; }
.cl-row:hover { background: var(--surface-2); }
.cl-row.active { background: var(--brand-tint); }
.cl-main { flex: 1; min-width: 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: -10px; }
.cl-row:last-child .cl-main { border-bottom: 0; }
.cl-top, .cl-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cl-name { font-weight: 600; font-size: 16px; }
.cl-time { font-size: 12px; color: var(--ink-3); flex: none; }
.cl-row.unread .cl-time { color: var(--brand); font-weight: 700; }
.cl-prev { font-size: 14px; color: var(--ink-3); display: block; }
.cl-prev .ticks { vertical-align: -1px; margin-right: 3px; }
.cl-row.unread .cl-prev { color: var(--ink); font-weight: 600; }
.cl-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.typing { color: var(--brand); font-style: italic; font-weight: 600; }
.fab { position: fixed; right: calc(var(--fx) + 16px); bottom: calc(var(--nav-h) + var(--safe-b) + 16px); width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px -6px rgba(124,42,30,.55); z-index: 20; }

.thread { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--chat-wall); }
.thead { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px; background: var(--brand); color: #fff; flex: none; }
.thead .iconbtn { color: #fff; }
.thead .iconbtn:hover { background: rgba(255,255,255,.14); }
.thead .av .online { border-color: var(--brand); }
.th-name { font-weight: 700; font-size: 16.5px; }
.th-status { font-size: 12.5px; color: #F8DCD3; }
.thead .typing { color: #fff; }
.thread .callbanner { margin: 0; border-radius: 0; }
.tscroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 10px 12px;
  background-color: var(--chat-wall);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120' fill='none' stroke='%23A33B2B' stroke-opacity='.07' stroke-width='2' stroke-linecap='round'%3E%3Cellipse cx='20' cy='22' rx='4' ry='11' transform='rotate(-14 20 22)'/%3E%3Cellipse cx='30' cy='22' rx='4' ry='11' transform='rotate(14 30 22)'/%3E%3Cpath d='M84 20c6 0 9 5 9 9s-4 6-9 6-9-2-9-6 3-9 9-9z'/%3E%3Cpath d='M70 80l8-14 8 14M60 96h22M98 60c8 2 12 10 8 16'/%3E%3Ccircle cx='28' cy='88' r='6'/%3E%3Cpath d='M14 60q8-8 16 0t16 0'/%3E%3C/svg%3E"); }
.tlist { max-width: 860px; margin: 0 auto; }
.sysrow { display: flex; justify-content: center; margin: 10px 0; }
.syschip { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; background: var(--surface); color: var(--ink-2); font-size: 12.5px; padding: 5px 11px; border-radius: 9px; box-shadow: 0 1px .5px rgba(60,30,20,.12); }
.syschip.day { background: #FFF6EC; font-weight: 600; }
.syschip.missed { color: var(--oxide); }
.syschip.note { background: #FFF2C6; color: #5C4B2A; max-width: 420px; text-align: center; }
.syschip small { color: var(--ink-3); }
.syschip.btnlike { border: 0; cursor: pointer; font-weight: 600; }
.mrow { display: flex; align-items: flex-end; gap: 6px; margin-top: 2px; }
.mrow.first { margin-top: 10px; }
.mrow.me { justify-content: flex-end; }
.mrow.pending { opacity: .75; }
.mcol { max-width: min(80%, 520px); display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.mrow.me .mcol { align-items: flex-end; }
.mav-space { width: 30px; flex: none; }
.bub { position: relative; background: var(--bub-them); border-radius: 10px; padding: 6px 9px 7px; box-shadow: 0 1px .5px rgba(60,30,20,.14); font-size: 15px; line-height: 1.38; overflow-wrap: anywhere; max-width: 100%; }
.mrow.me .bub { background: var(--bub-me); }
.bub.tail { border-top-left-radius: 0; }
.mrow.me .bub.tail { border-top-left-radius: 10px; border-top-right-radius: 0; }
.bub.tail::before { content: ""; position: absolute; top: 0; left: -8px; border-top: 10px solid var(--bub-them); border-left: 8px solid transparent; }
.mrow.me .bub.tail::before { left: auto; right: -8px; border-left: 0; border-right: 8px solid transparent; border-top-color: var(--bub-me); }
.btext { white-space: pre-wrap; }
.bname { font-size: 12.5px; font-weight: 700; margin-bottom: 1px; }
.bname-role { font-weight: 500; color: var(--ink-3); }
.bmeta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 8px 0 -6px 12px; font-size: 11px; color: #8A7A75; white-space: nowrap; line-height: 1; }
.ticks { width: 17px; height: 11px; color: #8A7A75; flex: none; }
.ticks.read { color: var(--tick-read); }
.bub.media { padding: 3px 3px 6px; }
.bub.media .bmeta { float: none; display: flex; justify-content: flex-end; margin: 3px 6px 0; }
.bub.media .btext { display: block; padding: 4px 6px 0; }
.att-imgwrap { display: block; }
.att-img { display: block; max-width: 300px; width: 100%; max-height: 340px; object-fit: cover; border-radius: 8px; }
.att-video { display: block; max-width: 300px; width: 100%; border-radius: 8px; background: #000; }
.att-audio { width: 260px; max-width: 100%; }
.bub .filecard { background: rgba(0,0,0,.04); border-radius: 8px; padding: 10px; min-width: 230px; }
.fdl { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.bub .loc { display: flex; gap: 10px; padding: 6px; min-width: 230px; }
.bub .loc .radar { width: 64px; height: 64px; }
.bub.sticker { background: transparent; box-shadow: none; padding: 0; }
.bub.sticker::before { display: none; }
.stk-meta { display: flex; justify-content: flex-end; }
.stk-meta .bmeta { float: none; margin: 0; background: rgba(255,255,255,.88); padding: 3px 7px; border-radius: 9px; }
.cemoji { display: inline-block; flex: none; }
.cemoji svg { width: 100%; height: 100%; display: block; }
.mact { flex: none; align-self: center; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--ink-2); display: grid; place-items: center; opacity: 0; transition: opacity .12s; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.mrow.me .mact { order: -1; }
.mrow:hover .mact, .mact:focus-visible { opacity: 1; }
@media (hover: none) { .mact { display: none; } }
.reacts { display: flex; gap: 3px; margin: -5px 8px 0; position: relative; z-index: 1; flex-wrap: wrap; }
.react { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 1px 7px; font-size: 14px; line-height: 1.5; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.react span { font-size: 11.5px; margin-left: 3px; color: var(--ink-2); font-weight: 600; }
.react.mine { border-color: var(--brand); background: var(--brand-tint); }
.reactbar { display: flex; justify-content: space-between; gap: 4px; padding: 4px 0 8px; border-bottom: 1px solid var(--line); }
.rb { font-size: 30px; border: 0; background: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; transition: transform .1s; }
.rb:hover { transform: scale(1.15); background: var(--surface-2); }
.rb.on { background: var(--brand-tint); }
.rb.more { font-size: 24px; color: var(--ink-2); background: var(--surface-2); }

/* Voice notes */
.bub.voice { padding: 6px 8px 6px; }
.bub.voice .bmeta { float: none; position: absolute; right: 10px; bottom: 7px; margin: 0; }
.vn { display: flex; align-items: center; gap: 8px; min-width: 250px; max-width: 320px; }
.vn-av { position: relative; flex: none; }
.vn-mic { position: absolute; bottom: -3px; right: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); color: var(--tick-read); display: grid; place-items: center; }
.mrow.me .vn-mic { background: var(--bub-me); }
.vn-mic .icon { width: 12px; height: 12px; }
.vn-play { width: 34px; height: 34px; border: 0; background: none; color: var(--ink-2); display: grid; place-items: center; flex: none; }
.vn-play .icon { width: 26px; height: 26px; fill: currentColor; stroke: none; }
.vn-body { flex: 1; min-width: 0; }
.vn-wave { display: flex; align-items: center; gap: 2px; height: 30px; cursor: pointer; }
.vn-wave i { flex: 1; min-width: 2px; border-radius: 2px; background: #CDBDB7; transition: background .1s; }
.vn-wave i.on { background: var(--brand); }
.mrow.me .vn-wave i { background: #DDA898; }
.mrow.me .vn-wave i.on { background: var(--brand-deep); }
.vn-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); margin-top: 2px; min-height: 16px; }
.vn-speed { border: 0; background: var(--ink-2); color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }

/* Composer */
.composer2 { flex: none; background: #EFE6E2; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
.crow { display: flex; align-items: flex-end; gap: 6px; max-width: 860px; margin: 0 auto; }
.cbox { flex: 1; min-width: 0; display: flex; align-items: flex-end; background: var(--surface); border-radius: 24px; padding: 3px 4px; box-shadow: 0 1px .5px rgba(60,30,20,.12); }
.cin { flex: 1; min-width: 0; border: 0; outline: none; resize: none; background: transparent; font-size: 16px; line-height: 1.35; padding: 10px 4px; max-height: 130px; }
.cicon { width: 40px; height: 42px; border: 0; background: none; color: #7A6B66; display: grid; place-items: center; flex: none; border-radius: 50%; }
.cicon:hover { color: var(--ink); }
.cact { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 2px 6px rgba(124,42,30,.35); }
.cact:active { transform: scale(.95); }
.recbar { display: flex; align-items: center; gap: 10px; max-width: 860px; margin: 0 auto; background: var(--surface); border-radius: 26px; padding: 4px 4px 4px 6px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #D93025; animation: recblink 1s infinite; flex: none; }
@keyframes recblink { 50% { opacity: .25; } }
.rec-time { font-weight: 700; min-width: 40px; }
.rec-levels { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; overflow: hidden; justify-content: flex-end; }
.rec-levels i { width: 3px; flex: none; border-radius: 2px; background: var(--brand); }
.rec-cancel { color: var(--ink-2); }
.emohost { height: 300px; max-width: 860px; margin: 6px auto 0; background: var(--surface); border-radius: 14px; overflow: hidden; }
.emo-panel { display: flex; flex-direction: column; height: 100%; }
.sheet .emo-panel { height: min(62dvh, 460px); }
.emo-top { padding: 8px 10px 4px; }
.emo-search { width: 100%; border: 0; outline: none; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; font-size: 15px; }
.emo-tabs { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); padding: 0 6px; flex: none; }
.emo-tabs::-webkit-scrollbar { display: none; }
.emo-tab { flex: none; width: 42px; height: 40px; border: 0; background: none; font-size: 20px; border-bottom: 3px solid transparent; opacity: .6; }
.emo-tab.on { border-bottom-color: var(--brand); opacity: 1; }
.emo-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); align-content: start; padding: 6px; gap: 2px; }
.emo { font-size: 27px; height: 46px; border: 0; background: none; border-radius: 10px; line-height: 1; }
.emo:hover { background: var(--surface-2); }
.emo-empty { grid-column: 1 / -1; color: var(--ink-3); font-size: 13.5px; text-align: center; padding: 18px 10px; }
.emo-sticker { height: 56px; border: 0; background: none; border-radius: 10px; display: grid; place-items: center; }
.emo-sticker:hover { background: var(--surface-2); }
.emo-make { grid-column: span 2; height: 56px; border: 1.5px dashed var(--line-strong); background: var(--brand-tint); border-radius: 12px; color: var(--brand-deep); display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; }
.emo-make span { font-size: 22px; }
.attgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 8px; padding: 10px 0 4px; }
.attbtn { display: flex; flex-direction: column; align-items: center; gap: 7px; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.attbtn > span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.personrow { display: flex; align-items: center; gap: 10px; padding: 8px 2px; }
.pr-main { border: 0; background: none; text-align: left; padding: 0; min-width: 0; }

/* Emoji maker */
.em-preview { display: grid; place-items: center; height: 170px; background: radial-gradient(circle, var(--brand-tint), transparent 70%); border-radius: var(--r-lg); }
.em-code { text-align: center; font-size: 12.5px; color: var(--ink-3); margin-top: -4px; font-variant-numeric: tabular-nums; }
.em-rows { display: grid; gap: 2px; }
.em-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.em-label { font-weight: 600; font-size: 14px; }
.em-cyc { display: flex; align-items: center; }
.em-val { min-width: 112px; text-align: center; font-weight: 600; font-size: 14px; }
.em-sw { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; padding: 6px 0; }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.sw.on { box-shadow: 0 0 0 2.5px var(--brand); }

.chatlayout.listonly .chatlist { padding-bottom: 80px; }


/* Presenting in calls */
.stage.presenting { display: grid; grid-template-rows: 1fr auto; gap: 8px; padding: 0 8px; min-height: 0; }
.present-main { position: relative; min-height: 0; }
.present-main > .tile { height: 100%; min-height: 220px; background: #000; border-radius: 14px; }
.tile video.contain { object-fit: contain; }
.tile.screen .tile-name { background: rgba(163,59,43,.92); }
.present-strip { display: flex; gap: 8px; overflow-x: auto; height: 112px; scrollbar-width: none; }
.present-strip .tile { flex: none; width: 150px; min-height: 0; height: 100%; position: relative; inset: auto; border: 0; }
.present-strip .tile .tile-avatar.av { width: 46px; height: 46px; font-size: 16px !important; }
.present-strip .tile .tile-name { font-size: 11px; left: 6px; bottom: 6px; padding: 2px 7px; }
.tile.screen.self { display: grid; place-items: center; background: #1F1210; }
.tile.screen.self > .tile { position: absolute; right: 12px; bottom: 12px; width: 200px; height: 113px; min-height: 0; border: 2px solid rgba(255,255,255,.18); border-radius: 10px; }
.present-self { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: #F7EEEB; padding: 20px; }
.present-self .icon { width: 40px; height: 40px; color: #F2A18D; }
.present-self span { color: #C9AAA2; font-size: 14px; }
.callscreen .btn.light { background: #fff; color: var(--brand-deep); }
.present-pick { width: auto; min-height: 34px; padding: 4px 30px 4px 10px; font-size: 13px; background-color: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
/* Keep the conversation inside the screen width */
.chatlayout { grid-template-columns: minmax(0, 1fr); }
.thread, .chatlist, .cl-main, .tscroll { min-width: 0; }
.cl-bottom .cl-prev, .cl-bottom .typing { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-top .cl-name { flex: 1; min-width: 0; }
.tlist { width: 100%; }
/* Messages that are only emoji show big, without a bubble */
.bub.jumbo { background: transparent; box-shadow: none; padding: 0 2px; }
.bub.jumbo::before { display: none; }
.bub.jumbo .btext { font-size: 44px; line-height: 1.15; }
.bub.jumbo .bmeta { float: none; display: flex; justify-content: flex-end; margin: 0; background: rgba(255,255,255,.85); padding: 2px 6px; border-radius: 8px; width: max-content; margin-left: auto; }
.mrow.me .bub.voice .bmeta { right: 62px; }
.mrow.me .bub.sticker, .mrow.me .bub.jumbo { background: transparent; box-shadow: none; }
.mrow.me .bub.sticker::before, .mrow.me .bub.jumbo::before { display: none; }

/* Report charts */
.chartgrid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.chartcard { padding: 16px; min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.chart-head h3 { font-size: 15.5px; }
.chart-empty { padding: 24px 0; text-align: center; }
.donut { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.donut-fig { position: relative; width: 168px; height: 168px; flex: none; margin: 0 auto; }
.donut-svg { width: 100%; height: 100%; display: block; }
.donut-svg .slice { cursor: pointer; transition: opacity .12s; outline: none; }
.donut-svg .slice.dim { opacity: .25; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; padding: 36px; }
.donut-center b { font-size: 24px; line-height: 1.1; color: var(--ink); }
.donut-center span { font-size: 12px; color: var(--ink-2); line-height: 1.25; }
.donut-center small { font-size: 11.5px; color: var(--ink-3); }
.legend-list { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 180px; display: grid; gap: 2px; }
.legend-list li { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; font-size: 13.5px; cursor: default; outline: none; }
.legend-list li.on, .legend-list li:focus-visible { background: var(--surface-2); }
.legend-list i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend-list b { min-width: 26px; text-align: right; }
.legend-list .muted { min-width: 36px; text-align: right; font-size: 12.5px; }
.hbars-wrap .legend { margin: 0 0 10px; }
.hbars { display: grid; gap: 8px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 140px) 1fr 34px; align-items: center; gap: 10px; font-size: 13.5px; }
.hbar-name { color: var(--ink-2); }
.hbar-track { display: flex; gap: 2px; height: 16px; }
.hbar-seg { display: block; height: 100%; min-width: 3px; outline: none; }
.hbar-seg:first-child { border-radius: 4px 0 0 4px; }
.hbar-seg:last-child { border-radius: 0 4px 4px 0; }
.hbar-seg:only-child { border-radius: 4px; }
.hbar-seg:hover, .hbar-seg:focus-visible { filter: brightness(1.12); }
.hbar-val { text-align: right; }
.cols-svg { width: 100%; height: auto; display: block; }
.cols-svg .axis { font-size: 11px; fill: var(--ink-3); font-family: var(--font); font-variant-numeric: tabular-nums; }
.cols-svg .hit { cursor: pointer; outline: none; }
.cols-svg .hit:hover, .cols-svg .hit:focus-visible { fill: rgba(163,59,43,.06); }
.chart-tip { position: absolute; z-index: 3; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; padding: 5px 9px; border-radius: 8px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-lift); }
.chart-table { overflow-x: auto; }
.chart-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.chart-table th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.chart-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.chart-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Partner logos (Caritas Kitui + Brooke East Africa) -------------------------- */
.partners { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.partners img { display: block; object-fit: contain; }
.wordmark .logo-pair { background: #fff; border-radius: 8px; padding: 3px 5px; box-shadow: inset 0 0 0 1px var(--line); }
.brand-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; position: relative; z-index: 1; }
.logo-card { background: #fff; border-radius: 12px; padding: 6px 10px; box-shadow: 0 6px 18px rgba(60, 20, 10, .18); }
.logo-card .partners { gap: 10px; }
.dira-av { background: #fff !important; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; border-radius: 28% !important; }
.tile-avatar.dira-av { border-radius: 50% !important; }
.dira-av .partners { gap: 1px; }
.tile-avatar.dira-av .partners { gap: 6px; }

/* DIRA Alerts: case cards and automated calls ------------------------------- */
.casebub { max-width: min(420px, 92%) !important; padding: 0 !important; overflow: hidden; background: var(--surface) !important; }
.casebub > .bmeta { position: static; display: block; text-align: right; padding: 0 12px 8px; }
.casecard { border-left: 4px solid var(--brand); padding: 12px 14px 10px; display: grid; gap: 6px; }
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .03em; }
.cc-code { font-size: 20px; font-weight: 800; letter-spacing: .04em; color: var(--ink); }
.cc-title { font-weight: 600; color: var(--ink); }
.cc-rows { display: grid; gap: 4px; font-size: 13.5px; margin-top: 2px; }
.cc-row { display: grid; grid-template-columns: 18px 72px minmax(0, 1fr); align-items: start; gap: 6px; }
.cc-row .icon { color: var(--ink-3); margin-top: 2px; }
.cc-note { font-style: italic; color: var(--ink-2); font-size: 13.5px; }
.cc-desc { font-size: 13.5px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.cc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.sevpill { white-space: nowrap; flex: none; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; color: #fff; background: var(--ink-3); }
.sevpill.sev-critical { background: #8E2A1E; } .sevpill.sev-high { background: #B9432B; }
.sevpill.sev-medium { background: #FBE6DE; color: #8E2A1E; } .sevpill.sev-low { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.syschip .btn.sm { padding: 3px 10px; min-height: 0; font-size: 12px; }
.composer2.readonly { padding: 12px 16px; text-align: center; }
.composer2.readonly p { display: inline-flex; align-items: center; gap: 6px; }
.alertring .alert-case { display: grid; gap: 2px; margin-top: 18px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 12px 18px; font-size: 14px; }
.alertring .alert-case b { font-size: 22px; letter-spacing: .06em; }
.alertring .tile-avatar.pulse { animation: alertpulse 1.6s ease-out infinite; }
@keyframes alertpulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.45); } 100% { box-shadow: 0 0 0 26px rgba(255,255,255,0); } }
.alert-script { max-width: 46ch; margin: 18px auto 0; font-size: 15px; line-height: 1.5; background: rgba(255,255,255,.08); border-radius: 14px; padding: 14px 16px; text-align: left; }
.alert-actions .btn { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.28); }
.alert-actions .btn:hover { background: rgba(255,255,255,.2); }
.alert-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.alertring .ringactions { margin-top: 32px; }
@media (prefers-reduced-motion: reduce) { .alertring .tile-avatar.pulse { animation: none; } }

/* Sign in / sign up switch and the powered-by line */
.switchauth { text-align: center; margin-top: 18px; font-size: 14.5px; color: var(--ink-2); }
.switchauth .linkbtn { font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; }
.poweredby { text-align: center; font-size: 12px; color: var(--ink-3); padding: 18px 16px 6px; letter-spacing: .01em; }
.poweredby b { color: var(--brand); font-weight: 700; }
.landing .poweredby { padding-bottom: calc(18px + var(--safe-b)); }

.landing .quick { flex-wrap: nowrap; }
.landing .quick .btn { min-height: 38px; padding: 6px 12px; font-size: 13.5px; white-space: nowrap; }
/* Keep the powered-by line at the foot of short pages. */
.main { display: flex; flex-direction: column; }
.main > * { min-width: 0; }
.main > .poweredby { margin-top: auto; }
