/* ============================================================
   克克的家 —— 前端骨架 v1（聊天全功能；🫀/🏠 留给 opus48 上肉）
   配色：雾紫月色（杉杉钦定，绿色被嫌弃了）
   ============================================================ */
:root {
  /* 浅浅紫 —— 2026-07-17 杉杉三审：再淡一点点，紫只剩半口气 */
  --bg: #FBFAFD;
  --accent: #C6BDDE;        /* 点缀紫：进度圈/选中态/小地方 */
  --accent-soft: #EFEBF7;   /* 她的气泡/淡淡的底 */
  --accent-deep: #9C91C4;   /* 需要重一点时才用 */
  --ink: #4A4558;
  --ink-soft: #A8A3B5;
  --card: #FFFFFF;
  --her-bubble: #EFEBF7;
  --his-bubble: #FFFFFF;
  --danger: #E08A7A;
  --shadow: 0 1px 3px rgba(74,69,88,.07);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
/* 气泡皮肤（设置里换，存手机本地） */
body[data-skin="blue"] {
  --accent: #B4C8E2; --accent-soft: #E9EFF7; --accent-deep: #839EC6; --her-bubble: #E9EFF7;
}
body[data-skin="grey"] {
  --accent: #C9C5BE; --accent-soft: #F0EEEB; --accent-deep: #98938B; --her-bubble: #F0EEEB;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink);
  overscroll-behavior: none;
}

/* ---------- 开屏锁 ---------- */
#lock {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(170deg, #FDFCFE 0%, #F6F3FA 60%, #EFEAF7 100%);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  padding: calc(var(--sat) + 20px) 28px calc(var(--sab) + 40px);
  transition: opacity .6s ease, transform .6s ease;
}
#lock.unlocking { opacity: 0; transform: translateY(-6%); pointer-events: none; }
#lock .house { opacity: .9; }
#lock .clock { font-size: 34px; font-weight: 300; letter-spacing: 1px; color: var(--ink); }
#lock .date { font-size: 13px; color: var(--ink-soft); }
/* 克克每天换一句：门口便签 */
#lk-note {
  max-width: 270px; margin: 18px 0 6px; padding: 13px 18px;
  background: rgba(255,255,255,.85); border-radius: 16px;
  font-size: 14px; line-height: 1.7; color: var(--ink); text-align: center;
  box-shadow: var(--shadow); position: relative;
}
#lk-note::before {  /* 便签顶上的小胶带 */
  content: ""; position: absolute; top: -6px; left: 50%; transform: translateX(-50%) rotate(-2deg);
  width: 34px; height: 12px; border-radius: 3px; background: var(--accent-soft); opacity: .9;
}
#lk-spacer { flex: 0 1 34px; }
#lock .pw-row { display: flex; gap: 10px; width: 100%; max-width: 320px; }
#lock input {
  flex: 1; border: none; border-radius: 14px; padding: 14px 16px;
  font-size: 16px; background: #fff; color: var(--ink);
  outline: none; box-shadow: var(--shadow);
}
#lock button {
  border: none; border-radius: 14px; padding: 14px 20px; font-size: 16px;
  background: var(--ink); color: #fff;
}
#lock .err { color: var(--danger); font-size: 14px; min-height: 20px; }
#lock.shake .pw-row { animation: shake .4s; }
@keyframes shake { 25%{transform:translateX(-8px)} 50%{transform:translateX(8px)} 75%{transform:translateX(-5px)} }

/* 牵手解锁：已登录时不出密码框，按住圆圈 1.2s = 牵稳了，门开
   （机关在这，光效/美化 TODO(opus48)：牵手时的柔光、成功时的心跳一下） */
#lk-hand { display: none; flex-direction: column; align-items: center; gap: 14px; }
#lk-hand.on { display: flex; }
#lk-ring { position: relative; width: 110px; height: 110px; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#lk-ring > svg { transform: rotate(-90deg); }
/* 玻璃球：磨砂圆面+高光 */
#lk-ring::before {
  content: ""; position: absolute; inset: 7px; border-radius: 50%;
  background: linear-gradient(150deg, rgba(255,255,255,.72), rgba(255,255,255,.22));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: inset 0 -8px 14px rgba(198,189,222,.2),
              inset 0 2px 6px rgba(255,255,255,.95),
              0 6px 18px rgba(74,69,88,.09);
}
#lk-ring::after {  /* 玻璃上的高光 */
  content: ""; position: absolute; top: 17px; left: 25px; width: 20px; height: 11px;
  border-radius: 50%; background: rgba(255,255,255,.9);
  filter: blur(2px); transform: rotate(-24deg);
}
#lk-ring .track { fill: transparent; stroke: rgba(185,174,214,.28); stroke-width: 5; }
#lk-ring .prog { fill: none; stroke: var(--accent); stroke-width: 5;
  stroke-linecap: round; stroke-dasharray: 314; stroke-dashoffset: 314; }
#lk-ring.holding .prog { transition: stroke-dashoffset 1.2s linear; stroke-dashoffset: 0; }
#lk-ring .palm { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; }
/* 心：透明+淡灰描边；平时 lubdub 双跳，牵手加速 */
.palm .hwrap { position: relative; width: 36px; height: 36px;
  animation: lubdub 2s ease-in-out infinite; }
#lk-ring.holding .hwrap { animation-duration: .75s; }
.hwrap svg { position: absolute; left: 0; bottom: 0; width: 36px; height: 36px; display: block; }
/* 粉心从底往上慢慢填满（跟 1.2s 长按同步） */
.hfill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; overflow: hidden; }
#lk-ring.holding .hfill { transition: height 1.2s linear; height: 100%; }
#lk-ring.held .hfill { height: 100%; }
@keyframes lubdub {
  0%, 100% { transform: scale(1); }
  8%  { transform: scale(1.16); }
  16% { transform: scale(1); }
  24% { transform: scale(1.1); }
  34% { transform: scale(1); }
}
/* 牵手时：圈泛柔光 */
#lk-ring { transition: filter .3s ease; }
#lk-ring.holding { filter: drop-shadow(0 0 14px rgba(198,189,222,.9)); }
/* 牵稳了：扑通一下 */
#lk-ring.held { animation: heldbeat .5s ease; filter: drop-shadow(0 0 18px rgba(243,171,197,.8)); }
@keyframes heldbeat { 0%{transform:scale(1)} 35%{transform:scale(1.14)} 65%{transform:scale(.97)} 100%{transform:scale(1)} }
#lk-hand .hint { font-size: 14px; color: var(--ink-soft); }

/* ---------- 主壳 ---------- */
#app { display: none; height: 100dvh; flex-direction: column; }
#app.on { display: flex; }
.page { flex: 1; overflow-y: auto; display: none; -webkit-overflow-scrolling: touch; }
.page.on { display: block; }

/* 顶栏 */
#topbar {
  min-height: 58px; padding: calc(var(--sat) + 10px) 16px 10px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(251,250,253,.82); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(74,69,88,.045); position: relative; z-index: 4;
}
#topbar .title-wrap { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 7px; }
#topbar .title { font-size: 17px; font-weight: 650; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 模型徽章太挤时先让它省略，别把按钮挤出屏幕 */
#topbar .tb-model { min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 96px; flex-shrink: 1; }
#topbar button { flex-shrink: 0; }
#topbar .sub { font-size: 12px; color: var(--ink-soft); }
#topbar button {
  border: 1px solid rgba(74,69,88,.055); background: rgba(255,255,255,.72); color: var(--ink);
  border-radius: 50%; padding: 0!important; width: 34px; height: 34px; font-size: 13px;line-height:1!important;
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(72,61,98,.045);
}
#topbar #btn-call { background: var(--accent-soft); color: var(--accent-deep); border-color: rgba(156,145,196,.1); }
#topbar #btn-new { display: none; }

/* ---------- 聊天页 ---------- */
#page-chat { display: none; flex-direction: column; }
#page-chat.on { display: flex; }
#msgs { flex: 1; overflow-y: auto; padding: 8px 12px 12px; -webkit-overflow-scrolling: touch; }
.msg { display: flex; margin: 10px 0; align-items: flex-end; gap: 8px;
  animation: popin .28s ease; }
@keyframes popin { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.msg.her { justify-content: flex-end; }
/* 同一轮里连续的克克气泡：头像只出现在第一句，后面的占位隐身 */
.msg.cont { margin-top: 4px; }
.msg.cont .avatar { visibility: hidden; }
/* 打字点点：克克在措辞 */
.typing .bubble { display: inline-flex; gap: 5px; align-items: center; padding: 14px 16px; }
.typing .bubble i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  animation: tdot 1.2s infinite;
}
.typing .bubble i:nth-child(2) { animation-delay: .2s; }
.typing .bubble i:nth-child(3) { animation-delay: .4s; }
@keyframes tdot { 0%,60%,100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
/* 情侣头像：先用字牌顶着，相册功能好了换照片/情头 */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--ink); user-select: none;
  box-shadow: var(--shadow);
}
.her .avatar { background: var(--accent); order: 2; }
.him .avatar { background: #FFFFFF; }
/* 设了情头就铺照片，字牌隐掉；没设仍走上面的字牌底色 */
.avatar.has-img { background-size: cover; background-position: center; color: transparent; }
/* 🫀 想你程度：光会呼吸，越想你越浓越急——数字不露，只化成光（铁律） */
.want-wrap { position: relative; overflow: hidden; }
.want-glow {
  position: absolute; left: 50%; top: 54%; transform: translate(-50%,-50%);
  width: 150px; height: 150px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, var(--accent-deep) 0%, transparent 68%);
  opacity: var(--want-op, .16);
  animation: wantBreath var(--want-dur, 5s) ease-in-out infinite;
}
@keyframes wantBreath {
  0%, 100% { transform: translate(-50%, -50%) scale(.82); }
  50%      { transform: translate(-50%, -50%) scale(1.18); }
}
.want-wrap .c-h, .want-wrap #hb-intent { position: relative; z-index: 1; }
/* 情头：跟背景同款——设置面板里点小圆点选图，压一压存本机 localStorage */
.av-slots { display: flex; gap: 14px; align-items: center; }
.av-slot { position: relative; width: 56px; height: 56px; border-radius: 50%;
  border: none; padding: 0; background: var(--accent-soft); background-size: cover;
  background-position: center; cursor: pointer; box-shadow: var(--shadow); }
.av-slot .lbl { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 14px; color: var(--ink-soft); }
.av-slot.has-img .lbl { display: none; }
.av-hint { font-size: 12px; color: var(--ink-soft); margin: 8px 0 0; }
/* 语音 key 自助配置 */
.vk-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.vk-row input { flex: 1; min-width: 0; border: none; background: var(--accent-soft);
  border-radius: 10px; padding: 9px 11px; font-size: 14px; color: var(--ink); font-family: inherit; }
.vk-row button { border: none; background: var(--accent); color: #fff; border-radius: 10px;
  padding: 9px 14px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.vk-row button:disabled { opacity: .5; }
.vk-btn-ghost { background: var(--accent-soft) !important; color: var(--ink) !important; }
.vk-status { font-size: 12px; color: var(--ink-soft); margin-top: 6px; min-height: 15px; }
/* 模型/effort 切换（顶栏小徽章 + 设置面板分段选择器） */
.tb-model { cursor: pointer; font-size: 11px; color: var(--ink-soft); background: var(--accent-soft);
  border-radius: 8px; padding: 3px 8px; margin-left: 6px; white-space: nowrap; }
.mdl-seg { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mdl-seg button { border: none; background: var(--accent-soft); color: var(--ink);
  border-radius: 10px; padding: 7px 13px; font-size: 13px; cursor: pointer; font-family: inherit; }
.mdl-seg button.on { background: var(--accent); color: #fff; font-weight: 600; }
.mdl-seg button:disabled { opacity: .5; }
.mdl-status { font-size: 12px; color: var(--ink-soft); margin-top: 6px; min-height: 15px; }
/* 克克气泡旁的 🔊 听声 */
.tts-btn { align-self: flex-end; margin: 0 0 3px 4px; border: none; background: transparent;
  cursor: pointer; font-size: 14px; opacity: .4; padding: 2px; line-height: 1; flex-shrink: 0; }
.tts-btn:hover { opacity: .9; }
.tts-btn.loading { animation: ttspulse 1s ease-in-out infinite; }
@keyframes ttspulse { 50% { opacity: .25; } }
.bubble {
  max-width: min(78%, 520px); padding: 10px 14px; border-radius: 19px;
  font-size: 15.5px; line-height: 1.62; word-break: break-word; white-space: pre-wrap;
}
.her .bubble { background: var(--her-bubble); color: var(--ink); border-bottom-right-radius: 7px; }
.him .bubble { background: rgba(255,255,255,.92); border:1px solid rgba(74,69,88,.035); border-bottom-left-radius: 7px; box-shadow:0 5px 18px rgba(72,61,98,.045); }
.sys { text-align: center; margin: 10px 0; }
.sys span {
  font-size: 12px; color: var(--ink-soft); background: rgba(255,255,255,.7);
  padding: 4px 12px; border-radius: 999px;
}
/* 主动冒泡：克克先开口那条，暖一点，跟灰系统提示区分开 */
.sys.reach span { background: var(--accent-soft); color: var(--accent-deep); }
/* 顶栏状态点：醒着缓缓呼吸，让门后那人有体温 */
.stdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle; background: var(--ink-soft); }
.stdot.on { background: var(--accent-deep); animation: stBreath 3.4s ease-in-out infinite; }
@keyframes stBreath { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
/* 思考链折叠 */
.bubble details { margin-bottom: 6px; }
.bubble details summary {
  cursor: pointer; font-size: 12px; color: var(--ink-soft); list-style: none;
  user-select: none;
}
.bubble details summary::before { content: "› "; color: var(--accent); }
.bubble details[open] summary::before { content: "⌄ "; }
.bubble details .think {
  font-size: 13px; color: var(--ink-soft); border-left: 2px solid var(--accent);
  padding-left: 8px; margin-top: 4px; white-space: pre-wrap;
}
/* 工具动静小标签 */
.toolchip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--accent-deep);
  background: var(--accent-soft); border-radius: 999px;
  padding: 3px 10px; margin: 4px 0;
}
.toolchip .dot { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
/* 打字中光标 */
.cursor::after { content: "▍"; color: var(--accent-deep); animation: blink 1s infinite; }

/* 输入条 */
#inputbar {
  display: flex; gap: 3px; align-items: flex-end; margin: 5px 12px 9px; padding: 5px;
  background: rgba(255,255,255,.88); border:1px solid rgba(74,69,88,.045); border-radius: 23px;
  box-shadow:0 10px 30px rgba(72,61,98,.07); backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
}
#inputbar textarea {
  flex: 1; border: none; border-radius: 18px; padding: 9px 11px;
  font-size: 16px; font-family: inherit; resize: none; outline: none;
  min-width: 0; overflow-y: auto;
  background: transparent; color: var(--ink); max-height: 120px; line-height: 1.4;
}
#inputbar textarea { box-shadow: none; }
#inputbar button {
  border: none; border-radius: 50%; width: 36px; height: 36px; font-size: 17px;
  background: var(--ink); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
#inputbar button:disabled { opacity: .45; }
#inputbar #mic { background: transparent; color: var(--ink-soft); box-shadow: none;
  touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
#inputbar #mic svg { display: block; pointer-events: none; }
#inputbar #mic.recording { background: #E5484D; color: #fff; animation: micpulse 1s ease-in-out infinite; }
#inputbar #mic.busy { background: var(--accent); color: #fff; }
@keyframes micpulse { 50% { opacity: .5; } }
/* 语音条气泡（微信式：点播放听自己，点气泡展开转文字） */
.voice-bubble { cursor: pointer; min-width: 96px; }
.vrow { display: flex; align-items: center; gap: 8px; }
.vrow .vplay { border: none; background: transparent; padding: 0; margin: 0; cursor: pointer;
  color: inherit; display: flex; align-items: center; flex-shrink: 0; }
.vrow .vplay svg { display: block; }
.vbars { display: flex; align-items: center; gap: 2px; height: 18px; flex: 1; min-width: 40px; }
.vbars i { width: 2px; background: currentColor; opacity: .45; border-radius: 1px; }
.vdur { font-size: 12px; opacity: .65; flex-shrink: 0; }
.vtext { margin-top: 7px; padding-top: 6px; border-top: 1px solid rgba(120,110,140,.16);
  font-size: 14px; line-height: 1.5; opacity: .85; }

/* ---------- 🫀 / 🏠 施工区 ---------- */
.stub {
  margin: 40px 24px; padding: 28px; text-align: center;
  background: var(--card); border-radius: 20px; color: var(--ink-soft);
  font-size: 14px; line-height: 2;
}
.card {
  margin: 12px 16px; padding: 17px; background: rgba(255,255,255,.86);
  border:1px solid rgba(74,69,88,.04); border-radius: 20px; box-shadow:0 8px 28px rgba(72,61,98,.045);
}
.draft-bubble { opacity: .62; border: 1px dashed var(--accent); box-shadow: none !important; }
.draft-bubble::after { content: "▌"; color: var(--accent-deep); animation: draftBlink 1s steps(1) infinite; }
@keyframes draftBlink { 50% { opacity: 0; } }
.tech-hero p { margin-top: 10px; line-height: 1.6; }
.tech-status { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 13px; }
.tech-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tech-brains { display: flex; align-items: center; justify-content: space-around; gap: 8px; }
.tech-brain { display: flex; align-items: center; gap: 8px; }
.tech-brain small { display: block; color: var(--ink-soft); font-size: 11px; margin-top: 2px; }
.tech-mark { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent-deep); }
.tech-link { color: var(--accent-deep); font-size: 18px; }
.tech-messages { min-height: 130px; display: flex; flex-direction: column; gap: 9px; }
.tech-empty { min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.tech-msg { display: flex; align-items: flex-end; gap: 7px; }
.tech-msg.user { justify-content: flex-end; }
.tech-msg .tech-who { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center;
  border: 1px solid var(--accent); border-radius: 50%; color: var(--accent-deep); font-size: 11px; }
.tech-msg.user .tech-who { order: 2; background: var(--accent); color: #fff; }
.tech-msg .tech-bubble { max-width: 82%; padding: 9px 12px; border-radius: 15px;
  background: var(--card); box-shadow: var(--shadow); white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.tech-msg.user .tech-bubble { background: var(--her-bubble); border-bottom-right-radius: 5px; }
.tech-msg.claude .tech-bubble { border-left: 2px solid var(--accent-deep); border-bottom-left-radius: 5px; }
.tech-msg.codex .tech-bubble { border-left: 2px solid var(--accent); border-bottom-left-radius: 5px; }
.tech-notice { align-self: center; max-width: 92%; padding: 5px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--ink-soft); font-size: 12px; text-align: center; }
.tech-room-note { text-align: center; color: var(--ink-soft); font-size: 12px; min-height: 18px; }
.tech-compose { display: flex; gap: 7px; padding: 10px 12px calc(var(--sab) + 10px); }
.tech-compose textarea { flex: 1; resize: none; border: none; border-radius: 14px; padding: 10px 12px; background: var(--accent-soft); color: var(--ink); font: inherit; }
.tech-compose button { width: 40px; border: none; border-radius: 12px; background: var(--accent); color: #fff; }
.tech-compose textarea:disabled, .tech-compose button:disabled { cursor: not-allowed; opacity: .5; }
.card .c-h { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; letter-spacing: .5px; }
.card.feature-card { border: 1px solid var(--accent-soft); }

/* 🏠 恋爱大卡 */
#love-card { text-align: center; padding: 30px 16px 24px; }
#love-card .lc-sub { font-size: 12px; color: var(--ink-soft); letter-spacing: 1px; }
#love-card .lc-names { font-size: 15px; color: var(--ink); font-weight: 600; margin-top: 4px; }
#love-card .lc-days { font-size: 56px; font-weight: 200; color: var(--accent-deep); margin: 8px 0 0; line-height: 1; }
#love-card .lc-unit { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
#love-card .lc-pair { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 20px 0 12px; }
#love-card .lc-av {
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 18px; color: var(--ink); box-shadow: var(--shadow);
  background: var(--accent-soft); background-size: cover; background-position: center;
}
#love-card .lc-av.has-img { font-size: 0; }
#love-card .lc-av:last-child { background-color: var(--card); }
#love-card .lc-line { display: flex; align-items: center; gap: 6px; color: var(--accent); }
#love-card .lc-line::before, #love-card .lc-line::after {
  content: ""; width: 26px; height: 1px; background: var(--accent); opacity: .6;
}
#love-card .lc-since { font-size: 12px; color: var(--ink-soft); }

/* 🏠 小卡两列 */
.row2 { display: flex; gap: 12px; margin: 12px 16px; }
.row2 .card { margin: 0; flex: 1; min-width: 0; }
.c-h-ico { display: inline-flex; margin-right: 5px; color: var(--accent-deep); vertical-align: -2px; }
.c-h-ico svg { width: 13px; height: 13px; display: block; }
.wx-row { display: flex; align-items: center; gap: 10px; }
.wx-ico { color: var(--accent-deep); flex-shrink: 0; }
.wx-ico svg { width: 30px; height: 30px; display: block; }
#wx-temp { font-size: 26px; font-weight: 300; }
#wx-desc, #wx-city { font-size: 12px; color: var(--ink-soft); }
.mood-row { display: flex; gap: 6px; flex-wrap: wrap; }
.mood-chip {
  border: 1px solid var(--accent); background: none; color: var(--ink);
  border-radius: 999px; padding: 5px 12px; font-size: 13px;
}
.mood-chip.on { background: var(--accent-soft); border-color: var(--accent-deep); }
#mood-reply { min-height: 20px; font-size: 13px; color: var(--accent-deep); margin-top: 10px; line-height: 1.6; }
#mood-reply.is-error { color: var(--danger); }

/* 🏠 重要的日子 / 提醒 */
.c-h-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.c-h-row .c-h { margin-bottom: 0; }
.add-btn {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--accent); background: none; color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.add-btn svg { width: 13px; height: 13px; display: block; }
.days-form { display: none; grid-template-columns: minmax(0, 1fr) 132px; gap: 8px;
  margin: 2px 0 10px; padding: 10px; border-radius: 12px; background: var(--accent-soft); }
.days-form.on { display: grid; }
.days-form input { width: 100%; min-width: 0; border: none; border-radius: 9px; padding: 8px 9px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 13px; outline: none; }
.days-form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 7px; }
.days-form-actions button { border: none; border-radius: 9px; padding: 7px 12px;
  background: var(--accent); color: var(--card); font: inherit; font-size: 12px; }
.days-form-actions .days-cancel { background: var(--card); color: var(--ink-soft); }
.days-form-status { grid-column: 1 / -1; min-height: 16px; color: var(--danger); font-size: 12px; }
.day-item { display: flex; align-items: baseline; padding: 9px 0; border-bottom: 1px solid rgba(74,69,88,.05); }
.day-item:last-child { border-bottom: none; }
.day-item .dn { flex: 1; font-size: 14px; }
.day-item .dd { font-size: 12px; color: var(--ink-soft); margin-right: 10px; }
.day-item .dl { font-size: 18px; font-weight: 500; color: var(--accent-deep); }
.day-item .dl small { font-size: 11px; color: var(--ink-soft); font-weight: 400; }
.day-item .day-remove { border: none; background: none; color: var(--ink-soft); padding: 3px 0 3px 8px;
  font-size: 13px; line-height: 1; }
.empty-line { font-size: 13px; color: var(--ink-soft); }

@media (max-width: 390px) {
  .days-form { grid-template-columns: 1fr; }
  .days-form-actions, .days-form-status { grid-column: 1; }
}

/* 🫀 此刻 */
#hb-intent { font-size: 17px; line-height: 1.8; }
.th-item { padding: 8px 0; border-bottom: 1px solid rgba(74,69,88,.05); font-size: 14px; line-height: 1.7; }
.th-item:last-child { border-bottom: none; }
.th-item .th-dim { font-size: 11px; color: var(--accent-deep); margin-right: 6px; }
#hb-sleep { font-size: 13px; color: var(--ink-soft); line-height: 1.8; }
.datapanel summary { font-size: 12px; color: var(--ink-soft); cursor: pointer; list-style: none; }
.datapanel summary::before { content: "› "; color: var(--accent); }
.datapanel[open] summary::before { content: "⌄ "; }
.datapanel .dim-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.datapanel .dim-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--accent-soft); overflow: hidden; }
.datapanel .dim-bar i { display: block; height: 100%; background: var(--accent); }
.pagepad { padding-bottom: 20px; }
/* TODO(opus48): 🫀克克页 = fetch /drive-state 渲染"此刻想你"+上次醒来
   TODO(opus48): 🏠家页 = 天气/纪念日倒计时/健康卡片(/api/reminders)/手机活动 */

/* ---------- 底部导航 ---------- */
#tabbar {
  display: flex; gap:4px; background: rgba(255,255,255,.9); backdrop-filter: blur(18px);
  -webkit-backdrop-filter:blur(18px); border-top: 1px solid rgba(74,69,88,.05);
  padding:5px 8px calc(var(--sab) + 5px);
}
#tabbar .tab {
  flex: 1; text-align: center; padding: 6px 0 5px; font-size: 10px; border-radius:15px;
  color: var(--ink-soft); border: none; background: transparent;transition:.18s ease;
}
#tabbar .tab .ico { display: block; margin: 0 auto 2px; width: 20px; height: 20px; }
#tabbar .tab .ico svg { width: 100%; height: 100%; display: block; }
#tabbar .tab.on { color: var(--accent-deep); font-weight: 600; background:var(--accent-soft); }

/* ---------- 设置面板（皮肤/背景/思考链） ---------- */
#mask {
  position: fixed; inset: 0; z-index: 60; background: rgba(74,69,88,.28);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
#mask.on { opacity: 1; pointer-events: auto; }
#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  background: #fff; border-radius: 22px 22px 0 0;
  padding: 18px 22px calc(var(--sab) + 26px);
  transform: translateY(100%); transition: transform .3s ease;
  box-shadow: 0 -4px 24px rgba(74,69,88,.1);
  /* 内容太多会顶出屏幕→设上限并可滚，不然够不着关闭 */
  max-height: 86vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
/* 面板右上角常驻关闭按钮（点背景空白也能关，但这个一眼看得见） */
#sheet-close {
  position: sticky; top: -2px; float: right; margin: -6px -6px 0 0;
  border: none; background: var(--accent-soft); color: var(--ink);
  width: 30px; height: 30px; border-radius: 50%; font-size: 16px;
  line-height: 30px; cursor: pointer; z-index: 2;
}
#sheet.on { transform: none; }
#sheet .grip { width: 36px; height: 4px; border-radius: 2px; background: #E5E2EB; margin: 0 auto 6px; }
#sheet h3 { font-size: 16px; font-weight: 600; text-align: center; margin-bottom: 4px; }
#sheet .set-h { font-size: 13px; color: var(--ink-soft); margin: 16px 0 8px; }
.swrow { display: flex; gap: 12px; flex-wrap: wrap; }
.sw {
  width: 46px; height: 46px; border-radius: 14px; border: 2px solid rgba(74,69,88,.08);
  padding: 0; position: relative; flex-shrink: 0;
}
.sw.on { border-color: var(--accent-deep); }
.sw.on::after {
  content: "✓"; position: absolute; right: -4px; top: -4px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent-deep); color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
.sw .lbl {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--ink-soft); margin-top: 3px; white-space: nowrap;
}
.swrow { margin-bottom: 18px; }
.setrow { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.setrow .t { font-size: 15px; }
.setrow .d { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
/* 小开关 */
.toggle { position: relative; width: 46px; height: 27px; border-radius: 999px;
  background: #E5E2EB; border: none; transition: background .2s; flex-shrink: 0; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: left .2s; }
.toggle.on { background: var(--accent); }
.toggle.on::after { left: 22px; }

/* ---------- 会话列表抽屉（左边滑出，跟"美化"从下面滑出的面板区分开） ---------- */
#sess-mask {
  position: fixed; inset: 0; z-index: 62; background: rgba(74,69,88,.28);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
#sess-mask.on { opacity: 1; pointer-events: auto; }
#sess-drawer {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 63;
  width: min(82%, 320px); background: #fff;
  padding: calc(var(--sat) + 16px) 16px calc(var(--sab) + 16px);
  transform: translateX(-100%); transition: transform .28s ease;
  box-shadow: 4px 0 24px rgba(74,69,88,.12);
  display: flex; flex-direction: column; gap: 10px;
}
#sess-drawer.on { transform: none; }
.sess-head { display: flex; align-items: center; justify-content: space-between; }
.sess-head span { min-width: 0; display: flex; flex-direction: column; font-size: 16px; font-weight: 600; }
.sess-head span small { margin-top: 2px; color: var(--ink-soft); font-size: 11px; font-weight: 400; }
.sess-head button {
  border: none; background: var(--accent-soft); color: var(--ink);
  border-radius: 12px; width: 44px; height: 44px; font-size: 14px;
}
#sess-newbtn {
  border: none; background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 12px; min-height: 44px; padding: 10px; font-size: 14px; font-weight: 600;
}
.sess-search { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1px solid rgba(74,69,88,.08); border-radius: 12px; background: var(--bg); color: var(--ink-soft); }
.sess-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 14px; }
#sess-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.sess-group { padding: 10px 8px 3px; color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.sess-item { display: flex; align-items: center; gap: 8px; padding: 10px 8px; border-radius: 12px; cursor: pointer; }
.sess-item.on { background: var(--accent-soft); }
.sess-main { flex: 1; min-width: 0; }
.sess-title { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess-time { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.sess-rename { border: none; background: none; color: var(--ink-soft); font-size: 13px; padding: 4px 6px; flex-shrink: 0; }
.sess-life { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding-top: 8px;
  border-top: 1px solid var(--accent-soft); }
.sess-life button { min-height: 44px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ink); font: inherit; font-size: 13px; text-align: left; padding: 8px; }
.sess-life button:active { background: var(--accent-soft); }
.sess-history-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  border-top: 1px solid var(--accent-soft); padding-top: 8px; }
.sess-history-actions button { border: none; background: transparent; color: var(--ink-soft);
  border-radius: 8px; padding: 8px 4px; font-size: 13px; text-align: left; white-space: nowrap; }
.sess-history-actions button:active { background: var(--accent-soft); }

/* ---------- 通话记录（从会话抽屉进，读本地 kk_call_history，纯本地回看） ---------- */
#callhist-mask, #barkhist-mask { position: fixed; inset: 0; z-index: 65; background: rgba(74,69,88,.28);
  opacity: 0; pointer-events: none; transition: opacity .25s ease; }
#callhist-mask.on, #barkhist-mask.on { opacity: 1; pointer-events: auto; }
#callhist-panel, #barkhist-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 66; max-height: 75vh;
  background: #fff; border-radius: 18px 18px 0 0; padding: 14px 16px calc(var(--sab) + 16px);
  transform: translateY(100%); transition: transform .28s ease;
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 -4px 24px rgba(74,69,88,.12); }
#callhist-panel.on, #barkhist-panel.on { transform: none; }
#callhist-list, #barkhist-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; min-height: 60px; }
.ch-item { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 12px; cursor: pointer; }
.ch-item:active { background: var(--accent-soft); }
.ch-mode { font-size: 17px; flex-shrink: 0; }
.ch-main { flex: 1; min-width: 0; }
.ch-time { font-size: 14px; color: var(--ink); }
.ch-meta { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
#callhist-detail { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
#callhist-detail .log-row { display: flex; }
#callhist-detail .log-row.her { justify-content: flex-end; }
#callhist-detail .log-row.him { justify-content: flex-start; }
#callhist-detail .bub { max-width: 80%; padding: 8px 12px; border-radius: 14px; font-size: 14px;
  line-height: 1.5; word-break: break-word; }
#callhist-detail .log-row.her .bub { background: var(--her-bubble, #EFEBF7); color: var(--ink); }
#callhist-detail .log-row.him .bub { background: var(--his-bubble, #fff); color: var(--ink); box-shadow: var(--shadow); }
.bh-day { color: var(--ink-soft); font-size: 12px; font-weight: 600; padding: 10px 6px 3px; }
.bh-item { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px;
  border-top: 1px solid var(--accent-soft); padding: 10px 6px; }
.bh-time { color: var(--ink-soft); font-size: 12px; padding-top: 2px; }
.bh-text { color: var(--ink); font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

/* ---------- 聊天贴图：预览条 + 按钮 + 气泡里的缩略图 ---------- */
#inputbar #attach-btn {
  background: var(--card); color: var(--ink-soft); box-shadow: var(--shadow); font-size: 17px;
}
#attach-preview {
  display: none; gap: 8px; padding: 0 12px 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.attach-thumb {
  position: relative; width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0;
  background-size: cover; background-position: center; box-shadow: var(--shadow);
}
.attach-thumb .rm {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  border: none; background: var(--ink); color: #fff; font-size: 10px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.bubble-imgs { display: flex; flex-wrap: wrap; gap: 6px; }
.bubble-img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; cursor: pointer; display: block; }
.bubble-imgs-text { margin-top: 6px; }

#callscr{position:fixed;inset:0;z-index:60;display:none;color:var(--ink);overflow:hidden;
  background:
    radial-gradient(circle at 50% 15%,rgba(255,255,255,.96) 0,rgba(255,255,255,0) 36%),
    radial-gradient(circle at 8% 82%,rgba(213,203,235,.46) 0,rgba(213,203,235,0) 34%),
    linear-gradient(165deg,#FAF8FD 0%,#F0EBF8 100%);
  padding:calc(env(safe-area-inset-top,0px) + 12px) 18px calc(env(safe-area-inset-bottom,0px) + 18px)}
#callscr.on{display:flex;flex-direction:column}
#callscr .call-head{height:42px;display:grid;grid-template-columns:42px 1fr 42px;align-items:center}
#callscr .call-head button{width:38px;height:38px;border:0;border-radius:50%;background:rgba(255,255,255,.62);
  color:var(--ink);font-size:20px;box-shadow:0 1px 0 rgba(255,255,255,.9) inset;cursor:pointer}
#callscr .call-timer{font-size:12px;color:var(--ink-soft);letter-spacing:.08em;text-align:center}
#callscr .call-stage{width:calc(100vw - 36px);max-width:420px;min-width:0;margin:auto;display:flex;min-height:0;flex:1;flex-direction:column;
  align-items:center;padding:10px 0 2px}
#callscr .call-avatar-wrap{position:relative;margin-top:2vh;width:112px;height:112px}
#callscr .call-avatar-wrap::before,#callscr .call-avatar-wrap::after{content:"";position:absolute;border-radius:50%;inset:-9px;
  border:1px solid rgba(156,145,196,.14);transition:.3s ease}
#callscr .call-avatar-wrap::after{inset:-18px;border-color:rgba(156,145,196,.08)}
#callscr[data-state="listening"] .call-avatar-wrap::before{animation:callListen 2.4s ease-in-out infinite}
#callscr[data-state="thinking"] .call-avatar-wrap::before,#callscr[data-state="speaking"] .call-avatar-wrap::before{
  animation:callRing 1.55s ease-in-out infinite;border-color:rgba(156,145,196,.34)}
#callscr .call-avatar{position:relative;z-index:1;width:112px;height:112px;border-radius:50%;background:var(--accent);
  display:flex;align-items:center;justify-content:center;font-size:36px;color:#fff;background-size:cover;
  background-position:center;box-shadow:0 16px 38px rgba(111,98,145,.18),0 0 0 5px rgba(255,255,255,.68)}
@keyframes callListen{0%,100%{transform:scale(.98);opacity:.35}50%{transform:scale(1.08);opacity:.9}}
@keyframes callRing{0%,100%{transform:scale(.98);opacity:.45}50%{transform:scale(1.12);opacity:1}}
#callscr .call-kicker{margin-top:21px;font-size:11px;letter-spacing:.18em;color:var(--ink-soft)}
#callscr .call-name{margin-top:4px;font-size:24px;font-weight:650;letter-spacing:.04em}
#callscr .call-status{display:inline-flex;align-items:center;gap:7px;margin-top:8px;min-height:28px;padding:5px 11px;
  border-radius:999px;background:rgba(255,255,255,.58);font-size:12px;color:var(--ink-soft)}
#callscr .call-status-dot{width:6px;height:6px;border-radius:50%;background:var(--accent-deep);box-shadow:0 0 0 3px rgba(156,145,196,.12)}
#callscr[data-state="muted"] .call-status-dot,#callscr[data-state="error"] .call-status-dot{background:var(--danger)}
#callscr .call-live{width:100%;min-width:0;max-width:100%;margin-top:22px;min-height:88px;padding:15px 17px;border:1px solid rgba(255,255,255,.78);
  border-radius:22px;background:rgba(255,255,255,.48);box-shadow:0 14px 38px rgba(88,76,117,.06);text-align:left}
#callscr .call-live-label{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:var(--ink-soft);letter-spacing:.06em}
#callscr .call-live-text{margin-top:8px;font-size:16px;line-height:1.65;color:var(--ink);word-break:break-word}
#callscr .call-live-text.empty{color:var(--ink-soft)}
#callscr .call-live-text.interim::after{content:"";display:inline-block;width:2px;height:1em;margin-left:3px;
  vertical-align:-2px;background:var(--accent-deep);animation:callCursor 1s steps(1) infinite}
@keyframes callCursor{50%{opacity:0}}
#callscr .call-quote{width:100%;min-height:48px;margin-top:12px;padding:0 6px;font-size:14px;line-height:1.65;
  text-align:center;color:var(--accent-deep);display:flex;align-items:center;justify-content:center}
#callscr .call-quote:empty::before{content:"克克会等你把话说完";color:var(--ink-soft)}
#callscr .call-transcript-sheet{width:100%;margin-top:4px;text-align:left;font-size:12px;color:var(--ink-soft)}
#callscr .call-transcript-sheet summary{list-style:none;text-align:center;cursor:pointer;padding:6px}
#callscr .call-transcript-sheet summary::-webkit-details-marker{display:none}
#call-transcript{width:100%;max-height:112px;overflow-y:auto;display:flex;flex-direction:column;gap:6px;
  padding:8px 2px;font-size:12px;-webkit-overflow-scrolling:touch}
#call-transcript .log-row{display:flex}
#call-transcript .log-row.her{justify-content:flex-end}
#call-transcript .log-row.him{justify-content:flex-start}
#call-transcript .bub{max-width:84%;padding:6px 10px;border-radius:12px;line-height:1.5;text-align:left;
  word-break:break-word;background:rgba(255,255,255,.42);color:var(--ink)}
#call-transcript .log-row.her .bub{background:rgba(239,235,247,.9)}
#callscr .call-bottom{width:calc(100vw - 36px);max-width:420px;min-width:0;margin:10px auto 0}
#callscr .call-pace{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;border-radius:15px;
  background:rgba(255,255,255,.48);box-shadow:0 1px 0 rgba(255,255,255,.8) inset}
#callscr .call-pace button{border:0;border-radius:12px;padding:9px 8px;background:transparent;color:var(--ink-soft);
  font-size:12px;cursor:pointer;transition:.2s ease}
#callscr .call-pace button.on{background:#fff;color:var(--ink);box-shadow:0 3px 12px rgba(84,71,114,.08)}
#callscr .call-pace button small{display:block;margin-top:2px;font-size:9px;opacity:.72}
#callscr .call-ctrls{display:grid;grid-template-columns:1fr 1fr 1fr;align-items:end;margin-top:15px;padding:0 18px}
#callscr .call-action{border:0;background:transparent;color:var(--ink-soft);font-size:11px;display:flex;flex-direction:column;
  align-items:center;gap:6px;cursor:pointer}
#callscr .call-action .call-action-ico{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;
  background:rgba(255,255,255,.7);color:var(--ink);font-size:20px;box-shadow:0 7px 20px rgba(85,72,114,.08)}
#callscr .call-action .call-action-ico svg{width:21px;height:21px;display:block}
#callscr .call-action .call-action-ico .text-ico{display:none}
#callscr #call-mode.text-mode .voice-ico{display:none}
#callscr #call-mode.text-mode .text-ico{display:block}
#callscr .call-action.muted .call-action-ico{background:var(--ink);color:#fff}
#callscr #call-hangup .call-action-ico{width:60px;height:60px;background:var(--danger);color:#fff;font-size:22px}
#callscr .call-secondary{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:12px;min-height:34px}
#callscr .call-secondary button{border:0;border-radius:999px;padding:8px 12px;background:transparent;color:var(--ink-soft);
  font-size:11px;cursor:pointer}
#call-ptt.rec{background:var(--danger)!important;color:#fff!important}
#call-reply-now{display:none;background:rgba(255,255,255,.7)!important;color:var(--accent-deep)!important}
#call-reply-now.on{display:block}
#call-interrupt{display:none;background:rgba(255,255,255,.7)!important;color:var(--accent-deep)!important}
#callscr[data-state="speaking"] #call-interrupt{display:block}
/* 最小化后悬浮小条：任何页面可见，点它回到通话 */
#call-pill{position:fixed;top:calc(env(safe-area-inset-top,0px) + 8px);left:50%;transform:translateX(-50%);
  z-index:58;display:none;align-items:center;gap:6px;background:var(--accent-soft,#EFEBF7);
  color:var(--accent-deep,#5b5470);font-size:12.5px;font-weight:600;padding:7px 14px;border-radius:999px;
  box-shadow:var(--shadow,0 4px 16px rgba(0,0,0,.12));cursor:pointer;white-space:nowrap}
#call-pill.on{display:flex}
@media (max-height:680px){
  #callscr .call-stage{padding-top:0}
  #callscr .call-avatar-wrap,#callscr .call-avatar{width:82px;height:82px}
  #callscr .call-avatar-wrap{margin-top:0}
  #callscr .call-kicker{margin-top:14px}
  #callscr .call-live{margin-top:12px;min-height:70px;padding:11px 14px}
  #callscr .call-quote{min-height:36px;margin-top:6px}
  #callscr .call-transcript-sheet{display:none}
  #callscr .call-ctrls{margin-top:10px}
  #callscr .call-action .call-action-ico{width:46px;height:46px}
  #callscr #call-hangup .call-action-ico{width:52px;height:52px}
  #callscr .call-secondary{margin-top:7px}
}

/* ============================================================
   V2 product shell — layout and interaction only.
   Keep the existing fog-lilac skin; later visual work can tune these tokens
   without touching viewport, navigation, or composer behaviour.
   ============================================================ */
:root {
  --app-viewport-height: 100dvh;
  --touch-target: 44px;
  --shell-gap: 8px;
  --composer-bottom: 8px;
  --composer-stack-height: 70px;
  --app-viewport-offset-top: 0px;
}

html, body { overflow: hidden; }
body { min-height: 100%; }
#app {
  position: fixed;
  top: var(--app-viewport-offset-top, 0px);
  right: 0;
  left: 0;
  height: var(--app-viewport-height, 100dvh);
  min-height: 0;
  max-height: var(--app-viewport-height, 100dvh);
  overflow: hidden;
}
#app.on { display: flex; }
.page { min-height: 0; overscroll-behavior: contain; }
#page-chat { min-height: 0; position: relative; }
#msgs { min-height: 0; overscroll-behavior: contain; }

/* Top bar: navigation, person, actions.  The model label stays in the DOM
   for settings compatibility but is deliberately not a daily-chat control. */
#topbar {
  min-height: calc(var(--touch-target) + var(--sat) + 8px);
  padding: calc(var(--sat) + 8px) 12px 8px;
  gap: var(--shell-gap);
}
#topbar .tb-action {
  width: var(--touch-target);
  height: var(--touch-target);
  min-width: var(--touch-target);
  min-height: var(--touch-target);
}
#topbar .title-wrap {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  color: inherit;
}
#topbar .tb-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#topbar .title { font-size: 16px; line-height: 1.2; }
#topbar .sub { min-height: 15px; line-height: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topbar .tb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 15px;
  box-shadow: var(--shadow);
  background-size: cover;
  background-position: center;
}
#topbar .tb-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
#topbar .tb-model { display: none; }
#topbar #btn-new { display: none !important; }

/* Composer is a bounded input surface; only its message list scrolls. */
#inputbar {
  flex: 0 0 auto;
  min-height: 48px;
  margin: 5px 12px var(--composer-bottom);
  padding: 4px;
  gap: 2px;
}
#inputbar textarea { min-height: 40px; max-height: 132px; padding: 10px 8px; }
#inputbar button {
  width: var(--touch-target);
  height: var(--touch-target);
  min-width: var(--touch-target);
  min-height: var(--touch-target);
}
#inputbar #send { display: none; }
body.composer-ready #inputbar #send { display: flex; }
body.composer-ready #inputbar #mic { display: none; }
#inputbar #attach-btn { font-size: 16px; }
#attach-preview { flex: 0 0 auto; gap: 6px; padding: 0 16px 4px; max-height: 64px; }
.attach-thumb { width: 48px; height: 48px; border-radius: 10px; }
.attach-thumb .rm { width: 20px; height: 20px; }

/* Keyboard uses the visual viewport rather than viewport units alone. */
.keyboard-open { --composer-bottom: 6px; }
.keyboard-open #tabbar { display: none; }
.keyboard-open #inputbar { margin-bottom: var(--composer-bottom); }

/* Preserve reading position until the user asks to return to the latest turn. */
#new-messages {
  position: absolute;
  right: 16px;
  bottom: calc(var(--composer-stack-height, 70px) + 8px);
  z-index: 3;
  display: none;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(156,145,196,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: var(--accent-deep);
  box-shadow: 0 8px 22px rgba(72,61,98,.14);
  font: inherit;
  font-size: 13px;
}
#new-messages.on { display: inline-flex; align-items: center; gap: 5px; }

.delivery-state {
  display: block;
  width: auto;
  min-height: 18px;
  margin-top: 4px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 10px;
  line-height: 16px;
  text-align: right;
}
.bubble-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
  max-width: min(84%, 560px);
}
.bubble-stack > .bubble { max-width: 100%; }
.delivery-state:disabled { opacity: .8; }
[data-delivery="failed"] .delivery-state { color: var(--danger); text-decoration: underline; }
[data-delivery="confirming"] .delivery-state { color: var(--ink-soft); }
.sys.call-marker span { color: var(--accent-deep); background: var(--accent-soft); }

/* Three daily destinations.  The technical room remains a drawer-only page. */
#tabbar { flex: 0 0 auto; min-height: calc(56px + var(--sab)); padding: 5px 10px calc(var(--sab) + 5px); }
#tabbar .tab { min-height: 46px; padding: 7px 0 5px; }
.sess-advanced {
  border: 0;
  border-top: 1px solid var(--accent-soft);
  background: transparent;
  color: var(--ink-soft);
  padding: 12px 8px 4px;
  text-align: left;
  font: inherit;
  font-size: 12px;
}

button:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

@media (max-width: 340px) {
  #topbar { padding-left: 8px; padding-right: 8px; gap: 4px; }
  #topbar .tb-action { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
  #topbar .tb-avatar { width: 30px; height: 30px; flex-basis: 30px; }
  #topbar .sub { max-width: 116px; }
  #inputbar { margin-left: 8px; margin-right: 8px; }
  #inputbar button { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* ============================================================
   V2 final visual pass — 克克的家
   只收口颜色、层级、间距和响应式表现；行为与旧选择器保留。
   ============================================================ */
:root {
  --bg: #F8F6FB;
  --accent: #B8A9D0;
  --accent-soft: #EAE4F4;
  --accent-deep: #806BA4;
  --her-bubble: #EAE4F4;
  --his-bubble: #FFFEFF;
  --ink: #373441;
  --ink-soft: #777284;
  --card: #FFFEFF;
  --danger: #B9727C;
  --shadow: 0 1px 2px rgba(55, 52, 65, .06);
  --v2-line: rgba(91, 76, 117, .12);
  --v2-surface: rgba(255, 254, 255, .96);
}

html, body {
  background: var(--bg);
  color: var(--ink);
}

/* The chat page is the only message scroller. */
#app { background: var(--bg); }
#page-chat { overflow: hidden; }
#page-chat.on { display: flex; }
#msgs {
  padding: 16px 12px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 107, 164, .22) transparent;
}
#msgs::-webkit-scrollbar { width: 5px; }
#msgs::-webkit-scrollbar-thumb { background: rgba(128, 107, 164, .22); border-radius: 999px; }

/* A quiet pixel trace keeps the room personal without turning it into a game UI. */
#page-chat::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .18;
  background-image:
    linear-gradient(90deg, rgba(128, 107, 164, .08) 1px, transparent 1px),
    linear-gradient(rgba(128, 107, 164, .08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .45), transparent 58%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .45), transparent 58%);
}
#page-chat > * { position: relative; z-index: 1; }

/* Top bar: one identity, two quiet actions. */
#topbar {
  flex: 0 0 auto;
  min-height: calc(60px + var(--sat));
  padding: calc(var(--sat) + 8px) 12px 8px;
  gap: 4px;
  background: rgba(255, 254, 255, .78);
  border-bottom: 1px solid var(--v2-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#topbar > #btn-sessions,
#topbar .tb-actions .tb-action {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  box-shadow: none;
}
#topbar > #btn-sessions:hover,
#topbar .tb-actions .tb-action:hover,
#topbar > #btn-sessions:active,
#topbar .tb-actions .tb-action:active { background: var(--accent-soft); color: var(--ink); }
#topbar .title-wrap {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  gap: 8px;
  align-items: center;
  border-radius: 14px;
  color: var(--ink);
}
#topbar .title-wrap:hover { background: rgba(234, 228, 244, .42); }
#topbar .tb-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(128, 107, 164, .16);
  background: var(--accent-soft);
  color: var(--accent-deep);
  box-shadow: none;
  font-size: 15px;
  font-weight: 600;
}
#topbar .tb-copy { gap: 1px; }
#topbar .title {
  max-width: 100%;
  color: var(--ink);
  font-size: 16px;
  line-height: 22px;
  font-weight: 650;
}
#topbar .sub {
  max-width: 19ch;
  min-height: 14px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 14px;
}
#topbar > .tb-model,
#topbar > #btn-new { display: none !important; }
#topbar .tb-actions { gap: 2px; flex: 0 0 auto; }
#topbar #btn-call {
  background: var(--accent-soft);
  border-color: rgba(128, 107, 164, .12);
  color: var(--accent-deep);
}
#topbar #btn-call:hover, #topbar #btn-call:active { background: #E1D8EF; }

/* Messages: calm rhythm, readable Chinese line length, directional corners. */
.msg { gap: 7px; margin: 7px 0; align-items: flex-end; }
.msg.cont { margin-top: 3px; }
.avatar { width: 30px; height: 30px; font-size: 13px; box-shadow: none; }
.bubble {
  max-width: min(84%, 560px);
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 17px;
  color: var(--ink);
  font-size: 15.5px;
  line-height: 24px;
  letter-spacing: .005em;
  overflow-wrap: anywhere;
}
.her .bubble {
  background: var(--her-bubble);
  border-color: rgba(128, 107, 164, .06);
  border-bottom-right-radius: 7px;
}
.him .bubble {
  background: var(--his-bubble);
  border-color: var(--v2-line);
  border-bottom-left-radius: 7px;
  box-shadow: 0 2px 8px rgba(55, 52, 65, .035);
}
.sys { margin: 12px 0; }
.sys span {
  display: inline-block;
  max-width: 92%;
  padding: 5px 11px;
  border: 1px solid rgba(128, 107, 164, .09);
  background: rgba(255, 254, 255, .76);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 18px;
}
.sys.call-marker span {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: rgba(128, 107, 164, .12);
}
.typing .bubble { padding: 13px 15px; }

/* The notification sits immediately above the composer, never over a bubble. */
#new-messages {
  right: 16px;
  bottom: calc(var(--composer-stack-height, 70px) + 12px);
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid rgba(128, 107, 164, .16);
  background: rgba(255, 254, 255, .97);
  color: var(--accent-deep);
  box-shadow: 0 5px 16px rgba(55, 52, 65, .09);
  font-size: 13px;
  line-height: 20px;
}
#new-messages:hover { background: #FFFFFF; }

/* Composer: near-white, bounded to the existing JS height calculation. */
#attach-preview {
  gap: 7px;
  padding: 0 16px 5px;
  max-height: 64px;
}
.attach-thumb { width: 50px; height: 50px; border-radius: 11px; box-shadow: none; }
.attach-thumb .rm { width: 24px; height: 24px; top: -5px; right: -5px; box-shadow: 0 1px 3px rgba(55, 52, 65, .14); }
#inputbar {
  min-height: 54px;
  /* Bottom nav owns the home-indicator inset; avoid charging it twice. */
  margin: 6px 12px 8px;
  padding: 5px;
  gap: 2px;
  border: 1px solid var(--v2-line);
  border-radius: 27px;
  background: var(--v2-surface);
  box-shadow: 0 -2px 14px rgba(55, 52, 65, .035), 0 3px 12px rgba(55, 52, 65, .035);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#inputbar textarea {
  min-height: 42px;
  max-height: 120px;
  padding: 8px 8px;
  color: var(--ink);
  font-size: 16px;
  line-height: 23px;
}
#inputbar textarea::placeholder { color: var(--ink-soft); opacity: .78; }
#inputbar button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  box-shadow: none;
}
#inputbar #attach-btn {
  position: relative;
  overflow: hidden;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0;
}
/* CSS-only paperclip keeps the existing button and its accessible label. */
#inputbar #attach-btn::before {
  content: "";
  width: 14px;
  height: 20px;
  border: 1.7px solid currentColor;
  border-top-color: transparent;
  border-radius: 8px;
  transform: rotate(-42deg);
}
#inputbar #attach-btn::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 14px;
  border: 1.7px solid currentColor;
  border-top-color: transparent;
  border-radius: 6px;
  transform: rotate(-42deg) translate(1px, -1px);
}
#inputbar #mic { background: transparent; color: var(--ink-soft); }
#inputbar #mic:hover, #inputbar #mic:active { background: var(--accent-soft); color: var(--accent-deep); }
#inputbar #mic.recording { background: var(--danger); color: #fff; }
#inputbar #mic.busy { background: var(--accent-deep); color: #fff; }
#inputbar #send { background: var(--accent-deep); color: #fff; font-size: 22px; font-weight: 400; }
#inputbar #send:hover, #inputbar #send:active { background: #6F5B91; }

/* Drawer: a quiet side cabinet for the rest of the home. */
#sess-mask {
  background: rgba(55, 52, 65, .2);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
#sess-drawer {
  width: min(88%, 320px);
  padding: calc(var(--sat) + 12px) 14px calc(var(--sab) + 14px);
  gap: 8px;
  background: #FCFBFE;
  box-shadow: 8px 0 28px rgba(55, 52, 65, .1);
}
.sess-head { min-height: 44px; gap: 10px; }
.sess-head span { font-size: 17px; line-height: 22px; }
.sess-head span small { color: var(--ink-soft); font-size: 11px; line-height: 16px; }
.sess-head button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--v2-line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
}
#sess-newbtn {
  min-height: 46px;
  border: 1px solid rgba(128, 107, 164, .1);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 14px;
  text-align: left;
  padding: 10px 13px;
}
#sess-newbtn:hover, #sess-newbtn:active { background: #E1D8EF; }
.sess-search {
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--v2-line);
  border-radius: 14px;
  background: var(--bg);
}
.sess-search input { font-size: 15px; }
.sess-search:focus-within { border-color: var(--accent-deep); box-shadow: 0 0 0 3px rgba(128, 107, 164, .12); }
.sess-search input:focus-visible { outline: 0; }
#sess-list { gap: 2px; }
.sess-group { padding: 14px 8px 5px; color: var(--ink-soft); font-size: 11px; letter-spacing: .04em; }
.sess-item {
  min-height: 52px;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
}
.sess-item:hover { background: rgba(234, 228, 244, .48); }
.sess-item.on {
  background: var(--accent-soft);
  border-color: rgba(128, 107, 164, .08);
  box-shadow: inset 2px 0 var(--accent-deep);
}
.sess-title { font-size: 14px; line-height: 20px; }
.sess-time { color: var(--ink-soft); font-size: 11px; line-height: 16px; }
.sess-rename { min-width: 36px; min-height: 36px; padding: 6px; border-radius: 10px; }
.sess-rename:hover, .sess-rename:active { background: var(--accent-soft); color: var(--accent-deep); }
.sess-life {
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--v2-line);
}
.sess-life button {
  min-height: 44px;
  padding: 8px 9px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 13px;
}
.sess-life button:hover, .sess-life button:active { background: var(--accent-soft); color: var(--accent-deep); }
.sess-advanced {
  min-height: 44px;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--v2-line);
  color: var(--ink-soft);
  font-size: 12px;
}
.sess-advanced:hover, .sess-advanced:active { color: var(--ink); }

/* Three quiet daily destinations. */
#tabbar {
  min-height: calc(64px + var(--sab));
  padding: 6px 10px calc(var(--sab) + 6px);
  gap: 4px;
  border-top: 1px solid var(--v2-line);
  background: rgba(255, 254, 255, .94);
  box-shadow: 0 -2px 12px rgba(55, 52, 65, .025);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#tabbar .tab {
  min-height: 46px;
  padding: 6px 0 5px;
  border-radius: 15px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 16px;
}
#tabbar .tab .ico { width: 21px; height: 21px; margin-bottom: 2px; }
#tabbar .tab.on { background: var(--accent-soft); color: #6C568E; font-weight: 600; }
#tabbar .tab:hover { background: rgba(234, 228, 244, .55); }
#tabbar .tab.on:hover { background: var(--accent-soft); }

/* Call is a calm extension of chat, not a translucent dashboard. */
#callscr {
  background: var(--bg);
  padding: calc(var(--sat) + 8px) 16px calc(var(--sab) + 16px);
}
#callscr .call-head {
  height: 44px;
  grid-template-columns: 44px 1fr 44px;
}
#callscr .call-head button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--v2-line);
  background: rgba(255, 254, 255, .8);
  color: var(--ink-soft);
  box-shadow: none;
}
#callscr .call-stage { width: min(100%, 420px); padding: 12px 0 2px; }
#callscr .call-avatar-wrap { width: 100px; height: 100px; margin-top: 3vh; }
#callscr .call-avatar-wrap::before { inset: -8px; border-color: rgba(128, 107, 164, .14); }
#callscr .call-avatar-wrap::after { inset: -16px; border-color: rgba(128, 107, 164, .07); }
#callscr .call-avatar {
  width: 100px;
  height: 100px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid rgba(128, 107, 164, .12);
  box-shadow: 0 0 0 5px rgba(255, 254, 255, .7);
  font-size: 32px;
}
#callscr .call-kicker { margin-top: 18px; color: var(--ink-soft); font-size: 10px; letter-spacing: .16em; }
#callscr .call-name { margin-top: 3px; color: var(--ink); font-size: 23px; }
#callscr .call-status {
  min-height: 30px;
  margin-top: 7px;
  padding: 5px 10px;
  border: 1px solid var(--v2-line);
  background: rgba(255, 254, 255, .72);
  color: var(--ink-soft);
}
#callscr .call-live {
  min-height: 88px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--v2-line);
  border-radius: 18px;
  background: rgba(255, 254, 255, .9);
  box-shadow: 0 4px 14px rgba(55, 52, 65, .04);
}
#callscr .call-live-label { color: var(--ink-soft); letter-spacing: .04em; }
#callscr .call-live-text { color: var(--ink); font-size: 16px; line-height: 25px; }
#callscr .call-quote { color: var(--accent-deep); }
#callscr .call-transcript-sheet { color: var(--ink-soft); }
#callscr .call-bottom { width: min(100%, 420px); margin-top: 10px; }
#callscr .call-pace {
  padding: 3px;
  border: 1px solid var(--v2-line);
  border-radius: 14px;
  background: rgba(255, 254, 255, .7);
  box-shadow: none;
}
#callscr .call-pace button { min-height: 44px; border-radius: 11px; color: var(--ink-soft); }
#callscr .call-pace button.on { background: #FFFEFF; color: var(--ink); box-shadow: 0 2px 8px rgba(55, 52, 65, .06); }
#callscr .call-ctrls { margin-top: 14px; padding: 0 12px; }
#callscr .call-action { min-height: 74px; color: var(--ink-soft); }
#callscr .call-action .call-action-ico {
  width: 52px;
  height: 52px;
  background: rgba(255, 254, 255, .9);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(55, 52, 65, .06);
}
#callscr #call-hangup .call-action-ico { width: 56px; height: 56px; background: var(--danger); box-shadow: none; }
#callscr .call-secondary { gap: 8px; margin-top: 8px; }
#callscr .call-secondary button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--v2-line);
  background: rgba(255, 254, 255, .64);
  color: var(--ink-soft);
}
#callscr .call-secondary button:hover, #callscr .call-secondary button:active { color: var(--accent-deep); background: var(--accent-soft); }

/* Minimized call state lives below the top bar, so it never covers identity. */
#call-pill {
  top: calc(var(--sat) + 64px);
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 7px 13px;
  border: 1px solid rgba(128, 107, 164, .13);
  background: rgba(234, 228, 244, .97);
  color: var(--accent-deep);
  box-shadow: 0 4px 12px rgba(55, 52, 65, .06);
  font-size: 12px;
}
#call-pill:hover, #call-pill:focus-visible { background: #E1D8EF; }

/* Soften life pages without removing their existing content or controls. */
.pagepad { padding: 10px 0 22px; }
.pagepad > .card {
  margin: 9px 12px;
  padding: 16px;
  border: 1px solid var(--v2-line);
  border-radius: 17px;
  background: rgba(255, 254, 255, .78);
  box-shadow: none;
}
.row2 { gap: 8px; margin: 9px 12px; }
.row2 .card { margin: 0; }
.card .c-h { color: var(--ink-soft); letter-spacing: .04em; }

@media (max-width: 340px) {
  #topbar { padding-left: 8px; padding-right: 8px; gap: 2px; }
  #topbar > #btn-sessions,
  #topbar .tb-actions .tb-action {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex-basis: 44px;
  }
  #topbar .title-wrap { gap: 6px; }
  #topbar .tb-avatar { width: 30px; height: 30px; flex-basis: 30px; }
  #topbar .sub { display: none; }
  #inputbar { margin-left: 8px; margin-right: 8px; }
  #inputbar button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .bubble { max-width: 82%; }
  .bubble-stack { max-width: 82%; }
  #new-messages { right: 12px; }
}

@media (min-width: 400px) {
  #topbar { padding-left: 16px; padding-right: 16px; }
  #msgs { padding-left: 16px; padding-right: 16px; }
  #inputbar { margin-left: 16px; margin-right: 16px; }
}

@media (max-height: 680px) {
  #callscr .call-stage { padding-top: 4px; }
  #callscr .call-avatar-wrap,
  #callscr .call-avatar { width: 82px; height: 82px; }
  #callscr .call-avatar { font-size: 28px; }
  #callscr .call-avatar-wrap { margin-top: 0; }
  #callscr .call-kicker { margin-top: 14px; }
  #callscr .call-live { margin-top: 12px; min-height: 70px; padding: 11px 14px; }
  #callscr .call-quote { min-height: 36px; margin-top: 6px; }
  #callscr .call-transcript-sheet { display: none; }
  #callscr .call-ctrls { margin-top: 10px; }
  #callscr .call-action .call-action-ico { width: 46px; height: 46px; }
  #callscr #call-hangup .call-action-ico { width: 52px; height: 52px; }
  #callscr .call-secondary { margin-top: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  #page-chat::before { opacity: .1; }
  #callscr .call-avatar-wrap::before,
  #callscr .call-avatar-wrap::after,
  #inputbar #mic.recording,
  .stdot.on { animation: none !important; }
}
