/* The Team Inbox (ADR 0052). An app, not a page of the site: calm and quiet,
 * warm off-white ground, white panels, one deep teal accent, as in the
 * mockups (worklog media team-inbox-mock-*-20261012). Two panes from 900px,
 * one at a time below (body[data-view="thread"] shows the chat). */

/* BEGIN GENERATED FONTS (scripts/fonts/subset_fonts.py: edit it, not this block) */
@font-face {
    font-family: "Archivo";
    src: url("/fonts/archivo-core-1300ab5ff3.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0-10FFFF; /* every code point the latin file below doesn't draw, as the single file claimed before */
}
@font-face {
    font-family: "Archivo";
    src: url("/fonts/archivo-latin-2f361cec31.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+00A1-00A2, U+00A4-00B6, U+00B8-00D6, U+00D8-00F2, U+00F4-00FF, U+0102, U+0131, U+0152-0153, U+02BC, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+2009, U+201A, U+201E, U+2032-2033, U+2039-203A, U+2044, U+20AC, U+2122, U+2191, U+2193, U+2215, U+FEFF;
}
/* END GENERATED FONTS */

:root {
    --bg: #f6f4ef;
    --panel: #ffffff;
    --line: #e8e4db;
    --text: #1c2826;
    --muted: #6a7370;
    --teal: #0e5f5a;
    --teal-press: #0a4a46;
    --teal-tint: #e3f2ef;
    --person-tint: #e5f4e2;
    --phone-tint: #eef0ea;
    --system-tint: #ecebe5;
    --hover: #f3f1ec;
    --selected: #edf5f3;
    --radius: 14px;
    --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, monospace;
    /* What /email-signin.js styles itself with. */
    --ink: var(--text);
    --paper: var(--panel);
    --accent: var(--teal);
    --err: #b3261e;
    color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: var(--teal); }

/* ── states before the app: loading, sign-in, picker, failure ───────────── */
.state { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.state > p { color: var(--muted); }
.card {
    width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line);
    border-radius: 18px; padding: 28px 24px;
}
.eyebrow { margin: 0 0 6px; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.card h1 { margin: 0 0 8px; font-size: 1.6rem; line-height: 1.2; color: var(--teal); }
.lede { margin: 0 0 20px; color: var(--muted); }
.small { font-size: .9rem; }
#signin-error { color: var(--err); }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 18px; border: 1px solid var(--teal); border-radius: 12px;
    background: var(--teal); color: #fff; text-decoration: none; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--teal-press); }
.signin-email { margin-top: 24px; }
/* The email form (email-signin.js) uses the site's form classes. */
.waitlist .row { display: flex; flex-wrap: wrap; gap: 8px; }
.waitlist input[type="email"] {
    flex: 1 1 200px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line);
    border-radius: 12px; font: inherit; background: var(--panel);
}
.waitlist .btn { flex: 0 0 auto; }
.es input.es-code-in { border-width: 1px !important; border-radius: 12px !important; border-color: var(--line) !important; }
.accounts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.accounts button {
    width: 100%; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--panel); cursor: pointer; font-weight: 600;
}
.accounts button:hover { background: var(--hover); }
.accounts .role { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); }

/* ── the app: two panes ─────────────────────────────────────────────────── */
.app { height: 100%; display: grid; grid-template-columns: minmax(320px, 400px) 1fr; }
.pane { min-width: 0; min-height: 0; }
.list-pane { display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); }
.thread-pane { display: flex; flex-direction: column; background: var(--bg); }

.list-head { padding: 18px 20px 0; border-bottom: 1px solid var(--line); }
.brand-row { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; }
.brand-name { margin: 0; flex: 1; min-width: 0; font-size: 1.45rem; line-height: 1.2; color: var(--teal); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me { position: relative; display: flex; align-items: center; gap: 10px; }
.portal-link { font-size: .9rem; font-weight: 600; text-decoration: none; padding: 6px 10px; border-radius: 10px; }
.portal-link:hover { background: var(--hover); }
.menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; min-width: 220px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
    box-shadow: 0 8px 24px rgba(28, 40, 38, .12);
}
.menu-who { margin: 4px 8px 8px; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.menu-item { display: block; width: 100%; text-align: left; padding: 9px 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-decoration: none; color: var(--text); }
.menu-item:hover { background: var(--hover); }
.menu-brand { display: grid; gap: 4px; margin: 4px 8px 8px; font-size: .85rem; color: var(--muted); }
.menu-brand select { font: inherit; padding: 6px; border-radius: 8px; border: 1px solid var(--line); }

.tabs { display: flex; gap: 6px; }
.tabs:empty { display: none; }
.tab {
    border: 0; background: none; padding: 10px 12px 12px; cursor: pointer; color: var(--muted);
    border-bottom: 3px solid transparent; font-weight: 600;
}
.tab[aria-selected="true"] { color: var(--teal); border-bottom-color: var(--teal); }

.list-body { flex: 1; overflow-y: auto; padding-bottom: 16px; }
.section-label { margin: 16px 20px 6px; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.chats { list-style: none; margin: 0; padding: 0; }
.chat-row {
    display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center;
    width: 100%; padding: 12px 20px; border: 0; background: none; text-align: left; cursor: pointer;
    border-bottom: 1px solid var(--line);
}
.chat-row:hover { background: var(--hover); }
.chat-row[aria-current="true"] { background: var(--selected); }
.chat-main { min-width: 0; }
.chat-name { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-preview { display: block; color: var(--muted); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-preview .from { color: var(--text); }
/* Presence (#599): "Sarah is typing…" in place of the row's preview, and under the open chat's name. */
.chat-presence { display: block; color: var(--teal); font-size: .92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row[data-presence] .chat-preview { display: none; }
.thread-head p.presence { color: var(--teal); font-weight: 600; }
.chat-time { align-self: start; padding-top: 2px; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.empty { margin: 24px 20px; color: var(--muted); }
.more { display: block; margin: 14px auto; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer; color: var(--teal); font-weight: 600; }

.avatar {
    display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    font-weight: 700; font-size: .95rem; flex: 0 0 auto; border: 0; padding: 0;
    background: var(--av-bg, #e5ecea); color: var(--av-fg, var(--teal));
}
.me-avatar { width: 40px; height: 40px; cursor: pointer; background: var(--teal); color: #fff; }

/* ── the open chat ──────────────────────────────────────────────────────── */
.thread-none { flex: 1; display: grid; place-items: center; color: var(--muted); }
.thread { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.thread-head .who { flex: 1; min-width: 0; }
.thread-head h2 { margin: 0; font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.back { display: none; border: 0; background: none; padding: 6px; margin-left: -8px; color: var(--teal); cursor: pointer; }
.banners:empty { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.messages:focus { outline: none; }
.bubbles { list-style: none; margin: 0 auto; padding: 0; max-width: 820px; display: flex; flex-direction: column; gap: 10px; }

.day { align-self: center; margin: 10px 0 2px; padding: 3px 12px; border-radius: 999px; background: var(--system-tint); color: var(--muted); font-size: .8rem; }
.msg { display: flex; flex-direction: column; max-width: min(78%, 560px); }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.label { display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 4px; font-size: .82rem; color: var(--muted); }
.label svg { flex: 0 0 auto; }
.msg.conciergr .label, .msg.person .label { color: var(--teal); font-weight: 600; }
.bubble {
    position: relative; padding: 9px 12px 7px; border-radius: var(--radius); background: var(--panel);
    border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.in .bubble { border-top-left-radius: 4px; }
.msg.out .bubble { border-top-right-radius: 4px; }
.msg.conciergr .bubble { background: var(--teal-tint); border-color: #cfe6e2; }
.msg.person .bubble { background: var(--person-tint); border-color: #d2e9cd; }
.msg.team-phone .bubble { background: var(--phone-tint); border-color: #dfe2d9; }
.bubble .time { display: block; margin-top: 2px; text-align: right; font-size: .75rem; color: var(--muted); }
.bubble .media-kind { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); margin-bottom: 2px; }
.bubble .caption { display: block; }
.bubble .described { display: block; color: #3f4a47; font-size: .93rem; }
.bubble.unsupported { font-style: italic; color: var(--muted); }
/* WhatsApp's ```monospace``` (#612): inline, or its own block when it spans lines. */
.bubble code { font-family: var(--mono); font-size: .9em; }
.bubble code.block { display: block; }
.system-line {
    align-self: center; max-width: min(92%, 640px); text-align: center; padding: 6px 14px; border-radius: 999px;
    background: var(--system-tint); color: #4c5552; font-size: .85rem;
}
.system-line.handover { background: #fbeccb; color: #6b4a00; border-radius: 12px; }
.system-line .time { margin-left: 6px; opacity: .8; }

/* ── scheduled sends (#605) ─────────────────────────────────────────────── */
.scheduled-lines { list-style: none; margin: 12px auto 0; padding: 0; max-width: 820px; display: flex; flex-direction: column; gap: 6px; }
.scheduled-lines:empty { display: none; }
.scheduled-line {
    align-self: center; display: inline-flex; align-items: center; gap: 8px; max-width: min(92%, 640px);
    padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--system-tint); color: var(--muted); font-size: .85rem;
}
.scheduled-line.cancelled { padding-right: 12px; }
.scheduled-line .what { overflow-wrap: anywhere; }
.scheduled-line svg { flex: 0 0 auto; }
.cancel-send {
    flex: 0 0 auto; border: 1px solid var(--line); background: var(--panel); color: var(--err); font: inherit; font-size: .8rem;
    font-weight: 600; padding: 3px 10px; border-radius: 999px; cursor: pointer;
}
.cancel-send:hover { background: var(--hover); }
.cancel-send:disabled { opacity: .5; cursor: default; }
.scheduled-list li { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.scheduled-list .chat-row { border-bottom: 0; flex: 1; min-width: 0; }
.scheduled-list .cancel-send { margin-right: 20px; }
.scheduled-list li.cancelled .chat-name { color: var(--muted); }
.scheduled-list li.cancelled .chat-preview { white-space: normal; }
.sched-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--system-tint); color: var(--muted); }

/* ── "This family has signed up" (#634) ─────────────────────────────────── */
.signup-line { margin: 10px auto 0; max-width: 640px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.signup-line[hidden] { display: none; }
.signup-action {
    font: inherit; font-size: .9rem; font-weight: 600; color: var(--teal); background: var(--panel);
    border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer;
}
.signup-action:hover { background: var(--hover); }
.signup-action:disabled { opacity: .6; cursor: default; }
.signup-why { margin: 0; font-size: .8rem; color: var(--muted); }
.signup-done { margin: 0; padding: 5px 12px; border-radius: 999px; background: var(--system-tint); color: var(--muted); font-size: .85rem; }

/* ── a phone: one pane at a time ────────────────────────────────────────── */
@media (max-width: 899px) {
    .app { grid-template-columns: 1fr; }
    .list-pane { border-right: 0; }
    .thread-pane { display: none; }
    body[data-view="thread"] .list-pane { display: none; }
    body[data-view="thread"] .thread-pane { display: flex; }
    .thread-none { display: none; }
    .back { display: inline-grid; }
    .list-head { padding: 16px 16px 0; }
    .chat-row { padding: 12px 16px; }
    .thread-head { padding: 10px 16px; }
    .messages { padding: 12px 12px 20px; }
    .msg { max-width: 86%; }
    .scheduled-list .cancel-send { margin-right: 16px; }
}

/* The composer (#598): "Reply as Sarah", a growing box and Send. */
.composer { border-top: 1px solid var(--line); background: var(--panel); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.compose { display: flex; gap: 8px; align-items: flex-end; max-width: 820px; margin: 0 auto; }
.compose-text { flex: 1; min-width: 0; resize: none; font: inherit; font-size: 1rem; line-height: 1.4; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 9px 14px; max-height: 160px; }
.compose-text:focus { outline: 2px solid var(--teal); outline-offset: -1px; }
.send { font: inherit; font-weight: 600; color: #fff; background: var(--teal); border: 0; border-radius: 20px; padding: 10px 18px; cursor: pointer; }
.send:hover { background: var(--teal-press); }
.send:disabled { opacity: .6; cursor: default; }
.compose-foot { display: flex; gap: 10px; align-items: center; max-width: 820px; margin: 0 auto; }
.compose-note { margin: 6px 4px 0; font-size: .85rem; color: var(--muted); }
.compose-note:empty { display: none; }
.compose-note.error { color: var(--err); }
.compose-window { margin: 0 4px 8px; }
.compose-retry, .bubble .resend { font: inherit; font-size: .85rem; font-weight: 600; color: var(--teal); background: none; border: 0; padding: 6px 4px 0; cursor: pointer; }
.bubble .resend { padding: 0 0 0 6px; }
.compose-text { min-height: 42px; }
.bubble .tick { margin-left: 4px; letter-spacing: -2px; }
.bubble .tick.read { color: #2a8bd8; }
.bubble .tick.pending { letter-spacing: 0; color: var(--muted); }
.bubble .tick.pending svg { vertical-align: -2px; }
.bubble .quality { display: block; margin-top: 2px; text-align: right; font-size: .75rem; color: var(--muted); }
.bubble .quality.low { color: var(--err); }
.bubble .failed { display: block; text-align: left; color: var(--err); white-space: normal; }

/* Cases and Needs you (#600): the wait on each row, the banner on the open chat, Close and Flag. */
.tab .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--teal); color: #fff; font-size: .75rem; }
.needs-row { box-shadow: inset 4px 0 0 #d9534f; }
.chat-side { display: grid; justify-items: end; gap: 6px; align-self: start; }
.case-chip { padding: 2px 9px; border-radius: 999px; background: #fbeccb; color: #6b4a00; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.case-chip.waiting-on { background: var(--system-tint); color: #4c5552; }
/* Needs you by topic (#619): one row of chips that scrolls sideways on a phone; each row's topic as a tag. */
.topic-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 20px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.topic-chips::-webkit-scrollbar { display: none; }
.topic-chip {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 12px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text);
    font-size: .88rem; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.topic-chip:hover { background: var(--hover); }
.topic-chip .count { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.topic-chip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.topic-chip[aria-pressed="true"] .count { color: var(--teal-tint); }
.topic-chip:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
/* The name gives way to the topic tag on a narrow row: the tag always shows. */
.chat-name.with-topic { display: flex; align-items: baseline; min-width: 0; }
.chat-name.with-topic .name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* #632: an urgent handover whose WhatsApp alert reached nobody. */
.tag.alert-tag { flex: 0 0 auto; white-space: nowrap; background: #f3e6e4; color: #7a3a33; }
.case-banner.alert-undelivered { background: #f3e6e4; color: #7a3a33; border-color: #e8cbc6; }
.tag.topic-tag { flex: 0 0 auto; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--teal-tint); color: var(--teal-press); }
@media (max-width: 899px) {
    .topic-chips { padding: 2px 16px 10px; }
}
.banners { padding: 10px 20px 0; }
.case-banner { margin: 0 auto; max-width: 820px; padding: 10px 14px; border-radius: 12px; background: #fbeccb; color: #6b4a00; font-size: .92rem; border: 1px solid #f1dca6; overflow-wrap: anywhere; }
.case-banner.flag { background: var(--teal-tint); color: var(--teal-press); border-color: #cfe6e2; }
.case-action { font: inherit; font-weight: 600; color: #fff; background: var(--teal); border: 1px solid var(--teal); border-radius: 12px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.case-action:hover { background: var(--teal-press); }
.case-action:disabled { opacity: .6; cursor: default; }
.case-action.quiet { color: var(--teal); background: var(--panel); border-color: var(--line); }
.case-action.quiet:hover { background: var(--hover); }
.case-flag { display: flex; flex-wrap: wrap; gap: 8px; max-width: 820px; margin: 0 auto; }
.case-note { flex: 1 1 220px; min-width: 0; font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
@media (max-width: 899px) {
    .banners { padding: 8px 12px 0; }
    .case-action { padding: 7px 10px; font-size: .9rem; }
}

/* ── contacts: search, tags, the team's name and note (#606) ────────────── */
.search {
    display: block; width: 100%; margin: 0 0 10px; padding: 9px 12px; min-height: 40px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: inherit; color: var(--text);
}
.search:focus { outline: 2px solid var(--teal-tint); border-color: var(--teal); background: var(--panel); }
.tag {
    display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; vertical-align: 2px;
    font-size: .7rem; font-weight: 600; letter-spacing: .02em; background: var(--system-tint); color: var(--muted);
}
.tag-excluded { background: #f3e6e4; color: #7a3a33; }
.chat-note { display: block; margin-top: 2px; font-size: .82rem; color: #6b4a00; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-head .thread-note { margin-top: 2px; font-size: .85rem; color: #6b4a00; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 4.2em; overflow-y: auto; }
.edit-contact {
    flex: 0 0 auto; border: 1px solid var(--line); background: var(--panel); border-radius: 999px;
    padding: 6px 12px; min-height: 36px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--teal); cursor: pointer;
}
.edit-contact:hover { background: var(--hover); }
.edit-contact .short { display: none; }
@media (max-width: 899px) {
    .edit-contact { padding: 6px 10px; }
    .edit-contact .long { display: none; }
    .edit-contact .short { display: inline; }
    .thread-head p { font-size: .85rem; }
}
.contact-edit { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--panel); color: var(--text); }
.contact-edit::backdrop { background: rgba(28, 40, 38, .35); }
.contact-edit h2 { margin: 0 0 4px; font-size: 1.2rem; color: var(--teal); }
.contact-edit .small { margin: 0 0 14px; color: var(--muted); }
.contact-edit label { display: grid; gap: 6px; margin-bottom: 12px; font-weight: 600; font-size: .9rem; }
.contact-edit input, .contact-edit textarea { font: inherit; font-weight: 400; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.contact-edit .err { color: var(--err); }
.contact-edit .actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn.ghost { background: var(--panel); color: var(--teal); }
.btn.ghost:hover { background: var(--hover); }

/* Media, quotes and reactions (#601): photos inline, players for voice notes
 * and videos, a document row; a kept file's note when it has expired. */
.bubble.media { padding: 6px; }
.bubble.media .caption, .bubble.media .described, .bubble.media .time { padding: 0 6px; }
.media-photo { display: block; }
.media-photo img { display: block; max-width: min(320px, 100%); max-height: 360px; border-radius: 10px; object-fit: cover; background: var(--system-tint); }
.media-audio { display: block; width: min(300px, 100%); height: 40px; margin: 2px 0 4px; }
.media-video { display: block; max-width: min(320px, 100%); max-height: 360px; border-radius: 10px; background: #000; }
.media-doc { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0; }
.media-doc .doc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.media-doc .doc-size { color: var(--muted); font-size: .8rem; }
.media-doc .doc-action { color: var(--accent, var(--text)); font-size: .8rem; font-weight: 600; }
.media-gone { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; font-size: .85rem; color: var(--muted); }
.media-gone .media-note { flex-basis: 100%; font-size: .78rem; font-style: italic; }
.bubble .described.transcript { margin-top: 2px; }
.quoted { display: block; margin: 0 0 6px; padding: 4px 8px; border-left: 3px solid var(--teal); border-radius: 6px; background: rgba(0, 0, 0, .04); font-size: .85rem; }
.quoted-who { display: block; font-weight: 600; color: var(--teal); font-size: .78rem; }
.quoted-text { display: block; color: #3f4a47; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.reactions { display: inline-flex; gap: 4px; margin-top: -6px; padding: 1px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: .9rem; position: relative; }
.msg.in .reactions { align-self: flex-start; margin-left: 8px; }
.msg.out .reactions { align-self: flex-end; margin-right: 8px; }
.quote-this { font: inherit; font-size: .9rem; color: var(--muted); background: none; border: 0; padding: 2px 6px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.msg:hover .quote-this, .msg:focus-within .quote-this { opacity: 1; }
@media (hover: none) { .quote-this { opacity: .7; } }
.compose-extras { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.compose-extras:empty { display: none; }
.compose-extras:not(:empty) { margin-bottom: 8px; }
.compose-quote, .compose-file { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: .88rem; min-width: 0; }
.compose-quote { border-left: 3px solid var(--teal); }
.compose-quote .quoted-text { flex: 1; }
.compose-file { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-extras .drop { margin-left: auto; font: inherit; font-size: 1.1rem; line-height: 1; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0 2px; }
.attach { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); font-size: 1.1rem; cursor: pointer; }
.attach:hover { background: var(--hover); }
.attach:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.emoji-toggle[aria-expanded="true"] { background: var(--teal-tint); border-color: var(--teal); }

/* The sign-off on team replies (#620): greyed under the box, added by the server to every reply. */
.compose-signoff { max-width: 820px; margin: 6px auto 0; padding: 0 4px; font-size: .85rem; color: var(--muted); white-space: pre-line; }

/* The emoji panel (#620): above the reply box, a grid of eight, recent ones first. */
.compose { position: relative; }
.emoji-panel {
    position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 20;
    width: min(320px, 100%); padding: 8px;
    display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(28, 40, 38, .12);
}
.emoji-panel .emoji { aspect-ratio: 1; min-width: 0; padding: 0; font-size: 1.3rem; line-height: 1; background: none; border: 0; border-radius: 8px; cursor: pointer; }
.emoji-panel .emoji:hover { background: var(--hover); }
.emoji-panel .emoji:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; background: var(--teal-tint); }
@media (max-width: 420px) {
    .attach { width: 38px; height: 38px; }
    .compose { gap: 6px; }
}

/* The scoreboard and the Team page (#604): the rank chip by the avatar, the
 * card under the header, and the Owner's table in the list pane. */
/* Four views fit the list pane and a phone: tighter tabs, scrolling sideways only past that. */
.tabs { overflow-x: auto; scrollbar-width: none; gap: 2px; }
.tab { white-space: nowrap; flex: 0 0 auto; padding-left: 8px; padding-right: 8px; }
@media (max-width: 400px) { .tab { font-size: .93rem; padding-left: 7px; padding-right: 7px; } }
.rank-chip { border: 1px solid #cfe6e2; background: var(--teal-tint); color: var(--teal-press); border-radius: 999px; padding: 4px 10px; font-size: .82rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.rank-chip:hover { background: #d4ebe6; }
.standing-card { position: relative; margin: 12px 16px 0; padding: 14px 40px 14px 16px; border-radius: 14px; background: var(--teal-tint); border: 1px solid #cfe6e2; color: var(--teal-press); }
.standing-card .eyebrow { margin-bottom: 4px; color: var(--teal); }
.standing-text { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.standing-close { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--teal-press); border-radius: 8px; }
.standing-close:hover { background: rgba(255, 255, 255, .6); }
.leaderboard { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; font-size: .9rem; color: var(--text); }
.leaderboard li { display: grid; grid-template-columns: 2ch 1fr auto; gap: 8px; padding: 3px 0; }
.leaderboard li.you { font-weight: 700; color: var(--teal-press); }
.leaderboard .lb-rank { color: var(--muted); text-align: right; }
.leaderboard .lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-body { padding: 14px 20px 20px; }
.team-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.segs { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg { border: 0; background: var(--panel); padding: 6px 12px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg[aria-pressed="true"] { background: var(--teal); color: #fff; }
.period-nav { display: inline-flex; align-items: center; gap: 4px; }
.period-label { font-weight: 600; font-size: .92rem; min-width: 0; }
.period-step { width: 32px; height: 32px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.period-step:disabled { opacity: .35; cursor: default; }
.team-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.team-table th, .team-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.team-table thead th { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.team-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.team-table tbody th { font-weight: 600; overflow-wrap: anywhere; }
.team-table tr.team-phone th { color: var(--muted); font-style: italic; }
.team-table tfoot th, .team-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--line); }
.team-note { margin: 12px 0 0; font-size: .85rem; color: var(--muted); }
@media (max-width: 899px) {
    .team-body { padding: 12px 16px 20px; }
    .standing-card { margin: 10px 16px 0; }
}

/* A phone's chat header (#604 whole-page check): the contact's name keeps its room. The Flag button shortens as
 * the Edit button does, the number line stays one line, and a long note scrolls inside two lines. */
.case-action .short { display: none; }
@media (max-width: 899px) {
    .case-action .long { display: none; }
    .case-action .short { display: inline; }
    .thread-head #thread-number { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .thread-head .thread-note { max-height: 2.8em; }
}

/* Notifications for Needs you (#618, js/notify.js): an offer above the chats, and the state in the person's menu. */
.side-panel-line { display: flex; align-items: center; gap: 6px; margin: 0; padding: 10px 12px 10px 20px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.side-panel-line[hidden] { display: none; }
.side-panel-line a { color: var(--teal); font-weight: 600; text-decoration: none; }
.side-panel-line a:hover { text-decoration: underline; }
.side-panel-free { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-panel-dismiss { flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.side-panel-dismiss:hover { background: var(--hover); color: var(--text); }
.notify-banner { margin: 12px 16px 0; padding: 12px 14px; border-radius: 14px; background: var(--teal-tint); border: 1px solid #cfe6e2; color: var(--teal-press); }
.notify-banner p { margin: 0 0 10px; font-size: .92rem; font-weight: 600; overflow-wrap: anywhere; }
.notify-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.small-btn { min-height: 36px; padding: 6px 14px; font-size: .9rem; border-radius: 10px; }
.menu-item:disabled { cursor: default; color: var(--muted); background: none; }
.menu-note { margin: 0 8px 8px; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
