/* ==========================================================================
   Hermes Portal · 设计令牌与共享组件（ui-redesign）
   视觉语言：暖纸底 + 墨绿主色（成长感）+ 琥珀点缀；柔和阴影、统一圆角。
   断点沿用 Tailwind：<768 手机 / 768–1023 平板 / ≥1024 桌面。
   ========================================================================== */

:root {
    --paper: #f7f4ee;          /* 暖纸底 */
    --paper-deep: #efeae1;     /* 深一档底 */
    --ink: #292524;            /* 主文字（stone-800） */
    --ink-soft: #57534e;       /* 次文字 */
    --ink-faint: #a8a29e;      /* 弱文字 */
    --line: #e7e2d8;           /* 暖灰边线 */
    --line-soft: #efece4;
    --brand: #3f7d5d;          /* 墨绿（成长主色） */
    --brand-deep: #2f6148;
    --brand-soft: #e9f3ed;
    --amber: #d97706;
    --amber-soft: #fdf3e3;
    --card: #fffdf9;           /* 卡片底（微暖白） */
    --radius: 14px;
    --shadow-card: 0 1px 2px rgb(41 37 36 / .05), 0 4px 14px -6px rgb(41 37 36 / .08);
    --shadow-pop: 0 6px 24px -8px rgb(41 37 36 / .18);
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--paper);
    color: var(--ink);
    font-feature-settings: "tnum";
}

::selection { background: rgb(63 125 93 / .18); }

/* ---------- 旧锚点类（保留语义，升级视觉） ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 10px;
    font-size: 13.5px; color: var(--ink-soft);
    transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--paper-deep); color: var(--ink); }
.nav-item.active {
    background: var(--brand-soft); color: var(--brand-deep); font-weight: 600;
    box-shadow: inset 2.5px 0 0 var(--brand);
}

/* ---------- 通用卡片 ---------- */
.hp-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.hp-card-hover { transition: box-shadow .18s, transform .18s, border-color .18s; }
.hp-card-hover:hover { box-shadow: var(--shadow-pop); transform: translateY(-1px); }

/* ---------- 徽章 / 药丸 ---------- */
.hp-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11px; line-height: 1.5;
    border: 1px solid var(--line);
    background: #fff; color: var(--ink-soft);
    white-space: nowrap;
}
.hp-pill-brand { background: var(--brand-soft); border-color: #cfe4d8; color: var(--brand-deep); font-weight: 600; }
.hp-pill-amber { background: var(--amber-soft); border-color: #f3dfbb; color: #92610a; }
.hp-pill-plain { background: var(--paper-deep); color: var(--ink-faint); }

/* ---------- 按钮（触控 ≥44px 由调用处保证高度） ---------- */
.hp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border-radius: 10px; font-size: 13px; font-weight: 500;
    min-height: 34px; padding: 6px 14px;
    transition: background .12s, box-shadow .12s, transform .06s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.hp-btn:active { transform: scale(.97); }
.hp-btn-brand { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgb(47 97 72 / .3); }
.hp-btn-brand:hover { background: var(--brand-deep); }
.hp-btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink-soft); }
.hp-btn-ghost:hover { border-color: #cfc8ba; color: var(--ink); }

/* ---------- 输入框 ---------- */
.hp-input {
    background: #fff; border: 1px solid var(--line); border-radius: 10px;
    font-size: 14px; color: var(--ink);
    transition: border-color .12s, box-shadow .12s;
}
.hp-input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgb(63 125 93 / .15);
}
.hp-input::placeholder { color: var(--ink-faint); }

/* ==========================================================================
   小美 · 今日总览
   ========================================================================== */

/* 节卡片：五节视觉区分（顶部 3px 色条 + 图标底纹） */
.xm-sec {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.xm-sec::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: linear-gradient(90deg, var(--sec-c, #94a3b8), transparent 65%);
}
.xm-sec[data-sec-tone="dawn"]    { --sec-c: #f59e0b; }
.xm-sec[data-sec-tone="todo"]    { --sec-c: #3f7d5d; }
.xm-sec[data-sec-tone="time"]    { --sec-c: #0ea5e9; }
.xm-sec[data-sec-tone="intel"]   { --sec-c: #8b5cf6; }
.xm-sec[data-sec-tone="night"]   { --sec-c: #64748b; }

.xm-sec-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 9px; font-size: 15px;
    background: color-mix(in srgb, var(--sec-c, #94a3b8) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--sec-c, #94a3b8) 22%, #fff);
}

/* 待办行 */
.xm-todo-item { border-radius: 10px; }
.xm-todo-item:hover { background: rgb(41 37 36 / .025); }

/* 完成钮：桌面为胶囊；手机为行右 44px 圆钮（见媒体查询） */
.xm-done-btn {
    transition: background .12s, transform .06s;
    -webkit-tap-highlight-color: transparent;
}
.xm-done-btn:active { transform: scale(.94); }

/* 情绪点按 */
.xm-mood-btn {
    transition: all .12s;
    -webkit-tap-highlight-color: transparent;
}
.xm-mood-btn:active { transform: scale(.95); }

/* 朗读钮 */
.xm-read-btn { -webkit-tap-highlight-color: transparent; }
.xm-read-btn:active { transform: scale(.95); }

/* Toast：桌面右上；手机底部居中（媒体查询） */
#xm-toast { box-shadow: var(--shadow-pop); letter-spacing: .01em; }

/* ---------- 手机端（<768px）：节锚点胶囊 + 底部动作栏 ---------- */
@media (max-width: 767px) {
    /* Toast 底部居中 */
    #xm-toast {
        top: auto !important; right: 50% !important;
        transform: translateX(50%);
        bottom: calc(76px + env(safe-area-inset-bottom)) !important;
        max-width: calc(100vw - 48px);
        text-align: center;
        border-radius: 999px;
    }

    /* 节锚点胶囊条（sticky） */
    .xm-anchor-bar {
        position: sticky;
        top: calc(56px + env(safe-area-inset-top));
        z-index: 15;
        display: flex; gap: 6px;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 8px 2px;
        background: linear-gradient(var(--paper) 82%, transparent);
    }
    .xm-anchor-bar::-webkit-scrollbar { display: none; }
    .xm-anchor-chip {
        flex: none; display: inline-flex; align-items: center; gap: 4px;
        min-height: 34px; padding: 5px 12px;
        border-radius: 999px; font-size: 12px;
        background: #fff; border: 1px solid var(--line); color: var(--ink-soft);
        text-decoration: none;
        box-shadow: 0 1px 2px rgb(41 37 36 / .05);
    }
    .xm-anchor-chip:active { background: var(--brand-soft); }

    /* 完成 = 行右 44px 圆钮（!important 压过 Tailwind 工具类） */
    .xm-done-btn {
        width: 44px !important; height: 44px !important; border-radius: 999px !important;
        padding: 0 !important; font-size: 18px !important;
        display: inline-flex; align-items: center; justify-content: center;
        background: var(--brand) !important; color: #fff !important;
        border: none !important;
        box-shadow: 0 2px 6px rgb(47 97 72 / .35);
    }
    .xm-done-btn .xm-done-label { display: none; }

    /* 触控规范：主要可点目标 ≥44 CSS px */
    .xm-mood-btn, .xm-defer-btn, .xm-defer-ok, .xm-defer-cancel, .xm-read-btn {
        min-height: 44px !important;
        display: inline-flex; align-items: center; justify-content: center;
        padding-left: 14px !important; padding-right: 14px !important;
    }
    #xm-capture-input { min-height: 44px; }
    .xm-anchor-chip { min-height: 38px; }

    /* 底部动作栏 */
    .xm-actionbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
        display: flex; gap: 8px;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        background: rgb(255 253 249 / .92);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--line);
    }
    .xm-actionbar .ab-btn {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 2px; min-height: 52px; border-radius: 12px;
        font-size: 11px; color: var(--ink-soft);
        background: #fff; border: 1px solid var(--line);
        -webkit-tap-highlight-color: transparent;
    }
    .xm-actionbar .ab-btn .ab-ico { font-size: 17px; line-height: 1; }
    .xm-actionbar .ab-btn.ab-primary {
        background: var(--brand); border-color: var(--brand); color: #fff;
        box-shadow: 0 2px 8px rgb(47 97 72 / .3);
    }
    .xm-actionbar .ab-btn:active { transform: scale(.96); }

    /* 页面底部给动作栏留位 */
    .xm-page-pad { padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important; }

    /* 手机端隐藏次要信息（文件路径徽标、页脚工程说明） */
    .xm-hide-mobile { display: none !important; }
}
@media (min-width: 768px) {
    .xm-anchor-bar, .xm-actionbar { display: none !important; }
}

/* ==========================================================================
   小美 · 画像目标（目标树）
   ========================================================================== */

/* 树干：从顶部说明垂下的主线 */
.gt-tree { position: relative; }
.gt-tree::before {
    content: ""; position: absolute;
    left: 15px; top: 0; bottom: 0; width: 2px;
    background: linear-gradient(var(--brand) 0%, #cbd5c0 60%, transparent 100%);
    border-radius: 2px; opacity: .5;
}
@media (min-width: 768px) { .gt-tree::before { left: 19px; } }

/* 组节点（分枝点） */
.gt-branch { position: relative; padding-left: 40px; }
@media (min-width: 768px) { .gt-branch { padding-left: 52px; } }
.gt-branch::before {
    content: ""; position: absolute;
    left: 15px; top: 27px; width: 25px; height: 2px;
    background: #cbd5c0; border-radius: 2px;
}
@media (min-width: 768px) { .gt-branch::before { left: 19px; width: 33px; } }
.gt-branch::after {
    content: ""; position: absolute;
    left: 10px; top: 22px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--card);
    border: 2.5px solid var(--brand);
    box-shadow: 0 0 0 3px var(--paper);
}
@media (min-width: 768px) { .gt-branch::after { left: 14px; } }
.gt-branch-interest::after { border-color: #b58a3c; }
.gt-branch-interest::before { background: #e3d5b3; }

/* 目标卡：左侧粗细 = 权重体量，层级感 */
.gt-goal {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    transition: box-shadow .15s, transform .15s;
}
.gt-goal:hover { box-shadow: var(--shadow-pop); transform: translateY(-1px); }
.gt-goal::before {
    content: ""; position: absolute;
    left: 0; top: 10px; bottom: 10px;
    width: var(--gt-w, 4px); border-radius: 4px;
    background: linear-gradient(var(--gt-c, var(--brand)), color-mix(in srgb, var(--gt-c, var(--brand)) 55%, #fff));
}

/* 权重条 */
.gt-weight-track { height: 7px; border-radius: 999px; background: var(--paper-deep); overflow: hidden; }
.gt-weight-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--gt-c, var(--brand)) 65%, #fff), var(--gt-c, var(--brand)));
}

/* ==========================================================================
   小美 · 事件流（时间线）
   ========================================================================== */
.ev-day { scroll-margin-top: 80px; }
.ev-item { position: relative; }
.ev-item .ev-dot {
    position: absolute; left: -19px; top: 4px;
    width: 11px; height: 11px; border-radius: 50%;
    border: 2.5px solid #fff;
    box-shadow: 0 0 0 1.5px rgb(41 37 36 / .08), 0 1px 3px rgb(41 37 36 / .15);
}
.ev-rail { position: relative; }
.ev-rail::before {
    content: ""; position: absolute;
    left: 1px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px;
    background: linear-gradient(#e2ddd2, #efece4);
}

/* ==========================================================================
   仪表板
   ========================================================================== */
.db-navcard { display: block; }
.db-navcard .db-ico {
    transition: transform .18s;
}
.db-navcard:hover .db-ico { transform: scale(1.08) rotate(-3deg); }

/* ==========================================================================
   安全区 / Web Clip
   ========================================================================== */
.hp-safe-top { padding-top: env(safe-area-inset-top); }
.hp-safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* 顶栏在手机端贴齐刘海 */
@media (max-width: 767px) {
    .hp-topbar {
        height: calc(56px + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
    }
    body { overscroll-behavior-y: none; }
}

/* 细滚动条 */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #d8d2c6; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #c4bdae; }
*::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   小美 · 智能体（阶段六：大厅 / 配置表单 / 聊天窗口）
   手机优先：暖纸/安全区/触控 ≥44px；桌面 A 层不破版
   ========================================================================== */

/* ---------- 通用：页面内小标题行 ---------- */
.xa-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ---------- 智能体大厅 ---------- */
.xa-hall { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.xa-add-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    min-height: 44px; padding: 8px 16px;
    background: var(--brand); color: #fff; border-radius: 12px;
    font-size: 13.5px; font-weight: 600; box-shadow: 0 2px 8px rgb(47 97 72 / .25);
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.xa-add-btn:active { transform: scale(.96); }
.xa-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px;
    margin-top: 14px;
}
.xa-card {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 16px 6px 12px; border-radius: 16px;
    background: var(--card); border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: transform .1s, box-shadow .15s, border-color .15s;
    min-height: 128px; justify-content: flex-start;
}
.xa-card:active { transform: scale(.97); }
.xa-card:hover { box-shadow: var(--shadow-pop); border-color: #d8d0c2; }
.xa-card.xa-builtin { border-color: #d8e6dc; background: linear-gradient(180deg, #fbfefb, var(--card)); }
.xa-orb {
    width: 68px; height: 68px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; line-height: 1;
    background: linear-gradient(145deg, #fff, var(--paper-deep));
    border: 1px solid var(--line);
    box-shadow: inset 0 0 0 3px #fff, 0 2px 6px rgb(41 37 36 / .1);
}
.xa-builtin .xa-orb {
    background: linear-gradient(145deg, #fff8ec, #fdeed2);
    border-color: #ecd9ae;
    box-shadow: inset 0 0 0 3px #fff, 0 2px 8px rgb(217 119 6 / .18);
}
.xa-name {
    font-size: 13px; font-weight: 600; color: var(--ink);
    max-width: 100%; text-align: center;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; word-break: break-all; line-height: 1.35;
}
.xa-type { font-size: 10px; color: var(--ink-faint); margin-top: -4px; }
.xa-menu-btn {
    position: absolute; top: 6px; right: 6px;
    width: 36px; height: 36px; min-height: 36px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--ink-faint); border-radius: 10px;
    background: transparent; -webkit-tap-highlight-color: transparent;
}
.xa-menu-btn:active { background: var(--paper-deep); }
.xa-empty { padding: 28px 12px; text-align: center; color: var(--ink-faint); font-size: 13px; }

/* 底部弹层（删除/编辑菜单 与 通用确认） */
.xa-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.xa-sheet .xa-sheet-mask { position: absolute; inset: 0; background: rgb(41 37 36 / .35); }
.xa-sheet .xa-sheet-panel {
    position: relative; width: min(420px, calc(100vw - 20px));
    margin-bottom: calc(10px + env(safe-area-inset-bottom));
    background: var(--card); border: 1px solid var(--line); border-radius: 18px;
    box-shadow: var(--shadow-pop); padding: 8px; overflow: hidden;
}
.xa-sheet .xa-sheet-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    min-height: 48px; padding: 8px 14px; border-radius: 12px;
    font-size: 14.5px; text-align: left; color: var(--ink);
    -webkit-tap-highlight-color: transparent;
}
.xa-sheet .xa-sheet-item:active { background: var(--paper-deep); }
.xa-sheet .xa-sheet-item.danger { color: #b91c1c; }

/* ---------- 配置表单 ---------- */
.xa-form { max-width: 560px; }
.xa-field { margin-bottom: 18px; }
.xa-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.xa-avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.xa-avatar-cell {
    aspect-ratio: 1; min-height: 0; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; background: #fff; border: 1px solid var(--line);
    -webkit-tap-highlight-color: transparent;
}
.xa-avatar-cell:active { transform: scale(.92); }
.xa-avatar-cell.sel { background: var(--brand-soft); border-color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.xa-hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; line-height: 1.5; }
.xa-form-actions { display: flex; gap: 10px; margin-top: 6px; }
.xa-form-actions .hp-btn { min-height: 46px; flex: 1; }
.xa-form-actions .hp-btn-ghost { flex: 0 0 auto; min-width: 96px; }

/* ---------- 聊天窗口 ---------- */
.xc-chat { display: flex; flex-direction: column; height: calc(100dvh - 56px - env(safe-area-inset-top)); }
@media (max-width: 767px) {
    .xc-chat { height: calc(100dvh - 92px - env(safe-area-inset-top)); }
}
.xc-head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-bottom: 1px solid var(--line-soft);
    background: rgb(255 253 249 / .9); backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.xc-back {
    width: 44px; height: 44px; min-height: 44px; flex: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: var(--ink-soft); border-radius: 12px;
    background: var(--paper-deep); -webkit-tap-highlight-color: transparent;
}
.xc-back:active { transform: scale(.95); }
.xc-head-orb {
    width: 40px; height: 40px; border-radius: 999px; flex: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; background: linear-gradient(145deg, #fff, var(--paper-deep));
    border: 1px solid var(--line);
}
.xc-head-t { flex: 1; min-width: 0; }
.xc-head-name { font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.xc-head-sub { font-size: 10.5px; color: var(--ink-faint); }
.xc-head-btn {
    min-height: 44px; padding: 6px 12px; border-radius: 12px;
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12.5px; color: var(--ink-soft); background: #fff;
    border: 1px solid var(--line); -webkit-tap-highlight-color: transparent;
}
.xc-head-btn:active { background: var(--paper-deep); }
.xc-head-btn.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-deep); }

.xc-msgs {
    flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 14px 12px calc(96px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column; gap: 12px;
}
.xc-msg { display: flex; gap: 8px; max-width: 92%; }
.xc-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.xc-msg .xc-orb-mini {
    width: 30px; height: 30px; border-radius: 999px; flex: none; margin-top: 2px;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
    background: var(--paper-deep); border: 1px solid var(--line);
}
.xc-bubble {
    padding: 9px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.62;
    word-break: break-word; overflow-wrap: anywhere; white-space: pre-wrap;
}
.xc-msg.agent .xc-bubble { background: var(--card); border: 1px solid var(--line); border-top-left-radius: 4px; box-shadow: var(--shadow-card); }
.xc-msg.user .xc-bubble { background: var(--brand); color: #fff; border-top-right-radius: 4px; }
.xc-msg.user .xc-bubble a { color: #dff3e8; }
.xc-bubble p { margin: 0 0 6px; }
.xc-bubble p:last-child { margin-bottom: 0; }
.xc-bubble ul, .xc-bubble ol { margin: 4px 0 6px; padding-left: 20px; }
.xc-bubble li { margin: 2px 0; }
.xc-bubble h1, .xc-bubble h2, .xc-bubble h3, .xc-bubble h4 { font-size: 15px; font-weight: 700; margin: 8px 0 4px; }
.xc-bubble code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: rgb(41 37 36 / .06); padding: 1px 5px; border-radius: 6px; }
.xc-bubble pre { background: rgb(41 37 36 / .06); padding: 8px 10px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; margin: 6px 0; }
.xc-bubble pre code { background: none; padding: 0; }
.xc-bubble blockquote { border-left: 3px solid var(--line); color: var(--ink-soft); margin: 6px 0; padding-left: 10px; }
.xc-bubble a { color: var(--brand-deep); text-decoration: underline; word-break: break-all; }
.xc-caret { display: inline-block; width: 7px; height: 15px; background: var(--brand); margin-left: 2px; vertical-align: -2px; animation: xc-blink 1s steps(2) infinite; border-radius: 2px; }
@keyframes xc-blink { 50% { opacity: 0; } }
.xc-status { font-size: 10.5px; color: var(--ink-faint); padding: 0 4px; display: flex; align-items: center; gap: 5px; }
.xc-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: xc-pulse 1.2s infinite; }
@keyframes xc-pulse { 50% { opacity: .25; } }
.xc-err {
    align-self: center; max-width: 92%;
    font-size: 12px; color: #b91c1c; background: #fef2f2;
    border: 1px solid #fecaca; border-radius: 10px; padding: 7px 12px; text-align: center;
}
.xc-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 11px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; border-top-left-radius: 4px; }
.xc-typing span { width: 6px; height: 6px; border-radius: 50%; background: #c9c2b4; animation: xc-bounce 1.2s infinite; }
.xc-typing span:nth-child(2) { animation-delay: .15s; }
.xc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes xc-bounce { 30% { transform: translateY(-4px); } }

.xc-inputbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; align-items: flex-end; gap: 8px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: rgb(255 253 249 / .94); backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
}
.xc-input { flex: 1; min-height: 46px; max-height: 120px; resize: none; padding: 11px 14px; line-height: 1.45; }
.xc-send {
    width: 46px; height: 46px; min-height: 46px; flex: none; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; background: var(--brand); color: #fff;
    box-shadow: 0 2px 8px rgb(47 97 72 / .3);
    -webkit-tap-highlight-color: transparent;
}
.xc-send:active { transform: scale(.94); }
.xc-send:disabled { opacity: .4; }
.xc-audio-flag {
    position: absolute; right: 70px; bottom: calc(64px + env(safe-area-inset-bottom));
    font-size: 11px; color: var(--brand-deep); background: var(--brand-soft);
    border: 1px solid #cfe4d8; padding: 4px 10px; border-radius: 999px;
    display: flex; align-items: center; gap: 5px;
}
@media (min-width: 768px) {
    .xa-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
    .xa-avatar-grid { grid-template-columns: repeat(10, 1fr); }
    .xc-msg { max-width: 76%; }
    .xc-chat { height: calc(100vh - 104px); }
}
