/* Reply Panel. Base: Alopex Brand Board v4 tokens (as in Meeting Sync). On top: ONE client colour (--brand, from /brand/theme.css);
   every tint is derived from it here, so a new client is a logo and one colour. Light and dark. */
@font-face { font-family: "Familjen Grotesk"; font-weight: 500; font-display: swap; src: url(/web/fonts/familjen-grotesk-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB; }
@font-face { font-family: "Familjen Grotesk"; font-weight: 500; font-display: swap; src: url(/web/fonts/familjen-grotesk-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Familjen Grotesk"; font-weight: 600; font-display: swap; src: url(/web/fonts/familjen-grotesk-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB; }
@font-face { font-family: "Familjen Grotesk"; font-weight: 600; font-display: swap; src: url(/web/fonts/familjen-grotesk-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url(/web/fonts/source-sans-3-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB; }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-display: swap; src: url(/web/fonts/source-sans-3-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url(/web/fonts/source-sans-3-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB; }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-display: swap; src: url(/web/fonts/source-sans-3-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "Martian Mono"; font-weight: 500; font-display: swap; src: url(/web/fonts/martian-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --brand: #2d6a4f;
  --font-head: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 14px; --radius-sm: 9px;
  --bg: #f2f3ef; --surface: #ffffff; --surface-2: #f7f8f5; --line: #e2e5dd; --line-2: #ccd0c5;
  --text: #161929; --muted: #4a4f60; --soft: #6a6f7f;
  --on-brand: #ffffff;
  --brand-ink: color-mix(in oklab, var(--brand) 86%, #000);
  --brand-soft: color-mix(in oklab, var(--brand) 8%, var(--surface));
  --brand-soft-2: color-mix(in oklab, var(--brand) 15%, var(--surface));
  --brand-line: color-mix(in oklab, var(--brand) 32%, var(--surface));
  --brand-hover: color-mix(in oklab, var(--brand) 88%, #000);
  --ok: #24573f; --ok-bg: #dcf2e2; --warn: #8a4f12; --warn-bg: #fff1da; --bad: #9c3525; --bad-bg: #fbe8e2; --idle: #5b6070; --idle-bg: #ebede8;
  --shadow-1: 0 1px 2px rgba(22, 25, 41, 0.05);
  --shadow-2: 0 10px 30px -14px rgba(22, 25, 41, 0.28);
  --shadow-pop: 0 22px 50px -20px rgba(22, 25, 41, 0.45), 0 2px 6px rgba(22, 25, 41, 0.06);
  --ring: color-mix(in oklab, var(--brand) 30%, transparent);
  --toast-bg: #161929; --toast-text: #f8fafc;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #13162a; --surface: #1f2338; --surface-2: #191c30; --line: #2f3450; --line-2: #414767;
  --text: #f3f5f9; --muted: #c2c9d6; --soft: #969db0;
  --brand-ink: color-mix(in oklab, var(--brand) 45%, #fff);
  --brand-soft: color-mix(in oklab, var(--brand) 22%, var(--surface));
  --brand-soft-2: color-mix(in oklab, var(--brand) 34%, var(--surface));
  --brand-line: color-mix(in oklab, var(--brand) 55%, var(--surface));
  --brand-hover: color-mix(in oklab, var(--brand) 85%, #fff);
  --ok: #7fd3a6; --ok-bg: #1d3f31; --warn: #f0c78a; --warn-bg: #3a2c1a; --bad: #f1a493; --bad-bg: #44231d; --idle: #a9afc0; --idle-bg: #2a2f48;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3); --shadow-2: 0 12px 30px -14px rgba(0, 0, 0, 0.6); --shadow-pop: 0 24px 54px -18px rgba(0, 0, 0, 0.7);
  --toast-bg: #f3f5f9; --toast-text: #161929;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--font-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-ink); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-soft-2); }
.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; }
.muted { color: var(--muted); } .soft { color: var(--soft); }
.grow { flex: 1; min-width: 0; } .row { display: flex; align-items: center; gap: 8px; } .hide { display: none !important; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.sm { width: 15px; height: 15px; } svg.ic.lg { width: 22px; height: 22px; }

.boot { height: 100dvh; display: grid; place-items: center; }
.boot-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); animation: pulse 1.1s var(--ease) infinite alternate; }
@keyframes pulse { from { transform: scale(0.7); opacity: 0.4; } to { transform: scale(1.25); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- buttons, fields, chips -------------------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s; }
.btn:hover { background: var(--surface-2); border-color: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 14px -8px var(--brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--idle-bg); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; } .btn.icon { width: 36px; padding: 0; } .btn.icon.sm { width: 30px; }
.btn.danger { color: var(--bad); } .btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.field { height: 38px; width: 100%; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.field:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
textarea.field { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.field { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
label.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 5px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--idle-bg); color: var(--idle); white-space: nowrap; }
.chip.group { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.03em; background: transparent; border: 1px solid var(--line-2); color: var(--muted); }
.chip.brand { background: var(--brand-soft-2); color: var(--brand-ink); }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip svg.ic { width: 13px; height: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); flex: none; }
.dot.ok { background: #2f9e6b; } .dot.warn { background: #d8912b; } .dot.bad { background: #cf4a35; } .dot.brand { background: var(--brand); }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; font-family: var(--font-head); font-weight: 600; font-size: 14px; background: var(--brand-soft-2); color: var(--brand-ink); }
.avatar.sm { width: 24px; height: 24px; border-radius: 8px; font-size: 11px; } .avatar.us { background: var(--brand); color: var(--on-brand); } .avatar.gray { background: var(--idle-bg); color: var(--idle); }
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--idle-bg) 25%, var(--surface-2) 37%, var(--idle-bg) 63%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }

/* ---- menus, toasts, modal ------------------------------------------------------------------------------------------------ */
.menu-wrap { position: relative; }
.menu { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; min-width: 210px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); animation: rise 0.16s var(--ease); }
.menu.left { right: auto; left: 0; }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-align: left; font-size: 14px; }
.menu button:hover, .menu button.on { background: var(--brand-soft); }
.menu button.on { font-weight: 600; color: var(--brand-ink); }
.menu .sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu .cap { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: min(440px, calc(100vw - 40px)); padding: 11px 12px 11px 14px; border-radius: 12px; background: var(--toast-bg); color: var(--toast-text); box-shadow: var(--shadow-pop); animation: rise 0.22s var(--ease); font-size: 14px; }
.toast.bad { background: var(--bad); color: #fff; }
.toast button { border: 0; background: rgba(255, 255, 255, 0.14); color: inherit; font-weight: 600; padding: 5px 10px; border-radius: 7px; }
:root[data-theme="dark"] .toast button { background: rgba(22, 25, 41, 0.12); }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--brand-line); border-radius: 0 0 0 12px; }
.toast { position: relative; overflow: hidden; }
.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(22, 25, 41, 0.42); display: grid; place-items: center; padding: 20px; animation: rise 0.15s var(--ease); }
.modal { width: min(680px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-pop); overflow: hidden; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-family: var(--font-body); font-size: 18px; letter-spacing: 0; } .modal-body { padding: 16px 18px; overflow: auto; display: flex; flex-direction: column; gap: 12px; } .modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 14px; background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); } .banner.info { background: var(--brand-soft); color: var(--brand-ink); } .banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner svg.ic { margin-top: 1px; }

/* ---- shell ------------------------------------------------------------------------------------------------------------------ */
.app { display: grid; grid-template-columns: 232px minmax(330px, 410px) minmax(0, 1fr); height: 100dvh; }
.app.wide { grid-template-columns: 232px minmax(0, 1fr); }
.rail { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px 12px; border-right: 1px solid var(--line); background: var(--surface-2); min-width: 0; }
.rail .logo { height: 44px; display: flex; align-items: center; padding: 0 8px; margin-bottom: 12px; }
.rail .logo img { max-height: 34px; max-width: 150px; object-fit: contain; }
.rail .logo .name { font-family: var(--font-head); font-weight: 600; font-size: 19px; }
.rail .compose { height: 42px; margin: 0 2px 12px; font-size: 15px; border-radius: 12px; }
.nav { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; background: none; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14.5px; text-align: left; width: 100%; transition: background 0.15s, color 0.15s; }
.nav:hover { background: var(--idle-bg); color: var(--text); }
.nav.on { background: var(--brand-soft-2); color: var(--brand-ink); }
.nav .count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--idle-bg); color: var(--muted); }
.nav.on .count, .nav .count.hot { background: var(--brand); color: var(--on-brand); }
.rail .spacer { flex: 1; }
.rail .status { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12.5px; color: var(--soft); }
.rail .me { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 10px; border: 0; background: none; width: 100%; text-align: left; }
.rail .me:hover { background: var(--idle-bg); }
.rail .me .who { font-weight: 600; font-size: 14px; line-height: 1.2; } .rail .me .mail { font-size: 12px; color: var(--soft); }
.rail .by { padding: 6px 10px 0; font-size: 11px; color: var(--soft); letter-spacing: 0.02em; }

.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.list { border-right: 1px solid var(--line); }
.pane-head { padding: 16px 16px 10px; display: flex; flex-direction: column; gap: 12px; }
.pane-head h1 { font-size: 24px; }
.search { position: relative; } .search svg.ic { position: absolute; left: 11px; top: 10px; color: var(--soft); } .search .field { padding-left: 36px; background: var(--surface-2); border-color: transparent; }
.search .field:focus { background: var(--surface); border-color: var(--brand); }
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--idle-bg); border-radius: 11px; }
.tab { flex: 1; height: 30px; border: 0; background: none; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.tab .n { font-family: var(--font-mono); font-size: 10.5px; color: var(--soft); } .tab.on .n.hot { color: var(--brand-ink); }
.filters { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fbtn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fbtn:hover { border-color: var(--soft); color: var(--text); } .fbtn.on { background: var(--brand-soft-2); border-color: var(--brand-line); color: var(--brand-ink); }
.fbtn svg.ic { width: 13px; height: 13px; }
.rows { flex: 1; overflow: auto; padding: 0 8px 12px; overscroll-behavior: contain; }
.trow { position: relative; display: flex; gap: 11px; width: 100%; padding: 11px 10px 11px 12px; border: 0; background: none; border-radius: 12px; text-align: left; transition: background 0.12s; }
.trow + .trow { margin-top: 1px; }
.trow:hover { background: var(--surface-2); }
.trow.on { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.trow .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trow .top { display: flex; align-items: baseline; gap: 8px; }
.trow .co { font-size: 15px; font-weight: 600; }
.trow .time { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--soft); flex: none; }
.trow .subj { font-size: 13.5px; color: var(--text); } .trow .snip { font-size: 13.5px; color: var(--soft); }
.trow .meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; min-height: 22px; flex-wrap: wrap; }
.trow .subj { color: var(--muted); } .trow.unread .subj { font-weight: 600; color: var(--text); }
.trow .unread-dot { position: absolute; left: 2px; top: 25px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.empty { margin: auto; padding: 40px 28px; text-align: center; color: var(--soft); max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .art { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); margin-bottom: 6px; }
.empty h3 { font-family: var(--font-body); font-size: 17px; letter-spacing: 0; color: var(--text); }

/* ---- conversation ---------------------------------------------------------------------------------------------------- */
.reader { background: var(--bg); position: relative; }
.reader-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 68px; }
.reader-head .title { min-width: 0; flex: 1; } .reader-head h2 { font-family: var(--font-body); font-size: 20px; font-weight: 600; letter-spacing: 0; } .reader-head .sub { font-size: 13px; color: var(--soft); display: flex; gap: 8px; align-items: center; min-width: 0; }
.reader-head .acts { display: flex; align-items: center; gap: 6px; flex: none; }
.stagebtn { height: 34px; padding: 0 10px 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; }
.stagebtn:hover { border-color: var(--soft); }
.reader-body { flex: 1; min-height: 0; display: flex; }
.thread { flex: 1; min-width: 0; overflow: auto; padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.thread-inner { width: 100%; max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); animation: rise 0.25s var(--ease); }
.msg.out { background: var(--brand-soft); border-color: var(--brand-line); }
.msg.note-like { background: var(--warn-bg); border-color: transparent; }
.msg-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 0; }
.msg-head .who { font-weight: 600; font-size: 14.5px; } .msg-head .to { font-size: 12.5px; color: var(--soft); } .msg-head .when { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--soft); flex: none; }
.msg-body { padding: 10px 14px 14px 60px; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.msg-body .txt { white-space: pre-wrap; }
.msg-body iframe { width: 100%; border: 0; display: block; background: #fff; border-radius: 8px; }
.msg.out .msg-body iframe { background: #fff; }
.quote-toggle { margin-top: 8px; height: 16px; padding: 0 9px; border: 0; border-radius: 8px; background: var(--idle-bg); color: var(--soft); font-size: 16px; line-height: 8px; letter-spacing: 1px; }
.quote-toggle:hover { background: var(--line-2); color: var(--text); }
.quoted { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--line-2); color: var(--soft); white-space: pre-wrap; font-size: 14px; }
.msg.collapsed { cursor: pointer; } .msg.collapsed .msg-head { padding-bottom: 12px; } .msg.collapsed:hover { border-color: var(--line-2); }
.msg.collapsed .peek { flex: 1; min-width: 0; font-size: 13.5px; color: var(--soft); }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.file { display: flex; align-items: center; gap: 9px; width: 232px; max-width: 100%; padding: 7px 9px 7px 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); text-decoration: none; color: var(--text); transition: border-color 0.15s, box-shadow 0.15s; }
.file:hover { border-color: var(--brand-line); box-shadow: var(--shadow-1); }
.file .thumb { width: 38px; height: 38px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--idle-bg); color: var(--idle); overflow: hidden; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .thumb.pdf { background: var(--bad-bg); color: var(--bad); font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; }
.file .fname { font-size: 13.5px; font-weight: 600; } .file .fsize { font-size: 12px; color: var(--soft); }
.file .get { margin-left: auto; color: var(--soft); }
.event { align-self: center; display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.event b { color: var(--text); font-weight: 600; }
.pending { border: 1px dashed var(--brand-line); background: var(--brand-soft); border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; animation: rise 0.2s var(--ease); }
.pending.bad { border-color: var(--bad); background: var(--bad-bg); }
.pending .ptxt { flex: 1; min-width: 0; } .pending .pstate { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; } .pending .pbody { font-size: 13.5px; color: var(--muted); white-space: pre-wrap; max-height: 64px; overflow: hidden; margin-top: 2px; }
.imgbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; color: var(--soft); }
.imgbar button { border: 0; background: none; color: var(--brand-ink); font-weight: 600; padding: 0; font-size: 12.5px; }

/* reply box */
.composer { margin: 0 20px 18px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-2); transition: border-color 0.15s, box-shadow 0.15s; }
.composer-wrap { width: 100%; max-width: 860px; margin: 0 auto; }
.composer:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring), var(--shadow-2); }
.composer .cto { display: flex; align-items: center; gap: 8px; padding: 10px 14px 0; font-size: 13px; color: var(--soft); }
.composer .cto b { color: var(--text); font-weight: 600; }
.composer textarea { display: block; width: 100%; border: 0; outline: 0; resize: none; background: transparent; padding: 8px 14px 4px; font-size: 15px; line-height: 1.5; min-height: 46px; max-height: 40dvh; }
.composer .cbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px 10px; }
.composer .hint { font-size: 12px; color: var(--soft); margin-left: auto; margin-right: 6px; }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 2px; }
.attach { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 6px 0 9px; border-radius: 8px; background: var(--idle-bg); font-size: 13px; max-width: 260px; }
.attach.up { opacity: 0.6; } .attach.err { background: var(--bad-bg); color: var(--bad); }
.attach button { border: 0; background: none; padding: 2px; color: var(--soft); display: grid; } .attach button:hover { color: var(--text); }
.dropzone { position: absolute; inset: 10px; z-index: 30; border: 2px dashed var(--brand); border-radius: 18px; background: color-mix(in oklab, var(--brand) 10%, var(--surface)); display: grid; place-items: center; font-family: var(--font-head); font-size: 20px; color: var(--brand-ink); pointer-events: none; }
.dnc-bar { margin: 0 20px 18px; }

/* side card */
.side { width: 292px; flex: none; overflow: auto; padding: 18px 18px 18px 0; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-1); }
.card h3 { font-size: 12px; font-family: var(--font-body); font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--soft); margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 6px 10px; font-size: 13.5px; } .kv dt { color: var(--soft); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.note { padding: 8px 10px; border-radius: 9px; background: var(--warn-bg); font-size: 13.5px; } .note + .note { margin-top: 6px; } .note .by { font-size: 11.5px; color: var(--warn); margin-top: 3px; }
.earlier { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 0; border: 0; background: none; text-align: left; font-size: 13.5px; color: var(--text); } .earlier:hover { color: var(--brand-ink); }

/* ---- sign-in ---------------------------------------------------------------------------------------------------------------- */
.signin { height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, var(--brand-soft-2), transparent 70%), var(--bg); overflow: auto; }
.signin-card { width: min(410px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 30px 28px 24px; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 14px; animation: rise 0.3s var(--ease); }
.signin-card img { max-height: 44px; max-width: 190px; object-fit: contain; align-self: flex-start; margin-bottom: 6px; }
.signin-card h1 { font-size: 24px; } .signin-card p { margin: 0; color: var(--muted); }
.code-field { letter-spacing: 0.5em; font-family: var(--font-mono); font-size: 22px; text-align: center; height: 54px; padding-left: 0.5em; }
.signin-foot { font-size: 12px; color: var(--soft); text-align: center; margin-top: 4px; }
.err { color: var(--bad); font-size: 13.5px; }

/* ---- statistics ----------------------------------------------------------------------------------------------------------- */
.page { overflow: auto; padding: 22px 26px 40px; background: var(--bg); }
.page-inner { width: 100%; max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page-inner > * { min-width: 0; max-width: 100%; } .grid2 > * { min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; } .page-head h1 { font-size: 26px; } .page-head .sub { color: var(--soft); font-size: 14px; }
.seg { display: inline-flex; padding: 3px; background: var(--idle-bg); border-radius: 10px; } .seg button { height: 30px; padding: 0 12px; border: 0; background: none; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); } .seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi .lab { font-size: 13.5px; color: var(--muted); font-weight: 600; }
.kpi .val { font-family: var(--font-head); font-size: 34px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 8px; }
.kpi .val small { font-family: var(--font-body); font-size: 14px; font-weight: 400; color: var(--soft); letter-spacing: 0; }
.kpi .foot { font-size: 13px; color: var(--soft); margin-top: auto; padding-top: 6px; }
.kpi.hero { background: var(--brand); border-color: var(--brand); color: var(--on-brand); } .kpi.hero .lab, .kpi.hero .foot, .kpi.hero .val small { color: color-mix(in oklab, var(--on-brand) 78%, var(--brand)); }
.kpi.hero .val { font-size: 50px; }
.meter { position: relative; height: 8px; border-radius: 999px; background: color-mix(in oklab, var(--on-brand) 22%, var(--brand)); margin-top: 10px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--on-brand); }
.meter .tick { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--on-brand); opacity: 0.9; border-radius: 2px; }
.insights { display: flex; flex-direction: column; gap: 8px; }
.insight { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; } .insight .ib { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.insight.good .ib { background: var(--ok-bg); color: var(--ok); } .insight.warn .ib { background: var(--warn-bg); color: var(--warn); } .insight.info .ib { background: var(--idle-bg); color: var(--idle); }
.insight span { padding-top: 2px; }
table.gt { width: 100%; border-collapse: collapse; font-size: 14px; }
table.gt th { text-align: right; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--soft); padding: 0 10px 8px; white-space: nowrap; }
table.gt th:first-child, table.gt td:first-child { text-align: left; padding-left: 0; }
table.gt td { padding: 11px 10px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; vertical-align: middle; }
table.gt td.g { min-width: 210px; } table.gt .gl { font-weight: 600; } table.gt .gs { font-size: 12.5px; color: var(--soft); }
table.gt tr.total td { font-weight: 600; border-top: 2px solid var(--line-2); }
.bar-cell { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.bar-track { position: relative; width: 150px; height: 12px; flex: none; }
.bar-track .base { position: absolute; left: 0; right: 0; top: 5px; height: 2px; background: var(--line); border-radius: 2px; }
.bar-track .fill { position: absolute; left: 0; top: 0; height: 12px; background: var(--brand); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-track .fill.dim { background: var(--line-2); }
.bar-track .target { position: absolute; top: -4px; height: 20px; width: 2px; background: var(--text); border-radius: 2px; }
.bar-cell .num { width: 38px; text-align: right; font-weight: 600; }
.spark { display: block; } .spark .l { fill: none; stroke: var(--line-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; } .spark .d { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.spark-wrap { position: relative; display: inline-block; }
.tip { position: fixed; z-index: 95; pointer-events: none; padding: 7px 10px; border-radius: 9px; background: var(--toast-bg); color: var(--toast-text); font-size: 12.5px; box-shadow: var(--shadow-pop); white-space: nowrap; }
.tip b { font-weight: 600; font-size: 13.5px; }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.frow { display: grid; grid-template-columns: 150px 1fr 110px; gap: 12px; align-items: center; font-size: 14px; }
.frow .ft { position: relative; height: 18px; } .frow .ft i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 0 4px 4px 0; min-width: 2px; }
.frow .fv { font-variant-numeric: tabular-nums; } .frow .fv b { font-weight: 600; } .frow .fv span { color: var(--soft); font-size: 12.5px; margin-left: 6px; }
.legend-note { font-size: 12.5px; color: var(--soft); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.legend-note i.t { display: inline-block; width: 2px; height: 12px; background: var(--text); vertical-align: -2px; margin-right: 6px; border-radius: 2px; }
.grid2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }

/* ---- admin ------------------------------------------------------------------------------------------------------------------ */
.arow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; } .arow:first-of-type { border-top: 0; }
.arow .am { flex: 1; min-width: 0; } .arow .as { font-size: 12.5px; color: var(--soft); }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.log { font-size: 12.5px; color: var(--muted); max-height: 260px; overflow: auto; } .log div { padding: 4px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; } .log .mono { color: var(--soft); flex: none; }

/* ---- sent ------------------------------------------------------------------------------------------------------------------ */
.srow .kind { font-size: 12px; color: var(--soft); display: flex; align-items: center; gap: 6px; }

/* ---- small screens ---------------------------------------------------------------------------------------------------- */
.back { display: none; }
.tabbar { display: none; }
@media (max-width: 1280px) { .side { display: none; } .side.open { display: flex; position: absolute; right: 0; top: 68px; bottom: 0; z-index: 20; background: var(--bg); padding: 16px; box-shadow: var(--shadow-pop); } }
@media (min-width: 1281px) { .side-toggle { display: none; } }
@media (max-width: 1080px) { .app { grid-template-columns: 68px minmax(300px, 360px) minmax(0, 1fr); } .app.wide { grid-template-columns: 68px minmax(0, 1fr); }
  .rail { padding: 14px 10px; align-items: center; } .rail .logo { padding: 0; justify-content: center; } .rail .logo img { max-width: 44px; } .rail .logo .name { display: none; }
  .nav { justify-content: center; padding: 0; position: relative; } .nav span.t, .rail .compose span, .rail .status span, .rail .me .txt, .rail .by { display: none; } .nav .count { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; font-size: 9.5px; padding: 0 4px; }
  .rail .compose { width: 44px; padding: 0; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  body { overflow: auto; }
  .app, .app.wide { display: block; height: auto; min-height: 100dvh; padding-bottom: 62px; }
  .rail { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: 62px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); justify-content: space-around; }
  .tabbar button { flex: 1; border: 0; background: none; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--soft); position: relative; }
  .tabbar button.on { color: var(--brand-ink); } .tabbar .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--brand); color: var(--on-brand); font-family: var(--font-mono); font-size: 9.5px; display: grid; place-items: center; padding: 0 4px; }
  .pane.list { min-height: calc(100dvh - 62px); border-right: 0; } .has-thread .pane.list { display: none; } .pane.reader { display: none; min-height: calc(100dvh - 62px); } .has-thread .pane.reader { display: flex; }
  .rows { overflow: visible; } .thread { overflow: visible; padding: 14px 12px 18px; } .reader-body { display: block; }
  .reader-head { position: sticky; top: 0; z-index: 15; padding: 10px 12px; gap: 8px; flex-wrap: wrap; } .reader-head h2 { font-size: 17px; } .back { display: inline-flex; }
  .reader-head .acts { width: 100%; justify-content: flex-start; overflow-x: auto; }
  .composer { margin: 0 10px 12px; position: sticky; bottom: 70px; } .dnc-bar { margin: 0 10px 12px; } .msg-body { padding-left: 14px; } .composer .hint { display: none; }
  .page { padding: 16px 12px 30px; overflow: visible; } .page-head { flex-direction: column; align-items: flex-start; } .page-inner { min-width: 0; } .card { overflow-x: auto; } .kpis { grid-template-columns: 1fr 1fr; } .kpi .val { font-size: 28px; } .kpi.hero { grid-column: 1 / -1; } .kpi.hero .val { font-size: 42px; }
  .toasts { left: 10px; right: 10px; bottom: 72px; transform: none; align-items: stretch; } .toast { min-width: 0; } .frow { grid-template-columns: 96px 1fr 84px; }
  table.gt .hide-sm { display: none; } .bar-track { width: 84px; } table.gt td.g { min-width: 0; } .formgrid { grid-template-columns: 1fr; }
  .scrim { padding: 0; align-items: end; } .modal { border-radius: 18px 18px 0 0; max-height: 92dvh; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
