:root {
  --dock-extra: 120px;
}

body[data-theme="light"] {
  --bg: #f3c2d4;
  --bg2: #f7d5e2;
  --glass: rgba(255, 248, 252, 0.34);
  --glass-strong: rgba(255, 255, 255, 0.58);
  --line: rgba(255, 255, 255, 0.45);
  --text: #4a2340;
  --muted: #b06b88;
  --accent: #e25a8c;
  --user: rgba(232, 120, 158, 0.32);
  --bot: rgba(255, 248, 252, 0.36);
  --bubble-bot: radial-gradient(ellipse at 50% 45%, rgba(255, 248, 252, 0.04) 0%, rgba(255, 240, 246, 0.16) 48%, rgba(255, 232, 240, 0.7) 100%);
  --bubble-user: radial-gradient(ellipse at 50% 45%, rgba(232, 120, 158, 0.04) 0%, rgba(232, 120, 158, 0.16) 48%, rgba(232, 120, 158, 0.58) 100%);
  --bubble-stroke: rgba(255, 255, 255, 0.55);
  --bubble-shine: rgba(255, 255, 255, 0.92);
  --bubble-shine-soft: rgba(255, 255, 255, 0.38);
  --shadow: 0 10px 28px rgba(180, 70, 110, 0.1);
}

body[data-theme="dark"] {
  --bg: #0e0a0c;
  --bg2: #161014;
  --glass: rgba(16, 10, 13, 0.42);
  --glass-strong: rgba(24, 14, 18, 0.62);
  --line: rgba(255, 176, 198, 0.22);
  --text: #f6dce6;
  --muted: #c48aa0;
  --accent: #f08ab0;
  --user: rgba(196, 72, 118, 0.36);
  --bot: rgba(22, 12, 16, 0.4);
  --bubble-bot: radial-gradient(ellipse at 50% 45%, rgba(28, 14, 20, 0.04) 0%, rgba(26, 12, 18, 0.18) 48%, rgba(22, 10, 14, 0.72) 100%);
  --bubble-user: radial-gradient(ellipse at 50% 45%, rgba(196, 72, 118, 0.05) 0%, rgba(160, 48, 88, 0.18) 48%, rgba(32, 12, 20, 0.68) 100%);
  --bubble-stroke: rgba(255, 176, 198, 0.32);
  --bubble-shine: rgba(255, 214, 226, 0.78);
  --bubble-shine-soft: rgba(255, 176, 198, 0.22);
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: Outfit, "PingFang SC", "Noto Sans SC", sans-serif;
  background: #f7dce6;
  color: var(--text);
}
.bg-art {
  position: fixed;
  inset: -12%;
  z-index: 0;
  pointer-events: none;
  background-color: #fff6fa;
  background-image: url("/static/bg-y2k-light.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  filter: blur(2px);
  transform: scale(1.12);
  transform-origin: center;
  will-change: transform;
}
body[data-theme="dark"] {
  background: #0e0a0c;
}
body[data-theme="dark"] .bg-art {
  background-color: #0e0a0c;
  background-image: url("/static/bg-y2k.jpg");
  filter: blur(2px) brightness(0.4) saturate(0.85);
}

.haptic-switch {
  position: fixed;
  left: -48px;
  top: -48px;
  width: 28px;
  height: 28px;
  opacity: 0;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: var(--glass-strong);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.topbar .icon-btn {
  color: var(--accent);
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.topbar .icon-btn.on {
  background: var(--accent);
  color: #fff;
}
.topbar .ico { width: 18px; height: 18px; }

.app {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  padding-top: 42px;
}

.sidebar {
  position: relative;
  width: 280px;
  flex: none;
  background: var(--glass);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.extra-dock {
  position: relative;
  flex: 0 0 auto;
  min-height: 200px;
  max-height: 42%;
  padding: 10px 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-mask { display: none; }

.extra-slots {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.listen-mini {
  flex: none;
  margin-top: auto;
}

.sidebar-close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.extra-btn {
  display: flex;
  align-items: center;
  gap: 0.75em;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 36px 8px 6px;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}
.extra-btn .ico {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--accent);
}
.extra-btn-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.extra-btn-copy small {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.presence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  margin-left: auto;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: presence-pulse 2.4s ease-out infinite;
}
@keyframes presence-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.extra-btn:hover { background: var(--glass-strong); }
.extra-btn.active { color: var(--accent); }

.extra-sub {
  display: flex;
  flex-direction: column;
  padding: 0 0 4px 28px;
  gap: 2px;
}
.extra-sub-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 14px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.extra-sub-btn:hover { background: var(--glass-strong); color: var(--text); }
.extra-sub-btn.on { color: var(--accent); }

.listen-view {
  max-width: 400px;
  margin: 0 auto;
  padding: 0 14px 16px;
}
.listen-view.hidden { display: none; }
.listen-screen {
  z-index: 34;
}
.listen-screen .screen-head {
  padding: 8px 14px 4px;
}
.listen-screen .screen-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lt-lyric-opt {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin: 4px 2px 10px;
  padding: 0;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}
.lt-lyric-opt input,
.lt-lyric-opt input[type="checkbox"],
.row-check input,
.row-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 16px;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  background: var(--glass-strong);
  accent-color: var(--accent);
  cursor: pointer;
}
.lt-lyric-opt input[type="checkbox"]:checked,
.row-check input[type="checkbox"]:checked {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.4 8.2l3 3 6.2-6.4'/%3E%3C/svg%3E") center/12px 12px no-repeat;
  border-color: var(--accent);
}

.lyric-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  background: var(--glass-strong);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.lyric-bar.hidden { display: none; }
.lyric-bar-text {
  flex: 1;
  min-width: 0;
  text-align: center;
  color: var(--accent);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-hero { text-align: center; padding: 2px 4px 8px; }
.lt-title {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-size: 26px;
  font-weight: 400;
  color: var(--accent);
}
.lt-sub { margin: 0; color: var(--muted); font-size: 11px; }
.lt-card {
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 8px 10px;
  margin-bottom: 8px;
}
.lt-now { display: flex; gap: 10px; align-items: center; }
.lt-cover {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex: none;
  background: #efc2d2 center/cover no-repeat;
}
.lt-meta { flex: 1; min-width: 0; }
.lt-song {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-artist {
  color: var(--muted);
  font-size: 11px;
  margin: 1px 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-progress { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.lt-progress .seek { flex: 1; }
.seek {
  --seek: 0%;
  height: 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.seek-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(226, 90, 140, 0.22);
}
.seek-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--seek);
  border-radius: inherit;
  background: var(--accent);
  pointer-events: none;
}
.seek-thumb {
  position: absolute;
  top: 50%;
  left: var(--seek);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(180, 70, 110, 0.28);
  pointer-events: none;
}
.lt-seek-main {
  width: 100%;
  padding: 2px 4px 0;
}
.lt-pill {
  width: fit-content;
  margin: 0 auto 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 11px;
}
.lt-lyrics {
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  margin-bottom: 8px;
  height: 132px;
  overflow-y: auto;
  text-align: center;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.lt-lyric-line {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  padding: 1px 6px;
  transition: color .25s ease, font-size .25s ease, transform .25s ease;
}
.lt-lyric-line.on {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  transform: scale(1.02);
}
.lt-lyric-empty { color: var(--muted); padding: 16px 0; font-size: 12px; }
.lt-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.lt-ico {
  border: 0;
  background: transparent;
  color: var(--accent);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.lt-ico .ico { width: 16px; height: 16px; }
.lt-play {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(226, 90, 140, 0.35);
}
.lt-play .ico { width: 16px; height: 16px; fill: #fff; stroke: none; }
.lt-vol {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 96px;
  flex: 1;
}
.lt-vol .ico {
  width: 14px;
  height: 14px;
  flex: none;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vol-seek { flex: 1; min-width: 56px; }
.lt-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.lt-who { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.lt-ava { width: 28px; height: 28px; }
.lt-session-ops { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.lt-ghost, .lt-leave {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
}
.lt-ghost { background: var(--glass); color: var(--text); }
.lt-leave { background: var(--accent); color: #fff; }
.lt-sheet {
  max-height: 140px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--glass-strong);
  margin-top: 4px;
}
.lt-ico.on { color: #ff6b9a; }

.listen-mini-title {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listen-mini-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.mini-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 99px;
  overflow: hidden;
}
.mini-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.mini-time { font-size: 11px; color: var(--muted); width: 34px; }

.conv:hover { background: var(--glass-strong); }

.conv-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 14px 8px 70px;
}

.sidebar-fabs {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.fab {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--accent);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(12px);
}
.fab .ico { width: 22px; height: 22px; }

.conv {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px;
  border-radius: 12px;
  cursor: pointer;
}
.conv.active { background: var(--glass-strong); }
.conv-title {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.conv-ops { display: none; gap: 4px; flex: none; }
.conv:hover .conv-ops, .conv.active .conv-ops { display: flex; }

.tiny {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.brand {
  margin: 0;
  flex: 1;
  text-align: center;
  font-family: "Great Vibes", cursive;
  font-size: 26px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.5px;
  pointer-events: none;
  line-height: 1;
}
.brand span { font-size: 12px; vertical-align: 5px; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; }

.ico {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bunny {
  width: 28px;
  height: 28px;
  display: block;
  overflow: visible;
}
.ico-send { width: 18px; height: 18px; stroke: #fff; }

.listen-panel {
  border-bottom: 1px solid var(--line);
  padding: 12px 18px 14px;
  background: var(--glass);
  backdrop-filter: blur(16px);
}
.listen-panel.hidden { display: none; }
.hidden { display: none !important; }
.listen-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.listen-view label {
  gap: 4px;
  font-size: 11px;
}
.listen-view input,
.listen-view textarea,
.listen-view select {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 13px;
}
.listen-view .lt-vol input[type="range"] {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  width: auto;
}
.listen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}
.span-2 { grid-column: 1 / -1; }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
input, textarea, select {
  width: 100%;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  padding: 8px 12px;
  font: inherit;
}
.file-row { display: flex; gap: 8px; }
.file-row input[type="file"] { flex: 0 0 160px; }
.ne-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.ne-bar span { flex: 1; }
.ne-login {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: var(--glass);
}
.ne-qr {
  width: 220px;
  height: 220px;
  padding: 16px;
  box-sizing: border-box;
  margin: 0 auto 6px;
  background: #fff;
  border-radius: 8px;
  overflow: visible;
}
.ne-qr svg, .ne-qr img {
  width: 100%;
  height: 100%;
  display: block;
}
.import-btn {
  flex: none;
  border: 1px solid var(--line);
  background: var(--user);
  color: var(--text);
  border-radius: 10px;
  padding: 0 10px;
  font-size: 13px;
  cursor: pointer;
}
.track-list {
  max-height: 132px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
}
.track-head {
  padding: 8px 10px 4px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-item:hover { background: var(--glass-strong); }
.track-item.dim { color: var(--muted); }
.now-lyric {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text);
  min-height: 1.4em;
}

.messages {
  flex: 1;
  overflow: auto;
  padding: 8px 0 12px;
}

.day-mark {
  text-align: center;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 1px;
  margin: 6px 0 16px;
}

.msg {
  max-width: 760px;
  margin: 0 auto 16px;
  padding: 0 18px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.msg.user { flex-direction: row-reverse; }
.msg.user.in {
  animation: msg-in 0.32s ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateX(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.typing {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 16px;
  padding: 2px 2px 0;
}
.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: typing 1s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
  40% { transform: translateY(-5px); opacity: 1; }
}
.think-standby {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 8px 2px 2px;
}
.think-load-ico {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 36 14;
  animation: think-spin 0.9s linear infinite;
}
@keyframes think-spin {
  to { transform: rotate(360deg); }
}
.msg-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(560px, calc(100% - 42px));
}
.msg.user .msg-col { align-items: flex-end; }
.think-tag {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 0 6px 5px;
  cursor: pointer;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.think-tag span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.think-tag .think-ico {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.think-tag:hover { color: var(--text); }
.msg-ops {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  padding: 0 4px;
}
.msg-ops button {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 22px;
  height: 22px;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.msg-ops button:hover { color: var(--text); }
.msg-op-ico {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.msg-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: min(280px, 70vw);
}
.msg-edit textarea {
  min-height: 72px;
  max-height: 180px;
  resize: vertical;
  width: 100%;
}
.msg-edit-ops {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.think-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.think-mask.hidden { display: none; }
.think-sheet {
  width: min(720px, 100%);
  height: 60vh;
  background: var(--glass-strong);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: think-up 0.28s ease;
}
@keyframes think-up {
  from { transform: translateY(18%); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.think-sheet-head {
  flex: none;
  padding: 14px 18px 8px;
  font-size: 14px;
  color: var(--text);
}
.think-sheet-body {
  flex: 1;
  overflow: auto;
  padding: 4px 18px 22px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  background: var(--glass-strong) center/cover no-repeat;
  box-shadow: var(--shadow);
}
.msg.assistant .avatar:not([style*="url"]) {
  background-image: none;
  display: grid;
  place-items: center;
}
.msg.assistant .avatar:not([style*="url"])::after {
  content: "✦";
  color: var(--accent);
  font-size: 14px;
}
.bubble {
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 22px;
  padding: 12px 16px;
  width: max-content;
  max-width: 100%;
  color: var(--text);
  border: 0.5px solid var(--bubble-stroke);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 var(--bubble-shine),
    inset 0 -10px 18px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px) saturate(1.45);
  -webkit-backdrop-filter: blur(14px) saturate(1.45);
}
.bubble::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(90% 55% at 16% 0%, var(--bubble-shine) 0%, var(--bubble-shine-soft) 26%, transparent 54%),
    linear-gradient(180deg, var(--bubble-shine-soft) 0%, transparent 38%);
}
.bubble::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 28%;
  top: 2px;
  height: 1.5px;
  border-radius: 99px;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(90deg, transparent, var(--bubble-shine), transparent);
}
.bubble > * { position: relative; z-index: 1; }
.msg.assistant .bubble { background: var(--bubble-bot); }
.msg.user .bubble { background: var(--bubble-user); }
.bubble-main {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.bubble-text {
  flex: 0 1 auto;
  min-width: auto;
}
.when {
  position: static;
  flex: none;
  margin: 0 0 1px 4px;
  padding: 0;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.msg.pending .bubble { color: var(--muted); }
.msg.error .bubble { color: #c44; }
.msg-stickers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.msg.user .msg-stickers { justify-content: flex-end; }
.sticker-shot {
  display: block;
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 10px;
}

.sticker-tray {
  max-width: 804px;
  width: calc(100% - 24px);
  margin: 8px auto 0;
  height: 236px;
  padding: 8px 10px 10px;
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  flex: none;
}
.sticker-tray.hidden { display: none; }
.sticker-tray-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 6px;
  font-size: 13px;
  color: var(--text);
}
.sticker-tray-head .hint {
  flex: 1;
  margin: 0;
  font-size: 11px;
}
.sticker-tray-grid {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px 6px;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}
.sticker-cell {
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.sticker-cell img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--glass);
  border-radius: 8px;
  pointer-events: none;
}
.sticker-cell .note {
  display: none;
  width: 100%;
  font-size: 10px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.sticker-tray.editing .sticker-cell .note { display: block; }
.sticker-add {
  width: 100%;
  aspect-ratio: 1;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  background: var(--glass);
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.sticker-note-preview {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 auto 12px;
  background: var(--glass);
  border-radius: 10px;
}
.upload-btn {
  display: inline-block;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  margin-right: 8px;
}
.profile-row { display: flex; gap: 16px; }
.profile-card {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.avatar-lg {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto 8px;
  background: var(--glass-strong) center/cover no-repeat;
}

.composer-sticker { position: relative; flex: none; }
.composer-sticker.on #btn-sticker-pick { opacity: 1; }

.composer {
  display: flex;
  gap: 8px;
  padding: 8px 14px 8px;
  max-width: 804px;
  width: calc(100% - 24px);
  margin: 0 auto;
  align-items: flex-end;
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.composer textarea {
  resize: none;
  min-height: 40px;
  max-height: 140px;
  border: 0;
  background: transparent;
  padding: 10px 4px;
}
.composer textarea::placeholder { color: var(--muted); }
.composer #btn-send {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  padding: 0;
  cursor: pointer;
  flex: none;
  display: grid;
  place-items: center;
}
.composer #btn-send:disabled { opacity: 0.45; cursor: default; }
.composer #btn-sticker-pick {
  height: 38px;
  width: 38px;
  border: 0;
  background: transparent;
  color: var(--accent);
  display: grid;
  place-items: center;
}

.dock {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 804px;
  width: calc(100% - 24px);
  margin: 10px auto 14px;
  padding: 8px 10px;
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.dock button {
  border: 0;
  background: transparent;
  color: var(--accent);
  opacity: 0.38;
  width: 42px;
  height: 32px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.dock button.on { opacity: 1; }

.icon-btn {
  border: 1px solid var(--line);
  background: var(--glass-strong);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1;
}
.icon-btn:disabled { opacity: 0.4; cursor: default; }

.text-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(80, 20, 40, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal.hidden { display: none; }
.modal-card {
  width: 380px;
  max-width: calc(100vw - 40px);
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}
.modal-card h2 { margin: 0 0 14px; font-size: 16px; }
.modal-card label { margin-bottom: 12px; }
#auth-gate { z-index: 80; background: rgba(80, 20, 40, 0.42); }
.auth-card { width: 340px; }
.auth-card .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
body.locked .app,
body.locked .topbar,
body.locked .dock,
body.locked #profile-page,
body.locked #presence-page {
  visibility: hidden;
}
.hint { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.modal-actions { text-align: right; margin-top: 8px; }
.confirm-card { width: 300px; }
.confirm-card p {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--text);
}
.confirm-card .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.screen {
  position: fixed;
  top: 42px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  overflow: auto;
}
.screen.hidden { pointer-events: none; }
.screen-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 8px;
}
.screen-body {
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 18px 40px;
}
.screen-h { font-size: 14px; margin: 18px 0 8px; }
.row-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}
.presence-body { max-width: 420px; }
.presence-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 10px 8px 16px;
}
.presence-mood {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.presence-status {
  font-size: 14px;
  color: var(--text);
}
.presence-gauges {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 4px;
  text-align: left;
}
.presence-gauge {
  display: grid;
  grid-template-columns: 36px 1fr 28px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}
.presence-gauge b { font-weight: 500; }
.presence-gauge em {
  font-style: normal;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.presence-gauge-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(226, 90, 140, 0.16);
  overflow: hidden;
}
.presence-gauge-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width .35s ease;
}
.presence-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
  padding: 6px 2px 18px;
}
.presence-note {
  min-height: 104px;
  padding: 12px 12px 16px;
  border: 0;
  border-radius: 2px;
  background: #ffe9a8;
  color: #4a3418;
  box-shadow: 1px 3px 0 rgba(80, 40, 10, 0.08), 0 10px 18px rgba(80, 40, 20, 0.1);
  transform: rotate(-1.5deg);
}
.presence-note:nth-child(2n) {
  background: #ffd4e4;
  transform: rotate(1.3deg);
}
.presence-note:nth-child(3n) {
  background: #d7efff;
  transform: rotate(-0.6deg);
}
.presence-note:nth-child(4n) {
  background: #e7f5c4;
  transform: rotate(1.8deg);
}
.presence-note time {
  display: block;
  font-size: 10px;
  opacity: 0.55;
  margin-bottom: 6px;
}
.presence-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.presence-empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 4px;
}
body[data-theme="dark"] .presence-note { filter: saturate(0.86) brightness(0.92); }
.theme-pick { display: flex; gap: 8px; margin-top: 8px; }
.theme-pick .on { border-color: var(--accent); color: var(--accent); }
.memory-list { display: flex; flex-direction: column; gap: 8px; }
.memory-item {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
}
.memory-item .ops { text-align: right; }

@media (min-width: 721px) {
  .app.nav-collapsed .sidebar {
    width: 0;
    border-right: 0;
    overflow: hidden;
  }
}

@media (max-width: 720px) {
  .sidebar {
    position: fixed;
    inset: 42px auto 0 0;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .app.nav-open .sidebar { transform: none; }
  .sidebar-mask {
    position: fixed;
    inset: 42px 0 0 0;
    background: rgba(80, 20, 40, 0.28);
    z-index: 15;
  }
  .app.nav-open .sidebar-mask { display: block; }
  .listen-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .file-row { flex-direction: column; }
  .file-row input[type="file"] { flex: none; }
  .brand { font-size: 24px; }
  .conv-ops { display: flex; }
}
