/* Office Chat. Warm, soft and light: the chat floats as a white panel on a warm off-white surround, orange is the
   one accent, buttons and the message box are pills, peach glows add warmth. Urbanist for Latin text; Anek Bangla for Bengali, so mixed messages read cleanly. */
@font-face { font-family: "Urbanist"; src: url("/fonts/urbanist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; 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: "Urbanist"; src: url("/fonts/urbanist-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@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 {
  color-scheme: light;
  /* text: warm near-black and warm greys */
  --ink: #1F1C1A; --ink-strong: #141210; --ink-soft: #5E5954; --ink-faint: #9A948E;
  /* the warm surround: sidebar, console background, top bars (named "river" from the first design) */
  --river: #F1EFEB; --river-deep: #FFFFFF; --river-text: #4A4642; --river-faint: #9A948E; --river-line: #E6E2DC;
  /* panels: the chat floats on white; quieter panels are a warm off-white */
  --canvas: #FFFFFF; --page: #F1EFEB; --surface: #FFFFFF; --surface-2: #F7F5F2; --line: #ECE8E3; --line-soft: #F2EFEB; --line-strong: #DDD8D1;
  /* orange accent: "mint" is the fill colour, "jade" the darker orange for text and icons on white */
  --mint: #F2722E; --jade: #E2601D; --jade-dark: #B9500F; --jade-soft: rgba(242, 114, 46, .10); --on-jade: #FFFFFF;
  --peach: #FDE6D8; --peach-2: #FFF3EB;
  /* attention (unread counts) */
  --marigold: #EE5A24; --marigold-soft: rgba(238, 90, 36, .10);
  --high: #D9354F; --high-soft: rgba(217, 53, 79, .09); --medium: #C46A00; --medium-soft: rgba(230, 140, 20, .12); --low: #3D6FD1; --low-soft: rgba(61, 111, 209, .09);
  --font: "Urbanist", "Anek Bangla", "Nirmala UI", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 12px; --r-md: 16px; --r-lg: 24px; --pill: 999px;
  --shadow: 0 24px 60px rgba(84, 60, 40, .14), 0 2px 8px rgba(84, 60, 40, .06);
  --panel-shadow: 0 1px 2px rgba(84, 60, 40, .05), 0 12px 40px rgba(84, 60, 40, .07);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); font-size: 15.5px; line-height: 1.5; font-weight: 450; 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(--jade); }
#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-strong); background: transparent; color: var(--ink); padding: 8px 18px; border-radius: var(--pill); font-weight: 650; line-height: 1.3; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.btn:hover { border-color: #CFC8BF; background: var(--surface-2); }
.btn.primary { background: var(--mint); border-color: var(--mint); color: #fff; font-weight: 700; box-shadow: 0 4px 14px rgba(242, 114, 46, .28); }
.btn.primary:hover { background: var(--jade); border-color: var(--jade); }
.btn.danger { color: var(--high); }
.btn.danger:hover { background: var(--high-soft); border-color: rgba(255, 92, 130, .45); }
.btn.small { padding: 5px 13px; 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: 650; font-size: 14.5px; color: var(--ink); }
.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 var(--line-strong); background: var(--surface-2); color: var(--ink); border-radius: var(--r-sm); padding: 9px 12px; width: 100%; }
::placeholder { color: #A9A39C; opacity: 1; }
select option { background: var(--surface); color: var(--ink); }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--jade); box-shadow: 0 0 0 3px var(--jade-soft); }
.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: var(--ink-strong); font-size: clamp(36px, 5vw, 62px); line-height: 1.02; font-weight: 800; letter-spacing: -0.025em; max-width: 10ch; }
.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(--jade-dark); margin-top: 2px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: var(--surface); border-radius: var(--r-lg) 0 0 var(--r-lg); box-shadow: -10px 0 40px rgba(84, 60, 40, .06); }
.login-form form { width: min(360px, 100%); }
.login-form h2 { font-size: 30px; font-weight: 300; margin-bottom: 22px; letter-spacing: -0.02em; }
.login-form h2 b, .setup h1 b { font-weight: 800; }
.setup { max-width: 620px; margin: 0 auto; padding: clamp(24px, 6vh, 64px) 20px; }
.setup h1 { font-size: 30px; font-weight: 300; letter-spacing: -0.02em; margin-bottom: 6px; }
.setup .lede { color: var(--ink-soft); margin-bottom: 22px; }
.notice { background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--mint); padding: 16px 18px; border-radius: var(--r-md); 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%; height: 100dvh; display: grid; grid-template-columns: 264px minmax(0, 1fr); background: var(--river); position: relative; isolation: isolate; }
.app::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(40% 35% at 100% 0%, var(--peach) 0%, transparent 70%), radial-gradient(30% 30% at 0% 100%, var(--peach-2) 0%, transparent 70%); }
.sidebar { background: transparent; color: var(--river-text); display: flex; flex-direction: column; min-height: 0; }
.ws-name { padding: 18px 18px 12px; font-size: 20px; font-weight: 800; color: var(--ink-strong); 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: 2px 14px 10px; }
.side-search .s-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); display: flex; pointer-events: none; transition: color .15s; }
.side-search .s-icon svg.ic { width: 17px; height: 17px; }
.sidebar .side-search input { width: 100%; background: #fff; border: 1px solid transparent; color: var(--ink); border-radius: var(--pill); padding: 11px 58px 11px 40px; font-size: 14.5px; box-shadow: 0 1px 2px rgba(84, 60, 40, .06), 0 3px 10px rgba(84, 60, 40, .05); transition: box-shadow .15s, border-color .15s; }
.sidebar .side-search input::placeholder { color: var(--ink-faint); }
.sidebar .side-search input:hover { box-shadow: 0 1px 2px rgba(84, 60, 40, .08), 0 5px 16px rgba(84, 60, 40, .08); }
.sidebar .side-search input:focus { outline: 0; border-color: rgba(242, 114, 46, .5); box-shadow: 0 0 0 4px var(--jade-soft), 0 3px 10px rgba(84, 60, 40, .05); }
.side-search:focus-within .s-icon { color: var(--jade-dark); }
.sidebar .side-search input::-webkit-search-cancel-button { display: none; }
.side-search .s-key { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 600 11px var(--font); color: var(--ink-faint); background: var(--river); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; pointer-events: none; letter-spacing: .02em; }
.side-search input:focus ~ .s-key { display: none; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 45; background: var(--surface); color: var(--ink); border-radius: 16px; box-shadow: 0 14px 40px rgba(60, 44, 30, .16); border: 1px solid var(--line); padding: 8px; 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: 11px; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 10px; }
.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; flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; }
.result.active .r-tail { color: var(--jade-dark); font-weight: 700; }
.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: 18px 10px 5px; color: var(--river-faint); font-size: 12.5px; font-weight: 600; }
.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: rgba(255, 255, 255, .8); color: var(--ink-strong); }
.side-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border: 0; background: transparent; color: var(--river-text); border-radius: var(--r-sm); text-align: left; position: relative; }
.side-item:hover { background: rgba(255, 255, 255, .6); }
.side-item.active { background: #fff; color: var(--ink-strong); font-weight: 700; box-shadow: 0 1px 2px rgba(84, 60, 40, .08), 0 4px 14px rgba(84, 60, 40, .06); }

.side-item.active svg.ic { color: var(--jade-dark); opacity: 1; }
.side-row { position: relative; }
.side-row .side-pin { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--ink-faint); padding: 4px; border-radius: 6px; display: none; cursor: pointer; }
.side-row:hover .side-pin, .side-row:focus-within .side-pin { display: inline-flex; }
.side-row:hover .side-item .badge, .side-row:hover .side-item .side-status { visibility: hidden; }
.side-pin svg.ic { width: 14px; height: 14px; }
.side-pin:hover { color: var(--jade-dark); background: var(--jade-soft); }
.side-item.pinned .side-pin { color: var(--jade-dark); }
.side-avatar { position: relative; flex: none; width: 28px; height: 28px; margin: -3px 0; }
.side-avatar .avatar.sm { width: 28px; height: 28px; font-size: 11.5px; }
.side-avatar .dot { position: absolute; right: -2px; bottom: -2px; margin: 0; width: 10px; height: 10px; border: 2px solid var(--river); background: #B9B2A9; }
.side-avatar .dot.on { background: #22B573; } .side-avatar .dot.away { background: #F2A000; } .side-avatar .dot.busy { background: #E5604F; }
.side-item.active .side-avatar .dot, .side-row:hover .side-avatar .dot { border-color: #fff; }
.side-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item.unread { color: var(--ink-strong); font-weight: 700; }
.side-item svg.ic { width: 16px; height: 16px; opacity: .75; }
.badge { background: var(--marigold); color: #fff; 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: #22B573; border-color: #22B573; }
.side-empty { padding: 4px 8px; color: var(--river-faint); font-size: 14px; }
.side-foot { border-top: 0; padding: 8px; display: grid; gap: 4px; }
.side-foot > * { min-width: 0; }
.nudge { min-width: 0; background: linear-gradient(135deg, #fff 0%, var(--peach-2) 100%); box-shadow: 0 1px 2px rgba(84, 60, 40, .06); 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: var(--ink-strong); font-weight: 700; }
.nudge-text span { color: var(--river-faint); font-size: 13.5px; }
.nudge-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.nudge .btn.primary { background: var(--mint); border-color: var(--mint); color: #fff; }
.nudge .btn.primary:hover { background: var(--jade); border-color: var(--jade); }
.nudge-close { color: var(--river-text); }
.sidebar .nudge-close:hover { background: var(--river-line); color: var(--ink-strong); }
.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: var(--ink-strong); 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: 36px; height: 36px; border-radius: 50%; 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: 11px; border-radius: 50%; }
.avatar.xs { width: 18px; height: 18px; font-size: 8px; border-radius: 50%; }
.avatar.lg { width: 88px; height: 88px; font-size: 30px; border-radius: 50%; box-shadow: 0 0 0 4px #fff, 0 6px 20px rgba(84, 60, 40, .18); }
.avatar.photo { background: var(--line-soft); overflow: hidden; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dot.away { background: #F2A000; border-color: #F2A000; }
.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: rgba(255, 255, 255, .7); }
.me-button { border-radius: var(--pill); padding: 3px 10px 3px 3px; }
.me-button .who { display: block; }
.msg-avatar { border: 0; padding: 0; background: transparent; align-self: start; cursor: pointer; border-radius: 50%; }
.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: 50%; 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: 22px; font-weight: 800; letter-spacing: -0.015em; }
.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(--peach-2); color: #9A3E0B; 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-2); color: var(--ink); border-radius: var(--r-md); padding: 8px 10px; font-weight: 550; }
.preset:hover { border-color: #CFC8BF; }
.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(--canvas); margin: 12px 12px 12px 0; border-radius: var(--r-lg); box-shadow: var(--panel-shadow); overflow: hidden; border: 1px solid rgba(84, 60, 40, .06); }
.pane-head { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line-soft); min-height: 64px; }
.pane-head .title { min-width: 0; flex: 1; }
.pane-head h2 { font-size: 18px; font-weight: 750; 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; }
/* Ctrl+S: find in this conversation */
.chat-search { border-bottom: 1px solid var(--line-soft); background: #FFF9F5; }
.cs-row { display: flex; align-items: center; gap: 8px; padding: 8px 14px; }
.cs-icon { display: flex; color: var(--jade-dark); } .cs-icon svg.ic { width: 17px; height: 17px; }
.cs-row input { flex: 1; min-width: 0; border-radius: var(--pill); padding: 8px 14px; font-size: 14.5px; background: #fff; }
.cs-count { font-size: 13px; color: var(--ink-faint); white-space: nowrap; }
.cs-results { max-height: min(46vh, 380px); overflow-y: auto; border-top: 1px solid var(--line-soft); padding: 6px 8px; background: #fff; }
.cs-hit { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 10px; align-items: flex-start; cursor: pointer; }
.cs-hit:hover { background: var(--jade-soft); }
.cs-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.cs-head { display: flex; gap: 8px; align-items: baseline; font-size: 13px; } .cs-head b { font-weight: 650; } .cs-head time { color: var(--ink-faint); font-size: 12px; }
.cs-body { font-size: 14px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-body mark, .msg mark { background: #FFE9A8; color: inherit; border-radius: 3px; padding: 0 1px; }
.msg.hit .msg-body, .msg.hit .msg-sticker, .msg.hit .msg-gif, .msg.hit .file-card { box-shadow: 0 0 0 3px var(--mint); transition: box-shadow .3s; }
/* Chat / Files / Photos tabs under the conversation title */
.pane-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); }
.pane-tab { border: 0; background: transparent; padding: 9px 12px 10px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.pane-tab:hover { color: var(--ink); }
.pane-tab.active { color: var(--jade-dark); border-bottom-color: var(--mint); }
.shared { flex: 1; overflow-y: auto; padding: 8px 22px 20px; }
.shared-day { font-size: 12.5px; font-weight: 650; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 6px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-md); }
.file-row:hover { background: #FBFAF8; }
.file-row .ext { flex: none; background: var(--jade-soft); color: var(--jade-dark); font-weight: 700; font-size: 12px; padding: 7px 8px; border-radius: 7px; text-transform: uppercase; min-width: 40px; text-align: center; }
.file-info { min-width: 0; flex: 1; }
.file-info .fname { font-weight: 600; color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info .fname:hover { color: var(--jade-dark); }
.file-meta { font-size: 13px; color: var(--ink-faint); }
.file-row .icon-btn { color: var(--ink-soft); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding-top: 10px; }
.photo-tile { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--line-soft); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .15s ease; }
.photo-tile:hover img { transform: scale(1.04); }
.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); }
/* Chat bubbles: my messages on the right, everyone else's on the left */
.msg { display: flex; align-items: flex-start; gap: 10px; padding: 8px 22px 1px; position: relative; }
.msg.grouped { padding-top: 2px; }
.msg.mine { justify-content: flex-end; }
.msg.theirs { justify-content: flex-start; }
.msg.grouped .msg-avatar { visibility: hidden; height: 0; }
.msg-avatar { flex: none; width: 34px; }
.msg-avatar .avatar { width: 34px; height: 34px; }
.msg-main { position: relative; display: flex; flex-direction: column; min-width: 0; max-width: min(72%, 620px); }
.msg.mine .msg-main { align-items: flex-end; }
.msg.theirs .msg-main { align-items: flex-start; }
.msg-head { display: flex; align-items: baseline; gap: 6px; margin: 0 0 3px 4px; font-size: 13.5px; }
.msg-author { font-weight: 650; color: var(--ink-soft); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; color: #3A3632; background: #F3F1ED; padding: 8px 13px 6px; border-radius: 18px; line-height: 1.45; max-width: 100%; }
.msg.theirs .msg-body { border-top-left-radius: 6px; }
.msg.theirs.grouped .msg-body { border-top-left-radius: 18px; border-bottom-left-radius: 6px; }
.msg.mine .msg-body { background: #FDE6D8; color: #3B2618; border-top-right-radius: 6px; }
.msg.mine.grouped .msg-body { border-top-right-radius: 18px; border-bottom-right-radius: 6px; }
.msg-body.gone { color: var(--ink-faint); font-style: italic; background: transparent !important; border: 1px dashed var(--line-strong); }
.msg-stamp { float: right; margin: 6px 0 0 12px; color: var(--ink-faint); font-size: 11.5px; font-style: normal; white-space: nowrap; line-height: 1.2; }
.msg.mine .msg-body .msg-stamp { color: #A9765A; }
.msg-meta .msg-stamp { float: none; margin: 2px 6px 0; }
.msg-file { max-width: 100%; }
.msg:hover .msg-body { filter: brightness(.985); }
.msg-actions { position: absolute; top: -14px; display: none; z-index: 2; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--pill); box-shadow: 0 6px 18px rgba(17, 24, 39, .12); overflow: hidden; }
.msg.mine .msg-actions { right: 8px; }
.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); }
.msg .edit-box { width: min(520px, 100%); }
.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: 9px 13px; 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: 20px; font-weight: 750; 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 var(--line); border-radius: 26px; background: var(--surface-2); display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: end; padding: 5px; }
.composer:focus-within { border-color: rgba(242, 114, 46, .55); background: #fff; box-shadow: 0 0 0 4px var(--jade-soft); }
.composer.drop { border-style: dashed; border-color: var(--jade); background: var(--jade-soft); }
.composer textarea { grid-column: 3; grid-row: 3; border: 0; outline: 0 !important; box-shadow: none !important; resize: none; min-height: 40px; max-height: 190px; padding: 9px 8px 8px; display: block; background: transparent; }
.composer-bar { display: contents; }
.composer-bar > .icon-btn { grid-row: 3; width: 40px; height: 40px; justify-content: center; align-items: center; border-radius: 50%; color: var(--ink-soft); }
.composer-bar > .icon-btn:hover { background: var(--line-soft); color: var(--ink-strong); }
.composer-bar > .icon-btn:nth-of-type(1) { grid-column: 1; }
.composer-bar > .icon-btn:nth-of-type(2) { grid-column: 2; margin-left: -6px; }
.composer-bar > .icon-btn.active { background: var(--jade-soft); color: var(--jade-dark); }
.composer-bar > .send-btn { grid-column: 5; grid-row: 3; }
.composer-bar > .icon-btn:nth-of-type(3) { grid-column: 3; margin-left: -6px; }
.composer { grid-template-columns: auto auto auto minmax(0, 1fr) auto; }
.composer textarea { grid-column: 4; }
/* Formatting toolbar (WhatsApp-style), shown above the text when turned on */
.fmt-bar { grid-column: 1 / -1; grid-row: 1; display: none; gap: 2px; align-items: center; padding: 4px 6px 2px; }
.fmt-bar.open { display: flex; }
.fmt-btn { border: 0; background: transparent; min-width: 32px; height: 30px; border-radius: 8px; color: var(--ink-soft); font: 600 14px var(--font); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0 6px; }
.fmt-btn:hover { background: var(--line-soft); color: var(--ink-strong); }
.fmt-btn.b { font-weight: 800; } .fmt-btn.i { font-style: italic; font-family: Georgia, serif; } .fmt-btn.s { text-decoration: line-through; } .fmt-btn.c { font-family: ui-monospace, Consolas, monospace; font-size: 13px; } .fmt-btn.q { font-family: Georgia, serif; font-size: 20px; line-height: 1; }
.fmt-btn svg.ic { width: 17px; height: 17px; }
.fmt-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
/* Rich text inside messages */
.msg-body .rt-list { margin: 2px 0 2px 20px; padding: 0; }
.msg-body .rt-list li { margin: 1px 0; }
.msg-body .rt-quote { margin: 3px 0; padding: 2px 10px; border-left: 3px solid var(--mint); color: var(--ink-soft); background: rgba(255, 255, 255, .5); border-radius: 0 8px 8px 0; }
.msg.mine .msg-body .rt-quote { background: rgba(255, 255, 255, .45); }
.msg-body .rt-code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: rgba(0, 0, 0, .06); padding: 1px 5px; border-radius: 5px; }
.msg-body .rt-pre { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: rgba(0, 0, 0, .06); padding: 8px 10px; border-radius: 8px; margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-body b { font-weight: 700; } .msg-body s { color: var(--ink-faint); }
.composer-bar .grow { grid-column: 1 / -1; grid-row: 2; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.pending.uploading { opacity: .6; }
.composer-bar .grow:empty { display: none; }
.composer-bar .grow .pending { margin: 4px 4px 2px; }
.send-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--mint); color: #fff; box-shadow: 0 4px 12px rgba(242, 114, 46, .35); }
.send-btn:hover { background: var(--jade); }
.send-btn:disabled { opacity: .5; box-shadow: none; }
.send-btn svg.ic { width: 18px; height: 18px; transform: translateX(-1px); }
.pending { display: inline-flex; align-items: center; gap: 6px; background: var(--jade-soft); border-radius: var(--pill); padding: 3px 4px 3px 10px; font-size: 13.5px; max-width: 100%; }
.pending span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Emoji / GIF / sticker picker, shown above the message box */
.picker { margin: 0 18px 6px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 40px rgba(60, 44, 30, .14); display: flex; flex-direction: column; height: min(340px, 45dvh); overflow: hidden; }
.picker-tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line-soft); }
.picker-tab { border: 0; background: transparent; padding: 7px 12px 9px; font: inherit; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.picker-tab.active { color: var(--jade-dark); border-bottom-color: var(--mint); }
.picker-search { margin: 8px 10px 4px; border-radius: var(--pill); padding: 7px 12px; font-size: 14px; width: calc(100% - 20px); box-sizing: border-box; flex: none; }
.picker-body { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.picker-label { font-size: 12px; font-weight: 650; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; margin: 8px 2px 4px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); }
.emoji-btn { border: 0; background: transparent; font-size: 23px; line-height: 1; height: 38px; border-radius: 8px; cursor: pointer; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.emoji-btn:hover { background: var(--line-soft); transform: scale(1.15); }
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; padding-top: 6px; }
.sticker-btn { border: 0; background: transparent; padding: 4px; border-radius: 12px; cursor: pointer; }
.sticker-btn:hover { background: var(--jade-soft); }
.sticker-btn img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.gif-grid { columns: 3; column-gap: 6px; padding-top: 6px; }
.gif-btn { display: block; width: 100%; break-inside: avoid; margin-bottom: 6px; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--line-soft); cursor: pointer; }
.gif-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-btn:hover { outline: 3px solid var(--mint); outline-offset: -3px; }
.picker-credit { text-align: center; font-size: 11.5px; color: var(--ink-faint); padding: 6px 0 2px; }
.picker-empty { color: var(--ink-faint); text-align: center; padding: 28px 12px; font-size: 14px; }
.picker-empty b { color: var(--ink); } .picker-empty p { margin: 6px 0 0; }
/* Sticker management in the console */
.sticker-admin { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.sticker-tile { position: relative; width: 64px; height: 64px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 4px; }
.sticker-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sticker-tile.builtin { opacity: .85; }
.tile-x { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft); font-size: 15px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
.tile-x:hover { color: #fff; background: var(--high); border-color: var(--high); }
.transcript .msg-sticker img { width: 96px; height: 96px; }
.transcript .msg-gif { width: min(200px, 100%); }
/* "Seen by" avatars under the last message each person has read */
.seen { display: flex; justify-content: flex-end; gap: 3px; padding: 1px 24px 4px; align-items: center; }
.seen .avatar.xs { box-shadow: 0 0 0 2px #fff; }
.seen-more { font-size: 11px; color: var(--ink-faint); margin-left: 2px; }
/* Thin, quiet scrollbars instead of the heavy system ones */
* { scrollbar-width: thin; scrollbar-color: rgba(84, 60, 40, .22) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(84, 60, 40, .18); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(84, 60, 40, .35); background-clip: padding-box; }
*::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
/* Stickers and GIFs inside messages: no bubble, just the picture */
.msg-sticker img { width: 140px; height: 140px; object-fit: contain; display: block; filter: drop-shadow(0 4px 10px rgba(60, 44, 30, .14)); }
.msg-gif { position: relative; width: min(280px, 100%); border-radius: 14px; overflow: hidden; background: var(--line-soft); }
.msg-gif img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-tag { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; letter-spacing: .04em; }
.msg.mine .msg-sticker, .msg.mine .msg-gif { margin-left: auto; }
.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(--jade-dark); }
.banner { background: var(--peach-2); color: #9A3E0B; text-align: center; padding: 5px 12px; font-size: 14px; }

/* ---------- modals, menus, toasts */
.overlay { position: fixed; inset: 0; background: rgba(60, 44, 30, .28); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); width: min(520px, 100%); max-height: min(86vh, 760px); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 6px; }
.modal-head h2 { font-size: 21px; font-weight: 750; letter-spacing: -0.01em; }
.modal-body { padding: 10px 22px 22px; 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-strong); border-radius: var(--r-md); box-shadow: var(--shadow); 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(--surface-2); }
#toast-root { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; }
.toast { background: #241F1B; color: #fff; border: 1px solid #241F1B; padding: 10px 18px; border-radius: var(--pill); font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow); }
.toast.bad { background: #C21E52; border-color: #C21E52; color: #fff; }
.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%; height: 100dvh; display: flex; flex-direction: column; background: var(--page); }
.console-top { background: transparent; color: var(--river-text); border-bottom: 1px solid var(--river-line); display: flex; align-items: center; gap: 6px; padding: 0 14px; padding-top: env(safe-area-inset-top); min-width: 0; }
.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: var(--ink-strong); }
.console-top h1 { font-size: 17px; color: var(--ink-strong); font-weight: 650; margin: 0 14px 0 4px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; flex: none; }
.tab { background: transparent; border: 0; color: var(--river-text); padding: 15px 12px 12px; border-bottom: 2px solid transparent; font-weight: 600; }
.tab:hover { color: var(--ink-strong); }
.tab.active { color: var(--jade); font-weight: 700; border-bottom-color: var(--mint); }
.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: 26px; font-weight: 800; letter-spacing: -0.02em; }
.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, .alert-detail { min-width: 0; }
.alerts-list { border-right: 1px solid var(--line); background: var(--surface); margin: 12px 0 12px 12px; border-radius: var(--r-lg) 0 0 var(--r-lg); box-shadow: var(--panel-shadow); overflow: hidden; 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: 26px; line-height: 1.1; font-weight: 800; 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: #FBFAF8; }
.alert-row.active { background: var(--surface-2); }
.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 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-soft); font-weight: 600; }
.chip.ai { background: rgba(124, 77, 219, .09); color: #5B33B8; }
.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: 24px; font-weight: 800; 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: #FFE58F; color: var(--ink-strong); padding: 0 3px; border-radius: 4px; }
.transcript { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: 0 1px 2px rgba(84, 60, 40, .04); }
.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: #FFFAEB; }
.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 8px; border-radius: 99px; background: var(--surface-2); 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; text-underline-offset: 2px; padding: 0; font-size: 13.5px; }
.versions { display: grid; gap: 6px; }
.version { background: var(--surface); border: 1px dashed var(--line-strong); 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 rgba(84, 60, 40, .06); border-radius: var(--r-lg); overflow-x: auto; box-shadow: var(--panel-shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th { text-align: left; font-weight: 700; color: var(--ink-faint); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13px; }
td { padding: 10px 14px; 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(--page); color: var(--jade-dark); font-weight: 700; font-size: 13.5px; padding: 8px 14px; }
.card { background: var(--surface); border: 1px solid rgba(84, 60, 40, .06); border-radius: var(--r-lg); padding: 24px 26px; margin-bottom: 16px; box-shadow: var(--panel-shadow); }
.card h3 { font-size: 18px; font-weight: 750; 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: #22B573; }
.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(60, 44, 30, .28); }
  .menu-btn { display: inline-flex; }
  .alerts-layout { grid-template-columns: minmax(0, 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; background: transparent; margin-top: 2px; }
  .msg-main { max-width: 82%; }
  .msg.picked .msg-actions { display: flex; }
}
@media (min-width: 901px) { .only-narrow { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


/* ---------- phones and tablets */
.msg-author { text-align: left; }
.alert-row .snip { word-break: break-word; }
.sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.monitored { padding-bottom: env(safe-area-inset-bottom); }

/* Fingers need bigger targets than a mouse pointer (about 40px or more) */
@media (pointer: coarse) {
  .icon-btn { min-width: 40px; min-height: 40px; justify-content: center; align-items: center; }
  .btn { min-height: 40px; }
  .btn.small { min-height: 36px; }
  .side-item { min-height: 42px; }
  .tab { padding-top: 16px; padding-bottom: 13px; }
  .result { min-height: 44px; }
  .link-btn { padding: 6px 0; }
  .side-search .s-key { display: none; }
  .sidebar .side-search input { padding-right: 14px; }
  /* 16px stops phones zooming into a field when it is tapped */
  input, select, textarea { font-size: 16px; }
}

@media (max-width: 900px) {
  /* The closed menu must not catch keyboard focus or screen readers */
  .sidebar { visibility: hidden; transition: transform .18s ease, visibility 0s linear .18s; }
  .app.nav-open .sidebar { visibility: visible; transition: transform .18s ease, visibility 0s; }
  .console-top h1 { display: none; }
  .pane-head { padding: 8px 10px; gap: 8px; }
  .msg { padding-left: 10px; padding-right: 10px; }
  .seen { padding-right: 12px; }
  .msg-avatar { width: 30px; }
  .msg-avatar .avatar { width: 30px; height: 30px; }
  .composer { margin: 0 10px 6px; }
  .pane-tabs { padding: 0 6px; }
  .shared { padding: 6px 12px 16px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .picker { margin: 0 10px 6px; height: min(320px, 42dvh); }
  .gif-grid { columns: 2; }
  .sticker-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .msg-sticker img { width: 120px; height: 120px; }
  .monitored { margin: 0 12px 8px; }
  .page { padding: 18px 14px 40px; }
  .page-head h2 { font-size: 21px; }
}

@media (max-width: 640px) {
  .login-brand { padding: 22px 20px; gap: 14px; }
  .login-brand h1 { font-size: 28px; max-width: none; }
  .login-brand p { font-size: 15px; margin-top: 8px !important; }
  .login-brand .watch { padding-top: 12px; font-size: 13.5px; }
  .login-form { align-items: flex-start; padding: 26px 20px 32px; }
  .setup { padding: 24px 18px 40px; }
  .setup h1 { font-size: 24px; }

  /* Dialogs become sheets that slide up from the bottom */
  .overlay { padding: 0; align-items: end; }
  .modal, .modal.wide, .modal.narrow { width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal-head { padding: 14px 16px 4px; }
  .modal-body { padding: 8px 16px 18px; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .profile .pf-top { flex-direction: column; align-items: flex-start; gap: 12px; }
  .pf-row { grid-template-columns: 80px minmax(0, 1fr); }

  .tally { grid-template-columns: 1fr 1fr; }
  .tally div:nth-child(2) { border-right: 0; }
  .tally div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters select:last-child { grid-column: span 2; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1 1 auto; justify-content: center; }
  .search-bar { grid-template-columns: 1fr; }
  .page-head { align-items: stretch; }
  .page-head > div:last-child:not(:first-child) { display: flex; flex-wrap: wrap; gap: 8px; }
  .invite-form select, .invite-form input { width: 100%; }
  .invite-form .field { flex: 1 1 140px; }

  /* Tables turn into one card per row, with each value labelled */
  .table-wrap { background: transparent; border: 0; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 10px; }
  .table-wrap tr.cat-row { background: transparent; border: 0; padding: 10px 2px 2px; margin: 0; }
  .table-wrap tr.cat-row td { background: transparent; padding: 0; }
  .table-wrap td { border: 0; padding: 4px 0; }
  .table-wrap td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-faint); }
  .table-wrap td.actions { text-align: left; white-space: normal; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
  .table-wrap td.actions .btn.quiet { border-color: var(--line); }
  .table-wrap td select { width: 100%; }
  .table-wrap td input[aria-label="Invite link"] { min-width: 0 !important; width: 100%; }
  .pattern { max-width: none; }
}


/* ---------- Getweb signature: thin orbit lines with glowing dots (sign-in and first-run screens) */
.login-brand { position: relative; overflow: hidden; isolation: isolate; background: radial-gradient(70% 55% at 100% 0%, var(--peach) 0%, transparent 70%), radial-gradient(60% 50% at 0% 100%, #FDEBDF 0%, transparent 70%), var(--page); }
.login-brand::before, .login-brand::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; border: 1px solid rgba(84, 60, 40, .07); pointer-events: none; }
.login-brand::before { width: 150%; aspect-ratio: 1; left: -25%; top: 58%; }
.login-brand::after { width: 105%; aspect-ratio: 1; left: 30%; top: 32%; border-color: rgba(84, 60, 40, .05); }
.orbit-dot { position: absolute; z-index: -1; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; }
.orbit-dot.g { background: #00D68F; box-shadow: 0 0 0 7px rgba(0, 214, 143, .12), 0 0 12px rgba(0, 214, 143, .5); }
.orbit-dot.p { background: var(--marigold); box-shadow: 0 0 0 7px rgba(252, 48, 120, .10), 0 0 12px rgba(252, 48, 120, .45); }
.orbit-dot.o { background: #F5A142; box-shadow: 0 0 0 7px rgba(245, 161, 66, .12), 0 0 12px rgba(245, 161, 66, .45); }
.login-brand h1 .light { font-weight: 300; display: block; }
.brand-logo { max-height: 40px; max-width: 220px; display: block; margin-bottom: 26px; }
.ws-logo { max-height: 30px; max-width: 100%; display: block; }
.eyebrow { color: var(--jade-dark); font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.logo-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo-preview { background: var(--page); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; min-width: 160px; min-height: 58px; display: grid; place-items: center; }
.logo-preview img { max-height: 34px; max-width: 200px; display: block; }
.login-form form > .btn.primary { width: 100%; justify-content: center; padding-top: 11px; padding-bottom: 11px; font-size: 16px; }
@media (max-width: 640px) { .orbit-dot.p, .orbit-dot.o { display: none; } .orbit-dot.g { top: 22% !important; right: 8% !important; } }

.orbit-dot { display: none; }
.console { background: var(--river); position: relative; isolation: isolate; }
.console::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(40% 35% at 100% 0%, var(--peach) 0%, transparent 70%); }
.alerts-layout .alert-detail { background: var(--surface); margin: 12px 12px 12px 0; border-radius: 0 var(--r-lg) var(--r-lg) 0; box-shadow: var(--panel-shadow); }
@media (max-width: 900px) {
  .sidebar { background: var(--river); background-image: radial-gradient(60% 40% at 100% 0%, var(--peach-2) 0%, transparent 70%); }
  .pane { margin: 0; border-radius: 0; border: 0; box-shadow: none; }
  .alerts-list, .alerts-layout .alert-detail { margin: 0; border-radius: 0; box-shadow: none; }
  .composer { margin: 0 10px 6px; }
  .pane-tabs { padding: 0 6px; }
  .shared { padding: 6px 12px 16px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .picker { margin: 0 10px 6px; height: min(320px, 42dvh); }
  .gif-grid { columns: 2; }
  .sticker-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .msg-sticker img { width: 120px; height: 120px; }
}
@media (max-width: 760px) { .login-form { border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -10px 40px rgba(84, 60, 40, .06); } }
