:root {
  --brand: #8F6FB6;
  --brand-dark: #7A5AA0;
  --brand-light: #C7B3E0;
  --bg: #F4EFF9;
  --bg2: #EFE7F6;
  --sidebar: #EDE3F5;
  --sidebar-sel: #DCCBE8;
  --border: #D9CAE7;
  --text: #4A3B5C;
  --text-sub: #8A7A9E;
  --user-bubble: #A98CD6;
  --user-bubble-text: #FFFFFF;
  --agent-bubble: #FFFFFF;
  --agent-bubble-text: #3D2F4F;
  --danger: #C96A6A;
  --splash-top: #C4B1E6;
  --splash-bottom: #ECE2F6;
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 让 HTML 的 hidden 属性真正生效（覆盖 .modal 等 display 设置） */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--text);
  overflow: hidden;
  background: var(--bg);
}

/* 壁纸层 */
#wallpaper {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(160deg, var(--splash-top), var(--splash-bottom));
  background-size: cover; background-position: center;
  transition: background-image .4s ease;
}

#app { position: relative; z-index: 1; height: 100%; }

/* 启动页（直接显示品牌封面图，与原图同风格） */
.splash {
  position: fixed; inset: 0; z-index: 50;
  background-image: url('cover.png');
  background-size: cover; background-position: center;
  background-color: var(--splash-bottom);
  transition: opacity .6s ease;
}
.splash.hide { opacity: 0; pointer-events: none; }

/* 布局 */
.layout { display: flex; height: 100%; }
.sidebar {
  width: 300px; min-width: 300px; display: flex; flex-direction: column;
  background: rgba(237,227,245,.7); border-right: 1px solid var(--border);
  transition: transform .3s ease;
}
.brand {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 8px;
}
.brand-name { font-family: Georgia, serif; font-weight: 700; font-size: 22px; color: var(--brand-dark); }
.icon-btn {
  background: transparent; border: none; font-size: 20px; color: var(--brand-dark);
  cursor: pointer; padding: 6px 10px; border-radius: 10px;
}
.icon-btn:hover { background: var(--sidebar-sel); }
.primary-btn {
  background: var(--brand); color: #fff; border: none; border-radius: 12px;
  padding: 12px 14px; font-size: 15px; font-weight: 700; cursor: pointer;
  margin: 4px 14px 10px; box-shadow: 0 2px 8px rgba(143,111,182,.3);
}
.primary-btn:hover { background: var(--brand-dark); }
.agent-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.agent-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 14px;
  cursor: pointer; margin-bottom: 2px;
}
.agent-item:hover { background: rgba(255,255,255,.4); }
.agent-item.active { background: var(--sidebar-sel); }
.agent-item .texts { min-width: 0; }
.agent-item .name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-item .last { font-size: 12px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-list { color: var(--text-sub); text-align: center; padding: 40px 12px; font-size: 14px; line-height: 1.7; }

/* 头像 */
.avatar, .avatar-sm {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; overflow: hidden; flex-shrink: 0;
  background: #9678B4;
}
.avatar { width: 44px; height: 44px; font-size: 18px; }
.avatar-sm { width: 40px; height: 40px; font-size: 16px; }
.avatar img, .avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

/* 聊天区 */
.chatpane { flex: 1; display: flex; flex-direction: column; background: rgba(244,239,249,.5); }
.chat-header {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: rgba(248,243,251,.55); border-bottom: 1px solid var(--border);
}
.chat-title { flex: 1; min-width: 0; }
.chat-name { font-size: 16px; font-weight: 700; }
.chat-sub { font-size: 12px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-actions { display: flex; gap: 6px; }
.ghost-btn {
  background: transparent; color: var(--brand-dark); border: none; cursor: pointer;
  border-radius: 8px; padding: 7px 10px; font-size: 13px;
}
.ghost-btn:hover { background: var(--bg2); }
.back { display: none; font-size: 26px; }

.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 8px; max-width: 82%; }
.msg .avatar { width: 38px; height: 38px; font-size: 15px; }
.bubble {
  padding: 10px 14px; border-radius: var(--radius); font-size: 15px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; max-width: 100%;
}
/* 聊天里的图片（电脑上发的，手机上也能看） */
.msg-img {
  display: block; max-width: 100%; max-height: 320px; width: auto; height: auto;
  border-radius: 10px; margin: 0 0 8px 0; background: rgba(0,0,0,.05);
}
.msg-img:last-child { margin-bottom: 0; }

/* 发图片按钮 */
.img-btn {
  flex: 0 0 auto; border: none; border-radius: 12px; cursor: pointer;
  background: var(--brand-light, #B9A6D6); color: #fff; font-size: 18px;
  padding: 0 12px; margin-right: 6px; align-self: stretch;
}
.img-btn:hover { filter: brightness(1.06); }
.msg.agent { align-self: flex-start; }
.msg.agent .bubble { background: var(--agent-bubble); color: var(--agent-bubble-text); border-top-left-radius: 6px; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .bubble { background: var(--user-bubble); color: var(--user-bubble-text); border-top-right-radius: 6px; }
.msg .time { font-size: 11px; color: var(--text-sub); align-self: flex-end; margin-top: 2px; }
.time-gap { text-align: center; font-size: 11px; color: var(--text-sub); margin: 2px 0; }
.msg.user .recall {
  opacity: 0; border: none; background: none; color: var(--text-sub); font-size: 12px;
  cursor: pointer; align-self: flex-end; margin: 0 2px 4px 4px; padding: 2px 4px; transition: opacity .15s;
}
.msg.user:hover .recall, .msg.user.show-recall .recall { opacity: 1; }
.msg.recalled { align-self: center; max-width: 100%; }
.recall-notice { text-align: center; color: var(--text-sub); font-size: 12px; padding: 4px 0; }
.typing .bubble::after { content: "…"; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 输入区 */
.composer { position: relative; padding: 10px 14px; background: rgba(239,231,246,.65); border-top: 1px solid var(--border); display: flex; align-items: flex-end; gap: 8px; }
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 12px; font-size: 15px; font-family: inherit; color: var(--text);
  background: #fff; max-height: 120px;
}
.composer textarea:focus { outline: none; border-color: var(--brand-light); }
.send-btn, .stop-btn {
  border: none; border-radius: 12px; padding: 12px 18px; font-size: 15px; font-weight: 700;
  cursor: pointer; color: #fff;
}
.send-btn { background: var(--brand); }
.send-btn:hover { background: var(--brand-dark); }
.stop-btn { background: var(--danger); }
.composer-hint { position: absolute; bottom: 2px; left: 20px; font-size: 10px; color: var(--text-sub); pointer-events: none; }

/* 弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(60,44,80,.45); padding: 16px; overflow-y: auto;
}
.modal-card {
  background: #fff; border-radius: 20px; width: 460px; max-width: 100%; max-height: 92vh;
  display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(60,44,80,.3);
}
.modal-head { padding: 18px 20px 8px; font-size: 18px; font-weight: 700; color: var(--brand-dark); }
.modal-body { padding: 8px 20px; overflow-y: auto; }
.modal-foot { padding: 16px 20px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; border-top: 1px solid var(--bg2); }
.section-title { font-weight: 700; color: var(--brand-dark); margin: 16px 0 4px; }
.field-label { display: block; font-size: 13px; color: var(--text); margin: 10px 0 4px; font-weight: 600; }
.field-label.small { font-size: 12px; color: var(--text-sub); font-weight: 400; }
.text-input {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; color: var(--text); background: #fff;
}
.text-input:focus { outline: none; border-color: var(--brand-light); }
.range { width: 100%; accent-color: var(--brand); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 12px 0; color: var(--text); accent-color: var(--brand); }
.avatar-row { display: flex; align-items: center; gap: 14px; margin: 4px 0; }
#avatarPreview { border-radius: 50%; border: 1px solid var(--border); background: #fff; }
.avatar-btns { display: flex; flex-direction: column; gap: 6px; }
.wallpaper-row { display: flex; gap: 10px; margin: 6px 0; }
.mid-btn {
  background: var(--brand-light); color: #fff; border: none; border-radius: 10px;
  padding: 8px 14px; font-size: 13px; cursor: pointer; font-weight: 600;
}
.mid-btn.ghost { background: var(--bg2); color: var(--text); }
.mid-btn:hover { filter: brightness(1.05); }
.ghost { background: var(--bg2); color: var(--text) !important; }
.danger-btn { background: transparent; color: var(--danger); border: none; cursor: pointer; font-size: 14px; margin-right: auto; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.swatch.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--brand); }
.hint { font-size: 12px; color: var(--text-sub); margin: 4px 0; line-height: 1.5; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: rgba(60,44,80,.92); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 14px; max-width: 86vw; text-align: center; transition: opacity .3s;
}

/* 手机端 */
@media (max-width: 720px) {
  .sidebar {
    position: absolute; top: 0; bottom: 0; left: 0; z-index: 20;
    transform: translateX(-100%); box-shadow: 2px 0 14px rgba(60,44,80,.2);
    width: 280px; min-width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  .back { display: block; }
  .chat-header { padding-left: 10px; }
  .splash-logo { font-size: 46px; }
  .splash-logo .big { font-size: 70px; }
  .messages { padding: 12px; }
  .modal-card { max-height: 90vh; }
  .two-col { grid-template-columns: 1fr; }
}

/* 批量删除 */
.side-tools { display: flex; gap: 8px; padding: 0 14px 8px; }
.side-tools .mid-btn { flex: 1; padding: 7px 8px; font-size: 13px; }
.agent-item .selbox { width: 18px; height: 18px; accent-color: var(--brand); align-self: center; }
.agent-item.active .selbox { background: var(--brand); }

/* 消息操作按钮（重说/继续） */
.msg-actions { display: flex; gap: 6px; align-self: flex-start; margin-top: 4px; }
.act-btn {
  border: none; background: rgba(255,255,255,.7); color: var(--brand-dark);
  font-size: 12px; padding: 3px 10px; border-radius: 20px; cursor: pointer;
}
.act-btn:hover { background: var(--brand-light); color: #fff; }

/* 朋友圈 */
.moments { flex: 1; display: flex; flex-direction: column; background: rgba(244,239,249,.5); }
.moments-header {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: rgba(248,243,251,.55); border-bottom: 1px solid var(--border);
}
.moments-feed { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.post {
  background: rgba(255,255,255,.75); border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(60,44,80,.08);
}
.post-head { display: flex; align-items: center; gap: 10px; }
.post-meta { flex: 1; min-width: 0; }
.post-name { font-weight: 700; font-size: 14px; }
.post-time { font-size: 11px; color: var(--text-sub); }
.post-comment { flex-shrink: 0; }
.post-content { margin: 10px 0; font-size: 15px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.post-comments { border-left: 3px solid var(--brand-light); padding-left: 12px; margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.comment { font-size: 13px; color: var(--text); line-height: 1.5; }
.comment b { color: var(--brand-dark); }

/* ===== 手机端底部 tab 栏 ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: flex; background: #fff; border-top: 1px solid #E6E0EE;
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px)) 0;
}
.tab-item {
  flex: 1; border: 0; background: none; color: #8A8095;
  font-size: 11px; line-height: 1.35; padding: 6px 0 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tab-item .tab-ico { font-size: 19px; }
.tab-item.active { color: #8F6FB6; font-weight: 600; }
body.tabbed .layout { padding-bottom: 62px; }
body.tabbed .messages { padding-bottom: 8px; }

/* ===== 全屏覆盖页（我 / 反馈）===== */
.page-overlay {
  position: fixed; left: 0; right: 0; top: 0; bottom: 62px; z-index: 70;
  background: #F4EFF9; overflow-y: auto; padding: 14px 14px 24px;
  -webkit-overflow-scrolling: touch;
}
.po-title { font-size: 19px; font-weight: 700; color: #6B4E8F; margin: 4px 0 12px; }
.page-overlay .card {
  background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(90,60,120,.08);
}
.me-row { display: flex; align-items: center; gap: 12px; }
.me-avatar {
  width: 54px; height: 54px; border-radius: 50%; background: #9678B4; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  overflow: hidden;
}
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-name { font-size: 17px; font-weight: 600; color: #2B2233; }
.me-sub { font-size: 12px; color: #8A8095; margin-top: 2px; }
.row-btn {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 13px 4px; font-size: 15px; color: #2B2233; text-decoration: none;
  border-bottom: 1px solid #F0ECF5;
}
.row-btn:last-child { border-bottom: 0; }
.row-btn.primary { background: #8F6FB6; color: #fff; border-radius: 12px; text-align: center; margin-top: 8px; border-bottom: 0; }
.row-btn.small { display: inline-block; width: auto; padding: 6px 12px; background: #EFE8F7; border-radius: 10px; font-size: 13px; border-bottom: 0; }
.tip-line { font-size: 12.5px; color: #7A7186; line-height: 1.7; margin: 6px 2px 10px; }
.mail-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #F7F3FC; border-radius: 12px; padding: 11px 12px; margin: 6px 0;
  font-size: 15px; color: #2B2233; word-break: break-all;
}

/* ===== 主题色 / 打赏 / 上传（新增块）===== */
.card-h { font-size: 15px; font-weight: 700; color: #6B4E8F; margin-bottom: 6px; }
.theme-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; font-size: 14px; color: #4A3B5C; }
.theme-row input[type=color] {
  width: 46px; height: 34px; border: 1px solid #D9CAE7; border-radius: 9px;
  background: none; padding: 2px;
}
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #4A3B5C; margin: 6px 0; }
.theme-preview {
  margin-top: 8px; padding: 10px 12px; border-radius: 12px; color: #fff; font-size: 13.5px;
  background: var(--brand);
}
.reward-box { text-align: center; margin-top: 8px; }
.reward-box img { max-width: 220px; width: 70%; border-radius: 12px; border: 1px solid #E6E0EE; }
#styleUpload { padding: 8px 10px; font-size: 13px; }

/* ===== DeepSeek 式排版：AI 的话整条铺开、无气泡 ===== */
.msg.agent { max-width: 100%; width: 100%; }
.msg.agent .bubble.md {
  background: transparent; color: var(--text);
  padding: 2px 0 6px; border-radius: 0; box-shadow: none;
  line-height: 1.78; font-size: 15px; word-break: break-word;
}
.msg.agent .bubble.md p { margin: 0 0 8px; }
.bubble.md h1, .bubble.md h2, .bubble.md h3, .bubble.md h4 {
  margin: 14px 0 6px; font-weight: 700; line-height: 1.4;
}
.bubble.md h1 { font-size: 19px; }
.bubble.md h2 { font-size: 17px; }
.bubble.md h3 { font-size: 16px; }
.bubble.md ul { margin: 6px 0 10px; padding-left: 22px; }
.bubble.md li { margin: 3px 0; }
.bubble.md blockquote {
  margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--brand-light);
  background: var(--bg2); border-radius: 0 8px 8px 0; color: var(--text-sub);
}
.bubble.md .md-code {
  font-family: Consolas, Menlo, monospace; font-size: 13.5px;
  background: var(--bg2); padding: 1.5px 5px; border-radius: 5px;
}
.bubble.md .md-pre {
  background: #2B2233; color: #F2ECFA; border-radius: 10px;
  padding: 11px 13px; overflow-x: auto; margin: 9px 0;
}
.bubble.md .md-pre code {
  font-family: Consolas, Menlo, monospace; font-size: 13.5px;
  background: none; color: inherit; white-space: pre;
}
.bubble.md a { color: var(--brand); text-decoration: underline; }
.bubble.md strong { font-weight: 700; }
/* 我自己的话：右侧气泡照旧 */
.msg.user .bubble.mine { white-space: pre-wrap; }

/* ===== 渲染器美化：代码块工具条 / 表格 / 分隔线 ===== */
.bubble.md .md-block { margin: 10px 0; border-radius: 10px; overflow: hidden; background: #2B2233; }
.bubble.md .md-block-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 10px; background: #241C2C; color: #B9A9CE;
  font-size: 11.5px; font-family: Consolas, Menlo, monospace;
}
.bubble.md .md-copy {
  border: 1px solid #4A3B5C; background: transparent; color: #D8C9EC;
  border-radius: 7px; padding: 2px 9px; font-size: 11.5px; cursor: pointer;
}
.bubble.md .md-copy:active { background: #4A3B5C; }
.bubble.md .md-block .md-pre { margin: 0; border-radius: 0; }
.bubble.md .md-table {
  border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 14px;
}
.bubble.md .md-table th, .bubble.md .md-table td {
  border: 1px solid var(--border); padding: 6px 9px; text-align: left;
}
.bubble.md .md-table th { background: var(--bg2); font-weight: 700; }
.bubble.md hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.bubble.md del { color: var(--text-sub); }

/* ===== 新手引导卡 ===== */
.first-guide {
  margin: 10px 2px 16px; padding: 13px 14px; border-radius: 14px;
  background: #fff; border: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(90,60,120,.08);
}
.first-guide .fg-title { font-size: 16px; font-weight: 700; color: var(--brand-dark); margin-bottom: 4px; }
.first-guide .fg-sub { font-size: 13px; color: var(--text-sub); line-height: 1.7; margin-bottom: 8px; }
.first-guide .fg-steps { margin: 6px 0 8px; padding-left: 20px; font-size: 14px; line-height: 1.85; color: var(--text); }
.first-guide .fg-steps a { color: var(--brand); }
.first-guide .fg-warn { font-size: 12.5px; color: #B03A3A; line-height: 1.7; margin-bottom: 10px; }
.first-guide .fg-ok {
  width: 100%; border: 0; border-radius: 11px; padding: 11px;
  background: var(--brand); color: #fff; font-size: 14.5px;
}

/* ===== 手机端：顶部栏太挤，「编辑 / 清空」被挤出屏幕 ===== */
@media (max-width: 720px) {
  .chat-header {
    flex-wrap: wrap !important;
    gap: 6px !important;
    row-gap: 4px !important;
    padding: 8px 10px !important;
  }
  .chat-header > div, .chat-header > span { min-width: 0 !important; }
  .chat-header .name, .chat-header .chat-name, .chat-header h1, .chat-header h2 {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1 1 auto; min-width: 0;
  }
  .chat-header button, .chat-header .icon-btn, .chat-header a.btn {
    flex: 0 0 auto !important;
    white-space: nowrap;
  }
  .chat-header img, .chat-header .avatar { flex: 0 0 auto; }
}

/* ===== 手机端：让内容用满屏宽（少一圈白边）===== */
@media (max-width: 720px) {
  .layout { padding-left: 0 !important; padding-right: 0 !important; }
  .messages { padding-left: 10px !important; padding-right: 10px !important; }
  .msg.agent { max-width: 100% !important; width: 100% !important; }
}

/* ===== 手机上：编辑/清空 收进三条杠 ===== */
.hdr-burger {
  flex: 0 0 auto; border: 0; background: transparent; color: inherit;
  font-size: 20px; line-height: 1; padding: 6px 8px; border-radius: 8px;
}
.hdr-burger:active { background: rgba(255,255,255,.25); }
.hdr-menu-pop {
  position: absolute; right: 8px; top: 100%; z-index: 60;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 6px 20px rgba(60,40,90,.18); padding: 4px; min-width: 110px;
}
.hdr-menu-pop button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 10px 14px; font-size: 15px; color: var(--text); border-radius: 8px;
}
.hdr-menu-pop button:active { background: var(--bg2); }
.chat-header { position: relative; overflow: visible !important; }

/* ===== 手机端：发送框瘦身 + 消息区抢回空间 ===== */
@media (max-width: 720px) {
  /* 消息区必须能滚动、能占满剩余高度（不加 min-height:0 就会被顶开） */
  .messages { min-height: 0 !important; flex: 1 1 auto !important; overflow-y: auto !important; }
  body.tabbed .layout { padding-bottom: 54px !important; }
  /* 输入区矮一点 */
  .composer, .input-bar { padding: 6px 8px !important; }
  .composer textarea, .input-bar textarea, #input {
    max-height: 96px !important; min-height: 38px !important;
  }
}
.cmp-plus {
  flex: 0 0 auto; border: 0; border-radius: 50%;
  width: 40px; height: 40px; font-size: 20px; line-height: 1;
  background: var(--bg2); color: var(--brand-dark);
}
.cmp-plus:active { background: var(--border); }
.cmp-menu {
  position: absolute; right: 8px; bottom: 56px; z-index: 70;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 6px 20px rgba(60,40,90,.18); padding: 4px; min-width: 130px;
}
.cmp-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 11px 14px; font-size: 15px; color: var(--text); border-radius: 8px;
}
.cmp-menu button:active { background: var(--bg2); }
