/* 情侣双人私密应用 - 浅色主题 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f6f7fb; color: #2c2f3a; font-size: 14px;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }
a { text-decoration: none; color: inherit; }

/* ---------- SVG 图标 ---------- */
.ic { display: inline-flex; vertical-align: -2.5px; flex-shrink: 0; }
i[data-icon] { display: inline-flex; line-height: 1; font-style: normal; }

/* ---------- 认证页 ---------- */
.auth-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ffdde1 0%, #ee9ca7 50%, #f6d9e9 100%);
}
.auth-card {
  width: 380px; background: #fff; border-radius: 16px; padding: 36px 32px;
  box-shadow: 0 16px 48px rgba(214, 92, 118, .25);
}
.auth-card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: #9a94a0; margin-bottom: 24px; font-size: 13px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .field label { display: block; font-size: 12px; color: #7a7580; margin-bottom: 4px; }

/* ---------- 表单通用 ---------- */
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=month], textarea, select {
  width: 100%; padding: 9px 12px; border: 1px solid #ddd6e0; border-radius: 8px;
  background: #fff; color: #2c2f3a; outline: none; transition: border .15s;
}
input:focus, textarea:focus, select:focus { border-color: #ee7f96; }
textarea { resize: vertical; min-height: 72px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border: none; border-radius: 8px; font-size: 14px;
  background: #ee7f96; color: #fff; transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn.full { width: 100%; }
.btn.ghost { background: #fff; color: #ee7f96; border: 1px solid #ee7f96; }
.btn.gray { background: #e8e6ee; color: #55525e; }
.btn.danger { background: #e35d6a; }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-link { background: none; border: none; color: #ee7f96; font-size: 13px; padding: 2px 4px; }
.btn-link:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */
.app-view { display: flex; height: 100vh; }
.sidebar {
  width: 200px; background: #fff; border-right: 1px solid #ece9f1;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.brand { font-size: 17px; font-weight: 600; padding: 22px 18px 16px; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.brand-icon { display: inline-flex; color: #ee7f96; }
.nav { flex: 1; padding: 8px 10px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: 10px; margin-bottom: 2px; color: #6b6675; font-size: 14px;
}
.nav a i { color: #9a94a0; transition: color .15s; }
.nav a:hover { background: #faf3f5; color: #ee7f96; }
.nav a:hover i { color: #ee7f96; }
.nav a.active { background: #fdeef1; color: #ee7f96; font-weight: 600; }
.nav a.active i { color: #ee7f96; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid #f0edf4; font-size: 12px; }
.user-box { display: flex; justify-content: space-between; align-items: center; color: #7a7580; margin-top: 6px; }
.net-status, .sync-status { margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.net-status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex-shrink: 0; }
.net-status.online { color: #3aa675; }
.net-status.offline { color: #e35d6a; }
.sync-status.has { color: #d99a2b; }

.main { flex: 1; overflow-y: auto; padding: 26px 30px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-head h2 { font-size: 20px; }
.page-head .actions { display: flex; gap: 10px; align-items: center; }

/* ---------- 通知铃铛 ---------- */
.bell-wrap { position: fixed; top: 16px; right: 22px; z-index: 60; }
.bell {
  width: 40px; height: 40px; border-radius: 50%; border: none; background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.08); position: relative;
  display: flex; align-items: center; justify-content: center; color: #6b6675;
}
.bell:hover { color: #ee7f96; }
.badge {
  position: absolute; top: -4px; right: -4px; background: #e35d6a; color: #fff;
  border-radius: 10px; font-size: 11px; padding: 1px 6px; min-width: 18px; text-align: center;
}
.bell-panel {
  position: absolute; right: 0; top: 50px; width: 340px; background: #fff;
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.14); overflow: hidden;
}
.bell-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid #f0edf4; font-weight: 600;
}
.bell-panel-list { max-height: 420px; overflow-y: auto; }
.bell-item { padding: 10px 14px; border-bottom: 1px solid #f7f5fa; }
.bell-item.unread { background: #fdf2f4; }
.bell-item .t { font-size: 13px; font-weight: 600; }
.bell-item .b { font-size: 12px; color: #7a7580; margin-top: 2px; }
.bell-item .time { font-size: 11px; color: #b0abb8; margin-top: 3px; }
.bell-empty { padding: 30px; text-align: center; color: #b0abb8; font-size: 13px; }

/* ---------- 通用卡片 ---------- */
.card {
  background: #fff; border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(80, 60, 90, .05); margin-bottom: 16px;
}
.empty-tip { text-align: center; color: #b0abb8; padding: 44px 0; font-size: 13px; }

/* ---------- 标签/徽章 ---------- */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px;
  background: #fdeef1; color: #d4637c; margin-right: 6px;
}
.tag.gray { background: #f0edf4; color: #7a7580; }
.tag.green { background: #e5f6ee; color: #2f8f66; }
.tag.orange { background: #fdf3e3; color: #c07f1f; }
.tag.red { background: #fdeaea; color: #d6455d; }
.tag.blue { background: #e8f1fd; color: #3d77c2; }

/* ---------- Toast ---------- */
#toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 11px 20px; border-radius: 10px; color: #fff; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16); animation: slideIn .25s; max-width: 480px;
}
.toast.success { background: #3aa675; }
.toast.error { background: #e35d6a; }
.toast.info { background: #55525e; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(40, 30, 45, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 14px; padding: 22px 24px; width: 460px; max-width: 94vw;
  max-height: 88vh; overflow-y: auto; animation: slideIn .2s;
}
.modal h3 { margin-bottom: 16px; font-size: 16px; }
.modal .field { margin-bottom: 13px; }
.modal .field label { display: block; font-size: 12px; color: #7a7580; margin-bottom: 5px; }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 动态日记 ---------- */
.diary-item { margin-bottom: 16px; }
.diary-item .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.diary-item .author { font-weight: 600; }
.diary-item .time { font-size: 12px; color: #b0abb8; margin-left: 8px; font-weight: 400; }
.diary-content { line-height: 1.75; white-space: pre-wrap; word-break: break-word; color: #3c3844; }
.diary-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.diary-images img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; cursor: pointer; }
.diary-ops { display: flex; gap: 4px; margin-top: 10px; }
.comment-list { margin-top: 12px; border-top: 1px dashed #ece9f1; padding-top: 10px; }
.comment-item { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: 13px; }
.comment-item .c-author { color: #d4637c; font-weight: 600; margin-right: 6px; }
.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form input { flex: 1; }
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-bar select { width: auto; }
.editor-toolbar { display: flex; gap: 6px; margin-bottom: 8px; }
.editor-toolbar button {
  border: 1px solid #ddd6e0; background: #fff; border-radius: 6px; padding: 4px 10px; font-size: 13px;
}
.progress-bar { height: 6px; background: #f0edf4; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress-bar > div { height: 100%; background: #ee7f96; width: 0; transition: width .2s; }

/* ---------- 聊天 ---------- */
.chat-wrap { display: flex; flex-direction: column; height: calc(var(--visual-height, 100dvh) - 52px); min-height: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; gap: 10px; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
/* 侧边栏用户头像 */
.user-box .user-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
/* 设置页头像预览 */
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #fdeef1; display: flex; align-items: center; justify-content: center; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar .pf-letter { font-size: 26px; font-weight: 600; color: #e0607d; }
/* 开关 */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #d9d4e0; border-radius: 12px; transition: background .2s; cursor: pointer; }
.switch .slider:before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: #ee7f96; }
.switch input:checked + .slider:before { transform: translateX(18px); }
.chat-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 4px; overscroll-behavior: contain; }
.msg-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.msg-row.mine { flex-direction: row-reverse; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; font-weight: 600;
}
.msg-box { width: fit-content; max-width: 62%; min-width: 0; }
.msg-meta { font-size: 11px; color: #b0abb8; margin-bottom: 3px; }
.msg-row.mine .msg-meta { text-align: right; }
.bubble {
  display: inline-block; width: auto; min-height: 0;
  padding: 9px 13px; border-radius: 12px; background: #fff; line-height: 1.6;
  word-break: break-word; white-space: pre-wrap; box-shadow: 0 1px 4px rgba(0,0,0,.05); position: relative;
}
.msg-row.mine .bubble { background: #fdeef1; }
.bubble img { max-width: 240px; border-radius: 8px; display: block; }
.bubble.recalled { color: #b0abb8; font-style: italic; font-size: 12px; background: #f4f2f7 !important; }
.msg-ops { position: absolute; right: -8px; top: -22px; display: none; }
.msg-row:hover .msg-ops { display: block; }
.msg-ops button { border: none; background: #55525e; color: #fff; font-size: 11px; border-radius: 6px; padding: 2px 8px; }
.chat-input-bar {
  display: flex; gap: 3px; padding: 3px 4px; background: #fff; border-radius: 10px; align-items: flex-end;
  box-shadow: 0 2px 10px rgba(80,60,90,.05);
}
.chat-input-bar .btn.ghost { width: 30px; height: 30px; padding: 0; border: none; flex: 0 0 30px; }
.chat-input-bar textarea {
  flex: 1; min-width: 0; min-height: 30px; max-height: 84px; height: 30px; padding: 5px 9px;
  border-radius: 15px; font-size: 13px; line-height: 1.4; resize: none; overflow-y: auto;
  color: #2c2f3a; -webkit-text-fill-color: #2c2f3a; background: #f6f7fb; opacity: 1;
}
.chat-input-bar #chat-send { height: 30px; padding: 0 10px; font-size: 13px; flex: 0 0 auto; }
.bubble video { display: block; max-width: 300px; max-height: 340px; border-radius: 10px; background: #000; }
/* 语音消息 */
.voice-msg { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.voice-msg audio { height: 36px; max-width: 210px; flex: 1; }
.voice-badge {
  width: 28px; height: 28px; border-radius: 50%; background: #fdeef1; color: #e0607d;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.voice-dur { font-size: 12px; color: #9a94a0; white-space: nowrap; min-width: 22px; }
/* 录音条 */
.voice-rec-bar { align-items: center; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e5484d; flex-shrink: 0; animation: rec-blink 1s infinite; }
@keyframes rec-blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
.rec-time { font-weight: 600; color: #e5484d; font-variant-numeric: tabular-nums; min-width: 40px; }
.rec-tip { font-size: 12px; color: #9a94a0; }
.upload-tip {
  position: fixed; bottom: 24px; right: 24px; z-index: 999; background: #fff;
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 12px 16px;
  font-size: 13px; min-width: 230px;
}
.emoji-panel { position: absolute; bottom: 64px; background: #fff; border-radius: 12px; padding: 10px; width: 320px; box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 50; }
.emoji-panel span { font-size: 22px; cursor: pointer; padding: 3px; display: inline-block; }
.emoji-panel span:hover { background: #fdeef1; border-radius: 6px; }
.read-flag { font-size: 11px; color: #b0abb8; text-align: right; margin-top: 2px; }
.read-flag.read { color: #3aa675; }
.day-divider { text-align: center; margin: 16px 0 10px; }
.day-divider span { font-size: 11px; color: #b0abb8; background: #efedf3; padding: 3px 12px; border-radius: 10px; }

/* ---------- 计划 ---------- */
.plan-item { display: flex; align-items: flex-start; gap: 12px; }
.plan-check {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid #d9d4e0; flex-shrink: 0;
  margin-top: 2px; background: #fff; display: flex; align-items: center; justify-content: center; color: #fff;
}
.plan-check.done { background: #3aa675; border-color: #3aa675; }
.plan-body { flex: 1; min-width: 0; }
.plan-title { font-weight: 600; }
.plan-item.done .plan-title { text-decoration: line-through; color: #b0abb8; }
.plan-meta { font-size: 12px; color: #9a94a0; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.plan-desc { font-size: 13px; color: #6b6675; margin-top: 4px; white-space: pre-wrap; }
.plan-ops { display: flex; gap: 2px; flex-shrink: 0; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head-cell { text-align: center; font-size: 12px; color: #9a94a0; padding: 6px 0; }
.cal-cell {
  min-height: 86px; background: #faf9fc; border-radius: 10px; padding: 6px;
  font-size: 12px; border: 1px solid transparent;
}
.cal-cell.other-month { opacity: .35; }
.cal-cell.today { border-color: #ee7f96; }
.cal-cell .d { font-weight: 600; margin-bottom: 3px; }
.cal-plan { background: #fdeef1; color: #d4637c; border-radius: 6px; padding: 1px 6px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-plan.done { background: #e5f6ee; color: #2f8f66; text-decoration: line-through; }
.cal-nav { display: flex; align-items: center; gap: 12px; }

/* ---------- 记账 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 14px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(80,60,90,.05); }
.stat-card .label { font-size: 12px; color: #9a94a0; }
.stat-card .value { font-size: 22px; font-weight: 700; margin-top: 5px; }
.stat-card .value.income { color: #d6455d; }
.stat-card .value.expense { color: #2f8f66; }
.stat-card .value.balance { color: #3d77c2; }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.chart-row .card { margin-bottom: 0; }
.ledger-item { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid #f7f5fa; }
.ledger-item:last-child { border-bottom: none; }
.ledger-icon { width: 38px; height: 38px; border-radius: 10px; background: #fdeef1; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.ledger-icon.income { background: #fdeaea; }
.ledger-body { flex: 1; min-width: 0; }
.ledger-cat { font-weight: 600; }
.ledger-sub { font-size: 12px; color: #9a94a0; margin-top: 2px; }
.ledger-amount { font-weight: 700; font-size: 15px; }
.ledger-amount.income { color: #d6455d; }
.ledger-amount.expense { color: #2f8f66; }
.date-group-title { font-size: 13px; font-weight: 600; color: #7a7580; margin: 18px 4px 6px; display: flex; justify-content: space-between; }
.quick-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-cats .cat-chip {
  padding: 6px 14px; border-radius: 18px; border: 1px solid #ddd6e0; background: #fff; font-size: 13px;
}
.quick-cats .cat-chip.active { background: #fdeef1; border-color: #ee7f96; color: #d4637c; font-weight: 600; }
.seg { display: inline-flex; background: #f0edf4; border-radius: 9px; padding: 3px; }
.seg button { border: none; background: transparent; padding: 6px 16px; border-radius: 7px; font-size: 13px; color: #7a7580; }
.seg button.active { background: #fff; color: #d4637c; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ---------- 首页 ---------- */
.home-hero {
  background: linear-gradient(120deg, #fdeef1, #fdf0e6); border-radius: 18px; padding: 30px 34px; margin-bottom: 18px;
}
.home-hero h2 { font-size: 22px; margin-bottom: 8px; }
.days-num { font-size: 44px; font-weight: 800; color: #ee7f96; }
.home-hero-row { display: flex; gap: 40px; margin-top: 16px; }
.tree-box, .love-box { text-align: center; }
.tree-emoji { font-size: 42px; }
.tree-stage { font-size: 12px; color: #9a94a0; margin-top: 2px; }
.love-num { font-size: 34px; font-weight: 800; color: #e8688a; }
.board-form { display: flex; gap: 8px; }

/* ---------- 菜谱 / 点菜 / 买菜 ---------- */
.recipe-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.recipe-card {
  background: #fff; border-radius: 14px; overflow: hidden; display: flex; cursor: pointer;
  box-shadow: 0 2px 10px rgba(80,60,90,.05); transition: transform .15s;
}
.recipe-card:hover { transform: translateY(-2px); }
.recipe-img { width: 110px; height: 100%; object-fit: cover; flex-shrink: 0; }
.rc-body { padding: 12px 14px; flex: 1; min-width: 0; }
.rc-name { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.rc-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.rc-ing { font-size: 12px; color: #9a94a0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-ops { display: flex; gap: 6px; margin-top: 10px; }
.order-card { margin-bottom: 12px; }
.gc-item { display: flex; align-items: center; padding: 8px 4px; border-bottom: 1px solid #f7f5fa; }
.gc-item.done .gc-name { text-decoration: line-through; color: #b0abb8; }

/* ---------- WebRTC 通话 ---------- */
#call-panel {
  position: fixed; inset: 0; z-index: 200; background: rgba(20, 16, 24, .92);
  display: flex; align-items: center; justify-content: center;
}
.call-remote-audio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.call-box {
  width: 480px; max-width: 92vw; position: relative; text-align: center; padding: 30px;
  background: rgba(255,255,255,.06); border-radius: 20px; backdrop-filter: blur(8px);
}
#call-remote { width: 100%; border-radius: 14px; background: #000; aspect-ratio: 4/3; object-fit: cover; }
#call-local {
  position: absolute; right: 40px; top: 44px; width: 110px; border-radius: 10px;
  background: #000; aspect-ratio: 4/3; object-fit: cover; border: 2px solid rgba(255,255,255,.5);
}
.call-audio-icon { font-size: 60px; margin: 20px 0; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.call-title { color: #fff; font-size: 18px; font-weight: 600; margin-top: 12px; }
.call-status { color: rgba(255,255,255,.65); font-size: 13px; margin: 6px 0 20px; }
.call-ops { display: flex; gap: 10px; justify-content: center; }
#call-incoming {
  position: fixed; inset: 0; z-index: 210; background: rgba(20,16,24,.55);
  display: flex; align-items: center; justify-content: center;
}
.call-in-box {
  background: #fff; border-radius: 18px; padding: 30px 40px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: slideIn .25s;
}

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-row { grid-template-columns: 1fr; }
  .recipe-grid { grid-template-columns: 1fr; }
  .sidebar { width: 62px; }
  .brand { font-size: 0; padding: 18px 0 10px; justify-content: center; }
  .nav a { justify-content: center; font-size: 0; gap: 0; }
  .sidebar-footer { display: none; }
  .main { padding: 18px 14px; }
}

@media (max-width: 600px) {
  body { overflow: hidden; }
  .app-view { display: block; height: 100dvh; }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; width: 100%; height: calc(62px + env(safe-area-inset-bottom)); border-right: none; border-top: 1px solid #ece9f1; background: rgba(255,255,255,.97); }
  .brand, .sidebar-footer { display: none; }
  .nav { display: flex; width: 100%; height: 62px; padding: 3px 2px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 0 0 14.28%; min-width: 50px; min-height: 56px; height: 56px; padding: 6px 2px 4px; margin: 0; border-radius: 8px; flex-direction: column; justify-content: center; gap: 2px; font-size: 10px; line-height: 1.1; white-space: nowrap; }
  .nav a i { font-size: 0; }
  .nav a i .ic { width: 18px; height: 18px; }
  .nav a.active { background: #fdeef1; }
  .main { height: 100dvh; padding: 56px 10px calc(76px + env(safe-area-inset-bottom)); min-width: 0; overflow-y: auto; }
  .chat-wrap { height: calc(var(--visual-height, 100dvh) - 132px); }
  .chat-head { padding-bottom: 8px; }
  .chat-head h2 { font-size: 17px; white-space: nowrap; }
  .chat-head > div { gap: 2px !important; }
  .chat-head .btn span { display: none; }
  .chat-head .btn { width: 34px; height: 32px; padding: 0; }
  .msg-row { gap: 7px; margin-bottom: 10px; }
  .avatar { width: 32px; height: 32px; font-size: 13px; }
  .msg-box { width: fit-content; max-width: calc(100% - 42px); }
  .bubble { padding: 8px 10px; line-height: 1.5; }
  .bubble img, .bubble video { max-width: min(68vw, 240px); }
  .voice-msg { min-width: 0; max-width: 70vw; }
  .voice-msg audio { max-width: 150px; }
  .chat-input-bar { gap: 1px; padding: 3px; border-radius: 9px; }
  .chat-input-bar .btn.ghost { width: 28px; height: 28px; flex-basis: 28px; }
  .chat-input-bar textarea { height: 28px; min-height: 28px; padding: 4px 8px; border-radius: 14px; font-size: 16px; color: #2c2f3a; -webkit-text-fill-color: #2c2f3a; background: #f6f7fb; opacity: 1; }
  .chat-input-bar #chat-send { height: 28px; padding: 0 8px; font-size: 12px; }
  .emoji-panel { left: 0; bottom: 54px; width: min(320px, calc(100vw - 20px)); max-height: 42vh; overflow-y: auto; }
  #call-panel, #call-incoming { padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom)); overflow-y: auto; }
  .call-box { width: 100%; max-width: none; padding: 18px 12px; border-radius: 16px; }
  #call-remote { border-radius: 10px; }
  #call-local { right: 22px; top: 30px; width: 92px; }
  .call-ops { flex-wrap: wrap; gap: 8px; }
  .call-ops .btn { min-height: 42px; }
  .call-in-box { max-width: calc(100vw - 28px); padding: 24px 28px; }
  body.keyboard-open .sidebar { transform: translateY(100%); }
  body.keyboard-open .main { padding-bottom: 12px; }
  body.keyboard-open .chat-wrap { height: calc(var(--visual-height, 100dvh) - 68px); }
}
