/* Office Chat. One typeface (Anek Bangla) covers Latin and Bengali so mixed-language messages sit on one line cleanly. */
@font-face { font-family: "Anek Bangla"; src: url("/fonts/anek-bangla-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Anek Bangla"; src: url("/fonts/anek-bangla-bengali-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap;
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }

:root {
  --ink: #14212B; --ink-soft: #485863; --ink-faint: #7A8891;
  --river: #12343B; --river-deep: #0C272D; --river-text: #D3E2DF; --river-faint: #8DADA9; --river-line: #1F4850;
  --canvas: #F1F5F4; --surface: #FFFFFF; --line: #DBE3E2; --line-soft: #E9EEED;
  --jade: #14785F; --jade-dark: #0E5F4B; --jade-soft: #E2F1EB;
  --marigold: #F2B01E; --marigold-soft: #FFF4D6;
  --high: #BF3A30; --high-soft: #FBE9E7; --medium: #B86E00; --medium-soft: #FDF0D9; --low: #4F6F8C; --low-soft: #E8EEF4;
  --font: "Anek Bangla", "Nirmala UI", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); font-size: 15.5px; line-height: 1.45; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--jade-dark); }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
.sidebar :focus-visible, .login-brand :focus-visible { outline-color: var(--marigold); }
#root { height: 100%; }
.hidden { display: none !important; }
svg.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons and fields */
.btn { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: var(--r-sm); font-weight: 550; line-height: 1.3; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.btn:hover { border-color: #BCC9C7; background: #F8FAFA; }
.btn.primary { background: var(--jade); border-color: var(--jade); color: #fff; }
.btn.primary:hover { background: var(--jade-dark); border-color: var(--jade-dark); }
.btn.danger { color: var(--high); }
.btn.danger:hover { background: var(--high-soft); border-color: #E8B8B3; }
.btn.small { padding: 4px 10px; font-size: 14px; }
.btn.quiet { border-color: transparent; background: transparent; }
.btn.quiet:hover { background: var(--line-soft); }
.btn:disabled { opacity: .55; cursor: default; }
.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field > span { font-weight: 550; font-size: 14.5px; }
.field small, .hint { color: var(--ink-faint); font-size: 13.5px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=time], input[type=number], input[type=tel], input[type=date], select, textarea {
  border: 1px solid #C9D3D2; background: #fff; border-radius: var(--r-sm); padding: 8px 10px; width: 100%; }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--jade); outline-offset: 0; border-color: var(--jade); }
.check { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 14px; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--jade); flex: none; }
.error-text { color: var(--high); font-size: 14.5px; margin-bottom: 10px; }

/* ---------- sign in and first-time setup */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.login-brand { background: var(--river); color: var(--river-text); padding: clamp(28px, 6vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-brand h1 { color: #fff; font-size: clamp(34px, 5vw, 58px); line-height: 1.02; font-weight: 700; letter-spacing: -0.02em; max-width: 9ch; }
.login-brand p { max-width: 34ch; font-size: 17px; }
.login-brand .watch { display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid var(--river-line); padding-top: 18px; font-size: 14.5px; color: var(--river-faint); max-width: 40ch; }
.login-brand .watch svg { color: var(--marigold); margin-top: 2px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: var(--surface); }
.login-form form { width: min(360px, 100%); }
.login-form h2 { font-size: 24px; margin-bottom: 20px; letter-spacing: -0.01em; }
.setup { max-width: 620px; margin: 0 auto; padding: clamp(24px, 6vh, 64px) 20px; }
.setup h1 { font-size: 28px; letter-spacing: -0.01em; margin-bottom: 6px; }
.setup .lede { color: var(--ink-soft); margin-bottom: 22px; }
.notice { background: var(--marigold-soft); border-left: 4px solid var(--marigold); padding: 16px 18px; border-radius: 0 var(--r-md) var(--r-md) 0; margin-bottom: 18px; white-space: pre-wrap; }
.notice h2 { font-size: 16px; margin-bottom: 6px; }
@media (max-width: 760px) { .login { grid-template-columns: 1fr; } .login-brand { padding: 28px 24px; gap: 20px; } }

/* ---------- app shell */
.app { height: 100%; display: grid; grid-template-columns: 272px minmax(0, 1fr); }
.sidebar { background: var(--river); color: var(--river-text); display: flex; flex-direction: column; min-height: 0; }
.ws-name { padding: 16px 16px 10px; font-size: 19px; font-weight: 700; color: #fff; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-scroll { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.side-search { position: relative; margin: 0 12px 6px; }
.side-search .s-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--river-faint); display: flex; pointer-events: none; }
.side-search .s-icon svg.ic { width: 16px; height: 16px; }
.sidebar .side-search input { width: 100%; background: var(--river-deep); border: 1px solid var(--river-line); color: #fff; border-radius: var(--r-sm); padding: 7px 56px 7px 33px; }
.sidebar .side-search input::placeholder { color: var(--river-faint); }
.sidebar .side-search input:focus { outline: 2px solid var(--marigold); outline-offset: 0; border-color: transparent; background: #0A2025; }
.sidebar .side-search input::-webkit-search-cancel-button { display: none; }
.side-search .s-key { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 600 11.5px var(--font); color: var(--river-faint); border: 1px solid var(--river-line); border-radius: 4px; padding: 1px 5px; pointer-events: none; }
.side-search input:focus ~ .s-key { display: none; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 45; background: var(--surface); color: var(--ink); border-radius: var(--r-md); box-shadow: 0 14px 36px rgba(12, 39, 45, .35); padding: 6px; max-height: min(60vh, 440px); overflow-y: auto; }
.r-group { font-size: 13px; font-weight: 600; color: var(--ink-faint); padding: 6px 8px 3px; }
.result { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: var(--r-sm); }
.result.active { background: var(--jade-soft); }
.result .r-main { flex: 1; min-width: 0; display: grid; }
.result .r-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .r-main small { color: var(--ink-faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .r-icon { width: 26px; height: 26px; display: grid; place-items: center; color: var(--ink-soft); background: var(--line-soft); border-radius: 7px; flex: none; }
.result .r-icon svg.ic { width: 15px; height: 15px; }
.result .r-tail { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; }
.result.active .r-tail { color: var(--jade-dark); font-weight: 600; }
.r-empty { padding: 10px 8px; color: var(--ink-soft); font-size: 14px; }
.modal-body > div > input[type=search] { margin-bottom: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 8px 4px; color: var(--river-faint); font-size: 14px; font-weight: 550; }
.side-head .tools { display: flex; gap: 2px; }
.icon-btn { background: transparent; border: 0; padding: 5px; border-radius: var(--r-sm); display: inline-flex; color: inherit; }
.sidebar .icon-btn:hover { background: var(--river-line); color: #fff; }
.side-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border: 0; background: transparent; color: var(--river-text); border-radius: var(--r-sm); text-align: left; }
.side-item:hover { background: var(--river-line); }
.side-item.active { background: #fff; color: var(--river); font-weight: 600; }
.side-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item.unread { color: #fff; font-weight: 650; }
.side-item svg.ic { width: 16px; height: 16px; opacity: .75; }
.badge { background: var(--marigold); color: #2B1E00; font-size: 12.5px; font-weight: 700; padding: 0 7px; border-radius: 99px; line-height: 19px; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--river-faint); flex: none; margin: 0 3.5px; }
.dot.on { background: #5FD4A4; border-color: #5FD4A4; }
.side-empty { padding: 4px 8px; color: var(--river-faint); font-size: 14px; }
.side-foot { border-top: 1px solid var(--river-line); padding: 8px; display: grid; gap: 4px; }
.nudge { background: var(--river-deep); border: 1px solid var(--river-line); border-radius: var(--r-md); padding: 10px 11px; display: grid; gap: 8px; margin-bottom: 4px; }
.nudge-text b { display: block; color: #fff; font-weight: 650; }
.nudge-text span { color: var(--river-faint); font-size: 13.5px; }
.nudge-actions { display: flex; gap: 6px; }
.nudge .btn.primary { background: var(--marigold); border-color: var(--marigold); color: #2B1E00; }
.nudge .btn.primary:hover { background: #FFC23D; border-color: #FFC23D; }
.nudge-close { color: var(--river-text); }
.sidebar .nudge-close:hover { background: var(--river-line); color: #fff; }
.console-link { justify-content: space-between; }
.me-row { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 6px; }
.me-row .who { flex: 1; min-width: 0; }
.me-row .who b { display: block; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-row .who span { color: var(--river-faint); font-size: 13.5px; }

.avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13.5px; color: #fff; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 26px; height: 26px; font-size: 11.5px; border-radius: 7px; }
.avatar.lg { width: 88px; height: 88px; font-size: 30px; border-radius: 22px; }
.avatar.photo { background: var(--line-soft); overflow: hidden; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dot.away { background: #F2B01E; border-color: #F2B01E; }
.dot.busy { background: #E5604F; border-color: #E5604F; }
.side-status { font-size: 13px; line-height: 1; flex: none; }
.me-button { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; background: transparent; border: 0; padding: 2px; border-radius: var(--r-sm); text-align: left; color: inherit; }
.me-button:hover { background: var(--river-line); }
.me-button .who { display: block; }
.msg-avatar { border: 0; padding: 0; background: transparent; align-self: start; cursor: pointer; border-radius: 9px; }
.msg.grouped .msg-avatar { display: none; }
.msg-author { border: 0; background: transparent; padding: 0; font: inherit; font-weight: 650; color: inherit; cursor: pointer; }
.msg-author:hover { text-decoration: underline; }
.msg-status { font-size: 13px; }
.head-avatar { border: 0; padding: 0; background: transparent; border-radius: 9px; flex: none; }
.name-link { border: 0; padding: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; }
.name-link:hover { text-decoration: underline; }
.modal.narrow { width: min(440px, 100%); }
.profile .pf-top { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.pf-id { min-width: 0; display: grid; gap: 3px; }
.pf-id h3 { font-size: 21px; letter-spacing: -0.01em; }
.pf-sub { color: var(--ink-soft); }
.pf-presence { display: flex; align-items: center; gap: 2px; color: var(--ink-faint); font-size: 14px; }
.pf-presence .dot { border-color: var(--ink-faint); }
.pf-status { font-size: 14.5px; }
.pf-status.none { color: var(--ink-soft); }
.pf-bday { background: var(--marigold-soft); border-radius: var(--r-md); padding: 8px 12px; margin-bottom: 12px; font-weight: 600; }
.pf-bio { white-space: pre-wrap; margin-bottom: 12px; max-width: 60ch; }
.pf-list { margin: 0 0 6px; display: grid; gap: 7px; }
.pf-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; }
.pf-row dt { color: var(--ink-faint); font-size: 14px; }
.pf-row dd { margin: 0; overflow-wrap: anywhere; }
.pf-photo { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.pf-photo-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pf-photo-actions .hint { flex-basis: 100%; }
.status-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.preset { display: flex; align-items: center; gap: 9px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md); padding: 8px 10px; font-weight: 550; }
.preset:hover { border-color: #BCC9C7; }
.preset.on { border-color: var(--jade); background: var(--jade-soft); box-shadow: inset 0 0 0 1px var(--jade); }
.p-emoji { font-size: 17px; line-height: 1; }
@media (max-width: 520px) { .status-presets { grid-template-columns: 1fr; } .profile .pf-top { align-items: flex-start; } }

/* ---------- conversation pane */
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.pane-head { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); min-height: 58px; }
.pane-head .title { min-width: 0; flex: 1; }
.pane-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-head .topic { color: var(--ink-faint); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 10px 0 6px; }
.day { display: flex; align-items: center; gap: 12px; padding: 10px 18px 4px; color: var(--ink-faint); font-size: 13.5px; font-weight: 550; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.msg { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 11px; padding: 6px 18px 2px; position: relative; }
.msg.grouped { padding-top: 1px; }
.msg.grouped .avatar, .msg.grouped .msg-head { display: none; }
.msg.grouped .msg-main { grid-column: 2; }
.msg:hover { background: #F7F9F9; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-author { font-weight: 650; }
.msg-time { color: var(--ink-faint); font-size: 13px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 78ch; }
.msg-body.gone { color: var(--ink-faint); font-style: italic; }
.msg-edited { color: var(--ink-faint); font-size: 12.5px; margin-left: 6px; }
.msg-actions { position: absolute; right: 16px; top: -10px; display: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 2px 6px rgba(20, 33, 43, .08); }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { display: flex; }
.msg-actions button { border: 0; background: transparent; padding: 4px 10px; font-size: 13.5px; color: var(--ink-soft); }
.msg-actions button:hover { color: var(--ink); background: var(--line-soft); }
.edit-box textarea { min-height: 60px; }
.edit-box .row { display: flex; gap: 8px; margin-top: 6px; }
.file-card { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; margin: 4px 0; text-decoration: none; color: var(--ink); max-width: 100%; background: var(--surface); }
.file-card:hover { border-color: var(--jade); }
.file-card .ext { background: var(--jade-soft); color: var(--jade-dark); font-weight: 700; font-size: 12px; padding: 5px 7px; border-radius: 5px; text-transform: uppercase; }
.file-card .fname { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card .fsize { color: var(--ink-faint); font-size: 13px; white-space: nowrap; }
.img-file { display: block; margin: 5px 0; }
.img-file img { max-width: min(420px, 100%); max-height: 320px; border-radius: var(--r-md); border: 1px solid var(--line); display: block; }
.load-more { display: block; margin: 6px auto 10px; }
.empty-state { margin: auto; text-align: center; color: var(--ink-soft); padding: 40px 20px; max-width: 44ch; }
.empty-state h3 { font-size: 19px; color: var(--ink); margin-bottom: 4px; }
.typing { height: 20px; padding: 0 18px; font-size: 13.5px; color: var(--ink-faint); }

.composer { margin: 0 18px 8px; border: 1px solid #C9D3D2; border-radius: var(--r-md); background: #fff; }
.composer:focus-within { border-color: var(--jade); box-shadow: 0 0 0 3px var(--jade-soft); }
.composer.drop { border-style: dashed; border-color: var(--jade); background: var(--jade-soft); }
.composer textarea { border: 0; outline: 0 !important; resize: none; min-height: 44px; max-height: 190px; padding: 11px 13px 4px; display: block; background: transparent; }
.composer-bar { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px 6px; }
.composer-bar .grow { flex: 1; min-width: 0; }
.pending { display: inline-flex; align-items: center; gap: 8px; background: var(--jade-soft); border-radius: var(--r-sm); padding: 3px 4px 3px 10px; font-size: 14px; max-width: 100%; }
.pending span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitored { display: flex; align-items: center; gap: 6px; margin: 0 18px 10px; font-size: 13px; color: var(--ink-faint); }
.monitored svg.ic { width: 14px; height: 14px; color: var(--medium); }
.banner { background: var(--marigold-soft); color: #5C4300; text-align: center; padding: 5px 12px; font-size: 14px; }

/* ---------- modals, menus, toasts */
.overlay { position: fixed; inset: 0; background: rgba(12, 39, 45, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--r-lg); width: min(520px, 100%); max-height: min(86vh, 760px); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(12, 39, 45, .28); }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 6px; }
.modal-head h2 { font-size: 20px; letter-spacing: -0.01em; }
.modal-body { padding: 10px 20px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.pick-list { border: 1px solid var(--line); border-radius: var(--r-md); max-height: 280px; overflow-y: auto; margin: 8px 0 14px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); }
.pick-row:last-child { border-bottom: 0; }
.pick-row .grow { flex: 1; min-width: 0; }
.pick-row small { color: var(--ink-faint); display: block; }
.pick-row input { width: 16px; height: 16px; accent-color: var(--jade); }
.menu { position: fixed; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: 0 12px 32px rgba(12, 39, 45, .2); padding: 5px; z-index: 60; min-width: 220px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: var(--r-sm); }
.menu button:hover { background: var(--line-soft); }
#toast-root { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 9px 16px; border-radius: var(--r-md); font-size: 14.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.toast.bad { background: var(--high); }
.secret { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--line-soft); padding: 2px 7px; border-radius: 5px; font-size: 14px; user-select: all; }

/* ---------- monitoring console */
.console { height: 100%; display: flex; flex-direction: column; background: var(--canvas); }
.console-top { background: var(--river); color: var(--river-text); display: flex; align-items: center; gap: 6px; padding: 0 14px; flex-wrap: wrap; }
.console-top .back { color: var(--river-text); background: transparent; border: 0; padding: 14px 10px; display: inline-flex; gap: 6px; align-items: center; }
.console-top .back:hover { color: #fff; }
.console-top h1 { font-size: 17px; color: #fff; font-weight: 650; margin: 0 14px 0 4px; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tab { background: transparent; border: 0; color: var(--river-text); padding: 14px 12px 11px; border-bottom: 3px solid transparent; font-weight: 550; }
.tab:hover { color: #fff; }
.tab.active { color: #fff; border-bottom-color: var(--marigold); }
.console-body { flex: 1; min-height: 0; overflow: auto; }
.page { max-width: 1080px; margin: 0 auto; padding: 22px 20px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 24px; letter-spacing: -0.015em; }
.page-head p { color: var(--ink-soft); max-width: 62ch; }

.alerts-layout { display: grid; grid-template-columns: 390px minmax(0, 1fr); height: 100%; }
.alerts-list { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.tally { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.tally div { padding: 10px 12px 9px; border-right: 1px solid var(--line-soft); }
.tally div:last-child { border-right: 0; }
.tally b { display: block; font-size: 24px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.tally span { font-size: 13px; color: var(--ink-soft); }
.tally .t-high b { color: var(--high); } .tally .t-medium b { color: var(--medium); } .tally .t-low b { color: var(--low); }
.filters { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); }
.filters select { padding: 6px 8px; font-size: 14px; }
.alert-rows { overflow-y: auto; flex: 1; }
.alert-row { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; padding: 10px 12px 10px 14px; border-left: 5px solid var(--low); }
.alert-row.sev-high { border-left-color: var(--high); } .alert-row.sev-medium { border-left-color: var(--medium); }
.alert-row:hover { background: #F7F9F9; }
.alert-row.active { background: var(--jade-soft); }
.alert-row.done { opacity: .62; }
.alert-row .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.alert-row .who { font-weight: 650; }
.alert-row time { color: var(--ink-faint); font-size: 13px; white-space: nowrap; }
.alert-row .where { color: var(--ink-faint); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-row .snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 3px 0 5px; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 12.5px; padding: 1px 8px; border-radius: 99px; background: var(--line-soft); color: var(--ink-soft); font-weight: 550; }
.chip.ai { background: #EDE7F8; color: #55389A; }
.chip.status-escalated { background: var(--high-soft); color: var(--high); }
.sev { font-size: 12.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.sev.high { background: var(--high-soft); color: var(--high); } .sev.medium { background: var(--medium-soft); color: var(--medium); } .sev.low { background: var(--low-soft); color: var(--low); }
.alert-detail { overflow-y: auto; padding: 22px clamp(16px, 3vw, 34px) 48px; min-width: 0; }
.alert-detail > .empty-state { margin-top: 12vh; }
.detail-head { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.detail-head h2 { font-size: 22px; letter-spacing: -0.015em; }
.detail-head .meta { color: var(--ink-soft); }
.detail-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.section-title { font-size: 15px; font-weight: 650; margin: 22px 0 8px; }
.reasons { display: grid; gap: 6px; }
.reason { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 9px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; }
.reason .src { color: var(--ink-faint); font-size: 13px; grid-column: 2; }
.reason mark, .t-body mark { background: #FFE08A; color: inherit; padding: 0 2px; border-radius: 3px; }
.transcript { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.t-msg { padding: 7px 14px 7px 12px; border-left: 5px solid transparent; border-bottom: 1px solid var(--line-soft); }
.t-msg:last-child { border-bottom: 0; }
.t-msg .t-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.t-msg .t-head b { font-weight: 650; }
.t-msg .t-head time { color: var(--ink-faint); font-size: 13px; }
.t-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.t-msg.flagged { background: #FFFBEF; }
.t-msg.flagged.sev-high { border-left-color: var(--high); } .t-msg.flagged.sev-medium { border-left-color: var(--medium); } .t-msg.flagged.sev-low { border-left-color: var(--low); }
.t-msg.other-flag { border-left-color: var(--line); }
.tag { font-size: 12px; font-weight: 650; padding: 0 7px; border-radius: 4px; background: var(--line-soft); color: var(--ink-soft); }
.tag.del { background: var(--high-soft); color: var(--high); }
.link-btn { border: 0; background: transparent; color: var(--jade-dark); text-decoration: underline; padding: 0; font-size: 13.5px; }
.versions { display: grid; gap: 6px; }
.version { background: var(--surface); border: 1px dashed #C9D3D2; border-radius: var(--r-md); padding: 8px 12px; }
.version small { color: var(--ink-faint); display: block; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; margin-bottom: 6px; }
.note small { color: var(--ink-faint); }
.note-form { display: grid; gap: 8px; justify-items: start; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th { text-align: left; font-weight: 650; color: var(--ink-soft); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13.5px; }
td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--ink-faint); font-size: 13px; }
td.actions { white-space: nowrap; text-align: right; }
td select { padding: 4px 6px; width: auto; }
.pattern { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; max-width: 46ch; }
tr.off td { opacity: .5; } tr.off td.actions { opacity: 1; }
.cat-row td { background: var(--canvas); font-weight: 650; padding: 7px 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 16px; }
.card h3 { font-size: 17px; margin-bottom: 4px; }
.card > p { color: var(--ink-soft); margin-bottom: 14px; max-width: 68ch; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.search-bar { display: grid; grid-template-columns: minmax(0, 1fr) 220px auto; gap: 8px; margin-bottom: 14px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sub-panel { border-left: 3px solid var(--line); padding: 4px 0 2px 16px; margin: 0 0 14px; }
.steps { margin: 0 0 14px; padding-left: 20px; color: var(--ink-soft); font-size: 14.5px; display: grid; gap: 3px; max-width: 72ch; }
.invite-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.invite-form .field { margin-bottom: 0; }
.invite-form select { width: 190px; height: 40px; }
.invite-form input { width: 150px; height: 40px; }
.page-foot { display: flex; justify-content: flex-end; }
.status-line { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; font-weight: 550; }
.status-line i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-faint); }
.status-line i.on { background: #2FA57A; }
.test-out { font-size: 14px; margin-top: 6px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .18s ease; z-index: 40; }
  .app.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(12, 39, 45, .45); }
  .menu-btn { display: inline-flex; }
  .alerts-layout { grid-template-columns: 1fr; }
  .alerts-layout.has-detail .alerts-list { display: none; }
  .alerts-layout:not(.has-detail) .alert-detail { display: none; }
  .grid-2, .grid-3, .search-bar { grid-template-columns: 1fr; }
  .msg-actions, .msg:hover .msg-actions { display: none; position: static; border: 0; box-shadow: none; grid-column: 2; background: transparent; }
  .msg.picked .msg-actions { display: flex; }
}
@media (min-width: 901px) { .only-narrow { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
