:root {
  --ground: #f4f6fa;
  --surface: #fff;
  --ink: #1b2b43;
  --ink-2: #617087;
  --ink-3: #748299;
  --line: #e5eaf1;
  --line-strong: #cbd5e2;
  --accent: #525bd4;
  --accent-tint: #eff0ff;
  --signal: #ce3f5c;
  --signal-tint: #fff0f3;
  --support: #178576;
  --admin: #6456c4;
  --other: #b37719;
  --done: #9aa7b9;
  --ok: #178576;
  --sidebar: 218px;
  --shadow: 0 3px 18px #18294b05, 0 1px 3px #18294b03;
  --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; color-scheme: light; }
body { margin: 0; height: 100%; background: var(--ground); color: var(--ink); font: 14px/1.5 var(--font); font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.025em; }
h2 { font-size: 28px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.center { text-align: center; }
.error, .bad { color: var(--signal); }
.bad { font-weight: 650; }
.stars { color: var(--other); letter-spacing: .05em; white-space: nowrap; }
.icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex: none; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .16em; color: var(--ink-3); }
:focus-visible { outline: 3px solid #8189ee; outline-offset: 3px; }
* { scrollbar-width: thin; scrollbar-color: #cbd4e2 transparent; }

/* Controls share one geometry across inbox, reports and administration. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 15px; border: 1px solid var(--accent); border-radius: 9px; background: var(--accent); color: #fff; font: 600 13px/1.4 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 3px #525bd411; }
.btn:hover { background: #444cbf; border-color: #444cbf; }
.btn:disabled { opacity: .55; cursor: default; }
.btn .icon { width: 16px; height: 16px; }
.btn-quiet { color: var(--ink-2); background: var(--surface); border-color: var(--line-strong); box-shadow: none; }
.btn-quiet:hover { color: var(--ink); background: #f5f7fc; border-color: #aab8cd; }
.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-danger { color: var(--signal); border-color: #efc7d0; }
.btn-danger:hover { color: var(--signal); background: var(--signal-tint); border-color: #e8aebc; }
.btn-danger-solid { color: #fff; background: var(--signal); border-color: var(--signal); }
.btn-danger-solid:hover { background: #b52e4a; border-color: #b52e4a; }
input, textarea, select { min-width: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--surface); font: inherit; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, textarea:hover, select:hover { border-color: #aab8cd; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: none; }
label { display: flex; flex-direction: column; gap: 7px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
label input, label select { color: var(--ink); font-size: 14px; font-weight: 400; }
.form-error, .form-ok { margin: 0; font-size: 13px; }
.form-error { color: var(--signal); }
.form-ok { color: var(--ok); }
.stack { display: flex; flex-direction: column; gap: 18px; width: 100%; max-width: 440px; }
.stack .btn { align-self: flex-start; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { padding: 7px 10px; width: 180px; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }
.tabs { display: flex; gap: 3px; padding: 4px; width: fit-content; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #eceff5; }
.tabs button { padding: 7px 14px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font: 600 12px/1.4 var(--font); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"], .tabs button[aria-pressed="true"] { color: var(--accent); background: #fff; box-shadow: 0 1px 4px #1b2b4310; }

/* A quiet dark sidebar gives the work area a clear visual hierarchy. */
.app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); grid-template-rows: 74px minmax(0, 1fr); position: relative; overflow: hidden; }
.sidebar { grid-column: 1; grid-row: 1 / -1; display: flex; flex-direction: column; min-height: 0; padding: 26px 15px 20px; color: #d0daec; background: #14253e; border-right: 1px solid #253753; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-size: 16px; font-weight: 700; letter-spacing: -.035em; color: #fff; }
.brand-mark { width: 36px; height: 39px; color: #14253e; background: #99e2d3; border-radius: 11px 11px 11px 3px; }
.brand-mark .icon { width: 22px; height: 22px; }
.brand small { display: block; margin-top: 5px; font-size: 8px; letter-spacing: .16em; font-weight: 500; color: #a2b1c9; }
.nav-caption { margin: 40px 12px 12px; font-size: 9px; letter-spacing: .15em; font-weight: 600; color: #8e9eb8; }
.nav { display: flex; flex-direction: column; gap: 5px; min-height: 0; overflow-y: auto; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid transparent; border-radius: 9px; color: #b9c7dc; text-decoration: none; font-size: 13px; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: #fff; background: #20334f; }
.nav a[aria-current="page"] { color: #fff; background: #2b3d5c; border-color: #3a4c6a; box-shadow: 0 3px 9px #07162818; }
.nav a[aria-current="page"] > [data-icon] { color: #a1e8d9; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 4px; background: #a1e8d9; }
.nav .pill { margin-left: auto; }
.nav-account { margin-top: 12px; }
.sidebar-footer { display: flex; align-items: flex-start; gap: 9px; margin-top: auto; padding: 22px 9px 0; color: #9aacbe; }
.sidebar-footer > [data-icon] { color: #9bd9cc; }
.sidebar-footer b { display: block; font-size: 10px; font-weight: 600; color: #c7d3e6; }
.sidebar-footer p { font-size: 10px; margin-top: 4px; line-height: 1.6; }
.top { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 20px; min-width: 0; padding: 0 28px; border-bottom: 1px solid var(--line); background: #ffffffed; }
.workspace-heading { display: flex; gap: 12px; align-items: center; margin-right: auto; min-width: 0; font-size: 13px; white-space: nowrap; }
.workspace-label { color: var(--ink-3); font-size: 12px; }
.workspace-label > span { margin-left: 12px; color: var(--line-strong); }
.workspace-heading strong { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.today-date { color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.connection-status { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; color: var(--ink-2); white-space: nowrap; }
.conn { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--done); flex: none; }
.conn[data-state="on"] { background: var(--support); box-shadow: 0 0 0 3px #17857613; }
.conn[data-state="off"] { background: var(--other); }
.presence { display: flex; align-items: center; }
.presence:empty { display: none; }
.avatar { display: inline-grid; place-items: center; width: 31px; height: 31px; border: 2px solid var(--surface); border-radius: 11px; color: #fff; background: var(--accent); font-size: 11px; font-weight: 650; line-height: 1; flex: none; }
.presence .avatar { width: 27px; height: 27px; margin-left: -7px; border-radius: 50%; background: #dce4f6; color: #344977; }
.presence .avatar:first-child { margin-left: 0; }
.me { display: flex; gap: 10px; align-items: center; padding-left: 18px; border-left: 1px solid var(--line); }
.me-avatar { background: #eaeafc; color: var(--accent); border: 0; width: 34px; height: 34px; }
.me-identity { display: flex; flex-direction: column; max-width: 110px; }
.me a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 12px; font-weight: 650; text-decoration: none; }
.me a:hover { color: var(--accent); }
.me small { font-size: 10px; color: var(--ink-3); }
.me #logoutBtn { margin-left: 6px; }
.view { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; overflow: auto; padding: 24px; }
#syncStatus { position: absolute; z-index: 5; top: 82px; right: 30px; max-width: min(500px, calc(100% - 32px)); padding: 10px 16px; background: #fff; box-shadow: 0 6px 24px #14253e18; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-2); }

/* Management pages, KPI cards and exact-data tables. */
.page { max-width: 1160px; margin: 0 auto; padding: 7px 7px 40px; }
.page.wide { max-width: 1440px; }
.page.narrow { max-width: 620px; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin: 0 0 26px; }
.page-heading { min-width: 0; }
.page-heading .eyebrow { margin-bottom: 9px; }
.page-heading h2 { font-size: 29px; }
.page-description { margin-top: 9px; color: var(--ink-2); font-size: 13px; }
.page-actions { display: flex; align-items: center; gap: 12px; }
.page > .tabs { margin: 0 0 20px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.group-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { --tone: var(--accent); --tint: var(--accent-tint); padding: 19px 20px 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.tone-teal { --tone: #178576; --tint: #e8f6f1; }
.tone-blue { --tone: #347fc0; --tint: #eaf3ff; }
.tone-amber { --tone: #ad791b; --tint: #fff7e5; }
.tone-rose { --tone: #ce3f5c; --tint: #fff0f3; }
.tile-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 34px; }
.tile-label { color: var(--ink-2); font-size: 12px; font-weight: 500; }
.tile-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--tint); color: var(--tone); flex: none; }
.tile-icon .icon { width: 17px; height: 17px; }
.tile-value { margin-top: 9px; font-size: 32px; font-weight: 700; letter-spacing: -.045em; line-height: 1.2; overflow-wrap: anywhere; }
.tile-value.hot { color: var(--signal); }
.tile-sub { margin-top: 9px; color: var(--ink-3); font-size: 11px; }
.summary-tiles .tile:nth-child(n + 5) .tile-value { font-size: 26px; }
.summary-trend { margin-bottom: 24px; }
.table-card { margin: 22px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); overflow: hidden; }
.table-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.table-heading h3 { font-size: 14px; }
.table-heading p { color: var(--ink-3); font-size: 11px; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 12px; }
.table th, .table td { text-align: left; padding: 15px 17px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { padding-top: 12px; padding-bottom: 12px; font-size: 10px; color: var(--ink-2); font-weight: 600; background: #f8f9fc; white-space: nowrap; }
.table td { white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfe; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.inactive td { color: var(--ink-3); }
.table td .actions { display: flex; gap: 7px; justify-content: flex-end; }
.table a { text-decoration: none; font-weight: 600; color: var(--accent); }
.table a:hover { text-decoration: underline; }
.table .empty-state { white-space: normal; }
.table-person { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.table-person .avatar { width: 30px; height: 30px; border: 0; font-size: 10px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #f4f6ff; }
.table tr[data-selected="true"] td { background: #eff1ff; }
.table-link { border: 0; padding: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.table-link:hover { color: var(--accent); }
.group-table td:first-child { min-width: 205px; max-width: 270px; white-space: normal; }
.group-table td:first-child .muted { display: block; margin-top: 3px; font-size: 10px; }
.group-table th, .group-table td { padding-left: 12px; padding-right: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin: 0 0 20px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.filters label { flex: 1; min-width: 130px; }
.filters input, .filters select { width: 100%; font-size: 12px; }
.filters .btn { align-self: flex-end; }
.results-caption { display: flex; align-items: center; gap: 9px; color: var(--ink-2); font-size: 12px; margin: 22px 2px -8px; }
.results-caption > .icon { color: var(--other); width: 16px; height: 16px; }
.results-caption .count-badge { margin-left: auto; }
.count-badge { display: inline-flex; justify-content: center; align-items: center; min-width: 24px; padding: 3px 9px; background: #eaf0f8; color: #566681; border-radius: 6px; font-size: 10px; font-weight: 600; }
.page > .form-error { margin-top: 14px; }
.page > .btn { margin-top: 18px; }

/* Graphs use real values; zero activity gets an explicit empty state. */
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 20px 0; }
.charts > :only-child { grid-column: 1 / -1; }
.chart { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.chart h4 { margin: 0 0 18px; font-size: 14px; color: var(--ink); font-weight: 650; }
.chart-heading { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.chart-heading h3 { font-size: 15px; }
.chart-heading p { margin-top: 5px; color: var(--ink-3); font-size: 11px; }
.chart-period { display: flex; align-items: center; gap: 6px; flex: none; color: var(--ink-2); font-size: 10px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.chart-period .icon { width: 13px; height: 13px; }
.legend { display: flex; justify-content: flex-end; gap: 16px; margin: 4px 0 8px; color: var(--ink-2); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--accent); }
.swatch.teal { background: var(--support); }
.trend-svg { display: block; width: 100%; max-height: 280px; overflow: visible; }
.daily-chart { container-type: inline-size; }
@container (max-width: 480px) {
  .daily-chart .axis-label { font-size: 18px; }
}
.chart-grid { stroke: #e8edf5; stroke-dasharray: 3 4; }
.axis-label { fill: var(--ink-3); font: 10px var(--font); }
.trend-area { fill: var(--accent); opacity: .065; }
.trend-line { stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.trend-line.series-0 { stroke: var(--accent); }
.trend-line.series-1 { stroke: var(--support); }
.trend-point { stroke: #fff; stroke-width: 2; }
.trend-point.series-0 { fill: var(--accent); }
.trend-point.series-1 { fill: var(--support); }
.chart-empty { min-height: 215px; display: grid; place-items: center; background: repeating-linear-gradient(to top, transparent 0 51px, #eef1f7 51px 52px); border-radius: 8px; }
.hbar { display: grid; grid-template-columns: 72px minmax(0, 1fr) 32px; align-items: center; gap: 14px; padding: 8px 0; font-size: 12px; }
.hbar.wide { grid-template-columns: 200px minmax(0, 1fr) 40px; }
.hbar-label { color: var(--ink-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hbar-track { height: 9px; overflow: hidden; background: #f0f3f8; border-radius: 8px; }
.hbar-fill { display: block; height: 100%; border-radius: 8px; }
.hbar-fill.ink { background: var(--accent); }
.hbar-fill.star { background: #e6b659; }
.hbar-fill.ns { background: #e28394; }
.hbar-fill.type-support { background: var(--support); }
.hbar-fill.type-admin { background: var(--admin); }
.hbar-fill.type-other { background: var(--other); }
.hbar-value { text-align: right; font-weight: 600; }

/* Conversation workspace. All three panes remain independently scrollable. */
.inbox { display: grid; grid-template-columns: 166px 294px minmax(0, 1fr); height: 100%; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.rail { display: flex; flex-direction: column; min-width: 0; overflow: auto; padding: 17px 8px; gap: 5px; background: #f9fafe; border-right: 1px solid var(--line); }
.rail-head { padding: 4px 10px 12px; color: var(--ink-3); font-size: 10px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.rail-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 6px; width: 100%; padding: 11px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.rail-item:hover { background: #edf0f8; }
.rail-item[aria-pressed="true"] { color: var(--accent); background: #eaeefb; border-color: #dee4f6; }
.rail-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; font-weight: 600; }
.rail-meta { grid-column: 1; margin-top: 4px; color: var(--ink-3); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-item .pill { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.pill { padding: 3px 6px; border-radius: 6px; background: var(--signal); color: #fff; font-size: 10px; font-weight: 600; line-height: 1.2; }
.list-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #fff; border-right: 1px solid var(--line); }
.list-head { padding: 18px 15px 14px; display: flex; flex-direction: column; gap: 13px; border-bottom: 1px solid var(--line); }
.list-title { display: flex; justify-content: space-between; align-items: center; }
.list-title h2 { font-size: 17px; }
.search-field { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8f9fc; }
.search-field > .icon { width: 15px; height: 15px; color: var(--ink-3); }
.search-field input { width: 100%; border: 0; padding: 9px 0; background: transparent; font-size: 12px; }
.search-field:focus-within { border-color: var(--accent); }
.list-head .tabs { width: 100%; border: 0; padding: 3px; }
.list-head .tabs button { flex: 1; padding: 7px 10px; }
.convs { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; min-height: 0; }
.section { display: flex; justify-content: space-between; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 1; padding: 10px 15px 8px; background: #fff; color: var(--ink-3); font-size: 9px; font-weight: 600; letter-spacing: .035em; }
.section > span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.section-count { flex: none; font-weight: 500; }
.conv { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; row-gap: 3px; padding: 14px 13px; border: 1px solid transparent; border-bottom-color: #f0f2f7; border-left-width: 3px; cursor: pointer; }
.conv:hover { background: #f8f9fd; }
.conv[aria-selected="true"] { background: #f0f2ff; border-left-color: var(--accent); }
.conv[data-status="closed"] { color: var(--ink-2); }
.conv-avatar { grid-column: 1; grid-row: 1 / span 3; width: 32px; height: 34px; border: 0; border-radius: 10px; margin-top: 2px; font-size: 10px; }
.conv-top, .conv-tags, .conv-preview { grid-column: 2; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 5px; }
.conv-name { font-weight: 650; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conv-top time { color: var(--ink-3); font-size: 9px; white-space: nowrap; }
.conv-tags { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--ink-2); }
.conv-group, .conv-closed { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 13px; margin-top: 2px; color: var(--ink-2); font-size: 11px; }
.dot { position: absolute; right: 14px; bottom: 17px; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.list-empty { color: var(--ink-2); padding: 16px 6px; }
.list-pane > .list-empty { margin-top: auto; margin-bottom: auto; }
.list-pane:has(> .list-empty:not([hidden])) .convs { flex: 0; }
.thread-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f5f7fc; }
.thread-empty { margin: auto; padding: 30px; max-width: 520px; width: 100%; text-align: center; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 440px; margin: 0 auto; padding: 32px 18px; text-align: center; }
.empty-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border: 1px solid #dfe5f5; border-radius: 18px; color: #727dba; background: #f0f3fb; box-shadow: 0 0 0 7px #f8f9fd; margin-bottom: 5px; }
.empty-icon .icon { width: 26px; height: 26px; }
.empty-state strong { display: block; font-size: 16px; line-height: 1.45; color: var(--ink); font-weight: 600; letter-spacing: -.02em; }
.empty-state p { color: var(--ink-3); font-size: 12px; line-height: 1.8; max-width: 310px; }
.list-empty .empty-state { padding: 22px 12px; }
.list-empty .empty-icon { width: 44px; height: 44px; border-radius: 14px; }
.list-empty .empty-icon .icon { width: 20px; height: 20px; }
.list-empty .empty-state strong { font-size: 13px; }
.list-empty .empty-state p { font-size: 11px; }
.empty-features { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 10px; }
.empty-features span { display: flex; align-items: center; gap: 6px; }
.empty-features .icon { width: 14px; height: 14px; }
.thread { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); background: #fff; flex: none; }
.thread-head .back, .profile .back { display: none; }
.thread-who { flex: 1; min-width: 0; }
.thread-title { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.thread-title .name { font-size: 14px; }
.thread-head .uname { font-size: 11px; color: var(--ink-3); }
.thread-where { margin-top: 4px; font-size: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-actions { display: flex; gap: 7px; }
.thread-actions .btn { font-size: 11px; min-height: 33px; padding: 6px 11px; }
.msgs { flex: 1; min-height: 0; overflow: auto; padding: 23px 22px 14px; display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: min(82%, 640px); align-self: flex-start; padding: 12px 15px 9px; border: 1px solid #e0e5ef; border-radius: 13px 13px 13px 3px; background: #fff; box-shadow: 0 2px 3px #18294b03; font-size: 13px; }
.bubble.agent { align-self: flex-end; background: #eaeefe; border-color: #dfe4fa; color: #263d71; border-radius: 13px 13px 3px 13px; }
.bubble.failed { border-color: #eebec9; background: var(--signal-tint); color: var(--ink); }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.bubble-meta { margin-top: 7px; font-size: 9px; color: var(--ink-3); }
.bubble.agent .bubble-meta { color: #697aa2; }
.bubble-err { font-size: 11px; color: var(--signal); margin-top: 5px; }
.sys { align-self: center; text-align: center; font-size: 10px; color: var(--ink-2); margin: 8px 0; }
.sys time { display: block; color: var(--ink-3); font-size: 9px; margin-top: 2px; }
.sys-closed span, .sys-rated span { font-weight: 600; color: var(--ink); }
.sys-not_solved span { font-weight: 600; color: var(--signal); }
.typing-line { padding: 0 22px 8px; font-size: 11px; color: var(--ink-2); }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 16px 18px; border-top: 1px solid var(--line); background: #fff; flex: none; }
.composer textarea { flex: 1; max-height: 160px; min-height: 42px; line-height: 1.5; background: #f8f9fd; font-size: 13px; }
.composer .btn { min-height: 42px; }
.composer-note, .composer-error { padding: 10px 18px; font-size: 12px; background: #fff; border-top: 1px solid var(--line); }
.composer-note { color: var(--ink-2); }
.composer-error { color: var(--signal); }
.media { display: block; max-width: 100%; margin-bottom: 7px; }
.media img { display: block; max-width: 100%; max-height: 360px; border-radius: 9px; }
.media.file { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.media.file:hover { text-decoration: underline; }
.media.file.blocked { color: var(--ink-2); cursor: not-allowed; }
audio.media, video.media { width: 100%; max-width: 420px; }

/* Shared semantic chips and team profiles. */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 5px; background: #f0f3f8; color: var(--ink-2); font-size: 10px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.chip-support { background: #e5f5ee; color: #237962; }
.chip-admin, .chip-role { background: #eeeafa; color: #6653ae; }
.chip-other, .chip-star { background: #fff3d9; color: #976b17; }
.chip-bad { background: var(--signal-tint); color: var(--signal); }
.chip-muted { background: #f0f3f8; color: var(--ink-3); }
.online-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); margin-right: 6px; vertical-align: middle; }
.online-dot.on { background: var(--support); }
.members { display: grid; grid-template-columns: 304px minmax(0, 1fr); height: 100%; min-height: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.members-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: #fff; }
.members-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 17px 6px; }
.members-head h2 { font-size: 18px; }
.members-count { font-size: 11px; color: var(--ink-3); margin: 0 17px 16px; }
.members-list > input { margin: 0 17px 14px; padding: 10px; font-size: 12px; background: #f8f9fc; }
.chips { display: flex; gap: 5px; padding: 0 17px 16px; flex-wrap: wrap; }
.chip-btn { padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-2); background: #fff; font: 500 11px/1.4 var(--font); cursor: pointer; }
.chip-btn[aria-pressed="true"] { color: var(--accent); background: #eff1ff; border-color: #dde1fc; }
.member-cards { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; border-top: 1px solid var(--line); }
.member-card { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 17px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.member-card:hover { background: #f8f9fd; }
.member-card[aria-pressed="true"] { background: #f0f2ff; box-shadow: inset 3px 0 var(--accent); }
.member-card.inactive { opacity: .65; }
.member-card .avatar { width: 36px; height: 38px; border: 0; border-radius: 11px; font-size: 12px; }
.member-card-body { min-width: 0; flex: 1; }
.member-card-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.member-card-meta { display: flex; align-items: center; margin-top: 4px; color: var(--ink-2); font-size: 10px; }
.member-card-stats { display: flex; gap: 10px; margin-top: 7px; color: var(--ink-3); font-size: 10px; }
.member-profile { min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; background: #f6f8fc; }
.profile { padding: 23px 24px 36px; width: 100%; max-width: 1180px; margin: 0 auto; }
.profile-head { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(110deg, #fff 65%, #f0f4ff); box-shadow: var(--shadow); }
.avatar.lg { width: 55px; height: 58px; font-size: 18px; border-radius: 16px; border: 0; }
.profile-id { min-width: 0; flex: 1; }
.profile-name { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.profile-name h3 { font-size: 21px; }
.profile-meta { display: flex; align-items: center; flex-wrap: wrap; margin-top: 7px; font-size: 10px; color: var(--ink-2); }
.toolbar { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; width: 100%; padding-top: 18px; margin-top: 4px; border-top: 1px solid var(--line); }
.confirm { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 4px 5px 4px 9px; border: 1px solid #edcbd3; border-radius: 7px; font-size: 11px; background: #fff8fa; }
.confirm-q { font-weight: 600; }
.inline-area { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.inline-area .inline-form label { flex-direction: row; align-items: center; gap: 8px; }
.profile-section { margin-top: 22px; }
.section-head { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-head h4, .profile-section > h4 { font-size: 13px; font-weight: 600; color: var(--ink); }
.profile-section > h4 { margin-bottom: 14px; }
.section-head .tabs { padding: 3px; }
.section-head .tabs button { padding: 5px 9px; font-size: 10px; }
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.strip-cell { padding: 17px 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.strip-cell:nth-child(4n) { border-right: 0; }
.strip-value { font-size: 23px; font-weight: 650; line-height: 1.3; letter-spacing: -.035em; overflow-wrap: anywhere; }
.strip-value .stars { font-size: 11px; letter-spacing: 0; }
.strip-label { margin-top: 7px; color: var(--ink-2); font-size: 10px; }
.strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 20px; }
.recent { list-style: none; margin: 0; padding: 7px 15px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.recent li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; padding: 12px 0; font-size: 11px; border-bottom: 1px solid var(--line); }
.recent li:last-child { border-bottom: 0; }
.recent .when { min-width: 96px; color: var(--ink-3); font-size: 10px; }
.recent a { text-decoration: none; color: var(--accent); font-weight: 600; }
.recent a:hover { text-decoration: underline; }
.detail { padding: 24px; margin-top: 22px; border: 1px solid #d9dfef; border-radius: 13px; background: #fff; box-shadow: 0 4px 24px #14253e08; }
.detail-head { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.detail-head h3 { display: inline-flex; align-items: center; gap: 8px; font-size: 19px; }
.detail-meta { color: var(--ink-3); font-size: 11px; margin-top: 7px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.detail .charts { margin-bottom: 0; }
.account-page { max-width: 1080px; }
.account-identity { display: flex; align-items: center; gap: 17px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 22px; }
.account-identity h3 { font-size: 19px; }
.account-identity p { margin-top: 5px; font-size: 12px; color: var(--ink-3); }
.account-identity > .chip { margin-left: auto; }
.account-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
.settings-card { padding: 28px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.settings-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; color: var(--accent); background: var(--accent-tint); border-radius: 12px; margin-bottom: 18px; }
.settings-card h3 { font-size: 17px; }
.settings-card > p { font-size: 12px; line-height: 1.8; margin-top: 8px; margin-bottom: 24px; }
.dialog { width: min(92vw, 440px); padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 24px 80px #14253e35; }
.dialog::backdrop { background: #14253e70; backdrop-filter: blur(3px); }
.dialog h3 { margin-bottom: 22px; font-size: 22px; }
.dialog .stack { max-width: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 8px; }

/* Login: editorial brand side, focused access form, no fabricated live statistics. */
.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr); min-height: 100vh; min-height: 100dvh; }
.login-story { display: flex; flex-direction: column; position: relative; isolation: isolate; overflow: hidden; padding: 44px 9%; color: #dbe5f1; background: #14253e; }
.login-story::before { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at 95% 5%, #34596755, transparent 60%), radial-gradient(ellipse at 0% 100%, #35458750, transparent 50%); }
.login-story::after { content: ""; position: absolute; z-index: -1; width: 520px; height: 520px; right: -250px; top: 15%; border: 1px solid #ffffff09; border-radius: 50%; box-shadow: 0 0 0 70px #ffffff03, 0 0 0 140px #ffffff02; }
.login-intro { margin: auto 0; padding: 55px 0; max-width: 500px; }
.login-intro > .eyebrow { color: #a0c8c5; font-size: 10px; letter-spacing: .2em; }
.login-intro h1 { margin: 22px 0; font-size: clamp(35px, 3.7vw, 56px); line-height: 1.17; font-weight: 650; letter-spacing: -.05em; color: #fff; }
.login-intro h1 em { color: #a0e0d3; font-style: normal; }
.login-intro > p { max-width: 380px; font-size: 14px; line-height: 1.9; color: #aabbd1; }
.login-illustration { display: flex; flex-direction: column; gap: 11px; max-width: 405px; margin-top: 38px; }
.illustration-card { display: flex; align-items: center; gap: 14px; padding: 15px 19px; border: 1px solid #aec5e51c; border-radius: 12px; background: #ffffff06; }
.illustration-card:nth-child(2) { margin-left: 24px; background: #ffffff09; }
.illustration-card:nth-child(3) { margin-left: 8px; }
.illustration-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #a1e4d617; color: #a1e4d6; }
.illustration-card b { font-size: 12px; font-weight: 600; color: #e8eff9; }
.illustration-card div > span { display: block; color: #aabbd1; margin-top: 3px; font-size: 10px; }
.illustration-dot { width: 6px; height: 6px; background: #9fe3d5; border-radius: 50%; margin-left: auto; }
.login-signature { font-size: 10px; color: #8ea3be; }
.login-form-side { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 50px 35px; background: #fafbfd; }
.login-card { display: flex; flex-direction: column; gap: 20px; width: min(100%, 385px); margin: auto; }
.login-symbol { align-self: flex-start; display: grid; place-items: center; width: 50px; height: 50px; background: #eceefd; color: var(--accent); border: 1px solid #e4e7fa; border-radius: 14px; margin-bottom: 16px; }
.login-symbol .icon { width: 24px; height: 24px; }
.login-card > .eyebrow { color: var(--accent); font-size: 10px; }
.login-card h2 { font-size: 30px; margin-top: -9px; }
.login-description { margin-top: -10px; margin-bottom: 12px; color: var(--ink-2); font-size: 13px; }
.login-card input { padding: 13px 14px; border-color: #dbe2ed; box-shadow: 0 2px 2px #14253e02; }
.login-card > .btn { justify-content: space-between; margin-top: 4px; padding: 14px 17px; font-size: 14px; border-radius: 9px; }
.login-help { text-align: center; color: var(--ink-3); font-size: 11px; line-height: 1.8; }
.login-footer { margin-top: 45px; font-size: 10px; color: var(--ink-3); }

/* Smaller desktops keep the workspace wide; all navigation remains accessible. */
@media (max-width: 1240px) and (min-width: 801px) {
  :root { --sidebar: 76px; }
  .sidebar { padding: 25px 11px 20px; align-items: center; }
  .sidebar .brand-name, .nav-caption, .sidebar-footer, .nav-label { display: none; }
  .nav { margin-top: 34px; width: 100%; overflow: visible; }
  .nav a { justify-content: center; padding: 13px 0; }
  .nav a .pill { position: absolute; right: 0; top: 2px; font-size: 8px; min-width: 15px; padding: 2px 4px; }
  .top { padding: 0 22px; gap: 16px; }
  .workspace-label, .today-date { display: none; }
  .view { padding: 18px; }
  .inbox { grid-template-columns: 148px 270px minmax(0, 1fr); }
  .thread-head { flex-wrap: wrap; padding: 14px; }
  .thread-who { flex-basis: 100%; }
  .thread-actions { margin-left: auto; }
  .members { grid-template-columns: 270px minmax(0, 1fr); }
  .profile { padding: 18px; }
  .tiles { gap: 12px; }
  .tile { padding: 15px; }
  .tile-label { font-size: 11px; }
  .tile-icon { width: 29px; height: 29px; }
}

/* Mobile: compact header + scrollable navigation; the composer stays at the bottom. */
@media (max-width: 800px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 58px 52px minmax(0, 1fr); }
  .top { grid-column: 1; grid-row: 1; padding: 0 14px; gap: 12px; }
  .workspace-heading { font-size: 13px; }
  .workspace-label, .today-date, .me-identity, .me-avatar { display: none; }
  .presence { max-width: 64px; flex: none; overflow-x: auto; scrollbar-width: none; }
  .presence::-webkit-scrollbar { display: none; }
  .connection-status { font-size: 9px; gap: 6px; }
  .me { padding-left: 0; border-left: 0; gap: 0; }
  .me #logoutBtn { margin: 0; }
  .sidebar { grid-column: 1; grid-row: 2; padding: 5px 8px; border-right: 0; min-width: 0; }
  .sidebar .brand, .nav-caption, .sidebar-footer { display: none; }
  .nav { flex-direction: row; gap: 5px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; min-width: 0; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { gap: 7px; padding: 8px 11px; font-size: 11px; flex: none; border-radius: 7px; }
  .nav a[aria-current="page"]::before { display: none; }
  .nav a .icon { width: 16px; height: 16px; }
  .nav-account { margin-top: 0; }
  .view { grid-column: 1; grid-row: 3; padding: 0; }
  #syncStatus { top: 117px; right: 10px; font-size: 12px; }
  .page { padding: 24px 16px 36px; }
  .page-head { gap: 16px; margin-bottom: 22px; }
  .page-heading h2 { font-size: 25px; }
  .page-description { font-size: 12px; line-height: 1.8; }
  .page-heading .eyebrow { font-size: 9px; }
  .page-actions .btn { font-size: 12px; }
  .tiles, .group-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
  .tile { padding: 13px; border-radius: 10px; }
  .tile-top { align-items: flex-start; gap: 5px; }
  .tile-label { font-size: 11px; }
  .tile-icon { width: 27px; height: 27px; border-radius: 8px; }
  .tile-icon .icon { width: 14px; height: 14px; }
  .tile-value { font-size: 28px; margin-top: 7px; }
  .summary-tiles .tile:nth-child(n + 5) .tile-value { font-size: 24px; }
  .tile-sub { font-size: 10px; line-height: 1.6; }
  .table-heading { padding: 17px 15px; align-items: flex-start; flex-direction: column; gap: 7px; }
  .table-heading h3 { font-size: 13px; }
  .table th, .table td { padding: 12px; }
  .table td .actions { flex-wrap: wrap; }
  .filters { padding: 14px; gap: 12px; }
  .filters label { min-width: calc(50% - 12px); flex-basis: calc(50% - 12px); }
  .charts { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .chart { padding: 17px 15px; }
  .chart-heading h3 { font-size: 14px; }
  .chart-heading p { font-size: 10px; }
  .chart-period { font-size: 9px; }
  .chart-empty { min-height: 180px; }
  .hbar.wide { grid-template-columns: 105px minmax(0, 1fr) 30px; }
  .hbar { font-size: 11px; gap: 10px; }
  .inbox { border: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .inbox.show-thread { grid-template-rows: minmax(0, 1fr); }
  .rail { flex-direction: row; overflow-x: auto; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); gap: 6px; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail-head { display: none; }
  .rail-item { display: inline-flex; gap: 7px; align-items: center; flex: none; width: auto; max-width: 210px; padding: 7px 10px; border-color: var(--line); background: #fff; border-radius: 7px; }
  .rail-title { font-size: 10px; }
  .rail-meta { display: none; }
  .list-head { padding: 16px; gap: 12px; }
  .list-pane { border-right: 0; }
  .conv { grid-template-columns: 38px minmax(0, 1fr); padding: 15px 16px; column-gap: 12px; }
  .conv-avatar { width: 36px; height: 38px; font-size: 11px; }
  .conv-name { font-size: 13px; }
  .conv-preview { font-size: 12px; }
  .conv-top time { font-size: 10px; }
  .thread-pane { display: none; }
  .inbox.show-thread .rail, .inbox.show-thread .list-pane { display: none; }
  .inbox.show-thread .thread-pane { display: flex; }
  .thread-head { gap: 9px; padding: 13px 12px; }
  .thread-head .back { display: inline-flex; font-size: 11px; padding: 6px 9px; min-height: 33px; }
  .thread-actions a.btn-quiet { display: none; }
  .thread-title { gap: 5px; }
  .thread-title .name { font-size: 13px; }
  .thread-head .uname { font-size: 10px; }
  .thread-where { font-size: 9px; }
  .msgs { padding: 17px 13px 12px; }
  .bubble { max-width: 88%; font-size: 13px; padding: 10px 12px 8px; }
  .composer { padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); gap: 8px; }
  .composer textarea { font-size: 16px; min-height: 44px; }
  .composer .btn { min-height: 44px; padding: 10px 14px; }
  .members { grid-template-columns: minmax(0, 1fr); border: 0; border-radius: 0; }
  .member-profile { display: none; }
  .members.show-thread .members-list { display: none; }
  .members.show-thread .member-profile { display: flex; }
  .members-list { border-right: 0; }
  .profile { padding: 16px 13px 32px; }
  .profile .back { display: inline-flex; margin-bottom: 14px; }
  .profile-head { padding: 18px; gap: 13px; }
  .profile-name h3 { font-size: 19px; }
  .strip, .strip.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-cell { padding: 14px; }
  .strip-cell:nth-child(even) { border-right: 0; }
  .strip-value { font-size: 23px; }
  .detail { padding: 18px 14px; }
  .detail-head h3 { font-size: 17px; }
  .detail-actions { margin-left: 0; }
  .account-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .account-identity { padding: 20px; gap: 13px; }
  .settings-card { padding: 23px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-story { padding: 24px 28px 28px; }
  .login-intro { margin: 0; padding: 32px 0 0; }
  .login-intro > .eyebrow { font-size: 8px; }
  .login-intro h1 { font-size: 32px; margin: 14px 0 0; }
  .login-intro > p, .login-illustration, .login-signature { display: none; }
  .login-form-side { padding: 32px 26px 24px; }
  .login-card { gap: 17px; }
  .login-card h2 { font-size: 26px; }
  .login-symbol, .login-card > .eyebrow { display: none; }
  .login-card input { font-size: 16px; }
  .login-description { font-size: 12px; margin-bottom: 5px; }
  .login-footer { margin-top: 30px; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a, .chip-btn { transition: background-color .15s, border-color .15s, color .15s; }
  .conn[data-state="on"] { animation: live-glow 3s ease-in-out infinite; }
  @keyframes live-glow { 50% { box-shadow: 0 0 0 4px #17857608; } }
}
