/* ===========================================================================
   Gowabox — design system (system font, WhatsApp var(--brand), full-viewport shell)
   Mirrors the "WhatsApp UI modernization" .dc.html reference (crm-shell.js).
   =========================================================================== */

:root {
    /* brand color — overridable from Admin → Settings (BRAND_COLOR); shades derive automatically */
    --brand: #00a884;
    --brand-700: color-mix(in srgb, var(--brand) 78%, black);
    --brand-ink: color-mix(in srgb, var(--brand) 62%, black);
    --brand-050: color-mix(in srgb, var(--brand) 7%, white);
    --brand-100: color-mix(in srgb, var(--brand) 15%, white);
    --brand-200: color-mix(in srgb, var(--brand) 30%, white);

    /* brand — flat, no gradients */
    --grad: var(--brand);
    --grad-accent: var(--brand);
    --green-d: var(--brand-700);   /* darker hover / links */
    --green: var(--brand);     /* primary */
    --green-b: #25D366;   /* bright (read ticks) */
    --accent: var(--brand);

    /* ink */
    --ink: #111B21;
    --ink-2: #54656F;
    --ink-3: #667781;
    --ink-4: #8696A0;

    /* lines / surfaces */
    --line: #E9EDEF;
    --line-2: #F0F2F5;
    --line-3: #F4F6F8;
    --page: #F7F9FA;      /* app background */

    /* dark rail (sidebar) */
    --rail: #202C33;
    --rail-ink: #AEBAC1;
    --rail-active: color-mix(in srgb, var(--brand) 22%, transparent);

    /* chips / pills */
    --chip: #EFEFF0;
    --chip-on: var(--brand-100);
    --chip-on-ink: var(--brand-ink);
    --link: #027EB5;

    /* chat */
    --chat-bg: #EFEAE2;
    --bubble-out: #D9FDD3;
    --backdrop: #F7F9FA;

    /* status / category */
    --ok: #16A34A;
    --warn: #D97706;
    --bad: #DC2626;
    --info: #0EA5E9;
    --cat-mkt: #7C3AED;
    --cat-util: #0EA5E9;
    --cat-auth: #16A34A;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: -apple-system, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, "Helvetica Neue", sans-serif;
    color: var(--ink);
    background: var(--page);
    display: flex;
    align-items: center;
    justify-content: center;
}
.noscroll::-webkit-scrollbar { width: 0; height: 0; }
.noscroll { scrollbar-width: none; }
a { color: var(--green-d); text-decoration: none; }
.muted { color: var(--ink-3); }

/* ---------- Frame shell ---------- */
.frame {
    position: relative;
    width: 100%;
    max-width: 460px;
    height: 100vh;
    height: 100dvh;
    max-height: 940px;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.frame-body { flex: 1; overflow-y: auto; background: #fff; }
.frame-body.chat-bg { background: var(--chat-bg); }

/* ---------- Headers ---------- */
.app-header { position: sticky; top: 0; z-index: 5; background: var(--grad); color: #fff; padding: 16px; }
.app-header h1 { margin: 0; font-size: 19px; font-weight: 800; }
.app-header .sub { font-size: 12.5px; opacity: .85; margin-top: 2px; }

.acct-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acct-id { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; background: none; border: none; color: #fff; padding: 0; font: inherit; }
.acct-id .name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-id .num { font-size: 12px; opacity: .85; }
.balance-pill { display: flex; flex-direction: column; align-items: flex-end; background: rgba(255, 255, 255, .16); border-radius: 12px; padding: 6px 11px; color: #fff; text-decoration: none; }
.balance-pill .lbl { font-size: 9px; letter-spacing: .6px; opacity: .8; font-weight: 700; }
.balance-pill .val { font-size: 14px; font-weight: 800; }

.header-search { margin-top: 12px; display: flex; align-items: center; gap: 9px; background: rgba(255, 255, 255, .15); border-radius: 11px; padding: 9px 13px; }
.header-search input { flex: 1; background: none; border: none; outline: none; color: #fff; font: inherit; font-size: 13.5px; }
.header-search input::placeholder { color: rgba(255, 255, 255, .8); }
.hdr-actions { display: flex; gap: 8px; }
.hdr-btn { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.16); border: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.hdr-btn:hover { background: rgba(255,255,255,.26); }
.hdr-btn svg { width: 19px; height: 19px; }

/* ---------- Avatars ---------- */
.avatar { border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: 0 0 auto; letter-spacing: .3px; width: 50px; height: 50px; font-size: 17px; }
.avatar.sm { width: 40px; height: 40px; font-size: 14px; }
.avatar.xs { width: 38px; height: 38px; font-size: 13px; }

/* ---------- Filter chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.chip { white-space: nowrap; background: var(--line-2); color: var(--ink-2); border: 1px solid transparent; border-radius: 16px; padding: 5px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.chip.active { background: var(--brand-100); color: var(--green-d); border-color: #B7E4C7; font-weight: 700; }

/* ---------- Chat list ---------- */
.clist { list-style: none; margin: 0; padding: 0; }
.citem { display: flex; gap: 13px; align-items: center; padding: 11px 16px; cursor: pointer; border-bottom: 1px solid var(--line-3); }
.citem:hover { background: #F6F8FA; }
.citem.active { background: #EAF7EF; }
.citem-main { flex: 1; min-width: 0; }
.citem-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.citem-name { font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citem-time { font-size: 12px; color: var(--ink-4); flex: 0 0 auto; }
.citem-time.unread { color: var(--green); font-weight: 700; }
.citem-bot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 3px; }
.citem-preview { font-size: 13.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.citem-preview .tick { color: var(--green); }
.citem-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.unread-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--green-b); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.chat-label { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }

/* ---------- Conversation overlay ---------- */
.conv { position: absolute; inset: 0; z-index: 30; background: var(--chat-bg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; }
.conv.open { transform: translateX(0); }
.conv-header { background: var(--grad); color: #fff; padding: 10px 12px; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.conv-back { background: none; border: none; color: #fff; cursor: pointer; padding: 2px; display: flex; }
.conv-who { flex: 1; min-width: 0; }
.conv-who .name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-who .status { font-size: 12px; opacity: .85; }
.conv-banner { background: #FFF6D8; color: #7A5B00; font-size: 11.5px; text-align: center; padding: 7px 12px; flex: 0 0 auto; border-bottom: 1px solid #F0E6C0; }
.conv-banner.closed { background: #FDECEC; color: #8a1c1c; border-color: #f3c6c6; }
.conv-body { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; }
.day-sep { text-align: center; margin: 4px 0 12px; }
.day-sep span { background: #fff; color: var(--ink-2); font-size: 11.5px; font-weight: 700; padding: 4px 12px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }

/* call log entry in the chat timeline */
.call-chip { display: flex; justify-content: center; margin: 6px 0; }
.call-chip .cc { display: inline-flex; align-items: center; gap: 9px; background: #fff; border-radius: 10px; padding: 7px 13px; box-shadow: 0 1px 1px rgba(0,0,0,.07); font-size: 13px; color: #1F2C34; max-width: 82%; }
.call-chip .cc-ic { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.call-chip .cc-ic svg { width: 14px; height: 14px; }
.call-chip .cc-ic.in { background: #E7F7EE; color: #12864B; }
.call-chip .cc-ic.out { background: #E6F0FF; color: #1B66D6; }
.call-chip .cc-ic.miss { background: #FDE7E7; color: #D33; }
.call-chip .cc-t { font-weight: 600; }
.call-chip .cc-sub { color: #8696A0; font-size: 11.5px; }
.call-chip .cc-cost { margin-left: 2px; color: #667781; font-size: 11.5px; font-weight: 600; }

/* live-audio call overlay */
.call-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(11,20,26,.72); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; }
.call-card { width: 300px; max-width: 90vw; background: linear-gradient(180deg,#1F2C34,#0B141A); border-radius: 20px; padding: 30px 24px 26px; text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,.5); color: #fff; }
.call-card .call-av { width: 96px; height: 96px; font-size: 34px; margin: 0 auto 16px; box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.call-card .call-name { font-size: 20px; font-weight: 700; }
.call-card .call-state { font-size: 13.5px; color: #9FB3C8; margin-top: 5px; min-height: 18px; letter-spacing: .3px; }
.call-actions { display: flex; justify-content: center; gap: 40px; margin-top: 26px; }
.call-cbtn { display: flex; flex-direction: column; align-items: center; gap: 7px; border: 0; background: none; cursor: pointer; font-size: 11.5px; font-weight: 600; color: #C9D6DF; }
.call-cbtn svg { width: 58px; height: 58px; border-radius: 50%; padding: 17px; box-sizing: border-box; }
.call-cbtn.accept svg { background: #12B76A; }
.call-cbtn.decline svg, .call-cbtn.end svg { background: #F04438; }
.call-cbtn.mute svg { background: rgba(255,255,255,.12); color: #fff; }
.call-cbtn.mute.on svg { background: #fff; color: #1F2C34; }
.call-cbtn.accept { animation: callpulse 1.3s ease-in-out infinite; }
@keyframes callpulse { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
#call-remote { display: none; }

.bubble { max-width: 80%; padding: 6px 9px 5px; border-radius: 13px; font-size: 14.5px; line-height: 1.36; box-shadow: 0 1px 1px rgba(0, 0, 0, .07); word-break: break-word; margin-bottom: 6px; position: relative; }
.bubble.in { background: #fff; align-self: flex-start; border-top-left-radius: 4px; }
.bubble.out { background: var(--bubble-out); align-self: flex-end; border-top-right-radius: 4px; }
.bubble.failed { background: #FFE0E0; }
.bubble-text { white-space: pre-wrap; }
.bubble-meta { display: block; text-align: right; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.tick.read { color: #53BDEB; }
.tpl-flag { font-size: 10px; font-weight: 800; letter-spacing: .4px; color: var(--green-d); border-bottom: 1px solid rgba(0,0,0,.08); padding-bottom: 3px; margin-bottom: 5px; }
.bubble .pv-footer { color: var(--ink-3); font-size: 12px; margin-top: 6px; }
.bubble .pv-buttons { margin: 8px -9px -5px; }
.bubble .pv-btn { text-align: center; padding: 7px; font-size: 13.5px; font-weight: 600; color: #027eb5; border-top: 1px solid rgba(0,0,0,.08); }

.quick-replies { display: flex; gap: 8px; overflow-x: auto; padding: 9px 12px; flex: 0 0 auto; background: var(--line-2); border-top: 1px solid #E2E6E9; }
.qr { white-space: nowrap; background: #fff; border: 1px solid #D1D7DB; border-radius: 16px; padding: 6px 13px; font-size: 13px; color: var(--green-d); font-weight: 600; cursor: pointer; }

.composer { display: flex; align-items: center; gap: 9px; padding: 8px 10px 10px; background: var(--line-2); flex: 0 0 auto; }
.composer .icon-btn { background: none; border: none; cursor: pointer; padding: 4px; font-size: 21px; line-height: 1; color: var(--ink-2); }
.composer textarea { flex: 1; border: none; outline: none; background: #fff; border-radius: 22px; padding: 11px 16px; font: inherit; font-size: 14px; color: var(--ink); resize: none; max-height: 110px; }
.composer textarea:disabled { background: #e9edef; }
.send-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--green); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; box-shadow: 0 3px 8px rgba(31, 170, 89, .35); }
.send-btn:disabled { opacity: .5; }
.emoji-tray { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px; background: var(--line-2); max-height: 150px; overflow-y: auto; }
.emoji-tray span { font-size: 22px; cursor: pointer; padding: 3px 5px; border-radius: 6px; }
.emoji-tray span:hover { background: #e3e6e8; }

/* ---------- Bottom nav ---------- */
.bottom-nav { flex: 0 0 auto; display: flex; border-top: 1px solid var(--line); background: #fff; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 9px; color: var(--ink-4); text-decoration: none; font-size: 11px; font-weight: 700; }
.nav-item.active { color: var(--green); }
.nav-item svg { width: 23px; height: 23px; }

/* ---------- Cards / stats / pills ---------- */
.pad { padding: 16px; }
.section-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 8px; }
.section-h .t { font-size: 13px; font-weight: 800; color: var(--ink-2); letter-spacing: .4px; }
.section-h .a { font-size: 12.5px; color: var(--green); font-weight: 700; }

.stat-cards { display: flex; gap: 10px; padding: 16px 16px 4px; }
.stat { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.stat .n { font-size: 20px; font-weight: 800; }
.stat .l { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.card-m { margin: 0 16px 12px; }

.tpl-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tpl-name { font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.tpl-meta { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.tpl-preview { font-size: 13px; color: var(--ink-3); margin-top: 9px; line-height: 1.45; background: #F6F8FA; border-radius: 9px; padding: 9px 11px; white-space: pre-wrap; }

.pill { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 20px; }
.pill-sq { font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 6px; }
.pill.ok, .pill-sq.ok { background: rgba(22,163,74,.10); color: var(--ok); }
.pill.warn, .pill-sq.warn { background: rgba(217,119,6,.10); color: var(--warn); }
.pill.bad, .pill-sq.bad { background: rgba(220,38,38,.10); color: var(--bad); }
.pill.info, .pill-sq.info { background: rgba(14,165,233,.10); color: var(--info); }
.pill.mkt { background: rgba(124,58,237,.10); color: #7C3AED; }
.lang { font-size: 11.5px; color: var(--ink-4); }

/* ---------- Number cards / add card ---------- */
.num-card { display: flex; align-items: center; gap: 12px; }
.num-card .info { flex: 1; min-width: 0; }
.num-card .nm { font-weight: 700; font-size: 14.5px; }
.num-card .tier { font-size: 12px; color: var(--ink-4); margin-top: 1px; }
.add-card { margin: 6px 16px 0; border: 1.5px dashed var(--green); border-radius: 14px; padding: 15px; background: #F4FBF6; display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; }
.add-card .plus { width: 38px; height: 38px; border-radius: 10px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; flex: 0 0 auto; }
.add-card .at { font-weight: 800; font-size: 14.5px; color: var(--green-d); }
.add-card .ad { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---------- Buttons / forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.btn:hover { background: #f6f8fa; }
.btn-primary { background: var(--grad-accent); border: none; color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 28%, transparent); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-danger { color: var(--bad); border-color: #f3c6c6; }
.btn:disabled { opacity: .55; cursor: default; }

.field { display: block; margin-bottom: 13px; }
.field label, .field > span { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 700; margin-bottom: 6px; }
.input, .field input, .field select, .field textarea {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px;
    font: inherit; font-size: 15px; color: var(--ink); background: #fff;
}
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--green); border-color: transparent; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Flash / alerts ---------- */
.alert { margin: 12px 16px 0; padding: 11px 13px; border-radius: 11px; font-size: 13.5px; }
.alert-error { background: #FDECEC; color: #b71c1c; }
.alert-success { background: #E7F7EF; color: #0b6e4f; }
.flash-float { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.18); }

/* ---------- Auth ---------- */
.auth-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 28px 22px; }
.auth-logo { width: 64px; height: 64px; border-radius: 18px; background: var(--grad-accent); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 30%, transparent); }
.auth-h { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
.auth-sub { color: var(--ink-3); font-size: 14px; margin: 0 0 22px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--ink-3); font-size: 14px; }

/* ---------- Empty / account sheet ---------- */
.empty { text-align: center; padding: 48px 24px; color: var(--ink-3); }
.empty .btn { margin-top: 14px; }
.sheet-backdrop { position: absolute; inset: 0; z-index: 25; background: rgba(0,0,0,.4); }
.sheet { position: absolute; top: 0; left: 0; right: 0; background: #fff; border-radius: 0 0 20px 20px; padding: 16px; box-shadow: 0 14px 34px rgba(0,0,0,.28); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-h .t { font-size: 15px; font-weight: 800; }
.sheet-h .x { font-size: 13px; color: var(--ink-4); cursor: pointer; font-weight: 700; background: none; border: none; }

/* ---------- Modal ---------- */
.modal { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; z-index: 80; }
.modal-card { background: #fff; border-radius: 18px 18px 0 0; padding: 18px; width: 100%; max-height: 88%; overflow-y: auto; }
.modal-card h3 { margin: 0 0 4px; font-size: 17px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* ---------- Misc ---------- */
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line-2); }
.code { background: #F1F3F4; padding: 2px 6px; border-radius: 5px; font-size: 12px; font-family: ui-monospace, monospace; word-break: break-all; }
.webhook-box { font-size: 12px; color: var(--ink-3); }
.webhook-box input { width: 100%; margin-top: 5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 11.5px; background: #f8fafa; }

/* ===========================================================================
   Desktop 3-column team inbox (WhatsApp CRM)
   =========================================================================== */
body.deskbody { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; background: #fff; height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); overflow: hidden; touch-action: pan-x pan-y; overscroll-behavior: none; }
.desk { display: flex; flex: 1; min-height: 0; background: #fff; }

/* left rail */
.desk-rail { width: 216px; background: #202C33; display: flex; flex-direction: column; padding: 12px 10px; flex: 0 0 auto; transition: width .16s ease; overflow: hidden; }
.rail-toggle { background: none; border: none; color: #8696A0; cursor: pointer; padding: 7px 8px; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; border-radius: 8px; font: inherit; font-size: 13px; }
.rail-toggle:hover { background: rgba(255,255,255,.06); color: #fff; }
.rail-toggle svg { width: 20px; height: 20px; flex: 0 0 auto; }
.desk.collapsed .desk-rail { width: 66px; }
.desk.collapsed .rail-nav span, .desk.collapsed .rail-acct .who, .desk.collapsed .rail-toggle span { display: none; }
.desk.collapsed .rail-nav { justify-content: center; padding: 11px; }
.desk.collapsed .rail-acct { justify-content: center; padding: 4px 0 14px; }
.desk.collapsed .rail-toggle { justify-content: center; }

/* shared desktop content page (templates, numbers, account) */
.desk-page { flex: 1; overflow-y: auto; background: #F7F9FA; padding: 26px 32px; min-width: 0; }
.dpage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.dpage-head h1 { margin: 0; font-size: 24px; font-weight: 800; color: #111B21; }
.dpage-head .sub { font-size: 13.5px; color: #667781; margin-top: 3px; }
.dpage-head .actions { display: flex; gap: 10px; align-items: center; }
.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.dpanel { background: #fff; border: 1px solid #E9EDEF; border-radius: 13px; padding: 18px; margin-bottom: 16px; }
.rail-acct { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.rail-acct .nm { color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-acct .nu { color: #8696A0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-nav { display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: 11px; color: var(--rail-ink); text-decoration: none; font-size: 14.5px; font-weight: 600; margin-bottom: 3px; transition: background .12s; }
.rail-nav:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.rail-nav.active { background: var(--rail-active); color: #fff; font-weight: 700; }
.rail-nav svg { width: 22px; height: 22px; flex: 0 0 auto; }
.rail-nav i { font-size: 21px; line-height: 1; display: inline-flex; align-items: center; flex: 0 0 auto; }
.rail-nav i::before { line-height: 1; }
.rail-foot { margin-top: auto; }
.rail-foot form { margin: 0; }
.rail-foot .rail-nav { width: 100%; background: none; border: none; cursor: pointer; text-align: left; font: inherit; }

/* brand block (matches Chats.dc.html rail header) */
.rail-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.rail-logo { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.rail-brandtext { min-width: 0; }
.rail-brandtext .bn { color: #fff; font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-brandtext .bz { color: #8696A0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk.collapsed .rail-brandtext { display: none; }
.desk.collapsed .rail-brand { justify-content: center; padding: 6px 0 18px; }

/* inbox column */
.desk-inbox { width: 380px; border-right: 1px solid #E9EDEF; display: flex; flex-direction: column; flex: 0 0 auto; min-height: 0; position: relative; }
.acct-switch { display: flex; align-items: center; gap: 9px; background: none; border: none; cursor: pointer; min-width: 0; padding: 4px 6px; border-radius: 8px; color: #111B21; }
.acct-switch:hover { background: rgba(0,0,0,.05); }
.acct-switch .acct-nm { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-switch svg { width: 16px; height: 16px; color: #54656F; flex: 0 0 auto; }
.acct-dropdown { position: absolute; z-index: 40; top: 50px; left: 10px; min-width: 268px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(0,0,0,.16); padding: 6px; }
.acct-dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: #111B21; }
.acct-dropdown a:hover { background: #F0F2F5; }
.acct-dropdown a.active { background: #EAF7EF; }
.dconv.start-new { background: #F0FBF4; }
.dconv.start-new:hover { background: #E3F6EA; }
.dconv.start-new .avatar { font-size: 20px; font-weight: 600; }
.inbox-head { padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between; background: #fff; }
.inbox-head .t { font-size: 20px; font-weight: 800; color: #111B21; }
.inbox-head button { background: none; border: none; cursor: pointer; color: #54656F; display: flex; }
.inbox-search { padding: 6px 14px 8px; background: #fff; }
.inbox-search .box { display: flex; align-items: center; gap: 8px; background: #EFEFF0; border-radius: 10px; padding: 8px 12px; }
.inbox-search svg { flex: 0 0 auto; }
.inbox-search input { width: 100%; background: transparent; border: none; outline: none; padding: 0; font-size: 15px; color: #111B21; }
.inbox-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 14px 9px; background: #fff; }
.inbox-chips::-webkit-scrollbar { display: none; }
.inbox-chip { white-space: nowrap; background: #EFEFF0; color: #54656F; border: none; border-radius: 15px; padding: 5px 13px; font-size: 13px; font-weight: 500; cursor: pointer; }
.inbox-chip.active { background: var(--brand-100); color: var(--brand-ink); font-weight: 700; }
.inbox-list { flex: 1; overflow-y: auto; min-height: 0; background: #fff; }
.dconv { display: flex; gap: 12px; align-items: flex-start; padding: 9px 14px 0; cursor: pointer; background: #fff; }
.dconv:hover { background: #F6F8FA; }
.dconv.active { background: #F0F2F5; }
.dconv-main { flex: 1; min-width: 0; border-bottom: .5px solid #E7E7EA; padding-bottom: 10px; }
.dconv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dconv-name { font-weight: 600; font-size: 16.5px; color: #111B21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dconv-time { font-size: 12.5px; color: #8E8E93; flex: 0 0 auto; }
.dconv-time.unread { color: var(--brand); font-weight: 700; }
.dconv-prev { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.dconv-prev .txt { font-size: 14.5px; color: #8E8E93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; line-height: 1.3; }
.dconv-prev .tick { color: #53BDEB; }
.dconv-tags { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.tag { font-size: 10px; font-weight: 700; border-radius: 5px; padding: 1px 6px; }
.tag-open { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.tag-tpl { color: #B26B00; background: #FFF3D6; }
.tag-unassigned { color: #667781; background: #EEF1F3; }
.dbadge { min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* conversation column */
.desk-conv { flex: 1; display: flex; flex-direction: column; min-width: 0; background-color: #EFE7DE;
    background-image: radial-gradient(rgba(0,0,0,.02) 1px, transparent 1px); background-size: 16px 16px; }
.desk-conv .placeholder { flex: 1; display: flex; align-items: center; justify-content: center; color: #667781; text-align: center; }
.dconv-head { background: #F0F2F5; padding: 9px 16px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid #E2E6E9; flex: 0 0 auto; }
.dconv-head .nm { font-weight: 600; font-size: 16.5px; color: #111B21; }
.dconv-head .sub { font-size: 12px; color: #8E8E93; }
.assignee-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 14px; background: #EDE9FE; color: #6D28D9; }
.assignee-chip.none { background: #EEF1F3; color: #667781; }
.reassign { font-size: 12.5px; font-weight: 700; color: var(--brand-700); cursor: pointer; display: flex; align-items: center; gap: 4px; background: none; border: none; }
.dconv-banner { text-align: center; font-size: 11.5px; padding: 7px 12px; flex: 0 0 auto; }
.dconv-banner.open { background: var(--brand-100); color: var(--brand-ink); font-weight: 600; }
.dconv-banner.closed { background: #FFF3D6; color: #9A6700; font-weight: 600; }
.dconv-msgs { flex: 1; overflow-y: auto; padding: 18px clamp(16px, 7%, 64px); display: flex; flex-direction: column; }
.dbubble { max-width: 75%; padding: 6px 9px 4px; border-radius: 9px; font-size: 15px; line-height: 1.35; box-shadow: 0 1px .5px rgba(0,0,0,.13); margin-bottom: 4px; word-break: break-word; position: relative; }

/* media inside bubbles — contained, no overlap */
.dbubble.media { padding: 3px; max-width: 320px; }
.media-wrap { border-radius: 6px; overflow: hidden; line-height: 0; position: relative; }
/* blur-up: shimmering skeleton while the proxied image loads, then sharpen in */
.media-wrap.loading-media { min-width: 200px; min-height: 150px; background: linear-gradient(100deg, #d9dde0 30%, #eef1f3 50%, #d9dde0 70%); background-size: 200% 100%; animation: chatshim 1.25s ease-in-out infinite; }
@keyframes chatshim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.chat-img { display: block; width: 100%; max-width: 314px; max-height: 360px; object-fit: cover; cursor: pointer; filter: blur(12px); opacity: 0; transition: filter .5s ease, opacity .4s ease; }
.chat-img.ready { filter: blur(0); opacity: 1; }
.chat-img-fail { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 200px; height: 150px; background: #E9EDEF; color: #8696A0; cursor: pointer; line-height: 1.2; }
.chat-img-fail i { font-size: 26px; }
.chat-img-fail span { font-size: 11.5px; font-weight: 600; }
.chat-vid { display: block; width: 100%; max-width: 314px; border-radius: 6px; }
.chat-aud { display: block; width: 240px; max-width: 100%; margin: 3px; }
.dbubble.media .dbubble-meta { padding: 0 6px 3px; }
.dbubble.media .dbubble-text { padding: 2px 6px; }

/* document card */
.doc-card { display: flex; align-items: center; gap: 11px; background: rgba(0,0,0,.05); border-radius: 8px; padding: 10px 12px; text-decoration: none; color: inherit; min-width: 236px; }
.doc-ic { width: 40px; height: 40px; border-radius: 8px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; flex: 0 0 auto; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-weight: 600; font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 11.5px; color: #667781; }
.doc-dl { flex: 0 0 auto; }

/* location card */
.loc-card { display: block; text-decoration: none; color: inherit; min-width: 220px; }
.loc-map { background: linear-gradient(135deg, #cfe0d8, #a8c8bb); border-radius: 6px; height: 94px; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.loc-name { font-weight: 600; margin-top: 6px; }
.loc-view { font-size: 12px; color: #027eb5; }

/* location picker (Google Maps) */
.loc-picker { margin: 6px 0 14px; }
.loc-search-row { display: flex; gap: 8px; margin-bottom: 8px; }
.loc-search-row #loc-search { flex: 1; padding: 9px 12px; border: 1px solid var(--border, #d1d7db); border-radius: 8px; font-size: 14px; outline: none; }
.loc-search-row #loc-search:focus { border-color: var(--accent, #00a884); }
.loc-gps { flex: 0 0 auto; width: 42px; padding: 0; font-size: 18px; line-height: 1; }
.loc-mapbox { height: 220px; width: 100%; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #cfe0d8, #a8c8bb); }
.loc-hint { font-size: 12px; margin: 6px 2px 0; }

/* universal header bar (all pages): brand · page title · number switcher */
#gwtop { position: relative; flex: 0 0 54px; height: 54px; z-index: 85; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 16px 0 12px; }
#gwtop .brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
#gwtop .brand .lg { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); display: flex; align-items: center; justify-content: center; }
#gwtop .brand .bn { font-weight: 800; font-size: 16px; color: #111B21; letter-spacing: -.2px; }
#gwtop .pg { flex: 1; min-width: 0; text-align: right; font-size: 13.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
#gwacct { position: relative; flex: 0 0 auto; border-left: 1px solid var(--line); padding-left: 14px; }
/* impersonation banner (admin viewing a user) */
#gwimp { display: flex; align-items: center; gap: 9px; background: #FFF7E0; border: 1px solid #F0D9A0; border-radius: 10px; padding: 5px 6px 5px 12px; flex: 0 0 auto; }
#gwimp > i { font-size: 13px; color: #9A6700; display: flex; line-height: 1; }
#gwimp .who { font-size: 12.5px; color: #7A5B00; white-space: nowrap; }
#gwimp .who b { font-weight: 800; }
#gwimp button { display: flex; align-items: center; gap: 6px; background: #9A6700; color: #fff; border: 0; border-radius: 8px; padding: 6px 11px; font-weight: 700; font-size: 12px; cursor: pointer; font-family: inherit; transition: background .12s; }
#gwimp button:hover { background: #7A5200; }
#gwimp button i { font-size: 11px; display: flex; line-height: 1; }
@media (max-width: 760px) { #gwimp .who { display: none; } #gwimp { padding: 5px 6px; } }

#gwwallet { display: flex; align-items: center; gap: 8px; background: #F6F8FA; border: 1px solid var(--line); border-radius: 10px; padding: 5px 6px 5px 12px; text-decoration: none; flex: 0 0 auto; transition: background .12s; }
#gwwallet:hover { background: #F0F2F5; }
#gwwallet > i { font-size: 14px; color: var(--brand-700); display: flex; line-height: 1; }
#gwwallet .amt { font-weight: 800; font-size: 13px; color: #111B21; white-space: nowrap; }
#gwwallet .add { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .12s; }
#gwwallet .add:hover { background: var(--brand-700); }
#gwwallet .add i { font-size: 11px; line-height: 1; display: flex; }
@media (max-width: 640px) { #gwwallet .amt { display: none; } #gwwallet { padding: 5px 6px; } }
#gwsupport { display: flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 13px; font-weight: 700; font-size: 13px; color: var(--ink-2); text-decoration: none; flex: 0 0 auto; transition: background .12s; }
#gwsupport:hover { background: #F6F8FA; color: var(--ink); }
#gwsupport i { font-size: 14px; line-height: 1; display: flex; }
@media (max-width: 640px) { #gwsupport span { display: none; } #gwsupport { padding: 8px 9px; } }
#gwtut-btn { display: flex; align-items: center; gap: 7px; background: var(--brand-050); border: 1px solid var(--brand-200); border-radius: 10px; padding: 8px 13px; font: inherit; font-weight: 700; font-size: 13px; color: var(--brand-700); cursor: pointer; flex: 0 0 auto; transition: background .12s; }
#gwtut-btn:hover { background: var(--brand-100); }
#gwtut-btn i { font-size: 15px; line-height: 1; display: flex; }
@media (max-width: 640px) { #gwtut-btn span { display: none; } #gwtut-btn { padding: 8px 9px; } }
#gwnewchat { display: flex; align-items: center; gap: 8px; background: var(--brand); color: #fff; border-radius: 10px; padding: 9px 15px; font-weight: 700; font-size: 13px; text-decoration: none; border: 0; cursor: pointer; font-family: inherit; flex: 0 0 auto; transition: background .12s; }
#gwnewchat:hover { background: var(--brand-700); text-decoration: none; color: #fff; }
#gwnewchat i { font-size: 14px; line-height: 1; display: flex; }
@media (max-width: 640px) { #gwnewchat { padding: 9px; border-radius: 50%; } #gwnewchat span { display: none; } }
#gwacct-btn { display: flex; align-items: center; gap: 9px; background: #F6F8FA; border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px 4px 5px; cursor: pointer; font: inherit; max-width: 250px; transition: background .12s; }
#gwacct-btn:hover { background: #F0F2F5; }
#gwacct .av { width: 32px; height: 32px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11.5px; flex: 0 0 auto; letter-spacing: .3px; }
#gwacct .who { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
#gwacct .who .nm { font-weight: 700; font-size: 12.5px; color: #111B21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; line-height: 1.25; }
#gwacct .who .nu { font-size: 10.5px; color: #8696A0; white-space: nowrap; line-height: 1.2; }
#gwacct-btn > i { font-size: 16px; color: #8696A0; display: flex; }
#gwacct-drop { position: absolute; top: 100%; left: 14px; margin-top: 8px; width: 290px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.18); overflow: hidden; }
#gwacct-drop .srch { display: flex; align-items: center; gap: 8px; padding: 10px 13px; border-bottom: 1px solid var(--line-2); }
#gwacct-drop .srch i { font-size: 14px; color: #8696A0; display: flex; }
#gwacct-drop .srch input { flex: 1; border: none; outline: none; font: inherit; font-size: 13.5px; color: #111B21; }
#gwacct-drop .rows { max-height: 260px; overflow-y: auto; }
#gwacct-drop .row { display: flex; align-items: center; gap: 10px; padding: 9px 13px; text-decoration: none; border-bottom: 1px solid var(--line-3); }
#gwacct-drop .row:hover { background: #F6F8FA; }
#gwacct-drop .row i { font-size: 14px; flex: 0 0 auto; }
#gwacct-drop .none { padding: 14px; text-align: center; color: #8696A0; font-size: 13px; }
#gwacct-drop .connect { display: flex; align-items: center; gap: 10px; padding: 12px 14px; text-decoration: none; color: var(--brand-700); font-weight: 700; font-size: 13.5px; background: var(--brand-050); }
#gwacct-drop .connect i { font-size: 13px; display: flex; }
#gwacct-drop .connect:hover { background: var(--brand-100); }
@media (max-width: 640px) {
    #gwtop { padding: 0 10px; gap: 10px; }
    #gwtop .pg { display: none; }
    #gwacct-drop { width: calc(100vw - 20px); position: fixed; top: 56px; left: 10px; right: 10px; }
}

/* reactions — hover controls float OUTSIDE the bubble (never cover text/time) */
.react-box { position: absolute; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(0,0,0,.12); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .12s; z-index: 5; }
.react-box i { font-size: 12px; color: #54656F; line-height: 1; }
.dbubble:hover .react-box { opacity: 1; }
.dbubble.in .react-box { right: -60px; }
.dbubble.out .react-box { left: -60px; right: auto; }
.react-strip { position: absolute; top: -42px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.16); padding: 5px 9px; display: flex; gap: 7px; z-index: 30; }
.dbubble.in .react-strip { left: 0; }
.dbubble.out .react-strip { right: 0; }
.react-strip span { font-size: 19px; cursor: pointer; transition: transform .1s; }
.react-strip span:hover { transform: scale(1.25); }
@media (max-width: 640px) {
    .dbubble.in .react-box { right: -30px; }
    .dbubble.out .react-box { left: -30px; }
}

/* multi-select — clean checkbox floating OUTSIDE the bubble */
.sel-box { position: absolute; top: 4px; width: 22px; height: 22px; border: 2px solid #C7D0D5; border-radius: 7px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, border-color .12s; z-index: 5; display: flex; align-items: center; justify-content: center; }
.sel-box:hover { border-color: var(--brand); }
.dbubble.in .sel-box { right: -32px; left: auto; }
.dbubble.out .sel-box { left: -32px; right: auto; }
@media (max-width: 640px) { .dbubble.in .sel-box { right: -30px; } .dbubble.out .sel-box { left: -30px; } .dbubble.in .react-box { right: -58px; } .dbubble.out .react-box { left: -58px; } }
.dbubble:hover .sel-box, .selecting .sel-box { opacity: 1; }
.dbubble.selected { background: #C7E9D6 !important; }
.dbubble.selected .sel-box { background: var(--brand); border-color: var(--brand); opacity: 1; }
.dbubble.selected .sel-box::after { content: ''; width: 10px; height: 6px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) translateY(-1px); }
.selecting .dbubble { cursor: pointer; }
.selecting .dbubble img, .selecting .dbubble a, .selecting .dbubble video, .selecting .dbubble audio { pointer-events: none; }
.sel-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 20; height: 56px; background: var(--brand-700); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 14px; }
.sel-bar .ic { color: #fff; background: none; border: none; cursor: pointer; }
.sel-bar .ic:hover { background: rgba(255,255,255,.14); border-radius: 50%; }

/* clickable contact header */
.th-who { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; cursor: pointer; padding: 3px 6px; border-radius: 8px; }
.th-who:hover { background: rgba(0,0,0,.05); }

/* skeleton loaders */
@keyframes shimmer { 0% { background-position: -220px 0; } 100% { background-position: 220px 0; } }
.sk-av, .sk-line { background: #E4E9EC; background-image: linear-gradient(90deg, #E4E9EC 0, #eff3f5 40px, #E4E9EC 80px); background-size: 320px; animation: shimmer 1.15s infinite linear; }
.dconv.skel { pointer-events: none; }
.sk-av { width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto; }
.sk-line { height: 10px; border-radius: 5px; }
.dbubble.skel-b { background: #fff; box-shadow: 0 1px .5px rgba(0,0,0,.1); }
.dbubble.skel-b .sk-line { background-color: #edf1f3; }

/* button polish */
.dcomposer .ic, .dconv-head .ic { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; transition: background .12s; }
.dcomposer .ic:hover, .dconv-head .ic:hover, .inbox-head button:hover { background: rgba(0,0,0,.06); }
.dbubble.in { background: #fff; align-self: flex-start; border-radius: 9px 9px 9px 3px; }
.dbubble.out { background: #E7FFDB; align-self: flex-end; border-radius: 9px 9px 3px 9px; }
.dbubble.failed { background: #FFE0E0; }
.dbubble-text { white-space: pre-wrap; }
.dbubble-meta { display: block; text-align: right; font-size: 10.5px; color: #8696A0; margin-top: 2px; }
.dbubble-meta .cost { color: var(--brand-700); font-weight: 700; margin-right: 6px; }
.dbubble-meta .tick.read { color: #34B7F1; }
.dtpl-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; color: var(--brand-700); background: var(--brand-100); border-radius: 5px; padding: 2px 7px; margin-bottom: 5px; }
.dbubble .pv-footer { color: #667781; font-size: 12px; margin-top: 5px; }
.dbubble .pv-buttons { margin: 7px -9px -5px; }
.dbubble .pv-btn { text-align: center; padding: 6px; font-size: 13px; font-weight: 600; color: #027eb5; border-top: 1px solid rgba(0,0,0,.08); }

.dfoot { background: #F0F2F5; flex: 0 0 auto; }
.dquick { display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px 0; }
.dquick::-webkit-scrollbar { display: none; }
.dquick span { white-space: nowrap; background: #fff; border: 1px solid #D1D7DB; border-radius: 16px; padding: 6px 12px; font-size: 12.5px; color: var(--brand-700); font-weight: 600; cursor: pointer; }
.demoji { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; background: #fff; border-top: 1px solid #E9EDEF; }
.demoji span { font-size: 23px; cursor: pointer; line-height: 1; }
.dcomposer { display: flex; align-items: center; gap: 11px; padding: 10px 16px; position: relative; }
.attach-menu { position: absolute; bottom: 54px; left: 44px; background: #fff; border-radius: 12px; box-shadow: 0 10px 34px rgba(0,0,0,.2); padding: 8px; z-index: 50; min-width: 214px; }
.attach-menu button { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: none; cursor: pointer; padding: 8px 10px; border-radius: 9px; font: inherit; font-size: 14px; color: #111B21; text-align: left; }
.attach-menu button:hover { background: #F0F2F5; }
.am-ic { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 auto; }
.am-ic i { color: #fff; font-size: 17px; line-height: 1; display: flex; }
.am-ic i::before { line-height: 1; }
.dcomposer .ic { background: none; border: none; cursor: pointer; color: #54656F; display: flex; padding: 0; }
.dcomposer input, .dcomposer textarea { flex: 1; border: none; outline: none; background: #fff; border-radius: 9px; padding: 11px 16px; font-size: 15px; color: #111B21; font-family: inherit; resize: none; line-height: 1.4; max-height: 120px; }
.dcomposer input:disabled, .dcomposer textarea:disabled { background: #e9edef; }

/* mic ↔ send morph (WhatsApp-style) */
.dsend { position: relative; width: 42px; height: 42px; border: none; border-radius: 50%; cursor: pointer; background: transparent; color: #54656F; transition: background .2s ease, color .2s ease; flex: 0 0 auto; }
.dsend .mic, .dsend .plane { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: opacity .18s ease, transform .22s ease; }
.dsend .mic i { font-size: 19px; line-height: 1; display: flex; }
.dsend .plane { opacity: 0; transform: scale(.5) rotate(-30deg); color: #fff; }
.dsend.has-text { background: var(--brand); }
.dsend.has-text:hover { background: var(--brand-700); }
.dsend.has-text .mic { opacity: 0; transform: scale(.5); }
.dsend.has-text .plane { opacity: 1; transform: scale(1) rotate(0); }

/* chat header icon buttons + dropdown menu */
.hic { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: none; background: none; cursor: pointer; color: #54656F; transition: background .15s; flex: 0 0 auto; }
.hic:hover { background: rgba(0,0,0,.07); }
.hic i { font-size: 17px; line-height: 1; display: flex; }
.th-menu { position: absolute; top: 42px; right: 0; width: 218px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.18); padding: 6px; z-index: 60; animation: menuIn .18s ease; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.th-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: none; background: none; text-align: left; font: inherit; font-size: 14px; color: #111B21; border-radius: 8px; cursor: pointer; }
.th-menu button:hover { background: #F0F2F5; }
.th-menu button i { font-size: 15px; color: #54656F; width: 18px; display: flex; }
.th-menu .sep { height: 1px; background: var(--line-2); margin: 5px 8px; }

/* translate popover — toggle switch */
.th-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.th-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.th-switch-track { width: 38px; height: 22px; border-radius: 22px; background: #CBD5DA; transition: background .18s ease; display: inline-block; position: relative; }
.th-switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.28); transition: transform .18s ease; }
.th-switch input:checked + .th-switch-track { background: var(--brand); }
.th-switch input:checked + .th-switch-track .th-switch-thumb { transform: translateX(16px); }
.th-xlate-btn-on { color: var(--brand) !important; }

/* translated line under an inbound bubble */
.dbubble-xlate { margin-top: 3px; padding-top: 4px; border-top: 1px dashed rgba(0,0,0,.12); font-size: 14px; line-height: 1.34; color: #1F2C34; }
.dbubble-xlate .xl-tag { font-size: 12px; color: #667781; margin-right: 5px; vertical-align: baseline; }
.dbubble-xlate.loading { color: #8696A0; font-style: italic; }

/* in-chat search bar */
.th-searchbar { display: flex; align-items: center; gap: 9px; background: #fff; border-bottom: 1px solid var(--line); padding: 7px 14px; flex: 0 0 auto; animation: menuIn .18s ease; }
.th-searchbar > i { font-size: 14px; color: #8696A0; display: flex; }
.th-searchbar input { flex: 1; border: none; outline: none; font: inherit; font-size: 14px; color: #111B21; }
.th-searchbar .cnt { font-size: 12px; color: #8696A0; white-space: nowrap; }
.dbubble.srch-hit { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); }
.dbubble.srch-cur { outline: 2.5px solid var(--brand); }

/* reply preview bar */
.th-replybar { display: flex; align-items: center; gap: 10px; background: #F0F2F5; border-top: 1px solid var(--line); padding: 8px 16px; animation: menuIn .18s ease; }
.th-replybar .q { flex: 1; min-width: 0; border-left: 3.5px solid var(--brand); padding: 2px 10px; }
.th-replybar .t { font-size: 12px; font-weight: 700; color: var(--brand-700); }
.th-replybar .x { font-size: 13px; color: #54656F; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* translate-before-send suggestion bar */
.th-xlsuggest { background: #F0F2F5; border-top: 1px solid var(--line); padding: 9px 16px 10px; animation: menuIn .18s ease; }
.th-xlsuggest .xls-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.th-xlsuggest select { border: 1px solid #D9DEE1; border-radius: 8px; padding: 4px 8px; font-size: 12.5px; font-weight: 600; color: #111B21; background: #fff; }
.th-xlsuggest .xls-text { background: #fff; border: 1px solid #E2E6E9; border-left: 3.5px solid var(--brand); border-radius: 8px; padding: 8px 11px; font-size: 14px; line-height: 1.4; color: #111B21; min-height: 20px; white-space: pre-wrap; word-break: break-word; }
.th-xlsuggest .xls-text.loading { color: #8696A0; font-style: italic; }
.th-xlsuggest .xls-orig { color: #8696A0; font-weight: 400; }
.th-xlsuggest .xls-actions { display: flex; gap: 8px; margin-top: 8px; }
.th-xlsuggest .xls-btn { border-radius: 9px; padding: 7px 14px; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.th-xlsuggest .xls-btn.ghost { background: #fff; border: 1px solid var(--brand-200); color: var(--brand-700); }
.th-xlsuggest .xls-btn.solid { background: var(--brand); border: 0; color: #fff; margin-left: auto; }
.th-xlsuggest .xls-btn:disabled { opacity: .5; cursor: default; }

/* message hover caret + action menu */
.msg-caret { position: absolute; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(0,0,0,.12); display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .15s; z-index: 5; }
.msg-caret i { font-size: 14px; color: #54656F; line-height: 1; display: flex; }
.dbubble:hover .msg-caret { opacity: 1; }
.dbubble.in .msg-caret { right: -60px; }
.dbubble.out .msg-caret { left: -60px; right: auto; }
.selecting .msg-caret { display: none; }
.msg-menu { position: absolute; top: 26px; width: 172px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.18); padding: 5px; z-index: 40; animation: menuIn .16s ease; }
.dbubble.in .msg-menu { left: 8px; }
.dbubble.out .msg-menu { right: 8px; }
.msg-menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; border: none; background: none; text-align: left; font: inherit; font-size: 13.5px; color: #111B21; border-radius: 8px; cursor: pointer; }
.msg-menu button:hover { background: #F0F2F5; }
.msg-menu button i { font-size: 14px; color: #54656F; width: 17px; display: flex; }
.msg-menu button.danger { color: #DC2626; }
.msg-menu button.danger i { color: #DC2626; }
.msg-menu .sep { height: 1px; background: var(--line-2); margin: 4px 8px; }

/* drag & drop target */
.dconv-msgs.dropping { outline: 3px dashed var(--brand); outline-offset: -10px; }
.dclosed { background: #F0F2F5; padding: 14px 16px; display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.dclosed .lock { flex: 1; display: flex; align-items: center; gap: 9px; background: #fff; border: 1px dashed #D1D7DB; border-radius: 9px; padding: 12px 14px; color: #8696A0; font-size: 13.5px; }
.dclosed .send-tpl { display: flex; align-items: center; gap: 8px; background: var(--brand-700); color: #fff; border-radius: 9px; padding: 12px 18px; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; border: none; }

/* right profile */
.desk-profile { width: 320px; border-left: 1px solid #E9EDEF; background: #fff; flex: 0 0 auto; overflow-y: auto; }
.prof-hero { padding: 26px 18px; text-align: center; border-bottom: 8px solid #F0F2F5; }
.prof-hero .avatar { margin: 0 auto; width: 92px; height: 92px; font-size: 34px; }
.prof-hero .nm { font-weight: 700; font-size: 18px; color: #111B21; margin-top: 12px; }
.prof-hero .ph { font-size: 13px; color: #667781; margin-top: 2px; }
.prof-sec { padding: 14px 18px; border-bottom: 1px solid #F0F2F5; }
.prof-sec .h { font-size: 11px; font-weight: 800; color: #8696A0; letter-spacing: .5px; margin-bottom: 9px; }
.prof-labels { display: flex; flex-wrap: wrap; gap: 7px; }
.prof-add { font-size: 12px; color: var(--brand-700); font-weight: 700; border: 1px dashed #B7E0D4; border-radius: 14px; padding: 3px 10px; cursor: pointer; background: none; }
.win-pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 9px; }
.win-pill.open { background: var(--brand-100); color: var(--brand-ink); }
.win-pill.closed { background: #FFF3D6; color: #7A5B00; }
.prof-action { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: #111B21; cursor: pointer; padding: 7px 0; background: none; border: none; width: 100%; text-align: left; }

/* mobile bottom nav (matches the mobile design) */
.desk-mobnav { display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 58px; background: #fff;
    border-top: 1px solid var(--line); z-index: 60; padding-bottom: env(safe-area-inset-bottom); }
.desk-mobnav a, .desk-mobnav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--ink-4); text-decoration: none; font: inherit; font-size: 10.5px; font-weight: 700; background: none; border: 0; cursor: pointer; }
.desk-mobnav a.active { color: var(--green); }
.desk-mobnav svg { width: 22px; height: 22px; }
.desk-mobnav i { font-size: 21px; line-height: 1; }

/* shared 3-dot kebab (top-right) + menu: desktop = small dropdown (WhatsApp-Web), mobile → /menu page */
#gwkebab { display: flex; position: fixed; top: 12px; right: 14px; width: 40px; height: 40px; align-items: center; justify-content: center; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 50%; z-index: 100000; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
#gwkebab i { font-size: 20px; color: #111B21; }
#gwmenu { display: none; }
#gwmenu.open { display: block; position: fixed; inset: 0; z-index: 100001; }
#gwmenu .sheet { position: absolute; top: 58px; right: 14px; width: 248px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.18); padding: 6px; }
#gwmenu .grab { display: none; }
#gwmenu a, #gwmenu button { display: flex; align-items: center; gap: 13px; padding: 11px 13px; color: #111B21; text-decoration: none; font: inherit; font-size: 14.5px; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; border-radius: 8px; }
#gwmenu a:hover, #gwmenu button:hover { background: #F0F2F5; }
#gwmenu a.active { color: var(--green); font-weight: 700; }
#gwmenu i { font-size: 19px; color: #54656F; width: 24px; display: flex; }

@media (max-width: 1180px) { .desk-profile { display: none; } }

/* ===== TABLET (769–1024): icon-only rail, roomy content ===== */
@media (max-width: 1024px) and (min-width: 769px) {
    .desk-rail { width: 66px; }
    .desk .rail-nav span, .desk .rail-acct .who, .desk .rail-toggle span, .desk .rail-brandtext { display: none; }
    .desk .rail-nav { justify-content: center; padding: 11px; }
    .desk-inbox { width: 320px; }
    .desk-page { padding: 20px 22px; }
}

/* ===== PHONE + small tablet (≤768): bottom nav takes over ===== */
@media (max-width: 768px) {
    .desk-rail { display: none; }
    .desk { margin-bottom: 54px; }
    .desk-mobnav { display: flex; height: 54px; }
    .desk-mobnav i { font-size: 19px; }
    .desk-mobnav a span, .desk-mobnav button span { font-size: 10px; }
    .desk-inbox { width: 320px; }
}
@media (max-width: 640px) {
    .desk-inbox { width: 100%; }
    .desk-conv { display: none; }
    .desk.show-conv .desk-inbox { display: none; }
    .desk.show-conv .desk-conv { display: flex; }
    .desk.show-conv ~ .desk-mobnav { display: none; }
    .desk.show-conv { margin-bottom: 0; }         /* full-height conversation */
    .desk-conv .dconv-head .ic#conv-back { display: flex !important; }
    .desk-page { padding: 14px 12px; }
    .dpage-head h1 { font-size: 19px; }

    /* In a conversation, drop the global top bar (WhatsApp-style) so the CONTACT header is
       the top bar and there's more room; it returns when you go back to the chat list. */
    body:has(.desk.show-conv) #gwtop { display: none; }
    /* Keep the contact profile header pinned while messages scroll / keyboard is open. */
    .desk.show-conv .dconv-head { position: sticky; top: 0; z-index: 6; }
}

/* touch devices: hover-only controls must be reachable */
@media (hover: none) {
    .dbubble .msg-caret { opacity: .9; }
    .dconv .row-caret { opacity: .9; }
}

/* ===== PHONE app-like scale (≤640): compact header, smaller type/buttons, capped modals ===== */
@media (max-width: 640px) {
    /* header: slim bar, essentials only */
    #gwtop { flex: 0 0 48px; height: 48px; gap: 6px; padding: 0 8px; }
    #gwtop .brand .lg { width: 28px; height: 28px; border-radius: 8px; }
    #gwtop .brand .lg svg { width: 16px; height: 16px; }
    #gwacct-btn { padding: 2px 7px 2px 3px; }
    #gwacct .av { width: 26px; height: 26px; font-size: 10px; }
    #gwacct .who .nm { font-size: 11.5px; max-width: 80px; }
    #gwacct .who .nu { font-size: 10px; max-width: 80px; }
    #gwnewchat { padding: 7px; }
    #gwnewchat i { font-size: 15px; }
    #gwwallet { margin-left: auto; padding: 4px 4px 4px 9px; }   /* pinned right */
    #gwwallet .amt { display: inline; font-size: 12px; }         /* balance stays visible */
    #gwsupport { display: none; }                 /* reachable from More */
    #gwacct-drop { top: 50px; }

    /* global type & control scale-down (inline-styled views) */
    .desk-page [style*="font-size:22px"] { font-size: 18px !important; }
    .desk-page [style*="font-size:20px"] { font-size: 17px !important; }
    .desk-page [style*="font-size:19px"] { font-size: 16px !important; }
    .desk-page [style*="font-size:18px"] { font-size: 15.5px !important; }
    .desk-page [style*="font-size:15px"] { font-size: 13.5px !important; }
    .desk-page div[style*="padding:11px 18px"] , .desk-page a[style*="padding:11px 18px"] { padding: 9px 13px !important; font-size: 13px !important; }
    .desk-page button[style*="padding:14px"] { padding: 12px !important; font-size: 14px !important; }
    .desk-page div[style*="padding:18px"] { padding: 13px !important; }
    .desk-page div[style*="padding:14px"][style*="border-radius:14px"] { padding: 12px !important; }
    .btn { padding: 9px 12px; font-size: 13px; border-radius: 10px; }
    .field input, .field select, .field textarea { font-size: 16px; }  /* stops iOS zoom */

    /* modals & sheets: never cover the whole screen */
    .modal { padding: 0; }
    .modal-card { max-height: 74vh; padding: 16px; border-radius: 18px 18px 0 0; }
    .modal-card h3 { font-size: 16px; margin-top: 0; }
    .bc-sheet { max-height: 82vh !important; padding: 16px !important; }
    #gwnc > div { max-width: 94vw !important; padding: 16px !important; }
    #tpv > div { max-width: 94vw !important; padding: 16px !important; }
    #fwd-list { max-height: 200px; }

    /* chat specifics */
    .dbubble.in .msg-caret { right: -30px; }
    .dbubble.out .msg-caret { left: -30px; }
    .composer textarea { font-size: 16px; }       /* stops iOS zoom-on-focus */
    .dconv .row-caret { width: 24px; height: 24px; }
    .inbox-head { padding: 10px 13px 8px; }
    .inbox-head .t { font-size: 17px; }
    .dconv { padding: 8px 11px 0; gap: 10px; }
    .dconv-name { font-size: 15px; }
    .dconv-head { padding: 7px 10px; gap: 8px; }
}
@media (max-width: 400px) {
    #gwtop .brand { display: none; }              /* switcher IS the brand row */
}

/* ===== hamburger + slide-in app menu ===== */
#gwburger { display: none; background: none; border: 0; cursor: pointer; color: #54656F; padding: 8px; border-radius: 50%; flex: 0 0 auto; }
#gwburger i { font-size: 19px; line-height: 1; display: flex; }
#gwdrawer { position: fixed; inset: 0; z-index: 160; background: rgba(11, 20, 26, .5); animation: bcfade .12s ease; }
#gwdrawer aside { position: absolute; top: 0; left: 0; bottom: 0; width: min(290px, 84vw); background: #fff; display: flex; flex-direction: column; box-shadow: 12px 0 40px rgba(0,0,0,.2); animation: dwslide .16s ease; }
@keyframes dwslide { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
#gwdrawer .dw-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
#gwdrawer .dw-head .lg { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: flex; align-items: center; justify-content: center; }
#gwdrawer .dw-head .nm { flex: 1; font-weight: 800; font-size: 16px; color: #111B21; }
#gwdrawer .dw-head > i { font-size: 22px; color: #54656F; cursor: pointer; display: flex; }
#gwdrawer .dw-nav { flex: 1; overflow-y: auto; padding: 8px; }
#gwdrawer .dw-nav a { display: flex; align-items: center; gap: 13px; padding: 12px 13px; border-radius: 10px; color: #111B21; text-decoration: none; font-size: 14.5px; font-weight: 600; }
#gwdrawer .dw-nav a i { font-size: 18px; color: #54656F; width: 22px; display: flex; }
#gwdrawer .dw-nav a.active { background: var(--brand-050); color: var(--brand-ink); }
#gwdrawer .dw-nav a.active i { color: var(--brand-700); }
#gwdrawer .dw-foot { border-top: 1px solid var(--line-2); padding: 8px; }
#gwdrawer .dw-foot a, #gwdrawer .dw-foot button { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px 13px; border-radius: 10px; color: #111B21; text-decoration: none; font: inherit; font-size: 14.5px; font-weight: 600; background: none; border: 0; cursor: pointer; text-align: left; }
#gwdrawer .dw-foot i { font-size: 17px; color: #54656F; width: 22px; display: flex; }

/* mobile: burger on, header new-chat off (it lives beside "Chats" now) */
#inbox-newchat { display: none; background: var(--brand); border: 0; border-radius: 50%; width: 34px; height: 34px; align-items: center; justify-content: center; cursor: pointer; color: #fff; }
#inbox-newchat i { font-size: 15px; line-height: 1; display: flex; }
@media (max-width: 768px) {
    #gwburger { display: flex; }
    #gwnewchat { display: none; }
    #inbox-newchat { display: flex; }
}

/* mobile: impersonation becomes its own full-width bar under the header */
@media (max-width: 640px) {
    #gwimp { position: fixed; top: 48px; left: 0; right: 0; z-index: 84; border-radius: 0; border-left: 0; border-right: 0; justify-content: center; padding: 6px 10px; }
    #gwimp .who { display: flex; font-size: 12px; }
    #gwtop:has(#gwimp) ~ .desk { margin-top: 35px; }
}

/* ---------- Impersonation bar ---------- */
.impersonate-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 70; background: #7c3aed; color: #fff;
    display: flex; align-items: center; justify-content: center; gap: 12px; padding: 7px 12px; font-size: 12.5px; margin: 0; }
.impersonate-bar button { background: rgba(255,255,255,.9); color: #5b21b6; border: none; border-radius: 7px; padding: 4px 12px; font-weight: 800; cursor: pointer; font-size: 12px; }

/* ---------- Admin (polished theme) ---------- */
body.admin { display: block; background: #f4f6f9; color: #1f2c34; }
.admin-shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }

/* sidebar */
.admin-side { background: linear-gradient(185deg,#12212b,#0a1218); color: #cdd6db; display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side::-webkit-scrollbar { width: 5px; }
.admin-side::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 6px; }
.admin-brand { font-weight: 800; font-size: 16.5px; color: #fff; display: flex; align-items: center; gap: 11px; padding: 6px 10px 14px; }
.admin-brand .brand-dot { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 3px 12px rgba(37,211,102,.45); }
.admin-brand .brand-dot i { font-size: 15px; line-height: 1; }
.admin-navsec { font-size: 10px; font-weight: 800; letter-spacing: .7px; color: #57696f; padding: 15px 12px 6px; text-transform: uppercase; }
.admin-nav { display: flex; align-items: center; gap: 12px; color: #9fb0b8; text-decoration: none; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; margin-bottom: 2px; transition: background .12s, color .12s; }
.admin-nav i { font-size: 16px; width: 20px; display: flex; justify-content: center; flex: 0 0 auto; }
.admin-nav:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.admin-nav.active { background: color-mix(in srgb, var(--brand) 90%, black); color: #fff; box-shadow: 0 5px 16px color-mix(in srgb, var(--brand) 32%, transparent); }
.admin-nav .nav-badge { margin-left: auto; background: #DC2626; color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 10px; padding: 1px 7px; }
.admin-side-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.admin-usercard { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 9px 11px; }
.admin-usercard .av { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: 0 0 auto; }
.admin-usercard .nm { color: #fff; font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-usercard .rl { color: #7c8b93; font-size: 11px; text-transform: capitalize; }
.admin-side-foot .btn { background: rgba(255,255,255,.08); border: none; color: #fff; }
.admin-side-foot .btn:hover { background: rgba(255,255,255,.16); }
.admin-side-foot .muted { color: #7c8b93; }

/* collapsible grouped sidebar */
.admin-navgrp { display: block; }
.admin-navsec { width: 100%; display: flex; align-items: center; gap: 6px; background: none; border: 0; text-align: left; font-family: inherit; cursor: pointer; }
.admin-navsec .chev { margin-left: auto; font-size: 15px; transition: transform .15s; opacity: .8; }
.admin-navsec:hover { color: #8aa0a8; }
.admin-navgrp.collapsed .admin-navsub { display: none; }
.admin-navgrp.collapsed .admin-navsec .chev { transform: rotate(-90deg); }

/* topbar */
.admin-topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 12px 30px; margin: -26px -30px 22px; }
.admin-topbar .tb-title { font-size: 15px; font-weight: 800; color: #111b21; letter-spacing: -.01em; }
.admin-topbar .tb-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.admin-topbar .tb-chip { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #54656F; font-weight: 600; }
.admin-topbar .tb-chip .av { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.admin-topbar .tb-link { color: #54656F; font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.admin-topbar .tb-link:hover { color: var(--brand-700); }

/* main */
.admin-main { padding: 26px 30px; max-width: 1200px; }
.admin-main h1 { margin: 0 0 4px; font-size: 23px; font-weight: 800; letter-spacing: -.015em; }
.admin-main .sub { color: var(--ink-3); margin: 0 0 22px; font-size: 14px; }

/* kpi */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 26px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 1px 2px rgba(17,27,33,.05); }
.kpi .n { font-size: 26px; font-weight: 800; }
.kpi .l { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }

/* tables */
.atable { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(17,27,33,.05); border: 1px solid var(--line); }
.atable th, .atable td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; vertical-align: middle; }
.atable thead th { background: #f7f9fa; color: var(--ink-3); font-weight: 700; font-size: 11px; letter-spacing: .4px; text-transform: uppercase; }
.atable tbody tr { transition: background .1s; }
.atable tbody tr:hover { background: #f9fbfc; }
.atable tbody tr:last-child td { border-bottom: none; }
.atable tfoot td { background: #f7f9fa; font-weight: 700; }
.atable input, .atable select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; }
.atable .w-narrow { width: 90px; }

/* cards + toolbar */
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(17,27,33,.04); }
.admin-card > strong:first-child { font-size: 14.5px; color: #111b21; }
.admin-toolbar { display: flex; gap: 9px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(17,27,33,.04); }
.admin-toolbar select, .admin-toolbar input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 13px; background: #fff; }
.admin-toolbar select:focus, .admin-toolbar input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); outline: none; }

/* ===== modern polish (match the header dropdown language: soft cards, rounded, subtle shadows) ===== */
.btn { border-radius: 10px; font-weight: 700; border: 1px solid var(--line); background: #fff; color: var(--ink-2); transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: #F6F8FA; border-color: #d7dde1; }
.btn-primary { background: var(--brand); border: none; color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-primary:hover { background: var(--brand-700); }
.btn-danger:hover { filter: brightness(.96); }
.field input, .field select, .field textarea, .input { border-radius: 10px; border: 1px solid #E2E6E9; transition: border-color .12s, box-shadow .12s; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); outline: none; }
.dpanel, .admin-card { border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(17,27,33,.04); }
.modal-card { border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.18); }
.acct-dropdown, .attach-menu { border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.18); }
.pill { border-radius: 20px; font-weight: 800; }
.atable { border-radius: 14px; box-shadow: 0 1px 2px rgba(17,27,33,.04); }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }
.thin::-webkit-scrollbar { width: 6px; height: 6px; }
.thin::-webkit-scrollbar-thumb { background: #c9d1d6; border-radius: 6px; }

/* ===== contact drawer ===== */
#ct-overlay { position: fixed; inset: 0; z-index: 110; background: rgba(11,20,26,.35); }
#ct-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; max-width: 92vw; z-index: 111; background: #fff; border-left: 1px solid var(--line); box-shadow: -12px 0 34px rgba(0,0,0,.14); display: flex; flex-direction: column; animation: ctd-in .18s ease; }
@keyframes ctd-in { from { transform: translateX(30px); opacity: .4; } to { transform: translateX(0); opacity: 1; } }
.ctd-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); flex: 0 0 auto; }
.ctd-x { width: 32px; height: 32px; border-radius: 9px; background: none; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #54656F; }
.ctd-x:hover { background: #F0F2F5; }
.ctd-x i { font-size: 20px; line-height: 1; display: flex; }
.ctd-body { flex: 1; overflow-y: auto; }
.ctd-sec { padding: 14px 18px; border-top: 6px solid var(--line-3); }
.ctd-h { font-size: 11px; font-weight: 800; color: #8696A0; letter-spacing: .4px; margin-bottom: 10px; }
.ctd-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 13.5px; color: #54656F; border-bottom: 1px solid var(--line-3); }
.ctd-row b { color: #111B21; font-weight: 700; }
.ctd-act { display: flex; align-items: center; gap: 7px; background: var(--brand-050); border: 1px solid var(--brand-200); color: var(--brand-700); border-radius: 9px; padding: 8px 14px; font-weight: 700; font-size: 12.5px; cursor: pointer; font-family: inherit; }
.ctd-act:hover { background: var(--brand-100); }
.ctd-act i { font-size: 13px; display: flex; line-height: 1; }
.ctd-label { display: inline-flex; align-items: center; gap: 7px; border-radius: 8px; padding: 6px 11px; font-size: 12.5px; font-weight: 700; cursor: pointer; border: 1px solid var(--line); background: #fff; color: #54656F; transition: all .12s; }
.ctd-label .dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.ctd-label.on { border-color: var(--brand); background: var(--brand-050); color: var(--brand-ink); }
.ctd-label.on::after { content: '✓'; font-size: 11px; color: var(--brand-700); font-weight: 800; }
@media (max-width: 640px) { #ct-drawer { width: 100vw; max-width: 100vw; } }

/* reaction badge attached to the original bubble (WhatsApp-style) */
.rx-badge { position: absolute; bottom: -12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1px 7px; font-size: 13px; line-height: 1.4; box-shadow: 0 1px 3px rgba(0,0,0,.14); z-index: 4; }
.dbubble.in .rx-badge { left: 8px; }
.dbubble.out .rx-badge { right: 8px; }
.dbubble.has-rx { margin-bottom: 16px; }
.dbubble-foot { font-size: 11.5px; color: #8696A0; margin-top: 5px; padding-top: 4px; border-top: 1px solid rgba(0,0,0,.06); font-style: italic; }

/* ---- media lightbox (WhatsApp-style full-screen preview) ---- */
#lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(17, 27, 33, .96); display: flex; flex-direction: column; animation: lbfade .14s ease; }
#lightbox[hidden] { display: none; }
@keyframes lbfade { from { opacity: 0; } to { opacity: 1; } }
#lightbox .lb-head { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 12px 18px; }
#lightbox .lb-name { flex: 1; min-width: 0; color: #E9EDEF; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lightbox .lb-act { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #AEBAC1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .12s; }
#lightbox .lb-act:hover { background: rgba(255, 255, 255, .1); color: #fff; }
#lightbox .lb-act i { font-size: 19px; line-height: 1; display: flex; }
#lightbox .lb-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 18px 18px; }
#lightbox .lb-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 4px 30px rgba(0, 0, 0, .5); }
#lightbox .lb-body iframe { width: min(920px, 100%); height: 100%; border: 0; border-radius: 6px; background: #fff; }

/* ================= responsive pass (phones) ================= */

/* universal header: keep everything on one 54px row, no overflow */
@media (max-width: 640px) {
    #gwtop { gap: 7px; }
    #gwtop .brand .bn { display: none; }              /* logo only */
    #gwacct { padding-left: 7px; border-left: none; }
    #gwacct-btn { padding: 3px 8px 3px 4px; gap: 7px; max-width: 168px; }
    #gwacct .av { width: 28px; height: 28px; font-size: 10.5px; }
    #gwacct .who .nm { max-width: 88px; font-size: 12px; }
    #gwacct .who .nu { max-width: 88px; overflow: hidden; text-overflow: ellipsis; }
    #gwimp span.who { display: none; }
}
@media (max-width: 400px) {
    #gwacct .who { display: none; }                   /* avatar + chevron only */
    #gwacct-btn > i { display: none; }
}

/* generic content: 2-col grids stack, tables scroll, cards breathe */
@media (max-width: 640px) {
    .row-2 { grid-template-columns: 1fr; }
    .dcards { grid-template-columns: 1fr 1fr !important; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .atable { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .alert[style*="position:fixed"] { left: 14px; max-width: none; }
}

/* admin panel: sidebar becomes a sticky, horizontally-scrollable top bar */
@media (max-width: 880px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { position: sticky; top: 0; z-index: 60; height: auto; flex-direction: row; align-items: center; gap: 2px; padding: 8px 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .admin-side::-webkit-scrollbar { display: none; }
    .admin-brand { margin-bottom: 0; margin-right: 8px; font-size: 15px; white-space: nowrap; padding: 0; }
    .admin-brand .brand-dot { width: 26px; height: 26px; }
    .admin-side nav { display: flex; align-items: center; gap: 2px; }
    .admin-nav { white-space: nowrap; margin-bottom: 0; padding: 8px 11px; font-size: 13px; }
    .admin-nav i { display: none; }
    .admin-navsec { display: none; }                  /* section divider labels */
    .admin-navgrp, .admin-navsub { display: contents; }  /* flatten groups into the row */
    .admin-side-foot { margin-top: 0; margin-left: 8px; flex-direction: row; align-items: center; padding-top: 0; border-top: none; gap: 6px; }
    .admin-usercard { display: none; }
    .admin-side-foot .muted { display: none; }
    .admin-main { padding: 16px 14px; max-width: none; }
    .admin-main h1 { font-size: 20px; }
    .admin-topbar { margin: -16px -14px 16px; padding: 10px 14px; }
}
@media (max-width: 640px) {
    .admin-main h1 { font-size: 18px; }
    .admin-main .sub { font-size: 13px; margin-bottom: 14px; }
    .kpi { padding: 12px; }
    .kpi .n { font-size: 20px; }
    .admin-card { padding: 13px; }
    .admin-main [style*="font-size:22px"] { font-size: 18px !important; }
    .admin-main [style*="font-size:20px"] { font-size: 17px !important; }
    .atable th, .atable td { padding: 8px 9px; font-size: 12.5px; }
}

/* full-page builders (broadcast create): tighter page gutters on phones */
@media (max-width: 640px) {
    .desk-page.thin > div[style*="padding:20px 26px"] { padding: 14px 12px !important; }
    .desk-page.thin > div[style*="padding:16px 26px"] { padding: 12px 14px !important; }
    .desk-page.thin > div[style*="padding:14px 26px"] { padding: 12px 14px !important; }
}

/* ---- custom dropdowns (styled replacement for native <select>) ---- */
.gwsel { position: relative; display: block; min-width: 0; }
.gwsel select { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; margin: 0; }
.gwsel-btn { display: flex; align-items: center; gap: 8px; width: 100%; background: #fff; border: 1px solid #E2E6E9; border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 13.5px; color: #111B21; cursor: pointer; text-align: left; transition: border-color .12s, box-shadow .12s; }
.gwsel-btn:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); outline: none; }
.gwsel-btn:disabled { background: #F0F2F5; color: #8696A0; cursor: default; }
.gwsel-btn .gwsel-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gwsel-btn i { font-size: 15px; color: #8696A0; display: flex; flex: 0 0 auto; }
.gwsel-menu { position: fixed; z-index: 420; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 44px rgba(0,0,0,.18); padding: 5px; max-height: 260px; overflow-y: auto; max-width: min(340px, 92vw); }
.gwsel-opt { padding: 9px 12px; border-radius: 8px; font-size: 13.5px; color: #111B21; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gwsel-opt:hover { background: #F0F2F5; }
.gwsel-opt.on { background: var(--brand-050); color: var(--brand-ink); font-weight: 700; }
.gwsel-opt.dis { color: #B0B7BC; cursor: default; }

/* ---- in-app toast + confirm (replaces browser alert/confirm) ---- */
#gw-toast { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%) translateY(12px); z-index: 400; background: #111B21; color: #fff; font-size: 13.5px; font-weight: 600; padding: 11px 18px; border-radius: 24px; box-shadow: 0 8px 30px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; max-width: min(420px, 86vw); text-align: center; }
#gw-toast.show { opacity: 1; transform: translateX(-50%); }
#gw-toast.err { background: #B42318; }
#gw-toast.ok { background: #067647; }
/* admin-controlled: hide chosen header buttons on mobile (they stay in the More menu) */
@media (max-width: 700px) { .gw-mob-off { display: none !important; } }

/* full emoji picker */
.emoji-pop { display: flex; flex-direction: column; max-height: 300px; }
.emoji-pop .emoji-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid #E9EDEF; padding: 4px 6px; flex: 0 0 auto; }
.emoji-pop .emoji-tabs::-webkit-scrollbar { height: 0; }
.emoji-pop .emoji-tabs button { flex: 0 0 auto; border: 0; background: none; font-size: 18px; line-height: 1; padding: 6px 8px; border-radius: 8px; cursor: pointer; opacity: .6; }
.emoji-pop .emoji-tabs button.on { background: #F0F2F5; opacity: 1; }
.emoji-pop .emoji-search { margin: 7px 8px 4px; padding: 8px 11px; border: 1px solid #E2E6E9; border-radius: 9px; font-size: 14px; outline: none; flex: 0 0 auto; }
.emoji-pop .emoji-grid { flex: 1 1 auto; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 2px; padding: 4px 8px 8px; }
.emoji-pop .emoji-grid span { display: flex; align-items: center; justify-content: center; height: 34px; font-size: 22px; border-radius: 8px; cursor: pointer; }
.emoji-pop .emoji-grid span:hover { background: #F0F2F5; }

/* voice-note recording bar (composer) */
.rec-bar { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 4px; }
.rec-bar .rec-dot { width: 11px; height: 11px; border-radius: 50%; background: #EA4335; animation: recpulse 1.1s ease-in-out infinite; flex: 0 0 auto; }
.rec-bar .rec-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; color: #111B21; flex: 0 0 auto; }
.rec-bar .rec-hint { flex: 1; font-size: 13px; color: #8696A0; }
.rec-bar button { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.rec-bar .rec-cancel { background: #F0F2F5; color: #54656F; }
.rec-bar .rec-send { background: var(--brand); color: #fff; }
@keyframes recpulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.gw-confirm { position: fixed; inset: 0; z-index: 380; background: rgba(11,20,26,.5); display: flex; align-items: center; justify-content: center; padding: 22px; animation: bcfade .12s ease; }
.gw-confirm .gc-card { width: 100%; max-width: 330px; background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 18px 60px rgba(0,0,0,.24); }
.gw-confirm .gc-text { font-size: 15.5px; font-weight: 700; color: #111B21; line-height: 1.35; }
.gw-confirm .gc-sub { font-size: 12.5px; color: #667781; margin-top: 7px; line-height: 1.45; }
.gw-confirm .gc-actions { display: flex; gap: 9px; margin-top: 16px; }
.gw-confirm .gc-actions button { flex: 1; border: 0; border-radius: 10px; padding: 11px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.gw-confirm .gc-cancel { background: #F0F2F5; color: #54656F; }
.gw-confirm .gc-ok { background: var(--brand); color: #fff; }
.gw-confirm .gc-ok.danger { background: #DC2626; }

/* phones: dialogs float with margins — never glued to the screen edges */
@media (max-width: 640px) {
    .modal { align-items: center; padding: 16px; }
    .modal-card { border-radius: 16px; max-height: 74vh; }
    .bc-overlay { padding: 16px !important; align-items: center !important; }
    .bc-sheet { border-radius: 16px !important; }
    #gw-toast { bottom: 70px; }
}

/* forward sheet rows */
.fwd-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #F4F6F8; cursor: pointer; }
.fwd-row:last-child { border-bottom: none; }
.fwd-row:hover { background: #F6F8FA; }
.fwd-row .fwd-cb { width: 17px; height: 17px; accent-color: var(--brand); flex: 0 0 auto; cursor: pointer; }

/* chat-list row hover menu (archive / delete, WhatsApp-style) */
.dconv { position: relative; }
.dconv .row-caret { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(0,0,0,.12); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s; z-index: 6; }
.dconv:hover .row-caret { opacity: 1; }
.dconv .row-caret i { font-size: 14px; color: #54656F; line-height: 1; display: flex; }
.row-menu { position: fixed; z-index: 140; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,.18); padding: 5px; min-width: 178px; }
.row-menu button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; font: inherit; font-size: 13.5px; color: #111B21; padding: 9px 11px; border-radius: 8px; cursor: pointer; text-align: left; }
.row-menu button:hover { background: #F0F2F5; }
.row-menu button.danger { color: #DC2626; }
.row-menu button i { font-size: 15px; color: #54656F; width: 18px; display: flex; }
.row-menu button.danger i { color: #DC2626; }

/* ---- support ticket rich editor + rendered bodies ---- */
.tk-toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid #E9EDEF; background: #F8FAFB; }
.tk-toolbar button, .tk-toolbar label { width: 30px; height: 28px; border: 0; background: none; border-radius: 7px; cursor: pointer; color: #54656F; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.tk-toolbar button:hover, .tk-toolbar label:hover { background: #EAEEF0; color: #111B21; }
.tk-toolbar i { font-size: 15px; }
[contenteditable][data-ph]:empty::before { content: attr(data-ph); color: #8696A0; }
.tk-body p { margin: 0 0 6px; }
.tk-body p:last-child { margin-bottom: 0; }
.tk-body ul, .tk-body ol { margin: 4px 0; padding-left: 22px; }
.tk-body a { color: var(--brand-700); }
.tk-body img { border-radius: 9px; }
