:root {
  --ink: #1f2a44;
  --ink-soft: #5b6b8c;
  --line: #dfe7f5;
  --pink: #fb7299;
  --blue: #4f8ef7;
  --blue-deep: #2f6bd8;
  --card: rgba(255, 255, 255, 0.92);
  --shadow-lg: 0 24px 60px rgba(31, 42, 68, 0.18);
  --shadow-sm: 0 8px 24px rgba(31, 42, 68, 0.12);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #dde7f3;
}

.hidden { display: none !important; }

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(165deg, #e6eef9 0%, #dbe7f6 42%, #cfdcef 100%);
  transition: background 0.6s ease;
}

.stage.night {
  background: linear-gradient(165deg, #1e2739 0%, #232f47 46%, #1a2334 100%);
  color: #e8eefc;
}

.sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(720px 420px at 82% 12%, rgba(255, 255, 255, 0.75), transparent 70%),
    radial-gradient(520px 320px at 12% 88%, rgba(251, 114, 153, 0.12), transparent 72%),
    radial-gradient(680px 400px at 20% 8%, rgba(79, 142, 247, 0.12), transparent 70%);
  pointer-events: none;
}

.stage.night .sky {
  background:
    radial-gradient(720px 420px at 82% 12%, rgba(120, 160, 255, 0.16), transparent 70%),
    radial-gradient(520px 320px at 12% 88%, rgba(251, 114, 153, 0.10), transparent 72%),
    radial-gradient(680px 400px at 20% 8%, rgba(79, 142, 247, 0.10), transparent 70%);
}

.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
  animation: twinkle 4s ease-in-out infinite;
}

.stage:not(.night) .star { opacity: 0.35; }

@keyframes twinkle {
  0%, 100% { transform: scale(0.6); opacity: 0.25; }
  50% { transform: scale(1.1); opacity: 0.9; }
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(14px, 3vw, 26px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.brand-emoji { font-size: 18px; }
.brand-name { font-weight: 700; letter-spacing: 0.5px; }
.brand-sub { font-size: 11px; color: var(--ink-soft); letter-spacing: 1.5px; text-transform: uppercase; }

.stage.night .brand,
.stage.night .icon-btn { background: rgba(34, 45, 66, 0.82); color: #dfe8fb; }

.top-actions { display: flex; align-items: center; gap: 8px; }

.clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 0 8px;
}

.stage.night .clock { color: #9fb0cf; }

.icon-btn {
  border: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-size: 17px;
  line-height: 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.icon-btn:active { transform: translateY(0); }
.icon-btn.small { width: 32px; height: 32px; font-size: 14px; border-radius: 10px; }
.icon-btn.ghost { background: transparent; box-shadow: none; color: var(--ink-soft); font-size: 13px; width: auto; padding: 0 10px; }

/* ------------------------------------------------------------------ pet */
.desk {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.hint {
  position: absolute;
  left: clamp(14px, 3vw, 26px);
  bottom: clamp(14px, 3vh, 26px);
  z-index: 6;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink-soft);
  font-size: 12px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}

.hint.fade { opacity: 0; transform: translateY(6px); }

.stage.night .hint { background: rgba(34, 45, 66, 0.72); color: #9fb0cf; }

.pet {
  position: absolute;
  right: clamp(10px, 4vw, 56px);
  bottom: clamp(6px, 2vh, 22px);
  --pet-scale: 1;
  width: calc(min(300px, 56vw) * var(--pet-scale));
  display: flex;
  flex-direction: column;
  align-items: center;
  touch-action: none;
  user-select: none;
}

.pet-art {
  position: relative;
  width: 100%;
  cursor: grab;
  animation: pet-bob 4.6s ease-in-out infinite;
  filter: drop-shadow(0 18px 26px rgba(31, 42, 68, 0.22));
}

.pet-art:active { cursor: grabbing; }

.pet-art img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  transition: transform 0.2s ease;
  animation: pet-sway 7s ease-in-out infinite;
}

.pet-art:hover img { transform: scale(1.04); }
.pet.dragging .pet-art { animation: none; }
.pet.dragging .pet-art img { animation: none; }

.pet-shadow {
  width: 64%;
  height: 18px;
  margin-top: -8px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(31, 42, 68, 0.24), transparent 70%);
  filter: blur(4px);
  pointer-events: none;
}

@keyframes pet-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes pet-sway {
  0%, 100% { transform: rotate(-1.4deg); }
  50% { transform: rotate(1.4deg); }
}

.sparkle-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.sparkle {
  position: absolute;
  font-size: 15px;
  animation: sparkle-float 1.5s ease-out forwards;
  pointer-events: none;
}

@keyframes sparkle-float {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(-56px) scale(1.15); opacity: 0; }
}

/* --------------------------------------------------------------- bubble */
.bubble {
  position: relative;
  width: min(340px, 86vw);
  margin-bottom: 14px;
  padding: 14px 16px 10px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.97), rgba(240, 246, 255, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(251, 114, 153, 0.08), 0 0 0 6px rgba(79, 142, 247, 0.08);
  backdrop-filter: blur(14px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.stage.night .bubble {
  background: linear-gradient(160deg, rgba(38, 49, 72, 0.96), rgba(30, 40, 60, 0.94));
  border-color: rgba(120, 150, 210, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(251, 114, 153, 0.12), 0 0 0 6px rgba(79, 142, 247, 0.12);
}

.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 18px;
  height: 18px;
  background: inherit;
  border-right: 1px solid rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.9);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 4px 0;
}

.stage.night .bubble::after { border-color: rgba(120, 150, 210, 0.35); }

.bubble-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(120, 150, 210, 0.18);
  font-size: 12px;
}

.bubble-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f8ef7;
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.16);
}

.bubble-name { font-weight: 700; font-size: 13px; }
.bubble-status { color: var(--ink-soft); margin-left: auto; }
.stage.night .bubble-status { color: #9fb0cf; }

.bubble-body { min-height: 46px; }

.bubble-line {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bubble-line.strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}

.stage.night .bubble-line { color: #b6c4de; }
.stage.night .bubble-line.strong { color: #eef3ff; }

.bubble-line.link { cursor: pointer; }
.bubble-line.link:hover { color: var(--blue-deep); text-decoration: underline; }

.bubble-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px dashed rgba(120, 150, 210, 0.22);
}

.bubble-meta { font-size: 11px; color: var(--ink-soft); }
.stage.night .bubble-meta { color: #8fa1c0; }

.bubble-tabs { margin-left: auto; display: inline-flex; gap: 4px; }

.tab {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover { background: rgba(79, 142, 247, 0.12); color: var(--blue-deep); }
.tab.active { background: rgba(79, 142, 247, 0.16); color: var(--blue-deep); font-weight: 600; }
.stage.night .tab { color: #9fb0cf; }
.stage.night .tab.active { background: rgba(79, 142, 247, 0.28); color: #cfe0ff; }

/* ---------------------------------------------------------------- panels */
.panel {
  position: fixed;
  z-index: 30;
  right: clamp(12px, 3vw, 26px);
  bottom: clamp(12px, 3vh, 26px);
  width: min(380px, calc(100vw - 24px));
  max-height: min(640px, calc(100vh - 90px));
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  overflow: hidden;
  animation: panel-in 0.22s ease;
}

.stage.night .panel { background: rgba(30, 41, 60, 0.96); color: #e8eefc; }

@keyframes panel-in {
  from { transform: translateY(14px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(120, 150, 210, 0.18);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8eef9;
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.16);
}

.panel-title { flex: 1; min-width: 0; }
.panel-name { font-weight: 700; font-size: 15px; }
.panel-sub { font-size: 11px; color: var(--ink-soft); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.stage.night .panel-sub { color: #9fb0cf; }

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

/* ------------------------------------------------------------------ chat */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.msg { display: flex; gap: 8px; max-width: 100%; }
.msg .msg-avatar { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px; object-fit: cover; background: #e8eef9; }

.msg-bubble {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 4px 12px rgba(31, 42, 68, 0.08);
}

.msg.assistant .msg-bubble {
  background: #ffffff;
  border-top-left-radius: 4px;
  color: var(--ink);
}

.stage.night .msg.assistant .msg-bubble { background: #2a3a56; color: #e8eefc; }

.msg.user { flex-direction: row-reverse; }
.msg.user .msg-bubble {
  background: linear-gradient(135deg, #5f9bff, #4f8ef7);
  color: #fff;
  border-top-right-radius: 4px;
}

.msg-time {
  font-size: 10px;
  color: var(--ink-soft);
  opacity: 0.75;
  margin-top: 4px;
  text-align: right;
}

.stage.night .msg-time { color: #8fa1c0; }

.msg-typing .msg-bubble { display: inline-flex; gap: 4px; align-items: center; }
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b8c6de;
  animation: typing 1s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-3px); opacity: 1; }
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(120, 150, 210, 0.18);
}

.chat-input-row input,
.login-card input,
.field input,
.field select {
  border: 1px solid rgba(120, 150, 210, 0.35);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.stage.night .chat-input-row input,
.stage.night .field input,
.stage.night .field select {
  background: #24324b;
  border-color: rgba(120, 150, 210, 0.4);
  color: #e8eefc;
}

.chat-input-row input:focus,
.login-card input:focus,
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.16); }

.send-btn {
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ff8fb0, #4f8ef7);
  box-shadow: 0 6px 16px rgba(79, 142, 247, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.send-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(79, 142, 247, 0.4); }
.send-btn:disabled { opacity: 0.6; cursor: default; transform: none; }
.send-btn.wide { width: 100%; padding: 12px; }

/* ---------------------------------------------------------------- settings */
.settings-body {
  flex: 1;
  min-height: 0;
  padding: 14px 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; }
.field.row > label { white-space: nowrap; flex: 0 0 auto; }
.field > label { font-weight: 600; color: var(--ink); font-size: 13px; }
.stage.night .field > label { color: #e8eefc; }

.skin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.skin-card {
  position: relative;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 8px 6px 6px;
  background: rgba(79, 142, 247, 0.07);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.skin-card:hover { transform: translateY(-1px); }
.skin-card.active { border-color: var(--blue); background: rgba(79, 142, 247, 0.14); }
.skin-card img { width: 100%; height: 54px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(31, 42, 68, 0.18)); }
.skin-card span { display: block; font-size: 11px; margin-top: 4px; color: var(--ink-soft); }
.skin-card.active span { color: var(--blue-deep); font-weight: 600; }

.field input[type="range"] { padding: 0; }

.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.toggle .knob {
  position: absolute;
  inset: 0;
  background: #c9d6ea;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.toggle .knob::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(31, 42, 68, 0.2);
}
.toggle input:checked + .knob { background: linear-gradient(135deg, #ff8fb0, #4f8ef7); }
.toggle input:checked + .knob::after { transform: translateX(20px); }

.reminder-form { display: flex; gap: 6px; }
.reminder-form input[type="number"] { width: 74px; flex: 0 0 74px; }
.mini-btn {
  border: 1px solid rgba(120, 150, 210, 0.35);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.mini-btn:hover { background: rgba(79, 142, 247, 0.12); transform: translateY(-1px); }
.stage.night .mini-btn { background: #24324b; color: #e8eefc; border-color: rgba(120, 150, 210, 0.4); }

.reminder-list { display: flex; flex-direction: column; gap: 6px; }

.reminder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(251, 114, 153, 0.08);
  color: var(--ink-soft);
}
.stage.night .reminder-item { color: #b6c4de; background: rgba(251, 114, 153, 0.14); }
.reminder-item button {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
}

.status-box { font-size: 12.5px; line-height: 1.7; color: var(--ink-soft); background: rgba(79, 142, 247, 0.07); border-radius: 12px; padding: 10px 12px; }
.stage.night .status-box { color: #b6c4de; background: rgba(79, 142, 247, 0.14); }

.panel-actions { display: flex; gap: 8px; }

/* ----------------------------------------------------------------- login */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 30, 48, 0.35);
  backdrop-filter: blur(10px);
}

.login-card {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 24px 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(10, 20, 40, 0.35);
  animation: panel-in 0.25s ease;
}

.login-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  align-self: center;
  object-fit: cover;
  box-shadow: 0 0 0 4px rgba(79, 142, 247, 0.2);
  margin-bottom: 4px;
}

.login-card h1 { margin: 0; font-size: 20px; text-align: center; }
.login-sub { margin: 0 0 8px; text-align: center; font-size: 12.5px; color: var(--ink-soft); }

.login-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }

.login-error { min-height: 18px; font-size: 12px; color: #e5484d; text-align: center; }

/* ----------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(31, 42, 68, 0.9);
  color: #fff;
  font-size: 12.5px;
  box-shadow: var(--shadow-lg);
  animation: panel-in 0.2s ease;
}

/* ------------------------------------------------------- install / offline */
.offline-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(251, 114, 153, 0.16);
  color: #b3416a;
  font-size: 11.5px;
  font-weight: 600;
}

.stage.night .offline-badge {
  background: rgba(251, 114, 153, 0.24);
  color: #ffc2d6;
}

.install-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.install-tip {
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.qr-box summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--blue-deep);
  margin-top: 2px;
}

.qr-box img {
  display: block;
  width: 150px;
  height: 150px;
  margin: 8px auto 6px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.qr-box .install-tip { display: block; text-align: center; }

.stage.night .install-tip { color: #9fb0cf; }

.mini-btn:disabled {
  opacity: 0.65;
  cursor: default;
  transform: none;
}

/* ------------------------------------------------------ bilibili dm notifier */
.dm-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(120, 150, 210, 0.28);
  background: rgba(79, 142, 247, 0.06);
}

.dm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.dm-state { font-size: 11.5px; color: var(--ink-soft); }
.dm-state.ok { color: #1f9d55; font-weight: 600; }
.dm-state.warn { color: #b3416a; font-weight: 600; }

.dm-hint {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.stage.night .dm-hint,
.stage.night .dm-state { color: #9fb0cf; }

.dm-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dm-grid label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--ink-soft);
}

.dm-grid input {
  width: 62px;
  padding: 6px 8px;
  font-size: 12.5px;
}

.dm-cookies summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--blue-deep);
  user-select: none;
}

.dm-cookies input { margin-top: 6px; }

.dm-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dm-result {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
  word-break: break-word;
}

.chat-attach {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 10px 0;
  background: rgba(255, 255, 255, 0.72);
}

.chat-attach img {
  max-width: 96px;
  max-height: 96px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.msg-image {
  display: block;
  max-width: 180px;
  max-height: 180px;
  border-radius: 12px;
  cursor: zoom-in;
  margin-bottom: 4px;
}

.msg-image-caption {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
  white-space: pre-line;
}

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 2px;
}

.chat-chip {
  border: 1px solid rgba(120, 150, 210, 0.5);
  background: rgba(255, 255, 255, 0.8);
  color: var(--blue-deep);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.chat-chip:hover { background: #fff; }

.push-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.push-row {
  border: 1px solid rgba(120, 150, 210, 0.3);
  border-radius: 12px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.72);
}

.push-row summary { cursor: pointer; }

.push-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 2px 2px;
}

.push-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.push-field span { min-width: 72px; color: var(--ink-soft); }

.push-field input { flex: 1; min-width: 0; }

.push-check { font-size: 12px; color: var(--ink-soft); }

.dm-digest-text {
  white-space: pre-line;
  font-size: 12px;
  line-height: 1.55;
  max-height: 260px;
  overflow: auto;
}

.dm-result a { color: var(--blue-deep); }
.dm-result.warn { color: #b3416a; }
.dm-result.ok { color: #1f9d55; }

.dm-item {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(120, 150, 210, 0.28);
}

.dm-item a { font-weight: 600; }

.dm-meta {
  margin-top: 2px;
  font-size: 11px;
  opacity: 0.75;
}

.dm-quote {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.5;
}

.dm-quote.snark { color: #b3416a; }

.stage.night .dm-result { color: #9fb0cf; }
.stage.night .dm-box { border-color: rgba(120, 150, 210, 0.4); background: rgba(79, 142, 247, 0.12); }

/* --------------------------------------------------------------- responsive */
@media (max-width: 720px) {
  .brand-sub { display: none; }
  .clock { display: none; }
  .bubble { width: calc(100vw - 24px); max-width: 340px; padding: 12px 13px 9px; margin-bottom: 10px; }
  .bubble-line.strong { font-size: 14px; }
  .bubble-line { font-size: 13px; }
  .bubble-tabs .tab { padding: 3px 6px; font-size: 10.5px; }
  .panel { left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 78vh; border-radius: 20px; }
  .pet { left: 0; right: 0; bottom: 3vh; width: 100%; }
  .pet-art { width: calc(min(230px, 60vw) * var(--pet-scale)); }
  .topbar { padding: 10px 12px; gap: 6px; }
  .brand { padding: 6px 10px; }
  .brand-name { font-size: 16px; }
  .icon-btn { width: 34px; height: 34px; font-size: 15px; }
  .icon-btn.ghost { font-size: 12px; padding: 0 6px; }
  .hint { display: none; }
}

@media (max-height: 520px) {
  .bubble { display: none; }
}
